@smarttalks.ai/widget 0.20.0 → 0.22.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.js +29 -20232
- package/lib/index.umd.cjs +28 -28
- package/package.json +1 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(cr){typeof define=="function"&&define.amd?define(cr):cr()})((function(){"use strict";function cr(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=cr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gc(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cr(e))&&(r&&(r+=" "),r+=t);return r}const Fi="-",Fh=e=>{const t=Bh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Fi);return a[0]===""&&a.length!==1&&a.shift(),pc(a,t)||Vh(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&r[s]?[...c,...r[s]]:c}}},pc=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?pc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Fi);return t.validators.find(({validator:s})=>s(i))?.classGroupId},mc=/^\[(.+)\]$/,Vh=e=>{if(mc.test(e)){const t=mc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Bh=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Kh(Object.entries(e.classGroups),n).forEach(([i,s])=>{Vi(s,r,i,t)}),r},Vi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:yc(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(zh(o)){Vi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Vi(s,yc(t,i),n,r)})})},yc=(e,t)=>{let n=e;return t.split(Fi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zh=e=>e.isThemeGetter,Kh=(e,t)=>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,Uh=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const 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)}}},vc="!",jh=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const c=[];let l=0,u=0,d;for(let m=0;m<a.length;m++){let v=a[m];if(l===0){if(v===o&&(r||a.slice(m,m+i)===t)){c.push(a.slice(u,m)),u=m+i;continue}if(v==="/"){d=m;continue}}v==="["?l++:v==="]"&&l--}const f=c.length===0?a:a.substring(u),g=f.startsWith(vc),h=g?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Wh=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},Hh=e=>({cache:Uh(e.cacheSize),parseClassName:jh(e),...Fh(e)}),Yh=/\s+/,qh=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Yh);let a="";for(let c=s.length-1;c>=0;c-=1){const l=s[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(l);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=l+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=l+(a.length>0?" "+a:a);continue}h=!1}const m=Wh(u).join(":"),v=d?m+vc:m,w=v+p;if(i.includes(w))continue;i.push(w);const x=o(p,h);for(let b=0;b<x.length;++b){const C=x[b];i.push(v+C)}a=l+(a.length>0?" "+a:a)}return a};function Gh(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=wc(t))&&(r&&(r+=" "),r+=n);return r}const wc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=wc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Xh(e,...t){let n,r,o,i=s;function s(c){const l=t.reduce((u,d)=>d(u),e());return n=Hh(l),r=n.cache.get,o=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=qh(c,n);return o(c,u),u}return function(){return i(Gh.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},bc=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zh=/^\d+\/\d+$/,Jh=new Set(["px","full","screen"]),Qh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eg=/\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$/,tg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ng=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>On(e)||Jh.has(e)||Zh.test(e),Kt=e=>Tn(e,"length",dg),On=e=>!!e&&!Number.isNaN(Number(e)),Bi=e=>Tn(e,"number",On),lr=e=>!!e&&Number.isInteger(Number(e)),og=e=>e.endsWith("%")&&On(e.slice(0,-1)),q=e=>bc.test(e),Ut=e=>Qh.test(e),ig=new Set(["length","size","percentage"]),sg=e=>Tn(e,ig,xc),ag=e=>Tn(e,"position",xc),cg=new Set(["image","url"]),lg=e=>Tn(e,cg,hg),ug=e=>Tn(e,"",fg),ur=()=>!0,Tn=(e,t,n)=>{const r=bc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},dg=e=>eg.test(e)&&!tg.test(e),xc=()=>!1,fg=e=>ng.test(e),hg=e=>rg.test(e),gg=Xh(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),c=ue("contrast"),l=ue("grayscale"),u=ue("hueRotate"),d=ue("invert"),f=ue("gap"),g=ue("gradientColorStops"),h=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),v=ue("opacity"),w=ue("padding"),x=ue("saturate"),b=ue("scale"),C=ue("sepia"),E=ue("skew"),T=ue("space"),D=ue("translate"),S=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",q,t],O=()=>[q,t],V=()=>["",St,Kt],K=()=>["auto",On,q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",q],Xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Re=()=>[On,q];return{cacheSize:500,separator:":",theme:{colors:[ur],spacing:[St,Kt],blur:["none","",Ut,q],brightness:Re(),borderColor:[e],borderRadius:["none","","full",Ut,q],borderSpacing:O(),borderWidth:V(),contrast:Re(),grayscale:G(),hueRotate:Re(),invert:G(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[og,Kt],inset:R(),margin:R(),opacity:Re(),padding:O(),saturate:Re(),scale:Re(),sepia:G(),skew:Re(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Ut]}],"break-after":[{"break-after":Xe()}],"break-before":[{"break-before":Xe()}],"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:[...Y(),q]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",lr,q]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",lr,q]}],"grid-cols":[{"grid-cols":[ur]}],"col-start-end":[{col:["auto",{span:["full",lr,q]},q]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[ur]}],"row-start-end":[{row:["auto",{span:[lr,q]},q]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Ut]},Ut]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ut,Kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bi]}],"font-family":[{font:[ur]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",q]}],"line-clamp":[{"line-clamp":["none",On,Bi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",St,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",St,Kt]}],"underline-offset":[{"underline-offset":["auto",St,q]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],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",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),ag]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[v]}],"border-style":[{border:[...F(),"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":[v]}],"divide-style":[{divide:F()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...F()]}],"outline-offset":[{"outline-offset":[St,q]}],"outline-w":[{outline:[St,Kt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[St,Kt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ut,ug]}],"shadow-color":[{shadow:[ur]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ut,q]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",q]}],duration:[{duration:Re()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:Re()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[lr,q]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],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",q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[St,Kt,Bi]}],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-s","border-color-e","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"]}}});function jt(...e){return gg(gc(e))}function pg(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",Qr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Qr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Qr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Qr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Qr(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,c=0,l=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),l=(i+o)/2,c=s==0?0:s/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),a+","+c+"%,"+l+"%"}function mg(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 yg(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 dr(){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 vg={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart",attachFile:"Attach a file",uploading:"Uploading...",uploadFailed:"Upload failed. Tap to retry.",fileTooLarge:"File is too large.",fileTypeNotAllowed:"This file type is not allowed.",dropToUpload:"Drop files to attach"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar",attachFile:"Anexar um arquivo",uploading:"Enviando...",uploadFailed:"Falha no envio. Toque para tentar novamente.",fileTooLarge:"O arquivo é muito grande.",fileTypeNotAllowed:"Este tipo de arquivo não é permitido.",dropToUpload:"Solte os arquivos para anexar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar",attachFile:"Adjuntar un archivo",uploading:"Subiendo...",uploadFailed:"Error al subir. Toca para reintentar.",fileTooLarge:"El archivo es demasiado grande.",fileTypeNotAllowed:"Este tipo de archivo no está permitido.",dropToUpload:"Suelta los archivos para adjuntar"}};function Oe(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"),vg[n][e]}const Et="https://heimdall.smarttalks.ai/api",wg="wss://heimdall.smarttalks.ai",Sc="smarttalkswidget";function ge(e,...t){window.postMessage({from:Sc,command:e,args:t})}function ye(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===Sc&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function bg(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ge("registerContactData",e)},registerMetadata:e=>{ge("registerMetadata",e)},open:e=>{ge("open"),e&&ge("setInput",e)},close:()=>{ge("close")},toggle:()=>{ge("toggle")},toggleFullscreen:()=>{ge("toggleFullscreen")},reset:()=>{ge("reset")},onOpen:e=>{ye("onOpen",e)},onClose:e=>{ye("onClose",e)},onToggle:e=>{ye("onToggle",e)},onReset:e=>{ye("onReset",e)},onInput:e=>{ye("onInput",e)},onAnswer:e=>{ye("onAnswer",e)},onLoad:e=>{ye("onLoad",e)}})}function Ec(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function Pc(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 xg(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Oc(o.value)&&!Cg(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 Sg(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Oc(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=kg(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function Eg(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function Pg(e,t){const n=xg(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?kc(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&Cc(e,i.attribute,i.value,!!i.parse),Object.defineProperty(e,o,{get(){return i.value},set(c){const l=i.value;i.value=c,i.reflect&&Cc(this,i.attribute,i.value,!!i.parse);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](o,c,l)},enumerable:!0,configurable:!0})}),n}function kc(e){if(e)try{return JSON.parse(e)}catch{return e}}function Cc(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 kg(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Oc(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Cg(e){return Object.prototype.toString.call(e)==="[object Function]"}function Og(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let zi;function Tg(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=Pg(this,t);const o=Eg(this.props),i=this.Component,s=zi;try{zi=this,this.__initialized=!0,Og(i)?new i(o,{element:this}):i(o,{element:this})}finally{zi=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?kc(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 Ag(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Tg(r,Sg(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const $g=!1,Dg=(e,t)=>e===t,Me=Symbol("solid-proxy"),Tc=typeof Proxy=="function",fr=Symbol("solid-track"),eo={equals:Dg};let Ac=_c;const Pt=1,to=2,$c={owned:null,cleanups:null,context:null,owner:null},Ki={};var ne=null;let Ui=null,Rg=null,se=null,be=null,kt=null,no=0;function Je(e,t){const n=se,r=ne,o=e.length===0,i=t===void 0?r:t,s=o?$c:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>re(()=>hr(s)));ne=s,se=null;try{return Ct(a,!0)}finally{se=n,ne=r}}function L(e,t){t=t?Object.assign({},eo,t):eo;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Ic(n,o));return[Mc.bind(n),r]}function Dc(e,t,n){const r=ro(e,t,!0,Pt);An(r)}function pe(e,t,n){const r=ro(e,t,!1,Pt);An(r)}function z(e,t,n){Ac=Vg;const r=ro(e,t,!1,Pt);(!n||!n.render)&&(r.user=!0),kt?kt.push(r):An(r)}function _(e,t,n){n=n?Object.assign({},eo,n):eo;const r=ro(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,An(r),Mc.bind(r)}function Mg(e){return e&&typeof e=="object"&&"then"in e}function Ig(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Ki,c=!1,l="initialValue"in i,u=typeof r=="function"&&_(r);const d=new Set,[f,g]=(i.storage||L)(i.initialValue),[h,p]=L(void 0),[m,v]=L(void 0,{equals:!1}),[w,x]=L(l?"ready":"unresolved");function b(S,P,R,O){return s===S&&(s=null,O!==void 0&&(l=!0),(S===a||P===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(O,{value:P})),a=Ki,C(P,R)),P}function C(S,P){Ct(()=>{P===void 0&&g(()=>S),x(P!==void 0?"errored":l?"ready":"unresolved"),p(P);for(const R of d.keys())R.decrement();d.clear()},!1)}function E(){const S=Lg,P=f(),R=h();if(R!==void 0&&!s)throw R;return se&&se.user,P}function T(S=!0){if(S!==!1&&c)return;c=!1;const P=u?u():r;if(P==null||P===!1){b(s,re(f));return}let R;const O=a!==Ki?a:re(()=>{try{return o(P,{value:f(),refetching:S})}catch(V){R=V}});if(R!==void 0){b(s,void 0,so(R),P);return}else if(!Mg(O))return b(s,O,void 0,P),O;return s=O,"v"in O?(O.s===1?b(s,O.v,void 0,P):b(s,void 0,so(O.v),P),O):(c=!0,queueMicrotask(()=>c=!1),Ct(()=>{x(l?"refreshing":"pending"),v()},!1),O.then(V=>b(O,V,void 0,P),V=>b(O,void 0,so(V),P)))}Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>h()},loading:{get(){const S=w();return S==="pending"||S==="refreshing"}},latest:{get(){if(!l)return E();const S=h();if(S&&!s)throw S;return f()}}});let D=ne;return u?Dc(()=>(D=ne,T(!1))):T(!1),[E,{refetch:S=>Rc(D,()=>T(S)),mutate:g}]}function Qe(e){return Ct(e,!1)}function re(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function dn(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 l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const c=re(()=>t(a,o,s));return o=a,c}}function Wt(e){z(()=>re(e))}function H(e){return ne===null||(ne.cleanups===null?ne.cleanups=[e]:ne.cleanups.push(e)),e}function ji(){return se}function _g(){return ne}function Rc(e,t){const n=ne,r=se;ne=e,se=null;try{return Ct(t,!0)}catch(o){Hi(o)}finally{ne=n,se=r}}function Se(e,t){const n=Symbol("context");return{id:n,Provider:Bg(n),defaultValue:e}}function Te(e){let t;return ne&&ne.context&&(t=ne.context[e.id])!==void 0?t:e.defaultValue}function Wi(e){const t=_(e),n=_(()=>Yi(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Lg;function Mc(){if(this.sources&&this.state)if(this.state===Pt)An(this);else{const e=be;be=null,Ct(()=>io(this),!1),be=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function Ic(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ct(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Ui&&Ui.running;s&&Ui.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?be.push(i):kt.push(i),i.observers&&Lc(i)),s||(i.state=Pt)}if(be.length>1e6)throw be=[],new Error},!1)),t}function An(e){if(!e.fn)return;hr(e);const t=no;Ng(e,e.value,t)}function Ng(e,t,n){let r;const o=ne,i=se;se=ne=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Pt,e.owned&&e.owned.forEach(hr),e.owned=null),e.updatedAt=n+1,Hi(s)}finally{se=i,ne=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ic(e,r):e.value=r,e.updatedAt=n)}function ro(e,t,n,r=Pt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ne,context:ne?ne.context:null,pure:n};return ne===null||ne!==$c&&(ne.owned?ne.owned.push(i):ne.owned=[i]),i}function oo(e){if(e.state===0)return;if(e.state===to)return io(e);if(e.suspense&&re(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<no);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Pt)An(e);else if(e.state===to){const r=be;be=null,Ct(()=>io(e,t[0]),!1),be=r}}function Ct(e,t){if(be)return e();let n=!1;t||(be=[]),kt?n=!0:kt=[],no++;try{const r=e();return Fg(n),r}catch(r){n||(kt=null),be=null,Hi(r)}}function Fg(e){if(be&&(_c(be),be=null),e)return;const t=kt;kt=null,t.length&&Ct(()=>Ac(t),!1)}function _c(e){for(let t=0;t<e.length;t++)oo(e[t])}function Vg(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:oo(r)}for(t=0;t<n;t++)oo(e[t])}function io(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===Pt?r!==t&&(!r.updatedAt||r.updatedAt<no)&&oo(r):o===to&&io(r,t)}}}function Lc(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=to,n.pure?be.push(n):kt.push(n),n.observers&&Lc(n))}}function hr(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.tOwned){for(t=e.tOwned.length-1;t>=0;t--)hr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)hr(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 so(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Hi(e,t=ne){throw so(e)}function Yi(e){if(typeof e=="function"&&!e.length)return Yi(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Yi(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function Bg(e,t){return function(r){let o;return pe(()=>o=re(()=>(ne.context={...ne.context,[e]:r.value},Wi(()=>r.children))),void 0),o}}const qi=Symbol("fallback");function ao(e){for(let t=0;t<e.length;t++)e[t]()}function zg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return H(()=>ao(i)),()=>{let c=e()||[],l=c.length,u,d;return c[fr],re(()=>{let g,h,p,m,v,w,x,b,C;if(l===0)s!==0&&(ao(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[qi],o[0]=Je(E=>(i[0]=E,n.fallback())),s=1);else if(s===0){for(o=new Array(l),d=0;d<l;d++)r[d]=c[d],o[d]=Je(f);s=l}else{for(p=new Array(l),m=new Array(l),a&&(v=new Array(l)),w=0,x=Math.min(s,l);w<x&&r[w]===c[w];w++);for(x=s-1,b=l-1;x>=w&&b>=w&&r[x]===c[b];x--,b--)p[b]=o[x],m[b]=i[x],a&&(v[b]=a[x]);for(g=new Map,h=new Array(b+1),d=b;d>=w;d--)C=c[d],u=g.get(C),h[d]=u===void 0?-1:u,g.set(C,d);for(u=w;u<=x;u++)C=r[u],d=g.get(C),d!==void 0&&d!==-1?(p[d]=o[u],m[d]=i[u],a&&(v[d]=a[u]),d=h[d],g.set(C,d)):i[u]();for(d=w;d<l;d++)d in p?(o[d]=p[d],i[d]=m[d],a&&(a[d]=v[d],a[d](d))):o[d]=Je(f);o=o.slice(0,s=l),r=c.slice(0)}return o});function f(g){if(i[d]=g,a){const[h,p]=L(d);return a[d]=p,t(c[d],h)}return t(c[d])}}}function Kg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,c;return H(()=>ao(i)),()=>{const l=e()||[],u=l.length;return l[fr],re(()=>{if(u===0)return a!==0&&(ao(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[qi],o[0]=Je(f=>(i[0]=f,n.fallback())),a=1),o;for(r[0]===qi&&(i[0](),i=[],r=[],o=[],a=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?s[c](()=>l[c]):c>=r.length&&(o[c]=Je(d));for(;c<r.length;c++)i[c]();return a=s.length=i.length=u,r=l.slice(0),o=o.slice(0,a)});function d(f){i[c]=f;const[g,h]=L(l[c]);return s[c]=h,t(g,c)}}}function y(e,t){return re(()=>e(t||{}))}function co(){return!0}const Gi={get(e,t,n){return t===Me?n:e.get(t)},has(e,t){return t===Me?!0:e.has(t)},set:co,deleteProperty:co,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:co,deleteProperty:co}},ownKeys(e){return e.keys()}};function Xi(e){return(e=typeof e=="function"?e():e)?e:{}}function Ug(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function B(...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,_(a)):a}if(Tc&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const c=Xi(e[a])[s];if(c!==void 0)return c}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Xi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Xi(e[a])));return[...new Set(s)]}},Gi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let l=c.length-1;l>=0;l--){const u=c[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:Ug.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],c=r[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function ee(e,...t){const n=t.length;if(Tc&&Me in e){const o=n>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)}},Gi));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},Gi)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let c=0;c<t.length;c++)if(t[c].includes(o)){i=c;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let jg=0;function Ke(){return`cl-${jg++}`}const Nc=e=>`Stale read from <${e}>.`;function Ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(zg(()=>e.each,e.children,t||void 0))}function Fc(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _(Kg(()=>e.each,e.children,t||void 0))}function Z(e){const t=e.keyed,n=_(()=>e.when,void 0,void 0),r=t?n:_(n,void 0,{equals:(o,i)=>!o==!i});return _(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?re(()=>i(t?o:()=>{if(!re(r))throw Nc("Show");return n()})):i}return e.fallback},void 0,void 0)}function Vc(e){const t=Wi(()=>e.children),n=_(()=>{const r=t(),o=Array.isArray(r)?r:[r];let i=()=>{};for(let s=0;s<o.length;s++){const a=s,c=o[s],l=i,u=_(()=>l()?void 0:c.when,void 0,void 0),d=c.keyed?u:_(u,void 0,{equals:(f,g)=>!f==!g});i=()=>l()||(d()?[a,u,c]:void 0)}return i});return _(()=>{const r=n()();if(!r)return e.fallback;const[o,i,s]=r,a=s.children;return typeof a=="function"&&a.length>0?re(()=>a(s.keyed?i():()=>{if(re(n)()?.[0]!==o)throw Nc("Match");return i()})):a},void 0,void 0)}function gr(e){return e}const Wg=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Hg=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Wg]),Yg=new Set(["innerHTML","textContent","innerText","children"]),qg=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Gg=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Xg(e,t){const n=Gg[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Zg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Jg=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","feDropShadow","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"]),Qg={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Yt=e=>_(()=>e());function ep(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,c=t[o-1].nextSibling,l=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]:c;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!l||!l.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(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++)}const u=l.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,f=1,g;for(;++d<o&&d<i&&!((g=l.get(t[d]))==null||g!==u+f);)f++;if(f>u-a){const h=t[s];for(;a<u;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Bc="_$DX_DELEGATE";function U(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function zc(e,t=window.document){const n=t[Bc]||(t[Bc]=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,sp))}}function me(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function tp(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function np(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function qt(e,t){t==null?e.removeAttribute("class"):e.className=t}function lo(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,typeof n!="function"&&n)}function rp(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]||(Kc(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Kc(e,a,!0),n[a]=c)}return n}function uo(e,t,n){if(!t)return n?me(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 fn(e,t={},n,r){const o={};return r||pe(()=>o.children=mr(e,t.children,o.children)),pe(()=>typeof t.ref=="function"&&pr(t.ref,e)),pe(()=>op(e,t,n,!0,o,!0)),o}function pr(e,t,n){return re(()=>e(t,n))}function N(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return mr(e,t,r,n);pe(o=>mr(e,t(),o,n),r)}function op(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Uc(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Uc(e,s,a,o[s],n,i,t)}}function ip(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Kc(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 Uc(e,t,n,r,o,i,s){let a,c,l,u,d;if(t==="style")return uo(e,n,r);if(t==="classList")return rp(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),g=Zg.has(f);if(!g&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(f,h)}(g||n)&&(lo(e,f,n,g),g&&zc([f]))}else if(t.slice(0,5)==="attr:")me(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")np(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Yg.has(t))||!o&&((u=Xg(t,e.tagName))||(c=Hg.has(t)))||(a=e.nodeName.includes("-")||"is"in s))d&&(t=t.slice(5),c=!0),t==="class"||t==="className"?qt(e,n):a&&!c&&!l?e[ip(t)]=n:e[u||t]=n;else{const f=o&&t.indexOf(":")>-1&&Qg[t.split(":")[0]];f?tp(e,f,t,n):me(e,qg[t]||t,n)}return n}function sp(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),s=()=>{const c=t[n];if(c&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function mr(e,t,n,r,o){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(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=$n(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=$n(e,n,r);else{if(i==="function")return pe(()=>{let a=t();for(;typeof a=="function";)a=a();n=mr(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Zi(a,t,n,o))return pe(()=>n=mr(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=$n(e,n,r),s)return n}else c?n.length===0?jc(e,a,r):ep(e,n,a):(n&&$n(e),jc(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=$n(e,n,r,t);$n(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Zi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zi(e,a,c)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=Zi(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const u=String(a);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return o}function jc(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function $n(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 c=a.parentNode===e;!i&&!s?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}const ap=!1,cp="http://www.w3.org/2000/svg";function Wc(e,t=!1,n=void 0){return t?document.createElementNS(cp,e):document.createElement(e,{is:n})}function Hc(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=_g();let i;return z(()=>{i||(i=Rc(o,()=>_(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,c]=L(!1),l=()=>c(!0);Je(u=>N(s,()=>a()?u():i(),null)),H(l)}else{const a=Wc(e.isSVG?"g":"div",e.isSVG),c=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),N(c,i),s.appendChild(a),e.ref&&e.ref(a),H(()=>s.removeChild(a))}},void 0,{render:!0}),n}function lp(e,t){const n=_(e);return _(()=>{const r=n();switch(typeof r){case"function":return re(()=>r(t));case"string":const o=Jg.has(r),i=Wc(r,o,re(()=>t.is));return fn(i,t,o),i}})}function yr(e){const[,t]=ee(e,["component"]);return lp(()=>e.component,t)}function up(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=L(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(s){i(()=>s)}})}return n}function dp(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 fp(e){return(t,n)=>{const{element:r}=n;return Je(o=>{const i=up(t);r.addPropertyChangedCallback((a,c)=>i[a]=c),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return N(r.renderRoot,s)},dp(r))}}function hp(e,t,n){return arguments.length===2&&(n=t,t={}),Ag(e,t)(fp(n))}const gp='*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,: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;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([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]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.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-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.right-0\\.5{right:2px}.top-0{top:0}.top-0\\.5{top:2px}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.m-3{margin:12px}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-7{width:28px;height:28px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.h-10{height:40px}.h-11{height:44px}.h-16{height:64px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.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-0{min-height:0}.min-h-\\[36px\\]{min-height:36px}.w-11\\/12{width:91.666667%}.w-16{width:64px}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-9{width:36px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80,.max-w-\\[320px\\]{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.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))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.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\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * 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-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.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-2{border-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-background\\/85{background-color:hsl(var(--background) / .85)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\\/70{background-color:hsl(var(--destructive) / .7)}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.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, 1))}.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, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.pb-2{padding-bottom:8px}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-left{text-align:left}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.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}.leading-tight{line-height:1.25}.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, 1))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.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, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-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))}.filter{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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@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}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--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: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media(max-width:640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-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, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.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-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.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, 1))}.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\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\: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))}',[Yc,Ji]=L(!1),qc=[],pp=e=>qc.push(e),Gc=()=>{qc.forEach(e=>e())},mp=()=>{const e=!Yc();Ji(e),ge("onToggle"),ge(e?"onOpen":"onClose"),Gc()},yp=()=>{Ji(!1),ge("onClose")},vp=()=>{Ji(!0),ge("onOpen"),Gc()},Xc=()=>({bubble:Yc,show:vp,hide:yp,toggle:mp,onOpen:pp}),fo=Symbol("store-raw"),hn=Symbol("store-node"),ct=Symbol("store-has"),Zc=Symbol("store-self");function Jc(e){let t=e[Me];if(!t&&(Object.defineProperty(e,Me,{value:t=new Proxy(e,xp)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const c=n[s];i&&c==="constructor"||r[c].get&&Object.defineProperty(e,c,{configurable:!0,enumerable:r[c].enumerable,get:r[c].get.bind(t)})}}return t}function Dn(e){let t;return e!=null&&typeof e=="object"&&(e[Me]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[fo])return n;if(!Dn(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=Rn(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 c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(o=e[i],(r=Rn(o,t))!==o&&(e[i]=r))}return e}function ho(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function vr(e,t,n){if(e[t])return e[t];const[r,o]=L(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function wp(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Me||t===hn||(delete n.value,delete n.writable,n.get=()=>e[Me][t]),n}function Qc(e){ji()&&vr(ho(e,hn),Zc)()}function bp(e){return Qc(e),Reflect.ownKeys(e)}const xp={get(e,t,n){if(t===fo)return e;if(t===Me)return n;if(t===fr)return Qc(e),n;const r=ho(e,hn),o=r[t];let i=o?o():e[t];if(t===hn||t===ct||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);ji()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=vr(r,t,i)())}return Dn(i)?Jc(i):i},has(e,t){return t===fo||t===Me||t===fr||t===hn||t===ct||t==="__proto__"?!0:(ji()&&vr(ho(e,ct),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:bp,getOwnPropertyDescriptor:wp};function Mn(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[ct]&&e[ct][t]&&o!==void 0&&e[ct][t].$()):(e[t]=n,e[ct]&&e[ct][t]&&o===void 0&&e[ct][t].$());let s=ho(e,hn),a;if((a=vr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=vr(s,"length",i))&&a.$(e.length)}(a=s[Zc])&&a.$()}function el(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];tl(o)||Mn(e,o,t[o])}}function tl(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function Sp(e,t){if(typeof t=="function"&&(t=t(e)),t=Rn(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&&Mn(e,n,o)}Mn(e,"length",r)}else el(e,t)}function wr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&tl(r)))return;if(Array.isArray(r)){for(let c=0;c<r.length;c++)wr(e,[r[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&wr(e,[c].concat(t),n);return}else if(a&&s==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=r;for(let d=c;d<=l;d+=u)wr(e,[d].concat(t),n);return}else if(t.length>1){wr(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=Rn(i),r===void 0||Dn(o)&&Dn(i)&&!Array.isArray(i)?el(o,i):Mn(e,r,i))}function nl(...[e,t]){const n=Rn(e||{}),r=Array.isArray(n),o=Jc(n);function i(...s){Qe(()=>{r&&s.length===1?Sp(n,s[0]):wr(n,s)})}return[o,i]}const go=new WeakMap,rl={get(e,t){if(t===fo)return e;const n=e[t];if(t===Me||t===fr||t===hn||t===ct||t==="__proto__")return n;let r;return Dn(n)?go.get(n)||(go.set(n,r=new Proxy(n,rl)),r):n},set(e,t,n){return Mn(e,t,Rn(n)),!0},deleteProperty(e,t){return Mn(e,t,void 0,!0),!0}};function ol(e){return t=>{if(Dn(t)){let n;(n=go.get(t))||go.set(t,n=new Proxy(t,rl)),e(n)}return t}}function Qi(e,t,n){return Je(()=>{const r=Pc(e),[o,i]=nl(r?JSON.parse(r):t);return z(()=>Ec(e,JSON.stringify(o),n)),[o,i]})}function Ep(e,t,n){return Je(()=>{const r=Pc(e),[o,i]=L(r?JSON.parse(r):t);return z(()=>Ec(e,JSON.stringify(o()),n)),[o,i]})}const[XC,ZC]=Ep("smarttalks-widget-lang","en");function Pp(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 kp(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 po={};function Cp(e){for(const[t,n]of Object.entries(e))n===null?po[t]=null:po[t]=n;return{...po}}function Op(){const e=Object.entries(po).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function Tp(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,c)=>c.toUpperCase());n[s]=i}}return n}function es(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...Tp(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=Op();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const Ap=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Et}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Pp(i);if(i.type==="entity")return kp(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 ye("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Et}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),ye("registerMetadata",s=>{!s||!Object.keys(s).length||(Cp(s),fetch(`${Et}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[il,$p]=L(""),[gn]=Je(()=>Ig(il,Ap)),Dp=()=>{if(gn()?.type==="chat")return gn()},Rp=()=>{if(gn()?.type==="form")return gn()},br=()=>{const e=gn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Je(()=>z(()=>{const e=gn();pg(e),e&&(ge("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const he=()=>({widgetId:il,setWidgetId:$p,widget:gn,chatWidget:Dp,formWidget:Rp,getSessionId:br}),sl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,al=gc,Mp=(e,t)=>n=>{var r;if(t?.variants==null)return al(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const u=n?.[l],d=i?.[l];if(u===null)return null;const f=sl(u)||sl(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...g}=u;return Object.entries(g).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...l,d,f]:l},[]);return al(e,s,c,n?.class,n?.className)};var Ip=U("<button>");const _p=Mp("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"}}),Ue=e=>{const[,t]=ee(e,["variant","size","class"]);return(()=>{var n=Ip();return fn(n,B({get class(){return jt(_p({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var Lp=U('<img alt="widget logo">');const cl=e=>{const[,t]=ee(e,["class","src"]);return(()=>{var n=Lp();return fn(n,B({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return jt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Np=U('<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 Fp=()=>{const{chatWidget:e}=he(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=Np(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return N(r,y(cl,{get src(){return e()?.avatar}}),o),N(i,t),N(s,n),r})()};var Vp=U("<svg stroke-width=0>");function Ee(e,t){const n=B(e.a,t),[r,o]=ee(n,["src"]),[i,s]=L(""),a=_(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return z(()=>s(a())),H(()=>{s("")}),(()=>{var c=Vp();return fn(c,B({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),N(c,()=>ap),c})()}function Bp(e){return Ee({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 zp(e){return Ee({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 ll(e){return Ee({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 Kp(e){return Ee({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)}const ts={equals:!1};function ul(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Up(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const I=e=>typeof e=="function"&&!e.length?e():e,dl=e=>Array.isArray(e)?e:e?[e]:[];function jp(e,...t){return typeof e=="function"?e(...t):e}const Wp=H;function Hp(e,t,n,r){return e.addEventListener(t,n,r),Wp(e.removeEventListener.bind(e,t,n,r))}function Yp(e,t,n,r){const o=()=>{dl(I(e)).forEach(i=>{i&&dl(I(t)).forEach(s=>Hp(i,s,n,r))})};typeof e=="function"?z(o):pe(o)}function mo(){return!0}const qp={get(e,t,n){return t===Me?n:e.get(t)},has(e,t){return e.has(t)},set:mo,deleteProperty:mo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:mo,deleteProperty:mo}},ownKeys(e){return e.keys()}},Gp=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function fl(e){const t={};let n;for(;n=Gp.exec(e);)t[n[1]]=n[2];return t}function Xp(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=fl(e)}else typeof t=="string"&&(t=fl(t));return{...e,...t}}const ns=(e,t,n)=>{let r;for(const o of e){const i=I(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Zp(...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?Up:ul,o={};for(const s of n){const a=I(s);for(const c in a)if(c[0]==="o"&&c[1]==="n"&&c[2]){const l=a[c],u=c.toLowerCase(),d=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;d?o[u]?o[u].push(d):o[u]=[d]:delete o[u]}}const i=B(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ns(n,"style",Xp);if(s==="ref"){const a=[];for(const c of n){const l=I(c)[s];typeof l=="function"&&a.push(l)}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"?ns(n,s,(a,c)=>`${a} ${c}`):s==="classList"?ns(n,s,(a,c)=>({...a,...c})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},qp)}function pn(...e){return ul(e)}function Jp(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function rs(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qp(e){return typeof e=="number"}function em(e){return Array.isArray(e)}function In(e){return Object.prototype.toString.call(e)==="[object String]"}function tm(e){return typeof e=="function"}function hl(e){return t=>`${e()}-${t}`}function lt(e,t){return e?e===t||e.contains(t):!1}function xr(e,t=!1){const{activeElement:n}=Ot(e);if(!n?.nodeName)return null;if(gl(n)&&n.contentDocument)return xr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ot(n).getElementById(r);if(o)return o}}return n}function Ot(e){return e?e.ownerDocument||e:document}function gl(e){return e.tagName==="IFRAME"}var pl=(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))(pl||{});function os(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function yo(){return os(/^Mac/i)}function nm(){return os(/^iPhone/i)}function rm(){return os(/^iPad/i)||yo()&&navigator.maxTouchPoints>1}function om(){return nm()||rm()}function im(){return yo()||om()}function Ie(e,t){return t&&(tm(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function je(e){return t=>{for(const n of e)Ie(t,n)}}function sm(e){return yo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ae(e){if(e)if(am())e.focus({preventScroll:!0});else{const t=cm(e);e.focus(),lm(t)}}var vo=null;function am(){if(vo==null){vo=!1;try{document.createElement("div").focus({get preventScroll(){return vo=!0,!0}})}catch{}}return vo}function cm(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 lm(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ml=["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'])"],um=[...ml,'[tabindex]:not([tabindex="-1"]):not([disabled])'],is=`${ml.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,dm=um.join(':not([hidden]):not([tabindex="-1"]),');function yl(e,t){const r=Array.from(e.querySelectorAll(is)).filter(vl);return t&&vl(e)&&r.unshift(e),r.forEach((o,i)=>{if(gl(o)&&o.contentDocument){const s=o.contentDocument.body,a=yl(s,!1);r.splice(i,1,...a)}}),r}function vl(e){return wl(e)&&!fm(e)}function wl(e){return e.matches(is)&&ss(e)}function fm(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function ss(e,t){return e.nodeName!=="#comment"&&hm(e)&&gm(e,t)&&(!e.parentElement||ss(e.parentElement,e))}function hm(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 gm(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function pm(e,t,n){const r=t?.tabbable?dm:is,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&ss(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function bl(e){let t=e;for(;t&&!mm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function mm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ym(){}function vm(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,c=s-1;a<s;c=a++){const[l,u]=t[a],[d,f]=t[c],[,g]=t[c===0?s-1:c-1]||[0,0],h=(u-f)*(n-l)-(l-d)*(r-u);if(f<u){if(r>=f&&r<u){if(h===0)return!0;h>0&&(r===f?r>g&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(h===0)return!0;h<0&&(r===f?r<g&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return o}function ut(e,t){return B(e,t)}var Sr=new Map,xl=new Set;function Sl(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Sr.get(n.target);r||(r=new Set,Sr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Sr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Sr.delete(n.target)),Sr.size===0)){for(const o of xl)o();xl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Sl():document.addEventListener("DOMContentLoaded",Sl));function as(e,t){const n=El(e,t,"left"),r=El(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const c=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>c&&(s+=n+o-c),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function El(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 wm(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=bl(e);for(;e&&o&&e!==n&&o!==n;)as(o,e),e=o,o=bl(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)&&e.scrollIntoView?.({block:"nearest"})}}}var bm={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 cs(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=c=>{if(c==null)return"";const l=e.getKey??"key",u=In(l)?c[l]:l(c);return u!=null?String(u):""},i=c=>{if(c==null)return"";const l=e.getTextValue??"textValue",u=In(l)?c[l]:l(c);return u!=null?String(u):""},s=c=>{if(c==null)return!1;const l=e.getDisabled??"disabled";return(In(l)?c[l]:l(c))??!1},a=c=>{if(c!=null)return In(e.getSectionChildren)?c[e.getSectionChildren]:e.getSectionChildren?.(c)};for(const c of e.dataSource){if(In(c)||Qp(c)){r.push({type:"item",rawValue:c,key:String(c),textValue:String(c),disabled:s(c),level:n,index:t}),t++;continue}if(a(c)!=null){r.push({type:"section",rawValue:c,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(c)??[];if(l.length>0){const u=cs({dataSource:l,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:c,key:o(c),textValue:i(c),disabled:s(c),level:n,index:t}),t++}return r}/*!
|
|
1
|
+
(function(cr){typeof define=="function"&&define.amd?define(cr):cr()})((function(){"use strict";function cr(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=cr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function hl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cr(e))&&(r&&(r+=" "),r+=t);return r}const Vi="-",_h=e=>{const t=Nh(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Vi);return a[0]===""&&a.length!==1&&a.shift(),gl(a,t)||Lh(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},gl=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?gl(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Vi);return t.validators.find(({validator:s})=>s(i))?.classGroupId},pl=/^\[(.+)\]$/,Lh=e=>{if(pl.test(e)){const t=pl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Nh=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Vh(Object.entries(e.classGroups),n).forEach(([i,s])=>{Bi(s,r,i,t)}),r},Bi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ml(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Fh(o)){Bi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Bi(s,ml(t,i),n,r)})})},ml=(e,t)=>{let n=e;return t.split(Vi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fh=e=>e.isThemeGetter,Vh=(e,t)=>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,Bh=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const 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)}}},yl="!",zh=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let m=0;m<a.length;m++){let v=a[m];if(c===0){if(v===o&&(r||a.slice(m,m+i)===t)){l.push(a.slice(u,m)),u=m+i;continue}if(v==="/"){d=m;continue}}v==="["?c++:v==="]"&&c--}const f=l.length===0?a:a.substring(u),g=f.startsWith(yl),h=g?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Kh=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},Uh=e=>({cache:Bh(e.cacheSize),parseClassName:zh(e),..._h(e)}),jh=/\s+/,Wh=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(jh);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=c+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=c+(a.length>0?" "+a:a);continue}h=!1}const m=Kh(u).join(":"),v=d?m+yl:m,w=v+p;if(i.includes(w))continue;i.push(w);const x=o(p,h);for(let b=0;b<x.length;++b){const C=x[b];i.push(v+C)}a=c+(a.length>0?" "+a:a)}return a};function Hh(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vl(t))&&(r&&(r+=" "),r+=n);return r}const vl=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vl(e[r]))&&(n&&(n+=" "),n+=t);return n};function Yh(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Uh(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=Wh(l,n);return o(l,u),u}return function(){return i(Hh.apply(null,arguments))}}const ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},wl=/^\[(?:([a-z-]+):)?(.+)\]$/i,qh=/^\d+\/\d+$/,Gh=new Set(["px","full","screen"]),Xh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zh=/\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$/,Jh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Qh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=e=>On(e)||Gh.has(e)||qh.test(e),Kt=e=>Tn(e,"length",lg),On=e=>!!e&&!Number.isNaN(Number(e)),zi=e=>Tn(e,"number",On),ur=e=>!!e&&Number.isInteger(Number(e)),tg=e=>e.endsWith("%")&&On(e.slice(0,-1)),q=e=>wl.test(e),Ut=e=>Xh.test(e),ng=new Set(["length","size","percentage"]),rg=e=>Tn(e,ng,bl),og=e=>Tn(e,"position",bl),ig=new Set(["image","url"]),sg=e=>Tn(e,ig,ug),ag=e=>Tn(e,"",cg),dr=()=>!0,Tn=(e,t,n)=>{const r=wl.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},lg=e=>Zh.test(e)&&!Jh.test(e),bl=()=>!1,cg=e=>Qh.test(e),ug=e=>eg.test(e),dg=Yh(()=>{const e=ue("colors"),t=ue("spacing"),n=ue("blur"),r=ue("brightness"),o=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),a=ue("borderWidth"),l=ue("contrast"),c=ue("grayscale"),u=ue("hueRotate"),d=ue("invert"),f=ue("gap"),g=ue("gradientColorStops"),h=ue("gradientColorStopPositions"),p=ue("inset"),m=ue("margin"),v=ue("opacity"),w=ue("padding"),x=ue("saturate"),b=ue("scale"),C=ue("sepia"),E=ue("skew"),T=ue("space"),D=ue("translate"),S=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",q,t],O=()=>[q,t],V=()=>["",St,Kt],K=()=>["auto",On,q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",q],Xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Re=()=>[On,q];return{cacheSize:500,separator:":",theme:{colors:[dr],spacing:[St,Kt],blur:["none","",Ut,q],brightness:Re(),borderColor:[e],borderRadius:["none","","full",Ut,q],borderSpacing:O(),borderWidth:V(),contrast:Re(),grayscale:X(),hueRotate:Re(),invert:X(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[tg,Kt],inset:R(),margin:R(),opacity:Re(),padding:O(),saturate:Re(),scale:Re(),sepia:X(),skew:Re(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Ut]}],"break-after":[{"break-after":Xe()}],"break-before":[{"break-before":Xe()}],"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:[...Y(),q]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ur,q]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",ur,q]}],"grid-cols":[{"grid-cols":[dr]}],"col-start-end":[{col:["auto",{span:["full",ur,q]},q]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[dr]}],"row-start-end":[{row:["auto",{span:[ur,q]},q]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Ut]},Ut]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ut,Kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",zi]}],"font-family":[{font:[dr]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",q]}],"line-clamp":[{"line-clamp":["none",On,zi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",St,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",St,Kt]}],"underline-offset":[{"underline-offset":["auto",St,q]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],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",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),og]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",rg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[v]}],"border-style":[{border:[...F(),"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":[v]}],"divide-style":[{divide:F()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...F()]}],"outline-offset":[{"outline-offset":[St,q]}],"outline-w":[{outline:[St,Kt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[St,Kt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ut,ag]}],"shadow-color":[{shadow:[dr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ut,q]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"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":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",q]}],duration:[{duration:Re()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:Re()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ur,q]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],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",q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[St,Kt,zi]}],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-s","border-color-e","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"]}}});function jt(...e){return dg(hl(e))}function fg(e){try{if(!e)return;const n=document.querySelector("smarttalks-widget")||document.querySelector(":root");if(!n)throw new Error("could not find root layer");e.style.primary&&n.style.setProperty("--primary",Qr(e.style.primary)),e.style.primaryForeground&&n.style.setProperty("--primary-foreground",Qr(e.style.primaryForeground)),e.style.background&&n.style.setProperty("--background",Qr(e.style.background)),e.style.foreground&&n.style.setProperty("--foreground",Qr(e.style.foreground))}catch(t){console.error("failed to load widget theme",t)}}function Qr(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 hg(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 gg(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 fr(){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 pg={en:{inputPlaceholder:"Type your message here...",emptyMessages:"No messages yet...",selectOption:"Select an option",send:"Send",restart:"Restart",attachFile:"Attach a file",uploading:"Uploading...",uploadFailed:"Upload failed. Tap to retry.",fileTooLarge:"File is too large.",fileTypeNotAllowed:"This file type is not allowed.",dropToUpload:"Drop files to attach"},pt:{inputPlaceholder:"Escreva sua mensagem aqui...",emptyMessages:"Nenhuma mensagem ainda...",selectOption:"Selecione uma opção",send:"Enviar",restart:"Reiniciar",attachFile:"Anexar um arquivo",uploading:"Enviando...",uploadFailed:"Falha no envio. Toque para tentar novamente.",fileTooLarge:"O arquivo é muito grande.",fileTypeNotAllowed:"Este tipo de arquivo não é permitido.",dropToUpload:"Solte os arquivos para anexar"},es:{inputPlaceholder:"Escribe tu mensaje aqui...",emptyMessages:"No hay mensajes aún...",selectOption:"Seleccione una opción",send:"Enviar",restart:"Reiniciar",attachFile:"Adjuntar un archivo",uploading:"Subiendo...",uploadFailed:"Error al subir. Toca para reintentar.",fileTooLarge:"El archivo es demasiado grande.",fileTypeNotAllowed:"Este tipo de archivo no está permitido.",dropToUpload:"Suelta los archivos para adjuntar"}};function Oe(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"),pg[n][e]}const Et="https://heimdall.smarttalks.ai/api",mg="wss://heimdall.smarttalks.ai",xl="smarttalkswidget";function ge(e,...t){window.postMessage({from:xl,command:e,args:t})}function ye(e,t){window.addEventListener("message",n=>{n.origin===window.location.origin&&n.data?.from===xl&&n.data?.command===e&&(n.stopImmediatePropagation(),console.info("received command:",e),t(...n.data.args||[]))})}function yg(){typeof window<"u"&&(window.SmartTalksWidget={registerContactData:e=>{ge("registerContactData",e)},registerMetadata:e=>{ge("registerMetadata",e)},open:e=>{ge("open"),e&&ge("setInput",e)},close:()=>{ge("close")},toggle:()=>{ge("toggle")},toggleFullscreen:()=>{ge("toggleFullscreen")},reset:()=>{ge("reset")},onOpen:e=>{ye("onOpen",e)},onClose:e=>{ye("onClose",e)},onToggle:e=>{ye("onToggle",e)},onReset:e=>{ye("onReset",e)},onInput:e=>{ye("onInput",e)},onAnswer:e=>{ye("onAnswer",e)},onLoad:e=>{ye("onLoad",e)}})}function Sl(e,t,n=0){localStorage.setItem(e,JSON.stringify({value:t,ttl:new Date().getTime()+n}))}function El(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 vg(e){return Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Object.assign({},o),Cl(o.value)&&!Eg(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 wg(e){return e?Object.keys(e).reduce((n,r)=>{const o=e[r];return n[r]=Cl(o)&&"value"in o?o:{value:o},n[r].attribute||(n[r].attribute=Sg(r)),n[r].parse="parse"in n[r]?n[r].parse:typeof n[r].value!="string",n},{}):{}}function bg(e){return Object.keys(e).reduce((n,r)=>(n[r]=e[r].value,n),{})}function xg(e,t){const n=vg(t);return Object.keys(t).forEach(o=>{const i=n[o],s=e.getAttribute(i.attribute),a=e[o];s!=null&&(i.value=i.parse?Pl(s):s),a!=null&&(i.value=Array.isArray(a)?a.slice(0):a),i.reflect&&kl(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&&kl(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 Pl(e){if(e)try{return JSON.parse(e)}catch{return e}}function kl(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 Sg(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Cl(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function Eg(e){return Object.prototype.toString.call(e)==="[object Function]"}function Pg(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let eo;function kg(){return eo}function Cg(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=xg(this,t);const o=bg(this.props),i=this.Component,s=eo;try{eo=this,this.__initialized=!0,Pg(i)?new i(o,{element:this}):i(o,{element:this})}finally{eo=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?Pl(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 Og(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return s=>{let a=i.get(e);return a?(a.prototype.Component=s,a):(a=Cg(r,wg(t)),a.prototype.Component=s,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const Tg=!1,Ag=(e,t)=>e===t,Me=Symbol("solid-proxy"),Ol=typeof Proxy=="function",hr=Symbol("solid-track"),to={equals:Ag};let Tl=_l;const Pt=1,no=2,Al={owned:null,cleanups:null,context:null,owner:null},Ki={};var ne=null;let Ui=null,$g=null,se=null,be=null,kt=null,ro=0;function Je(e,t){const n=se,r=ne,o=e.length===0,i=t===void 0?r:t,s=o?Al:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ie(()=>gr(s)));ne=s,se=null;try{return Ct(a,!0)}finally{se=n,ne=r}}function _(e,t){t=t?Object.assign({},to,t):to;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Il(n,o));return[Ml.bind(n),r]}function $l(e,t,n){const r=oo(e,t,!0,Pt);An(r)}function pe(e,t,n){const r=oo(e,t,!1,Pt);An(r)}function z(e,t,n){Tl=Ng;const r=oo(e,t,!1,Pt);(!n||!n.render)&&(r.user=!0),kt?kt.push(r):An(r)}function L(e,t,n){n=n?Object.assign({},to,n):to;const r=oo(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,An(r),Ml.bind(r)}function Dg(e){return e&&typeof e=="object"&&"then"in e}function Rg(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=!0,o=e,i=t||{});let s=null,a=Ki,l=!1,c="initialValue"in i,u=typeof r=="function"&&L(r);const d=new Set,[f,g]=(i.storage||_)(i.initialValue),[h,p]=_(void 0),[m,v]=_(void 0,{equals:!1}),[w,x]=_(c?"ready":"unresolved");function b(S,P,R,O){return s===S&&(s=null,O!==void 0&&(c=!0),(S===a||P===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(O,{value:P})),a=Ki,C(P,R)),P}function C(S,P){Ct(()=>{P===void 0&&g(()=>S),x(P!==void 0?"errored":c?"ready":"unresolved"),p(P);for(const R of d.keys())R.decrement();d.clear()},!1)}function E(){const S=Ig,P=f(),R=h();if(R!==void 0&&!s)throw R;return se&&se.user,P}function T(S=!0){if(S!==!1&&l)return;l=!1;const P=u?u():r;if(P==null||P===!1){b(s,ie(f));return}let R;const O=a!==Ki?a:ie(()=>{try{return o(P,{value:f(),refetching:S})}catch(V){R=V}});if(R!==void 0){b(s,void 0,ao(R),P);return}else if(!Dg(O))return b(s,O,void 0,P),O;return s=O,"v"in O?(O.s===1?b(s,O.v,void 0,P):b(s,void 0,ao(O.v),P),O):(l=!0,queueMicrotask(()=>l=!1),Ct(()=>{x(c?"refreshing":"pending"),v()},!1),O.then(V=>b(O,V,void 0,P),V=>b(O,void 0,ao(V),P)))}Object.defineProperties(E,{state:{get:()=>w()},error:{get:()=>h()},loading:{get(){const S=w();return S==="pending"||S==="refreshing"}},latest:{get(){if(!c)return E();const S=h();if(S&&!s)throw S;return f()}}});let D=ne;return u?$l(()=>(D=ne,T(!1))):T(!1),[E,{refetch:S=>Dl(D,()=>T(S)),mutate:g}]}function Qe(e){return Ct(e,!1)}function ie(e){if(se===null)return e();const t=se;se=null;try{return e()}finally{se=t}}function dn(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)return i=!1,s;const l=ie(()=>t(a,o,s));return o=a,l}}function Wt(e){z(()=>ie(e))}function H(e){return ne===null||(ne.cleanups===null?ne.cleanups=[e]:ne.cleanups.push(e)),e}function ji(){return se}function Mg(){return ne}function Dl(e,t){const n=ne,r=se;ne=e,se=null;try{return Ct(t,!0)}catch(o){Wi(o)}finally{ne=n,se=r}}function Se(e,t){const n=Symbol("context");return{id:n,Provider:Fg(n),defaultValue:e}}function Te(e){let t;return ne&&ne.context&&(t=ne.context[e.id])!==void 0?t:e.defaultValue}function Rl(e){const t=L(e),n=L(()=>Hi(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Ig;function Ml(){if(this.sources&&this.state)if(this.state===Pt)An(this);else{const e=be;be=null,Ct(()=>so(this),!1),be=e}if(se){const e=this.observers;if(!e||e[e.length-1]!==se){const t=e?e.length:0;se.sources?(se.sources.push(this),se.sourceSlots.push(t)):(se.sources=[this],se.sourceSlots=[t]),e?(e.push(se),this.observerSlots.push(se.sources.length-1)):(this.observers=[se],this.observerSlots=[se.sources.length-1])}}return this.value}function Il(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ct(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=Ui&&Ui.running;s&&Ui.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?be.push(i):kt.push(i),i.observers&&Ll(i)),s||(i.state=Pt)}if(be.length>1e6)throw be=[],new Error},!1)),t}function An(e){if(!e.fn)return;gr(e);const t=ro;_g(e,e.value,t)}function _g(e,t,n){let r;const o=ne,i=se;se=ne=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Pt,e.owned&&e.owned.forEach(gr),e.owned=null),e.updatedAt=n+1,Wi(s)}finally{se=i,ne=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Il(e,r):e.value=r,e.updatedAt=n)}function oo(e,t,n,r=Pt,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ne,context:ne?ne.context:null,pure:n};return ne===null||ne!==Al&&(ne.owned?ne.owned.push(i):ne.owned=[i]),i}function io(e){if(e.state===0)return;if(e.state===no)return so(e);if(e.suspense&&ie(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ro);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Pt)An(e);else if(e.state===no){const r=be;be=null,Ct(()=>so(e,t[0]),!1),be=r}}function Ct(e,t){if(be)return e();let n=!1;t||(be=[]),kt?n=!0:kt=[],ro++;try{const r=e();return Lg(n),r}catch(r){n||(kt=null),be=null,Wi(r)}}function Lg(e){if(be&&(_l(be),be=null),e)return;const t=kt;kt=null,t.length&&Ct(()=>Tl(t),!1)}function _l(e){for(let t=0;t<e.length;t++)io(e[t])}function Ng(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:io(r)}for(t=0;t<n;t++)io(e[t])}function so(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===Pt?r!==t&&(!r.updatedAt||r.updatedAt<ro)&&io(r):o===no&&so(r,t)}}}function Ll(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=no,n.pure?be.push(n):kt.push(n),n.observers&&Ll(n))}}function gr(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.tOwned){for(t=e.tOwned.length-1;t>=0;t--)gr(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)gr(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 ao(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Wi(e,t=ne){throw ao(e)}function Hi(e){if(typeof e=="function"&&!e.length)return Hi(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Hi(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let o=0;o<r.length;o++)t.push(r[o]);else t.push(r)}return t}return e}function Fg(e,t){return function(r){let o;return pe(()=>o=ie(()=>(ne.context={...ne.context,[e]:r.value},Rl(()=>r.children))),void 0),o}}const Yi=Symbol("fallback");function lo(e){for(let t=0;t<e.length;t++)e[t]()}function Vg(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return H(()=>lo(i)),()=>{let l=e()||[],c=l.length,u,d;return l[hr],ie(()=>{let g,h,p,m,v,w,x,b,C;if(c===0)s!==0&&(lo(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Yi],o[0]=Je(E=>(i[0]=E,n.fallback())),s=1);else if(s===0){for(o=new Array(c),d=0;d<c;d++)r[d]=l[d],o[d]=Je(f);s=c}else{for(p=new Array(c),m=new Array(c),a&&(v=new Array(c)),w=0,x=Math.min(s,c);w<x&&r[w]===l[w];w++);for(x=s-1,b=c-1;x>=w&&b>=w&&r[x]===l[b];x--,b--)p[b]=o[x],m[b]=i[x],a&&(v[b]=a[x]);for(g=new Map,h=new Array(b+1),d=b;d>=w;d--)C=l[d],u=g.get(C),h[d]=u===void 0?-1:u,g.set(C,d);for(u=w;u<=x;u++)C=r[u],d=g.get(C),d!==void 0&&d!==-1?(p[d]=o[u],m[d]=i[u],a&&(v[d]=a[u]),d=h[d],g.set(C,d)):i[u]();for(d=w;d<c;d++)d in p?(o[d]=p[d],i[d]=m[d],a&&(a[d]=v[d],a[d](d))):o[d]=Je(f);o=o.slice(0,s=c),r=l.slice(0)}return o});function f(g){if(i[d]=g,a){const[h,p]=_(d);return a[d]=p,t(l[d],h)}return t(l[d])}}}function Bg(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return H(()=>lo(i)),()=>{const c=e()||[],u=c.length;return c[hr],ie(()=>{if(u===0)return a!==0&&(lo(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Yi],o[0]=Je(f=>(i[0]=f,n.fallback())),a=1),o;for(r[0]===Yi&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=Je(d));for(;l<r.length;l++)i[l]();return a=s.length=i.length=u,r=c.slice(0),o=o.slice(0,a)});function d(f){i[l]=f;const[g,h]=_(c[l]);return s[l]=h,t(g,l)}}}function y(e,t){return ie(()=>e(t||{}))}function co(){return!0}const qi={get(e,t,n){return t===Me?n:e.get(t)},has(e,t){return t===Me?!0:e.has(t)},set:co,deleteProperty:co,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:co,deleteProperty:co}},ownKeys(e){return e.keys()}};function Gi(e){return(e=typeof e=="function"?e():e)?e:{}}function zg(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function B(...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,L(a)):a}if(Ol&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Gi(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Gi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Gi(e[a])));return[...new Set(s)]}},qi);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:zg.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.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 ee(e,...t){const n=t.length;if(Ol&&Me in e){const o=n>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)}},qi));return i.push(new Proxy({get(s){return o.includes(s)?void 0:e[s]},has(s){return o.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.includes(s))}},qi)),i}const r=[];for(let o=0;o<=n;o++)r[o]={};for(const o of Object.getOwnPropertyNames(e)){let i=n;for(let l=0;l<t.length;l++)if(t[l].includes(o)){i=l;break}const s=Object.getOwnPropertyDescriptor(e,o);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?r[i][o]=s.value:Object.defineProperty(r[i],o,s)}return r}let Kg=0;function Ke(){return`cl-${Kg++}`}const Ug=e=>`Stale read from <${e}>.`;function Ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return L(Vg(()=>e.each,e.children,t||void 0))}function Nl(e){const t="fallback"in e&&{fallback:()=>e.fallback};return L(Bg(()=>e.each,e.children,t||void 0))}function G(e){const t=e.keyed,n=L(()=>e.when,void 0,void 0),r=t?n:L(n,void 0,{equals:(o,i)=>!o==!i});return L(()=>{const o=r();if(o){const i=e.children;return typeof i=="function"&&i.length>0?ie(()=>i(t?o:()=>{if(!ie(r))throw Ug("Show");return n()})):i}return e.fallback},void 0,void 0)}const jg=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Wg=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...jg]),Hg=new Set(["innerHTML","textContent","innerText","children"]),Yg=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),qg=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Gg(e,t){const n=qg[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Xg=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Zg=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","feDropShadow","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"]),Jg={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Yt=e=>L(()=>e());function Qg(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,f=1,g;for(;++d<o&&d<i&&!((g=c.get(t[d]))==null||g!==u+f);)f++;if(f>u-a){const h=t[s];for(;a<u;)e.insertBefore(n[a++],h)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Fl="_$DX_DELEGATE";function U(e,t,n,r){let o;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(!0);return s.cloneNode=s,s}function Vl(e,t=window.document){const n=t[Fl]||(t[Fl]=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,ip))}}function me(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function ep(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function tp(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function qt(e,t){t==null?e.removeAttribute("class"):e.className=t}function uo(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,typeof n!="function"&&n)}function np(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]||(Bl(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||(Bl(e,a,!0),n[a]=l)}return n}function fo(e,t,n){if(!t)return n?me(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 fn(e,t={},n,r){const o={};return r||pe(()=>o.children=mr(e,t.children,o.children)),pe(()=>typeof t.ref=="function"&&pr(t.ref,e)),pe(()=>rp(e,t,n,!0,o,!0)),o}function pr(e,t,n){return ie(()=>e(t,n))}function N(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return mr(e,t,r,n);pe(o=>mr(e,t(),o,n),r)}function rp(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=zl(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=zl(e,s,a,o[s],n,i,t)}}function op(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Bl(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 zl(e,t,n,r,o,i,s){let a,l,c,u,d;if(t==="style")return fo(e,n,r);if(t==="classList")return np(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),g=Xg.has(f);if(!g&&r){const h=Array.isArray(r)?r[0]:r;e.removeEventListener(f,h)}(g||n)&&(uo(e,f,n,g),g&&Vl([f]))}else if(t.slice(0,5)==="attr:")me(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")tp(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=Hg.has(t))||!o&&((u=Gg(t,e.tagName))||(l=Wg.has(t)))||(a=e.nodeName.includes("-")||"is"in s))d&&(t=t.slice(5),l=!0),t==="class"||t==="className"?qt(e,n):a&&!l&&!c?e[op(t)]=n:e[u||t]=n;else{const f=o&&t.indexOf(":")>-1&&Jg[t.split(":")[0]];f?ep(e,f,t,n):me(e,Yg[t]||t,n)}return n}function ip(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function mr(e,t,n,r,o){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(i==="number"&&(t=t.toString(),t===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),n=$n(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean")n=$n(e,n,r);else{if(i==="function")return pe(()=>{let a=t();for(;typeof a=="function";)a=a();n=mr(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Xi(a,t,n,o))return pe(()=>n=mr(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=$n(e,n,r),s)return n}else l?n.length===0?Kl(e,a,r):Qg(e,n,a):(n&&$n(e),Kl(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(s)return n=$n(e,n,r,t);$n(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Xi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Xi(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Xi(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 Kl(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function $n(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]}const sp=!1,ap="http://www.w3.org/2000/svg";function Ul(e,t=!1,n=void 0){return t?document.createElementNS(ap,e):document.createElement(e,{is:n})}function jl(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Mg();let i;return z(()=>{i||(i=Dl(o,()=>L(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[a,l]=_(!1),c=()=>l(!0);Je(u=>N(s,()=>a()?u():i(),null)),H(c)}else{const a=Ul(e.isSVG?"g":"div",e.isSVG),l=t&&a.attachShadow?a.attachShadow({mode:"open"}):a;Object.defineProperty(a,"_$host",{get(){return n.parentNode},configurable:!0}),N(l,i),s.appendChild(a),e.ref&&e.ref(a),H(()=>s.removeChild(a))}},void 0,{render:!0}),n}function lp(e,t){const n=L(e);return L(()=>{const r=n();switch(typeof r){case"function":return ie(()=>r(t));case"string":const o=Zg.has(r),i=Ul(r,o,ie(()=>t.is));return fn(i,t,o),i}})}function yr(e){const[,t]=ee(e,["component"]);return lp(()=>e.component,t)}function cp(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 up(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 dp(e){return(t,n)=>{const{element:r}=n;return Je(o=>{const i=cp(t);r.addPropertyChangedCallback((a,l)=>i[a]=l),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const s=e(i,n);return N(r.renderRoot,s)},up(r))}}function fp(e,t,n){return arguments.length===2&&(n=t,t={}),Og(e,t)(dp(n))}const hp='*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,: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;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([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]:where(:not([hidden=until-found])){display:none}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-feature-settings:"rlig" 1,"calt" 1}.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-12{top:-48px}.bottom-0{bottom:0}.bottom-5{bottom:20px}.bottom-\\[-12px\\]{bottom:-12px}.left-0{left:0}.left-1\\/2{left:50%}.left-2{left:8px}.right-0{right:0}.right-0\\.5{right:2px}.top-0{top:0}.top-0\\.5{top:2px}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.z-\\[99999\\]{z-index:99999}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.m-3{margin:12px}.-mx-1{margin-left:-4px;margin-right:-4px}.mx-1{margin-left:4px;margin-right:4px}.mx-\\[-16px\\]{margin-left:-16px;margin-right:-16px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.mb-1{margin-bottom:4px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-24{margin-top:96px}.mt-4{margin-top:16px}.box-border{box-sizing:border-box}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.size-10{width:40px;height:40px}.size-14{width:56px;height:56px}.size-2{width:8px;height:8px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-7{width:28px;height:28px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.h-10{height:40px}.h-11{height:44px}.h-16{height:64px}.h-2{height:8px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[85vh\\]{height:85vh}.h-\\[min\\(85vh\\,700px\\)\\]{height:min(85vh,700px)}.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-0{min-height:0}.min-h-\\[36px\\]{min-height:36px}.w-11\\/12{width:91.666667%}.w-16{width:64px}.w-4{width:16px}.w-5{width:20px}.w-7{width:28px}.w-8{width:32px}.w-9{width:36px}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-\\[calc\\(var\\(--reference-width\\)-\\(12px\\*2\\)\\)\\]{width:calc(var(--reference-width) - (12px * 2))}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[128px\\]{min-width:128px}.max-w-64{max-width:256px}.max-w-80,.max-w-\\[320px\\]{max-width:320px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.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))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;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-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.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\\.5{gap:2px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-3{gap:12px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * 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-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.break-words{overflow-wrap:break-word}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.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-2{border-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.bg-background{background-color:hsl(var(--background))}.bg-background\\/85{background-color:hsl(var(--background) / .85)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\\/70{background-color:hsl(var(--destructive) / .7)}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.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, 1))}.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, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:4px;padding-right:4px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.pb-2{padding-bottom:8px}.pb-\\[max\\(1rem\\,env\\(safe-area-inset-bottom\\)\\)\\]{padding-bottom:max(1rem,env(safe-area-inset-bottom))}.pl-3{padding-left:12px}.pl-8{padding-left:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.text-left{text-align:left}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-\\[12\\.8px\\]{font-size:12.8px}.text-base{font-size:16px}.text-lg{font-size:18px}.text-sm{font-size:14px}.text-xs{font-size:12px}.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}.leading-tight{line-height:1.25}.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, 1))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.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, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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-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))}.filter{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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@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}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:host{font-size:16px;line-height:1.5;-webkit-text-size-adjust:100%;font-family:Inter,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji";box-sizing:border-box}#smarttalks-widget{isolation:isolate;--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: 8px}.st-fullscreen{position:fixed!important;top:env(safe-area-inset-top)!important;left:env(safe-area-inset-left)!important;right:env(safe-area-inset-right)!important;bottom:env(safe-area-inset-bottom)!important;width:100dvw!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important;z-index:2147483647!important}@supports not (height: 100dvh){.st-fullscreen{inset:0!important;width:100vw!important;height:100vh!important}}@media(max-width:640px){.container{padding-left:16px;padding-right:16px}}::-webkit-scrollbar{width:8px;height:6.4px}::-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, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-base::file-selector-button{font-size:16px}.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-green-400:hover{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.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, 1))}.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\\:bottom-5{bottom:20px}.md\\:block{display:block}.md\\:h-\\[min\\(100vh\\,500px\\)\\]{height:min(100vh,500px)}.md\\:max-h-\\[90\\%\\]{max-height:90%}.md\\:w-\\[400px\\]{width:400px}.md\\:w-\\[min\\(100vw\\,425px\\)\\]{width:min(100vw,425px)}.md\\:max-w-\\[90\\%\\]{max-width:90%}.md\\:select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.md\\:rounded-xl{border-radius:calc(var(--radius) + 4px)}.md\\:text-lg{font-size:18px}.md\\:text-sm{font-size:14px}.md\\:file\\:text-sm::file-selector-button{font-size:14px}}.\\[\\&\\: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))}',[Wl,Zi]=_(!1),Hl=[],gp=e=>Hl.push(e),Yl=()=>{Hl.forEach(e=>e())},pp=()=>{const e=!Wl();Zi(e),ge("onToggle"),ge(e?"onOpen":"onClose"),Yl()},mp=()=>{Zi(!1),ge("onClose")},yp=()=>{Zi(!0),ge("onOpen"),Yl()},ql=()=>({bubble:Wl,show:yp,hide:mp,toggle:pp,onOpen:gp}),ho=Symbol("store-raw"),hn=Symbol("store-node"),lt=Symbol("store-has"),Gl=Symbol("store-self");function Xl(e){let t=e[Me];if(!t&&(Object.defineProperty(e,Me,{value:t=new Proxy(e,bp)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),i=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(i){const s=Object.getOwnPropertyDescriptors(o);n.push(...Object.keys(s)),Object.assign(r,s)}for(let s=0,a=n.length;s<a;s++){const l=n[s];i&&l==="constructor"||r[l].get&&Object.defineProperty(e,l,{configurable:!0,enumerable:r[l].enumerable,get:r[l].get.bind(t)})}}return t}function Dn(e){let t;return e!=null&&typeof e=="object"&&(e[Me]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Rn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[ho])return n;if(!Dn(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=Rn(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=Rn(o,t))!==o&&(e[i]=r))}return e}function go(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function vr(e,t,n){if(e[t])return e[t];const[r,o]=_(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function vp(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===Me||t===hn||(delete n.value,delete n.writable,n.get=()=>e[Me][t]),n}function Zl(e){ji()&&vr(go(e,hn),Gl)()}function wp(e){return Zl(e),Reflect.ownKeys(e)}const bp={get(e,t,n){if(t===ho)return e;if(t===Me)return n;if(t===hr)return Zl(e),n;const r=go(e,hn),o=r[t];let i=o?o():e[t];if(t===hn||t===lt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);ji()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=vr(r,t,i)())}return Dn(i)?Xl(i):i},has(e,t){return t===ho||t===Me||t===hr||t===hn||t===lt||t==="__proto__"?!0:(ji()&&vr(go(e,lt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:wp,getOwnPropertyDescriptor:vp};function Mn(e,t,n,r=!1){if(t==="__proto__"||!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[lt]&&e[lt][t]&&o!==void 0&&e[lt][t].$()):(e[t]=n,e[lt]&&e[lt][t]&&o===void 0&&e[lt][t].$());let s=go(e,hn),a;if((a=vr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=vr(s,"length",i))&&a.$(e.length)}(a=s[Gl])&&a.$()}function Jl(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Ql(o)||Mn(e,o,t[o])}}function Ql(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function xp(e,t){if(typeof t=="function"&&(t=t(e)),t=Rn(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&&Mn(e,n,o)}Mn(e,"length",r)}else Jl(e,t)}function wr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(s==="string"&&(r==="__proto__"||t.length>1&&Ql(r)))return;if(Array.isArray(r)){for(let l=0;l<r.length;l++)wr(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&wr(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)wr(e,[d].concat(t),n);return}else if(t.length>1){wr(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=Rn(i),r===void 0||Dn(o)&&Dn(i)&&!Array.isArray(i)?Jl(o,i):Mn(e,r,i))}function ec(...[e,t]){const n=Rn(e||{}),r=Array.isArray(n),o=Xl(n);function i(...s){Qe(()=>{r&&s.length===1?xp(n,s[0]):wr(n,s)})}return[o,i]}const po=new WeakMap,tc={get(e,t){if(t===ho)return e;const n=e[t];if(t===Me||t===hr||t===hn||t===lt||t==="__proto__")return n;let r;return Dn(n)?po.get(n)||(po.set(n,r=new Proxy(n,tc)),r):n},set(e,t,n){return Mn(e,t,Rn(n)),!0},deleteProperty(e,t){return Mn(e,t,void 0,!0),!0}};function nc(e){return t=>{if(Dn(t)){let n;(n=po.get(t))||po.set(t,n=new Proxy(t,tc)),e(n)}return t}}function Ji(e,t,n){return Je(()=>{const r=El(e),[o,i]=ec(r?JSON.parse(r):t);return z(()=>Sl(e,JSON.stringify(o),n)),[o,i]})}function Sp(e,t,n){return Je(()=>{const r=El(e),[o,i]=_(r?JSON.parse(r):t);return z(()=>Sl(e,JSON.stringify(o()),n)),[o,i]})}const[qC,GC]=Sp("smarttalks-widget-lang","en");function Ep(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 Pp(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 mo={};function kp(e){for(const[t,n]of Object.entries(e))n===null?mo[t]=null:mo[t]=n;return{...mo}}function Cp(){const e=Object.entries(mo).filter(([,t])=>t!==void 0);if(e.length)return Object.fromEntries(e)}function Op(e){const t=new URLSearchParams(e),n={},r=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];for(const o of r){const i=t.get(o);if(i){const s=o.replace(/_([a-z])/g,(a,l)=>l.toUpperCase());n[s]=i}}return n}function Qi(){if(typeof window>"u")return{};const e={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,...Op(window.location.search)};try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}e.isMobile=String(/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)),e.viewportW=String(window.innerWidth),e.viewportH=String(window.innerHeight);const t=Cp();t&&(e.custom=t);for(const n of Object.keys(e))(e[n]===void 0||e[n]==="")&&delete e[n];return e}const Tp=async e=>{const t=e.split("?"),n=t[0],r=t[1]?.split("&")??[];if(!n)return;console.info("fetching widget:",n);const o=`${Et}/v1/widget/${n}`,{result:i}=await(await fetch(o,{credentials:"include"})).json();if(i.type==="flow")return Ep(i);if(i.type==="entity")return Pp(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 ye("registerContactData",s=>{s&&Object.keys(s).length&&fetch(`${Et}/v1/contact-data/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).catch(console.error)}),ye("registerMetadata",s=>{!s||!Object.keys(s).length||(kp(s),fetch(`${Et}/v1/widget-metadata/${n}`,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:s})}).catch(console.error))}),i._id=n,i},[rc,Ap]=_(""),[gn]=Je(()=>Rg(rc,Tp)),$p=()=>{if(gn()?.type==="chat")return gn()},Dp=()=>{if(gn()?.type==="form")return gn()},br=()=>{const e=gn();if(e&&e.sessionId)return e.sessionId;if(typeof window<"u")return localStorage.getItem("chat_session_id")};Je(()=>z(()=>{const e=gn();fg(e),e&&(ge("onLoad"),e.sessionId&&(console.log("currentWidget.sessionId",e.sessionId),localStorage.setItem("chat_session_id",e.sessionId)))}));const he=()=>({widgetId:rc,setWidgetId:Ap,widget:gn,chatWidget:$p,formWidget:Dp,getSessionId:br}),oc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ic=hl,Rp=(e,t)=>n=>{var r;if(t?.variants==null)return ic(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 f=oc(u)||oc(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...g}=u;return Object.entries(g).every(h=>{let[p,m]=h;return Array.isArray(m)?m.includes({...i,...a}[p]):{...i,...a}[p]===m})?[...c,d,f]:c},[]);return ic(e,s,l,n?.class,n?.className)};var Mp=U("<button>");const Ip=Rp("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"}}),Ue=e=>{const[,t]=ee(e,["variant","size","class"]);return(()=>{var n=Mp();return fn(n,B({get class(){return jt(Ip({variant:e.variant,size:e.size}),e.class)}},t),!1,!1),n})()};var _p=U('<img alt="widget logo">');const sc=e=>{const[,t]=ee(e,["class","src"]);return(()=>{var n=_p();return fn(n,B({get src(){return e.src??"/src/assets/izi.jpeg"},get class(){return jt("size-14 bg-transparent rounded-full",e.class)}},t),!1,!1),n})()};var Lp=U('<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 Np=()=>{const{chatWidget:e}=he(),t=()=>e()?.title?(e()?.title?.length||0)>24?`${e()?.title?.slice(0,21)}...`:e()?.title:"SmartTalks.ai",n=()=>e()?.subtitle?(e()?.subtitle?.length||0)>30?`${e()?.subtitle?.slice(0,27)}...`:e()?.subtitle:"Chat";return(()=>{var r=Lp(),o=r.firstChild,i=o.firstChild,s=i.nextSibling;return N(r,y(sc,{get src(){return e()?.avatar}}),o),N(i,t),N(s,n),r})()};var Fp=U("<svg stroke-width=0>");function Ee(e,t){const n=B(e.a,t),[r,o]=ee(n,["src"]),[i,s]=_(""),a=L(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return z(()=>s(a())),H(()=>{s("")}),(()=>{var l=Fp();return fn(l,B({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),N(l,()=>sp),l})()}function Vp(e){return Ee({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 Bp(e){return Ee({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 ac(e){return Ee({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 zp(e){return Ee({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)}const es={equals:!1};function lc(e){return(...t)=>{for(const n of e)n&&n(...t)}}function Kp(e){return(...t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n];r&&r(...t)}}}const I=e=>typeof e=="function"&&!e.length?e():e,cc=e=>Array.isArray(e)?e:e?[e]:[];function Up(e,...t){return typeof e=="function"?e(...t):e}const jp=H;function Wp(e,t,n,r){return e.addEventListener(t,n,r),jp(e.removeEventListener.bind(e,t,n,r))}function Hp(e,t,n,r){const o=()=>{cc(I(e)).forEach(i=>{i&&cc(I(t)).forEach(s=>Wp(i,s,n,r))})};typeof e=="function"?z(o):pe(o)}function yo(){return!0}const Yp={get(e,t,n){return t===Me?n:e.get(t)},has(e,t){return e.has(t)},set:yo,deleteProperty:yo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:yo,deleteProperty:yo}},ownKeys(e){return e.keys()}},qp=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function uc(e){const t={};let n;for(;n=qp.exec(e);)t[n[1]]=n[2];return t}function Gp(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=uc(e)}else typeof t=="string"&&(t=uc(t));return{...e,...t}}const ts=(e,t,n)=>{let r;for(const o of e){const i=I(o)[t];r?i&&(r=n(r,i)):r=i}return r};function Xp(...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?Kp:lc,o={};for(const s of n){const a=I(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=B(...n);return new Proxy({get(s){if(typeof s!="string")return Reflect.get(i,s);if(s==="style")return ts(n,"style",Gp);if(s==="ref"){const a=[];for(const l of n){const c=I(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"?ts(n,s,(a,l)=>`${a} ${l}`):s==="classList"?ts(n,s,(a,l)=>({...a,...l})):Reflect.get(i,s)},has(s){return Reflect.has(i,s)},keys(){return Object.keys(i)}},Yp)}function pn(...e){return lc(e)}function Zp(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ns(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Jp(e){return typeof e=="number"}function Qp(e){return Array.isArray(e)}function In(e){return Object.prototype.toString.call(e)==="[object String]"}function em(e){return typeof e=="function"}function dc(e){return t=>`${e()}-${t}`}function ct(e,t){return e?e===t||e.contains(t):!1}function xr(e,t=!1){const{activeElement:n}=Ot(e);if(!n?.nodeName)return null;if(fc(n)&&n.contentDocument)return xr(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ot(n).getElementById(r);if(o)return o}}return n}function Ot(e){return e?e.ownerDocument||e:document}function fc(e){return e.tagName==="IFRAME"}var hc=(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))(hc||{});function rs(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function vo(){return rs(/^Mac/i)}function tm(){return rs(/^iPhone/i)}function nm(){return rs(/^iPad/i)||vo()&&navigator.maxTouchPoints>1}function rm(){return tm()||nm()}function om(){return vo()||rm()}function Ie(e,t){return t&&(em(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function je(e){return t=>{for(const n of e)Ie(t,n)}}function im(e){return vo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ae(e){if(e)if(sm())e.focus({preventScroll:!0});else{const t=am(e);e.focus(),lm(t)}}var wo=null;function sm(){if(wo==null){wo=!1;try{document.createElement("div").focus({get preventScroll(){return wo=!0,!0}})}catch{}}return wo}function am(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 lm(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var gc=["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'])"],cm=[...gc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],os=`${gc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,um=cm.join(':not([hidden]):not([tabindex="-1"]),');function pc(e,t){const r=Array.from(e.querySelectorAll(os)).filter(mc);return t&&mc(e)&&r.unshift(e),r.forEach((o,i)=>{if(fc(o)&&o.contentDocument){const s=o.contentDocument.body,a=pc(s,!1);r.splice(i,1,...a)}}),r}function mc(e){return yc(e)&&!dm(e)}function yc(e){return e.matches(os)&&is(e)}function dm(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function is(e,t){return e.nodeName!=="#comment"&&fm(e)&&hm(e,t)&&(!e.parentElement||is(e.parentElement,e))}function fm(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 hm(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function gm(e,t,n){const r=t?.tabbable?um:os,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){return t?.from?.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&is(i)&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}function vc(e){let t=e;for(;t&&!pm(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function pm(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function mm(){}function ym(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,f]=t[l],[,g]=t[l===0?s-1:l-1]||[0,0],h=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(h===0)return!0;h>0&&(r===f?r>g&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(h===0)return!0;h<0&&(r===f?r<g&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function ut(e,t){return B(e,t)}var Sr=new Map,wc=new Set;function bc(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Sr.get(n.target);r||(r=new Set,Sr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Sr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Sr.delete(n.target)),Sr.size===0)){for(const o of wc)o();wc.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bc():document.addEventListener("DOMContentLoaded",bc));function ss(e,t){const n=xc(e,t,"left"),r=xc(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 xc(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 vm(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let o=vc(e);for(;e&&o&&e!==n&&o!==n;)ss(o,e),e=o,o=vc(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)&&e.scrollIntoView?.({block:"nearest"})}}}var wm={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 as(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=In(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=In(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(In(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return In(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(In(l)||Jp(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=as({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
|
|
7
|
+
*/function bm(e,t=[]){const n=as({dataSource:I(e.dataSource),getKey:I(e.getKey),getTextValue:I(e.getTextValue),getDisabled:I(e.getDisabled),getSectionChildren:I(e.getSectionChildren)}),[r,o]=_(e.factory(n));return z(dn([()=>I(e.dataSource),()=>I(e.getKey),()=>I(e.getTextValue),()=>I(e.getDisabled),()=>I(e.getSectionChildren),()=>e.factory,...t],([i,s,a,l,c,u])=>{const d=as({dataSource:i,getKey:s,getTextValue:a,getDisabled:l,getSectionChildren:c});o(()=>u(d))},{defer:!0})),r}function ls(e){const[t,n]=_(e.defaultValue?.()),r=L(()=>e.value?.()!==void 0),o=L(()=>r()?e.value?.():t());return[o,s=>{ie(()=>{const a=Up(s,o());return Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})}]}function xm(e){const[t,n]=ls(e);return[()=>t()??!1,n]}function Sm(e){const[t,n]=ls(e);return[()=>t()??[],n]}function Sc(e={}){const[t,n]=xm({value:()=>I(e.open),defaultValue:()=>!!I(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 Em(e){const t=n=>{n.key===hc.Escape&&e.onEscapeKeyDown?.(n)};z(()=>{if(I(e.isDisabled))return;const n=e.ownerDocument?.()??Ot();n.addEventListener("keydown",t),H(()=>{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
|
|
19
|
+
*/const bo="data-kb-top-layer";let Ec,cs=!1;const Tt=[];function Er(e){return Tt.findIndex(t=>t.node===e)}function Pm(e){return Tt[Er(e)]}function km(e){return Tt[Tt.length-1].node===e}function Pc(){return Tt.filter(e=>e.isPointerBlocking)}function Cm(){return[...Pc()].slice(-1)[0]}function us(){return Pc().length>0}function kc(e){const t=Er(Cm()?.node);return Er(e)<t}function Om(e){Tt.push(e)}function Tm(e){const t=Er(e);t<0||Tt.splice(t,1)}function Am(){for(const{node:e}of Tt)e.style.pointerEvents=kc(e)?"none":"auto"}function $m(e){if(us()&&!cs){const t=Ot(e);Ec=document.body.style.pointerEvents,t.body.style.pointerEvents="none",cs=!0}}function Dm(e){if(us())return;const t=Ot(e);t.body.style.pointerEvents=Ec,t.body.style.length===0&&t.body.removeAttribute("style"),cs=!1}const _e={layers:Tt,isTopMostLayer:km,hasPointerBlockingLayer:us,isBelowPointerBlockingLayer:kc,addLayer:Om,removeLayer:Tm,indexOf:Er,find:Pm,assignPointerEventToLayers:Am,disableBodyPointerEvents:$m,restoreBodyPointerEvents:Dm};/*!
|
|
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,19 +29,19 @@
|
|
|
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
|
|
32
|
+
*/const ds="focusScope.autoFocusOnMount",fs="focusScope.autoFocusOnUnmount",Cc={bubbles:!1,cancelable:!0},Oc={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=ns(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=ns(this.stack,e),this.active()?.resume()}};function Rm(e,t){const[n,r]=_(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=h=>e.onMountAutoFocus?.(h),a=h=>e.onUnmountAutoFocus?.(h),l=()=>Ot(t()),c=()=>{const h=l().createElement("span");return h.setAttribute("data-focus-trap",""),h.tabIndex=0,Object.assign(h.style,wm),h},u=()=>{const h=t();return h?pc(h,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const h=u();return h.length>0?h[0]:null},f=()=>{const h=u();return h.length>0?h[h.length-1]:null},g=()=>{const h=t();if(!h)return!1;const p=xr(h);return!p||ct(h,p)?!1:yc(p)};z(()=>{const h=t();if(!h)return;Oc.add(o);const p=xr(h);if(!ct(h,p)){const v=new CustomEvent(ds,Cc);h.addEventListener(ds,s),h.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Ae(d()),xr(h)===p&&Ae(h)},0)}H(()=>{h.removeEventListener(ds,s),setTimeout(()=>{const v=new CustomEvent(fs,Cc);g()&&v.preventDefault(),h.addEventListener(fs,a),h.dispatchEvent(v),v.defaultPrevented||Ae(p??l().body),h.removeEventListener(fs,a),Oc.remove(o)},0)})}),z(()=>{const h=t();if(!h||!I(e.trapFocus)||n())return;const p=v=>{const w=v.target;w?.closest(`[${bo}]`)||(ct(h,w)?i=w:Ae(i))},m=v=>{const x=v.relatedTarget??xr(h);x?.closest(`[${bo}]`)||ct(h,x)||Ae(i)};l().addEventListener("focusin",p),l().addEventListener("focusout",m),H(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",m)})}),z(()=>{const h=t();if(!h||!I(e.trapFocus)||n())return;const p=c();h.insertAdjacentElement("afterbegin",p);const m=c();h.insertAdjacentElement("beforeend",m);function v(x){const b=d(),C=f();x.relatedTarget===b?Ae(C):Ae(b)}p.addEventListener("focusin",v),m.addEventListener("focusin",v);const w=new MutationObserver(x=>{for(const b of x)b.previousSibling===m&&(m.remove(),h.insertAdjacentElement("beforeend",m)),b.nextSibling===p&&(p.remove(),h.insertAdjacentElement("afterbegin",p))});w.observe(h,{childList:!0,subtree:!1}),H(()=>{p.removeEventListener("focusin",v),m.removeEventListener("focusin",v),p.remove(),m.remove(),w.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
|
*
|
|
36
36
|
* Credits to the React Spectrum team:
|
|
37
37
|
* https://github.com/adobe/react-spectrum/blob/15e101b74966bd5eb719c6529ce71ce57eaed430/packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx
|
|
38
|
-
*/const
|
|
38
|
+
*/const Mm="data-live-announcer";/*!
|
|
39
39
|
* This file is based on code from react-spectrum.
|
|
40
40
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
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
|
|
44
|
+
*/function Im(e){z(()=>{I(e.isDisabled)||H(_m(I(e.targets),I(e.root)))})}const Pr=new WeakMap,We=[];function _m(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${Mm}], [${bo}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(f.contains(g))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 f=u.nextNode();for(;f!=null;)i(f),f=u.nextNode()}},i=l=>{const c=Pr.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Pr.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=Pr.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Pr.delete(l)):Pr.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,38 +53,38 @@
|
|
|
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
|
|
56
|
+
*/const Tc="interactOutside.pointerDownOutside",Ac="interactOutside.focusOutside";function Lm(e,t){let n,r=mm;const o=()=>Ot(t()),i=d=>e.onPointerDownOutside?.(d),s=d=>e.onFocusOutside?.(d),a=d=>e.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${bo}]`)||!ct(o(),f)||ct(t(),f)?!1:!e.shouldExcludeElement?.(f)},c=d=>{function f(){const g=t(),h=d.target;if(!g||!h||!l(d))return;const p=je([i,a]);h.addEventListener(Tc,p,{once:!0});const m=new CustomEvent(Tc,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||im(d)&&d.button===0}});h.dispatchEvent(m)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),g=d.target;if(!f||!g||!l(d))return;const h=je([s,a]);g.addEventListener(Ac,h,{once:!0});const p=new CustomEvent(Ac,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});g.dispatchEvent(p)};z(()=>{I(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),H(()=>{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
|
|
63
|
+
*/function Nm(e){const[t,n]=_();let r={},o=e(),i="none";const[s,a]=Fm(e()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return z(dn(s,l=>{const c=xo(r);i=l==="mounted"?c:"none"})),z(dn(e,l=>{if(o===l)return;const c=xo(r);l?a("MOUNT"):r?.display==="none"?a("UNMOUNT"):a(o&&i!==c?"ANIMATION_OUT":"UNMOUNT"),o=l})),z(dn(t,l=>{if(l){const c=d=>{const g=xo(r).includes(d.animationName);d.target===l&&g&&a("ANIMATION_END")},u=d=>{d.target===l&&(i=xo(r))};l.addEventListener("animationstart",u),l.addEventListener("animationcancel",c),l.addEventListener("animationend",c),H(()=>{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 xo(e){return e?.animationName||"none"}function Fm(e,t){const n=(s,a)=>t[s][a]??s,[r,o]=_(e);return[r,s=>{o(a=>n(a,s))}]}function So(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
|
|
69
|
+
*/function Vm(e,t){const[n,r]=_($c(t?.()));return z(()=>{r(e()?.tagName.toLowerCase()||$c(t?.()))}),n}function $c(e){return In(e)?e:void 0}function Eo(e){const[t,n]=ee(e,["asChild","as","children"]);if(!t.asChild)return y(yr,B({get component(){return t.as}},n,{get children(){return t.children}}));const r=Rl(()=>t.children);if(Dc(r())){const o=Rc(n,r()?.props??{});return y(yr,o)}if(Qp(r())){const o=r().find(Dc);if(o){const i=()=>y(Ht,{get each(){return r()},children:a=>y(G,{when:a===o,fallback:a,get children(){return o.props.children}})}),s=Rc(n,o?.props??{});return y(yr,B(s,{children:i}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const Bm=Symbol("$$KobalteAsComponent");function Dc(e){return e?.[Bm]===!0}function Rc(e,t){return Xp([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
|
*
|
|
73
73
|
* Credits to the React Spectrum team:
|
|
74
74
|
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
|
|
75
|
-
*/const
|
|
75
|
+
*/const zm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Km=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Um(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return zm.has(n)}const t=e.split("-")[0];return Km.has(t)}function jm(e){return Um(e)?"rtl":"ltr"}/*!
|
|
76
76
|
* Portions of this file are based on code from react-spectrum.
|
|
77
77
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
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
|
|
81
|
+
*/function Mc(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:jm(e)}}let hs=Mc();const kr=new Set;function Ic(){hs=Mc();for(const e of kr)e(hs)}function Wm(){const[e,t]=_(hs),n=L(()=>e());return Wt(()=>{kr.size===0&&window.addEventListener("languagechange",Ic),kr.add(t),H(()=>{kr.delete(t),kr.size===0&&window.removeEventListener("languagechange",Ic)})}),{locale:()=>n().locale,direction:()=>n().direction}}const Hm=Se();function gs(){const e=Wm();return Te(Hm)||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
|
|
87
|
+
*/const ps=new Map;function Ym(e){const{locale:t}=gs(),n=L(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return L(()=>{const r=n();let o;return ps.has(r)&&(o=ps.get(r)),o||(o=new Intl.Collator(t(),e),ps.set(r,o)),o})}function qm(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ms(e,t,n){qm(e,t),t.set(e,n)}/*!
|
|
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,79 +92,79 @@
|
|
|
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 et extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof et?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function
|
|
95
|
+
*/class et extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof et?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}}function Gm(e){const[t,n]=ls(e);return[()=>t()??new et,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
|
|
101
|
+
*/function _c(e){return om()?e.altKey:e.ctrlKey}function _n(e){return vo()?e.metaKey:e.ctrlKey}function Lc(e){return new et(e)}function Xm(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
|
|
107
|
+
*/function Zm(e){const t=ut({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=_(!1),[o,i]=_(),s=L(()=>{const p=I(t.selectedKeys);return p!=null?Lc(p):p}),a=L(()=>{const p=I(t.defaultSelectedKeys);return p!=null?Lc(p):new et}),[l,c]=Gm({value:s,defaultValue:a,onChange:p=>t.onSelectionChange?.(p)}),[u,d]=_(I(t.selectionBehavior)),f=()=>I(t.selectionMode),g=()=>I(t.disallowEmptySelection)??!1,h=p=>{(I(t.allowDuplicateSelectionEvents)||!Xm(p,l()))&&c(p)};return z(()=>{const p=l();I(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),z(()=>{d(I(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:h}}/*!
|
|
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
|
|
113
|
+
*/function Jm(e){const[t,n]=_(""),[r,o]=_(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(I(e.isDisabled))return;const a=I(e.keyboardDelegate),l=I(e.selectionManager);if(!a.getKeyForSearch)return;const c=Qm(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(f=>f+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&ey(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 Qm(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function ey(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
|
|
119
|
+
*/function ty(e,t,n){const o=B({selectOnFocus:()=>I(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=gs();let a={top:0,left:0};Hp(()=>I(o.isVirtualized)?void 0:i(),"scroll",()=>{const p=i();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=Jm({isDisabled:()=>I(o.disallowTypeAhead),keyboardDelegate:()=>I(o.keyboardDelegate),selectionManager:()=>I(o.selectionManager)}),c=p=>{Ie(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const m=t();if(!m?.contains(p.target))return;const v=I(o.selectionManager),w=I(o.selectOnFocus),x=T=>{T!=null&&(v.setFocusedKey(T),p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(T):w&&!_c(p)&&v.replaceSelection(T))},b=I(o.keyboardDelegate),C=I(o.shouldFocusWrap),E=v.focusedKey();switch(p.key){case"ArrowDown":{if(b.getKeyBelow){p.preventDefault();let T;E!=null?T=b.getKeyBelow(E):T=b.getFirstKey?.(),T==null&&C&&(T=b.getFirstKey?.(E)),x(T)}break}case"ArrowUp":{if(b.getKeyAbove){p.preventDefault();let T;E!=null?T=b.getKeyAbove(E):T=b.getLastKey?.(),T==null&&C&&(T=b.getLastKey?.(E)),x(T)}break}case"ArrowLeft":{if(b.getKeyLeftOf){p.preventDefault();const T=s()==="rtl";let D;E!=null?D=b.getKeyLeftOf(E):D=T?b.getFirstKey?.():b.getLastKey?.(),x(D)}break}case"ArrowRight":{if(b.getKeyRightOf){p.preventDefault();const T=s()==="rtl";let D;E!=null?D=b.getKeyRightOf(E):D=T?b.getLastKey?.():b.getFirstKey?.(),x(D)}break}case"Home":if(b.getFirstKey){p.preventDefault();const T=b.getFirstKey(E,_n(p));T!=null&&(v.setFocusedKey(T),_n(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(T):w&&v.replaceSelection(T))}break;case"End":if(b.getLastKey){p.preventDefault();const T=b.getLastKey(E,_n(p));T!=null&&(v.setFocusedKey(T),_n(p)&&p.shiftKey&&v.selectionMode()==="multiple"?v.extendSelection(T):w&&v.replaceSelection(T))}break;case"PageDown":if(b.getKeyPageBelow&&E!=null){p.preventDefault();const T=b.getKeyPageBelow(E);x(T)}break;case"PageUp":if(b.getKeyPageAbove&&E!=null){p.preventDefault();const T=b.getKeyPageAbove(E);x(T)}break;case"a":_n(p)&&v.selectionMode()==="multiple"&&I(o.disallowSelectAll)!==!0&&(p.preventDefault(),v.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),I(o.disallowEmptySelection)||v.clearSelection());break;case"Tab":if(!I(o.allowsTabNavigation)){if(p.shiftKey)m.focus();else{const T=gm(m,{tabbable:!0});let D,S;do S=T.lastChild(),S&&(D=S);while(S);D&&!D.contains(document.activeElement)&&Ae(D)}break}}},u=p=>{const m=I(o.selectionManager),v=I(o.keyboardDelegate),w=I(o.selectOnFocus);if(m.isFocused()){p.currentTarget.contains(p.target)||m.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(m.setFocused(!0),m.focusedKey()==null){const x=C=>{C!=null&&(m.setFocusedKey(C),w&&m.replaceSelection(C))},b=p.relatedTarget;b&&p.currentTarget.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?x(m.lastSelectedKey()??v.getLastKey?.()):x(m.firstSelectedKey()??v.getFirstKey?.())}else if(!I(o.isVirtualized)){const x=i();if(x){x.scrollTop=a.top,x.scrollLeft=a.left;const b=x.querySelector(`[data-key="${m.focusedKey()}"]`);b&&(Ae(b),ss(x,b))}}}},d=p=>{const m=I(o.selectionManager);p.currentTarget.contains(p.relatedTarget)||m.setFocused(!1)},f=p=>{i()===p.target&&p.preventDefault()},g=()=>{const p=I(o.autoFocus);if(!p)return;const m=I(o.selectionManager),v=I(o.keyboardDelegate);let w;p==="first"&&(w=v.getFirstKey?.()),p==="last"&&(w=v.getLastKey?.());const x=m.selectedKeys();x.size&&(w=x.values().next().value),m.setFocused(!0),m.setFocusedKey(w);const b=t();b&&w==null&&!I(o.shouldUseVirtualFocus)&&Ae(b)};return Wt(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),z(dn([i,()=>I(o.isVirtualized),()=>I(o.selectionManager).focusedKey()],p=>{const[m,v,w]=p;if(v)w&&o.scrollToKey?.(w);else if(w&&m){const x=m.querySelector(`[data-key="${w}"]`);x&&ss(m,x)}})),{tabIndex:L(()=>{if(!I(o.shouldUseVirtualFocus))return I(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:f,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
|
|
125
|
+
*/function ny(e,t){const n=()=>I(e.selectionManager),r=()=>I(e.key),o=()=>I(e.shouldUseVirtualFocus),i=w=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):w?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||_n(w)||"pointerType"in w&&w.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>I(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=w=>{l()&&(c=w.pointerType,w.pointerType==="mouse"&&w.button===0&&!I(e.shouldSelectOnPressUp)&&i(w))},d=w=>{l()&&w.pointerType==="mouse"&&w.button===0&&I(e.shouldSelectOnPressUp)&&I(e.allowsDifferentPressOrigin)&&i(w)},f=w=>{l()&&(I(e.shouldSelectOnPressUp)&&!I(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(w)},g=w=>{!l()||!["Enter"," "].includes(w.key)||(_c(w)?n().toggleSelection(r()):i(w))},h=w=>{a()&&w.preventDefault()},p=w=>{const x=t();o()||a()||!x||w.target===x&&n().setFocusedKey(r())},m=L(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),v=L(()=>I(e.virtualized)?void 0:r());return z(dn([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([w,x,b,C,E])=>{w&&x===C&&E&&!b&&document.activeElement!==w&&(e.focus?e.focus():Ae(w))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:m,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:g,onMouseDown:h,onFocus:p}}/*!
|
|
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
|
*
|
|
129
129
|
* Credits to the React Spectrum team:
|
|
130
130
|
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
|
|
131
|
-
*/class
|
|
131
|
+
*/class ry{collection;state;constructor(t,n){this.collection=t,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}isFocused(){return this.state.isFocused()}setFocused(t){this.state.setFocused(t)}focusedKey(){return this.state.focusedKey()}setFocusedKey(t){(t==null||this.collection().getItem(t))&&this.state.setFocusedKey(t)}selectedKeys(){return this.state.selectedKeys()}isSelected(t){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(t);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const t=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>t.has(n))}firstSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index<t.index;(!t||o)&&(t=r)}return t?.key}lastSelectedKey(){let t;for(const n of this.state.selectedKeys()){const r=this.collection().getItem(n),o=r?.index!=null&&t?.index!=null&&r.index>t.index;(!t||o)&&(t=r)}return t?.key}extendSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=this.state.selectedKeys(),o=r.anchorKey||n,i=new et(r,o,n);for(const s of this.getKeyRange(o,r.currentKey||n))i.delete(s);for(const s of this.getKeyRange(n,o))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(t,n){const r=this.collection().getItem(t),o=this.collection().getItem(n);return r&&o?r.index!=null&&o.index!=null&&r.index<=o.index?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){const r=[];let o=t;for(;o!=null;){const i=this.collection().getItem(o);if(i&&i.type==="item"&&r.push(o),o===n)return r;o=this.collection().getKeyAfter(o)}return[]}getKey(t){const n=this.collection().getItem(t);return n?!n||n.type!=="item"?null:n.key:t}toggleSelection(t){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}const n=this.getKey(t);if(n==null)return;const r=new et(this.state.selectedKeys());r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection()&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode()==="none")return;const n=this.getKey(t);if(n==null)return;const r=this.canSelectItem(n)?new et([n],n,n):new et;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode()==="none")return;const n=new et;for(const r of t){const o=this.getKey(r);if(o!=null&&(n.add(o),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const t=this.state.selectedKeys();!this.disallowEmptySelection()&&t.size>0&&this.state.setSelectedKeys(new et)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(t)&&!this.disallowEmptySelection()?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;for(const r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(t);return n!=null&&!n.disabled}isDisabled(t){const n=this.collection().getItem(t);return!n||n.disabled}getAllSelectableKeys(){const t=[];return(r=>{for(;r!=null;){if(this.canSelectItem(r)){const o=this.collection().getItem(r);if(!o)continue;o.type==="item"&&t.push(r)}r=this.collection().getKeyAfter(r)}})(this.collection().getFirstKey()),t}}/*!
|
|
132
132
|
* Portions of this file are based on code from react-spectrum.
|
|
133
133
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
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
|
|
137
|
+
*/class Nc{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
|
|
143
|
+
*/function oy(e){const t=Zm(e),r=bm({dataSource:()=>I(e.dataSource),getKey:()=>I(e.getKey),getTextValue:()=>I(e.getTextValue),getDisabled:()=>I(e.getDisabled),getSectionChildren:()=>I(e.getSectionChildren),factory:i=>e.filter?new Nc(e.filter(i)):new Nc(i)},[()=>e.filter]),o=new ry(r,t);return $l(()=>{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
|
*
|
|
147
147
|
* Credits to the React Spectrum team:
|
|
148
148
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
|
|
149
|
-
*/class
|
|
149
|
+
*/class iy{collection;ref;collator;constructor(t,n,r){this.collection=t,this.ref=n,this.collator=r}getKeyBelow(t){let n=this.collection().getKeyAfter(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(t){let n=this.collection().getKeyBefore(t);for(;n!=null;){const r=this.collection().getItem(n);if(r&&r.type==="item"&&!r.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let t=this.collection().getFirstKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getLastKey(){let t=this.collection().getLastKey();for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getItem(t){return this.ref?.()?.querySelector(`[data-key="${t}"]`)??null}getKeyPageAbove(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.max(0,r.offsetTop+r.offsetHeight-n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop>o;)i=this.getKeyAbove(i),r=i!=null?this.getItem(i):null;return i}getKeyPageBelow(t){const n=this.ref?.();let r=this.getItem(t);if(!n||!r)return;const o=Math.min(n.scrollHeight,r.offsetTop-r.offsetHeight+n.offsetHeight);let i=t;for(;i&&r&&r.offsetTop<o;)i=this.getKeyBelow(i),r=i!=null?this.getItem(i):null;return i}getKeyForSearch(t,n){const r=this.collator?.();if(!r)return;let o=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;o!=null;){const i=this.collection().getItem(o);if(i){const s=i.textValue.slice(0,t.length);if(i.textValue&&r.compare(s,t)===0)return o}o=this.getKeyBelow(o)}}}/*!
|
|
150
150
|
* Portions of this file are based on code from react-spectrum.
|
|
151
151
|
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
152
152
|
*
|
|
153
153
|
* Credits to the React Spectrum team:
|
|
154
154
|
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
|
|
155
|
-
*/function
|
|
155
|
+
*/function sy(e,t,n){const r=Ym({usage:"search",sensitivity:"base"}),o=L(()=>{const i=I(e.keyboardDelegate);return i||new iy(e.collection,t,r)});return ty({selectionManager:()=>I(e.selectionManager),keyboardDelegate:o,autoFocus:()=>I(e.autoFocus),deferAutoFocus:()=>I(e.deferAutoFocus),shouldFocusWrap:()=>I(e.shouldFocusWrap),disallowEmptySelection:()=>I(e.disallowEmptySelection),selectOnFocus:()=>I(e.selectOnFocus),disallowTypeAhead:()=>I(e.disallowTypeAhead),shouldUseVirtualFocus:()=>I(e.shouldUseVirtualFocus),allowsTabNavigation:()=>I(e.allowsTabNavigation),isVirtualized:()=>I(e.isVirtualized),scrollToKey:i=>I(e.scrollToKey)?.(i)},t)}/*!
|
|
156
156
|
* Portions of this file are based on code from ariakit
|
|
157
157
|
* MIT Licensed, Copyright (c) Diego Haz.
|
|
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
|
|
161
|
+
*/const ay=["button","color","file","image","reset","submit"];function ly(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?ay.indexOf(e.type)!==-1:!1}function cy(e){let t;const n=ut({type:"button"},e),[r,o]=ee(n,["ref","type","disabled"]),i=Vm(()=>t,()=>"button"),s=L(()=>{const c=i();return c==null?!1:ly({tagName:c,type:r.type})}),a=L(()=>i()==="input"),l=L(()=>i()==="a"&&t?.getAttribute("href")!=null);return y(Eo,B({as:"button",ref(c){var u=pn(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 Fc=Se();function Vc(){return Te(Fc)}function uy(){const e=Vc();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
|
|
167
|
+
*/function Bc(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function dy(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&&Bc(o,n))return r+1}return 0}function fy(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:Bc(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function zc(e,t){const n=fy(e);e!==n&&t(n)}function hy(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 Ot(r).body}function gy(e,t){z(()=>{const n=setTimeout(()=>{zc(e(),t)});H(()=>clearTimeout(n))})}function py(e,t){if(typeof IntersectionObserver!="function"){gy(e,t);return}let n=[];z(()=>{const r=()=>{const s=!!n.length;n=e(),s&&zc(e(),t)},o=hy(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}H(()=>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,14 +172,14 @@
|
|
|
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 yy(e={}){const[t,n]=Em({value:()=>I(e.items),onChange:i=>e.onItemsChange?.(i)});my(t,n);const r=i=>(n(s=>{const a=fy(s,i);return Jp(s,i,a)}),()=>{n(s=>{const a=s.filter(c=>c.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y(Bl.Provider,{value:{registerItem:r},get children(){return i.children}})}}function vy(e){const t=dy(),n=ut({shouldRegisterItem:!0},e);z(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());H(r)})}var de=e=>typeof e=="function"?e():e,vs=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),ws=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Eo=new Map,wy=e=>{z(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Eo.get(e.key);o?o.activeCount++:Eo.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);H(()=>{const i=Eo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Eo.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?.()}})})},jl=wy,by=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},xy=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},Sy=(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[c,l,u]=by(o,t),d=u-c-r*l;(l!==0||d!==0)&&xy(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Wl,Hl]=L([]),Ey=e=>Wl().indexOf(e)===Wl().length-1,Py=e=>{const t=B({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ke();let r=[0,0],o=null,i=null;z(()=>{de(t.enabled)&&(Hl(l=>[...l,n]),H(()=>{Hl(l=>l.filter(u=>u!==n))}))}),z(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:l}=document,u=window.innerWidth-l.offsetWidth;if(de(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(de(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,h=window.scrollX;jl({key:"prevent-scroll",element:l,style:d,properties:f,cleanup:()=>{de(t.restoreScrollPosition)&&u>0&&window.scrollTo(h,g)}})}else jl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),z(()=>{!Ey(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",c,{passive:!1}),H(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",c)}))});const s=l=>{r=Yl(l),o=null,i=null},a=l=>{const u=l.target,d=de(t.element),f=ky(l),g=Math.abs(f[0])>Math.abs(f[1])?"x":"y",h=g==="x"?f[0]:f[1],p=ql(u,g,h,d);let m;d&&ws(d,u)?m=!p:m=!0,m&&l.cancelable&&l.preventDefault()},c=l=>{const u=de(t.element),d=l.target;let f;if(l.touches.length===2)f=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Yl(l).map((p,m)=>r[m]-p),h=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=h,i=h==="x"?g[0]:g[1]}if(d.type==="range")f=!1;else{const g=ql(d,o,i,u);u&&ws(u,d)?f=!g:f=!0}}f&&l.cancelable&&l.preventDefault()}},ky=e=>[e.deltaX,e.deltaY],Yl=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ql=(e,t,n,r)=>{const o=r!==null&&ws(r,e),[i,s]=Sy(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Cy=Py,Gl=Cy;const Xl=Se();function Oy(){return Te(Xl)}function Ty(e){let t;const n=Oy(),[r,o]=ee(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n?.registerNestedLayer(d);return()=>{i.delete(d),f?.()}};Nm({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>lt(f(),d))||[...i].some(f=>lt(f,d)):!1,onPointerDownOutside:d=>{!t||_e.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!_e.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),Pm({ownerDocument:()=>Ot(t),onEscapeKeyDown:d=>{!t||!_e.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Wt(()=>{if(!t)return;_e.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);_e.assignPointerEventToLayers(),_e.disableBodyPointerEvents(t),H(()=>{t&&(_e.removeLayer(t),d?.(),_e.assignPointerEventToLayers(),_e.restoreBodyPointerEvents(t))})}),z(dn([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const g=_e.find(d);g&&g.isPointerBlocking!==f&&(g.isPointerBlocking=f,_e.assignPointerEventToLayers()),f&&_e.disableBodyPointerEvents(d),H(()=>{_e.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return y(Xl.Provider,{value:u,get children(){return y(So,B({as:"div",ref(d){var f=pn(g=>t=g,r.ref);typeof f=="function"&&f(d)}},o))}})}const Zl=Se();function Ay(){const e=Te(Zl);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function $y(e){const t=Ay(),[n,r]=ee(e,["ref","style"]);return y(So,B({as:"div",ref(o){var i=pn(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 Dy=["top","right","bottom","left"],Gt=Math.min,Le=Math.max,Po=Math.round,ko=Math.floor,dt=e=>({x:e,y:e}),Ry={left:"right",right:"left",bottom:"top",top:"bottom"},My={start:"end",end:"start"};function bs(e,t,n){return Le(e,Gt(t,n))}function mn(e,t){return typeof e=="function"?e(t):e}function Xt(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Jl(e){return e==="x"?"y":"x"}function xs(e){return e==="y"?"height":"width"}function yn(e){return["top","bottom"].includes(Xt(e))?"y":"x"}function Ss(e){return Jl(yn(e))}function Iy(e,t,n){n===void 0&&(n=!1);const r=Ln(e),o=Ss(e),i=xs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Co(s)),[s,Co(s)]}function _y(e){const t=Co(e);return[Es(e),t,Es(t)]}function Es(e){return e.replace(/start|end/g,t=>My[t])}function Ly(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 Ny(e,t,n,r){const o=Ln(e);let i=Ly(Xt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Es)))),i}function Co(e){return e.replace(/left|right|bottom|top/g,t=>Ry[t])}function Fy(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ql(e){return typeof e!="number"?Fy(e):{top:e,right:e,bottom:e,left:e}}function Oo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function eu(e,t,n){let{reference:r,floating:o}=e;const i=yn(t),s=Ss(t),a=xs(s),c=Xt(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Ln(t)){case"start":g[s]-=f*(n&&l?-1:1);break;case"end":g[s]+=f*(n&&l?-1:1);break}return g}const Vy=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=eu(l,r,c),f=r,g={},h=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:w,y:x,data:b,reset:C}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:g,rects:l,platform:s,elements:{reference:e,floating:t}});u=w??u,d=x??d,g={...g,[m]:{...g[m],...b}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=eu(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:g}};async function Cr(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=mn(t,e),h=Ql(g),m=a[f?d==="floating"?"reference":"floating":d],v=Oo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=Oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(v.top-C.top+h.top)/b.y,bottom:(C.bottom-v.bottom+h.bottom)/b.y,left:(v.left-C.left+h.left)/b.x,right:(C.right-v.right+h.right)/b.x}}const By=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=mn(e,t)||{};if(l==null)return{};const d=Ql(u),f={x:n,y:r},g=Ss(o),h=xs(g),p=await s.getDimensions(l),m=g==="y",v=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],C=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=E?E[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[x]||i.floating[h]);const D=b/2-C/2,S=T/2-p[h]/2-1,P=Gt(d[v],S),R=Gt(d[w],S),O=P,V=T-p[h]-R,K=T/2-p[h]/2+D,Y=bs(O,K,V),F=!c.arrow&&Ln(o)!=null&&K!==Y&&i.reference[h]/2-(K<O?P:R)-p[h]/2<0,W=F?K<O?K-O:K-V:0;return{[g]:f[g]+W,data:{[g]:Y,centerOffset:K-Y-W,...F&&{alignmentOffset:W}},reset:F}}}),zy=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:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=mn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Xt(o),w=yn(a),x=Xt(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=f||(x||!p?[Co(a)]:_y(a)),E=h!=="none";!f&&E&&C.push(...Ny(a,p,h,b));const T=[a,...C],D=await Cr(t,m),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(D[v]),d){const K=Iy(o,s,b);S.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(K=>K<=0)){var R,O;const K=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=T[K];if(Y)return{data:{index:K,overflows:P},reset:{placement:Y}};let F=(O=P.filter(W=>W.overflows[0]<=0).sort((W,X)=>W.overflows[1]-X.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var V;const W=(V=P.filter(X=>{if(E){const G=yn(X.placement);return G===w||G==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(G=>G>0).reduce((G,Xe)=>G+Xe,0)]).sort((X,G)=>X[1]-G[1])[0])==null?void 0:V[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function tu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nu(e){return Dy.some(t=>e[t]>=0)}const Ky=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=mn(e,t);switch(r){case"referenceHidden":{const i=await Cr(t,{...o,elementContext:"reference"}),s=tu(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:nu(s)}}}case"escaped":{const i=await Cr(t,{...o,altBoundary:!0}),s=tu(i,n.floating);return{data:{escapedOffsets:s,escaped:nu(s)}}}default:return{}}}}};async function Uy(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xt(n),a=Ln(n),c=yn(n)==="y",l=["left","top"].includes(s)?-1:1,u=i&&c?-1:1,d=mn(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),c?{x:g*u,y:f*l}:{x:f*l,y:g*u}}const jy=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,c=await Uy(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Wy=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:m=>{let{x:v,y:w}=m;return{x:v,y:w}}},...c}=mn(e,t),l={x:n,y:r},u=await Cr(t,c),d=yn(Xt(o)),f=Jl(d);let g=l[f],h=l[d];if(i){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=g+u[m],x=g-u[v];g=bs(w,g,x)}if(s){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=h+u[m],x=h-u[v];h=bs(w,h,x)}const p=a.fn({...t,[f]:g,[d]:h});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[d]:s}}}}}},Hy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=mn(e,t),u=await Cr(t,l),d=Xt(o),f=Ln(o),g=yn(o)==="y",{width:h,height:p}=i.floating;let m,v;d==="top"||d==="bottom"?(m=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=h-u.left-u.right,b=Gt(p-u[m],w),C=Gt(h-u[v],x),E=!t.middlewareData.shift;let T=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!f){const P=Le(u.left,0),R=Le(u.right,0),O=Le(u.top,0),V=Le(u.bottom,0);g?D=h-2*(P!==0||R!==0?P+R:Le(u.left,u.right)):T=p-2*(O!==0||V!==0?O+V:Le(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:T});const S=await s.getDimensions(a.floating);return h!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function To(){return typeof window<"u"}function Nn(e){return ru(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ft(e){var t;return(t=(ru(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ru(e){return To()?e instanceof Node||e instanceof Ne(e).Node:!1}function tt(e){return To()?e instanceof Element||e instanceof Ne(e).Element:!1}function ht(e){return To()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function ou(e){return!To()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Yy(e){return["table","td","th"].includes(Nn(e))}function Ao(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ps(e){const t=ks(),n=tt(e)?nt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function qy(e){let t=Zt(e);for(;ht(t)&&!Fn(t);){if(Ps(t))return t;if(Ao(t))return null;t=Zt(t)}return null}function ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fn(e){return["html","body","#document"].includes(Nn(e))}function nt(e){return Ne(e).getComputedStyle(e)}function $o(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Nn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ou(e)&&e.host||ft(e);return ou(t)?t.host:t}function iu(e){const t=Zt(e);return Fn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&Or(t)?t:iu(t)}function Tr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=iu(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Cs(s);return t.concat(s,s.visualViewport||[],Or(o)?o:[],a&&n?Tr(a):[])}return t.concat(o,Tr(o,[],n))}function Cs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function su(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ht(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Po(n)!==i||Po(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Os(e){return tt(e)?e:e.contextElement}function Vn(e){const t=Os(e);if(!ht(t))return dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=su(t);let s=(i?Po(n.width):n.width)/r,a=(i?Po(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Gy=dt(0);function au(e){const t=Ne(e);return!ks()||!t.visualViewport?Gy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Os(e);let s=dt(1);t&&(r?tt(r)&&(s=Vn(r)):s=Vn(e));const a=Xy(i,n,r)?au(i):dt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Ne(i),g=r&&tt(r)?Ne(r):r;let h=f,p=Cs(h);for(;p&&r&&g!==h;){const m=Vn(p),v=p.getBoundingClientRect(),w=nt(p),x=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=b,h=Ne(p),p=Cs(h)}}return Oo({width:u,height:d,x:c,y:l})}function Ts(e,t){const n=$o(e).scrollLeft;return t?t.left+n:vn(ft(e)).left+n}function cu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ts(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Zy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ft(r),a=t?Ao(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=dt(1);const u=dt(0),d=ht(r);if((d||!d&&!i)&&((Nn(r)!=="body"||Or(s))&&(c=$o(r)),ht(r))){const g=vn(r);l=Vn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!d&&!i?cu(s,c,!0):dt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Jy(e){return Array.from(e.getClientRects())}function Qy(e){const t=ft(e),n=$o(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ts(e);const a=-n.scrollTop;return nt(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function ev(e,t){const n=Ne(e),r=ft(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const l=ks();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a,y:c}}function tv(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ht(e)?Vn(e):dt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function lu(e,t,n){let r;if(t==="viewport")r=ev(e,n);else if(t==="document")r=Qy(ft(e));else if(tt(t))r=tv(t,n);else{const o=au(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Oo(r)}function uu(e,t){const n=Zt(e);return n===t||!tt(n)||Fn(n)?!1:nt(n).position==="fixed"||uu(n,t)}function nv(e,t){const n=t.get(e);if(n)return n;let r=Tr(e,[],!1).filter(a=>tt(a)&&Nn(a)!=="body"),o=null;const i=nt(e).position==="fixed";let s=i?Zt(e):e;for(;tt(s)&&!Fn(s);){const a=nt(s),c=Ps(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Or(s)&&!c&&uu(e,s))?r=r.filter(u=>u!==s):o=a,s=Zt(s)}return t.set(e,r),r}function rv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ao(t)?[]:nv(t,this._c):[].concat(n),r],a=s[0],c=s.reduce((l,u)=>{const d=lu(t,u,o);return l.top=Le(d.top,l.top),l.right=Gt(d.right,l.right),l.bottom=Gt(d.bottom,l.bottom),l.left=Le(d.left,l.left),l},lu(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ov(e){const{width:t,height:n}=su(e);return{width:t,height:n}}function iv(e,t,n){const r=ht(t),o=ft(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=dt(0);if(r||!r&&!i)if((Nn(t)!=="body"||Or(o))&&(a=$o(t)),r){const f=vn(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=Ts(o));const l=o&&!r&&!i?cu(o,a):dt(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function As(e){return nt(e).position==="static"}function du(e,t){if(!ht(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ft(e)===n&&(n=n.ownerDocument.body),n}function fu(e,t){const n=Ne(e);if(Ao(e))return n;if(!ht(e)){let o=Zt(e);for(;o&&!Fn(o);){if(tt(o)&&!As(o))return o;o=Zt(o)}return n}let r=du(e,t);for(;r&&Yy(r)&&As(r);)r=du(r,t);return r&&Fn(r)&&As(r)&&!Ps(r)?n:r||qy(e)||n}const sv=async function(e){const t=this.getOffsetParent||fu,n=this.getDimensions,r=await n(e.floating);return{reference:iv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function av(e){return nt(e).direction==="rtl"}const hu={convertOffsetParentRelativeRectToViewportRelativeRect:Zy,getDocumentElement:ft,getClippingRect:rv,getOffsetParent:fu,getElementRects:sv,getClientRects:Jy,getDimensions:ov,getScale:Vn,isElement:tt,isRTL:av};function gu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cv(e,t){let n=null,r;const o=ft(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=l;if(a||t(),!f||!g)return;const h=ko(d),p=ko(o.clientWidth-(u+f)),m=ko(o.clientHeight-(d+g)),v=ko(u),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Le(0,Gt(1,c))||1};let b=!0;function C(E){const T=E[0].intersectionRatio;if(T!==c){if(!b)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!gu(l,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function lv(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:c=!1}=r,l=Os(e),u=o||i?[...l?Tr(l):[],...Tr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&a?cv(l,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let h,p=c?vn(e):null;c&&m();function m(){const v=vn(e);p&&!gu(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const uv=jy,dv=Wy,fv=zy,hv=Hy,gv=Ky,pv=By,mv=(e,t,n)=>{const r=new Map,o={platform:hu,...n},i={...o.platform,_c:r};return Vy(e,t,{...o,platform:i})};function pu(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 yv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?pu(r):e?e.getBoundingClientRect():pu()}}}function vv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const wv={top:"bottom",right:"left",bottom:"top",left:"right"};function bv(e,t){const[n,r]=e.split("-"),o=wv[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 xv(e){const t=ut({getAnchorRect:f=>f?.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]=L(),[o,i]=L(),[s,a]=L(t.placement),c=()=>yv(t.anchorRef(),t.getAnchorRect),{direction:l}=ps();async function u(){const f=c(),g=n(),h=o();if(!f||!g)return;const p=(h?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[uv(({placement:E})=>{const T=!!E.split("-")[1];return{mainAxis:m,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const E=typeof t.flip=="string"?t.flip.split(" "):void 0;if(E!==void 0&&!E.every(vv))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(fv({padding:t.overflowPadding,fallbackPlacements:E}))}(t.slide||t.overlap)&&v.push(dv({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(hv({padding:t.overflowPadding,apply({availableWidth:E,availableHeight:T,rects:D}){const S=Math.round(D.reference.width);E=Math.floor(E),T=Math.floor(T),g.style.setProperty("--kb-popper-anchor-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-width",`${E}px`),g.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(g.style.width=`${S}px`),t.fitViewport&&(g.style.maxWidth=`${E}px`,g.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&v.push(gv({padding:t.detachedPadding})),h&&v.push(pv({element:h,padding:t.arrowPadding}));const w=await mv(f,g,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...hu,isRTL:()=>l()==="rtl"}});if(a(w.placement),t.onCurrentPlacementChange?.(w.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",bv(w.placement,l()));const x=Math.round(w.x),b=Math.round(w.y);let C;if(t.hideWhenDetached&&(C=w.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${b}px, 0)`,visibility:C}),h&&w.middlewareData.arrow){const{x:E,y:T}=w.middlewareData.arrow,D=w.placement.split("-")[0];Object.assign(h.style,{left:E!=null?`${E}px`:"",top:T!=null?`${T}px`:"",[D]:"100%"})}}z(()=>{const f=c(),g=n();if(!f||!g)return;const h=lv(f,g,u,{elementResize:typeof ResizeObserver=="function"});H(h)}),z(()=>{const f=n(),g=t.contentRef();!f||!g||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(g).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Zl.Provider,{value:d,get children(){return t.children}})}const mu=Se();function yu(){return Te(mu)}function Bn(){const e=yu();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const vu=Se();function zn(){const e=Te(vu);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}/*!
|
|
175
|
+
*/function my(e={}){const[t,n]=Sm({value:()=>I(e.items),onChange:i=>e.onItemsChange?.(i)});py(t,n);const r=i=>(n(s=>{const a=dy(s,i);return Zp(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>y(Fc.Provider,{value:{registerItem:r},get children(){return i.children}})}}function yy(e){const t=uy(),n=ut({shouldRegisterItem:!0},e);z(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());H(r)})}var de=e=>typeof e=="function"?e():e,ys=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),vs=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Po=new Map,vy=e=>{z(()=>{const t=de(e.style)??{},n=de(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Po.get(e.key);o?o.activeCount++:Po.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);H(()=>{const i=Po.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Po.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?.()}})})},Kc=vy,wy=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},by=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},xy=(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]=wy(o,t),d=u-l-r*c;(c!==0||d!==0)&&by(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Uc,jc]=_([]),Sy=e=>Uc().indexOf(e)===Uc().length-1,Ey=e=>{const t=B({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ke();let r=[0,0],o=null,i=null;z(()=>{de(t.enabled)&&(jc(c=>[...c,n]),H(()=>{jc(c=>c.filter(u=>u!==n))}))}),z(()=>{if(!de(t.enabled)||!de(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(de(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(de(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,h=window.scrollX;Kc({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{de(t.restoreScrollPosition)&&u>0&&window.scrollTo(h,g)}})}else Kc({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),z(()=>{!Sy(n)||!de(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),H(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=Wc(c),o=null,i=null},a=c=>{const u=c.target,d=de(t.element),f=Py(c),g=Math.abs(f[0])>Math.abs(f[1])?"x":"y",h=g==="x"?f[0]:f[1],p=Hc(u,g,h,d);let m;d&&vs(d,u)?m=!p:m=!0,m&&c.cancelable&&c.preventDefault()},l=c=>{const u=de(t.element),d=c.target;let f;if(c.touches.length===2)f=!de(t.allowPinchZoom);else{if(o==null||i===null){const g=Wc(c).map((p,m)=>r[m]-p),h=Math.abs(g[0])>Math.abs(g[1])?"x":"y";o=h,i=h==="x"?g[0]:g[1]}if(d.type==="range")f=!1;else{const g=Hc(d,o,i,u);u&&vs(u,d)?f=!g:f=!0}}f&&c.cancelable&&c.preventDefault()}},Py=e=>[e.deltaX,e.deltaY],Wc=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],Hc=(e,t,n,r)=>{const o=r!==null&&vs(r,e),[i,s]=xy(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},ky=Ey,Yc=ky;const qc=Se();function Cy(){return Te(qc)}function Oy(e){let t;const n=Cy(),[r,o]=ee(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n?.registerNestedLayer(d);return()=>{i.delete(d),f?.()}};Lm({shouldExcludeElement:d=>t?r.excludedElements?.some(f=>ct(f(),d))||[...i].some(f=>ct(f,d)):!1,onPointerDownOutside:d=>{!t||_e.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!_e.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),Em({ownerDocument:()=>Ot(t),onEscapeKeyDown:d=>{!t||!_e.isTopMostLayer(t)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Wt(()=>{if(!t)return;_e.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(t);_e.assignPointerEventToLayers(),_e.disableBodyPointerEvents(t),H(()=>{t&&(_e.removeLayer(t),d?.(),_e.assignPointerEventToLayers(),_e.restoreBodyPointerEvents(t))})}),z(dn([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const g=_e.find(d);g&&g.isPointerBlocking!==f&&(g.isPointerBlocking=f,_e.assignPointerEventToLayers()),f&&_e.disableBodyPointerEvents(d),H(()=>{_e.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return y(qc.Provider,{value:u,get children(){return y(Eo,B({as:"div",ref(d){var f=pn(g=>t=g,r.ref);typeof f=="function"&&f(d)}},o))}})}const Gc=Se();function Ty(){const e=Te(Gc);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}function Ay(e){const t=Ty(),[n,r]=ee(e,["ref","style"]);return y(Eo,B({as:"div",ref(o){var i=pn(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 $y=["top","right","bottom","left"],Gt=Math.min,Le=Math.max,ko=Math.round,Co=Math.floor,dt=e=>({x:e,y:e}),Dy={left:"right",right:"left",bottom:"top",top:"bottom"},Ry={start:"end",end:"start"};function ws(e,t,n){return Le(e,Gt(t,n))}function mn(e,t){return typeof e=="function"?e(t):e}function Xt(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function Xc(e){return e==="x"?"y":"x"}function bs(e){return e==="y"?"height":"width"}function yn(e){return["top","bottom"].includes(Xt(e))?"y":"x"}function xs(e){return Xc(yn(e))}function My(e,t,n){n===void 0&&(n=!1);const r=Ln(e),o=xs(e),i=bs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Oo(s)),[s,Oo(s)]}function Iy(e){const t=Oo(e);return[Ss(e),t,Ss(t)]}function Ss(e){return e.replace(/start|end/g,t=>Ry[t])}function _y(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 Ly(e,t,n,r){const o=Ln(e);let i=_y(Xt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ss)))),i}function Oo(e){return e.replace(/left|right|bottom|top/g,t=>Dy[t])}function Ny(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zc(e){return typeof e!="number"?Ny(e):{top:e,right:e,bottom:e,left:e}}function To(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Jc(e,t,n){let{reference:r,floating:o}=e;const i=yn(t),s=xs(t),a=bs(s),l=Xt(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Ln(t)){case"start":g[s]-=f*(n&&c?-1:1);break;case"end":g[s]+=f*(n&&c?-1:1);break}return g}const Fy=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}=Jc(c,r,l),f=r,g={},h=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:w,y:x,data:b,reset:C}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=x??d,g={...g,[m]:{...g[m],...b}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=Jc(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:g}};async function Cr(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:f=!1,padding:g=0}=mn(t,e),h=Zc(g),m=a[f?d==="floating"?"reference":"floating":d],v=To(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=To(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(v.top-C.top+h.top)/b.y,bottom:(C.bottom-v.bottom+h.bottom)/b.y,left:(v.left-C.left+h.left)/b.x,right:(C.right-v.right+h.right)/b.x}}const Vy=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}=mn(e,t)||{};if(c==null)return{};const d=Zc(u),f={x:n,y:r},g=xs(o),h=bs(g),p=await s.getDimensions(c),m=g==="y",v=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],C=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=E?E[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[x]||i.floating[h]);const D=b/2-C/2,S=T/2-p[h]/2-1,P=Gt(d[v],S),R=Gt(d[w],S),O=P,V=T-p[h]-R,K=T/2-p[h]/2+D,Y=ws(O,K,V),F=!l.arrow&&Ln(o)!=null&&K!==Y&&i.reference[h]/2-(K<O?P:R)-p[h]/2<0,W=F?K<O?K-O:K-V:0;return{[g]:f[g]+W,data:{[g]:Y,centerOffset:K-Y-W,...F&&{alignmentOffset:W}},reset:F}}}),By=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:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=mn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Xt(o),w=yn(a),x=Xt(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!p?[Oo(a)]:Iy(a)),E=h!=="none";!f&&E&&C.push(...Ly(a,p,h,b));const T=[a,...C],D=await Cr(t,m),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(D[v]),d){const K=My(o,s,b);S.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(K=>K<=0)){var R,O;const K=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=T[K];if(Y)return{data:{index:K,overflows:P},reset:{placement:Y}};let F=(O=P.filter(W=>W.overflows[0]<=0).sort((W,Z)=>W.overflows[1]-Z.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var V;const W=(V=P.filter(Z=>{if(E){const X=yn(Z.placement);return X===w||X==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(X=>X>0).reduce((X,Xe)=>X+Xe,0)]).sort((Z,X)=>Z[1]-X[1])[0])==null?void 0:V[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Qc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eu(e){return $y.some(t=>e[t]>=0)}const zy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=mn(e,t);switch(r){case"referenceHidden":{const i=await Cr(t,{...o,elementContext:"reference"}),s=Qc(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:eu(s)}}}case"escaped":{const i=await Cr(t,{...o,altBoundary:!0}),s=Qc(i,n.floating);return{data:{escapedOffsets:s,escaped:eu(s)}}}default:return{}}}}};async function Ky(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Xt(n),a=Ln(n),l=yn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=mn(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),l?{x:g*u,y:f*c}:{x:f*c,y:g*u}}const Uy=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 Ky(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}}}}},jy=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:m=>{let{x:v,y:w}=m;return{x:v,y:w}}},...l}=mn(e,t),c={x:n,y:r},u=await Cr(t,l),d=yn(Xt(o)),f=Xc(d);let g=c[f],h=c[d];if(i){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=g+u[m],x=g-u[v];g=ws(w,g,x)}if(s){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=h+u[m],x=h-u[v];h=ws(w,h,x)}const p=a.fn({...t,[f]:g,[d]:h});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[d]:s}}}}}},Wy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=mn(e,t),u=await Cr(t,c),d=Xt(o),f=Ln(o),g=yn(o)==="y",{width:h,height:p}=i.floating;let m,v;d==="top"||d==="bottom"?(m=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=h-u.left-u.right,b=Gt(p-u[m],w),C=Gt(h-u[v],x),E=!t.middlewareData.shift;let T=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!f){const P=Le(u.left,0),R=Le(u.right,0),O=Le(u.top,0),V=Le(u.bottom,0);g?D=h-2*(P!==0||R!==0?P+R:Le(u.left,u.right)):T=p-2*(O!==0||V!==0?O+V:Le(u.top,u.bottom))}await l({...t,availableWidth:D,availableHeight:T});const S=await s.getDimensions(a.floating);return h!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<"u"}function Nn(e){return tu(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ft(e){var t;return(t=(tu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tu(e){return Ao()?e instanceof Node||e instanceof Ne(e).Node:!1}function tt(e){return Ao()?e instanceof Element||e instanceof Ne(e).Element:!1}function ht(e){return Ao()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function nu(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}function Or(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Hy(e){return["table","td","th"].includes(Nn(e))}function $o(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Es(e){const t=Ps(),n=tt(e)?nt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Yy(e){let t=Zt(e);for(;ht(t)&&!Fn(t);){if(Es(t))return t;if($o(t))return null;t=Zt(t)}return null}function Ps(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fn(e){return["html","body","#document"].includes(Nn(e))}function nt(e){return Ne(e).getComputedStyle(e)}function Do(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Nn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nu(e)&&e.host||ft(e);return nu(t)?t.host:t}function ru(e){const t=Zt(e);return Fn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&Or(t)?t:ru(t)}function Tr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ru(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=ks(s);return t.concat(s,s.visualViewport||[],Or(o)?o:[],a&&n?Tr(a):[])}return t.concat(o,Tr(o,[],n))}function ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ou(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ht(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ko(n)!==i||ko(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Cs(e){return tt(e)?e:e.contextElement}function Vn(e){const t=Cs(e);if(!ht(t))return dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ou(t);let s=(i?ko(n.width):n.width)/r,a=(i?ko(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const qy=dt(0);function iu(e){const t=Ne(e);return!Ps()||!t.visualViewport?qy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function vn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Cs(e);let s=dt(1);t&&(r?tt(r)&&(s=Vn(r)):s=Vn(e));const a=Gy(i,n,r)?iu(i):dt(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 f=Ne(i),g=r&&tt(r)?Ne(r):r;let h=f,p=ks(h);for(;p&&r&&g!==h;){const m=Vn(p),v=p.getBoundingClientRect(),w=nt(p),x=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=b,h=Ne(p),p=ks(h)}}return To({width:u,height:d,x:l,y:c})}function Os(e,t){const n=Do(e).scrollLeft;return t?t.left+n:vn(ft(e)).left+n}function su(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Os(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Xy(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ft(r),a=t?$o(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=dt(1);const u=dt(0),d=ht(r);if((d||!d&&!i)&&((Nn(r)!=="body"||Or(s))&&(l=Do(r)),ht(r))){const g=vn(r);c=Vn(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!d&&!i?su(s,l,!0):dt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Zy(e){return Array.from(e.getClientRects())}function Jy(e){const t=ft(e),n=Do(e),r=e.ownerDocument.body,o=Le(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Le(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Os(e);const a=-n.scrollTop;return nt(r).direction==="rtl"&&(s+=Le(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Qy(e,t){const n=Ne(e),r=ft(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=Ps();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function ev(e,t){const n=vn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ht(e)?Vn(e):dt(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 au(e,t,n){let r;if(t==="viewport")r=Qy(e,n);else if(t==="document")r=Jy(ft(e));else if(tt(t))r=ev(t,n);else{const o=iu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return To(r)}function lu(e,t){const n=Zt(e);return n===t||!tt(n)||Fn(n)?!1:nt(n).position==="fixed"||lu(n,t)}function tv(e,t){const n=t.get(e);if(n)return n;let r=Tr(e,[],!1).filter(a=>tt(a)&&Nn(a)!=="body"),o=null;const i=nt(e).position==="fixed";let s=i?Zt(e):e;for(;tt(s)&&!Fn(s);){const a=nt(s),l=Es(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Or(s)&&!l&&lu(e,s))?r=r.filter(u=>u!==s):o=a,s=Zt(s)}return t.set(e,r),r}function nv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?$o(t)?[]:tv(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=au(t,u,o);return c.top=Le(d.top,c.top),c.right=Gt(d.right,c.right),c.bottom=Gt(d.bottom,c.bottom),c.left=Le(d.left,c.left),c},au(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rv(e){const{width:t,height:n}=ou(e);return{width:t,height:n}}function ov(e,t,n){const r=ht(t),o=ft(t),i=n==="fixed",s=vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=dt(0);if(r||!r&&!i)if((Nn(t)!=="body"||Or(o))&&(a=Do(t)),r){const f=vn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Os(o));const c=o&&!r&&!i?su(o,a):dt(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Ts(e){return nt(e).position==="static"}function cu(e,t){if(!ht(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ft(e)===n&&(n=n.ownerDocument.body),n}function uu(e,t){const n=Ne(e);if($o(e))return n;if(!ht(e)){let o=Zt(e);for(;o&&!Fn(o);){if(tt(o)&&!Ts(o))return o;o=Zt(o)}return n}let r=cu(e,t);for(;r&&Hy(r)&&Ts(r);)r=cu(r,t);return r&&Fn(r)&&Ts(r)&&!Es(r)?n:r||Yy(e)||n}const iv=async function(e){const t=this.getOffsetParent||uu,n=this.getDimensions,r=await n(e.floating);return{reference:ov(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sv(e){return nt(e).direction==="rtl"}const du={convertOffsetParentRelativeRectToViewportRelativeRect:Xy,getDocumentElement:ft,getClippingRect:nv,getOffsetParent:uu,getElementRects:iv,getClientRects:Zy,getDimensions:rv,getScale:Vn,isElement:tt,isRTL:sv};function fu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function av(e,t){let n=null,r;const o=ft(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 c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=c;if(a||t(),!f||!g)return;const h=Co(d),p=Co(o.clientWidth-(u+f)),m=Co(o.clientHeight-(d+g)),v=Co(u),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Le(0,Gt(1,l))||1};let b=!0;function C(E){const T=E[0].intersectionRatio;if(T!==l){if(!b)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!fu(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function lv(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=Cs(e),u=o||i?[...c?Tr(c):[],...Tr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?av(c,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let h,p=l?vn(e):null;l&&m();function m(){const v=vn(e);p&&!fu(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(v=g)==null||v.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const cv=Uy,uv=jy,dv=By,fv=Wy,hv=zy,gv=Vy,pv=(e,t,n)=>{const r=new Map,o={platform:du,...n},i={...o.platform,_c:r};return Fy(e,t,{...o,platform:i})};function hu(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 mv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?hu(r):e?e.getBoundingClientRect():hu()}}}function yv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}const vv={top:"bottom",right:"left",bottom:"top",left:"right"};function wv(e,t){const[n,r]=e.split("-"),o=vv[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 bv(e){const t=ut({getAnchorRect:f=>f?.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=()=>mv(t.anchorRef(),t.getAnchorRect),{direction:c}=gs();async function u(){const f=l(),g=n(),h=o();if(!f||!g)return;const p=(h?.clientHeight||0)/2,m=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[cv(({placement:E})=>{const T=!!E.split("-")[1];return{mainAxis:m,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const E=typeof t.flip=="string"?t.flip.split(" "):void 0;if(E!==void 0&&!E.every(yv))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(dv({padding:t.overflowPadding,fallbackPlacements:E}))}(t.slide||t.overlap)&&v.push(uv({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(fv({padding:t.overflowPadding,apply({availableWidth:E,availableHeight:T,rects:D}){const S=Math.round(D.reference.width);E=Math.floor(E),T=Math.floor(T),g.style.setProperty("--kb-popper-anchor-width",`${S}px`),g.style.setProperty("--kb-popper-content-available-width",`${E}px`),g.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(g.style.width=`${S}px`),t.fitViewport&&(g.style.maxWidth=`${E}px`,g.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&v.push(hv({padding:t.detachedPadding})),h&&v.push(gv({element:h,padding:t.arrowPadding}));const w=await pv(f,g,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...du,isRTL:()=>c()==="rtl"}});if(a(w.placement),t.onCurrentPlacementChange?.(w.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",wv(w.placement,c()));const x=Math.round(w.x),b=Math.round(w.y);let C;if(t.hideWhenDetached&&(C=w.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${b}px, 0)`,visibility:C}),h&&w.middlewareData.arrow){const{x:E,y:T}=w.middlewareData.arrow,D=w.placement.split("-")[0];Object.assign(h.style,{left:E!=null?`${E}px`:"",top:T!=null?`${T}px`:"",[D]:"100%"})}}z(()=>{const f=l(),g=n();if(!f||!g)return;const h=lv(f,g,u,{elementResize:typeof ResizeObserver=="function"});H(h)}),z(()=>{const f=n(),g=t.contentRef();!f||!g||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(g).zIndex})});const d={currentPlacement:s,contentRef:()=>t.contentRef(),setPositionerRef:r,setArrowRef:i};return y(Gc.Provider,{value:d,get children(){return t.children}})}const gu=Se();function pu(){return Te(gu)}function Bn(){const e=pu();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}const mu=Se();function zn(){const e=Te(mu);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 Sv(e,t){return t?vm([e.clientX,e.clientY],t):!1}function Ev(e){const t=zn(),n=zl(),r=yu(),o=ut({placement:"bottom-start"},e),[i,s]=ee(o,["open","defaultOpen","onOpenChange"]);let a=0,c=null,l="right";const[u,d]=L(),[f,g]=L(),[h,p]=L(),[m,v]=L(),[w,x]=L(!0),[b,C]=L(s.placement),[E,T]=L([]),[D,S]=L([]),{DomCollectionProvider:P}=yy({items:D,onItemsChange:S}),R=Pl({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:J=>i.onOpenChange?.(J)}),O=Fm(()=>t.forceMount()||R.isOpen()),V=iy({selectionMode:"none",dataSource:D}),K=J=>{x(J),R.open()},Y=(J=!1)=>{R.close(),J&&r&&r.close(!0)},F=J=>{x(J),R.toggle()},W=()=>{const J=m();J&&(Ae(J),V.selectionManager().setFocused(!0),V.selectionManager().setFocusedKey(void 0))},X=J=>{T(an=>[...an,J]);const zt=r?.registerNestedMenu(J);return()=>{T(an=>rs(an,J)),zt?.()}},G=J=>l===c?.side&&Sv(J,c?.area),Xe=J=>{G(J)&&J.preventDefault()},Re=J=>{G(J)||W()},fc=J=>{G(J)&&J.preventDefault()};_m({isDisabled:()=>!(r==null&&R.isOpen()&&t.isModal()),targets:()=>[m(),...E()].filter(Boolean)}),z(()=>{const J=m();if(!J||!r)return;const zt=r.registerNestedMenu(J);H(()=>{zt()})});const Ii={dataset:_(()=>({"data-expanded":R.isOpen()?"":void 0,"data-closed":R.isOpen()?void 0:""})),isOpen:R.isOpen,contentPresence:O,nestedMenus:E,currentPlacement:b,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>V,parentMenuContext:()=>r,triggerRef:h,contentRef:m,triggerId:u,contentId:f,setTriggerRef:p,setContentRef:v,open:K,close:Y,toggle:F,focusContent:W,onItemEnter:Xe,onItemLeave:Re,onTriggerLeave:fc,setPointerDir:J=>l=J,setPointerGraceTimeoutId:J=>a=J,setPointerGraceIntent:J=>c=J,registerNestedMenu:X,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:xo(d),registerContentId:xo(g)};return y(P,{get children(){return y(mu.Provider,{value:Ii,get children(){return y(xv,B({anchorRef:h,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const Pv=Se();function kv(e){let t;const n=zn(),r=Bn(),o=ut({id:n.generateId(`item-${Ke()}`)},e),[i,s]=ee(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,c]=L(),[l,u]=L(),[d,f]=L(),g=()=>r.listState().selectionManager(),h=()=>s.id,p=()=>g().focusedKey()===h(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};vy({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=ry({key:h,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=S=>{Ie(S,i.onPointerMove),S.pointerType==="mouse"&&(i.disabled?r.onItemLeave(S):(r.onItemEnter(S),S.defaultPrevented||(Ae(S.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},x=S=>{Ie(S,i.onPointerLeave),S.pointerType==="mouse"&&r.onItemLeave(S)},b=S=>{Ie(S,i.onPointerUp),!i.disabled&&S.button===0&&m()},C=S=>{if(Ie(S,i.onKeyDown),!S.repeat&&!i.disabled)switch(S.key){case"Enter":case" ":m();break}},E=_(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),T=_(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),D={isChecked:()=>i.checked,dataset:T,setLabelRef:f,generateId:hl(()=>s.id),registerLabel:xo(c),registerDescription:xo(u)};return y(Pv.Provider,{value:D,get children(){return y(So,B({as:"div",ref(S){var P=pn(R=>t=R,i.ref);typeof P=="function"&&P(S)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return E()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return v.dataKey()},get onPointerDown(){return je([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return je([b,v.onPointerUp])},get onClick(){return je([i.onClick,v.onClick])},get onKeyDown(){return je([C,v.onKeyDown])},get onMouseDown(){return je([i.onMouseDown,v.onMouseDown])},get onFocus(){return je([i.onFocus,v.onFocus])},onPointerMove:w,onPointerLeave:x},T,s))}})}const Cv=Se();function wu(){return Te(Cv)}function Ov(e){let t;const n=zn(),r=Bn(),o=wu(),i=ut({id:n.generateId(`content-${Ke()}`)},e),[s,a]=ee(i,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const l=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),u=ay({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Mm({trapFocus:()=>l()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=m=>{if(lt(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},h=m=>{Ie(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(Ie(m,s.onPointerMove),m.pointerType!=="mouse")return;const v=m.target,w=c!==m.clientX;lt(m.currentTarget,v)&&w&&(r.setPointerDir(m.clientX>c?"right":"left"),c=m.clientX)};return z(()=>H(r.registerContentId(s.id))),y(Z,{get when(){return r.contentPresence.isPresent()},get children(){return y($y,{get children(){return y(Ty,B({ref(m){var v=pn(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof v=="function"&&v(m)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return Yt(()=>!!l())()&&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:f,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return je([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return je([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return je([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return je([s.onFocusOut,u.onFocusOut])},onPointerEnter:h,onPointerMove:p},()=>r.dataset(),a))}})}})}function Tv(e){let t;const n=zn(),r=Bn(),[o,i]=ee(e,["ref"]);return Gl({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Ov,B({ref(s){var a=pn(c=>{t=c},o.ref);typeof a=="function"&&a(s)}},i))}function Av(e){return y(kv,B({role:"menuitem",closeOnSelect:!0},e))}function $v(e){const t=Bn();return y(Z,{get when(){return t.contentPresence.isPresent()},get children(){return y(Hc,e)}})}function Dv(e){const t=`menu-${Ke()}`,n=ut({id:t,modal:!0},e),[r,o]=ee(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=Pl({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:hl(()=>r.id),value:()=>r.value};return y(vu.Provider,{value:s,get children(){return y(Ev,B({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Rv(e){const t=zn(),n=Bn(),r=wu(),o=ut({id:t.generateId("trigger")},e),[i,s]=ee(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,z(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),z(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),z(()=>{n.isOpen()&&r.setValue(a)}),H(()=>{r.unregisterMenu(a)}),r.lastValue()===void 0&&r.setLastValue(a));const c=()=>{r?.setAutoFocusMenu(!0),r!==void 0?n.toggle(!1):n.toggle(!0),r!==void 0&&!n.isOpen()&&r.value()===a&&r.closeMenu()},l=h=>{Ie(h,i.onPointerDown),h.currentTarget.dataset.pointerType=h.pointerType,!i.disabled&&h.pointerType!=="touch"&&h.button===0&&c()},u=h=>{Ie(h,i.onClick),i.disabled||h.currentTarget.dataset.pointerType==="touch"&&c()},d=h=>{if(Ie(h,i.onKeyDown),!i.disabled)switch(h.key){case"Enter":case" ":case"ArrowDown":h.stopPropagation(),h.preventDefault(),wm(h.currentTarget),n.toggle("first");break;case"ArrowUp":h.stopPropagation(),h.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.previousMenu();break}},f=h=>{Ie(h,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=h=>{Ie(h,i.onFocus),r!==void 0&&r.setValue(a)};return z(()=>H(n.registerTriggerId(i.id))),y(uy,B({ref(h){var p=pn(n.setTriggerRef,i.ref);typeof p=="function"&&p(h)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Yt(()=>!!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:l,onMouseOver:f,onClick:u,onKeyDown:d,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Mv(e){const t=zn(),n=Bn(),[r,o]=ee(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(Tv,B({onCloseAutoFocus:c=>{r.onCloseAutoFocus?.(c),i||Ae(n.triggerRef()),i=!1,c.preventDefault()},onInteractOutside:c=>{r.onInteractOutside?.(c),(!t.isModal()||c.detail.isContextMenu)&&(i=!0)}},o))}function Iv(e){const t=`dropdownmenu-${Ke()}`,n=ut({id:t},e);return y(Dv,n)}function _v(e){return Ee({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 Lv(e){return Ee({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 Nv(e){return Ee({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)}function Fv(e){return Ee({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file",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"/>'},e)}const Vv=e=>y(Iv,B({gutter:4},e)),Bv=Rv,zv=e=>{const[,t]=ee(e,["class"]);return y($v,{get mount(){return dr()},get children(){return y(Mv,B({get class(){return jt("z-50 min-w-[128px] 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))}})},Kv=e=>{const[,t]=ee(e,["class"]);return y(Av,B({get class(){return jt("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 Uv(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function jv(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function Wv(e,t,n){const r=`${Et}/v1/messages`,o=br(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:es()})};await fetch(r,s)}async function Hv(e){const t=`${Et}/v1/messages`,n=br(),r={"Content-Type":"application/json"};n&&(r["x-session-id"]=n);const o={credentials:"include",method:"POST",headers:r,body:JSON.stringify({channelId:e,type:"open",metadata:es()})},i=await fetch(t,o);if(!i.ok)throw new Error(`open event rejected: ${i.status}`)}async function Yv(e,t,n){if(!e||!t||!n)return;const r=`${Et}/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 gt=Object.create(null);gt.open="0",gt.close="1",gt.ping="2",gt.pong="3",gt.message="4",gt.upgrade="5",gt.noop="6";const Do=Object.create(null);Object.keys(gt).forEach(e=>{Do[gt[e]]=e});const $s={type:"error",data:"parser error"},bu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",xu=typeof ArrayBuffer=="function",Su=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ds=({type:e,data:t},n,r)=>bu&&t instanceof Blob?n?r(t):Eu(t,r):xu&&(t instanceof ArrayBuffer||Su(t))?n?r(t):Eu(new Blob([t]),r):r(gt[e]+(t||"")),Eu=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Pu(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Rs;function qv(e,t){if(bu&&e.data instanceof Blob)return e.data.arrayBuffer().then(Pu).then(t);if(xu&&(e.data instanceof ArrayBuffer||Su(e.data)))return t(Pu(e.data));Ds(e,!1,n=>{Rs||(Rs=new TextEncoder),t(Rs.encode(n))})}const ku="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ar=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ku.length;e++)Ar[ku.charCodeAt(e)]=e;const Gv=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)i=Ar[e.charCodeAt(r)],s=Ar[e.charCodeAt(r+1)],a=Ar[e.charCodeAt(r+2)],c=Ar[e.charCodeAt(r+3)],u[o++]=i<<2|s>>4,u[o++]=(s&15)<<4|a>>2,u[o++]=(a&3)<<6|c&63;return l},Xv=typeof ArrayBuffer=="function",Ms=(e,t)=>{if(typeof e!="string")return{type:"message",data:Cu(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Zv(e.substring(1),t)}:Do[n]?e.length>1?{type:Do[n],data:e.substring(1)}:{type:Do[n]}:$s},Zv=(e,t)=>{if(Xv){const n=Gv(e);return Cu(n,t)}else return{base64:!0,data:e}},Cu=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ou="",Jv=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{Ds(i,!1,a=>{r[s]=a,++o===n&&t(r.join(Ou))})})},Qv=(e,t)=>{const n=e.split(Ou),r=[];for(let o=0;o<n.length;o++){const i=Ms(n[o],t);if(r.push(i),i.type==="error")break}return r};function ew(){return new TransformStream({transform(e,t){qv(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 Is;function Ro(e){return e.reduce((t,n)=>t+n.length,0)}function Mo(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 tw(e,t){Is||(Is=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(Ro(n)<1)break;const c=Mo(n,1);i=(c[0]&128)===128,o=c[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Ro(n)<2)break;const c=Mo(n,2);o=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(Ro(n)<8)break;const c=Mo(n,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue($s);break}o=u*Math.pow(2,32)+l.getUint32(4),r=3}else{if(Ro(n)<o)break;const c=Mo(n,o);a.enqueue(Ms(i?c:Is.decode(c),t)),r=0}if(o===0||o>e){a.enqueue($s);break}}}})}const Tu=4;function ve(e){if(e)return nw(e)}function nw(e){for(var t in ve.prototype)e[t]=ve.prototype[t];return e}ve.prototype.on=ve.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},ve.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},ve.prototype.off=ve.prototype.removeListener=ve.prototype.removeAllListeners=ve.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},ve.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},ve.prototype.emitReserved=ve.prototype.emit,ve.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ve.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Io=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),He=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),rw="arraybuffer";function JC(){}function Au(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const ow=He.setTimeout,iw=He.clearTimeout;function _o(e,t){t.useNativeTimers?(e.setTimeoutFn=ow.bind(He),e.clearTimeoutFn=iw.bind(He)):(e.setTimeoutFn=He.setTimeout.bind(He),e.clearTimeoutFn=He.clearTimeout.bind(He))}const sw=1.33;function aw(e){return typeof e=="string"?cw(e):Math.ceil((e.byteLength||e.size)*sw)}function cw(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 $u(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function lw(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function uw(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 dw extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class _s extends ve{constructor(t){super(),this.writable=!1,_o(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 dw(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=Ms(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=lw(t);return n.length?"?"+n:""}}class fw extends _s{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)};Qv(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,Jv(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]=$u()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Du=!1;try{Du=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hw=Du;function gw(){}class pw extends fw{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 pt extends ve{constructor(t,n,r){super(),this.createRequest=t,_o(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=Au(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=pt.requestsCount++,pt.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=gw,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pt.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(pt.requestsCount=0,pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ru);else if(typeof addEventListener=="function"){const e="onpagehide"in He?"pagehide":"unload";addEventListener(e,Ru,!1)}}function Ru(){for(let e in pt.requests)pt.requests.hasOwnProperty(e)&&pt.requests[e].abort()}const mw=(function(){const e=Mu({xdomain:!1});return e&&e.responseType!==null})();class yw extends pw{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=mw&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new pt(Mu,this.uri(),t)}}function Mu(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hw))return new XMLHttpRequest}catch{}if(!t)try{return new He[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Iu=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vw extends _s{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Iu?{}:Au(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;Ds(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&Io(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},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]=$u()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ls=He.WebSocket||He.MozWebSocket;class ww extends vw{createSocket(t,n,r){return Iu?new Ls(t,n,r):n?new Ls(t,n):new Ls(t)}doWrite(t,n){this.ws.send(n)}}class bw extends _s{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=tw(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=ew();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),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&&Io(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const xw={websocket:ww,webtransport:bw,polling:yw},Sw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ew=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ns(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=Sw.exec(e||""),i={},s=14;for(;s--;)i[Ew[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=Pw(i,i.path),i.queryKey=kw(i,i.query),i}function Pw(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 kw(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Fs=typeof addEventListener=="function"&&typeof removeEventListener=="function",Lo=[];Fs&&addEventListener("offline",()=>{Lo.forEach(e=>e())},!1);class Jt extends ve{constructor(t,n){if(super(),this.binaryType=rw,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=Ns(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=Ns(n.host).host);_o(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=uw(this.opts.query)),Fs&&(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"})},Lo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Tu,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&&Jt.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",Jt.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+=aw(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,Io(()=>{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(Jt.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(),Fs&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Lo.indexOf(this._offlineEventListener);r!==-1&&Lo.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=Tu;class Cw extends Jt{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;Jt.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;Jt.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 f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function c(){s("socket closed")}function l(d){n&&d.name!==n.name&&i()}const u=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",l),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 Ow=class extends Cw{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=>xw[o]).filter(o=>!!o)),super(t,r)}};function Tw(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=Ns(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 Aw=typeof ArrayBuffer=="function",$w=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_u=Object.prototype.toString,Dw=typeof Blob=="function"||typeof Blob<"u"&&_u.call(Blob)==="[object BlobConstructor]",Rw=typeof File=="function"||typeof File<"u"&&_u.call(File)==="[object FileConstructor]";function Vs(e){return Aw&&(e instanceof ArrayBuffer||$w(e))||Dw&&e instanceof Blob||Rw&&e instanceof File}function No(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(No(e[n]))return!0;return!1}if(Vs(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return No(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&No(e[n]))return!0;return!1}function Mw(e){const t=[],n=e.data,r=e;return r.data=Bs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Bs(e,t){if(!e)return e;if(Vs(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]=Bs(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]=Bs(e[r],t));return n}return e}function Iw(e,t){return e.data=zs(e.data,t),delete e.attachments,e}function zs(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]=zs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=zs(e[n],t));return e}const _w=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Q;(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"})(Q||(Q={}));class Lw{constructor(t){this.replacer=t}encode(t){return(t.type===Q.EVENT||t.type===Q.ACK)&&No(t)?this.encodeAsBinary({type:t.type===Q.EVENT?Q.BINARY_EVENT:Q.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Q.BINARY_EVENT||t.type===Q.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=Mw(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class Ks extends ve{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}: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===Q.BINARY_EVENT;r||n.type===Q.BINARY_ACK?(n.type=r?Q.EVENT:Q.ACK,this.reconstructor=new Nw(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Vs(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(Q[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Q.BINARY_EVENT||r.type===Q.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");const a=Number(s);if(!Fw(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}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(Ks.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Q.CONNECT:return Lu(n);case Q.DISCONNECT:return n===void 0;case Q.CONNECT_ERROR:return typeof n=="string"||Lu(n);case Q.EVENT:case Q.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&_w.indexOf(n[0])===-1);case Q.ACK:case Q.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Nw{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=Iw(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Fw=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Lu(e){return Object.prototype.toString.call(e)==="[object Object]"}const Vw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ks,Encoder:Lw,get PacketType(){return Q}},Symbol.toStringTag,{value:"Module"}));function rt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Bw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Nu extends ve{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=[rt(t,"open",this.onopen.bind(this)),rt(t,"packet",this.onpacket.bind(this)),rt(t,"error",this.onerror.bind(this)),rt(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(Bw.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:Q.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,c=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(c?(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:Q.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 Q.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 Q.EVENT:case Q.BINARY_EVENT:this.onevent(t);break;case Q.ACK:case Q.BINARY_ACK:this.onack(t);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.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:Q.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:Q.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 Kn(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}Kn.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)==0?e-n:e+n}return Math.min(e,this.max)|0},Kn.prototype.reset=function(){this.attempts=0},Kn.prototype.setMin=function(e){this.ms=e},Kn.prototype.setMax=function(e){this.max=e},Kn.prototype.setJitter=function(e){this.jitter=e};class Us extends ve{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,_o(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 Kn({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||Vw;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 Ow(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=rt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=rt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}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(rt(t,"ping",this.onping.bind(this)),rt(t,"data",this.ondata.bind(this)),rt(t,"error",this.onerror.bind(this)),rt(t,"close",this.onclose.bind(this)),rt(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){Io(()=>{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 Nu(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 $r={};function Fo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Tw(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=$r[o]&&i in $r[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let c;return a?c=new Us(r,t):($r[o]||($r[o]=new Us(r,t)),c=$r[o]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Fo,{Manager:Us,Socket:Nu,io:Fo,connect:Fo});class mt{static instance;constructor(){}static init(t){if(!mt.instance){const n=br();mt.instance=Fo(wg,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),mt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",mt.instance.id)})}return mt.instance}static on(t,n,r){const o=mt.instance||this.init(n);o.off(t),o.on(t,r)}static waitForConnection(t){const n=mt.instance||this.init(t);return n.connected?Promise.resolve():new Promise(r=>{n.once("connect",()=>r())})}}const js={image:["image/png","image/jpeg","image/webp","image/gif"],video:["video/mp4","video/webm","video/quicktime"],pdf:["application/pdf"]},zw={image:10*1024*1024,video:50*1024*1024,pdf:20*1024*1024},Kw=Object.values(js).flat().join(",");function Vo(e){for(const t of Object.keys(js))if(js[t].includes(e))return t;return null}function Uw(e){const t=Vo(e.type);return t?e.size===0?{reason:"size",category:t}:e.size>zw[t]?{reason:"size",category:t}:null:{reason:"type"}}function Ws(){const e=br();return e?{"x-session-id":e}:{}}async function jw(e,t){const n=await fetch(`${Et}/v1/uploads/${e}/presign`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Ws()},body:JSON.stringify({filename:t.name,contentType:t.type,size:t.size})});if(!n.ok)throw new Error(`presign failed (${n.status})`);return n.json()}function Ww(e,t,n){return new Promise((r,o)=>{const i=new XMLHttpRequest;i.open("PUT",e.uploadUrl,!0),i.setRequestHeader("Content-Type",e.headers["Content-Type"]),i.timeout=(e.expiresIn||300)*1e3,i.upload.onprogress=s=>{s.lengthComputable&&n&&n(s.loaded/s.total)},i.onload=()=>{i.status>=200&&i.status<300?r():o(new Error(`upload failed (${i.status})`))},i.onerror=()=>o(new Error("upload network error")),i.ontimeout=()=>o(new Error("upload timed out")),i.send(t)})}async function Hw(e,t,n){const r=await fetch(`${Et}/v1/uploads/${e}/complete`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Ws()},body:JSON.stringify({key:n,filename:t.name,contentType:t.type,size:t.size})});if(!r.ok)throw new Error(`complete failed (${r.status})`);const i=(await r.json())?.document?.url;if(typeof i!="string"||!i)throw new Error("complete: missing document url");return{key:n,url:i,contentType:t.type,filename:t.name}}async function Yw(e,t,n){const r=await fetch(`${Et}/v1/messages`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...Ws()},body:JSON.stringify({type:"media",channelId:e,key:t.key,contentType:t.contentType,filename:t.filename,text:n,metadata:es()})});if(!r.ok)throw new Error(`send media message failed (${r.status})`)}async function qw(e,t,n){const r=await jw(e,t);return await Ww(r,t,n),Hw(e,t,r.key)}let Fu=0;const[Hs,Bo]=nl([]),[Gw,Vu]=L(null),Xw=e=>{for(const t of e){const n=Uw(t);if(n){Vu(n);continue}Fu+=1;const r=Vo(t.type)==="image"?URL.createObjectURL(t):"";Bo(ol(o=>{o.push({id:`att-${Fu}`,file:t,previewUrl:r,status:"pending",progress:0})}))}},Zw=(e,t)=>{Bo(n=>n.id===e,t)},Jw=e=>{const t=Hs.find(n=>n.id===e);t?.previewUrl&&URL.revokeObjectURL(t.previewUrl),Bo(ol(n=>{const r=n.findIndex(o=>o.id===e);r>=0&&n.splice(r,1)}))},Qw=()=>{for(const e of Hs)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);Bo([])},Dr=()=>({attachments:Hs,addFiles:Xw,updateAttachment:Zw,removeAttachment:Jw,clearAttachments:Qw,lastRejection:Gw,clearRejection:()=>Vu(null)}),Ys=1e3*60*60*24,[zo,Bu]=Qi("smarttalks-widget-messages",{},Ys),zu=()=>{const{widgetId:e}=he();return zo[e()]??[]},eb=e=>{const{widgetId:t}=he();Bu({...zo,[t()]:[...zo[t()]??[],e]})},tb=()=>{const{widgetId:e}=he();Bu({...zo,[e()]:[]})},[Ku,nb]=Qi("smarttalks-widget-conversationinfo",{},Ys),qs=()=>{const{widgetId:e}=he();return Ku[e()]??{}},Uu=e=>{const{widgetId:t}=he();nb({...Ku,[t()]:e})},[ju,rb]=Qi("smarttalks-widget-autostarted",{},Ys),ob=()=>{const{widgetId:e}=he();return ju[e()]??!1},Wu=e=>{const{widgetId:t}=he();rb({...ju,[t()]:e})},[ib,Rr]=L(!1),[sb,Hu]=L(!1),Yu=[],qu=()=>{Yu.forEach(e=>e())},ab=e=>Yu.push(e),Ko=e=>{const t=Uv(e);if(eb(t),t.type==="media"){setTimeout(qu,200);return}qu()},Gs=()=>{const{widgetId:e}=he(),t=qs();mt.on("message",e(),n=>{(n.contactId!==t.contactId||n.interactionId!==t.interactionId)&&Uu({contactId:n.contactId,interactionId:n.interactionId});for(const r of n.messages)Ko(r),ge("onAnswer",r);Rr(!1),jv(n.debug)})},cb=(e,t)=>{const{chatWidget:n}=he();e.trim()&&(Ko({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ge("onInput",e),Gs(),Rr(!0),Wv(e,t,n()?._id).catch(r=>{console.error(r),Rr(!1)}))},lb=(e,t)=>{const n=Vo(e.contentType);return n==="video"?{type:"video",link:e.url,text:t}:n==="pdf"?{type:"document",link:e.url,filename:e.filename,text:t}:{type:"image",link:e.url,text:t}},ub=(e,t)=>{const{chatWidget:n}=he();Ko({media:lb(e,t),type:"media",origin:"user",createdAt:new Date().toString()}),Gs(),Rr(!0),Yw(n()?._id??"",e,t).catch(r=>{console.error(r),Rr(!1)})};let Xs=!1;const db=()=>{const{chatWidget:e,widgetId:t}=he();Gs(),Xs=!0,mt.waitForConnection(t()).then(()=>Hv(e()?._id)).then(()=>Wu(!0)).catch(n=>console.error(n)).finally(()=>{Xs=!1})},Gu=()=>{qs().interactionId||ob()||Xs||db()},fb=()=>{const{chatWidget:e}=he(),t=qs();Hu(!0),tb(),Dr().clearAttachments(),Yv(e()?._id,t.contactId,t.interactionId).finally(()=>{Uu({}),Hu(!1),Xu(),Wu(!1),Gu()}),ge("onReset")},Xu=()=>{const{chatWidget:e}=he();if(zu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Ko({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qt=()=>({getMessages:zu,pushMessage:cb,pushMedia:ub,maybeAutostart:Gu,clearMessages:fb,addBalloonMessage:Xu,onMessage:ab,typing:ib,loading:sb});var hb=U("<span>");const gb=()=>{const{clearMessages:e}=Qt();L(!1);const[t,n]=L(!1);return y(Vv,{get open(){return t()},onOpenChange:n,get children(){return[y(Bv,{get children(){return y(Ue,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(zp,{size:20})}})}}),y(zv,{get children(){return y(Kv,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(Bp,{size:14}),(()=>{var r=hb();return N(r,()=>Oe("restart")),r})()]}})}})]}})};function pb(e){return Ee({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 mb(e){return Ee({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 yb(e){return Ee({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function vb(e){return Ee({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 wb=U('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Zs=()=>{const{chatWidget:e}=he(),[t,n]=L(!1);let r=null;Wt(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&l()});const o=f=>{const g=f;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async f=>{const g=f;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const f=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(f.webkitExitFullscreen)return f.webkitExitFullscreen(),!0;if(f.msExitFullscreen)return f.msExitFullscreen(),!0}catch{}return!1},a=f=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",f.classList.add("st-fullscreen"),n(!0)},c=f=>{f.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},l=async()=>{try{const f=dr();if(!f)return;if(!t())o(f)&&await i(f)||a(f);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||c(f)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},u=()=>{const f=document,g=!!(document.fullscreenElement||f.webkitFullscreenElement||f.msFullscreenElement);if(n(g),!g)try{const h=dr();h.classList.contains("st-fullscreen")&&c(h)}catch{}};document.addEventListener("fullscreenchange",u),document.addEventListener("webkitfullscreenchange",u);const d=()=>{e()?.mode==="popup"&&ge("close")};return ye("toggleFullscreen",()=>{l()}),(()=>{var f=wb(),g=f.firstChild;return N(f,y(Fp,{}),g),N(g,y(Ue,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:l,get children(){return y(Z,{get when(){return t()},get fallback(){return y(mb,{size:16})},get children(){return y(pb,{size:16})}})}}),null),N(g,y(Z,{get when(){return e()?.showSettings},get children(){return y(gb,{})}}),null),N(g,y(Z,{get when(){return e()?.mode==="popup"},get children(){return y(Ue,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:d,get children(){return y(vb,{size:16})}})}}),null),f})()};var bb=U("<span>");const Zu=({createdAt:e,anchor:t="end"})=>(()=>{var n=bb();return qt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),N(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var xb=U('<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 Sb=({children:e,createdAt:t})=>(()=>{var n=xb(),r=n.firstChild;return N(r,e),N(n,y(Zu,{createdAt:t,anchor:"start"}),null),n})();var Eb=U("<span>");const Uo=e=>{const[t,n]=L(!1),r=o=>{const i=new ResizeObserver(()=>{n(o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)});i.observe(o),H(()=>i.disconnect())};return(()=>{var o=Eb();return pr(r,o),N(o,()=>e.text),pe(i=>{var s=e.class,a=t()?e.text:void 0;return s!==i.e&&qt(o,i.e=s),a!==i.t&&me(o,"title",i.t=a),i},{e:void 0,t:void 0}),o})()};var Pb=U("<span>");const Un=e=>{const[,t]=ee(e,["class","children"]);let n=e.children?.toString();return n&&(n=mg(yg(n))),(()=>{var r=Pb();return r.innerHTML=n,fn(r,B({get class(){return jt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var kb=U('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const Cb=({options:e,text:t})=>{let n;const{pushMessage:r}=Qt(),[o,i]=L(!1),s=(a,c)=>{i(!0),r(a,c)};return(()=>{var a=kb(),c=a.firstChild,l=c.firstChild;N(a,y(Un,{get children(){return t?.trim()}}),c);var u=n;return typeof u=="function"?pr(u,l):n=l,N(l,y(Ht,{each:e,children:d=>y(Ue,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 max-w-full min-w-0",onClick:()=>s(d.label,d.value),get children(){return y(Uo,{class:"min-w-0 truncate",get text(){return d.label?.trim()}})}})})),pe(()=>qt(c,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Ob=U('<div class="flex flex-col"><span>'),Tb=U("<a target=_blank><img><span></span><span>");const Ab=({options:e,text:t})=>(()=>{var n=Ob(),r=n.firstChild;return N(r,()=>t?.trim()),N(n,y(Ht,{each:e,children:o=>(()=>{var i=Tb(),s=i.firstChild,a=s.nextSibling,c=a.nextSibling;return N(a,()=>o.title?.trim()),N(c,()=>o.description?.trim()),pe(l=>{var u=o.url,d=o.image;return u!==l.e&&me(i,"href",l.e=u),d!==l.t&&me(s,"src",l.t=d),l},{e:void 0,t:void 0}),i})()}),null),n})();var $b=U("<a target=_blank>");const Db=({url:e,text:t})=>(()=>{var n=$b();return me(n,"href",e),N(n,()=>t?.trim()),n})();var ce=e=>typeof e=="function"?e():e,Ju=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Rb=e=>{const t=B({initialRegistered:!1},e),[n,r]=L(t.initialRegistered);return[_(()=>{if(n())return ce(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Qu=Rb,Mr=e=>typeof e=="function",Mb=["button","color","file","image","reset","submit"],Ib=(e,t)=>e==="button"?!0:e==="input"&&t?Mb.indexOf(t)!==-1:!1;function _b(e){const[t,n]=L(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>re(()=>{let a;return Mr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Js=_b,jo=new Map,Wo=(e,t)=>{if(jo.has(e))return jo.get(e);const n=Se(t);return jo.set(e,n),n},Qs=e=>{const t=jo.get(e);if(t)return Te(t)},Ho=new Map,Lb=e=>{z(()=>{const t=ce(e.style)??{},n=ce(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Ho.get(e.key);o?o.activeCount++:Ho.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);H(()=>{const i=Ho.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Ho.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?.()}})})},Nb=Lb,Fb=e=>{const t=B({enabled:!0},e);z(()=>{ce(t.enabled)&&(document.addEventListener("keydown",n),H(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Vb=Fb,Bb=e=>{const t=B({enabled:!0},e);z(()=>{const{body:n}=document;ce(t.enabled)&&Nb({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},zb=Bb,Kb=e=>{const t=B({enabled:!0,strategy:"pointerup"},e);z(()=>{if(!ce(t.enabled))return;const r=ce(t.strategy);document.addEventListener(r,n),H(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=ce(t.element),i=ce(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Ub=Kb,jb=e=>{const t=B({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Vb({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Ub({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}),zb({enabled:t.noOutsidePointerEvents})},Wb=jb,ea=Se(),Hb=e=>_(()=>{if(Te(ea))return y(ed,e);const r=Ke(),[o,i]=L([r]),s=c=>{i(l=>[...l,c])},a=c=>{i(l=>l.filter(u=>u!==c))};return y(ea.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(ed,e)}})}),ed=e=>{const t=B({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=ee(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=Te(ea),i=Ke();z(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;Wb({dismissOnEscapeKeyDown:()=>ce(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>ce(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>ce(n.noOutsidePointerEvents)&&n.enabled,onDismiss:l=>{n.onDismiss(l)},...r});const a=_(()=>n.children),c=()=>{const l=a();return Mr(l)?l({get isLastLayer(){return s()}}):l};return re(()=>c())},Yb=Hb,qb=()=>{const[e,t]=L(!1);return z(()=>t(!0)),e},Gb=qb,Xb=(e,t)=>(e&&(Mr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ta=(...e)=>e.some(t=>!!t()),Zb=e=>(...t)=>{for(const n of e)n&&n(...t)},Yo=(...e)=>Zb(e),xe=e=>e?"":void 0,Jb="div",Qb=e=>{const[t,n]=ee(e,["as"]),r=_(()=>t.as??Jb);return _(()=>{const i=r();switch(typeof i){case"function":return re(()=>i(n));case"string":return y(yr,B({component:i},n))}})},na=Qb,e0=e=>{let t,n=!1;return()=>n?t:(n=!0,t=_(e))},td=e0,t0=e=>_(()=>ce(e.element)?.tagName.toLowerCase()||e.fallback),n0=t0,nd="button",r0=e=>{const[t,n]=L(null),[r,o]=ee(e,["as","ref","type"]),i=n0({element:t,fallback:nd}),s=_(()=>Ib(i(),r.type));return y(na,B({get as(){return r.as??nd},ref(a){var c=Yo(n,r.ref);typeof c=="function"&&c(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},o0=r0,i0='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"])',ra="focusTrap.initialFocus",oa="focusTrap.finalFocus",rd={bubbles:!1,cancelable:!0},s0=e=>{const t=B({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=L(null),o=_(()=>{const h=n();return h?h[0]??null:null}),i=_(()=>{const h=n();return h?h[h.length-1]??null:null});let s=null;const a=()=>{vs(()=>{c(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&l(de(t.element))})};z(()=>{const h=de(t.element);if(h&&de(t.enabled)){s=document.activeElement,re(()=>{c(h),l(h)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(h,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),H(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(h)})}}),z(()=>{const h=n();h===null||h.length!==0||(document.addEventListener("keydown",f),H(()=>{document.removeEventListener("keydown",f)}))}),z(()=>{const h=o();h&&(h.addEventListener("keydown",u),H(()=>{h.removeEventListener("keydown",u)}))}),z(()=>{const h=i();h&&(h.addEventListener("keydown",d),H(()=>{h.removeEventListener("keydown",d)}))});const c=h=>{const p=Array.from(h.querySelectorAll(i0)).map((m,v)=>({element:m,domIndex:v,tabIndex:m.tabIndex})).sort((m,v)=>m.tabIndex===v.tabIndex?m.domIndex-v.domIndex:m.tabIndex-v.tabIndex);r(p.map(({element:m})=>m))},l=h=>{vs(()=>{const p=de(t.initialFocusElement)??o()??h,m=t.onInitialFocus;let v;m&&(v=new CustomEvent(ra,rd),h.addEventListener(ra,m),h.dispatchEvent(v),h.removeEventListener(ra,m)),v?.defaultPrevented!==!0&&p.focus()})},u=h=>{h.key==="Tab"&&h.shiftKey&&(h.preventDefault(),i().focus())},d=h=>{h.key==="Tab"&&!h.shiftKey&&(h.preventDefault(),o().focus())},f=h=>{h.key==="Tab"&&h.preventDefault()},g=h=>{vs(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let v;const w=t.onFinalFocus;w&&(v=new CustomEvent(oa,rd),h.addEventListener(oa,w),h.dispatchEvent(v),h.removeEventListener(oa,w)),v?.defaultPrevented!==!0&&m.focus()})}},a0=s0,c0=a0,l0=e=>{const t=_(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=L(de(e.show)?"present":"hidden");let i="none";return z(s=>{const a=de(e.show);return re(()=>{if(s===a)return a;const c=i,l=n();a?o("present"):l==="none"||t()?.display==="none"?o("hidden"):o(s===!0&&c!==l?"hiding":"hidden")}),a}),z(()=>{const s=de(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},c=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),H(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},u0=l0,od=u0,d0=Se(),f0=e=>e?Wo(`dialog-${e}`):d0,id=Se(),h0=e=>e?Wo(`dialog-internal-${e}`):id,jn=e=>{if(!e){const n=Te(id);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=Qs(`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},g0="div",p0=e=>{const[t,n]=ee(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=_(()=>jn(t.contextId)),o=()=>ta(r().open,()=>t.forceMount,r().contentPresent),i=_(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return y(Yb,{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=_(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(na,B({ref(c){var l=Yo(r().setContentRef,t.ref);typeof l=="function"&&l(c)},get as(){return t.as??g0},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 xe(r().open())},get"data-closed"(){return xe(!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()}}))}})}})}})},m0=p0,y0="div",v0=e=>{const[t,n]=ee(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=_(()=>jn(t.contextId)),o=()=>ta(r().open,()=>t.forceMount,r().overlayPresent),i=_(s=>s||o(),!1);return y(Z,{get when(){return i()},get children(){return(()=>{const s=_(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(na,B({get as(){return t.as??y0},ref(a){var c=Yo(r().setOverlayRef,t.ref);typeof c=="function"&&c(a)},"aria-hidden":"true",get"data-open"(){return xe(r().open())},get"data-closed"(){return xe(!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()}}))}})})()}})},w0=v0,b0=e=>{const[t,n]=ee(e,["forceMount","contextId","children"]),r=_(()=>jn(t.contextId)),o=()=>ta(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=Gb(),s=_(a=>a||o()&&i(),!1);return y(Z,{get when(){return s()},get children(){return(()=>{const a=_(()=>t.children);return y(Z,{get when(){return o()},get children(){return y(Hc,B(n,{get children(){return a()}}))}})})()}})},x0=b0,ia=!0,S0=e=>{const t=B({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??ia),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??ia),preventScroll:()=>!!(e.modal??ia),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ke()},e),[n,r]=Js({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Qu({value:()=>t.labelId??Ke()}),[a,c,l]=Qu({value:()=>t.descriptionId??Ke()}),[u,d]=L(null),[f,g]=L(null),[h,p]=L(null),{present:m}=od({show:n,element:f}),{present:v}=od({show:n,element:h});c0({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Gl({element:f,enabled:()=>m()&&ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const w={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return ce(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return ce(t.noOutsidePointerEvents)},get preventScroll(){return ce(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return ce(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 m()},get contentRef(){return f()},get overlayPresent(){return v()},get overlayRef(){return h()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=td(()=>t.children),b=()=>{const E=x()();return Mr(E)?E(w):E};return _(()=>{const E=f0(t.contextId),T=h0(t.contextId);return y(E.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:v,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(T.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>ce(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>ce(t.noOutsidePointerEvents),preventScroll:()=>ce(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>ce(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:v,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:c,unregisterDescriptionId:l,setContentRef:g,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return re(()=>b())}})}})})},E0=S0,P0="button",k0=e=>{const[t,n]=ee(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=_(()=>jn(t.contextId));return y(o0,B({ref(i){var s=Yo(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??P0},onClick:i=>{!Xb(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 xe(r().open())},get"data-closed"(){return xe(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},C0=k0,qo=e=>typeof e=="function"?e():e,sd=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function O0(e){const t=B({enabled:!0,dimension:"both"},e),[n,r]=L(!1),[o,i]=L(null);let s=null;z(()=>{const l=qo(t.element),u=qo(t.enabled);if(!l||!u)return;const d=new ResizeObserver(a);d.observe(l),l.addEventListener("transitionend",c),H(()=>{d.disconnect(),l.removeEventListener("transitionend",c),c()})});const a=([l])=>{if(n())return;const u=l.target,d=[u.offsetWidth,u.offsetHeight],f=qo(t.dimension);f==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Qe(()=>{i(s),r(!0)}),sd(()=>{i(d),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d:s?Go(f,s)!==Go(f,d)&&(Qe(()=>{i(Go(f,s)),r(!0)}),sd(()=>{i(Go(f,d)),parseFloat(getComputedStyle(l.target).transitionDuration)===0&&c()})):s=d},c=()=>{if(!n())return;const l=qo(t.element);l?s=[l.offsetWidth,l.offsetHeight]:s=null,Qe(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Go=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},T0=O0,A0=T0;const $0=(e,t)=>e.length>0?()=>e(re(t)):e;function D0(e,t){let n=0;const r=e.map((o,i)=>_(()=>(n=i,o()),void 0,ts));return _(()=>r.map(o=>o())[n],void 0,t)}function ad(e,t,n){let r=()=>t;const[o,i]=L(t,ts),s=_($0(e,()=>r()),t,ts);return[r=D0([o,s],n),(a=>i(()=>typeof a=="function"?a(re(r)):a))]}var R0=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},M0=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},I0=(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[c,l,u]=R0(o,t),d=u-c-r*l;(l!==0||d!==0)&&M0(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},_0=e=>y(C0,B({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),cd=Se(),L0=e=>e?Wo(`drawer-${e}`):cd,N0=e=>{if(!e){const n=Te(cd);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Qs(`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},ld=Se(),F0=e=>e?Wo(`drawer-internal-${e}`):ld,ud=e=>{if(!e){const n=Te(ld);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Qs(`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},dd=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Xo(e,t)};const o=r[n-1]?Xo(r[n-1],t):void 0,i=r[n]?Xo(r[n],t):void 0;return{value:e,offset:Xo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Xo=(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)},V0=(e,t,n,r)=>{const o=fd("upper",e,r?n:t),i=fd("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},fd=(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),B0=(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},z0=void 0,K0=e=>{const t=B({initialOpen:!1,snapPoints:[0,1],breakPoints:[z0],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,W)=>{const X=F/W;return X<1&&X>-1?1:X},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=ee(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Js({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Js({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[c,l]=L(),{transitioning:u,transitionSize:d}=A0({element:()=>c()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,g]=L(!1),[h,p]=ad(()=>u()?"resizing":null),m=_(()=>{const F=c()?.contentRef();if(F)return getComputedStyle(F)}),[v,w]=L(!1);z(()=>{const F=o();re(()=>{v()!==F&&(F?(w(!0),Ju(()=>{Qe(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Qe(()=>{p("closing"),a(0)}),Ju(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Qe(()=>{w(!1),p(null)})},[b,C]=L(0);z(()=>{const F=c()?.contentRef();if(!F)return;T(F);const W=new ResizeObserver(E);W.observe(F),H(()=>{W.disconnect()})});const E=F=>{for(const W of F)W.target===c()?.contentRef()&&T(W.target)},T=F=>{const W=re(()=>b());switch(n.side){case"top":case"bottom":if(W===F.offsetHeight)return;C(F.offsetHeight);break;case"left":case"right":if(W===F.offsetWidth)return;C(F.offsetWidth);break}},D=_(()=>dd(s(),b())),[S,P]=ad(()=>D().offset),R=_(()=>b()?(b()-S())/b():0),O={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 f()},get isTransitioning(){return h()!==null},get transitionState(){return h()},get openPercentage(){return R()},get translate(){return S()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},V=td(()=>n.children),K=F=>{l(jn(n.contextId));const W=V()();if(Mr(W)){const X=B(F,O);return W(X)}return W};return _(()=>{const F=L0(n.contextId),W=F0(n.contextId);return re(()=>y(F.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:R,translate:S,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(W.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:R,translate:S,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:P,drawerSize:b,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:d,closeDrawer:x}},get children(){return y(E0,B({get open(){return v()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:X=>K(X)}))}})}}))})},U0=K0,j0=e=>{const[t,n]=ee(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const c=_(()=>ud(t.contextId)),l=_(()=>jn(t.contextId)),u=_(()=>c().snapPoints().map((x,b)=>dd(x,c().drawerSize(),b,c().breakPoints()))),d=_(()=>{switch(c().side()){case"top":return`translate3d(0, ${-c().translate()}px, 0)`;case"bottom":return`translate3d(0, ${c().translate()}px, 0)`;case"right":return`translate3d(${c().translate()}px, 0, 0)`;case"left":return`translate3d(${-c().translate()}px, 0, 0)`}}),f=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"top":case"bottom":return`${x}px`}}),g=_(()=>{const x=c().transitionSize();if(x)switch(c().side()){case"left":case"right":return`${x}px`}});z(()=>{l().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),H(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const h=x=>{B0(x.target,l().contentRef())&&c().transitionState()!=="closing"&&(r=!0,c().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{v(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&v(x.target,x.touches[0].clientX,x.touches[0].clientY)},v=(x,b,C)=>{if(!r)return;if(!c().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){w();return}if(c().handleScrollableElements()){const S=[b,C].map((Y,F)=>i[F]-Y),P=Math.abs(S[0])>Math.abs(S[1])?"x":"y",R=P==="x"?S[0]:S[1];if(Math.abs(R)<.3)return;const O=l().contentRef(),[V,K]=I0(x,P,O);if(R>0&&Math.abs(V)>1||R<0&&Math.abs(K)>0){w();return}}switch(c().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=b}s=new Date,a=c().translate(),Qe(()=>{c().setIsDragging(!0),c().setTransitionState(null)})}let E;switch(c().side()){case"top":E=-(o-C);break;case"bottom":E=o-C;break;case"right":E=o-b;break;case"left":E=-(o-b);break}E-=c().resolvedActiveSnapPoint().offset,E>0&&(E=c().dampFunction(E));const T=new Date;T.getTime()-s.getTime()>c().velocityCacheReset()&&(s=T,a=c().translate()),c().setTranslate(-E)},w=()=>{if(r=!1,!c().isDragging())return;const x=new Date,b=c().velocityFunction(-(a-c().translate()),x.getTime()-s.getTime()||1),C=c().translate()*b,E=V0(u(),c().translate(),C,c().allowSkippingSnapPoints());Qe(()=>{c().setTransitionState("snapping"),c().setIsDragging(!1)}),Qe(()=>{c().setActiveSnapPoint(E.value),E.offset===c().drawerSize()?l().setOpen(!1):(c().setTranslate(E.offset),parseFloat(c().drawerStyles().transitionDuration)===0&&c().setTransitionState(null))})};return y(m0,B({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":c().isDragging()?"0ms":void 0,height:f(),width:g(),...t.style}},onPointerDown:h,onTransitionEnd:()=>{Qe(()=>{c().transitionState()==="closing"&&c().closeDrawer(),c().transitionState()!=="resizing"&&c().setTransitionState(null)})},get"data-transitioning"(){return xe(c().isTransitioning())},get"data-opening"(){return xe(c().transitionState()==="opening")},get"data-closing"(){return xe(c().transitionState()==="closing")},get"data-snapping"(){return xe(c().transitionState()==="snapping")},get"data-resizing"(){return xe(c().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},W0=j0,H0=e=>{const[t,n]=ee(e,["contextId"]),r=_(()=>ud(t.contextId));return y(w0,B({get contextId(){return t.contextId},get"data-transitioning"(){return xe(r().isTransitioning())},get"data-opening"(){return xe(r().transitionState()==="opening")},get"data-closing"(){return xe(r().transitionState()==="closing")},get"data-snapping"(){return xe(r().transitionState()==="snapping")},get"data-resizing"(){return xe(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},Y0=H0,q0=U('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const G0=U0,X0=_0,Z0=x0,J0=e=>{const[,t]=ee(e,["class"]),n=N0();return y(Y0,B({get class(){return jt("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))},Q0=e=>{const[,t]=ee(e,["class","children"]);return y(Z0,{get mount(){return dr()},get children(){return[y(J0,{}),y(W0,B({id:"smarttalks-list-content",get class(){return jt("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[q0(),Yt(()=>e.children)]}}))]}})};var ex=U('<span class="font-semibold mt-2 max-w-full px-4 text-center break-words">'),tx=U('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),nx=U('<div class="flex flex-col space-y-2"><div>'),rx=U('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),ox=U('<div class="flex min-w-0 flex-col items-start text-left">');const ix=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qt(),[o,i]=L(!1),[s,a]=L(!1),[c,l]=L(),u=(f,g)=>{a(!1),i(!0),r(f,g)},d=f=>{const g=f.composedPath();for(const h of g)if(h.id==="smarttalks-list-content"){f.preventDefault();return}};return(()=>{var f=nx(),g=f.firstChild;return N(f,y(Un,{get children(){return t?.trim()}}),g),N(g,y(G0,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[y(X0,{as:Ue,variant:"outline",class:"w-full min-w-0",get children(){return y(Uo,{class:"min-w-0 truncate",get text(){return n?.trim()??Oe("selectOption")}})}}),y(Q0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var h=ex();return N(h,()=>n?.trim()??Oe("selectOption")),h})(),(()=>{var h=tx();return N(h,y(Ht,{each:e,children:p=>(()=>{var m=rx(),v=m.firstChild;return N(v,()=>p.label?.trim()??""),N(m,y(Ht,{get each(){return p.items},children:w=>y(Ue,{variant:"outline",get disabled(){return o()},get class(){return`h-auto py-3 flex justify-between gap-2 hover:bg-slate-200 ${c()===w?"bg-slate-200":""}`},onClick:()=>l(w),get children(){return[(()=>{var x=ox();return N(x,y(Uo,{class:"max-w-full truncate",get text(){return w.label?.trim()}}),null),N(x,y(Uo,{class:"max-w-full line-clamp-2 text-slate-500",get text(){return w.description?.trim()}}),null),x})(),y(Z,{get when(){return c()===w},get fallback(){return y(Lv,{class:"size-4 shrink-0 text-slate-500"})},get children(){return y(_v,{class:"size-4 shrink-0 text-slate-500"})}})]}})}),null),m})()})),h})(),y(Ue,{get disabled(){return o()||!c()},onClick:()=>u(c().label,c().value),class:"w-11/12 mt-4 hover:bg-primary shadow-sm hover:shadow-primary transition-shadow",get children(){return Oe("send")}})]}})]}})),pe(()=>qt(g,o()?"opacity-50":"")),f})()};var sx=U("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const ax=e=>(()=>{var t=sx(),n=t.firstChild,r=n.nextSibling;return pe(o=>{var i=e.link,s=e.link;return i!==o.e&&me(n,"src",o.e=i),s!==o.t&&me(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var cx=U('<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 lx=e=>(()=>{var t=cx(),n=t.firstChild,r=n.firstChild;return N(n,y(Nv,{class:"size-10"}),r),N(r,()=>e.filename?.trim()),N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(()=>me(n,"href",e.link)),t})();var ux=U('<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 max-w-[320px] rounded-md">');const dx=e=>(()=>{var t=ux(),n=t.firstChild,r=n.firstChild;return N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&me(n,"href",o.e=i),s!==o.t&&me(r,"src",o.t=s),a!==o.a&&me(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var fx=U('<div class="flex flex-col space-y-2"><video controls preload=auto class="w-full h-auto max-w-[320px] rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const hx=e=>(()=>{var t=fx(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(i=>{var s=e.link,a=e.link;return s!==i.e&&me(r,"src",i.e=s),a!==i.t&&me(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var gx=U("<div>Media type not supported");const hd=e=>e.type==="image"?y(dx,e):e.type==="audio"?y(ax,e):e.type==="document"?y(lx,e):e.type==="video"?y(hx,e):gx(),sa=({text:e})=>y(Un,{get children(){return e?.trim()}});var yt=()=>(e,t)=>ee(e,t);function px(e){return e==null?[]:Array.isArray(e)?e:[e]}var mx=e=>e[e.length-1],yx=e=>Array.from(new Set(e));function gd(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):mx(n)?.push(r),n),[])}var pd=e=>e?.constructor.name==="Array",vx=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Zo(e[n],t[n]))return!1;return!0},Zo=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(pd(e)&&pd(t))return vx(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Zo(e[i],t[i]))return!1}return!0},wx=e=>Array.isArray(e),md=e=>e!=null&&typeof e=="object",bx=e=>md(e)&&!wx(e),xx=e=>typeof e=="number"&&!Number.isNaN(e),Wn=e=>typeof e=="string",ot=e=>typeof e=="function",Sx=e=>e==null,yd=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ex=e=>Object.prototype.toString.call(e),vd=Function.prototype.toString,Px=vd.call(Object),kx=e=>{if(!md(e)||Ex(e)!="[object Object]"||Tx(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=yd(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vd.call(n)==Px},Cx=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Ox=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Tx=e=>Cx(e)||Ox(e),wd=()=>{},Ir=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function _r(e,t,...n){if(e in t){const o=t[e];return ot(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,_r),r}var{min:Ax,max:$x}=Math,Dx=e=>Number.isNaN(e),bd=e=>Dx(e)?0:e,aa=(e,t,n)=>{const r=bd(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},Rx=(e,t,n)=>Ax($x(bd(e),t),n);function ca(e){if(!kx(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=ca(o))}return n}function Jo(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function xd(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function la(e,t){if(e==null)throw new Error(t())}function Mx(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function en(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=Se(i);function a(){const c=Te(s);if(!c&&t){const l=new Error(o??Mx(n,r));throw l.name="ContextError",yd(Error,"captureStackTrace")&&ot(Error.captureStackTrace)&&Error.captureStackTrace(l,a),l}return c}return[s.Provider,a,s]}en({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var Ix=e=>yt()(e,["lazyMount","unmountOnExit"]),_x=e=>typeof e=="function",Sd=(e,...t)=>_x(e)?e(...t):e;function Lx(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var Nx=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Fx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ed=e=>{const t={};let n;for(;n=Fx.exec(e);)t[n[1]]=n[2];return t},Vx=(e,t)=>{if(Wn(e)){if(Wn(t))return`${e};${t}`;e=Ed(e)}else Wn(t)&&(t=Ed(t));return Object.assign({},e??{},t??{})};function Bx(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=Ir(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=Nx(t[o],n[o]);continue}if(o==="style"){t[o]=Vx(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function zx(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,l)=>!Zo(r[l],c)))&&(r=s,o=t(s,i)),o}}var tn=".",Pd="#",kd=new WeakMap,Cd=new WeakMap;function ua(e){return e.join(tn)}function Kx(e){return e.includes(tn)}function Od(e){return e.startsWith(Pd)}function Ux(e){return e.startsWith(tn)}function jx(e){return Od(e)?e.slice(Pd.length):e}function da(e,t){return e?`${e}${tn}${t}`:t}function Wx(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&xd(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){la(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||xd(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const u=da(o,c);r(u,l)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Lr(e){const t=kd.get(e);if(t)return t;const{index:n,idIndex:r}=Wx(e);return kd.set(e,n),Cd.set(e,r),n}function Hx(e,t){return Lr(e),Cd.get(e)?.get(t)}function fa(e){return e?String(e).split(tn).filter(Boolean):[]}function Qo(e,t){if(!t)return[];const n=Lr(e),r=fa(t),o=[],i=[];for(const s of r){i.push(s);const a=ua(i),c=n.get(a);if(!c)break;o.push({path:a,state:c})}return o}function Nr(e,t){const n=Lr(e),r=fa(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const c=ua(o);if(!n.has(c))return t}let i=ua(o),s=n.get(i);for(;s?.initial;){const a=`${i}${tn}${s.initial}`,c=n.get(a);if(!c)break;i=a,s=c}return i}function Td(e,t){return Lr(e).has(t)}function Ad(e,t,n){const r=String(t);if(Od(r)){const o=jx(r),i=Hx(e,o);return la(i,()=>`[zag-js] Unknown state id: "${o}"`),Nr(e,i)}if(Ux(r)&&n){const o=da(n,r.slice(1));return Nr(e,o)}if(!Kx(r)&&n){const o=fa(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(tn),a=da(s,r);if(Td(e,a))return Nr(e,a)}if(Td(e,r))return Nr(e,r)}return Nr(e,r)}function Yx(e,t,n){const r=Qo(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function qx(e,t,n,r){const o=t?Qo(e,t):[],i=Qo(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),c=i.slice(s);const l=o.at(-1)?.path===i.at(-1)?.path;return r&&l&&(a=o.slice().reverse(),c=i),{exiting:a,entering:c}}function Gx(e,t){return e?e===t||e.startsWith(`${t}${tn}`):!1}function Xx(e,t,n){return Qo(e,t).some(r=>r.state.tags?.includes(n))}function Zx(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function $d(e){return Lr(e),e}var Hn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Hn||{}),ei="__init__",Jx=Object.defineProperty,Qx=(e,t,n)=>t in e?Jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ha=(e,t,n)=>Qx(e,typeof t!="symbol"?t+"":t,n),Dd=()=>{},ti=e=>typeof e=="object"&&e!==null,j=e=>e?"":void 0,Pe=e=>e?"true":void 0,e1=1,t1=9,n1=11,Fe=e=>ti(e)&&e.nodeType===e1&&typeof e.nodeName=="string",ga=e=>ti(e)&&e.nodeType===t1,r1=e=>ti(e)&&e===e.window,Rd=e=>Fe(e)?e.localName||"":"#document";function o1(e){return["html","body","#document"].includes(Rd(e))}var Md=e=>ti(e)&&e.nodeType!==void 0,Yn=e=>Md(e)&&e.nodeType===n1&&"host"in e,i1=e=>Fe(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function s1(e){if(!e)return!1;const t=e.getRootNode();return Id(t)===e}function ni(e,t){if(!e||!t||!Fe(e)||!Md(t))return!1;if(Fe(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&Yn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wn(e){return ga(e)?e:r1(e)?e.document:e?.ownerDocument??document}function a1(e){return wn(e).documentElement}function At(e){return Yn(e)?At(e.host):ga(e)?e.defaultView??window:Fe(e)?e.ownerDocument?.defaultView??window:window}function Id(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function c1(e){if(Rd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||a1(e);return Yn(t)?t.host:t}function l1(e){let t;try{if(t=e.getRootNode({composed:!0}),ga(t)||Yn(t))return t}catch{}return e.ownerDocument??document}var pa=new WeakMap;function ma(e){return pa.has(e)||pa.set(e,At(e).getComputedStyle(e)),pa.get(e)}var u1=new Set(["menu","listbox","dialog","grid","tree","region","application"]),d1=e=>u1.has(e),f1=e=>e.getAttribute("aria-controls")?.split(" ")||[];function h1(e,t){const n=new Set,r=l1(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const c=f1(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const u=r.getElementById(l);if(u){const d=u.getAttribute("role"),f=u.getAttribute("aria-modal")==="true";if(d&&d1(d)&&!f&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}var _d=()=>typeof document<"u";function g1(){return navigator.userAgentData?.platform??navigator.platform}var ya=e=>_d()&&e.test(g1()),Ld=()=>_d()&&!!navigator.maxTouchPoints,p1=()=>ya(/^iPhone/i),m1=()=>ya(/^iPad/i)||Fd()&&navigator.maxTouchPoints>1,Nd=()=>p1()||m1(),Fd=()=>ya(/^Mac/i);function y1(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function qn(e){return y1(e)?.[0]??e.target}function v1(e){return Bd(e).isComposing||e.keyCode===229}var w1=e=>e.button===2||Fd()&&e.ctrlKey&&e.button===0,b1={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Vd={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function x1(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=b1[o]??o,n==="rtl"&&r==="horizontal"&&o in Vd&&(o=Vd[o]),o}function Bd(e){return e.nativeEvent??e}var ri=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function S1(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=At(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function E1(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function oi(e,t,n="value"){if(!e)return;const r=E1(e);r&&S1(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var P1="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function zd(e){return!Fe(e)||e.closest("[inert]")?!1:e.matches(P1)&&i1(e)}var k1=class Nh{constructor(){ha(this,"id",null),ha(this,"fn_cleanup"),ha(this,"cleanup",()=>{this.cancel()})}static create(){return new Nh}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function $e(e){const t=k1.create();return t.request(e),t.cleanup}function va(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function wa(e){const t=c1(e);return o1(t)?wn(t).body:Fe(t)&&T1(t)?t:wa(t)}var C1=/auto|scroll|overlay|hidden|clip/,O1=new Set(["inline","contents"]);function T1(e){const t=At(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return C1.test(n+o+r)&&!O1.has(i)}var Gn="default",ba="",ii=new WeakMap;function A1(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return Nd()?(Gn==="default"&&(ba=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Gn="disabled"):t&&(ii.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Kd({target:t,doc:r})}function Kd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(Nd()){if(Gn!=="disabled")return;Gn="restoring",setTimeout(()=>{va(()=>{Gn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=ba||""),ba="",Gn="default")})},300)}else if(t&&ii.has(t)){const i=ii.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),ii.delete(t)}}function $1(e={}){const{defer:t,target:n,...r}=e,o=t?$e:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(A1({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function D1(e,t){return Array.from(e?.querySelectorAll(t)??[])}function R1(e,t){return e?.querySelector(t)??null}function Ud(e,t){if(!e)return Dd;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return M1(n,t)?Dd:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function M1(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function I1(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{r.aborted||(clearTimeout(c),s(l))}).catch(l=>{r.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function _1(e,t){const{timeout:n,rootNode:r}=t,o=At(r),i=wn(r),s=new o.AbortController;return I1(new Promise(a=>{const c=e();if(c){a(c);return}const l=new o.MutationObserver(()=>{const u=e();u&&u.isConnected&&(l.disconnect(),a(u))});l.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function L1(e){const t=()=>e.getRootNode?.()??document,n=()=>wn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>Id(t()),isActiveElement:s1,getById:s=>t().getElementById(s)}}var N1=$d({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=At(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",ma(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});$e(()=>{if(r("present"))return;const s=si(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{$e(()=>{e.set("prevAnimationName",si(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=l=>{(l.composedPath?.()?.[0]??l.target)===o&&e.set("prevAnimationName",si(t.get("styles")))},s=l=>{const u=si(t.get("styles"));qn(l)===o&&u===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=l=>{qn(l)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const c=Ud(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),va(()=>c())}}}}});function si(e){return e?.animationName||"none"}function F1(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function ai(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=L(t),i=_(()=>e().value!=null),s={current:r()},a={current:void 0};z(()=>{const u=i()?e().value:r();a.current=u,s.current=u});const c=u=>{const d=a.current,f=ot(u)?u(s.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:f,prev:d}),i()||o(f),n(f,d)||e().onChange?.(f,d)};function l(){const u=i()?e().value:r;return ot(u)?u():u}return{initial:t,ref:s,get:l,set:c,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}ai.cleanup=e=>{H(()=>e())},ai.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function V1(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function xa(e){return ot(e)?e():e}var B1=(e,t)=>{let n=[],r=!0;z(()=>{if(r){n=e.map(i=>xa(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Zo(n[i],xa(e[i]))){o=!0;break}o&&(n=e.map(i=>xa(i)),t())})};function jd(e,t={}){const n=_(()=>{const{id:D,ids:S,getRootNode:P}=Sa(t);return L1({id:D,ids:S,getRootNode:P})}),r=(...D)=>{e.debug&&console.log(...D)},o=_(()=>e.props?.({props:ca(Sa(t)),scope:n()})??Sa(t)),i=z1(o),s=e.context?.({prop:i,bindable:ai,get scope(){return n()},flush:Wd,getContext(){return a},getComputed(){return b},getRefs(){return h},getEvent(){return f()}}),a={get(D){return s?.[D].get()},set(D,S){s?.[D].set(S)},initial(D){return s?.[D].initial},hash(D){const S=s?.[D].get();return s?.[D].hash(S)}},c={current:new Map},l={current:null},u={current:null},d={current:{type:""}},f=()=>B(d.current,{current(){return d.current},previous(){return u.current}}),g=()=>B(C,{matches(...D){const S=C.get();return D.some(P=>Gx(S,P))},hasTag(D){const S=C.get();return Xx(e,S,D)}}),h=V1(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:f(),prop:i,send:T,action:m,guard:v,track:B1,refs:h,computed:b,flush:Wd,get scope(){return n()},choose:x}),m=D=>{const S=ot(D)?D(p()):D;if(!S)return;const P=S.map(R=>{const O=e.implementations?.actions?.[R];return O||Jo(`[zag-js] No implementation found for action "${JSON.stringify(R)}"`),O});for(const R of P)R?.(p())},v=D=>{if(ot(D))return D(p());const S=e.implementations?.guards?.[D];return S||Jo(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),S?.(p())},w=D=>{const S=ot(D)?D(p()):D;if(!S)return;const P=S.map(O=>{const V=e.implementations?.effects?.[O];return V||Jo(`[zag-js] No implementation found for effect "${JSON.stringify(O)}"`),V}),R=[];for(const O of P){const V=O?.(p());V&&R.push(V)}return()=>R.forEach(O=>O?.())},x=D=>px(D).find(S=>{let P=!S.guard;return Wn(S.guard)?P=!!v(S.guard):ot(S.guard)&&(P=S.guard(p())),P}),b=D=>{la(e.computed,()=>"[zag-js] No computed object found on machine");const S=e.computed[D];return S({context:a,event:d.current,prop:i,refs:h,scope:n(),computed:b})},C=ai(()=>({defaultValue:Ad(e,e.initialState({prop:i})),onChange(D,S){const{exiting:P,entering:R}=qx(e,S,D,l.current?.reenter);if(P.forEach(O=>{c.current.get(O.path)?.(),c.current.delete(O.path)}),P.forEach(O=>{m(O.state?.exit)}),m(l.current?.actions),R.forEach(O=>{const V=w(O.state?.effects);if(V){const K=c.current.get(O.path);c.current.set(O.path,K?Ir(K,V):V)}}),S===ei){m(e.entry);const O=w(e.effects);if(O){const V=c.current.get(ei);c.current.set(ei,V?Ir(V,O):O)}}R.forEach(O=>{m(O.state?.entry)})}}));let E=Hn.NotStarted;Wt(()=>{const D=E===Hn.Started;E=Hn.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,ei)}),H(()=>{r("unmounting..."),E=Hn.Stopped,c.current.forEach(S=>S?.()),c.current=new Map,l.current=null,m(e.exit)});const T=D=>{queueMicrotask(()=>{if(E!==Hn.Started)return;u.current=d.current,d.current=D;let S=re(()=>C.get());const{transitions:P,source:R}=Yx(e,S,D.type),O=x(P);if(!O)return;l.current=O;const V=Ad(e,O.target??S,R);r("transition",D.type,O.target||S,`(${O.actions})`),V!==S?C.set(V):O.reenter?C.invoke(S,S):m(O.actions)})};return e.watch?.(p()),{state:g(),send:T,context:a,prop:i,get scope(){return n()},refs:h,computed:b,event:f(),getStatus:()=>E}}function Wd(e){e()}function Sa(e){return ot(e)?e():e}function z1(e){return function(n){return e()[n]}}function te(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let c=e[a];typeof c=="function"&&(c=c()),s=Bx(s,{[i]:(c||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let c,l=e[a];if(typeof l=="function"&&(l=l()),c=(l||{})[i],c!==void 0)return c}}})}}return t}var Hd={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},K1=e=>e.startsWith("--")?e:G1(e);function U1(e){return e in Hd?Hd[e]:e}var j1=F1(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&bx(r)){t.style=W1(r);continue}if(n==="children"){Wn(r)&&(t.textContent=r);continue}t[U1(n)]=r}}return t});function W1(e){let t={};for(const n in e){const r=e[n];!Wn(r)&&!xx(r)||(t[K1(n)]=r)}return t}var H1=/[A-Z]/g,Y1=/^ms-/;function q1(e){return"-"+e.toLowerCase()}var Ea={};function G1(e){if(Ea.hasOwnProperty(e))return Ea[e];const t=e.replace(H1,q1);return Ea[e]=Y1.test(t)?"-"+t:t}var Yd=e=>{const[t,n]=Ix(Sd(e)),[r,o]=L(!1),i=jd(N1,e),s=_(()=>Lx(i));z(()=>{s().present&&o(!0)});const a=c=>{c&&i.send({type:"NODE.SET",node:c})};return _(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},X1=e=>typeof e=="function",qd=(e,t)=>{for(const n of e)X1(n)&&n(t)};function Z1(...e){let t=null;return z(()=>{qd(e,t)}),n=>{t=n,qd(e,n)}}var Pa=e=>n=>{const[r,o]=ee(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=ee(o,["ref"]);return te(a,s)};return r.asChild(i)}return y(yr,B({component:e},o))};function J1(){const e=new Map;return new Proxy(Pa,{apply(t,n,r){return Pa(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Pa(r)),e.get(r)}})}var oe=J1(),Gd=e=>yt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[Xd,Zd]=en({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Fr=(e,t=[])=>({parts:(...n)=>{if(Q1(t))return Fr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Fr(e,[...t,...n]),omit:(...n)=>Fr(e,t.filter(r=>!n.includes(r))),rename:n=>Fr(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Xn(e)}"][data-part="${Xn(r)}"]`,`& [data-scope="${Xn(e)}"][data-part="${Xn(r)}"]`].join(", "),attrs:{"data-scope":Xn(e),"data-part":Xn(r)}}}),{})}),Xn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Q1=e=>e.length===0;const eS=["top","right","bottom","left"],nn=Math.min,Ve=Math.max,ci=Math.round,li=Math.floor,vt=e=>({x:e,y:e}),tS={left:"right",right:"left",bottom:"top",top:"bottom"};function ka(e,t,n){return Ve(e,nn(t,n))}function $t(e,t){return typeof e=="function"?e(t):e}function Dt(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function Ca(e){return e==="x"?"y":"x"}function Oa(e){return e==="y"?"height":"width"}function wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ta(e){return Ca(wt(e))}function nS(e,t,n){n===void 0&&(n=!1);const r=Zn(e),o=Ta(e),i=Oa(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ui(s)),[s,ui(s)]}function rS(e){const t=ui(e);return[Aa(e),t,Aa(t)]}function Aa(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Jd=["left","right"],Qd=["right","left"],oS=["top","bottom"],iS=["bottom","top"];function sS(e,t,n){switch(e){case"top":case"bottom":return n?t?Qd:Jd:t?Jd:Qd;case"left":case"right":return t?oS:iS;default:return[]}}function aS(e,t,n,r){const o=Zn(e);let i=sS(Dt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Aa)))),i}function ui(e){const t=Dt(e);return tS[t]+e.slice(t.length)}function cS(e){return{top:0,right:0,bottom:0,left:0,...e}}function ef(e){return typeof e!="number"?cS(e):{top:e,right:e,bottom:e,left:e}}function di(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function tf(e,t,n){let{reference:r,floating:o}=e;const i=wt(t),s=Ta(t),a=Oa(s),c=Dt(t),l=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Zn(t)){case"start":g[s]-=f*(n&&l?-1:1);break;case"end":g[s]+=f*(n&&l?-1:1);break}return g}async function lS(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=$t(t,e),h=ef(g),m=a[f?d==="floating"?"reference":"floating":d],v=di(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=di(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(v.top-C.top+h.top)/b.y,bottom:(C.bottom-v.bottom+h.bottom)/b.y,left:(v.left-C.left+h.left)/b.x,right:(C.right-v.right+h.right)/b.x}}const uS=50,dS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:lS},c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=tf(l,r,c),f=r,g=0;const h={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:v,fn:w}=m,{x,y:b,data:C,reset:E}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});u=x??u,d=b??d,h[v]={...h[v],...C},E&&g<uS&&(g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(l=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=tf(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}},fS=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=$t(e,t)||{};if(l==null)return{};const d=ef(u),f={x:n,y:r},g=Ta(o),h=Oa(g),p=await s.getDimensions(l),m=g==="y",v=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],C=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=E?E[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[x]||i.floating[h]);const D=b/2-C/2,S=T/2-p[h]/2-1,P=nn(d[v],S),R=nn(d[w],S),O=P,V=T-p[h]-R,K=T/2-p[h]/2+D,Y=ka(O,K,V),F=!c.arrow&&Zn(o)!=null&&K!==Y&&i.reference[h]/2-(K<O?P:R)-p[h]/2<0,W=F?K<O?K-O:K-V:0;return{[g]:f[g]+W,data:{[g]:Y,centerOffset:K-Y-W,...F&&{alignmentOffset:W}},reset:F}}}),hS=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:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=$t(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Dt(o),w=wt(a),x=Dt(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=f||(x||!p?[ui(a)]:rS(a)),E=h!=="none";!f&&E&&C.push(...aS(a,p,h,b));const T=[a,...C],D=await c.detectOverflow(t,m),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(D[v]),d){const K=nS(o,s,b);S.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(K=>K<=0)){var R,O;const K=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=T[K];if(Y&&(!(d==="alignment"?w!==wt(Y):!1)||P.every(X=>wt(X.placement)===w?X.overflows[0]>0:!0)))return{data:{index:K,overflows:P},reset:{placement:Y}};let F=(O=P.filter(W=>W.overflows[0]<=0).sort((W,X)=>W.overflows[1]-X.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var V;const W=(V=P.filter(X=>{if(E){const G=wt(X.placement);return G===w||G==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(G=>G>0).reduce((G,Xe)=>G+Xe,0)]).sort((X,G)=>X[1]-G[1])[0])==null?void 0:V[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function nf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rf(e){return eS.some(t=>e[t]>=0)}const gS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=$t(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=nf(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:rf(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=nf(s,n.floating);return{data:{escapedOffsets:a,escaped:rf(a)}}}default:return{}}}}},of=new Set(["left","top"]);async function pS(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Dt(n),a=Zn(n),c=wt(n)==="y",l=of.has(s)?-1:1,u=i&&c?-1:1,d=$t(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),c?{x:g*u,y:f*l}:{x:f*l,y:g*u}}const mS=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,c=await pS(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},yS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:w,y:x}=v;return{x:w,y:x}}},...l}=$t(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),f=wt(Dt(o)),g=Ca(f);let h=u[g],p=u[f];if(s){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=h+d[v],b=h-d[w];h=ka(x,h,b)}if(a){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=p+d[v],b=p-d[w];p=ka(x,p,b)}const m=c.fn({...t,[g]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[f]:a}}}}}},vS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=$t(e,t),u={x:n,y:r},d=wt(o),f=Ca(d);let g=u[f],h=u[d];const p=$t(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=f==="y"?"height":"width",b=i.reference[f]-i.floating[x]+m.mainAxis,C=i.reference[f]+i.reference[x]-m.mainAxis;g<b?g=b:g>C&&(g=C)}if(l){var v,w;const x=f==="y"?"width":"height",b=of.has(Dt(o)),C=i.reference[d]-i.floating[x]+(b&&((v=s.offset)==null?void 0:v[d])||0)+(b?0:m.crossAxis),E=i.reference[d]+i.reference[x]+(b?0:((w=s.offset)==null?void 0:w[d])||0)-(b?m.crossAxis:0);h<C?h=C:h>E&&(h=E)}return{[f]:g,[d]:h}}}},wS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:c=()=>{},...l}=$t(e,t),u=await s.detectOverflow(t,l),d=Dt(o),f=Zn(o),g=wt(o)==="y",{width:h,height:p}=i.floating;let m,v;d==="top"||d==="bottom"?(m=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=h-u.left-u.right,b=nn(p-u[m],w),C=nn(h-u[v],x),E=!t.middlewareData.shift;let T=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!f){const P=Ve(u.left,0),R=Ve(u.right,0),O=Ve(u.top,0),V=Ve(u.bottom,0);g?D=h-2*(P!==0||R!==0?P+R:Ve(u.left,u.right)):T=p-2*(O!==0||V!==0?O+V:Ve(u.top,u.bottom))}await c({...t,availableWidth:D,availableHeight:T});const S=await s.getDimensions(a.floating);return h!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function fi(){return typeof window<"u"}function Jn(e){return sf(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(sf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sf(e){return fi()?e instanceof Node||e instanceof Be(e).Node:!1}function it(e){return fi()?e instanceof Element||e instanceof Be(e).Element:!1}function Rt(e){return fi()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function af(e){return!fi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function Vr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function bS(e){return/^(table|td|th)$/.test(Jn(e))}function hi(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const xS=/transform|translate|scale|rotate|perspective|filter/,SS=/paint|layout|strict|content/,bn=e=>!!e&&e!=="none";let $a;function Da(e){const t=it(e)?st(e):e;return bn(t.transform)||bn(t.translate)||bn(t.scale)||bn(t.rotate)||bn(t.perspective)||!Ra()&&(bn(t.backdropFilter)||bn(t.filter))||xS.test(t.willChange||"")||SS.test(t.contain||"")}function ES(e){let t=rn(e);for(;Rt(t)&&!Qn(t);){if(Da(t))return t;if(hi(t))return null;t=rn(t)}return null}function Ra(){return $a==null&&($a=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$a}function Qn(e){return/^(html|body|#document)$/.test(Jn(e))}function st(e){return Be(e).getComputedStyle(e)}function gi(e){return it(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rn(e){if(Jn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||af(e)&&e.host||bt(e);return af(t)?t.host:t}function cf(e){const t=rn(e);return Qn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&Vr(t)?t:cf(t)}function Br(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cf(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Be(o);if(i){const a=Ma(s);return t.concat(s,s.visualViewport||[],Vr(o)?o:[],a&&n?Br(a):[])}else return t.concat(o,Br(o,[],n))}function Ma(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lf(e){const t=st(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Rt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ci(n)!==i||ci(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ia(e){return it(e)?e:e.contextElement}function er(e){const t=Ia(e);if(!Rt(t))return vt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=lf(t);let s=(i?ci(n.width):n.width)/r,a=(i?ci(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const PS=vt(0);function uf(e){const t=Be(e);return!Ra()||!t.visualViewport?PS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kS(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function xn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ia(e);let s=vt(1);t&&(r?it(r)&&(s=er(r)):s=er(e));const a=kS(i,n,r)?uf(i):vt(0);let c=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Be(i),g=r&&it(r)?Be(r):r;let h=f,p=Ma(h);for(;p&&r&&g!==h;){const m=er(p),v=p.getBoundingClientRect(),w=st(p),x=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,d*=m.y,c+=x,l+=b,h=Be(p),p=Ma(h)}}return di({width:u,height:d,x:c,y:l})}function pi(e,t){const n=gi(e).scrollLeft;return t?t.left+n:xn(bt(e)).left+n}function df(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function CS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=bt(r),a=t?hi(t.floating):!1;if(r===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1);const u=vt(0),d=Rt(r);if((d||!d&&!i)&&((Jn(r)!=="body"||Vr(s))&&(c=gi(r)),d)){const g=xn(r);l=er(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!d&&!i?df(s,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function OS(e){return Array.from(e.getClientRects())}function TS(e){const t=bt(e),n=gi(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+pi(e);const a=-n.scrollTop;return st(r).direction==="rtl"&&(s+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ff=25;function AS(e,t){const n=Be(e),r=bt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;const u=Ra();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=pi(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-g);h<=ff&&(i-=h)}else l<=ff&&(i+=l);return{width:i,height:s,x:a,y:c}}function $S(e,t){const n=xn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Rt(e)?er(e):vt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=o*i.x,l=r*i.y;return{width:s,height:a,x:c,y:l}}function hf(e,t,n){let r;if(t==="viewport")r=AS(e,n);else if(t==="document")r=TS(bt(e));else if(it(t))r=$S(t,n);else{const o=uf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return di(r)}function gf(e,t){const n=rn(e);return n===t||!it(n)||Qn(n)?!1:st(n).position==="fixed"||gf(n,t)}function DS(e,t){const n=t.get(e);if(n)return n;let r=Br(e,[],!1).filter(a=>it(a)&&Jn(a)!=="body"),o=null;const i=st(e).position==="fixed";let s=i?rn(e):e;for(;it(s)&&!Qn(s);){const a=st(s),c=Da(s);!c&&a.position==="fixed"&&(o=null),(i?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Vr(s)&&!c&&gf(e,s))?r=r.filter(u=>u!==s):o=a,s=rn(s)}return t.set(e,r),r}function RS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?hi(t)?[]:DS(t,this._c):[].concat(n),r],a=hf(t,s[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<s.length;f++){const g=hf(t,s[f],o);c=Ve(g.top,c),l=nn(g.right,l),u=nn(g.bottom,u),d=Ve(g.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function MS(e){const{width:t,height:n}=lf(e);return{width:t,height:n}}function IS(e,t,n){const r=Rt(t),o=bt(t),i=n==="fixed",s=xn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=vt(0);function l(){c.x=pi(o)}if(r||!r&&!i)if((Jn(t)!=="body"||Vr(o))&&(a=gi(t)),r){const g=xn(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=o&&!r&&!i?df(o,a):vt(0),d=s.left+a.scrollLeft-c.x-u.x,f=s.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function _a(e){return st(e).position==="static"}function pf(e,t){if(!Rt(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function mf(e,t){const n=Be(e);if(hi(e))return n;if(!Rt(e)){let o=rn(e);for(;o&&!Qn(o);){if(it(o)&&!_a(o))return o;o=rn(o)}return n}let r=pf(e,t);for(;r&&bS(r)&&_a(r);)r=pf(r,t);return r&&Qn(r)&&_a(r)&&!Da(r)?n:r||ES(e)||n}const _S=async function(e){const t=this.getOffsetParent||mf,n=this.getDimensions,r=await n(e.floating);return{reference:IS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LS(e){return st(e).direction==="rtl"}const NS={convertOffsetParentRelativeRectToViewportRelativeRect:CS,getDocumentElement:bt,getClippingRect:RS,getOffsetParent:mf,getElementRects:_S,getClientRects:OS,getDimensions:MS,getScale:er,isElement:it,isRTL:LS};function yf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function FS(e,t){let n=null,r;const o=bt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=l;if(a||t(),!f||!g)return;const h=li(d),p=li(o.clientWidth-(u+f)),m=li(o.clientHeight-(d+g)),v=li(u),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Ve(0,nn(1,c))||1};let b=!0;function C(E){const T=E[0].intersectionRatio;if(T!==c){if(!b)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!yf(l,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function VS(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:c=!1}=r,l=Ia(e),u=o||i?[...l?Br(l):[],...t?Br(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&a?FS(l,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(v=>{let[w]=v;w&&w.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let h,p=c?xn(e):null;c&&m();function m(){const v=xn(e);p&&!yf(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(h)}}const BS=mS,zS=yS,KS=hS,US=wS,jS=gS,WS=fS,HS=vS,YS=(e,t,n)=>{const r=new Map,o={platform:NS,...n},i={...o.platform,_c:r};return dS(e,t,{...o,platform:i})};function vf(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function qS(e){if(!e)return vf();const{x:t,y:n,width:r,height:o}=e;return vf(t,n,r,o)}function GS(e,t){return{contextElement:Fe(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?qS(r):n.getBoundingClientRect()}}}var zr=e=>({variable:e,reference:`var(${e})`}),Mt={arrowSize:zr("--arrow-size"),arrowSizeHalf:zr("--arrow-size-half"),arrowBg:zr("--arrow-background"),transformOrigin:zr("--transform-origin"),arrowOffset:zr("--arrow-offset")},XS=e=>e==="top"||e==="bottom"?"y":"x";function ZS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,c=i.split("-")[0],l=XS(c),u=o.arrow?.x||0,d=o.arrow?.y||0,f=t?.clientWidth||0,g=t?.clientHeight||0,h=u+f/2,p=d+g/2,m=Math.abs(o.shift?.y||0),v=s.reference.height/2,w=g/2,x=e.offset?.mainAxis??e.gutter,b=typeof x=="number"?x+w:x??w,C=m>b,E={top:`${h}px calc(100% + ${b}px)`,bottom:`${h}px ${-b}px`,left:`calc(100% + ${b}px) ${p}px`,right:`${-b}px ${p}px`}[c],T=`${h}px ${s.reference.y+v-a}px`,D=!!e.overlap&&l==="y"&&C;return r.floating.style.setProperty(Mt.transformOrigin.variable,D?T:E),{data:{transformOrigin:D?T:E}}}}}var JS={name:"rects",fn({rects:e}){return{data:e}}},QS=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Mt.arrowOffset.reference})`}),{}}}};function eE(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function tE(e){return e.split("-")[0]}var nE={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function wf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function tr(e,t){return e!=null&&Math.abs(e-t)<.5}function mi(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function rE(e,t,n){const r=e||t.createElement("div");return WS({element:r,padding:n.arrowPadding})}function oE(e,t){if(!Sx(t.offset??t.gutter))return BS(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=eE(n),a=s?void 0:t.shift,c=t.offset?.crossAxis??a;return ca({crossAxis:c,mainAxis:i,alignmentAxis:t.shift})})}function iE(e){if(e.flip)return KS(()=>{const t=mi(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function sE(e){if(!(!e.slide&&!e.overlap))return zS(()=>{const t=mi(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:HS()}})}function aE(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return US(()=>{const i=mi(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:c,availableWidth:l}){const u=s.floating,d=Math.round(a.reference.width),f=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),tr(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),tr(n,f)||(u.style.setProperty("--reference-height",`${f}px`),n=f),tr(r,l)||(u.style.setProperty("--available-width",`${l}px`),r=l),tr(o,c)||(u.style.setProperty("--available-height",`${c}px`),o=c)}}})}function cE(e){if(e.hideWhenDetached)return jS(()=>({strategy:"referenceHidden",boundary:mi(e.boundary)??"clippingAncestors"}))}function lE(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var uE=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],dE=["top","right","bottom","left"];function bf(e,t){if(!e)return wd;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function xf(e){return e==null?null:Fe(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function fE(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const P=typeof e=="function"?e():e;return n.getAnchorElement?.()??P},i=()=>{const P=o();return!P&&!n.getAnchorRect?null:GS(P,n.getAnchorRect)},s=Object.assign({},nE,n);let a=[],c=null,l,u;function d(P){l?.(),u?.(),c=P,l=s.restoreStyles?bf(P,uE):void 0;const R=P.querySelector("[data-part=arrow]");u=s.restoreStyles?bf(R,dE):void 0,a=[oE(R,s),iE(s),sE(s),rE(R,P.ownerDocument,s),QS(R),ZS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},R),aE(s),cE(s),JS]}const{placement:f,strategy:g,onComplete:h,onPositioned:p}=s;let m,v,w=!1,x,b,C=wd;const E=lE(s.listeners);function T(){if(!s.listeners)return;const P=o(),R=i(),O=r();if(!R||!O)return;(xf(P)!==xf(x)||O!==b)&&(C(),x=P,b=O,C=VS(R,O,S,E))}async function D(){T();const P=r();if(!P)return;P!==c&&(d(P),w=!1);const R=i();if(!R)return;const O=await YS(R,P,{placement:f,middleware:a,strategy:g});h?.(O);const V=At(P),K=wf(V,O.x),Y=wf(V,O.y);if(tr(m,K)||(P.style.setProperty("--x",`${K}px`),m=K),tr(v,Y)||(P.style.setProperty("--y",`${Y}px`),v=Y),s.hideWhenDetached&&(O.middlewareData.hide?.referenceHidden?(P.style.setProperty("visibility","hidden"),P.style.setProperty("pointer-events","none")):(P.style.removeProperty("visibility"),P.style.removeProperty("pointer-events"))),!w){const F=P.firstElementChild;F&&(P.style.setProperty("--z-index",ma(F).zIndex),w=!0)}}async function S(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return S(),()=>{C(),u?.(),l?.(),p?.({placed:!1})}}function hE(e,t,n={}){const{defer:r,...o}=n,i=r?$e:a=>a(),s=[];return s.push(i(()=>{s.push(fE(e,t,o))})),()=>{s.forEach(a=>a?.())}}var gE={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function pE(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Mt.arrowSize.reference,height:Mt.arrowSize.reference,[Mt.arrowSizeHalf.variable]:`calc(${Mt.arrowSize.reference} / 2)`,[Mt.arrowOffset.variable]:`calc(${Mt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?gE[t.split("-")[0]]:void 0,background:Mt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function mE(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function yE(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var Sf="pointerdown.outside",Ef="focus.outside";function vE(e){for(const t of e)if(Fe(t)&&zd(t))return!0;return!1}var Pf=e=>"clientY"in e;function wE(e,t){if(!Pf(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function bE(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function kf(e,t){if(!t||!Pf(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return bE(s,a)?r||i:!1}function xE(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const c=wn(e),l=At(e),u=mE(l),d=yE(l);function f(b,C){if(!Fe(C)||!C.isConnected||ni(e,C)||wE(e,b)||a&&h1(e,C))return!1;const E=c.querySelector(`[aria-controls="${e.id}"]`);if(E){const D=wa(E);if(kf(b,D))return!1}const T=wa(e);return kf(b,T)?!1:!n?.(C)}const g=new Set,h=Yn(e?.getRootNode());let p=!1;function m(b){p=!0;const C=()=>{p=!1};c.addEventListener("pointerup",C,{once:!0}),l.addEventListener("pointerup",C,{once:!0});function E(T){const D=s&&!Ld()?$e:R=>R(),S=T??b,P=S?.composedPath?.()??[S?.target];D(()=>{const R=h?P[0]:qn(b);if(!(!e||!f(b,R))){if(o||i){const O=Ir(o,i);e.addEventListener(Sf,O,{once:!0})}Cf(e,Sf,{bubbles:!1,cancelable:!0,detail:{originalEvent:S,contextmenu:w1(S),focusable:vE(P),target:R}})}})}b.pointerType==="touch"?(g.forEach(T=>T()),g.add(ri(c,"click",E,{once:!0})),g.add(d.addEventListener("click",E,{once:!0})),g.add(u.addEventListener("click",E,{once:!0}))):E()}const v=new Set,w=setTimeout(()=>{v.add(ri(c,"pointerdown",m,!0)),v.add(d.addEventListener("pointerdown",m,!0)),v.add(u.addEventListener("pointerdown",m,!0))},0);function x(b){if(p)return;(s?$e:E=>E())(()=>{const E=b?.composedPath?.()??[b?.target],T=h?E[0]:qn(b);if(!(!e||!f(b,T))){if(r||i){const D=Ir(r,i);e.addEventListener(Ef,D,{once:!0})}Cf(e,Ef,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:zd(T),target:T}})}})}return Ld()||(v.add(ri(c,"focusin",x,!0)),v.add(d.addEventListener("focusin",x,!0)),v.add(u.addEventListener("focusin",x,!0))),()=>{clearTimeout(w),g.forEach(b=>b()),v.forEach(b=>b())}}function SE(e,t){const{defer:n}=t,r=n?$e:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(xE(i,t))})),()=>{o.forEach(i=>i?.())}}function Cf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function EE(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return ri(wn(e),"keydown",n,{capture:!0})}var Of="layer:request-dismiss",De={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>ni(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>ni(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&PE(o)}),this.recentlyRemoved.add(e),va(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>De.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Tf(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;Tf(e,t,r);const{zIndex:o}=ma(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];CE(e,Of,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),kE(e,Of,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Tf(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),De.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=De.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function PE(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function kE(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function CE(e,t,n){e.addEventListener(t,n,{once:!0})}var La=new WeakMap,Kr=new WeakMap;function OE(e){return De.isBelowPointerBlockingLayer(e)?"none":"auto"}function Af(e){const t=OE(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function TE(e){if(Kr.has(e))return;const t=At(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Kr.has(e)&&Af(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Kr.set(e,n)}function $f(){De.layers.forEach(({node:e})=>{Af(e),TE(e)})}function AE(e){const t=Kr.get(e);t&&(t.disconnect(),Kr.delete(e)),e.style.pointerEvents=""}function $E(e,t){const n=wn(e),r=[];return De.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(La.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=_1(()=>{const a=o();return Fe(a)?a:null},{timeout:1e3});i.then(a=>r.push(Ud(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{De.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=La.get(o);i!==void 0&&(o.style.pointerEvents=i,La.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function DE(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Jo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:c="dialog",layerStyleTargets:l}=t,u={dismiss:r,node:e,type:c,pointerBlocking:i,requestDismiss:o,styleTargets:l};De.add(u),$f();function d(m){const v=qn(m.detail.originalEvent);De.isBelowPointerBlockingLayer(e)||De.isInBranch(v)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function f(m){const v=qn(m.detail.originalEvent);De.isInBranch(v)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){De.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function h(m){if(!e)return!1;const v=typeof s=="function"?s():s,w=Array.isArray(v)?v:[v],x=t.persistentElements?.map(b=>b()).filter(Fe);return x&&w.push(...x),w.some(b=>ni(b,m))||De.isInNestedLayer(e,m)}const p=[i?$E(e,t.persistentElements):void 0,EE(e,g),SE(e,{exclude:h,onFocusOutside:f,onPointerDownOutside:d,defer:t.defer})];return()=>{De.remove(e),$f(),AE(e),p.forEach(m=>m?.())}}function RE(e,t){const{defer:n}=t,r=n?$e:i=>i(),o=[];return o.push(r(()=>{const i=ot(e)?e():e;o.push(DE(i,t))})),()=>{o.forEach(i=>i?.())}}var[QC,ME]=en({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function Na(e,t){return e-t*Math.floor(e/t)}const Df=1721426;function yi(e,t,n,r){t=Fa(e,t);let o=t-1,i=-2;return n<=2?i=0:vi(t)&&(i=-1),Df-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function vi(e){return e%4===0&&(e%100!==0||e%400===0)}function Fa(e,t){return e==="BC"?1-t:t}function IE(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const _E={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class nr{fromJulianDay(t){let n=t,r=n-Df,o=Math.floor(r/146097),i=Na(r,146097),s=Math.floor(i/36524),a=Na(i,36524),c=Math.floor(a/1461),l=Na(a,1461),u=Math.floor(l/365),d=o*400+s*100+c*4+u+(s!==4&&u!==4?1:0),[f,g]=IE(d),h=n-yi(f,g,1,1),p=2;n<yi(f,g,3,1)?p=0:vi(g)&&(p=1);let m=Math.floor(((h+p)*12+373)/367),v=n-yi(f,g,m,1)+1;return new Ft(f,g,m,v)}toJulianDay(t){return yi(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return _E[vi(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return vi(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const LE={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function ze(e,t){return t=we(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function NE(e,t){return t=we(t,e.calendar),e=It(e),t=It(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function FE(e,t){return t=we(t,e.calendar),e=Wr(e),t=Wr(t),e.era===t.era&&e.year===t.year}function VE(e,t){return wi(e.calendar,t.calendar)&&ze(e,t)}function Ur(e,t){return wi(e.calendar,t.calendar)&&NE(e,t)}function jr(e,t){return wi(e.calendar,t.calendar)&&FE(e,t)}function wi(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function BE(e,t){return ze(e,bi(t))}const zE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Rf(e,t,n){let r=e.calendar.toJulianDay(e),o=n?zE[n]:WE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function Mf(e){return Lt(Date.now(),e)}function bi(e){return Sn(Mf(e))}function If(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function KE(e,t){return _f(e)-_f(t)}function _f(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Va=null,UE=!1;function Ba(){return Va==null&&(Va=new Intl.DateTimeFormat().resolvedOptions().timeZone),Va}function Lf(){return UE}function It(e){return e.subtract({days:e.day-1})}function za(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Wr(e){return It(e.subtract({months:e.month-1}))}function jE(e){return za(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function on(e,t,n){let r=Rf(e,t,n);return e.subtract({days:r})}function Nf(e,t,n){return on(e,t,n).add({days:6})}const Ff=new Map,Ka=new Map;function Vf(e){if(Intl.Locale){let n=Ff.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Ff.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function WE(e){let t=Ka.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return Ka.set(e,t),t.firstDay}let n=Vf(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&LE[n]||0};Ka.set(e,t)}return t.firstDay}function HE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil((Rf(It(e),t,n)+r)/7)}function Bf(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function zf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const YE={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function qE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Vf(t),[i,s]=YE[o]||[6,0];return r===i||r===s}function rr(e){e=we(e,new nr);let t=Fa(e.era,e.year);return Kf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Kf(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ua(e,t){if(t==="UTC")return 0;if(e>0&&t===Ba()&&!Lf())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=jf(e,t);return Kf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const Uf=new Map;function jf(e,t){let n=Uf.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Uf.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const Wf=864e5;function GE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>XE(e,t,i))}function XE(e,t,n){let r=jf(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function _t(e,t,n="compatible"){let r=Ye(e);if(t==="UTC")return rr(r);if(t===Ba()&&n==="compatible"&&!Lf()){r=we(r,new nr);let c=new Date,l=Fa(r.era,r.year);return c.setFullYear(l,r.month-1,r.day),c.setHours(r.hour,r.minute,r.second,r.millisecond),c.getTime()}let o=rr(r),i=Ua(o-Wf,t),s=Ua(o+Wf,t),a=GE(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function Hf(e,t,n="compatible"){return new Date(_t(e,t,n))}function Lt(e,t){let n=Ua(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Yr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,c,l,u)}function Sn(e){return new Ft(e.calendar,e.era,e.year,e.month,e.day)}function Ye(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new Pi(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function we(e,t){if(wi(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,En(r),r}function Yf(e,t,n){if(e instanceof Yr)return e.timeZone===t?e:JE(e,t);let r=_t(e,t,n);return Lt(r,t)}function ZE(e){let t=rr(e)-e.offset;return new Date(t)}function JE(e,t){let n=rr(e)-e.offset;return we(Lt(n,t),e.calendar)}const Hr=36e5;function xi(e,t){let n=e.copy(),r="hour"in n?nP(n,t):0;ja(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Wa(n),qf(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,QE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let c=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function ja(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function Wa(e){for(;e.month<1;)ja(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,ja(e,1)}function QE(e){for(;e.day<1;)e.month--,Wa(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Wa(e)}function qf(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function En(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),qf(e)}function Gf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Xf(e,t){return xi(e,Gf(t))}function Ha(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),En(n),n}function Si(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),tP(n),n}function eP(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ei(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ei(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ei(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ei(e.hour,24),t}function tP(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ei(e,t){let n=e%t;return n<0&&(n+=t),n}function nP(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,eP(e)}function Ya(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),c=a.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=Nt(c,n,0,a.length-1,r?.round),o.era=a[c],En(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=Nt(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=Nt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=Nt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),En(o),o}function Zf(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let c=i>=12;s=c?12:0,a=c?23:11}o.hour=Nt(i,n,s,a,r?.round);break}case"minute":o.minute=Nt(e.minute,n,0,59,r?.round);break;case"second":o.second=Nt(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=Nt(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function Nt(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function Jf(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=xi(Ye(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=_t(o,e.timeZone)}else n=rr(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=Lt(n,e.timeZone);return we(r,e.calendar)}function rP(e,t){return Jf(e,Gf(t))}function oP(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let h=e.hour>=12;o=h?12:0,i=h?23:11}let s=Ye(e),a=we(Si(s,{hour:o}),new nr),c=[_t(a,e.timeZone,"earlier"),_t(a,e.timeZone,"later")].filter(h=>Lt(h,e.timeZone).day===a.day)[0],l=we(Si(s,{hour:i}),new nr),u=[_t(l,e.timeZone,"earlier"),_t(l,e.timeZone,"later")].filter(h=>Lt(h,e.timeZone).day===l.day).pop(),d=rr(e)-e.offset,f=Math.floor(d/Hr),g=d%Hr;return d=Nt(f,n,Math.floor(c/Hr),Math.floor(u/Hr),r?.round)*Hr+g,we(Lt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Zf(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Ya(Ye(e),t,n,r),i=_t(o,e.timeZone);return we(Lt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function iP(e,t,n){let r=Ye(e),o=Si(Ha(r,t),t);if(o.compare(r)===0)return e;let i=_t(o,e.timeZone,n);return we(Lt(i,e.timeZone),e.calendar)}function sP(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Qf(e){let t=we(e,new nr),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function eh(e){return`${Qf(e)}T${sP(e)}`}function aP(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function cP(e){return`${eh(e)}${aP(e.offset)}[${e.timeZone}]`}function qa(e){let t=typeof e[0]=="object"?e.shift():new nr,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var lP=new WeakMap;class Ft{copy(){return this.era?new Ft(this.calendar,this.era,this.year,this.month,this.day):new Ft(this.calendar,this.year,this.month,this.day)}add(t){return xi(this,t)}subtract(t){return Xf(this,t)}set(t){return Ha(this,t)}cycle(t,n,r){return Ya(this,t,n,r)}toDate(t){return Hf(this,t)}toString(){return Qf(this)}compare(t){return If(this,t)}constructor(...t){ys(this,lP,{writable:!0,value:void 0});let[n,r,o,i,s]=qa(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,En(this)}}var uP=new WeakMap;class Pi{copy(){return this.era?new Pi(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Pi(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return xi(this,t)}subtract(t){return Xf(this,t)}set(t){return Ha(Si(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Ya(this,t,n,r);default:return Zf(this,t,n,r)}}toDate(t,n){return Hf(this,t,n)}toString(){return eh(this)}compare(t){let n=If(this,t);return n===0?KE(this,Ye(t)):n}constructor(...t){ys(this,uP,{writable:!0,value:void 0});let[n,r,o,i,s]=qa(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,En(this)}}var dP=new WeakMap;class Yr{copy(){return this.era?new Yr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Yr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Jf(this,t)}subtract(t){return rP(this,t)}set(t,n){return iP(this,t,n)}cycle(t,n,r){return oP(this,t,n,r)}toDate(){return ZE(this)}toString(){return cP(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Yf(t,this.timeZone).toDate().getTime()}constructor(...t){ys(this,dP,{writable:!0,value:void 0});let[n,r,o,i,s]=qa(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,En(this)}}let Ga=new Map;class qe{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return gP()&&(this.resolvedHourCycle||(this.resolvedHourCycle=pP(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=th(t,n),this.options=n}}const fP={true:{ja:"h11"},false:{}};function th(e,t={}){if(typeof t.hour12=="boolean"&&hP()){t={...t};let o=fP[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Ga.has(n))return Ga.get(n);let r=new Intl.DateTimeFormat(e,t);return Ga.set(n,r),r}let Xa=null;function hP(){return Xa==null&&(Xa=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Xa}let Za=null;function gP(){return Za==null&&(Za=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Za}function pP(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=th(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}var[eO,mP]=en({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),yP=Object.defineProperty,vP=(e,t)=>{for(var n in t)yP(e,n,{get:t[n],enumerable:!0})},ki="__live-region__",Ja="__live-region-debug__",wP="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function bP(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function c(){if(!i)return;let d=n.getElementById(Ja);return d||(d=n.createElement("div"),d.id=Ja,d.dataset.liveAnnouncerDebug="true",d.setAttribute("aria-hidden","true"),d.style.cssText=wP,a.appendChild(d),d)}function l(d,f){n.getElementById(ki)?.remove(),f=f??o;const h=n.createElement("span");h.id=ki,h.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";h.setAttribute("aria-live",t),h.setAttribute("role",p),Object.assign(h.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),a.appendChild(h),s.setTimeout(()=>{if(!h.isConnected)return;h.textContent=d;const m=c();m&&(m.textContent=d)},f)}function u(){n.getElementById(ki)?.remove(),n.getElementById(Ja)?.remove()}return{announce:l,destroy:u,toJSON(){return ki}}}function xP(e,t,n,r,o){const i={};for(let a in t){const c=a,l=t[c];l!=null&&(i[c]=Math.floor(l/2),i[c]>0&&l%2===0&&i[c]--)}const s=Pn(e,t,n).subtract(i);return qr(e,s,t,n,r,o)}function Pn(e,t,n,r,o){let i=e;return t.years?i=Wr(e):t.months?i=It(e):t.weeks&&(i=on(e,n)),qr(e,i,t,n,r,o)}function Qa(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=Pn(e,t,n).subtract(i);return qr(e,s,t,n,r,o)}function qr(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=zf(t,Pn(Sn(o),n,r))),i&&e.compare(i)<=0&&(t=Bf(t,Qa(Sn(i),n,r))),t}function Ge(e,t,n){const r=Sn(e),o=t?Sn(t):void 0,i=n?Sn(n):void 0;let s=r;return o&&(s=zf(s,o)),i&&(s=Bf(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function nh(e,t,n,r,o,i){switch(t){case"start":return Pn(e,n,r,o,i);case"end":return Qa(e,n,r,o,i);case"center":default:return xP(e,n,r,o,i)}}function sn(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?ze(e,t):Ye(e).compare(Ye(t))===0}function rh(e,t,n,r,o){return e?t?.(e,n)?!0:xt(e,r,o):!1}function xt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function SP(e,t,n){const r=e.subtract({days:1});return ze(r,e)||xt(r,t,n)}function EP(e,t,n){const r=e.add({days:1});return ze(r,e)||xt(r,t,n)}function ec(e){let t={...e};for(let n in t)t[n]=1;return t}function oh(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function ih(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function sh(e,t,n){const r=n??Ye(bi(t));return new qe(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:ih(r),calendar:r.calendar.identifier,timeZone:t})}function ah(e,t,n){const r=n??bi(t);return new qe(e,{month:"long",year:"numeric",era:ih(r),calendar:r.calendar.identifier,timeZone:t})}function PP(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let l=0;l<i.length;l++){let u=i[l];if(u.source==="shared"&&u.type==="literal")s=l;else if(u.source==="endRange")break}let a="",c="";for(let l=0;l<i.length;l++)l<s?a+=i[l].value:l>s&&(c+=i[l].value);return r(a,c)}function Ci(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=sh(n,r);return ze(o,i)?s.format(o.toDate(r)):PP(o,i,s,(a,c)=>`${a} – ${c}`,r)}var kP=["sun","mon","tue","wed","thu","fri","sat"];function ch(e){return e!=null?kP[e]:void 0}function lh(e,t,n){const r=ch(n);return on(e,t,r)}function uh(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=lh(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(ze(s,a))break;s=a}return i}function CP(e,t,n,r){const o=ch(r),i=n??HE(e,t,o);return[...new Array(i).keys()].map(a=>uh(a,e,t,r))}function OP(e,t){const n=new qe(e,{weekday:"long",timeZone:t}),r=new qe(e,{weekday:"short",timeZone:t}),o=new qe(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function TP(e,t,n,r){const o=lh(e,r,t),i=[...new Array(7).keys()],s=OP(r,n);return i.map(a=>s(o.add({days:a})))}function AP(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new qe(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function dh(e,t){const n=on(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=on(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const c=n.set({year:r-1,month:1,day:4}),l=on(c,t,"mon"),u=l.calendar.toJulianDay(l);return 1+Math.floor((s-u)/7)}function $P(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var DP=1900,RP=2099;function MP(e,t,n){const r=e.calendar,o=t?.year??we(new Ft(DP,1,1),r).year,i=n?.year??we(new Ft(RP,12,31),r).year;return{from:o,to:i}}var IP=10;function _P(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+IP?(o-100).toString():o.toString()}return e}}function or(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Gr(e,t){const n=bi(e??Ba());return t?we(n,t):n}function Xr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,c=oh(s,e);return xt(a,n,r)?{startDate:s,focusedDate:Ge(a,n,r),endDate:c}:a.compare(s)<0?{startDate:Qa(a,e,t,n,r),focusedDate:Ge(a,n,r),endDate:c}:a.compare(c)>0?{startDate:Pn(a,e,t,n,r),endDate:c,focusedDate:Ge(a,n,r)}:{startDate:s,endDate:c,focusedDate:Ge(a,n,r)}}}function fh(e,t,n,r,o,i){const s=Xr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:Pn(qr(e,a,n,r,o,i),n,r)})}function hh(e,t,n,r,o,i){const s=Xr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:Pn(qr(e,a,n,r,o,i),n,r)})}function LP(e,t,n,r,o,i,s){const a=Xr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(ec(r)),startDate:t});if(r.days)return fh(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function NP(e,t,n,r,o,i,s){const a=Xr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(ec(r)),startDate:t});if(r.days)return hh(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var gh=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,FP=(e,t)=>e.split("").filter(n=>gh(n,t)).join(""),ph=new Map;function VP(e){let t=ph.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",ph.set(e,t),t}var mh=e=>e!=null&&e.length===4,BP=e=>e!=null&&parseFloat(e)<=12,zP=e=>e!=null&&parseFloat(e)<=31;function KP(e,t,n){const r=UP(t,n);let{year:o,month:i,day:s}=jP(r,e)??{};if(o!=null||i!=null||s!=null){const l=new Date;o||(o=l.getFullYear().toString()),i||(i=(l.getMonth()+1).toString()),s||(s=l.getDate().toString())}if(mh(o)||(o=_P(o)),mh(o)&&BP(i)&&zP(s))return new Ft(+o,+i,+s);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Ft(l.getFullYear(),l.getMonth()+1,l.getDate())}}function UP(e,t){return new qe(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function jP(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function yh(e,t,n){const r=Sn(Mf(n));switch(e){case"thisWeek":return[on(r,t),Nf(r,t)];case"thisMonth":return[It(r),r];case"thisQuarter":return[It(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Wr(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[It(r.add({months:-1})),za(r.add({months:-1}))];case"lastQuarter":return[It(r.add({months:-((r.month-1)%3)-3})),za(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[on(r,t).add({weeks:-1}),Nf(r,t).add({weeks:-1})];case"lastYear":return[Wr(r.add({years:-1})),jE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var vh=Fr("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),ie=vh.build(),WP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,HP=e=>e.ids?.root??`datepicker:${e.id}`,YP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,tc=e=>e.ids?.content??`datepicker:${e.id}:content`,nc=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,qP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,GP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,XP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,wh=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,bh=e=>e.ids?.control??`datepicker:${e.id}:control`,xh=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,Sh=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,Eh=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,Ph=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,kh=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,Ch=(e,t)=>R1(Ti(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Oi=e=>e.getById(Sh(e)),Ti=e=>e.getById(tc(e)),Zr=e=>D1(Th(e),"[data-part=input]"),ZP=e=>e.getById(kh(e)),JP=e=>e.getById(Ph(e)),QP=e=>e.getById(wh(e)),Oh=e=>e.getById(Eh(e)),Th=e=>e.getById(bh(e));function rc(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function ir(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function Ai(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function ek(e){return _r(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var tk={day:"dd",month:"mm",year:"yyyy"};function nk(e){return new qe(e).formatToParts(new Date).map(t=>tk[t.type]??t.value).join("")}var Ah=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),rk={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return _r(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return _r(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return _r(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Vt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function oc(e){return e===0?"day":e===1?"month":"year"}function ic(e,t,n){return oc(Rx(Vt(e,0),Vt(t,0),Vt(n,2)))}function ok(e,t){return Vt(e,0)>Vt(t,0)}function ik(e,t){return Vt(e,0)<Vt(t,0)}function sk(e,t,n){const r=Vt(e,0)+1;return ic(oc(r),t,n)}function ak(e,t,n){const r=Vt(e,0)-1;return ic(oc(r),t,n)}var ck=["day","month","year"];function lk(e){ck.forEach(t=>e(t))}var uk=zx(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const d=or(n.year,{strict:!0}),f=d.at(0).toString(),g=d.at(-1).toString();return{start:f,end:g,formatted:`${f} - ${g}`}}if(e==="month"){const d=new qe(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),f=d.format(n.toDate(i)),g=d.format(r.toDate(i)),h=s==="range"?`${f} - ${g}`:f;return{start:f,end:g,formatted:h}}const a=new qe(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),c=a.format(n.toDate(i)),l=a.format(r.toDate(i)),u=s==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:u}});function dk(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,c=r.get("startValue"),l=s("endValue"),u=r.get("value"),d=r.get("focusedValue"),f=r.get("hoveredValue"),g=f?rc([u[0],f]):[],h=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),v=s("isInteractive"),w=u.length===0,x=o("min"),b=o("max"),C=o("locale"),E=o("timeZone"),T=o("startOfWeek"),D=n.matches("focused"),S=n.matches("open"),P=o("selectionMode")==="range",R=o("selectionMode")==="multiple",O=o("isDateUnavailable"),V=o("maxSelectedDates"),K=R&&V!=null&&u.length>=V,Y=r.get("currentPlacement"),F=Y?tE(Y):void 0,W=pE({...o("positioning"),placement:Y}),X=VP(C),G={...rk,...o("translations")};function Xe($=c){const k=o("fixedWeeks")?6:void 0;return CP($,C,k,T)}function Re($={}){const{format:k}=$;return AP(C,k,d).map((A,M)=>{const le=M+1,Ze=d.set({month:le}),Ce=xt(Ze,x,b);return{label:A,value:le,disabled:Ce}})}function fc(){const $=MP(d,x,b);return $P($).map(A=>({label:A.toString(),value:A,disabled:!aa(A,x?.year,b?.year)}))}function Mi($){return rh($,O,C,x,b)}function Ii($){const k=c??Gr(E,d.calendar);i({type:"FOCUS.SET",value:k.set({month:$})})}function J($){const k=c??Gr(E,d.calendar);i({type:"FOCUS.SET",value:k.set({year:$})})}function zt($){const{value:k,disabled:A}=$,M=d.set({year:k}),Ze=!or(c.year,{strict:!0}).includes(k),Ce=aa(k,x?.year,b?.year),at=P&&ir(M,u),cn=P&&u[0]&&jr(M,u[0]),sr=P&&u[1]&&jr(M,u[1]),Cn=P&&g.length>0,ar=Cn&&ir(M,g),ln=Cn&&g[0]&&jr(M,g[0]),un=Cn&&g[1]&&jr(M,g[1]),_i={focused:d.year===$.value,selectable:!Ze&&Ce,outsideRange:Ze,selected:!!u.find(Li=>Li&&Li.year===k),valueText:k.toString(),inRange:at||ar,firstInRange:!!cn,lastInRange:!!sr,inHoveredRange:!!ar,firstInHoveredRange:!!ln,lastInHoveredRange:!!un,value:M,get disabled(){return A||!_i.selectable}};return _i}function an($){const{value:k,disabled:A}=$,M=d.set({month:k}),le=ah(C,E,d),Ze=P&&ir(M,u),Ce=P&&u[0]&&Ur(M,u[0]),at=P&&u[1]&&Ur(M,u[1]),cn=P&&g.length>0,sr=cn&&ir(M,g),Cn=cn&&g[0]&&Ur(M,g[0]),ar=cn&&g[1]&&Ur(M,g[1]),ln={focused:d.month===$.value,selectable:!xt(M,x,b),selected:!!u.find(un=>un&&un.month===k&&un.year===d.year),valueText:le.format(M.toDate(E)),inRange:Ze||sr,firstInRange:!!Ce,lastInRange:!!at,inHoveredRange:!!sr,firstInHoveredRange:!!Cn,lastInHoveredRange:!!ar,outsideRange:!1,value:M,get disabled(){return A||!ln.selectable}};return ln}function hc($){const{value:k,disabled:A,visibleRange:M=s("visibleRange")}=$,le=sh(C,E,d),Ze=ec(s("visibleDuration")),Ce=o("outsideDaySelectable"),at=M.start.add(Ze).subtract({days:1}),cn=xt(k,M.start,at),sr=P&&ir(k,u),Cn=P&&u[0]&&ze(k,u[0]),ar=P&&u[1]&&ze(k,u[1]),ln=P&&g.length>0,un=ln&&ir(k,g),_i=ln&&g[0]&&ze(k,g[0]),Li=ln&&g[1]&&ze(k,g[1]),_h=u.some(Lh=>Lh!=null&&ze(k,Lh)),Ni={invalid:xt(k,x,b),disabled:A||!Ce&&cn||xt(k,x,b)||K&&!_h,selected:_h,unavailable:rh(k,O,C,x,b)&&!A,outsideRange:cn,today:BE(k,E),weekend:qE(k,C),value:k,valueText:le.format(k.toDate(E)),get focused(){return d!=null&&ze(k,d)&&(!Ni.outsideRange||Ce)},get selectable(){return!Ni.disabled&&!Ni.unavailable},inRange:sr||un,firstInRange:Cn,lastInRange:ar,inHoveredRange:un,firstInHoveredRange:_i,lastInHoveredRange:Li};return Ni}function qC($){const{view:k="day",id:A}=$;return[k,A].filter(Boolean).join(" ")}return{focused:D,open:S,disabled:h,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:V,isMaxSelected:K,view:r.get("view"),getRangePresetValue($){return yh($,C,E)},getWeekNumber($){const k=$[0];return k?dh(k,C):0},getDaysInWeek($,k=c){return uh($,k,C,T)},getOffset($){const k=c.add($),A=l.add($),M=ah(C,E,d);return{visibleRange:{start:k,end:A},weeks:Xe(k),visibleRangeText:{start:M.format(k.toDate(E)),end:M.format(A.toDate(E))}}},getMonthWeeks:Xe,isUnavailable:Mi,weeks:Xe(),weekDays:TP(c,T,E,C),visibleRangeText:s("visibleRangeText"),value:u,valueAsDate:u.filter($=>$!=null).map($=>$.toDate(E)),valueAsString:s("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(E),focusedValueAsString:o("format")(d,{locale:C,timeZone:E}),visibleRange:s("visibleRange"),selectToday(){const $=Ge(Gr(E,d.calendar),x,b);i({type:"VALUE.SET",value:[$]})},setValue($){const k=$.map(A=>Ge(A,x,b));i({type:"VALUE.SET",value:k})},setTime($,k=0){const A=Array.from(u);let M=A[k];M&&("hour"in M||(M=Ye(M)),M=M.set({hour:$.hour??("hour"in M?M.hour:0),minute:$.minute??("minute"in M?M.minute:0),second:$.second??("second"in M?M.second:0),millisecond:$.millisecond??("millisecond"in M?M.millisecond:0)}),A[k]=Ge(M,x,b),i({type:"VALUE.SET",value:A}))},clearValue($={}){const{focus:k=!0}=$;i({type:"VALUE.CLEAR",focus:k})},setFocusedValue($){i({type:"FOCUS.SET",value:$})},setOpen($){o("inline")||n.matches("open")===$||i({type:$?"OPEN":"CLOSE"})},focusMonth:Ii,focusYear:J,getYears:fc,getMonths:Re,getYearsGrid($={}){const{columns:k=1}=$,A=or(c.year,{strict:!0}).map(M=>({label:M.toString(),value:M,disabled:!aa(M,x?.year,b?.year)}));return gd(A,k)},getDecade(){const $=or(c.year,{strict:!0});return{start:$.at(0),end:$.at(-1)}},getMonthsGrid($={}){const{columns:k=1,format:A}=$;return gd(Re({format:A}),k)},format($,k={month:"long",year:"numeric"}){return new qe(C,{...k,calendar:$.calendar.identifier}).format($.toDate(E))},setView($){i({type:"VIEW.SET",view:$})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...ie.root.attrs,dir:o("dir"),id:HP(a),"data-state":S?"open":"closed","data-disabled":j(h),"data-readonly":j(p),"data-empty":j(w)})},getLabelProps($={}){const{index:k=0}=$;return t.label({...ie.label.attrs,id:WP(a,k),dir:o("dir"),htmlFor:xh(a,k),"data-state":S?"open":"closed","data-index":k,"data-disabled":j(h),"data-readonly":j(p)})},getControlProps(){return t.element({...ie.control.attrs,dir:o("dir"),id:bh(a),"data-disabled":j(h),"data-placeholder-shown":j(w)})},getRangeTextProps(){return t.element({...ie.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...ie.content.attrs,hidden:!S,dir:o("dir"),"data-state":S?"open":"closed","data-placement":Y,"data-side":F,"data-inline":j(o("inline")),id:tc(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":G.content})},getTableProps($={}){const{view:k="day",columns:A=k==="day"?7:4}=$,M=qC($);return t.element({...ie.table.attrs,role:"grid","data-columns":A,"aria-roledescription":ek(k),id:YP(a,M),"aria-readonly":Pe(p),"aria-disabled":Pe(h),"aria-multiselectable":Pe(o("selectionMode")!=="single"),"data-view":k,dir:o("dir"),tabIndex:-1,onKeyDown(le){if(le.defaultPrevented)return;const Ce={Enter(){k==="day"&&Mi(d)||k==="month"&&!an({value:d.month}).selectable||k==="year"&&!zt({value:d.year}).selectable||i({type:"TABLE.ENTER",view:k,columns:A,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:k,columns:A,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:k,columns:A,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:k,columns:A,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:k,columns:A,focus:!0})},PageUp(at){i({type:"TABLE.PAGE_UP",larger:at.shiftKey,view:k,columns:A,focus:!0})},PageDown(at){i({type:"TABLE.PAGE_DOWN",larger:at.shiftKey,view:k,columns:A,focus:!0})},Home(){i({type:"TABLE.HOME",view:k,columns:A,focus:!0})},End(){i({type:"TABLE.END",view:k,columns:A,focus:!0})}}[x1(le,{dir:o("dir")})];Ce&&(Ce(le),le.preventDefault(),le.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:k})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:k})}})},getTableHeadProps($={}){const{view:k="day"}=$;return t.element({...ie.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":k,"data-disabled":j(h)})},getTableHeaderProps($={}){const{view:k="day"}=$;return t.element({...ie.tableHeader.attrs,dir:o("dir"),"data-view":k,"data-disabled":j(h)})},getTableBodyProps($={}){const{view:k="day"}=$;return t.element({...ie.tableBody.attrs,"data-view":k,"data-disabled":j(h)})},getTableRowProps($={}){const{view:k="day"}=$;return t.element({...ie.tableRow.attrs,"aria-disabled":Pe(h),"data-disabled":j(h),"data-view":k})},getWeekNumberHeaderCellProps($={}){const{view:k="day"}=$;return t.element({...ie.tableCell.attrs,scope:"col","aria-label":G.weekColumnHeader,"data-view":k,"data-type":"week-number","data-disabled":j(h)})},getWeekNumberCellProps($){const{weekIndex:k,week:A}=$,M=A[0]?dh(A[0],C):0;return t.element({...ie.tableCell.attrs,role:"rowheader","aria-label":G.weekNumberCell?.(M),"data-view":"day","data-week-index":k,"data-type":"week-number","data-disabled":j(h)})},getDayTableCellState:hc,getDayTableCellProps($){const{value:k}=$,A=hc($);return t.element({...ie.tableCell.attrs,role:"gridcell","aria-disabled":Pe(!A.selectable),"aria-selected":A.selected||A.inRange,"aria-invalid":Pe(A.invalid),"aria-current":A.today?"date":void 0,"data-value":k.toString()})},getDayTableCellTriggerProps($){const{value:k}=$,A=hc($);return t.element({...ie.tableCellTrigger.attrs,id:nc(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":G.dayCell(A),"aria-disabled":Pe(!A.selectable),"aria-invalid":Pe(A.invalid),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k.toString(),"data-view":"day","data-today":j(A.today),"data-focus":j(A.focused),"data-unavailable":j(A.unavailable),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-outside-range":j(A.outsideRange),"data-weekend":j(A.weekend),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"day",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const le=!a.isActiveElement(M.currentTarget);f&&VE(k,f)||i({type:"CELL.POINTER_MOVE",cell:"day",value:k,focus:le,outsideRange:A.outsideRange})}:void 0})},getMonthTableCellState:an,getMonthTableCellProps($){const{value:k,columns:A}=$,M=an($);return t.element({...ie.tableCell.attrs,dir:o("dir"),colSpan:A,role:"gridcell","aria-selected":Pe(M.selected||M.inRange),"data-selected":j(M.selected),"aria-disabled":Pe(!M.selectable),"data-value":k})},getMonthTableCellTriggerProps($){const{value:k}=$,A=an($);return t.element({...ie.tableCellTrigger.attrs,id:nc(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":A.valueText,"aria-disabled":Pe(!A.selectable),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k,"data-view":"month","data-focus":j(A.focused),"data-outside-range":j(A.outsideRange),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"month",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const le=!a.isActiveElement(M.currentTarget);f&&A.value&&Ur(A.value,f)||i({type:"CELL.POINTER_MOVE",cell:"month",value:A.value,focus:le})}:void 0})},getYearTableCellState:zt,getYearTableCellProps($){const{value:k,columns:A}=$,M=zt($);return t.element({...ie.tableCell.attrs,dir:o("dir"),colSpan:A,role:"gridcell","aria-selected":Pe(M.selected||M.inRange),"data-selected":j(M.selected),"aria-disabled":Pe(!M.selectable),"data-value":k})},getYearTableCellTriggerProps($){const{value:k}=$,A=zt($);return t.element({...ie.tableCellTrigger.attrs,id:nc(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":A.valueText,"aria-disabled":Pe(!A.selectable),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k,"data-view":"year","data-focus":j(A.focused),"data-outside-range":j(A.outsideRange),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"year",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const le=!a.isActiveElement(M.currentTarget);f&&A.value&&jr(A.value,f)||i({type:"CELL.POINTER_MOVE",cell:"year",value:A.value,focus:le})}:void 0})},getNextTriggerProps($={}){const{view:k="day"}=$,A=h||!s("isNextVisibleRangeValid");return t.button({...ie.nextTrigger.attrs,dir:o("dir"),id:GP(a,k),type:"button","aria-label":G.nextTrigger(k),disabled:A,"data-disabled":j(A),onClick(M){M.defaultPrevented||i({type:"GOTO.NEXT",view:k})}})},getPrevTriggerProps($={}){const{view:k="day"}=$,A=h||!s("isPrevVisibleRangeValid");return t.button({...ie.prevTrigger.attrs,dir:o("dir"),id:qP(a,k),type:"button","aria-label":G.prevTrigger(k),disabled:A,"data-disabled":j(A),onClick(M){M.defaultPrevented||i({type:"GOTO.PREV",view:k})}})},getClearTriggerProps(){return t.button({...ie.clearTrigger.attrs,id:wh(a),dir:o("dir"),type:"button","aria-label":G.clearTrigger,hidden:!u.length,onClick($){$.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ie.trigger.attrs,id:Sh(a),dir:o("dir"),type:"button","data-placement":Y,"data-side":F,"aria-label":G.trigger(S),"aria-controls":tc(a),"aria-expanded":S,"data-state":S?"open":"closed","data-placeholder-shown":j(w),"aria-haspopup":"grid",disabled:h,onClick($){$.defaultPrevented||v&&i({type:"TRIGGER.CLICK"})}})},getViewProps($={}){const{view:k="day"}=$;return t.element({...ie.view.attrs,"data-view":k,hidden:r.get("view")!==k})},getViewTriggerProps($={}){const{view:k="day"}=$;return t.button({...ie.viewTrigger.attrs,"data-view":k,dir:o("dir"),id:XP(a,k),type:"button",disabled:h,"aria-label":G.viewTrigger(k),onClick(A){A.defaultPrevented||v&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps($={}){const{view:k="day"}=$;return t.element({...ie.viewControl.attrs,"data-view":k,dir:o("dir")})},getInputProps($={}){const{index:k=0,fixOnBlur:A=!0}=$;return t.input({...ie.input.attrs,id:xh(a,k),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":k,"data-state":S?"open":"closed","data-placeholder-shown":j(w),readOnly:p,disabled:h,required:o("required"),"aria-invalid":Pe(m),"data-invalid":j(m),placeholder:o("placeholder")||nk(C),defaultValue:s("valueAsString")[k],onBeforeInput(M){const{data:le}=Bd(M);gh(le,X)||M.preventDefault()},onClick(M){M.defaultPrevented||o("openOnClick")&&v&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:k})},onBlur(M){const le=M.currentTarget.value.trim();i({type:"INPUT.BLUR",value:le,index:k,fixOnBlur:A})},onKeyDown(M){if(M.defaultPrevented||!v)return;const Ze={Enter(Ce){v1(Ce)||Mi(d)||Ce.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Ce.currentTarget.value,index:k})}}[M.key];Ze&&(Ze(M),M.preventDefault())},onInput(M){const le=M.currentTarget.value;i({type:"INPUT.CHANGE",value:FP(le,X),index:k})}})},getMonthSelectProps(){return t.select({...ie.monthSelect.attrs,id:Ph(a),"aria-label":G.monthSelect,disabled:h,dir:o("dir"),defaultValue:c.month,onChange($){Ii(Number($.currentTarget.value))}})},getYearSelectProps(){return t.select({...ie.yearSelect.attrs,id:kh(a),disabled:h,"aria-label":G.yearSelect,dir:o("dir"),defaultValue:c.year,onChange($){J(Number($.currentTarget.value))}})},getPositionerProps(){return t.element({id:Eh(a),...ie.positioner.attrs,dir:o("dir"),style:W.floating})},getPresetTriggerProps($){const k=Array.isArray($.value)?$.value:yh($.value,C,E),A=k.filter(M=>M!=null).map(M=>M.toDate(E).toDateString());return t.button({...ie.presetTrigger.attrs,"aria-label":G.presetTrigger(A),type:"button",onClick(M){M.defaultPrevented||i({type:"PRESET.CLICK",value:k})}})}}}var{and:ke}=Zx();function fk(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!sn(e[r],t[r]))return!1;return!0}function $i(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var hk=$d({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const h=new Intl.DateTimeFormat(t).resolvedOptions().calendar;h!=="gregory"&&h!=="iso8601"&&(i=e.createCalendar(h))}const s=g=>!i||g.calendar.identifier===i.identifier?g:we(g,i),a=e.defaultValue?Ai(e.defaultValue).map(g=>Ge(s(g),e.min,e.max)):void 0,c=e.value?Ai(e.value).map(g=>Ge(s(g),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||Gr(n,i);l=Ge(s(l),e.min,e.max);const u="day",d="year",f=ic(e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:f,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:h,timeZone:p}){return new qe(h,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:h,timeZone:p}){return KP(g,h,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:sn,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=$i(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:fk,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=$i(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:sn})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:nh(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:sn,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>oh(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>uk({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!SP(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!EP(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>$i(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:ke("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:ke("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:ke("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:ke("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:ke("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:ke("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>ok(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>sn(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=Th(n);return hE(r,()=>Oh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",bP({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:RE(()=>Ti(e),{type:"popover",defer:!0,layerStyleTargets:[()=>Oh(e)],exclude:[...Zr(e),Oi(e),QP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=sk(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=ak(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,c]=r;a&&c?s=Ci(a,c,o,i):a?s=Ci(a,null,o,i):c?s=Ci(c,null,o,i):s=""}else s=r.map(a=>Ci(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){$1({target:Ti(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Kd({doc:e.getDoc(),target:Ti(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){$e(()=>{Zr(e).forEach((r,o)=>{oi(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ge(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=Di(e,n.value??t.get("focusedValue"));r[o]=sc(i,s),t.set("value",rc(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=Di(e,n.value??t.get("focusedValue"));t.set("value",[sc(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=Di(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>sn(s,r));if(i===-1){const s=[...o,r];t.set("value",Ai(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",Ai(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=sc(o,i),e.set("value",rc(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=fh(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Ri(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=hh(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Ri(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=LP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Ri(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=NP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Ri(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Gr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=or(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=or(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&$e(()=>{const r=t.get("view");Ch(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&$e(()=>{const r=t.get("view");Ch(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){$e(()=>{Oi(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&$e(()=>{const[n]=Zr(e);(n??Oi(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){$e(()=>{const t=Zr(e);if(t.length===0){Oi(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=JP(e);oi(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=ZP(e);oi(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Zr(e),o=n.index??t.get("activeIndex");oi(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!Ah(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!Ah(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ge(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=$i(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!xt(r,e.get("startValue"),t("endValue")))return;const i=nh(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),Di=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return lk(s=>{ik(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},sc=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=Yf(Ye(t),e.timeZone):r=Ye(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=Di(e,t);if(sn(n.get("focusedValue"),i))return;const a=Xr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Ri(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");sn(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var $h=vh.extendWith("view","valueText"),[Dh,ae]=en({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),gk=e=>{const t=ae(),n=te(()=>t().getClearTriggerProps(),e);return y(oe.button,n)},pk=e=>{const t=ae(),n=Zd(),r=te(()=>t().getContentProps(),()=>n().presenceProps,e);return y(Z,{get when(){return!n().unmounted},get children(){return y(oe.div,B(r,{ref(o){var i=Z1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},mk=e=>e.children(ae()),yk=e=>{const t=ae(),n=te(()=>t().getControlProps(),e);return y(oe.div,n)},vk=e=>{const[t,n]=yt()(e,["index","fixOnBlur"]),r=ae(),o=te(()=>r().getInputProps(t),n);return y(oe.input,o)},wk=e=>{const t=ae(),n=te(()=>t().getLabelProps(),e);return y(oe.label,n)},bk=e=>{const t=ae(),n=te(()=>t().getMonthSelectProps(),e);return y(oe.select,B(n,{get children(){return y(Fc,{get each(){return t().getMonths()},children:r=>y(oe.option,{get value(){return r().value},get children(){return r().label}})})}}))},[xk,kn]=en({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),Sk=e=>{const t=ae(),n=kn(),r=te(()=>t().getNextTriggerProps(n),e);return y(oe.button,r)},Ek=e=>{const t=ae(),n=Zd(),r=te(()=>t().getPositionerProps(),e);return y(Z,{get when(){return!n().unmounted},get children(){return y(oe.div,r)}})},Pk=e=>{const[t,n]=yt()(e,["value"]),r=ae(),o=te(()=>r().getPresetTriggerProps(t),n);return y(oe.button,o)},kk=e=>{const t=ae(),n=kn(),r=te(()=>t().getPrevTriggerProps(n),e);return y(oe.button,r)},Ck=e=>{const t=ae(),n=te(()=>t().getRangeTextProps(),e),r=_(()=>{const{start:o,end:i}=t().visibleRangeText;return yx([o,i]).filter(Boolean).join(" - ")});return y(oe.div,B(n,{get children(){return r()}}))},Ok=e=>{const t=ae(),n=()=>t().value.length>0;return y(Z,{get when(){return typeof e.children=="function"},get fallback(){return y(oe.span,B(()=>$h.build().valueText.attrs,e,{get children(){return Yt(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return y(Z,{get when(){return n()},get fallback(){return e.placeholder},get children(){return y(Ht,{get each(){return t().value},children:(r,o)=>Yt(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},Tk=e=>{const t=Ke(),n=mP(),r=ME(),o=_(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...Sd(e)})),i=jd(hk,o);return _(()=>dk(i,j1))},Ak=e=>{const[t,n]=Gd(e),[r,o]=yt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=Tk(r),s=Yd(te(t,()=>({present:i().open}))),a=te(()=>i().getRootProps(),o);return y(Dh,{value:i,get children(){return y(Xd,{value:s,get children(){return y(oe.div,a)}})}})},$k=e=>{const[t,n]=Gd(e),[{value:r},o]=yt()(n,["value"]),i=Yd(te(t,()=>({present:r().open}))),s=te(()=>r().getRootProps(),o);return y(Dh,{value:r,get children(){return y(Xd,{value:i,get children(){return y(oe.div,s)}})}})},[Dk,Jr]=en({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),Rk=e=>{const[t,n]=yt()(e,["columns"]),r=ae(),o=kn(),i=Ke(),s=te(()=>({columns:t.columns,id:i}),o),a=te(()=>r().getTableProps(s),n);return y(Dk,{value:s,get children(){return y(oe.table,a)}})},Mk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableBodyProps(n),e);return y(oe.tbody,r)},[Ik,_k]=en({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),Lk=e=>{const[t,n]=yt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=kn(),i=_(()=>{const c={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return c(t)}),s=te(i,n);return y(Ik,{value:t,get children(){return y(oe.td,s)}})},Nk=e=>{const t=ae(),n=_k(),r=kn(),o=_(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=te(o,e);return y(oe.div,i)},Fk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableHeadProps(n),e);return y(oe.thead,r)},Vk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableHeaderProps(n),e);return y(oe.th,r)},Bk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableRowProps(n),e);return y(oe.tr,r)},zk=e=>{const t=ae(),n=te(()=>t().getTriggerProps(),e);return y(oe.button,n)},Kk=e=>{const[t,n]=yt()(e,["view"]),r=ae(),o=te(()=>$h.build().view.attrs,n);return y(xk,{value:t,get children(){return y(oe.div,B(o,{get hidden(){return r().view!==t.view}}))}})},Uk=e=>{const t=ae(),n=kn(),r=te(()=>t().getViewControlProps(n),e);return y(oe.div,r)},jk=e=>{const t=ae(),n=kn(),r=te(()=>t().getViewTriggerProps(n),e);return y(oe.button,r)},Wk=yt(),Hk=e=>{const[t,n]=Wk(e,["weekIndex","week"]),r=ae(),o=te(()=>r().getWeekNumberCellProps(t),n);return y(oe.td,o)},Yk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getWeekNumberHeaderCellProps(n),e);return y(oe.th,r)},qk=e=>{const t=ae(),n=te(()=>t().getYearSelectProps(),e);return y(oe.select,B(n,{get children(){return y(Fc,{get each(){return t().getYears()},children:r=>y(oe.option,{get value(){return r().value},get children(){return r().label}})})}}))},Bt={};vP(Bt,{ClearTrigger:()=>gk,Content:()=>pk,Context:()=>mk,Control:()=>yk,Input:()=>vk,Label:()=>wk,MonthSelect:()=>bk,NextTrigger:()=>Sk,Positioner:()=>Ek,PresetTrigger:()=>Pk,PrevTrigger:()=>kk,RangeText:()=>Ck,Root:()=>Ak,RootProvider:()=>$k,Table:()=>Rk,TableBody:()=>Mk,TableCell:()=>Lk,TableCellTrigger:()=>Nk,TableHead:()=>Fk,TableHeader:()=>Vk,TableRow:()=>Bk,Trigger:()=>zk,ValueText:()=>Ok,View:()=>Kk,ViewControl:()=>Uk,ViewTrigger:()=>jk,WeekNumberCell:()=>Hk,WeekNumberHeaderCell:()=>Yk,YearSelect:()=>qk}),Bt.Label,Bt.TableHead,Bt.TableBody,Bt.ClearTrigger,Bt.YearSelect,Bt.MonthSelect,Bt.Context,Bt.RootProvider;var Gk=U("<div>Unknown bot message type");const Xk=e=>y(Sb,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(sa,{get text(){return e.text}}):e.type==="buttons"?y(Cb,B(()=>e.buttons)):e.type==="list"?y(ix,B(()=>e.list)):e.type==="media"?y(hd,B(()=>e.media)):e.type==="link"?y(Db,B(()=>e.link)):e.type==="cards"?y(Ab,B(()=>e.cards)):e.type==="date"?y(sa,{get text(){return e.text}}):Gk()}});var Zk=U('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Jk=e=>(()=>{var t=Zk(),n=t.firstChild;return N(n,()=>e.text?.trim()),t})();var Qk=U('<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 eC=({children:e,createdAt:t})=>(()=>{var n=Qk(),r=n.firstChild;return N(r,e),N(n,y(Zu,{createdAt:t,anchor:"end"}),null),n})();var tC=U("<div>Unknown user message type");const nC=e=>y(eC,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(sa,{get text(){return e.text}}):e.type==="media"?y(hd,B(()=>e.media)):tC()}});var rC=U("<div>Unknown message origin");const oC=e=>e.origin==="bot"?y(Xk,e):e.origin==="user"?y(nC,e):e.origin==="service"?y(Jk,e):rC();function Rh(e){return Ee({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 ac(e){return Ee({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 iC=U('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),sC=U("<div>");const cc=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o,maybeAutostart:i}=Qt(),{onOpen:s}=Xc(),a=(c=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},c)};return ye("reset",()=>{r()}),Wt(()=>{o(),a(200),i()}),n(a),s(()=>a(200)),(()=>{var c=iC(),l=e;return typeof l=="function"?pr(l,c):e=c,N(c,y(Ht,{get each(){return t()},get fallback(){return(()=>{var u=sC();return N(u,()=>Oe("emptyMessages")),u})()},children:u=>y(oC,u)})),c})()};function Mh(e){return Ee({a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:'<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/>'},e)}var aC=U("<textarea>");const cC=e=>{const[,t]=ee(e,["class"]);return(()=>{var n=aC();return fn(n,B({get class(){return jt("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md: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 lC=U('<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 uC=e=>(()=>{var t=lC();return fn(t,e,!0,!0),t})();var dC=U('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const fC=()=>(()=>{var e=dC(),t=e.firstChild;return N(e,y(uC,{height:15}),t),e})();var hC=U('<div class="flex items-center justify-between gap-2 rounded-md bg-destructive/10 text-destructive text-xs px-2 py-1.5"><span></span><button type=button aria-label=Dismiss class=shrink-0>'),gC=U('<div class="flex gap-2 flex-wrap">'),pC=U('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"><input type=file multiple class=hidden></div><div class="flex justify-center opacity-70 scale-95">'),mC=U('<img class="w-full h-full object-cover">'),yC=U('<div class="absolute inset-0 bg-black/50 flex items-center justify-center"><span class="text-white text-xs font-medium">%'),vC=U('<button type=button class="absolute inset-0 bg-destructive/70 flex items-center justify-center text-white text-[10px] leading-tight px-1 text-center">'),wC=U('<button type=button class="absolute top-0.5 right-0.5 bg-black/60 text-white rounded-full p-0.5"aria-label=Remove>'),bC=U('<div class="relative w-16 h-16 rounded-md overflow-hidden border border-gray-200 bg-gray-50 flex items-center justify-center shrink-0">');const lc=()=>{const{pushMessage:e,pushMedia:t}=Qt(),{chatWidget:n}=he(),{attachments:r,addFiles:o,updateAttachment:i,removeAttachment:s,lastRejection:a,clearRejection:c}=Dr(),[l,u]=L(""),[d,f]=L(!1);let g,h;const p=()=>g?.click(),m=2,v=()=>{const S=h;if(!S)return;const P=getComputedStyle(S),R=parseFloat(P.lineHeight)||20,O=parseFloat(P.paddingTop)+parseFloat(P.paddingBottom)+parseFloat(P.borderTopWidth)+parseFloat(P.borderBottomWidth),V=R*m+O;S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,V)}px`,S.style.overflowY=S.scrollHeight>V?"auto":"hidden"};z(()=>{l(),v()});const w=S=>{c();const P=Array.from(S.currentTarget.files??[]);P.length&&o(P),S.currentTarget.value=""},x=()=>{const S=a();return S?S.reason==="size"?Oe("fileTooLarge"):Oe("fileTypeNotAllowed"):""},b=async S=>{const P=n()?._id??"";i(S.id,{status:"uploading",progress:0,error:void 0});const R=await qw(P,S.file,O=>i(S.id,{progress:O}));return i(S.id,{status:"uploaded",progress:1}),R},C=async()=>{if(d())return;const S=l().trim(),P=[...r];if(P.length===0){if(!S)return;e(S),u("");return}f(!0),u("");let R=!1;for(const O of P)try{const V=await b(O),K=R?"":S;R=!0,t(V,K),s(O.id)}catch(V){console.error(V),i(O.id,{status:"failed",error:String(V)})}f(!1)},E=async S=>{if(!(d()||S.status==="uploading"))try{const P=await b(S);t(P,""),s(S.id)}catch(P){console.error(P),i(S.id,{status:"failed",error:String(P)})}},T=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),C())};ye("setInput",S=>{S&&u(S)});const D=()=>!d()&&(l().trim().length>0||r.length>0);return(()=>{var S=pC(),P=S.firstChild,R=P.firstChild,O=R.firstChild,V=R.nextSibling;N(P,y(Z,{get when(){return a()},get children(){var Y=hC(),F=Y.firstChild,W=F.nextSibling;return N(F,x),lo(W,"click",c,!0),N(W,y(Rh,{size:14})),Y}}),R),N(P,y(Z,{get when(){return r.length>0},get children(){var Y=gC();return N(Y,y(Ht,{each:r,children:F=>y(xC,{att:F,onRemove:()=>s(F.id),onRetry:()=>E(F)})})),Y}}),R),N(R,y(Ue,{variant:"outline",class:"h-9 w-9 p-0 shrink-0 flex items-center justify-center text-gray-400",get"aria-label"(){return Oe("attachFile")},get title(){return Oe("attachFile")},type:"button",onClick:p,get children(){return y(Mh,{size:18})}}),O),O.addEventListener("change",w);var K=g;return typeof K=="function"?pr(K,O):g=O,me(O,"accept",Kw),N(R,y(cC,{ref(Y){var F=h;typeof F=="function"?F(Y):h=Y},id:"chat-input",rows:1,get placeholder(){return Oe("inputPlaceholder")},get value(){return l()},onInput:Y=>u(Y.currentTarget.value),onKeyDown:T,class:"focus-visible:ring-primary min-h-[36px] py-2 leading-tight resize-none overflow-y-hidden"}),null),N(R,y(Ue,{variant:"outline",class:"h-9 w-9 p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",get disabled(){return!D()},onClick:C,get children(){return y(Z,{get when(){return!d()},get fallback(){return y(ll,{size:18,class:"animate-spin"})},get children(){return y(Kp,{size:18})}})}}),null),N(V,y(fC,{})),S})()},xC=e=>{const t=()=>Vo(e.att.file.type)==="image";return(()=>{var n=bC();return N(n,y(Z,{get when(){return t()},get fallback(){return y(Fv,{class:"size-7 text-gray-400"})},get children(){var r=mC();return pe(o=>{var i=e.att.previewUrl,s=e.att.file.name;return i!==o.e&&me(r,"src",o.e=i),s!==o.t&&me(r,"alt",o.t=s),o},{e:void 0,t:void 0}),r}}),null),N(n,y(Z,{get when(){return e.att.status==="uploading"},get children(){var r=yC(),o=r.firstChild,i=o.firstChild;return N(o,()=>Math.round(e.att.progress*100),i),r}}),null),N(n,y(Z,{get when(){return e.att.status==="failed"},get children(){var r=vC();return lo(r,"click",e.onRetry,!0),N(r,()=>Oe("uploadFailed")),pe(o=>{var i=Oe("uploadFailed"),s=Oe("uploadFailed");return i!==o.e&&me(r,"aria-label",o.e=i),s!==o.t&&me(r,"title",o.t=s),o},{e:void 0,t:void 0}),r}}),null),N(n,y(Z,{get when(){return e.att.status==="pending"||e.att.status==="failed"},get children(){var r=wC();return lo(r,"click",e.onRemove,!0),N(r,y(Rh,{size:12})),r}}),null),pe(()=>me(n,"title",e.att.file.name)),n})()};zc(["click"]);var SC=U('<div class="absolute inset-0 z-40 flex items-center justify-center bg-background/85 backdrop-blur-sm pointer-events-none"><div class="m-3 flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-primary p-6 text-primary"><span class=font-medium>'),EC=U("<div>");const uc=e=>{const[t,n]=L(!1);let r=0;const o=i=>Array.from(i.dataTransfer?.types??[]).includes("Files");return Wt(()=>{let i=null;try{i=dr()}catch{i=null}if(!i)return;const s=i,a=f=>{o(f)&&f.preventDefault()};document.addEventListener("dragover",a),document.addEventListener("drop",a),H(()=>{document.removeEventListener("dragover",a),document.removeEventListener("drop",a)}),getComputedStyle(s).position==="static"&&(s.style.position="relative");const c=f=>{o(f)&&(f.preventDefault(),r+=1,n(!0))},l=f=>{o(f)&&f.preventDefault()},u=()=>{r=Math.max(0,r-1),r===0&&n(!1)},d=f=>{if(!o(f))return;f.preventDefault(),r=0,n(!1);const g=Array.from(f.dataTransfer?.files??[]);g.length&&e.onFiles(g)};s.addEventListener("dragenter",c),s.addEventListener("dragover",l),s.addEventListener("dragleave",u),s.addEventListener("drop",d),H(()=>{s.removeEventListener("dragenter",c),s.removeEventListener("dragover",l),s.removeEventListener("dragleave",u),s.removeEventListener("drop",d)})}),(()=>{var i=EC();return i.style.setProperty("display","contents"),N(i,y(Z,{get when(){return t()},get children(){var s=SC(),a=s.firstChild,c=a.firstChild;return N(a,y(Mh,{class:"size-8"}),c),N(c,()=>Oe("dropToUpload")),s}})),i})()};var PC=U('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),kC=U("<span class=sr-only>Close"),CC=U('<div><div class="flex justify-center gap-3 items-center">'),OC=U("<span class=sr-only>Open"),TC=U("<span class=font-bold>"),AC=U("<span>"),$C=U('<div class="animate-pulse flex p-1">');const DC=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=Xc(),{chatWidget:s}=he(),[a,c]=L(!0),[l,u]=L("");setTimeout(()=>c(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const d=()=>(s()?.style.margin??5)*4,f=()=>s()?.style.position==="left"?{left:`${d()}px`}:{right:`${d()}px`};return ye("open",()=>{o()}),ye("close",()=>{i()}),ye("toggle",()=>{r()}),ye("onAnswer",g=>{g.text&&u(g.text),o()}),(()=>{var g=CC(),h=g.firstChild;return N(g,y(Z,{get when(){return Yt(()=>!!n())()&&!s()?.hideWidget},get children(){var p=PC();return N(p,e),p}}),h),N(h,y(Z,{get when(){return s()?.whatsappBtn},get children(){return y(Ue,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return y(yb,{class:"size-9",color:"white"})}})}}),null),N(h,y(Z,{get when(){return!s()?.hideWidget},get children(){return y(Z,{get when(){return n()},get fallback(){return y(Ue,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,OC(),y(Z,{get when(){return s()?.balloonMessage},get children(){var p=AC();return N(p,y(Z,{get when(){return l()},get fallback(){return y(Z,{get when(){return!a()},get fallback(){return(()=>{var m=$C();return N(m,y(ac,{class:"size-2 animate-bounce"}),null),N(m,y(ac,{class:"size-2 animate-bounce delay-150"}),null),N(m,y(ac,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return Yt(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=TC();return N(m,(()=>{var v=Yt(()=>l().length>20);return()=>v()?l().substring(0,17)+"...":l()})()),m}})),pe(()=>qt(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return y(Ue,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,kC()]}})}})}}),null),pe(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),v=f();return m!==p.e&&qt(g,p.e=m),p.t=uo(g,v,p.t),p},{e:void 0,t:void 0}),g})()};var RC=U('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const MC=({children:e})=>{const{chatWidget:t}=he(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=RC();return uo(r,n),N(r,e),r})()};var IC=U("<div id=smarttalks-widget>");const _C=({children:e})=>{const{chatWidget:t}=he(),[n,r]=L(!1),[o,i]=L(!1),[s,a]=L("100%"),c=()=>{typeof window<"u"&&i(window.innerWidth<768)},l=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};z(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),Wt(()=>{c(),window.addEventListener("resize",c),window.visualViewport&&(window.visualViewport.addEventListener("resize",l),window.visualViewport.addEventListener("scroll",l))}),H(()=>{window.removeEventListener("resize",c),window.visualViewport&&(window.visualViewport.removeEventListener("resize",l),window.visualViewport.removeEventListener("scroll",l)),document.body.style.overflow="",document.body.style.position=""});const u=()=>(t()?.style.margin??5)*4,d=()=>{if(o())return{height:s(),top:"0px"};const f={};return t()?.fullscreen?(f.height="100%",f["max-height"]="100%",f.width="100%",f["max-width"]="100%",f.bottom=0,f.left=0):t()?.style.position&&(f[t()?.style.position||"right"]=`${u()}px`),f};return ye("open",()=>{r(!0),ge("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ye("close",()=>{r(!1),ge("onClose")}),ye("toggle",()=>{r(!n()),ge("onToggle")}),ye("onAnswer",()=>{r(!0),ge("onOpen")}),setTimeout(()=>{r(!0),ge("onOpen")},(t()?.openDelay||0)*1e3),y(Z,{get when(){return n()},get children(){var f=IC();return N(f,e),pe(g=>{var h=`
|
|
181
|
+
*/function xv(e,t){return t?ym([e.clientX,e.clientY],t):!1}function Sv(e){const t=zn(),n=Vc(),r=pu(),o=ut({placement:"bottom-start"},e),[i,s]=ee(o,["open","defaultOpen","onOpenChange"]);let a=0,l=null,c="right";const[u,d]=_(),[f,g]=_(),[h,p]=_(),[m,v]=_(),[w,x]=_(!0),[b,C]=_(s.placement),[E,T]=_([]),[D,S]=_([]),{DomCollectionProvider:P}=my({items:D,onItemsChange:S}),R=Sc({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:J=>i.onOpenChange?.(J)}),O=Nm(()=>t.forceMount()||R.isOpen()),V=oy({selectionMode:"none",dataSource:D}),K=J=>{x(J),R.open()},Y=(J=!1)=>{R.close(),J&&r&&r.close(!0)},F=J=>{x(J),R.toggle()},W=()=>{const J=m();J&&(Ae(J),V.selectionManager().setFocused(!0),V.selectionManager().setFocusedKey(void 0))},Z=J=>{T(an=>[...an,J]);const zt=r?.registerNestedMenu(J);return()=>{T(an=>ns(an,J)),zt?.()}},X=J=>c===l?.side&&xv(J,l?.area),Xe=J=>{X(J)&&J.preventDefault()},Re=J=>{X(J)||W()},dl=J=>{X(J)&&J.preventDefault()};Im({isDisabled:()=>!(r==null&&R.isOpen()&&t.isModal()),targets:()=>[m(),...E()].filter(Boolean)}),z(()=>{const J=m();if(!J||!r)return;const zt=r.registerNestedMenu(J);H(()=>{zt()})});const _i={dataset:L(()=>({"data-expanded":R.isOpen()?"":void 0,"data-closed":R.isOpen()?void 0:""})),isOpen:R.isOpen,contentPresence:O,nestedMenus:E,currentPlacement:b,pointerGraceTimeoutId:()=>a,autoFocus:w,listState:()=>V,parentMenuContext:()=>r,triggerRef:h,contentRef:m,triggerId:u,contentId:f,setTriggerRef:p,setContentRef:v,open:K,close:Y,toggle:F,focusContent:W,onItemEnter:Xe,onItemLeave:Re,onTriggerLeave:dl,setPointerDir:J=>c=J,setPointerGraceTimeoutId:J=>a=J,setPointerGraceIntent:J=>l=J,registerNestedMenu:Z,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:So(d),registerContentId:So(g)};return y(P,{get children(){return y(gu.Provider,{value:_i,get children(){return y(bv,B({anchorRef:h,contentRef:m,onCurrentPlacementChange:C},s))}})}})}const Ev=Se();function Pv(e){let t;const n=zn(),r=Bn(),o=ut({id:n.generateId(`item-${Ke()}`)},e),[i,s]=ee(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=_(),[c,u]=_(),[d,f]=_(),g=()=>r.listState().selectionManager(),h=()=>s.id,p=()=>g().focusedKey()===h(),m=()=>{i.onSelect?.(),i.closeOnSelect&&r.close(!0)};yy({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const v=ny({key:h,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),w=S=>{Ie(S,i.onPointerMove),S.pointerType==="mouse"&&(i.disabled?r.onItemLeave(S):(r.onItemEnter(S),S.defaultPrevented||(Ae(S.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},x=S=>{Ie(S,i.onPointerLeave),S.pointerType==="mouse"&&r.onItemLeave(S)},b=S=>{Ie(S,i.onPointerUp),!i.disabled&&S.button===0&&m()},C=S=>{if(Ie(S,i.onKeyDown),!S.repeat&&!i.disabled)switch(S.key){case"Enter":case" ":m();break}},E=L(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),T=L(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),D={isChecked:()=>i.checked,dataset:T,setLabelRef:f,generateId:dc(()=>s.id),registerLabel:So(l),registerDescription:So(u)};return y(Ev.Provider,{value:D,get children(){return y(Eo,B({as:"div",ref(S){var P=pn(R=>t=R,i.ref);typeof P=="function"&&P(S)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return E()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return je([i.onPointerDown,v.onPointerDown])},get onPointerUp(){return je([b,v.onPointerUp])},get onClick(){return je([i.onClick,v.onClick])},get onKeyDown(){return je([C,v.onKeyDown])},get onMouseDown(){return je([i.onMouseDown,v.onMouseDown])},get onFocus(){return je([i.onFocus,v.onFocus])},onPointerMove:w,onPointerLeave:x},T,s))}})}const kv=Se();function yu(){return Te(kv)}function Cv(e){let t;const n=zn(),r=Bn(),o=yu(),i=ut({id:n.generateId(`content-${Ke()}`)},e),[s,a]=ee(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=sy({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused()},()=>t);Rm({trapFocus:()=>c()&&r.isOpen(),onMountAutoFocus:m=>{o===void 0&&s.onOpenAutoFocus?.(m)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);const d=m=>{if(ct(m.currentTarget,m.target)&&(m.key==="Tab"&&r.isOpen()&&m.preventDefault(),o!==void 0&&m.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(m.key){case"ArrowRight":m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case"ArrowLeft":if(m.currentTarget.hasAttribute("data-closed"))break;m.stopPropagation(),m.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},f=m=>{s.onEscapeKeyDown?.(m),o?.setAutoFocusMenu(!1),r.close(!0)},g=m=>{s.onFocusOutside?.(m),n.isModal()&&m.preventDefault()},h=m=>{Ie(m,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},p=m=>{if(Ie(m,s.onPointerMove),m.pointerType!=="mouse")return;const v=m.target,w=l!==m.clientX;ct(m.currentTarget,v)&&w&&(r.setPointerDir(m.clientX>l?"right":"left"),l=m.clientX)};return z(()=>H(r.registerContentId(s.id))),y(G,{get when(){return r.contentPresence.isPresent()},get children(){return y(Ay,{get children(){return y(Oy,B({ref(m){var v=pn(w=>{r.setContentRef(w),r.contentPresence.setRef(w),t=w},s.ref);typeof v=="function"&&v(m)},role:"menu",get id(){return s.id},get tabIndex(){return u.tabIndex()},get disableOutsidePointerEvents(){return Yt(()=>!!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:f,onFocusOutside:g,get onDismiss(){return r.close},get onKeyDown(){return je([s.onKeyDown,u.onKeyDown,d])},get onMouseDown(){return je([s.onMouseDown,u.onMouseDown])},get onFocusIn(){return je([s.onFocusIn,u.onFocusIn])},get onFocusOut(){return je([s.onFocusOut,u.onFocusOut])},onPointerEnter:h,onPointerMove:p},()=>r.dataset(),a))}})}})}function Ov(e){let t;const n=zn(),r=Bn(),[o,i]=ee(e,["ref"]);return Yc({element:()=>t??null,enabled:()=>r.isOpen()&&n.preventScroll()}),y(Cv,B({ref(s){var a=pn(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}function Tv(e){return y(Pv,B({role:"menuitem",closeOnSelect:!0},e))}function Av(e){const t=Bn();return y(G,{get when(){return t.contentPresence.isPresent()},get children(){return y(jl,e)}})}function $v(e){const t=`menu-${Ke()}`,n=ut({id:t,modal:!0},e),[r,o]=ee(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value"]),i=Sc({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:dc(()=>r.id),value:()=>r.value};return y(mu.Provider,{value:s,get children(){return y(Sv,B({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function Dv(e){const t=zn(),n=Bn(),r=yu(),o=ut({id:t.generateId("trigger")},e),[i,s]=ee(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let a;r!==void 0&&(a=t.value()??i.id,z(()=>{r.registerMenu(a,[n.contentRef(),...n.nestedMenus()])}),z(()=>{r.value()===a?(n.triggerRef()?.focus(),r.autoFocusMenu()&&n.open(!0)):n.close(!0)}),z(()=>{n.isOpen()&&r.setValue(a)}),H(()=>{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=h=>{Ie(h,i.onPointerDown),h.currentTarget.dataset.pointerType=h.pointerType,!i.disabled&&h.pointerType!=="touch"&&h.button===0&&l()},u=h=>{Ie(h,i.onClick),i.disabled||h.currentTarget.dataset.pointerType==="touch"&&l()},d=h=>{if(Ie(h,i.onKeyDown),!i.disabled)switch(h.key){case"Enter":case" ":case"ArrowDown":h.stopPropagation(),h.preventDefault(),vm(h.currentTarget),n.toggle("first");break;case"ArrowUp":h.stopPropagation(),h.preventDefault(),n.toggle("last");break;case"ArrowRight":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.nextMenu();break;case"ArrowLeft":if(r===void 0)break;h.stopPropagation(),h.preventDefault(),r.previousMenu();break}},f=h=>{Ie(h,i.onMouseOver),!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(a)},g=h=>{Ie(h,i.onFocus),r!==void 0&&r.setValue(a)};return z(()=>H(n.registerTriggerId(i.id))),y(cy,B({ref(h){var p=pn(n.setTriggerRef,i.ref);typeof p=="function"&&p(h)},get id(){return i.id},get disabled(){return i.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Yt(()=>!!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:f,onClick:u,onKeyDown:d,onFocus:g,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function Rv(e){const t=zn(),n=Bn(),[r,o]=ee(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return y(Ov,B({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),i||Ae(n.triggerRef()),i=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(i=!0)}},o))}function Mv(e){const t=`dropdownmenu-${Ke()}`,n=ut({id:t},e);return y($v,n)}function Iv(e){return Ee({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 _v(e){return Ee({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 Lv(e){return Ee({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)}function Nv(e){return Ee({a:{xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file",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"/>'},e)}const Fv=e=>y(Mv,B({gutter:4},e)),Vv=Dv,Bv=e=>{const[,t]=ee(e,["class"]);return y(Av,{get mount(){return fr()},get children(){return y(Rv,B({get class(){return jt("z-50 min-w-[128px] 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))}})},zv=e=>{const[,t]=ee(e,["class"]);return y(Tv,B({get class(){return jt("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 Kv(e){return e.type==="buttons"&&e.buttons.options.length>10?{list:{text:e.buttons.text,options:[{items:e.buttons.options}]},type:"list",origin:e.origin,createdAt:e.createdAt}:e}function Uv(e){if(Array.isArray(e)){console.info("----------------------------------------------------------");for(const t of e)console.info("Executed:",t.type),console.info(t)}}async function jv(e,t,n){const r=`${Et}/v1/messages`,o=br(),i={"Content-Type":"application/json"};o&&(i["x-session-id"]=o);const s={credentials:"include",method:"POST",headers:i,body:JSON.stringify({channelId:n,postback:t,type:"text",text:e,metadata:Qi()})};await fetch(r,s)}async function Wv(e){const t=`${Et}/v1/messages`,n=br(),r={"Content-Type":"application/json"};n&&(r["x-session-id"]=n);const o={credentials:"include",method:"POST",headers:r,body:JSON.stringify({channelId:e,type:"open",metadata:Qi()})},i=await fetch(t,o);if(!i.ok)throw new Error(`open event rejected: ${i.status}`)}async function Hv(e,t,n){if(!e||!t||!n)return;const r=`${Et}/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 gt=Object.create(null);gt.open="0",gt.close="1",gt.ping="2",gt.pong="3",gt.message="4",gt.upgrade="5",gt.noop="6";const Ro=Object.create(null);Object.keys(gt).forEach(e=>{Ro[gt[e]]=e});const As={type:"error",data:"parser error"},vu=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wu=typeof ArrayBuffer=="function",bu=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$s=({type:e,data:t},n,r)=>vu&&t instanceof Blob?n?r(t):xu(t,r):wu&&(t instanceof ArrayBuffer||bu(t))?n?r(t):xu(new Blob([t]),r):r(gt[e]+(t||"")),xu=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Su(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ds;function Yv(e,t){if(vu&&e.data instanceof Blob)return e.data.arrayBuffer().then(Su).then(t);if(wu&&(e.data instanceof ArrayBuffer||bu(e.data)))return t(Su(e.data));$s(e,!1,n=>{Ds||(Ds=new TextEncoder),t(Ds.encode(n))})}const Eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ar=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Eu.length;e++)Ar[Eu.charCodeAt(e)]=e;const qv=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=Ar[e.charCodeAt(r)],s=Ar[e.charCodeAt(r+1)],a=Ar[e.charCodeAt(r+2)],l=Ar[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},Gv=typeof ArrayBuffer=="function",Rs=(e,t)=>{if(typeof e!="string")return{type:"message",data:Pu(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Xv(e.substring(1),t)}:Ro[n]?e.length>1?{type:Ro[n],data:e.substring(1)}:{type:Ro[n]}:As},Xv=(e,t)=>{if(Gv){const n=qv(e);return Pu(n,t)}else return{base64:!0,data:e}},Pu=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ku="",Zv=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{$s(i,!1,a=>{r[s]=a,++o===n&&t(r.join(ku))})})},Jv=(e,t)=>{const n=e.split(ku),r=[];for(let o=0;o<n.length;o++){const i=Rs(n[o],t);if(r.push(i),i.type==="error")break}return r};function Qv(){return new TransformStream({transform(e,t){Yv(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 Ms;function Mo(e){return e.reduce((t,n)=>t+n.length,0)}function Io(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 ew(e,t){Ms||(Ms=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(Mo(n)<1)break;const l=Io(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(Mo(n)<2)break;const l=Io(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Mo(n)<8)break;const l=Io(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(As);break}o=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Mo(n)<o)break;const l=Io(n,o);a.enqueue(Rs(i?l:Ms.decode(l),t)),r=0}if(o===0||o>e){a.enqueue(As);break}}}})}const Cu=4;function ve(e){if(e)return tw(e)}function tw(e){for(var t in ve.prototype)e[t]=ve.prototype[t];return e}ve.prototype.on=ve.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},ve.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},ve.prototype.off=ve.prototype.removeListener=ve.prototype.removeAllListeners=ve.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},ve.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},ve.prototype.emitReserved=ve.prototype.emit,ve.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},ve.prototype.hasListeners=function(e){return!!this.listeners(e).length};const _o=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),He=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nw="arraybuffer";function XC(){}function Ou(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const rw=He.setTimeout,ow=He.clearTimeout;function Lo(e,t){t.useNativeTimers?(e.setTimeoutFn=rw.bind(He),e.clearTimeoutFn=ow.bind(He)):(e.setTimeoutFn=He.setTimeout.bind(He),e.clearTimeoutFn=He.clearTimeout.bind(He))}const iw=1.33;function sw(e){return typeof e=="string"?aw(e):Math.ceil((e.byteLength||e.size)*iw)}function aw(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 Tu(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function lw(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function cw(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 uw extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Is extends ve{constructor(t){super(),this.writable=!1,Lo(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 uw(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=Rs(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=lw(t);return n.length?"?"+n:""}}class dw extends Is{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)};Jv(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,Zv(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]=Tu()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Au=!1;try{Au=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const fw=Au;function hw(){}class gw extends dw{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 pt extends ve{constructor(t,n,r){super(),this.createRequest=t,Lo(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=Ou(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=pt.requestsCount++,pt.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=hw,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pt.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(pt.requestsCount=0,pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$u);else if(typeof addEventListener=="function"){const e="onpagehide"in He?"pagehide":"unload";addEventListener(e,$u,!1)}}function $u(){for(let e in pt.requests)pt.requests.hasOwnProperty(e)&&pt.requests[e].abort()}const pw=(function(){const e=Du({xdomain:!1});return e&&e.responseType!==null})();class mw extends gw{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=pw&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new pt(Du,this.uri(),t)}}function Du(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||fw))return new XMLHttpRequest}catch{}if(!t)try{return new He[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ru=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yw extends Is{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Ru?{}:Ou(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;$s(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}o&&_o(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},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]=Tu()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const _s=He.WebSocket||He.MozWebSocket;class vw extends yw{createSocket(t,n,r){return Ru?new _s(t,n,r):n?new _s(t,n):new _s(t)}doWrite(t,n){this.ws.send(n)}}class ww extends Is{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=ew(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=Qv();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&&_o(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const bw={websocket:vw,webtransport:ww,polling:mw},xw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Sw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ls(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=xw.exec(e||""),i={},s=14;for(;s--;)i[Sw[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=Ew(i,i.path),i.queryKey=Pw(i,i.query),i}function Ew(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 Pw(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const Ns=typeof addEventListener=="function"&&typeof removeEventListener=="function",No=[];Ns&&addEventListener("offline",()=>{No.forEach(e=>e())},!1);class Jt extends ve{constructor(t,n){if(super(),this.binaryType=nw,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=Ls(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=Ls(n.host).host);Lo(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=cw(this.opts.query)),Ns&&(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"})},No.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Cu,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&&Jt.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",Jt.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+=sw(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,_o(()=>{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(Jt.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(),Ns&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=No.indexOf(this._offlineEventListener);r!==-1&&No.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Jt.protocol=Cu;class kw extends Jt{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;Jt.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;Jt.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 f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};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 Cw=class extends kw{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=>bw[o]).filter(o=>!!o)),super(t,r)}};function Ow(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=Ls(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 Tw=typeof ArrayBuffer=="function",Aw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Mu=Object.prototype.toString,$w=typeof Blob=="function"||typeof Blob<"u"&&Mu.call(Blob)==="[object BlobConstructor]",Dw=typeof File=="function"||typeof File<"u"&&Mu.call(File)==="[object FileConstructor]";function Fs(e){return Tw&&(e instanceof ArrayBuffer||Aw(e))||$w&&e instanceof Blob||Dw&&e instanceof File}function Fo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Fo(e[n]))return!0;return!1}if(Fs(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Fo(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Fo(e[n]))return!0;return!1}function Rw(e){const t=[],n=e.data,r=e;return r.data=Vs(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Vs(e,t){if(!e)return e;if(Fs(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]=Vs(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]=Vs(e[r],t));return n}return e}function Mw(e,t){return e.data=Bs(e.data,t),delete e.attachments,e}function Bs(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]=Bs(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Bs(e[n],t));return e}const Iw=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Q;(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"})(Q||(Q={}));class _w{constructor(t){this.replacer=t}encode(t){return(t.type===Q.EVENT||t.type===Q.ACK)&&Fo(t)?this.encodeAsBinary({type:t.type===Q.EVENT?Q.BINARY_EVENT:Q.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Q.BINARY_EVENT||t.type===Q.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=Rw(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class zs extends ve{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}: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===Q.BINARY_EVENT;r||n.type===Q.BINARY_ACK?(n.type=r?Q.EVENT:Q.ACK,this.reconstructor=new Lw(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Fs(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(Q[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Q.BINARY_EVENT||r.type===Q.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");const a=Number(s);if(!Nw(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}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(zs.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Q.CONNECT:return Iu(n);case Q.DISCONNECT:return n===void 0;case Q.CONNECT_ERROR:return typeof n=="string"||Iu(n);case Q.EVENT:case Q.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Iw.indexOf(n[0])===-1);case Q.ACK:case Q.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Lw{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=Mw(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Nw=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Iu(e){return Object.prototype.toString.call(e)==="[object Object]"}const Fw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:zs,Encoder:_w,get PacketType(){return Q}},Symbol.toStringTag,{value:"Module"}));function rt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Vw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _u extends ve{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=[rt(t,"open",this.onopen.bind(this)),rt(t,"packet",this.onpacket.bind(this)),rt(t,"error",this.onerror.bind(this)),rt(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(Vw.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:Q.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:Q.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 Q.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 Q.EVENT:case Q.BINARY_EVENT:this.onevent(t);break;case Q.ACK:case Q.BINARY_ACK:this.onack(t);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.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:Q.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:Q.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 Kn(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}Kn.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)==0?e-n:e+n}return Math.min(e,this.max)|0},Kn.prototype.reset=function(){this.attempts=0},Kn.prototype.setMin=function(e){this.ms=e},Kn.prototype.setMax=function(e){this.max=e},Kn.prototype.setJitter=function(e){this.jitter=e};class Ks extends ve{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,Lo(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 Kn({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||Fw;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 Cw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=rt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=rt(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(rt(t,"ping",this.onping.bind(this)),rt(t,"data",this.ondata.bind(this)),rt(t,"error",this.onerror.bind(this)),rt(t,"close",this.onclose.bind(this)),rt(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){_o(()=>{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 _u(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 $r={};function Vo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Ow(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=$r[o]&&i in $r[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new Ks(r,t):($r[o]||($r[o]=new Ks(r,t)),l=$r[o]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Vo,{Manager:Ks,Socket:_u,io:Vo,connect:Vo});class mt{static instance;constructor(){}static init(t){if(!mt.instance){const n=br();mt.instance=Vo(mg,{path:"/ws",withCredentials:!0,extraHeaders:{"widget-id":t},auth:{sessionId:n,widgetId:t},query:{sessionId:n||""}}),mt.instance.on("connect",()=>{console.info("SmartTalks.ai widget connected!",mt.instance.id)})}return mt.instance}static on(t,n,r){const o=mt.instance||this.init(n);o.off(t),o.on(t,r)}static waitForConnection(t){const n=mt.instance||this.init(t);return n.connected?Promise.resolve():new Promise(r=>{n.once("connect",()=>r())})}}const Us={image:["image/png","image/jpeg","image/webp","image/gif"],video:["video/mp4","video/webm","video/quicktime"],pdf:["application/pdf"]},Bw={image:10*1024*1024,video:50*1024*1024,pdf:20*1024*1024},zw=Object.values(Us).flat().join(",");function Bo(e){for(const t of Object.keys(Us))if(Us[t].includes(e))return t;return null}function Kw(e){const t=Bo(e.type);return t?e.size===0?{reason:"size",category:t}:e.size>Bw[t]?{reason:"size",category:t}:null:{reason:"type"}}function js(){const e=br();return e?{"x-session-id":e}:{}}async function Uw(e,t){const n=await fetch(`${Et}/v1/uploads/${e}/presign`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...js()},body:JSON.stringify({filename:t.name,contentType:t.type,size:t.size})});if(!n.ok)throw new Error(`presign failed (${n.status})`);return n.json()}function jw(e,t,n){return new Promise((r,o)=>{const i=new XMLHttpRequest;i.open("PUT",e.uploadUrl,!0),i.setRequestHeader("Content-Type",e.headers["Content-Type"]),i.timeout=(e.expiresIn||300)*1e3,i.upload.onprogress=s=>{s.lengthComputable&&n&&n(s.loaded/s.total)},i.onload=()=>{i.status>=200&&i.status<300?r():o(new Error(`upload failed (${i.status})`))},i.onerror=()=>o(new Error("upload network error")),i.ontimeout=()=>o(new Error("upload timed out")),i.send(t)})}async function Ww(e,t,n){const r=await fetch(`${Et}/v1/uploads/${e}/complete`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...js()},body:JSON.stringify({key:n,filename:t.name,contentType:t.type,size:t.size})});if(!r.ok)throw new Error(`complete failed (${r.status})`);const i=(await r.json())?.document?.url;if(typeof i!="string"||!i)throw new Error("complete: missing document url");return{key:n,url:i,contentType:t.type,filename:t.name}}async function Hw(e,t,n){const r=await fetch(`${Et}/v1/messages`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...js()},body:JSON.stringify({type:"media",channelId:e,key:t.key,contentType:t.contentType,filename:t.filename,text:n,metadata:Qi()})});if(!r.ok)throw new Error(`send media message failed (${r.status})`)}async function Yw(e,t,n){const r=await Uw(e,t);return await jw(r,t,n),Ww(e,t,r.key)}let Lu=0;const[Ws,zo]=ec([]),[qw,Nu]=_(null),Gw=e=>{for(const t of e){const n=Kw(t);if(n){Nu(n);continue}Lu+=1;const r=Bo(t.type)==="image"?URL.createObjectURL(t):"";zo(nc(o=>{o.push({id:`att-${Lu}`,file:t,previewUrl:r,status:"pending",progress:0})}))}},Xw=(e,t)=>{zo(n=>n.id===e,t)},Zw=e=>{const t=Ws.find(n=>n.id===e);t?.previewUrl&&URL.revokeObjectURL(t.previewUrl),zo(nc(n=>{const r=n.findIndex(o=>o.id===e);r>=0&&n.splice(r,1)}))},Jw=()=>{for(const e of Ws)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);zo([])},Dr=()=>({attachments:Ws,addFiles:Gw,updateAttachment:Xw,removeAttachment:Zw,clearAttachments:Jw,lastRejection:qw,clearRejection:()=>Nu(null)}),Hs=1e3*60*60*24,[Ko,Fu]=Ji("smarttalks-widget-messages",{},Hs),Vu=()=>{const{widgetId:e}=he();return Ko[e()]??[]},Qw=e=>{const{widgetId:t}=he();Fu({...Ko,[t()]:[...Ko[t()]??[],e]})},eb=()=>{const{widgetId:e}=he();Fu({...Ko,[e()]:[]})},[Bu,tb]=Ji("smarttalks-widget-conversationinfo",{},Hs),Ys=()=>{const{widgetId:e}=he();return Bu[e()]??{}},zu=e=>{const{widgetId:t}=he();tb({...Bu,[t()]:e})},[Ku,nb]=Ji("smarttalks-widget-autostarted",{},Hs),rb=()=>{const{widgetId:e}=he();return Ku[e()]??!1},Uu=e=>{const{widgetId:t}=he();nb({...Ku,[t()]:e})},[ob,Rr]=_(!1),[ib,ju]=_(!1),Wu=[],Hu=()=>{Wu.forEach(e=>e())},sb=e=>Wu.push(e),Uo=e=>{const t=Kv(e);if(Qw(t),t.type==="media"){setTimeout(Hu,200);return}Hu()},qs=()=>{const{widgetId:e}=he(),t=Ys();mt.on("message",e(),n=>{(n.contactId!==t.contactId||n.interactionId!==t.interactionId)&&zu({contactId:n.contactId,interactionId:n.interactionId});for(const r of n.messages)Uo(r),ge("onAnswer",r);Rr(!1),Uv(n.debug)})},ab=(e,t)=>{const{chatWidget:n}=he();e.trim()&&(Uo({text:e,type:"text",origin:"user",createdAt:new Date().toString()}),ge("onInput",e),qs(),Rr(!0),jv(e,t,n()?._id).catch(r=>{console.error(r),Rr(!1)}))},lb=(e,t)=>{const n=Bo(e.contentType);return n==="video"?{type:"video",link:e.url,text:t}:n==="pdf"?{type:"document",link:e.url,filename:e.filename,text:t}:{type:"image",link:e.url,text:t}},cb=(e,t)=>{const{chatWidget:n}=he();Uo({media:lb(e,t),type:"media",origin:"user",createdAt:new Date().toString()}),qs(),Rr(!0),Hw(n()?._id??"",e,t).catch(r=>{console.error(r),Rr(!1)})};let Gs=!1;const ub=()=>{const{chatWidget:e,widgetId:t}=he();qs(),Gs=!0,mt.waitForConnection(t()).then(()=>Wv(e()?._id)).then(()=>Uu(!0)).catch(n=>console.error(n)).finally(()=>{Gs=!1})},Yu=()=>{Ys().interactionId||rb()||Gs||ub()},db=()=>{const{chatWidget:e}=he(),t=Ys();ju(!0),eb(),Dr().clearAttachments(),Hv(e()?._id,t.contactId,t.interactionId).finally(()=>{zu({}),ju(!1),qu(),Uu(!1),Yu()}),ge("onReset")},qu=()=>{const{chatWidget:e}=he();if(Vu().length===0&&e()?.balloonMessage){const n=e()?.balloonMessage;n&&Uo({text:n,type:"text",origin:"bot",createdAt:new Date().toString()})}},Qt=()=>({getMessages:Vu,pushMessage:ab,pushMedia:cb,maybeAutostart:Yu,clearMessages:db,addBalloonMessage:qu,onMessage:sb,typing:ob,loading:ib});var fb=U("<span>");const hb=()=>{const{clearMessages:e}=Qt();_(!1);const[t,n]=_(!1);return y(Fv,{get open(){return t()},onOpenChange:n,get children(){return[y(Vv,{get children(){return y(Ue,{variant:"ghost",size:"icon",class:"hover:bg-accent/10 hover:text-primary-foreground",get children(){return y(Bp,{size:20})}})}}),y(Bv,{get children(){return y(zv,{class:"flex space-x-2 items-center cursor-pointer",onSelect:e,get children(){return[y(Vp,{size:14}),(()=>{var r=fb();return N(r,()=>Oe("restart")),r})()]}})}})]}})};function gb(e){return Ee({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 pb(e){return Ee({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 mb(e){return Ee({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"/>'},e)}function yb(e){return Ee({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 vb=U('<header class="flex-none bg-primary text-primary-foreground p-3 flex items-center justify-between space-x-4 relative z-10"><div class="flex items-center gap-0.5">');const Xs=()=>{const{chatWidget:e}=he(),[t,n]=_(!1);let r=null;Wt(()=>{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&c()});const o=f=>{const g=f;return!!(g.requestFullscreen||g.webkitRequestFullscreen||g.msRequestFullscreen)},i=async f=>{const g=f;try{if(g.requestFullscreen)return await g.requestFullscreen(),!0;if(g.webkitRequestFullscreen)return g.webkitRequestFullscreen(),!0;if(g.msRequestFullscreen)return g.msRequestFullscreen(),!0}catch{}return!1},s=async()=>{const f=document;try{if(document.exitFullscreen)return await document.exitFullscreen(),!0;if(f.webkitExitFullscreen)return f.webkitExitFullscreen(),!0;if(f.msExitFullscreen)return f.msExitFullscreen(),!0}catch{}return!1},a=f=>{r=document.body.style.overflow||null,document.body.style.overflow="hidden",f.classList.add("st-fullscreen"),n(!0)},l=f=>{f.classList.remove("st-fullscreen"),r!==null?(document.body.style.overflow=r,r=null):document.body.style.overflow="",n(!1)},c=async()=>{try{const f=fr();if(!f)return;if(!t())o(f)&&await i(f)||a(f);else{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.msFullscreenElement)&&await s()||l(f)}}catch{console.error("SmartTalks.ai Widget unable to toggle fullscreen in the current state.")}},u=()=>{const f=document,g=!!(document.fullscreenElement||f.webkitFullscreenElement||f.msFullscreenElement);if(n(g),!g)try{const h=fr();h.classList.contains("st-fullscreen")&&l(h)}catch{}};document.addEventListener("fullscreenchange",u),document.addEventListener("webkitfullscreenchange",u);const d=()=>{e()?.mode==="popup"&&ge("close")};return ye("toggleFullscreen",()=>{c()}),(()=>{var f=vb(),g=f.firstChild;return N(f,y(Np,{}),g),N(g,y(Ue,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:c,get children(){return y(G,{get when(){return t()},get fallback(){return y(pb,{size:16})},get children(){return y(gb,{size:16})}})}}),null),N(g,y(G,{get when(){return e()?.showSettings},get children(){return y(hb,{})}}),null),N(g,y(G,{get when(){return e()?.mode==="popup"},get children(){return y(Ue,{size:"icon",variant:"ghost",class:"hover:bg-accent/10 hover:text-primary-foreground",onClick:d,get children(){return y(yb,{size:16})}})}}),null),f})()};var wb=U("<span>");const Gu=({createdAt:e,anchor:t="end"})=>(()=>{var n=wb();return qt(n,`${t==="end"?"self-end":"self-start"} pt-1 text-[10px] italic font-light text-slate-600`),N(n,()=>new Date(e).toLocaleString([],{hour:"2-digit",minute:"2-digit"})),n})();var bb=U('<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 xb=({children:e,createdAt:t})=>(()=>{var n=bb(),r=n.firstChild;return N(r,e),N(n,y(Gu,{createdAt:t,anchor:"start"}),null),n})();var Sb=U("<span>");const jo=e=>{const[t,n]=_(!1),r=o=>{const i=new ResizeObserver(()=>{n(o.scrollWidth>o.clientWidth||o.scrollHeight>o.clientHeight)});i.observe(o),H(()=>i.disconnect())};return(()=>{var o=Sb();return pr(r,o),N(o,()=>e.text),pe(i=>{var s=e.class,a=t()?e.text:void 0;return s!==i.e&&qt(o,i.e=s),a!==i.t&&me(o,"title",i.t=a),i},{e:void 0,t:void 0}),o})()};var Eb=U("<span>");const Un=e=>{const[,t]=ee(e,["class","children"]);let n=e.children?.toString();return n&&(n=hg(gg(n))),(()=>{var r=Eb();return r.innerHTML=n,fn(r,B({get class(){return jt("whitespace-pre-line",e.class)}},t),!1,!1),r})()};var Pb=U('<div class="flex flex-col space-y-2"><div><div class="flex p-1 flex-wrap items-center justify-center">');const kb=({options:e,text:t})=>{let n;const{pushMessage:r}=Qt(),[o,i]=_(!1),s=(a,l)=>{i(!0),r(a,l)};return(()=>{var a=Pb(),l=a.firstChild,c=l.firstChild;N(a,y(Un,{get children(){return t?.trim()}}),l);var u=n;return typeof u=="function"?pr(u,c):n=c,N(c,y(Ht,{each:e,children:d=>y(Ue,{variant:"outline",get disabled(){return o()},class:"px-2 ml-1 mb-1 py-0 max-w-full min-w-0",onClick:()=>s(d.label,d.value),get children(){return y(jo,{class:"min-w-0 truncate",get text(){return d.label?.trim()}})}})})),pe(()=>qt(l,`flex items-center justify-center max-w-80 mx-[-16px] ${o()&&"opacity-50"}`)),a})()};var Cb=U('<div class="flex flex-col"><span>'),Ob=U("<a target=_blank><img><span></span><span>");const Tb=({options:e,text:t})=>(()=>{var n=Cb(),r=n.firstChild;return N(r,()=>t?.trim()),N(n,y(Ht,{each:e,children:o=>(()=>{var i=Ob(),s=i.firstChild,a=s.nextSibling,l=a.nextSibling;return N(a,()=>o.title?.trim()),N(l,()=>o.description?.trim()),pe(c=>{var u=o.url,d=o.image;return u!==c.e&&me(i,"href",c.e=u),d!==c.t&&me(s,"src",c.t=d),c},{e:void 0,t:void 0}),i})()}),null),n})();var Ab=U("<a target=_blank>");const $b=({url:e,text:t})=>(()=>{var n=Ab();return me(n,"href",e),N(n,()=>t?.trim()),n})();var le=e=>typeof e=="function"?e():e,Xu=e=>requestAnimationFrame(()=>requestAnimationFrame(e)),Db=e=>{const t=B({initialRegistered:!1},e),[n,r]=_(t.initialRegistered);return[L(()=>{if(n())return le(t.value)}),()=>{r(!0)},()=>{r(!1)}]},Zu=Db,Mr=e=>typeof e=="function",Rb=["button","color","file","image","reset","submit"],Mb=(e,t)=>e==="button"?!0:e==="input"&&t?Rb.indexOf(t)!==-1:!1;function Ib(e){const[t,n]=_(e.initialValue),r=()=>e.value?.()!==void 0,o=()=>r()?e.value?.():t();return[o,s=>ie(()=>{let a;return Mr(s)?a=s(o()):a=s,Object.is(a,o())||(r()||n(a),e.onChange?.(a)),a})]}var Zs=Ib,Wo=new Map,Ho=(e,t)=>{if(Wo.has(e))return Wo.get(e);const n=Se(t);return Wo.set(e,n),n},Js=e=>{const t=Wo.get(e);if(t)return Te(t)},Yo=new Map,_b=e=>{z(()=>{const t=le(e.style)??{},n=le(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Yo.get(e.key);o?o.activeCount++:Yo.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);H(()=>{const i=Yo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Yo.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?.()}})})},Lb=_b,Nb=e=>{const t=B({enabled:!0},e);z(()=>{le(t.enabled)&&(document.addEventListener("keydown",n),H(()=>{document.removeEventListener("keydown",n)}))});const n=r=>{r.key==="Escape"&&t.onEscapeKeyDown(r)}},Fb=Nb,Vb=e=>{const t=B({enabled:!0},e);z(()=>{const{body:n}=document;le(t.enabled)&&Lb({key:"no-pointer-events",element:n,style:{pointerEvents:"none"}})})},Bb=Vb,zb=e=>{const t=B({enabled:!0,strategy:"pointerup"},e);z(()=>{if(!le(t.enabled))return;const r=le(t.strategy);document.addEventListener(r,n),H(()=>{document.removeEventListener(r,n)})});const n=r=>{const o=le(t.element),i=le(t.ignore);o&&!o.contains(r.target)&&!(i&&i.contains(r.target))&&t.onPointer(r)}},Kb=zb,Ub=e=>{const t=B({dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e);Fb({enabled:t.dismissOnEscapeKeyDown,onEscapeKeyDown:n=>{t.onEscapeKeyDown?.(n),n.defaultPrevented||t.onDismiss("escapeKey")}}),Kb({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}),Bb({enabled:t.noOutsidePointerEvents})},jb=Ub,Qs=Se(),Wb=e=>L(()=>{if(Te(Qs))return y(Ju,e);const r=Ke(),[o,i]=_([r]),s=l=>{i(c=>[...c,l])},a=l=>{i(c=>c.filter(u=>u!==l))};return y(Qs.Provider,{value:{layers:o,onLayerShow:s,onLayerDismiss:a},get children(){return y(Ju,e)}})}),Ju=e=>{const t=B({enabled:!0,dismissOnEscapeKeyDown:!0,dismissOnOutsidePointer:!0,dismissOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:!0},e),[n,r]=ee(t,["enabled","children","dismissOnEscapeKeyDown","dismissOnOutsidePointer","dismissOnOutsidePointerStrategy","dismissOnOutsidePointerIgnore","noOutsidePointerEvents","onDismiss"]),o=Te(Qs),i=Ke();z(()=>{n.enabled?o.onLayerShow(i):o.onLayerDismiss(i)});const s=()=>o.layers()[o.layers().length-1]===i;jb({dismissOnEscapeKeyDown:()=>le(n.dismissOnEscapeKeyDown)&&s()&&n.enabled,dismissOnOutsidePointer:()=>le(n.dismissOnOutsidePointer)&&s()&&n.enabled,dismissOnOutsidePointerStrategy:n.dismissOnOutsidePointerStrategy,dismissOnOutsidePointerIgnore:n.dismissOnOutsidePointerIgnore,noOutsidePointerEvents:()=>le(n.noOutsidePointerEvents)&&n.enabled,onDismiss:c=>{n.onDismiss(c)},...r});const a=L(()=>n.children),l=()=>{const c=a();return Mr(c)?c({get isLastLayer(){return s()}}):c};return ie(()=>l())},Hb=Wb,Yb=()=>{const[e,t]=_(!1);return z(()=>t(!0)),e},qb=Yb,Gb=(e,t)=>(e&&(Mr(e)?e(t):e[0](e[1],t)),t.defaultPrevented),ea=(...e)=>e.some(t=>!!t()),Xb=e=>(...t)=>{for(const n of e)n&&n(...t)},qo=(...e)=>Xb(e),xe=e=>e?"":void 0,Zb="div",Jb=e=>{const[t,n]=ee(e,["as"]),r=L(()=>t.as??Zb);return L(()=>{const i=r();switch(typeof i){case"function":return ie(()=>i(n));case"string":return y(yr,B({component:i},n))}})},ta=Jb,Qb=e=>{let t,n=!1;return()=>n?t:(n=!0,t=L(e))},Qu=Qb,e0=e=>L(()=>le(e.element)?.tagName.toLowerCase()||e.fallback),t0=e0,ed="button",n0=e=>{const[t,n]=_(null),[r,o]=ee(e,["as","ref","type"]),i=t0({element:t,fallback:ed}),s=L(()=>Mb(i(),r.type));return y(ta,B({get as(){return r.as??ed},ref(a){var l=qo(n,r.ref);typeof l=="function"&&l(a)},get type(){return s()?"button":void 0},get role(){return s()?void 0:"button"}},o))},r0=n0,o0='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"])',na="focusTrap.initialFocus",ra="focusTrap.finalFocus",td={bubbles:!1,cancelable:!0},i0=e=>{const t=B({enabled:!0,observeChanges:!0,restoreFocus:!0},e),[n,r]=_(null),o=L(()=>{const h=n();return h?h[0]??null:null}),i=L(()=>{const h=n();return h?h[h.length-1]??null:null});let s=null;const a=()=>{ys(()=>{l(de(t.element)),(document.activeElement===null||document.activeElement===document.body)&&c(de(t.element))})};z(()=>{const h=de(t.element);if(h&&de(t.enabled)){s=document.activeElement,ie(()=>{l(h),c(h)});const p=new MutationObserver(a);de(t.observeChanges)&&p.observe(h,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex"]}),H(()=>{de(t.observeChanges)&&p.disconnect(),r(null),g(h)})}}),z(()=>{const h=n();h===null||h.length!==0||(document.addEventListener("keydown",f),H(()=>{document.removeEventListener("keydown",f)}))}),z(()=>{const h=o();h&&(h.addEventListener("keydown",u),H(()=>{h.removeEventListener("keydown",u)}))}),z(()=>{const h=i();h&&(h.addEventListener("keydown",d),H(()=>{h.removeEventListener("keydown",d)}))});const l=h=>{const p=Array.from(h.querySelectorAll(o0)).map((m,v)=>({element:m,domIndex:v,tabIndex:m.tabIndex})).sort((m,v)=>m.tabIndex===v.tabIndex?m.domIndex-v.domIndex:m.tabIndex-v.tabIndex);r(p.map(({element:m})=>m))},c=h=>{ys(()=>{const p=de(t.initialFocusElement)??o()??h,m=t.onInitialFocus;let v;m&&(v=new CustomEvent(na,td),h.addEventListener(na,m),h.dispatchEvent(v),h.removeEventListener(na,m)),v?.defaultPrevented!==!0&&p.focus()})},u=h=>{h.key==="Tab"&&h.shiftKey&&(h.preventDefault(),i().focus())},d=h=>{h.key==="Tab"&&!h.shiftKey&&(h.preventDefault(),o().focus())},f=h=>{h.key==="Tab"&&h.preventDefault()},g=h=>{ys(()=>{if(!de(t.restoreFocus))return;const m=de(t.finalFocusElement)??s;if(!m)return;let v;const w=t.onFinalFocus;w&&(v=new CustomEvent(ra,td),h.addEventListener(ra,w),h.dispatchEvent(v),h.removeEventListener(ra,w)),v?.defaultPrevented!==!0&&m.focus()})}},s0=i0,a0=s0,l0=e=>{const t=L(()=>{const s=de(e.element);if(s)return getComputedStyle(s)}),n=()=>t()?.animationName??"none",[r,o]=_(de(e.show)?"present":"hidden");let i="none";return z(s=>{const a=de(e.show);return ie(()=>{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}),z(()=>{const s=de(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),H(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},c0=l0,nd=c0,u0=Se(),d0=e=>e?Ho(`dialog-${e}`):u0,rd=Se(),f0=e=>e?Ho(`dialog-internal-${e}`):rd,jn=e=>{if(!e){const n=Te(rd);if(!n)throw new Error("[corvu]: Dialog context not found. Make sure to wrap Dialog components in <Dialog.Root>");return n}const t=Js(`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},h0="div",g0=e=>{const[t,n]=ee(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-content"]),r=L(()=>jn(t.contextId)),o=()=>ea(r().open,()=>t.forceMount,r().contentPresent),i=L(s=>s||o(),!1);return y(G,{get when(){return i()},get children(){return y(Hb,{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=L(()=>t.children);return y(G,{get when(){return o()},get children(){return y(ta,B({ref(l){var c=qo(r().setContentRef,t.ref);typeof c=="function"&&c(l)},get as(){return t.as??h0},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 xe(r().open())},get"data-closed"(){return xe(!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()}}))}})}})}})},p0=g0,m0="div",y0=e=>{const[t,n]=ee(e,["as","forceMount","contextId","children","ref","style","data-corvu-dialog-overlay"]),r=L(()=>jn(t.contextId)),o=()=>ea(r().open,()=>t.forceMount,r().overlayPresent),i=L(s=>s||o(),!1);return y(G,{get when(){return i()},get children(){return(()=>{const s=L(()=>t.children);return y(G,{get when(){return o()},get children(){return y(ta,B({get as(){return t.as??m0},ref(a){var l=qo(r().setOverlayRef,t.ref);typeof l=="function"&&l(a)},"aria-hidden":"true",get"data-open"(){return xe(r().open())},get"data-closed"(){return xe(!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()}}))}})})()}})},v0=y0,w0=e=>{const[t,n]=ee(e,["forceMount","contextId","children"]),r=L(()=>jn(t.contextId)),o=()=>ea(r().open,()=>t.forceMount,r().contentPresent,r().overlayPresent),i=qb(),s=L(a=>a||o()&&i(),!1);return y(G,{get when(){return s()},get children(){return(()=>{const a=L(()=>t.children);return y(G,{get when(){return o()},get children(){return y(jl,B(n,{get children(){return a()}}))}})})()}})},b0=w0,oa=!0,x0=e=>{const t=B({role:"dialog",initialOpen:!1,modal:!0,closeOnEscapeKeyDown:!0,closeOnOutsidePointer:()=>!!(e.modal??oa),closeOnOutsidePointerStrategy:"pointerup",noOutsidePointerEvents:()=>!!(e.modal??oa),preventScroll:()=>!!(e.modal??oa),hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",allowPinchZoom:!0,trapFocus:!0,restoreFocus:!0,dialogId:Ke()},e),[n,r]=Zs({value:()=>t.open,initialValue:t.initialOpen,onChange:t.onOpenChange}),[o,i,s]=Zu({value:()=>t.labelId??Ke()}),[a,l,c]=Zu({value:()=>t.descriptionId??Ke()}),[u,d]=_(null),[f,g]=_(null),[h,p]=_(null),{present:m}=nd({show:n,element:f}),{present:v}=nd({show:n,element:h});a0({element:f,enabled:()=>n()&&t.trapFocus,initialFocusElement:()=>t.initialFocusEl??null,restoreFocus:()=>t.restoreFocus,finalFocusElement:()=>t.finalFocusEl??null,onFinalFocus:t.onFinalFocus,onInitialFocus:t.onInitialFocus}),Yc({element:f,enabled:()=>m()&&le(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>t.preventScrollbarShift,preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom});const w={get role(){return t.role},get open(){return n()},setOpen:r,get modal(){return t.modal},get closeOnEscapeKeyDown(){return t.closeOnEscapeKeyDown},get closeOnOutsidePointer(){return le(t.closeOnOutsidePointer)},get closeOnOutsidePointerStrategy(){return t.closeOnOutsidePointerStrategy},get noOutsidePointerEvents(){return le(t.noOutsidePointerEvents)},get preventScroll(){return le(t.preventScroll)},get hideScrollbar(){return t.hideScrollbar},get preventScrollbarShift(){return le(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 m()},get contentRef(){return f()},get overlayPresent(){return v()},get overlayRef(){return h()},get dialogId(){return t.dialogId},get labelId(){return o()},get descriptionId(){return a()}},x=Qu(()=>t.children),b=()=>{const E=x()();return Mr(E)?E(w):E};return L(()=>{const E=d0(t.contextId),T=f0(t.contextId);return y(E.Provider,{value:{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,closeOnOutsidePointer:()=>le(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,noOutsidePointerEvents:()=>le(t.noOutsidePointerEvents),preventScroll:()=>le(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>le(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:v,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,descriptionId:a},get children(){return y(T.Provider,{get value(){return{role:()=>t.role,open:n,setOpen:r,modal:()=>t.modal,closeOnEscapeKeyDown:()=>t.closeOnEscapeKeyDown,onEscapeKeyDown:t.onEscapeKeyDown,closeOnOutsidePointer:()=>le(t.closeOnOutsidePointer),closeOnOutsidePointerStrategy:()=>t.closeOnOutsidePointerStrategy,onOutsidePointer:t.onOutsidePointer,noOutsidePointerEvents:()=>le(t.noOutsidePointerEvents),preventScroll:()=>le(t.preventScroll),hideScrollbar:()=>t.hideScrollbar,preventScrollbarShift:()=>le(t.preventScrollbarShift),preventScrollbarShiftMode:()=>t.preventScrollbarShiftMode,allowPinchZoom:()=>t.allowPinchZoom,trapFocus:()=>t.trapFocus,restoreFocus:()=>t.restoreFocus,initialFocusEl:()=>t.initialFocusEl,finalFocusEl:()=>t.finalFocusEl,contentPresent:m,contentRef:f,overlayPresent:v,overlayRef:h,dialogId:()=>t.dialogId,labelId:o,registerLabelId:i,unregisterLabelId:s,descriptionId:a,registerDescriptionId:l,unregisterDescriptionId:c,setContentRef:g,setOverlayRef:p,triggerRef:u,setTriggerRef:d}},get children(){return ie(()=>b())}})}})})},S0=x0,E0="button",P0=e=>{const[t,n]=ee(e,["as","contextId","ref","onClick","data-corvu-dialog-trigger"]),r=L(()=>jn(t.contextId));return y(r0,B({ref(i){var s=qo(r().setTriggerRef,t.ref);typeof s=="function"&&s(i)},get as(){return t.as??E0},onClick:i=>{!Gb(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 xe(r().open())},get"data-closed"(){return xe(!r().open())},get"data-corvu-dialog-trigger"(){return t.hasOwnProperty("data-corvu-dialog-trigger")?t["data-corvu-dialog-trigger"]:""}},n))},k0=P0,Go=e=>typeof e=="function"?e():e,od=e=>requestAnimationFrame(()=>requestAnimationFrame(e));function C0(e){const t=B({enabled:!0,dimension:"both"},e),[n,r]=_(!1),[o,i]=_(null);let s=null;z(()=>{const c=Go(t.element),u=Go(t.enabled);if(!c||!u)return;const d=new ResizeObserver(a);d.observe(c),c.addEventListener("transitionend",l),H(()=>{d.disconnect(),c.removeEventListener("transitionend",l),l()})});const a=([c])=>{if(n())return;const u=c.target,d=[u.offsetWidth,u.offsetHeight],f=Go(t.dimension);f==="both"?s?s[0]!==d[0]&&s[1]!==d[1]&&(Qe(()=>{i(s),r(!0)}),od(()=>{i(d),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d:s?Xo(f,s)!==Xo(f,d)&&(Qe(()=>{i(Xo(f,s)),r(!0)}),od(()=>{i(Xo(f,d)),parseFloat(getComputedStyle(c.target).transitionDuration)===0&&l()})):s=d},l=()=>{if(!n())return;const c=Go(t.element);c?s=[c.offsetWidth,c.offsetHeight]:s=null,Qe(()=>{r(!1),i(null)})};return{transitioning:n,transitionSize:o}}var Xo=(e,t)=>{switch(e){case"width":return t[0];case"height":return t[1]}},O0=C0,T0=O0;const A0=(e,t)=>e.length>0?()=>e(ie(t)):e;function $0(e,t){let n=0;const r=e.map((o,i)=>L(()=>(n=i,o()),void 0,es));return L(()=>r.map(o=>o())[n],void 0,t)}function id(e,t,n){let r=()=>t;const[o,i]=_(t,es),s=L(A0(e,()=>r()),t,es);return[r=$0([o,s],n),(a=>i(()=>typeof a=="function"?a(ie(r)):a))]}var D0=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},R0=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},M0=(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]=D0(o,t),d=u-l-r*c;(c!==0||d!==0)&&R0(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},I0=e=>y(k0,B({"data-corvu-dialog-trigger":void 0,"data-corvu-drawer-trigger":""},e)),sd=Se(),_0=e=>e?Ho(`drawer-${e}`):sd,L0=e=>{if(!e){const n=Te(sd);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Js(`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},ad=Se(),N0=e=>e?Ho(`drawer-internal-${e}`):ad,ld=e=>{if(!e){const n=Te(ad);if(!n)throw new Error("[corvu]: Drawer context not found. Make sure to wrap Drawer components in <Drawer.Root>");return n}const t=Js(`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},cd=(e,t,n,r)=>{if(n===void 0||r===void 0)return{value:e,offset:Zo(e,t)};const o=r[n-1]?Zo(r[n-1],t):void 0,i=r[n]?Zo(r[n],t):void 0;return{value:e,offset:Zo(e,t),lowerBreakPoint:i,upperBreakPoint:o}},Zo=(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)},F0=(e,t,n,r)=>{const o=ud("upper",e,r?n:t),i=ud("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},ud=(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),V0=(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},B0=void 0,z0=e=>{const t=B({initialOpen:!1,snapPoints:[0,1],breakPoints:[B0],defaultSnapPoint:1,side:"bottom",dampFunction:F=>6*Math.log(F+1),velocityFunction:(F,W)=>{const Z=F/W;return Z<1&&Z>-1?1:Z},velocityCacheReset:200,allowSkippingSnapPoints:!0,handleScrollableElements:!0,transitionResize:!1,closeOnOutsidePointer:!0,allowPinchZoom:!1},e),[n,r]=ee(t,["snapPoints","breakPoints","defaultSnapPoint","activeSnapPoint","onActiveSnapPointChange","side","dampFunction","velocityFunction","velocityCacheReset","allowSkippingSnapPoints","handleScrollableElements","transitionResize","open","initialOpen","onOpenChange","closeOnOutsidePointer","contextId","children"]),[o,i]=Zs({value:()=>n.open,initialValue:n.initialOpen,onChange:n.onOpenChange}),[s,a]=Zs({value:()=>n.activeSnapPoint,initialValue:0,onChange:n.onActiveSnapPointChange}),[l,c]=_(),{transitioning:u,transitionSize:d}=T0({element:()=>l()?.contentRef()??null,enabled:()=>o()&&n.transitionResize,dimension:()=>{switch(n.side){case"top":case"bottom":return"height";case"left":case"right":return"width"}}}),[f,g]=_(!1),[h,p]=id(()=>u()?"resizing":null),m=L(()=>{const F=l()?.contentRef();if(F)return getComputedStyle(F)}),[v,w]=_(!1);z(()=>{const F=o();ie(()=>{v()!==F&&(F?(w(!0),Xu(()=>{Qe(()=>{p("opening"),a(n.defaultSnapPoint)}),parseFloat(m().transitionDuration)===0&&p(null)})):(Qe(()=>{p("closing"),a(0)}),Xu(()=>{parseFloat(m().transitionDuration)===0&&x()})))})});const x=()=>{Qe(()=>{w(!1),p(null)})},[b,C]=_(0);z(()=>{const F=l()?.contentRef();if(!F)return;T(F);const W=new ResizeObserver(E);W.observe(F),H(()=>{W.disconnect()})});const E=F=>{for(const W of F)W.target===l()?.contentRef()&&T(W.target)},T=F=>{const W=ie(()=>b());switch(n.side){case"top":case"bottom":if(W===F.offsetHeight)return;C(F.offsetHeight);break;case"left":case"right":if(W===F.offsetWidth)return;C(F.offsetWidth);break}},D=L(()=>cd(s(),b())),[S,P]=id(()=>D().offset),R=L(()=>b()?(b()-S())/b():0),O={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 f()},get isTransitioning(){return h()!==null},get transitionState(){return h()},get openPercentage(){return R()},get translate(){return S()},get velocityCacheReset(){return n.velocityCacheReset},get allowSkippingSnapPoints(){return n.allowSkippingSnapPoints},get handleScrollableElements(){return n.handleScrollableElements},get transitionResize(){return n.transitionResize}},V=Qu(()=>n.children),K=F=>{c(jn(n.contextId));const W=V()();if(Mr(W)){const Z=B(F,O);return W(Z)}return W};return L(()=>{const F=_0(n.contextId),W=N0(n.contextId);return ie(()=>y(F.Provider,{value:{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:R,translate:S,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize},get children(){return y(W.Provider,{get value(){return{snapPoints:()=>n.snapPoints,breakPoints:()=>n.breakPoints,defaultSnapPoint:()=>n.defaultSnapPoint,activeSnapPoint:s,setActiveSnapPoint:a,side:()=>n.side,isDragging:f,isTransitioning:()=>h()!==null,transitionState:h,openPercentage:R,translate:S,velocityCacheReset:()=>n.velocityCacheReset,allowSkippingSnapPoints:()=>n.allowSkippingSnapPoints,handleScrollableElements:()=>n.handleScrollableElements,transitionResize:()=>n.transitionResize,dampFunction:n.dampFunction,velocityFunction:n.velocityFunction,setIsDragging:g,setTranslate:P,drawerSize:b,resolvedActiveSnapPoint:D,drawerStyles:m,setTransitionState:p,transitionSize:d,closeDrawer:x}},get children(){return y(S0,B({get open(){return v()},onOpenChange:i,get contextId(){return n.contextId},get closeOnOutsidePointer(){return!f()&&n.closeOnOutsidePointer}},r,{children:Z=>K(Z)}))}})}}))})},K0=z0,U0=e=>{const[t,n]=ee(e,["contextId","style"]);let r=!1,o=null,i=[0,0],s,a=0;const l=L(()=>ld(t.contextId)),c=L(()=>jn(t.contextId)),u=L(()=>l().snapPoints().map((x,b)=>cd(x,l().drawerSize(),b,l().breakPoints()))),d=L(()=>{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)`}}),f=L(()=>{const x=l().transitionSize();if(x)switch(l().side()){case"top":case"bottom":return`${x}px`}}),g=L(()=>{const x=l().transitionSize();if(x)switch(l().side()){case"left":case"right":return`${x}px`}});z(()=>{c().open()&&(document.addEventListener("pointermove",p),document.addEventListener("touchmove",m),document.addEventListener("pointerup",w),document.addEventListener("touchend",w),H(()=>{document.removeEventListener("pointermove",p),document.removeEventListener("touchmove",m),document.removeEventListener("pointerup",w),document.removeEventListener("touchend",w)}))});const h=x=>{V0(x.target,c().contentRef())&&l().transitionState()!=="closing"&&(r=!0,l().handleScrollableElements()&&(i=[x.clientX,x.clientY]))},p=x=>{v(x.target,x.clientX,x.clientY)},m=x=>{x.touches[0]&&v(x.target,x.touches[0].clientX,x.touches[0].clientY)},v=(x,b,C)=>{if(!r)return;if(!l().isDragging()||o===null){const D=window.getSelection();if(D&&D.toString().length>0){w();return}if(l().handleScrollableElements()){const S=[b,C].map((Y,F)=>i[F]-Y),P=Math.abs(S[0])>Math.abs(S[1])?"x":"y",R=P==="x"?S[0]:S[1];if(Math.abs(R)<.3)return;const O=c().contentRef(),[V,K]=M0(x,P,O);if(R>0&&Math.abs(V)>1||R<0&&Math.abs(K)>0){w();return}}switch(l().side()){case"top":case"bottom":o=C;break;case"right":case"left":o=b}s=new Date,a=l().translate(),Qe(()=>{l().setIsDragging(!0),l().setTransitionState(null)})}let E;switch(l().side()){case"top":E=-(o-C);break;case"bottom":E=o-C;break;case"right":E=o-b;break;case"left":E=-(o-b);break}E-=l().resolvedActiveSnapPoint().offset,E>0&&(E=l().dampFunction(E));const T=new Date;T.getTime()-s.getTime()>l().velocityCacheReset()&&(s=T,a=l().translate()),l().setTranslate(-E)},w=()=>{if(r=!1,!l().isDragging())return;const x=new Date,b=l().velocityFunction(-(a-l().translate()),x.getTime()-s.getTime()||1),C=l().translate()*b,E=F0(u(),l().translate(),C,l().allowSkippingSnapPoints());Qe(()=>{l().setTransitionState("snapping"),l().setIsDragging(!1)}),Qe(()=>{l().setActiveSnapPoint(E.value),E.offset===l().drawerSize()?c().setOpen(!1):(l().setTranslate(E.offset),parseFloat(l().drawerStyles().transitionDuration)===0&&l().setTransitionState(null))})};return y(p0,B({get contextId(){return t.contextId},get style(){return{transform:d(),"transition-duration":l().isDragging()?"0ms":void 0,height:f(),width:g(),...t.style}},onPointerDown:h,onTransitionEnd:()=>{Qe(()=>{l().transitionState()==="closing"&&l().closeDrawer(),l().transitionState()!=="resizing"&&l().setTransitionState(null)})},get"data-transitioning"(){return xe(l().isTransitioning())},get"data-opening"(){return xe(l().transitionState()==="opening")},get"data-closing"(){return xe(l().transitionState()==="closing")},get"data-snapping"(){return xe(l().transitionState()==="snapping")},get"data-resizing"(){return xe(l().transitionState()==="resizing")},"data-corvu-dialog-content":void 0,"data-corvu-drawer-content":""},n))},j0=U0,W0=e=>{const[t,n]=ee(e,["contextId"]),r=L(()=>ld(t.contextId));return y(v0,B({get contextId(){return t.contextId},get"data-transitioning"(){return xe(r().isTransitioning())},get"data-opening"(){return xe(r().transitionState()==="opening")},get"data-closing"(){return xe(r().transitionState()==="closing")},get"data-snapping"(){return xe(r().transitionState()==="snapping")},get"data-resizing"(){return xe(r().transitionState()==="resizing")},"data-corvu-dialog-overlay":void 0,"data-corvu-drawer-overlay":""},n))},H0=W0,Y0=U('<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted">');const q0=K0,G0=I0,X0=b0,Z0=e=>{const[,t]=ee(e,["class"]),n=L0();return y(H0,B({get class(){return jt("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))},J0=e=>{const[,t]=ee(e,["class","children"]);return y(X0,{get mount(){return fr()},get children(){return[y(Z0,{}),y(j0,B({id:"smarttalks-list-content",get class(){return jt("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[Y0(),Yt(()=>e.children)]}}))]}})};var Q0=U('<span class="font-semibold mt-2 max-w-full px-4 text-center break-words">'),ex=U('<div class="flex py-4 pl-3 pr-1 flex-col w-full space-y-4 overflow-y-auto">'),tx=U('<div class="flex flex-col space-y-2"><div>'),nx=U('<div class="flex flex-col w-full space-y-1"><span class="font-semibold text-slate-700">'),rx=U('<div class="flex min-w-0 flex-col items-start text-left">');const ox=({options:e,text:t,title:n})=>{const{pushMessage:r}=Qt(),[o,i]=_(!1),[s,a]=_(!1),[l,c]=_(),u=(f,g)=>{a(!1),i(!0),r(f,g)},d=f=>{const g=f.composedPath();for(const h of g)if(h.id==="smarttalks-list-content"){f.preventDefault();return}};return(()=>{var f=tx(),g=f.firstChild;return N(f,y(Un,{get children(){return t?.trim()}}),g),N(g,y(q0,{get open(){return s()},onOpenChange:a,onOutsidePointer:d,get children(){return[y(G0,{as:Ue,variant:"outline",class:"w-full min-w-0",get children(){return y(jo,{class:"min-w-0 truncate",get text(){return n?.trim()??Oe("selectOption")}})}}),y(J0,{class:"pb-2 px-2 flex flex-col items-center justify-center",get children(){return[(()=>{var h=Q0();return N(h,()=>n?.trim()??Oe("selectOption")),h})(),(()=>{var h=ex();return N(h,y(Ht,{each:e,children:p=>(()=>{var m=nx(),v=m.firstChild;return N(v,()=>p.label?.trim()??""),N(m,y(Ht,{get each(){return p.items},children:w=>y(Ue,{variant:"outline",get disabled(){return o()},get class(){return`h-auto py-3 flex justify-between gap-2 hover:bg-slate-200 ${l()===w?"bg-slate-200":""}`},onClick:()=>c(w),get children(){return[(()=>{var x=rx();return N(x,y(jo,{class:"max-w-full truncate",get text(){return w.label?.trim()}}),null),N(x,y(jo,{class:"max-w-full line-clamp-2 text-slate-500",get text(){return w.description?.trim()}}),null),x})(),y(G,{get when(){return l()===w},get fallback(){return y(_v,{class:"size-4 shrink-0 text-slate-500"})},get children(){return y(Iv,{class:"size-4 shrink-0 text-slate-500"})}})]}})}),null),m})()})),h})(),y(Ue,{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 Oe("send")}})]}})]}})),pe(()=>qt(g,o()?"opacity-50":"")),f})()};var ix=U("<audio controls preload=auto class=h-8><source type=audio/mpeg><source type=audio/ogg>Your browser does not support the audio element.");const sx=e=>(()=>{var t=ix(),n=t.firstChild,r=n.nextSibling;return pe(o=>{var i=e.link,s=e.link;return i!==o.e&&me(n,"src",o.e=i),s!==o.t&&me(r,"src",o.t=s),o},{e:void 0,t:void 0}),t})();var ax=U('<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 lx=e=>(()=>{var t=ax(),n=t.firstChild,r=n.firstChild;return N(n,y(Lv,{class:"size-10"}),r),N(r,()=>e.filename?.trim()),N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(()=>me(n,"href",e.link)),t})();var cx=U('<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 max-w-[320px] rounded-md">');const ux=e=>(()=>{var t=cx(),n=t.firstChild,r=n.firstChild;return N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(o=>{var i=e.link,s=e.link,a=e.text?.trim();return i!==o.e&&me(n,"href",o.e=i),s!==o.t&&me(r,"src",o.t=s),a!==o.a&&me(r,"alt",o.a=a),o},{e:void 0,t:void 0,a:void 0}),t})();var dx=U('<div class="flex flex-col space-y-2"><video controls preload=auto class="w-full h-auto max-w-[320px] rounded-md"><source type=video/mp4><source type=video/ogg>Your browser does not support the video element.');const fx=e=>(()=>{var t=dx(),n=t.firstChild,r=n.firstChild,o=r.nextSibling;return N(t,y(Un,{get children(){return e.text?.trim()}}),null),pe(i=>{var s=e.link,a=e.link;return s!==i.e&&me(r,"src",i.e=s),a!==i.t&&me(o,"src",i.t=a),i},{e:void 0,t:void 0}),t})();var hx=U("<div>Media type not supported");const dd=e=>e.type==="image"?y(ux,e):e.type==="audio"?y(sx,e):e.type==="document"?y(lx,e):e.type==="video"?y(fx,e):hx(),ia=({text:e})=>y(Un,{get children(){return e?.trim()}});var yt=()=>(e,t)=>ee(e,t);function gx(e){return e==null?[]:Array.isArray(e)?e:[e]}var px=e=>e[e.length-1],mx=e=>Array.from(new Set(e));function fd(e,t){return e.reduce((n,r,o)=>(o%t===0?n.push([r]):px(n)?.push(r),n),[])}var hd=e=>e?.constructor.name==="Array",yx=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Jo(e[n],t[n]))return!1;return!0},Jo=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(hd(e)&&hd(t))return yx(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!Jo(e[i],t[i]))return!1}return!0},vx=e=>Array.isArray(e),gd=e=>e!=null&&typeof e=="object",wx=e=>gd(e)&&!vx(e),bx=e=>typeof e=="number"&&!Number.isNaN(e),Wn=e=>typeof e=="string",ot=e=>typeof e=="function",xx=e=>e==null,pd=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Sx=e=>Object.prototype.toString.call(e),md=Function.prototype.toString,Ex=md.call(Object),Px=e=>{if(!gd(e)||Sx(e)!="[object Object]"||Ox(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=pd(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&md.call(n)==Ex},kx=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,Cx=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Ox=e=>kx(e)||Cx(e),yd=()=>{},Ir=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function _r(e,t,...n){if(e in t){const o=t[e];return ot(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,_r),r}var{min:Tx,max:Ax}=Math,$x=e=>Number.isNaN(e),vd=e=>$x(e)?0:e,sa=(e,t,n)=>{const r=vd(e),o=t==null||r>=t,i=n==null||r<=n;return o&&i},Dx=(e,t,n)=>Tx(Ax(vd(e),t),n);function aa(e){if(!Px(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=aa(o))}return n}function Qo(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function wd(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function la(e,t){if(e==null)throw new Error(t())}function Rx(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function en(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,s=Se(i);function a(){const l=Te(s);if(!l&&t){const c=new Error(o??Rx(n,r));throw c.name="ContextError",pd(Error,"captureStackTrace")&&ot(Error.captureStackTrace)&&Error.captureStackTrace(c,a),c}return l}return[s.Provider,a,s]}en({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"});var Mx=e=>yt()(e,["lazyMount","unmountOnExit"]),Ix=e=>typeof e=="function",bd=(e,...t)=>Ix(e)?e(...t):e;function _x(e,t){const{state:n,send:r,context:o}=e,i=n.matches("mounted","unmountSuspended");return{skip:!o.get("initial"),present:i,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var Lx=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Nx=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,xd=e=>{const t={};let n;for(;n=Nx.exec(e);)t[n[1]]=n[2];return t},Fx=(e,t)=>{if(Wn(e)){if(Wn(t))return`${e};${t}`;e=xd(e)}else Wn(t)&&(t=xd(t));return Object.assign({},e??{},t??{})};function Vx(...e){let t={};for(let n of e){if(!n)continue;for(let o in t){if(o.startsWith("on")&&typeof t[o]=="function"&&typeof n[o]=="function"){t[o]=Ir(n[o],t[o]);continue}if(o==="className"||o==="class"){t[o]=Lx(t[o],n[o]);continue}if(o==="style"){t[o]=Fx(t[o],n[o]);continue}t[o]=n[o]!==void 0?n[o]:t[o]}for(let o in n)t[o]===void 0&&(t[o]=n[o]);const r=Object.getOwnPropertySymbols(n);for(let o of r)t[o]=n[o]}return t}function Bx(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((l,c)=>!Jo(r[c],l)))&&(r=s,o=t(s,i)),o}}var tn=".",Sd="#",Ed=new WeakMap,Pd=new WeakMap;function ca(e){return e.join(tn)}function zx(e){return e.includes(tn)}function kd(e){return e.startsWith(Sd)}function Kx(e){return e.startsWith(tn)}function Ux(e){return kd(e)?e.slice(Sd.length):e}function ua(e,t){return e?`${e}${tn}${t}`:t}function jx(e){const t=new Map,n=new Map,r=(o,i)=>{t.set(o,i);const s=i.id;s&&(n.has(s)&&wd(`[zag-js] Duplicate state id: "${s}"`),n.set(s,o));const a=i.states;if(a){la(i.initial,()=>`[zag-js] Compound state "${o}" has child states but no "initial" property`),i.initial in a||wd(`[zag-js] Compound state "${o}" has initial "${String(i.initial)}" which is not a child state`);for(const[l,c]of Object.entries(a)){if(!c)continue;const u=ua(o,l);r(u,c)}}};for(const[o,i]of Object.entries(e.states))i&&r(o,i);return{index:t,idIndex:n}}function Lr(e){const t=Ed.get(e);if(t)return t;const{index:n,idIndex:r}=jx(e);return Ed.set(e,n),Pd.set(e,r),n}function Wx(e,t){return Lr(e),Pd.get(e)?.get(t)}function da(e){return e?String(e).split(tn).filter(Boolean):[]}function ei(e,t){if(!t)return[];const n=Lr(e),r=da(t),o=[],i=[];for(const s of r){i.push(s);const a=ca(i),l=n.get(a);if(!l)break;o.push({path:a,state:l})}return o}function Nr(e,t){const n=Lr(e),r=da(t);if(!r.length)return t;const o=[];for(const a of r){o.push(a);const l=ca(o);if(!n.has(l))return t}let i=ca(o),s=n.get(i);for(;s?.initial;){const a=`${i}${tn}${s.initial}`,l=n.get(a);if(!l)break;i=a,s=l}return i}function Cd(e,t){return Lr(e).has(t)}function Od(e,t,n){const r=String(t);if(kd(r)){const o=Ux(r),i=Wx(e,o);return la(i,()=>`[zag-js] Unknown state id: "${o}"`),Nr(e,i)}if(Kx(r)&&n){const o=ua(n,r.slice(1));return Nr(e,o)}if(!zx(r)&&n){const o=da(n);for(let i=o.length-1;i>=1;i--){const s=o.slice(0,i).join(tn),a=ua(s,r);if(Cd(e,a))return Nr(e,a)}if(Cd(e,r))return Nr(e,r)}return Nr(e,r)}function Hx(e,t,n){const r=ei(e,t);for(let i=r.length-1;i>=0;i--){const a=r[i]?.state.on?.[n];if(a)return{transitions:a,source:r[i]?.path}}return{transitions:e.on?.[n],source:void 0}}function Yx(e,t,n,r){const o=t?ei(e,t):[],i=ei(e,n);let s=0;for(;s<o.length&&s<i.length&&o[s]?.path===i[s]?.path;)s+=1;let a=o.slice(s).reverse(),l=i.slice(s);const c=o.at(-1)?.path===i.at(-1)?.path;return r&&c&&(a=o.slice().reverse(),l=i),{exiting:a,entering:l}}function qx(e,t){return e?e===t||e.startsWith(`${t}${tn}`):!1}function Gx(e,t,n){return ei(e,t).some(r=>r.state.tags?.includes(n))}function Xx(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function Td(e){return Lr(e),e}var Hn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Hn||{}),ti="__init__",Zx=Object.defineProperty,Jx=(e,t,n)=>t in e?Zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fa=(e,t,n)=>Jx(e,typeof t!="symbol"?t+"":t,n),Ad=()=>{},ni=e=>typeof e=="object"&&e!==null,j=e=>e?"":void 0,Pe=e=>e?"true":void 0,Qx=1,e1=9,t1=11,Fe=e=>ni(e)&&e.nodeType===Qx&&typeof e.nodeName=="string",ha=e=>ni(e)&&e.nodeType===e1,n1=e=>ni(e)&&e===e.window,$d=e=>Fe(e)?e.localName||"":"#document";function r1(e){return["html","body","#document"].includes($d(e))}var Dd=e=>ni(e)&&e.nodeType!==void 0,Yn=e=>Dd(e)&&e.nodeType===t1&&"host"in e,o1=e=>Fe(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function i1(e){if(!e)return!1;const t=e.getRootNode();return Rd(t)===e}function ri(e,t){if(!e||!t||!Fe(e)||!Dd(t))return!1;if(Fe(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&Yn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wn(e){return ha(e)?e:n1(e)?e.document:e?.ownerDocument??document}function s1(e){return wn(e).documentElement}function At(e){return Yn(e)?At(e.host):ha(e)?e.defaultView??window:Fe(e)?e.ownerDocument?.defaultView??window:window}function Rd(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function a1(e){if($d(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yn(e)&&e.host||s1(e);return Yn(t)?t.host:t}function l1(e){let t;try{if(t=e.getRootNode({composed:!0}),ha(t)||Yn(t))return t}catch{}return e.ownerDocument??document}var ga=new WeakMap;function pa(e){return ga.has(e)||ga.set(e,At(e).getComputedStyle(e)),ga.get(e)}var c1=new Set(["menu","listbox","dialog","grid","tree","region","application"]),u1=e=>c1.has(e),d1=e=>e.getAttribute("aria-controls")?.split(" ")||[];function f1(e,t){const n=new Set,r=l1(e),o=i=>{const s=i.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const l=d1(a);for(const c of l){if(!c||n.has(c))continue;n.add(c);const u=r.getElementById(c);if(u){const d=u.getAttribute("role"),f=u.getAttribute("aria-modal")==="true";if(d&&u1(d)&&!f&&(u===t||u.contains(t)||o(u)))return!0}}}return!1};return o(e)}var Md=()=>typeof document<"u";function h1(){return navigator.userAgentData?.platform??navigator.platform}var ma=e=>Md()&&e.test(h1()),Id=()=>Md()&&!!navigator.maxTouchPoints,g1=()=>ma(/^iPhone/i),p1=()=>ma(/^iPad/i)||Ld()&&navigator.maxTouchPoints>1,_d=()=>g1()||p1(),Ld=()=>ma(/^Mac/i);function m1(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function qn(e){return m1(e)?.[0]??e.target}function y1(e){return Fd(e).isComposing||e.keyCode===229}var v1=e=>e.button===2||Ld()&&e.ctrlKey&&e.button===0,w1={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Nd={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function b1(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=w1[o]??o,n==="rtl"&&r==="horizontal"&&o in Nd&&(o=Nd[o]),o}function Fd(e){return e.nativeEvent??e}var oi=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function x1(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=At(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function S1(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function ii(e,t,n="value"){if(!e)return;const r=S1(e);r&&x1(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}var E1="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Vd(e){return!Fe(e)||e.closest("[inert]")?!1:e.matches(E1)&&o1(e)}var P1=class Ih{constructor(){fa(this,"id",null),fa(this,"fn_cleanup"),fa(this,"cleanup",()=>{this.cancel()})}static create(){return new Ih}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function $e(e){const t=P1.create();return t.request(e),t.cleanup}function ya(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function va(e){const t=a1(e);return r1(t)?wn(t).body:Fe(t)&&O1(t)?t:va(t)}var k1=/auto|scroll|overlay|hidden|clip/,C1=new Set(["inline","contents"]);function O1(e){const t=At(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return k1.test(n+o+r)&&!C1.has(i)}var Gn="default",wa="",si=new WeakMap;function T1(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return _d()?(Gn==="default"&&(wa=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),Gn="disabled"):t&&(si.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Bd({target:t,doc:r})}function Bd(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(_d()){if(Gn!=="disabled")return;Gn="restoring",setTimeout(()=>{ya(()=>{Gn==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=wa||""),wa="",Gn="default")})},300)}else if(t&&si.has(t)){const i=si.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),si.delete(t)}}function A1(e={}){const{defer:t,target:n,...r}=e,o=t?$e:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(T1({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function $1(e,t){return Array.from(e?.querySelectorAll(t)??[])}function D1(e,t){return e?.querySelector(t)??null}function zd(e,t){if(!e)return Ad;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return R1(n,t)?Ad:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function R1(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function M1(e,t,n){const{signal:r}=t;return[new Promise((s,a)=>{const l=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(l),a(new DOMException("Promise aborted","AbortError"))}),e.then(c=>{r.aborted||(clearTimeout(l),s(c))}).catch(c=>{r.aborted||(clearTimeout(l),a(c))})}),()=>t.abort()]}function I1(e,t){const{timeout:n,rootNode:r}=t,o=At(r),i=wn(r),s=new o.AbortController;return M1(new Promise(a=>{const l=e();if(l){a(l);return}const c=new o.MutationObserver(()=>{const u=e();u&&u.isConnected&&(c.disconnect(),a(u))});c.observe(i.body,{childList:!0,subtree:!0})}),s,n)}function _1(e){const t=()=>e.getRootNode?.()??document,n=()=>wn(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>Rd(t()),isActiveElement:i1,getById:s=>t().getElementById(s)}}var L1=Td({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e("onExitComplete")?.();const n=t.get("node");if(!n)return;const r=At(n),o=new r.CustomEvent("exitcomplete",{bubbles:!1});n.dispatchEvent(o)},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",pa(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const o=r("present");if(o)return n({type:"MOUNT",src:"presence.changed"});const i=t.get("node");if(!o&&i?.ownerDocument.visibilityState==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});$e(()=>{if(r("present"))return;const s=ai(t.get("styles"));e.set("unmountAnimationName",s),s==="none"||s===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{$e(()=>{e.set("prevAnimationName",ai(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const o=t.get("node");if(!o)return;const i=c=>{(c.composedPath?.()?.[0]??c.target)===o&&e.set("prevAnimationName",ai(t.get("styles")))},s=c=>{const u=ai(t.get("styles"));qn(c)===o&&u===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})},a=c=>{qn(c)===o&&!r("present")&&n({type:"UNMOUNT",src:"animationcancel"})};o.addEventListener("animationstart",i),o.addEventListener("animationcancel",a),o.addEventListener("animationend",s);const l=zd(o,{animationFillMode:"forwards"});return()=>{o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",s),ya(()=>l())}}}}});function ai(e){return e?.animationName||"none"}function N1(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}function li(e){const t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,o]=_(t),i=L(()=>e().value!=null),s={current:r()},a={current:void 0};z(()=>{const u=i()?e().value:r();a.current=u,s.current=u});const l=u=>{const d=a.current,f=ot(u)?u(s.current):u;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:f,prev:d}),i()||o(f),n(f,d)||e().onChange?.(f,d)};function c(){const u=i()?e().value:r;return ot(u)?u():u}return{initial:t,ref:s,get:c,set:l,invoke(u,d){e().onChange?.(u,d)},hash(u){return e().hash?.(u)??String(u)}}}li.cleanup=e=>{H(()=>e())},li.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function F1(e){const t={current:e};return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}function ba(e){return ot(e)?e():e}var V1=(e,t)=>{let n=[],r=!0;z(()=>{if(r){n=e.map(i=>ba(i)),r=!1;return}let o=!1;for(let i=0;i<e.length;i++)if(!Jo(n[i],ba(e[i]))){o=!0;break}o&&(n=e.map(i=>ba(i)),t())})};function Kd(e,t={}){const n=L(()=>{const{id:D,ids:S,getRootNode:P}=xa(t);return _1({id:D,ids:S,getRootNode:P})}),r=(...D)=>{e.debug&&console.log(...D)},o=L(()=>e.props?.({props:aa(xa(t)),scope:n()})??xa(t)),i=B1(o),s=e.context?.({prop:i,bindable:li,get scope(){return n()},flush:Ud,getContext(){return a},getComputed(){return b},getRefs(){return h},getEvent(){return f()}}),a={get(D){return s?.[D].get()},set(D,S){s?.[D].set(S)},initial(D){return s?.[D].initial},hash(D){const S=s?.[D].get();return s?.[D].hash(S)}},l={current:new Map},c={current:null},u={current:null},d={current:{type:""}},f=()=>B(d.current,{current(){return d.current},previous(){return u.current}}),g=()=>B(C,{matches(...D){const S=C.get();return D.some(P=>qx(S,P))},hasTag(D){const S=C.get();return Gx(e,S,D)}}),h=F1(e.refs?.({prop:i,context:a})??{}),p=()=>({state:g(),context:a,event:f(),prop:i,send:T,action:m,guard:v,track:V1,refs:h,computed:b,flush:Ud,get scope(){return n()},choose:x}),m=D=>{const S=ot(D)?D(p()):D;if(!S)return;const P=S.map(R=>{const O=e.implementations?.actions?.[R];return O||Qo(`[zag-js] No implementation found for action "${JSON.stringify(R)}"`),O});for(const R of P)R?.(p())},v=D=>{if(ot(D))return D(p());const S=e.implementations?.guards?.[D];return S||Qo(`[zag-js] No implementation found for guard "${JSON.stringify(D)}"`),S?.(p())},w=D=>{const S=ot(D)?D(p()):D;if(!S)return;const P=S.map(O=>{const V=e.implementations?.effects?.[O];return V||Qo(`[zag-js] No implementation found for effect "${JSON.stringify(O)}"`),V}),R=[];for(const O of P){const V=O?.(p());V&&R.push(V)}return()=>R.forEach(O=>O?.())},x=D=>gx(D).find(S=>{let P=!S.guard;return Wn(S.guard)?P=!!v(S.guard):ot(S.guard)&&(P=S.guard(p())),P}),b=D=>{la(e.computed,()=>"[zag-js] No computed object found on machine");const S=e.computed[D];return S({context:a,event:d.current,prop:i,refs:h,scope:n(),computed:b})},C=li(()=>({defaultValue:Od(e,e.initialState({prop:i})),onChange(D,S){const{exiting:P,entering:R}=Yx(e,S,D,c.current?.reenter);if(P.forEach(O=>{l.current.get(O.path)?.(),l.current.delete(O.path)}),P.forEach(O=>{m(O.state?.exit)}),m(c.current?.actions),R.forEach(O=>{const V=w(O.state?.effects);if(V){const K=l.current.get(O.path);l.current.set(O.path,K?Ir(K,V):V)}}),S===ti){m(e.entry);const O=w(e.effects);if(O){const V=l.current.get(ti);l.current.set(ti,V?Ir(V,O):O)}}R.forEach(O=>{m(O.state?.entry)})}}));let E=Hn.NotStarted;Wt(()=>{const D=E===Hn.Started;E=Hn.Started,r(D?"rehydrating...":"initializing..."),C.invoke(C.initial,ti)}),H(()=>{r("unmounting..."),E=Hn.Stopped,l.current.forEach(S=>S?.()),l.current=new Map,c.current=null,m(e.exit)});const T=D=>{queueMicrotask(()=>{if(E!==Hn.Started)return;u.current=d.current,d.current=D;let S=ie(()=>C.get());const{transitions:P,source:R}=Hx(e,S,D.type),O=x(P);if(!O)return;c.current=O;const V=Od(e,O.target??S,R);r("transition",D.type,O.target||S,`(${O.actions})`),V!==S?C.set(V):O.reenter?C.invoke(S,S):m(O.actions)})};return e.watch?.(p()),{state:g(),send:T,context:a,prop:i,get scope(){return n()},refs:h,computed:b,event:f(),getStatus:()=>E}}function Ud(e){e()}function xa(e){return ot(e)?e():e}function B1(e){return function(n){return e()[n]}}function te(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r=="function"&&(r=r()),r){const o=Object.getOwnPropertyDescriptors(r);for(const i in o)i in t||Object.defineProperty(t,i,{enumerable:!0,get(){let s={};if(i==="style"||i==="class"||i==="className"||i.startsWith("on")){for(let a=0;a<e.length;a++){let l=e[a];typeof l=="function"&&(l=l()),s=Vx(s,{[i]:(l||{})[i]})}return s[i]}for(let a=e.length-1;a>=0;a--){let l,c=e[a];if(typeof c=="function"&&(c=c()),l=(c||{})[i],l!==void 0)return l}}})}}return t}var jd={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},z1=e=>e.startsWith("--")?e:q1(e);function K1(e){return e in jd?jd[e]:e}var U1=N1(e=>{const t={};for(const n in e){const r=e[n];if(!(n==="readOnly"&&r===!1)){if(n==="style"&&wx(r)){t.style=j1(r);continue}if(n==="children"){Wn(r)&&(t.textContent=r);continue}t[K1(n)]=r}}return t});function j1(e){let t={};for(const n in e){const r=e[n];!Wn(r)&&!bx(r)||(t[z1(n)]=r)}return t}var W1=/[A-Z]/g,H1=/^ms-/;function Y1(e){return"-"+e.toLowerCase()}var Sa={};function q1(e){if(Sa.hasOwnProperty(e))return Sa[e];const t=e.replace(W1,Y1);return Sa[e]=H1.test(t)?"-"+t:t}var Wd=e=>{const[t,n]=Mx(bd(e)),[r,o]=_(!1),i=Kd(L1,e),s=L(()=>_x(i));z(()=>{s().present&&o(!0)});const a=l=>{l&&i.send({type:"NODE.SET",node:l})};return L(()=>({unmounted:!s().present&&!r()&&t.lazyMount||t.unmountOnExit&&!s().present&&r(),present:s().present,ref:a,presenceProps:{hidden:!s().present,"data-state":s().skip&&n.skipAnimationOnMount?void 0:n.present?"open":"closed"}}))},G1=e=>typeof e=="function",Hd=(e,t)=>{for(const n of e)G1(n)&&n(t)};function X1(...e){let t=null;return z(()=>{Hd(e,t)}),n=>{t=n,Hd(e,n)}}var Ea=e=>n=>{const[r,o]=ee(n,["asChild"]);if(r.asChild){const i=s=>{const[,a]=ee(o,["ref"]);return te(a,s)};return r.asChild(i)}return y(yr,B({component:e},o))};function Z1(){const e=new Map;return new Proxy(Ea,{apply(t,n,r){return Ea(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Ea(r)),e.get(r)}})}var re=Z1(),Yd=e=>yt()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]),[qd,Gd]=en({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Fr=(e,t=[])=>({parts:(...n)=>{if(J1(t))return Fr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Fr(e,[...t,...n]),omit:(...n)=>Fr(e,t.filter(r=>!n.includes(r))),rename:n=>Fr(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${Xn(e)}"][data-part="${Xn(r)}"]`,`& [data-scope="${Xn(e)}"][data-part="${Xn(r)}"]`].join(", "),attrs:{"data-scope":Xn(e),"data-part":Xn(r)}}}),{})}),Xn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),J1=e=>e.length===0;const Q1=["top","right","bottom","left"],nn=Math.min,Ve=Math.max,ci=Math.round,ui=Math.floor,vt=e=>({x:e,y:e}),eS={left:"right",right:"left",bottom:"top",top:"bottom"};function Pa(e,t,n){return Ve(e,nn(t,n))}function $t(e,t){return typeof e=="function"?e(t):e}function Dt(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function ka(e){return e==="x"?"y":"x"}function Ca(e){return e==="y"?"height":"width"}function wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Oa(e){return ka(wt(e))}function tS(e,t,n){n===void 0&&(n=!1);const r=Zn(e),o=Oa(e),i=Ca(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=di(s)),[s,di(s)]}function nS(e){const t=di(e);return[Ta(e),t,Ta(t)]}function Ta(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Xd=["left","right"],Zd=["right","left"],rS=["top","bottom"],oS=["bottom","top"];function iS(e,t,n){switch(e){case"top":case"bottom":return n?t?Zd:Xd:t?Xd:Zd;case"left":case"right":return t?rS:oS;default:return[]}}function sS(e,t,n,r){const o=Zn(e);let i=iS(Dt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ta)))),i}function di(e){const t=Dt(e);return eS[t]+e.slice(t.length)}function aS(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jd(e){return typeof e!="number"?aS(e):{top:e,right:e,bottom:e,left:e}}function fi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Qd(e,t,n){let{reference:r,floating:o}=e;const i=wt(t),s=Oa(t),a=Ca(s),l=Dt(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-o.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Zn(t)){case"start":g[s]-=f*(n&&c?-1:1);break;case"end":g[s]+=f*(n&&c?-1:1);break}return g}async function lS(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:f=!1,padding:g=0}=$t(t,e),h=Jd(g),m=a[f?d==="floating"?"reference":"floating":d],v=fi(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=fi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(v.top-C.top+h.top)/b.y,bottom:(C.bottom-v.bottom+h.bottom)/b.y,left:(v.left-C.left+h.left)/b.x,right:(C.right-v.right+h.right)/b.x}}const cS=50,uS=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:lS},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}=Qd(c,r,l),f=r,g=0;const h={};for(let p=0;p<i.length;p++){const m=i[p];if(!m)continue;const{name:v,fn:w}=m,{x,y:b,data:C,reset:E}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=x??u,d=b??d,h[v]={...h[v],...C},E&&g<cS&&(g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=Qd(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}},dS=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}=$t(e,t)||{};if(c==null)return{};const d=Jd(u),f={x:n,y:r},g=Oa(o),h=Ca(g),p=await s.getDimensions(c),m=g==="y",v=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[g]-f[g]-i.floating[h],C=f[g]-i.reference[g],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=E?E[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=a.floating[x]||i.floating[h]);const D=b/2-C/2,S=T/2-p[h]/2-1,P=nn(d[v],S),R=nn(d[w],S),O=P,V=T-p[h]-R,K=T/2-p[h]/2+D,Y=Pa(O,K,V),F=!l.arrow&&Zn(o)!=null&&K!==Y&&i.reference[h]/2-(K<O?P:R)-p[h]/2<0,W=F?K<O?K-O:K-V:0;return{[g]:f[g]+W,data:{[g]:Y,centerOffset:K-Y-W,...F&&{alignmentOffset:W}},reset:F}}}),fS=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:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...m}=$t(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Dt(o),w=wt(a),x=Dt(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!p?[di(a)]:nS(a)),E=h!=="none";!f&&E&&C.push(...sS(a,p,h,b));const T=[a,...C],D=await l.detectOverflow(t,m),S=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&S.push(D[v]),d){const K=tS(o,s,b);S.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:o,overflows:S}],!S.every(K=>K<=0)){var R,O;const K=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=T[K];if(Y&&(!(d==="alignment"?w!==wt(Y):!1)||P.every(Z=>wt(Z.placement)===w?Z.overflows[0]>0:!0)))return{data:{index:K,overflows:P},reset:{placement:Y}};let F=(O=P.filter(W=>W.overflows[0]<=0).sort((W,Z)=>W.overflows[1]-Z.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(g){case"bestFit":{var V;const W=(V=P.filter(Z=>{if(E){const X=wt(Z.placement);return X===w||X==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(X=>X>0).reduce((X,Xe)=>X+Xe,0)]).sort((Z,X)=>Z[1]-X[1])[0])==null?void 0:V[0];W&&(F=W);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function ef(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tf(e){return Q1.some(t=>e[t]>=0)}const hS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=$t(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=ef(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tf(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=ef(s,n.floating);return{data:{escapedOffsets:a,escaped:tf(a)}}}default:return{}}}}},nf=new Set(["left","top"]);async function gS(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Dt(n),a=Zn(n),l=wt(n)==="y",c=nf.has(s)?-1:1,u=i&&l?-1:1,d=$t(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),l?{x:g*u,y:f*c}:{x:f*c,y:g*u}}const pS=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 gS(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}}}}},mS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y:x}=v;return{x:w,y:x}}},...c}=$t(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),f=wt(Dt(o)),g=ka(f);let h=u[g],p=u[f];if(s){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",x=h+d[v],b=h-d[w];h=Pa(x,h,b)}if(a){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=p+d[v],b=p-d[w];p=Pa(x,p,b)}const m=l.fn({...t,[g]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:s,[f]:a}}}}}},yS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=$t(e,t),u={x:n,y:r},d=wt(o),f=ka(d);let g=u[f],h=u[d];const p=$t(a,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=i.reference[f]-i.floating[x]+m.mainAxis,C=i.reference[f]+i.reference[x]-m.mainAxis;g<b?g=b:g>C&&(g=C)}if(c){var v,w;const x=f==="y"?"width":"height",b=nf.has(Dt(o)),C=i.reference[d]-i.floating[x]+(b&&((v=s.offset)==null?void 0:v[d])||0)+(b?0:m.crossAxis),E=i.reference[d]+i.reference[x]+(b?0:((w=s.offset)==null?void 0:w[d])||0)-(b?m.crossAxis:0);h<C?h=C:h>E&&(h=E)}return{[f]:g,[d]:h}}}},vS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=$t(e,t),u=await s.detectOverflow(t,c),d=Dt(o),f=Zn(o),g=wt(o)==="y",{width:h,height:p}=i.floating;let m,v;d==="top"||d==="bottom"?(m=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m=f==="end"?"top":"bottom");const w=p-u.top-u.bottom,x=h-u.left-u.right,b=nn(p-u[m],w),C=nn(h-u[v],x),E=!t.middlewareData.shift;let T=b,D=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!f){const P=Ve(u.left,0),R=Ve(u.right,0),O=Ve(u.top,0),V=Ve(u.bottom,0);g?D=h-2*(P!==0||R!==0?P+R:Ve(u.left,u.right)):T=p-2*(O!==0||V!==0?O+V:Ve(u.top,u.bottom))}await l({...t,availableWidth:D,availableHeight:T});const S=await s.getDimensions(a.floating);return h!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function hi(){return typeof window<"u"}function Jn(e){return rf(e)?(e.nodeName||"").toLowerCase():"#document"}function Be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(rf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rf(e){return hi()?e instanceof Node||e instanceof Be(e).Node:!1}function it(e){return hi()?e instanceof Element||e instanceof Be(e).Element:!1}function Rt(e){return hi()?e instanceof HTMLElement||e instanceof Be(e).HTMLElement:!1}function of(e){return!hi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Be(e).ShadowRoot}function Vr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function wS(e){return/^(table|td|th)$/.test(Jn(e))}function gi(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const bS=/transform|translate|scale|rotate|perspective|filter/,xS=/paint|layout|strict|content/,bn=e=>!!e&&e!=="none";let Aa;function $a(e){const t=it(e)?st(e):e;return bn(t.transform)||bn(t.translate)||bn(t.scale)||bn(t.rotate)||bn(t.perspective)||!Da()&&(bn(t.backdropFilter)||bn(t.filter))||bS.test(t.willChange||"")||xS.test(t.contain||"")}function SS(e){let t=rn(e);for(;Rt(t)&&!Qn(t);){if($a(t))return t;if(gi(t))return null;t=rn(t)}return null}function Da(){return Aa==null&&(Aa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Aa}function Qn(e){return/^(html|body|#document)$/.test(Jn(e))}function st(e){return Be(e).getComputedStyle(e)}function pi(e){return it(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rn(e){if(Jn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||of(e)&&e.host||bt(e);return of(t)?t.host:t}function sf(e){const t=rn(e);return Qn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&Vr(t)?t:sf(t)}function Br(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sf(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Be(o);if(i){const a=Ra(s);return t.concat(s,s.visualViewport||[],Vr(o)?o:[],a&&n?Br(a):[])}else return t.concat(o,Br(o,[],n))}function Ra(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function af(e){const t=st(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Rt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ci(n)!==i||ci(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ma(e){return it(e)?e:e.contextElement}function er(e){const t=Ma(e);if(!Rt(t))return vt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=af(t);let s=(i?ci(n.width):n.width)/r,a=(i?ci(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ES=vt(0);function lf(e){const t=Be(e);return!Da()||!t.visualViewport?ES:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PS(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function xn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ma(e);let s=vt(1);t&&(r?it(r)&&(s=er(r)):s=er(e));const a=PS(i,n,r)?lf(i):vt(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 f=Be(i),g=r&&it(r)?Be(r):r;let h=f,p=Ra(h);for(;p&&r&&g!==h;){const m=er(p),v=p.getBoundingClientRect(),w=st(p),x=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=b,h=Be(p),p=Ra(h)}}return fi({width:u,height:d,x:l,y:c})}function mi(e,t){const n=pi(e).scrollLeft;return t?t.left+n:xn(bt(e)).left+n}function cf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function kS(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=bt(r),a=t?gi(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=vt(1);const u=vt(0),d=Rt(r);if((d||!d&&!i)&&((Jn(r)!=="body"||Vr(s))&&(l=pi(r)),d)){const g=xn(r);c=er(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=s&&!d&&!i?cf(s,l):vt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function CS(e){return Array.from(e.getClientRects())}function OS(e){const t=bt(e),n=pi(e),r=e.ownerDocument.body,o=Ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mi(e);const a=-n.scrollTop;return st(r).direction==="rtl"&&(s+=Ve(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const uf=25;function TS(e,t){const n=Be(e),r=bt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=Da();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=mi(r);if(c<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-g);h<=uf&&(i-=h)}else c<=uf&&(i+=c);return{width:i,height:s,x:a,y:l}}function AS(e,t){const n=xn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Rt(e)?er(e):vt(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 df(e,t,n){let r;if(t==="viewport")r=TS(e,n);else if(t==="document")r=OS(bt(e));else if(it(t))r=AS(t,n);else{const o=lf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fi(r)}function ff(e,t){const n=rn(e);return n===t||!it(n)||Qn(n)?!1:st(n).position==="fixed"||ff(n,t)}function $S(e,t){const n=t.get(e);if(n)return n;let r=Br(e,[],!1).filter(a=>it(a)&&Jn(a)!=="body"),o=null;const i=st(e).position==="fixed";let s=i?rn(e):e;for(;it(s)&&!Qn(s);){const a=st(s),l=$a(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Vr(s)&&!l&&ff(e,s))?r=r.filter(u=>u!==s):o=a,s=rn(s)}return t.set(e,r),r}function DS(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?gi(t)?[]:$S(t,this._c):[].concat(n),r],a=df(t,s[0],o);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<s.length;f++){const g=df(t,s[f],o);l=Ve(g.top,l),c=nn(g.right,c),u=nn(g.bottom,u),d=Ve(g.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function RS(e){const{width:t,height:n}=af(e);return{width:t,height:n}}function MS(e,t,n){const r=Rt(t),o=bt(t),i=n==="fixed",s=xn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=vt(0);function c(){l.x=mi(o)}if(r||!r&&!i)if((Jn(t)!=="body"||Vr(o))&&(a=pi(t)),r){const g=xn(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?cf(o,a):vt(0),d=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function Ia(e){return st(e).position==="static"}function hf(e,t){if(!Rt(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function gf(e,t){const n=Be(e);if(gi(e))return n;if(!Rt(e)){let o=rn(e);for(;o&&!Qn(o);){if(it(o)&&!Ia(o))return o;o=rn(o)}return n}let r=hf(e,t);for(;r&&wS(r)&&Ia(r);)r=hf(r,t);return r&&Qn(r)&&Ia(r)&&!$a(r)?n:r||SS(e)||n}const IS=async function(e){const t=this.getOffsetParent||gf,n=this.getDimensions,r=await n(e.floating);return{reference:MS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _S(e){return st(e).direction==="rtl"}const LS={convertOffsetParentRelativeRectToViewportRelativeRect:kS,getDocumentElement:bt,getClippingRect:DS,getOffsetParent:gf,getElementRects:IS,getClientRects:CS,getDimensions:RS,getScale:er,isElement:it,isRTL:_S};function pf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function NS(e,t){let n=null,r;const o=bt(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 c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=c;if(a||t(),!f||!g)return;const h=ui(d),p=ui(o.clientWidth-(u+f)),m=ui(o.clientHeight-(d+g)),v=ui(u),x={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Ve(0,nn(1,l))||1};let b=!0;function C(E){const T=E[0].intersectionRatio;if(T!==l){if(!b)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!pf(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return s(!0),i}function FS(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=Ma(e),u=o||i?[...c?Br(c):[],...t?Br(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?NS(c,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),c&&!l&&g.observe(c),t&&g.observe(t));let h,p=l?xn(e):null;l&&m();function m(){const v=xn(e);p&&!pf(p,v)&&n(),p=v,h=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(v=g)==null||v.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const VS=pS,BS=mS,zS=fS,KS=vS,US=hS,jS=dS,WS=yS,HS=(e,t,n)=>{const r=new Map,o={platform:LS,...n},i={...o.platform,_c:r};return uS(e,t,{...o,platform:i})};function mf(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function YS(e){if(!e)return mf();const{x:t,y:n,width:r,height:o}=e;return mf(t,n,r,o)}function qS(e,t){return{contextElement:Fe(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?YS(r):n.getBoundingClientRect()}}}var zr=e=>({variable:e,reference:`var(${e})`}),Mt={arrowSize:zr("--arrow-size"),arrowSizeHalf:zr("--arrow-size-half"),arrowBg:zr("--arrow-background"),transformOrigin:zr("--transform-origin"),arrowOffset:zr("--arrow-offset")},GS=e=>e==="top"||e==="bottom"?"y":"x";function XS(e,t){return{name:"transformOrigin",fn(n){const{elements:r,middlewareData:o,placement:i,rects:s,y:a}=n,l=i.split("-")[0],c=GS(l),u=o.arrow?.x||0,d=o.arrow?.y||0,f=t?.clientWidth||0,g=t?.clientHeight||0,h=u+f/2,p=d+g/2,m=Math.abs(o.shift?.y||0),v=s.reference.height/2,w=g/2,x=e.offset?.mainAxis??e.gutter,b=typeof x=="number"?x+w:x??w,C=m>b,E={top:`${h}px calc(100% + ${b}px)`,bottom:`${h}px ${-b}px`,left:`calc(100% + ${b}px) ${p}px`,right:`${-b}px ${p}px`}[l],T=`${h}px ${s.reference.y+v-a}px`,D=!!e.overlap&&c==="y"&&C;return r.floating.style.setProperty(Mt.transformOrigin.variable,D?T:E),{data:{transformOrigin:D?T:E}}}}}var ZS={name:"rects",fn({rects:e}){return{data:e}}},JS=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:o!=null?`${o}px`:"",[i]:`calc(100% + ${Mt.arrowOffset.reference})`}),{}}}};function QS(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function eE(e){return e.split("-")[0]}var tE={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function yf(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function tr(e,t){return e!=null&&Math.abs(e-t)<.5}function yi(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function nE(e,t,n){const r=e||t.createElement("div");return jS({element:r,padding:n.arrowPadding})}function rE(e,t){if(!xx(t.offset??t.gutter))return VS(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i=typeof o=="number"?o+r:o??r,{hasAlign:s}=QS(n),a=s?void 0:t.shift,l=t.offset?.crossAxis??a;return aa({crossAxis:l,mainAxis:i,alignmentAxis:t.shift})})}function oE(e){if(e.flip)return zS(()=>{const t=yi(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function iE(e){if(!(!e.slide&&!e.overlap))return BS(()=>{const t=yi(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:WS()}})}function sE(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,o;return KS(()=>{const i=yi(e.boundary);return{padding:e.overflowPadding,...i?{boundary:i}:void 0,apply({elements:s,rects:a,availableHeight:l,availableWidth:c}){const u=s.floating,d=Math.round(a.reference.width),f=Math.round(a.reference.height);c=Math.floor(c),l=Math.floor(l),tr(t,d)||(u.style.setProperty("--reference-width",`${d}px`),t=d),tr(n,f)||(u.style.setProperty("--reference-height",`${f}px`),n=f),tr(r,c)||(u.style.setProperty("--available-width",`${c}px`),r=c),tr(o,l)||(u.style.setProperty("--available-height",`${l}px`),o=l)}}})}function aE(e){if(e.hideWhenDetached)return US(()=>({strategy:"referenceHidden",boundary:yi(e.boundary)??"clippingAncestors"}))}function lE(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var cE=["transform","visibility","pointer-events","--x","--y","--z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],uE=["top","right","bottom","left"];function vf(e,t){if(!e)return yd;const n=new Map(t.map(r=>[r,e.style.getPropertyValue(r)]));return()=>{n.forEach((r,o)=>{r?e.style.setProperty(o,r):e.style.removeProperty(o)}),e.style.length===0&&e.removeAttribute("style")}}function wf(e){return e==null?null:Fe(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function dE(e,t,n={}){const r=()=>(typeof t=="function"?t():t)??null,o=()=>{const P=typeof e=="function"?e():e;return n.getAnchorElement?.()??P},i=()=>{const P=o();return!P&&!n.getAnchorRect?null:qS(P,n.getAnchorRect)},s=Object.assign({},tE,n);let a=[],l=null,c,u;function d(P){c?.(),u?.(),l=P,c=s.restoreStyles?vf(P,cE):void 0;const R=P.querySelector("[data-part=arrow]");u=s.restoreStyles?vf(R,uE):void 0,a=[rE(R,s),oE(s),iE(s),nE(R,P.ownerDocument,s),JS(R),XS({gutter:s.gutter,offset:s.offset,overlap:s.overlap},R),sE(s),aE(s),ZS]}const{placement:f,strategy:g,onComplete:h,onPositioned:p}=s;let m,v,w=!1,x,b,C=yd;const E=lE(s.listeners);function T(){if(!s.listeners)return;const P=o(),R=i(),O=r();if(!R||!O)return;(wf(P)!==wf(x)||O!==b)&&(C(),x=P,b=O,C=FS(R,O,S,E))}async function D(){T();const P=r();if(!P)return;P!==l&&(d(P),w=!1);const R=i();if(!R)return;const O=await HS(R,P,{placement:f,middleware:a,strategy:g});h?.(O);const V=At(P),K=yf(V,O.x),Y=yf(V,O.y);if(tr(m,K)||(P.style.setProperty("--x",`${K}px`),m=K),tr(v,Y)||(P.style.setProperty("--y",`${Y}px`),v=Y),s.hideWhenDetached&&(O.middlewareData.hide?.referenceHidden?(P.style.setProperty("visibility","hidden"),P.style.setProperty("pointer-events","none")):(P.style.removeProperty("visibility"),P.style.removeProperty("pointer-events"))),!w){const F=P.firstElementChild;F&&(P.style.setProperty("--z-index",pa(F).zIndex),w=!0)}}async function S(){n.updatePosition?(await n.updatePosition({updatePosition:D,floatingElement:r()}),p?.({placed:!0})):await D()}return S(),()=>{C(),u?.(),c?.(),p?.({placed:!1})}}function fE(e,t,n={}){const{defer:r,...o}=n,i=r?$e:a=>a(),s=[];return s.push(i(()=>{s.push(dE(e,t,o))})),()=>{s.forEach(a=>a?.())}}var hE={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function gE(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Mt.arrowSize.reference,height:Mt.arrowSize.reference,[Mt.arrowSizeHalf.variable]:`calc(${Mt.arrowSize.reference} / 2)`,[Mt.arrowOffset.variable]:`calc(${Mt.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?hE[t.split("-")[0]]:void 0,background:Mt.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function pE(e){const t={each(n){for(let r=0;r<e.frames?.length;r+=1){const o=e.frames[r];o&&n(o)}},addEventListener(n,r,o){return t.each(i=>{try{i.document.addEventListener(n,r,o)}catch{}}),()=>{try{t.removeEventListener(n,r,o)}catch{}}},removeEventListener(n,r,o){t.each(i=>{try{i.document.removeEventListener(n,r,o)}catch{}})}};return t}function mE(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,o)=>{try{t?.addEventListener(n,r,o)}catch{}return()=>{try{t?.removeEventListener(n,r,o)}catch{}}},removeEventListener:(n,r,o)=>{try{t?.removeEventListener(n,r,o)}catch{}}}}var bf="pointerdown.outside",xf="focus.outside";function yE(e){for(const t of e)if(Fe(t)&&Vd(t))return!0;return!1}var Sf=e=>"clientY"in e;function vE(e,t){if(!Sf(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function wE(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Ef(e,t){if(!t||!Sf(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,o=t.scrollWidth>t.clientWidth,i=o&&e.clientY>t.offsetTop+t.clientHeight,s={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(o?16:0)},a={x:e.clientX,y:e.clientY};return wE(s,a)?r||i:!1}function bE(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:s,followControlledElements:a=!0}=t;if(!e)return;const l=wn(e),c=At(e),u=pE(c),d=mE(c);function f(b,C){if(!Fe(C)||!C.isConnected||ri(e,C)||vE(e,b)||a&&f1(e,C))return!1;const E=l.querySelector(`[aria-controls="${e.id}"]`);if(E){const D=va(E);if(Ef(b,D))return!1}const T=va(e);return Ef(b,T)?!1:!n?.(C)}const g=new Set,h=Yn(e?.getRootNode());let p=!1;function m(b){p=!0;const C=()=>{p=!1};l.addEventListener("pointerup",C,{once:!0}),c.addEventListener("pointerup",C,{once:!0});function E(T){const D=s&&!Id()?$e:R=>R(),S=T??b,P=S?.composedPath?.()??[S?.target];D(()=>{const R=h?P[0]:qn(b);if(!(!e||!f(b,R))){if(o||i){const O=Ir(o,i);e.addEventListener(bf,O,{once:!0})}Pf(e,bf,{bubbles:!1,cancelable:!0,detail:{originalEvent:S,contextmenu:v1(S),focusable:yE(P),target:R}})}})}b.pointerType==="touch"?(g.forEach(T=>T()),g.add(oi(l,"click",E,{once:!0})),g.add(d.addEventListener("click",E,{once:!0})),g.add(u.addEventListener("click",E,{once:!0}))):E()}const v=new Set,w=setTimeout(()=>{v.add(oi(l,"pointerdown",m,!0)),v.add(d.addEventListener("pointerdown",m,!0)),v.add(u.addEventListener("pointerdown",m,!0))},0);function x(b){if(p)return;(s?$e:E=>E())(()=>{const E=b?.composedPath?.()??[b?.target],T=h?E[0]:qn(b);if(!(!e||!f(b,T))){if(r||i){const D=Ir(r,i);e.addEventListener(xf,D,{once:!0})}Pf(e,xf,{bubbles:!1,cancelable:!0,detail:{originalEvent:b,contextmenu:!1,focusable:Vd(T),target:T}})}})}return Id()||(v.add(oi(l,"focusin",x,!0)),v.add(d.addEventListener("focusin",x,!0)),v.add(u.addEventListener("focusin",x,!0))),()=>{clearTimeout(w),g.forEach(b=>b()),v.forEach(b=>b())}}function xE(e,t){const{defer:n}=t,r=n?$e:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(bE(i,t))})),()=>{o.forEach(i=>i?.())}}function Pf(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,n);return e.dispatchEvent(o)}function SE(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return oi(wn(e),"keydown",n,{capture:!0})}var kf="layer:request-dismiss",De={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(r=>ri(r.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>ri(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(r=>{const o=r();o&&EE(o)}),this.recentlyRemoved.add(e),ya(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(o=>De.dismiss(o.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Cf(e,t,e.node),e.styleTargets?.forEach(n=>{const r=n();if(!r||r===e.node)return;Cf(e,t,r);const{zIndex:o}=pa(e.node);r.style.setProperty("--z-index",o)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];kE(e,kf,o=>{r.requestDismiss?.(o),o.defaultPrevented||r?.dismiss()}),PE(e,kf,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Cf(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),De.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const o=De.countNestedLayersOfType(e.node,e.type);o>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${o}`)}function EE(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.style.removeProperty("--z-index"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function PE(e,t,n){const r=e.ownerDocument.defaultView||window,o=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(o)}function kE(e,t,n){e.addEventListener(t,n,{once:!0})}var _a=new WeakMap,Kr=new WeakMap;function CE(e){return De.isBelowPointerBlockingLayer(e)?"none":"auto"}function Of(e){const t=CE(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function OE(e){if(Kr.has(e))return;const t=At(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{Kr.has(e)&&Of(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),Kr.set(e,n)}function Tf(){De.layers.forEach(({node:e})=>{Of(e),OE(e)})}function TE(e){const t=Kr.get(e);t&&(t.disconnect(),Kr.delete(e)),e.style.pointerEvents=""}function AE(e,t){const n=wn(e),r=[];return De.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(_a.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const o=n.body;o&&(o.style.pointerEvents="none",o.setAttribute("data-inert",""))})),t?.forEach(o=>{const[i,s]=I1(()=>{const a=o();return Fe(a)?a:null},{timeout:1e3});i.then(a=>r.push(zd(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{De.hasPointerBlockingLayer()||(queueMicrotask(()=>{const o=n.body;if(!o)return;const i=_a.get(o);i!==void 0&&(o.style.pointerEvents=i,_a.delete(o)),o.removeAttribute("data-inert"),o.style.length===0&&o.removeAttribute("style")}),r.forEach(o=>o()))}}function $E(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){Qo("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:o,pointerBlocking:i,exclude:s,debug:a,type:l="dialog",layerStyleTargets:c}=t,u={dismiss:r,node:e,type:l,pointerBlocking:i,requestDismiss:o,styleTargets:c};De.add(u),Tf();function d(m){const v=qn(m.detail.originalEvent);De.isBelowPointerBlockingLayer(e)||De.isInBranch(v)||(t.onPointerDownOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),r?.()))}function f(m){const v=qn(m.detail.originalEvent);De.isInBranch(v)||(t.onFocusOutside?.(m),t.onInteractOutside?.(m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),r?.()))}function g(m){De.isTopMost(e)&&(t.onEscapeKeyDown?.(m),!m.defaultPrevented&&r&&(m.preventDefault(),r()))}function h(m){if(!e)return!1;const v=typeof s=="function"?s():s,w=Array.isArray(v)?v:[v],x=t.persistentElements?.map(b=>b()).filter(Fe);return x&&w.push(...x),w.some(b=>ri(b,m))||De.isInNestedLayer(e,m)}const p=[i?AE(e,t.persistentElements):void 0,SE(e,g),xE(e,{exclude:h,onFocusOutside:f,onPointerDownOutside:d,defer:t.defer})];return()=>{De.remove(e),Tf(),TE(e),p.forEach(m=>m?.())}}function DE(e,t){const{defer:n}=t,r=n?$e:i=>i(),o=[];return o.push(r(()=>{const i=ot(e)?e():e;o.push($E(i,t))})),()=>{o.forEach(i=>i?.())}}var[ZC,RE]=en({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});function La(e,t){return e-t*Math.floor(e/t)}const Af=1721426;function vi(e,t,n,r){t=Na(e,t);let o=t-1,i=-2;return n<=2?i=0:wi(t)&&(i=-1),Af-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function wi(e){return e%4===0&&(e%100!==0||e%400===0)}function Na(e,t){return e==="BC"?1-t:t}function ME(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const IE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class nr{fromJulianDay(t){let n=t,r=n-Af,o=Math.floor(r/146097),i=La(r,146097),s=Math.floor(i/36524),a=La(i,36524),l=Math.floor(a/1461),c=La(a,1461),u=Math.floor(c/365),d=o*400+s*100+l*4+u+(s!==4&&u!==4?1:0),[f,g]=ME(d),h=n-vi(f,g,1,1),p=2;n<vi(f,g,3,1)?p=0:wi(g)&&(p=1);let m=Math.floor(((h+p)*12+373)/367),v=n-vi(f,g,m,1)+1;return new Ft(f,g,m,v)}toJulianDay(t){return vi(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return IE[wi(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return wi(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const _E={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function ze(e,t){return t=we(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function LE(e,t){return t=we(t,e.calendar),e=It(e),t=It(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function NE(e,t){return t=we(t,e.calendar),e=Wr(e),t=Wr(t),e.era===t.era&&e.year===t.year}function FE(e,t){return bi(e.calendar,t.calendar)&&ze(e,t)}function Ur(e,t){return bi(e.calendar,t.calendar)&&LE(e,t)}function jr(e,t){return bi(e.calendar,t.calendar)&&NE(e,t)}function bi(e,t){var n,r,o,i;return(i=(o=(n=e.isEqual)===null||n===void 0?void 0:n.call(e,t))!==null&&o!==void 0?o:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&i!==void 0?i:e.identifier===t.identifier}function VE(e,t){return ze(e,xi(t))}const BE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function $f(e,t,n){let r=e.calendar.toJulianDay(e),o=n?BE[n]:jE(t),i=Math.ceil(r+1-o)%7;return i<0&&(i+=7),i}function Df(e){return Lt(Date.now(),e)}function xi(e){return Sn(Df(e))}function Rf(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function zE(e,t){return Mf(e)-Mf(t)}function Mf(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Fa=null,KE=!1;function Va(){return Fa==null&&(Fa=new Intl.DateTimeFormat().resolvedOptions().timeZone),Fa}function If(){return KE}function It(e){return e.subtract({days:e.day-1})}function Ba(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function Wr(e){return It(e.subtract({months:e.month-1}))}function UE(e){return Ba(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function on(e,t,n){let r=$f(e,t,n);return e.subtract({days:r})}function _f(e,t,n){return on(e,t,n).add({days:6})}const Lf=new Map,za=new Map;function Nf(e){if(Intl.Locale){let n=Lf.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&Lf.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function jE(e){let t=za.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo(),t))return za.set(e,t),t.firstDay}let n=Nf(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];r==="mon"?t={firstDay:1}:r==="tue"?t={firstDay:2}:r==="wed"?t={firstDay:3}:r==="thu"?t={firstDay:4}:r==="fri"?t={firstDay:5}:r==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&_E[n]||0};za.set(e,t)}return t.firstDay}function WE(e,t,n){let r=e.calendar.getDaysInMonth(e);return Math.ceil(($f(It(e),t,n)+r)/7)}function Ff(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function Vf(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const HE={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function YE(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1)%7;r<0&&(r+=7);let o=Nf(t),[i,s]=HE[o]||[6,0];return r===i||r===s}function rr(e){e=we(e,new nr);let t=Na(e.era,e.year);return Bf(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Bf(e,t,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(e,t-1,n),a.getTime()}function Ka(e,t){if(t==="UTC")return 0;if(e>0&&t===Va()&&!If())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=Kf(e,t);return Bf(n,r,o,i,s,a,0)-Math.floor(e/1e3)*1e3}const zf=new Map;function Kf(e,t){let n=zf.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),zf.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const Uf=864e5;function qE(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>GE(e,t,i))}function GE(e,t,n){let r=Kf(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function _t(e,t,n="compatible"){let r=Ye(e);if(t==="UTC")return rr(r);if(t===Va()&&n==="compatible"&&!If()){r=we(r,new nr);let l=new Date,c=Na(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=rr(r),i=Ka(o-Uf,t),s=Ka(o+Uf,t),a=qE(r,t,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function jf(e,t,n="compatible"){return new Date(_t(e,t,n))}function Lt(e,t){let n=Ka(e,t),r=new Date(e+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Yr(o<1?"BC":"AD",o<1?-o+1:o,i,s,t,n,a,l,c,u)}function Sn(e){return new Ft(e.calendar,e.era,e.year,e.month,e.day)}function Ye(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new ki(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function we(e,t){if(bi(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,En(r),r}function Wf(e,t,n){if(e instanceof Yr)return e.timeZone===t?e:ZE(e,t);let r=_t(e,t,n);return Lt(r,t)}function XE(e){let t=rr(e)-e.offset;return new Date(t)}function ZE(e,t){let n=rr(e)-e.offset;return we(Lt(n,t),e.calendar)}const Hr=36e5;function Si(e,t){let n=e.copy(),r="hour"in n?tP(n,t):0;Ua(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,ja(n),Hf(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,JE(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let l=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Ua(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function ja(e){for(;e.month<1;)Ua(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Ua(e,1)}function JE(e){for(;e.day<1;)e.month--,ja(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,ja(e)}function Hf(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function En(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Hf(e)}function Yf(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function qf(e,t){return Si(e,Yf(t))}function Wa(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),En(n),n}function Ei(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),eP(n),n}function QE(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Pi(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Pi(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Pi(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Pi(e.hour,24),t}function eP(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Pi(e,t){let n=e%t;return n<0&&(n+=t),n}function tP(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,QE(e)}function Ha(e,t,n,r){let o=e.copy();switch(t){case"era":{let a=e.calendar.getEras(),l=a.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Nt(l,n,0,a.length-1,r?.round),o.era=a[l],En(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=Nt(e.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=Nt(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case"day":o.day=Nt(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),En(o),o}function Gf(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,s=0,a=23;if(r?.hourCycle===12){let l=i>=12;s=l?12:0,a=l?23:11}o.hour=Nt(i,n,s,a,r?.round);break}case"minute":o.minute=Nt(e.minute,n,0,59,r?.round);break;case"second":o.second=Nt(e.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=Nt(e.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+t)}return o}function Nt(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function Xf(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let o=Si(Ye(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=_t(o,e.timeZone)}else n=rr(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=Lt(n,e.timeZone);return we(r,e.calendar)}function nP(e,t){return Xf(e,Yf(t))}function rP(e,t,n,r){switch(t){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let h=e.hour>=12;o=h?12:0,i=h?23:11}let s=Ye(e),a=we(Ei(s,{hour:o}),new nr),l=[_t(a,e.timeZone,"earlier"),_t(a,e.timeZone,"later")].filter(h=>Lt(h,e.timeZone).day===a.day)[0],c=we(Ei(s,{hour:i}),new nr),u=[_t(c,e.timeZone,"earlier"),_t(c,e.timeZone,"later")].filter(h=>Lt(h,e.timeZone).day===c.day).pop(),d=rr(e)-e.offset,f=Math.floor(d/Hr),g=d%Hr;return d=Nt(f,n,Math.floor(l/Hr),Math.floor(u/Hr),r?.round)*Hr+g,we(Lt(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Gf(e,t,n,r);case"era":case"year":case"month":case"day":{let o=Ha(Ye(e),t,n,r),i=_t(o,e.timeZone);return we(Lt(i,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function oP(e,t,n){let r=Ye(e),o=Ei(Wa(r,t),t);if(o.compare(r)===0)return e;let i=_t(o,e.timeZone,n);return we(Lt(i,e.timeZone),e.calendar)}function iP(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Zf(e){let t=we(e,new nr),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Jf(e){return`${Zf(e)}T${iP(e)}`}function sP(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),o=Math.floor(e%36e5%6e4/1e3),i=`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return o!==0&&(i+=`:${String(o).padStart(2,"0")}`),i}function aP(e){return`${Jf(e)}${sP(e.offset)}[${e.timeZone}]`}function Ya(e){let t=typeof e[0]=="object"?e.shift():new nr,n;if(typeof e[0]=="string")n=e.shift();else{let s=t.getEras();n=s[s.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var lP=new WeakMap;class Ft{copy(){return this.era?new Ft(this.calendar,this.era,this.year,this.month,this.day):new Ft(this.calendar,this.year,this.month,this.day)}add(t){return Si(this,t)}subtract(t){return qf(this,t)}set(t){return Wa(this,t)}cycle(t,n,r){return Ha(this,t,n,r)}toDate(t){return jf(this,t)}toString(){return Zf(this)}compare(t){return Rf(this,t)}constructor(...t){ms(this,lP,{writable:!0,value:void 0});let[n,r,o,i,s]=Ya(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,En(this)}}var cP=new WeakMap;class ki{copy(){return this.era?new ki(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new ki(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Si(this,t)}subtract(t){return qf(this,t)}set(t){return Wa(Ei(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return Ha(this,t,n,r);default:return Gf(this,t,n,r)}}toDate(t,n){return jf(this,t,n)}toString(){return Jf(this)}compare(t){let n=Rf(this,t);return n===0?zE(this,Ye(t)):n}constructor(...t){ms(this,cP,{writable:!0,value:void 0});let[n,r,o,i,s]=Ya(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,En(this)}}var uP=new WeakMap;class Yr{copy(){return this.era?new Yr(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Yr(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Xf(this,t)}subtract(t){return nP(this,t)}set(t,n){return oP(this,t,n)}cycle(t,n,r){return rP(this,t,n,r)}toDate(){return XE(this)}toString(){return aP(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Wf(t,this.timeZone).toDate().getTime()}constructor(...t){ms(this,uP,{writable:!0,value:void 0});let[n,r,o,i,s]=Ya(t),a=t.shift(),l=t.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,En(this)}}let qa=new Map;class qe{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return hP()&&(this.resolvedHourCycle||(this.resolvedHourCycle=gP(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=Qf(t,n),this.options=n}}const dP={true:{ja:"h11"},false:{}};function Qf(e,t={}){if(typeof t.hour12=="boolean"&&fP()){t={...t};let o=dP[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o??i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(qa.has(n))return qa.get(n);let r=new Intl.DateTimeFormat(e,t);return qa.set(n,r),r}let Ga=null;function fP(){return Ga==null&&(Ga=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Ga}let Xa=null;function hP(){return Xa==null&&(Xa=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Xa}function gP(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Qf(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}var[JC,pP]=en({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),mP=Object.defineProperty,yP=(e,t)=>{for(var n in t)mP(e,n,{get:t[n],enumerable:!0})},Ci="__live-region__",Za="__live-region-debug__",vP="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;";function wP(e={}){const{level:t="polite",document:n=document,root:r,delay:o=0,debug:i=!1}=e,s=n.defaultView??window,a=r??n.body;function l(){if(!i)return;let d=n.getElementById(Za);return d||(d=n.createElement("div"),d.id=Za,d.dataset.liveAnnouncerDebug="true",d.setAttribute("aria-hidden","true"),d.style.cssText=vP,a.appendChild(d),d)}function c(d,f){n.getElementById(Ci)?.remove(),f=f??o;const h=n.createElement("span");h.id=Ci,h.dataset.liveAnnouncer="true";const p=t!=="assertive"?"status":"alert";h.setAttribute("aria-live",t),h.setAttribute("role",p),Object.assign(h.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}),a.appendChild(h),s.setTimeout(()=>{if(!h.isConnected)return;h.textContent=d;const m=l();m&&(m.textContent=d)},f)}function u(){n.getElementById(Ci)?.remove(),n.getElementById(Za)?.remove()}return{announce:c,destroy:u,toJSON(){return Ci}}}function bP(e,t,n,r,o){const i={};for(let a in t){const l=a,c=t[l];c!=null&&(i[l]=Math.floor(c/2),i[l]>0&&c%2===0&&i[l]--)}const s=Pn(e,t,n).subtract(i);return qr(e,s,t,n,r,o)}function Pn(e,t,n,r,o){let i=e;return t.years?i=Wr(e):t.months?i=It(e):t.weeks&&(i=on(e,n)),qr(e,i,t,n,r,o)}function Ja(e,t,n,r,o){let i={...t};i.days?i.days--:i.weeks?i.weeks--:i.months?i.months--:i.years&&i.years--;let s=Pn(e,t,n).subtract(i);return qr(e,s,t,n,r,o)}function qr(e,t,n,r,o,i){return o&&e.compare(o)>=0&&(t=Vf(t,Pn(Sn(o),n,r))),i&&e.compare(i)<=0&&(t=Ff(t,Ja(Sn(i),n,r))),t}function Ge(e,t,n){const r=Sn(e),o=t?Sn(t):void 0,i=n?Sn(n):void 0;let s=r;return o&&(s=Vf(s,o)),i&&(s=Ff(s,i)),s.compare(r)===0?e:"hour"in e?e.set({year:s.year,month:s.month,day:s.day}):s}function eh(e,t,n,r,o,i){switch(t){case"start":return Pn(e,n,r,o,i);case"end":return Ja(e,n,r,o,i);case"center":default:return bP(e,n,r,o,i)}}function sn(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?ze(e,t):Ye(e).compare(Ye(t))===0}function th(e,t,n,r,o){return e?t?.(e,n)?!0:xt(e,r,o):!1}function xt(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function xP(e,t,n){const r=e.subtract({days:1});return ze(r,e)||xt(r,t,n)}function SP(e,t,n){const r=e.add({days:1});return ze(r,e)||xt(r,t,n)}function Qa(e){let t={...e};for(let n in t)t[n]=1;return t}function nh(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function rh(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function oh(e,t,n){const r=n??Ye(xi(t));return new qe(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:rh(r),calendar:r.calendar.identifier,timeZone:t})}function ih(e,t,n){const r=n??xi(t);return new qe(e,{month:"long",year:"numeric",era:rh(r),calendar:r.calendar.identifier,timeZone:t})}function EP(e,t,n,r,o){let i=n.formatRangeToParts(e.toDate(o),t.toDate(o)),s=-1;for(let c=0;c<i.length;c++){let u=i[c];if(u.source==="shared"&&u.type==="literal")s=c;else if(u.source==="endRange")break}let a="",l="";for(let c=0;c<i.length;c++)c<s?a+=i[c].value:c>s&&(l+=i[c].value);return r(a,l)}function Oi(e,t,n,r){if(!e)return"";let o=e,i=t??e,s=oh(n,r);return ze(o,i)?s.format(o.toDate(r)):EP(o,i,s,(a,l)=>`${a} – ${l}`,r)}var PP=["sun","mon","tue","wed","thu","fri","sat"];function sh(e){return e!=null?PP[e]:void 0}function ah(e,t,n){const r=sh(n);return on(e,t,r)}function lh(e,t,n,r){const o=t.add({weeks:e}),i=[];let s=ah(o,n,r);for(;i.length<7;){i.push(s);let a=s.add({days:1});if(ze(s,a))break;s=a}return i}function kP(e,t,n,r){const o=sh(r),i=n??WE(e,t,o);return[...new Array(i).keys()].map(a=>lh(a,e,t,r))}function CP(e,t){const n=new qe(e,{weekday:"long",timeZone:t}),r=new qe(e,{weekday:"short",timeZone:t}),o=new qe(e,{weekday:"narrow",timeZone:t});return i=>{const s=i instanceof Date?i:i.toDate(t);return{value:i,short:r.format(s),long:n.format(s),narrow:o.format(s)}}}function OP(e,t,n,r){const o=ah(e,r,t),i=[...new Array(7).keys()],s=CP(r,n);return i.map(a=>s(o.add({days:a})))}function TP(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const s=new Date(2021,0,1),a=[];for(let l=0;l<12;l++)a.push(s.toLocaleString(e,{month:t})),s.setMonth(s.getMonth()+1);return a}const r=n.calendar.getMonthsInYear(n),o=new qe(e,{month:t,calendar:n.calendar.identifier}),i=[];for(let s=1;s<=r;s++){const a=n.set({month:s});i.push(o.format(a.toDate("UTC")))}return i}function ch(e,t){const n=on(e,t,"mon"),r=n.year,o=n.set({month:1,day:4}),i=on(o,t,"mon"),s=n.calendar.toJulianDay(n),a=i.calendar.toJulianDay(i);if(s>=a)return 1+Math.floor((s-a)/7);const l=n.set({year:r-1,month:1,day:4}),c=on(l,t,"mon"),u=c.calendar.toJulianDay(c);return 1+Math.floor((s-u)/7)}function AP(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var $P=1900,DP=2099;function RP(e,t,n){const r=e.calendar,o=t?.year??we(new Ft($P,1,1),r).year,i=n?.year??we(new Ft(DP,12,31),r).year;return{from:o,to:i}}var MP=10;function IP(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,r=parseInt(e.slice(-2),10),o=n+r;return o>t+MP?(o-100).toString():o.toString()}return e}}function or(e,t){const n=t?.strict?10:12,r=e-e%10,o=[];for(let i=0;i<n;i+=1){const s=r+i;o.push(s)}return o}function Gr(e,t){const n=xi(e??Va());return t?we(n,t):n}function Xr(e,t,n,r){return function(i){const{startDate:s,focusedDate:a}=i,l=nh(s,e);return xt(a,n,r)?{startDate:s,focusedDate:Ge(a,n,r),endDate:l}:a.compare(s)<0?{startDate:Ja(a,e,t,n,r),focusedDate:Ge(a,n,r),endDate:l}:a.compare(l)>0?{startDate:Pn(a,e,t,n,r),endDate:l,focusedDate:Ge(a,n,r)}:{startDate:s,endDate:l,focusedDate:Ge(a,n,r)}}}function uh(e,t,n,r,o,i){const s=Xr(n,r,o,i),a=t.add(n);return s({focusedDate:e.add(n),startDate:Pn(qr(e,a,n,r,o,i),n,r)})}function dh(e,t,n,r,o,i){const s=Xr(n,r,o,i);let a=t.subtract(n);return s({focusedDate:e.subtract(n),startDate:Pn(qr(e,a,n,r,o,i),n,r)})}function _P(e,t,n,r,o,i,s){const a=Xr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.add(Qa(r)),startDate:t});if(r.days)return uh(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.add({years:1}),startDate:t})}function LP(e,t,n,r,o,i,s){const a=Xr(r,o,i,s);if(!n&&!r.days)return a({focusedDate:e.subtract(Qa(r)),startDate:t});if(r.days)return dh(e,t,r,o,i,s);if(r.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(r.months||r.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var fh=(e,t)=>e?/\d/.test(e)||t.includes(e)||e.length!==1:!0,NP=(e,t)=>e.split("").filter(n=>fh(n,t)).join(""),hh=new Map;function FP(e){let t=hh.get(e);if(t!=null)return t;const r=new Intl.DateTimeFormat(e).formatToParts(new Date).find(o=>o.type==="literal");return t=r?r.value:"/",hh.set(e,t),t}var gh=e=>e!=null&&e.length===4,VP=e=>e!=null&&parseFloat(e)<=12,BP=e=>e!=null&&parseFloat(e)<=31;function zP(e,t,n){const r=KP(t,n);let{year:o,month:i,day:s}=UP(r,e)??{};if(o!=null||i!=null||s!=null){const c=new Date;o||(o=c.getFullYear().toString()),i||(i=(c.getMonth()+1).toString()),s||(s=c.getDate().toString())}if(gh(o)||(o=IP(o)),gh(o)&&VP(i)&&BP(s))return new Ft(+o,+i,+s);const l=Date.parse(e);if(!isNaN(l)){const c=new Date(l);return new Ft(c.getFullYear(),c.getMonth()+1,c.getDate())}}function KP(e,t){return new qe(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:o,value:i})=>o==="literal"?`${i}?`:`((?!=<${o}>)\\d+)?`).join("")}function UP(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(r=>{const o=r.match(/<(.+)>/);return!o||o.length<=0?null:r.match(/<(.+)>/)?.[1]}).reduce((r,o,i)=>(o&&(n&&n.length>i?r[o]=n[i+1]:r[o]=null),r),{})}function ph(e,t,n){const r=Sn(Df(n));switch(e){case"thisWeek":return[on(r,t),_f(r,t)];case"thisMonth":return[It(r),r];case"thisQuarter":return[It(r).add({months:-((r.month-1)%3)}),r];case"thisYear":return[Wr(r),r];case"last3Days":return[r.add({days:-2}),r];case"last7Days":return[r.add({days:-6}),r];case"last14Days":return[r.add({days:-13}),r];case"last30Days":return[r.add({days:-29}),r];case"last90Days":return[r.add({days:-89}),r];case"lastMonth":return[It(r.add({months:-1})),Ba(r.add({months:-1}))];case"lastQuarter":return[It(r.add({months:-((r.month-1)%3)-3})),Ba(r.add({months:-((r.month-1)%3)-1}))];case"lastWeek":return[on(r,t).add({weeks:-1}),_f(r,t).add({weeks:-1})];case"lastYear":return[Wr(r.add({years:-1})),UE(r.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var mh=Fr("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),oe=mh.build(),jP=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,WP=e=>e.ids?.root??`datepicker:${e.id}`,HP=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,el=e=>e.ids?.content??`datepicker:${e.id}:content`,tl=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,YP=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,qP=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,GP=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,yh=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,vh=e=>e.ids?.control??`datepicker:${e.id}:control`,wh=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,bh=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,xh=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,Sh=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,Eh=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,Ph=(e,t)=>D1(Ai(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Ti=e=>e.getById(bh(e)),Ai=e=>e.getById(el(e)),Zr=e=>$1(Ch(e),"[data-part=input]"),XP=e=>e.getById(Eh(e)),ZP=e=>e.getById(Sh(e)),JP=e=>e.getById(yh(e)),kh=e=>e.getById(xh(e)),Ch=e=>e.getById(vh(e));function nl(e){const[t,n]=e;let r;return!t||!n?r=e:r=t.compare(n)<=0?e:[n,t],r}function ir(e,t){const[n,r]=t;return!n||!r?!1:n.compare(e)<=0&&r.compare(e)>=0}function $i(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function QP(e){return _r(e,{year:"calendar decade",month:"calendar year",day:"calendar month"})}var ek={day:"dd",month:"mm",year:"yyyy"};function tk(e){return new qe(e).formatToParts(new Date).map(t=>ek[t.type]??t.value).join("")}var Oh=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),nk={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e){return _r(e,{year:"Switch to month view",month:"Switch to day view",day:"Switch to year view"})},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return _r(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return _r(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function Vt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function rl(e){return e===0?"day":e===1?"month":"year"}function ol(e,t,n){return rl(Dx(Vt(e,0),Vt(t,0),Vt(n,2)))}function rk(e,t){return Vt(e,0)>Vt(t,0)}function ok(e,t){return Vt(e,0)<Vt(t,0)}function ik(e,t,n){const r=Vt(e,0)+1;return ol(rl(r),t,n)}function sk(e,t,n){const r=Vt(e,0)-1;return ol(rl(r),t,n)}var ak=["day","month","year"];function lk(e){ak.forEach(t=>e(t))}var ck=Bx(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale],([e],t)=>{const{startValue:n,endValue:r,locale:o,timeZone:i,selectionMode:s}=t;if(e==="year"){const d=or(n.year,{strict:!0}),f=d.at(0).toString(),g=d.at(-1).toString();return{start:f,end:g,formatted:`${f} - ${g}`}}if(e==="month"){const d=new qe(o,{year:"numeric",timeZone:i,calendar:n.calendar.identifier}),f=d.format(n.toDate(i)),g=d.format(r.toDate(i)),h=s==="range"?`${f} - ${g}`:f;return{start:f,end:g,formatted:h}}const a=new qe(o,{month:"long",year:"numeric",timeZone:i,calendar:n.calendar.identifier}),l=a.format(n.toDate(i)),c=a.format(r.toDate(i)),u=s==="range"?`${l} - ${c}`:l;return{start:l,end:c,formatted:u}});function uk(e,t){const{state:n,context:r,prop:o,send:i,computed:s,scope:a}=e,l=r.get("startValue"),c=s("endValue"),u=r.get("value"),d=r.get("focusedValue"),f=r.get("hoveredValue"),g=f?nl([u[0],f]):[],h=!!o("disabled"),p=!!o("readOnly"),m=!!o("invalid"),v=s("isInteractive"),w=u.length===0,x=o("min"),b=o("max"),C=o("locale"),E=o("timeZone"),T=o("startOfWeek"),D=n.matches("focused"),S=n.matches("open"),P=o("selectionMode")==="range",R=o("selectionMode")==="multiple",O=o("isDateUnavailable"),V=o("maxSelectedDates"),K=R&&V!=null&&u.length>=V,Y=r.get("currentPlacement"),F=Y?eE(Y):void 0,W=gE({...o("positioning"),placement:Y}),Z=FP(C),X={...nk,...o("translations")};function Xe($=l){const k=o("fixedWeeks")?6:void 0;return kP($,C,k,T)}function Re($={}){const{format:k}=$;return TP(C,k,d).map((A,M)=>{const ce=M+1,Ze=d.set({month:ce}),Ce=xt(Ze,x,b);return{label:A,value:ce,disabled:Ce}})}function dl(){const $=RP(d,x,b);return AP($).map(A=>({label:A.toString(),value:A,disabled:!sa(A,x?.year,b?.year)}))}function Ii($){return th($,O,C,x,b)}function _i($){const k=l??Gr(E,d.calendar);i({type:"FOCUS.SET",value:k.set({month:$})})}function J($){const k=l??Gr(E,d.calendar);i({type:"FOCUS.SET",value:k.set({year:$})})}function zt($){const{value:k,disabled:A}=$,M=d.set({year:k}),Ze=!or(l.year,{strict:!0}).includes(k),Ce=sa(k,x?.year,b?.year),at=P&&ir(M,u),ln=P&&u[0]&&jr(M,u[0]),ar=P&&u[1]&&jr(M,u[1]),Cn=P&&g.length>0,lr=Cn&&ir(M,g),cn=Cn&&g[0]&&jr(M,g[0]),un=Cn&&g[1]&&jr(M,g[1]),Li={focused:d.year===$.value,selectable:!Ze&&Ce,outsideRange:Ze,selected:!!u.find(Ni=>Ni&&Ni.year===k),valueText:k.toString(),inRange:at||lr,firstInRange:!!ln,lastInRange:!!ar,inHoveredRange:!!lr,firstInHoveredRange:!!cn,lastInHoveredRange:!!un,value:M,get disabled(){return A||!Li.selectable}};return Li}function an($){const{value:k,disabled:A}=$,M=d.set({month:k}),ce=ih(C,E,d),Ze=P&&ir(M,u),Ce=P&&u[0]&&Ur(M,u[0]),at=P&&u[1]&&Ur(M,u[1]),ln=P&&g.length>0,ar=ln&&ir(M,g),Cn=ln&&g[0]&&Ur(M,g[0]),lr=ln&&g[1]&&Ur(M,g[1]),cn={focused:d.month===$.value,selectable:!xt(M,x,b),selected:!!u.find(un=>un&&un.month===k&&un.year===d.year),valueText:ce.format(M.toDate(E)),inRange:Ze||ar,firstInRange:!!Ce,lastInRange:!!at,inHoveredRange:!!ar,firstInHoveredRange:!!Cn,lastInHoveredRange:!!lr,outsideRange:!1,value:M,get disabled(){return A||!cn.selectable}};return cn}function fl($){const{value:k,disabled:A,visibleRange:M=s("visibleRange")}=$,ce=oh(C,E,d),Ze=Qa(s("visibleDuration")),Ce=o("outsideDaySelectable"),at=M.start.add(Ze).subtract({days:1}),ln=xt(k,M.start,at),ar=P&&ir(k,u),Cn=P&&u[0]&&ze(k,u[0]),lr=P&&u[1]&&ze(k,u[1]),cn=P&&g.length>0,un=cn&&ir(k,g),Li=cn&&g[0]&&ze(k,g[0]),Ni=cn&&g[1]&&ze(k,g[1]),Rh=u.some(Mh=>Mh!=null&&ze(k,Mh)),Fi={invalid:xt(k,x,b),disabled:A||!Ce&&ln||xt(k,x,b)||K&&!Rh,selected:Rh,unavailable:th(k,O,C,x,b)&&!A,outsideRange:ln,today:VE(k,E),weekend:YE(k,C),value:k,valueText:ce.format(k.toDate(E)),get focused(){return d!=null&&ze(k,d)&&(!Fi.outsideRange||Ce)},get selectable(){return!Fi.disabled&&!Fi.unavailable},inRange:ar||un,firstInRange:Cn,lastInRange:lr,inHoveredRange:un,firstInHoveredRange:Li,lastInHoveredRange:Ni};return Fi}function HC($){const{view:k="day",id:A}=$;return[k,A].filter(Boolean).join(" ")}return{focused:D,open:S,disabled:h,invalid:m,readOnly:p,inline:!!o("inline"),numOfMonths:o("numOfMonths"),showWeekNumbers:!!o("showWeekNumbers"),selectionMode:o("selectionMode"),maxSelectedDates:V,isMaxSelected:K,view:r.get("view"),getRangePresetValue($){return ph($,C,E)},getWeekNumber($){const k=$[0];return k?ch(k,C):0},getDaysInWeek($,k=l){return lh($,k,C,T)},getOffset($){const k=l.add($),A=c.add($),M=ih(C,E,d);return{visibleRange:{start:k,end:A},weeks:Xe(k),visibleRangeText:{start:M.format(k.toDate(E)),end:M.format(A.toDate(E))}}},getMonthWeeks:Xe,isUnavailable:Ii,weeks:Xe(),weekDays:OP(l,T,E,C),visibleRangeText:s("visibleRangeText"),value:u,valueAsDate:u.filter($=>$!=null).map($=>$.toDate(E)),valueAsString:s("valueAsString"),focusedValue:d,focusedValueAsDate:d?.toDate(E),focusedValueAsString:o("format")(d,{locale:C,timeZone:E}),visibleRange:s("visibleRange"),selectToday(){const $=Ge(Gr(E,d.calendar),x,b);i({type:"VALUE.SET",value:[$]})},setValue($){const k=$.map(A=>Ge(A,x,b));i({type:"VALUE.SET",value:k})},setTime($,k=0){const A=Array.from(u);let M=A[k];M&&("hour"in M||(M=Ye(M)),M=M.set({hour:$.hour??("hour"in M?M.hour:0),minute:$.minute??("minute"in M?M.minute:0),second:$.second??("second"in M?M.second:0),millisecond:$.millisecond??("millisecond"in M?M.millisecond:0)}),A[k]=Ge(M,x,b),i({type:"VALUE.SET",value:A}))},clearValue($={}){const{focus:k=!0}=$;i({type:"VALUE.CLEAR",focus:k})},setFocusedValue($){i({type:"FOCUS.SET",value:$})},setOpen($){o("inline")||n.matches("open")===$||i({type:$?"OPEN":"CLOSE"})},focusMonth:_i,focusYear:J,getYears:dl,getMonths:Re,getYearsGrid($={}){const{columns:k=1}=$,A=or(l.year,{strict:!0}).map(M=>({label:M.toString(),value:M,disabled:!sa(M,x?.year,b?.year)}));return fd(A,k)},getDecade(){const $=or(l.year,{strict:!0});return{start:$.at(0),end:$.at(-1)}},getMonthsGrid($={}){const{columns:k=1,format:A}=$;return fd(Re({format:A}),k)},format($,k={month:"long",year:"numeric"}){return new qe(C,{...k,calendar:$.calendar.identifier}).format($.toDate(E))},setView($){i({type:"VIEW.SET",view:$})},goToNext(){i({type:"GOTO.NEXT",view:r.get("view")})},goToPrev(){i({type:"GOTO.PREV",view:r.get("view")})},getRootProps(){return t.element({...oe.root.attrs,dir:o("dir"),id:WP(a),"data-state":S?"open":"closed","data-disabled":j(h),"data-readonly":j(p),"data-empty":j(w)})},getLabelProps($={}){const{index:k=0}=$;return t.label({...oe.label.attrs,id:jP(a,k),dir:o("dir"),htmlFor:wh(a,k),"data-state":S?"open":"closed","data-index":k,"data-disabled":j(h),"data-readonly":j(p)})},getControlProps(){return t.element({...oe.control.attrs,dir:o("dir"),id:vh(a),"data-disabled":j(h),"data-placeholder-shown":j(w)})},getRangeTextProps(){return t.element({...oe.rangeText.attrs,dir:o("dir")})},getContentProps(){return t.element({...oe.content.attrs,hidden:!S,dir:o("dir"),"data-state":S?"open":"closed","data-placement":Y,"data-side":F,"data-inline":j(o("inline")),id:el(a),tabIndex:-1,role:"application","aria-roledescription":"datepicker","aria-label":X.content})},getTableProps($={}){const{view:k="day",columns:A=k==="day"?7:4}=$,M=HC($);return t.element({...oe.table.attrs,role:"grid","data-columns":A,"aria-roledescription":QP(k),id:HP(a,M),"aria-readonly":Pe(p),"aria-disabled":Pe(h),"aria-multiselectable":Pe(o("selectionMode")!=="single"),"data-view":k,dir:o("dir"),tabIndex:-1,onKeyDown(ce){if(ce.defaultPrevented)return;const Ce={Enter(){k==="day"&&Ii(d)||k==="month"&&!an({value:d.month}).selectable||k==="year"&&!zt({value:d.year}).selectable||i({type:"TABLE.ENTER",view:k,columns:A,focus:!0})},ArrowLeft(){i({type:"TABLE.ARROW_LEFT",view:k,columns:A,focus:!0})},ArrowRight(){i({type:"TABLE.ARROW_RIGHT",view:k,columns:A,focus:!0})},ArrowUp(){i({type:"TABLE.ARROW_UP",view:k,columns:A,focus:!0})},ArrowDown(){i({type:"TABLE.ARROW_DOWN",view:k,columns:A,focus:!0})},PageUp(at){i({type:"TABLE.PAGE_UP",larger:at.shiftKey,view:k,columns:A,focus:!0})},PageDown(at){i({type:"TABLE.PAGE_DOWN",larger:at.shiftKey,view:k,columns:A,focus:!0})},Home(){i({type:"TABLE.HOME",view:k,columns:A,focus:!0})},End(){i({type:"TABLE.END",view:k,columns:A,focus:!0})}}[b1(ce,{dir:o("dir")})];Ce&&(Ce(ce),ce.preventDefault(),ce.stopPropagation())},onPointerLeave(){i({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){i({type:"TABLE.POINTER_DOWN",view:k})},onPointerUp(){i({type:"TABLE.POINTER_UP",view:k})}})},getTableHeadProps($={}){const{view:k="day"}=$;return t.element({...oe.tableHead.attrs,"aria-hidden":!0,dir:o("dir"),"data-view":k,"data-disabled":j(h)})},getTableHeaderProps($={}){const{view:k="day"}=$;return t.element({...oe.tableHeader.attrs,dir:o("dir"),"data-view":k,"data-disabled":j(h)})},getTableBodyProps($={}){const{view:k="day"}=$;return t.element({...oe.tableBody.attrs,"data-view":k,"data-disabled":j(h)})},getTableRowProps($={}){const{view:k="day"}=$;return t.element({...oe.tableRow.attrs,"aria-disabled":Pe(h),"data-disabled":j(h),"data-view":k})},getWeekNumberHeaderCellProps($={}){const{view:k="day"}=$;return t.element({...oe.tableCell.attrs,scope:"col","aria-label":X.weekColumnHeader,"data-view":k,"data-type":"week-number","data-disabled":j(h)})},getWeekNumberCellProps($){const{weekIndex:k,week:A}=$,M=A[0]?ch(A[0],C):0;return t.element({...oe.tableCell.attrs,role:"rowheader","aria-label":X.weekNumberCell?.(M),"data-view":"day","data-week-index":k,"data-type":"week-number","data-disabled":j(h)})},getDayTableCellState:fl,getDayTableCellProps($){const{value:k}=$,A=fl($);return t.element({...oe.tableCell.attrs,role:"gridcell","aria-disabled":Pe(!A.selectable),"aria-selected":A.selected||A.inRange,"aria-invalid":Pe(A.invalid),"aria-current":A.today?"date":void 0,"data-value":k.toString()})},getDayTableCellTriggerProps($){const{value:k}=$,A=fl($);return t.element({...oe.tableCellTrigger.attrs,id:tl(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":X.dayCell(A),"aria-disabled":Pe(!A.selectable),"aria-invalid":Pe(A.invalid),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k.toString(),"data-view":"day","data-today":j(A.today),"data-focus":j(A.focused),"data-unavailable":j(A.unavailable),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-outside-range":j(A.outsideRange),"data-weekend":j(A.weekend),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"day",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const ce=!a.isActiveElement(M.currentTarget);f&&FE(k,f)||i({type:"CELL.POINTER_MOVE",cell:"day",value:k,focus:ce,outsideRange:A.outsideRange})}:void 0})},getMonthTableCellState:an,getMonthTableCellProps($){const{value:k,columns:A}=$,M=an($);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:A,role:"gridcell","aria-selected":Pe(M.selected||M.inRange),"data-selected":j(M.selected),"aria-disabled":Pe(!M.selectable),"data-value":k})},getMonthTableCellTriggerProps($){const{value:k}=$,A=an($);return t.element({...oe.tableCellTrigger.attrs,id:tl(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":A.valueText,"aria-disabled":Pe(!A.selectable),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k,"data-view":"month","data-focus":j(A.focused),"data-outside-range":j(A.outsideRange),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"month",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const ce=!a.isActiveElement(M.currentTarget);f&&A.value&&Ur(A.value,f)||i({type:"CELL.POINTER_MOVE",cell:"month",value:A.value,focus:ce})}:void 0})},getYearTableCellState:zt,getYearTableCellProps($){const{value:k,columns:A}=$,M=zt($);return t.element({...oe.tableCell.attrs,dir:o("dir"),colSpan:A,role:"gridcell","aria-selected":Pe(M.selected||M.inRange),"data-selected":j(M.selected),"aria-disabled":Pe(!M.selectable),"data-value":k})},getYearTableCellTriggerProps($){const{value:k}=$,A=zt($);return t.element({...oe.tableCellTrigger.attrs,id:tl(a,k.toString()),role:"button",dir:o("dir"),tabIndex:A.focused?0:-1,"aria-label":A.valueText,"aria-disabled":Pe(!A.selectable),"data-disabled":j(!A.selectable),"data-selectable":j(A.selectable),"data-selected":j(A.selected),"data-value":k,"data-view":"year","data-focus":j(A.focused),"data-outside-range":j(A.outsideRange),"data-range-start":j(A.firstInRange),"data-range-end":j(A.lastInRange),"data-in-range":j(A.inRange),"data-in-hover-range":j(A.inHoveredRange),"data-hover-range-start":j(A.firstInHoveredRange),"data-hover-range-end":j(A.lastInHoveredRange),onClick(M){M.defaultPrevented||A.selectable&&i({type:"CELL.CLICK",cell:"year",value:k})},onPointerMove:P?M=>{if(M.pointerType==="touch"||!A.selectable)return;const ce=!a.isActiveElement(M.currentTarget);f&&A.value&&jr(A.value,f)||i({type:"CELL.POINTER_MOVE",cell:"year",value:A.value,focus:ce})}:void 0})},getNextTriggerProps($={}){const{view:k="day"}=$,A=h||!s("isNextVisibleRangeValid");return t.button({...oe.nextTrigger.attrs,dir:o("dir"),id:qP(a,k),type:"button","aria-label":X.nextTrigger(k),disabled:A,"data-disabled":j(A),onClick(M){M.defaultPrevented||i({type:"GOTO.NEXT",view:k})}})},getPrevTriggerProps($={}){const{view:k="day"}=$,A=h||!s("isPrevVisibleRangeValid");return t.button({...oe.prevTrigger.attrs,dir:o("dir"),id:YP(a,k),type:"button","aria-label":X.prevTrigger(k),disabled:A,"data-disabled":j(A),onClick(M){M.defaultPrevented||i({type:"GOTO.PREV",view:k})}})},getClearTriggerProps(){return t.button({...oe.clearTrigger.attrs,id:yh(a),dir:o("dir"),type:"button","aria-label":X.clearTrigger,hidden:!u.length,onClick($){$.defaultPrevented||i({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...oe.trigger.attrs,id:bh(a),dir:o("dir"),type:"button","data-placement":Y,"data-side":F,"aria-label":X.trigger(S),"aria-controls":el(a),"aria-expanded":S,"data-state":S?"open":"closed","data-placeholder-shown":j(w),"aria-haspopup":"grid",disabled:h,onClick($){$.defaultPrevented||v&&i({type:"TRIGGER.CLICK"})}})},getViewProps($={}){const{view:k="day"}=$;return t.element({...oe.view.attrs,"data-view":k,hidden:r.get("view")!==k})},getViewTriggerProps($={}){const{view:k="day"}=$;return t.button({...oe.viewTrigger.attrs,"data-view":k,dir:o("dir"),id:GP(a,k),type:"button",disabled:h,"aria-label":X.viewTrigger(k),onClick(A){A.defaultPrevented||v&&i({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps($={}){const{view:k="day"}=$;return t.element({...oe.viewControl.attrs,"data-view":k,dir:o("dir")})},getInputProps($={}){const{index:k=0,fixOnBlur:A=!0}=$;return t.input({...oe.input.attrs,id:wh(a,k),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:o("dir"),name:o("name"),"data-index":k,"data-state":S?"open":"closed","data-placeholder-shown":j(w),readOnly:p,disabled:h,required:o("required"),"aria-invalid":Pe(m),"data-invalid":j(m),placeholder:o("placeholder")||tk(C),defaultValue:s("valueAsString")[k],onBeforeInput(M){const{data:ce}=Fd(M);fh(ce,Z)||M.preventDefault()},onClick(M){M.defaultPrevented||o("openOnClick")&&v&&i({type:"OPEN",src:"input.click"})},onFocus(){i({type:"INPUT.FOCUS",index:k})},onBlur(M){const ce=M.currentTarget.value.trim();i({type:"INPUT.BLUR",value:ce,index:k,fixOnBlur:A})},onKeyDown(M){if(M.defaultPrevented||!v)return;const Ze={Enter(Ce){y1(Ce)||Ii(d)||Ce.currentTarget.value.trim()!==""&&i({type:"INPUT.ENTER",value:Ce.currentTarget.value,index:k})}}[M.key];Ze&&(Ze(M),M.preventDefault())},onInput(M){const ce=M.currentTarget.value;i({type:"INPUT.CHANGE",value:NP(ce,Z),index:k})}})},getMonthSelectProps(){return t.select({...oe.monthSelect.attrs,id:Sh(a),"aria-label":X.monthSelect,disabled:h,dir:o("dir"),defaultValue:l.month,onChange($){_i(Number($.currentTarget.value))}})},getYearSelectProps(){return t.select({...oe.yearSelect.attrs,id:Eh(a),disabled:h,"aria-label":X.yearSelect,dir:o("dir"),defaultValue:l.year,onChange($){J(Number($.currentTarget.value))}})},getPositionerProps(){return t.element({id:xh(a),...oe.positioner.attrs,dir:o("dir"),style:W.floating})},getPresetTriggerProps($){const k=Array.isArray($.value)?$.value:ph($.value,C,E),A=k.filter(M=>M!=null).map(M=>M.toDate(E).toDateString());return t.button({...oe.presetTrigger.attrs,"aria-label":X.presetTrigger(A),type:"button",onClick(M){M.defaultPrevented||i({type:"PRESET.CLICK",value:k})}})}}}var{and:ke}=Xx();function dk(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if(!sn(e[r],t[r]))return!1;return!0}function Di(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var fk=Td({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",r=e.selectionMode||"single",o=e.numOfMonths||1;let i;if(e.createCalendar){const h=new Intl.DateTimeFormat(t).resolvedOptions().calendar;h!=="gregory"&&h!=="iso8601"&&(i=e.createCalendar(h))}const s=g=>!i||g.calendar.identifier===i.identifier?g:we(g,i),a=e.defaultValue?$i(e.defaultValue).map(g=>Ge(s(g),e.min,e.max)):void 0,l=e.value?$i(e.value).map(g=>Ge(s(g),e.min,e.max)):void 0;let c=e.focusedValue||e.defaultFocusedValue||l?.[0]||a?.[0]||Gr(n,i);c=Ge(s(c),e.min,e.max);const u="day",d="year",f=ol(e.view||u,u,d);return{locale:t,numOfMonths:o,timeZone:n,selectionMode:r,defaultView:f,minView:u,maxView:d,outsideDaySelectable:!1,closeOnSelect:!0,format(g,{locale:h,timeZone:p}){return new qe(h,{timeZone:p,day:"2-digit",month:"2-digit",year:"numeric",calendar:i?.identifier}).format(g.toDate(p))},parse(g,{locale:h,timeZone:p}){return zP(g,h,p)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:c,defaultFocusedValue:c,value:l,defaultValue:a??[],positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")||e("inline")?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:sn,hash:r=>r.toString(),sync:!0,onChange(r){const o=n(),i=o.get("view"),s=o.get("value"),a=Di(s,e);e("onFocusChange")?.({value:s,valueAsString:a,view:i,focusedValue:r})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:dk,hash:r=>r.map(o=>o?.toString()??"").join(","),onChange(r){const o=n(),i=Di(r,e);e("onValueChange")?.({value:r,valueAsString:i,view:o.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:sn})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(r){e("onViewChange")?.({view:r})}})),startValue:t(()=>{const r=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:eh(r,"start",{months:e("numOfMonths")},e("locale")),isEqual:sn,hash:o=>o.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>nh(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>ck({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!xP(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!SP(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>Di(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:r,computed:o}){e([()=>t("locale")],()=>{r(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{r(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{r(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{r(["syncInputValue"])}),e([()=>n.hash("value")],()=>{r(["syncInputElement"])}),e([()=>o("valueAsString").toString()],()=>{r(["announceValueText"])}),e([()=>n.get("view")],()=>{r(["focusActiveCell"])}),e([()=>t("open")],()=>{r(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate","resetView"],on:{"CONTROLLED.CLOSE":[{guard:ke("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["focusTriggerElement"]},{guard:"shouldRestoreFocus",target:"focused",actions:["focusInputElement"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:ke("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:ke("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","focusInputElement"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:ke("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","focusTriggerElement"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:ke("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","clearDateValue","setSelectedDate","setActiveIndexToEnd"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:ke("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","focusInputElement"]},{guard:ke("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:ke("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:ke("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","focusInputElement"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","focusTriggerElement"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>rk(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:({context:e,prop:t,event:n})=>{const r=t("maxSelectedDates");if(r==null)return!0;const o=e.get("value"),i=n.value??e.get("focusedValue");return o.some(a=>sn(a,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const r=Ch(n);return fE(r,()=>kh(n),{...t("positioning"),defer:!0,onComplete(i){e.set("currentPlacement",i.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",wP({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:r}){return r("inline")?void 0:DE(()=>Ai(e),{type:"popover",defer:!0,layerStyleTargets:[()=>kh(e)],exclude:[...Zr(e),Ti(e),JP(e)],onInteractOutside(i){n.set("restoreFocus",!i.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(i){i.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable"})}})}},actions:{setNextView({context:e,prop:t}){const n=ik(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=sk(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const r=e.get("value"),o=t("locale"),i=t("timeZone");let s;if(t("selectionMode")==="range"){const[a,l]=r;a&&l?s=Oi(a,l,o,i):a?s=Oi(a,null,o,i):l?s=Oi(l,null,o,i):s=""}else s=r.map(a=>Oi(a,null,o,i)).filter(Boolean).join(",");n.get("announcer")?.announce(s,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){A1({target:Ai(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Bd({doc:e.getDoc(),target:Ai(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&fe(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){$e(()=>{Zr(e).forEach((r,o)=>{ii(r,t("valueAsString")[o]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;fe(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;fe(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;fe(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const r=t.value.map(o=>Ge(o,n("min"),n("max")));e.set("value",r)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,r=Array.from(t.get("value")),o=t.get("activeIndex"),i=r[o],s=Ri(e,n.value??t.get("focusedValue"));r[o]=il(i,s),t.set("value",nl(r))},resetSelection(e){const{context:t,event:n}=e,r=t.get("value")[0],o=Ri(e,n.value??t.get("focusedValue"));t.set("value",[il(r,o)])},toggleSelectedDate(e){const{context:t,event:n}=e,r=Ri(e,n.value??t.get("focusedValue")),o=t.get("value"),i=o.findIndex(s=>sn(s,r));if(i===-1){const s=[...o,r];t.set("value",$i(s))}else{const s=Array.from(o);s.splice(i,1),t.set("value",$i(s))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),r=e.get("activeIndex"),o=n[r],i=e.get("focusedValue").copy();n[r]=il(o,i),e.set("value",nl(n));const s=t("valueAsString");e.set("inputValue",s[r])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});fe(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});fe(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});fe(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});fe(e,n)},focusNextPage(e){const{context:t,computed:n,prop:r}=e,o=uh(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Mi(e,o)},focusPreviousPage(e){const{context:t,computed:n,prop:r}=e,o=dh(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),r("locale"),r("min"),r("max"));Mi(e,o)},focusSectionStart(e){const{context:t}=e;fe(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;fe(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=_P(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Mi(e,i)},focusPreviousSection(e){const{context:t,event:n,computed:r,prop:o}=e,i=LP(t.get("focusedValue"),t.get("startValue"),n.larger,r("visibleDuration"),o("locale"),o("min"),o("max"));i&&Mi(e,i)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});fe(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});fe(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});fe(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});fe(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,r=t.get("focusedValue").calendar;fe(e,Gr(n("timeZone"),r))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({months:n.columns});fe(e,r)},focusNextMonthColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({months:n.columns});fe(e,r)},focusPreviousYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").subtract({years:n.columns});fe(e,r)},focusNextYearColumn(e){const{context:t,event:n}=e,r=t.get("focusedValue").add({years:n.columns});fe(e,r)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMinimumMonthInYear?.(n)??1;fe(e,n.set({month:r}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),r=n.calendar.getMonthsInYear(n);fe(e,n.set({month:r}))},focusFirstYear(e){const{context:t}=e,n=or(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[0]});fe(e,r)},focusLastYear(e){const{context:t}=e,n=or(t.get("focusedValue").year),r=t.get("focusedValue").set({year:n[n.length-1]});fe(e,r)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&$e(()=>{const r=t.get("view");Ph(e,r)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&$e(()=>{const r=t.get("view");Ph(e,r)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!t.type.startsWith("TABLE.ARROW")||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},focusTriggerElement({scope:e}){$e(()=>{Ti(e)?.focus({preventScroll:!0})})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&$e(()=>{const[n]=Zr(e);(n??Ti(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){$e(()=>{const t=Zr(e);if(t.length===0){Ti(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(i=>i.value!==""),r=Math.max(n,0),o=t[r];o?.focus({preventScroll:!0}),o?.setSelectionRange(o.value.length,o.value.length)})},syncMonthSelectElement({scope:e,context:t}){const n=ZP(e);ii(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=XP(e);ii(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const r=Zr(e),o=n.index??t.get("activeIndex");ii(r[o],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!o||!Oh(o)||fe(e,o)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let o=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!o||!Oh(o))&&t.value&&(o=e.get("focusedValue").copy()),!o)return;o=Ge(o,n("min"),n("max"));const i=Array.from(e.get("value"));i[t.index]=o,e.set("value",i);const s=Di(i,n);e.set("inputValue",s[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const r=e.get("focusedValue");if(!xt(r,e.get("startValue"),t("endValue")))return;const i=eh(r,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",i)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),Ri=(e,t)=>{const{context:n,prop:r}=e,o=n.get("view");let i=typeof t=="number"?n.get("focusedValue").set({[o]:t}):t;return lk(s=>{ok(s,r("minView"))&&(i=i.set({[s]:s==="day"?1:0}))}),i},il=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let r=t;return"hour"in t||(n?r=Wf(Ye(t),e.timeZone):r=Ye(t)),r.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function fe(e,t){const{context:n,prop:r,computed:o}=e;if(!t)return;const i=Ri(e,t);if(sn(n.get("focusedValue"),i))return;const a=Xr(o("visibleDuration"),r("locale"),r("min"),r("max"))({focusedDate:i,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Mi(e,t){const{context:n}=e;n.set("startValue",t.startDate);const r=n.get("focusedValue");sn(r,t.focusedDate)||n.set("focusedValue",t.focusedDate)}var Th=mh.extendWith("view","valueText"),[Ah,ae]=en({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),hk=e=>{const t=ae(),n=te(()=>t().getClearTriggerProps(),e);return y(re.button,n)},gk=e=>{const t=ae(),n=Gd(),r=te(()=>t().getContentProps(),()=>n().presenceProps,e);return y(G,{get when(){return!n().unmounted},get children(){return y(re.div,B(r,{ref(o){var i=X1(n().ref,e.ref);typeof i=="function"&&i(o)}}))}})},pk=e=>e.children(ae()),mk=e=>{const t=ae(),n=te(()=>t().getControlProps(),e);return y(re.div,n)},yk=e=>{const[t,n]=yt()(e,["index","fixOnBlur"]),r=ae(),o=te(()=>r().getInputProps(t),n);return y(re.input,o)},vk=e=>{const t=ae(),n=te(()=>t().getLabelProps(),e);return y(re.label,n)},wk=e=>{const t=ae(),n=te(()=>t().getMonthSelectProps(),e);return y(re.select,B(n,{get children(){return y(Nl,{get each(){return t().getMonths()},children:r=>y(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},[bk,kn]=en({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),xk=e=>{const t=ae(),n=kn(),r=te(()=>t().getNextTriggerProps(n),e);return y(re.button,r)},Sk=e=>{const t=ae(),n=Gd(),r=te(()=>t().getPositionerProps(),e);return y(G,{get when(){return!n().unmounted},get children(){return y(re.div,r)}})},Ek=e=>{const[t,n]=yt()(e,["value"]),r=ae(),o=te(()=>r().getPresetTriggerProps(t),n);return y(re.button,o)},Pk=e=>{const t=ae(),n=kn(),r=te(()=>t().getPrevTriggerProps(n),e);return y(re.button,r)},kk=e=>{const t=ae(),n=te(()=>t().getRangeTextProps(),e),r=L(()=>{const{start:o,end:i}=t().visibleRangeText;return mx([o,i]).filter(Boolean).join(" - ")});return y(re.div,B(n,{get children(){return r()}}))},Ck=e=>{const t=ae(),n=()=>t().value.length>0;return y(G,{get when(){return typeof e.children=="function"},get fallback(){return y(re.span,B(()=>Th.build().valueText.attrs,e,{get children(){return Yt(()=>!!n())()?t().valueAsString.join(e.separator??", "):e.placeholder}}))},get children(){return y(G,{get when(){return n()},get fallback(){return e.placeholder},get children(){return y(Ht,{get each(){return t().value},children:(r,o)=>Yt(()=>e.children({value:r,index:o(),valueAsString:t().valueAsString[o()],remove:()=>{t().setValue(t().value.filter((i,s)=>s!==o()))}}))})}})}})},Ok=e=>{const t=Ke(),n=pP(),r=RE(),o=L(()=>({id:t,dir:n().dir,locale:n().locale,getRootNode:r().getRootNode,...bd(e)})),i=Kd(fk,o);return L(()=>uk(i,U1))},Tk=e=>{const[t,n]=Yd(e),[r,o]=yt()(n,["closeOnSelect","createCalendar","defaultFocusedValue","defaultOpen","defaultValue","defaultView","disabled","fixedWeeks","focusedValue","format","id","ids","inline","invalid","isDateUnavailable","locale","max","maxSelectedDates","maxView","min","minView","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","onVisibleRangeChange","open","openOnClick","outsideDaySelectable","parse","placeholder","positioning","readOnly","required","selectionMode","showWeekNumbers","startOfWeek","timeZone","translations","value","view"]),i=Ok(r),s=Wd(te(t,()=>({present:i().open}))),a=te(()=>i().getRootProps(),o);return y(Ah,{value:i,get children(){return y(qd,{value:s,get children(){return y(re.div,a)}})}})},Ak=e=>{const[t,n]=Yd(e),[{value:r},o]=yt()(n,["value"]),i=Wd(te(t,()=>({present:r().open}))),s=te(()=>r().getRootProps(),o);return y(Ah,{value:r,get children(){return y(qd,{value:i,get children(){return y(re.div,s)}})}})},[$k,Jr]=en({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),Dk=e=>{const[t,n]=yt()(e,["columns"]),r=ae(),o=kn(),i=Ke(),s=te(()=>({columns:t.columns,id:i}),o),a=te(()=>r().getTableProps(s),n);return y($k,{value:s,get children(){return y(re.table,a)}})},Rk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableBodyProps(n),e);return y(re.tbody,r)},[Mk,Ik]=en({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"}),_k=e=>{const[t,n]=yt()(e,["disabled","value","visibleRange","columns"]),r=ae(),o=kn(),i=L(()=>{const l={day:r().getDayTableCellProps,month:r().getMonthTableCellProps,year:r().getYearTableCellProps}[o.view];return l(t)}),s=te(i,n);return y(Mk,{value:t,get children(){return y(re.td,s)}})},Lk=e=>{const t=ae(),n=Ik(),r=kn(),o=L(()=>{const a={day:t().getDayTableCellTriggerProps,month:t().getMonthTableCellTriggerProps,year:t().getYearTableCellTriggerProps}[r.view];return a(n)}),i=te(o,e);return y(re.div,i)},Nk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableHeadProps(n),e);return y(re.thead,r)},Fk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableHeaderProps(n),e);return y(re.th,r)},Vk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getTableRowProps(n),e);return y(re.tr,r)},Bk=e=>{const t=ae(),n=te(()=>t().getTriggerProps(),e);return y(re.button,n)},zk=e=>{const[t,n]=yt()(e,["view"]),r=ae(),o=te(()=>Th.build().view.attrs,n);return y(bk,{value:t,get children(){return y(re.div,B(o,{get hidden(){return r().view!==t.view}}))}})},Kk=e=>{const t=ae(),n=kn(),r=te(()=>t().getViewControlProps(n),e);return y(re.div,r)},Uk=e=>{const t=ae(),n=kn(),r=te(()=>t().getViewTriggerProps(n),e);return y(re.button,r)},jk=yt(),Wk=e=>{const[t,n]=jk(e,["weekIndex","week"]),r=ae(),o=te(()=>r().getWeekNumberCellProps(t),n);return y(re.td,o)},Hk=e=>{const t=ae(),n=Jr(),r=te(()=>t().getWeekNumberHeaderCellProps(n),e);return y(re.th,r)},Yk=e=>{const t=ae(),n=te(()=>t().getYearSelectProps(),e);return y(re.select,B(n,{get children(){return y(Nl,{get each(){return t().getYears()},children:r=>y(re.option,{get value(){return r().value},get children(){return r().label}})})}}))},Bt={};yP(Bt,{ClearTrigger:()=>hk,Content:()=>gk,Context:()=>pk,Control:()=>mk,Input:()=>yk,Label:()=>vk,MonthSelect:()=>wk,NextTrigger:()=>xk,Positioner:()=>Sk,PresetTrigger:()=>Ek,PrevTrigger:()=>Pk,RangeText:()=>kk,Root:()=>Tk,RootProvider:()=>Ak,Table:()=>Dk,TableBody:()=>Rk,TableCell:()=>_k,TableCellTrigger:()=>Lk,TableHead:()=>Nk,TableHeader:()=>Fk,TableRow:()=>Vk,Trigger:()=>Bk,ValueText:()=>Ck,View:()=>zk,ViewControl:()=>Kk,ViewTrigger:()=>Uk,WeekNumberCell:()=>Wk,WeekNumberHeaderCell:()=>Hk,YearSelect:()=>Yk}),Bt.Label,Bt.TableHead,Bt.TableBody,Bt.ClearTrigger,Bt.YearSelect,Bt.MonthSelect,Bt.Context,Bt.RootProvider;var qk=U("<div>Unknown bot message type");const Gk=e=>y(xb,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ia,{get text(){return e.text}}):e.type==="buttons"?y(kb,B(()=>e.buttons)):e.type==="list"?y(ox,B(()=>e.list)):e.type==="media"?y(dd,B(()=>e.media)):e.type==="link"?y($b,B(()=>e.link)):e.type==="cards"?y(Tb,B(()=>e.cards)):e.type==="date"?y(ia,{get text(){return e.text}}):qk()}});var Xk=U('<div class="place-self-center p-4"><span class="bg-slate-200/40 text-black font-semibold py-2 px-4 rounded-xl">');const Zk=e=>(()=>{var t=Xk(),n=t.firstChild;return N(n,()=>e.text?.trim()),t})();var Jk=U('<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 Qk=({children:e,createdAt:t})=>(()=>{var n=Jk(),r=n.firstChild;return N(r,e),N(n,y(Gu,{createdAt:t,anchor:"end"}),null),n})();var eC=U("<div>Unknown user message type");const tC=e=>y(Qk,{get createdAt(){return e.createdAt},get children(){return e.type==="text"?y(ia,{get text(){return e.text}}):e.type==="media"?y(dd,B(()=>e.media)):eC()}});var nC=U("<div>Unknown message origin");const rC=e=>e.origin==="bot"?y(Gk,e):e.origin==="user"?y(tC,e):e.origin==="service"?y(Zk,e):nC();function $h(e){return Ee({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 sl(e){return Ee({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 oC=U('<main touch-action-pan-y class="flex-1 w-full p-4 overflow-y-auto flex flex-col items-center scroll-smooth relative min-h-0 overscroll-contain pb-2">'),iC=U("<div>");const al=()=>{let e;const{getMessages:t,onMessage:n,clearMessages:r,addBalloonMessage:o,maybeAutostart:i}=Qt(),{onOpen:s}=ql(),a=(l=100)=>{setTimeout(()=>{e?.scrollTo(0,e.scrollHeight)},l)};return ye("reset",()=>{r()}),Wt(()=>{o(),a(200),i()}),n(a),s(()=>a(200)),(()=>{var l=oC(),c=e;return typeof c=="function"?pr(c,l):e=l,N(l,y(Ht,{get each(){return t()},get fallback(){return(()=>{var u=iC();return N(u,()=>Oe("emptyMessages")),u})()},children:u=>y(rC,u)})),l})()};function Dh(e){return Ee({a:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"},c:'<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/>'},e)}var sC=U("<textarea>");const aC=e=>{const[,t]=ee(e,["class"]);return(()=>{var n=sC();return fn(n,B({get class(){return jt("flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md: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 lC=U('<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 cC=e=>(()=>{var t=lC();return fn(t,e,!0,!0),t})();var uC=U('<div class="absolute flex items-center justify-center left-1/2 transform -translate-x-1/2 bottom-[-12px]"><span class="font-semibold text-xs text-gray-600 ml-1">SmartTalks.ai');const dC=()=>(()=>{var e=uC(),t=e.firstChild;return N(e,y(cC,{height:15}),t),e})();var fC=U('<div class="flex items-center justify-between gap-2 rounded-md bg-destructive/10 text-destructive text-xs px-2 py-1.5"><span></span><button type=button aria-label=Dismiss class=shrink-0>'),hC=U('<div class="flex gap-2 flex-wrap">'),gC=U('<footer class="relative flex-none bg-white border-t border-gray-100 z-20 w-full"><div class="flex flex-col p-3 gap-2 pb-[max(1rem,env(safe-area-inset-bottom))] w-full box-border"><div class="flex items-end gap-2 w-full"><input type=file multiple class=hidden></div><div class="flex justify-center opacity-70 scale-95">'),pC=U('<img class="w-full h-full object-cover">'),mC=U('<div class="absolute inset-0 bg-black/50 flex items-center justify-center"><span class="text-white text-xs font-medium">%'),yC=U('<button type=button class="absolute inset-0 bg-destructive/70 flex items-center justify-center text-white text-[10px] leading-tight px-1 text-center">'),vC=U('<button type=button class="absolute top-0.5 right-0.5 bg-black/60 text-white rounded-full p-0.5"aria-label=Remove>'),wC=U('<div class="relative w-16 h-16 rounded-md overflow-hidden border border-gray-200 bg-gray-50 flex items-center justify-center shrink-0">');const ll=()=>{const{pushMessage:e,pushMedia:t}=Qt(),{chatWidget:n}=he(),{attachments:r,addFiles:o,updateAttachment:i,removeAttachment:s,lastRejection:a,clearRejection:l}=Dr(),[c,u]=_(""),[d,f]=_(!1);let g,h;const p=()=>g?.click(),m=2,v=()=>{const S=h;if(!S)return;const P=getComputedStyle(S),R=parseFloat(P.lineHeight)||20,O=parseFloat(P.paddingTop)+parseFloat(P.paddingBottom)+parseFloat(P.borderTopWidth)+parseFloat(P.borderBottomWidth),V=R*m+O;S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,V)}px`,S.style.overflowY=S.scrollHeight>V?"auto":"hidden"};z(()=>{c(),v()});const w=S=>{l();const P=Array.from(S.currentTarget.files??[]);P.length&&o(P),S.currentTarget.value=""},x=()=>{const S=a();return S?S.reason==="size"?Oe("fileTooLarge"):Oe("fileTypeNotAllowed"):""},b=async S=>{const P=n()?._id??"";i(S.id,{status:"uploading",progress:0,error:void 0});const R=await Yw(P,S.file,O=>i(S.id,{progress:O}));return i(S.id,{status:"uploaded",progress:1}),R},C=async()=>{if(d())return;const S=c().trim(),P=[...r];if(P.length===0){if(!S)return;e(S),u("");return}f(!0),u("");let R=!1;for(const O of P)try{const V=await b(O),K=R?"":S;R=!0,t(V,K),s(O.id)}catch(V){console.error(V),i(O.id,{status:"failed",error:String(V)})}f(!1)},E=async S=>{if(!(d()||S.status==="uploading"))try{const P=await b(S);t(P,""),s(S.id)}catch(P){console.error(P),i(S.id,{status:"failed",error:String(P)})}},T=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),C())};ye("setInput",S=>{S&&u(S)});const D=()=>!d()&&(c().trim().length>0||r.length>0);return(()=>{var S=gC(),P=S.firstChild,R=P.firstChild,O=R.firstChild,V=R.nextSibling;N(P,y(G,{get when(){return a()},get children(){var Y=fC(),F=Y.firstChild,W=F.nextSibling;return N(F,x),uo(W,"click",l,!0),N(W,y($h,{size:14})),Y}}),R),N(P,y(G,{get when(){return r.length>0},get children(){var Y=hC();return N(Y,y(Ht,{each:r,children:F=>y(bC,{att:F,onRemove:()=>s(F.id),onRetry:()=>E(F)})})),Y}}),R),N(R,y(Ue,{variant:"outline",class:"h-9 w-9 p-0 shrink-0 flex items-center justify-center text-gray-400",get"aria-label"(){return Oe("attachFile")},get title(){return Oe("attachFile")},type:"button",onClick:p,get children(){return y(Dh,{size:18})}}),O),O.addEventListener("change",w);var K=g;return typeof K=="function"?pr(K,O):g=O,me(O,"accept",zw),N(R,y(aC,{ref(Y){var F=h;typeof F=="function"?F(Y):h=Y},id:"chat-input",rows:1,get placeholder(){return Oe("inputPlaceholder")},get value(){return c()},onInput:Y=>u(Y.currentTarget.value),onKeyDown:T,class:"focus-visible:ring-primary min-h-[36px] py-2 leading-tight resize-none overflow-y-hidden"}),null),N(R,y(Ue,{variant:"outline",class:"h-9 w-9 p-0 shrink-0 flex items-center justify-center","aria-label":"Send",type:"button",get disabled(){return!D()},onClick:C,get children(){return y(G,{get when(){return!d()},get fallback(){return y(ac,{size:18,class:"animate-spin"})},get children(){return y(zp,{size:18})}})}}),null),N(V,y(dC,{})),S})()},bC=e=>{const t=()=>Bo(e.att.file.type)==="image";return(()=>{var n=wC();return N(n,y(G,{get when(){return t()},get fallback(){return y(Nv,{class:"size-7 text-gray-400"})},get children(){var r=pC();return pe(o=>{var i=e.att.previewUrl,s=e.att.file.name;return i!==o.e&&me(r,"src",o.e=i),s!==o.t&&me(r,"alt",o.t=s),o},{e:void 0,t:void 0}),r}}),null),N(n,y(G,{get when(){return e.att.status==="uploading"},get children(){var r=mC(),o=r.firstChild,i=o.firstChild;return N(o,()=>Math.round(e.att.progress*100),i),r}}),null),N(n,y(G,{get when(){return e.att.status==="failed"},get children(){var r=yC();return uo(r,"click",e.onRetry,!0),N(r,()=>Oe("uploadFailed")),pe(o=>{var i=Oe("uploadFailed"),s=Oe("uploadFailed");return i!==o.e&&me(r,"aria-label",o.e=i),s!==o.t&&me(r,"title",o.t=s),o},{e:void 0,t:void 0}),r}}),null),N(n,y(G,{get when(){return e.att.status==="pending"||e.att.status==="failed"},get children(){var r=vC();return uo(r,"click",e.onRemove,!0),N(r,y($h,{size:12})),r}}),null),pe(()=>me(n,"title",e.att.file.name)),n})()};Vl(["click"]);var xC=U('<div class="absolute inset-0 z-40 flex items-center justify-center bg-background/85 backdrop-blur-sm pointer-events-none"><div class="m-3 flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-primary p-6 text-primary"><span class=font-medium>'),SC=U("<div>");const cl=e=>{const[t,n]=_(!1);let r=0;const o=i=>Array.from(i.dataTransfer?.types??[]).includes("Files");return Wt(()=>{let i=null;try{i=fr()}catch{i=null}if(!i)return;const s=i,a=f=>{o(f)&&f.preventDefault()};document.addEventListener("dragover",a),document.addEventListener("drop",a),H(()=>{document.removeEventListener("dragover",a),document.removeEventListener("drop",a)}),getComputedStyle(s).position==="static"&&(s.style.position="relative");const l=f=>{o(f)&&(f.preventDefault(),r+=1,n(!0))},c=f=>{o(f)&&f.preventDefault()},u=()=>{r=Math.max(0,r-1),r===0&&n(!1)},d=f=>{if(!o(f))return;f.preventDefault(),r=0,n(!1);const g=Array.from(f.dataTransfer?.files??[]);g.length&&e.onFiles(g)};s.addEventListener("dragenter",l),s.addEventListener("dragover",c),s.addEventListener("dragleave",u),s.addEventListener("drop",d),H(()=>{s.removeEventListener("dragenter",l),s.removeEventListener("dragover",c),s.removeEventListener("dragleave",u),s.removeEventListener("drop",d)})}),(()=>{var i=SC();return i.style.setProperty("display","contents"),N(i,y(G,{get when(){return t()},get children(){var s=xC(),a=s.firstChild,l=a.firstChild;return N(a,y(Dh,{class:"size-8"}),l),N(l,()=>Oe("dropToUpload")),s}})),i})()};var EC=U('<div id=smarttalks-widget class="rounded-md shadow-xl h-[85vh] w-[90vw] md:h-[min(100vh,500px)] md:w-[min(100vw,425px)] overflow-hidden bg-background text-foreground flex flex-col relative">'),PC=U("<span class=sr-only>Close"),kC=U('<div><div class="flex justify-center gap-3 items-center">'),CC=U("<span class=sr-only>Open"),OC=U("<span class=font-bold>"),TC=U("<span>"),AC=U('<div class="animate-pulse flex p-1">');const $C=({children:e,openIcon:t})=>{const{bubble:n,toggle:r,show:o,hide:i}=ql(),{chatWidget:s}=he(),[a,l]=_(!0),[c,u]=_("");setTimeout(()=>l(!1),2e3),s()?.openDelay&&!s()?.hideWidget&&setTimeout(()=>{o()},(s()?.openDelay||0)*1e3);const d=()=>(s()?.style.margin??5)*4,f=()=>s()?.style.position==="left"?{left:`${d()}px`}:{right:`${d()}px`};return ye("open",()=>{o()}),ye("close",()=>{i()}),ye("toggle",()=>{r()}),ye("onAnswer",g=>{g.text&&u(g.text),o()}),(()=>{var g=kC(),h=g.firstChild;return N(g,y(G,{get when(){return Yt(()=>!!n())()&&!s()?.hideWidget},get children(){var p=EC();return N(p,e),p}}),h),N(h,y(G,{get when(){return s()?.whatsappBtn},get children(){return y(Ue,{onclick:()=>window.open(s()?.whatsappBtn,"_blank"),"aria-label":"Open",class:"bg-green-500 rounded-full size-14 shadow-md hover:bg-green-400 animate-scale",type:"button",get children(){return y(mb,{class:"size-9",color:"white"})}})}}),null),N(h,y(G,{get when(){return!s()?.hideWidget},get children(){return y(G,{get when(){return n()},get fallback(){return y(Ue,{onclick:r,class:"rounded-full px-0 animate-scale","aria-label":"Open",type:"button",get children(){return[t,CC(),y(G,{get when(){return s()?.balloonMessage},get children(){var p=TC();return N(p,y(G,{get when(){return c()},get fallback(){return y(G,{get when(){return!a()},get fallback(){return(()=>{var m=AC();return N(m,y(sl,{class:"size-2 animate-bounce"}),null),N(m,y(sl,{class:"size-2 animate-bounce delay-150"}),null),N(m,y(sl,{class:"size-2 animate-bounce delay-300"}),null),m})()},get children(){return Yt(()=>(s()?.balloonMessage?.length??0)>18)()?s()?.balloonMessage?.substring(0,15)+"...":s()?.balloonMessage}})},get children(){var m=OC();return N(m,(()=>{var v=Yt(()=>c().length>20);return()=>v()?c().substring(0,17)+"...":c()})()),m}})),pe(()=>qt(p,"absolute -top-12 bg-primary text-primary-foreground px-2.5 py-2 pointer-events-none rounded-full truncate hidden md:block"+(s()?.style.position==="left"?" left-0":" right-0"))),p}})]}})},get children(){return y(Ue,{onclick:r,class:"rounded-full px-0 hover:bg-primary hover:shadow-primary shadow-md transition-shadow duration-300","aria-label":"Close",type:"button",get children(){return[t,PC()]}})}})}}),null),pe(p=>{var m="z-[9999] max-h-full max-w-full md:max-h-[90%] md:max-w-[90%] fixed bottom-5 flex flex-col space-y-2 "+(s()?.style.position==="left"?" items-start":" items-end"),v=f();return m!==p.e&&qt(g,p.e=m),p.t=fo(g,v,p.t),p},{e:void 0,t:void 0}),g})()};var DC=U('<div id=smarttalks-widget class="h-screen w-full overflow-hidden bg-background text-foreground flex flex-col rounded-md">');const RC=({children:e})=>{const{chatWidget:t}=he(),n={};return t()?.style.width&&(n.width=`min(100vw, ${t()?.style.width}px)`),t()?.style.height&&(n.height=`min(100vh, ${t()?.style.height}px)`),(()=>{var r=DC();return fo(r,n),N(r,e),r})()};var MC=U("<div id=smarttalks-widget>");const IC=({children:e})=>{const{chatWidget:t}=he(),[n,r]=_(!1),[o,i]=_(!1),[s,a]=_("100%"),l=()=>{typeof window<"u"&&i(window.innerWidth<768)},c=()=>{o()&&window.visualViewport&&(a(`${window.visualViewport.height}px`),window.scrollTo(0,0))};z(()=>{typeof document>"u"||(n()&&o()?(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"):(document.body.style.overflow="",document.body.style.position="",document.body.style.width=""))}),Wt(()=>{l(),window.addEventListener("resize",l),window.visualViewport&&(window.visualViewport.addEventListener("resize",c),window.visualViewport.addEventListener("scroll",c))}),H(()=>{window.removeEventListener("resize",l),window.visualViewport&&(window.visualViewport.removeEventListener("resize",c),window.visualViewport.removeEventListener("scroll",c)),document.body.style.overflow="",document.body.style.position=""});const u=()=>(t()?.style.margin??5)*4,d=()=>{if(o())return{height:s(),top:"0px"};const f={};return t()?.fullscreen?(f.height="100%",f["max-height"]="100%",f.width="100%",f["max-width"]="100%",f.bottom=0,f.left=0):t()?.style.position&&(f[t()?.style.position||"right"]=`${u()}px`),f};return ye("open",()=>{r(!0),ge("onOpen"),o()&&window.visualViewport&&a(`${window.visualViewport.height}px`)}),ye("close",()=>{r(!1),ge("onClose")}),ye("toggle",()=>{r(!n()),ge("onToggle")}),ye("onAnswer",()=>{r(!0),ge("onOpen")}),setTimeout(()=>{r(!0),ge("onOpen")},(t()?.openDelay||0)*1e3),y(G,{get when(){return n()},get children(){var f=MC();return N(f,e),pe(g=>{var h=`
|
|
182
182
|
fixed flex flex-col bg-background text-foreground shadow-xl overflow-hidden z-[99999]
|
|
183
183
|
|
|
184
184
|
${o()?"inset-x-0 top-0 w-full rounded-none m-0":"transition-all duration-300 ease-in-out w-[400px] h-[min(85vh,700px)] md:w-[400px] md:max-h-[90%] md:rounded-xl md:bottom-5"}
|
|
185
|
-
`,p=d();return h!==g.e&&qt(f,g.e=h),g.t=
|
|
185
|
+
`,p=d();return h!==g.e&&qt(f,g.e=h),g.t=fo(f,p,g.t),g},{e:void 0,t:void 0}),f}})};var _C=U('<div class="absolute bg-black/50 text-white font-bold h-full w-full grid place-content-center z-50">');const ul=()=>(()=>{var e=_C();return N(e,y(ac,{size:45,class:"animate-spin"})),e})(),LC=()=>{const{chatWidget:e}=he(),{loading:t}=Qt(),{addFiles:n}=Dr();return y($C,{get openIcon(){return y(sc,{get src(){return e()?.avatar}})},get children(){return[y(G,{get when(){return t()},get children(){return y(ul,{})}}),y(Xs,{}),y(al,{}),y(ll,{}),y(cl,{onFiles:n})]}})},NC=()=>{const{loading:e}=Qt(),{addFiles:t}=Dr();return y(IC,{get children(){return[y(G,{get when(){return e()},get children(){return y(ul,{})}}),y(Xs,{}),y(al,{}),y(ll,{}),y(cl,{onFiles:t})]}})},FC=()=>{const{loading:e}=Qt(),{addFiles:t}=Dr();return y(RC,{get children(){return[y(G,{get when(){return e()},get children(){return y(ul,{})}}),y(Xs,{}),y(al,{}),y(ll,{}),y(cl,{onFiles:t})]}})};var VC=U("<div><div>Form");const BC=()=>{const{formWidget:e}=he();return(()=>{var t=VC();return t.firstChild,N(t,()=>e()?._id,null),t})()};function zC(){const{widget:e,chatWidget:t}=he();return[y(G,{get when(){return t()?.mode==="standard"},get children(){return y(LC,{})}}),y(G,{get when(){return t()?.mode==="popup"},get children(){return y(NC,{})}}),y(G,{get when(){return t()?.mode==="static"},get children(){return y(FC,{})}}),y(G,{get when(){return e()?.type==="form"},get children(){return y(BC,{})}})]}var KC=U("<style>"),UC=U("<div>");let sr=null;const jC=({id:e,settings:t,side:n,margin:r,mode:o})=>{const i=kg();if(sr&&sr!==i&&sr.isConnected)return console.warn("SmartTalks.ai Widget: duplicate instance blocked"),[];sr=i;const{setWidgetId:s,widget:a}=he(),l=(e||"default")+"?"+(t?"&showSettings":"")+(n?`&${n}`:"")+(r?`&margin=${r}`:"")+(o?`&mode=${o}`:"");s(l);const[c,u]=_(!1);let d=!1;const f=()=>{if(!d){if(a()){u(!0);return}setTimeout(f,50)}};return setTimeout(f,0),H(()=>{d=!0,sr===i&&(sr=null)}),[(()=>{var g=KC();return N(g,hp),g})(),(()=>{var g=UC();return N(g,y(G,{get when(){return c()},get children(){return y(zC,{})}})),g})()]},WC={id:"",settings:!1,side:void 0,margin:void 0,mode:void 0};(()=>{typeof window>"u"||fp("smarttalks-widget",WC,jC)})(),yg()}));
|