extended-dynamic-forms 0.1.13 → 0.1.14

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/dist/index.umd.js CHANGED
@@ -1,19 +1,19 @@
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";/**
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,Cn,Yo,bl,wl){"use strict";var ew=Object.defineProperty;var tw=(Y,w,D)=>w in Y?ew(Y,w,{enumerable:!0,configurable:!0,writable:!0,value:D}):Y[w]=D;var wt=(Y,w,D)=>tw(Y,typeof w!="symbol"?w+"":w,D);function zo(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 E=zo(D),Sn=zo(Uo);function qo(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=qo(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ko(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=qo(e))&&(r&&(r+=" "),r+=t);return r}const lr="-",xl=e=>{const t=Cl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(lr);return s[0]===""&&s.length!==1&&s.shift(),Go(s,t)||El(a)},getConflictingClassGroupIds:(a,s)=>{const c=n[a]||[];return s&&r[a]?[...c,...r[a]]:c}}},Go=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Go(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(lr);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},Xo=/^\[(.+)\]$/,El=e=>{if(Xo.test(e)){const t=Xo.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Cl=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ol(Object.entries(e.classGroups),n).forEach(([i,a])=>{ur(a,r,i,t)}),r},ur=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Qo(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Sl(o)){ur(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{ur(a,Qo(t,i),n,r)})})},Qo=(e,t)=>{let n=e;return t.split(lr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sl=e=>e.isThemeGetter,Ol=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e,_l=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Zo="!",kl=e=>{const{separator:t,experimentalParseClassName:n}=e,r=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&&(r||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),b=p?h.substring(1):h,f=u&&u>d?u-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:f}};return n?s=>n({className:s,parseClassName:a}):a},Pl=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},Ml=e=>({cache:_l(e.cacheSize),parseClassName:kl(e),...xl(e)}),Al=/\s+/,Nl=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Al);let s="";for(let c=a.length-1;c>=0;c-=1){const l=a[c],{modifiers:d,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:p}=n(l);let b=!!p,f=r(b?h.substring(0,p):h);if(!f){if(!b){s=l+(s.length>0?" "+s:s);continue}if(f=r(h),!f){s=l+(s.length>0?" "+s:s);continue}b=!1}const v=Pl(d).join(":"),g=u?v+Zo:v,y=g+f;if(i.includes(y))continue;i.push(y);const x=o(f,b);for(let O=0;O<x.length;++O){const S=x[O];i.push(g+S)}s=l+(s.length>0?" "+s:s)}return s};function Dl(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Jo(t))&&(r&&(r+=" "),r+=n);return r}const Jo=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jo(e[r]))&&(n&&(n+=" "),n+=t);return n};function Tl(e,...t){let n,r,o,i=a;function a(c){const l=t.reduce((d,u)=>u(d),e());return n=Ml(l),r=n.cache.get,o=n.cache.set,i=s,s(c)}function s(c){const l=r(c);if(l)return l;const d=Nl(c,n);return o(c,d),d}return function(){return i(Dl.apply(null,arguments))}}const pe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ei=/^\[(?:([a-z-]+):)?(.+)\]$/i,Fl=/^\d+\/\d+$/,Il=new Set(["px","full","screen"]),Wl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\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$/,Ll=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Bl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$l=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qe=e=>Mt(e)||Il.has(e)||Fl.test(e),ct=e=>At(e,"length",Kl),Mt=e=>!!e&&!Number.isNaN(Number(e)),dr=e=>At(e,"number",Mt),Jt=e=>!!e&&Number.isInteger(Number(e)),Rl=e=>e.endsWith("%")&&Mt(e.slice(0,-1)),te=e=>ei.test(e),lt=e=>Wl.test(e),Vl=new Set(["length","size","percentage"]),Hl=e=>At(e,Vl,ti),Ul=e=>At(e,"position",ti),Yl=new Set(["image","url"]),zl=e=>At(e,Yl,Xl),ql=e=>At(e,"",Gl),en=()=>!0,At=(e,t,n)=>{const r=ei.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Kl=e=>jl.test(e)&&!Ll.test(e),ti=()=>!1,Gl=e=>Bl.test(e),Xl=e=>$l.test(e),Ql=Tl(()=>{const e=pe("colors"),t=pe("spacing"),n=pe("blur"),r=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"),b=pe("gradientColorStopPositions"),f=pe("inset"),v=pe("margin"),g=pe("opacity"),y=pe("padding"),x=pe("saturate"),O=pe("scale"),S=pe("sepia"),F=pe("skew"),P=pe("space"),L=pe("translate"),V=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",te,t],B=()=>[te,t],K=()=>["",Qe,ct],ee=()=>["auto",Mt,te],R=()=>["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:[en],spacing:[Qe,ct],blur:["none","",lt,te],brightness:k(),borderColor:[e],borderRadius:["none","","full",lt,te],borderSpacing:B(),borderWidth:K(),contrast:k(),grayscale:C(),hueRotate:k(),invert:C(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[Rl,ct],inset:H(),margin:H(),opacity:k(),padding:B(),saturate:k(),scale:k(),sepia:C(),skew:k(),space:B(),translate:B()},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:[...R(),te]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],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:H()}],"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":[en]}],"col-start-end":[{col:["auto",{span:["full",Jt,te]},te]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[en]}],"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",dr]}],"font-family":[{font:[en]}],"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,dr]}],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:B()}],"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:[...R(),Ul]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Hl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zl]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"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,ql]}],"shadow-color":[{shadow:[en]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",lt,te]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"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":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"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":[F]}],"skew-y":[{"skew-y":[F]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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,dr]}],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 Ql(Ko(e))}const be=E.forwardRef(({className:e,type:t,...n},r)=>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:r,...n}));be.displayName="Input";function ni(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ri(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ni(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ni(e[o],null)}}}}function ue(...e){return E.useCallback(ri(...e),e)}function Nt(e){const t=Jl(e),n=E.forwardRef((r,o)=>{const{children:i,...a}=r,s=E.Children.toArray(i),c=s.find(tu);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 n.displayName=`${e}.Slot`,n}var Zl=Nt("Slot");function Jl(e){const t=E.forwardRef((n,r)=>{const{children:o,...i}=n;if(E.isValidElement(o)){const a=ru(o),s=nu(i,o.props);return o.type!==E.Fragment&&(s.ref=r?ri(r,a):a),E.cloneElement(o,s)}return E.Children.count(o)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eu=Symbol("radix.slottable");function tu(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eu}function nu(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const c=i(...s);return o(...s),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ru(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 ou=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=ou.reduce((e,t)=>{const n=Nt(`Primitive.${t}`),r=E.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iu(e,t){e&&Sn.flushSync(()=>e.dispatchEvent(t))}var au="Label",oi=E.forwardRef((e,t)=>w.jsx(ie.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())}}));oi.displayName=au;var ii=oi;const ai=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,si=Ko,fr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return si(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(l=>{const d=n==null?void 0:n[l],u=i==null?void 0:i[l];if(d===null)return null;const h=ai(d)||ai(u);return o[l][h]}),s=n&&Object.entries(n).reduce((l,d)=>{let[u,h]=d;return h===void 0||(l[u]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:u,className:h,...p}=d;return Object.entries(p).every(b=>{let[f,v]=b;return Array.isArray(v)?v.includes({...i,...s}[f]):{...i,...s}[f]===v})?[...l,u,h]:l},[]);return si(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},su=fr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ke=E.forwardRef(({className:e,...t},n)=>w.jsx(ii,{ref:n,className:J(su(),e),...t}));ke.displayName=ii.displayName;const On=E.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));On.displayName="Card";const hr=E.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:J("flex flex-col space-y-1.5 p-6",e),...t}));hr.displayName="CardHeader";const ci=E.forwardRef(({className:e,...t},n)=>w.jsx("h3",{ref:n,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));ci.displayName="CardTitle";const cu=E.forwardRef(({className:e,...t},n)=>w.jsx("p",{ref:n,className:J("text-sm text-muted-foreground",e),...t}));cu.displayName="CardDescription";const _n=E.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:J("p-6 pt-0",e),...t}));_n.displayName="CardContent";const lu=E.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:J("flex items-center p-6 pt-0",e),...t}));lu.displayName="CardFooter";const li=({formData:e,onChange:t,required:n,disabled:r,readonly:o,schema:i,idSchema:a})=>{const s=c=>l=>{t({...e,[c]:l.target.value})};return w.jsxs(On,{children:[w.jsx(hr,{className:"pb-4",children:w.jsx(ci,{className:"text-lg",children:i.title||"Address"})}),w.jsxs(_n,{className:"space-y-4",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_street`,children:["Street Address",n&&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:r||o,placeholder:"123 Main St"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_city`,children:["City",n&&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:r||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",n&&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:r||o,placeholder:"NY"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsxs(ke,{htmlFor:`${a.$id}_zip`,children:["ZIP/Postal Code",n&&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:r||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:r||o,placeholder:"United States"})]})]})]})},ui=D.createContext(null),di=({eventHub:e,formData:t,children:n})=>w.jsx(ui.Provider,{value:{eventHub:e,formData:t},children:n}),fi=()=>{const e=D.useContext(ui);if(!e)throw new Error("useFormEventHub must be used within a FormEventProvider");return e},ve=(e,t,n)=>{const{eventHub:r,formData:o}=fi();return D.useMemo(()=>r.createFieldEventHandlers(e,t,o,n),[r,e,t,o,n])},hi=({formData:e,onChange:t,required:n,disabled:r,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",n&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:a.$id,type:"tel",value:e||"",onChange:l,disabled:r||o,placeholder:"(555) 123-4567",maxLength:14})]})},pi=({formData:e,onChange:t,required:n,disabled:r,readonly:o,schema:i,uiSchema:a,idSchema:s})=>{var b,f;const c=((b=a==null?void 0:a["ui:options"])==null?void 0:b.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",n&&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:r||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)})]})]})},pr=fr("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:n,asChild:r=!1,...o},i)=>{const a=r?Zl:"button";return w.jsx(a,{className:J(pr({variant:t,size:n,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 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"};/**
6
+ */var uu={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 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};/**
11
+ */const du=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Re=(e,t)=>{const n=D.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:c,...l},d)=>D.createElement("svg",{ref:d,...uu,width:o,height:o,stroke:r,strokeWidth:a?Number(i)*24/Number(o):i,className:["lucide",`lucide-${du(e)}`,s].join(" "),...l},[...t.map(([u,h])=>D.createElement(u,h)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
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 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"}]]);/**
16
+ */const fu=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.
@@ -23,17 +23,17 @@
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 mn=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
26
+ */const mr=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 fu=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
31
+ */const hu=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 hu=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
36
+ */const pu=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.
@@ -43,71 +43,71 @@
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 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"}]]);/**
46
+ */const mu=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 mu=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
51
+ */const gu=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 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"}]]);/**
56
+ */const vu=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 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,`;
61
+ */const gr=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vi=e=>{const{canAdd:t,disabled:n,idSchema:r,uiSchema:o,items:i,onAddClick:a,readonly:s,registry:c,required:l,schema:d,title:u}=e,h=Cn.getUiOptions(o),p=Cn.getTemplate("ArrayFieldDescriptionTemplate",c,h),b=Cn.getTemplate("ArrayFieldItemTemplate",c,h),f=Cn.getTemplate("ArrayFieldTitleTemplate",c,h);return w.jsx("div",{className:J("rjsf-array-field",h.classNames),children:w.jsxs(On,{className:"border-slate-200",children:[(u||h.title)&&w.jsxs(hr,{className:"pb-3",children:[w.jsx(f,{idSchema:r,title:h.title||u,required:l,schema:d,uiSchema:o,registry:c}),(h.description||d.description)&&w.jsx(p,{idSchema:r,description:h.description||d.description,schema:d,uiSchema:o,registry:c})]}),w.jsxs(_n,{className:"space-y-3",children:[i&&i.map(({key:v,...g})=>w.jsx(b,{...g},v)),t&&w.jsxs(Ze,{type:"button",onClick:a,disabled:n||s,size:"sm",variant:"outline",className:"w-full border-dashed",children:[w.jsx(gu,{className:"h-4 w-4 mr-2"}),"Add ",u||"Item"]})]})]})})},yi=e=>{const{children:t,disabled:n,hasToolbar:r,buttonsProps:o,readonly:i}=e,{hasMoveDown:a,hasMoveUp:s,hasRemove:c,index:l,onDropIndexClick:d,onReorderClick:u}=o;return w.jsx(On,{className:"relative border-slate-200",children:w.jsxs(_n,{className:"p-4",children:[r&&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(mu,{className:"h-4 w-4 text-slate-400"})}),s&&w.jsx(Ze,{type:"button",size:"sm",variant:"ghost",disabled:n||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:n||i,onClick:u(l,l+1),className:"h-8 w-8 p-0",title:"Move down",children:w.jsx(mr,{className:"h-4 w-4"})}),c&&w.jsx(Ze,{type:"button",size:"sm",variant:"ghost",disabled:n||i,onClick:d(l),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Remove",children:w.jsx(gr,{className:"h-4 w-4"})})]}),w.jsx("div",{className:J(r&&"pr-24"),children:t})]})})},bi={address:li,phone:hi,currency:pi},wi={ArrayFieldTemplate:vi,ArrayFieldItemTemplate:yi},xi=({id:e,value:t,required:n,disabled:r,readonly:o,label:i,onChange:a,onBlur:s,onFocus:c,schema:l})=>{const d=ve(e,l),u=async b=>{const f=b.target.value;a(f),await d.onChange(f)},h=async b=>{const f=b.target.value;s&&s(e,f),await d.onBlur(f)},p=async b=>{const f=b.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,n&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:e,type:"color",value:t||"#000000",required:n,disabled:r||o,onChange:u,onBlur:h,onFocus:p,className:"h-10 w-full cursor-pointer"})]})},yu=({id:e,value:t,required:n,disabled:r,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)},b=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,n&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{id:e,type:u,value:t||"",required:n,disabled:r||o,onChange:p,onBlur:b,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"})]})},bu=fr("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,...n}){return w.jsx("div",{className:J(bu({variant:t}),e),...n})}const Ci=({id:e,value:t,required:n,disabled:r,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 x=Array.from(g).map(O=>({name:O.name,size:O.size,type:O.type,lastModified:O.lastModified}));y=x,a(x)}else{const x=g[0];x&&(y={name:x.name,size:x.size,type:x.type,lastModified:x.lastModified},a(y))}y&&await h.onChange(y)},b=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,n&&w.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w.jsx(be,{ref:l,id:e,type:"file",accept:d,multiple:u,required:n,disabled:r||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),")"]}),!r&&!o&&w.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:b,children:w.jsx(gr,{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),")"]}),!r&&!o&&w.jsx(Ze,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent",onClick:b,children:w.jsx(gr,{className:"h-3 w-3"})})]}):null})]})};function kn(e,[t,n]){return Math.min(n,Math.max(t,e))}function oe(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 Dt(e,t=[]){let n=[];function r(i,a){const s=E.createContext(a),c=n.length;n=[...n,a];const l=u=>{var g;const{scope:h,children:p,...b}=u,f=((g=h==null?void 0:h[e])==null?void 0:g[c])||s,v=E.useMemo(()=>b,Object.values(b));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,b=E.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[l,d]}const o=()=>{const i=n.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,[r,wu(o,...t)]}function wu(...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(i){const a=r.reduce((s,{useScope:c,scopeName:l})=>{const u=c(i)[`__scope${l}`];return{...s,...u}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Ce=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},xu=E[" useInsertionEffect ".trim().toString()]||Ce;function tn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=Eu({defaultProp:t,onChange:n}),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(`${r} 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,r])}const l=E.useCallback(d=>{var u;if(s){const h=Cu(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 Eu({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),o=E.useRef(n),i=E.useRef(t);return xu(()=>{i.current=t},[t]),E.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Cu(e){return typeof e=="function"}var Su=E.createContext(void 0);function Si(e){const t=E.useContext(Su);return e||t||"ltr"}function vr(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 yr(e){const[t,n]=E.useState(void 0);return Ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=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;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Oi(e){const t=e+"CollectionProvider",[n,r]=Dt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=f=>{const{scope:v,children:g}=f,y=D.useRef(null),x=D.useRef(new Map).current;return w.jsx(o,{scope:v,itemMap:x,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,x=i(s,g),O=ue(v,x.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,...x}=f,O=D.useRef(null),S=ue(v,O),F=i(d,g);return D.useEffect(()=>(F.itemMap.set(O,{ref:O,...x}),()=>void F.itemMap.delete(O))),w.jsx(h,{[u]:"",ref:S,children:y})});p.displayName=d;function b(f){const v=i(e+"CollectionConsumer",f);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((F,P)=>x.indexOf(F.ref.current)-x.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},b,r]}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",[br,Ou,_u]=Oi(Tt),[Mi,rw]=Dt(Tt,[_u]),[ku,Pn]=Mi(Tt),Ai=E.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:d,onValueChange:u=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:b,...f}=e,v=E.useRef(new Set),g=E.useRef(0),x=a==="horizontal"?Pu:Mu,[O=[],S]=tn({prop:d,defaultProp:l,onChange:H=>{var K;(K=[...v.current][g.current])==null||K.focus(),u(H)}}),F=E.useRef(O);function P(H){const B=Fu(O,H);U(H,B)}function L(H){U(H,g.current)}function V(){const H=F.current[g.current];O[g.current]!==H&&h(O)}function U(H,B,{commit:K}={commit:!1}){const ee=Lu(i),R=Bu(Math.round((H-r)/i)*i+r,ee),X=kn(R,[r,o]);S((Z=[])=>{const m=Du(Z,X,B);if(ju(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(ku,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:g,thumbs:v.current,values:O,orientation:a,form:b,children:w.jsx(br.Provider,{scope:e.__scopeSlider,children:w.jsx(br.Slot,{scope:e.__scopeSlider,children:w.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...f,ref:t,onPointerDown:oe(f.onPointerDown,()=>{s||(F.current=O)}),min:r,max:o,inverted:p,onSlideStart:s?void 0:P,onSlideMove:s?void 0:L,onSlideEnd:s?void 0:V,onHomeKeyDown:()=>!s&&U(r,0,{commit:!0}),onEndKeyDown:()=>!s&&U(o,O.length-1,{commit:!0}),onStepKeyDown:({event:H,direction:B})=>{if(!s){const R=_i.includes(H.key)||H.shiftKey&&ki.includes(H.key)?10:1,X=g.current,Z=O[X],m=i*R*B;U(Z+m,X,{commit:!0})}}})})})})});Ai.displayName=Tt;var[Ni,Di]=Mi(Tt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Pu=E.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...d}=e,[u,h]=E.useState(null),p=ue(t,x=>h(x)),b=E.useRef(void 0),f=Si(o),v=f==="ltr",g=v&&!i||!v&&i;function y(x){const O=b.current||u.getBoundingClientRect(),S=[0,O.width],P=Er(S,g?[n,r]:[r,n]);return b.current=O,P(x-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:x=>{const O=y(x.clientX);a==null||a(O)},onSlideMove:x=>{const O=y(x.clientX);s==null||s(O)},onSlideEnd:()=>{b.current=void 0,c==null||c()},onStepKeyDown:x=>{const S=Pi[g?"from-left":"from-right"].includes(x.key);l==null||l({event:x,direction:S?-1:1})}})})}),Mu=E.forwardRef((e,t)=>{const{min:n,max:r,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 b(f){const v=h.current||d.current.getBoundingClientRect(),g=[0,v.height],x=Er(g,p?[r,n]:[n,r]);return h.current=v,x(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=b(f.clientY);i==null||i(v)},onSlideMove:f=>{const v=b(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:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:c,...l}=e,d=Pn(Tt,n);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():r(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:n,...r}=e,o=Pn(Fi,n);return w.jsx(ie.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});Ii.displayName=Fi;var wr="SliderRange",Wi=E.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=Pn(wr,n),i=Di(wr,n),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,...r,ref:s,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:u+"%"}})});Wi.displayName=wr;var xr="SliderThumb",ji=E.forwardRef((e,t)=>{const n=Ou(e.__scopeSlider),[r,o]=E.useState(null),i=ue(t,s=>o(s)),a=E.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return w.jsx(Au,{...e,ref:i,index:a})}),Au=E.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=Pn(xr,n),s=Di(xr,n),[c,l]=E.useState(null),d=ue(t,y=>l(y)),u=c?a.form||!!c.closest("form"):!0,h=yr(c),p=a.values[r],b=p===void 0?0:Bi(p,a.min,a.max),f=Tu(r,a.values.length),v=h==null?void 0:h[s.size],g=v?Iu(v,b,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(${b}% + ${g}px)`},children:[w.jsx(br.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=r})})}),u&&w.jsx(Li,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:p},r)]})});ji.displayName=xr;var Nu="RadioBubbleInput",Li=E.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=E.useRef(null),i=ue(o,r),a=vr(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"},...n,ref:i,defaultValue:t})});Li.displayName=Nu;function Du(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function Bi(e,t,n){const i=100/(n-t)*(e-t);return kn(i,[0,100])}function Tu(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Fu(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 Iu(e,t,n){const r=e/2,i=Er([0,50],[0,r]);return(r-i(t)*n)*n}function Wu(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function ju(e,t){if(t>0){const n=Wu(e);return Math.min(...n)>=t}return!0}function Er(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 Lu(e){return(String(e).split(".")[1]||"").length}function Bu(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var $i=Ai,$u=Ii,Ru=Wi,Vu=ji;const Ri=E.forwardRef(({className:e,...t},n)=>w.jsxs($i,{ref:n,className:J("relative flex w-full touch-none select-none items-center",e),...t,children:[w.jsx($u,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:w.jsx(Ru,{className:"absolute h-full bg-primary"})}),w.jsx(Vu,{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:n,disabled:r,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 b=>{const f=b[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,n&&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:r||o,className:"w-full"})]})},Hi=({id:e,value:t,required:n,disabled:r,readonly:o,label:i,onChange:a,options:s,schema:c})=>{const l=Number(s.max||c.maximum||5),d=Array.from({length:l},(p,b)=>b+1),u=ve(e,c),h=async p=>{!r&&!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,n&&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",r||o?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:()=>h(p),disabled:r||o,"aria-label":`Rate ${p} out of ${l}`,role:"radio","aria-checked":p===t,children:w.jsx(vu,{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},n)=>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:n,...t}));Ui.displayName="Textarea";function xt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Hu(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e);E.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 Uu="DismissableLayer",Cr="dismissableLayer.update",Yu="dismissableLayer.pointerDownOutside",zu="dismissableLayer.focusOutside",Yi,zi=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sr=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,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({}),b=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,x=l.layersWithOutsidePointerEventsDisabled.size>0,O=y>=g,S=Gu(P=>{const L=P.target,V=[...l.branches].some(U=>U.contains(L));!O||V||(o==null||o(P),a==null||a(P),P.defaultPrevented||s==null||s())},h),F=Xu(P=>{const L=P.target;[...l.branches].some(U=>U.contains(L))||(i==null||i(P),a==null||a(P),P.defaultPrevented||s==null||s())},h);return Hu(P=>{y===l.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},h),E.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Yi=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),qi(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Yi)}},[d,h,n,l]),E.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),qi())},[d,l]),E.useEffect(()=>{const P=()=>p({});return document.addEventListener(Cr,P),()=>document.removeEventListener(Cr,P)},[]),w.jsx(ie.div,{...c,ref:b,style:{pointerEvents:x?O?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,F.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,S.onPointerDownCapture)})});Sr.displayName=Uu;var qu="DismissableLayerBranch",Ku=E.forwardRef((e,t)=>{const n=E.useContext(zi),r=E.useRef(null),o=ue(t,r);return E.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(ie.div,{...e,ref:o})});Ku.displayName=qu;function Gu(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e),r=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){Ki(Yu,n,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);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xu(e,t=globalThis==null?void 0:globalThis.document){const n=xt(e),r=E.useRef(!1);return E.useEffect(()=>{const o=i=>{i.target&&!r.current&&Ki(zu,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qi(){const e=new CustomEvent(Cr);document.dispatchEvent(e)}function Ki(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?iu(o,i):o.dispatchEvent(i)}var Or=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()),Or++,()=>{Or===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Or--}},[])}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 _r="focusScope.autoFocusOnMount",kr="focusScope.autoFocusOnUnmount",Qi={bubbles:!1,cancelable:!0},Qu="FocusScope",Pr=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!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(r){let f=function(x){if(p.paused||!s)return;const O=x.target;s.contains(O)?u.current=O:ut(u.current,{select:!0})},v=function(x){if(p.paused||!s)return;const O=x.relatedTarget;O!==null&&(s.contains(O)||ut(u.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const S of x)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()}}},[r,s,p.paused]),E.useEffect(()=>{if(s){ea.add(p);const f=document.activeElement;if(!s.contains(f)){const g=new CustomEvent(_r,Qi);s.addEventListener(_r,l),s.dispatchEvent(g),g.defaultPrevented||(Zu(rd(Zi(s)),{select:!0}),document.activeElement===f&&ut(s))}return()=>{s.removeEventListener(_r,l),setTimeout(()=>{const g=new CustomEvent(kr,Qi);s.addEventListener(kr,d),s.dispatchEvent(g),g.defaultPrevented||ut(f??document.body,{select:!0}),s.removeEventListener(kr,d),ea.remove(p)},0)}}},[s,l,d,p]);const b=E.useCallback(f=>{if(!n&&!r||p.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,g=document.activeElement;if(v&&g){const y=f.currentTarget,[x,O]=Ju(y);x&&O?!f.shiftKey&&g===O?(f.preventDefault(),n&&ut(x,{select:!0})):f.shiftKey&&g===x&&(f.preventDefault(),n&&ut(O,{select:!0})):g===y&&f.preventDefault()}},[n,r,p.paused]);return w.jsx(ie.div,{tabIndex:-1,...a,ref:h,onKeyDown:b})});Pr.displayName=Qu;function Zu(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ut(r,{select:t}),document.activeElement!==n)return}function Ju(e){const t=Zi(e),n=Ji(t,e),r=Ji(t.reverse(),e);return[n,r]}function Zi(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 Ji(e,t){for(const n of e)if(!ed(n,{upTo:t}))return n}function ed(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 td(e){return e instanceof HTMLInputElement&&"select"in e}function ut(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&td(e)&&t&&e.select()}}var ea=nd();function nd(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ta(e,t),e.unshift(t)},remove(t){var n;e=ta(e,t),(n=e[0])==null||n.resume()}}}function ta(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rd(e){return e.filter(t=>t.tagName!=="A")}var od=E[" useId ".trim().toString()]||(()=>{}),id=0;function Mn(e){const[t,n]=E.useState(od());return Ce(()=>{n(r=>r??String(id++))},[e]),t?`radix-${t}`:""}const ad=["top","right","bottom","left"],dt=Math.min,Pe=Math.max,An=Math.round,Nn=Math.floor,Ve=e=>({x:e,y:e}),sd={left:"right",right:"left",bottom:"top",top:"bottom"},cd={start:"end",end:"start"};function Mr(e,t,n){return Pe(e,dt(t,n))}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 Ar(e){return e==="x"?"y":"x"}function Nr(e){return e==="y"?"height":"width"}function tt(e){return["top","bottom"].includes(et(e))?"y":"x"}function Dr(e){return Ar(tt(e))}function ld(e,t,n){n===void 0&&(n=!1);const r=Ft(e),o=Dr(e),i=Nr(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Dn(a)),[a,Dn(a)]}function ud(e){const t=Dn(e);return[Tr(e),t,Tr(t)]}function Tr(e){return e.replace(/start|end/g,t=>cd[t])}function dd(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function fd(e,t,n,r){const o=Ft(e);let i=dd(et(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Tr)))),i}function Dn(e){return e.replace(/left|right|bottom|top/g,t=>sd[t])}function hd(e){return{top:0,right:0,bottom:0,left:0,...e}}function na(e){return typeof e!="number"?hd(e):{top:e,right:e,bottom:e,left:e}}function Tn(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 ra(e,t,n){let{reference:r,floating:o}=e;const i=tt(t),a=Dr(t),s=Nr(a),c=et(t),l=i==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(c){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Ft(t)){case"start":p[a]-=h*(n&&l?-1:1);break;case"end":p[a]+=h*(n&&l?-1:1);break}return p}const pd=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,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}=ra(l,r,c),h=r,p={},b=0;for(let f=0;f<s.length;f++){const{name:v,fn:g}=s[f],{x:y,y:x,data:O,reset:S}=await g({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});d=y??d,u=x??u,p={...p,[v]:{...p[v],...O}},S&&b<=50&&(b++,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}=ra(l,h,c)),f=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}};async function nn(e,t){var n;t===void 0&&(t={});const{x:r,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),b=na(p),v=s[h?u==="floating"?"reference":"floating":u],g=Tn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),y=u==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),O=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},S=Tn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:x,strategy:c}):y);return{top:(g.top-S.top+b.top)/O.y,bottom:(S.bottom-g.bottom+b.bottom)/O.y,left:(g.left-S.left+b.left)/O.x,right:(S.right-g.right+b.right)/O.x}}const md=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,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=na(d),h={x:n,y:r},p=Dr(o),b=Nr(p),f=await a.getDimensions(l),v=p==="y",g=v?"top":"left",y=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=i.reference[b]+i.reference[p]-h[p]-i.floating[b],S=h[p]-i.reference[p],F=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let P=F?F[x]:0;(!P||!await(a.isElement==null?void 0:a.isElement(F)))&&(P=s.floating[x]||i.floating[b]);const L=O/2-S/2,V=P/2-f[b]/2-1,U=dt(u[g],V),H=dt(u[y],V),B=U,K=P-f[b]-H,ee=P/2-f[b]/2+L,R=Mr(B,ee,K),X=!c.arrow&&Ft(o)!=null&&ee!==R&&i.reference[b]/2-(ee<B?U:H)-f[b]/2<0,Z=X?ee<B?ee-B:ee-K:0;return{[p]:h[p]+Z,data:{[p]:R,centerOffset:ee-R-Z,...X&&{alignmentOffset:Z}},reset:X}}}),gd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;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:b="none",flipAlignment:f=!0,...v}=Je(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=et(o),y=tt(s),x=et(s)===s,O=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=h||(x||!f?[Dn(s)]:ud(s)),F=b!=="none";!h&&F&&S.push(...fd(s,f,b,O));const P=[s,...S],L=await nn(t,v),V=[];let U=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&V.push(L[g]),u){const R=ld(o,a,O);V.push(L[R[0]],L[R[1]])}if(U=[...U,{placement:o,overflows:V}],!V.every(R=>R<=0)){var H,B;const R=(((H=i.flip)==null?void 0:H.index)||0)+1,X=P[R];if(X){var K;const m=u==="alignment"?y!==tt(X):!1,C=((K=U[0])==null?void 0:K.overflows[0])>0;if(!m||C)return{data:{index:R,overflows:U},reset:{placement:X}}}let Z=(B=U.filter(m=>m.overflows[0]<=0).sort((m,C)=>m.overflows[1]-C.overflows[1])[0])==null?void 0:B.placement;if(!Z)switch(p){case"bestFit":{var ee;const m=(ee=U.filter(C=>{if(F){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 ad.some(t=>e[t]>=0)}const vd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Je(e,t);switch(r){case"referenceHidden":{const i=await nn(t,{...o,elementContext:"reference"}),a=oa(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ia(a)}}}case"escaped":{const i=await nn(t,{...o,altBoundary:!0}),a=oa(i,n.floating);return{data:{escapedOffsets:a,escaped:ia(a)}}}default:return{}}}}};async function yd(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=et(n),s=Ft(n),c=tt(n)==="y",l=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,u=Je(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof b=="number"&&(p=s==="end"?b*-1:b),c?{x:p*d,y:h*l}:{x:h*l,y:p*d}}const bd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await yd(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},wd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x:g,y}=v;return{x:g,y}}},...c}=Je(e,t),l={x:n,y:r},d=await nn(t,c),u=tt(et(o)),h=Ar(u);let p=l[h],b=l[u];if(i){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=p+d[v],x=p-d[g];p=Mr(y,p,x)}if(a){const v=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=b+d[v],x=b-d[g];b=Mr(y,b,x)}const f=s.fn({...t,[h]:p,[u]:b});return{...f,data:{x:f.x-n,y:f.y-r,enabled:{[h]:i,[u]:a}}}}}},xd=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Je(e,t),d={x:n,y:r},u=tt(o),h=Ar(u);let p=d[h],b=d[u];const f=Je(s,t),v=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const x=h==="y"?"height":"width",O=i.reference[h]-i.floating[x]+v.mainAxis,S=i.reference[h]+i.reference[x]-v.mainAxis;p<O?p=O:p>S&&(p=S)}if(l){var g,y;const x=h==="y"?"width":"height",O=["top","left"].includes(et(o)),S=i.reference[u]-i.floating[x]+(O&&((g=a.offset)==null?void 0:g[u])||0)+(O?0:v.crossAxis),F=i.reference[u]+i.reference[x]+(O?0:((y=a.offset)==null?void 0:y[u])||0)-(O?v.crossAxis:0);b<S?b=S:b>F&&(b=F)}return{[h]:p,[u]:b}}}},Ed=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=Je(e,t),d=await nn(t,l),u=et(o),h=Ft(o),p=tt(o)==="y",{width:b,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,x=b-d.left-d.right,O=dt(f-d[v],y),S=dt(b-d[g],x),F=!t.middlewareData.shift;let P=O,L=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=y),F&&!h){const U=Pe(d.left,0),H=Pe(d.right,0),B=Pe(d.top,0),K=Pe(d.bottom,0);p?L=b-2*(U!==0||H!==0?U+H:Pe(d.left,d.right)):P=f-2*(B!==0||K!==0?B+K:Pe(d.top,d.bottom))}await c({...t,availableWidth:L,availableHeight:P});const V=await a.getDimensions(s.floating);return b!==V.width||f!==V.height?{reset:{rects:!0}}:{}}}};function Fn(){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 Fn()?e instanceof Node||e instanceof Me(e).Node:!1}function Te(e){return Fn()?e instanceof Element||e instanceof Me(e).Element:!1}function Ue(e){return Fn()?e instanceof HTMLElement||e instanceof Me(e).HTMLElement:!1}function sa(e){return!Fn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Me(e).ShadowRoot}function rn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Cd(e){return["table","td","th"].includes(It(e))}function In(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Fr(e){const t=Ir(),n=Te(e)?Fe(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 Sd(e){let t=ft(e);for(;Ue(t)&&!Wt(t);){if(Fr(t))return t;if(In(t))return null;t=ft(t)}return null}function Ir(){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 Wn(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)&&rn(t)?t:ca(t)}function on(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ca(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Me(o);if(i){const s=Wr(a);return t.concat(a,a.visualViewport||[],rn(o)?o:[],s&&n?on(s):[])}return t.concat(o,on(o,[],n))}function Wr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function la(e){const t=Fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ue(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=An(n)!==i||An(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function jr(e){return Te(e)?e:e.contextElement}function jt(e){const t=jr(e);if(!Ue(t))return Ve(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=la(t);let a=(i?An(n.width):n.width)/r,s=(i?An(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Od=Ve(0);function ua(e){const t=Me(e);return!Ir()||!t.visualViewport?Od:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _d(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Me(e)?!1:t}function Et(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=jr(e);let a=Ve(1);t&&(r?Te(r)&&(a=jt(r)):a=jt(e));const s=_d(i,n,r)?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=r&&Te(r)?Me(r):r;let b=h,f=Wr(b);for(;f&&r&&p!==b;){const v=jt(f),g=f.getBoundingClientRect(),y=Fe(f),x=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+=x,l+=O,b=Me(f),f=Wr(b)}}return Tn({width:d,height:u,x:c,y:l})}function Lr(e,t){const n=Wn(e).scrollLeft;return t?t.left+n:Et(He(e)).left+n}function da(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Lr(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function kd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=He(r),s=t?In(t.floating):!1;if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Ve(1);const d=Ve(0),u=Ue(r);if((u||!u&&!i)&&((It(r)!=="body"||rn(a))&&(c=Wn(r)),Ue(r))){const p=Et(r);l=jt(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=a&&!u&&!i?da(a,c,!0):Ve(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-c.scrollTop*l.y+d.y+h.y}}function Pd(e){return Array.from(e.getClientRects())}function Md(e){const t=He(e),n=Wn(e),r=e.ownerDocument.body,o=Pe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Pe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Lr(e);const s=-n.scrollTop;return Fe(r).direction==="rtl"&&(a+=Pe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Ad(e,t){const n=Me(e),r=He(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const l=Ir();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}function Nd(e,t){const n=Et(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.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=r*i.y;return{width:a,height:s,x:c,y:l}}function fa(e,t,n){let r;if(t==="viewport")r=Ad(e,n);else if(t==="document")r=Md(He(e));else if(Te(t))r=Nd(t,n);else{const o=ua(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Tn(r)}function ha(e,t){const n=ft(e);return n===t||!Te(n)||Wt(n)?!1:Fe(n).position==="fixed"||ha(n,t)}function Dd(e,t){const n=t.get(e);if(n)return n;let r=on(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=Fr(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||rn(a)&&!c&&ha(e,a))?r=r.filter(d=>d!==a):o=s,a=ft(a)}return t.set(e,r),r}function Td(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?In(t)?[]:Dd(t,this._c):[].concat(n),r],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 Fd(e){const{width:t,height:n}=la(e);return{width:t,height:n}}function Id(e,t,n){const r=Ue(t),o=He(t),i=n==="fixed",a=Et(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Ve(0);function l(){c.x=Lr(o)}if(r||!r&&!i)if((It(t)!=="body"||rn(o))&&(s=Wn(t)),r){const p=Et(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&l();i&&!r&&o&&l();const d=o&&!r&&!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 Br(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 n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function ma(e,t){const n=Me(e);if(In(e))return n;if(!Ue(e)){let o=ft(e);for(;o&&!Wt(o);){if(Te(o)&&!Br(o))return o;o=ft(o)}return n}let r=pa(e,t);for(;r&&Cd(r)&&Br(r);)r=pa(r,t);return r&&Wt(r)&&Br(r)&&!Fr(r)?n:r||Sd(e)||n}const Wd=async function(e){const t=this.getOffsetParent||ma,n=this.getDimensions,r=await n(e.floating);return{reference:Id(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jd(e){return Fe(e).direction==="rtl"}const Ld={convertOffsetParentRelativeRectToViewportRelativeRect:kd,getDocumentElement:He,getClippingRect:Td,getOffsetParent:ma,getElementRects:Wd,getClientRects:Pd,getDimensions:Fd,getScale:jt,isElement:Te,isRTL:jd};function ga(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bd(e,t){let n=null,r;const o=He(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=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 b=Nn(u),f=Nn(o.clientWidth-(d+h)),v=Nn(o.clientHeight-(u+p)),g=Nn(d),x={rootMargin:-b+"px "+-f+"px "+-v+"px "+-g+"px",threshold:Pe(0,dt(1,c))||1};let O=!0;function S(F){const P=F[0].intersectionRatio;if(P!==c){if(!O)return a();P?a(!1,P):r=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!ga(l,e.getBoundingClientRect())&&a(),O=!1}try{n=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(e)}return a(!0),i}function $d(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=jr(e),d=o||i?[...l?on(l):[],...on(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const u=l&&s?Bd(l,n):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 x;(x=p)==null||x.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let b,f=c?Et(e):null;c&&v();function v(){const g=Et(e);f&&!ga(f,g)&&n(),f=g,b=requestAnimationFrame(v)}return n(),()=>{var g;d.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),u==null||u(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(b)}}const Rd=bd,Vd=wd,Hd=gd,Ud=Ed,Yd=vd,va=md,zd=xd,qd=(e,t,n)=>{const r=new Map,o={platform:Ld,...n},i={...o.platform,_c:r};return pd(e,t,{...o,platform:i})};var jn=typeof document<"u"?D.useLayoutEffect:D.useEffect;function Ln(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(!Ln(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ln(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 n=ya(e);return Math.round(t*n)/n}function $r(e){const t=E.useRef(e);return jn(()=>{t.current=e}),t}function Kd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,u]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=E.useState(r);Ln(h,r)||p(r);const[b,f]=E.useState(null),[v,g]=E.useState(null),y=E.useCallback(m=>{m!==F.current&&(F.current=m,f(m))},[]),x=E.useCallback(m=>{m!==P.current&&(P.current=m,g(m))},[]),O=i||b,S=a||v,F=E.useRef(null),P=E.useRef(null),L=E.useRef(d),V=c!=null,U=$r(c),H=$r(o),B=$r(l),K=E.useCallback(()=>{if(!F.current||!P.current)return;const m={placement:t,strategy:n,middleware:h};H.current&&(m.platform=H.current),qd(F.current,P.current,m).then(C=>{const _={...C,isPositioned:B.current!==!1};ee.current&&!Ln(L.current,_)&&(L.current=_,Sn.flushSync(()=>{u(_)}))})},[h,t,n,H,B]);jn(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,u(m=>({...m,isPositioned:!1})))},[l]);const ee=E.useRef(!1);jn(()=>(ee.current=!0,()=>{ee.current=!1}),[]),jn(()=>{if(O&&(F.current=O),S&&(P.current=S),O&&S){if(U.current)return U.current(O,S,K);K()}},[O,S,K,U,V]);const R=E.useMemo(()=>({reference:F,floating:P,setReference:y,setFloating:x}),[y,x]),X=E.useMemo(()=>({reference:O,floating:S}),[O,S]),Z=E.useMemo(()=>{const m={position:n,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:n,left:C,top:_}},[n,s,X.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:K,refs:R,elements:X,floatingStyles:Z}),[d,K,R,X,Z])}const Gd=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?va({element:r.current,padding:o}).fn(n):{}:r?va({element:r,padding:o}).fn(n):{}}}},Xd=(e,t)=>({...Rd(e),options:[e,t]}),Qd=(e,t)=>({...Vd(e),options:[e,t]}),Zd=(e,t)=>({...zd(e),options:[e,t]}),Jd=(e,t)=>({...Hd(e),options:[e,t]}),ef=(e,t)=>({...Ud(e),options:[e,t]}),tf=(e,t)=>({...Yd(e),options:[e,t]}),nf=(e,t)=>({...Gd(e),options:[e,t]});var rf="Arrow",wa=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return w.jsx(ie.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});wa.displayName=rf;var of=wa,Rr="Popper",[xa,Bn]=Dt(Rr),[af,Ea]=xa(Rr),Ca=e=>{const{__scopePopper:t,children:n}=e,[r,o]=E.useState(null);return w.jsx(af,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ca.displayName=Rr;var Sa="PopperAnchor",Oa=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Ea(Sa,n),a=E.useRef(null),s=ue(t,a);return E.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.jsx(ie.div,{...o,ref:s})});Oa.displayName=Sa;var Vr="PopperContent",[sf,cf]=xa(Vr),_a=E.forwardRef((e,t)=>{var A,$,ne,q,z,Q;const{__scopePopper:n,side:r="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:b,...f}=e,v=Ea(Vr,n),[g,y]=E.useState(null),x=ue(t,se=>y(se)),[O,S]=E.useState(null),F=yr(O),P=(F==null?void 0:F.width)??0,L=(F==null?void 0:F.height)??0,V=r+(i!=="center"?"-"+i:""),U=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},H=Array.isArray(l)?l:[l],B=H.length>0,K={padding:U,boundary:H.filter(uf),altBoundary:B},{refs:ee,floatingStyles:R,placement:X,isPositioned:Z,middlewareData:m}=Kd({strategy:"fixed",placement:V,whileElementsMounted:(...se)=>$d(...se,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Xd({mainAxis:o+L,alignmentAxis:a}),c&&Qd({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Zd():void 0,...K}),c&&Jd({...K}),ef({...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&&nf({element:O,padding:s}),df({arrowWidth:P,arrowHeight:L}),h&&tf({strategy:"referenceHidden",...K})]}),[C,_]=Ma(X),k=xt(b);Ce(()=>{Z&&(k==null||k())},[Z,k]);const M=(A=m.arrow)==null?void 0:A.x,T=($=m.arrow)==null?void 0:$.y,I=((ne=m.arrow)==null?void 0:ne.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:{...R,transform:Z?R.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(sf,{scope:n,placedSide:C,onArrowChange:S,arrowX:M,arrowY:T,shouldHideArrow:I,children:w.jsx(ie.div,{"data-side":C,"data-align":_,...f,ref:x,style:{...f.style,animation:Z?void 0:"none"}})})})});_a.displayName=Vr;var ka="PopperArrow",lf={top:"bottom",right:"left",bottom:"top",left:"right"},Pa=E.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=cf(ka,r),a=lf[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(of,{...o,ref:n,style:{...o.style,display:"block"}})})});Pa.displayName=ka;function uf(e){return e!==null}var df=e=>({name:"transformOrigin",options:e,fn(t){var v,g,y;const{placement:n,rects:r,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(n),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 b="",f="";return l==="bottom"?(b=a?u:`${h}px`,f=`${-c}px`):l==="top"?(b=a?u:`${h}px`,f=`${r.floating.height+c}px`):l==="right"?(b=`${-c}px`,f=a?u:`${p}px`):l==="left"&&(b=`${r.floating.width+c}px`,f=a?u:`${p}px`),{data:{x:b,y:f}}}});function Ma(e){const[t,n="center"]=e.split("-");return[t,n]}var Aa=Ca,Hr=Oa,Na=_a,Da=Pa,ff="Portal",Ur=E.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=E.useState(!1);Ce(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Uo.createPortal(w.jsx(ie.div,{...r,ref:t}),a):null});Ur.displayName=ff;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"}),hf="VisuallyHidden",pf=E.forwardRef((e,t)=>w.jsx(ie.span,{...e,ref:t,style:{...Ta,...e.style}}));pf.displayName=hf;var mf=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lt=new WeakMap,$n=new WeakMap,Rn={},Yr=0,Fa=function(e){return e&&(e.host||Fa(e.parentNode))},gf=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Fa(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})},vf=function(e,t,n,r){var o=gf(t,Array.isArray(e)?e:[e]);Rn[n]||(Rn[n]=new WeakMap);var i=Rn[n],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(r),b=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&&b&&$n.set(h,!0),v===1&&h.setAttribute(n,"true"),b||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return d(t),s.clear(),Yr++,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||($n.has(u)||u.removeAttribute(r),$n.delete(u)),p||u.removeAttribute(n)}),Yr--,Yr||(Lt=new WeakMap,Lt=new WeakMap,$n=new WeakMap,Rn={})}},Ia=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=mf(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),vf(r,o,n,"aria-hidden")):function(){return null}},Ye=function(){return Ye=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ye.apply(this,arguments)};function Wa(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 yf(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Vn="right-scroll-bar-position",Hn="width-before-scroll-bar",bf="with-scroll-bars-hidden",wf="--removed-body-scroll-bar-size";function zr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xf(e,t){var n=D.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 Ef=typeof window<"u"?E.useLayoutEffect:E.useEffect,ja=new WeakMap;function Cf(e,t){var n=xf(null,function(r){return e.forEach(function(o){return zr(o,r)})});return Ef(function(){var r=ja.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||zr(s,null)}),i.forEach(function(s){o.has(s)||zr(s,a)})}ja.set(n,e)},[e]),n}function Sf(e){return e}function Of(e,t){t===void 0&&(t=Sf);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var c=function(){var d=a;a=[],d.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(d){a.push(d),l()},filter:function(d){return a=a.filter(d),n}}}};return o}function _f(e){e===void 0&&(e={});var t=Of(null);return t.options=Ye({async:!0,ssr:!1},e),t}var La=function(e){var t=e.sideCar,n=Wa(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 E.createElement(r,Ye({},n))};La.isSideCarExport=!0;function kf(e,t){return e.useMedium(t),La}var Ba=_f(),qr=function(){},Un=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:qr,onWheelCapture:qr,onTouchMoveCapture:qr}),o=r[0],i=r[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,b=e.noIsolation,f=e.inert,v=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,x=e.gapMode,O=Wa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,F=Cf([n,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:b,inert:f,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:x}),a?E.cloneElement(E.Children.only(s),Ye(Ye({},P),{ref:F})):E.createElement(y,Ye({},P,{className:c,ref:F}),s))});Un.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Un.classNames={fullWidth:Hn,zeroRight:Vn};var Pf=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Pf();return t&&e.setAttribute("nonce",t),e}function Af(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Nf(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Df=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mf())&&(Af(t,n),Nf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tf=function(){var e=Df();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$a=function(){var e=Tf(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ff={left:0,top:0,right:0,gap:0},Kr=function(e){return parseInt(e||"",10)||0},If=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[Kr(n),Kr(r),Kr(o)]},Wf=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ff;var t=If(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])}},jf=$a(),Bt="data-scroll-locked",Lf=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
62
+ .`.concat(bf,` {
63
+ overflow: hidden `).concat(r,`;
64
+ padding-right: `).concat(s,"px ").concat(r,`;
65
65
  }
66
66
  body[`).concat(Bt,`] {
67
- overflow: hidden `).concat(n,`;
67
+ overflow: hidden `).concat(r,`;
68
68
  overscroll-behavior: contain;
69
- `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
69
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
70
70
  padding-left: `.concat(o,`px;
71
71
  padding-top: `).concat(i,`px;
72
72
  padding-right: `).concat(a,`px;
73
73
  margin-left:0;
74
74
  margin-top:0;
75
- margin-right: `).concat(s,"px ").concat(n,`;
76
- `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),`
75
+ margin-right: `).concat(s,"px ").concat(r,`;
76
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
77
77
  }
78
78
 
79
- .`).concat(Rr,` {
80
- right: `).concat(s,"px ").concat(n,`;
79
+ .`).concat(Vn,` {
80
+ right: `).concat(s,"px ").concat(r,`;
81
81
  }
82
82
 
83
- .`).concat(Vr,` {
84
- margin-right: `).concat(s,"px ").concat(n,`;
83
+ .`).concat(Hn,` {
84
+ margin-right: `).concat(s,"px ").concat(r,`;
85
85
  }
86
86
 
87
- .`).concat(Rr," .").concat(Rr,` {
88
- right: 0 `).concat(n,`;
87
+ .`).concat(Vn," .").concat(Vn,` {
88
+ right: 0 `).concat(r,`;
89
89
  }
90
90
 
91
- .`).concat(Vr," .").concat(Vr,` {
92
- margin-right: 0 `).concat(n,`;
91
+ .`).concat(Hn," .").concat(Hn,` {
92
+ margin-right: 0 `).concat(r,`;
93
93
  }
94
94
 
95
95
  body[`).concat(Bt,`] {
96
- `).concat(bf,": ").concat(s,`px;
96
+ `).concat(wf,": ").concat(s,`px;
97
97
  }
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`
98
+ `)},Ra=function(){var e=parseInt(document.body.getAttribute(Bt)||"0",10);return isFinite(e)?e:0},Bf=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())}},[])},$f=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Bf();var i=E.useMemo(function(){return Wf(o)},[o]);return E.createElement(jf,{styles:Lf(i,!t,o,n?"":"!important")})},Gr=!1;if(typeof window<"u")try{var Yn=Object.defineProperty({},"passive",{get:function(){return Gr=!0,!0}});window.addEventListener("test",Yn,Yn),window.removeEventListener("test",Yn,Yn)}catch{Gr=!1}var $t=Gr?{passive:!1}:!1,Rf=function(e){return e.tagName==="TEXTAREA"},Va=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Rf(e)&&n[t]==="visible")},Vf=function(e){return Va(e,"overflowY")},Hf=function(e){return Va(e,"overflowX")},Ha=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ua(e,r);if(o){var i=Ya(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Uf=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Yf=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ua=function(e,t){return e==="v"?Vf(t):Hf(t)},Ya=function(e,t){return e==="v"?Uf(t):Yf(t)},zf=function(e,t){return e==="h"&&t==="rtl"?-1:1},qf=function(e,t,n,r,o){var i=zf(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,c=t.contains(s),l=!1,d=a>0,u=0,h=0;do{if(!s)break;var p=Ya(e,s),b=p[0],f=p[1],v=p[2],g=f-v-i*b;(b||g)&&Ua(e,s)&&(u+=g,h+=b);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},zn=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},Kf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gf=function(e){return`
99
99
  .block-interactivity-`.concat(e,` {pointer-events: none;}
100
100
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
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:`
101
+ `)},Xf=0,Rt=[];function Qf(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),o=E.useState(Xf++)[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=yf([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=zn(f),y=n.current,x="deltaX"in f?f.deltaX:y[0]-g[0],O="deltaY"in f?f.deltaY:y[1]-g[1],S,F=f.target,P=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in f&&P==="h"&&F.type==="range")return!1;var L=Ha(P,F);if(!L)return!0;if(L?S=P:(S=P==="v"?"h":"v",L=Ha(P,F)),!L)return!1;if(!r.current&&"changedTouches"in f&&(x||O)&&(r.current=S),!S)return!0;var V=r.current||S;return qf(V,v,f,V==="h"?x:O)},[]),c=E.useCallback(function(f){var v=f;if(!(!Rt.length||Rt[Rt.length-1]!==i)){var g="deltaY"in v?za(v):zn(v),y=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Kf(S.delta,g)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var x=(a.current.shards||[]).map(qa).filter(Boolean).filter(function(S){return S.contains(v.target)}),O=x.length>0?s(v,x[0]):!a.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),l=E.useCallback(function(f,v,g,y){var x={name:f,delta:v,target:g,should:y,shadowParent:Zf(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=E.useCallback(function(f){n.current=zn(f),r.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,zn(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,b=e.inert;return E.createElement(E.Fragment,null,b?E.createElement(i,{styles:Gf(o)}):null,p?E.createElement($f,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jf=kf(Ba,Qf);var Xr=E.forwardRef(function(e,t){return E.createElement(Un,Ye({},e,{ref:t,sideCar:Jf}))});Xr.classNames=Un.classNames;var eh=[" ","Enter","ArrowUp","ArrowDown"],th=[" ","Enter"],Ct="Select",[qn,Kn,nh]=Oi(Ct),[Vt,ow]=Dt(Ct,[nh,Bn]),Gn=Bn(),[rh,ht]=Vt(Ct),[oh,ih]=Vt(Ct),Ka=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:u,disabled:h,required:p,form:b}=e,f=Gn(t),[v,g]=E.useState(null),[y,x]=E.useState(null),[O,S]=E.useState(!1),F=Si(l),[P,L]=tn({prop:r,defaultProp:o??!1,onChange:i,caller:Ct}),[V,U]=tn({prop:a,defaultProp:s,onChange:c,caller:Ct}),H=E.useRef(null),B=v?b||!!v.closest("form"):!0,[K,ee]=E.useState(new Set),R=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:x,valueNodeHasChildren:O,onValueNodeHasChildrenChange:S,contentId:Mn(),value:V,onValueChange:U,open:P,onOpenChange:L,dir:F,triggerPointerDownPosRef:H,disabled:h,children:[w.jsx(qn.Provider,{scope:t,children:w.jsx(oh,{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:n})}),B?w.jsxs(ys,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:u,value:V,onChange:X=>U(X.target.value),disabled:h,form:b,children:[V===void 0?w.jsx("option",{value:""}):null,Array.from(K)]},R):null]})})};Ka.displayName=Ct;var Ga="SelectTrigger",Xa=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Gn(n),a=ht(Ga,n),s=a.disabled||r,c=ue(t,a.onTriggerChange),l=Kn(n),d=E.useRef("touch"),[u,h,p]=ws(f=>{const v=l().filter(x=>!x.disabled),g=v.find(x=>x.value===a.value),y=xs(v,f,g);y!==void 0&&a.onValueChange(y.value)}),b=f=>{s||(a.onOpenChange(!0),p()),f&&(a.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return w.jsx(Hr,{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"&&b(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"&&(b(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===" ")&&eh.includes(f.key)&&(b(),f.preventDefault())})})})});Xa.displayName=Ga;var Qa="SelectValue",Za=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,c=ht(Qa,n),{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 ah="SelectIcon",Ja=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return w.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Ja.displayName=ah;var sh="SelectPortal",es=e=>w.jsx(Ur,{asChild:!0,...e});es.displayName=sh;var St="SelectContent",ts=E.forwardRef((e,t)=>{const n=ht(St,e.__scopeSelect),[r,o]=E.useState();if(Ce(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Sn.createPortal(w.jsx(ns,{scope:e.__scopeSelect,children:w.jsx(qn.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),i):null}return w.jsx(rs,{...e,ref:t})});ts.displayName=St;var Ie=10,[ns,pt]=Vt(St),ch="SelectContentImpl",lh=Nt("SelectContent.RemoveScroll"),rs=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:p,sticky:b,hideWhenDetached:f,avoidCollisions:v,...g}=e,y=ht(St,n),[x,O]=E.useState(null),[S,F]=E.useState(null),P=ue(t,A=>O(A)),[L,V]=E.useState(null),[U,H]=E.useState(null),B=Kn(n),[K,ee]=E.useState(!1),R=E.useRef(!1);E.useEffect(()=>{if(x)return Ia(x)},[x]),Gi();const X=E.useCallback(A=>{const[$,...ne]=B().map(Q=>Q.ref.current),[q]=ne.slice(-1),z=document.activeElement;for(const Q of A)if(Q===z||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===$&&S&&(S.scrollTop=0),Q===q&&S&&(S.scrollTop=S.scrollHeight),Q==null||Q.focus(),document.activeElement!==z))return},[B,S]),Z=E.useCallback(()=>X([L,x]),[X,L,x]);E.useEffect(()=>{K&&Z()},[K,Z]);const{onOpenChange:m,triggerPointerDownPosRef:C}=y;E.useEffect(()=>{if(x){let A={x:0,y:0};const $=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))}},ne=q=>{A.x<=10&&A.y<=10?q.preventDefault():x.contains(q.target)||m(!1),document.removeEventListener("pointermove",$),C.current=null};return C.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",ne,{capture:!0})}}},[x,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 $=B().filter(z=>!z.disabled),ne=$.find(z=>z.ref.current===document.activeElement),q=xs($,A,ne);q&&setTimeout(()=>q.ref.current.focus())}),M=E.useCallback((A,$,ne)=>{const q=!R.current&&!ne;(y.value!==void 0&&y.value===$||q)&&(V(A),q&&(R.current=!0))},[y.value]),T=E.useCallback(()=>x==null?void 0:x.focus(),[x]),I=E.useCallback((A,$,ne)=>{const q=!R.current&&!ne;(y.value!==void 0&&y.value===$||q)&&H(A)},[y.value]),j=r==="popper"?Qr:os,W=j===Qr?{side:s,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:p,sticky:b,hideWhenDetached:f,avoidCollisions:v}:{};return w.jsx(ns,{scope:n,content:x,viewport:S,onViewportChange:F,itemRefCallback:M,selectedItem:L,onItemLeave:T,itemTextRefCallback:I,focusSelectedItem:Z,selectedItemText:U,position:r,isPositioned:K,searchRef:_,children:w.jsx(Xr,{as:lh,allowPinchZoom:!0,children:w.jsx(Pr,{asChild:!0,trapped:y.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:oe(o,A=>{var $;($=y.trigger)==null||$.focus({preventScroll:!0}),A.preventDefault()}),children:w.jsx(Sr,{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 $=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!$&&A.key.length===1&&k(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let q=B().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()}})})})})})})});rs.displayName=ch;var uh="SelectItemAlignedPosition",os=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ht(St,n),a=pt(St,n),[s,c]=E.useState(null),[l,d]=E.useState(null),u=ue(t,P=>d(P)),h=Kn(n),p=E.useRef(!1),b=E.useRef(!0),{viewport:f,selectedItem:v,selectedItemText:g,focusSelectedItem:y}=a,x=E.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&l&&f&&v&&g){const P=i.trigger.getBoundingClientRect(),L=l.getBoundingClientRect(),V=i.valueNode.getBoundingClientRect(),U=g.getBoundingClientRect();if(i.dir!=="rtl"){const z=U.left-L.left,Q=V.left-z,se=P.left-Q,Ee=P.width+se,Le=Math.max(Ee,L.width),Ne=window.innerWidth-Ie,Be=kn(Q,[Ie,Math.max(Ie,Ne-Le)]);s.style.minWidth=Ee+"px",s.style.left=Be+"px"}else{const z=L.right-U.right,Q=window.innerWidth-V.right-z,se=window.innerWidth-P.right-Q,Ee=P.width+se,Le=Math.max(Ee,L.width),Ne=window.innerWidth-Ie,Be=kn(Q,[Ie,Math.max(Ie,Ne-Le)]);s.style.minWidth=Ee+"px",s.style.right=Be+"px"}const H=h(),B=window.innerHeight-Ie*2,K=f.scrollHeight,ee=window.getComputedStyle(l),R=parseInt(ee.borderTopWidth,10),X=parseInt(ee.paddingTop,10),Z=parseInt(ee.borderBottomWidth,10),m=parseInt(ee.paddingBottom,10),C=R+X+K+m+Z,_=Math.min(v.offsetHeight*5,C),k=window.getComputedStyle(f),M=parseInt(k.paddingTop,10),T=parseInt(k.paddingBottom,10),I=P.top+P.height/2-Ie,j=B-I,W=v.offsetHeight/2,A=v.offsetTop+W,$=R+X+A,ne=C-$;if($<=I){const z=H.length>0&&v===H[H.length-1].ref.current;s.style.bottom="0px";const Q=l.clientHeight-f.offsetTop-f.offsetHeight,se=Math.max(j,W+(z?T:0)+Q+Z),Ee=$+se;s.style.height=Ee+"px"}else{const z=H.length>0&&v===H[0].ref.current;s.style.top="0px";const se=Math.max(I,R+f.offsetTop+(z?M:0)+W)+ne;s.style.height=se+"px",f.scrollTop=$-I+f.offsetTop}s.style.margin=`${Ie}px 0`,s.style.minHeight=_+"px",s.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,s,l,f,v,g,i.dir,r]);Ce(()=>x(),[x]);const[O,S]=E.useState();Ce(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const F=E.useCallback(P=>{P&&b.current===!0&&(x(),y==null||y(),b.current=!1)},[x,y]);return w.jsx(fh,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:F,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=uh;var dh="SelectPopperPosition",Qr=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ie,...i}=e,a=Gn(n);return w.jsx(Na,{...a,...i,ref:t,align:r,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)"}})});Qr.displayName=dh;var[fh,Zr]=Vt(St,{}),Jr="SelectViewport",is=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=pt(Jr,n),a=Zr(Jr,n),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:r}),w.jsx(qn.Slot,{scope:n,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 b=window.innerHeight-Ie*2,f=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),g=Math.max(f,v);if(g<b){const y=g+p,x=Math.min(b,y),O=y-x;u.style.height=x+"px",u.style.bottom==="0px"&&(d.scrollTop=O>0?O:0,u.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});is.displayName=Jr;var as="SelectGroup",[hh,ph]=Vt(as),mh=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Mn();return w.jsx(hh,{scope:n,id:o,children:w.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});mh.displayName=as;var ss="SelectLabel",cs=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ph(ss,n);return w.jsx(ie.div,{id:o.id,...r,ref:t})});cs.displayName=ss;var Xn="SelectItem",[gh,ls]=Vt(Xn),us=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=ht(Xn,n),c=pt(Xn,n),l=s.value===r,[d,u]=E.useState(i??""),[h,p]=E.useState(!1),b=ue(t,y=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,y,r,o)}),f=Mn(),v=E.useRef("touch"),g=()=>{o||(s.onValueChange(r),s.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 w.jsx(gh,{scope:n,value:r,disabled:o,textId:f,isSelected:l,onItemTextChange:E.useCallback(y=>{u(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:w.jsx(qn.ItemSlot,{scope:n,value:r,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:b,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 x;v.current=y.pointerType,o?(x=c.onItemLeave)==null||x.call(c):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(a.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:oe(a.onKeyDown,y=>{var O;((O=c.searchRef)==null?void 0:O.current)!==""&&y.key===" "||(th.includes(y.key)&&g(),y.key===" "&&y.preventDefault())})})})})});us.displayName=Xn;var an="SelectItemText",ds=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=ht(an,n),s=pt(an,n),c=ls(an,n),l=ih(an,n),[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,b=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(b),()=>v(b)),[f,v,b]),w.jsxs(w.Fragment,{children:[w.jsx(ie.span,{id:c.textId,...i,ref:h}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Sn.createPortal(i.children,a.valueNode):null]})});ds.displayName=an;var fs="SelectItemIndicator",hs=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ls(fs,n).isSelected?w.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});hs.displayName=fs;var eo="SelectScrollUpButton",ps=E.forwardRef((e,t)=>{const n=pt(eo,e.__scopeSelect),r=Zr(eo,e.__scopeSelect),[o,i]=E.useState(!1),a=ue(t,r.onScrollButtonChange);return Ce(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=c.scrollTop>0;i(l)};const c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?w.jsx(gs,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=n;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});ps.displayName=eo;var to="SelectScrollDownButton",ms=E.forwardRef((e,t)=>{const n=pt(to,e.__scopeSelect),r=Zr(to,e.__scopeSelect),[o,i]=E.useState(!1),a=ue(t,r.onScrollButtonChange);return Ce(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;i(d)};const c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?w.jsx(gs,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=n;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});ms.displayName=to;var gs=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=pt("SelectScrollButton",n),a=E.useRef(null),s=Kn(n),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(r,50))}),onPointerMove:oe(o.onPointerMove,()=>{var l;(l=i.onItemLeave)==null||l.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{c()})})}),vh="SelectSeparator",vs=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});vs.displayName=vh;var no="SelectArrow",yh=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Gn(n),i=ht(no,n),a=pt(no,n);return i.open&&a.position==="popper"?w.jsx(Da,{...o,...r,ref:t}):null});yh.displayName=no;var bh="SelectBubbleInput",ys=E.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=E.useRef(null),i=ue(r,o),a=vr(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,{...n,style:{...Ta,...n.style},ref:i,defaultValue:t})});ys.displayName=bh;function bs(e){return e===""||e===void 0}function ws(e){const t=xt(e),n=E.useRef(""),r=E.useRef(0),o=E.useCallback(a=>{const s=n.current+a;t(s),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(s)},[t]),i=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function xs(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=wh(e,Math.max(i,0));o.length===1&&(a=a.filter(l=>l!==n));const c=a.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function wh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xh=Ka,Es=Xa,Eh=Za,Ch=Ja,Sh=es,Cs=ts,Oh=is,Ss=cs,Os=us,_h=ds,kh=hs,_s=ps,ks=ms,Ps=vs;const Ph=xh,Mh=Eh,Ms=E.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(Es,{ref:r,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),...n,children:[t,w.jsx(Ch,{asChild:!0,children:w.jsx(mr,{className:"h-4 w-4 opacity-50"})})]}));Ms.displayName=Es.displayName;const As=E.forwardRef(({className:e,...t},n)=>w.jsx(_s,{ref:n,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},n)=>w.jsx(ks,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(mr,{className:"h-4 w-4"})}));Ns.displayName=ks.displayName;const Ds=E.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>w.jsx(Sh,{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",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:[w.jsx(As,{}),w.jsx(Oh,{className:J("p-1",n==="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 Ah=E.forwardRef(({className:e,...t},n)=>w.jsx(Ss,{ref:n,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ah.displayName=Ss.displayName;const Ts=E.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(Os,{ref:r,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),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(kh,{children:w.jsx(mi,{className:"h-4 w-4"})})}),w.jsx(_h,{children:t})]}));Ts.displayName=Os.displayName;const Nh=E.forwardRef(({className:e,...t},n)=>w.jsx(Ps,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Nh.displayName=Ps.displayName;function Dh(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Qn=e=>{const{present:t,children:n}=e,r=Th(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=ue(r.ref,Fh(o));return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};Qn.displayName="Presence";function Th(e){const[t,n]=E.useState(),r=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),a=e?"mounted":"unmounted",[s,c]=Dh(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const l=Zn(r.current);i.current=s==="mounted"?l:"none"},[s]),Ce(()=>{const l=r.current,d=o.current;if(d!==e){const h=i.current,p=Zn(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=Zn(r.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=Zn(r.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=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Zn(e){return(e==null?void 0:e.animationName)||"none"}function Fh(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 Jn="Checkbox",[Ih,iw]=Dt(Jn),[Wh,ro]=Ih(Jn);function jh(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:c,required:l,value:d="on",internal_do_not_use_render:u}=e,[h,p]=tn({prop:n,defaultProp:o??!1,onChange:c,caller:Jn}),[b,f]=E.useState(null),[v,g]=E.useState(null),y=E.useRef(!1),x=b?!!a||!!b.closest("form"):!0,O={checked:h,disabled:i,setChecked:p,control:b,setControl:f,name:s,form:a,value:d,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:mt(o)?!1:o,isFormControl:x,bubbleInput:v,setBubbleInput:g};return w.jsx(Wh,{scope:t,...O,children:Lh(u)?u(O):r})}var Fs="CheckboxTrigger",Is=E.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:c,required:l,setControl:d,setChecked:u,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:b}=ro(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,...r,ref:f,onKeyDown:oe(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:oe(n,g=>{u(y=>mt(y)?!0:!y),b&&p&&(h.current=g.isPropagationStopped(),h.current||g.stopPropagation())})})});Is.displayName=Fs;var oo=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:c,onCheckedChange:l,form:d,...u}=e;return w.jsx(jh,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:l,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>w.jsxs(w.Fragment,{children:[w.jsx(Is,{...u,ref:t,__scopeCheckbox:n}),h&&w.jsx(Bs,{__scopeCheckbox:n})]})})});oo.displayName=Jn;var Ws="CheckboxIndicator",js=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=ro(Ws,n);return w.jsx(Qn,{present:r||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},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:c,name:l,value:d,form:u,bubbleInput:h,setBubbleInput:p}=ro(Ls,e),b=ue(n,p),f=vr(i),v=yr(r);E.useEffect(()=>{const y=h;if(!y)return;const x=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(x,"checked").set,F=!o.current;if(f!==i&&S){const P=new Event("click",{bubbles:F});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:b,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Bs.displayName=Ls;function Lh(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},n)=>w.jsx(oo,{ref:n,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,Bh=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,n){const r=de(e,n==null?void 0:n.in);return isNaN(t)?we(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Ys(e,t,n){const r=de(e,n==null?void 0:n.in);if(isNaN(t))return we(e,NaN);if(!t)return r;const o=r.getDate(),i=we(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const a=i.getDate();return o>=a?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let $h={};function sn(){return $h}function Ht(e,t){var s,c,l,d;const n=sn(),r=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(l=n.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<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function cn(e,t){return Ht(e,{...t,weekStartsOn:1})}function zs(e,t){const n=de(e,t==null?void 0:t.in),r=n.getFullYear(),o=we(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=cn(o),a=we(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=cn(a);return n.getTime()>=i.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function qs(e){const t=de(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 Ut(e,...t){const n=we.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ln(e,t){const n=de(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Ks(e,t,n){const[r,o]=Ut(n==null?void 0:n.in,e,t),i=ln(r),a=ln(o),s=+i-qs(i),c=+a-qs(a);return Math.round((s-c)/Bh)}function Rh(e,t){const n=zs(e,t),r=we(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),cn(r)}function Vh(e,t,n){return Us(e,t*7,n)}function Hh(e,t,n){return Ys(e,t*12,n)}function Uh(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=we.bind(null,o));const i=de(o,r);(!n||n<i||isNaN(+i))&&(n=i)}),we(r,n||NaN)}function Yh(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=we.bind(null,o));const i=de(o,r);(!n||n>i||isNaN(+i))&&(n=i)}),we(r,n||NaN)}function zh(e,t,n){const[r,o]=Ut(n==null?void 0:n.in,e,t);return+ln(r)==+ln(o)}function Gs(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qh(e){return!(!Gs(e)&&typeof e!="number"||isNaN(+de(e)))}function Kh(e,t,n){const[r,o]=Ut(n==null?void 0:n.in,e,t),i=r.getFullYear()-o.getFullYear(),a=r.getMonth()-o.getMonth();return i*12+a}function Gh(e,t){const n=de(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 Xh(e,t){const[n,r]=Ut(e,t.start,t.end);return{start:n,end:r}}function Qh(e,t){const{start:n,end:r}=Xh(t==null?void 0:t.in,e);let o=+n>+r;const i=o?+n:+r,a=o?r:n;a.setHours(0,0,0,0),a.setDate(1);let s=1;const c=[];for(;+a<=i;)c.push(we(n,a)),a.setMonth(a.getMonth()+s);return o?c.reverse():c}function Zh(e,t){const n=de(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Jh(e,t){const n=de(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 Xs(e,t){const n=de(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Qs(e,t){var s,c,l,d;const n=sn(),r=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(l=n.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<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function ep(e,t){return Qs(e,{...t,weekStartsOn:1})}const tp={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"}},np=(e,t,n)=>{let r;const o=tp[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 io(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rp={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},op={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ip={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ap={date:io({formats:rp,defaultWidth:"full"}),time:io({formats:op,defaultWidth:"full"}),dateTime:io({formats:ip,defaultWidth:"full"})},sp={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},cp=(e,t,n,r)=>sp[e];function un(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const lp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},up={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dp={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"]},fp={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"]},hp={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"}},pp={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"}},mp={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:un({values:lp,defaultWidth:"wide"}),quarter:un({values:up,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:dp,defaultWidth:"wide"}),day:un({values:fp,defaultWidth:"wide"}),dayPeriod:un({values:hp,defaultWidth:"wide",formattingValues:pp,defaultFormattingWidth:"wide"})};function dn(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?vp(s,u=>u.test(a)):gp(s,u=>u.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const d=t.slice(a.length);return{value:l,rest:d}}}function gp(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vp(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function yp(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const bp=/^(\d+)(th|st|nd|rd)?/i,wp=/\d+/i,xp={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},Ep={any:[/^b/i,/^(a|c)/i]},Cp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sp={any:[/1/i,/2/i,/3/i,/4/i]},Op={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},_p={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]},kp={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},Pp={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]},Mp={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},Ap={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}},Np={ordinalNumber:yp({matchPattern:bp,parsePattern:wp,valueCallback:e=>parseInt(e,10)}),era:dn({matchPatterns:xp,defaultMatchWidth:"wide",parsePatterns:Ep,defaultParseWidth:"any"}),quarter:dn({matchPatterns:Cp,defaultMatchWidth:"wide",parsePatterns:Sp,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:Op,defaultMatchWidth:"wide",parsePatterns:_p,defaultParseWidth:"any"}),day:dn({matchPatterns:kp,defaultMatchWidth:"wide",parsePatterns:Pp,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:Mp,defaultMatchWidth:"any",parsePatterns:Ap,defaultParseWidth:"any"})},ao={code:"en-US",formatDistance:np,formatLong:ap,formatRelative:cp,localize:mp,match:Np,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Dp(e,t){const n=de(e,t==null?void 0:t.in);return Ks(n,Xs(n))+1}function Zs(e,t){const n=de(e,t==null?void 0:t.in),r=+cn(n)-+Rh(n);return Math.round(r/Vs)+1}function Js(e,t){var d,u,h,p;const n=de(e,t==null?void 0:t.in),r=n.getFullYear(),o=sn(),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(r+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(r,0,i),c.setHours(0,0,0,0);const l=Ht(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Tp(e,t){var s,c,l,d;const n=sn(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(l=n.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,r),i.setHours(0,0,0,0),Ht(i,t)}function ec(e,t){const n=de(e,t==null?void 0:t.in),r=+Ht(n,t)-+Tp(n,t);return Math.round(r/Vs)+1}function ce(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const gt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ce(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ce(n+1,2)},d(e,t){return ce(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 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 n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return ce(o,t.length)}},Yt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tc={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 gt.y(e,t)},Y:function(e,t,n,r){const o=Js(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return ce(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ce(i,t.length)},R:function(e,t){const n=zs(e);return ce(n,t.length)},u:function(e,t){const n=e.getFullYear();return ce(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 ce(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 ce(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 gt.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 ce(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=ec(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):ce(o,t.length)},I:function(e,t,n){const r=Zs(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ce(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):gt.d(e,t)},D:function(e,t,n){const r=Dp(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ce(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(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ce(i,2);case"eo":return n.ordinalNumber(i,{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(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ce(i,t.length);case"co":return n.ordinalNumber(i,{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 ce(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=Yt.noon:r===0?o=Yt.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=Yt.evening:r>=12?o=Yt.afternoon:r>=4?o=Yt.morning:o=Yt.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 gt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):gt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ce(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ce(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):gt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):gt.s(e,t)},S:function(e,t){return gt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rc(r);case"XXXX":case"XX":return Ot(r);case"XXXXX":case"XXX":default:return Ot(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rc(r);case"xxxx":case"xx":return Ot(r);case"xxxxx":case"xxx":default:return Ot(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nc(r,":");case"OOOO":default:return"GMT"+Ot(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nc(r,":");case"zzzz":default:return"GMT"+Ot(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ce(r,t.length)},T:function(e,t,n){return ce(+e,t.length)}};function nc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+ce(i,2)}function rc(e,t){return e%60===0?(e>0?"-":"+")+ce(Math.abs(e)/60,2):Ot(e,t)}function Ot(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=ce(Math.trunc(r/60),2),i=ce(r%60,2);return n+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"})}},Fp={p:ic,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return oc(e,t);let i;switch(r){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(r,t)).replace("{{time}}",ic(o,t))}},Ip=/^D+$/,Wp=/^Y+$/,jp=["D","DD","YY","YYYY"];function Lp(e){return Ip.test(e)}function Bp(e){return Wp.test(e)}function $p(e,t,n){const r=Rp(e,t,n);if(console.warn(r),jp.includes(e))throw new RangeError(r)}function Rp(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 Vp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Hp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Up=/^'([^]*?)'?$/,Yp=/''/g,zp=/[a-zA-Z]/;function so(e,t,n){var d,u,h,p,b,f,v,g;const r=sn(),o=(n==null?void 0:n.locale)??r.locale??ao,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((f=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:f.weekStartsOn)??r.weekStartsOn??((g=(v=r.locale)==null?void 0:v.options)==null?void 0:g.weekStartsOn)??0,s=de(e,n==null?void 0:n.in);if(!qh(s))throw new RangeError("Invalid time value");let c=t.match(Hp).map(y=>{const x=y[0];if(x==="p"||x==="P"){const O=Fp[x];return O(y,o.formatLong)}return y}).join("").match(Vp).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:qp(y)};if(tc[x])return{isToken:!0,value:y};if(x.match(zp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");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 x=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Bp(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Lp(x))&&$p(x,t,String(e));const O=tc[x[0]];return O(s,x,o.localize,l)}).join("")}function qp(e){const t=e.match(Up);return t?t[1].replace(Yp,"'"):e}function Kp(e,t){const n=de(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),i=we(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function Gp(e,t){return de(e,t==null?void 0:t.in).getMonth()}function Xp(e,t){return de(e,t==null?void 0:t.in).getFullYear()}function Qp(e,t){return+de(e)>+de(t)}function Zp(e,t){return+de(e)<+de(t)}function Jp(e,t,n){const[r,o]=Ut(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function em(e,t,n){const[r,o]=Ut(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function tm(e,t,n){const r=de(e,n==null?void 0:n.in),o=r.getFullYear(),i=r.getDate(),a=we(e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const s=Kp(a);return r.setMonth(t,Math.min(i,s)),r}function nm(e,t,n){const r=de(e,n==null?void 0:n.in);return isNaN(+r)?we(e,NaN):(r.setFullYear(t),r)}const co={},fn={};function hn(e,t){try{const r=(co[e]||(co[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in fn?fn[r]:ac(r,r.split(":"))}catch{if(e in fn)return fn[e];const n=e==null?void 0:e.match(rm);return n?ac(e,n.slice(1)):NaN}}const rm=/([+-]\d\d):?(\d\d)?/;function ac(e,t){const n=+t[0],r=+(t[1]||0);return fn[e]=n>0?n*60+r:n*60-r}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(hn(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,...n){return n.length?new ze(...n,t):new ze(Date.now(),t)}withTimeZone(t){return new ze(+this,t)}getTimezoneOffset(){return-hn(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),om(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 om(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=hn(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=-new Date(+n).getTimezoneOffset(),i=r-o,a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const c=hn(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=hn(e.timeZone,e),b=c-p;b&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+b),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b))}}class Se extends ze{static tz(t,...n){return n.length?new Se(...n,t):new Se(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} (${im(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 Se(+this,t)}[Symbol.for("constructDateFrom")](t){return new Se(+new Date(t),this.timeZone)}}function im(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,am=4;function sm(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),i=t.addDays(o,lc*7-1);return t.getMonth(e)===t.getMonth(i)?lc:am}function uc(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 cm(e,t){const n=uc(e,t),r=sm(e,t);return t.addDays(n,r*7-1)}class nt{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Se.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,i)=>{var a;return(a=this.overrides)!=null&&a.newDate?this.overrides.newDate(r,o,i):this.options.timeZone?new Se(r,o,i,this.options.timeZone):new Date(r,o,i)},this.addDays=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,o):Us(r,o)},this.addMonths=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,o):Ys(r,o)},this.addWeeks=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,o):Vh(r,o)},this.addYears=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,o):Hh(r,o)},this.differenceInCalendarDays=(r,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):Ks(r,o)},this.differenceInCalendarMonths=(r,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):Kh(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Qh(r)},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):cm(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):ep(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):Gh(r)},this.endOfWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,o):Qs(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):Jh(r)},this.format=(r,o,i)=>{var s;const a=(s=this.overrides)!=null&&s.format?this.overrides.format(r,o,this.options):so(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):Zs(r)},this.getMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):Gp(r,this.options)},this.getYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):Xp(r,this.options)},this.getWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):ec(r,this.options)},this.isAfter=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,o):Qp(r,o)},this.isBefore=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,o):Zp(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Gs(r)},this.isSameDay=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,o):zh(r,o)},this.isSameMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,o):Jp(r,o)},this.isSameYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,o):em(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):Uh(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):Yh(r)},this.setMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,o):tm(r,o)},this.setYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,o):nm(r,o)},this.startOfBroadcastWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):uc(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):ln(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):cn(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):Zh(r)},this.startOfWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Ht(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):Xs(r)},this.options={locale:ao,...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 qe=new nt;class dc{constructor(t,n,r=qe){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 lm{constructor(t,n){this.date=t,this.weeks=n}}class um{constructor(t,n){this.days=n,this.weekNumber=t}}function rt(e,t,n=!1,r=qe){let{from:o,to:i}=e;const{differenceInCalendarDays:a,isSameDay:s}=r;return o&&i?(a(i,o)<0&&([o,i]=[i,o]),a(t,o)>=(n?1:0)&&a(i,t)>=(n?1:0)):!n&&i?s(i,t):!n&&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,n=qe){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:a}=n;return r.some(s=>{if(typeof s=="boolean")return s;if(n.isDate(s))return o(e,s);if(gc(s,n))return s.includes(e);if(uo(s))return rt(s,e,!1,n);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 dm(e,t,n){const{disabled:r,hidden:o,modifiers:i,showOutsideDays:a,broadcastCalendar:s,today:c}=t,{isSameDay:l,isSameMonth:d,startOfMonth:u,isBefore:h,endOfMonth:p,isAfter:b}=n,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 x of e){const{date:O,displayMonth:S}=x,F=!!(S&&!d(O,S)),P=!!(f&&h(O,f)),L=!!(v&&b(O,v)),V=!!(r&&ot(O,r,n)),U=!!(o&&ot(O,o,n))||P||L||!s&&!a&&F||s&&a===!1&&F,H=l(O,c??n.today());F&&g.outside.push(x),V&&g.disabled.push(x),U&&g.hidden.push(x),H&&g.today.push(x),i&&Object.keys(i).forEach(B=>{const K=i==null?void 0:i[B];K&&ot(O,K,n)&&(y[B]?y[B].push(x):y[B]=[x])})}return x=>{const O={[ge.focused]:!1,[ge.disabled]:!1,[ge.hidden]:!1,[ge.outside]:!1,[ge.today]:!1},S={};for(const F in g){const P=g[F];O[F]=P.some(L=>L===x)}for(const F in y)S[F]=y[F].some(P=>P===x);return{...O,...S}}}function fm(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[i])=>(n[i]?o.push(n[i]):t[ge[i]]?o.push(t[ge[i]]):t[We[i]]&&o.push(t[We[i]]),o),[t[G.Day]])}function hm(e){return D.createElement("button",{...e})}function pm(e){return D.createElement("span",{...e})}function mm(e){const{size:t=24,orientation:n="left",className:r}=e;return D.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&D.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&D.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&D.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&D.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function gm(e){const{day:t,modifiers:n,...r}=e;return D.createElement("td",{...r})}function vm(e){const{day:t,modifiers:n,...r}=e,o=D.useRef(null);return D.useEffect(()=>{var i;n.focused&&((i=o.current)==null||i.focus())},[n.focused]),D.createElement("button",{ref:o,...r})}function ym(e){const{options:t,className:n,components:r,classNames:o,...i}=e,a=[o[G.Dropdown],n].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(r.Select,{className:a,...i},t==null?void 0:t.map(({value:c,label:l,disabled:d})=>D.createElement(r.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(r.Chevron,{orientation:"down",size:18,className:o[G.Chevron]})))}function bm(e){return D.createElement("div",{...e})}function wm(e){return D.createElement("div",{...e})}function xm(e){const{calendarMonth:t,displayIndex:n,...r}=e;return D.createElement("div",{...r},e.children)}function Em(e){const{calendarMonth:t,displayIndex:n,...r}=e;return D.createElement("div",{...r})}function Cm(e){return D.createElement("table",{...e})}function Sm(e){return D.createElement("div",{...e})}const vc=D.createContext(void 0);function pn(){const e=D.useContext(vc);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function Om(e){const{components:t}=pn();return D.createElement(t.Dropdown,{...e})}function _m(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...i}=e,{components:a,classNames:s,labels:{labelPrevious:c,labelNext:l}}=pn(),d=D.useCallback(h=>{o&&(n==null||n(h))},[o,n]),u=D.useCallback(h=>{r&&(t==null||t(h))},[r,t]);return D.createElement("nav",{...i},D.createElement(a.PreviousMonthButton,{type:"button",className:s[G.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},D.createElement(a.Chevron,{disabled:r?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 km(e){const{components:t}=pn();return D.createElement(t.Button,{...e})}function Pm(e){return D.createElement("option",{...e})}function Mm(e){const{components:t}=pn();return D.createElement(t.Button,{...e})}function Am(e){const{rootRef:t,...n}=e;return D.createElement("div",{...n,ref:t})}function Nm(e){return D.createElement("select",{...e})}function Dm(e){const{week:t,...n}=e;return D.createElement("tr",{...n})}function Tm(e){return D.createElement("th",{...e})}function Fm(e){return D.createElement("thead",{"aria-hidden":!0},D.createElement("tr",{...e}))}function Im(e){const{week:t,...n}=e;return D.createElement("th",{...n})}function Wm(e){return D.createElement("th",{...e})}function jm(e){return D.createElement("tbody",{...e})}function Lm(e){const{components:t}=pn();return D.createElement(t.Dropdown,{...e})}const Bm=Object.freeze(Object.defineProperty({__proto__:null,Button:hm,CaptionLabel:pm,Chevron:mm,Day:gm,DayButton:vm,Dropdown:ym,DropdownNav:bm,Footer:wm,Month:xm,MonthCaption:Em,MonthGrid:Cm,Months:Sm,MonthsDropdown:Om,Nav:_m,NextMonthButton:km,Option:Pm,PreviousMonthButton:Mm,Root:Am,Select:Nm,Week:Dm,WeekNumber:Im,WeekNumberHeader:Wm,Weekday:Tm,Weekdays:Fm,Weeks:jm,YearsDropdown:Lm},Symbol.toStringTag,{value:"Module"}));function $m(e){return{...Bm,...e}}function Rm(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 Vm(){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,n){return(n??new nt(t)).format(e,"LLLL y")}const Hm=yc;function Um(e,t,n){return(n??new nt(t)).format(e,"d")}function Ym(e,t=qe){return t.format(e,"LLLL")}function zm(e,t=qe){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function qm(){return""}function Km(e,t,n){return(n??new nt(t)).format(e,"cccccc")}function bc(e,t=qe){return t.format(e,"yyyy")}const Gm=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:yc,formatDay:Um,formatMonthCaption:Hm,formatMonthDropdown:Ym,formatWeekNumber:zm,formatWeekNumberHeader:qm,formatWeekdayName:Km,formatYearCaption:bc,formatYearDropdown:bc},Symbol.toStringTag,{value:"Module"}));function Xm(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Gm,...e}}function Qm(e,t,n,r,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=r.formatMonthDropdown(h,o),b=l(h),f=t&&h<i(t)||n&&h>i(n)||!1;return{value:b,label:p,disabled:f}})}function Zm(e,t={},n={}){let r={...t==null?void 0:t[G.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function Jm(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let a=0;a<7;a++){const s=e.addDays(o,a);i.push(s)}return i}function eg(e,t,n,r){if(!e||!t)return;const{startOfYear:o,endOfYear:i,addYears:a,getYear:s,isBefore:c,isSameYear:l}=r,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(b=>{const f=n.formatYearDropdown(b,r);return{value:s(b),label:f,disabled:!1}})}function wc(e,t,n){return(n??new nt(t)).format(e,"LLLL y")}const tg=wc;function ng(e,t,n,r){let o=(r??new nt(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function xc(e,t,n,r){let o=(r??new nt(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const rg=xc;function og(){return""}function ig(e){return"Choose the Month"}function ag(e){return"Go to the Next Month"}function sg(e){return"Go to the Previous Month"}function cg(e,t,n){return(n??new nt(t)).format(e,"cccc")}function lg(e,t){return`Week ${e}`}function ug(e){return"Week Number"}function dg(e){return"Choose the Year"}const fg=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:tg,labelDay:rg,labelDayButton:xc,labelGrid:wc,labelGridcell:ng,labelMonthDropdown:ig,labelNav:og,labelNext:ag,labelPrevious:sg,labelWeekNumber:lg,labelWeekNumberHeader:ug,labelWeekday:cg,labelYearDropdown:dg},Symbol.toStringTag,{value:"Module"})),mn=e=>e instanceof HTMLElement?e:null,fo=e=>[...e.querySelectorAll("[data-animated-month]")??[]],hg=e=>mn(e.querySelector("[data-animated-month]")),ho=e=>mn(e.querySelector("[data-animated-caption]")),po=e=>mn(e.querySelector("[data-animated-weeks]")),pg=e=>mn(e.querySelector("[data-animated-nav]")),mg=e=>mn(e.querySelector("[data-animated-weekdays]"));function gg(e,t,{classNames:n,months:r,focused:o,dateLib:i}){const a=D.useRef(null),s=D.useRef(r),c=D.useRef(!1);D.useLayoutEffect(()=>{const l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const d=i.isSameMonth(r[0].date,l[0].date),u=i.isAfter(r[0].date,l[0].date),h=u?n[Ae.caption_after_enter]:n[Ae.caption_before_enter],p=u?n[Ae.weeks_after_enter]:n[Ae.weeks_before_enter],b=a.current,f=e.current.cloneNode(!0);if(f instanceof HTMLElement?(fo(f).forEach(x=>{if(!(x instanceof HTMLElement))return;const O=hg(x);O&&x.contains(O)&&x.removeChild(O);const S=ho(x);S&&S.classList.remove(h);const F=po(x);F&&F.classList.remove(p)}),a.current=f):a.current=null,c.current||d||o)return;const v=b instanceof HTMLElement?fo(b):[],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=pg(e.current);y&&(y.style.zIndex="1"),g.forEach((x,O)=>{const S=v[O];if(!S)return;x.style.position="relative",x.style.overflow="hidden";const F=ho(x);F&&F.classList.add(h);const P=po(x);P&&P.classList.add(p);const L=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),F&&F.classList.remove(h),P&&P.classList.remove(p),x.style.position="",x.style.overflow="",x.contains(S)&&x.removeChild(S)};S.style.pointerEvents="none",S.style.position="absolute",S.style.overflow="hidden",S.setAttribute("aria-hidden","true");const V=mg(S);V&&(V.style.opacity="0");const U=ho(S);U&&(U.classList.add(u?n[Ae.caption_before_exit]:n[Ae.caption_after_exit]),U.addEventListener("animationend",L));const H=po(S);H&&H.classList.add(u?n[Ae.weeks_before_exit]:n[Ae.weeks_after_exit]),x.insertBefore(S,x.firstChild)})}})}function vg(e,t,n,r){const o=e[0],i=e[e.length-1],{ISOWeek:a,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:h,endOfISOWeek:p,endOfMonth:b,endOfWeek:f,isAfter:v,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:x}=r,O=c?g(o,r):a?y(o):x(o),S=c?h(i):a?p(b(i)):f(b(i)),F=d(S,O),P=u(i,o)+1,L=[];for(let H=0;H<=F;H++){const B=l(O,H);if(t&&v(B,t))break;L.push(B)}const U=(c?35:42)*P;if(s&&L.length<U){const H=U-L.length;for(let B=0;B<H;B++){const K=l(L[L.length-1],1);L.push(K)}}return L}function yg(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((i,a)=>[...i,...a.days],t);return[...n,...o]},t)}function bg(e,t,n,r){const{numberOfMonths:o=1}=n,i=[];for(let a=0;a<o;a++){const s=r.addMonths(e,a);if(t&&s>t)break;i.push(s)}return i}function Ec(e,t){const{month:n,defaultMonth:r,today:o=t.today(),numberOfMonths:i=1,endMonth:a,startMonth:s}=e;let c=n||r||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 wg(e,t,n,r){const{addDays:o,endOfBroadcastWeek:i,endOfISOWeek:a,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:h,startOfWeek:p}=r,b=e.reduce((f,v)=>{const g=n.broadcastCalendar?u(v,r):n.ISOWeek?h(v):p(v),y=n.broadcastCalendar?i(v):n.ISOWeek?a(s(v)):c(s(v)),x=t.filter(P=>P>=g&&P<=y),O=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<O){const P=t.filter(L=>{const V=O-x.length;return L>y&&L<=o(y,V)});x.push(...P)}const S=x.reduce((P,L)=>{const V=n.ISOWeek?l(L):d(L),U=P.find(B=>B.weekNumber===V),H=new dc(L,v,r);return U?U.days.push(H):P.push(new um(V,[H])),P},[]),F=new lm(v,S);return f.push(F),f},[]);return n.reverseMonths?b.reverse():b}function xg(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:i,startOfMonth:a,endOfMonth:s,addYears:c,endOfYear:l,newDate:d,today:u}=t,{fromYear:h,toYear:p,fromMonth:b,toMonth:f}=e;!n&&b&&(n=b),!n&&h&&(n=t.newDate(h,0,1)),!r&&f&&(r=f),!r&&p&&(r=d(p,11,31));const v=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=a(n):h?n=d(h,0,1):!n&&v&&(n=o(c(e.today??u(),-100))),r?r=s(r):p?r=d(p,11,31):!r&&v&&(r=l(e.today??u())),[n&&i(n),r&&i(r)]}function Eg(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:s,differenceInCalendarMonths:c}=r,l=o?i:1,d=a(e);if(!t)return s(d,l);if(!(c(t,e)<i))return s(d,l)}function Cg(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i}=n,{startOfMonth:a,addMonths:s,differenceInCalendarMonths:c}=r,l=o?i??1:1,d=a(e);if(!t)return s(d,-l);if(!(c(d,t)<=0))return s(d,-l)}function Sg(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function er(e,t){const[n,r]=D.useState(e);return[t===void 0?n:t,r]}function Og(e,t){const[n,r]=xg(e,t),{startOfMonth:o,endOfMonth:i}=t,a=Ec(e,t),[s,c]=er(a,e.month?a:void 0);D.useEffect(()=>{const F=Ec(e,t);c(F)},[e.timeZone]);const l=bg(s,r,e,t),d=vg(l,e.endMonth?i(e.endMonth):void 0,e,t),u=wg(l,d,e,t),h=Sg(u),p=yg(u),b=Cg(s,n,e,t),f=Eg(s,r,e,t),{disableNavigation:v,onMonthChange:g}=e,y=F=>h.some(P=>P.days.some(L=>L.isEqualTo(F))),x=F=>{if(v)return;let P=o(F);n&&P<o(n)&&(P=o(n)),r&&P>o(r)&&(P=o(r)),c(P),g==null||g(P)};return{months:u,weeks:h,days:p,navStart:n,navEnd:r,previousMonth:b,nextMonth:f,goToMonth:x,goToDay:F=>{y(F)||x(F.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 _g(e,t,n,r){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):r!=null&&r.isEqualTo(a)&&i<Ke.LastFocused?(o=a,i=Ke.LastFocused):n(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 kg(e,t,n,r,o,i,a){const{ISOWeek:s,broadcastCalendar:c}=i,{addDays:l,addMonths:d,addWeeks:u,addYears:h,endOfBroadcastWeek:p,endOfISOWeek:b,endOfWeek:f,max:v,min:g,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:O}=a;let F={day:l,week:u,month:d,year:h,startOfWeek:P=>c?y(P,a):s?x(P):O(P),endOfWeek:P=>c?p(P):s?b(P):f(P)}[e](n,t==="after"?1:-1);return t==="before"&&r?F=v([r,F]):t==="after"&&o&&(F=g([o,F])),F}function Sc(e,t,n,r,o,i,a,s=0){if(s>365)return;const c=kg(e,t,n.date,r,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,r,o,i,a,s+1)}function Pg(e,t,n,r,o){const{autoFocus:i}=e,[a,s]=D.useState(),c=_g(t.days,n,r||(()=>!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 Mg(e,t){const{selected:n,required:r,onSelect:o}=e,[i,a]=er(n,o?n:void 0),s=o?n:i,{isSameDay:c}=t,l=p=>(s==null?void 0:s.some(b=>c(b,p)))??!1,{min:d,max:u}=e;return{selected:s,select:(p,b,f)=>{let v=[...s??[]];if(l(p)){if((s==null?void 0:s.length)===d||r&&(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,b,f),v},isSelected:l}}function Ag(e,t,n=0,r=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:n>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:n>0?void 0:e};else if(c(s,e))u={from:e,to:n>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);r>0&&h>r?u={from:e,to:void 0}:n>1&&h<n&&(u={from:e,to:void 0})}return u}function Ng(e,t,n=qe){const r=Array.isArray(t)?t:[t];let o=e.from;const i=n.differenceInCalendarDays(e.to,e.from),a=Math.min(i,6);for(let s=0;s<=a;s++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function Oc(e,t,n=qe){return rt(e,t.from,!1,n)||rt(e,t.to,!1,n)||rt(t,e.from,!1,n)||rt(t,e.to,!1,n)}function Dg(e,t,n=qe){const r=Array.isArray(t)?t:[t];if(r.filter(s=>typeof s!="function").some(s=>typeof s=="boolean"?s:n.isDate(s)?rt(e,s,!1,n):gc(s,n)?s.some(c=>rt(e,c,!1,n)):uo(s)?s.from&&s.to?Oc(e,{from:s.from,to:s.to},n):!1:mc(s)?Ng(e,s.dayOfWeek,n):fc(s)?n.isAfter(s.before,s.after)?Oc(e,{from:n.addDays(s.after,1),to:n.addDays(s.before,-1)},n):ot(e.from,s,n)||ot(e.to,s,n):hc(s)||pc(s)?ot(e.from,s,n)||ot(e.to,s,n):!1))return!0;const a=r.filter(s=>typeof s=="function");if(a.length){let s=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(a.some(d=>d(s)))return!0;s=n.addDays(s,1)}}return!1}function Tg(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:i,onSelect:a}=e,[s,c]=er(o,a?o:void 0),l=a?o:s;return{selected:l,select:(h,p,b)=>{const{min:f,max:v}=e,g=h?Ag(h,l,f,v,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&Dg({from:g.from,to:g.to},n,t)&&(g.from=h,g.to=void 0),a||c(g),a==null||a(g,h,p,b),g},isSelected:h=>l&&rt(l,h,!1,t)}}function Fg(e,t){const{selected:n,required:r,onSelect:o}=e,[i,a]=er(n,o?n:void 0),s=o?n:i,{isSameDay:c}=t;return{selected:s,select:(u,h,p)=>{let b=u;return!r&&s&&s&&c(u,s)&&(b=void 0),o||a(b),o==null||o(b,u,h,p),b},isSelected:u=>s?c(s,u):!1}}function Ig(e,t){const n=Fg(e,t),r=Mg(e,t),o=Tg(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function Wg(e){var yl;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=(yl=t.selected)==null?void 0:yl.map(re=>new Se(re,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:n,formatters:r,labels:o,dateLib:i,locale:a,classNames:s}=D.useMemo(()=>{const re={...ao,...t.locale};return{dateLib:new nt({locale:re,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:$m(t.components),formatters:Xm(t.formatters),labels:{...fg,...t.labels},locale:re,classNames:{...Vm(),...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:b,onDayKeyDown:f,onDayMouseEnter:v,onDayMouseLeave:g,onNextClick:y,onPrevClick:x,showWeekNumber:O,styles:S}=t,{formatCaption:F,formatDay:P,formatMonthDropdown:L,formatWeekNumber:V,formatWeekNumberHeader:U,formatWeekdayName:H,formatYearDropdown:B}=r,K=Og(t,i),{days:ee,months:R,navStart:X,navEnd:Z,previousMonth:m,nextMonth:C,goToMonth:_}=K,k=dm(ee,t,i),{isSelected:M,select:T,selected:I}=Ig(t,i)??{},{blur:j,focused:W,isFocusTarget:A,moveFocus:$,setFocused:ne}=Pg(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:jb}=o,Lb=D.useMemo(()=>Jm(i,t.ISOWeek),[i,t.ISOWeek]),gl=l!==void 0||p!==void 0,$o=D.useCallback(()=>{m&&(_(m),x==null||x(m))},[m,_,x]),Ro=D.useCallback(()=>{C&&(_(C),y==null||y(C))},[_,C,y]),Bb=D.useCallback((re,me)=>he=>{he.preventDefault(),he.stopPropagation(),ne(re),T==null||T(re.date,me,he),p==null||p(re.date,me,he)},[T,p,ne]),$b=D.useCallback((re,me)=>he=>{ne(re),b==null||b(re.date,me,he)},[b,ne]),Rb=D.useCallback((re,me)=>he=>{j(),h==null||h(re.date,me,he)},[j,h]),Vb=D.useCallback((re,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,cr]=bt[he.key];$($e,cr)}f==null||f(re.date,me,he)},[$,f,t.dir]),Hb=D.useCallback((re,me)=>he=>{v==null||v(re.date,me,he)},[v]),Ub=D.useCallback((re,me)=>he=>{g==null||g(re.date,me,he)},[g]),Yb=D.useCallback(re=>me=>{const he=Number(me.target.value),bt=i.setMonth(i.startOfMonth(re),he);_(bt)},[i,_]),zb=D.useCallback(re=>me=>{const he=Number(me.target.value),bt=i.setYear(i.startOfMonth(re),he);_(bt)},[i,_]),{className:qb,style:Kb}=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]),Gb=Rm(t),vl=D.useRef(null);gg(vl,!!t.animate,{classNames:s,months:R,focused:W,dateLib:i});const Xb={dayPickerProps:t,selected:I,select:T,isSelected:M,months:R,nextMonth:C,previousMonth:m,goToMonth:_,getModifiers:k,components:n,classNames:s,styles:S,labels:o,formatters:r};return D.createElement(vc.Provider,{value:Xb},D.createElement(n.Root,{rootRef:t.animate?vl:void 0,className:qb,style:Kb,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],...Gb},D.createElement(n.Months,{className:s[G.Months],style:S==null?void 0:S[G.Months]},!t.hideNavigation&&!d&&D.createElement(n.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}),R.map((re,me)=>{const he=Qm(re.date,X,Z,r,i),bt=eg(X,Z,r,i);return D.createElement(n.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:re},d==="around"&&!t.hideNavigation&&me===0&&D.createElement(n.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(n.Chevron,{disabled:m?void 0:!0,className:s[G.Chevron],orientation:t.dir==="rtl"?"right":"left"})),D.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:s[G.MonthCaption],style:S==null?void 0:S[G.MonthCaption],calendarMonth:re,displayIndex:me},c!=null&&c.startsWith("dropdown")?D.createElement(n.DropdownNav,{className:s[G.Dropdowns],style:S==null?void 0:S[G.Dropdowns]},c==="dropdown"||c==="dropdown-months"?D.createElement(n.MonthsDropdown,{className:s[G.MonthsDropdown],"aria-label":se(),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:Yb(re.date),options:he,style:S==null?void 0:S[G.Dropdown],value:i.getMonth(re.date)}):D.createElement("span",null,L(re.date,i)),c==="dropdown"||c==="dropdown-years"?D.createElement(n.YearsDropdown,{className:s[G.YearsDropdown],"aria-label":jb(i.options),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:zb(re.date),options:bt,style:S==null?void 0:S[G.Dropdown],value:i.getYear(re.date)}):D.createElement("span",null,B(re.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"}},F(re.date,i.options,i))):D.createElement(n.CaptionLabel,{className:s[G.CaptionLabel],role:"status","aria-live":"polite"},F(re.date,i.options,i))),d==="around"&&!t.hideNavigation&&me===u-1&&D.createElement(n.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(n.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(n.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(n.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":Q(re.date,i.options,i)||void 0,className:s[G.MonthGrid],style:S==null?void 0:S[G.MonthGrid]},!t.hideWeekdays&&D.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:s[G.Weekdays],style:S==null?void 0:S[G.Weekdays]},O&&D.createElement(n.WeekNumberHeader,{"aria-label":ye(i.options),className:s[G.WeekNumberHeader],style:S==null?void 0:S[G.WeekNumberHeader],scope:"col"},U()),Lb.map(($e,cr)=>D.createElement(n.Weekday,{"aria-label":Be($e,i.options,i),className:s[G.Weekday],key:cr,style:S==null?void 0:S[G.Weekday],scope:"col"},H($e,i.options,i)))),D.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:s[G.Weeks],style:S==null?void 0:S[G.Weeks]},re.weeks.map(($e,cr)=>D.createElement(n.Week,{className:s[G.Week],key:$e.weekNumber,style:S==null?void 0:S[G.Week],week:$e},O&&D.createElement(n.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"},V($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]=rt(I,Xe,!0,i)}const Qb=Zm(le,S,t.modifiersStyles),Zb=fm(le,s,t.modifiersClassNames),Jb=!gl&&!le.hidden?z(Xe,le,i.options,i):void 0;return D.createElement(n.Day,{key:`${i.format(Xe,"yyyy-MM-dd")}_${i.format(Oe.displayMonth,"yyyy-MM")}`,day:Oe,modifiers:le,className:Zb.join(" "),style:Qb,role:"gridcell","aria-selected":le.selected||void 0,"aria-label":Jb,"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&&gl?D.createElement(n.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:Bb(Oe,le),onBlur:Rb(Oe,le),onFocus:$b(Oe,le),onKeyDown:Vb(Oe,le),onMouseEnter:Hb(Oe,le),onMouseLeave:Ub(Oe,le)},P(Xe,i.options,i)):!le.hidden&&P(Oe.date,i.options,i))}))))))})),t.footer&&D.createElement(n.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:n=!0,...r}){return w.jsx(Wg,{showOutsideDays:n,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(pr({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(pr({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(hu,{className:"h-4 w-4"}):w.jsx(pu,{className:"h-4 w-4"})},...r})}_c.displayName="Calendar";var tr="Popover",[kc,lw]=Dt(tr,[Bn]),gn=Bn(),[jg,vt]=kc(tr),Pc=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=gn(t),c=E.useRef(null),[l,d]=E.useState(!1),[u,h]=tn({prop:r,defaultProp:o??!1,onChange:i,caller:tr});return w.jsx(Aa,{...s,children:w.jsx(jg,{scope:t,contentId:Mn(),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:n})})};Pc.displayName=tr;var Mc="PopoverAnchor",Lg=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=vt(Mc,n),i=gn(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return E.useEffect(()=>(a(),()=>s()),[a,s]),w.jsx(Hr,{...i,...r,ref:t})});Lg.displayName=Mc;var Ac="PopoverTrigger",Nc=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=vt(Ac,n),i=gn(n),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),...r,ref:a,onClick:oe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:w.jsx(Hr,{asChild:!0,...i,children:s})});Nc.displayName=Ac;var mo="PopoverPortal",[Bg,$g]=kc(mo,{forceMount:void 0}),Dc=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=vt(mo,t);return w.jsx(Bg,{scope:t,forceMount:n,children:w.jsx(Qn,{present:n||i.open,children:w.jsx(Ur,{asChild:!0,container:o,children:r})})})};Dc.displayName=mo;var zt="PopoverContent",Tc=E.forwardRef((e,t)=>{const n=$g(zt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=vt(zt,e.__scopePopover);return w.jsx(Qn,{present:r||i.open,children:i.modal?w.jsx(Vg,{...o,ref:t}):w.jsx(Hg,{...o,ref:t})})});Tc.displayName=zt;var Rg=Nt("PopoverContent.RemoveScroll"),Vg=E.forwardRef((e,t)=>{const n=vt(zt,e.__scopePopover),r=E.useRef(null),o=ue(t,r),i=E.useRef(!1);return E.useEffect(()=>{const a=r.current;if(a)return Ia(a)},[]),w.jsx(Xr,{as:Rg,allowPinchZoom:!0,children:w.jsx(Fc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=n.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})})})}),Hg=E.forwardRef((e,t)=>{const n=vt(zt,e.__scopePopover),r=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||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((l=n.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:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:d,...u}=e,h=vt(zt,n),p=gn(n);return Gi(),w.jsx(Pr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:w.jsx(Sr,{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",Ug=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=vt(Ic,n);return w.jsx(ie.button,{type:"button",...r,ref:t,onClick:oe(e.onClick,()=>o.onOpenChange(!1))})});Ug.displayName=Ic;var Yg="PopoverArrow",zg=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=gn(n);return w.jsx(Da,{...o,...r,ref:t})});zg.displayName=Yg;function Wc(e){return e?"open":"closed"}var qg=Pc,Kg=Nc,Gg=Dc,jc=Tc;const Xg=qg,Qg=Kg,Lc=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>w.jsx(Gg,{children:w.jsx(jc,{ref:o,align:t,sideOffset:n,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),...r})}));Lc.displayName=jc.displayName;function Zg({id:e,value:t,placeholder:n,disabled:r,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(Xg,{children:[w.jsx(Qg,{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:r,onBlur:i,onFocus:a,"aria-invalid":c,children:[w.jsx(fu,{className:"mr-2 h-4 w-4"}),l?so(l,"PPP"):w.jsx("span",{children:n})]})}),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:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),b=async y=>{const x=y.target.value===""?d.emptyValue:y.target.value;s(x),await p.onChange(x)},f=async y=>{const x=y.target.value;c&&c(t,x),await p.onBlur(x)},v=async y=>{const x=y.target.value;l&&l(t,x),await p.onFocus(x)},g=u.length>0;return w.jsx(be,{id:t,type:"text",value:n||"",placeholder:a,required:r,disabled:o,readOnly:i,onChange:b,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function $c(e){const{id:t,value:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),b=async x=>{const O=x.target.value===""?d.emptyValue:x.target.value;s(O),await p.onChange(O)},f=async x=>{const O=x.target.value;c&&c(t,O),await p.onBlur(O)},v=async x=>{const O=x.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:n||"",placeholder:a,required:r,disabled:o,readOnly:i,rows:y,onChange:b,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:n,required:r,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,n),await u.onBlur(n)},b=async()=>{s&&s(t,n),await u.onFocus(n)},f=l.length>0,{enumOptions:v=[]}=c;return w.jsxs(Ph,{value:n||"",onValueChange:h,disabled:o,required:r,children:[w.jsx(Ms,{id:t,"aria-invalid":f,className:J("w-full",f&&"border-destructive focus-visible:ring-destructive/20"),onBlur:p,onFocus:b,children:w.jsx(Mh,{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:n,disabled:r,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,n),await u.onBlur(n)},b=async()=>{s&&s(t,n),await u.onFocus(n)},f=l.length>0;return w.jsxs("div",{className:"flex items-start space-x-2",children:[w.jsx(Rs,{id:t,checked:n||!1,disabled:r||o,onCheckedChange:h,onBlur:p,onFocus:b,"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",r&&"opacity-50",!o&&!r&&"cursor-pointer"),children:c})]})}function Hc(e){const{id:t,value:n,disabled:r,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,n),await u.onBlur(n)},b=async()=>{s&&s(t,n),await u.onFocus(n)},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:n===g.value,disabled:r,readOnly:o,onChange:()=>h(g.value),onBlur:p,onFocus:b,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
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:{}};/*!
105
+ ${r?"cursor-not-allowed opacity-50":"cursor-pointer"}
106
+ `}),w.jsx("label",{htmlFor:`${t}_${y}`,className:`text-sm text-gray-700 ${r?"opacity-50":""} ${o?"":"cursor-pointer"}`,children:g.label})]},g.value))})}function Uc(e){const{id:t,value:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,schema:u,rawErrors:h=[]}=e,p=ve(t,u),b=async y=>{const x=y.target.value,O=x===""?d.emptyValue:parseFloat(x);s(O),await p.onChange(O)},f=async y=>{const x=y.target.value;c&&c(t,x),await p.onBlur(x)},v=async y=>{const x=y.target.value;l&&l(t,x),await p.onFocus(x)},g=h.length>0;return w.jsx(be,{id:t,type:"number",value:n??"",placeholder:a,required:r,disabled:o,readOnly:i,min:u.minimum,max:u.maximum,step:u.multipleOf||"any",onChange:b,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function go(e){const{id:t,value:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),b=async y=>{const x=y.target.value===""?d.emptyValue:y.target.value;s(x),await p.onChange(x)},f=async y=>{const x=y.target.value;c&&c(t,x),await p.onBlur(x)},v=async y=>{const x=y.target.value;l&&l(t,x),await p.onFocus(x)},g=u.length>0;return w.jsx(be,{id:t,type:"tel",value:n||"",placeholder:a||"Enter phone number",required:r,disabled:o,readOnly:i,onChange:b,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function vo(e){const{id:t,value:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),b=async y=>{const x=y.target.value===""?d.emptyValue:y.target.value;s(x),await p.onChange(x)},f=async y=>{const x=y.target.value;c&&c(t,x),await p.onBlur(x)},v=async y=>{const x=y.target.value;l&&l(t,x),await p.onFocus(x)},g=u.length>0;return w.jsx(be,{id:t,type:"email",value:n||"",placeholder:a||"Enter email address",required:r,disabled:o,readOnly:i,onChange:b,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function yo(e){const{id:t,value:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),b=async y=>{const x=y.target.value===""?d.emptyValue:y.target.value;s(x),await p.onChange(x)},f=async y=>{const x=y.target.value;c&&c(t,x),await p.onBlur(x)},v=async y=>{const x=y.target.value;l&&l(t,x),await p.onFocus(x)},g=u.length>0;return w.jsx(be,{id:t,type:"url",value:n||"",placeholder:a||"Enter URL",required:r,disabled:o,readOnly:i,onChange:b,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function bo(e){const{id:t,value:n,required:r,disabled:o,readonly:i,placeholder:a,onChange:s,onBlur:c,onFocus:l,options:d,rawErrors:u=[],schema:h}=e,p=ve(t,h),b=async y=>{const x=y.target.value===""?d.emptyValue:y.target.value;s(x),await p.onChange(x)},f=async y=>{const x=y.target.value;c&&c(t,x),await p.onBlur(x)},v=async y=>{const x=y.target.value;l&&l(t,x),await p.onFocus(x)},g=u.length>0;return w.jsx(be,{id:t,type:"password",value:n||"",placeholder:a||"Enter password",required:r,disabled:o,readOnly:i,onChange:b,onBlur:f,onFocus:v,"aria-invalid":g,className:J(g&&"border-destructive focus-visible:ring-destructive/20")})}function Yc(e){const{id:t,value:n,required:r,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)},b=async()=>{s&&s(t,n),await h.onBlur(n)},f=async()=>{c&&c(t,n),await h.onFocus(n)},v=d.length>0;return i?w.jsx(be,{id:t,type:"date",value:n||"",required:r,disabled:o,readOnly:i,"aria-invalid":v,className:J(v&&"border-destructive focus-visible:ring-destructive/20")}):w.jsx(Zg,{id:t,value:n||"",placeholder:"Select a date",disabled:o,onChange:p,onBlur:b,onFocus:f,"aria-invalid":v,className:J(v&&"border-destructive focus-visible:ring-destructive/20")})}function wo(e){const{id:t,value:n,required:r,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)},b=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:n||"",required:r,disabled:o,readOnly:i,onChange:p,onBlur:b,onFocus:f,"aria-invalid":v,className:J(v&&"border-destructive focus-visible:ring-destructive/20")})}function zc(e){const{id:t,required:n,disabled:r,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 x=y[0],O=new FileReader;O.onload=async()=>{const S=O.result;i(S),await u.onChange(S)},O.readAsDataURL(x)}},p=async g=>{const y=g.target.value;a&&a(t,y),await u.onBlur(y)},b=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:n,disabled:r,readOnly:o,accept:v,onChange:h,onBlur:p,onFocus:b,"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},Jg={small:"space-y-2",medium:"space-y-4",large:"space-y-6"},ev=({children:e,spacing:t="medium",className:n=""})=>w.jsx("div",{className:J("flex flex-col",Jg[t],n),children:e}),tv={small:"space-x-2",medium:"space-x-4",large:"space-x-6"},nv={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},rv=({children:e,spacing:t="medium",align:n="center",className:r=""})=>w.jsx("div",{className:J("flex flex-row",tv[t],nv[n],r),children:e}),ov={small:"gap-2",medium:"gap-4",large:"gap-6"},iv=({children:e,columns:t="auto-fit",gap:n="medium",minItemWidth:r="250px",className:o=""})=>{const i={display:"grid"};return typeof t=="number"?i.gridTemplateColumns=`repeat(${t}, 1fr)`:i.gridTemplateColumns=`repeat(${t}, minmax(${r}, 1fr))`,w.jsx("div",{className:J("grid",ov[n],o),style:i,children:e})};class av{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,n){this.handlers.afterValidation&&await this.handlers.afterValidation(t,n)}}class Gc{constructor(t,n={},r=[]){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=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,i,a){const s={eventType:t,fieldId:n,fieldValue:r,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 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 i=await fetch(t.url,o);if(!i.ok)throw new Error(`Webhook request failed: ${i.status} ${i.statusText}`)}createFieldEventHandlers(t,n,r,o){return{onFocus:i=>this.handleFieldEvent("focus",t,i,n,r,o),onBlur:i=>this.handleFieldEvent("blur",t,i,n,r,o),onChange:i=>this.handleFieldEvent("change",t,i,n,r,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 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 i=o;for(let a=0;a<r.length-1;a++){const s=r[a];(!(s in i)||typeof i[s]!="object")&&(i[s]={}),i=i[s]}return i[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]=Xc.removeEmptyValues(r));return t}return e}},Qc={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 i=t?`${t}.${r}`:r;n.push(i),n.push(...Qc.getAllFieldPaths(o,i))}return n}},sv={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"},Zc=({schema:e,uiSchema:t,formData:n,onSubmit:r,onChange:o,onError:i,onBlur:a,onFocus:s,beforeSubmit:c,afterSubmit:l,beforeValidation:d,afterValidation:u,onFieldFocus:h,onFieldBlur:p,onFieldChange:b,webhooks:f=[],widgets:v={},fields:g={},templates:y={},...x})=>{const O=D.useRef(null),S=D.useMemo(()=>{const H=new Gc({beforeSubmit:c,afterSubmit:l,beforeValidation:d,afterValidation:u},{onFieldFocus:h,onFieldBlur:p,onFieldChange:b},f);return O.current=H,H},[c,l,d,u,h,p,b,f]);D.useEffect(()=>()=>{O.current&&O.current.cleanup()},[]);const F=async(H,B)=>{const K=await S.handleBeforeSubmit(H);r&&await r(K,B),await S.handleAfterSubmit(K)},P=H=>{o&&o(H)},L={...Kc,...v},V={...bi,...g},U={...wi,...y};return w.jsx(di,{eventHub:S,formData:n,children:w.jsx(wl,{schema:e,uiSchema:t,formData:n,validator:Yo,onSubmit:F,onChange:P,onError:i,onBlur:a,onFocus:s,widgets:L,fields:V,templates:U,...x})})};function cv(e){return e.map(t=>{const n=[];if(Object.entries(t.conditions).forEach(([r,o])=>{r!=="all"&&r!=="any"&&typeof o=="object"&&!Array.isArray(o)&&n.push(...xo(r,o))}),t.conditions.all&&Array.isArray(t.conditions.all)&&t.conditions.all.forEach(r=>{Object.entries(r).forEach(([o,i])=>{n.push(...xo(o,i))})}),t.conditions.any&&Array.isArray(t.conditions.any)){const r=[];t.conditions.any.forEach(o=>{const i=[];Object.entries(o).forEach(([a,s])=>{i.push(...xo(a,s))}),i.length>0&&(i.length===1?r.push(i[0]):r.push({all:i}))}),r.length>0&&n.push({any:r})}return{conditions:{all:n},event:t.event}})}function xo(e,t){const n=[];return Object.entries(t).forEach(([r,o])=>{const i=lv(r);i&&n.push({fact:e,operator:i,value:o})}),n}function lv(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 uv(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=JSON.parse(JSON.stringify(t||{}));if(n.hiddenFields.forEach(i=>{const a=i.replace("root_","").split(/[._]/);Jc(o,a,"ui:widget","hidden")}),n.disabledFields.forEach(i=>{const a=i.replace("root_","").split(/[._]/);Jc(o,a,"ui:disabled",!0)}),r.properties){const i=new Set(r.required||[]);n.requiredFields.forEach(a=>{const s=a.replace("root_","");s&&i.add(s)}),r.required=Array.from(i)}return{schema:r,uiSchema:o}}function Jc(e,t,n,r){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][n]=r}function Eo(e,t="",n="."){const r={};if(!e||typeof e!="object")return r;for(const o in e)if(e.hasOwnProperty(o)){const i=t?`${t}${n}${o}`:o;Array.isArray(e[o])?(e[o].forEach((a,s)=>{const c=`${i}.${s}`;typeof a=="object"&&a!==null?Object.assign(r,Eo(a,c,n)):r[c]=a}),r[i]=e[o]):typeof e[o]=="object"&&e[o]!==null?Object.assign(r,Eo(e[o],i,n)):r[i]=e[o]}return r}function dv(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var _e={},it={},vn={},Co={};Object.defineProperty(Co,"__esModule",{value:!0});function fv(e){for(var t=e.length,n=5381,r=52711,o;t--;)o=e.charCodeAt(t),n=n*33^o,r=r*33^o;return(n>>>0)*4096+(r>>>0)}var yn="|",hv=/\[object ([HTML|SVG](.*)Element)\]/,pv={"[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},mv={"[object Arguments]":1,"[object Array]":2},el={"[object Generator]":1,"[object Promise]":2,"[object WeakMap]":3,"[object WeakRef]":4,"[object WeakSet]":5},gv={"[object AsyncFunction]":1,"[object AsyncGeneratorFunction]":2,"[object Boolean]":3,"[object Function]":4,"[object GeneratorFunction]":5,"[object Number]":6,"[object String]":7},vv={"[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},yv={"[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},bn={bigint:"i",boolean:"b",empty:"e",function:"g",number:"n",object:"o",string:"s",symbol:"s"};function bv(e,t){return e[0]>t[0]}function tl(e,t){return e>t}function So(e,t){for(var n,r,o=0;o<e.length;++o){for(r=e[o],n=o-1;~n&&t(e[n],r);--n)e[n+1]=e[n];e[n+1]=r}return e}function xe(e,t){return bn.object+yn+pv[e]+yn+t}var nl=new WeakMap,wv=0;function Oo(e,t){var n=nl.get(e);if(n)return n;var r=xe(t,"NOT_ENUMERABLE"+yn+wv++);return nl.set(e,r),r}var xv=Object.prototype.toString;function Ev(e,t,n){if(yv[t])return rl(t,e,n);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+yn+e.stack);if(t==="[object DocumentFragment]")return xe(t,kv(e));var r=t.match(hv);return r?xe("ELEMENT",r[1]+yn+e.outerHTML):el[t]?Oo(e,t):gv[t]?xe(t,e.toString()):rl("CUSTOM",e,n)}function rl(e,t,n){var r=n.cache.get(t);return r?xe(e,"RECURSIVE~"+r):(n.cache.set(t,++n.id),e==="[object Object]"?t[Symbol.iterator]?Oo(t,e):xe(e,il(t,n)):mv[e]?xe(e,Cv(t,n)):e==="[object Map]"?xe(e,Pv(t,n)):e==="[object Set]"?xe(e,Mv(t,n)):vv[e]?xe(e,t.join()):e==="[object ArrayBuffer]"?xe(e,ol(t)):e==="[object DataView]"?xe(e,ol(t.buffer)):el[e]?Oo(t,e):xe("CUSTOM",il(t,n)))}function Cv(e,t){for(var n=e.length,r=new Array(n);--n>=0;)r[n]=qt(e[n],t);return r.join()}function Sv(e){return Buffer.from(e).toString("utf8")}function Ov(e){return String.fromCharCode.apply(null,new Uint16Array(e))}function _v(){return"UNSUPPORTED"}function kv(e){for(var t=e.children,n=t.length,r=new Array(n);--n>=0;)r[n]=t[n].outerHTML;return r.join()}var ol=typeof Buffer<"u"&&typeof Buffer.from=="function"?Sv:typeof Uint16Array=="function"?Ov:_v;function Pv(e,t){var n=new Array(e.size),r=0;for(e.forEach(function(o,i){n[r++]=[qt(i,t),qt(o,t)]}),So(n,bv);--r>=0;)n[r]="["+n[r][0]+","+n[r][1]+"]";return"["+n.join()+"]"}function il(e,t){for(var n=So(Object.getOwnPropertyNames(e),tl),r=n.length,o=new Array(r),i=r;--i>=0;)o[i]=n[i]+":"+qt(e[n[i]],t);return"{"+o.join()+"}"}function Mv(e,t){var n=new Array(e.size),r=0;return e.forEach(function(o){n[r++]=qt(o,t)}),"["+So(n,tl).join()+"]"}function qt(e,t){var n=typeof e;return e==null||n==="undefined"?bn.empty+e:n==="object"?Ev(e,xv.call(e),t||{cache:new WeakMap,id:1}):n==="function"||n==="symbol"?bn[n]+e.toString():n==="boolean"?bn.boolean+ +e:bn[n]+e}function Av(e){return fv(qt(e,void 0))}Co.default=Av,Object.defineProperty(vn,"__esModule",{value:!0});var Nv=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Dv=Co,Tv=Fv(Dv);function Fv(e){return e&&e.__esModule?e:{default:e}}function Iv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _o=function(){function e(t,n,r){Iv(this,e),this.id=t;var o={cache:!0};if(typeof r>"u"&&(r=o),typeof n!="function"?(this.value=n,this.type=this.constructor.CONSTANT):(this.calculationMethod=n,this.type=this.constructor.DYNAMIC),!this.id)throw new Error("factId required");return this.priority=parseInt(r.priority||1,10),this.options=Object.assign({},o,r),this.cacheKeyMethod=this.defaultCacheKeys,this}return Nv(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(n,r){return Object.prototype.hasOwnProperty.call(this,"value")?this.value:this.calculationMethod(n,r)}},{key:"defaultCacheKeys",value:function(n,r){return{params:r,id:n}}},{key:"getCacheKey",value:function(n){if(this.options.cache===!0){var r=this.cacheKeyMethod(this.id,n),o=e.hashFromObject(r);return o}}}],[{key:"hashFromObject",value:function(n){return(0,Tv.default)(n)}}]),e}();_o.CONSTANT="CONSTANT",_o.DYNAMIC="DYNAMIC",vn.default=_o;var nr={},rr={},_t={};Object.defineProperty(_t,"__esModule",{value:!0});function Wv(){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=Wv(),Object.defineProperty(rr,"__esModule",{value:!0});var jv=function(){function e(t,n){var r=[],o=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),c;!(o=(c=s.next()).done)&&(r.push(c.value),!(n&&r.length===n));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&s.return&&s.return()}finally{if(i)throw a}}return r}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Lv=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Bv=_t,$v=Rv(Bv);function Rv(e){return e&&e.__esModule?e:{default:e}}function Vv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Hv=function(){function e(t){if(Vv(this,e),!t)throw new Error("Condition: constructor options required");var n=e.booleanOperator(t);if(Object.assign(this,t),n){var r=t[n],o=Array.isArray(r);if(n!=="not"&&!o)throw new Error('"'+n+'" must be an array');if(n==="not"&&o)throw new Error('"'+n+'" cannot be an array');this.operator=n,this.priority=parseInt(t.priority,10)||1,o?this[n]=r.map(function(i){return new e(i)}):this[n]=new e(r)}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 Lv(e,[{key:"toJSON",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r={};this.priority&&(r.priority=this.priority),this.name&&(r.name=this.name);var o=e.booleanOperator(this);return o?Array.isArray(this[o])?r[o]=this[o].map(function(i){return i.toJSON(!1)}):r[o]=this[o].toJSON(!1):this.isConditionReference()?r.condition=this.condition:(r.operator=this.operator,r.value=this.value,r.fact=this.fact,this.factResult!==void 0&&(r.factResult=this.factResult),this.valueResult!==void 0&&(r.valueResult=this.valueResult),this.result!==void 0&&(r.result=this.result),this.params&&(r.params=this.params),this.path&&(r.path=this.path)),n?JSON.stringify(r):r}},{key:"evaluate",value:function(n,r){var o=this;if(!n)return Promise.reject(new Error("almanac required"));if(!r)return Promise.reject(new Error("operatorMap required"));if(this.isBooleanOperator())return Promise.reject(new Error("Cannot evaluate() a boolean condition"));var i=r.get(this.operator);return i?Promise.all([n.getValue(this.value),n.factValue(this.fact,this.params,this.path)]).then(function(a){var s=jv(a,2),c=s[0],l=s[1],d=i.evaluate(l,c);return(0,$v.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(n){if(Object.prototype.hasOwnProperty.call(n,"any"))return"any";if(Object.prototype.hasOwnProperty.call(n,"all"))return"all";if(Object.prototype.hasOwnProperty.call(n,"not"))return"not"}}]),e}();rr.default=Hv;var ko={},al={exports:{}};(function(e){var t=function(){function n(h,p){return p!=null&&h instanceof p}var r;try{r=Map}catch{r=function(){}}var o;try{o=Set}catch{o=function(){}}var i;try{i=Promise}catch{i=function(){}}function a(h,p,b,f,v){typeof p=="object"&&(b=p.depth,f=p.prototype,v=p.includeNonEnumerable,p=p.circular);var g=[],y=[],x=typeof Buffer<"u";typeof p>"u"&&(p=!0),typeof b>"u"&&(b=1/0);function O(S,F){if(S===null)return null;if(F===0)return S;var P,L;if(typeof S!="object")return S;if(n(S,r))P=new r;else if(n(S,o))P=new o;else if(n(S,i))P=new i(function(Z,m){S.then(function(C){Z(O(C,F-1))},function(C){m(O(C,F-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(x&&Buffer.isBuffer(S))return Buffer.allocUnsafe?P=Buffer.allocUnsafe(S.length):P=new Buffer(S.length),S.copy(P),P;n(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 V=g.indexOf(S);if(V!=-1)return y[V];g.push(S),y.push(P)}n(S,r)&&S.forEach(function(Z,m){var C=O(m,F-1),_=O(Z,F-1);P.set(C,_)}),n(S,o)&&S.forEach(function(Z){var m=O(Z,F-1);P.add(m)});for(var U in S){var H;L&&(H=Object.getOwnPropertyDescriptor(L,U)),!(H&&H.set==null)&&(P[U]=O(S[U],F-1))}if(Object.getOwnPropertySymbols)for(var B=Object.getOwnPropertySymbols(S),U=0;U<B.length;U++){var K=B[U],ee=Object.getOwnPropertyDescriptor(S,K);ee&&!ee.enumerable&&!v||(P[K]=O(S[K],F-1),ee.enumerable||Object.defineProperty(P,K,{enumerable:!1}))}if(v)for(var R=Object.getOwnPropertyNames(S),U=0;U<R.length;U++){var X=R[U],ee=Object.getOwnPropertyDescriptor(S,X);ee&&ee.enumerable||(P[X]=O(S[X],F-1),Object.defineProperty(P,X,{enumerable:!1}))}return P}return O(h,b)}a.clonePrototype=function(p){if(p===null)return null;var b=function(){};return b.prototype=p,new b};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)})(al);var sl=al.exports;Object.defineProperty(ko,"__esModule",{value:!0});var Uv=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},Yv=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),zv=sl,or=qv(zv);function qv(e){return e&&e.__esModule?e:{default:e}}function Kv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Gv=function(){function e(t,n,r,o){Kv(this,e),this.conditions=(0,or.default)(t),this.event=(0,or.default)(n),this.priority=(0,or.default)(r),this.name=(0,or.default)(o),this.result=null}return Yv(e,[{key:"setResult",value:function(n){this.result=n}},{key:"resolveEventParams",value:function(n){var r=this;if(this.event.params!==null&&Uv(this.event.params)==="object"){var o=[],i=function(c){Object.prototype.hasOwnProperty.call(r.event.params,c)&&o.push(n.getValue(r.event.params[c]).then(function(l){return r.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 n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r={conditions:this.conditions.toJSON(!1),event:this.event,priority:this.priority,name:this.name,result:this.result};return n?JSON.stringify(r):r}}]),e}();ko.default=Gv;var cl={exports:{}};/*!
107
107
  * EventEmitter2
108
108
  * https://github.com/hij1nx/EventEmitter2
109
109
  *
110
110
  * Copyright (c) 2013 hij1nx
111
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"})});
112
+ */(function(e,t){(function(n){var r=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!==n&&(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 b(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,T=0,I=0;I<M;I++)k=m[I],_[k]=I<T?C[I]:n;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 T=m._observers;T?T.push(this):m._observers=[this]}Object.assign(g.prototype,{subscribe:function(m,C,_){var k=this,M=this._target,T=this._emitter,I=this._listeners,j=function(){var W=f.apply(null,arguments),A={data:W,name:C,original:m};if(_){var $=_.call(M,A);$!==!1&&T.emit.apply(T,[A.name].concat(W));return}T.emit.apply(T,[C].concat(W))};if(I[m])throw Error("Event '"+m+"' is already listening");this._listenersCount++,T._newListener&&T._removeListener&&!k._onNewListener?(this._onNewListener=function(W){W===C&&I[m]===null&&(I[m]=j,k._on.call(M,m,j))},T.on("newListener",this._onNewListener),this._onRemoveListener=function(W){W===C&&!T.hasListeners(W)&&I[m]&&(I[m]=null,k._off.call(M,m,j))},I[m]=null,T.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,T,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 $=L.call(k,C);k._observers.splice($,1)}if(m){if(M=_[m],!M)return;I.call(j,m,M),delete _[m],--this._listenersCount||A()}else{for(T=u(_),W=T.length;W-- >0;)m=T[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 T=Object.keys(m),I=T.length,j,W,A;function $(q){throw Error('Invalid "'+j+'" option value'+(q?". Reason: "+q:""))}for(var ne=0;ne<I;ne++){if(j=T[ne],!r.call(C,j))throw Error('Unknown "'+j+'" option');W=m[j],W!==n&&(A=_[j],M[j]=A?A(W,$):W)}return M}function x(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(T,I){if(typeof T===k)return T;I(C)}:_===2?function(T,I){var j=typeof T;if(j===k||j===M)return T;I(C)}:function(T,I){for(var j=typeof T,W=_;W-- >0;)if(j===m[W])return T;I(C)}}var S=O(["function"]),F=O(["object","function"]);function P(m,C,_){var k,M,T=0,I,j=new m(function(W,A,$){_=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 $=="function";function ne(){M&&(M=null),T&&(clearTimeout(T),T=0)}var q=function(Q){ne(),W(Q)},z=function(Q){ne(),A(Q)};k?C(q,z,$):(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&&(T=setTimeout(function(){var Q=Error("timeout");Q.code="ETIMEDOUT",T=0,j.cancel(Q),A(Q)},_.timeout))});return k||(j.cancel=function(W){if(M){for(var A=M.length,$=1;$<A;$++)M[$](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 V(m,C,_,k,M){if(!_)return null;if(k===0){var T=typeof C;if(T==="string"){var I,j,W=0,A=0,$=this.delimiter,ne=$.length;if((j=C.indexOf($))!==-1){I=new Array(5);do I[W++]=C.slice(A,j),A=j+ne;while((j=C.indexOf($,A))!==-1);I[W++]=C.slice(A),C=I,M=W}else C=[C],M=1}else T==="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=V(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=V(m,C,_,M,M)),De=u(_),j=De.length;j-- >0;)z=De[j],z!=="_listeners"&&(z==="*"||z==="**"?(_[z]._listeners&&!Le&&(ye=V(m,C,_[z],M,M),ye&&(q?q.push.apply(q,ye):q=ye)),ye=V(m,C,_[z],k,M)):z===Be?ye=V(m,C,_[z],k+2,M):ye=V(m,C,_[z],k,M),ye&&(q?q.push.apply(q,ye):q=ye));return q}else _[Ne]&&(q=V(m,C,_[Ne],k+1,M));if(Q=_["*"],Q&&V(m,C,Q,k+1,M),se=_["**"],se)if(k<M)for(se._listeners&&V(m,C,se,M,M),De=u(se),j=De.length;j-- >0;)z=De[j],z!=="_listeners"&&(z===Be?V(m,C,se[z],k+2,M):z===Ne?V(m,C,se[z],k+1,M):(Ee={},Ee[z]=se[z],V(m,C,{"**":Ee},k+1,M)));else se._listeners?V(m,C,se,M,M):se["*"]&&se["*"]._listeners&&V(m,C,se["*"],M,M);return q}function U(m,C,_){var k=0,M=0,T,I=this.delimiter,j=I.length,W;if(typeof m=="string")if((T=m.indexOf(I))!==-1){W=new Array(5);do W[k++]=m.slice(M,T),M=T+j;while((T=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(T=0;T+1<k;T++)if(W[T]==="**"&&W[T+1]==="**")return}var A=this.listenerTree,$;for(T=0;T<k;T++)if($=W[T],A=A[$]||(A[$]={}),T===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,b.call(this,A._listeners.length,$))):A._listeners=C,!0;return!0}function H(m,C,_,k){for(var M=u(m),T=M.length,I,j,W,A=m._listeners,$;T-- >0;)j=M[T],I=m[j],j==="_listeners"?W=_:W=_?_.concat(j):[j],$=k||typeof j=="symbol",A&&C.push($?W:W.join(this.delimiter)),typeof I=="object"&&H.call(this,I,C,W,$);return C}function B(m){for(var C=u(m),_=C.length,k,M,T;_-- >0;)M=C[_],k=m[M],k&&(T=!0,M!=="_listeners"&&!B(k)&&delete m[M]);return T}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,T=_.nextTick,I=_.objectify}if(k||T||M){var j=C,W=C._origin||C;if(T&&!a)throw Error("process.nextTick is not supported");M===n&&(M=C.constructor.name==="AsyncFunction"),C=function(){var A=arguments,$=this,ne=this.event;return M?T?Promise.resolve():new Promise(function(q){d(q)}).then(function(){return $.event=ne,j.apply($,A)}):(T?process.nextTick:d)(function(){$.event=ne,j.apply($,A)})},C._async=!0,C._origin=W}return[C,I?new K(this,m,C):this]}function R(m){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,p.call(this,m)}R.EventEmitter2=R,R.prototype.listenTo=function(m,C,_){if(typeof m!="object")throw TypeError("target musts be an object");var k=this;_=y(_,{on:n,off:n,reducers:n},{on:S,off:S,reducers:F});function M(T){if(typeof T!="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(T),$=A.length,ne,q=typeof I=="function",z=0;z<$;z++)ne=A[z],W.subscribe(ne,T[ne]||ne,q?I:I&&I[ne])}return o(C)?M(v(C)):M(typeof C=="string"?v(C.split(/\s+/)):C),this},R.prototype.stopListeningTo=function(m,C){var _=this._observers;if(!_)return!1;var k=_.length,M,T=!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),T=!0);return T},R.prototype.delimiter=".",R.prototype.setMaxListeners=function(m){m!==n&&(this._maxListeners=m,this._conf||(this._conf={}),this._conf.maxListeners=m)},R.prototype.getMaxListeners=function(){return this._maxListeners},R.prototype.event="",R.prototype.once=function(m,C,_){return this._once(m,C,!1,_)},R.prototype.prependOnceListener=function(m,C,_){return this._once(m,C,!0,_)},R.prototype._once=function(m,C,_,k){return this._many(m,1,C,_,k)},R.prototype.many=function(m,C,_,k){return this._many(m,C,_,!1,k)},R.prototype.prependMany=function(m,C,_,k){return this._many(m,C,_,!0,k)},R.prototype._many=function(m,C,_,k,M){var T=this;if(typeof _!="function")throw new Error("many only accepts instances of Function");function I(){return--C===0&&T.off(m,I),_.apply(this,arguments)}return I._origin=_,this._on(m,I,k,M)},R.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||h.call(this);var m=arguments[0],C,_=this.wildcard,k,M,T,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(T=0;T<M;T++)if(typeof m[T]=="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(),T=0,M=A.length;T<M;T++)switch(this.event=m,W){case 1:A[T].call(this,m);break;case 2:A[T].call(this,m,arguments[1]);break;case 3:A[T].call(this,m,arguments[1],arguments[2]);break;default:A[T].apply(this,arguments)}if(_)A=[],V.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(T=0,M=A.length;T<M;T++)switch(this.event=m,W){case 1:A[T].call(this);break;case 2:A[T].call(this,arguments[1]);break;case 3:A[T].call(this,arguments[1],arguments[2]);break;default:A[T].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},R.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||h.call(this);var m=arguments[0],C=this.wildcard,_,k,M,T,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(T=m.length,s){for(I=0;I<T;I++)if(typeof m[I]=="symbol"){k=!0;break}}k||(m=m.join(this.delimiter))}var W=[],A=arguments.length,$;if(this._all)for(I=0,T=this._all.length;I<T;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,$,_,this.listenerTree,0)):$=this._events[m],typeof $=="function")switch(this.event=m,A){case 1:W.push($.call(this));break;case 2:W.push($.call(this,arguments[1]));break;case 3:W.push($.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($.apply(this,M))}else if($&&$.length){if($=$.slice(),A>3)for(M=new Array(A-1),j=1;j<A;j++)M[j-1]=arguments[j];for(I=0,T=$.length;I<T;I++)switch(this.event=m,A){case 1:W.push($[I].call(this));break;case 2:W.push($[I].call(this,arguments[1]));break;case 3:W.push($[I].call(this,arguments[1],arguments[2]));break;default:W.push($[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)},R.prototype.on=function(m,C,_){return this._on(m,C,!1,_)},R.prototype.prependListener=function(m,C,_){return this._on(m,C,!0,_)},R.prototype.onAny=function(m){return this._onAny(m,!1)},R.prototype.prependAny=function(m){return this._onAny(m,!0)},R.prototype.addListener=R.prototype.on,R.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},R.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,T;return k!==n&&(T=ee.call(this,m,C,k),C=T[0],M=T[1]),this._newListener&&this.emit("newListener",m,C),this.wildcard?(U.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,b.call(this,this._events[m].length,m))):this._events[m]=C,M)},R.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=V.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 T=0;T<k.length;T++){var I=k[T];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&&B(this.listenerTree),this},R.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},R.prototype.removeListener=R.prototype.off,R.prototype.removeAllListeners=function(m){if(m===n)return!this._events||h.call(this),this;if(this.wildcard){var C=V.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&&B(this.listenerTree)}else this._events&&(this._events[m]=null);return this},R.prototype.listeners=function(m){var C=this._events,_,k,M,T,I;if(m===n){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!C)return[];for(_=u(C),T=_.length,M=[];T-- >0;)k=C[_[T]],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 V.call(this,j,W,I,0),j}return C?(k=C[m],k?typeof k=="function"?[k]:k:[]):[]}},R.prototype.eventNames=function(m){var C=this._events;return this.wildcard?H.call(this,this.listenerTree,[],null,m):C?u(C):[]},R.prototype.listenerCount=function(m){return this.listeners(m).length},R.prototype.hasListeners=function(m){if(this.wildcard){var C=[],_=typeof m=="string"?m.split(this.delimiter):m.slice();return V.call(this,C,_,this.listenerTree,0),C.length>0}var k=this._events,M=this._all;return!!(M&&M.length||k&&(m===n?u(k).length:k[m]))},R.prototype.listenersAny=function(){return this._all?this._all:[]},R.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:n,handleError:!1,Promise,overload:!1},{filter:S,Promise:x}),P(C.Promise,function(M,T,I){function j(){var W=C.filter;if(!(W&&!W.apply(_,arguments)))if(_.off(m,j),C.handleError){var A=arguments[0];A?T(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:x});var k=_.Promise;return P(k,function(M,T,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($){m.removeListener(C,W),T($)},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=R.prototype;Object.defineProperties(R,{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=R})()})(cl);var ll=cl.exports;Object.defineProperty(nr,"__esModule",{value:!0});var Xv=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Qv=rr,Zv=wn(Qv),Jv=ko,ey=wn(Jv),ty=_t,ny=wn(ty),ry=sl,oy=wn(ry),iy=ll,ay=wn(iy);function wn(e){return e&&e.__esModule?e:{default:e}}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)}var uy=function(e){ly(t,e);function t(n){sy(this,t);var r=cy(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));typeof n=="string"&&(n=JSON.parse(n)),n&&n.conditions&&r.setConditions(n.conditions),n&&n.onSuccess&&r.on("success",n.onSuccess),n&&n.onFailure&&r.on("failure",n.onFailure),n&&(n.name||n.name===0)&&r.setName(n.name);var o=n&&n.priority||1;r.setPriority(o);var i=n&&n.event||{type:"unknown"};return r.setEvent(i),r}return Xv(t,[{key:"setPriority",value:function(r){if(r=parseInt(r,10),r<=0)throw new Error("Priority must be greater than zero");return this.priority=r,this}},{key:"setName",value:function(r){if(!r&&r!==0)throw new Error('Rule "name" must be defined');return this.name=r,this}},{key:"setConditions",value:function(r){if(!Object.prototype.hasOwnProperty.call(r,"all")&&!Object.prototype.hasOwnProperty.call(r,"any")&&!Object.prototype.hasOwnProperty.call(r,"not")&&!Object.prototype.hasOwnProperty.call(r,"condition"))throw new Error('"conditions" root must contain a single instance of "all", "any", "not", or "condition"');return this.conditions=new Zv.default(r),this}},{key:"setEvent",value:function(r){if(!r)throw new Error("Rule: setEvent() requires event object");if(!Object.prototype.hasOwnProperty.call(r,"type"))throw new Error('Rule: setEvent() requires event object with "type" property');return this.ruleEvent={type:r.type},this.event=this.ruleEvent,r.params&&(this.ruleEvent.params=r.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(r){return this.engine=r,this}},{key:"toJSON",value:function(){var r=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 r?JSON.stringify(o):o}},{key:"prioritizeConditions",value:function(r){var o=this,i=r.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(r){var o=this,i=new ey.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 x=y===!0;return f.result=x,x})}else return f.evaluate(r,o.engine.operators).then(function(y){var x=y.result;return f.factResult=y.leftHandSideValue,f.valueResult=y.rightHandSideValue,f.result=x,x})},s=function(f,v){return Array.isArray(f)||(f=[f]),Promise.all(f.map(function(g){return a(g)})).then(function(g){return(0,ny.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"),x=function(F){var P=g[F];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++)x(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,oy.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(r));var g=f?"success":"failure";return v.then(function(){return o.emitAsync(g,i.event,r,i)}).then(function(){return i})};return i.conditions.any?l(i.conditions.any).then(function(b){return p(b)}):i.conditions.all?d(i.conditions.all).then(function(b){return p(b)}):i.conditions.not?u(i.conditions.not).then(function(b){return p(b)}):h(i.conditions).then(function(b){return p(b)})}}]),t}(ay.default);nr.default=uy;var ir={},Po={};Object.defineProperty(Po,"__esModule",{value:!0});function dy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fy(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 hy(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)}Po.UndefinedFactError=function(e){hy(t,e);function t(){var n;dy(this,t);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=fy(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(o)));return a.code="UNDEFINED_FACT",a}return t}(Error);class py{add(t,n,r){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]||[],n&&this[o][r?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(r){r.call(n&&n.context?n.context:n,n)})}}class my{constructor(t){this.jsep=t,this.registered={}}register(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.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,n,r){return N.max_binop_len=Math.max(t.length,N.max_binop_len),N.binary_ops[t]=n,r?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,n){return N.literals[t]=n,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(n=>n.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 n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(N.hooks[t]){const r={context:this,node:n};return N.hooks.run(t,r),r.node}return n}searchHook(t){if(N.hooks[t]){const n={context:this};return N.hooks[t].find(function(r){return r.call(n.context,n),n.node}),n.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(),n=t.length===1?t[0]:{type:N.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],r,o;for(;this.index<this.expr.length;)if(r=this.code,r===N.SEMCOL_CODE||r===N.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(r===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}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),n=t.length;for(;n>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+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,r,o,i,a,s,c,l;if(a=this.gobbleToken(),!a||(n=this.gobbleBinaryOp(),!n))return a;for(i={value:n,prec:N.binaryPrecedence(n),right_a:N.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+n),o=[a,i,s];n=this.gobbleBinaryOp();){if(r=N.binaryPrecedence(n),r===0){this.index-=n.length;break}i={value:n,prec:r,right_a:N.right_associative.has(n)},l=n;const d=u=>i.right_a&&u.right_a?r>u.prec:r<=u.prec;for(;o.length>2&&d(o[o.length-2]);)s=o.pop(),n=o.pop().value,a=o.pop(),t={type:N.BINARY_EXP,operator:n,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,n,r,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(n=this.expr.substr(this.index,N.max_unop_len),r=n.length;r>0;){if(N.unary_ops.hasOwnProperty(n)&&(!N.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!N.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=r;const i=this.gobbleToken();return i||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:N.UNARY_EXP,operator:n,argument:i,prefix:!0})}n=n.substr(0,--r)}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 n=this.code;for(;n===N.PERIOD_CODE||n===N.OBRACK_CODE||n===N.OPAREN_CODE||n===N.QUMARK_CODE;){let r;if(n===N.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==N.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===N.OBRACK_CODE?(t={type:N.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==N.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===N.OPAREN_CODE?t={type:N.CALL_EXP,arguments:this.gobbleArguments(N.CPAREN_CODE),callee:t}:(n===N.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:N.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),r&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,r;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(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(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 r=this.code,N.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(r===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 n=this.index,r=this.expr.charAt(this.index++);let o=!1;for(;this.index<this.expr.length;){let i=this.expr.charAt(this.index++);if(i===r){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(n,this.index)}}gobbleIdentifier(){let t=this.code,n=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(n,this.index)}}gobbleArguments(t){const n=[];let r=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===t){r=!0,this.index++,t===N.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(i===N.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===N.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===N.CBRACK_CODE)for(let a=n.length;a<o;a++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{const a=this.gobbleExpression();(!a||a.type===N.COMPOUND)&&this.throwError("Expected comma"),n.push(a)}}return r||this.throwError("Expected "+String.fromCharCode(t)),n}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 gy=new py;Object.assign(N,{hooks:gy,plugins:new my(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(),vy=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(N).filter(e=>!vy.includes(e)&&at[e]===void 0).forEach(e=>{at[e]=N[e]}),at.Jsep=N;const yy="ConditionalExpression";var by={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;const r=n.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"),n.node={type:yy,test:r,consequent:o,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let a=r;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;n.node.test=a.right,a.right=n.node,n.node=r}}else this.throwError("Expected :")}})}};at.plugins.register(by);const ul=47,wy=92;var xy={name:"regex",init(e){e.hooks.add("gobble-token",function(n){if(this.code===ul){const r=++this.index;let o=!1;for(;this.index<this.expr.length;){if(this.code===ul&&!o){const i=this.expr.slice(r,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 n.node={type:e.LITERAL,value:s,raw:this.expr.slice(r-1,this.index)},n.node=this.gobbleTokenProperty(n.node),n.node}this.code===e.OBRACK_CODE?o=!0:o&&this.code===e.CBRACK_CODE&&(o=!1),this.index+=this.code===wy?2:1}this.throwError("Unclosed Regex")}})}};const Mo=43,Kt={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[Mo,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];Kt.assignmentOperators.forEach(r=>e.addBinaryOp(r,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===Mo?"++":"--",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===Mo?"++":"--",argument:o.node,prefix:!1})}}),e.hooks.add("after-expression",function(o){o.node&&n(o.node)});function n(r){Kt.assignmentOperators.has(r.operator)?(r.type="AssignmentExpression",n(r.left),n(r.right)):r.operator||Object.values(r).forEach(o=>{o&&typeof o=="object"&&n(o)})}}};at.plugins.register(xy,Kt),at.addUnaryOp("typeof"),at.addLiteral("null",null),at.addLiteral("undefined",void 0);const Ey=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{"||":(r,o)=>r||o(),"&&":(r,o)=>r&&o(),"|":(r,o)=>r|o(),"^":(r,o)=>r^o(),"&":(r,o)=>r&o(),"==":(r,o)=>r==o(),"!=":(r,o)=>r!=o(),"===":(r,o)=>r===o(),"!==":(r,o)=>r!==o(),"<":(r,o)=>r<o(),">":(r,o)=>r>o(),"<=":(r,o)=>r<=o(),">=":(r,o)=>r>=o(),"<<":(r,o)=>r<<o(),">>":(r,o)=>r>>o(),">>>":(r,o)=>r>>>o(),"+":(r,o)=>r+o(),"-":(r,o)=>r-o(),"*":(r,o)=>r*o(),"/":(r,o)=>r/o(),"%":(r,o)=>r%o()}[e.operator](fe.evalAst(e.left,t),()=>fe.evalAst(e.right,t))},evalCompound(e,t){let n;for(let r=0;r<e.body.length;r++){e.body[r].type==="Identifier"&&["var","let","const"].includes(e.body[r].name)&&e.body[r+1]&&e.body[r+1].type==="AssignmentExpression"&&(r+=1);const o=e.body[r];n=fe.evalAst(o,t)}return n},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 n=String(e.computed?fe.evalAst(e.property):e.property.name),r=fe.evalAst(e.object,t);if(r==null)throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);if(!Object.hasOwn(r,n)&&Ey.has(n))throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);const o=r[n];return typeof o=="function"?o.bind(r):o},evalUnaryExpression(e,t){return{"-":r=>-fe.evalAst(r,t),"!":r=>!fe.evalAst(r,t),"~":r=>~fe.evalAst(r,t),"+":r=>+fe.evalAst(r,t),typeof:r=>typeof fe.evalAst(r,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(n=>fe.evalAst(n,t))},evalCallExpression(e,t){const n=e.arguments.map(o=>fe.evalAst(o,t));return fe.evalAst(e.callee,t)(...n)},evalAssignmentExpression(e,t){if(e.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const n=e.left.name,r=fe.evalAst(e.right,t);return t[n]=r,t[n]}};class Cy{constructor(t){this.code=t,this.ast=at(this.code)}runInNewContext(t){const n=Object.assign(Object.create(null),t);return fe.evalAst(this.ast,n)}}function yt(e,t){return e=e.slice(),e.push(t),e}function Ao(e,t){return t=t.slice(),t.unshift(e),t}class Sy 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,n,r,o){if(!(this instanceof ae))try{return new ae(e,t,n,r,o)}catch(a){if(!a.avoidNew)throw a;return a.value}typeof e=="string"&&(o=r,r=n,n=t,t=e,e=null);const i=e&&typeof e=="object";if(e=e||{},this.json=e.json||n,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||r||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=n;const s=this.evaluate(a);if(!s||typeof s!="object")throw new Sy(s);return s}}ae.prototype.evaluate=function(e,t,n,r){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,n=n||this.callback,this.currOtherTypeCallback=r||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,n=Object.hasOwn(e,"callback")?e.callback:n,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,n).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 n=Array.isArray(e.path)?e.path:ae.toPathArray(e.path);return e.pointer=ae.toPointer(n),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,n){if(t){const r=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:ae.toPathString(e.path),t(r,n,e)}},ae.prototype._trace=function(e,t,n,r,o,i,a,s){let c;if(!e.length)return c={path:n,value:t,parent:r,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(b=>{u.push(b)}):u.push(p)}if((typeof l!="string"||s)&&t&&Object.hasOwn(t,l))h(this._trace(d,t[l],yt(n,l),t,l,i,a));else if(l==="*")this._walk(t,p=>{h(this._trace(d,t[p],yt(n,p),t,p,i,!0,!0))});else if(l==="..")h(this._trace(d,t,n,r,o,i,a)),this._walk(t,p=>{typeof t[p]=="object"&&h(this._trace(e.slice(),t[p],yt(n,p),t,p,i,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:d,isParentSelector:!0};if(l==="~")return c={path:yt(n,l),value:o,parent:r,parentProperty:null},this._handleCallback(c,i,"property"),c;if(l==="$")h(this._trace(d,t,n,null,null,i,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))h(this._slice(l,d,t,n,r,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"),b=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(p);b?this._walk(t,f=>{const v=[b[2]],g=b[1]?t[f][b[1]]:t[f];this._trace(v,g,n,r,o,i,!0).length>0&&h(this._trace(d,t[f],yt(n,f),t,f,i,!0))}):this._walk(t,f=>{this._eval(p,t[f],f,n,r,o)&&h(this._trace(d,t[f],yt(n,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(Ao(this._eval(l,t,n.at(-1),n.slice(0,-1),r,o),d),t,n,r,o,i,a))}else if(l[0]==="@"){let p=!1;const b=l.slice(1,-2);switch(b){case"scalar":(!t||!["object","function"].includes(typeof t))&&(p=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===b&&(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===b&&(p=!0);break;case"array":Array.isArray(t)&&(p=!0);break;case"other":p=this.currOtherTypeCallback(t,n,r,o);break;case"null":t===null&&(p=!0);break;default:throw new TypeError("Unknown value type "+b)}if(p)return c={path:n,value:t,parent:r,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(n,p),t,p,i,a,!0))}else if(l.includes(",")){const p=l.split(",");for(const b of p)h(this._trace(Ao(b,d),t,n,r,o,i,!0))}else!s&&t&&Object.hasOwn(t,l)&&h(this._trace(d,t[l],yt(n,l),t,l,i,a,!0))}if(this._hasParentSelector)for(let p=0;p<u.length;p++){const b=u[p];if(b&&b.isParentSelector){const f=this._trace(b.expr,t,b.path,r,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 n=e.length;for(let r=0;r<n;r++)t(r)}else e&&typeof e=="object"&&Object.keys(e).forEach(n=>{t(n)})},ae.prototype._slice=function(e,t,n,r,o,i,a){if(!Array.isArray(n))return;const s=n.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(Ao(p,t),n,r,o,i,a,!0).forEach(f=>{h.push(f)});return h},ae.prototype._eval=function(e,t,n,r,o,i){this.currSandbox._$_parentProperty=i,this.currSandbox._$_parent=o,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const a=e.includes("@path");a&&(this.currSandbox._$_path=ae.toPathString(r.concat([n])));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,n=t.length;let r="$";for(let o=1;o<n;o++)/^(~|\^|@.*?\(\))$/u.test(t[o])||(r+=/^[0-9*]+$/u.test(t[o])?"["+t[o]+"]":"['"+t[o]+"']");return r},ae.toPointer=function(e){const t=e,n=t.length;let r="";for(let o=1;o<n;o++)/^(~|\^|@.*?\(\))$/u.test(t[o])||(r+="/"+t[o].toString().replaceAll("~","~0").replaceAll("/","~1"));return r},ae.toPathArray=function(e){const{cache:t}=ae;if(t[e])return t[e].concat();const n=[],o=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(i,a){return"[#"+(n.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:n[a[1]]});return t[e]=o,t[e].concat()},ae.prototype.safeVm={Script:Cy};const Oy=function(e,t,n){const r=e.length;for(let o=0;o<r;o++){const i=e[o];n(i)&&t.push(e.splice(o--,1)[0])}};class _y{constructor(t){this.code=t}runInNewContext(t){let n=this.code;const r=Object.keys(t),o=[];Oy(r,o,l=>typeof t[l]=="function");const i=r.map(l=>t[l]);n=o.reduce((l,d)=>{let u=t[d].toString();return/function/u.test(u)||(u="function "+u),"var "+d+"="+u+";"+l},"")+n,!/(['"])use strict\1/u.test(n)&&!r.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;\s*$/u,"");const s=n.lastIndexOf(";"),c=s!==-1?n.slice(0,s+1)+" return "+n.slice(s+1):" return "+n;return new Function(...r,c)(...i)}}ae.prototype.vm={Script:_y};const ky=dv(Object.freeze(Object.defineProperty({__proto__:null,JSONPath:ae},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(ir,"__esModule",{value:!0});var No=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},Py=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),My=vn,Do=dl(My),Ay=Po,Ny=_t,kt=dl(Ny),Dy=ky;function dl(e){return e&&e.__esModule?e:{default:e}}function Ty(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fy(e,t){return(0,Dy.JSONPath)({path:t,json:e,wrap:!1})}var Iy=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ty(this,e),this.factMap=new Map,this.factResultsCache=new Map,this.allowUndefinedFacts=!!t.allowUndefinedFacts,this.pathResolver=t.pathResolver||Fy,this.events={success:[],failure:[]},this.ruleResults=[]}return Py(e,[{key:"addEvent",value:function(n,r){if(!r)throw new Error('outcome required: "success" | "failure"]');this.events[r].push(n)}},{key:"getEvents",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?this.events[n]:this.events.success.concat(this.events.failure)}},{key:"addResult",value:function(n){this.ruleResults.push(n)}},{key:"getResults",value:function(){return this.ruleResults}},{key:"_getFact",value:function(n){return this.factMap.get(n)}},{key:"_addConstantFact",value:function(n){this.factMap.set(n.id,n),this._setFactValue(n,{},n.value)}},{key:"_setFactValue",value:function(n,r,o){var i=n.getCacheKey(r),a=Promise.resolve(o);return i&&this.factResultsCache.set(i,a),a}},{key:"addFact",value:function(n,r,o){var i=n,a=void 0;return n instanceof Do.default?(i=n.id,a=n):a=new Do.default(n,r,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(n,r){(0,kt.default)("almanac::addRuntimeFact",{id:n});var o=new Do.default(n,r);return this._addConstantFact(o)}},{key:"factValue",value:function(n){var r=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(n);if(s===void 0)return this.allowUndefinedFacts?Promise.resolve(void 0):Promise.reject(new Ay.UndefinedFactError("Undefined fact: "+n));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:n})):((0,kt.default)("almanac::factValue cache miss, calculating",{id:n}),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":No(d))==="object"){var u=r.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":No(d)}),d})):a}},{key:"getValue",value:function(n){return n!=null&&(typeof n>"u"?"undefined":No(n))==="object"&&Object.prototype.hasOwnProperty.call(n,"fact")?this.factValue(n.fact,n.params,n.path):Promise.resolve(n)}}]),e}();ir.default=Iy;var To={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});var Wy=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function jy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ly=function(){function e(t,n,r){if(jy(this,e),this.name=String(t),!t)throw new Error("Missing operator name");if(typeof n!="function")throw new Error("Missing operator callback");this.cb=n,this.factValueValidator=r,this.factValueValidator||(this.factValueValidator=function(){return!0})}return Wy(e,[{key:"evaluate",value:function(n,r){return this.factValueValidator(n)&&this.cb(n,r)}}]),e}();Gt.default=Ly,Object.defineProperty(To,"__esModule",{value:!0});var By=Gt,Ge=$y(By);function $y(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 ar(e){return Number.parseFloat(e).toString()!=="NaN"}je.push(new Ge.default("lessThan",function(e,t){return e<t},ar)),je.push(new Ge.default("lessThanInclusive",function(e,t){return e<=t},ar)),je.push(new Ge.default("greaterThan",function(e,t){return e>t},ar)),je.push(new Ge.default("greaterThanInclusive",function(e,t){return e>=t},ar)),To.default=je;var Fo={},xn={};Object.defineProperty(xn,"__esModule",{value:!0});var Ry=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Vy=Gt,Hy=Uy(Vy);function Uy(e){return e&&e.__esModule?e:{default:e}}function Yy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var zy=function(){function e(t,n,r){if(Yy(this,e),this.name=String(t),!t)throw new Error("Missing decorator name");if(typeof n!="function")throw new Error("Missing decorator callback");this.cb=n,this.factValueValidator=r,this.factValueValidator||(this.factValueValidator=function(){return!0})}return Ry(e,[{key:"decorate",value:function(n){var r=this,o=n.evaluate.bind(n);return new Hy.default(this.name+":"+n.name,function(i,a){return r.cb(i,a,o)},this.factValueValidator)}}]),e}();xn.default=zy,Object.defineProperty(Fo,"__esModule",{value:!0});var qy=xn,Xt=Ky(qy);function Ky(e){return e&&e.__esModule?e:{default:e}}var Pt=[];Pt.push(new Xt.default("someFact",function(e,t,n){return e.some(function(r){return n(r,t)})},Array.isArray)),Pt.push(new Xt.default("someValue",function(e,t,n){return t.some(function(r){return n(e,r)})})),Pt.push(new Xt.default("everyFact",function(e,t,n){return e.every(function(r){return n(r,t)})},Array.isArray)),Pt.push(new Xt.default("everyValue",function(e,t,n){return t.every(function(r){return n(e,r)})})),Pt.push(new Xt.default("swap",function(e,t,n){return n(t,e)})),Pt.push(new Xt.default("not",function(e,t,n){return!n(e,t)})),Fo.default=Pt;var Io={};Object.defineProperty(Io,"__esModule",{value:!0});var Gy=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Xy=Gt,Wo=Lo(Xy),Qy=xn,jo=Lo(Qy),Zy=_t,sr=Lo(Zy);function Lo(e){return e&&e.__esModule?e:{default:e}}function Jy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var eb=function(){function e(){Jy(this,e),this.operators=new Map,this.decorators=new Map}return Gy(e,[{key:"addOperator",value:function(n,r){var o=void 0;n instanceof Wo.default?o=n:o=new Wo.default(n,r),(0,sr.default)("operatorMap::addOperator",{name:o.name}),this.operators.set(o.name,o)}},{key:"removeOperator",value:function(n){var r=void 0;n instanceof Wo.default?r=n.name:r=n;for(var o=":"+r,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(r)}},{key:"addOperatorDecorator",value:function(n,r){var o=void 0;n instanceof jo.default?o=n:o=new jo.default(n,r),(0,sr.default)("operatorMap::addOperatorDecorator",{name:o.name}),this.decorators.set(o.name,o)}},{key:"removeOperatorDecorator",value:function(n){var r=void 0;n instanceof jo.default?r=n.name:r=n;for(var o=r+":",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(r)}},{key:"get",value:function(n){for(var r=[],o=n;!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,sr.default)("operatorMap::get invalid decorator",{name:a}),null;r.unshift(s),o=o.slice(i+1)}else return(0,sr.default)("operatorMap::get no operator",{name:o}),null}for(var c=this.operators.get(o),l=0;l<r.length;l++)c=r[l].decorate(c),this.operators.set(c.name,c);return c}}]),e}();Io.default=eb,Object.defineProperty(it,"__esModule",{value:!0}),it.FINISHED=it.RUNNING=it.READY=void 0;var tb=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},nb=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),rb=vn,En=st(rb),ob=nr,Bo=st(ob),ib=ir,ab=st(ib),sb=ll,cb=st(sb),lb=To,ub=st(lb),db=Fo,fb=st(db),hb=_t,Qt=st(hb),pb=rr,mb=st(pb),gb=Io,vb=st(gb);function st(e){return e&&e.__esModule?e:{default:e}}function yb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bb(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 wb(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 xb=it.READY="READY",fl=it.RUNNING="RUNNING",hl=it.FINISHED="FINISHED",Eb=function(e){wb(t,e);function t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};yb(this,t);var o=bb(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.rules=[],o.allowUndefinedFacts=r.allowUndefinedFacts||!1,o.allowUndefinedConditions=r.allowUndefinedConditions||!1,o.replaceFactsInEventParams=r.replaceFactsInEventParams||!1,o.pathResolver=r.pathResolver,o.operators=new vb.default,o.facts=new Map,o.conditions=new Map,o.status=xb,n.map(function(i){return o.addRule(i)}),ub.default.map(function(i){return o.addOperator(i)}),fb.default.map(function(i){return o.addOperatorDecorator(i)}),o}return nb(t,[{key:"addRule",value:function(r){if(!r)throw new Error("Engine: addRule() requires options");var o=void 0;if(r instanceof Bo.default)o=r;else{if(!Object.prototype.hasOwnProperty.call(r,"event"))throw new Error('Engine: addRule() argument requires "event" property');if(!Object.prototype.hasOwnProperty.call(r,"conditions"))throw new Error('Engine: addRule() argument requires "conditions" property');o=new Bo.default(r)}return o.setEngine(this),this.rules.push(o),this.prioritizedRules=null,this}},{key:"updateRule",value:function(r){var o=this.rules.findIndex(function(i){return i.name===r.name});if(o>-1)this.rules.splice(o,1),this.addRule(r),this.prioritizedRules=null;else throw new Error("Engine: updateRule() rule not found")}},{key:"removeRule",value:function(r){var o=!1;if(r instanceof Bo.default){var a=this.rules.indexOf(r);a>-1&&(o=!!this.rules.splice(a,1).length)}else{var i=this.rules.filter(function(s){return s.name!==r});o=i.length!==this.rules.length,this.rules=i}return o&&(this.prioritizedRules=null),o}},{key:"setCondition",value:function(r,o){if(!r)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(r,new mb.default(o)),this}},{key:"removeCondition",value:function(r){return this.conditions.delete(r)}},{key:"addOperator",value:function(r,o){this.operators.addOperator(r,o)}},{key:"removeOperator",value:function(r){return this.operators.removeOperator(r)}},{key:"addOperatorDecorator",value:function(r,o){this.operators.addOperatorDecorator(r,o)}},{key:"removeOperatorDecorator",value:function(r){return this.operators.removeOperatorDecorator(r)}},{key:"addFact",value:function(r,o,i){var a=r,s=void 0;return r instanceof En.default?(a=r.id,s=r):s=new En.default(r,o,i),(0,Qt.default)("engine::addFact",{id:a}),this.facts.set(a,s),this}},{key:"removeFact",value:function(r){var o=void 0;return r instanceof En.default?o=r.id:o=r,this.facts.delete(o)}},{key:"prioritizeRules",value:function(){if(!this.prioritizedRules){var r=this.rules.reduce(function(o,i){var a=i.priority;return o[a]||(o[a]=[]),o[a].push(i),o},{});this.prioritizedRules=Object.keys(r).sort(function(o,i){return Number(o)>Number(i)?-1:1}).map(function(o){return r[o]})}return this.prioritizedRules}},{key:"stop",value:function(){return this.status=hl,this}},{key:"getFact",value:function(r){return this.facts.get(r)}},{key:"evaluateRules",value:function(r,o){var i=this;return Promise.all(r.map(function(a){return i.status!==fl?((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 r=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=fl;var a=i.almanac||new ab.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 En.default?c=o[s]:c=new En.default(s,o[s]),a.addFact(c),(0,Qt.default)("engine::run initialized runtime fact",{id:c.id,value:c.value,type:tb(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 r.evaluateRules(p,a)}).catch(h),d}),d.then(function(){r.status=hl,(0,Qt.default)("engine::run completed");var p=a.getResults(),b=p.reduce(function(g,y){var x=y.result?"results":"failureResults";return g[x].push(y),g},{results:[],failureResults:[]}),f=b.results,v=b.failureResults;u({almanac:a,results:f,failureResults:v,events:a.getEvents("success"),failureEvents:a.getEvents("failure")})}).catch(h)})}}]),t}(cb.default);it.default=Eb,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 pl.default(e,t)};var Cb=it,pl=Zt(Cb),Sb=vn,Ob=Zt(Sb),_b=nr,kb=Zt(_b),Pb=Gt,Mb=Zt(Pb),Ab=ir,Nb=Zt(Ab),Db=xn,Tb=Zt(Db);function Zt(e){return e&&e.__esModule?e:{default:e}}_e.Fact=Ob.default,_e.Rule=kb.default,_e.Operator=Mb.default,_e.Engine=pl.default,_e.Almanac=Nb.default,_e.OperatorDecorator=Tb.default;var Fb=_e;function Ib(e){const t=new Map;return e.forEach(n=>{var o;(((o=n.event.params)==null?void 0:o.fields)||[]).forEach(i=>{t.has(i)||t.set(i,{field:i,events:[]}),t.get(i).events.push({type:n.event.type,rule:n})})}),t}async function ml(e,t,n=!1){const r=Ib(e),o=new Fb.Engine;o.addOperator("empty",(h,p)=>{const b=!h||h===""||Array.isArray(h)&&h.length===0;return p?b:!b}),o.addOperator("notEmpty",(h,p)=>{const b=!h||h===""||Array.isArray(h)&&h.length===0;return p?!b:b}),cv(e).forEach(h=>o.addRule(h));const a=Eo(t||{});e.forEach(h=>{const p=b=>{Object.keys(b).forEach(f=>{f!=="all"&&f!=="any"&&(f in a||(a[f]=void 0))}),b.all&&b.all.forEach(f=>p(f)),b.any&&b.any.forEach(f=>p(f))};p(h.conditions)});const{events:s}=await o.run(a),c=new Map;s.forEach(h=>{var b;(((b=h.params)==null?void 0:b.fields)||[]).forEach(f=>{c.has(f)||c.set(f,new Set),c.get(f).add(h.type)})}),n&&(console.log("Initial state analysis:"),console.log("- Field mappings:",Array.from(r.entries())),console.log("- Initial facts:",a),console.log("- Triggered events:",Array.from(c.entries())));const l=new Set,d=new Set,u=new Set;return r.forEach((h,p)=>{const b=c.get(p)||new Set,f=h.events.some(S=>S.type==="show"),v=h.events.some(S=>S.type==="hide");(f&&!b.has("show")||v&&b.has("hide"))&&l.add(p);const g=h.events.some(S=>S.type==="enable"),y=h.events.some(S=>S.type==="disable");(g&&!b.has("enable")||y&&b.has("disable"))&&d.add(p);const x=h.events.some(S=>S.type==="require"),O=h.events.some(S=>S.type==="unrequire");(x&&b.has("require")||O&&!b.has("unrequire"))&&u.add(p)}),n&&console.log("Determined initial state:",{hidden:Array.from(l),disabled:Array.from(d),required:Array.from(u)}),{hiddenFields:l,disabledFields:d,requiredFields:u}}const Wb=({schema:e,uiSchema:t={},formData:n,conditionalRules:r,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(!1),[p,b]=D.useState(n||{});D.useEffect(()=>{(async()=>{if(!r||r.length===0){h(!0);return}try{const S=await ml(r,n||{},o);d(S),h(!0),o&&console.log("Initial conditional state determined:",{hidden:Array.from(S.hiddenFields),disabled:Array.from(S.disabledFields),required:Array.from(S.requiredFields)})}catch(S){console.error("Error determining initial conditional state:",S),h(!0)}})()},[]);const f=D.useCallback(async O=>{if(!r||r.length===0){d({hiddenFields:new Set,disabledFields:new Set,requiredFields:new Set});return}try{const S=await ml(r,O,o);d(S)}catch(S){console.error("Error evaluating conditional rules:",S)}},[r,o]);D.useEffect(()=>{f(p)},[p,f]);const{schema:v,uiSchema:g}=D.useMemo(()=>{const O=uv(e,t,l);return o&&l.requiredFields.size>0&&console.log("Modified schema required fields:",O.schema.required),O},[e,t,l,o]),y=D.useCallback(O=>{o&&console.log("Field changed:",O),i==null||i(O),O.formData&&b(O.formData)},[i,o]),x=D.useCallback(O=>{b(O.formData),c.onChange&&c.onChange(O)},[c]);return u?w.jsx(Zc,{...c,schema:v,uiSchema:g,formData:p,onChange:x,onFieldChange:y,onFieldFocus:a,onFieldBlur:s}):null};Y.validator=Yo,Object.defineProperty(Y,"generateTheme",{enumerable:!0,get:()=>bl.generateTheme}),Y.AddressField=li,Y.ArrayFieldItemTemplate=yi,Y.ArrayFieldTemplate=vi,Y.ColorWidget=xi,Y.ConditionalForm=Wb,Y.CurrencyField=pi,Y.DateTimeWidget=wo,Y.DateWidget=yu,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=av,Y.FormEventProvider=di,Y.GridLayout=iv,Y.HorizontalLayout=rv,Y.PasswordWidget=bo,Y.PhoneField=hi,Y.RangeWidget=Vi,Y.RatingWidget=Hi,Y.TelephoneWidget=go,Y.URLWidget=yo,Y.VerticalLayout=ev,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=sv,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});