extended-dynamic-forms 0.1.11 → 0.1.13
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/README.md +165 -0
- package/dist/conditionals/ConditionalForm.d.ts +7 -0
- package/dist/conditionals/index.d.ts +3 -0
- package/dist/conditionals/types.d.ts +65 -0
- package/dist/conditionals/utils.d.ts +22 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +7941 -4073
- package/dist/index.umd.js +45 -38
- package/dist/style.css +1 -1
- package/dist/vanilla-wrapper.d.ts +2 -0
- package/package.json +5 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,106 +1,113 @@
|
|
|
1
|
-
(function(T,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("@rjsf/utils"),require("@rjsf/validator-ajv8"),require("@rjsf/shadcn"),require("@rjsf/core")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","@rjsf/utils","@rjsf/validator-ajv8","@rjsf/shadcn","@rjsf/core"],m):(T=typeof globalThis<"u"?globalThis:T||self,m(T.ExtendedDynamicForms={},T.React.jsxRuntime,T.React,T.ReactDOM,T.RJSFUtils,T.RJSFValidatorAjv8,T.RJSFShadcn,T.RJSFCore))})(this,function(T,m,E,Ur,Kt,qr,oc,sc){"use strict";var ug=Object.defineProperty;var fg=(T,m,E)=>m in T?ug(T,m,{enumerable:!0,configurable:!0,writable:!0,value:E}):T[m]=E;var ot=(T,m,E)=>fg(T,typeof m!="symbol"?m+"":m,E);function Gr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const v=Gr(E),Xt=Gr(Ur);function Kr(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=Kr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xr(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Kr(e))&&(r&&(r+=" "),r+=t);return r}const Dn="-",ac=e=>{const t=cc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Dn);return a[0]===""&&a.length!==1&&a.shift(),Qr(a,t)||ic(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Qr=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Qr(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Dn);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Zr=/^\[(.+)\]$/,ic=e=>{if(Zr.test(e)){const t=Zr.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},cc=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return dc(Object.entries(e.classGroups),n).forEach(([s,i])=>{Tn(i,r,s,t)}),r},Tn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Jr(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(lc(o)){Tn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Tn(i,Jr(t,s),n,r)})})},Jr=(e,t)=>{let n=e;return t.split(Dn).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},lc=e=>e.isThemeGetter,dc=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,uc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},eo="!",fc=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let l=0,u=0,d;for(let b=0;b<a.length;b++){let p=a[b];if(l===0){if(p===o&&(r||a.slice(b,b+s)===t)){c.push(a.slice(u,b)),u=b+s;continue}if(p==="/"){d=b;continue}}p==="["?l++:p==="]"&&l--}const f=c.length===0?a:a.substring(u),g=f.startsWith(eo),x=g?f.substring(1):f,h=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:i}):i},hc=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},mc=e=>({cache:uc(e.cacheSize),parseClassName:fc(e),...ac(e)}),pc=/\s+/,gc=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(pc);let a="";for(let c=i.length-1;c>=0;c-=1){const l=i[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(l);let x=!!g,h=r(x?f.substring(0,g):f);if(!h){if(!x){a=l+(a.length>0?" "+a:a);continue}if(h=r(f),!h){a=l+(a.length>0?" "+a:a);continue}x=!1}const b=hc(u).join(":"),p=d?b+eo:b,y=p+h;if(s.includes(y))continue;s.push(y);const w=o(h,x);for(let S=0;S<w.length;++S){const C=w[S];s.push(p+C)}a=l+(a.length>0?" "+a:a)}return a};function vc(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=to(t))&&(r&&(r+=" "),r+=n);return r}const to=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=to(e[r]))&&(n&&(n+=" "),n+=t);return n};function yc(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=mc(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=gc(c,n);return o(c,u),u}return function(){return s(vc.apply(null,arguments))}}const re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},no=/^\[(?:([a-z-]+):)?(.+)\]$/i,bc=/^\d+\/\d+$/,wc=new Set(["px","full","screen"]),xc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cc=/\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$/,Sc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,kc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ec=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Le=e=>ht(e)||wc.has(e)||bc.test(e),qe=e=>mt(e,"length",Wc),ht=e=>!!e&&!Number.isNaN(Number(e)),An=e=>mt(e,"number",ht),At=e=>!!e&&Number.isInteger(Number(e)),Mc=e=>e.endsWith("%")&&ht(e.slice(0,-1)),V=e=>no.test(e),Ge=e=>xc.test(e),Nc=new Set(["length","size","percentage"]),Oc=e=>mt(e,Nc,ro),Pc=e=>mt(e,"position",ro),Dc=new Set(["image","url"]),Tc=e=>mt(e,Dc,Fc),Ac=e=>mt(e,"",_c),Wt=()=>!0,mt=(e,t,n)=>{const r=no.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Wc=e=>Cc.test(e)&&!Sc.test(e),ro=()=>!1,_c=e=>kc.test(e),Fc=e=>Ec.test(e),Ic=yc(()=>{const e=re("colors"),t=re("spacing"),n=re("blur"),r=re("brightness"),o=re("borderColor"),s=re("borderRadius"),i=re("borderSpacing"),a=re("borderWidth"),c=re("contrast"),l=re("grayscale"),u=re("hueRotate"),d=re("invert"),f=re("gap"),g=re("gradientColorStops"),x=re("gradientColorStopPositions"),h=re("inset"),b=re("margin"),p=re("opacity"),y=re("padding"),w=re("saturate"),S=re("scale"),C=re("sepia"),M=re("skew"),k=re("space"),O=re("translate"),_=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",V,t],N=()=>[V,t],I=()=>["",Le,qe],z=()=>["auto",ht,V],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",V],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[ht,V];return{cacheSize:500,separator:":",theme:{colors:[Wt],spacing:[Le,qe],blur:["none","",Ge,V],brightness:oe(),borderColor:[e],borderRadius:["none","","full",Ge,V],borderSpacing:N(),borderWidth:I(),contrast:oe(),grayscale:B(),hueRotate:oe(),invert:B(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[Mc,qe],inset:P(),margin:P(),opacity:oe(),padding:N(),saturate:oe(),scale:oe(),sepia:B(),skew:oe(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",V]}],container:["container"],columns:[{columns:[Ge]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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(),V]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",At,V]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",V]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",At,V]}],"grid-cols":[{"grid-cols":[Wt]}],"col-start-end":[{col:["auto",{span:["full",At,V]},V]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[Wt]}],"row-start-end":[{row:["auto",{span:[At,V]},V]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",V]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",V]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",V,t]}],"min-w":[{"min-w":[V,t,"min","max","fit"]}],"max-w":[{"max-w":[V,t,"none","full","min","max","fit","prose",{screen:[Ge]},Ge]}],h:[{h:[V,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[V,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[V,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[V,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ge,qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",An]}],"font-family":[{font:[Wt]}],"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",V]}],"line-clamp":[{"line-clamp":["none",ht,An]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Le,V]}],"list-image":[{"list-image":["none",V]}],"list-style-type":[{list:["none","disc","decimal",V]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Le,qe]}],"underline-offset":[{"underline-offset":["auto",Le,V]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",V]}],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",V]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),Pc]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Oc]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Tc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[p]}],"border-style":[{border:[...L(),"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":[p]}],"divide-style":[{divide:L()}],"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:["",...L()]}],"outline-offset":[{"outline-offset":[Le,V]}],"outline-w":[{outline:[Le,qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Le,qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ge,Ac]}],"shadow-color":[{shadow:[Wt]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ge,V]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],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":[p]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",V]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",V]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",V]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[At,V]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",V]}],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",V]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",V]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Le,qe,An]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-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 F(...e){return Ic(Xr(e))}const le=v.forwardRef(({className:e,type:t,...n},r)=>m.jsx("input",{type:t,className:F("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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),ref:r,...n}));le.displayName="Input";function oo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function so(...e){return t=>{let n=!1;const r=e.map(o=>{const s=oo(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():oo(e[o],null)}}}}function Z(...e){return v.useCallback(so(...e),e)}function pt(e){const t=Lc(e),n=v.forwardRef((r,o)=>{const{children:s,...i}=r,a=v.Children.toArray(s),c=a.find(Vc);if(c){const l=c.props.children,u=a.map(d=>d===c?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:d);return m.jsx(t,{...i,ref:o,children:v.isValidElement(l)?v.cloneElement(l,void 0,u):null})}return m.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Bc=pt("Slot");function Lc(e){const t=v.forwardRef((n,r)=>{const{children:o,...s}=n;if(v.isValidElement(o)){const i=Yc(o),a=Hc(s,o.props);return o.type!==v.Fragment&&(a.ref=r?so(r,i):i),v.cloneElement(o,a)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $c=Symbol("radix.slottable");function Vc(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$c}function Hc(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Yc(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],q=zc.reduce((e,t)=>{const n=pt(`Primitive.${t}`),r=v.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function jc(e,t){e&&Xt.flushSync(()=>e.dispatchEvent(t))}var Rc="Label",ao=v.forwardRef((e,t)=>m.jsx(q.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ao.displayName=Rc;var io=ao;const co=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lo=Xr,Wn=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return lo(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=co(u)||co(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(x=>{let[h,b]=x;return Array.isArray(b)?b.includes({...s,...a}[h]):{...s,...a}[h]===b})?[...l,d,f]:l},[]);return lo(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Uc=Wn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pe=v.forwardRef(({className:e,...t},n)=>m.jsx(io,{ref:n,className:F(Uc(),e),...t}));pe.displayName=io.displayName;const Qt=v.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:F("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Qt.displayName="Card";const _n=v.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:F("flex flex-col space-y-1.5 p-6",e),...t}));_n.displayName="CardHeader";const uo=v.forwardRef(({className:e,...t},n)=>m.jsx("h3",{ref:n,className:F("text-2xl font-semibold leading-none tracking-tight",e),...t}));uo.displayName="CardTitle";const qc=v.forwardRef(({className:e,...t},n)=>m.jsx("p",{ref:n,className:F("text-sm text-muted-foreground",e),...t}));qc.displayName="CardDescription";const Zt=v.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:F("p-6 pt-0",e),...t}));Zt.displayName="CardContent";const Gc=v.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:F("flex items-center p-6 pt-0",e),...t}));Gc.displayName="CardFooter";const fo=({formData:e,onChange:t,required:n,disabled:r,readonly:o,schema:s,idSchema:i})=>{const a=c=>l=>{t({...e,[c]:l.target.value})};return m.jsxs(Qt,{children:[m.jsx(_n,{className:"pb-4",children:m.jsx(uo,{className:"text-lg",children:s.title||"Address"})}),m.jsxs(Zt,{className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:`${i.$id}_street`,children:["Street Address",n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:`${i.$id}_street`,type:"text",value:(e==null?void 0:e.street)||"",onChange:a("street"),disabled:r||o,placeholder:"123 Main St"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:`${i.$id}_city`,children:["City",n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:`${i.$id}_city`,type:"text",value:(e==null?void 0:e.city)||"",onChange:a("city"),disabled:r||o,placeholder:"New York"})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:`${i.$id}_state`,children:["State/Province",n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:`${i.$id}_state`,type:"text",value:(e==null?void 0:e.state)||"",onChange:a("state"),disabled:r||o,placeholder:"NY"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:`${i.$id}_zip`,children:["ZIP/Postal Code",n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:`${i.$id}_zip`,type:"text",value:(e==null?void 0:e.zip)||"",onChange:a("zip"),disabled:r||o,placeholder:"10001"})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(pe,{htmlFor:`${i.$id}_country`,children:"Country"}),m.jsx(le,{id:`${i.$id}_country`,type:"text",value:(e==null?void 0:e.country)||"",onChange:a("country"),disabled:r||o,placeholder:"United States"})]})]})]})},ho=E.createContext(null),mo=({eventHub:e,formData:t,children:n})=>m.jsx(ho.Provider,{value:{eventHub:e,formData:t},children:n}),po=()=>{const e=E.useContext(ho);if(!e)throw new Error("useFormEventHub must be used within a FormEventProvider");return e},ie=(e,t,n)=>{const{eventHub:r,formData:o}=po();return E.useMemo(()=>r.createFieldEventHandlers(e,t,o,n),[r,e,t,o,n])},go=({formData:e,onChange:t,required:n,disabled:r,readonly:o,schema:s,idSchema:i})=>{const a=ie(i.$id,s),c=u=>{const d=u.replace(/\D/g,""),f=d.length;return f<4?d:f<7?`(${d.slice(0,3)}) ${d.slice(3)}`:`(${d.slice(0,3)}) ${d.slice(3,6)}-${d.slice(6,10)}`},l=async u=>{const d=c(u.target.value);t(d),await a.onChange(d)};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:i.$id,children:[s.title||"Phone Number",n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:i.$id,type:"tel",value:e||"",onChange:l,disabled:r||o,placeholder:"(555) 123-4567",maxLength:14})]})},vo=({formData:e,onChange:t,required:n,disabled:r,readonly:o,schema:s,uiSchema:i,idSchema:a})=>{var x,h;const c=((x=i==null?void 0:i["ui:options"])==null?void 0:x.currency)||"USD",l=((h=i==null?void 0:i["ui:options"])==null?void 0:h.symbol)||"$",u=ie(a.$id,s),d=b=>{const p=parseFloat(b.replace(/[^0-9.-]+/g,""));return isNaN(p)?"":p.toFixed(2)},f=async b=>{const p=b.target.value.replace(/[^0-9.-]+/g,""),y=p?parseFloat(p):void 0;t(y),await u.onChange(y)},g=async b=>{const p=d(b.target.value),y=p?parseFloat(p):void 0;t(y),await u.onBlur(y)};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:a.$id,children:[s.title||"Amount",n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsxs("div",{className:"relative",children:[m.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:String(l)}),m.jsx(le,{id:a.$id,type:"text",inputMode:"decimal",value:e||"",onChange:f,onBlur:g,disabled:r||o,placeholder:"0.00",className:"pl-8 pr-12"}),m.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:String(c)})]})]})},Fn=Wn("inline-flex items-center justify-center whitespace-nowrap 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 bg-background 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:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$e=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Bc:"button";return m.jsx(i,{className:F(Fn({variant:t,size:n,className:e})),ref:s,...o})});$e.displayName="Button";/**
|
|
1
|
+
(function(Y,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react"),require("react-dom"),require("@rjsf/utils"),require("@rjsf/validator-ajv8"),require("@rjsf/shadcn"),require("@rjsf/core")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom","@rjsf/utils","@rjsf/validator-ajv8","@rjsf/shadcn","@rjsf/core"],w):(Y=typeof globalThis<"u"?globalThis:Y||self,w(Y.ExtendedDynamicForms={},Y.React.jsxRuntime,Y.React,Y.ReactDOM,Y.RJSFUtils,Y.RJSFValidatorAjv8,Y.RJSFShadcn,Y.RJSFCore))})(this,function(Y,w,D,Uo,Er,Yo,yl,bl){"use strict";var Zb=Object.defineProperty;var Jb=(Y,w,D)=>w in Y?Zb(Y,w,{enumerable:!0,configurable:!0,writable:!0,value:D}):Y[w]=D;var wt=(Y,w,D)=>Jb(Y,typeof w!="symbol"?w+"":w,D);function zo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const E=zo(D),Cr=zo(Uo);function qo(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=qo(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ko(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=qo(e))&&(n&&(n+=" "),n+=t);return n}const ln="-",wl=e=>{const t=El(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const s=a.split(ln);return s[0]===""&&s.length!==1&&s.shift(),Go(s,t)||xl(a)},getConflictingClassGroupIds:(a,s)=>{const c=r[a]||[];return s&&n[a]?[...c,...n[a]]:c}}},Go=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?Go(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ln);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},Xo=/^\[(.+)\]$/,xl=e=>{if(Xo.test(e)){const t=Xo.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},El=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Sl(Object.entries(e.classGroups),r).forEach(([i,a])=>{un(a,n,i,t)}),n},un=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Qo(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(Cl(o)){un(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{un(a,Qo(t,i),r,n)})})},Qo=(e,t)=>{let r=e;return t.split(ln).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Cl=e=>e.isThemeGetter,Sl=(e,t)=>t?e.map(([r,n])=>{const o=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[r,o]}):e,Ol=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}},Zo="!",_l=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],i=t.length,a=s=>{const c=[];let l=0,d=0,u;for(let v=0;v<s.length;v++){let g=s[v];if(l===0){if(g===o&&(n||s.slice(v,v+i)===t)){c.push(s.slice(d,v)),d=v+i;continue}if(g==="/"){u=v;continue}}g==="["?l++:g==="]"&&l--}const h=c.length===0?s:s.substring(d),p=h.startsWith(Zo),x=p?h.substring(1):h,f=u&&u>d?u-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:f}};return r?s=>r({className:s,parseClassName:a}):a},kl=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Pl=e=>({cache:Ol(e.cacheSize),parseClassName:_l(e),...wl(e)}),Ml=/\s+/,Al=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Ml);let s="";for(let c=a.length-1;c>=0;c-=1){const l=a[c],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:p}=r(l);let x=!!p,f=n(x?h.substring(0,p):h);if(!f){if(!x){s=l+(s.length>0?" "+s:s);continue}if(f=n(h),!f){s=l+(s.length>0?" "+s:s);continue}x=!1}const v=kl(d).join(":"),g=u?v+Zo:v,y=g+f;if(i.includes(y))continue;i.push(y);const b=o(f,x);for(let O=0;O<b.length;++O){const S=b[O];i.push(g+S)}s=l+(s.length>0?" "+s:s)}return s};function Nl(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Jo(t))&&(n&&(n+=" "),n+=r);return n}const Jo=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Jo(e[n]))&&(r&&(r+=" "),r+=t);return r};function Dl(e,...t){let r,n,o,i=a;function a(c){const l=t.reduce((d,u)=>u(d),e());return r=Pl(l),n=r.cache.get,o=r.cache.set,i=s,s(c)}function s(c){const l=n(c);if(l)return l;const d=Al(c,r);return o(c,d),d}return function(){return i(Nl.apply(null,arguments))}}const pe=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ei=/^\[(?:([a-z-]+):)?(.+)\]$/i,Tl=/^\d+\/\d+$/,Fl=new Set(["px","full","screen"]),Il=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wl=/\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$/,jl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ll=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qe=e=>Mt(e)||Fl.has(e)||Tl.test(e),ct=e=>At(e,"length",ql),Mt=e=>!!e&&!Number.isNaN(Number(e)),dn=e=>At(e,"number",Mt),Jt=e=>!!e&&Number.isInteger(Number(e)),$l=e=>e.endsWith("%")&&Mt(e.slice(0,-1)),te=e=>ei.test(e),lt=e=>Il.test(e),Rl=new Set(["length","size","percentage"]),Vl=e=>At(e,Rl,ti),Hl=e=>At(e,"position",ti),Ul=new Set(["image","url"]),Yl=e=>At(e,Ul,Gl),zl=e=>At(e,"",Kl),er=()=>!0,At=(e,t,r)=>{const n=ei.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},ql=e=>Wl.test(e)&&!jl.test(e),ti=()=>!1,Kl=e=>Ll.test(e),Gl=e=>Bl.test(e),Xl=Dl(()=>{const e=pe("colors"),t=pe("spacing"),r=pe("blur"),n=pe("brightness"),o=pe("borderColor"),i=pe("borderRadius"),a=pe("borderSpacing"),s=pe("borderWidth"),c=pe("contrast"),l=pe("grayscale"),d=pe("hueRotate"),u=pe("invert"),h=pe("gap"),p=pe("gradientColorStops"),x=pe("gradientColorStopPositions"),f=pe("inset"),v=pe("margin"),g=pe("opacity"),y=pe("padding"),b=pe("saturate"),O=pe("scale"),S=pe("sepia"),T=pe("skew"),P=pe("space"),L=pe("translate"),$=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",te,t],R=()=>[te,t],K=()=>["",Qe,ct],ee=()=>["auto",Mt,te],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],m=()=>["start","end","center","between","around","evenly","stretch"],C=()=>["","0",te],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[Mt,te];return{cacheSize:500,separator:":",theme:{colors:[er],spacing:[Qe,ct],blur:["none","",lt,te],brightness:k(),borderColor:[e],borderRadius:["none","","full",lt,te],borderSpacing:R(),borderWidth:K(),contrast:k(),grayscale:C(),hueRotate:k(),invert:C(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[$l,ct],inset:U(),margin:U(),opacity:k(),padding:R(),saturate:k(),scale:k(),sepia:C(),skew:k(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[lt]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...H(),te]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Jt,te]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:C()}],shrink:[{shrink:C()}],order:[{order:["first","last","none",Jt,te]}],"grid-cols":[{"grid-cols":[er]}],"col-start-end":[{col:["auto",{span:["full",Jt,te]},te]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[er]}],"row-start-end":[{row:["auto",{span:[Jt,te]},te]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...m()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...m(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...m(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[lt]},lt]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",lt,ct]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dn]}],"font-family":[{font:[er]}],"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",te]}],"line-clamp":[{"line-clamp":["none",Mt,dn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qe,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qe,ct]}],"underline-offset":[{"underline-offset":["auto",Qe,te]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],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",te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),Hl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Yl]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:X()}],"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:["",...X()]}],"outline-offset":[{"outline-offset":[Qe,te]}],"outline-w":[{outline:[Qe,ct]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Qe,ct]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",lt,zl]}],"shadow-color":[{shadow:[er]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",lt,te]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",te]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Jt,te]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],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",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qe,ct,dn]}],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 J(...e){return Xl(Ko(e))}const be=E.forwardRef(({className:e,type:t,...r},n)=>w.jsx("input",{type:t,className:J("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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),ref:n,...r}));be.displayName="Input";function ri(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ni(...e){return t=>{let r=!1;const n=e.map(o=>{const i=ri(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():ri(e[o],null)}}}}function ue(...e){return E.useCallback(ni(...e),e)}function Nt(e){const t=Zl(e),r=E.forwardRef((n,o)=>{const{children:i,...a}=n,s=E.Children.toArray(i),c=s.find(eu);if(c){const l=c.props.children,d=s.map(u=>u===c?E.Children.count(l)>1?E.Children.only(null):E.isValidElement(l)?l.props.children:null:u);return w.jsx(t,{...a,ref:o,children:E.isValidElement(l)?E.cloneElement(l,void 0,d):null})}return w.jsx(t,{...a,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Ql=Nt("Slot");function Zl(e){const t=E.forwardRef((r,n)=>{const{children:o,...i}=r;if(E.isValidElement(o)){const a=ru(o),s=tu(i,o.props);return o.type!==E.Fragment&&(s.ref=n?ni(n,a):a),E.cloneElement(o,s)}return E.Children.count(o)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jl=Symbol("radix.slottable");function eu(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jl}function tu(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...s)=>{const c=i(...s);return o(...s),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ru(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=nu.reduce((e,t)=>{const r=Nt(`Primitive.${t}`),n=E.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ou(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}var iu="Label",oi=E.forwardRef((e,t)=>w.jsx(ie.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));oi.displayName=iu;var ii=oi;const ai=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,si=Ko,fn=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return si(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(l=>{const d=r==null?void 0:r[l],u=i==null?void 0:i[l];if(d===null)return null;const h=ai(d)||ai(u);return o[l][h]}),s=r&&Object.entries(r).reduce((l,d)=>{let[u,h]=d;return h===void 0||(l[u]=h),l},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,d)=>{let{class:u,className:h,...p}=d;return Object.entries(p).every(x=>{let[f,v]=x;return Array.isArray(v)?v.includes({...i,...s}[f]):{...i,...s}[f]===v})?[...l,u,h]:l},[]);return si(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)},au=fn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ke=E.forwardRef(({className:e,...t},r)=>w.jsx(ii,{ref:r,className:J(au(),e),...t}));ke.displayName=ii.displayName;const Sr=E.forwardRef(({className:e,...t},r)=>w.jsx("div",{ref:r,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Sr.displayName="Card";const hn=E.forwardRef(({className:e,...t},r)=>w.jsx("div",{ref:r,className:J("flex flex-col space-y-1.5 p-6",e),...t}));hn.displayName="CardHeader";const ci=E.forwardRef(({className:e,...t},r)=>w.jsx("h3",{ref:r,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));ci.displayName="CardTitle";const su=E.forwardRef(({className:e,...t},r)=>w.jsx("p",{ref:r,className:J("text-sm text-muted-foreground",e),...t}));su.displayName="CardDescription";const Or=E.forwardRef(({className:e,...t},r)=>w.jsx("div",{ref:r,className:J("p-6 pt-0",e),...t}));Or.displayName="CardContent";const cu=E.forwardRef(({className:e,...t},r)=>w.jsx("div",{ref:r,className:J("flex items-center p-6 pt-0",e),...t}));cu.displayName="CardFooter";const li=({formData:e,onChange:t,required:r,disabled:n,readonly:o,schema:i,idSchema:a})=>{const s=c=>l=>{t({...e,[c]:l.target.value})};return w.jsxs(Sr,{children:[w.jsx(hn,{className:"pb-4",children:w.jsx(ci,{className:"text-lg",children:i.title||"Address"})}),w.jsxs(Or,{className:"space-y-4",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_street`,children:["Street Address",r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:`${a.$id}_street`,type:"text",value:(e==null?void 0:e.street)||"",onChange:s("street"),disabled:n||o,placeholder:"123 Main St"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_city`,children:["City",r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:`${a.$id}_city`,type:"text",value:(e==null?void 0:e.city)||"",onChange:s("city"),disabled:n||o,placeholder:"New York"})]}),w.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_state`,children:["State/Province",r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:`${a.$id}_state`,type:"text",value:(e==null?void 0:e.state)||"",onChange:s("state"),disabled:n||o,placeholder:"NY"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_zip`,children:["ZIP/Postal Code",r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:`${a.$id}_zip`,type:"text",value:(e==null?void 0:e.zip)||"",onChange:s("zip"),disabled:n||o,placeholder:"10001"})]})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx(ke,{htmlFor:`${a.$id}_country`,children:"Country"}),w.jsx(be,{id:`${a.$id}_country`,type:"text",value:(e==null?void 0:e.country)||"",onChange:s("country"),disabled:n||o,placeholder:"United States"})]})]})]})},ui=D.createContext(null),di=({eventHub:e,formData:t,children:r})=>w.jsx(ui.Provider,{value:{eventHub:e,formData:t},children:r}),fi=()=>{const e=D.useContext(ui);if(!e)throw new Error("useFormEventHub must be used within a FormEventProvider");return e},ve=(e,t,r)=>{const{eventHub:n,formData:o}=fi();return D.useMemo(()=>n.createFieldEventHandlers(e,t,o,r),[n,e,t,o,r])},hi=({formData:e,onChange:t,required:r,disabled:n,readonly:o,schema:i,idSchema:a})=>{const s=ve(a.$id,i),c=d=>{const u=d.replace(/\D/g,""),h=u.length;return h<4?u:h<7?`(${u.slice(0,3)}) ${u.slice(3)}`:`(${u.slice(0,3)}) ${u.slice(3,6)}-${u.slice(6,10)}`},l=async d=>{const u=c(d.target.value);t(u),await s.onChange(u)};return w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:a.$id,children:[i.title||"Phone Number",r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:a.$id,type:"tel",value:e||"",onChange:l,disabled:n||o,placeholder:"(555) 123-4567",maxLength:14})]})},pi=({formData:e,onChange:t,required:r,disabled:n,readonly:o,schema:i,uiSchema:a,idSchema:s})=>{var x,f;const c=((x=a==null?void 0:a["ui:options"])==null?void 0:x.currency)||"USD",l=((f=a==null?void 0:a["ui:options"])==null?void 0:f.symbol)||"$",d=ve(s.$id,i),u=v=>{const g=parseFloat(v.replace(/[^0-9.-]+/g,""));return isNaN(g)?"":g.toFixed(2)},h=async v=>{const g=v.target.value.replace(/[^0-9.-]+/g,""),y=g?parseFloat(g):void 0;t(y),await d.onChange(y)},p=async v=>{const g=u(v.target.value),y=g?parseFloat(g):void 0;t(y),await d.onBlur(y)};return w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:s.$id,children:[i.title||"Amount",r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsxs("div",{className:"relative",children:[w.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:String(l)}),w.jsx(be,{id:s.$id,type:"text",inputMode:"decimal",value:e||"",onChange:h,onBlur:p,disabled:n||o,placeholder:"0.00",className:"pl-8 pr-12"}),w.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:String(c)})]})]})},pn=fn("inline-flex items-center justify-center whitespace-nowrap 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 bg-background 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:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ze=E.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},i)=>{const a=n?Ql:"button";return w.jsx(a,{className:J(pn({variant:t,size:r,className:e})),ref:i,...o})});Ze.displayName="Button";/**
|
|
2
2
|
* @license lucide-react v0.303.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/var
|
|
6
|
+
*/var lu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
7
7
|
* @license lucide-react v0.303.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const uu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Re=(e,t)=>{const r=D.forwardRef(({color:n="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:c,...l},d)=>D.createElement("svg",{ref:d,...lu,width:o,height:o,stroke:n,strokeWidth:a?Number(i)*24/Number(o):i,className:["lucide",`lucide-${uu(e)}`,s].join(" "),...l},[...t.map(([u,h])=>D.createElement(u,h)),...Array.isArray(c)?c:[c]]));return r.displayName=`${e}`,r};/**
|
|
12
12
|
* @license lucide-react v0.303.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const du=Re("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
|
|
17
17
|
* @license lucide-react v0.303.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const mi=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
22
22
|
* @license lucide-react v0.303.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const mn=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
27
27
|
* @license lucide-react v0.303.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const fu=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
32
32
|
* @license lucide-react v0.303.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const hu=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
37
37
|
* @license lucide-react v0.303.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const gi=Re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
42
42
|
* @license lucide-react v0.303.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const pu=Re("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
47
47
|
* @license lucide-react v0.303.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
51
|
+
*/const mu=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
52
52
|
* @license lucide-react v0.303.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const
|
|
56
|
+
*/const gu=Re("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
57
57
|
* @license lucide-react v0.303.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const Bn=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wo=e=>{const{canAdd:t,disabled:n,idSchema:r,uiSchema:o,items:s,onAddClick:i,readonly:a,registry:c,required:l,schema:u,title:d}=e,f=Kt.getUiOptions(o),g=Kt.getTemplate("ArrayFieldDescriptionTemplate",c,f),x=Kt.getTemplate("ArrayFieldItemTemplate",c,f),h=Kt.getTemplate("ArrayFieldTitleTemplate",c,f);return m.jsx("div",{className:F("rjsf-array-field",f.classNames),children:m.jsxs(Qt,{className:"border-slate-200",children:[(d||f.title)&&m.jsxs(_n,{className:"pb-3",children:[m.jsx(h,{idSchema:r,title:f.title||d,required:l,schema:u,uiSchema:o,registry:c}),(f.description||u.description)&&m.jsx(g,{idSchema:r,description:f.description||u.description,schema:u,uiSchema:o,registry:c})]}),m.jsxs(Zt,{className:"space-y-3",children:[s&&s.map(({key:b,...p})=>m.jsx(x,{...p},b)),t&&m.jsxs($e,{type:"button",onClick:i,disabled:n||a,size:"sm",variant:"outline",className:"w-full border-dashed",children:[m.jsx(tl,{className:"h-4 w-4 mr-2"}),"Add ",d||"Item"]})]})]})})},xo=e=>{const{children:t,disabled:n,hasToolbar:r,buttonsProps:o,readonly:s}=e,{hasMoveDown:i,hasMoveUp:a,hasRemove:c,index:l,onDropIndexClick:u,onReorderClick:d}=o;return m.jsx(Qt,{className:"relative border-slate-200",children:m.jsxs(Zt,{className:"p-4",children:[r&&m.jsxs("div",{className:"absolute right-2 top-2 flex items-center gap-1",children:[(a||i)&&m.jsx("div",{className:"flex items-center mr-2",children:m.jsx(el,{className:"h-4 w-4 text-slate-400"})}),a&&m.jsx($e,{type:"button",size:"sm",variant:"ghost",disabled:n||s,onClick:d(l,l-1),className:"h-8 w-8 p-0",title:"Move up",children:m.jsx(bo,{className:"h-4 w-4"})}),i&&m.jsx($e,{type:"button",size:"sm",variant:"ghost",disabled:n||s,onClick:d(l,l+1),className:"h-8 w-8 p-0",title:"Move down",children:m.jsx(In,{className:"h-4 w-4"})}),c&&m.jsx($e,{type:"button",size:"sm",variant:"ghost",disabled:n||s,onClick:u(l),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Remove",children:m.jsx(Bn,{className:"h-4 w-4"})})]}),m.jsx("div",{className:F(r&&"pr-24"),children:t})]})})},Co={address:fo,phone:go,currency:vo},So={ArrayFieldTemplate:wo,ArrayFieldItemTemplate:xo},ko=({id:e,value:t,required:n,disabled:r,readonly:o,label:s,onChange:i,onBlur:a,onFocus:c,schema:l})=>{const u=ie(e,l),d=async x=>{const h=x.target.value;i(h),await u.onChange(h)},f=async x=>{const h=x.target.value;a&&a(e,h),await u.onBlur(h)},g=async x=>{const h=x.target.value;c&&c(e,h),await u.onFocus(h)};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:e,children:[s||l.title,n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:e,type:"color",value:t||"#000000",required:n,disabled:r||o,onChange:d,onBlur:f,onFocus:g,className:"h-10 w-full cursor-pointer"})]})},rl=({id:e,value:t,required:n,disabled:r,readonly:o,label:s,onChange:i,onBlur:a,onFocus:c,options:l,schema:u})=>{const d=l.inputType||"date",f=ie(e,u),g=async b=>{const p=b.target.value;i(p),await f.onChange(p)},x=async b=>{const p=b.target.value;a&&a(e,p),await f.onBlur(p)},h=async b=>{const p=b.target.value;c&&c(e,p),await f.onFocus(p)};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:e,children:[s||u.title,n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{id:e,type:d,value:t||"",required:n,disabled:r||o,onChange:g,onBlur:x,onFocus:h,min:typeof l.minDate=="string"||typeof l.minDate=="number"?l.minDate:void 0,max:typeof l.maxDate=="string"||typeof l.maxDate=="number"?l.maxDate:void 0,className:"w-full"})]})},ol=Wn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Eo({className:e,variant:t,...n}){return m.jsx("div",{className:F(ol({variant:t}),e),...n})}const Mo=({id:e,value:t,required:n,disabled:r,readonly:o,label:s,onChange:i,options:a,schema:c})=>{const l=E.useRef(null),u=a.accept||"*/*",d=a.multiple||!1,f=ie(e,c),g=async b=>{const p=b.target.files;if(!p)return;let y;if(d){const w=Array.from(p).map(S=>({name:S.name,size:S.size,type:S.type,lastModified:S.lastModified}));y=w,i(w)}else{const w=p[0];w&&(y={name:w.name,size:w.size,type:w.type,lastModified:w.lastModified},i(y))}y&&await f.onChange(y)},x=async()=>{l.current&&(l.current.value=""),i(null),await f.onChange(null)},h=b=>b<1024?b+" B":b<1024*1024?(b/1024).toFixed(1)+" KB":(b/(1024*1024)).toFixed(1)+" MB";return m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:e,children:[s||c.title,n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx(le,{ref:l,id:e,type:"file",accept:u,multiple:d,required:n,disabled:r||o,onChange:g,className:"cursor-pointer"}),t&&m.jsx("div",{className:"space-y-2",children:d&&Array.isArray(t)?m.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((b,p)=>m.jsxs(Eo,{variant:"secondary",className:"flex items-center gap-1 pr-1",children:[m.jsxs("span",{className:"text-xs",children:[b.name," (",h(b.size),")"]}),!r&&!o&&m.jsx($e,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:x,children:m.jsx(Bn,{className:"h-3 w-3"})})]},p))}):t&&typeof t=="object"&&"name"in t?m.jsxs(Eo,{variant:"secondary",className:"inline-flex items-center gap-1 pr-1",children:[m.jsxs("span",{className:"text-xs",children:[t.name," (",h(t.size),")"]}),!r&&!o&&m.jsx($e,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:x,children:m.jsx(Bn,{className:"h-3 w-3"})})]}):null})]})};function Jt(e,[t,n]){return Math.min(n,Math.max(t,e))}function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function gt(e,t=[]){let n=[];function r(s,i){const a=v.createContext(i),c=n.length;n=[...n,i];const l=d=>{var p;const{scope:f,children:g,...x}=d,h=((p=f==null?void 0:f[e])==null?void 0:p[c])||a,b=v.useMemo(()=>x,Object.values(x));return m.jsx(h.Provider,{value:b,children:g})};l.displayName=s+"Provider";function u(d,f){var h;const g=((h=f==null?void 0:f[e])==null?void 0:h[c])||a,x=v.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>v.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,sl(o,...t)]}function sl(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var ue=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},al=v[" useInsertionEffect ".trim().toString()]||ue;function _t({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=il({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=v.useRef(e!==void 0);v.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=v.useCallback(u=>{var d;if(a){const f=cl(u)?u(e):u;f!==e&&((d=i.current)==null||d.call(i,f))}else s(u)},[a,e,s,i]);return[c,l]}function il({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),o=v.useRef(n),s=v.useRef(t);return al(()=>{s.current=t},[t]),v.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function cl(e){return typeof e=="function"}var ll=v.createContext(void 0);function No(e){const t=v.useContext(ll);return e||t||"ltr"}function Ln(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function $n(e){const[t,n]=v.useState(void 0);return ue(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Oo(e){const t=e+"CollectionProvider",[n,r]=gt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:b,children:p}=h,y=E.useRef(null),w=E.useRef(new Map).current;return m.jsx(o,{scope:b,itemMap:w,collectionRef:y,children:p})};i.displayName=t;const a=e+"CollectionSlot",c=pt(a),l=E.forwardRef((h,b)=>{const{scope:p,children:y}=h,w=s(a,p),S=Z(b,w.collectionRef);return m.jsx(c,{ref:S,children:y})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=pt(u),g=E.forwardRef((h,b)=>{const{scope:p,children:y,...w}=h,S=E.useRef(null),C=Z(b,S),M=s(u,p);return E.useEffect(()=>(M.itemMap.set(S,{ref:S,...w}),()=>void M.itemMap.delete(S))),m.jsx(f,{[d]:"",ref:C,children:y})});g.displayName=u;function x(h){const b=s(e+"CollectionConsumer",h);return E.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((M,k)=>w.indexOf(M.ref.current)-w.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:l,ItemSlot:g},x,r]}var Po=["PageUp","PageDown"],Do=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],To={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},vt="Slider",[Vn,dl,ul]=Oo(vt),[Ao,mg]=gt(vt,[ul]),[fl,en]=Ao(vt),Wo=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:s=1,orientation:i="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:g=!1,form:x,...h}=e,b=v.useRef(new Set),p=v.useRef(0),w=i==="horizontal"?hl:ml,[S=[],C]=_t({prop:u,defaultProp:l,onChange:P=>{var I;(I=[...b.current][p.current])==null||I.focus(),d(P)}}),M=v.useRef(S);function k(P){const N=bl(S,P);W(P,N)}function O(P){W(P,p.current)}function _(){const P=M.current[p.current];S[p.current]!==P&&f(S)}function W(P,N,{commit:I}={commit:!1}){const z=Sl(s),Y=kl(Math.round((P-r)/s)*s+r,z),L=Jt(Y,[r,o]);C((H=[])=>{const D=vl(H,L,N);if(Cl(D,c*s)){p.current=D.indexOf(L);const B=String(D)!==String(H);return B&&I&&f(D),B?D:H}else return H})}return m.jsx(fl,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:o,valueIndexToChangeRef:p,thumbs:b.current,values:S,orientation:i,form:x,children:m.jsx(Vn.Provider,{scope:e.__scopeSlider,children:m.jsx(Vn.Slot,{scope:e.__scopeSlider,children:m.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...h,ref:t,onPointerDown:U(h.onPointerDown,()=>{a||(M.current=S)}),min:r,max:o,inverted:g,onSlideStart:a?void 0:k,onSlideMove:a?void 0:O,onSlideEnd:a?void 0:_,onHomeKeyDown:()=>!a&&W(r,0,{commit:!0}),onEndKeyDown:()=>!a&&W(o,S.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:N})=>{if(!a){const Y=Po.includes(P.key)||P.shiftKey&&Do.includes(P.key)?10:1,L=p.current,H=S[L],D=s*Y*N;W(H+D,L,{commit:!0})}}})})})})});Wo.displayName=vt;var[_o,Fo]=Ao(vt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),hl=v.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=v.useState(null),g=Z(t,w=>f(w)),x=v.useRef(void 0),h=No(o),b=h==="ltr",p=b&&!s||!b&&s;function y(w){const S=x.current||d.getBoundingClientRect(),C=[0,S.width],k=zn(C,p?[n,r]:[r,n]);return x.current=S,k(w-S.left)}return m.jsx(_o,{scope:e.__scopeSlider,startEdge:p?"left":"right",endEdge:p?"right":"left",direction:p?1:-1,size:"width",children:m.jsx(Io,{dir:h,"data-orientation":"horizontal",...u,ref:g,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=y(w.clientX);i==null||i(S)},onSlideMove:w=>{const S=y(w.clientX);a==null||a(S)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:w=>{const C=To[p?"from-left":"from-right"].includes(w.key);l==null||l({event:w,direction:C?-1:1})}})})}),ml=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onStepKeyDown:c,...l}=e,u=v.useRef(null),d=Z(t,u),f=v.useRef(void 0),g=!o;function x(h){const b=f.current||u.current.getBoundingClientRect(),p=[0,b.height],w=zn(p,g?[r,n]:[n,r]);return f.current=b,w(h-b.top)}return m.jsx(_o,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:m.jsx(Io,{"data-orientation":"vertical",...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const b=x(h.clientY);s==null||s(b)},onSlideMove:h=>{const b=x(h.clientY);i==null||i(b)},onSlideEnd:()=>{f.current=void 0,a==null||a()},onStepKeyDown:h=>{const p=To[g?"from-bottom":"from-top"].includes(h.key);c==null||c({event:h,direction:p?-1:1})}})})}),Io=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:a,onStepKeyDown:c,...l}=e,u=en(vt,n);return m.jsx(q.span,{...l,ref:t,onKeyDown:U(e.onKeyDown,d=>{d.key==="Home"?(i(d),d.preventDefault()):d.key==="End"?(a(d),d.preventDefault()):Po.concat(Do).includes(d.key)&&(c(d),d.preventDefault())}),onPointerDown:U(e.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:U(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:U(e.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),s(d))})})}),Bo="SliderTrack",Lo=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=en(Bo,n);return m.jsx(q.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});Lo.displayName=Bo;var Hn="SliderRange",$o=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=en(Hn,n),s=Fo(Hn,n),i=v.useRef(null),a=Z(t,i),c=o.values.length,l=o.values.map(f=>Yo(f,o.min,o.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return m.jsx(q.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...e.style,[s.startEdge]:u+"%",[s.endEdge]:d+"%"}})});$o.displayName=Hn;var Yn="SliderThumb",Vo=v.forwardRef((e,t)=>{const n=dl(e.__scopeSlider),[r,o]=v.useState(null),s=Z(t,a=>o(a)),i=v.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return m.jsx(pl,{...e,ref:s,index:i})}),pl=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...s}=e,i=en(Yn,n),a=Fo(Yn,n),[c,l]=v.useState(null),u=Z(t,y=>l(y)),d=c?i.form||!!c.closest("form"):!0,f=$n(c),g=i.values[r],x=g===void 0?0:Yo(g,i.min,i.max),h=yl(r,i.values.length),b=f==null?void 0:f[a.size],p=b?wl(b,x,a.direction):0;return v.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]),m.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${x}% + ${p}px)`},children:[m.jsx(Vn.ItemSlot,{scope:e.__scopeSlider,children:m.jsx(q.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":i.min,"aria-valuenow":g,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:u,style:g===void 0?{display:"none"}:e.style,onFocus:U(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),d&&m.jsx(Ho,{name:o??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:g},r)]})});Vo.displayName=Yn;var gl="RadioBubbleInput",Ho=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=v.useRef(null),s=Z(o,r),i=Ln(t);return v.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("input",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),m.jsx(q.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});Ho.displayName=gl;function vl(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,s)=>o-s)}function Yo(e,t,n){const s=100/(n-t)*(e-t);return Jt(s,[0,100])}function yl(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function bl(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function wl(e,t,n){const r=e/2,s=zn([0,50],[0,r]);return(r-s(t)*n)*n}function xl(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Cl(e,t){if(t>0){const n=xl(e);return Math.min(...n)>=t}return!0}function zn(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Sl(e){return(String(e).split(".")[1]||"").length}function kl(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var zo=Wo,El=Lo,Ml=$o,Nl=Vo;const jo=v.forwardRef(({className:e,...t},n)=>m.jsxs(zo,{ref:n,className:F("relative flex w-full touch-none select-none items-center",e),...t,children:[m.jsx(El,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:m.jsx(Ml,{className:"absolute h-full bg-primary"})}),m.jsx(Nl,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));jo.displayName=zo.displayName;const Ro=({id:e,value:t,required:n,disabled:r,readonly:o,label:s,onChange:i,onBlur:a,schema:c})=>{const l=c.minimum||0,u=c.maximum||100,d=c.multipleOf||1,f=ie(e,c),g=async x=>{const h=x[0];i(h),a&&a(e,h),await f.onChange(h)};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs(pe,{htmlFor:e,children:[s||c.title,n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx("span",{className:"text-sm font-medium tabular-nums",children:t||l})]}),m.jsx(jo,{id:e,min:l,max:u,step:d,value:[t||l],onValueChange:g,disabled:r||o,className:"w-full"})]})},Uo=({id:e,value:t,required:n,disabled:r,readonly:o,label:s,onChange:i,options:a,schema:c})=>{const l=Number(a.max||c.maximum||5),u=Array.from({length:l},(g,x)=>x+1),d=ie(e,c),f=async g=>{!r&&!o&&(i(g),await d.onChange(g))};return m.jsxs("div",{className:"space-y-2",children:[m.jsxs(pe,{htmlFor:e,children:[s||c.title,n&&m.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.jsx("div",{className:"flex items-center gap-1",role:"radiogroup","aria-labelledby":e,children:u.map(g=>m.jsx($e,{type:"button",variant:"ghost",size:"icon",className:F("h-8 w-8 p-0 hover:bg-transparent",r||o?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:()=>f(g),disabled:r||o,"aria-label":`Rate ${g} out of ${l}`,role:"radio","aria-checked":g===t,children:m.jsx(nl,{className:F("h-5 w-5 transition-colors",g<=(t||0)?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})},g))})]})},qo=v.forwardRef(({className:e,...t},n)=>m.jsx("textarea",{className:F("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));qo.displayName="Textarea";function st(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ol(e,t=globalThis==null?void 0:globalThis.document){const n=st(e);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Pl="DismissableLayer",jn="dismissableLayer.update",Dl="dismissableLayer.pointerDownOutside",Tl="dismissableLayer.focusOutside",Go,Ko=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rn=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=v.useContext(Ko),[u,d]=v.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=v.useState({}),x=Z(t,k=>d(k)),h=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=h.indexOf(b),y=u?h.indexOf(u):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,S=y>=p,C=_l(k=>{const O=k.target,_=[...l.branches].some(W=>W.contains(O));!S||_||(o==null||o(k),i==null||i(k),k.defaultPrevented||a==null||a())},f),M=Fl(k=>{const O=k.target;[...l.branches].some(W=>W.contains(O))||(s==null||s(k),i==null||i(k),k.defaultPrevented||a==null||a())},f);return Ol(k=>{y===l.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),v.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Go=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Xo(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Go)}},[u,f,n,l]),v.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Xo())},[u,l]),v.useEffect(()=>{const k=()=>g({});return document.addEventListener(jn,k),()=>document.removeEventListener(jn,k)},[]),m.jsx(q.div,{...c,ref:x,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,M.onFocusCapture),onBlurCapture:U(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,C.onPointerDownCapture)})});Rn.displayName=Pl;var Al="DismissableLayerBranch",Wl=v.forwardRef((e,t)=>{const n=v.useContext(Ko),r=v.useRef(null),o=Z(t,r);return v.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),m.jsx(q.div,{...e,ref:o})});Wl.displayName=Al;function _l(e,t=globalThis==null?void 0:globalThis.document){const n=st(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Qo(Dl,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Fl(e,t=globalThis==null?void 0:globalThis.document){const n=st(e),r=v.useRef(!1);return v.useEffect(()=>{const o=s=>{s.target&&!r.current&&Qo(Tl,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Xo(){const e=new CustomEvent(jn);document.dispatchEvent(e)}function Qo(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?jc(o,s):o.dispatchEvent(s)}var Un=0;function Zo(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jo()),document.body.insertAdjacentElement("beforeend",e[1]??Jo()),Un++,()=>{Un===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Un--}},[])}function Jo(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qn="focusScope.autoFocusOnMount",Gn="focusScope.autoFocusOnUnmount",es={bubbles:!1,cancelable:!0},Il="FocusScope",Kn=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=v.useState(null),l=st(o),u=st(s),d=v.useRef(null),f=Z(t,h=>c(h)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let h=function(w){if(g.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:Ke(d.current,{select:!0})},b=function(w){if(g.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Ke(d.current,{select:!0}))},p=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Ke(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const y=new MutationObserver(p);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),y.disconnect()}}},[r,a,g.paused]),v.useEffect(()=>{if(a){rs.add(g);const h=document.activeElement;if(!a.contains(h)){const p=new CustomEvent(qn,es);a.addEventListener(qn,l),a.dispatchEvent(p),p.defaultPrevented||(Bl(Yl(ts(a)),{select:!0}),document.activeElement===h&&Ke(a))}return()=>{a.removeEventListener(qn,l),setTimeout(()=>{const p=new CustomEvent(Gn,es);a.addEventListener(Gn,u),a.dispatchEvent(p),p.defaultPrevented||Ke(h??document.body,{select:!0}),a.removeEventListener(Gn,u),rs.remove(g)},0)}}},[a,l,u,g]);const x=v.useCallback(h=>{if(!n&&!r||g.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,p=document.activeElement;if(b&&p){const y=h.currentTarget,[w,S]=Ll(y);w&&S?!h.shiftKey&&p===S?(h.preventDefault(),n&&Ke(w,{select:!0})):h.shiftKey&&p===w&&(h.preventDefault(),n&&Ke(S,{select:!0})):p===y&&h.preventDefault()}},[n,r,g.paused]);return m.jsx(q.div,{tabIndex:-1,...i,ref:f,onKeyDown:x})});Kn.displayName=Il;function Bl(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ke(r,{select:t}),document.activeElement!==n)return}function Ll(e){const t=ts(e),n=ns(t,e),r=ns(t.reverse(),e);return[n,r]}function ts(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ns(e,t){for(const n of e)if(!$l(n,{upTo:t}))return n}function $l(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Vl(e){return e instanceof HTMLInputElement&&"select"in e}function Ke(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vl(e)&&t&&e.select()}}var rs=Hl();function Hl(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=os(e,t),e.unshift(t)},remove(t){var n;e=os(e,t),(n=e[0])==null||n.resume()}}}function os(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Yl(e){return e.filter(t=>t.tagName!=="A")}var zl=v[" useId ".trim().toString()]||(()=>{}),jl=0;function tn(e){const[t,n]=v.useState(zl());return ue(()=>{n(r=>r??String(jl++))},[e]),t?`radix-${t}`:""}const Rl=["top","right","bottom","left"],Xe=Math.min,ge=Math.max,nn=Math.round,rn=Math.floor,De=e=>({x:e,y:e}),Ul={left:"right",right:"left",bottom:"top",top:"bottom"},ql={start:"end",end:"start"};function Xn(e,t,n){return ge(e,Xe(t,n))}function Ve(e,t){return typeof e=="function"?e(t):e}function He(e){return e.split("-")[0]}function yt(e){return e.split("-")[1]}function Qn(e){return e==="x"?"y":"x"}function Zn(e){return e==="y"?"height":"width"}function Ye(e){return["top","bottom"].includes(He(e))?"y":"x"}function Jn(e){return Qn(Ye(e))}function Gl(e,t,n){n===void 0&&(n=!1);const r=yt(e),o=Jn(e),s=Zn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=on(i)),[i,on(i)]}function Kl(e){const t=on(e);return[er(e),t,er(t)]}function er(e){return e.replace(/start|end/g,t=>ql[t])}function Xl(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function Ql(e,t,n,r){const o=yt(e);let s=Xl(He(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(er)))),s}function on(e){return e.replace(/left|right|bottom|top/g,t=>Ul[t])}function Zl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ss(e){return typeof e!="number"?Zl(e):{top:e,right:e,bottom:e,left:e}}function sn(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 as(e,t,n){let{reference:r,floating:o}=e;const s=Ye(t),i=Jn(t),a=Zn(i),c=He(t),l=s==="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(yt(t)){case"start":g[i]-=f*(n&&l?-1:1);break;case"end":g[i]+=f*(n&&l?-1:1);break}return g}const Jl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=as(l,r,c),f=r,g={},x=0;for(let h=0;h<a.length;h++){const{name:b,fn:p}=a[h],{x:y,y:w,data:S,reset:C}=await p({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:g,rects:l,platform:i,elements:{reference:e,floating:t}});u=y??u,d=w??d,g={...g,[b]:{...g[b],...S}},C&&x<=50&&(x++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=as(l,f,c)),h=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:g}};async function Ft(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=Ve(t,e),x=ss(g),b=a[f?d==="floating"?"reference":"floating":d],p=sn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=sn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:c}):y);return{top:(p.top-C.top+x.top)/S.y,bottom:(C.bottom-p.bottom+x.bottom)/S.y,left:(p.left-C.left+x.left)/S.x,right:(C.right-p.right+x.right)/S.x}}const ed=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Ve(e,t)||{};if(l==null)return{};const d=ss(u),f={x:n,y:r},g=Jn(o),x=Zn(g),h=await i.getDimensions(l),b=g==="y",p=b?"top":"left",y=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=s.reference[x]+s.reference[g]-f[g]-s.floating[x],C=f[g]-s.reference[g],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let k=M?M[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(M)))&&(k=a.floating[w]||s.floating[x]);const O=S/2-C/2,_=k/2-h[x]/2-1,W=Xe(d[p],_),P=Xe(d[y],_),N=W,I=k-h[x]-P,z=k/2-h[x]/2+O,Y=Xn(N,z,I),L=!c.arrow&&yt(o)!=null&&z!==Y&&s.reference[x]/2-(z<N?W:P)-h[x]/2<0,H=L?z<N?z-N:z-I:0;return{[g]:f[g]+H,data:{[g]:Y,centerOffset:z-Y-H,...L&&{alignmentOffset:H}},reset:L}}}),td=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...b}=Ve(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=He(o),y=Ye(a),w=He(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=f||(w||!h?[on(a)]:Kl(a)),M=x!=="none";!f&&M&&C.push(...Ql(a,h,x,S));const k=[a,...C],O=await Ft(t,b),_=[];let W=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&_.push(O[p]),d){const Y=Gl(o,i,S);_.push(O[Y[0]],O[Y[1]])}if(W=[...W,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var P,N;const Y=(((P=s.flip)==null?void 0:P.index)||0)+1,L=k[Y];if(L){var I;const D=d==="alignment"?y!==Ye(L):!1,B=((I=W[0])==null?void 0:I.overflows[0])>0;if(!D||B)return{data:{index:Y,overflows:W},reset:{placement:L}}}let H=(N=W.filter(D=>D.overflows[0]<=0).sort((D,B)=>D.overflows[1]-B.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(g){case"bestFit":{var z;const D=(z=W.filter(B=>{if(M){const R=Ye(B.placement);return R===y||R==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(R=>R>0).reduce((R,oe)=>R+oe,0)]).sort((B,R)=>B[1]-R[1])[0])==null?void 0:z[0];D&&(H=D);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function is(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cs(e){return Rl.some(t=>e[t]>=0)}const nd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ve(e,t);switch(r){case"referenceHidden":{const s=await Ft(t,{...o,elementContext:"reference"}),i=is(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:cs(i)}}}case"escaped":{const s=await Ft(t,{...o,altBoundary:!0}),i=is(s,n.floating);return{data:{escapedOffsets:i,escaped:cs(i)}}}default:return{}}}}};async function rd(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=He(n),a=yt(n),c=Ye(n)==="y",l=["left","top"].includes(i)?-1:1,u=s&&c?-1:1,d=Ve(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),c?{x:g*u,y:f*l}:{x:f*l,y:g*u}}const od=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await rd(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},sd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:p,y}=b;return{x:p,y}}},...c}=Ve(e,t),l={x:n,y:r},u=await Ft(t,c),d=Ye(He(o)),f=Qn(d);let g=l[f],x=l[d];if(s){const b=f==="y"?"top":"left",p=f==="y"?"bottom":"right",y=g+u[b],w=g-u[p];g=Xn(y,g,w)}if(i){const b=d==="y"?"top":"left",p=d==="y"?"bottom":"right",y=x+u[b],w=x-u[p];x=Xn(y,x,w)}const h=a.fn({...t,[f]:g,[d]:x});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:s,[d]:i}}}}}},ad=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Ve(e,t),u={x:n,y:r},d=Ye(o),f=Qn(d);let g=u[f],x=u[d];const h=Ve(a,t),b=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const w=f==="y"?"height":"width",S=s.reference[f]-s.floating[w]+b.mainAxis,C=s.reference[f]+s.reference[w]-b.mainAxis;g<S?g=S:g>C&&(g=C)}if(l){var p,y;const w=f==="y"?"width":"height",S=["top","left"].includes(He(o)),C=s.reference[d]-s.floating[w]+(S&&((p=i.offset)==null?void 0:p[d])||0)+(S?0:b.crossAxis),M=s.reference[d]+s.reference[w]+(S?0:((y=i.offset)==null?void 0:y[d])||0)-(S?b.crossAxis:0);x<C?x=C:x>M&&(x=M)}return{[f]:g,[d]:x}}}},id=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Ve(e,t),u=await Ft(t,l),d=He(o),f=yt(o),g=Ye(o)==="y",{width:x,height:h}=s.floating;let b,p;d==="top"||d==="bottom"?(b=d,p=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,b=f==="end"?"top":"bottom");const y=h-u.top-u.bottom,w=x-u.left-u.right,S=Xe(h-u[b],y),C=Xe(x-u[p],w),M=!t.middlewareData.shift;let k=S,O=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=y),M&&!f){const W=ge(u.left,0),P=ge(u.right,0),N=ge(u.top,0),I=ge(u.bottom,0);g?O=x-2*(W!==0||P!==0?W+P:ge(u.left,u.right)):k=h-2*(N!==0||I!==0?N+I:ge(u.top,u.bottom))}await c({...t,availableWidth:O,availableHeight:k});const _=await i.getDimensions(a.floating);return x!==_.width||h!==_.height?{reset:{rects:!0}}:{}}}};function an(){return typeof window<"u"}function bt(e){return ls(e)?(e.nodeName||"").toLowerCase():"#document"}function ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Te(e){var t;return(t=(ls(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ls(e){return an()?e instanceof Node||e instanceof ve(e).Node:!1}function Ce(e){return an()?e instanceof Element||e instanceof ve(e).Element:!1}function Ae(e){return an()?e instanceof HTMLElement||e instanceof ve(e).HTMLElement:!1}function ds(e){return!an()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ve(e).ShadowRoot}function It(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function cd(e){return["table","td","th"].includes(bt(e))}function cn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function tr(e){const t=nr(),n=Ce(e)?Se(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 ld(e){let t=Qe(e);for(;Ae(t)&&!wt(t);){if(tr(t))return t;if(cn(t))return null;t=Qe(t)}return null}function nr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wt(e){return["html","body","#document"].includes(bt(e))}function Se(e){return ve(e).getComputedStyle(e)}function ln(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qe(e){if(bt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ds(e)&&e.host||Te(e);return ds(t)?t.host:t}function us(e){const t=Qe(e);return wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ae(t)&&It(t)?t:us(t)}function Bt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=us(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ve(o);if(s){const a=rr(i);return t.concat(i,i.visualViewport||[],It(o)?o:[],a&&n?Bt(a):[])}return t.concat(o,Bt(o,[],n))}function rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fs(e){const t=Se(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ae(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=nn(n)!==s||nn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function or(e){return Ce(e)?e:e.contextElement}function xt(e){const t=or(e);if(!Ae(t))return De(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=fs(t);let i=(s?nn(n.width):n.width)/r,a=(s?nn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const dd=De(0);function hs(e){const t=ve(e);return!nr()||!t.visualViewport?dd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ud(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ve(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=or(e);let i=De(1);t&&(r?Ce(r)&&(i=xt(r)):i=xt(e));const a=ud(s,n,r)?hs(s):De(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=ve(s),g=r&&Ce(r)?ve(r):r;let x=f,h=rr(x);for(;h&&r&&g!==x;){const b=xt(h),p=h.getBoundingClientRect(),y=Se(h),w=p.left+(h.clientLeft+parseFloat(y.paddingLeft))*b.x,S=p.top+(h.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,l*=b.y,u*=b.x,d*=b.y,c+=w,l+=S,x=ve(h),h=rr(x)}}return sn({width:u,height:d,x:c,y:l})}function sr(e,t){const n=ln(e).scrollLeft;return t?t.left+n:at(Te(e)).left+n}function ms(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:sr(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function fd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Te(r),a=t?cn(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=De(1);const u=De(0),d=Ae(r);if((d||!d&&!s)&&((bt(r)!=="body"||It(i))&&(c=ln(r)),Ae(r))){const g=at(r);l=xt(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=i&&!d&&!s?ms(i,c,!0):De(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 hd(e){return Array.from(e.getClientRects())}function md(e){const t=Te(e),n=ln(e),r=e.ownerDocument.body,o=ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+sr(e);const a=-n.scrollTop;return Se(r).direction==="rtl"&&(i+=ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function pd(e,t){const n=ve(e),r=Te(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=nr();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}function gd(e,t){const n=at(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ae(e)?xt(e):De(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function ps(e,t,n){let r;if(t==="viewport")r=pd(e,n);else if(t==="document")r=md(Te(e));else if(Ce(t))r=gd(t,n);else{const o=hs(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return sn(r)}function gs(e,t){const n=Qe(e);return n===t||!Ce(n)||wt(n)?!1:Se(n).position==="fixed"||gs(n,t)}function vd(e,t){const n=t.get(e);if(n)return n;let r=Bt(e,[],!1).filter(a=>Ce(a)&&bt(a)!=="body"),o=null;const s=Se(e).position==="fixed";let i=s?Qe(e):e;for(;Ce(i)&&!wt(i);){const a=Se(i),c=tr(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||It(i)&&!c&&gs(e,i))?r=r.filter(u=>u!==i):o=a,i=Qe(i)}return t.set(e,r),r}function yd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?cn(t)?[]:vd(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=ps(t,u,o);return l.top=ge(d.top,l.top),l.right=Xe(d.right,l.right),l.bottom=Xe(d.bottom,l.bottom),l.left=ge(d.left,l.left),l},ps(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function bd(e){const{width:t,height:n}=fs(e);return{width:t,height:n}}function wd(e,t,n){const r=Ae(t),o=Te(t),s=n==="fixed",i=at(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=De(0);function l(){c.x=sr(o)}if(r||!r&&!s)if((bt(t)!=="body"||It(o))&&(a=ln(t)),r){const g=at(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?ms(o,a):De(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function ar(e){return Se(e).position==="static"}function vs(e,t){if(!Ae(e)||Se(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Te(e)===n&&(n=n.ownerDocument.body),n}function ys(e,t){const n=ve(e);if(cn(e))return n;if(!Ae(e)){let o=Qe(e);for(;o&&!wt(o);){if(Ce(o)&&!ar(o))return o;o=Qe(o)}return n}let r=vs(e,t);for(;r&&cd(r)&&ar(r);)r=vs(r,t);return r&&wt(r)&&ar(r)&&!tr(r)?n:r||ld(e)||n}const xd=async function(e){const t=this.getOffsetParent||ys,n=this.getDimensions,r=await n(e.floating);return{reference:wd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cd(e){return Se(e).direction==="rtl"}const Sd={convertOffsetParentRelativeRectToViewportRelativeRect:fd,getDocumentElement:Te,getClippingRect:yd,getOffsetParent:ys,getElementRects:xd,getClientRects:hd,getDimensions:bd,getScale:xt,isElement:Ce,isRTL:Cd};function bs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kd(e,t){let n=null,r;const o=Te(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:g}=l;if(a||t(),!f||!g)return;const x=rn(d),h=rn(o.clientWidth-(u+f)),b=rn(o.clientHeight-(d+g)),p=rn(u),w={rootMargin:-x+"px "+-h+"px "+-b+"px "+-p+"px",threshold:ge(0,Xe(1,c))||1};let S=!0;function C(M){const k=M[0].intersectionRatio;if(k!==c){if(!S)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!bs(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function Ed(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=or(e),u=o||s?[...l?Bt(l):[],...Bt(t)]:[];u.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=l&&a?kd(l,n):null;let f=-1,g=null;i&&(g=new ResizeObserver(p=>{let[y]=p;y&&y.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),l&&!c&&g.observe(l),g.observe(t));let x,h=c?at(e):null;c&&b();function b(){const p=at(e);h&&!bs(h,p)&&n(),h=p,x=requestAnimationFrame(b)}return n(),()=>{var p;u.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(p=g)==null||p.disconnect(),g=null,c&&cancelAnimationFrame(x)}}const Md=od,Nd=sd,Od=td,Pd=id,Dd=nd,ws=ed,Td=ad,Ad=(e,t,n)=>{const r=new Map,o={platform:Sd,...n},s={...o.platform,_c:r};return Jl(e,t,{...o,platform:s})};var dn=typeof document<"u"?E.useLayoutEffect:E.useEffect;function un(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!un(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!un(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cs(e,t){const n=xs(e);return Math.round(t*n)/n}function ir(e){const t=v.useRef(e);return dn(()=>{t.current=e}),t}function Wd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=v.useState(r);un(f,r)||g(r);const[x,h]=v.useState(null),[b,p]=v.useState(null),y=v.useCallback(D=>{D!==M.current&&(M.current=D,h(D))},[]),w=v.useCallback(D=>{D!==k.current&&(k.current=D,p(D))},[]),S=s||x,C=i||b,M=v.useRef(null),k=v.useRef(null),O=v.useRef(u),_=c!=null,W=ir(c),P=ir(o),N=ir(l),I=v.useCallback(()=>{if(!M.current||!k.current)return;const D={placement:t,strategy:n,middleware:f};P.current&&(D.platform=P.current),Ad(M.current,k.current,D).then(B=>{const R={...B,isPositioned:N.current!==!1};z.current&&!un(O.current,R)&&(O.current=R,Xt.flushSync(()=>{d(R)}))})},[f,t,n,P,N]);dn(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(D=>({...D,isPositioned:!1})))},[l]);const z=v.useRef(!1);dn(()=>(z.current=!0,()=>{z.current=!1}),[]),dn(()=>{if(S&&(M.current=S),C&&(k.current=C),S&&C){if(W.current)return W.current(S,C,I);I()}},[S,C,I,W,_]);const Y=v.useMemo(()=>({reference:M,floating:k,setReference:y,setFloating:w}),[y,w]),L=v.useMemo(()=>({reference:S,floating:C}),[S,C]),H=v.useMemo(()=>{const D={position:n,left:0,top:0};if(!L.floating)return D;const B=Cs(L.floating,u.x),R=Cs(L.floating,u.y);return a?{...D,transform:"translate("+B+"px, "+R+"px)",...xs(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:R}},[n,a,L.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:I,refs:Y,elements:L,floatingStyles:H}),[u,I,Y,L,H])}const _d=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ws({element:r.current,padding:o}).fn(n):{}:r?ws({element:r,padding:o}).fn(n):{}}}},Fd=(e,t)=>({...Md(e),options:[e,t]}),Id=(e,t)=>({...Nd(e),options:[e,t]}),Bd=(e,t)=>({...Td(e),options:[e,t]}),Ld=(e,t)=>({...Od(e),options:[e,t]}),$d=(e,t)=>({...Pd(e),options:[e,t]}),Vd=(e,t)=>({...Dd(e),options:[e,t]}),Hd=(e,t)=>({..._d(e),options:[e,t]});var Yd="Arrow",Ss=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return m.jsx(q.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ss.displayName=Yd;var zd=Ss,cr="Popper",[ks,fn]=gt(cr),[jd,Es]=ks(cr),Ms=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.useState(null);return m.jsx(jd,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ms.displayName=cr;var Ns="PopperAnchor",Os=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Es(Ns,n),i=v.useRef(null),a=Z(t,i);return v.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:m.jsx(q.div,{...o,ref:a})});Os.displayName=Ns;var lr="PopperContent",[Rd,Ud]=ks(lr),Ps=v.forwardRef((e,t)=>{var $,ee,ce,te,G,K;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:x,...h}=e,b=Es(lr,n),[p,y]=v.useState(null),w=Z(t,me=>y(me)),[S,C]=v.useState(null),M=$n(S),k=(M==null?void 0:M.width)??0,O=(M==null?void 0:M.height)??0,_=r+(s!=="center"?"-"+s:""),W=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(l)?l:[l],N=P.length>0,I={padding:W,boundary:P.filter(Gd),altBoundary:N},{refs:z,floatingStyles:Y,placement:L,isPositioned:H,middlewareData:D}=Wd({strategy:"fixed",placement:_,whileElementsMounted:(...me)=>Ed(...me,{animationFrame:g==="always"}),elements:{reference:b.anchor},middleware:[Fd({mainAxis:o+O,alignmentAxis:i}),c&&Id({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Bd():void 0,...I}),c&&Ld({...I}),$d({...I,apply:({elements:me,rects:we,availableWidth:dt,availableHeight:ut})=>{const{width:ft,height:Hr}=we.reference,Tt=me.floating.style;Tt.setProperty("--radix-popper-available-width",`${dt}px`),Tt.setProperty("--radix-popper-available-height",`${ut}px`),Tt.setProperty("--radix-popper-anchor-width",`${ft}px`),Tt.setProperty("--radix-popper-anchor-height",`${Hr}px`)}}),S&&Hd({element:S,padding:a}),Kd({arrowWidth:k,arrowHeight:O}),f&&Vd({strategy:"referenceHidden",...I})]}),[B,R]=As(L),oe=st(x);ue(()=>{H&&(oe==null||oe())},[H,oe]);const Me=($=D.arrow)==null?void 0:$.x,Ne=(ee=D.arrow)==null?void 0:ee.y,be=((ce=D.arrow)==null?void 0:ce.centerOffset)!==0,[Ue,xe]=v.useState();return ue(()=>{p&&xe(window.getComputedStyle(p).zIndex)},[p]),m.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ue,"--radix-popper-transform-origin":[(te=D.transformOrigin)==null?void 0:te.x,(G=D.transformOrigin)==null?void 0:G.y].join(" "),...((K=D.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Rd,{scope:n,placedSide:B,onArrowChange:C,arrowX:Me,arrowY:Ne,shouldHideArrow:be,children:m.jsx(q.div,{"data-side":B,"data-align":R,...h,ref:w,style:{...h.style,animation:H?void 0:"none"}})})})});Ps.displayName=lr;var Ds="PopperArrow",qd={top:"bottom",right:"left",bottom:"top",left:"right"},Ts=v.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ud(Ds,r),i=qd[s.placedSide];return m.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:m.jsx(zd,{...o,ref:n,style:{...o.style,display:"block"}})})});Ts.displayName=Ds;function Gd(e){return e!==null}var Kd=e=>({name:"transformOrigin",options:e,fn(t){var b,p,y;const{placement:n,rects:r,middlewareData:o}=t,i=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=As(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((p=o.arrow)==null?void 0:p.x)??0)+a/2,g=(((y=o.arrow)==null?void 0:y.y)??0)+c/2;let x="",h="";return l==="bottom"?(x=i?d:`${f}px`,h=`${-c}px`):l==="top"?(x=i?d:`${f}px`,h=`${r.floating.height+c}px`):l==="right"?(x=`${-c}px`,h=i?d:`${g}px`):l==="left"&&(x=`${r.floating.width+c}px`,h=i?d:`${g}px`),{data:{x,y:h}}}});function As(e){const[t,n="center"]=e.split("-");return[t,n]}var Ws=Ms,dr=Os,_s=Ps,Fs=Ts,Xd="Portal",ur=v.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=v.useState(!1);ue(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Ur.createPortal(m.jsx(q.div,{...r,ref:t}),i):null});ur.displayName=Xd;var Is=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Qd="VisuallyHidden",Zd=v.forwardRef((e,t)=>m.jsx(q.span,{...e,ref:t,style:{...Is,...e.style}}));Zd.displayName=Qd;var Jd=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ct=new WeakMap,hn=new WeakMap,mn={},fr=0,Bs=function(e){return e&&(e.host||Bs(e.parentNode))},eu=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Bs(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},tu=function(e,t,n,r){var o=eu(t,Array.isArray(e)?e:[e]);mn[n]||(mn[n]=new WeakMap);var s=mn[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var g=f.getAttribute(r),x=g!==null&&g!=="false",h=(Ct.get(f)||0)+1,b=(s.get(f)||0)+1;Ct.set(f,h),s.set(f,b),i.push(f),h===1&&x&&hn.set(f,!0),b===1&&f.setAttribute(n,"true"),x||f.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return u(t),a.clear(),fr++,function(){i.forEach(function(d){var f=Ct.get(d)-1,g=s.get(d)-1;Ct.set(d,f),s.set(d,g),f||(hn.has(d)||d.removeAttribute(r),hn.delete(d)),g||d.removeAttribute(n)}),fr--,fr||(Ct=new WeakMap,Ct=new WeakMap,hn=new WeakMap,mn={})}},Ls=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Jd(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),tu(r,o,n,"aria-hidden")):function(){return null}},We=function(){return We=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},We.apply(this,arguments)};function $s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function nu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var pn="right-scroll-bar-position",gn="width-before-scroll-bar",ru="with-scroll-bars-hidden",ou="--removed-body-scroll-bar-size";function hr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function su(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var au=typeof window<"u"?v.useLayoutEffect:v.useEffect,Vs=new WeakMap;function iu(e,t){var n=su(null,function(r){return e.forEach(function(o){return hr(o,r)})});return au(function(){var r=Vs.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||hr(a,null)}),s.forEach(function(a){o.has(a)||hr(a,i)})}Vs.set(n,e)},[e]),n}function cu(e){return e}function lu(e,t){t===void 0&&(t=cu);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function du(e){e===void 0&&(e={});var t=lu(null);return t.options=We({async:!0,ssr:!1},e),t}var Hs=function(e){var t=e.sideCar,n=$s(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,We({},n))};Hs.isSideCarExport=!0;function uu(e,t){return e.useMedium(t),Hs}var Ys=du(),mr=function(){},vn=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:mr,onWheelCapture:mr,onTouchMoveCapture:mr}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,g=e.noRelative,x=e.noIsolation,h=e.inert,b=e.allowPinchZoom,p=e.as,y=p===void 0?"div":p,w=e.gapMode,S=$s(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,M=iu([n,t]),k=We(We({},S),o);return v.createElement(v.Fragment,null,u&&v.createElement(C,{sideCar:Ys,removeScrollBar:l,shards:d,noRelative:g,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:w}),i?v.cloneElement(v.Children.only(a),We(We({},k),{ref:M})):v.createElement(y,We({},k,{className:c,ref:M}),a))});vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vn.classNames={fullWidth:gn,zeroRight:pn};var fu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fu();return t&&e.setAttribute("nonce",t),e}function mu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hu())&&(mu(t,n),pu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vu=function(){var e=gu();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},zs=function(){var e=vu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},yu={left:0,top:0,right:0,gap:0},pr=function(e){return parseInt(e||"",10)||0},bu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[pr(n),pr(r),pr(o)]},wu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yu;var t=bu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xu=zs(),St="data-scroll-locked",Cu=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
62
|
-
.`.concat(
|
|
63
|
-
overflow: hidden `).concat(
|
|
64
|
-
padding-right: `).concat(
|
|
61
|
+
*/const gn=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vi=e=>{const{canAdd:t,disabled:r,idSchema:n,uiSchema:o,items:i,onAddClick:a,readonly:s,registry:c,required:l,schema:d,title:u}=e,h=Er.getUiOptions(o),p=Er.getTemplate("ArrayFieldDescriptionTemplate",c,h),x=Er.getTemplate("ArrayFieldItemTemplate",c,h),f=Er.getTemplate("ArrayFieldTitleTemplate",c,h);return w.jsx("div",{className:J("rjsf-array-field",h.classNames),children:w.jsxs(Sr,{className:"border-slate-200",children:[(u||h.title)&&w.jsxs(hn,{className:"pb-3",children:[w.jsx(f,{idSchema:n,title:h.title||u,required:l,schema:d,uiSchema:o,registry:c}),(h.description||d.description)&&w.jsx(p,{idSchema:n,description:h.description||d.description,schema:d,uiSchema:o,registry:c})]}),w.jsxs(Or,{className:"space-y-3",children:[i&&i.map(({key:v,...g})=>w.jsx(x,{...g},v)),t&&w.jsxs(Ze,{type:"button",onClick:a,disabled:r||s,size:"sm",variant:"outline",className:"w-full border-dashed",children:[w.jsx(mu,{className:"h-4 w-4 mr-2"}),"Add ",u||"Item"]})]})]})})},yi=e=>{const{children:t,disabled:r,hasToolbar:n,buttonsProps:o,readonly:i}=e,{hasMoveDown:a,hasMoveUp:s,hasRemove:c,index:l,onDropIndexClick:d,onReorderClick:u}=o;return w.jsx(Sr,{className:"relative border-slate-200",children:w.jsxs(Or,{className:"p-4",children:[n&&w.jsxs("div",{className:"absolute right-2 top-2 flex items-center gap-1",children:[(s||a)&&w.jsx("div",{className:"flex items-center mr-2",children:w.jsx(pu,{className:"h-4 w-4 text-slate-400"})}),s&&w.jsx(Ze,{type:"button",size:"sm",variant:"ghost",disabled:r||i,onClick:u(l,l-1),className:"h-8 w-8 p-0",title:"Move up",children:w.jsx(gi,{className:"h-4 w-4"})}),a&&w.jsx(Ze,{type:"button",size:"sm",variant:"ghost",disabled:r||i,onClick:u(l,l+1),className:"h-8 w-8 p-0",title:"Move down",children:w.jsx(mn,{className:"h-4 w-4"})}),c&&w.jsx(Ze,{type:"button",size:"sm",variant:"ghost",disabled:r||i,onClick:d(l),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Remove",children:w.jsx(gn,{className:"h-4 w-4"})})]}),w.jsx("div",{className:J(n&&"pr-24"),children:t})]})})},bi={address:li,phone:hi,currency:pi},wi={ArrayFieldTemplate:vi,ArrayFieldItemTemplate:yi},xi=({id:e,value:t,required:r,disabled:n,readonly:o,label:i,onChange:a,onBlur:s,onFocus:c,schema:l})=>{const d=ve(e,l),u=async x=>{const f=x.target.value;a(f),await d.onChange(f)},h=async x=>{const f=x.target.value;s&&s(e,f),await d.onBlur(f)},p=async x=>{const f=x.target.value;c&&c(e,f),await d.onFocus(f)};return w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:e,children:[i||l.title,r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:e,type:"color",value:t||"#000000",required:r,disabled:n||o,onChange:u,onBlur:h,onFocus:p,className:"h-10 w-full cursor-pointer"})]})},vu=({id:e,value:t,required:r,disabled:n,readonly:o,label:i,onChange:a,onBlur:s,onFocus:c,options:l,schema:d})=>{const u=l.inputType||"date",h=ve(e,d),p=async v=>{const g=v.target.value;a(g),await h.onChange(g)},x=async v=>{const g=v.target.value;s&&s(e,g),await h.onBlur(g)},f=async v=>{const g=v.target.value;c&&c(e,g),await h.onFocus(g)};return w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:e,children:[i||d.title,r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:e,type:u,value:t||"",required:r,disabled:n||o,onChange:p,onBlur:x,onFocus:f,min:typeof l.minDate=="string"||typeof l.minDate=="number"?l.minDate:void 0,max:typeof l.maxDate=="string"||typeof l.maxDate=="number"?l.maxDate:void 0,className:"w-full"})]})},yu=fn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ei({className:e,variant:t,...r}){return w.jsx("div",{className:J(yu({variant:t}),e),...r})}const Ci=({id:e,value:t,required:r,disabled:n,readonly:o,label:i,onChange:a,options:s,schema:c})=>{const l=D.useRef(null),d=s.accept||"*/*",u=s.multiple||!1,h=ve(e,c),p=async v=>{const g=v.target.files;if(!g)return;let y;if(u){const b=Array.from(g).map(O=>({name:O.name,size:O.size,type:O.type,lastModified:O.lastModified}));y=b,a(b)}else{const b=g[0];b&&(y={name:b.name,size:b.size,type:b.type,lastModified:b.lastModified},a(y))}y&&await h.onChange(y)},x=async()=>{l.current&&(l.current.value=""),a(null),await h.onChange(null)},f=v=>v<1024?v+" B":v<1024*1024?(v/1024).toFixed(1)+" KB":(v/(1024*1024)).toFixed(1)+" MB";return w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:e,children:[i||c.title,r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{ref:l,id:e,type:"file",accept:d,multiple:u,required:r,disabled:n||o,onChange:p,className:"cursor-pointer"}),t&&w.jsx("div",{className:"space-y-2",children:u&&Array.isArray(t)?w.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((v,g)=>w.jsxs(Ei,{variant:"secondary",className:"flex items-center gap-1 pr-1",children:[w.jsxs("span",{className:"text-xs",children:[v.name," (",f(v.size),")"]}),!n&&!o&&w.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:x,children:w.jsx(gn,{className:"h-3 w-3"})})]},g))}):t&&typeof t=="object"&&"name"in t?w.jsxs(Ei,{variant:"secondary",className:"inline-flex items-center gap-1 pr-1",children:[w.jsxs("span",{className:"text-xs",children:[t.name," (",f(t.size),")"]}),!n&&!o&&w.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:x,children:w.jsx(gn,{className:"h-3 w-3"})})]}):null})]})};function _r(e,[t,r]){return Math.min(r,Math.max(t,e))}function oe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Dt(e,t=[]){let r=[];function n(i,a){const s=E.createContext(a),c=r.length;r=[...r,a];const l=u=>{var g;const{scope:h,children:p,...x}=u,f=((g=h==null?void 0:h[e])==null?void 0:g[c])||s,v=E.useMemo(()=>x,Object.values(x));return w.jsx(f.Provider,{value:v,children:p})};l.displayName=i+"Provider";function d(u,h){var f;const p=((f=h==null?void 0:h[e])==null?void 0:f[c])||s,x=E.useContext(p);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=r.map(a=>E.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[n,bu(o,...t)]}function bu(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=n.reduce((s,{useScope:c,scopeName:l})=>{const u=c(i)[`__scope${l}`];return{...s,...u}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var Ce=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},wu=E[" useInsertionEffect ".trim().toString()]||Ce;function tr({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,a]=xu({defaultProp:t,onChange:r}),s=e!==void 0,c=s?e:o;{const d=E.useRef(e!==void 0);E.useEffect(()=>{const u=d.current;u!==s&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,n])}const l=E.useCallback(d=>{var u;if(s){const h=Eu(d)?d(e):d;h!==e&&((u=a.current)==null||u.call(a,h))}else i(d)},[s,e,i,a]);return[c,l]}function xu({defaultProp:e,onChange:t}){const[r,n]=E.useState(e),o=E.useRef(r),i=E.useRef(t);return wu(()=>{i.current=t},[t]),E.useEffect(()=>{var a;o.current!==r&&((a=i.current)==null||a.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Eu(e){return typeof e=="function"}var Cu=E.createContext(void 0);function Si(e){const t=E.useContext(Cu);return e||t||"ltr"}function vn(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function yn(e){const[t,r]=E.useState(void 0);return Ce(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}function Oi(e){const t=e+"CollectionProvider",[r,n]=Dt(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=f=>{const{scope:v,children:g}=f,y=D.useRef(null),b=D.useRef(new Map).current;return w.jsx(o,{scope:v,itemMap:b,collectionRef:y,children:g})};a.displayName=t;const s=e+"CollectionSlot",c=Nt(s),l=D.forwardRef((f,v)=>{const{scope:g,children:y}=f,b=i(s,g),O=ue(v,b.collectionRef);return w.jsx(c,{ref:O,children:y})});l.displayName=s;const d=e+"CollectionItemSlot",u="data-radix-collection-item",h=Nt(d),p=D.forwardRef((f,v)=>{const{scope:g,children:y,...b}=f,O=D.useRef(null),S=ue(v,O),T=i(d,g);return D.useEffect(()=>(T.itemMap.set(O,{ref:O,...b}),()=>void T.itemMap.delete(O))),w.jsx(h,{[u]:"",ref:S,children:y})});p.displayName=d;function x(f){const v=i(e+"CollectionConsumer",f);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((T,P)=>b.indexOf(T.ref.current)-b.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},x,n]}var _i=["PageUp","PageDown"],ki=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Pi={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Tt="Slider",[bn,Su,Ou]=Oi(Tt),[Mi,tw]=Dt(Tt,[Ou]),[_u,kr]=Mi(Tt),Ai=E.forwardRef((e,t)=>{const{name:r,min:n=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[n],value:d,onValueChange:u=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:x,...f}=e,v=E.useRef(new Set),g=E.useRef(0),b=a==="horizontal"?ku:Pu,[O=[],S]=tr({prop:d,defaultProp:l,onChange:U=>{var K;(K=[...v.current][g.current])==null||K.focus(),u(U)}}),T=E.useRef(O);function P(U){const R=Tu(O,U);B(U,R)}function L(U){B(U,g.current)}function $(){const U=T.current[g.current];O[g.current]!==U&&h(O)}function B(U,R,{commit:K}={commit:!1}){const ee=ju(i),H=Lu(Math.round((U-n)/i)*i+n,ee),X=_r(H,[n,o]);S((Z=[])=>{const m=Nu(Z,X,R);if(Wu(m,c*i)){g.current=m.indexOf(X);const C=String(m)!==String(Z);return C&&K&&h(m),C?m:Z}else return Z})}return w.jsx(_u,{scope:e.__scopeSlider,name:r,disabled:s,min:n,max:o,valueIndexToChangeRef:g,thumbs:v.current,values:O,orientation:a,form:x,children:w.jsx(bn.Provider,{scope:e.__scopeSlider,children:w.jsx(bn.Slot,{scope:e.__scopeSlider,children:w.jsx(b,{"aria-disabled":s,"data-disabled":s?"":void 0,...f,ref:t,onPointerDown:oe(f.onPointerDown,()=>{s||(T.current=O)}),min:n,max:o,inverted:p,onSlideStart:s?void 0:P,onSlideMove:s?void 0:L,onSlideEnd:s?void 0:$,onHomeKeyDown:()=>!s&&B(n,0,{commit:!0}),onEndKeyDown:()=>!s&&B(o,O.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:R})=>{if(!s){const H=_i.includes(U.key)||U.shiftKey&&ki.includes(U.key)?10:1,X=g.current,Z=O[X],m=i*H*R;B(Z+m,X,{commit:!0})}}})})})})});Ai.displayName=Tt;var[Ni,Di]=Mi(Tt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ku=E.forwardRef((e,t)=>{const{min:r,max:n,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...d}=e,[u,h]=E.useState(null),p=ue(t,b=>h(b)),x=E.useRef(void 0),f=Si(o),v=f==="ltr",g=v&&!i||!v&&i;function y(b){const O=x.current||u.getBoundingClientRect(),S=[0,O.width],P=En(S,g?[r,n]:[n,r]);return x.current=O,P(b-O.left)}return w.jsx(Ni,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:w.jsx(Ti,{dir:f,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const O=y(b.clientX);a==null||a(O)},onSlideMove:b=>{const O=y(b.clientX);s==null||s(O)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:b=>{const S=Pi[g?"from-left":"from-right"].includes(b.key);l==null||l({event:b,direction:S?-1:1})}})})}),Pu=E.forwardRef((e,t)=>{const{min:r,max:n,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:c,...l}=e,d=E.useRef(null),u=ue(t,d),h=E.useRef(void 0),p=!o;function x(f){const v=h.current||d.current.getBoundingClientRect(),g=[0,v.height],b=En(g,p?[n,r]:[r,n]);return h.current=v,b(f-v.top)}return w.jsx(Ni,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:w.jsx(Ti,{"data-orientation":"vertical",...l,ref:u,style:{...l.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:f=>{const v=x(f.clientY);i==null||i(v)},onSlideMove:f=>{const v=x(f.clientY);a==null||a(v)},onSlideEnd:()=>{h.current=void 0,s==null||s()},onStepKeyDown:f=>{const g=Pi[p?"from-bottom":"from-top"].includes(f.key);c==null||c({event:f,direction:g?-1:1})}})})}),Ti=E.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:c,...l}=e,d=kr(Tt,r);return w.jsx(ie.span,{...l,ref:t,onKeyDown:oe(e.onKeyDown,u=>{u.key==="Home"?(a(u),u.preventDefault()):u.key==="End"?(s(u),u.preventDefault()):_i.concat(ki).includes(u.key)&&(c(u),u.preventDefault())}),onPointerDown:oe(e.onPointerDown,u=>{const h=u.target;h.setPointerCapture(u.pointerId),u.preventDefault(),d.thumbs.has(h)?h.focus():n(u)}),onPointerMove:oe(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&o(u)}),onPointerUp:oe(e.onPointerUp,u=>{const h=u.target;h.hasPointerCapture(u.pointerId)&&(h.releasePointerCapture(u.pointerId),i(u))})})}),Fi="SliderTrack",Ii=E.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,o=kr(Fi,r);return w.jsx(ie.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...n,ref:t})});Ii.displayName=Fi;var wn="SliderRange",Wi=E.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,o=kr(wn,r),i=Di(wn,r),a=E.useRef(null),s=ue(t,a),c=o.values.length,l=o.values.map(h=>Bi(h,o.min,o.max)),d=c>1?Math.min(...l):0,u=100-Math.max(...l);return w.jsx(ie.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...n,ref:s,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:u+"%"}})});Wi.displayName=wn;var xn="SliderThumb",ji=E.forwardRef((e,t)=>{const r=Su(e.__scopeSlider),[n,o]=E.useState(null),i=ue(t,s=>o(s)),a=E.useMemo(()=>n?r().findIndex(s=>s.ref.current===n):-1,[r,n]);return w.jsx(Mu,{...e,ref:i,index:a})}),Mu=E.forwardRef((e,t)=>{const{__scopeSlider:r,index:n,name:o,...i}=e,a=kr(xn,r),s=Di(xn,r),[c,l]=E.useState(null),d=ue(t,y=>l(y)),u=c?a.form||!!c.closest("form"):!0,h=yn(c),p=a.values[n],x=p===void 0?0:Bi(p,a.min,a.max),f=Du(n,a.values.length),v=h==null?void 0:h[s.size],g=v?Fu(v,x,s.direction):0;return E.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),w.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${x}% + ${g}px)`},children:[w.jsx(bn.ItemSlot,{scope:e.__scopeSlider,children:w.jsx(ie.span,{role:"slider","aria-label":e["aria-label"]||f,"aria-valuemin":a.min,"aria-valuenow":p,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:oe(e.onFocus,()=>{a.valueIndexToChangeRef.current=n})})}),u&&w.jsx(Li,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:p},n)]})});ji.displayName=xn;var Au="RadioBubbleInput",Li=E.forwardRef(({__scopeSlider:e,value:t,...r},n)=>{const o=E.useRef(null),i=ue(o,n),a=vn(t);return E.useEffect(()=>{const s=o.current;if(!s)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const u=new Event("input",{bubbles:!0});d.call(s,t),s.dispatchEvent(u)}},[a,t]),w.jsx(ie.input,{style:{display:"none"},...r,ref:i,defaultValue:t})});Li.displayName=Au;function Nu(e=[],t,r){const n=[...e];return n[r]=t,n.sort((o,i)=>o-i)}function Bi(e,t,r){const i=100/(r-t)*(e-t);return _r(i,[0,100])}function Du(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Tu(e,t){if(e.length===1)return 0;const r=e.map(o=>Math.abs(o-t)),n=Math.min(...r);return r.indexOf(n)}function Fu(e,t,r){const n=e/2,i=En([0,50],[0,n]);return(n-i(t)*r)*r}function Iu(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function Wu(e,t){if(t>0){const r=Iu(e);return Math.min(...r)>=t}return!0}function En(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function ju(e){return(String(e).split(".")[1]||"").length}function Lu(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var $i=Ai,Bu=Ii,$u=Wi,Ru=ji;const Ri=E.forwardRef(({className:e,...t},r)=>w.jsxs($i,{ref:r,className:J("relative flex w-full touch-none select-none items-center",e),...t,children:[w.jsx(Bu,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:w.jsx($u,{className:"absolute h-full bg-primary"})}),w.jsx(Ru,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));Ri.displayName=$i.displayName;const Vi=({id:e,value:t,required:r,disabled:n,readonly:o,label:i,onChange:a,onBlur:s,schema:c})=>{const l=c.minimum||0,d=c.maximum||100,u=c.multipleOf||1,h=ve(e,c),p=async x=>{const f=x[0];a(f),s&&s(e,f),await h.onChange(f)};return w.jsxs("div",{className:"space-y-2",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsxs(ke,{htmlFor:e,children:[i||c.title,r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx("span",{className:"text-sm font-medium tabular-nums",children:t||l})]}),w.jsx(Ri,{id:e,min:l,max:d,step:u,value:[t||l],onValueChange:p,disabled:n||o,className:"w-full"})]})},Hi=({id:e,value:t,required:r,disabled:n,readonly:o,label:i,onChange:a,options:s,schema:c})=>{const l=Number(s.max||c.maximum||5),d=Array.from({length:l},(p,x)=>x+1),u=ve(e,c),h=async p=>{!n&&!o&&(a(p),await u.onChange(p))};return w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:e,children:[i||c.title,r&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx("div",{className:"flex items-center gap-1",role:"radiogroup","aria-labelledby":e,children:d.map(p=>w.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:J("h-8 w-8 p-0 hover:bg-transparent",n||o?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:()=>h(p),disabled:n||o,"aria-label":`Rate ${p} out of ${l}`,role:"radio","aria-checked":p===t,children:w.jsx(gu,{className:J("h-5 w-5 transition-colors",p<=(t||0)?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})},p))})]})},Ui=E.forwardRef(({className:e,...t},r)=>w.jsx("textarea",{className:J("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Ui.displayName="Textarea";function xt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Vu(e,t=globalThis==null?void 0:globalThis.document){const r=xt(e);E.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Hu="DismissableLayer",Cn="dismissableLayer.update",Uu="dismissableLayer.pointerDownOutside",Yu="dismissableLayer.focusOutside",Yi,zi=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sn=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...c}=e,l=E.useContext(zi),[d,u]=E.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=E.useState({}),x=ue(t,P=>u(P)),f=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=f.indexOf(v),y=d?f.indexOf(d):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,O=y>=g,S=Ku(P=>{const L=P.target,$=[...l.branches].some(B=>B.contains(L));!O||$||(o==null||o(P),a==null||a(P),P.defaultPrevented||s==null||s())},h),T=Gu(P=>{const L=P.target;[...l.branches].some(B=>B.contains(L))||(i==null||i(P),a==null||a(P),P.defaultPrevented||s==null||s())},h);return Vu(P=>{y===l.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},h),E.useEffect(()=>{if(d)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Yi=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),qi(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Yi)}},[d,h,r,l]),E.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),qi())},[d,l]),E.useEffect(()=>{const P=()=>p({});return document.addEventListener(Cn,P),()=>document.removeEventListener(Cn,P)},[]),w.jsx(ie.div,{...c,ref:x,style:{pointerEvents:b?O?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,T.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,S.onPointerDownCapture)})});Sn.displayName=Hu;var zu="DismissableLayerBranch",qu=E.forwardRef((e,t)=>{const r=E.useContext(zi),n=E.useRef(null),o=ue(t,n);return E.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),w.jsx(ie.div,{...e,ref:o})});qu.displayName=zu;function Ku(e,t=globalThis==null?void 0:globalThis.document){const r=xt(e),n=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let c=function(){Ki(Uu,r,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Gu(e,t=globalThis==null?void 0:globalThis.document){const r=xt(e),n=E.useRef(!1);return E.useEffect(()=>{const o=i=>{i.target&&!n.current&&Ki(Yu,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function qi(){const e=new CustomEvent(Cn);document.dispatchEvent(e)}function Ki(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?ou(o,i):o.dispatchEvent(i)}var On=0;function Gi(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Xi()),document.body.insertAdjacentElement("beforeend",e[1]??Xi()),On++,()=>{On===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),On--}},[])}function Xi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _n="focusScope.autoFocusOnMount",kn="focusScope.autoFocusOnUnmount",Qi={bubbles:!1,cancelable:!0},Xu="FocusScope",Pn=E.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,c]=E.useState(null),l=xt(o),d=xt(i),u=E.useRef(null),h=ue(t,f=>c(f)),p=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(n){let f=function(b){if(p.paused||!s)return;const O=b.target;s.contains(O)?u.current=O:ut(u.current,{select:!0})},v=function(b){if(p.paused||!s)return;const O=b.relatedTarget;O!==null&&(s.contains(O)||ut(u.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&ut(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",v);const y=new MutationObserver(g);return s&&y.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",v),y.disconnect()}}},[n,s,p.paused]),E.useEffect(()=>{if(s){ea.add(p);const f=document.activeElement;if(!s.contains(f)){const g=new CustomEvent(_n,Qi);s.addEventListener(_n,l),s.dispatchEvent(g),g.defaultPrevented||(Qu(rd(Zi(s)),{select:!0}),document.activeElement===f&&ut(s))}return()=>{s.removeEventListener(_n,l),setTimeout(()=>{const g=new CustomEvent(kn,Qi);s.addEventListener(kn,d),s.dispatchEvent(g),g.defaultPrevented||ut(f??document.body,{select:!0}),s.removeEventListener(kn,d),ea.remove(p)},0)}}},[s,l,d,p]);const x=E.useCallback(f=>{if(!r&&!n||p.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,g=document.activeElement;if(v&&g){const y=f.currentTarget,[b,O]=Zu(y);b&&O?!f.shiftKey&&g===O?(f.preventDefault(),r&&ut(b,{select:!0})):f.shiftKey&&g===b&&(f.preventDefault(),r&&ut(O,{select:!0})):g===y&&f.preventDefault()}},[r,n,p.paused]);return w.jsx(ie.div,{tabIndex:-1,...a,ref:h,onKeyDown:x})});Pn.displayName=Xu;function Qu(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ut(n,{select:t}),document.activeElement!==r)return}function Zu(e){const t=Zi(e),r=Ji(t,e),n=Ji(t.reverse(),e);return[r,n]}function Zi(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ji(e,t){for(const r of e)if(!Ju(r,{upTo:t}))return r}function Ju(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ed(e){return e instanceof HTMLInputElement&&"select"in e}function ut(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ed(e)&&t&&e.select()}}var ea=td();function td(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ta(e,t),e.unshift(t)},remove(t){var r;e=ta(e,t),(r=e[0])==null||r.resume()}}}function ta(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function rd(e){return e.filter(t=>t.tagName!=="A")}var nd=E[" useId ".trim().toString()]||(()=>{}),od=0;function Pr(e){const[t,r]=E.useState(nd());return Ce(()=>{r(n=>n??String(od++))},[e]),t?`radix-${t}`:""}const id=["top","right","bottom","left"],dt=Math.min,Pe=Math.max,Mr=Math.round,Ar=Math.floor,Ve=e=>({x:e,y:e}),ad={left:"right",right:"left",bottom:"top",top:"bottom"},sd={start:"end",end:"start"};function Mn(e,t,r){return Pe(e,dt(t,r))}function Je(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function Ft(e){return e.split("-")[1]}function An(e){return e==="x"?"y":"x"}function Nn(e){return e==="y"?"height":"width"}function tt(e){return["top","bottom"].includes(et(e))?"y":"x"}function Dn(e){return An(tt(e))}function cd(e,t,r){r===void 0&&(r=!1);const n=Ft(e),o=Dn(e),i=Nn(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Nr(a)),[a,Nr(a)]}function ld(e){const t=Nr(e);return[Tn(e),t,Tn(t)]}function Tn(e){return e.replace(/start|end/g,t=>sd[t])}function ud(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}function dd(e,t,r,n){const o=Ft(e);let i=ud(et(e),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Tn)))),i}function Nr(e){return e.replace(/left|right|bottom|top/g,t=>ad[t])}function fd(e){return{top:0,right:0,bottom:0,left:0,...e}}function ra(e){return typeof e!="number"?fd(e):{top:e,right:e,bottom:e,left:e}}function Dr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function na(e,t,r){let{reference:n,floating:o}=e;const i=tt(t),a=Dn(t),s=Nn(a),c=et(t),l=i==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,h=n[s]/2-o[s]/2;let p;switch(c){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}switch(Ft(t)){case"start":p[a]-=h*(r&&l?-1:1);break;case"end":p[a]+=h*(r&&l?-1:1);break}return p}const hd=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=na(l,n,c),h=n,p={},x=0;for(let f=0;f<s.length;f++){const{name:v,fn:g}=s[f],{x:y,y:b,data:O,reset:S}=await g({x:d,y:u,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});d=y??d,u=b??u,p={...p,[v]:{...p[v],...O}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:d,y:u}=na(l,h,c)),f=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}};async function rr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Je(t,e),x=ra(p),v=s[h?u==="floating"?"reference":"floating":u],g=Dr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),y=u==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),O=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},S=Dr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:c}):y);return{top:(g.top-S.top+x.top)/O.y,bottom:(S.bottom-g.bottom+x.bottom)/O.y,left:(g.left-S.left+x.left)/O.x,right:(S.right-g.right+x.right)/O.x}}const pd=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:d=0}=Je(e,t)||{};if(l==null)return{};const u=ra(d),h={x:r,y:n},p=Dn(o),x=Nn(p),f=await a.getDimensions(l),v=p==="y",g=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",O=i.reference[x]+i.reference[p]-h[p]-i.floating[x],S=h[p]-i.reference[p],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let P=T?T[b]:0;(!P||!await(a.isElement==null?void 0:a.isElement(T)))&&(P=s.floating[b]||i.floating[x]);const L=O/2-S/2,$=P/2-f[x]/2-1,B=dt(u[g],$),U=dt(u[y],$),R=B,K=P-f[x]-U,ee=P/2-f[x]/2+L,H=Mn(R,ee,K),X=!c.arrow&&Ft(o)!=null&&ee!==H&&i.reference[x]/2-(ee<R?B:U)-f[x]/2<0,Z=X?ee<R?ee-R:ee-K:0;return{[p]:h[p]+Z,data:{[p]:H,centerOffset:ee-H-Z,...X&&{alignmentOffset:Z}},reset:X}}}),md=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:f=!0,...v}=Je(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=et(o),y=tt(s),b=et(s)===s,O=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=h||(b||!f?[Nr(s)]:ld(s)),T=x!=="none";!h&&T&&S.push(...dd(s,f,x,O));const P=[s,...S],L=await rr(t,v),$=[];let B=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&$.push(L[g]),u){const H=cd(o,a,O);$.push(L[H[0]],L[H[1]])}if(B=[...B,{placement:o,overflows:$}],!$.every(H=>H<=0)){var U,R;const H=(((U=i.flip)==null?void 0:U.index)||0)+1,X=P[H];if(X){var K;const m=u==="alignment"?y!==tt(X):!1,C=((K=B[0])==null?void 0:K.overflows[0])>0;if(!m||C)return{data:{index:H,overflows:B},reset:{placement:X}}}let Z=(R=B.filter(m=>m.overflows[0]<=0).sort((m,C)=>m.overflows[1]-C.overflows[1])[0])==null?void 0:R.placement;if(!Z)switch(p){case"bestFit":{var ee;const m=(ee=B.filter(C=>{if(T){const _=tt(C.placement);return _===y||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,k)=>_+k,0)]).sort((C,_)=>C[1]-_[1])[0])==null?void 0:ee[0];m&&(Z=m);break}case"initialPlacement":Z=s;break}if(o!==Z)return{reset:{placement:Z}}}return{}}}};function oa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ia(e){return id.some(t=>e[t]>=0)}const gd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Je(e,t);switch(n){case"referenceHidden":{const i=await rr(t,{...o,elementContext:"reference"}),a=oa(i,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ia(a)}}}case"escaped":{const i=await rr(t,{...o,altBoundary:!0}),a=oa(i,r.floating);return{data:{escapedOffsets:a,escaped:ia(a)}}}default:return{}}}}};async function vd(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=et(r),s=Ft(r),c=tt(r)==="y",l=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,u=Je(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:x}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof x=="number"&&(p=s==="end"?x*-1:x),c?{x:p*d,y:h*l}:{x:h*l,y:p*d}}const yd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await vd(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},bd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:g,y}=v;return{x:g,y}}},...c}=Je(e,t),l={x:r,y:n},d=await rr(t,c),u=tt(et(o)),h=An(u);let p=l[h],x=l[u];if(i){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=p+d[v],b=p-d[g];p=Mn(y,p,b)}if(a){const v=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=x+d[v],b=x-d[g];x=Mn(y,x,b)}const f=s.fn({...t,[h]:p,[u]:x});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[h]:i,[u]:a}}}}}},wd=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Je(e,t),d={x:r,y:n},u=tt(o),h=An(u);let p=d[h],x=d[u];const f=Je(s,t),v=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const b=h==="y"?"height":"width",O=i.reference[h]-i.floating[b]+v.mainAxis,S=i.reference[h]+i.reference[b]-v.mainAxis;p<O?p=O:p>S&&(p=S)}if(l){var g,y;const b=h==="y"?"width":"height",O=["top","left"].includes(et(o)),S=i.reference[u]-i.floating[b]+(O&&((g=a.offset)==null?void 0:g[u])||0)+(O?0:v.crossAxis),T=i.reference[u]+i.reference[b]+(O?0:((y=a.offset)==null?void 0:y[u])||0)-(O?v.crossAxis:0);x<S?x=S:x>T&&(x=T)}return{[h]:p,[u]:x}}}},xd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=Je(e,t),d=await rr(t,l),u=et(o),h=Ft(o),p=tt(o)==="y",{width:x,height:f}=i.floating;let v,g;u==="top"||u==="bottom"?(v=u,g=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,v=h==="end"?"top":"bottom");const y=f-d.top-d.bottom,b=x-d.left-d.right,O=dt(f-d[v],y),S=dt(x-d[g],b),T=!t.middlewareData.shift;let P=O,L=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=y),T&&!h){const B=Pe(d.left,0),U=Pe(d.right,0),R=Pe(d.top,0),K=Pe(d.bottom,0);p?L=x-2*(B!==0||U!==0?B+U:Pe(d.left,d.right)):P=f-2*(R!==0||K!==0?R+K:Pe(d.top,d.bottom))}await c({...t,availableWidth:L,availableHeight:P});const $=await a.getDimensions(s.floating);return x!==$.width||f!==$.height?{reset:{rects:!0}}:{}}}};function Tr(){return typeof window<"u"}function It(e){return aa(e)?(e.nodeName||"").toLowerCase():"#document"}function Me(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(aa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aa(e){return Tr()?e instanceof Node||e instanceof Me(e).Node:!1}function Te(e){return Tr()?e instanceof Element||e instanceof Me(e).Element:!1}function Ue(e){return Tr()?e instanceof HTMLElement||e instanceof Me(e).HTMLElement:!1}function sa(e){return!Tr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function nr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function Ed(e){return["table","td","th"].includes(It(e))}function Fr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Fn(e){const t=In(),r=Te(e)?Fe(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function Cd(e){let t=ft(e);for(;Ue(t)&&!Wt(t);){if(Fn(t))return t;if(Fr(t))return null;t=ft(t)}return null}function In(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wt(e){return["html","body","#document"].includes(It(e))}function Fe(e){return Me(e).getComputedStyle(e)}function Ir(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ft(e){if(It(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sa(e)&&e.host||He(e);return sa(t)?t.host:t}function ca(e){const t=ft(e);return Wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ue(t)&&nr(t)?t:ca(t)}function or(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ca(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=Me(o);if(i){const s=Wn(a);return t.concat(a,a.visualViewport||[],nr(o)?o:[],s&&r?or(s):[])}return t.concat(o,or(o,[],r))}function Wn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function la(e){const t=Fe(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ue(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=Mr(r)!==i||Mr(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function jn(e){return Te(e)?e:e.contextElement}function jt(e){const t=jn(e);if(!Ue(t))return Ve(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=la(t);let a=(i?Mr(r.width):r.width)/n,s=(i?Mr(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Sd=Ve(0);function ua(e){const t=Me(e);return!In()||!t.visualViewport?Sd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Od(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Me(e)?!1:t}function Et(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=jn(e);let a=Ve(1);t&&(n?Te(n)&&(a=jt(n)):a=jt(e));const s=Od(i,r,n)?ua(i):Ve(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(i){const h=Me(i),p=n&&Te(n)?Me(n):n;let x=h,f=Wn(x);for(;f&&n&&p!==x;){const v=jt(f),g=f.getBoundingClientRect(),y=Fe(f),b=g.left+(f.clientLeft+parseFloat(y.paddingLeft))*v.x,O=g.top+(f.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,l*=v.y,d*=v.x,u*=v.y,c+=b,l+=O,x=Me(f),f=Wn(x)}}return Dr({width:d,height:u,x:c,y:l})}function Ln(e,t){const r=Ir(e).scrollLeft;return t?t.left+r:Et(He(e)).left+r}function da(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Ln(e,n)),i=n.top+t.scrollTop;return{x:o,y:i}}function _d(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",a=He(n),s=t?Fr(t.floating):!1;if(n===a||s&&i)return r;let c={scrollLeft:0,scrollTop:0},l=Ve(1);const d=Ve(0),u=Ue(n);if((u||!u&&!i)&&((It(n)!=="body"||nr(a))&&(c=Ir(n)),Ue(n))){const p=Et(n);l=jt(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const h=a&&!u&&!i?da(a,c,!0):Ve(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:r.y*l.y-c.scrollTop*l.y+d.y+h.y}}function kd(e){return Array.from(e.getClientRects())}function Pd(e){const t=He(e),r=Ir(e),n=e.ownerDocument.body,o=Pe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Pe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Ln(e);const s=-r.scrollTop;return Fe(n).direction==="rtl"&&(a+=Pe(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Md(e,t){const r=Me(e),n=He(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const l=In();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}function Ad(e,t){const r=Et(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Ue(e)?jt(e):Ve(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,l=n*i.y;return{width:a,height:s,x:c,y:l}}function fa(e,t,r){let n;if(t==="viewport")n=Md(e,r);else if(t==="document")n=Pd(He(e));else if(Te(t))n=Ad(t,r);else{const o=ua(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dr(n)}function ha(e,t){const r=ft(e);return r===t||!Te(r)||Wt(r)?!1:Fe(r).position==="fixed"||ha(r,t)}function Nd(e,t){const r=t.get(e);if(r)return r;let n=or(e,[],!1).filter(s=>Te(s)&&It(s)!=="body"),o=null;const i=Fe(e).position==="fixed";let a=i?ft(e):e;for(;Te(a)&&!Wt(a);){const s=Fe(a),c=Fn(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||nr(a)&&!c&&ha(e,a))?n=n.filter(d=>d!==a):o=s,a=ft(a)}return t.set(e,n),n}function Dd(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?Fr(t)?[]:Nd(t,this._c):[].concat(r),n],s=a[0],c=a.reduce((l,d)=>{const u=fa(t,d,o);return l.top=Pe(u.top,l.top),l.right=dt(u.right,l.right),l.bottom=dt(u.bottom,l.bottom),l.left=Pe(u.left,l.left),l},fa(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Td(e){const{width:t,height:r}=la(e);return{width:t,height:r}}function Fd(e,t,r){const n=Ue(t),o=He(t),i=r==="fixed",a=Et(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Ve(0);function l(){c.x=Ln(o)}if(n||!n&&!i)if((It(t)!=="body"||nr(o))&&(s=Ir(t)),n){const p=Et(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&l();i&&!n&&o&&l();const d=o&&!n&&!i?da(o,s):Ve(0),u=a.left+s.scrollLeft-c.x-d.x,h=a.top+s.scrollTop-c.y-d.y;return{x:u,y:h,width:a.width,height:a.height}}function Bn(e){return Fe(e).position==="static"}function pa(e,t){if(!Ue(e)||Fe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return He(e)===r&&(r=r.ownerDocument.body),r}function ma(e,t){const r=Me(e);if(Fr(e))return r;if(!Ue(e)){let o=ft(e);for(;o&&!Wt(o);){if(Te(o)&&!Bn(o))return o;o=ft(o)}return r}let n=pa(e,t);for(;n&&Ed(n)&&Bn(n);)n=pa(n,t);return n&&Wt(n)&&Bn(n)&&!Fn(n)?r:n||Cd(e)||r}const Id=async function(e){const t=this.getOffsetParent||ma,r=this.getDimensions,n=await r(e.floating);return{reference:Fd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Wd(e){return Fe(e).direction==="rtl"}const jd={convertOffsetParentRelativeRectToViewportRelativeRect:_d,getDocumentElement:He,getClippingRect:Dd,getOffsetParent:ma,getElementRects:Id,getClientRects:kd,getDimensions:Td,getScale:jt,isElement:Te,isRTL:Wd};function ga(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ld(e,t){let r=null,n;const o=He(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=l;if(s||t(),!h||!p)return;const x=Ar(u),f=Ar(o.clientWidth-(d+h)),v=Ar(o.clientHeight-(u+p)),g=Ar(d),b={rootMargin:-x+"px "+-f+"px "+-v+"px "+-g+"px",threshold:Pe(0,dt(1,c))||1};let O=!0;function S(T){const P=T[0].intersectionRatio;if(P!==c){if(!O)return a();P?a(!1,P):n=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!ga(l,e.getBoundingClientRect())&&a(),O=!1}try{r=new IntersectionObserver(S,{...b,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,b)}r.observe(e)}return a(!0),i}function Bd(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=jn(e),d=o||i?[...l?or(l):[],...or(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const u=l&&s?Ld(l,r):null;let h=-1,p=null;a&&(p=new ResizeObserver(g=>{let[y]=g;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),r()}),l&&!c&&p.observe(l),p.observe(t));let x,f=c?Et(e):null;c&&v();function v(){const g=Et(e);f&&!ga(f,g)&&r(),f=g,x=requestAnimationFrame(v)}return r(),()=>{var g;d.forEach(y=>{o&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),u==null||u(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const $d=yd,Rd=bd,Vd=md,Hd=xd,Ud=gd,va=pd,Yd=wd,zd=(e,t,r)=>{const n=new Map,o={platform:jd,...r},i={...o.platform,_c:n};return hd(e,t,{...o,platform:i})};var Wr=typeof document<"u"?D.useLayoutEffect:D.useEffect;function jr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!jr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!jr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ya(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ba(e,t){const r=ya(e);return Math.round(t*r)/r}function $n(e){const t=E.useRef(e);return Wr(()=>{t.current=e}),t}function qd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,u]=E.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=E.useState(n);jr(h,n)||p(n);const[x,f]=E.useState(null),[v,g]=E.useState(null),y=E.useCallback(m=>{m!==T.current&&(T.current=m,f(m))},[]),b=E.useCallback(m=>{m!==P.current&&(P.current=m,g(m))},[]),O=i||x,S=a||v,T=E.useRef(null),P=E.useRef(null),L=E.useRef(d),$=c!=null,B=$n(c),U=$n(o),R=$n(l),K=E.useCallback(()=>{if(!T.current||!P.current)return;const m={placement:t,strategy:r,middleware:h};U.current&&(m.platform=U.current),zd(T.current,P.current,m).then(C=>{const _={...C,isPositioned:R.current!==!1};ee.current&&!jr(L.current,_)&&(L.current=_,Cr.flushSync(()=>{u(_)}))})},[h,t,r,U,R]);Wr(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,u(m=>({...m,isPositioned:!1})))},[l]);const ee=E.useRef(!1);Wr(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Wr(()=>{if(O&&(T.current=O),S&&(P.current=S),O&&S){if(B.current)return B.current(O,S,K);K()}},[O,S,K,B,$]);const H=E.useMemo(()=>({reference:T,floating:P,setReference:y,setFloating:b}),[y,b]),X=E.useMemo(()=>({reference:O,floating:S}),[O,S]),Z=E.useMemo(()=>{const m={position:r,left:0,top:0};if(!X.floating)return m;const C=ba(X.floating,d.x),_=ba(X.floating,d.y);return s?{...m,transform:"translate("+C+"px, "+_+"px)",...ya(X.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:C,top:_}},[r,s,X.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:K,refs:H,elements:X,floatingStyles:Z}),[d,K,H,X,Z])}const Kd=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?va({element:n.current,padding:o}).fn(r):{}:n?va({element:n,padding:o}).fn(r):{}}}},Gd=(e,t)=>({...$d(e),options:[e,t]}),Xd=(e,t)=>({...Rd(e),options:[e,t]}),Qd=(e,t)=>({...Yd(e),options:[e,t]}),Zd=(e,t)=>({...Vd(e),options:[e,t]}),Jd=(e,t)=>({...Hd(e),options:[e,t]}),ef=(e,t)=>({...Ud(e),options:[e,t]}),tf=(e,t)=>({...Kd(e),options:[e,t]});var rf="Arrow",wa=E.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return w.jsx(ie.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});wa.displayName=rf;var nf=wa,Rn="Popper",[xa,Lr]=Dt(Rn),[of,Ea]=xa(Rn),Ca=e=>{const{__scopePopper:t,children:r}=e,[n,o]=E.useState(null);return w.jsx(of,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ca.displayName=Rn;var Sa="PopperAnchor",Oa=E.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ea(Sa,r),a=E.useRef(null),s=ue(t,a);return E.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:w.jsx(ie.div,{...o,ref:s})});Oa.displayName=Sa;var Vn="PopperContent",[af,sf]=xa(Vn),_a=E.forwardRef((e,t)=>{var A,V,re,q,z,Q;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:x,...f}=e,v=Ea(Vn,r),[g,y]=E.useState(null),b=ue(t,se=>y(se)),[O,S]=E.useState(null),T=yn(O),P=(T==null?void 0:T.width)??0,L=(T==null?void 0:T.height)??0,$=n+(i!=="center"?"-"+i:""),B=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(l)?l:[l],R=U.length>0,K={padding:B,boundary:U.filter(lf),altBoundary:R},{refs:ee,floatingStyles:H,placement:X,isPositioned:Z,middlewareData:m}=qd({strategy:"fixed",placement:$,whileElementsMounted:(...se)=>Bd(...se,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Gd({mainAxis:o+L,alignmentAxis:a}),c&&Xd({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Qd():void 0,...K}),c&&Zd({...K}),Jd({...K,apply:({elements:se,rects:Ee,availableWidth:Le,availableHeight:Ne})=>{const{width:Be,height:De}=Ee.reference,ye=se.floating.style;ye.setProperty("--radix-popper-available-width",`${Le}px`),ye.setProperty("--radix-popper-available-height",`${Ne}px`),ye.setProperty("--radix-popper-anchor-width",`${Be}px`),ye.setProperty("--radix-popper-anchor-height",`${De}px`)}}),O&&tf({element:O,padding:s}),uf({arrowWidth:P,arrowHeight:L}),h&&ef({strategy:"referenceHidden",...K})]}),[C,_]=Ma(X),k=xt(x);Ce(()=>{Z&&(k==null||k())},[Z,k]);const M=(A=m.arrow)==null?void 0:A.x,F=(V=m.arrow)==null?void 0:V.y,I=((re=m.arrow)==null?void 0:re.centerOffset)!==0,[j,W]=E.useState();return Ce(()=>{g&&W(window.getComputedStyle(g).zIndex)},[g]),w.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Z?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:j,"--radix-popper-transform-origin":[(q=m.transformOrigin)==null?void 0:q.x,(z=m.transformOrigin)==null?void 0:z.y].join(" "),...((Q=m.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(af,{scope:r,placedSide:C,onArrowChange:S,arrowX:M,arrowY:F,shouldHideArrow:I,children:w.jsx(ie.div,{"data-side":C,"data-align":_,...f,ref:b,style:{...f.style,animation:Z?void 0:"none"}})})})});_a.displayName=Vn;var ka="PopperArrow",cf={top:"bottom",right:"left",bottom:"top",left:"right"},Pa=E.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=sf(ka,n),a=cf[i.placedSide];return w.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:w.jsx(nf,{...o,ref:r,style:{...o.style,display:"block"}})})});Pa.displayName=ka;function lf(e){return e!==null}var uf=e=>({name:"transformOrigin",options:e,fn(t){var v,g,y;const{placement:r,rects:n,middlewareData:o}=t,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[l,d]=Ma(r),u={start:"0%",center:"50%",end:"100%"}[d],h=(((g=o.arrow)==null?void 0:g.x)??0)+s/2,p=(((y=o.arrow)==null?void 0:y.y)??0)+c/2;let x="",f="";return l==="bottom"?(x=a?u:`${h}px`,f=`${-c}px`):l==="top"?(x=a?u:`${h}px`,f=`${n.floating.height+c}px`):l==="right"?(x=`${-c}px`,f=a?u:`${p}px`):l==="left"&&(x=`${n.floating.width+c}px`,f=a?u:`${p}px`),{data:{x,y:f}}}});function Ma(e){const[t,r="center"]=e.split("-");return[t,r]}var Aa=Ca,Hn=Oa,Na=_a,Da=Pa,df="Portal",Un=E.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[o,i]=E.useState(!1);Ce(()=>i(!0),[]);const a=r||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Uo.createPortal(w.jsx(ie.div,{...n,ref:t}),a):null});Un.displayName=df;var Ta=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ff="VisuallyHidden",hf=E.forwardRef((e,t)=>w.jsx(ie.span,{...e,ref:t,style:{...Ta,...e.style}}));hf.displayName=ff;var pf=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lt=new WeakMap,Br=new WeakMap,$r={},Yn=0,Fa=function(e){return e&&(e.host||Fa(e.parentNode))},mf=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Fa(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},gf=function(e,t,r,n){var o=mf(t,Array.isArray(e)?e:[e]);$r[r]||($r[r]=new WeakMap);var i=$r[r],a=[],s=new Set,c=new Set(o),l=function(u){!u||s.has(u)||(s.add(u),l(u.parentNode))};o.forEach(l);var d=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(h){if(s.has(h))d(h);else try{var p=h.getAttribute(n),x=p!==null&&p!=="false",f=(Lt.get(h)||0)+1,v=(i.get(h)||0)+1;Lt.set(h,f),i.set(h,v),a.push(h),f===1&&x&&Br.set(h,!0),v===1&&h.setAttribute(r,"true"),x||h.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return d(t),s.clear(),Yn++,function(){a.forEach(function(u){var h=Lt.get(u)-1,p=i.get(u)-1;Lt.set(u,h),i.set(u,p),h||(Br.has(u)||u.removeAttribute(n),Br.delete(u)),p||u.removeAttribute(r)}),Yn--,Yn||(Lt=new WeakMap,Lt=new WeakMap,Br=new WeakMap,$r={})}},Ia=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=pf(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),gf(n,o,r,"aria-hidden")):function(){return null}},Ye=function(){return Ye=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ye.apply(this,arguments)};function Wa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function vf(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Rr="right-scroll-bar-position",Vr="width-before-scroll-bar",yf="with-scroll-bars-hidden",bf="--removed-body-scroll-bar-size";function zn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wf(e,t){var r=D.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var xf=typeof window<"u"?E.useLayoutEffect:E.useEffect,ja=new WeakMap;function Ef(e,t){var r=wf(null,function(n){return e.forEach(function(o){return zn(o,n)})});return xf(function(){var n=ja.get(r);if(n){var o=new Set(n),i=new Set(e),a=r.current;o.forEach(function(s){i.has(s)||zn(s,null)}),i.forEach(function(s){o.has(s)||zn(s,a)})}ja.set(r,e)},[e]),r}function Cf(e){return e}function Sf(e,t){t===void 0&&(t=Cf);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var a=t(i,n);return r.push(a),function(){r=r.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(n=!0;r.length;){var a=r;r=[],a.forEach(i)}r={push:function(s){return i(s)},filter:function(){return r}}},assignMedium:function(i){n=!0;var a=[];if(r.length){var s=r;r=[],s.forEach(i),a=r}var c=function(){var d=a;a=[],d.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),r}}}};return o}function Of(e){e===void 0&&(e={});var t=Sf(null);return t.options=Ye({async:!0,ssr:!1},e),t}var La=function(e){var t=e.sideCar,r=Wa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return E.createElement(n,Ye({},r))};La.isSideCarExport=!0;function _f(e,t){return e.useMedium(t),La}var Ba=Of(),qn=function(){},Hr=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.useState({onScrollCapture:qn,onWheelCapture:qn,onTouchMoveCapture:qn}),o=n[0],i=n[1],a=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,u=e.shards,h=e.sideCar,p=e.noRelative,x=e.noIsolation,f=e.inert,v=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,b=e.gapMode,O=Wa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,T=Ef([r,t]),P=Ye(Ye({},O),o);return E.createElement(E.Fragment,null,d&&E.createElement(S,{sideCar:Ba,removeScrollBar:l,shards:u,noRelative:p,noIsolation:x,inert:f,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:b}),a?E.cloneElement(E.Children.only(s),Ye(Ye({},P),{ref:T})):E.createElement(y,Ye({},P,{className:c,ref:T}),s))});Hr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hr.classNames={fullWidth:Vr,zeroRight:Rr};var kf=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Pf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kf();return t&&e.setAttribute("nonce",t),e}function Mf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Af(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nf=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Pf())&&(Mf(t,r),Af(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Df=function(){var e=Nf();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},$a=function(){var e=Df(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},Tf={left:0,top:0,right:0,gap:0},Kn=function(e){return parseInt(e||"",10)||0},Ff=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Kn(r),Kn(n),Kn(o)]},If=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tf;var t=Ff(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Wf=$a(),Bt="data-scroll-locked",jf=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),`
|
|
62
|
+
.`.concat(yf,` {
|
|
63
|
+
overflow: hidden `).concat(n,`;
|
|
64
|
+
padding-right: `).concat(s,"px ").concat(n,`;
|
|
65
65
|
}
|
|
66
|
-
body[`).concat(
|
|
67
|
-
overflow: hidden `).concat(
|
|
66
|
+
body[`).concat(Bt,`] {
|
|
67
|
+
overflow: hidden `).concat(n,`;
|
|
68
68
|
overscroll-behavior: contain;
|
|
69
|
-
`).concat([t&&"position: relative ".concat(
|
|
69
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
70
70
|
padding-left: `.concat(o,`px;
|
|
71
|
-
padding-top: `).concat(
|
|
72
|
-
padding-right: `).concat(
|
|
71
|
+
padding-top: `).concat(i,`px;
|
|
72
|
+
padding-right: `).concat(a,`px;
|
|
73
73
|
margin-left:0;
|
|
74
74
|
margin-top:0;
|
|
75
|
-
margin-right: `).concat(
|
|
76
|
-
`),
|
|
75
|
+
margin-right: `).concat(s,"px ").concat(n,`;
|
|
76
|
+
`),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
.`).concat(
|
|
80
|
-
right: `).concat(
|
|
79
|
+
.`).concat(Rr,` {
|
|
80
|
+
right: `).concat(s,"px ").concat(n,`;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
.`).concat(
|
|
84
|
-
margin-right: `).concat(
|
|
83
|
+
.`).concat(Vr,` {
|
|
84
|
+
margin-right: `).concat(s,"px ").concat(n,`;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.`).concat(
|
|
88
|
-
right: 0 `).concat(
|
|
87
|
+
.`).concat(Rr," .").concat(Rr,` {
|
|
88
|
+
right: 0 `).concat(n,`;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
.`).concat(
|
|
92
|
-
margin-right: 0 `).concat(
|
|
91
|
+
.`).concat(Vr," .").concat(Vr,` {
|
|
92
|
+
margin-right: 0 `).concat(n,`;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
body[`).concat(
|
|
96
|
-
`).concat(
|
|
95
|
+
body[`).concat(Bt,`] {
|
|
96
|
+
`).concat(bf,": ").concat(s,`px;
|
|
97
97
|
}
|
|
98
|
-
`)},
|
|
98
|
+
`)},Ra=function(){var e=parseInt(document.body.getAttribute(Bt)||"0",10);return isFinite(e)?e:0},Lf=function(){E.useEffect(function(){return document.body.setAttribute(Bt,(Ra()+1).toString()),function(){var e=Ra()-1;e<=0?document.body.removeAttribute(Bt):document.body.setAttribute(Bt,e.toString())}},[])},Bf=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Lf();var i=E.useMemo(function(){return If(o)},[o]);return E.createElement(Wf,{styles:jf(i,!t,o,r?"":"!important")})},Gn=!1;if(typeof window<"u")try{var Ur=Object.defineProperty({},"passive",{get:function(){return Gn=!0,!0}});window.addEventListener("test",Ur,Ur),window.removeEventListener("test",Ur,Ur)}catch{Gn=!1}var $t=Gn?{passive:!1}:!1,$f=function(e){return e.tagName==="TEXTAREA"},Va=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!$f(e)&&r[t]==="visible")},Rf=function(e){return Va(e,"overflowY")},Vf=function(e){return Va(e,"overflowX")},Ha=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=Ua(e,n);if(o){var i=Ya(e,n),a=i[1],s=i[2];if(a>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Hf=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Uf=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ua=function(e,t){return e==="v"?Rf(t):Vf(t)},Ya=function(e,t){return e==="v"?Hf(t):Uf(t)},Yf=function(e,t){return e==="h"&&t==="rtl"?-1:1},zf=function(e,t,r,n,o){var i=Yf(e,window.getComputedStyle(t).direction),a=i*n,s=r.target,c=t.contains(s),l=!1,d=a>0,u=0,h=0;do{if(!s)break;var p=Ya(e,s),x=p[0],f=p[1],v=p[2],g=f-v-i*x;(x||g)&&Ua(e,s)&&(u+=g,h+=x);var y=s.parentNode;s=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(d&&Math.abs(u)<1||!d&&Math.abs(h)<1)&&(l=!0),l},Yr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},za=function(e){return[e.deltaX,e.deltaY]},qa=function(e){return e&&"current"in e?e.current:e},qf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Kf=function(e){return`
|
|
99
99
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
100
100
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
101
|
-
`)},_u=0,Et=[];function Fu(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(_u++)[0],s=v.useState(zs)[0],i=v.useRef(e);v.useEffect(function(){i.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=nu([e.lockRef.current],(e.shards||[]).map(Xs),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var p=bn(h),y=n.current,w="deltaX"in h?h.deltaX:y[0]-p[0],S="deltaY"in h?h.deltaY:y[1]-p[1],C,M=h.target,k=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&k==="h"&&M.type==="range")return!1;var O=Us(k,M);if(!O)return!0;if(O?C=k:(C=k==="v"?"h":"v",O=Us(k,M)),!O)return!1;if(!r.current&&"changedTouches"in h&&(w||S)&&(r.current=C),!C)return!0;var _=r.current||C;return Tu(_,b,h,_==="h"?w:S)},[]),c=v.useCallback(function(h){var b=h;if(!(!Et.length||Et[Et.length-1]!==s)){var p="deltaY"in b?Ks(b):bn(b),y=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&Au(C.delta,p)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var w=(i.current.shards||[]).map(Xs).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=w.length>0?a(b,w[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),l=v.useCallback(function(h,b,p,y){var w={name:h,delta:b,target:p,should:y,shadowParent:Iu(p)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=v.useCallback(function(h){n.current=bn(h),r.current=void 0},[]),d=v.useCallback(function(h){l(h.type,Ks(h),h.target,a(h,e.lockRef.current))},[]),f=v.useCallback(function(h){l(h.type,bn(h),h.target,a(h,e.lockRef.current))},[]);v.useEffect(function(){return Et.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,kt),document.addEventListener("touchmove",c,kt),document.addEventListener("touchstart",u,kt),function(){Et=Et.filter(function(h){return h!==s}),document.removeEventListener("wheel",c,kt),document.removeEventListener("touchmove",c,kt),document.removeEventListener("touchstart",u,kt)}},[]);var g=e.removeScrollBar,x=e.inert;return v.createElement(v.Fragment,null,x?v.createElement(s,{styles:Wu(o)}):null,g?v.createElement(ku,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Iu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bu=uu(Ys,Fu);var vr=v.forwardRef(function(e,t){return v.createElement(vn,We({},e,{ref:t,sideCar:Bu}))});vr.classNames=vn.classNames;var Lu=[" ","Enter","ArrowUp","ArrowDown"],$u=[" ","Enter"],it="Select",[wn,xn,Vu]=Oo(it),[Mt,pg]=gt(it,[Vu,fn]),Cn=fn(),[Hu,Ze]=Mt(it),[Yu,zu]=Mt(it),Qs=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:g,form:x}=e,h=Cn(t),[b,p]=v.useState(null),[y,w]=v.useState(null),[S,C]=v.useState(!1),M=No(l),[k,O]=_t({prop:r,defaultProp:o??!1,onChange:s,caller:it}),[_,W]=_t({prop:i,defaultProp:a,onChange:c,caller:it}),P=v.useRef(null),N=b?x||!!b.closest("form"):!0,[I,z]=v.useState(new Set),Y=Array.from(I).map(L=>L.props.value).join(";");return m.jsx(Ws,{...h,children:m.jsxs(Hu,{required:g,scope:t,trigger:b,onTriggerChange:p,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:tn(),value:_,onValueChange:W,open:k,onOpenChange:O,dir:M,triggerPointerDownPosRef:P,disabled:f,children:[m.jsx(wn.Provider,{scope:t,children:m.jsx(Yu,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(L=>{z(H=>new Set(H).add(L))},[]),onNativeOptionRemove:v.useCallback(L=>{z(H=>{const D=new Set(H);return D.delete(L),D})},[]),children:n})}),N?m.jsxs(xa,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:d,value:_,onChange:L=>W(L.target.value),disabled:f,form:x,children:[_===void 0?m.jsx("option",{value:""}):null,Array.from(I)]},Y):null]})})};Qs.displayName=it;var Zs="SelectTrigger",Js=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Cn(n),i=Ze(Zs,n),a=i.disabled||r,c=Z(t,i.onTriggerChange),l=xn(n),u=v.useRef("touch"),[d,f,g]=Sa(h=>{const b=l().filter(w=>!w.disabled),p=b.find(w=>w.value===i.value),y=ka(b,h,p);y!==void 0&&i.onValueChange(y.value)}),x=h=>{a||(i.onOpenChange(!0),g()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return m.jsx(dr,{asChild:!0,...s,children:m.jsx(q.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Ca(i.value)?"":void 0,...o,ref:c,onClick:U(o.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&x(h)}),onPointerDown:U(o.onPointerDown,h=>{u.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(x(h),h.preventDefault())}),onKeyDown:U(o.onKeyDown,h=>{const b=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&f(h.key),!(b&&h.key===" ")&&Lu.includes(h.key)&&(x(),h.preventDefault())})})})});Js.displayName=Zs;var ea="SelectValue",ta=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Ze(ea,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=Z(t,c.onValueNodeChange);return ue(()=>{l(u)},[l,u]),m.jsx(q.span,{...a,ref:d,style:{pointerEvents:"none"},children:Ca(c.value)?m.jsx(m.Fragment,{children:i}):s})});ta.displayName=ea;var ju="SelectIcon",na=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(q.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});na.displayName=ju;var Ru="SelectPortal",ra=e=>m.jsx(ur,{asChild:!0,...e});ra.displayName=Ru;var ct="SelectContent",oa=v.forwardRef((e,t)=>{const n=Ze(ct,e.__scopeSelect),[r,o]=v.useState();if(ue(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Xt.createPortal(m.jsx(sa,{scope:e.__scopeSelect,children:m.jsx(wn.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),s):null}return m.jsx(aa,{...e,ref:t})});oa.displayName=ct;var ke=10,[sa,Je]=Mt(ct),Uu="SelectContentImpl",qu=pt("SelectContent.RemoveScroll"),aa=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:x,hideWhenDetached:h,avoidCollisions:b,...p}=e,y=Ze(ct,n),[w,S]=v.useState(null),[C,M]=v.useState(null),k=Z(t,$=>S($)),[O,_]=v.useState(null),[W,P]=v.useState(null),N=xn(n),[I,z]=v.useState(!1),Y=v.useRef(!1);v.useEffect(()=>{if(w)return Ls(w)},[w]),Zo();const L=v.useCallback($=>{const[ee,...ce]=N().map(K=>K.ref.current),[te]=ce.slice(-1),G=document.activeElement;for(const K of $)if(K===G||(K==null||K.scrollIntoView({block:"nearest"}),K===ee&&C&&(C.scrollTop=0),K===te&&C&&(C.scrollTop=C.scrollHeight),K==null||K.focus(),document.activeElement!==G))return},[N,C]),H=v.useCallback(()=>L([O,w]),[L,O,w]);v.useEffect(()=>{I&&H()},[I,H]);const{onOpenChange:D,triggerPointerDownPosRef:B}=y;v.useEffect(()=>{if(w){let $={x:0,y:0};const ee=te=>{var G,K;$={x:Math.abs(Math.round(te.pageX)-(((G=B.current)==null?void 0:G.x)??0)),y:Math.abs(Math.round(te.pageY)-(((K=B.current)==null?void 0:K.y)??0))}},ce=te=>{$.x<=10&&$.y<=10?te.preventDefault():w.contains(te.target)||D(!1),document.removeEventListener("pointermove",ee),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",ce,{capture:!0})}}},[w,D,B]),v.useEffect(()=>{const $=()=>D(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[D]);const[R,oe]=Sa($=>{const ee=N().filter(G=>!G.disabled),ce=ee.find(G=>G.ref.current===document.activeElement),te=ka(ee,$,ce);te&&setTimeout(()=>te.ref.current.focus())}),Me=v.useCallback(($,ee,ce)=>{const te=!Y.current&&!ce;(y.value!==void 0&&y.value===ee||te)&&(_($),te&&(Y.current=!0))},[y.value]),Ne=v.useCallback(()=>w==null?void 0:w.focus(),[w]),be=v.useCallback(($,ee,ce)=>{const te=!Y.current&&!ce;(y.value!==void 0&&y.value===ee||te)&&P($)},[y.value]),Ue=r==="popper"?yr:ia,xe=Ue===yr?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:x,hideWhenDetached:h,avoidCollisions:b}:{};return m.jsx(sa,{scope:n,content:w,viewport:C,onViewportChange:M,itemRefCallback:Me,selectedItem:O,onItemLeave:Ne,itemTextRefCallback:be,focusSelectedItem:H,selectedItemText:W,position:r,isPositioned:I,searchRef:R,children:m.jsx(vr,{as:qu,allowPinchZoom:!0,children:m.jsx(Kn,{asChild:!0,trapped:y.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:U(o,$=>{var ee;(ee=y.trigger)==null||ee.focus({preventScroll:!0}),$.preventDefault()}),children:m.jsx(Rn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:m.jsx(Ue,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:$=>$.preventDefault(),...p,...xe,onPlaced:()=>z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:U(p.onKeyDown,$=>{const ee=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!ee&&$.key.length===1&&oe($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let te=N().filter(G=>!G.disabled).map(G=>G.ref.current);if(["ArrowUp","End"].includes($.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const G=$.target,K=te.indexOf(G);te=te.slice(K+1)}setTimeout(()=>L(te)),$.preventDefault()}})})})})})})});aa.displayName=Uu;var Gu="SelectItemAlignedPosition",ia=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Ze(ct,n),i=Je(ct,n),[a,c]=v.useState(null),[l,u]=v.useState(null),d=Z(t,k=>u(k)),f=xn(n),g=v.useRef(!1),x=v.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:p,focusSelectedItem:y}=i,w=v.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&h&&b&&p){const k=s.trigger.getBoundingClientRect(),O=l.getBoundingClientRect(),_=s.valueNode.getBoundingClientRect(),W=p.getBoundingClientRect();if(s.dir!=="rtl"){const G=W.left-O.left,K=_.left-G,me=k.left-K,we=k.width+me,dt=Math.max(we,O.width),ut=window.innerWidth-ke,ft=Jt(K,[ke,Math.max(ke,ut-dt)]);a.style.minWidth=we+"px",a.style.left=ft+"px"}else{const G=O.right-W.right,K=window.innerWidth-_.right-G,me=window.innerWidth-k.right-K,we=k.width+me,dt=Math.max(we,O.width),ut=window.innerWidth-ke,ft=Jt(K,[ke,Math.max(ke,ut-dt)]);a.style.minWidth=we+"px",a.style.right=ft+"px"}const P=f(),N=window.innerHeight-ke*2,I=h.scrollHeight,z=window.getComputedStyle(l),Y=parseInt(z.borderTopWidth,10),L=parseInt(z.paddingTop,10),H=parseInt(z.borderBottomWidth,10),D=parseInt(z.paddingBottom,10),B=Y+L+I+D+H,R=Math.min(b.offsetHeight*5,B),oe=window.getComputedStyle(h),Me=parseInt(oe.paddingTop,10),Ne=parseInt(oe.paddingBottom,10),be=k.top+k.height/2-ke,Ue=N-be,xe=b.offsetHeight/2,$=b.offsetTop+xe,ee=Y+L+$,ce=B-ee;if(ee<=be){const G=P.length>0&&b===P[P.length-1].ref.current;a.style.bottom="0px";const K=l.clientHeight-h.offsetTop-h.offsetHeight,me=Math.max(Ue,xe+(G?Ne:0)+K+H),we=ee+me;a.style.height=we+"px"}else{const G=P.length>0&&b===P[0].ref.current;a.style.top="0px";const me=Math.max(be,Y+h.offsetTop+(G?Me:0)+xe)+ce;a.style.height=me+"px",h.scrollTop=ee-be+h.offsetTop}a.style.margin=`${ke}px 0`,a.style.minHeight=R+"px",a.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,s.trigger,s.valueNode,a,l,h,b,p,s.dir,r]);ue(()=>w(),[w]);const[S,C]=v.useState();ue(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);const M=v.useCallback(k=>{k&&x.current===!0&&(w(),y==null||y(),x.current=!1)},[w,y]);return m.jsx(Xu,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:m.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:m.jsx(q.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ia.displayName=Gu;var Ku="SelectPopperPosition",yr=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ke,...s}=e,i=Cn(n);return m.jsx(_s,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});yr.displayName=Ku;var[Xu,br]=Mt(ct,{}),wr="SelectViewport",ca=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Je(wr,n),i=br(wr,n),a=Z(t,s.onViewportChange),c=v.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(wn.Slot,{scope:n,children:m.jsx(q.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:U(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const g=Math.abs(c.current-u.scrollTop);if(g>0){const x=window.innerHeight-ke*2,h=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),p=Math.max(h,b);if(p<x){const y=p+g,w=Math.min(x,y),S=y-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});ca.displayName=wr;var la="SelectGroup",[Qu,Zu]=Mt(la),Ju=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=tn();return m.jsx(Qu,{scope:n,id:o,children:m.jsx(q.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ju.displayName=la;var da="SelectLabel",ua=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Zu(da,n);return m.jsx(q.div,{id:o.id,...r,ref:t})});ua.displayName=da;var Sn="SelectItem",[ef,fa]=Mt(Sn),ha=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Ze(Sn,n),c=Je(Sn,n),l=a.value===r,[u,d]=v.useState(s??""),[f,g]=v.useState(!1),x=Z(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,r,o)}),h=tn(),b=v.useRef("touch"),p=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(ef,{scope:n,value:r,disabled:o,textId:h,isSelected:l,onItemTextChange:v.useCallback(y=>{d(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:m.jsx(wn.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:m.jsx(q.div,{role:"option","aria-labelledby":h,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:U(i.onFocus,()=>g(!0)),onBlur:U(i.onBlur,()=>g(!1)),onClick:U(i.onClick,()=>{b.current!=="mouse"&&p()}),onPointerUp:U(i.onPointerUp,()=>{b.current==="mouse"&&p()}),onPointerDown:U(i.onPointerDown,y=>{b.current=y.pointerType}),onPointerMove:U(i.onPointerMove,y=>{var w;b.current=y.pointerType,o?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(i.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:U(i.onKeyDown,y=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&y.key===" "||($u.includes(y.key)&&p(),y.key===" "&&y.preventDefault())})})})})});ha.displayName=Sn;var Lt="SelectItemText",ma=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Ze(Lt,n),a=Je(Lt,n),c=fa(Lt,n),l=zu(Lt,n),[u,d]=v.useState(null),f=Z(t,p=>d(p),c.onItemTextChange,p=>{var y;return(y=a.itemTextRefCallback)==null?void 0:y.call(a,p,c.value,c.disabled)}),g=u==null?void 0:u.textContent,x=v.useMemo(()=>m.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:h,onNativeOptionRemove:b}=l;return ue(()=>(h(x),()=>b(x)),[h,b,x]),m.jsxs(m.Fragment,{children:[m.jsx(q.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Xt.createPortal(s.children,i.valueNode):null]})});ma.displayName=Lt;var pa="SelectItemIndicator",ga=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fa(pa,n).isSelected?m.jsx(q.span,{"aria-hidden":!0,...r,ref:t}):null});ga.displayName=pa;var xr="SelectScrollUpButton",va=v.forwardRef((e,t)=>{const n=Je(xr,e.__scopeSelect),r=br(xr,e.__scopeSelect),[o,s]=v.useState(!1),i=Z(t,r.onScrollButtonChange);return ue(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?m.jsx(ba,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});va.displayName=xr;var Cr="SelectScrollDownButton",ya=v.forwardRef((e,t)=>{const n=Je(Cr,e.__scopeSelect),r=br(Cr,e.__scopeSelect),[o,s]=v.useState(!1),i=Z(t,r.onScrollButtonChange);return ue(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?m.jsx(ba,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});ya.displayName=Cr;var ba=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Je("SelectScrollButton",n),i=v.useRef(null),a=xn(n),c=v.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),ue(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),m.jsx(q.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:U(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:U(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:U(o.onPointerLeave,()=>{c()})})}),tf="SelectSeparator",wa=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(q.div,{"aria-hidden":!0,...r,ref:t})});wa.displayName=tf;var Sr="SelectArrow",nf=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Cn(n),s=Ze(Sr,n),i=Je(Sr,n);return s.open&&i.position==="popper"?m.jsx(Fs,{...o,...r,ref:t}):null});nf.displayName=Sr;var rf="SelectBubbleInput",xa=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=v.useRef(null),s=Z(r,o),i=Ln(t);return v.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),m.jsx(q.select,{...n,style:{...Is,...n.style},ref:s,defaultValue:t})});xa.displayName=rf;function Ca(e){return e===""||e===void 0}function Sa(e){const t=st(e),n=v.useRef(""),r=v.useRef(0),o=v.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ka(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=of(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function of(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sf=Qs,Ea=Js,af=ta,cf=na,lf=ra,Ma=oa,df=ca,Na=ua,Oa=ha,uf=ma,ff=ga,Pa=va,Da=ya,Ta=wa;const hf=sf,mf=af,Aa=v.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Ea,{ref:r,className:F("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,m.jsx(cf,{asChild:!0,children:m.jsx(In,{className:"h-4 w-4 opacity-50"})})]}));Aa.displayName=Ea.displayName;const Wa=v.forwardRef(({className:e,...t},n)=>m.jsx(Pa,{ref:n,className:F("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(bo,{className:"h-4 w-4"})}));Wa.displayName=Pa.displayName;const _a=v.forwardRef(({className:e,...t},n)=>m.jsx(Da,{ref:n,className:F("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(In,{className:"h-4 w-4"})}));_a.displayName=Da.displayName;const Fa=v.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>m.jsx(lf,{children:m.jsxs(Ma,{ref:o,className:F("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[m.jsx(Wa,{}),m.jsx(df,{className:F("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),m.jsx(_a,{})]})}));Fa.displayName=Ma.displayName;const pf=v.forwardRef(({className:e,...t},n)=>m.jsx(Na,{ref:n,className:F("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));pf.displayName=Na.displayName;const Ia=v.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Oa,{ref:r,className:F("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ff,{children:m.jsx(yo,{className:"h-4 w-4"})})}),m.jsx(uf,{children:t})]}));Ia.displayName=Oa.displayName;const gf=v.forwardRef(({className:e,...t},n)=>m.jsx(Ta,{ref:n,className:F("-mx-1 my-1 h-px bg-muted",e),...t}));gf.displayName=Ta.displayName;function vf(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var kn=e=>{const{present:t,children:n}=e,r=yf(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),s=Z(r.ref,bf(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:s}):null};kn.displayName="Presence";function yf(e){const[t,n]=v.useState(),r=v.useRef(null),o=v.useRef(e),s=v.useRef("none"),i=e?"mounted":"unmounted",[a,c]=vf(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=En(r.current);s.current=a==="mounted"?l:"none"},[a]),ue(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,g=En(l);e?c("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ue(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=g=>{const h=En(r.current).includes(g.animationName);if(g.target===t&&h&&(c("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=g=>{g.target===t&&(s.current=En(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function En(e){return(e==null?void 0:e.animationName)||"none"}function bf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mn="Checkbox",[wf,gg]=gt(Mn),[xf,kr]=wf(Mn);function Cf(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:d}=e,[f,g]=_t({prop:n,defaultProp:o??!1,onChange:c,caller:Mn}),[x,h]=v.useState(null),[b,p]=v.useState(null),y=v.useRef(!1),w=x?!!i||!!x.closest("form"):!0,S={checked:f,disabled:s,setChecked:g,control:x,setControl:h,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:et(o)?!1:o,isFormControl:w,bubbleInput:b,setBubbleInput:p};return m.jsx(xf,{scope:t,...S,children:Sf(d)?d(S):r})}var Ba="CheckboxTrigger",La=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:g,bubbleInput:x}=kr(Ba,e),h=Z(o,u),b=v.useRef(c);return v.useEffect(()=>{const p=s==null?void 0:s.form;if(p){const y=()=>d(b.current);return p.addEventListener("reset",y),()=>p.removeEventListener("reset",y)}},[s,d]),m.jsx(q.button,{type:"button",role:"checkbox","aria-checked":et(c)?"mixed":c,"aria-required":l,"data-state":za(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:h,onKeyDown:U(t,p=>{p.key==="Enter"&&p.preventDefault()}),onClick:U(n,p=>{d(y=>et(y)?!0:!y),x&&g&&(f.current=p.isPropagationStopped(),f.current||p.stopPropagation())})})});La.displayName=Ba;var Er=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:l,form:u,...d}=e;return m.jsx(Cf,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:f})=>m.jsxs(m.Fragment,{children:[m.jsx(La,{...d,ref:t,__scopeCheckbox:n}),f&&m.jsx(Ya,{__scopeCheckbox:n})]})})});Er.displayName=Mn;var $a="CheckboxIndicator",Va=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=kr($a,n);return m.jsx(kn,{present:r||et(s.checked)||s.checked===!0,children:m.jsx(q.span,{"data-state":za(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Va.displayName=$a;var Ha="CheckboxBubbleInput",Ya=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:g}=kr(Ha,e),x=Z(n,g),h=Ln(s),b=$n(r);v.useEffect(()=>{const y=f;if(!y)return;const w=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(w,"checked").set,M=!o.current;if(h!==s&&C){const k=new Event("click",{bubbles:M});y.indeterminate=et(s),C.call(y,et(s)?!1:s),y.dispatchEvent(k)}},[f,h,s,o]);const p=v.useRef(et(s)?!1:s);return m.jsx(q.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??p.current,required:a,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:x,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ya.displayName=Ha;function Sf(e){return typeof e=="function"}function et(e){return e==="indeterminate"}function za(e){return et(e)?"indeterminate":e?"checked":"unchecked"}const ja=v.forwardRef(({className:e,...t},n)=>m.jsx(Er,{ref:n,className:F("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:m.jsx(Va,{className:F("flex items-center justify-center text-current"),children:m.jsx(yo,{className:"h-4 w-4"})})}));ja.displayName=Er.displayName;const Ra=6048e5,kf=864e5,Ua=Symbol.for("constructDateFrom");function de(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ua in e?e[Ua](t):e instanceof Date?new e.constructor(t):new Date(t)}function J(e,t){return de(t||e,e)}function qa(e,t,n){const r=J(e,n==null?void 0:n.in);return isNaN(t)?de(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Ga(e,t,n){const r=J(e,n==null?void 0:n.in);if(isNaN(t))return de(e,NaN);if(!t)return r;const o=r.getDate(),s=de(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const i=s.getDate();return o>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),o),r)}let Ef={};function $t(){return Ef}function Nt(e,t){var a,c,l,u;const n=$t(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=J(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Vt(e,t){return Nt(e,{...t,weekStartsOn:1})}function Ka(e,t){const n=J(e,t==null?void 0:t.in),r=n.getFullYear(),o=de(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Vt(o),i=de(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Vt(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Xa(e){const t=J(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ot(e,...t){const n=de.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ht(e,t){const n=J(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Qa(e,t,n){const[r,o]=Ot(n==null?void 0:n.in,e,t),s=Ht(r),i=Ht(o),a=+s-Xa(s),c=+i-Xa(i);return Math.round((a-c)/kf)}function Mf(e,t){const n=Ka(e,t),r=de(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Vt(r)}function Nf(e,t,n){return qa(e,t*7,n)}function Of(e,t,n){return Ga(e,t*12,n)}function Pf(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=de.bind(null,o));const s=J(o,r);(!n||n<s||isNaN(+s))&&(n=s)}),de(r,n||NaN)}function Df(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=de.bind(null,o));const s=J(o,r);(!n||n>s||isNaN(+s))&&(n=s)}),de(r,n||NaN)}function Tf(e,t,n){const[r,o]=Ot(n==null?void 0:n.in,e,t);return+Ht(r)==+Ht(o)}function Za(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Af(e){return!(!Za(e)&&typeof e!="number"||isNaN(+J(e)))}function Wf(e,t,n){const[r,o]=Ot(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function _f(e,t){const n=J(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Ff(e,t){const[n,r]=Ot(e,t.start,t.end);return{start:n,end:r}}function If(e,t){const{start:n,end:r}=Ff(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let a=1;const c=[];for(;+i<=s;)c.push(de(n,i)),i.setMonth(i.getMonth()+a);return o?c.reverse():c}function Bf(e,t){const n=J(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Lf(e,t){const n=J(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Ja(e,t){const n=J(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ei(e,t){var a,c,l,u;const n=$t(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,o=J(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?-7:0)+6-(s-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function $f(e,t){return ei(e,{...t,weekStartsOn:1})}const Vf={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hf=(e,t,n)=>{let r;const o=Vf[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Mr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rf={date:Mr({formats:Yf,defaultWidth:"full"}),time:Mr({formats:zf,defaultWidth:"full"}),dateTime:Mr({formats:jf,defaultWidth:"full"})},Uf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qf=(e,t,n,r)=>Uf[e];function Yt(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Gf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Kf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Qf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Zf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Jf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},eh={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Yt({values:Gf,defaultWidth:"wide"}),quarter:Yt({values:Kf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Xf,defaultWidth:"wide"}),day:Yt({values:Qf,defaultWidth:"wide"}),dayPeriod:Yt({values:Zf,defaultWidth:"wide",formattingValues:Jf,defaultFormattingWidth:"wide"})};function zt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?nh(a,d=>d.test(i)):th(a,d=>d.test(i));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(i.length);return{value:l,rest:u}}}function th(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function nh(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function rh(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const oh=/^(\d+)(th|st|nd|rd)?/i,sh=/\d+/i,ah={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ih={any:[/^b/i,/^(a|c)/i]},ch={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lh={any:[/1/i,/2/i,/3/i,/4/i]},dh={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uh={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fh={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hh={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},mh={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ph={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gh={ordinalNumber:rh({matchPattern:oh,parsePattern:sh,valueCallback:e=>parseInt(e,10)}),era:zt({matchPatterns:ah,defaultMatchWidth:"wide",parsePatterns:ih,defaultParseWidth:"any"}),quarter:zt({matchPatterns:ch,defaultMatchWidth:"wide",parsePatterns:lh,defaultParseWidth:"any",valueCallback:e=>e+1}),month:zt({matchPatterns:dh,defaultMatchWidth:"wide",parsePatterns:uh,defaultParseWidth:"any"}),day:zt({matchPatterns:fh,defaultMatchWidth:"wide",parsePatterns:hh,defaultParseWidth:"any"}),dayPeriod:zt({matchPatterns:mh,defaultMatchWidth:"any",parsePatterns:ph,defaultParseWidth:"any"})},Nr={code:"en-US",formatDistance:Hf,formatLong:Rf,formatRelative:qf,localize:eh,match:gh,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vh(e,t){const n=J(e,t==null?void 0:t.in);return Qa(n,Ja(n))+1}function ti(e,t){const n=J(e,t==null?void 0:t.in),r=+Vt(n)-+Mf(n);return Math.round(r/Ra)+1}function ni(e,t){var u,d,f,g;const n=J(e,t==null?void 0:t.in),r=n.getFullYear(),o=$t(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((g=(f=o.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,i=de((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=Nt(i,t),c=de((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const l=Nt(c,t);return+n>=+a?r+1:+n>=+l?r:r-1}function yh(e,t){var a,c,l,u;const n=$t(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,o=ni(e,t),s=de((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Nt(s,t)}function ri(e,t){const n=J(e,t==null?void 0:t.in),r=+Nt(n,t)-+yh(n,t);return Math.round(r/Ra)+1}function X(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const tt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return X(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):X(n+1,2)},d(e,t){return X(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return X(e.getHours()%12||12,t.length)},H(e,t){return X(e.getHours(),t.length)},m(e,t){return X(e.getMinutes(),t.length)},s(e,t){return X(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return X(o,t.length)}},Pt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},oi={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return tt.y(e,t)},Y:function(e,t,n,r){const o=ni(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return X(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):X(s,t.length)},R:function(e,t){const n=Ka(e);return X(n,t.length)},u:function(e,t){const n=e.getFullYear();return X(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return X(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return X(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return tt.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return X(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=ri(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):X(o,t.length)},I:function(e,t,n){const r=ti(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):X(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):tt.d(e,t)},D:function(e,t,n){const r=vh(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):X(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return X(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return X(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return X(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Pt.noon:r===0?o=Pt.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Pt.evening:r>=12?o=Pt.afternoon:r>=4?o=Pt.morning:o=Pt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return tt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):tt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):X(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):X(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tt.s(e,t)},S:function(e,t){return tt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ai(r);case"XXXX":case"XX":return lt(r);case"XXXXX":case"XXX":default:return lt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ai(r);case"xxxx":case"xx":return lt(r);case"xxxxx":case"xxx":default:return lt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+si(r,":");case"OOOO":default:return"GMT"+lt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+si(r,":");case"zzzz":default:return"GMT"+lt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return X(r,t.length)},T:function(e,t,n){return X(+e,t.length)}};function si(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+X(s,2)}function ai(e,t){return e%60===0?(e>0?"-":"+")+X(Math.abs(e)/60,2):lt(e,t)}function lt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=X(Math.trunc(r/60),2),s=X(r%60,2);return n+o+t+s}const ii=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ci=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},bh={p:ci,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return ii(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ii(r,t)).replace("{{time}}",ci(o,t))}},wh=/^D+$/,xh=/^Y+$/,Ch=["D","DD","YY","YYYY"];function Sh(e){return wh.test(e)}function kh(e){return xh.test(e)}function Eh(e,t,n){const r=Mh(e,t,n);if(console.warn(r),Ch.includes(e))throw new RangeError(r)}function Mh(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Nh=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Oh=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ph=/^'([^]*?)'?$/,Dh=/''/g,Th=/[a-zA-Z]/;function Or(e,t,n){var u,d,f,g,x,h,b,p;const r=$t(),o=(n==null?void 0:n.locale)??r.locale??Nr,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((h=(x=n==null?void 0:n.locale)==null?void 0:x.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((p=(b=r.locale)==null?void 0:b.options)==null?void 0:p.weekStartsOn)??0,a=J(e,n==null?void 0:n.in);if(!Af(a))throw new RangeError("Invalid time value");let c=t.match(Oh).map(y=>{const w=y[0];if(w==="p"||w==="P"){const S=bh[w];return S(y,o.formatLong)}return y}).join("").match(Nh).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Ah(y)};if(oi[w])return{isToken:!0,value:y};if(w.match(Th))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});o.localize.preprocessor&&(c=o.localize.preprocessor(a,c));const l={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&kh(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Sh(w))&&Eh(w,t,String(e));const S=oi[w[0]];return S(a,w,o.localize,l)}).join("")}function Ah(e){const t=e.match(Ph);return t?t[1].replace(Dh,"'"):e}function Wh(e,t){const n=J(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),s=de(n,0);return s.setFullYear(r,o+1,0),s.setHours(0,0,0,0),s.getDate()}function _h(e,t){return J(e,t==null?void 0:t.in).getMonth()}function Fh(e,t){return J(e,t==null?void 0:t.in).getFullYear()}function Ih(e,t){return+J(e)>+J(t)}function Bh(e,t){return+J(e)<+J(t)}function Lh(e,t,n){const[r,o]=Ot(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function $h(e,t,n){const[r,o]=Ot(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function Vh(e,t,n){const r=J(e,n==null?void 0:n.in),o=r.getFullYear(),s=r.getDate(),i=de(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const a=Wh(i);return r.setMonth(t,Math.min(s,a)),r}function Hh(e,t,n){const r=J(e,n==null?void 0:n.in);return isNaN(+r)?de(e,NaN):(r.setFullYear(t),r)}const Pr={},jt={};function Rt(e,t){try{const r=(Pr[e]||(Pr[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in jt?jt[r]:li(r,r.split(":"))}catch{if(e in jt)return jt[e];const n=e==null?void 0:e.match(Yh);return n?li(e,n.slice(1)):NaN}}const Yh=/([+-]\d\d):?(\d\d)?/;function li(e,t){const n=+t[0],r=+(t[1]||0);return jt[e]=n>0?n*60+r:n*60-r}class _e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Rt(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),ui(this),Dr(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new _e(...n,t):new _e(Date.now(),t)}withTimeZone(t){return new _e(+this,t)}getTimezoneOffset(){return-Rt(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Dr(this),+this}[Symbol.for("constructDateFrom")](t){return new _e(+new Date(t),this.timeZone)}}const di=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!di.test(e))return;const t=e.replace(di,"$1UTC");_e.prototype[t]&&(e.startsWith("get")?_e.prototype[e]=function(){return this.internal[t]()}:(_e.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),zh(this),+this},_e.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Dr(this),+this}))});function Dr(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function zh(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),ui(e)}function ui(e){const t=Rt(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=-new Date(+n).getTimezoneOffset(),s=r-o,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);const a=r-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);const c=Rt(e.timeZone,e),u=-new Date(+e).getTimezoneOffset()-c,d=c!==t,f=u-a;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const g=Rt(e.timeZone,e),x=c-g;x&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x))}}class fe extends _e{static tz(t,...n){return n.length?new fe(...n,t):new fe(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${jh(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new fe(+this,t)}[Symbol.for("constructDateFrom")](t){return new fe(+new Date(t),this.timeZone)}}function jh(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}var A;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(A||(A={}));var ae;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ae||(ae={}));var Ee;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Ee||(Ee={}));var ye;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(ye||(ye={}));const fi=5,Rh=4;function Uh(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),s=t.addDays(o,fi*7-1);return t.getMonth(e)===t.getMonth(s)?fi:Rh}function hi(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function qh(e,t){const n=hi(e,t),r=Uh(e,t);return t.addDays(n,r*7-1)}class ze{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?fe.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,s)=>{var i;return(i=this.overrides)!=null&&i.newDate?this.overrides.newDate(r,o,s):this.options.timeZone?new fe(r,o,s,this.options.timeZone):new Date(r,o,s)},this.addDays=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addDays?this.overrides.addDays(r,o):qa(r,o)},this.addMonths=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addMonths?this.overrides.addMonths(r,o):Ga(r,o)},this.addWeeks=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addWeeks?this.overrides.addWeeks(r,o):Nf(r,o)},this.addYears=(r,o)=>{var s;return(s=this.overrides)!=null&&s.addYears?this.overrides.addYears(r,o):Of(r,o)},this.differenceInCalendarDays=(r,o)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Qa(r,o)},this.differenceInCalendarMonths=(r,o)=>{var s;return(s=this.overrides)!=null&&s.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Wf(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):If(r)},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):qh(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):$f(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):_f(r)},this.endOfWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.endOfWeek?this.overrides.endOfWeek(r,o):ei(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):Lf(r)},this.format=(r,o,s)=>{var a;const i=(a=this.overrides)!=null&&a.format?this.overrides.format(r,o,this.options):Or(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):ti(r)},this.getMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getMonth?this.overrides.getMonth(r,this.options):_h(r,this.options)},this.getYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getYear?this.overrides.getYear(r,this.options):Fh(r,this.options)},this.getWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.getWeek?this.overrides.getWeek(r,this.options):ri(r,this.options)},this.isAfter=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isAfter?this.overrides.isAfter(r,o):Ih(r,o)},this.isBefore=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isBefore?this.overrides.isBefore(r,o):Bh(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Za(r)},this.isSameDay=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameDay?this.overrides.isSameDay(r,o):Tf(r,o)},this.isSameMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameMonth?this.overrides.isSameMonth(r,o):Lh(r,o)},this.isSameYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.isSameYear?this.overrides.isSameYear(r,o):$h(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):Pf(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):Df(r)},this.setMonth=(r,o)=>{var s;return(s=this.overrides)!=null&&s.setMonth?this.overrides.setMonth(r,o):Vh(r,o)},this.setYear=(r,o)=>{var s;return(s=this.overrides)!=null&&s.setYear?this.overrides.setYear(r,o):Hh(r,o)},this.startOfBroadcastWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):hi(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):Ht(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):Vt(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):Bf(r)},this.startOfWeek=(r,o)=>{var s;return(s=this.overrides)!=null&&s.startOfWeek?this.overrides.startOfWeek(r,this.options):Nt(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Ja(r)},this.options={locale:Nr,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}}const Fe=new ze;class mi{constructor(t,n,r=Fe){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class Gh{constructor(t,n){this.date=t,this.weeks=n}}class Kh{constructor(t,n){this.days=n,this.weekNumber=t}}function je(e,t,n=!1,r=Fe){let{from:o,to:s}=e;const{differenceInCalendarDays:i,isSameDay:a}=r;return o&&s?(i(s,o)<0&&([o,s]=[s,o]),i(t,o)>=(n?1:0)&&i(s,t)>=(n?1:0)):!n&&s?a(s,t):!n&&o?a(o,t):!1}function pi(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Tr(e){return!!(e&&typeof e=="object"&&"from"in e)}function gi(e){return!!(e&&typeof e=="object"&&"after"in e)}function vi(e){return!!(e&&typeof e=="object"&&"before"in e)}function yi(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function bi(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Re(e,t,n=Fe){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:s,isAfter:i}=n;return r.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return o(e,a);if(bi(a,n))return a.includes(e);if(Tr(a))return je(a,e,!1,n);if(yi(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(pi(a)){const c=s(a.before,e),l=s(a.after,e),u=c>0,d=l<0;return i(a.before,a.after)?d&&u:u||d}return gi(a)?s(e,a.after)>0:vi(a)?s(a.before,e)>0:typeof a=="function"?a(e):!1})}function Xh(e,t,n){const{disabled:r,hidden:o,modifiers:s,showOutsideDays:i,broadcastCalendar:a,today:c}=t,{isSameDay:l,isSameMonth:u,startOfMonth:d,isBefore:f,endOfMonth:g,isAfter:x}=n,h=t.startMonth&&d(t.startMonth),b=t.endMonth&&g(t.endMonth),p={[ae.focused]:[],[ae.outside]:[],[ae.disabled]:[],[ae.hidden]:[],[ae.today]:[]},y={};for(const w of e){const{date:S,displayMonth:C}=w,M=!!(C&&!u(S,C)),k=!!(h&&f(S,h)),O=!!(b&&x(S,b)),_=!!(r&&Re(S,r,n)),W=!!(o&&Re(S,o,n))||k||O||!a&&!i&&M||a&&i===!1&&M,P=l(S,c??n.today());M&&p.outside.push(w),_&&p.disabled.push(w),W&&p.hidden.push(w),P&&p.today.push(w),s&&Object.keys(s).forEach(N=>{const I=s==null?void 0:s[N];I&&Re(S,I,n)&&(y[N]?y[N].push(w):y[N]=[w])})}return w=>{const S={[ae.focused]:!1,[ae.disabled]:!1,[ae.hidden]:!1,[ae.outside]:!1,[ae.today]:!1},C={};for(const M in p){const k=p[M];S[M]=k.some(O=>O===w)}for(const M in y)C[M]=y[M].some(k=>k===w);return{...S,...C}}}function Qh(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[s])=>(n[s]?o.push(n[s]):t[ae[s]]?o.push(t[ae[s]]):t[Ee[s]]&&o.push(t[Ee[s]]),o),[t[A.Day]])}function Zh(e){return E.createElement("button",{...e})}function Jh(e){return E.createElement("span",{...e})}function em(e){const{size:t=24,orientation:n="left",className:r}=e;return E.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&E.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&E.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&E.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&E.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function tm(e){const{day:t,modifiers:n,...r}=e;return E.createElement("td",{...r})}function nm(e){const{day:t,modifiers:n,...r}=e,o=E.useRef(null);return E.useEffect(()=>{var s;n.focused&&((s=o.current)==null||s.focus())},[n.focused]),E.createElement("button",{ref:o,...r})}function rm(e){const{options:t,className:n,components:r,classNames:o,...s}=e,i=[o[A.Dropdown],n].join(" "),a=t==null?void 0:t.find(({value:c})=>c===s.value);return E.createElement("span",{"data-disabled":s.disabled,className:o[A.DropdownRoot]},E.createElement(r.Select,{className:i,...s},t==null?void 0:t.map(({value:c,label:l,disabled:u})=>E.createElement(r.Option,{key:c,value:c,disabled:u},l))),E.createElement("span",{className:o[A.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,E.createElement(r.Chevron,{orientation:"down",size:18,className:o[A.Chevron]})))}function om(e){return E.createElement("div",{...e})}function sm(e){return E.createElement("div",{...e})}function am(e){const{calendarMonth:t,displayIndex:n,...r}=e;return E.createElement("div",{...r},e.children)}function im(e){const{calendarMonth:t,displayIndex:n,...r}=e;return E.createElement("div",{...r})}function cm(e){return E.createElement("table",{...e})}function lm(e){return E.createElement("div",{...e})}const wi=E.createContext(void 0);function Ut(){const e=E.useContext(wi);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function dm(e){const{components:t}=Ut();return E.createElement(t.Dropdown,{...e})}function um(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...s}=e,{components:i,classNames:a,labels:{labelPrevious:c,labelNext:l}}=Ut(),u=E.useCallback(f=>{o&&(n==null||n(f))},[o,n]),d=E.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return E.createElement("nav",{...s},E.createElement(i.PreviousMonthButton,{type:"button",className:a[A.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},E.createElement(i.Chevron,{disabled:r?void 0:!0,className:a[A.Chevron],orientation:"left"})),E.createElement(i.NextMonthButton,{type:"button",className:a[A.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":l(o),onClick:u},E.createElement(i.Chevron,{disabled:o?void 0:!0,orientation:"right",className:a[A.Chevron]})))}function fm(e){const{components:t}=Ut();return E.createElement(t.Button,{...e})}function hm(e){return E.createElement("option",{...e})}function mm(e){const{components:t}=Ut();return E.createElement(t.Button,{...e})}function pm(e){const{rootRef:t,...n}=e;return E.createElement("div",{...n,ref:t})}function gm(e){return E.createElement("select",{...e})}function vm(e){const{week:t,...n}=e;return E.createElement("tr",{...n})}function ym(e){return E.createElement("th",{...e})}function bm(e){return E.createElement("thead",{"aria-hidden":!0},E.createElement("tr",{...e}))}function wm(e){const{week:t,...n}=e;return E.createElement("th",{...n})}function xm(e){return E.createElement("th",{...e})}function Cm(e){return E.createElement("tbody",{...e})}function Sm(e){const{components:t}=Ut();return E.createElement(t.Dropdown,{...e})}const km=Object.freeze(Object.defineProperty({__proto__:null,Button:Zh,CaptionLabel:Jh,Chevron:em,Day:tm,DayButton:nm,Dropdown:rm,DropdownNav:om,Footer:sm,Month:am,MonthCaption:im,MonthGrid:cm,Months:lm,MonthsDropdown:dm,Nav:um,NextMonthButton:fm,Option:hm,PreviousMonthButton:mm,Root:pm,Select:gm,Week:vm,WeekNumber:wm,WeekNumberHeader:xm,Weekday:ym,Weekdays:bm,Weeks:Cm,YearsDropdown:Sm},Symbol.toStringTag,{value:"Module"}));function Em(e){return{...km,...e}}function Mm(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function Nm(){const e={};for(const t in A)e[A[t]]=`rdp-${A[t]}`;for(const t in ae)e[ae[t]]=`rdp-${ae[t]}`;for(const t in Ee)e[Ee[t]]=`rdp-${Ee[t]}`;for(const t in ye)e[ye[t]]=`rdp-${ye[t]}`;return e}function xi(e,t,n){return(n??new ze(t)).format(e,"LLLL y")}const Om=xi;function Pm(e,t,n){return(n??new ze(t)).format(e,"d")}function Dm(e,t=Fe){return t.format(e,"LLLL")}function Tm(e,t=Fe){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function Am(){return""}function Wm(e,t,n){return(n??new ze(t)).format(e,"cccccc")}function Ci(e,t=Fe){return t.format(e,"yyyy")}const _m=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:xi,formatDay:Pm,formatMonthCaption:Om,formatMonthDropdown:Dm,formatWeekNumber:Tm,formatWeekNumberHeader:Am,formatWeekdayName:Wm,formatYearCaption:Ci,formatYearDropdown:Ci},Symbol.toStringTag,{value:"Module"}));function Fm(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{..._m,...e}}function Im(e,t,n,r,o){const{startOfMonth:s,startOfYear:i,endOfYear:a,eachMonthOfInterval:c,getMonth:l}=o;return c({start:i(e),end:a(e)}).map(f=>{const g=r.formatMonthDropdown(f,o),x=l(f),h=t&&f<s(t)||n&&f>s(n)||!1;return{value:x,label:g,disabled:h}})}function Bm(e,t={},n={}){let r={...t==null?void 0:t[A.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function Lm(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),s=[];for(let i=0;i<7;i++){const a=e.addDays(o,i);s.push(a)}return s}function $m(e,t,n,r){if(!e||!t)return;const{startOfYear:o,endOfYear:s,addYears:i,getYear:a,isBefore:c,isSameYear:l}=r,u=o(e),d=s(t),f=[];let g=u;for(;c(g,d)||l(g,d);)f.push(g),g=i(g,1);return f.map(x=>{const h=n.formatYearDropdown(x,r);return{value:a(x),label:h,disabled:!1}})}function Si(e,t,n){return(n??new ze(t)).format(e,"LLLL y")}const Vm=Si;function Hm(e,t,n,r){let o=(r??new ze(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function ki(e,t,n,r){let o=(r??new ze(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const Ym=ki;function zm(){return""}function jm(e){return"Choose the Month"}function Rm(e){return"Go to the Next Month"}function Um(e){return"Go to the Previous Month"}function qm(e,t,n){return(n??new ze(t)).format(e,"cccc")}function Gm(e,t){return`Week ${e}`}function Km(e){return"Week Number"}function Xm(e){return"Choose the Year"}const Qm=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Vm,labelDay:Ym,labelDayButton:ki,labelGrid:Si,labelGridcell:Hm,labelMonthDropdown:jm,labelNav:zm,labelNext:Rm,labelPrevious:Um,labelWeekNumber:Gm,labelWeekNumberHeader:Km,labelWeekday:qm,labelYearDropdown:Xm},Symbol.toStringTag,{value:"Module"})),qt=e=>e instanceof HTMLElement?e:null,Ar=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Zm=e=>qt(e.querySelector("[data-animated-month]")),Wr=e=>qt(e.querySelector("[data-animated-caption]")),_r=e=>qt(e.querySelector("[data-animated-weeks]")),Jm=e=>qt(e.querySelector("[data-animated-nav]")),ep=e=>qt(e.querySelector("[data-animated-weekdays]"));function tp(e,t,{classNames:n,months:r,focused:o,dateLib:s}){const i=E.useRef(null),a=E.useRef(r),c=E.useRef(!1);E.useLayoutEffect(()=>{const l=a.current;if(a.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const u=s.isSameMonth(r[0].date,l[0].date),d=s.isAfter(r[0].date,l[0].date),f=d?n[ye.caption_after_enter]:n[ye.caption_before_enter],g=d?n[ye.weeks_after_enter]:n[ye.weeks_before_enter],x=i.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(Ar(h).forEach(w=>{if(!(w instanceof HTMLElement))return;const S=Zm(w);S&&w.contains(S)&&w.removeChild(S);const C=Wr(w);C&&C.classList.remove(f);const M=_r(w);M&&M.classList.remove(g)}),i.current=h):i.current=null,c.current||u||o)return;const b=x instanceof HTMLElement?Ar(x):[],p=Ar(e.current);if(p&&p.every(y=>y instanceof HTMLElement)&&b&&b.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=Jm(e.current);y&&(y.style.zIndex="1"),p.forEach((w,S)=>{const C=b[S];if(!C)return;w.style.position="relative",w.style.overflow="hidden";const M=Wr(w);M&&M.classList.add(f);const k=_r(w);k&&k.classList.add(g);const O=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),M&&M.classList.remove(f),k&&k.classList.remove(g),w.style.position="",w.style.overflow="",w.contains(C)&&w.removeChild(C)};C.style.pointerEvents="none",C.style.position="absolute",C.style.overflow="hidden",C.setAttribute("aria-hidden","true");const _=ep(C);_&&(_.style.opacity="0");const W=Wr(C);W&&(W.classList.add(d?n[ye.caption_before_exit]:n[ye.caption_after_exit]),W.addEventListener("animationend",O));const P=_r(C);P&&P.classList.add(d?n[ye.weeks_before_exit]:n[ye.weeks_after_exit]),w.insertBefore(C,w.firstChild)})}})}function np(e,t,n,r){const o=e[0],s=e[e.length-1],{ISOWeek:i,fixedWeeks:a,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:g,endOfMonth:x,endOfWeek:h,isAfter:b,startOfBroadcastWeek:p,startOfISOWeek:y,startOfWeek:w}=r,S=c?p(o,r):i?y(o):w(o),C=c?f(s):i?g(x(s)):h(x(s)),M=u(C,S),k=d(s,o)+1,O=[];for(let P=0;P<=M;P++){const N=l(S,P);if(t&&b(N,t))break;O.push(N)}const W=(c?35:42)*k;if(a&&O.length<W){const P=W-O.length;for(let N=0;N<P;N++){const I=l(O[O.length-1],1);O.push(I)}}return O}function rp(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((s,i)=>[...s,...i.days],t);return[...n,...o]},t)}function op(e,t,n,r){const{numberOfMonths:o=1}=n,s=[];for(let i=0;i<o;i++){const a=r.addMonths(e,i);if(t&&a>t)break;s.push(a)}return s}function Ei(e,t){const{month:n,defaultMonth:r,today:o=t.today(),numberOfMonths:s=1,endMonth:i,startMonth:a}=e;let c=n||r||o;const{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=t;if(i&&l(i,c)<0){const f=-1*(s-1);c=u(i,f)}return a&&l(c,a)<0&&(c=a),d(c)}function sp(e,t,n,r){const{addDays:o,endOfBroadcastWeek:s,endOfISOWeek:i,endOfMonth:a,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:g}=r,x=e.reduce((h,b)=>{const p=n.broadcastCalendar?d(b,r):n.ISOWeek?f(b):g(b),y=n.broadcastCalendar?s(b):n.ISOWeek?i(a(b)):c(a(b)),w=t.filter(k=>k>=p&&k<=y),S=n.broadcastCalendar?35:42;if(n.fixedWeeks&&w.length<S){const k=t.filter(O=>{const _=S-w.length;return O>y&&O<=o(y,_)});w.push(...k)}const C=w.reduce((k,O)=>{const _=n.ISOWeek?l(O):u(O),W=k.find(N=>N.weekNumber===_),P=new mi(O,b,r);return W?W.days.push(P):k.push(new Kh(_,[P])),k},[]),M=new Gh(b,C);return h.push(M),h},[]);return n.reverseMonths?x.reverse():x}function ap(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:s,startOfMonth:i,endOfMonth:a,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:g,fromMonth:x,toMonth:h}=e;!n&&x&&(n=x),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&g&&(r=u(g,11,31));const b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):f?n=u(f,0,1):!n&&b&&(n=o(c(e.today??d(),-100))),r?r=a(r):g?r=u(g,11,31):!r&&b&&(r=l(e.today??d())),[n&&s(n),r&&s(r)]}function ip(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s=1}=n,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=r,l=o?s:1,u=i(e);if(!t)return a(u,l);if(!(c(t,e)<s))return a(u,l)}function cp(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:s}=n,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=r,l=o?s??1:1,u=i(e);if(!t)return a(u,-l);if(!(c(u,t)<=0))return a(u,-l)}function lp(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function Nn(e,t){const[n,r]=E.useState(e);return[t===void 0?n:t,r]}function dp(e,t){const[n,r]=ap(e,t),{startOfMonth:o,endOfMonth:s}=t,i=Ei(e,t),[a,c]=Nn(i,e.month?i:void 0);E.useEffect(()=>{const M=Ei(e,t);c(M)},[e.timeZone]);const l=op(a,r,e,t),u=np(l,e.endMonth?s(e.endMonth):void 0,e,t),d=sp(l,u,e,t),f=lp(d),g=rp(d),x=cp(a,n,e,t),h=ip(a,r,e,t),{disableNavigation:b,onMonthChange:p}=e,y=M=>f.some(k=>k.days.some(O=>O.isEqualTo(M))),w=M=>{if(b)return;let k=o(M);n&&k<o(n)&&(k=o(n)),r&&k>o(r)&&(k=o(r)),c(k),p==null||p(k)};return{months:d,weeks:f,days:g,navStart:n,navEnd:r,previousMonth:x,nextMonth:h,goToMonth:w,goToDay:M=>{y(M)||w(M.date)}}}var Ie;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ie||(Ie={}));function Mi(e){return!e[ae.disabled]&&!e[ae.hidden]&&!e[ae.outside]}function up(e,t,n,r){let o,s=-1;for(const i of e){const a=t(i);Mi(a)&&(a[ae.focused]&&s<Ie.FocusedModifier?(o=i,s=Ie.FocusedModifier):r!=null&&r.isEqualTo(i)&&s<Ie.LastFocused?(o=i,s=Ie.LastFocused):n(i.date)&&s<Ie.Selected?(o=i,s=Ie.Selected):a[ae.today]&&s<Ie.Today&&(o=i,s=Ie.Today))}return o||(o=e.find(i=>Mi(t(i)))),o}function fp(e,t,n,r,o,s,i){const{ISOWeek:a,broadcastCalendar:c}=s,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:g,endOfISOWeek:x,endOfWeek:h,max:b,min:p,startOfBroadcastWeek:y,startOfISOWeek:w,startOfWeek:S}=i;let M={day:l,week:d,month:u,year:f,startOfWeek:k=>c?y(k,i):a?w(k):S(k),endOfWeek:k=>c?g(k):a?x(k):h(k)}[e](n,t==="after"?1:-1);return t==="before"&&r?M=b([r,M]):t==="after"&&o&&(M=p([o,M])),M}function Ni(e,t,n,r,o,s,i,a=0){if(a>365)return;const c=fp(e,t,n.date,r,o,s,i),l=!!(s.disabled&&Re(c,s.disabled,i)),u=!!(s.hidden&&Re(c,s.hidden,i)),d=c,f=new mi(c,d,i);return!l&&!u?f:Ni(e,t,f,r,o,s,i,a+1)}function hp(e,t,n,r,o){const{autoFocus:s}=e,[i,a]=E.useState(),c=up(t.days,n,r||(()=>!1),i),[l,u]=E.useState(s?c:void 0);return{isFocusTarget:h=>!!(c!=null&&c.isEqualTo(h)),setFocused:u,focused:l,blur:()=>{a(l),u(void 0)},moveFocus:(h,b)=>{if(!l)return;const p=Ni(h,b,l,t.navStart,t.navEnd,e,o);p&&(t.goToDay(p),u(p))}}}function mp(e,t){const{selected:n,required:r,onSelect:o}=e,[s,i]=Nn(n,o?n:void 0),a=o?n:s,{isSameDay:c}=t,l=g=>(a==null?void 0:a.some(x=>c(x,g)))??!1,{min:u,max:d}=e;return{selected:a,select:(g,x,h)=>{let b=[...a??[]];if(l(g)){if((a==null?void 0:a.length)===u||r&&(a==null?void 0:a.length)===1)return;b=a==null?void 0:a.filter(p=>!c(p,g))}else(a==null?void 0:a.length)===d?b=[g]:b=[...b,g];return o||i(b),o==null||o(b,g,x,h),b},isSelected:l}}function pp(e,t,n=0,r=0,o=!1,s=Fe){const{from:i,to:a}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=s;let d;if(!i&&!a)d={from:e,to:n>0?void 0:e};else if(i&&!a)c(i,e)?o?d={from:i,to:void 0}:d=void 0:u(e,i)?d={from:e,to:i}:d={from:i,to:e};else if(i&&a)if(c(i,e)&&c(a,e))o?d={from:i,to:a}:d=void 0;else if(c(i,e))d={from:i,to:n>0?void 0:e};else if(c(a,e))d={from:e,to:n>0?void 0:e};else if(u(e,i))d={from:e,to:a};else if(l(e,i))d={from:i,to:e};else if(l(e,a))d={from:i,to:e};else throw new Error("Invalid range");if(d!=null&&d.from&&(d!=null&&d.to)){const f=s.differenceInCalendarDays(d.to,d.from);r>0&&f>r?d={from:e,to:void 0}:n>1&&f<n&&(d={from:e,to:void 0})}return d}function gp(e,t,n=Fe){const r=Array.isArray(t)?t:[t];let o=e.from;const s=n.differenceInCalendarDays(e.to,e.from),i=Math.min(s,6);for(let a=0;a<=i;a++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function Oi(e,t,n=Fe){return je(e,t.from,!1,n)||je(e,t.to,!1,n)||je(t,e.from,!1,n)||je(t,e.to,!1,n)}function vp(e,t,n=Fe){const r=Array.isArray(t)?t:[t];if(r.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?je(e,a,!1,n):bi(a,n)?a.some(c=>je(e,c,!1,n)):Tr(a)?a.from&&a.to?Oi(e,{from:a.from,to:a.to},n):!1:yi(a)?gp(e,a.dayOfWeek,n):pi(a)?n.isAfter(a.before,a.after)?Oi(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):Re(e.from,a,n)||Re(e.to,a,n):gi(a)||vi(a)?Re(e.from,a,n)||Re(e.to,a,n):!1))return!0;const i=r.filter(a=>typeof a=="function");if(i.length){let a=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(i.some(u=>u(a)))return!0;a=n.addDays(a,1)}}return!1}function yp(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:s,onSelect:i}=e,[a,c]=Nn(o,i?o:void 0),l=i?o:a;return{selected:l,select:(f,g,x)=>{const{min:h,max:b}=e,p=f?pp(f,l,h,b,s,t):void 0;return r&&n&&(p!=null&&p.from)&&p.to&&vp({from:p.from,to:p.to},n,t)&&(p.from=f,p.to=void 0),i||c(p),i==null||i(p,f,g,x),p},isSelected:f=>l&&je(l,f,!1,t)}}function bp(e,t){const{selected:n,required:r,onSelect:o}=e,[s,i]=Nn(n,o?n:void 0),a=o?n:s,{isSameDay:c}=t;return{selected:a,select:(d,f,g)=>{let x=d;return!r&&a&&a&&c(d,a)&&(x=void 0),o||i(x),o==null||o(x,d,f,g),x},isSelected:d=>a?c(a,d):!1}}function wp(e,t){const n=bp(e,t),r=mp(e,t),o=yp(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function xp(e){var rc;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new fe(t.today,t.timeZone)),t.month&&(t.month=new fe(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new fe(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new fe(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new fe(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new fe(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(rc=t.selected)==null?void 0:rc.map(j=>new fe(j,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new fe(t.selected.from,t.timeZone):void 0,to:t.selected.to?new fe(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:o,dateLib:s,locale:i,classNames:a}=E.useMemo(()=>{const j={...Nr,...t.locale};return{dateLib:new ze({locale:j,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:Em(t.components),formatters:Fm(t.formatters),labels:{...Qm,...t.labels},locale:j,classNames:{...Nm(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:l,navLayout:u,numberOfMonths:d=1,onDayBlur:f,onDayClick:g,onDayFocus:x,onDayKeyDown:h,onDayMouseEnter:b,onDayMouseLeave:p,onNextClick:y,onPrevClick:w,showWeekNumber:S,styles:C}=t,{formatCaption:M,formatDay:k,formatMonthDropdown:O,formatWeekNumber:_,formatWeekNumberHeader:W,formatWeekdayName:P,formatYearDropdown:N}=r,I=dp(t,s),{days:z,months:Y,navStart:L,navEnd:H,previousMonth:D,nextMonth:B,goToMonth:R}=I,oe=Xh(z,t,s),{isSelected:Me,select:Ne,selected:be}=wp(t,s)??{},{blur:Ue,focused:xe,isFocusTarget:$,moveFocus:ee,setFocused:ce}=hp(t,I,oe,Me??(()=>!1),s),{labelDayButton:te,labelGridcell:G,labelGrid:K,labelMonthDropdown:me,labelNav:we,labelPrevious:dt,labelNext:ut,labelWeekday:ft,labelWeekNumber:Hr,labelWeekNumberHeader:Tt,labelYearDropdown:Gp}=o,Kp=E.useMemo(()=>Lm(s,t.ISOWeek),[s,t.ISOWeek]),tc=l!==void 0||g!==void 0,Yr=E.useCallback(()=>{D&&(R(D),w==null||w(D))},[D,R,w]),zr=E.useCallback(()=>{B&&(R(B),y==null||y(B))},[R,B,y]),Xp=E.useCallback((j,se)=>ne=>{ne.preventDefault(),ne.stopPropagation(),ce(j),Ne==null||Ne(j.date,se,ne),g==null||g(j.date,se,ne)},[Ne,g,ce]),Qp=E.useCallback((j,se)=>ne=>{ce(j),x==null||x(j.date,se,ne)},[x,ce]),Zp=E.useCallback((j,se)=>ne=>{Ue(),f==null||f(j.date,se,ne)},[Ue,f]),Jp=E.useCallback((j,se)=>ne=>{const rt={ArrowLeft:["day",t.dir==="rtl"?"after":"before"],ArrowRight:["day",t.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[ne.shiftKey?"year":"month","before"],PageDown:[ne.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(rt[ne.key]){ne.preventDefault(),ne.stopPropagation();const[Oe,Pn]=rt[ne.key];ee(Oe,Pn)}h==null||h(j.date,se,ne)},[ee,h,t.dir]),eg=E.useCallback((j,se)=>ne=>{b==null||b(j.date,se,ne)},[b]),tg=E.useCallback((j,se)=>ne=>{p==null||p(j.date,se,ne)},[p]),ng=E.useCallback(j=>se=>{const ne=Number(se.target.value),rt=s.setMonth(s.startOfMonth(j),ne);R(rt)},[s,R]),rg=E.useCallback(j=>se=>{const ne=Number(se.target.value),rt=s.setYear(s.startOfMonth(j),ne);R(rt)},[s,R]),{className:og,style:sg}=E.useMemo(()=>({className:[a[A.Root],t.className].filter(Boolean).join(" "),style:{...C==null?void 0:C[A.Root],...t.style}}),[a,t.className,t.style,C]),ag=Mm(t),nc=E.useRef(null);tp(nc,!!t.animate,{classNames:a,months:Y,focused:xe,dateLib:s});const ig={dayPickerProps:t,selected:be,select:Ne,isSelected:Me,months:Y,nextMonth:B,previousMonth:D,goToMonth:R,getModifiers:oe,components:n,classNames:a,styles:C,labels:o,formatters:r};return E.createElement(wi.Provider,{value:ig},E.createElement(n.Root,{rootRef:t.animate?nc:void 0,className:og,style:sg,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],...ag},E.createElement(n.Months,{className:a[A.Months],style:C==null?void 0:C[A.Months]},!t.hideNavigation&&!u&&E.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:a[A.Nav],style:C==null?void 0:C[A.Nav],"aria-label":we(),onPreviousClick:Yr,onNextClick:zr,previousMonth:D,nextMonth:B}),Y.map((j,se)=>{const ne=Im(j.date,L,H,r,s),rt=$m(L,H,r,s);return E.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:a[A.Month],style:C==null?void 0:C[A.Month],key:se,displayIndex:se,calendarMonth:j},u==="around"&&!t.hideNavigation&&se===0&&E.createElement(n.PreviousMonthButton,{type:"button",className:a[A.PreviousMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":dt(D),onClick:Yr,"data-animated-button":t.animate?"true":void 0},E.createElement(n.Chevron,{disabled:D?void 0:!0,className:a[A.Chevron],orientation:t.dir==="rtl"?"right":"left"})),E.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:a[A.MonthCaption],style:C==null?void 0:C[A.MonthCaption],calendarMonth:j,displayIndex:se},c!=null&&c.startsWith("dropdown")?E.createElement(n.DropdownNav,{className:a[A.Dropdowns],style:C==null?void 0:C[A.Dropdowns]},c==="dropdown"||c==="dropdown-months"?E.createElement(n.MonthsDropdown,{className:a[A.MonthsDropdown],"aria-label":me(),classNames:a,components:n,disabled:!!t.disableNavigation,onChange:ng(j.date),options:ne,style:C==null?void 0:C[A.Dropdown],value:s.getMonth(j.date)}):E.createElement("span",null,O(j.date,s)),c==="dropdown"||c==="dropdown-years"?E.createElement(n.YearsDropdown,{className:a[A.YearsDropdown],"aria-label":Gp(s.options),classNames:a,components:n,disabled:!!t.disableNavigation,onChange:rg(j.date),options:rt,style:C==null?void 0:C[A.Dropdown],value:s.getYear(j.date)}):E.createElement("span",null,N(j.date,s)),E.createElement("span",{role:"status","aria-live":"polite",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"}},M(j.date,s.options,s))):E.createElement(n.CaptionLabel,{className:a[A.CaptionLabel],role:"status","aria-live":"polite"},M(j.date,s.options,s))),u==="around"&&!t.hideNavigation&&se===d-1&&E.createElement(n.NextMonthButton,{type:"button",className:a[A.NextMonthButton],tabIndex:B?void 0:-1,"aria-disabled":B?void 0:!0,"aria-label":ut(B),onClick:zr,"data-animated-button":t.animate?"true":void 0},E.createElement(n.Chevron,{disabled:B?void 0:!0,className:a[A.Chevron],orientation:t.dir==="rtl"?"left":"right"})),se===d-1&&u==="after"&&!t.hideNavigation&&E.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:a[A.Nav],style:C==null?void 0:C[A.Nav],"aria-label":we(),onPreviousClick:Yr,onNextClick:zr,previousMonth:D,nextMonth:B}),E.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":K(j.date,s.options,s)||void 0,className:a[A.MonthGrid],style:C==null?void 0:C[A.MonthGrid]},!t.hideWeekdays&&E.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:a[A.Weekdays],style:C==null?void 0:C[A.Weekdays]},S&&E.createElement(n.WeekNumberHeader,{"aria-label":Tt(s.options),className:a[A.WeekNumberHeader],style:C==null?void 0:C[A.WeekNumberHeader],scope:"col"},W()),Kp.map((Oe,Pn)=>E.createElement(n.Weekday,{"aria-label":ft(Oe,s.options,s),className:a[A.Weekday],key:Pn,style:C==null?void 0:C[A.Weekday],scope:"col"},P(Oe,s.options,s)))),E.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:a[A.Weeks],style:C==null?void 0:C[A.Weeks]},j.weeks.map((Oe,Pn)=>E.createElement(n.Week,{className:a[A.Week],key:Oe.weekNumber,style:C==null?void 0:C[A.Week],week:Oe},S&&E.createElement(n.WeekNumber,{week:Oe,style:C==null?void 0:C[A.WeekNumber],"aria-label":Hr(Oe.weekNumber,{locale:i}),className:a[A.WeekNumber],scope:"row",role:"rowheader"},_(Oe.weekNumber,s)),Oe.days.map(he=>{const{date:Be}=he,Q=oe(he);if(Q[ae.focused]=!Q.hidden&&!!(xe!=null&&xe.isEqualTo(he)),Q[Ee.selected]=(Me==null?void 0:Me(Be))||Q.selected,Tr(be)){const{from:jr,to:Rr}=be;Q[Ee.range_start]=!!(jr&&Rr&&s.isSameDay(Be,jr)),Q[Ee.range_end]=!!(jr&&Rr&&s.isSameDay(Be,Rr)),Q[Ee.range_middle]=je(be,Be,!0,s)}const cg=Bm(Q,C,t.modifiersStyles),lg=Qh(Q,a,t.modifiersClassNames),dg=!tc&&!Q.hidden?G(Be,Q,s.options,s):void 0;return E.createElement(n.Day,{key:`${s.format(Be,"yyyy-MM-dd")}_${s.format(he.displayMonth,"yyyy-MM")}`,day:he,modifiers:Q,className:lg.join(" "),style:cg,role:"gridcell","aria-selected":Q.selected||void 0,"aria-label":dg,"data-day":s.format(Be,"yyyy-MM-dd"),"data-month":he.outside?s.format(Be,"yyyy-MM"):void 0,"data-selected":Q.selected||void 0,"data-disabled":Q.disabled||void 0,"data-hidden":Q.hidden||void 0,"data-outside":he.outside||void 0,"data-focused":Q.focused||void 0,"data-today":Q.today||void 0},!Q.hidden&&tc?E.createElement(n.DayButton,{className:a[A.DayButton],style:C==null?void 0:C[A.DayButton],type:"button",day:he,modifiers:Q,disabled:Q.disabled||void 0,tabIndex:$(he)?0:-1,"aria-label":te(Be,Q,s.options,s),onClick:Xp(he,Q),onBlur:Zp(he,Q),onFocus:Qp(he,Q),onKeyDown:Jp(he,Q),onMouseEnter:eg(he,Q),onMouseLeave:tg(he,Q)},k(Be,s.options,s)):!Q.hidden&&k(he.date,s.options,s))}))))))})),t.footer&&E.createElement(n.Footer,{className:a[A.Footer],style:C==null?void 0:C[A.Footer],role:"status","aria-live":"polite"},t.footer)))}function Pi({className:e,classNames:t,showOutsideDays:n=!0,...r}){return m.jsx(xp,{showOutsideDays:n,className:F("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:F(Fn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:F(Fn({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{Chevron:({orientation:o})=>o==="left"?m.jsx(Zc,{className:"h-4 w-4"}):m.jsx(Jc,{className:"h-4 w-4"})},...r})}Pi.displayName="Calendar";var On="Popover",[Di,wg]=gt(On,[fn]),Gt=fn(),[Cp,nt]=Di(On),Ti=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Gt(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=_t({prop:r,defaultProp:o??!1,onChange:s,caller:On});return m.jsx(Ws,{...a,children:m.jsx(Cp,{scope:t,contentId:tn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:i,children:n})})};Ti.displayName=On;var Ai="PopoverAnchor",Sp=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nt(Ai,n),s=Gt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return v.useEffect(()=>(i(),()=>a()),[i,a]),m.jsx(dr,{...s,...r,ref:t})});Sp.displayName=Ai;var Wi="PopoverTrigger",_i=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nt(Wi,n),s=Gt(n),i=Z(t,o.triggerRef),a=m.jsx(q.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$i(o.open),...r,ref:i,onClick:U(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:m.jsx(dr,{asChild:!0,...s,children:a})});_i.displayName=Wi;var Fr="PopoverPortal",[kp,Ep]=Di(Fr,{forceMount:void 0}),Fi=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=nt(Fr,t);return m.jsx(kp,{scope:t,forceMount:n,children:m.jsx(kn,{present:n||s.open,children:m.jsx(ur,{asChild:!0,container:o,children:r})})})};Fi.displayName=Fr;var Dt="PopoverContent",Ii=v.forwardRef((e,t)=>{const n=Ep(Dt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=nt(Dt,e.__scopePopover);return m.jsx(kn,{present:r||s.open,children:s.modal?m.jsx(Np,{...o,ref:t}):m.jsx(Op,{...o,ref:t})})});Ii.displayName=Dt;var Mp=pt("PopoverContent.RemoveScroll"),Np=v.forwardRef((e,t)=>{const n=nt(Dt,e.__scopePopover),r=v.useRef(null),o=Z(t,r),s=v.useRef(!1);return v.useEffect(()=>{const i=r.current;if(i)return Ls(i)},[]),m.jsx(vr,{as:Mp,allowPinchZoom:!0,children:m.jsx(Bi,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:U(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Op=v.forwardRef((e,t)=>{const n=nt(Dt,e.__scopePopover),r=v.useRef(!1),o=v.useRef(!1);return m.jsx(Bi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Bi=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=nt(Dt,n),g=Gt(n);return Zo(),m.jsx(Kn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:m.jsx(Rn,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:m.jsx(_s,{"data-state":$i(f.open),role:"dialog",id:f.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Li="PopoverClose",Pp=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nt(Li,n);return m.jsx(q.button,{type:"button",...r,ref:t,onClick:U(e.onClick,()=>o.onOpenChange(!1))})});Pp.displayName=Li;var Dp="PopoverArrow",Tp=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Gt(n);return m.jsx(Fs,{...o,...r,ref:t})});Tp.displayName=Dp;function $i(e){return e?"open":"closed"}var Ap=Ti,Wp=_i,_p=Fi,Vi=Ii;const Fp=Ap,Ip=Wp,Hi=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>m.jsx(_p,{children:m.jsx(Vi,{ref:o,align:t,sideOffset:n,className:F("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Hi.displayName=Vi.displayName;function Bp({id:e,value:t,placeholder:n,disabled:r,onChange:o,onBlur:s,onFocus:i,className:a,"aria-invalid":c}){const[l,u]=v.useState();v.useEffect(()=>{t&&u(new Date(t))},[t]);const d=f=>{u(f),f&&o&&o(Or(f,"yyyy-MM-dd"))};return m.jsxs(Fp,{children:[m.jsx(Ip,{asChild:!0,children:m.jsxs($e,{id:e,variant:"outline",className:F("w-full justify-start text-left font-normal",!l&&"text-muted-foreground",a),disabled:r,onBlur:s,onFocus:i,"aria-invalid":c,children:[m.jsx(Qc,{className:"mr-2 h-4 w-4"}),l?Or(l,"PPP"):m.jsx("span",{children:n})]})}),m.jsx(Hi,{className:"w-auto p-0",children:m.jsx(Pi,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})}function Yi(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,rawErrors:d=[],schema:f}=e,g=ie(t,f),x=async y=>{const w=y.target.value===""?u.emptyValue:y.target.value;a(w),await g.onChange(w)},h=async y=>{const w=y.target.value;c&&c(t,w),await g.onBlur(w)},b=async y=>{const w=y.target.value;l&&l(t,w),await g.onFocus(w)},p=d.length>0;return m.jsx(le,{id:t,type:"text",value:n||"",placeholder:i,required:r,disabled:o,readOnly:s,onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F(p&&"border-destructive focus-visible:ring-destructive/20")})}function zi(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,rawErrors:d=[],schema:f}=e,g=ie(t,f),x=async w=>{const S=w.target.value===""?u.emptyValue:w.target.value;a(S),await g.onChange(S)},h=async w=>{const S=w.target.value;c&&c(t,S),await g.onBlur(S)},b=async w=>{const S=w.target.value;l&&l(t,S),await g.onFocus(S)},p=d.length>0,y=u.rows||4;return m.jsx(qo,{id:t,value:n||"",placeholder:i,required:r,disabled:o,readOnly:s,rows:y,onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F("resize-y",p&&"border-destructive focus-visible:ring-destructive/20")})}function ji(e){const{id:t,value:n,required:r,disabled:o,onChange:s,onBlur:i,onFocus:a,options:c,rawErrors:l=[],schema:u}=e,d=ie(t,u),f=async p=>{const y=p===""?c.emptyValue:p;s(y),await d.onChange(y)},g=async()=>{i&&i(t,n),await d.onBlur(n)},x=async()=>{a&&a(t,n),await d.onFocus(n)},h=l.length>0,{enumOptions:b=[]}=c;return m.jsxs(hf,{value:n||"",onValueChange:f,disabled:o,required:r,children:[m.jsx(Aa,{id:t,"aria-invalid":h,className:F("w-full",h&&"border-destructive focus-visible:ring-destructive/20"),onBlur:g,onFocus:x,children:m.jsx(mf,{placeholder:"Select an option..."})}),m.jsx(Fa,{children:b.map(p=>m.jsx(Ia,{value:p.value,children:p.label},p.value))})]})}function Ri(e){const{id:t,value:n,disabled:r,readonly:o,onChange:s,onBlur:i,onFocus:a,label:c,rawErrors:l=[],schema:u}=e,d=ie(t,u),f=async b=>{s(b),await d.onChange(b)},g=async()=>{i&&i(t,n),await d.onBlur(n)},x=async()=>{a&&a(t,n),await d.onFocus(n)},h=l.length>0;return m.jsxs("div",{className:"flex items-start space-x-2",children:[m.jsx(ja,{id:t,checked:n||!1,disabled:r||o,onCheckedChange:f,onBlur:g,onFocus:x,"aria-invalid":h,className:F("mt-0.5",h&&"border-destructive focus-visible:ring-destructive/20")}),c&&m.jsx(pe,{htmlFor:t,className:F("text-sm leading-none",r&&"opacity-50",!o&&!r&&"cursor-pointer"),children:c})]})}function Ui(e){const{id:t,value:n,disabled:r,readonly:o,onChange:s,onBlur:i,onFocus:a,options:c,rawErrors:l=[],schema:u}=e,d=ie(t,u),f=async p=>{s(p),await d.onChange(p)},g=async()=>{i&&i(t,n),await d.onBlur(n)},x=async()=>{a&&a(t,n),await d.onFocus(n)},h=l.length>0,{enumOptions:b=[]}=c;return m.jsx("div",{className:"space-y-2",children:b.map((p,y)=>m.jsxs("div",{className:"flex items-center",children:[m.jsx("input",{id:`${t}_${y}`,type:"radio",name:t,value:p.value,checked:n===p.value,disabled:r,readOnly:o,onChange:()=>f(p.value),onBlur:g,onFocus:x,className:`
|
|
101
|
+
`)},Gf=0,Rt=[];function Xf(e){var t=E.useRef([]),r=E.useRef([0,0]),n=E.useRef(),o=E.useState(Gf++)[0],i=E.useState($a)[0],a=E.useRef(e);E.useEffect(function(){a.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=vf([e.lockRef.current],(e.shards||[]).map(qa),!0).filter(Boolean);return f.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(f,v){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!a.current.allowPinchZoom;var g=Yr(f),y=r.current,b="deltaX"in f?f.deltaX:y[0]-g[0],O="deltaY"in f?f.deltaY:y[1]-g[1],S,T=f.target,P=Math.abs(b)>Math.abs(O)?"h":"v";if("touches"in f&&P==="h"&&T.type==="range")return!1;var L=Ha(P,T);if(!L)return!0;if(L?S=P:(S=P==="v"?"h":"v",L=Ha(P,T)),!L)return!1;if(!n.current&&"changedTouches"in f&&(b||O)&&(n.current=S),!S)return!0;var $=n.current||S;return zf($,v,f,$==="h"?b:O)},[]),c=E.useCallback(function(f){var v=f;if(!(!Rt.length||Rt[Rt.length-1]!==i)){var g="deltaY"in v?za(v):Yr(v),y=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&qf(S.delta,g)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(qa).filter(Boolean).filter(function(S){return S.contains(v.target)}),O=b.length>0?s(v,b[0]):!a.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),l=E.useCallback(function(f,v,g,y){var b={name:f,delta:v,target:g,should:y,shadowParent:Qf(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(O){return O!==b})},1)},[]),d=E.useCallback(function(f){r.current=Yr(f),n.current=void 0},[]),u=E.useCallback(function(f){l(f.type,za(f),f.target,s(f,e.lockRef.current))},[]),h=E.useCallback(function(f){l(f.type,Yr(f),f.target,s(f,e.lockRef.current))},[]);E.useEffect(function(){return Rt.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$t),document.addEventListener("touchmove",c,$t),document.addEventListener("touchstart",d,$t),function(){Rt=Rt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,$t),document.removeEventListener("touchmove",c,$t),document.removeEventListener("touchstart",d,$t)}},[]);var p=e.removeScrollBar,x=e.inert;return E.createElement(E.Fragment,null,x?E.createElement(i,{styles:Kf(o)}):null,p?E.createElement(Bf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zf=_f(Ba,Xf);var Xn=E.forwardRef(function(e,t){return E.createElement(Hr,Ye({},e,{ref:t,sideCar:Zf}))});Xn.classNames=Hr.classNames;var Jf=[" ","Enter","ArrowUp","ArrowDown"],eh=[" ","Enter"],Ct="Select",[zr,qr,th]=Oi(Ct),[Vt,rw]=Dt(Ct,[th,Lr]),Kr=Lr(),[rh,ht]=Vt(Ct),[nh,oh]=Vt(Ct),Ka=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:u,disabled:h,required:p,form:x}=e,f=Kr(t),[v,g]=E.useState(null),[y,b]=E.useState(null),[O,S]=E.useState(!1),T=Si(l),[P,L]=tr({prop:n,defaultProp:o??!1,onChange:i,caller:Ct}),[$,B]=tr({prop:a,defaultProp:s,onChange:c,caller:Ct}),U=E.useRef(null),R=v?x||!!v.closest("form"):!0,[K,ee]=E.useState(new Set),H=Array.from(K).map(X=>X.props.value).join(";");return w.jsx(Aa,{...f,children:w.jsxs(rh,{required:p,scope:t,trigger:v,onTriggerChange:g,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:O,onValueNodeHasChildrenChange:S,contentId:Pr(),value:$,onValueChange:B,open:P,onOpenChange:L,dir:T,triggerPointerDownPosRef:U,disabled:h,children:[w.jsx(zr.Provider,{scope:t,children:w.jsx(nh,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(X=>{ee(Z=>new Set(Z).add(X))},[]),onNativeOptionRemove:E.useCallback(X=>{ee(Z=>{const m=new Set(Z);return m.delete(X),m})},[]),children:r})}),R?w.jsxs(ys,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:u,value:$,onChange:X=>B(X.target.value),disabled:h,form:x,children:[$===void 0?w.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};Ka.displayName=Ct;var Ga="SelectTrigger",Xa=E.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Kr(r),a=ht(Ga,r),s=a.disabled||n,c=ue(t,a.onTriggerChange),l=qr(r),d=E.useRef("touch"),[u,h,p]=ws(f=>{const v=l().filter(b=>!b.disabled),g=v.find(b=>b.value===a.value),y=xs(v,f,g);y!==void 0&&a.onValueChange(y.value)}),x=f=>{s||(a.onOpenChange(!0),p()),f&&(a.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return w.jsx(Hn,{asChild:!0,...i,children:w.jsx(ie.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":bs(a.value)?"":void 0,...o,ref:c,onClick:oe(o.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&x(f)}),onPointerDown:oe(o.onPointerDown,f=>{d.current=f.pointerType;const v=f.target;v.hasPointerCapture(f.pointerId)&&v.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(x(f),f.preventDefault())}),onKeyDown:oe(o.onKeyDown,f=>{const v=u.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&h(f.key),!(v&&f.key===" ")&&Jf.includes(f.key)&&(x(),f.preventDefault())})})})});Xa.displayName=Ga;var Qa="SelectValue",Za=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:a="",...s}=e,c=ht(Qa,r),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,u=ue(t,c.onValueNodeChange);return Ce(()=>{l(d)},[l,d]),w.jsx(ie.span,{...s,ref:u,style:{pointerEvents:"none"},children:bs(c.value)?w.jsx(w.Fragment,{children:a}):i})});Za.displayName=Qa;var ih="SelectIcon",Ja=E.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return w.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Ja.displayName=ih;var ah="SelectPortal",es=e=>w.jsx(Un,{asChild:!0,...e});es.displayName=ah;var St="SelectContent",ts=E.forwardRef((e,t)=>{const r=ht(St,e.__scopeSelect),[n,o]=E.useState();if(Ce(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Cr.createPortal(w.jsx(rs,{scope:e.__scopeSelect,children:w.jsx(zr.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),i):null}return w.jsx(ns,{...e,ref:t})});ts.displayName=St;var Ie=10,[rs,pt]=Vt(St),sh="SelectContentImpl",ch=Nt("SelectContent.RemoveScroll"),ns=E.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:p,sticky:x,hideWhenDetached:f,avoidCollisions:v,...g}=e,y=ht(St,r),[b,O]=E.useState(null),[S,T]=E.useState(null),P=ue(t,A=>O(A)),[L,$]=E.useState(null),[B,U]=E.useState(null),R=qr(r),[K,ee]=E.useState(!1),H=E.useRef(!1);E.useEffect(()=>{if(b)return Ia(b)},[b]),Gi();const X=E.useCallback(A=>{const[V,...re]=R().map(Q=>Q.ref.current),[q]=re.slice(-1),z=document.activeElement;for(const Q of A)if(Q===z||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===V&&S&&(S.scrollTop=0),Q===q&&S&&(S.scrollTop=S.scrollHeight),Q==null||Q.focus(),document.activeElement!==z))return},[R,S]),Z=E.useCallback(()=>X([L,b]),[X,L,b]);E.useEffect(()=>{K&&Z()},[K,Z]);const{onOpenChange:m,triggerPointerDownPosRef:C}=y;E.useEffect(()=>{if(b){let A={x:0,y:0};const V=q=>{var z,Q;A={x:Math.abs(Math.round(q.pageX)-(((z=C.current)==null?void 0:z.x)??0)),y:Math.abs(Math.round(q.pageY)-(((Q=C.current)==null?void 0:Q.y)??0))}},re=q=>{A.x<=10&&A.y<=10?q.preventDefault():b.contains(q.target)||m(!1),document.removeEventListener("pointermove",V),C.current=null};return C.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",re,{capture:!0})}}},[b,m,C]),E.useEffect(()=>{const A=()=>m(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[m]);const[_,k]=ws(A=>{const V=R().filter(z=>!z.disabled),re=V.find(z=>z.ref.current===document.activeElement),q=xs(V,A,re);q&&setTimeout(()=>q.ref.current.focus())}),M=E.useCallback((A,V,re)=>{const q=!H.current&&!re;(y.value!==void 0&&y.value===V||q)&&($(A),q&&(H.current=!0))},[y.value]),F=E.useCallback(()=>b==null?void 0:b.focus(),[b]),I=E.useCallback((A,V,re)=>{const q=!H.current&&!re;(y.value!==void 0&&y.value===V||q)&&U(A)},[y.value]),j=n==="popper"?Qn:os,W=j===Qn?{side:s,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:p,sticky:x,hideWhenDetached:f,avoidCollisions:v}:{};return w.jsx(rs,{scope:r,content:b,viewport:S,onViewportChange:T,itemRefCallback:M,selectedItem:L,onItemLeave:F,itemTextRefCallback:I,focusSelectedItem:Z,selectedItemText:B,position:n,isPositioned:K,searchRef:_,children:w.jsx(Xn,{as:ch,allowPinchZoom:!0,children:w.jsx(Pn,{asChild:!0,trapped:y.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:oe(o,A=>{var V;(V=y.trigger)==null||V.focus({preventScroll:!0}),A.preventDefault()}),children:w.jsx(Sn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:w.jsx(j,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:A=>A.preventDefault(),...g,...W,onPlaced:()=>ee(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:oe(g.onKeyDown,A=>{const V=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!V&&A.key.length===1&&k(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let q=R().filter(z=>!z.disabled).map(z=>z.ref.current);if(["ArrowUp","End"].includes(A.key)&&(q=q.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const z=A.target,Q=q.indexOf(z);q=q.slice(Q+1)}setTimeout(()=>X(q)),A.preventDefault()}})})})})})})});ns.displayName=sh;var lh="SelectItemAlignedPosition",os=E.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=ht(St,r),a=pt(St,r),[s,c]=E.useState(null),[l,d]=E.useState(null),u=ue(t,P=>d(P)),h=qr(r),p=E.useRef(!1),x=E.useRef(!0),{viewport:f,selectedItem:v,selectedItemText:g,focusSelectedItem:y}=a,b=E.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&l&&f&&v&&g){const P=i.trigger.getBoundingClientRect(),L=l.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),B=g.getBoundingClientRect();if(i.dir!=="rtl"){const z=B.left-L.left,Q=$.left-z,se=P.left-Q,Ee=P.width+se,Le=Math.max(Ee,L.width),Ne=window.innerWidth-Ie,Be=_r(Q,[Ie,Math.max(Ie,Ne-Le)]);s.style.minWidth=Ee+"px",s.style.left=Be+"px"}else{const z=L.right-B.right,Q=window.innerWidth-$.right-z,se=window.innerWidth-P.right-Q,Ee=P.width+se,Le=Math.max(Ee,L.width),Ne=window.innerWidth-Ie,Be=_r(Q,[Ie,Math.max(Ie,Ne-Le)]);s.style.minWidth=Ee+"px",s.style.right=Be+"px"}const U=h(),R=window.innerHeight-Ie*2,K=f.scrollHeight,ee=window.getComputedStyle(l),H=parseInt(ee.borderTopWidth,10),X=parseInt(ee.paddingTop,10),Z=parseInt(ee.borderBottomWidth,10),m=parseInt(ee.paddingBottom,10),C=H+X+K+m+Z,_=Math.min(v.offsetHeight*5,C),k=window.getComputedStyle(f),M=parseInt(k.paddingTop,10),F=parseInt(k.paddingBottom,10),I=P.top+P.height/2-Ie,j=R-I,W=v.offsetHeight/2,A=v.offsetTop+W,V=H+X+A,re=C-V;if(V<=I){const z=U.length>0&&v===U[U.length-1].ref.current;s.style.bottom="0px";const Q=l.clientHeight-f.offsetTop-f.offsetHeight,se=Math.max(j,W+(z?F:0)+Q+Z),Ee=V+se;s.style.height=Ee+"px"}else{const z=U.length>0&&v===U[0].ref.current;s.style.top="0px";const se=Math.max(I,H+f.offsetTop+(z?M:0)+W)+re;s.style.height=se+"px",f.scrollTop=V-I+f.offsetTop}s.style.margin=`${Ie}px 0`,s.style.minHeight=_+"px",s.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,s,l,f,v,g,i.dir,n]);Ce(()=>b(),[b]);const[O,S]=E.useState();Ce(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const T=E.useCallback(P=>{P&&x.current===!0&&(b(),y==null||y(),x.current=!1)},[b,y]);return w.jsx(dh,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:w.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:w.jsx(ie.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});os.displayName=lh;var uh="SelectPopperPosition",Qn=E.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ie,...i}=e,a=Kr(r);return w.jsx(Na,{...a,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Qn.displayName=uh;var[dh,Zn]=Vt(St,{}),Jn="SelectViewport",is=E.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=pt(Jn,r),a=Zn(Jn,r),s=ue(t,i.onViewportChange),c=E.useRef(0);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),w.jsx(zr.Slot,{scope:r,children:w.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:oe(o.onScroll,l=>{const d=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:h}=a;if(h!=null&&h.current&&u){const p=Math.abs(c.current-d.scrollTop);if(p>0){const x=window.innerHeight-Ie*2,f=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),g=Math.max(f,v);if(g<x){const y=g+p,b=Math.min(x,y),O=y-b;u.style.height=b+"px",u.style.bottom==="0px"&&(d.scrollTop=O>0?O:0,u.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});is.displayName=Jn;var as="SelectGroup",[fh,hh]=Vt(as),ph=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Pr();return w.jsx(fh,{scope:r,id:o,children:w.jsx(ie.div,{role:"group","aria-labelledby":o,...n,ref:t})})});ph.displayName=as;var ss="SelectLabel",cs=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=hh(ss,r);return w.jsx(ie.div,{id:o.id,...n,ref:t})});cs.displayName=ss;var Gr="SelectItem",[mh,ls]=Vt(Gr),us=E.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...a}=e,s=ht(Gr,r),c=pt(Gr,r),l=s.value===n,[d,u]=E.useState(i??""),[h,p]=E.useState(!1),x=ue(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,n,o)}),f=Pr(),v=E.useRef("touch"),g=()=>{o||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return w.jsx(mh,{scope:r,value:n,disabled:o,textId:f,isSelected:l,onItemTextChange:E.useCallback(y=>{u(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:w.jsx(zr.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:w.jsx(ie.div,{role:"option","aria-labelledby":f,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:x,onFocus:oe(a.onFocus,()=>p(!0)),onBlur:oe(a.onBlur,()=>p(!1)),onClick:oe(a.onClick,()=>{v.current!=="mouse"&&g()}),onPointerUp:oe(a.onPointerUp,()=>{v.current==="mouse"&&g()}),onPointerDown:oe(a.onPointerDown,y=>{v.current=y.pointerType}),onPointerMove:oe(a.onPointerMove,y=>{var b;v.current=y.pointerType,o?(b=c.onItemLeave)==null||b.call(c):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(a.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:oe(a.onKeyDown,y=>{var O;((O=c.searchRef)==null?void 0:O.current)!==""&&y.key===" "||(eh.includes(y.key)&&g(),y.key===" "&&y.preventDefault())})})})})});us.displayName=Gr;var ir="SelectItemText",ds=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,a=ht(ir,r),s=pt(ir,r),c=ls(ir,r),l=oh(ir,r),[d,u]=E.useState(null),h=ue(t,g=>u(g),c.onItemTextChange,g=>{var y;return(y=s.itemTextRefCallback)==null?void 0:y.call(s,g,c.value,c.disabled)}),p=d==null?void 0:d.textContent,x=E.useMemo(()=>w.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:f,onNativeOptionRemove:v}=l;return Ce(()=>(f(x),()=>v(x)),[f,v,x]),w.jsxs(w.Fragment,{children:[w.jsx(ie.span,{id:c.textId,...i,ref:h}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Cr.createPortal(i.children,a.valueNode):null]})});ds.displayName=ir;var fs="SelectItemIndicator",hs=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ls(fs,r).isSelected?w.jsx(ie.span,{"aria-hidden":!0,...n,ref:t}):null});hs.displayName=fs;var eo="SelectScrollUpButton",ps=E.forwardRef((e,t)=>{const r=pt(eo,e.__scopeSelect),n=Zn(eo,e.__scopeSelect),[o,i]=E.useState(!1),a=ue(t,n.onScrollButtonChange);return Ce(()=>{if(r.viewport&&r.isPositioned){let s=function(){const l=c.scrollTop>0;i(l)};const c=r.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),o?w.jsx(gs,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=r;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});ps.displayName=eo;var to="SelectScrollDownButton",ms=E.forwardRef((e,t)=>{const r=pt(to,e.__scopeSelect),n=Zn(to,e.__scopeSelect),[o,i]=E.useState(!1),a=ue(t,n.onScrollButtonChange);return Ce(()=>{if(r.viewport&&r.isPositioned){let s=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;i(d)};const c=r.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),o?w.jsx(gs,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=r;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});ms.displayName=to;var gs=E.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=pt("SelectScrollButton",r),a=E.useRef(null),s=qr(r),c=E.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return E.useEffect(()=>()=>c(),[c]),Ce(()=>{var d;const l=s().find(u=>u.ref.current===document.activeElement);(d=l==null?void 0:l.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),w.jsx(ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:oe(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:oe(o.onPointerMove,()=>{var l;(l=i.onItemLeave)==null||l.call(i),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{c()})})}),gh="SelectSeparator",vs=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return w.jsx(ie.div,{"aria-hidden":!0,...n,ref:t})});vs.displayName=gh;var ro="SelectArrow",vh=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Kr(r),i=ht(ro,r),a=pt(ro,r);return i.open&&a.position==="popper"?w.jsx(Da,{...o,...n,ref:t}):null});vh.displayName=ro;var yh="SelectBubbleInput",ys=E.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=E.useRef(null),i=ue(n,o),a=vn(t);return E.useEffect(()=>{const s=o.current;if(!s)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const u=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(u)}},[a,t]),w.jsx(ie.select,{...r,style:{...Ta,...r.style},ref:i,defaultValue:t})});ys.displayName=yh;function bs(e){return e===""||e===void 0}function ws(e){const t=xt(e),r=E.useRef(""),n=E.useRef(0),o=E.useCallback(a=>{const s=r.current+a;t(s),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(s)},[t]),i=E.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function xs(e,t,r){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let a=bh(e,Math.max(i,0));o.length===1&&(a=a.filter(l=>l!==r));const c=a.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function bh(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var wh=Ka,Es=Xa,xh=Za,Eh=Ja,Ch=es,Cs=ts,Sh=is,Ss=cs,Os=us,Oh=ds,_h=hs,_s=ps,ks=ms,Ps=vs;const kh=wh,Ph=xh,Ms=E.forwardRef(({className:e,children:t,...r},n)=>w.jsxs(Es,{ref:n,className:J("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,w.jsx(Eh,{asChild:!0,children:w.jsx(mn,{className:"h-4 w-4 opacity-50"})})]}));Ms.displayName=Es.displayName;const As=E.forwardRef(({className:e,...t},r)=>w.jsx(_s,{ref:r,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(gi,{className:"h-4 w-4"})}));As.displayName=_s.displayName;const Ns=E.forwardRef(({className:e,...t},r)=>w.jsx(ks,{ref:r,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(mn,{className:"h-4 w-4"})}));Ns.displayName=ks.displayName;const Ds=E.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>w.jsx(Ch,{children:w.jsxs(Cs,{ref:o,className:J("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[w.jsx(As,{}),w.jsx(Sh,{className:J("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),w.jsx(Ns,{})]})}));Ds.displayName=Cs.displayName;const Mh=E.forwardRef(({className:e,...t},r)=>w.jsx(Ss,{ref:r,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Mh.displayName=Ss.displayName;const Ts=E.forwardRef(({className:e,children:t,...r},n)=>w.jsxs(Os,{ref:n,className:J("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(_h,{children:w.jsx(mi,{className:"h-4 w-4"})})}),w.jsx(Oh,{children:t})]}));Ts.displayName=Os.displayName;const Ah=E.forwardRef(({className:e,...t},r)=>w.jsx(Ps,{ref:r,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Ah.displayName=Ps.displayName;function Nh(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var Xr=e=>{const{present:t,children:r}=e,n=Dh(t),o=typeof r=="function"?r({present:n.isPresent}):E.Children.only(r),i=ue(n.ref,Th(o));return typeof r=="function"||n.isPresent?E.cloneElement(o,{ref:i}):null};Xr.displayName="Presence";function Dh(e){const[t,r]=E.useState(),n=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[s,c]=Nh(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const l=Qr(n.current);i.current=s==="mounted"?l:"none"},[s]),Ce(()=>{const l=n.current,d=o.current;if(d!==e){const h=i.current,p=Qr(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ce(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,u=p=>{const f=Qr(n.current).includes(p.animationName);if(p.target===t&&f&&(c("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(i.current=Qr(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function Qr(e){return(e==null?void 0:e.animationName)||"none"}function Th(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Zr="Checkbox",[Fh,nw]=Dt(Zr),[Ih,no]=Fh(Zr);function Wh(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:c,required:l,value:d="on",internal_do_not_use_render:u}=e,[h,p]=tr({prop:r,defaultProp:o??!1,onChange:c,caller:Zr}),[x,f]=E.useState(null),[v,g]=E.useState(null),y=E.useRef(!1),b=x?!!a||!!x.closest("form"):!0,O={checked:h,disabled:i,setChecked:p,control:x,setControl:f,name:s,form:a,value:d,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:mt(o)?!1:o,isFormControl:b,bubbleInput:v,setBubbleInput:g};return w.jsx(Ih,{scope:t,...O,children:jh(u)?u(O):n})}var Fs="CheckboxTrigger",Is=E.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},o)=>{const{control:i,value:a,disabled:s,checked:c,required:l,setControl:d,setChecked:u,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:x}=no(Fs,e),f=ue(o,d),v=E.useRef(c);return E.useEffect(()=>{const g=i==null?void 0:i.form;if(g){const y=()=>u(v.current);return g.addEventListener("reset",y),()=>g.removeEventListener("reset",y)}},[i,u]),w.jsx(ie.button,{type:"button",role:"checkbox","aria-checked":mt(c)?"mixed":c,"aria-required":l,"data-state":$s(c),"data-disabled":s?"":void 0,disabled:s,value:a,...n,ref:f,onKeyDown:oe(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:oe(r,g=>{u(y=>mt(y)?!0:!y),x&&p&&(h.current=g.isPropagationStopped(),h.current||g.stopPropagation())})})});Is.displayName=Fs;var oo=E.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:o,defaultChecked:i,required:a,disabled:s,value:c,onCheckedChange:l,form:d,...u}=e;return w.jsx(Wh,{__scopeCheckbox:r,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:l,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>w.jsxs(w.Fragment,{children:[w.jsx(Is,{...u,ref:t,__scopeCheckbox:r}),h&&w.jsx(Bs,{__scopeCheckbox:r})]})})});oo.displayName=Zr;var Ws="CheckboxIndicator",js=E.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...o}=e,i=no(Ws,r);return w.jsx(Xr,{present:n||mt(i.checked)||i.checked===!0,children:w.jsx(ie.span,{"data-state":$s(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});js.displayName=Ws;var Ls="CheckboxBubbleInput",Bs=E.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:c,name:l,value:d,form:u,bubbleInput:h,setBubbleInput:p}=no(Ls,e),x=ue(r,p),f=vn(i),v=yn(n);E.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,T=!o.current;if(f!==i&&S){const P=new Event("click",{bubbles:T});y.indeterminate=mt(i),S.call(y,mt(i)?!1:i),y.dispatchEvent(P)}},[h,f,i,o]);const g=E.useRef(mt(i)?!1:i);return w.jsx(ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??g.current,required:s,disabled:c,name:l,value:d,form:u,...t,tabIndex:-1,ref:x,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Bs.displayName=Ls;function jh(e){return typeof e=="function"}function mt(e){return e==="indeterminate"}function $s(e){return mt(e)?"indeterminate":e?"checked":"unchecked"}const Rs=E.forwardRef(({className:e,...t},r)=>w.jsx(oo,{ref:r,className:J("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:w.jsx(js,{className:J("flex items-center justify-center text-current"),children:w.jsx(mi,{className:"h-4 w-4"})})}));Rs.displayName=oo.displayName;const Vs=6048e5,Lh=864e5,Hs=Symbol.for("constructDateFrom");function we(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Hs in e?e[Hs](t):e instanceof Date?new e.constructor(t):new Date(t)}function de(e,t){return we(t||e,e)}function Us(e,t,r){const n=de(e,r==null?void 0:r.in);return isNaN(t)?we(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ys(e,t,r){const n=de(e,r==null?void 0:r.in);if(isNaN(t))return we(e,NaN);if(!t)return n;const o=n.getDate(),i=we(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}let Bh={};function ar(){return Bh}function Ht(e,t){var s,c,l,d;const r=ar(),n=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(l=r.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??0,o=de(e,t==null?void 0:t.in),i=o.getDay(),a=(i<n?7:0)+i-n;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function sr(e,t){return Ht(e,{...t,weekStartsOn:1})}function zs(e,t){const r=de(e,t==null?void 0:t.in),n=r.getFullYear(),o=we(r,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);const i=sr(o),a=we(r,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=sr(a);return r.getTime()>=i.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function qs(e){const t=de(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Ut(e,...t){const r=we.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function cr(e,t){const r=de(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Ks(e,t,r){const[n,o]=Ut(r==null?void 0:r.in,e,t),i=cr(n),a=cr(o),s=+i-qs(i),c=+a-qs(a);return Math.round((s-c)/Lh)}function $h(e,t){const r=zs(e,t),n=we(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),sr(n)}function Rh(e,t,r){return Us(e,t*7,r)}function Vh(e,t,r){return Ys(e,t*12,r)}function Hh(e,t){let r,n=t==null?void 0:t.in;return e.forEach(o=>{!n&&typeof o=="object"&&(n=we.bind(null,o));const i=de(o,n);(!r||r<i||isNaN(+i))&&(r=i)}),we(n,r||NaN)}function Uh(e,t){let r,n=t==null?void 0:t.in;return e.forEach(o=>{!n&&typeof o=="object"&&(n=we.bind(null,o));const i=de(o,n);(!r||r>i||isNaN(+i))&&(r=i)}),we(n,r||NaN)}function Yh(e,t,r){const[n,o]=Ut(r==null?void 0:r.in,e,t);return+cr(n)==+cr(o)}function Gs(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zh(e){return!(!Gs(e)&&typeof e!="number"||isNaN(+de(e)))}function qh(e,t,r){const[n,o]=Ut(r==null?void 0:r.in,e,t),i=n.getFullYear()-o.getFullYear(),a=n.getMonth()-o.getMonth();return i*12+a}function Kh(e,t){const r=de(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function Gh(e,t){const[r,n]=Ut(e,t.start,t.end);return{start:r,end:n}}function Xh(e,t){const{start:r,end:n}=Gh(t==null?void 0:t.in,e);let o=+r>+n;const i=o?+r:+n,a=o?n:r;a.setHours(0,0,0,0),a.setDate(1);let s=1;const c=[];for(;+a<=i;)c.push(we(r,a)),a.setMonth(a.getMonth()+s);return o?c.reverse():c}function Qh(e,t){const r=de(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Zh(e,t){const r=de(e,t==null?void 0:t.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function Xs(e,t){const r=de(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Qs(e,t){var s,c,l,d;const r=ar(),n=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(l=r.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??0,o=de(e,t==null?void 0:t.in),i=o.getDay(),a=(i<n?-7:0)+6-(i-n);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function Jh(e,t){return Qs(e,{...t,weekStartsOn:1})}const ep={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tp=(e,t,r)=>{let n;const o=ep[e];return typeof o=="string"?n=o:t===1?n=o.one:n=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function io(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const rp={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},np={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},op={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ip={date:io({formats:rp,defaultWidth:"full"}),time:io({formats:np,defaultWidth:"full"}),dateTime:io({formats:op,defaultWidth:"full"})},ap={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sp=(e,t,r,n)=>ap[e];function lr(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let o;if(n==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=r!=null&&r.width?String(r.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=r!=null&&r.width?String(r.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const cp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lp={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},up={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dp={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},fp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},hp={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pp={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:lr({values:cp,defaultWidth:"wide"}),quarter:lr({values:lp,defaultWidth:"wide",argumentCallback:e=>e-1}),month:lr({values:up,defaultWidth:"wide"}),day:lr({values:dp,defaultWidth:"wide"}),dayPeriod:lr({values:fp,defaultWidth:"wide",formattingValues:hp,defaultFormattingWidth:"wide"})};function ur(e){return(t,r={})=>{const n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?gp(s,u=>u.test(a)):mp(s,u=>u.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=r.valueCallback?r.valueCallback(l):l;const d=t.slice(a.length);return{value:l,rest:d}}}function mp(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function gp(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function vp(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const o=n[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=r.valueCallback?r.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const yp=/^(\d+)(th|st|nd|rd)?/i,bp=/\d+/i,wp={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xp={any:[/^b/i,/^(a|c)/i]},Ep={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cp={any:[/1/i,/2/i,/3/i,/4/i]},Sp={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Op={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_p={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},kp={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Pp={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Mp={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ap={ordinalNumber:vp({matchPattern:yp,parsePattern:bp,valueCallback:e=>parseInt(e,10)}),era:ur({matchPatterns:wp,defaultMatchWidth:"wide",parsePatterns:xp,defaultParseWidth:"any"}),quarter:ur({matchPatterns:Ep,defaultMatchWidth:"wide",parsePatterns:Cp,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ur({matchPatterns:Sp,defaultMatchWidth:"wide",parsePatterns:Op,defaultParseWidth:"any"}),day:ur({matchPatterns:_p,defaultMatchWidth:"wide",parsePatterns:kp,defaultParseWidth:"any"}),dayPeriod:ur({matchPatterns:Pp,defaultMatchWidth:"any",parsePatterns:Mp,defaultParseWidth:"any"})},ao={code:"en-US",formatDistance:tp,formatLong:ip,formatRelative:sp,localize:pp,match:Ap,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Np(e,t){const r=de(e,t==null?void 0:t.in);return Ks(r,Xs(r))+1}function Zs(e,t){const r=de(e,t==null?void 0:t.in),n=+sr(r)-+$h(r);return Math.round(n/Vs)+1}function Js(e,t){var d,u,h,p;const r=de(e,t==null?void 0:t.in),n=r.getFullYear(),o=ar(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,a=we((t==null?void 0:t.in)||e,0);a.setFullYear(n+1,0,i),a.setHours(0,0,0,0);const s=Ht(a,t),c=we((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const l=Ht(c,t);return+r>=+s?n+1:+r>=+l?n:n-1}function Dp(e,t){var s,c,l,d;const r=ar(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(l=r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??1,o=Js(e,t),i=we((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,n),i.setHours(0,0,0,0),Ht(i,t)}function ec(e,t){const r=de(e,t==null?void 0:t.in),n=+Ht(r,t)-+Dp(r,t);return Math.round(n/Vs)+1}function ce(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const gt={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return ce(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):ce(r+1,2)},d(e,t){return ce(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ce(e.getHours()%12||12,t.length)},H(e,t){return ce(e.getHours(),t.length)},m(e,t){return ce(e.getMinutes(),t.length)},s(e,t){return ce(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),o=Math.trunc(n*Math.pow(10,r-3));return ce(o,t.length)}},Yt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tc={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return gt.y(e,t)},Y:function(e,t,r,n){const o=Js(e,n),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return ce(a,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):ce(i,t.length)},R:function(e,t){const r=zs(e);return ce(r,t.length)},u:function(e,t){const r=e.getFullYear();return ce(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return ce(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return ce(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return gt.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return ce(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const o=ec(e,n);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):ce(o,t.length)},I:function(e,t,r){const n=Zs(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):ce(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):gt.d(e,t)},D:function(e,t,r){const n=Np(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):ce(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const o=e.getDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ce(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const o=e.getDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ce(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),o=n===0?7:n;switch(t){case"i":return String(o);case"ii":return ce(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let o;switch(n===12?o=Yt.noon:n===0?o=Yt.midnight:o=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let o;switch(n>=17?o=Yt.evening:n>=12?o=Yt.afternoon:n>=4?o=Yt.morning:o=Yt.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return gt.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):gt.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):ce(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):ce(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):gt.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):gt.s(e,t)},S:function(e,t){return gt.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return nc(n);case"XXXX":case"XX":return Ot(n);case"XXXXX":case"XXX":default:return Ot(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return nc(n);case"xxxx":case"xx":return Ot(n);case"xxxxx":case"xxx":default:return Ot(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rc(n,":");case"OOOO":default:return"GMT"+Ot(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rc(n,":");case"zzzz":default:return"GMT"+Ot(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return ce(n,t.length)},T:function(e,t,r){return ce(+e,t.length)}};function rc(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),i=n%60;return i===0?r+String(o):r+String(o)+t+ce(i,2)}function nc(e,t){return e%60===0?(e>0?"-":"+")+ce(Math.abs(e)/60,2):Ot(e,t)}function Ot(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=ce(Math.trunc(n/60),2),i=ce(n%60,2);return r+o+t+i}const oc=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ic=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Tp={p:ic,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return oc(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",oc(n,t)).replace("{{time}}",ic(o,t))}},Fp=/^D+$/,Ip=/^Y+$/,Wp=["D","DD","YY","YYYY"];function jp(e){return Fp.test(e)}function Lp(e){return Ip.test(e)}function Bp(e,t,r){const n=$p(e,t,r);if(console.warn(n),Wp.includes(e))throw new RangeError(n)}function $p(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Rp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Vp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hp=/^'([^]*?)'?$/,Up=/''/g,Yp=/[a-zA-Z]/;function so(e,t,r){var d,u,h,p,x,f,v,g;const n=ar(),o=(r==null?void 0:r.locale)??n.locale??ao,i=(r==null?void 0:r.firstWeekContainsDate)??((u=(d=r==null?void 0:r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,a=(r==null?void 0:r.weekStartsOn)??((f=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:f.weekStartsOn)??n.weekStartsOn??((g=(v=n.locale)==null?void 0:v.options)==null?void 0:g.weekStartsOn)??0,s=de(e,r==null?void 0:r.in);if(!zh(s))throw new RangeError("Invalid time value");let c=t.match(Vp).map(y=>{const b=y[0];if(b==="p"||b==="P"){const O=Tp[b];return O(y,o.formatLong)}return y}).join("").match(Rp).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const b=y[0];if(b==="'")return{isToken:!1,value:zp(y)};if(tc[b])return{isToken:!0,value:y};if(b.match(Yp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:y}});o.localize.preprocessor&&(c=o.localize.preprocessor(s,c));const l={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return c.map(y=>{if(!y.isToken)return y.value;const b=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&Lp(b)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&jp(b))&&Bp(b,t,String(e));const O=tc[b[0]];return O(s,b,o.localize,l)}).join("")}function zp(e){const t=e.match(Hp);return t?t[1].replace(Up,"'"):e}function qp(e,t){const r=de(e,t==null?void 0:t.in),n=r.getFullYear(),o=r.getMonth(),i=we(r,0);return i.setFullYear(n,o+1,0),i.setHours(0,0,0,0),i.getDate()}function Kp(e,t){return de(e,t==null?void 0:t.in).getMonth()}function Gp(e,t){return de(e,t==null?void 0:t.in).getFullYear()}function Xp(e,t){return+de(e)>+de(t)}function Qp(e,t){return+de(e)<+de(t)}function Zp(e,t,r){const[n,o]=Ut(r==null?void 0:r.in,e,t);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()}function Jp(e,t,r){const[n,o]=Ut(r==null?void 0:r.in,e,t);return n.getFullYear()===o.getFullYear()}function em(e,t,r){const n=de(e,r==null?void 0:r.in),o=n.getFullYear(),i=n.getDate(),a=we(e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const s=qp(a);return n.setMonth(t,Math.min(i,s)),n}function tm(e,t,r){const n=de(e,r==null?void 0:r.in);return isNaN(+n)?we(e,NaN):(n.setFullYear(t),n)}const co={},dr={};function fr(e,t){try{const n=(co[e]||(co[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in dr?dr[n]:ac(n,n.split(":"))}catch{if(e in dr)return dr[e];const r=e==null?void 0:e.match(rm);return r?ac(e,r.slice(1)):NaN}}const rm=/([+-]\d\d):?(\d\d)?/;function ac(e,t){const r=+t[0],n=+(t[1]||0);return dr[e]=r>0?r*60+n:r*60-n}class ze extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(fr(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),cc(this),lo(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new ze(...r,t):new ze(Date.now(),t)}withTimeZone(t){return new ze(+this,t)}getTimezoneOffset(){return-fr(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),lo(this),+this}[Symbol.for("constructDateFrom")](t){return new ze(+new Date(t),this.timeZone)}}const sc=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!sc.test(e))return;const t=e.replace(sc,"$1UTC");ze.prototype[t]&&(e.startsWith("get")?ze.prototype[e]=function(){return this.internal[t]()}:(ze.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),nm(this),+this},ze.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),lo(this),+this}))});function lo(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function nm(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),cc(e)}function cc(e){const t=fr(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const n=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),i=n-o,a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const s=n-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const c=fr(e.timeZone,e),d=-new Date(+e).getTimezoneOffset()-c,u=c!==t,h=d-s;if(u&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);const p=fr(e.timeZone,e),x=c-p;x&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x))}}class Se extends ze{static tz(t,...r){return r.length?new Se(...r,t):new Se(Date.now(),t)}toISOString(){const[t,r,n]=this.tzComponents(),o=`${t}${r}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,r,n,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${n} ${r} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[r,n,o]=this.tzComponents();return`${t} GMT${r}${n}${o} (${om(this.timeZone,this)})`}toLocaleString(t,r){return Date.prototype.toLocaleString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleDateString(t,r){return Date.prototype.toLocaleDateString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleTimeString(t,r){return Date.prototype.toLocaleTimeString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),r=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[r,n,o]}withTimeZone(t){return new Se(+this,t)}[Symbol.for("constructDateFrom")](t){return new Se(+new Date(t),this.timeZone)}}function om(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}var G;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(G||(G={}));var ge;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ge||(ge={}));var We;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(We||(We={}));var Ae;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Ae||(Ae={}));const lc=5,im=4;function am(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,o=t.addDays(e,-n+1),i=t.addDays(o,lc*7-1);return t.getMonth(e)===t.getMonth(i)?lc:im}function uc(e,t){const r=t.startOfMonth(e),n=r.getDay();return n===1?r:n===0?t.addDays(r,-1*6):t.addDays(r,-1*(n-1))}function sm(e,t){const r=uc(e,t),n=am(e,t);return t.addDays(r,n*7-1)}class rt{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?Se.tz(this.options.timeZone):new this.Date},this.newDate=(n,o,i)=>{var a;return(a=this.overrides)!=null&&a.newDate?this.overrides.newDate(n,o,i):this.options.timeZone?new Se(n,o,i,this.options.timeZone):new Date(n,o,i)},this.addDays=(n,o)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(n,o):Us(n,o)},this.addMonths=(n,o)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,o):Ys(n,o)},this.addWeeks=(n,o)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,o):Rh(n,o)},this.addYears=(n,o)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,o):Vh(n,o)},this.differenceInCalendarDays=(n,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,o):Ks(n,o)},this.differenceInCalendarMonths=(n,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,o):qh(n,o)},this.eachMonthOfInterval=n=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):Xh(n)},this.endOfBroadcastWeek=n=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):sm(n,this)},this.endOfISOWeek=n=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(n):Jh(n)},this.endOfMonth=n=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(n):Kh(n)},this.endOfWeek=(n,o)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,o):Qs(n,this.options)},this.endOfYear=n=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(n):Zh(n)},this.format=(n,o,i)=>{var s;const a=(s=this.overrides)!=null&&s.format?this.overrides.format(n,o,this.options):so(n,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=n=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(n):Zs(n)},this.getMonth=(n,o)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):Kp(n,this.options)},this.getYear=(n,o)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):Gp(n,this.options)},this.getWeek=(n,o)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):ec(n,this.options)},this.isAfter=(n,o)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,o):Xp(n,o)},this.isBefore=(n,o)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,o):Qp(n,o)},this.isDate=n=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(n):Gs(n)},this.isSameDay=(n,o)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,o):Yh(n,o)},this.isSameMonth=(n,o)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,o):Zp(n,o)},this.isSameYear=(n,o)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,o):Jp(n,o)},this.max=n=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(n):Hh(n)},this.min=n=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(n):Uh(n)},this.setMonth=(n,o)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,o):em(n,o)},this.setYear=(n,o)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,o):tm(n,o)},this.startOfBroadcastWeek=(n,o)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):uc(n,this)},this.startOfDay=n=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(n):cr(n)},this.startOfISOWeek=n=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(n):sr(n)},this.startOfMonth=n=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(n):Qh(n)},this.startOfWeek=(n,o)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):Ht(n,this.options)},this.startOfYear=n=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(n):Xs(n)},this.options={locale:ao,...t},this.overrides=r}getDigitMap(){const{numerals:t="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let o=0;o<10;o++)n[o.toString()]=r.format(o);return n}replaceDigits(t){const r=this.getDigitMap();return t.replace(/\d/g,n=>r[n]||n)}formatNumber(t){return this.replaceDigits(t.toString())}}const qe=new rt;class dc{constructor(t,r,n=qe){this.date=t,this.displayMonth=r,this.outside=!!(r&&!n.isSameMonth(t,r)),this.dateLib=n}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class cm{constructor(t,r){this.date=t,this.weeks=r}}class lm{constructor(t,r){this.days=r,this.weekNumber=t}}function nt(e,t,r=!1,n=qe){let{from:o,to:i}=e;const{differenceInCalendarDays:a,isSameDay:s}=n;return o&&i?(a(i,o)<0&&([o,i]=[i,o]),a(t,o)>=(r?1:0)&&a(i,t)>=(r?1:0)):!r&&i?s(i,t):!r&&o?s(o,t):!1}function fc(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function uo(e){return!!(e&&typeof e=="object"&&"from"in e)}function hc(e){return!!(e&&typeof e=="object"&&"after"in e)}function pc(e){return!!(e&&typeof e=="object"&&"before"in e)}function mc(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function gc(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ot(e,t,r=qe){const n=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:a}=r;return n.some(s=>{if(typeof s=="boolean")return s;if(r.isDate(s))return o(e,s);if(gc(s,r))return s.includes(e);if(uo(s))return nt(s,e,!1,r);if(mc(s))return Array.isArray(s.dayOfWeek)?s.dayOfWeek.includes(e.getDay()):s.dayOfWeek===e.getDay();if(fc(s)){const c=i(s.before,e),l=i(s.after,e),d=c>0,u=l<0;return a(s.before,s.after)?u&&d:d||u}return hc(s)?i(e,s.after)>0:pc(s)?i(s.before,e)>0:typeof s=="function"?s(e):!1})}function um(e,t,r){const{disabled:n,hidden:o,modifiers:i,showOutsideDays:a,broadcastCalendar:s,today:c}=t,{isSameDay:l,isSameMonth:d,startOfMonth:u,isBefore:h,endOfMonth:p,isAfter:x}=r,f=t.startMonth&&u(t.startMonth),v=t.endMonth&&p(t.endMonth),g={[ge.focused]:[],[ge.outside]:[],[ge.disabled]:[],[ge.hidden]:[],[ge.today]:[]},y={};for(const b of e){const{date:O,displayMonth:S}=b,T=!!(S&&!d(O,S)),P=!!(f&&h(O,f)),L=!!(v&&x(O,v)),$=!!(n&&ot(O,n,r)),B=!!(o&&ot(O,o,r))||P||L||!s&&!a&&T||s&&a===!1&&T,U=l(O,c??r.today());T&&g.outside.push(b),$&&g.disabled.push(b),B&&g.hidden.push(b),U&&g.today.push(b),i&&Object.keys(i).forEach(R=>{const K=i==null?void 0:i[R];K&&ot(O,K,r)&&(y[R]?y[R].push(b):y[R]=[b])})}return b=>{const O={[ge.focused]:!1,[ge.disabled]:!1,[ge.hidden]:!1,[ge.outside]:!1,[ge.today]:!1},S={};for(const T in g){const P=g[T];O[T]=P.some(L=>L===b)}for(const T in y)S[T]=y[T].some(P=>P===b);return{...O,...S}}}function dm(e,t,r={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[i])=>(r[i]?o.push(r[i]):t[ge[i]]?o.push(t[ge[i]]):t[We[i]]&&o.push(t[We[i]]),o),[t[G.Day]])}function fm(e){return D.createElement("button",{...e})}function hm(e){return D.createElement("span",{...e})}function pm(e){const{size:t=24,orientation:r="left",className:n}=e;return D.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&D.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&D.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&D.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&D.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function mm(e){const{day:t,modifiers:r,...n}=e;return D.createElement("td",{...n})}function gm(e){const{day:t,modifiers:r,...n}=e,o=D.useRef(null);return D.useEffect(()=>{var i;r.focused&&((i=o.current)==null||i.focus())},[r.focused]),D.createElement("button",{ref:o,...n})}function vm(e){const{options:t,className:r,components:n,classNames:o,...i}=e,a=[o[G.Dropdown],r].join(" "),s=t==null?void 0:t.find(({value:c})=>c===i.value);return D.createElement("span",{"data-disabled":i.disabled,className:o[G.DropdownRoot]},D.createElement(n.Select,{className:a,...i},t==null?void 0:t.map(({value:c,label:l,disabled:d})=>D.createElement(n.Option,{key:c,value:c,disabled:d},l))),D.createElement("span",{className:o[G.CaptionLabel],"aria-hidden":!0},s==null?void 0:s.label,D.createElement(n.Chevron,{orientation:"down",size:18,className:o[G.Chevron]})))}function ym(e){return D.createElement("div",{...e})}function bm(e){return D.createElement("div",{...e})}function wm(e){const{calendarMonth:t,displayIndex:r,...n}=e;return D.createElement("div",{...n},e.children)}function xm(e){const{calendarMonth:t,displayIndex:r,...n}=e;return D.createElement("div",{...n})}function Em(e){return D.createElement("table",{...e})}function Cm(e){return D.createElement("div",{...e})}const vc=D.createContext(void 0);function hr(){const e=D.useContext(vc);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function Sm(e){const{components:t}=hr();return D.createElement(t.Dropdown,{...e})}function Om(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:o,...i}=e,{components:a,classNames:s,labels:{labelPrevious:c,labelNext:l}}=hr(),d=D.useCallback(h=>{o&&(r==null||r(h))},[o,r]),u=D.useCallback(h=>{n&&(t==null||t(h))},[n,t]);return D.createElement("nav",{...i},D.createElement(a.PreviousMonthButton,{type:"button",className:s[G.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:u},D.createElement(a.Chevron,{disabled:n?void 0:!0,className:s[G.Chevron],orientation:"left"})),D.createElement(a.NextMonthButton,{type:"button",className:s[G.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":l(o),onClick:d},D.createElement(a.Chevron,{disabled:o?void 0:!0,orientation:"right",className:s[G.Chevron]})))}function _m(e){const{components:t}=hr();return D.createElement(t.Button,{...e})}function km(e){return D.createElement("option",{...e})}function Pm(e){const{components:t}=hr();return D.createElement(t.Button,{...e})}function Mm(e){const{rootRef:t,...r}=e;return D.createElement("div",{...r,ref:t})}function Am(e){return D.createElement("select",{...e})}function Nm(e){const{week:t,...r}=e;return D.createElement("tr",{...r})}function Dm(e){return D.createElement("th",{...e})}function Tm(e){return D.createElement("thead",{"aria-hidden":!0},D.createElement("tr",{...e}))}function Fm(e){const{week:t,...r}=e;return D.createElement("th",{...r})}function Im(e){return D.createElement("th",{...e})}function Wm(e){return D.createElement("tbody",{...e})}function jm(e){const{components:t}=hr();return D.createElement(t.Dropdown,{...e})}const Lm=Object.freeze(Object.defineProperty({__proto__:null,Button:fm,CaptionLabel:hm,Chevron:pm,Day:mm,DayButton:gm,Dropdown:vm,DropdownNav:ym,Footer:bm,Month:wm,MonthCaption:xm,MonthGrid:Em,Months:Cm,MonthsDropdown:Sm,Nav:Om,NextMonthButton:_m,Option:km,PreviousMonthButton:Pm,Root:Mm,Select:Am,Week:Nm,WeekNumber:Fm,WeekNumberHeader:Im,Weekday:Dm,Weekdays:Tm,Weeks:Wm,YearsDropdown:jm},Symbol.toStringTag,{value:"Module"}));function Bm(e){return{...Lm,...e}}function $m(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([r,n])=>{r.startsWith("data-")&&(t[r]=n)}),t}function Rm(){const e={};for(const t in G)e[G[t]]=`rdp-${G[t]}`;for(const t in ge)e[ge[t]]=`rdp-${ge[t]}`;for(const t in We)e[We[t]]=`rdp-${We[t]}`;for(const t in Ae)e[Ae[t]]=`rdp-${Ae[t]}`;return e}function yc(e,t,r){return(r??new rt(t)).format(e,"LLLL y")}const Vm=yc;function Hm(e,t,r){return(r??new rt(t)).format(e,"d")}function Um(e,t=qe){return t.format(e,"LLLL")}function Ym(e,t=qe){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function zm(){return""}function qm(e,t,r){return(r??new rt(t)).format(e,"cccccc")}function bc(e,t=qe){return t.format(e,"yyyy")}const Km=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:yc,formatDay:Hm,formatMonthCaption:Vm,formatMonthDropdown:Um,formatWeekNumber:Ym,formatWeekNumberHeader:zm,formatWeekdayName:qm,formatYearCaption:bc,formatYearDropdown:bc},Symbol.toStringTag,{value:"Module"}));function Gm(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Km,...e}}function Xm(e,t,r,n,o){const{startOfMonth:i,startOfYear:a,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=o;return c({start:a(e),end:s(e)}).map(h=>{const p=n.formatMonthDropdown(h,o),x=l(h),f=t&&h<i(t)||r&&h>i(r)||!1;return{value:x,label:p,disabled:f}})}function Qm(e,t={},r={}){let n={...t==null?void 0:t[G.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{n={...n,...r==null?void 0:r[o]}}),n}function Zm(e,t,r){const n=e.today(),o=t?e.startOfISOWeek(n):e.startOfWeek(n),i=[];for(let a=0;a<7;a++){const s=e.addDays(o,a);i.push(s)}return i}function Jm(e,t,r,n){if(!e||!t)return;const{startOfYear:o,endOfYear:i,addYears:a,getYear:s,isBefore:c,isSameYear:l}=n,d=o(e),u=i(t),h=[];let p=d;for(;c(p,u)||l(p,u);)h.push(p),p=a(p,1);return h.map(x=>{const f=r.formatYearDropdown(x,n);return{value:s(x),label:f,disabled:!1}})}function wc(e,t,r){return(r??new rt(t)).format(e,"LLLL y")}const eg=wc;function tg(e,t,r,n){let o=(n??new rt(r)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function xc(e,t,r,n){let o=(n??new rt(r)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const rg=xc;function ng(){return""}function og(e){return"Choose the Month"}function ig(e){return"Go to the Next Month"}function ag(e){return"Go to the Previous Month"}function sg(e,t,r){return(r??new rt(t)).format(e,"cccc")}function cg(e,t){return`Week ${e}`}function lg(e){return"Week Number"}function ug(e){return"Choose the Year"}const dg=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:eg,labelDay:rg,labelDayButton:xc,labelGrid:wc,labelGridcell:tg,labelMonthDropdown:og,labelNav:ng,labelNext:ig,labelPrevious:ag,labelWeekNumber:cg,labelWeekNumberHeader:lg,labelWeekday:sg,labelYearDropdown:ug},Symbol.toStringTag,{value:"Module"})),pr=e=>e instanceof HTMLElement?e:null,fo=e=>[...e.querySelectorAll("[data-animated-month]")??[]],fg=e=>pr(e.querySelector("[data-animated-month]")),ho=e=>pr(e.querySelector("[data-animated-caption]")),po=e=>pr(e.querySelector("[data-animated-weeks]")),hg=e=>pr(e.querySelector("[data-animated-nav]")),pg=e=>pr(e.querySelector("[data-animated-weekdays]"));function mg(e,t,{classNames:r,months:n,focused:o,dateLib:i}){const a=D.useRef(null),s=D.useRef(n),c=D.useRef(!1);D.useLayoutEffect(()=>{const l=s.current;if(s.current=n,!t||!e.current||!(e.current instanceof HTMLElement)||n.length===0||l.length===0||n.length!==l.length)return;const d=i.isSameMonth(n[0].date,l[0].date),u=i.isAfter(n[0].date,l[0].date),h=u?r[Ae.caption_after_enter]:r[Ae.caption_before_enter],p=u?r[Ae.weeks_after_enter]:r[Ae.weeks_before_enter],x=a.current,f=e.current.cloneNode(!0);if(f instanceof HTMLElement?(fo(f).forEach(b=>{if(!(b instanceof HTMLElement))return;const O=fg(b);O&&b.contains(O)&&b.removeChild(O);const S=ho(b);S&&S.classList.remove(h);const T=po(b);T&&T.classList.remove(p)}),a.current=f):a.current=null,c.current||d||o)return;const v=x instanceof HTMLElement?fo(x):[],g=fo(e.current);if(g&&g.every(y=>y instanceof HTMLElement)&&v&&v.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=hg(e.current);y&&(y.style.zIndex="1"),g.forEach((b,O)=>{const S=v[O];if(!S)return;b.style.position="relative",b.style.overflow="hidden";const T=ho(b);T&&T.classList.add(h);const P=po(b);P&&P.classList.add(p);const L=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),T&&T.classList.remove(h),P&&P.classList.remove(p),b.style.position="",b.style.overflow="",b.contains(S)&&b.removeChild(S)};S.style.pointerEvents="none",S.style.position="absolute",S.style.overflow="hidden",S.setAttribute("aria-hidden","true");const $=pg(S);$&&($.style.opacity="0");const B=ho(S);B&&(B.classList.add(u?r[Ae.caption_before_exit]:r[Ae.caption_after_exit]),B.addEventListener("animationend",L));const U=po(S);U&&U.classList.add(u?r[Ae.weeks_before_exit]:r[Ae.weeks_after_exit]),b.insertBefore(S,b.firstChild)})}})}function gg(e,t,r,n){const o=e[0],i=e[e.length-1],{ISOWeek:a,fixedWeeks:s,broadcastCalendar:c}=r??{},{addDays:l,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:h,endOfISOWeek:p,endOfMonth:x,endOfWeek:f,isAfter:v,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:b}=n,O=c?g(o,n):a?y(o):b(o),S=c?h(i):a?p(x(i)):f(x(i)),T=d(S,O),P=u(i,o)+1,L=[];for(let U=0;U<=T;U++){const R=l(O,U);if(t&&v(R,t))break;L.push(R)}const B=(c?35:42)*P;if(s&&L.length<B){const U=B-L.length;for(let R=0;R<U;R++){const K=l(L[L.length-1],1);L.push(K)}}return L}function vg(e){const t=[];return e.reduce((r,n)=>{const o=n.weeks.reduce((i,a)=>[...i,...a.days],t);return[...r,...o]},t)}function yg(e,t,r,n){const{numberOfMonths:o=1}=r,i=[];for(let a=0;a<o;a++){const s=n.addMonths(e,a);if(t&&s>t)break;i.push(s)}return i}function Ec(e,t){const{month:r,defaultMonth:n,today:o=t.today(),numberOfMonths:i=1,endMonth:a,startMonth:s}=e;let c=r||n||o;const{differenceInCalendarMonths:l,addMonths:d,startOfMonth:u}=t;if(a&&l(a,c)<0){const h=-1*(i-1);c=d(a,h)}return s&&l(c,s)<0&&(c=s),u(c)}function bg(e,t,r,n){const{addDays:o,endOfBroadcastWeek:i,endOfISOWeek:a,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:h,startOfWeek:p}=n,x=e.reduce((f,v)=>{const g=r.broadcastCalendar?u(v,n):r.ISOWeek?h(v):p(v),y=r.broadcastCalendar?i(v):r.ISOWeek?a(s(v)):c(s(v)),b=t.filter(P=>P>=g&&P<=y),O=r.broadcastCalendar?35:42;if(r.fixedWeeks&&b.length<O){const P=t.filter(L=>{const $=O-b.length;return L>y&&L<=o(y,$)});b.push(...P)}const S=b.reduce((P,L)=>{const $=r.ISOWeek?l(L):d(L),B=P.find(R=>R.weekNumber===$),U=new dc(L,v,n);return B?B.days.push(U):P.push(new lm($,[U])),P},[]),T=new cm(v,S);return f.push(T),f},[]);return r.reverseMonths?x.reverse():x}function wg(e,t){let{startMonth:r,endMonth:n}=e;const{startOfYear:o,startOfDay:i,startOfMonth:a,endOfMonth:s,addYears:c,endOfYear:l,newDate:d,today:u}=t,{fromYear:h,toYear:p,fromMonth:x,toMonth:f}=e;!r&&x&&(r=x),!r&&h&&(r=t.newDate(h,0,1)),!n&&f&&(n=f),!n&&p&&(n=d(p,11,31));const v=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return r?r=a(r):h?r=d(h,0,1):!r&&v&&(r=o(c(e.today??u(),-100))),n?n=s(n):p?n=d(p,11,31):!n&&v&&(n=l(e.today??u())),[r&&i(r),n&&i(n)]}function xg(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=r,{startOfMonth:a,addMonths:s,differenceInCalendarMonths:c}=n,l=o?i:1,d=a(e);if(!t)return s(d,l);if(!(c(t,e)<i))return s(d,l)}function Eg(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i}=r,{startOfMonth:a,addMonths:s,differenceInCalendarMonths:c}=n,l=o?i??1:1,d=a(e);if(!t)return s(d,-l);if(!(c(d,t)<=0))return s(d,-l)}function Cg(e){const t=[];return e.reduce((r,n)=>[...r,...n.weeks],t)}function Jr(e,t){const[r,n]=D.useState(e);return[t===void 0?r:t,n]}function Sg(e,t){const[r,n]=wg(e,t),{startOfMonth:o,endOfMonth:i}=t,a=Ec(e,t),[s,c]=Jr(a,e.month?a:void 0);D.useEffect(()=>{const T=Ec(e,t);c(T)},[e.timeZone]);const l=yg(s,n,e,t),d=gg(l,e.endMonth?i(e.endMonth):void 0,e,t),u=bg(l,d,e,t),h=Cg(u),p=vg(u),x=Eg(s,r,e,t),f=xg(s,n,e,t),{disableNavigation:v,onMonthChange:g}=e,y=T=>h.some(P=>P.days.some(L=>L.isEqualTo(T))),b=T=>{if(v)return;let P=o(T);r&&P<o(r)&&(P=o(r)),n&&P>o(n)&&(P=o(n)),c(P),g==null||g(P)};return{months:u,weeks:h,days:p,navStart:r,navEnd:n,previousMonth:x,nextMonth:f,goToMonth:b,goToDay:T=>{y(T)||b(T.date)}}}var Ke;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Ke||(Ke={}));function Cc(e){return!e[ge.disabled]&&!e[ge.hidden]&&!e[ge.outside]}function Og(e,t,r,n){let o,i=-1;for(const a of e){const s=t(a);Cc(s)&&(s[ge.focused]&&i<Ke.FocusedModifier?(o=a,i=Ke.FocusedModifier):n!=null&&n.isEqualTo(a)&&i<Ke.LastFocused?(o=a,i=Ke.LastFocused):r(a.date)&&i<Ke.Selected?(o=a,i=Ke.Selected):s[ge.today]&&i<Ke.Today&&(o=a,i=Ke.Today))}return o||(o=e.find(a=>Cc(t(a)))),o}function _g(e,t,r,n,o,i,a){const{ISOWeek:s,broadcastCalendar:c}=i,{addDays:l,addMonths:d,addWeeks:u,addYears:h,endOfBroadcastWeek:p,endOfISOWeek:x,endOfWeek:f,max:v,min:g,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:O}=a;let T={day:l,week:u,month:d,year:h,startOfWeek:P=>c?y(P,a):s?b(P):O(P),endOfWeek:P=>c?p(P):s?x(P):f(P)}[e](r,t==="after"?1:-1);return t==="before"&&n?T=v([n,T]):t==="after"&&o&&(T=g([o,T])),T}function Sc(e,t,r,n,o,i,a,s=0){if(s>365)return;const c=_g(e,t,r.date,n,o,i,a),l=!!(i.disabled&&ot(c,i.disabled,a)),d=!!(i.hidden&&ot(c,i.hidden,a)),u=c,h=new dc(c,u,a);return!l&&!d?h:Sc(e,t,h,n,o,i,a,s+1)}function kg(e,t,r,n,o){const{autoFocus:i}=e,[a,s]=D.useState(),c=Og(t.days,r,n||(()=>!1),a),[l,d]=D.useState(i?c:void 0);return{isFocusTarget:f=>!!(c!=null&&c.isEqualTo(f)),setFocused:d,focused:l,blur:()=>{s(l),d(void 0)},moveFocus:(f,v)=>{if(!l)return;const g=Sc(f,v,l,t.navStart,t.navEnd,e,o);g&&(t.goToDay(g),d(g))}}}function Pg(e,t){const{selected:r,required:n,onSelect:o}=e,[i,a]=Jr(r,o?r:void 0),s=o?r:i,{isSameDay:c}=t,l=p=>(s==null?void 0:s.some(x=>c(x,p)))??!1,{min:d,max:u}=e;return{selected:s,select:(p,x,f)=>{let v=[...s??[]];if(l(p)){if((s==null?void 0:s.length)===d||n&&(s==null?void 0:s.length)===1)return;v=s==null?void 0:s.filter(g=>!c(g,p))}else(s==null?void 0:s.length)===u?v=[p]:v=[...v,p];return o||a(v),o==null||o(v,p,x,f),v},isSelected:l}}function Mg(e,t,r=0,n=0,o=!1,i=qe){const{from:a,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:d}=i;let u;if(!a&&!s)u={from:e,to:r>0?void 0:e};else if(a&&!s)c(a,e)?o?u={from:a,to:void 0}:u=void 0:d(e,a)?u={from:e,to:a}:u={from:a,to:e};else if(a&&s)if(c(a,e)&&c(s,e))o?u={from:a,to:s}:u=void 0;else if(c(a,e))u={from:a,to:r>0?void 0:e};else if(c(s,e))u={from:e,to:r>0?void 0:e};else if(d(e,a))u={from:e,to:s};else if(l(e,a))u={from:a,to:e};else if(l(e,s))u={from:a,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const h=i.differenceInCalendarDays(u.to,u.from);n>0&&h>n?u={from:e,to:void 0}:r>1&&h<r&&(u={from:e,to:void 0})}return u}function Ag(e,t,r=qe){const n=Array.isArray(t)?t:[t];let o=e.from;const i=r.differenceInCalendarDays(e.to,e.from),a=Math.min(i,6);for(let s=0;s<=a;s++){if(n.includes(o.getDay()))return!0;o=r.addDays(o,1)}return!1}function Oc(e,t,r=qe){return nt(e,t.from,!1,r)||nt(e,t.to,!1,r)||nt(t,e.from,!1,r)||nt(t,e.to,!1,r)}function Ng(e,t,r=qe){const n=Array.isArray(t)?t:[t];if(n.filter(s=>typeof s!="function").some(s=>typeof s=="boolean"?s:r.isDate(s)?nt(e,s,!1,r):gc(s,r)?s.some(c=>nt(e,c,!1,r)):uo(s)?s.from&&s.to?Oc(e,{from:s.from,to:s.to},r):!1:mc(s)?Ag(e,s.dayOfWeek,r):fc(s)?r.isAfter(s.before,s.after)?Oc(e,{from:r.addDays(s.after,1),to:r.addDays(s.before,-1)},r):ot(e.from,s,r)||ot(e.to,s,r):hc(s)||pc(s)?ot(e.from,s,r)||ot(e.to,s,r):!1))return!0;const a=n.filter(s=>typeof s=="function");if(a.length){let s=e.from;const c=r.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(a.some(d=>d(s)))return!0;s=r.addDays(s,1)}}return!1}function Dg(e,t){const{disabled:r,excludeDisabled:n,selected:o,required:i,onSelect:a}=e,[s,c]=Jr(o,a?o:void 0),l=a?o:s;return{selected:l,select:(h,p,x)=>{const{min:f,max:v}=e,g=h?Mg(h,l,f,v,i,t):void 0;return n&&r&&(g!=null&&g.from)&&g.to&&Ng({from:g.from,to:g.to},r,t)&&(g.from=h,g.to=void 0),a||c(g),a==null||a(g,h,p,x),g},isSelected:h=>l&&nt(l,h,!1,t)}}function Tg(e,t){const{selected:r,required:n,onSelect:o}=e,[i,a]=Jr(r,o?r:void 0),s=o?r:i,{isSameDay:c}=t;return{selected:s,select:(u,h,p)=>{let x=u;return!n&&s&&s&&c(u,s)&&(x=void 0),o||a(x),o==null||o(x,u,h,p),x},isSelected:u=>s?c(s,u):!1}}function Fg(e,t){const r=Tg(e,t),n=Pg(e,t),o=Dg(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return o;default:return}}function Ig(e){var vl;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Se(t.today,t.timeZone)),t.month&&(t.month=new Se(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Se(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Se(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Se(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Se(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(vl=t.selected)==null?void 0:vl.map(ne=>new Se(ne,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Se(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Se(t.selected.to,t.timeZone):void 0}));const{components:r,formatters:n,labels:o,dateLib:i,locale:a,classNames:s}=D.useMemo(()=>{const ne={...ao,...t.locale};return{dateLib:new rt({locale:ne,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:Bm(t.components),formatters:Gm(t.formatters),labels:{...dg,...t.labels},locale:ne,classNames:{...Rm(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:l,navLayout:d,numberOfMonths:u=1,onDayBlur:h,onDayClick:p,onDayFocus:x,onDayKeyDown:f,onDayMouseEnter:v,onDayMouseLeave:g,onNextClick:y,onPrevClick:b,showWeekNumber:O,styles:S}=t,{formatCaption:T,formatDay:P,formatMonthDropdown:L,formatWeekNumber:$,formatWeekNumberHeader:B,formatWeekdayName:U,formatYearDropdown:R}=n,K=Sg(t,i),{days:ee,months:H,navStart:X,navEnd:Z,previousMonth:m,nextMonth:C,goToMonth:_}=K,k=um(ee,t,i),{isSelected:M,select:F,selected:I}=Fg(t,i)??{},{blur:j,focused:W,isFocusTarget:A,moveFocus:V,setFocused:re}=kg(t,K,k,M??(()=>!1),i),{labelDayButton:q,labelGridcell:z,labelGrid:Q,labelMonthDropdown:se,labelNav:Ee,labelPrevious:Le,labelNext:Ne,labelWeekday:Be,labelWeekNumber:De,labelWeekNumberHeader:ye,labelYearDropdown:Ib}=o,Wb=D.useMemo(()=>Zm(i,t.ISOWeek),[i,t.ISOWeek]),ml=l!==void 0||p!==void 0,$o=D.useCallback(()=>{m&&(_(m),b==null||b(m))},[m,_,b]),Ro=D.useCallback(()=>{C&&(_(C),y==null||y(C))},[_,C,y]),jb=D.useCallback((ne,me)=>he=>{he.preventDefault(),he.stopPropagation(),re(ne),F==null||F(ne.date,me,he),p==null||p(ne.date,me,he)},[F,p,re]),Lb=D.useCallback((ne,me)=>he=>{re(ne),x==null||x(ne.date,me,he)},[x,re]),Bb=D.useCallback((ne,me)=>he=>{j(),h==null||h(ne.date,me,he)},[j,h]),$b=D.useCallback((ne,me)=>he=>{const bt={ArrowLeft:["day",t.dir==="rtl"?"after":"before"],ArrowRight:["day",t.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[he.shiftKey?"year":"month","before"],PageDown:[he.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(bt[he.key]){he.preventDefault(),he.stopPropagation();const[$e,cn]=bt[he.key];V($e,cn)}f==null||f(ne.date,me,he)},[V,f,t.dir]),Rb=D.useCallback((ne,me)=>he=>{v==null||v(ne.date,me,he)},[v]),Vb=D.useCallback((ne,me)=>he=>{g==null||g(ne.date,me,he)},[g]),Hb=D.useCallback(ne=>me=>{const he=Number(me.target.value),bt=i.setMonth(i.startOfMonth(ne),he);_(bt)},[i,_]),Ub=D.useCallback(ne=>me=>{const he=Number(me.target.value),bt=i.setYear(i.startOfMonth(ne),he);_(bt)},[i,_]),{className:Yb,style:zb}=D.useMemo(()=>({className:[s[G.Root],t.className].filter(Boolean).join(" "),style:{...S==null?void 0:S[G.Root],...t.style}}),[s,t.className,t.style,S]),qb=$m(t),gl=D.useRef(null);mg(gl,!!t.animate,{classNames:s,months:H,focused:W,dateLib:i});const Kb={dayPickerProps:t,selected:I,select:F,isSelected:M,months:H,nextMonth:C,previousMonth:m,goToMonth:_,getModifiers:k,components:r,classNames:s,styles:S,labels:o,formatters:n};return D.createElement(vc.Provider,{value:Kb},D.createElement(r.Root,{rootRef:t.animate?gl:void 0,className:Yb,style:zb,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],...qb},D.createElement(r.Months,{className:s[G.Months],style:S==null?void 0:S[G.Months]},!t.hideNavigation&&!d&&D.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[G.Nav],style:S==null?void 0:S[G.Nav],"aria-label":Ee(),onPreviousClick:$o,onNextClick:Ro,previousMonth:m,nextMonth:C}),H.map((ne,me)=>{const he=Xm(ne.date,X,Z,n,i),bt=Jm(X,Z,n,i);return D.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:s[G.Month],style:S==null?void 0:S[G.Month],key:me,displayIndex:me,calendarMonth:ne},d==="around"&&!t.hideNavigation&&me===0&&D.createElement(r.PreviousMonthButton,{type:"button",className:s[G.PreviousMonthButton],tabIndex:m?void 0:-1,"aria-disabled":m?void 0:!0,"aria-label":Le(m),onClick:$o,"data-animated-button":t.animate?"true":void 0},D.createElement(r.Chevron,{disabled:m?void 0:!0,className:s[G.Chevron],orientation:t.dir==="rtl"?"right":"left"})),D.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:s[G.MonthCaption],style:S==null?void 0:S[G.MonthCaption],calendarMonth:ne,displayIndex:me},c!=null&&c.startsWith("dropdown")?D.createElement(r.DropdownNav,{className:s[G.Dropdowns],style:S==null?void 0:S[G.Dropdowns]},c==="dropdown"||c==="dropdown-months"?D.createElement(r.MonthsDropdown,{className:s[G.MonthsDropdown],"aria-label":se(),classNames:s,components:r,disabled:!!t.disableNavigation,onChange:Hb(ne.date),options:he,style:S==null?void 0:S[G.Dropdown],value:i.getMonth(ne.date)}):D.createElement("span",null,L(ne.date,i)),c==="dropdown"||c==="dropdown-years"?D.createElement(r.YearsDropdown,{className:s[G.YearsDropdown],"aria-label":Ib(i.options),classNames:s,components:r,disabled:!!t.disableNavigation,onChange:Ub(ne.date),options:bt,style:S==null?void 0:S[G.Dropdown],value:i.getYear(ne.date)}):D.createElement("span",null,R(ne.date,i)),D.createElement("span",{role:"status","aria-live":"polite",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"}},T(ne.date,i.options,i))):D.createElement(r.CaptionLabel,{className:s[G.CaptionLabel],role:"status","aria-live":"polite"},T(ne.date,i.options,i))),d==="around"&&!t.hideNavigation&&me===u-1&&D.createElement(r.NextMonthButton,{type:"button",className:s[G.NextMonthButton],tabIndex:C?void 0:-1,"aria-disabled":C?void 0:!0,"aria-label":Ne(C),onClick:Ro,"data-animated-button":t.animate?"true":void 0},D.createElement(r.Chevron,{disabled:C?void 0:!0,className:s[G.Chevron],orientation:t.dir==="rtl"?"left":"right"})),me===u-1&&d==="after"&&!t.hideNavigation&&D.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[G.Nav],style:S==null?void 0:S[G.Nav],"aria-label":Ee(),onPreviousClick:$o,onNextClick:Ro,previousMonth:m,nextMonth:C}),D.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":Q(ne.date,i.options,i)||void 0,className:s[G.MonthGrid],style:S==null?void 0:S[G.MonthGrid]},!t.hideWeekdays&&D.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:s[G.Weekdays],style:S==null?void 0:S[G.Weekdays]},O&&D.createElement(r.WeekNumberHeader,{"aria-label":ye(i.options),className:s[G.WeekNumberHeader],style:S==null?void 0:S[G.WeekNumberHeader],scope:"col"},B()),Wb.map(($e,cn)=>D.createElement(r.Weekday,{"aria-label":Be($e,i.options,i),className:s[G.Weekday],key:cn,style:S==null?void 0:S[G.Weekday],scope:"col"},U($e,i.options,i)))),D.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:s[G.Weeks],style:S==null?void 0:S[G.Weeks]},ne.weeks.map(($e,cn)=>D.createElement(r.Week,{className:s[G.Week],key:$e.weekNumber,style:S==null?void 0:S[G.Week],week:$e},O&&D.createElement(r.WeekNumber,{week:$e,style:S==null?void 0:S[G.WeekNumber],"aria-label":De($e.weekNumber,{locale:a}),className:s[G.WeekNumber],scope:"row",role:"rowheader"},$($e.weekNumber,i)),$e.days.map(Oe=>{const{date:Xe}=Oe,le=k(Oe);if(le[ge.focused]=!le.hidden&&!!(W!=null&&W.isEqualTo(Oe)),le[We.selected]=(M==null?void 0:M(Xe))||le.selected,uo(I)){const{from:Vo,to:Ho}=I;le[We.range_start]=!!(Vo&&Ho&&i.isSameDay(Xe,Vo)),le[We.range_end]=!!(Vo&&Ho&&i.isSameDay(Xe,Ho)),le[We.range_middle]=nt(I,Xe,!0,i)}const Gb=Qm(le,S,t.modifiersStyles),Xb=dm(le,s,t.modifiersClassNames),Qb=!ml&&!le.hidden?z(Xe,le,i.options,i):void 0;return D.createElement(r.Day,{key:`${i.format(Xe,"yyyy-MM-dd")}_${i.format(Oe.displayMonth,"yyyy-MM")}`,day:Oe,modifiers:le,className:Xb.join(" "),style:Gb,role:"gridcell","aria-selected":le.selected||void 0,"aria-label":Qb,"data-day":i.format(Xe,"yyyy-MM-dd"),"data-month":Oe.outside?i.format(Xe,"yyyy-MM"):void 0,"data-selected":le.selected||void 0,"data-disabled":le.disabled||void 0,"data-hidden":le.hidden||void 0,"data-outside":Oe.outside||void 0,"data-focused":le.focused||void 0,"data-today":le.today||void 0},!le.hidden&&ml?D.createElement(r.DayButton,{className:s[G.DayButton],style:S==null?void 0:S[G.DayButton],type:"button",day:Oe,modifiers:le,disabled:le.disabled||void 0,tabIndex:A(Oe)?0:-1,"aria-label":q(Xe,le,i.options,i),onClick:jb(Oe,le),onBlur:Bb(Oe,le),onFocus:Lb(Oe,le),onKeyDown:$b(Oe,le),onMouseEnter:Rb(Oe,le),onMouseLeave:Vb(Oe,le)},P(Xe,i.options,i)):!le.hidden&&P(Oe.date,i.options,i))}))))))})),t.footer&&D.createElement(r.Footer,{className:s[G.Footer],style:S==null?void 0:S[G.Footer],role:"status","aria-live":"polite"},t.footer)))}function _c({className:e,classNames:t,showOutsideDays:r=!0,...n}){return w.jsx(Ig,{showOutsideDays:r,className:J("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:J(pn({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:J(pn({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{Chevron:({orientation:o})=>o==="left"?w.jsx(fu,{className:"h-4 w-4"}):w.jsx(hu,{className:"h-4 w-4"})},...n})}_c.displayName="Calendar";var en="Popover",[kc,sw]=Dt(en,[Lr]),mr=Lr(),[Wg,vt]=kc(en),Pc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=mr(t),c=E.useRef(null),[l,d]=E.useState(!1),[u,h]=tr({prop:n,defaultProp:o??!1,onChange:i,caller:en});return w.jsx(Aa,{...s,children:w.jsx(Wg,{scope:t,contentId:Pr(),triggerRef:c,open:u,onOpenChange:h,onOpenToggle:E.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:l,onCustomAnchorAdd:E.useCallback(()=>d(!0),[]),onCustomAnchorRemove:E.useCallback(()=>d(!1),[]),modal:a,children:r})})};Pc.displayName=en;var Mc="PopoverAnchor",jg=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=vt(Mc,r),i=mr(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return E.useEffect(()=>(a(),()=>s()),[a,s]),w.jsx(Hn,{...i,...n,ref:t})});jg.displayName=Mc;var Ac="PopoverTrigger",Nc=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=vt(Ac,r),i=mr(r),a=ue(t,o.triggerRef),s=w.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Wc(o.open),...n,ref:a,onClick:oe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:w.jsx(Hn,{asChild:!0,...i,children:s})});Nc.displayName=Ac;var mo="PopoverPortal",[Lg,Bg]=kc(mo,{forceMount:void 0}),Dc=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=vt(mo,t);return w.jsx(Lg,{scope:t,forceMount:r,children:w.jsx(Xr,{present:r||i.open,children:w.jsx(Un,{asChild:!0,container:o,children:n})})})};Dc.displayName=mo;var zt="PopoverContent",Tc=E.forwardRef((e,t)=>{const r=Bg(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=vt(zt,e.__scopePopover);return w.jsx(Xr,{present:n||i.open,children:i.modal?w.jsx(Rg,{...o,ref:t}):w.jsx(Vg,{...o,ref:t})})});Tc.displayName=zt;var $g=Nt("PopoverContent.RemoveScroll"),Rg=E.forwardRef((e,t)=>{const r=vt(zt,e.__scopePopover),n=E.useRef(null),o=ue(t,n),i=E.useRef(!1);return E.useEffect(()=>{const a=n.current;if(a)return Ia(a)},[]),w.jsx(Xn,{as:$g,allowPinchZoom:!0,children:w.jsx(Fc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0,l=s.button===2||c;i.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:oe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Vg=E.forwardRef((e,t)=>{const r=vt(zt,e.__scopePopover),n=E.useRef(!1),o=E.useRef(!1);return w.jsx(Fc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((l=r.triggerRef.current)==null?void 0:l.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Fc=E.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:d,...u}=e,h=vt(zt,r),p=mr(r);return Gi(),w.jsx(Pn,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:w.jsx(Sn,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:w.jsx(Na,{"data-state":Wc(h.open),role:"dialog",id:h.contentId,...p,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ic="PopoverClose",Hg=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=vt(Ic,r);return w.jsx(ie.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,()=>o.onOpenChange(!1))})});Hg.displayName=Ic;var Ug="PopoverArrow",Yg=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=mr(r);return w.jsx(Da,{...o,...n,ref:t})});Yg.displayName=Ug;function Wc(e){return e?"open":"closed"}var zg=Pc,qg=Nc,Kg=Dc,jc=Tc;const Gg=zg,Xg=qg,Lc=E.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>w.jsx(Kg,{children:w.jsx(jc,{ref:o,align:t,sideOffset:r,className:J("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Lc.displayName=jc.displayName;function Qg({id:e,value:t,placeholder:r,disabled:n,onChange:o,onBlur:i,onFocus:a,className:s,"aria-invalid":c}){const[l,d]=E.useState();E.useEffect(()=>{t&&d(new Date(t))},[t]);const u=h=>{d(h),h&&o&&o(so(h,"yyyy-MM-dd"))};return w.jsxs(Gg,{children:[w.jsx(Xg,{asChild:!0,children:w.jsxs(Ze,{id:e,variant:"outline",className:J("w-full justify-start text-left font-normal",!l&&"text-muted-foreground",s),disabled:n,onBlur:i,onFocus:a,"aria-invalid":c,children:[w.jsx(du,{className:"mr-2 h-4 w-4"}),l?so(l,"PPP"):w.jsx("span",{children:r})]})}),w.jsx(Lc,{className:"w-auto p-0",children:w.jsx(_c,{mode:"single",selected:l,onSelect:u,initialFocus:!0})})]})}function Bc(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),x=async y=>{const b=y.target.value===""?d.emptyValue:y.target.value;s(b),await p.onChange(b)},f=async y=>{const b=y.target.value;c&&c(t,b),await p.onBlur(b)},v=async y=>{const b=y.target.value;l&&l(t,b),await p.onFocus(b)},g=u.length>0;return w.jsx(be,{id:t,type:"text",value:r||"",placeholder:a,required:n,disabled:o,readOnly:i,onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function $c(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),x=async b=>{const O=b.target.value===""?d.emptyValue:b.target.value;s(O),await p.onChange(O)},f=async b=>{const O=b.target.value;c&&c(t,O),await p.onBlur(O)},v=async b=>{const O=b.target.value;l&&l(t,O),await p.onFocus(O)},g=u.length>0,y=d.rows||4;return w.jsx(Ui,{id:t,value:r||"",placeholder:a,required:n,disabled:o,readOnly:i,rows:y,onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J("resize-y",g&&"border-destructive focus-visible:ring-destructive/20")})}function Rc(e){const{id:t,value:r,required:n,disabled:o,onChange:i,onBlur:a,onFocus:s,options:c,rawErrors:l=[],schema:d}=e,u=ve(t,d),h=async g=>{const y=g===""?c.emptyValue:g;i(y),await u.onChange(y)},p=async()=>{a&&a(t,r),await u.onBlur(r)},x=async()=>{s&&s(t,r),await u.onFocus(r)},f=l.length>0,{enumOptions:v=[]}=c;return w.jsxs(kh,{value:r||"",onValueChange:h,disabled:o,required:n,children:[w.jsx(Ms,{id:t,"aria-invalid":f,className:J("w-full",f&&"border-destructive focus-visible:ring-destructive/20"),onBlur:p,onFocus:x,children:w.jsx(Ph,{placeholder:"Select an option..."})}),w.jsx(Ds,{children:v.map(g=>w.jsx(Ts,{value:g.value,children:g.label},g.value))})]})}function Vc(e){const{id:t,value:r,disabled:n,readonly:o,onChange:i,onBlur:a,onFocus:s,label:c,rawErrors:l=[],schema:d}=e,u=ve(t,d),h=async v=>{i(v),await u.onChange(v)},p=async()=>{a&&a(t,r),await u.onBlur(r)},x=async()=>{s&&s(t,r),await u.onFocus(r)},f=l.length>0;return w.jsxs("div",{className:"flex items-start space-x-2",children:[w.jsx(Rs,{id:t,checked:r||!1,disabled:n||o,onCheckedChange:h,onBlur:p,onFocus:x,"aria-invalid":f,className:J("mt-0.5",f&&"border-destructive focus-visible:ring-destructive/20")}),c&&w.jsx(ke,{htmlFor:t,className:J("text-sm leading-none",n&&"opacity-50",!o&&!n&&"cursor-pointer"),children:c})]})}function Hc(e){const{id:t,value:r,disabled:n,readonly:o,onChange:i,onBlur:a,onFocus:s,options:c,rawErrors:l=[],schema:d}=e,u=ve(t,d),h=async g=>{i(g),await u.onChange(g)},p=async()=>{a&&a(t,r),await u.onBlur(r)},x=async()=>{s&&s(t,r),await u.onFocus(r)},f=l.length>0,{enumOptions:v=[]}=c;return w.jsx("div",{className:"space-y-2",children:v.map((g,y)=>w.jsxs("div",{className:"flex items-center",children:[w.jsx("input",{id:`${t}_${y}`,type:"radio",name:t,value:g.value,checked:r===g.value,disabled:n,readOnly:o,onChange:()=>h(g.value),onBlur:p,onFocus:x,className:`
|
|
102
102
|
h-4 w-4 border-gray-300 text-blue-600 mr-3
|
|
103
103
|
focus:ring-blue-500 transition-colors duration-200
|
|
104
|
-
${
|
|
105
|
-
${
|
|
106
|
-
`}),m.jsx("label",{htmlFor:`${t}_${y}`,className:`text-sm text-gray-700 ${r?"opacity-50":""} ${o?"":"cursor-pointer"}`,children:p.label})]},p.value))})}function qi(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,schema:d,rawErrors:f=[]}=e,g=ie(t,d),x=async y=>{const w=y.target.value,S=w===""?u.emptyValue:parseFloat(w);a(S),await g.onChange(S)},h=async y=>{const w=y.target.value;c&&c(t,w),await g.onBlur(w)},b=async y=>{const w=y.target.value;l&&l(t,w),await g.onFocus(w)},p=f.length>0;return m.jsx(le,{id:t,type:"number",value:n??"",placeholder:i,required:r,disabled:o,readOnly:s,min:d.minimum,max:d.maximum,step:d.multipleOf||"any",onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F(p&&"border-destructive focus-visible:ring-destructive/20")})}function Ir(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,rawErrors:d=[],schema:f}=e,g=ie(t,f),x=async y=>{const w=y.target.value===""?u.emptyValue:y.target.value;a(w),await g.onChange(w)},h=async y=>{const w=y.target.value;c&&c(t,w),await g.onBlur(w)},b=async y=>{const w=y.target.value;l&&l(t,w),await g.onFocus(w)},p=d.length>0;return m.jsx(le,{id:t,type:"tel",value:n||"",placeholder:i||"Enter phone number",required:r,disabled:o,readOnly:s,onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F(p&&"border-destructive focus-visible:ring-destructive/20")})}function Br(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,rawErrors:d=[],schema:f}=e,g=ie(t,f),x=async y=>{const w=y.target.value===""?u.emptyValue:y.target.value;a(w),await g.onChange(w)},h=async y=>{const w=y.target.value;c&&c(t,w),await g.onBlur(w)},b=async y=>{const w=y.target.value;l&&l(t,w),await g.onFocus(w)},p=d.length>0;return m.jsx(le,{id:t,type:"email",value:n||"",placeholder:i||"Enter email address",required:r,disabled:o,readOnly:s,onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F(p&&"border-destructive focus-visible:ring-destructive/20")})}function Lr(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,rawErrors:d=[],schema:f}=e,g=ie(t,f),x=async y=>{const w=y.target.value===""?u.emptyValue:y.target.value;a(w),await g.onChange(w)},h=async y=>{const w=y.target.value;c&&c(t,w),await g.onBlur(w)},b=async y=>{const w=y.target.value;l&&l(t,w),await g.onFocus(w)},p=d.length>0;return m.jsx(le,{id:t,type:"url",value:n||"",placeholder:i||"Enter URL",required:r,disabled:o,readOnly:s,onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F(p&&"border-destructive focus-visible:ring-destructive/20")})}function $r(e){const{id:t,value:n,required:r,disabled:o,readonly:s,placeholder:i,onChange:a,onBlur:c,onFocus:l,options:u,rawErrors:d=[],schema:f}=e,g=ie(t,f),x=async y=>{const w=y.target.value===""?u.emptyValue:y.target.value;a(w),await g.onChange(w)},h=async y=>{const w=y.target.value;c&&c(t,w),await g.onBlur(w)},b=async y=>{const w=y.target.value;l&&l(t,w),await g.onFocus(w)},p=d.length>0;return m.jsx(le,{id:t,type:"password",value:n||"",placeholder:i||"Enter password",required:r,disabled:o,readOnly:s,onChange:x,onBlur:h,onFocus:b,"aria-invalid":p,className:F(p&&"border-destructive focus-visible:ring-destructive/20")})}function Gi(e){const{id:t,value:n,required:r,disabled:o,readonly:s,onChange:i,onBlur:a,onFocus:c,options:l,rawErrors:u=[],schema:d}=e,f=ie(t,d),g=async p=>{const y=p===""?l.emptyValue:p;i(y),await f.onChange(y)},x=async()=>{a&&a(t,n),await f.onBlur(n)},h=async()=>{c&&c(t,n),await f.onFocus(n)},b=u.length>0;return s?m.jsx(le,{id:t,type:"date",value:n||"",required:r,disabled:o,readOnly:s,"aria-invalid":b,className:F(b&&"border-destructive focus-visible:ring-destructive/20")}):m.jsx(Bp,{id:t,value:n||"",placeholder:"Select a date",disabled:o,onChange:g,onBlur:x,onFocus:h,"aria-invalid":b,className:F(b&&"border-destructive focus-visible:ring-destructive/20")})}function Vr(e){const{id:t,value:n,required:r,disabled:o,readonly:s,onChange:i,onBlur:a,onFocus:c,options:l,rawErrors:u=[],schema:d}=e,f=ie(t,d),g=async p=>{const y=p.target.value===""?l.emptyValue:p.target.value;i(y),await f.onChange(y)},x=async p=>{const y=p.target.value;a&&a(t,y),await f.onBlur(y)},h=async p=>{const y=p.target.value;c&&c(t,y),await f.onFocus(y)},b=u.length>0;return m.jsx(le,{id:t,type:"datetime-local",value:n||"",required:r,disabled:o,readOnly:s,onChange:g,onBlur:x,onFocus:h,"aria-invalid":b,className:F(b&&"border-destructive focus-visible:ring-destructive/20")})}function Ki(e){const{id:t,required:n,disabled:r,readonly:o,onChange:s,onBlur:i,onFocus:a,options:c,rawErrors:l=[],schema:u}=e,d=ie(t,u),f=async p=>{const y=p.target.files;if(y&&y.length>0){const w=y[0],S=new FileReader;S.onload=async()=>{const C=S.result;s(C),await d.onChange(C)},S.readAsDataURL(w)}},g=async p=>{const y=p.target.value;i&&i(t,y),await d.onBlur(y)},x=async p=>{const y=p.target.value;a&&a(t,y),await d.onFocus(y)},h=l.length>0,b=typeof c.accept=="string"?c.accept:"*/*";return m.jsx(le,{id:t,type:"file",required:n,disabled:r,readOnly:o,accept:b,onChange:f,onBlur:g,onFocus:x,"aria-invalid":h,className:F("file:mr-4 file:py-1 file:px-2 file:rounded file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",h&&"border-destructive focus-visible:ring-destructive/20")})}const Xi={TextWidget:Yi,TextareaWidget:zi,SelectWidget:ji,CheckboxWidget:Ri,RadioWidget:Ui,UpDownWidget:qi,FileWidget:Ki,tel:Ir,email:Br,url:Lr,password:$r,date:Gi,"datetime-local":Vr,TelWidget:Ir,EmailWidget:Br,URLWidget:Lr,PasswordWidget:$r,DateWidget:Gi,DateTimeWidget:Vr},Qi={color:ko,file:Mo,range:Ro,rating:Uo,...Xi},Lp={small:"space-y-2",medium:"space-y-4",large:"space-y-6"},$p=({children:e,spacing:t="medium",className:n=""})=>m.jsx("div",{className:F("flex flex-col",Lp[t],n),children:e}),Vp={small:"space-x-2",medium:"space-x-4",large:"space-x-6"},Hp={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},Yp=({children:e,spacing:t="medium",align:n="center",className:r=""})=>m.jsx("div",{className:F("flex flex-row",Vp[t],Hp[n],r),children:e}),zp={small:"gap-2",medium:"gap-4",large:"gap-6"},jp=({children:e,columns:t="auto-fit",gap:n="medium",minItemWidth:r="250px",className:o=""})=>{const s={display:"grid"};return typeof t=="number"?s.gridTemplateColumns=`repeat(${t}, 1fr)`:s.gridTemplateColumns=`repeat(${t}, minmax(${r}, 1fr))`,m.jsx("div",{className:F("grid",zp[n],o),style:s,children:e})};class Rp{constructor(t){ot(this,"handlers");this.handlers=t}async handleBeforeSubmit(t){return this.handlers.beforeSubmit?await this.handlers.beforeSubmit(t):t}async handleAfterSubmit(t){this.handlers.afterSubmit&&await this.handlers.afterSubmit(t)}async handleBeforeValidation(t){return this.handlers.beforeValidation?await this.handlers.beforeValidation(t):t}async handleAfterValidation(t,n){this.handlers.afterValidation&&await this.handlers.afterValidation(t,n)}}class Zi{constructor(t,n={},r=[]){ot(this,"formHandlers");ot(this,"fieldHandlers");ot(this,"webhooks");ot(this,"debounceTimers",new Map);ot(this,"webhookQueue",[]);ot(this,"isProcessingQueue",!1);this.formHandlers=t,this.fieldHandlers=n,this.webhooks=r}async handleBeforeSubmit(t){return this.formHandlers.beforeSubmit?await this.formHandlers.beforeSubmit(t):t}async handleAfterSubmit(t){this.formHandlers.afterSubmit&&await this.formHandlers.afterSubmit(t)}async handleBeforeValidation(t){return this.formHandlers.beforeValidation?await this.formHandlers.beforeValidation(t):t}async handleAfterValidation(t,n){this.formHandlers.afterValidation&&await this.formHandlers.afterValidation(t,n)}async handleFieldEvent(t,n,r,o,s,i){const a={eventType:t,fieldId:n,fieldValue:r,schema:o,formData:s,timestamp:Date.now(),fieldPath:i};try{switch(t){case"focus":this.fieldHandlers.onFieldFocus&&await this.fieldHandlers.onFieldFocus(a);break;case"blur":this.fieldHandlers.onFieldBlur&&await this.fieldHandlers.onFieldBlur(a);break;case"change":this.fieldHandlers.onFieldChange&&await this.fieldHandlers.onFieldChange(a);break}}catch(c){console.error(`Error in field event handler (${t}):`,c)}this.processWebhooks(a)}processWebhooks(t){const n=this.webhooks.filter(r=>!r.events||r.events.includes(t.eventType));for(const r of n)r.debounceMs&&r.debounceMs>0?this.debounceWebhook(r,t):this.queueWebhook(r,t)}debounceWebhook(t,n){const r=`${t.url}-${n.fieldId}-${n.eventType}`;this.debounceTimers.has(r)&&clearTimeout(this.debounceTimers.get(r));const o=setTimeout(()=>{this.queueWebhook(t,n),this.debounceTimers.delete(r)},t.debounceMs);this.debounceTimers.set(r,o)}queueWebhook(t,n){this.webhookQueue.push({config:t,event:n,retryCount:0}),this.isProcessingQueue||this.processWebhookQueue()}async processWebhookQueue(){if(!(this.isProcessingQueue||this.webhookQueue.length===0)){for(this.isProcessingQueue=!0;this.webhookQueue.length>0;){const t=this.webhookQueue.shift();try{await this.callWebhook(t.config,t.event)}catch(n){const r=t.config.retries||3;t.retryCount<r?(t.retryCount++,setTimeout(()=>{this.webhookQueue.push(t)},Math.pow(2,t.retryCount)*1e3)):console.error(`Webhook failed after ${r} retries:`,n)}}this.isProcessingQueue=!1}}async callWebhook(t,n){const r={event:n,timestamp:Date.now(),source:"extended-dynamic-forms"},o={method:t.method||"POST",headers:{"Content-Type":"application/json",...t.headers},body:JSON.stringify(r)};t.timeout&&(o.signal=AbortSignal.timeout(t.timeout));const s=await fetch(t.url,o);if(!s.ok)throw new Error(`Webhook request failed: ${s.status} ${s.statusText}`)}createFieldEventHandlers(t,n,r,o){return{onFocus:s=>this.handleFieldEvent("focus",t,s,n,r,o),onBlur:s=>this.handleFieldEvent("blur",t,s,n,r,o),onChange:s=>this.handleFieldEvent("change",t,s,n,r,o)}}cleanup(){for(const t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear()}}const Ji={cloneFormData:e=>JSON.parse(JSON.stringify(e)),mergeFormData:(e,t)=>({...e,...t}),getNestedValue:(e,t)=>{const n=t.split(".");let r=e;for(const o of n)if(r&&typeof r=="object"&&o in r)r=r[o];else return;return r},setNestedValue:(e,t,n)=>{const r=t.split("."),o={...e};let s=o;for(let i=0;i<r.length-1;i++){const a=r[i];(!(a in s)||typeof s[a]!="object")&&(s[a]={}),s=s[a]}return s[r[r.length-1]]=n,o},removeEmptyValues:e=>{if(Array.isArray(e))return e.filter(t=>t!=null&&t!=="");if(e!==null&&typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))r!=null&&r!==""&&(t[n]=Ji.removeEmptyValues(r));return t}return e}},ec={getRequiredFields:e=>e.required||[],isFieldRequired:(e,t)=>(e.required||[]).includes(t),getFieldSchema:(e,t)=>{const n=t.split(".");let r=e;for(const o of n)if(r.type==="object"&&r.properties)r=r.properties[o];else if(r.type==="array"&&r.items)r=r.items;else return;return r},mergeSchemas:(e,t)=>({...e,...t,properties:{...e.properties,...t.properties},required:[...new Set([...e.required||[],...t.required||[]])]}),getAllFieldPaths:(e,t="")=>{const n=[];if(e.type==="object"&&e.properties)for(const[r,o]of Object.entries(e.properties)){const s=t?`${t}.${r}`:r;n.push(s),n.push(...ec.getAllFieldPaths(o,s))}return n}},Up={isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),isValidPhone:e=>/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test(e),isValidUrl:e=>{try{return new URL(e),!0}catch{return!1}},isValidDate:e=>{const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())},isInRange:(e,t,n)=>!(t!==void 0&&e<t||n!==void 0&&e>n),getValidationMessage:(e,t)=>({required:"This field is required",email:"Please enter a valid email address",phone:"Please enter a valid phone number",url:"Please enter a valid URL",date:"Please enter a valid date",min:`Value must be at least ${t==null?void 0:t.min}`,max:`Value must be at most ${t==null?void 0:t.max}`,minLength:`Must be at least ${t==null?void 0:t.minLength} characters`,maxLength:`Must be at most ${t==null?void 0:t.maxLength} characters`})[e]||"Invalid value"},qp=({schema:e,uiSchema:t,formData:n,onSubmit:r,onChange:o,onError:s,onBlur:i,onFocus:a,beforeSubmit:c,afterSubmit:l,beforeValidation:u,afterValidation:d,onFieldFocus:f,onFieldBlur:g,onFieldChange:x,webhooks:h=[],widgets:b={},fields:p={},templates:y={},...w})=>{const S=E.useRef(null),C=E.useMemo(()=>{const P=new Zi({beforeSubmit:c,afterSubmit:l,beforeValidation:u,afterValidation:d},{onFieldFocus:f,onFieldBlur:g,onFieldChange:x},h);return S.current=P,P},[c,l,u,d,f,g,x,h]);E.useEffect(()=>()=>{S.current&&S.current.cleanup()},[]);const M=async(P,N)=>{const I=await C.handleBeforeSubmit(P);r&&await r(I,N),await C.handleAfterSubmit(I)},k=P=>{o&&o(P)},O={...Qi,...b},_={...Co,...p},W={...So,...y};return m.jsx(mo,{eventHub:C,formData:n,children:m.jsx(sc,{schema:e,uiSchema:t,formData:n,validator:qr,onSubmit:M,onChange:k,onError:s,onBlur:i,onFocus:a,widgets:O,fields:_,templates:W,...w})})};T.validator=qr,Object.defineProperty(T,"generateTheme",{enumerable:!0,get:()=>oc.generateTheme}),T.AddressField=fo,T.ArrayFieldItemTemplate=xo,T.ArrayFieldTemplate=wo,T.ColorWidget=ko,T.CurrencyField=vo,T.DateTimeWidget=Vr,T.DateWidget=rl,T.EmailWidget=Br,T.EnhancedCheckboxWidget=Ri,T.EnhancedNumberWidget=qi,T.EnhancedRadioWidget=Ui,T.EnhancedSelectWidget=ji,T.EnhancedTextWidget=Yi,T.EnhancedTextareaWidget=zi,T.ExtendedForm=qp,T.FileUploadWidget=Ki,T.FileWidget=Mo,T.FormEventHub=Zi,T.FormEventManager=Rp,T.FormEventProvider=mo,T.GridLayout=jp,T.HorizontalLayout=Yp,T.PasswordWidget=$r,T.PhoneField=go,T.RangeWidget=Ro,T.RatingWidget=Uo,T.TelephoneWidget=Ir,T.URLWidget=Lr,T.VerticalLayout=$p,T.cn=F,T.customFields=Co,T.customTemplates=So,T.customWidgets=Qi,T.enhancedWidgets=Xi,T.formDataUtils=Ji,T.schemaUtils=ec,T.useFieldEventHandlers=ie,T.useFormEventHub=po,T.validationUtils=Up,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
104
|
+
${f?"border-red-300 focus:ring-red-500":""}
|
|
105
|
+
${n?"cursor-not-allowed opacity-50":"cursor-pointer"}
|
|
106
|
+
`}),w.jsx("label",{htmlFor:`${t}_${y}`,className:`text-sm text-gray-700 ${n?"opacity-50":""} ${o?"":"cursor-pointer"}`,children:g.label})]},g.value))})}function Uc(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,schema:u,rawErrors:h=[]}=e,p=ve(t,u),x=async y=>{const b=y.target.value,O=b===""?d.emptyValue:parseFloat(b);s(O),await p.onChange(O)},f=async y=>{const b=y.target.value;c&&c(t,b),await p.onBlur(b)},v=async y=>{const b=y.target.value;l&&l(t,b),await p.onFocus(b)},g=h.length>0;return w.jsx(be,{id:t,type:"number",value:r??"",placeholder:a,required:n,disabled:o,readOnly:i,min:u.minimum,max:u.maximum,step:u.multipleOf||"any",onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function go(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),x=async y=>{const b=y.target.value===""?d.emptyValue:y.target.value;s(b),await p.onChange(b)},f=async y=>{const b=y.target.value;c&&c(t,b),await p.onBlur(b)},v=async y=>{const b=y.target.value;l&&l(t,b),await p.onFocus(b)},g=u.length>0;return w.jsx(be,{id:t,type:"tel",value:r||"",placeholder:a||"Enter phone number",required:n,disabled:o,readOnly:i,onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function vo(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),x=async y=>{const b=y.target.value===""?d.emptyValue:y.target.value;s(b),await p.onChange(b)},f=async y=>{const b=y.target.value;c&&c(t,b),await p.onBlur(b)},v=async y=>{const b=y.target.value;l&&l(t,b),await p.onFocus(b)},g=u.length>0;return w.jsx(be,{id:t,type:"email",value:r||"",placeholder:a||"Enter email address",required:n,disabled:o,readOnly:i,onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function yo(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),x=async y=>{const b=y.target.value===""?d.emptyValue:y.target.value;s(b),await p.onChange(b)},f=async y=>{const b=y.target.value;c&&c(t,b),await p.onBlur(b)},v=async y=>{const b=y.target.value;l&&l(t,b),await p.onFocus(b)},g=u.length>0;return w.jsx(be,{id:t,type:"url",value:r||"",placeholder:a||"Enter URL",required:n,disabled:o,readOnly:i,onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function bo(e){const{id:t,value:r,required:n,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),x=async y=>{const b=y.target.value===""?d.emptyValue:y.target.value;s(b),await p.onChange(b)},f=async y=>{const b=y.target.value;c&&c(t,b),await p.onBlur(b)},v=async y=>{const b=y.target.value;l&&l(t,b),await p.onFocus(b)},g=u.length>0;return w.jsx(be,{id:t,type:"password",value:r||"",placeholder:a||"Enter password",required:n,disabled:o,readOnly:i,onChange:x,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function Yc(e){const{id:t,value:r,required:n,disabled:o,readonly:i,onChange:a,onBlur:s,onFocus:c,options:l,rawErrors:d=[],schema:u}=e,h=ve(t,u),p=async g=>{const y=g===""?l.emptyValue:g;a(y),await h.onChange(y)},x=async()=>{s&&s(t,r),await h.onBlur(r)},f=async()=>{c&&c(t,r),await h.onFocus(r)},v=d.length>0;return i?w.jsx(be,{id:t,type:"date",value:r||"",required:n,disabled:o,readOnly:i,"aria-invalid":v,className:J(v&&"border-destructive focus-visible:ring-destructive/20")}):w.jsx(Qg,{id:t,value:r||"",placeholder:"Select a date",disabled:o,onChange:p,onBlur:x,onFocus:f,"aria-invalid":v,className:J(v&&"border-destructive focus-visible:ring-destructive/20")})}function wo(e){const{id:t,value:r,required:n,disabled:o,readonly:i,onChange:a,onBlur:s,onFocus:c,options:l,rawErrors:d=[],schema:u}=e,h=ve(t,u),p=async g=>{const y=g.target.value===""?l.emptyValue:g.target.value;a(y),await h.onChange(y)},x=async g=>{const y=g.target.value;s&&s(t,y),await h.onBlur(y)},f=async g=>{const y=g.target.value;c&&c(t,y),await h.onFocus(y)},v=d.length>0;return w.jsx(be,{id:t,type:"datetime-local",value:r||"",required:n,disabled:o,readOnly:i,onChange:p,onBlur:x,onFocus:f,"aria-invalid":v,className:J(v&&"border-destructive focus-visible:ring-destructive/20")})}function zc(e){const{id:t,required:r,disabled:n,readonly:o,onChange:i,onBlur:a,onFocus:s,options:c,rawErrors:l=[],schema:d}=e,u=ve(t,d),h=async g=>{const y=g.target.files;if(y&&y.length>0){const b=y[0],O=new FileReader;O.onload=async()=>{const S=O.result;i(S),await u.onChange(S)},O.readAsDataURL(b)}},p=async g=>{const y=g.target.value;a&&a(t,y),await u.onBlur(y)},x=async g=>{const y=g.target.value;s&&s(t,y),await u.onFocus(y)},f=l.length>0,v=typeof c.accept=="string"?c.accept:"*/*";return w.jsx(be,{id:t,type:"file",required:r,disabled:n,readOnly:o,accept:v,onChange:h,onBlur:p,onFocus:x,"aria-invalid":f,className:J("file:mr-4 file:py-1 file:px-2 file:rounded file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",f&&"border-destructive focus-visible:ring-destructive/20")})}const qc={TextWidget:Bc,TextareaWidget:$c,SelectWidget:Rc,CheckboxWidget:Vc,RadioWidget:Hc,UpDownWidget:Uc,FileWidget:zc,tel:go,email:vo,url:yo,password:bo,date:Yc,"datetime-local":wo,TelWidget:go,EmailWidget:vo,URLWidget:yo,PasswordWidget:bo,DateWidget:Yc,DateTimeWidget:wo},Kc={color:xi,file:Ci,range:Vi,rating:Hi,...qc},Zg={small:"space-y-2",medium:"space-y-4",large:"space-y-6"},Jg=({children:e,spacing:t="medium",className:r=""})=>w.jsx("div",{className:J("flex flex-col",Zg[t],r),children:e}),ev={small:"space-x-2",medium:"space-x-4",large:"space-x-6"},tv={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},rv=({children:e,spacing:t="medium",align:r="center",className:n=""})=>w.jsx("div",{className:J("flex flex-row",ev[t],tv[r],n),children:e}),nv={small:"gap-2",medium:"gap-4",large:"gap-6"},ov=({children:e,columns:t="auto-fit",gap:r="medium",minItemWidth:n="250px",className:o=""})=>{const i={display:"grid"};return typeof t=="number"?i.gridTemplateColumns=`repeat(${t}, 1fr)`:i.gridTemplateColumns=`repeat(${t}, minmax(${n}, 1fr))`,w.jsx("div",{className:J("grid",nv[r],o),style:i,children:e})};class iv{constructor(t){wt(this,"handlers");this.handlers=t}async handleBeforeSubmit(t){return this.handlers.beforeSubmit?await this.handlers.beforeSubmit(t):t}async handleAfterSubmit(t){this.handlers.afterSubmit&&await this.handlers.afterSubmit(t)}async handleBeforeValidation(t){return this.handlers.beforeValidation?await this.handlers.beforeValidation(t):t}async handleAfterValidation(t,r){this.handlers.afterValidation&&await this.handlers.afterValidation(t,r)}}class Gc{constructor(t,r={},n=[]){wt(this,"formHandlers");wt(this,"fieldHandlers");wt(this,"webhooks");wt(this,"debounceTimers",new Map);wt(this,"webhookQueue",[]);wt(this,"isProcessingQueue",!1);this.formHandlers=t,this.fieldHandlers=r,this.webhooks=n}async handleBeforeSubmit(t){return this.formHandlers.beforeSubmit?await this.formHandlers.beforeSubmit(t):t}async handleAfterSubmit(t){this.formHandlers.afterSubmit&&await this.formHandlers.afterSubmit(t)}async handleBeforeValidation(t){return this.formHandlers.beforeValidation?await this.formHandlers.beforeValidation(t):t}async handleAfterValidation(t,r){this.formHandlers.afterValidation&&await this.formHandlers.afterValidation(t,r)}async handleFieldEvent(t,r,n,o,i,a){const s={eventType:t,fieldId:r,fieldValue:n,schema:o,formData:i,timestamp:Date.now(),fieldPath:a};try{switch(t){case"focus":this.fieldHandlers.onFieldFocus&&await this.fieldHandlers.onFieldFocus(s);break;case"blur":this.fieldHandlers.onFieldBlur&&await this.fieldHandlers.onFieldBlur(s);break;case"change":this.fieldHandlers.onFieldChange&&await this.fieldHandlers.onFieldChange(s);break}}catch(c){console.error(`Error in field event handler (${t}):`,c)}this.processWebhooks(s)}processWebhooks(t){const r=this.webhooks.filter(n=>!n.events||n.events.includes(t.eventType));for(const n of r)n.debounceMs&&n.debounceMs>0?this.debounceWebhook(n,t):this.queueWebhook(n,t)}debounceWebhook(t,r){const n=`${t.url}-${r.fieldId}-${r.eventType}`;this.debounceTimers.has(n)&&clearTimeout(this.debounceTimers.get(n));const o=setTimeout(()=>{this.queueWebhook(t,r),this.debounceTimers.delete(n)},t.debounceMs);this.debounceTimers.set(n,o)}queueWebhook(t,r){this.webhookQueue.push({config:t,event:r,retryCount:0}),this.isProcessingQueue||this.processWebhookQueue()}async processWebhookQueue(){if(!(this.isProcessingQueue||this.webhookQueue.length===0)){for(this.isProcessingQueue=!0;this.webhookQueue.length>0;){const t=this.webhookQueue.shift();try{await this.callWebhook(t.config,t.event)}catch(r){const n=t.config.retries||3;t.retryCount<n?(t.retryCount++,setTimeout(()=>{this.webhookQueue.push(t)},Math.pow(2,t.retryCount)*1e3)):console.error(`Webhook failed after ${n} retries:`,r)}}this.isProcessingQueue=!1}}async callWebhook(t,r){const n={event:r,timestamp:Date.now(),source:"extended-dynamic-forms"},o={method:t.method||"POST",headers:{"Content-Type":"application/json",...t.headers},body:JSON.stringify(n)};t.timeout&&(o.signal=AbortSignal.timeout(t.timeout));const i=await fetch(t.url,o);if(!i.ok)throw new Error(`Webhook request failed: ${i.status} ${i.statusText}`)}createFieldEventHandlers(t,r,n,o){return{onFocus:i=>this.handleFieldEvent("focus",t,i,r,n,o),onBlur:i=>this.handleFieldEvent("blur",t,i,r,n,o),onChange:i=>this.handleFieldEvent("change",t,i,r,n,o)}}cleanup(){for(const t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear()}}const Xc={cloneFormData:e=>JSON.parse(JSON.stringify(e)),mergeFormData:(e,t)=>({...e,...t}),getNestedValue:(e,t)=>{const r=t.split(".");let n=e;for(const o of r)if(n&&typeof n=="object"&&o in n)n=n[o];else return;return n},setNestedValue:(e,t,r)=>{const n=t.split("."),o={...e};let i=o;for(let a=0;a<n.length-1;a++){const s=n[a];(!(s in i)||typeof i[s]!="object")&&(i[s]={}),i=i[s]}return i[n[n.length-1]]=r,o},removeEmptyValues:e=>{if(Array.isArray(e))return e.filter(t=>t!=null&&t!=="");if(e!==null&&typeof e=="object"){const t={};for(const[r,n]of Object.entries(e))n!=null&&n!==""&&(t[r]=Xc.removeEmptyValues(n));return t}return e}},Qc={getRequiredFields:e=>e.required||[],isFieldRequired:(e,t)=>(e.required||[]).includes(t),getFieldSchema:(e,t)=>{const r=t.split(".");let n=e;for(const o of r)if(n.type==="object"&&n.properties)n=n.properties[o];else if(n.type==="array"&&n.items)n=n.items;else return;return n},mergeSchemas:(e,t)=>({...e,...t,properties:{...e.properties,...t.properties},required:[...new Set([...e.required||[],...t.required||[]])]}),getAllFieldPaths:(e,t="")=>{const r=[];if(e.type==="object"&&e.properties)for(const[n,o]of Object.entries(e.properties)){const i=t?`${t}.${n}`:n;r.push(i),r.push(...Qc.getAllFieldPaths(o,i))}return r}},av={isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),isValidPhone:e=>/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test(e),isValidUrl:e=>{try{return new URL(e),!0}catch{return!1}},isValidDate:e=>{const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())},isInRange:(e,t,r)=>!(t!==void 0&&e<t||r!==void 0&&e>r),getValidationMessage:(e,t)=>({required:"This field is required",email:"Please enter a valid email address",phone:"Please enter a valid phone number",url:"Please enter a valid URL",date:"Please enter a valid date",min:`Value must be at least ${t==null?void 0:t.min}`,max:`Value must be at most ${t==null?void 0:t.max}`,minLength:`Must be at least ${t==null?void 0:t.minLength} characters`,maxLength:`Must be at most ${t==null?void 0:t.maxLength} characters`})[e]||"Invalid value"},Zc=({schema:e,uiSchema:t,formData:r,onSubmit:n,onChange:o,onError:i,onBlur:a,onFocus:s,beforeSubmit:c,afterSubmit:l,beforeValidation:d,afterValidation:u,onFieldFocus:h,onFieldBlur:p,onFieldChange:x,webhooks:f=[],widgets:v={},fields:g={},templates:y={},...b})=>{const O=D.useRef(null),S=D.useMemo(()=>{const U=new Gc({beforeSubmit:c,afterSubmit:l,beforeValidation:d,afterValidation:u},{onFieldFocus:h,onFieldBlur:p,onFieldChange:x},f);return O.current=U,U},[c,l,d,u,h,p,x,f]);D.useEffect(()=>()=>{O.current&&O.current.cleanup()},[]);const T=async(U,R)=>{const K=await S.handleBeforeSubmit(U);n&&await n(K,R),await S.handleAfterSubmit(K)},P=U=>{o&&o(U)},L={...Kc,...v},$={...bi,...g},B={...wi,...y};return w.jsx(di,{eventHub:S,formData:r,children:w.jsx(bl,{schema:e,uiSchema:t,formData:r,validator:Yo,onSubmit:T,onChange:P,onError:i,onBlur:a,onFocus:s,widgets:L,fields:$,templates:B,...b})})};function sv(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var _e={},it={},gr={},xo={};Object.defineProperty(xo,"__esModule",{value:!0});function cv(e){for(var t=e.length,r=5381,n=52711,o;t--;)o=e.charCodeAt(t),r=r*33^o,n=n*33^o;return(r>>>0)*4096+(n>>>0)}var vr="|",lv=/\[object ([HTML|SVG](.*)Element)\]/,uv={"[object Arguments]":0,"[object Array]":1,"[object ArrayBuffer]":2,"[object AsyncFunction]":3,"[object AsyncGeneratorFunction]":4,"[object BigInt]":5,"[object BigInt64Array]":6,"[object BigUint64Array]":7,"[object Boolean]":8,"[object DataView]":9,"[object Date]":10,"[object DocumentFragment]":11,"[object Error]":12,"[object Event]":13,"[object Float32Array]":14,"[object Float64Array]":15,"[object Function]":16,"[object Generator]":17,"[object GeneratorFunction]":18,"[object Int8Array]":19,"[object Int16Array]":20,"[object Map]":21,"[object Number]":22,"[object Object]":23,"[object Promise]":24,"[object RegExp]":25,"[object Set]":26,"[object SharedArrayBuffer]":27,"[object String]":28,"[object Uint8Array]":29,"[object Uint8ClampedArray]":30,"[object Uint16Array]":31,"[object Uint32Array]":32,"[object WeakMap]":33,"[object WeakRef]":34,"[object WeakSet]":35,CUSTOM:36,ELEMENT:37},dv={"[object Arguments]":1,"[object Array]":2},Jc={"[object Generator]":1,"[object Promise]":2,"[object WeakMap]":3,"[object WeakRef]":4,"[object WeakSet]":5},fv={"[object AsyncFunction]":1,"[object AsyncGeneratorFunction]":2,"[object Boolean]":3,"[object Function]":4,"[object GeneratorFunction]":5,"[object Number]":6,"[object String]":7},hv={"[object BigInt64Array]":1,"[object BigUint64Array]":2,"[object Float32Array]":3,"[object Float64Array]":4,"[object Int8Array]":5,"[object Int16Array]":6,"[object Uint8Array]":7,"[object Uint8ClampedArray]":8,"[object Uint16Array]":9,"[object Uint32Array]":10},pv={"[object Arguments]":1,"[object Array]":2,"[object ArrayBuffer]":3,"[object BigInt64Array]":4,"[object BigUint64Array]":5,"[object DataView]":6,"[object Float32Array]":7,"[object Float64Array]":8,"[object Int8Array]":9,"[object Int16Array]":10,"[object Map]":11,"[object Object]":12,"[object Set]":13,"[object SharedArrayBuffer]":14,"[object Uint8Array]":15,"[object Uint8ClampedArray]":16,"[object Uint16Array]":17,"[object Uint32Array]":18,CUSTOM:19},yr={bigint:"i",boolean:"b",empty:"e",function:"g",number:"n",object:"o",string:"s",symbol:"s"};function mv(e,t){return e[0]>t[0]}function el(e,t){return e>t}function Eo(e,t){for(var r,n,o=0;o<e.length;++o){for(n=e[o],r=o-1;~r&&t(e[r],n);--r)e[r+1]=e[r];e[r+1]=n}return e}function xe(e,t){return yr.object+vr+uv[e]+vr+t}var tl=new WeakMap,gv=0;function Co(e,t){var r=tl.get(e);if(r)return r;var n=xe(t,"NOT_ENUMERABLE"+vr+gv++);return tl.set(e,n),n}var vv=Object.prototype.toString;function yv(e,t,r){if(pv[t])return rl(t,e,r);if(t==="[object Date]")return xe(t,e.getTime());if(t==="[object RegExp]")return xe(t,e.toString());if(t==="[object Event]")return xe(t,[e.bubbles,e.cancelBubble,e.cancelable,e.composed,e.currentTarget,e.defaultPrevented,e.eventPhase,e.isTrusted,e.returnValue,e.target,e.type].join());if(t==="[object Error]")return xe(t,e.message+vr+e.stack);if(t==="[object DocumentFragment]")return xe(t,Cv(e));var n=t.match(lv);return n?xe("ELEMENT",n[1]+vr+e.outerHTML):Jc[t]?Co(e,t):fv[t]?xe(t,e.toString()):rl("CUSTOM",e,r)}function rl(e,t,r){var n=r.cache.get(t);return n?xe(e,"RECURSIVE~"+n):(r.cache.set(t,++r.id),e==="[object Object]"?t[Symbol.iterator]?Co(t,e):xe(e,ol(t,r)):dv[e]?xe(e,bv(t,r)):e==="[object Map]"?xe(e,Sv(t,r)):e==="[object Set]"?xe(e,Ov(t,r)):hv[e]?xe(e,t.join()):e==="[object ArrayBuffer]"?xe(e,nl(t)):e==="[object DataView]"?xe(e,nl(t.buffer)):Jc[e]?Co(t,e):xe("CUSTOM",ol(t,r)))}function bv(e,t){for(var r=e.length,n=new Array(r);--r>=0;)n[r]=qt(e[r],t);return n.join()}function wv(e){return Buffer.from(e).toString("utf8")}function xv(e){return String.fromCharCode.apply(null,new Uint16Array(e))}function Ev(){return"UNSUPPORTED"}function Cv(e){for(var t=e.children,r=t.length,n=new Array(r);--r>=0;)n[r]=t[r].outerHTML;return n.join()}var nl=typeof Buffer<"u"&&typeof Buffer.from=="function"?wv:typeof Uint16Array=="function"?xv:Ev;function Sv(e,t){var r=new Array(e.size),n=0;for(e.forEach(function(o,i){r[n++]=[qt(i,t),qt(o,t)]}),Eo(r,mv);--n>=0;)r[n]="["+r[n][0]+","+r[n][1]+"]";return"["+r.join()+"]"}function ol(e,t){for(var r=Eo(Object.getOwnPropertyNames(e),el),n=r.length,o=new Array(n),i=n;--i>=0;)o[i]=r[i]+":"+qt(e[r[i]],t);return"{"+o.join()+"}"}function Ov(e,t){var r=new Array(e.size),n=0;return e.forEach(function(o){r[n++]=qt(o,t)}),"["+Eo(r,el).join()+"]"}function qt(e,t){var r=typeof e;return e==null||r==="undefined"?yr.empty+e:r==="object"?yv(e,vv.call(e),t||{cache:new WeakMap,id:1}):r==="function"||r==="symbol"?yr[r]+e.toString():r==="boolean"?yr.boolean+ +e:yr[r]+e}function _v(e){return cv(qt(e,void 0))}xo.default=_v,Object.defineProperty(gr,"__esModule",{value:!0});var kv=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Pv=xo,Mv=Av(Pv);function Av(e){return e&&e.__esModule?e:{default:e}}function Nv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var So=function(){function e(t,r,n){Nv(this,e),this.id=t;var o={cache:!0};if(typeof n>"u"&&(n=o),typeof r!="function"?(this.value=r,this.type=this.constructor.CONSTANT):(this.calculationMethod=r,this.type=this.constructor.DYNAMIC),!this.id)throw new Error("factId required");return this.priority=parseInt(n.priority||1,10),this.options=Object.assign({},o,n),this.cacheKeyMethod=this.defaultCacheKeys,this}return kv(e,[{key:"isConstant",value:function(){return this.type===this.constructor.CONSTANT}},{key:"isDynamic",value:function(){return this.type===this.constructor.DYNAMIC}},{key:"calculate",value:function(r,n){return Object.prototype.hasOwnProperty.call(this,"value")?this.value:this.calculationMethod(r,n)}},{key:"defaultCacheKeys",value:function(r,n){return{params:n,id:r}}},{key:"getCacheKey",value:function(r){if(this.options.cache===!0){var n=this.cacheKeyMethod(this.id,r),o=e.hashFromObject(n);return o}}}],[{key:"hashFromObject",value:function(r){return(0,Mv.default)(r)}}]),e}();So.CONSTANT="CONSTANT",So.DYNAMIC="DYNAMIC",gr.default=So;var tn={},rn={},_t={};Object.defineProperty(_t,"__esModule",{value:!0});function Dv(){try{if(typeof process<"u"&&process.env&&process.env.DEBUG&&process.env.DEBUG.match(/json-rules-engine/)||typeof window<"u"&&window.localStorage&&window.localStorage.debug&&window.localStorage.debug.match(/json-rules-engine/))return console.debug.bind(console)}catch{}return function(){}}_t.default=Dv(),Object.defineProperty(rn,"__esModule",{value:!0});var Tv=function(){function e(t,r){var n=[],o=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),c;!(o=(c=s.next()).done)&&(n.push(c.value),!(r&&n.length===r));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&s.return&&s.return()}finally{if(i)throw a}}return n}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Fv=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Iv=_t,Wv=jv(Iv);function jv(e){return e&&e.__esModule?e:{default:e}}function Lv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Bv=function(){function e(t){if(Lv(this,e),!t)throw new Error("Condition: constructor options required");var r=e.booleanOperator(t);if(Object.assign(this,t),r){var n=t[r],o=Array.isArray(n);if(r!=="not"&&!o)throw new Error('"'+r+'" must be an array');if(r==="not"&&o)throw new Error('"'+r+'" cannot be an array');this.operator=r,this.priority=parseInt(t.priority,10)||1,o?this[r]=n.map(function(i){return new e(i)}):this[r]=new e(n)}else if(!Object.prototype.hasOwnProperty.call(t,"condition")){if(!Object.prototype.hasOwnProperty.call(t,"fact"))throw new Error('Condition: constructor "fact" property required');if(!Object.prototype.hasOwnProperty.call(t,"operator"))throw new Error('Condition: constructor "operator" property required');if(!Object.prototype.hasOwnProperty.call(t,"value"))throw new Error('Condition: constructor "value" property required');Object.prototype.hasOwnProperty.call(t,"priority")&&(t.priority=parseInt(t.priority,10))}}return Fv(e,[{key:"toJSON",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n={};this.priority&&(n.priority=this.priority),this.name&&(n.name=this.name);var o=e.booleanOperator(this);return o?Array.isArray(this[o])?n[o]=this[o].map(function(i){return i.toJSON(!1)}):n[o]=this[o].toJSON(!1):this.isConditionReference()?n.condition=this.condition:(n.operator=this.operator,n.value=this.value,n.fact=this.fact,this.factResult!==void 0&&(n.factResult=this.factResult),this.valueResult!==void 0&&(n.valueResult=this.valueResult),this.result!==void 0&&(n.result=this.result),this.params&&(n.params=this.params),this.path&&(n.path=this.path)),r?JSON.stringify(n):n}},{key:"evaluate",value:function(r,n){var o=this;if(!r)return Promise.reject(new Error("almanac required"));if(!n)return Promise.reject(new Error("operatorMap required"));if(this.isBooleanOperator())return Promise.reject(new Error("Cannot evaluate() a boolean condition"));var i=n.get(this.operator);return i?Promise.all([r.getValue(this.value),r.factValue(this.fact,this.params,this.path)]).then(function(a){var s=Tv(a,2),c=s[0],l=s[1],d=i.evaluate(l,c);return(0,Wv.default)("condition::evaluate",{leftHandSideValue:l,operator:o.operator,rightHandSideValue:c,result:d}),{result:d,leftHandSideValue:l,rightHandSideValue:c,operator:o.operator}}):Promise.reject(new Error("Unknown operator: "+this.operator))}},{key:"booleanOperator",value:function(){return e.booleanOperator(this)}},{key:"isBooleanOperator",value:function(){return e.booleanOperator(this)!==void 0}},{key:"isConditionReference",value:function(){return Object.prototype.hasOwnProperty.call(this,"condition")}}],[{key:"booleanOperator",value:function(r){if(Object.prototype.hasOwnProperty.call(r,"any"))return"any";if(Object.prototype.hasOwnProperty.call(r,"all"))return"all";if(Object.prototype.hasOwnProperty.call(r,"not"))return"not"}}]),e}();rn.default=Bv;var Oo={},il={exports:{}};(function(e){var t=function(){function r(h,p){return p!=null&&h instanceof p}var n;try{n=Map}catch{n=function(){}}var o;try{o=Set}catch{o=function(){}}var i;try{i=Promise}catch{i=function(){}}function a(h,p,x,f,v){typeof p=="object"&&(x=p.depth,f=p.prototype,v=p.includeNonEnumerable,p=p.circular);var g=[],y=[],b=typeof Buffer<"u";typeof p>"u"&&(p=!0),typeof x>"u"&&(x=1/0);function O(S,T){if(S===null)return null;if(T===0)return S;var P,L;if(typeof S!="object")return S;if(r(S,n))P=new n;else if(r(S,o))P=new o;else if(r(S,i))P=new i(function(Z,m){S.then(function(C){Z(O(C,T-1))},function(C){m(O(C,T-1))})});else if(a.__isArray(S))P=[];else if(a.__isRegExp(S))P=new RegExp(S.source,u(S)),S.lastIndex&&(P.lastIndex=S.lastIndex);else if(a.__isDate(S))P=new Date(S.getTime());else{if(b&&Buffer.isBuffer(S))return Buffer.allocUnsafe?P=Buffer.allocUnsafe(S.length):P=new Buffer(S.length),S.copy(P),P;r(S,Error)?P=Object.create(S):typeof f>"u"?(L=Object.getPrototypeOf(S),P=Object.create(L)):(P=Object.create(f),L=f)}if(p){var $=g.indexOf(S);if($!=-1)return y[$];g.push(S),y.push(P)}r(S,n)&&S.forEach(function(Z,m){var C=O(m,T-1),_=O(Z,T-1);P.set(C,_)}),r(S,o)&&S.forEach(function(Z){var m=O(Z,T-1);P.add(m)});for(var B in S){var U;L&&(U=Object.getOwnPropertyDescriptor(L,B)),!(U&&U.set==null)&&(P[B]=O(S[B],T-1))}if(Object.getOwnPropertySymbols)for(var R=Object.getOwnPropertySymbols(S),B=0;B<R.length;B++){var K=R[B],ee=Object.getOwnPropertyDescriptor(S,K);ee&&!ee.enumerable&&!v||(P[K]=O(S[K],T-1),ee.enumerable||Object.defineProperty(P,K,{enumerable:!1}))}if(v)for(var H=Object.getOwnPropertyNames(S),B=0;B<H.length;B++){var X=H[B],ee=Object.getOwnPropertyDescriptor(S,X);ee&&ee.enumerable||(P[X]=O(S[X],T-1),Object.defineProperty(P,X,{enumerable:!1}))}return P}return O(h,x)}a.clonePrototype=function(p){if(p===null)return null;var x=function(){};return x.prototype=p,new x};function s(h){return Object.prototype.toString.call(h)}a.__objToStr=s;function c(h){return typeof h=="object"&&s(h)==="[object Date]"}a.__isDate=c;function l(h){return typeof h=="object"&&s(h)==="[object Array]"}a.__isArray=l;function d(h){return typeof h=="object"&&s(h)==="[object RegExp]"}a.__isRegExp=d;function u(h){var p="";return h.global&&(p+="g"),h.ignoreCase&&(p+="i"),h.multiline&&(p+="m"),p}return a.__getRegExpFlags=u,a}();e.exports&&(e.exports=t)})(il);var al=il.exports;Object.defineProperty(Oo,"__esModule",{value:!0});var $v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rv=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Vv=al,nn=Hv(Vv);function Hv(e){return e&&e.__esModule?e:{default:e}}function Uv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Yv=function(){function e(t,r,n,o){Uv(this,e),this.conditions=(0,nn.default)(t),this.event=(0,nn.default)(r),this.priority=(0,nn.default)(n),this.name=(0,nn.default)(o),this.result=null}return Rv(e,[{key:"setResult",value:function(r){this.result=r}},{key:"resolveEventParams",value:function(r){var n=this;if(this.event.params!==null&&$v(this.event.params)==="object"){var o=[],i=function(c){Object.prototype.hasOwnProperty.call(n.event.params,c)&&o.push(r.getValue(n.event.params[c]).then(function(l){return n.event.params[c]=l}))};for(var a in this.event.params)i(a);return Promise.all(o)}return Promise.resolve()}},{key:"toJSON",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n={conditions:this.conditions.toJSON(!1),event:this.event,priority:this.priority,name:this.name,result:this.result};return r?JSON.stringify(n):n}}]),e}();Oo.default=Yv;var sl={exports:{}};/*!
|
|
107
|
+
* EventEmitter2
|
|
108
|
+
* https://github.com/hij1nx/EventEmitter2
|
|
109
|
+
*
|
|
110
|
+
* Copyright (c) 2013 hij1nx
|
|
111
|
+
* Licensed under the MIT license.
|
|
112
|
+
*/(function(e,t){(function(r){var n=Object.hasOwnProperty,o=Array.isArray?Array.isArray:function(C){return Object.prototype.toString.call(C)==="[object Array]"},i=10,a=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",d=l?setImmediate:setTimeout,u=s?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(m){var C=Object.getOwnPropertyNames(m);return C.push.apply(C,Object.getOwnPropertySymbols(m)),C}:Object.keys;function h(){this._events={},this._conf&&p.call(this,this._conf)}function p(m){m&&(this._conf=m,m.delimiter&&(this.delimiter=m.delimiter),m.maxListeners!==r&&(this._maxListeners=m.maxListeners),m.wildcard&&(this.wildcard=m.wildcard),m.newListener&&(this._newListener=m.newListener),m.removeListener&&(this._removeListener=m.removeListener),m.verboseMemoryLeak&&(this.verboseMemoryLeak=m.verboseMemoryLeak),m.ignoreErrors&&(this.ignoreErrors=m.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function x(m,C){var _="(node) warning: possible EventEmitter memory leak detected. "+m+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(_+=" Event name: "+C+"."),typeof process<"u"&&process.emitWarning){var k=new Error(_);k.name="MaxListenersExceededWarning",k.emitter=this,k.count=m,process.emitWarning(k)}else console.error(_),console.trace&&console.trace()}var f=function(m,C,_){var k=arguments.length;switch(k){case 0:return[];case 1:return[m];case 2:return[m,C];case 3:return[m,C,_];default:for(var M=new Array(k);k--;)M[k]=arguments[k];return M}};function v(m,C){for(var _={},k,M=m.length,F=0,I=0;I<M;I++)k=m[I],_[k]=I<F?C[I]:r;return _}function g(m,C,_){this._emitter=m,this._target=C,this._listeners={},this._listenersCount=0;var k,M;if((_.on||_.off)&&(k=_.on,M=_.off),C.addEventListener?(k=C.addEventListener,M=C.removeEventListener):C.addListener?(k=C.addListener,M=C.removeListener):C.on&&(k=C.on,M=C.off),!k&&!M)throw Error("target does not implement any known event API");if(typeof k!="function")throw TypeError("on method must be a function");if(typeof M!="function")throw TypeError("off method must be a function");this._on=k,this._off=M;var F=m._observers;F?F.push(this):m._observers=[this]}Object.assign(g.prototype,{subscribe:function(m,C,_){var k=this,M=this._target,F=this._emitter,I=this._listeners,j=function(){var W=f.apply(null,arguments),A={data:W,name:C,original:m};if(_){var V=_.call(M,A);V!==!1&&F.emit.apply(F,[A.name].concat(W));return}F.emit.apply(F,[C].concat(W))};if(I[m])throw Error("Event '"+m+"' is already listening");this._listenersCount++,F._newListener&&F._removeListener&&!k._onNewListener?(this._onNewListener=function(W){W===C&&I[m]===null&&(I[m]=j,k._on.call(M,m,j))},F.on("newListener",this._onNewListener),this._onRemoveListener=function(W){W===C&&!F.hasListeners(W)&&I[m]&&(I[m]=null,k._off.call(M,m,j))},I[m]=null,F.on("removeListener",this._onRemoveListener)):(I[m]=j,k._on.call(M,m,j))},unsubscribe:function(m){var C=this,_=this._listeners,k=this._emitter,M,F,I=this._off,j=this._target,W;if(m&&typeof m!="string")throw TypeError("event must be a string");function A(){C._onNewListener&&(k.off("newListener",C._onNewListener),k.off("removeListener",C._onRemoveListener),C._onNewListener=null,C._onRemoveListener=null);var V=L.call(k,C);k._observers.splice(V,1)}if(m){if(M=_[m],!M)return;I.call(j,m,M),delete _[m],--this._listenersCount||A()}else{for(F=u(_),W=F.length;W-- >0;)m=F[W],I.call(j,m,_[m]);this._listeners={},this._listenersCount=0,A()}}});function y(m,C,_,k){var M=Object.assign({},C);if(!m)return M;if(typeof m!="object")throw TypeError("options must be an object");var F=Object.keys(m),I=F.length,j,W,A;function V(q){throw Error('Invalid "'+j+'" option value'+(q?". Reason: "+q:""))}for(var re=0;re<I;re++){if(j=F[re],!n.call(C,j))throw Error('Unknown "'+j+'" option');W=m[j],W!==r&&(A=_[j],M[j]=A?A(W,V):W)}return M}function b(m,C){return(typeof m!="function"||!m.hasOwnProperty("prototype"))&&C("value must be a constructor"),m}function O(m){var C="value must be type of "+m.join("|"),_=m.length,k=m[0],M=m[1];return _===1?function(F,I){if(typeof F===k)return F;I(C)}:_===2?function(F,I){var j=typeof F;if(j===k||j===M)return F;I(C)}:function(F,I){for(var j=typeof F,W=_;W-- >0;)if(j===m[W])return F;I(C)}}var S=O(["function"]),T=O(["object","function"]);function P(m,C,_){var k,M,F=0,I,j=new m(function(W,A,V){_=y(_,{timeout:0,overload:!1},{timeout:function(Q,se){return Q*=1,(typeof Q!="number"||Q<0||!Number.isFinite(Q))&&se("timeout must be a positive number"),Q}}),k=!_.overload&&typeof m.prototype.cancel=="function"&&typeof V=="function";function re(){M&&(M=null),F&&(clearTimeout(F),F=0)}var q=function(Q){re(),W(Q)},z=function(Q){re(),A(Q)};k?C(q,z,V):(M=[function(Q){z(Q||Error("canceled"))}],C(q,z,function(Q){if(I)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Q!="function")throw TypeError("onCancel callback must be a function");M.push(Q)}),I=!0),_.timeout>0&&(F=setTimeout(function(){var Q=Error("timeout");Q.code="ETIMEDOUT",F=0,j.cancel(Q),A(Q)},_.timeout))});return k||(j.cancel=function(W){if(M){for(var A=M.length,V=1;V<A;V++)M[V](W);M[0](W),M=null}}),j}function L(m){var C=this._observers;if(!C)return-1;for(var _=C.length,k=0;k<_;k++)if(C[k]._target===m)return k;return-1}function $(m,C,_,k,M){if(!_)return null;if(k===0){var F=typeof C;if(F==="string"){var I,j,W=0,A=0,V=this.delimiter,re=V.length;if((j=C.indexOf(V))!==-1){I=new Array(5);do I[W++]=C.slice(A,j),A=j+re;while((j=C.indexOf(V,A))!==-1);I[W++]=C.slice(A),C=I,M=W}else C=[C],M=1}else F==="object"?M=C.length:(C=[C],M=1)}var q=null,z,Q,se,Ee,Le,Ne=C[k],Be=C[k+1],De,ye;if(k===M)_._listeners&&(typeof _._listeners=="function"?(m&&m.push(_._listeners),q=[_]):(m&&m.push.apply(m,_._listeners),q=[_]));else if(Ne==="*"){for(De=u(_),j=De.length;j-- >0;)z=De[j],z!=="_listeners"&&(ye=$(m,C,_[z],k+1,M),ye&&(q?q.push.apply(q,ye):q=ye));return q}else if(Ne==="**"){for(Le=k+1===M||k+2===M&&Be==="*",Le&&_._listeners&&(q=$(m,C,_,M,M)),De=u(_),j=De.length;j-- >0;)z=De[j],z!=="_listeners"&&(z==="*"||z==="**"?(_[z]._listeners&&!Le&&(ye=$(m,C,_[z],M,M),ye&&(q?q.push.apply(q,ye):q=ye)),ye=$(m,C,_[z],k,M)):z===Be?ye=$(m,C,_[z],k+2,M):ye=$(m,C,_[z],k,M),ye&&(q?q.push.apply(q,ye):q=ye));return q}else _[Ne]&&(q=$(m,C,_[Ne],k+1,M));if(Q=_["*"],Q&&$(m,C,Q,k+1,M),se=_["**"],se)if(k<M)for(se._listeners&&$(m,C,se,M,M),De=u(se),j=De.length;j-- >0;)z=De[j],z!=="_listeners"&&(z===Be?$(m,C,se[z],k+2,M):z===Ne?$(m,C,se[z],k+1,M):(Ee={},Ee[z]=se[z],$(m,C,{"**":Ee},k+1,M)));else se._listeners?$(m,C,se,M,M):se["*"]&&se["*"]._listeners&&$(m,C,se["*"],M,M);return q}function B(m,C,_){var k=0,M=0,F,I=this.delimiter,j=I.length,W;if(typeof m=="string")if((F=m.indexOf(I))!==-1){W=new Array(5);do W[k++]=m.slice(M,F),M=F+j;while((F=m.indexOf(I,M))!==-1);W[k++]=m.slice(M)}else W=[m],k=1;else W=m,k=m.length;if(k>1){for(F=0;F+1<k;F++)if(W[F]==="**"&&W[F+1]==="**")return}var A=this.listenerTree,V;for(F=0;F<k;F++)if(V=W[F],A=A[V]||(A[V]={}),F===k-1)return A._listeners?(typeof A._listeners=="function"&&(A._listeners=[A._listeners]),_?A._listeners.unshift(C):A._listeners.push(C),!A._listeners.warned&&this._maxListeners>0&&A._listeners.length>this._maxListeners&&(A._listeners.warned=!0,x.call(this,A._listeners.length,V))):A._listeners=C,!0;return!0}function U(m,C,_,k){for(var M=u(m),F=M.length,I,j,W,A=m._listeners,V;F-- >0;)j=M[F],I=m[j],j==="_listeners"?W=_:W=_?_.concat(j):[j],V=k||typeof j=="symbol",A&&C.push(V?W:W.join(this.delimiter)),typeof I=="object"&&U.call(this,I,C,W,V);return C}function R(m){for(var C=u(m),_=C.length,k,M,F;_-- >0;)M=C[_],k=m[M],k&&(F=!0,M!=="_listeners"&&!R(k)&&delete m[M]);return F}function K(m,C,_){this.emitter=m,this.event=C,this.listener=_}K.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function ee(m,C,_){if(_===!0)M=!0;else if(_===!1)k=!0;else{if(!_||typeof _!="object")throw TypeError("options should be an object or true");var k=_.async,M=_.promisify,F=_.nextTick,I=_.objectify}if(k||F||M){var j=C,W=C._origin||C;if(F&&!a)throw Error("process.nextTick is not supported");M===r&&(M=C.constructor.name==="AsyncFunction"),C=function(){var A=arguments,V=this,re=this.event;return M?F?Promise.resolve():new Promise(function(q){d(q)}).then(function(){return V.event=re,j.apply(V,A)}):(F?process.nextTick:d)(function(){V.event=re,j.apply(V,A)})},C._async=!0,C._origin=W}return[C,I?new K(this,m,C):this]}function H(m){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,p.call(this,m)}H.EventEmitter2=H,H.prototype.listenTo=function(m,C,_){if(typeof m!="object")throw TypeError("target musts be an object");var k=this;_=y(_,{on:r,off:r,reducers:r},{on:S,off:S,reducers:T});function M(F){if(typeof F!="object")throw TypeError("events must be an object");var I=_.reducers,j=L.call(k,m),W;j===-1?W=new g(k,m,_):W=k._observers[j];for(var A=u(F),V=A.length,re,q=typeof I=="function",z=0;z<V;z++)re=A[z],W.subscribe(re,F[re]||re,q?I:I&&I[re])}return o(C)?M(v(C)):M(typeof C=="string"?v(C.split(/\s+/)):C),this},H.prototype.stopListeningTo=function(m,C){var _=this._observers;if(!_)return!1;var k=_.length,M,F=!1;if(m&&typeof m!="object")throw TypeError("target should be an object");for(;k-- >0;)M=_[k],(!m||M._target===m)&&(M.unsubscribe(C),F=!0);return F},H.prototype.delimiter=".",H.prototype.setMaxListeners=function(m){m!==r&&(this._maxListeners=m,this._conf||(this._conf={}),this._conf.maxListeners=m)},H.prototype.getMaxListeners=function(){return this._maxListeners},H.prototype.event="",H.prototype.once=function(m,C,_){return this._once(m,C,!1,_)},H.prototype.prependOnceListener=function(m,C,_){return this._once(m,C,!0,_)},H.prototype._once=function(m,C,_,k){return this._many(m,1,C,_,k)},H.prototype.many=function(m,C,_,k){return this._many(m,C,_,!1,k)},H.prototype.prependMany=function(m,C,_,k){return this._many(m,C,_,!0,k)},H.prototype._many=function(m,C,_,k,M){var F=this;if(typeof _!="function")throw new Error("many only accepts instances of Function");function I(){return--C===0&&F.off(m,I),_.apply(this,arguments)}return I._origin=_,this._on(m,I,k,M)},H.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||h.call(this);var m=arguments[0],C,_=this.wildcard,k,M,F,I,j;if(m==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(_&&(C=m,m!=="newListener"&&m!=="removeListener"&&typeof m=="object")){if(M=m.length,s){for(F=0;F<M;F++)if(typeof m[F]=="symbol"){j=!0;break}}j||(m=m.join(this.delimiter))}var W=arguments.length,A;if(this._all&&this._all.length)for(A=this._all.slice(),F=0,M=A.length;F<M;F++)switch(this.event=m,W){case 1:A[F].call(this,m);break;case 2:A[F].call(this,m,arguments[1]);break;case 3:A[F].call(this,m,arguments[1],arguments[2]);break;default:A[F].apply(this,arguments)}if(_)A=[],$.call(this,A,C,this.listenerTree,0,M);else if(A=this._events[m],typeof A=="function"){switch(this.event=m,W){case 1:A.call(this);break;case 2:A.call(this,arguments[1]);break;case 3:A.call(this,arguments[1],arguments[2]);break;default:for(k=new Array(W-1),I=1;I<W;I++)k[I-1]=arguments[I];A.apply(this,k)}return!0}else A&&(A=A.slice());if(A&&A.length){if(W>3)for(k=new Array(W-1),I=1;I<W;I++)k[I-1]=arguments[I];for(F=0,M=A.length;F<M;F++)switch(this.event=m,W){case 1:A[F].call(this);break;case 2:A[F].call(this,arguments[1]);break;case 3:A[F].call(this,arguments[1],arguments[2]);break;default:A[F].apply(this,k)}return!0}else if(!this.ignoreErrors&&!this._all&&m==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},H.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||h.call(this);var m=arguments[0],C=this.wildcard,_,k,M,F,I,j;if(m==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(C&&(_=m,m!=="newListener"&&m!=="removeListener"&&typeof m=="object")){if(F=m.length,s){for(I=0;I<F;I++)if(typeof m[I]=="symbol"){k=!0;break}}k||(m=m.join(this.delimiter))}var W=[],A=arguments.length,V;if(this._all)for(I=0,F=this._all.length;I<F;I++)switch(this.event=m,A){case 1:W.push(this._all[I].call(this,m));break;case 2:W.push(this._all[I].call(this,m,arguments[1]));break;case 3:W.push(this._all[I].call(this,m,arguments[1],arguments[2]));break;default:W.push(this._all[I].apply(this,arguments))}if(C?(V=[],$.call(this,V,_,this.listenerTree,0)):V=this._events[m],typeof V=="function")switch(this.event=m,A){case 1:W.push(V.call(this));break;case 2:W.push(V.call(this,arguments[1]));break;case 3:W.push(V.call(this,arguments[1],arguments[2]));break;default:for(M=new Array(A-1),j=1;j<A;j++)M[j-1]=arguments[j];W.push(V.apply(this,M))}else if(V&&V.length){if(V=V.slice(),A>3)for(M=new Array(A-1),j=1;j<A;j++)M[j-1]=arguments[j];for(I=0,F=V.length;I<F;I++)switch(this.event=m,A){case 1:W.push(V[I].call(this));break;case 2:W.push(V[I].call(this,arguments[1]));break;case 3:W.push(V[I].call(this,arguments[1],arguments[2]));break;default:W.push(V[I].apply(this,M))}}else if(!this.ignoreErrors&&!this._all&&m==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(W)},H.prototype.on=function(m,C,_){return this._on(m,C,!1,_)},H.prototype.prependListener=function(m,C,_){return this._on(m,C,!0,_)},H.prototype.onAny=function(m){return this._onAny(m,!1)},H.prototype.prependAny=function(m){return this._onAny(m,!0)},H.prototype.addListener=H.prototype.on,H.prototype._onAny=function(m,C){if(typeof m!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),C?this._all.unshift(m):this._all.push(m),this},H.prototype._on=function(m,C,_,k){if(typeof m=="function")return this._onAny(m,C),this;if(typeof C!="function")throw new Error("on only accepts instances of Function");this._events||h.call(this);var M=this,F;return k!==r&&(F=ee.call(this,m,C,k),C=F[0],M=F[1]),this._newListener&&this.emit("newListener",m,C),this.wildcard?(B.call(this,m,C,_),M):(this._events[m]?(typeof this._events[m]=="function"&&(this._events[m]=[this._events[m]]),_?this._events[m].unshift(C):this._events[m].push(C),!this._events[m].warned&&this._maxListeners>0&&this._events[m].length>this._maxListeners&&(this._events[m].warned=!0,x.call(this,this._events[m].length,m))):this._events[m]=C,M)},H.prototype.off=function(m,C){if(typeof C!="function")throw new Error("removeListener only takes instances of Function");var _,k=[];if(this.wildcard){var M=typeof m=="string"?m.split(this.delimiter):m.slice();if(k=$.call(this,null,M,this.listenerTree,0),!k)return this}else{if(!this._events[m])return this;_=this._events[m],k.push({_listeners:_})}for(var F=0;F<k.length;F++){var I=k[F];if(_=I._listeners,o(_)){for(var j=-1,W=0,A=_.length;W<A;W++)if(_[W]===C||_[W].listener&&_[W].listener===C||_[W]._origin&&_[W]._origin===C){j=W;break}if(j<0)continue;return this.wildcard?I._listeners.splice(j,1):this._events[m].splice(j,1),_.length===0&&(this.wildcard?delete I._listeners:delete this._events[m]),this._removeListener&&this.emit("removeListener",m,C),this}else(_===C||_.listener&&_.listener===C||_._origin&&_._origin===C)&&(this.wildcard?delete I._listeners:delete this._events[m],this._removeListener&&this.emit("removeListener",m,C))}return this.listenerTree&&R(this.listenerTree),this},H.prototype.offAny=function(m){var C=0,_=0,k;if(m&&this._all&&this._all.length>0){for(k=this._all,C=0,_=k.length;C<_;C++)if(m===k[C])return k.splice(C,1),this._removeListener&&this.emit("removeListenerAny",m),this}else{if(k=this._all,this._removeListener)for(C=0,_=k.length;C<_;C++)this.emit("removeListenerAny",k[C]);this._all=[]}return this},H.prototype.removeListener=H.prototype.off,H.prototype.removeAllListeners=function(m){if(m===r)return!this._events||h.call(this),this;if(this.wildcard){var C=$.call(this,null,m,this.listenerTree,0),_,k;if(!C)return this;for(k=0;k<C.length;k++)_=C[k],_._listeners=null;this.listenerTree&&R(this.listenerTree)}else this._events&&(this._events[m]=null);return this},H.prototype.listeners=function(m){var C=this._events,_,k,M,F,I;if(m===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!C)return[];for(_=u(C),F=_.length,M=[];F-- >0;)k=C[_[F]],typeof k=="function"?M.push(k):M.push.apply(M,k);return M}else{if(this.wildcard){if(I=this.listenerTree,!I)return[];var j=[],W=typeof m=="string"?m.split(this.delimiter):m.slice();return $.call(this,j,W,I,0),j}return C?(k=C[m],k?typeof k=="function"?[k]:k:[]):[]}},H.prototype.eventNames=function(m){var C=this._events;return this.wildcard?U.call(this,this.listenerTree,[],null,m):C?u(C):[]},H.prototype.listenerCount=function(m){return this.listeners(m).length},H.prototype.hasListeners=function(m){if(this.wildcard){var C=[],_=typeof m=="string"?m.split(this.delimiter):m.slice();return $.call(this,C,_,this.listenerTree,0),C.length>0}var k=this._events,M=this._all;return!!(M&&M.length||k&&(m===r?u(k).length:k[m]))},H.prototype.listenersAny=function(){return this._all?this._all:[]},H.prototype.waitFor=function(m,C){var _=this,k=typeof C;return k==="number"?C={timeout:C}:k==="function"&&(C={filter:C}),C=y(C,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:S,Promise:b}),P(C.Promise,function(M,F,I){function j(){var W=C.filter;if(!(W&&!W.apply(_,arguments)))if(_.off(m,j),C.handleError){var A=arguments[0];A?F(A):M(f.apply(null,arguments).slice(1))}else M(f.apply(null,arguments))}I(function(){_.off(m,j)}),_._on(m,j,!1)},{timeout:C.timeout,overload:C.overload})};function X(m,C,_){_=y(_,{Promise,timeout:0,overload:!1},{Promise:b});var k=_.Promise;return P(k,function(M,F,I){var j;if(typeof m.addEventListener=="function"){j=function(){M(f.apply(null,arguments))},I(function(){m.removeEventListener(C,j)}),m.addEventListener(C,j,{once:!0});return}var W=function(){A&&m.removeListener("error",A),M(f.apply(null,arguments))},A;C!=="error"&&(A=function(V){m.removeListener(C,W),F(V)},m.once("error",A)),I(function(){A&&m.removeListener("error",A),m.removeListener(C,W)}),m.once(C,W)},{timeout:_.timeout,overload:_.overload})}var Z=H.prototype;Object.defineProperties(H,{defaultMaxListeners:{get:function(){return Z._maxListeners},set:function(m){if(typeof m!="number"||m<0||Number.isNaN(m))throw TypeError("n must be a non-negative number");Z._maxListeners=m},enumerable:!0},once:{value:X,writable:!0,configurable:!0}}),Object.defineProperties(Z,{_maxListeners:{value:i,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),e.exports=H})()})(sl);var cl=sl.exports;Object.defineProperty(tn,"__esModule",{value:!0});var zv=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),qv=rn,Kv=br(qv),Gv=Oo,Xv=br(Gv),Qv=_t,Zv=br(Qv),Jv=al,ey=br(Jv),ty=cl,ry=br(ty);function br(e){return e&&e.__esModule?e:{default:e}}function ny(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oy(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function iy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var ay=function(e){iy(t,e);function t(r){ny(this,t);var n=oy(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));typeof r=="string"&&(r=JSON.parse(r)),r&&r.conditions&&n.setConditions(r.conditions),r&&r.onSuccess&&n.on("success",r.onSuccess),r&&r.onFailure&&n.on("failure",r.onFailure),r&&(r.name||r.name===0)&&n.setName(r.name);var o=r&&r.priority||1;n.setPriority(o);var i=r&&r.event||{type:"unknown"};return n.setEvent(i),n}return zv(t,[{key:"setPriority",value:function(n){if(n=parseInt(n,10),n<=0)throw new Error("Priority must be greater than zero");return this.priority=n,this}},{key:"setName",value:function(n){if(!n&&n!==0)throw new Error('Rule "name" must be defined');return this.name=n,this}},{key:"setConditions",value:function(n){if(!Object.prototype.hasOwnProperty.call(n,"all")&&!Object.prototype.hasOwnProperty.call(n,"any")&&!Object.prototype.hasOwnProperty.call(n,"not")&&!Object.prototype.hasOwnProperty.call(n,"condition"))throw new Error('"conditions" root must contain a single instance of "all", "any", "not", or "condition"');return this.conditions=new Kv.default(n),this}},{key:"setEvent",value:function(n){if(!n)throw new Error("Rule: setEvent() requires event object");if(!Object.prototype.hasOwnProperty.call(n,"type"))throw new Error('Rule: setEvent() requires event object with "type" property');return this.ruleEvent={type:n.type},this.event=this.ruleEvent,n.params&&(this.ruleEvent.params=n.params),this}},{key:"getEvent",value:function(){return this.ruleEvent}},{key:"getPriority",value:function(){return this.priority}},{key:"getConditions",value:function(){return this.conditions}},{key:"getEngine",value:function(){return this.engine}},{key:"setEngine",value:function(n){return this.engine=n,this}},{key:"toJSON",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,o={conditions:this.conditions.toJSON(!1),priority:this.priority,event:this.ruleEvent,name:this.name};return n?JSON.stringify(o):o}},{key:"prioritizeConditions",value:function(n){var o=this,i=n.reduce(function(a,s){var c=s.priority;if(!c){var l=o.engine.getFact(s.fact);c=l&&l.priority||1}return a[c]||(a[c]=[]),a[c].push(s),a},{});return Object.keys(i).sort(function(a,s){return Number(a)>Number(s)?-1:1}).map(function(a){return i[a]})}},{key:"evaluate",value:function(n){var o=this,i=new Xv.default(this.conditions,this.ruleEvent,this.priority,this.name),a=function(f){if(f.isConditionReference())return h(f);if(f.isBooleanOperator()){var v=f[f.operator],g=void 0;return f.operator==="all"?g=d(v):f.operator==="any"?g=l(v):g=u(v),g.then(function(y){var b=y===!0;return f.result=b,b})}else return f.evaluate(n,o.engine.operators).then(function(y){var b=y.result;return f.factResult=y.leftHandSideValue,f.valueResult=y.rightHandSideValue,f.result=b,b})},s=function(f,v){return Array.isArray(f)||(f=[f]),Promise.all(f.map(function(g){return a(g)})).then(function(g){return(0,Zv.default)("rule::evaluateConditions",{results:g}),v.call(g,function(y){return y===!0})})},c=function(f,v){if(f.length===0)return Promise.resolve(!0);if(f.length===1)return a(f[0]);for(var g=o.prioritizeConditions(f),y=Promise.resolve(v==="all"),b=function(T){var P=g[T];y=y.then(function(L){return v==="any"?L||s(P,Array.prototype.some):L&&s(P,Array.prototype.every)})},O=0;O<g.length;O++)b(O);return y},l=function(f){return c(f,"any")},d=function(f){return c(f,"all")},u=function(f){return c([f],"not").then(function(v){return!v})},h=function(f){var v=o.engine.conditions.get(f.condition);if(v)return delete f.condition,Object.assign(f,(0,ey.default)(v)),a(f);if(o.engine.allowUndefinedConditions)return f.result=!1,Promise.resolve(!1);throw new Error("No condition "+f.condition+" exists")},p=function(f){i.setResult(f);var v=Promise.resolve();o.engine.replaceFactsInEventParams&&(v=i.resolveEventParams(n));var g=f?"success":"failure";return v.then(function(){return o.emitAsync(g,i.event,n,i)}).then(function(){return i})};return i.conditions.any?l(i.conditions.any).then(function(x){return p(x)}):i.conditions.all?d(i.conditions.all).then(function(x){return p(x)}):i.conditions.not?u(i.conditions.not).then(function(x){return p(x)}):h(i.conditions).then(function(x){return p(x)})}}]),t}(ry.default);tn.default=ay;var on={},_o={};Object.defineProperty(_o,"__esModule",{value:!0});function sy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cy(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function ly(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}_o.UndefinedFactError=function(e){ly(t,e);function t(){var r;sy(this,t);for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=cy(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(o)));return a.code="UNDEFINED_FACT",a}return t}(Error);class uy{add(t,r,n){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],r&&this[o][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}}class dy{constructor(t){this.jsep=t,this.registered={}}register(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach(o=>{if(typeof o!="object"||!o.name||!o.init)throw new Error("Invalid JSEP plugin format");this.registered[o.name]||(o.init(this.jsep),this.registered[o.name]=o)})}}class N{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+N.version}static addUnaryOp(t){return N.max_unop_len=Math.max(t.length,N.max_unop_len),N.unary_ops[t]=1,N}static addBinaryOp(t,r,n){return N.max_binop_len=Math.max(t.length,N.max_binop_len),N.binary_ops[t]=r,n?N.right_associative.add(t):N.right_associative.delete(t),N}static addIdentifierChar(t){return N.additional_identifier_chars.add(t),N}static addLiteral(t,r){return N.literals[t]=r,N}static removeUnaryOp(t){return delete N.unary_ops[t],t.length===N.max_unop_len&&(N.max_unop_len=N.getMaxKeyLen(N.unary_ops)),N}static removeAllUnaryOps(){return N.unary_ops={},N.max_unop_len=0,N}static removeIdentifierChar(t){return N.additional_identifier_chars.delete(t),N}static removeBinaryOp(t){return delete N.binary_ops[t],t.length===N.max_binop_len&&(N.max_binop_len=N.getMaxKeyLen(N.binary_ops)),N.right_associative.delete(t),N}static removeAllBinaryOps(){return N.binary_ops={},N.max_binop_len=0,N}static removeLiteral(t){return delete N.literals[t],N}static removeAllLiterals(){return N.literals={},N}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new N(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return N.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!N.binary_ops[String.fromCharCode(t)]||N.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return N.isIdentifierStart(t)||N.isDecimalDigit(t)}throwError(t){const r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(N.hooks[t]){const n={context:this,node:r};return N.hooks.run(t,n),n.node}return r}searchHook(t){if(N.hooks[t]){const r={context:this};return N.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===N.SPACE_CODE||t===N.TAB_CODE||t===N.LF_CODE||t===N.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:N.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,o;for(;this.index<this.expr.length;)if(n=this.code,n===N.SEMCOL_CODE||n===N.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())r.push(o);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){const t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,N.max_binop_len),r=t.length;for(;r>0;){if(N.binary_ops.hasOwnProperty(t)&&(!N.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!N.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,o,i,a,s,c,l;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(i={value:r,prec:N.binaryPrecedence(r),right_a:N.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),o=[a,i,s];r=this.gobbleBinaryOp();){if(n=N.binaryPrecedence(r),n===0){this.index-=r.length;break}i={value:r,prec:n,right_a:N.right_associative.has(r)},l=r;const d=u=>i.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;o.length>2&&d(o[o.length-2]);)s=o.pop(),r=o.pop().value,a=o.pop(),t={type:N.BINARY_EXP,operator:r,left:a,right:s},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+l),o.push(i,t)}for(c=o.length-1,t=o[c];c>1;)t={type:N.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,r,n,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,N.isDecimalDigit(t)||t===N.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===N.SQUOTE_CODE||t===N.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===N.OBRACK_CODE)o=this.gobbleArray();else{for(r=this.expr.substr(this.index,N.max_unop_len),n=r.length;n>0;){if(N.unary_ops.hasOwnProperty(r)&&(!N.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!N.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;const i=this.gobbleToken();return i||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:N.UNARY_EXP,operator:r,argument:i,prefix:!0})}r=r.substr(0,--n)}N.isIdentifierStart(t)?(o=this.gobbleIdentifier(),N.literals.hasOwnProperty(o.name)?o={type:N.LITERAL,value:N.literals[o.name],raw:o.name}:o.name===N.this_str&&(o={type:N.THIS_EXP})):t===N.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===N.PERIOD_CODE||r===N.OBRACK_CODE||r===N.OPAREN_CODE||r===N.QUMARK_CODE;){let n;if(r===N.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==N.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===N.OBRACK_CODE?(t={type:N.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==N.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===N.OPAREN_CODE?t={type:N.CALL_EXP,arguments:this.gobbleArguments(N.CPAREN_CODE),callee:t}:(r===N.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:N.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;N.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===N.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);N.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));N.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);N.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,N.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===N.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===N.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:N.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="";const r=this.index,n=this.expr.charAt(this.index++);let o=!1;for(;this.index<this.expr.length;){let i=this.expr.charAt(this.index++);if(i===n){o=!0;break}else if(i==="\\")switch(i=this.expr.charAt(this.index++),i){case"n":t+=`
|
|
113
|
+
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=i}else t+=i}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:N.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(N.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,N.isIdentifierPart(t));)this.index++;return{type:N.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){const r=[];let n=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===t){n=!0,this.index++,t===N.CPAREN_CODE&&o&&o>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(i===N.COMMA_CODE){if(this.index++,o++,o!==r.length){if(t===N.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===N.CBRACK_CODE)for(let a=r.length;a<o;a++)r.push(null)}}else if(r.length!==o&&o!==0)this.throwError("Expected comma");else{const a=this.gobbleExpression();(!a||a.type===N.COMPOUND)&&this.throwError("Expected comma"),r.push(a)}}return n||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(N.CPAREN_CODE);if(this.code===N.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:N.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:N.ARRAY_EXP,elements:this.gobbleArguments(N.CBRACK_CODE)}}}const fy=new uy;Object.assign(N,{hooks:fy,plugins:new dy(N),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),N.max_unop_len=N.getMaxKeyLen(N.unary_ops),N.max_binop_len=N.getMaxKeyLen(N.binary_ops);const at=e=>new N(e).parse(),hy=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(N).filter(e=>!hy.includes(e)&&at[e]===void 0).forEach(e=>{at[e]=N[e]}),at.Jsep=N;const py="ConditionalExpression";var my={name:"ternary",init(e){e.hooks.add("after-expression",function(r){if(r.node&&this.code===e.QUMARK_CODE){this.index++;const n=r.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),r.node={type:py,test:n,consequent:o,alternate:i},n.operator&&e.binary_ops[n.operator]<=.9){let a=n;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;r.node.test=a.right,a.right=r.node,r.node=n}}else this.throwError("Expected :")}})}};at.plugins.register(my);const ll=47,gy=92;var vy={name:"regex",init(e){e.hooks.add("gobble-token",function(r){if(this.code===ll){const n=++this.index;let o=!1;for(;this.index<this.expr.length;){if(this.code===ll&&!o){const i=this.expr.slice(n,this.index);let a="";for(;++this.index<this.expr.length;){const c=this.code;if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57)a+=this.char;else break}let s;try{s=new RegExp(i,a)}catch(c){this.throwError(c.message)}return r.node={type:e.LITERAL,value:s,raw:this.expr.slice(n-1,this.index)},r.node=this.gobbleTokenProperty(r.node),r.node}this.code===e.OBRACK_CODE?o=!0:o&&this.code===e.CBRACK_CODE&&(o=!1),this.index+=this.code===gy?2:1}this.throwError("Unclosed Regex")}})}};const ko=43,Kt={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[ko,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];Kt.assignmentOperators.forEach(n=>e.addBinaryOp(n,Kt.assignmentPrecedence,!0)),e.hooks.add("gobble-token",function(o){const i=this.code;Kt.updateOperators.some(a=>a===i&&a===this.expr.charCodeAt(this.index+1))&&(this.index+=2,o.node={type:"UpdateExpression",operator:i===ko?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!o.node.argument||!t.includes(o.node.argument.type))&&this.throwError(`Unexpected ${o.node.operator}`))}),e.hooks.add("after-token",function(o){if(o.node){const i=this.code;Kt.updateOperators.some(a=>a===i&&a===this.expr.charCodeAt(this.index+1))&&(t.includes(o.node.type)||this.throwError(`Unexpected ${o.node.operator}`),this.index+=2,o.node={type:"UpdateExpression",operator:i===ko?"++":"--",argument:o.node,prefix:!1})}}),e.hooks.add("after-expression",function(o){o.node&&r(o.node)});function r(n){Kt.assignmentOperators.has(n.operator)?(n.type="AssignmentExpression",r(n.left),r(n.right)):n.operator||Object.values(n).forEach(o=>{o&&typeof o=="object"&&r(o)})}}};at.plugins.register(vy,Kt),at.addUnaryOp("typeof"),at.addLiteral("null",null),at.addLiteral("undefined",void 0);const yy=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),fe={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return fe.evalBinaryExpression(e,t);case"Compound":return fe.evalCompound(e,t);case"ConditionalExpression":return fe.evalConditionalExpression(e,t);case"Identifier":return fe.evalIdentifier(e,t);case"Literal":return fe.evalLiteral(e,t);case"MemberExpression":return fe.evalMemberExpression(e,t);case"UnaryExpression":return fe.evalUnaryExpression(e,t);case"ArrayExpression":return fe.evalArrayExpression(e,t);case"CallExpression":return fe.evalCallExpression(e,t);case"AssignmentExpression":return fe.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression(e,t){return{"||":(n,o)=>n||o(),"&&":(n,o)=>n&&o(),"|":(n,o)=>n|o(),"^":(n,o)=>n^o(),"&":(n,o)=>n&o(),"==":(n,o)=>n==o(),"!=":(n,o)=>n!=o(),"===":(n,o)=>n===o(),"!==":(n,o)=>n!==o(),"<":(n,o)=>n<o(),">":(n,o)=>n>o(),"<=":(n,o)=>n<=o(),">=":(n,o)=>n>=o(),"<<":(n,o)=>n<<o(),">>":(n,o)=>n>>o(),">>>":(n,o)=>n>>>o(),"+":(n,o)=>n+o(),"-":(n,o)=>n-o(),"*":(n,o)=>n*o(),"/":(n,o)=>n/o(),"%":(n,o)=>n%o()}[e.operator](fe.evalAst(e.left,t),()=>fe.evalAst(e.right,t))},evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){e.body[n].type==="Identifier"&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&e.body[n+1].type==="AssignmentExpression"&&(n+=1);const o=e.body[n];r=fe.evalAst(o,t)}return r},evalConditionalExpression(e,t){return fe.evalAst(e.test,t)?fe.evalAst(e.consequent,t):fe.evalAst(e.alternate,t)},evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral(e){return e.value},evalMemberExpression(e,t){const r=String(e.computed?fe.evalAst(e.property):e.property.name),n=fe.evalAst(e.object,t);if(n==null)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&yy.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const o=n[r];return typeof o=="function"?o.bind(n):o},evalUnaryExpression(e,t){return{"-":n=>-fe.evalAst(n,t),"!":n=>!fe.evalAst(n,t),"~":n=>~fe.evalAst(n,t),"+":n=>+fe.evalAst(n,t),typeof:n=>typeof fe.evalAst(n,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(r=>fe.evalAst(r,t))},evalCallExpression(e,t){const r=e.arguments.map(o=>fe.evalAst(o,t));return fe.evalAst(e.callee,t)(...r)},evalAssignmentExpression(e,t){if(e.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name,n=fe.evalAst(e.right,t);return t[r]=n,t[r]}};class by{constructor(t){this.code=t,this.ast=at(this.code)}runInNewContext(t){const r=Object.assign(Object.create(null),t);return fe.evalAst(this.ast,r)}}function yt(e,t){return e=e.slice(),e.push(t),e}function Po(e,t){return t=t.slice(),t.unshift(e),t}class wy extends Error{constructor(t){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=t,this.name="NewError"}}function ae(e,t,r,n,o){if(!(this instanceof ae))try{return new ae(e,t,r,n,o)}catch(a){if(!a.avoidNew)throw a;return a.value}typeof e=="string"&&(o=n,n=r,r=t,t=e,e=null);const i=e&&typeof e=="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=Object.hasOwn(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.eval=e.eval===void 0?"safe":e.eval,this.ignoreEvalErrors=typeof e.ignoreEvalErrors>"u"?!1:e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){const a={path:i?e.path:t};i?"json"in e&&(a.json=e.json):a.json=r;const s=this.evaluate(a);if(!s||typeof s!="object")throw new wy(s);return s}}ae.prototype.evaluate=function(e,t,r,n){let o=this.parent,i=this.parentProperty,{flatten:a,wrap:s}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&typeof e=="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),a=Object.hasOwn(e,"flatten")?e.flatten:a,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,s=Object.hasOwn(e,"wrap")?e.wrap:s,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(e,"parent")?e.parent:o,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(o=o||null,i=i||null,Array.isArray(e)&&(e=ae.toPathString(e)),!e&&e!==""||!t)return;const c=ae.toPathArray(e);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;const l=this._trace(c,t,["$"],o,i,r).filter(function(d){return d&&!d.isParentSelector});return l.length?!s&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce((d,u)=>{const h=this._getPreferredOutput(u);return a&&Array.isArray(h)?d=d.concat(h):d.push(h),d},[]):s?[]:void 0},ae.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const r=Array.isArray(e.path)?e.path:ae.toPathArray(e.path);return e.pointer=ae.toPointer(r),e.path=typeof e.path=="string"?e.path:ae.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return ae.toPathString(e[t]);case"pointer":return ae.toPointer(e.path);default:throw new TypeError("Unknown result type")}},ae.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:ae.toPathString(e.path),t(n,r,e)}},ae.prototype._trace=function(e,t,r,n,o,i,a,s){let c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:o,hasArrExpr:a},this._handleCallback(c,i,"value"),c;const l=e[0],d=e.slice(1),u=[];function h(p){Array.isArray(p)?p.forEach(x=>{u.push(x)}):u.push(p)}if((typeof l!="string"||s)&&t&&Object.hasOwn(t,l))h(this._trace(d,t[l],yt(r,l),t,l,i,a));else if(l==="*")this._walk(t,p=>{h(this._trace(d,t[p],yt(r,p),t,p,i,!0,!0))});else if(l==="..")h(this._trace(d,t,r,n,o,i,a)),this._walk(t,p=>{typeof t[p]=="object"&&h(this._trace(e.slice(),t[p],yt(r,p),t,p,i,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if(l==="~")return c={path:yt(r,l),value:o,parent:n,parentProperty:null},this._handleCallback(c,i,"property"),c;if(l==="$")h(this._trace(d,t,r,null,null,i,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))h(this._slice(l,d,t,r,n,o,i));else if(l.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const p=l.replace(/^\?\((.*?)\)$/u,"$1"),x=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(p);x?this._walk(t,f=>{const v=[x[2]],g=x[1]?t[f][x[1]]:t[f];this._trace(v,g,r,n,o,i,!0).length>0&&h(this._trace(d,t[f],yt(r,f),t,f,i,!0))}):this._walk(t,f=>{this._eval(p,t[f],f,r,n,o)&&h(this._trace(d,t[f],yt(r,f),t,f,i,!0))})}else if(l[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(Po(this._eval(l,t,r.at(-1),r.slice(0,-1),n,o),d),t,r,n,o,i,a))}else if(l[0]==="@"){let p=!1;const x=l.slice(1,-2);switch(x){case"scalar":(!t||!["object","function"].includes(typeof t))&&(p=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===x&&(p=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(p=!0);break;case"number":Number.isFinite(t)&&(p=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(p=!0);break;case"object":t&&typeof t===x&&(p=!0);break;case"array":Array.isArray(t)&&(p=!0);break;case"other":p=this.currOtherTypeCallback(t,r,n,o);break;case"null":t===null&&(p=!0);break;default:throw new TypeError("Unknown value type "+x)}if(p)return c={path:r,value:t,parent:n,parentProperty:o},this._handleCallback(c,i,"value"),c}else if(l[0]==="`"&&t&&Object.hasOwn(t,l.slice(1))){const p=l.slice(1);h(this._trace(d,t[p],yt(r,p),t,p,i,a,!0))}else if(l.includes(",")){const p=l.split(",");for(const x of p)h(this._trace(Po(x,d),t,r,n,o,i,!0))}else!s&&t&&Object.hasOwn(t,l)&&h(this._trace(d,t[l],yt(r,l),t,l,i,a,!0))}if(this._hasParentSelector)for(let p=0;p<u.length;p++){const x=u[p];if(x&&x.isParentSelector){const f=this._trace(x.expr,t,x.path,n,o,i,a);if(Array.isArray(f)){u[p]=f[0];const v=f.length;for(let g=1;g<v;g++)p++,u.splice(p,0,f[g])}else u[p]=f}}return u},ae.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let n=0;n<r;n++)t(n)}else e&&typeof e=="object"&&Object.keys(e).forEach(r=>{t(r)})},ae.prototype._slice=function(e,t,r,n,o,i,a){if(!Array.isArray(r))return;const s=r.length,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1;let d=c[0]&&Number.parseInt(c[0])||0,u=c[1]&&Number.parseInt(c[1])||s;d=d<0?Math.max(0,d+s):Math.min(s,d),u=u<0?Math.max(0,u+s):Math.min(s,u);const h=[];for(let p=d;p<u;p+=l)this._trace(Po(p,t),r,n,o,i,a,!0).forEach(f=>{h.push(f)});return h},ae.prototype._eval=function(e,t,r,n,o,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=o,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const a=e.includes("@path");a&&(this.currSandbox._$_path=ae.toPathString(n.concat([r])));const s=this.currEval+"Script:"+e;if(!ae.cache[s]){let c=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(a&&(c=c.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)ae.cache[s]=new this.safeVm.Script(c);else if(this.currEval==="native")ae.cache[s]=new this.vm.Script(c);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const l=this.currEval;ae.cache[s]=new l(c)}else if(typeof this.currEval=="function")ae.cache[s]={runInNewContext:l=>this.currEval(c,l)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return ae.cache[s].runInNewContext(this.currSandbox)}catch(c){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+c.message+": "+e)}},ae.cache={},ae.toPathString=function(e){const t=e,r=t.length;let n="$";for(let o=1;o<r;o++)/^(~|\^|@.*?\(\))$/u.test(t[o])||(n+=/^[0-9*]+$/u.test(t[o])?"["+t[o]+"]":"['"+t[o]+"']");return n},ae.toPointer=function(e){const t=e,r=t.length;let n="";for(let o=1;o<r;o++)/^(~|\^|@.*?\(\))$/u.test(t[o])||(n+="/"+t[o].toString().replaceAll("~","~0").replaceAll("/","~1"));return n},ae.toPathArray=function(e){const{cache:t}=ae;if(t[e])return t[e].concat();const r=[],o=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(i,a){return"[#"+(r.push(a)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(i,a){return"['"+a.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(i,a){return";"+a.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(i){const a=i.match(/#(\d+)/u);return!a||!a[1]?i:r[a[1]]});return t[e]=o,t[e].concat()},ae.prototype.safeVm={Script:by};const xy=function(e,t,r){const n=e.length;for(let o=0;o<n;o++){const i=e[o];r(i)&&t.push(e.splice(o--,1)[0])}};class Ey{constructor(t){this.code=t}runInNewContext(t){let r=this.code;const n=Object.keys(t),o=[];xy(n,o,l=>typeof t[l]=="function");const i=n.map(l=>t[l]);r=o.reduce((l,d)=>{let u=t[d].toString();return/function/u.test(u)||(u="function "+u),"var "+d+"="+u+";"+l},"")+r,!/(['"])use strict\1/u.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;\s*$/u,"");const s=r.lastIndexOf(";"),c=s!==-1?r.slice(0,s+1)+" return "+r.slice(s+1):" return "+r;return new Function(...n,c)(...i)}}ae.prototype.vm={Script:Ey};const Cy=sv(Object.freeze(Object.defineProperty({__proto__:null,JSONPath:ae},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(on,"__esModule",{value:!0});var Mo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sy=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Oy=gr,Ao=ul(Oy),_y=_o,ky=_t,kt=ul(ky),Py=Cy;function ul(e){return e&&e.__esModule?e:{default:e}}function My(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ay(e,t){return(0,Py.JSONPath)({path:t,json:e,wrap:!1})}var Ny=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};My(this,e),this.factMap=new Map,this.factResultsCache=new Map,this.allowUndefinedFacts=!!t.allowUndefinedFacts,this.pathResolver=t.pathResolver||Ay,this.events={success:[],failure:[]},this.ruleResults=[]}return Sy(e,[{key:"addEvent",value:function(r,n){if(!n)throw new Error('outcome required: "success" | "failure"]');this.events[n].push(r)}},{key:"getEvents",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return r?this.events[r]:this.events.success.concat(this.events.failure)}},{key:"addResult",value:function(r){this.ruleResults.push(r)}},{key:"getResults",value:function(){return this.ruleResults}},{key:"_getFact",value:function(r){return this.factMap.get(r)}},{key:"_addConstantFact",value:function(r){this.factMap.set(r.id,r),this._setFactValue(r,{},r.value)}},{key:"_setFactValue",value:function(r,n,o){var i=r.getCacheKey(n),a=Promise.resolve(o);return i&&this.factResultsCache.set(i,a),a}},{key:"addFact",value:function(r,n,o){var i=r,a=void 0;return r instanceof Ao.default?(i=r.id,a=r):a=new Ao.default(r,n,o),(0,kt.default)("almanac::addFact",{id:i}),this.factMap.set(i,a),a.isConstant()&&this._setFactValue(a,{},a.value),this}},{key:"addRuntimeFact",value:function(r,n){(0,kt.default)("almanac::addRuntimeFact",{id:r});var o=new Ao.default(r,n);return this._addConstantFact(o)}},{key:"factValue",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=void 0,s=this._getFact(r);if(s===void 0)return this.allowUndefinedFacts?Promise.resolve(void 0):Promise.reject(new _y.UndefinedFactError("Undefined fact: "+r));if(s.isConstant())a=Promise.resolve(s.calculate(o,this));else{var c=s.getCacheKey(o),l=c&&this.factResultsCache.get(c);l?(a=Promise.resolve(l),(0,kt.default)("almanac::factValue cache hit for fact",{id:r})):((0,kt.default)("almanac::factValue cache miss, calculating",{id:r}),a=this._setFactValue(s,o,s.calculate(o,this)))}return i?((0,kt.default)("condition::evaluate extracting object",{property:i}),a.then(function(d){if(d!=null&&(typeof d>"u"?"undefined":Mo(d))==="object"){var u=n.pathResolver(d,i);return(0,kt.default)("condition::evaluate extracting object",{property:i,received:u}),u}else return(0,kt.default)("condition::evaluate could not compute object path of non-object",{path:i,factValue:d,type:typeof d>"u"?"undefined":Mo(d)}),d})):a}},{key:"getValue",value:function(r){return r!=null&&(typeof r>"u"?"undefined":Mo(r))==="object"&&Object.prototype.hasOwnProperty.call(r,"fact")?this.factValue(r.fact,r.params,r.path):Promise.resolve(r)}}]),e}();on.default=Ny;var No={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});var Dy=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function Ty(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Fy=function(){function e(t,r,n){if(Ty(this,e),this.name=String(t),!t)throw new Error("Missing operator name");if(typeof r!="function")throw new Error("Missing operator callback");this.cb=r,this.factValueValidator=n,this.factValueValidator||(this.factValueValidator=function(){return!0})}return Dy(e,[{key:"evaluate",value:function(r,n){return this.factValueValidator(r)&&this.cb(r,n)}}]),e}();Gt.default=Fy,Object.defineProperty(No,"__esModule",{value:!0});var Iy=Gt,Ge=Wy(Iy);function Wy(e){return e&&e.__esModule?e:{default:e}}var je=[];je.push(new Ge.default("equal",function(e,t){return e===t})),je.push(new Ge.default("notEqual",function(e,t){return e!==t})),je.push(new Ge.default("in",function(e,t){return t.indexOf(e)>-1})),je.push(new Ge.default("notIn",function(e,t){return t.indexOf(e)===-1})),je.push(new Ge.default("contains",function(e,t){return e.indexOf(t)>-1},Array.isArray)),je.push(new Ge.default("doesNotContain",function(e,t){return e.indexOf(t)===-1},Array.isArray));function an(e){return Number.parseFloat(e).toString()!=="NaN"}je.push(new Ge.default("lessThan",function(e,t){return e<t},an)),je.push(new Ge.default("lessThanInclusive",function(e,t){return e<=t},an)),je.push(new Ge.default("greaterThan",function(e,t){return e>t},an)),je.push(new Ge.default("greaterThanInclusive",function(e,t){return e>=t},an)),No.default=je;var Do={},wr={};Object.defineProperty(wr,"__esModule",{value:!0});var jy=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Ly=Gt,By=$y(Ly);function $y(e){return e&&e.__esModule?e:{default:e}}function Ry(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Vy=function(){function e(t,r,n){if(Ry(this,e),this.name=String(t),!t)throw new Error("Missing decorator name");if(typeof r!="function")throw new Error("Missing decorator callback");this.cb=r,this.factValueValidator=n,this.factValueValidator||(this.factValueValidator=function(){return!0})}return jy(e,[{key:"decorate",value:function(r){var n=this,o=r.evaluate.bind(r);return new By.default(this.name+":"+r.name,function(i,a){return n.cb(i,a,o)},this.factValueValidator)}}]),e}();wr.default=Vy,Object.defineProperty(Do,"__esModule",{value:!0});var Hy=wr,Xt=Uy(Hy);function Uy(e){return e&&e.__esModule?e:{default:e}}var Pt=[];Pt.push(new Xt.default("someFact",function(e,t,r){return e.some(function(n){return r(n,t)})},Array.isArray)),Pt.push(new Xt.default("someValue",function(e,t,r){return t.some(function(n){return r(e,n)})})),Pt.push(new Xt.default("everyFact",function(e,t,r){return e.every(function(n){return r(n,t)})},Array.isArray)),Pt.push(new Xt.default("everyValue",function(e,t,r){return t.every(function(n){return r(e,n)})})),Pt.push(new Xt.default("swap",function(e,t,r){return r(t,e)})),Pt.push(new Xt.default("not",function(e,t,r){return!r(e,t)})),Do.default=Pt;var To={};Object.defineProperty(To,"__esModule",{value:!0});var Yy=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),zy=Gt,Fo=Wo(zy),qy=wr,Io=Wo(qy),Ky=_t,sn=Wo(Ky);function Wo(e){return e&&e.__esModule?e:{default:e}}function Gy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Xy=function(){function e(){Gy(this,e),this.operators=new Map,this.decorators=new Map}return Yy(e,[{key:"addOperator",value:function(r,n){var o=void 0;r instanceof Fo.default?o=r:o=new Fo.default(r,n),(0,sn.default)("operatorMap::addOperator",{name:o.name}),this.operators.set(o.name,o)}},{key:"removeOperator",value:function(r){var n=void 0;r instanceof Fo.default?n=r.name:n=r;for(var o=":"+n,i=Array.from(this.operators.keys()),a=0;a<i.length;a++)i[a].endsWith(o)&&this.operators.delete(i[a]);return this.operators.delete(n)}},{key:"addOperatorDecorator",value:function(r,n){var o=void 0;r instanceof Io.default?o=r:o=new Io.default(r,n),(0,sn.default)("operatorMap::addOperatorDecorator",{name:o.name}),this.decorators.set(o.name,o)}},{key:"removeOperatorDecorator",value:function(r){var n=void 0;r instanceof Io.default?n=r.name:n=r;for(var o=n+":",i=Array.from(this.operators.keys()),a=0;a<i.length;a++)i[a].includes(o)&&this.operators.delete(i[a]);return this.decorators.delete(n)}},{key:"get",value:function(r){for(var n=[],o=r;!this.operators.has(o);){var i=o.indexOf(":");if(i>0){var a=o.slice(0,i),s=this.decorators.get(a);if(!s)return(0,sn.default)("operatorMap::get invalid decorator",{name:a}),null;n.unshift(s),o=o.slice(i+1)}else return(0,sn.default)("operatorMap::get no operator",{name:o}),null}for(var c=this.operators.get(o),l=0;l<n.length;l++)c=n[l].decorate(c),this.operators.set(c.name,c);return c}}]),e}();To.default=Xy,Object.defineProperty(it,"__esModule",{value:!0}),it.FINISHED=it.RUNNING=it.READY=void 0;var Qy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zy=function(){function e(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),Jy=gr,xr=st(Jy),eb=tn,jo=st(eb),tb=on,rb=st(tb),nb=cl,ob=st(nb),ib=No,ab=st(ib),sb=Do,cb=st(sb),lb=_t,Qt=st(lb),ub=rn,db=st(ub),fb=To,hb=st(fb);function st(e){return e&&e.__esModule?e:{default:e}}function pb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mb(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function gb(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var vb=it.READY="READY",dl=it.RUNNING="RUNNING",fl=it.FINISHED="FINISHED",yb=function(e){gb(t,e);function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};pb(this,t);var o=mb(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.rules=[],o.allowUndefinedFacts=n.allowUndefinedFacts||!1,o.allowUndefinedConditions=n.allowUndefinedConditions||!1,o.replaceFactsInEventParams=n.replaceFactsInEventParams||!1,o.pathResolver=n.pathResolver,o.operators=new hb.default,o.facts=new Map,o.conditions=new Map,o.status=vb,r.map(function(i){return o.addRule(i)}),ab.default.map(function(i){return o.addOperator(i)}),cb.default.map(function(i){return o.addOperatorDecorator(i)}),o}return Zy(t,[{key:"addRule",value:function(n){if(!n)throw new Error("Engine: addRule() requires options");var o=void 0;if(n instanceof jo.default)o=n;else{if(!Object.prototype.hasOwnProperty.call(n,"event"))throw new Error('Engine: addRule() argument requires "event" property');if(!Object.prototype.hasOwnProperty.call(n,"conditions"))throw new Error('Engine: addRule() argument requires "conditions" property');o=new jo.default(n)}return o.setEngine(this),this.rules.push(o),this.prioritizedRules=null,this}},{key:"updateRule",value:function(n){var o=this.rules.findIndex(function(i){return i.name===n.name});if(o>-1)this.rules.splice(o,1),this.addRule(n),this.prioritizedRules=null;else throw new Error("Engine: updateRule() rule not found")}},{key:"removeRule",value:function(n){var o=!1;if(n instanceof jo.default){var a=this.rules.indexOf(n);a>-1&&(o=!!this.rules.splice(a,1).length)}else{var i=this.rules.filter(function(s){return s.name!==n});o=i.length!==this.rules.length,this.rules=i}return o&&(this.prioritizedRules=null),o}},{key:"setCondition",value:function(n,o){if(!n)throw new Error("Engine: setCondition() requires name");if(!o)throw new Error("Engine: setCondition() requires conditions");if(!Object.prototype.hasOwnProperty.call(o,"all")&&!Object.prototype.hasOwnProperty.call(o,"any")&&!Object.prototype.hasOwnProperty.call(o,"not")&&!Object.prototype.hasOwnProperty.call(o,"condition"))throw new Error('"conditions" root must contain a single instance of "all", "any", "not", or "condition"');return this.conditions.set(n,new db.default(o)),this}},{key:"removeCondition",value:function(n){return this.conditions.delete(n)}},{key:"addOperator",value:function(n,o){this.operators.addOperator(n,o)}},{key:"removeOperator",value:function(n){return this.operators.removeOperator(n)}},{key:"addOperatorDecorator",value:function(n,o){this.operators.addOperatorDecorator(n,o)}},{key:"removeOperatorDecorator",value:function(n){return this.operators.removeOperatorDecorator(n)}},{key:"addFact",value:function(n,o,i){var a=n,s=void 0;return n instanceof xr.default?(a=n.id,s=n):s=new xr.default(n,o,i),(0,Qt.default)("engine::addFact",{id:a}),this.facts.set(a,s),this}},{key:"removeFact",value:function(n){var o=void 0;return n instanceof xr.default?o=n.id:o=n,this.facts.delete(o)}},{key:"prioritizeRules",value:function(){if(!this.prioritizedRules){var n=this.rules.reduce(function(o,i){var a=i.priority;return o[a]||(o[a]=[]),o[a].push(i),o},{});this.prioritizedRules=Object.keys(n).sort(function(o,i){return Number(o)>Number(i)?-1:1}).map(function(o){return n[o]})}return this.prioritizedRules}},{key:"stop",value:function(){return this.status=fl,this}},{key:"getFact",value:function(n){return this.facts.get(n)}},{key:"evaluateRules",value:function(n,o){var i=this;return Promise.all(n.map(function(a){return i.status!==dl?((0,Qt.default)("engine::run, skipping remaining rules",{status:i.status}),Promise.resolve()):a.evaluate(o).then(function(s){return(0,Qt.default)("engine::run",{ruleResult:s.result}),o.addResult(s),s.result?(o.addEvent(s.event,"success"),i.emitAsync("success",s.event,o,s).then(function(){return i.emitAsync(s.event.type,s.event.params,o,s)})):(o.addEvent(s.event,"failure"),i.emitAsync("failure",s.event,o,s))})}))}},{key:"run",value:function(){var n=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,Qt.default)("engine::run started"),this.status=dl;var a=i.almanac||new rb.default({allowUndefinedFacts:this.allowUndefinedFacts,pathResolver:this.pathResolver});this.facts.forEach(function(u){a.addFact(u)});for(var s in o){var c=void 0;o[s]instanceof xr.default?c=o[s]:c=new xr.default(s,o[s]),a.addFact(c),(0,Qt.default)("engine::run initialized runtime fact",{id:c.id,value:c.value,type:Qy(c.value)})}var l=this.prioritizeRules(),d=Promise.resolve();return new Promise(function(u,h){l.map(function(p){return d=d.then(function(){return n.evaluateRules(p,a)}).catch(h),d}),d.then(function(){n.status=fl,(0,Qt.default)("engine::run completed");var p=a.getResults(),x=p.reduce(function(g,y){var b=y.result?"results":"failureResults";return g[b].push(y),g},{results:[],failureResults:[]}),f=x.results,v=x.failureResults;u({almanac:a,results:f,failureResults:v,events:a.getEvents("success"),failureEvents:a.getEvents("failure")})}).catch(h)})}}]),t}(ob.default);it.default=yb,Object.defineProperty(_e,"__esModule",{value:!0}),_e.OperatorDecorator=_e.Almanac=_e.Engine=_e.Operator=_e.Rule=_e.Fact=void 0,_e.default=function(e,t){return new hl.default(e,t)};var bb=it,hl=Zt(bb),wb=gr,xb=Zt(wb),Eb=tn,Cb=Zt(Eb),Sb=Gt,Ob=Zt(Sb),_b=on,kb=Zt(_b),Pb=wr,Mb=Zt(Pb);function Zt(e){return e&&e.__esModule?e:{default:e}}_e.Fact=xb.default,_e.Rule=Cb.default,_e.Operator=Ob.default,_e.Engine=hl.default,_e.Almanac=kb.default,_e.OperatorDecorator=Mb.default;var Ab=_e;function Nb(e){return e.map(t=>{const r=[];if(Object.entries(t.conditions).forEach(([n,o])=>{n!=="all"&&n!=="any"&&typeof o=="object"&&!Array.isArray(o)&&r.push(...Lo(n,o))}),t.conditions.all&&Array.isArray(t.conditions.all)&&t.conditions.all.forEach(n=>{Object.entries(n).forEach(([o,i])=>{r.push(...Lo(o,i))})}),t.conditions.any&&Array.isArray(t.conditions.any)){const n=[];t.conditions.any.forEach(o=>{const i=[];Object.entries(o).forEach(([a,s])=>{i.push(...Lo(a,s))}),i.length>0&&(i.length===1?n.push(i[0]):n.push({all:i}))}),n.length>0&&r.push({any:n})}return{conditions:{all:r},event:t.event}})}function Lo(e,t){const r=[];return Object.entries(t).forEach(([n,o])=>{const i=Db(n);i&&r.push({fact:e,operator:i,value:o})}),r}function Db(e){return{equals:"equal",notEquals:"notEqual",greaterThan:"greaterThan",lessThan:"lessThan",greaterThanOrEqual:"greaterThanOrEqual",lessThanOrEqual:"lessThanOrEqual",contains:"contains",notContains:"doesNotContain",in:"in",notIn:"notIn",empty:"empty",notEmpty:"notEmpty"}[e]||null}function Tb(e,t,r){const n=JSON.parse(JSON.stringify(e)),o=JSON.parse(JSON.stringify(t||{}));if(r.hiddenFields.forEach(i=>{const a=i.replace("root_","").split("_");pl(o,a,"ui:widget","hidden")}),r.disabledFields.forEach(i=>{const a=i.replace("root_","").split("_");pl(o,a,"ui:disabled",!0)}),n.properties){const i=new Set(n.required||[]);r.requiredFields.forEach(a=>{const s=a.replace("root_","");s&&i.add(s)}),n.required=Array.from(i)}return{schema:n,uiSchema:o}}function pl(e,t,r,n){let o=e;for(let a=0;a<t.length-1;a++)o[t[a]]||(o[t[a]]={}),o=o[t[a]];const i=t[t.length-1];o[i]||(o[i]={}),o[i][r]=n}function Bo(e,t="",r="."){const n={};if(!e||typeof e!="object")return n;for(const o in e)if(e.hasOwnProperty(o)){const i=t?`${t}${r}${o}`:o;Array.isArray(e[o])?(e[o].forEach((a,s)=>{const c=`${i}.${s}`;typeof a=="object"&&a!==null?Object.assign(n,Bo(a,c,r)):n[c]=a}),n[i]=e[o]):typeof e[o]=="object"&&e[o]!==null?Object.assign(n,Bo(e[o],i,r)):n[i]=e[o]}return n}const Fb=({schema:e,uiSchema:t={},formData:r,conditionalRules:n,debug:o=!1,onFieldChange:i,onFieldFocus:a,onFieldBlur:s,...c})=>{const[l,d]=D.useState({hiddenFields:new Set,disabledFields:new Set,requiredFields:new Set}),[u,h]=D.useState(r||{}),p=D.useMemo(()=>{const b=new Ab.Engine;return b.addOperator("empty",(S,T)=>{const P=!S||S===""||Array.isArray(S)&&S.length===0;return T?P:!P}),b.addOperator("notEmpty",(S,T)=>{const P=!S||S===""||Array.isArray(S)&&S.length===0;return T?!P:P}),Nb(n).forEach(S=>b.addRule(S)),b},[n]),x=D.useCallback(async b=>{if(!n||n.length===0){d({hiddenFields:new Set,disabledFields:new Set,requiredFields:new Set});return}try{const O=Bo(b);n&&n.forEach(P=>{const L=$=>{Object.keys($).forEach(B=>{B!=="all"&&B!=="any"&&(B in O||(O[B]=void 0))}),$.all&&$.all.forEach(B=>L(B)),$.any&&$.any.forEach(B=>L(B))};L(P.conditions)}),o&&(console.log("Form data:",b),console.log("Extracted facts:",O));const{events:S}=await p.run(O),T={hiddenFields:new Set,disabledFields:new Set,requiredFields:new Set};S.forEach(P=>{var $;const L=(($=P.params)==null?void 0:$.fields)||[];switch(P.type){case"show":L.forEach(B=>T.hiddenFields.delete(B));break;case"hide":L.forEach(B=>T.hiddenFields.add(B));break;case"require":L.forEach(B=>T.requiredFields.add(B));break;case"unrequire":L.forEach(B=>T.requiredFields.delete(B));break;case"disable":L.forEach(B=>T.disabledFields.add(B));break;case"enable":L.forEach(B=>T.disabledFields.delete(B));break}}),o&&(console.log("Conditional engine events:",S),console.log("Conditional state after evaluation:",{hidden:Array.from(T.hiddenFields),disabled:Array.from(T.disabledFields),required:Array.from(T.requiredFields)})),d(T)}catch(O){console.error("Error evaluating conditional rules with engine:",O)}},[p,n,o]);D.useEffect(()=>{x(u)},[u,x]);const{schema:f,uiSchema:v}=D.useMemo(()=>{const b=Tb(e,t,l);return o&&l.requiredFields.size>0&&console.log("Modified schema required fields:",b.schema.required),b},[e,t,l,o]),g=D.useCallback(b=>{o&&console.log("Field changed:",b),i==null||i(b),b.formData&&h(b.formData)},[i,o]),y=D.useCallback(b=>{h(b.formData),c.onChange&&c.onChange(b)},[c]);return w.jsx(Zc,{...c,schema:f,uiSchema:v,formData:u,onChange:y,onFieldChange:g,onFieldFocus:a,onFieldBlur:s})};Y.validator=Yo,Object.defineProperty(Y,"generateTheme",{enumerable:!0,get:()=>yl.generateTheme}),Y.AddressField=li,Y.ArrayFieldItemTemplate=yi,Y.ArrayFieldTemplate=vi,Y.ColorWidget=xi,Y.ConditionalForm=Fb,Y.CurrencyField=pi,Y.DateTimeWidget=wo,Y.DateWidget=vu,Y.EmailWidget=vo,Y.EnhancedCheckboxWidget=Vc,Y.EnhancedNumberWidget=Uc,Y.EnhancedRadioWidget=Hc,Y.EnhancedSelectWidget=Rc,Y.EnhancedTextWidget=Bc,Y.EnhancedTextareaWidget=$c,Y.ExtendedForm=Zc,Y.FileUploadWidget=zc,Y.FileWidget=Ci,Y.FormEventHub=Gc,Y.FormEventManager=iv,Y.FormEventProvider=di,Y.GridLayout=ov,Y.HorizontalLayout=rv,Y.PasswordWidget=bo,Y.PhoneField=hi,Y.RangeWidget=Vi,Y.RatingWidget=Hi,Y.TelephoneWidget=go,Y.URLWidget=yo,Y.VerticalLayout=Jg,Y.cn=J,Y.customFields=bi,Y.customTemplates=wi,Y.customWidgets=Kc,Y.enhancedWidgets=qc,Y.formDataUtils=Xc,Y.schemaUtils=Qc,Y.useFieldEventHandlers=ve,Y.useFormEventHub=fi,Y.validationUtils=av,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
|