ynotsoft-dynamic-form 1.0.133 → 1.0.134

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
- (function(me,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react/jsx-runtime"),require("react"),require("react-hot-toast"),require("dayjs"),require("react-select"),require("react-select/animated"),require("react-dom"),require("@tiptap/react"),require("@tiptap/starter-kit"),require("@tiptap/extension-underline"),require("@tiptap/extension-character-count"),require("react-day-picker"),require("react-day-picker/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-hot-toast","dayjs","react-select","react-select/animated","react-dom","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-underline","@tiptap/extension-character-count","react-day-picker","react-day-picker/dist/style.css"],c):(me=typeof globalThis<"u"?globalThis:me||self,c(me.YnotsoftDynamicForm={},me.jsxRuntime,me.React,me.ReactHotToast,me.dayjs,me.ReactSelect,me.ReactSelectAnimated,me.ReactDOM,me.TiptapReact,me.StarterKit,null,me.CharacterCount,me.ReactDayPicker))})(this,(function(me,c,R,tn,nn,Zi,Ji,uo,fo,ec,Uh,tc,Zn){"use strict";function po(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 f=po(R),rn=po(uo);function nc(e){return c.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function rc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=e.disabled&&typeof e.disabled=="function"?e.disabled(t):e.disabled,i=s||a,l=e.options||[],u=Ji(),d=t[e.name]||e.value||[],h=p=>Array.isArray(p)&&p.length>0&&typeof p[0]=="object"&&p[0]!==null&&"value"in p[0];let g;return h(d)?g=d:g=d.filter(p=>p!=null).map(p=>l.find(b=>b.value===p)).filter(p=>p!==void 0),c.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:c.jsx(Zi,{components:u,isMulti:!0,isDisabled:i,name:e.label,value:g,onChange:p=>{const b=p.map(m=>m.value);n(e.name,b)},options:l,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>r(e.name),classNamePrefix:"react-select",classNames:{control:p=>`!rounded-lg !min-h-[42px] transition duration-150 !shadow-sm
1
+ (function(me,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react/jsx-runtime"),require("react"),require("react-hot-toast"),require("dayjs"),require("react-select"),require("react-select/animated"),require("react-dom"),require("@tiptap/react"),require("@tiptap/starter-kit"),require("@tiptap/extension-underline"),require("@tiptap/extension-character-count"),require("react-day-picker"),require("react-day-picker/dist/style.css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-hot-toast","dayjs","react-select","react-select/animated","react-dom","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-underline","@tiptap/extension-character-count","react-day-picker","react-day-picker/dist/style.css"],c):(me=typeof globalThis<"u"?globalThis:me||self,c(me.YnotsoftDynamicForm={},me.jsxRuntime,me.React,me.ReactHotToast,me.dayjs,me.ReactSelect,me.ReactSelectAnimated,me.ReactDOM,me.TiptapReact,me.StarterKit,null,me.CharacterCount,me.ReactDayPicker))})(this,(function(me,c,z,tn,nn,Zi,Ji,uo,fo,ec,Uh,tc,Zn){"use strict";function po(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 p=po(z),rn=po(uo);function nc(e){return c.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function rc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=e.disabled&&typeof e.disabled=="function"?e.disabled(t):e.disabled,i=s||a,l=e.options||[],u=Ji(),d=t[e.name]||e.value||[],m=h=>Array.isArray(h)&&h.length>0&&typeof h[0]=="object"&&h[0]!==null&&"value"in h[0];let g;return m(d)?g=d:g=d.filter(h=>h!=null).map(h=>l.find(y=>y.value===h)).filter(h=>h!==void 0),c.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:c.jsx(Zi,{components:u,isMulti:!0,isDisabled:i,name:e.label,value:g,onChange:h=>{const y=h.map(f=>f.value);n(e.name,y)},options:l,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>r(e.name),classNamePrefix:"react-select",classNames:{control:h=>`!rounded-lg !min-h-[42px] transition duration-150 !shadow-sm
2
2
  ${o?"!border-red-500":"!border-gray-300"}
3
3
  ${i?"!bg-gray-100 !cursor-not-allowed":"!bg-white"}
4
- ${!i&&p.isFocused?"!border-blue-500 ring-2 ring-blue-200":""}
5
- ${!i&&!p.isFocused&&!o?"hover:!border-gray-400":""}
6
- `,valueContainer:()=>"py-0.5 px-2",placeholder:()=>"text-gray-400",dropdownIndicator:()=>"!text-gray-400 hover:!text-gray-600",multiValue:()=>"!bg-blue-100 !text-blue-800 !rounded-md",multiValueLabel:()=>"!text-blue-800 !pr-1",multiValueRemove:()=>"!text-blue-500 hover:!bg-blue-200 hover:!text-blue-700 !rounded-r-md",menu:()=>"!shadow-lg !rounded-lg !mt-2 !z-50",option:p=>`!py-2 !px-3 !text-sm !cursor-pointer
7
- ${p.isSelected?"!bg-blue-500 !text-white":""}
8
- ${p.isFocused&&!p.isSelected?"!bg-gray-100 !text-gray-800":""}
9
- `}})})}const oc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),mo=e=>{const t=sc(e);return t.charAt(0).toUpperCase()+t.slice(1)},ho=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ac=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ic={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"};const cc=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},l)=>R.createElement("svg",{ref:l,...ic,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ho("lucide",o),...!s&&!ac(i)&&{"aria-hidden":"true"},...i},[...a.map(([u,d])=>R.createElement(u,d)),...Array.isArray(s)?s:[s]]));const ie=(e,t)=>{const n=R.forwardRef(({className:r,...o},s)=>R.createElement(cc,{ref:s,iconNode:t,className:ho(`lucide-${oc(mo(e))}`,`lucide-${e}`,r),...o}));return n.displayName=mo(e),n};const lc=ie("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const go=ie("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const uc=ie("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const on=ie("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const dc=ie("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const fc=ie("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const pc=ie("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const mc=ie("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const hc=ie("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const gc=ie("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const bc=ie("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);const yc=ie("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);const vc=ie("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);const wc=ie("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);const xc=ie("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Sc=ie("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const Cc=ie("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const Ec=ie("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);const bo=ie("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Nc=ie("message-square-quote",[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]]);const kc=ie("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);const Ac=ie("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const Tc=ie("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);const Pc=ie("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);const _c=ie("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);const Jn=ie("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Oc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,apiClient:a,...i}){const l=s,u=e.selectMode!=="multiple",d=e.returnValueOnly===!0,[h,g]=R.useState([]),[p,b]=R.useState(!1),[m,v]=R.useState(!1),[S,k]=R.useState(""),[N,w]=R.useState(-1),[x,A]=R.useState({}),O=R.useRef(null),T=R.useRef(null),z=R.useRef(null),$=t[e.name],q=R.useCallback(()=>$?(Array.isArray($)?$:[$]).map(M=>{if(M&&typeof M=="object"&&M.value!==void 0)return{value:M.value,label:M.label||M.value};const D=h.find(V=>V.value===M);return D||(x[M]?x[M]:{value:M,label:M})}):[],[$,h,x])(),I=R.useCallback(async(E="")=>{if(e.onSearch){const M=await e.onSearch(E,t);g((M||[]).map(D=>({value:D[e.valueId||"value"]??D.value??D.id,label:D[e.labelId||"label"]??D.label??D.name,description:D.description})));return}if(!e.optionsUrl||!a){const M=(e.options||[]).map(D=>({value:D[e.valueId||"value"]||D.value||D.id,label:D[e.labelId||"label"]||D.label||D.name,description:D.description}));g(E?M.filter(D=>String(D.label).toLowerCase().includes(E.toLowerCase())):M);return}b(!0);try{const M=e.searchParam||"search",D=e.optionsUrl.includes("?")?"&":"?",V=`${e.optionsUrl}${D}${M}=${encodeURIComponent(E)}`,se=await a(V),Z=se.data||se,ge=Array.isArray(Z)?Z:[];g(ge.map(Y=>({value:Y[e.valueId||"value"]||Y.value||Y.id,label:Y[e.labelId||"label"]||Y.label||Y.name,description:Y.description})))}catch{g([])}finally{b(!1)}},[e,a,t]),C=R.useCallback(E=>{if(!E)return;A(V=>({...V,[E.value]:E}));const M=d?E.value:{value:E.value,label:E.label};let D;if(u)D=[M],v(!1);else{const V=Array.isArray($)?$:[];D=V.some(Z=>(Z?.value??Z)===E.value)?V.filter(Z=>(Z?.value??Z)!==E.value):[...V,M]}n(e.name,D),r(e.name),e.clearSearchOnSelect&&k("")},[$,e.clearSearchOnSelect,e.name,n,r,u,d]),P=E=>{if(!l)switch(E.key){case"ArrowDown":E.preventDefault(),m?w(M=>M<h.length-1?M+1:M):v(!0);break;case"ArrowUp":E.preventDefault(),m&&w(M=>M>0?M-1:0);break;case"Enter":E.preventDefault(),m&&N>=0&&h[N]?C(h[N]):m||v(!0);break;case"Escape":v(!1);break;case"Tab":v(!1),r(e.name);break}},_=E=>{const M=E.target.value;k(M),w(-1),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>I(M),300)};R.useEffect(()=>{if(m){I(S);const E=setTimeout(()=>T.current?.focus(),50);return()=>clearTimeout(E)}else w(-1)},[m,I,S]),R.useEffect(()=>{if(!m)return;const E=M=>{O.current&&!O.current.contains(M.target)&&(v(!1),r(e.name))};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[m,e.name,r]);const F=(E,M)=>{E.stopPropagation();const D=Array.isArray($)?$:[],V=u?[]:D.filter(se=>(se?.value??se)!==M);n(e.name,V),r(e.name)};return c.jsxs("div",{className:`mb-4 relative ${e.fieldClass||"col-span-full"}`,ref:O,children:[c.jsxs("div",{role:"combobox","aria-expanded":m,"aria-haspopup":"listbox","aria-controls":`${e.name}-listbox`,tabIndex:l?-1:0,onClick:()=>!l&&v(!m),onKeyDown:P,className:`
4
+ ${!i&&h.isFocused?"!border-blue-500 ring-2 ring-blue-200":""}
5
+ ${!i&&!h.isFocused&&!o?"hover:!border-gray-400":""}
6
+ `,valueContainer:()=>"py-0.5 px-2",placeholder:()=>"text-gray-400",dropdownIndicator:()=>"!text-gray-400 hover:!text-gray-600",multiValue:()=>"!bg-blue-100 !text-blue-800 !rounded-md",multiValueLabel:()=>"!text-blue-800 !pr-1",multiValueRemove:()=>"!text-blue-500 hover:!bg-blue-200 hover:!text-blue-700 !rounded-r-md",menu:()=>"!shadow-lg !rounded-lg !mt-2 !z-50",option:h=>`!py-2 !px-3 !text-sm !cursor-pointer
7
+ ${h.isSelected?"!bg-blue-500 !text-white":""}
8
+ ${h.isFocused&&!h.isSelected?"!bg-gray-100 !text-gray-800":""}
9
+ `}})})}const oc=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),mo=e=>{const t=sc(e);return t.charAt(0).toUpperCase()+t.slice(1)},ho=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ac=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ic={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"};const cc=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},l)=>z.createElement("svg",{ref:l,...ic,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ho("lucide",o),...!s&&!ac(i)&&{"aria-hidden":"true"},...i},[...a.map(([u,d])=>z.createElement(u,d)),...Array.isArray(s)?s:[s]]));const ie=(e,t)=>{const n=z.forwardRef(({className:r,...o},s)=>z.createElement(cc,{ref:s,iconNode:t,className:ho(`lucide-${oc(mo(e))}`,`lucide-${e}`,r),...o}));return n.displayName=mo(e),n};const lc=ie("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const go=ie("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const uc=ie("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const on=ie("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const dc=ie("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const fc=ie("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const pc=ie("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const mc=ie("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const hc=ie("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);const gc=ie("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const bc=ie("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);const yc=ie("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);const vc=ie("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);const wc=ie("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);const xc=ie("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Sc=ie("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const Cc=ie("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const Ec=ie("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);const bo=ie("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Nc=ie("message-square-quote",[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]]);const kc=ie("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);const Ac=ie("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const Tc=ie("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);const Pc=ie("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);const _c=ie("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);const Jn=ie("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Oc({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,apiClient:a,...i}){const l=s,u=e.selectMode!=="multiple",d=e.returnValueOnly===!0,[m,g]=z.useState([]),[h,y]=z.useState(!1),[f,b]=z.useState(!1),[S,k]=z.useState(""),[E,w]=z.useState(-1),[T,L]=z.useState({}),A=z.useRef(null),x=z.useRef(null),$=z.useRef(null),W=t[e.name],j=z.useCallback(()=>W?(Array.isArray(W)?W:[W]).map(O=>{if(O&&typeof O=="object"&&O.value!==void 0)return{value:O.value,label:O.label||O.value};const M=m.find(G=>G.value===O);return M||(T[O]?T[O]:{value:O,label:O})}):[],[W,m,T])(),D=z.useCallback(async(N="")=>{if(e.onSearch){const O=await e.onSearch(N,t);g((O||[]).map(M=>({value:M[e.valueId||"value"]??M.value??M.id,label:M[e.labelId||"label"]??M.label??M.name,description:M.description})));return}if(!e.optionsUrl||!a){const O=(e.options||[]).map(M=>({value:M[e.valueId||"value"]||M.value||M.id,label:M[e.labelId||"label"]||M.label||M.name,description:M.description}));g(N?O.filter(M=>String(M.label).toLowerCase().includes(N.toLowerCase())):O);return}y(!0);try{const O=e.searchParam||"search",M=e.optionsUrl.includes("?")?"&":"?",G=`${e.optionsUrl}${M}${O}=${encodeURIComponent(N)}`,se=await a(G),Z=se.data||se,ge=Array.isArray(Z)?Z:[];g(ge.map(q=>({value:q[e.valueId||"value"]||q.value||q.id,label:q[e.labelId||"label"]||q.label||q.name,description:q.description})))}catch{g([])}finally{y(!1)}},[e,a,t]),C=z.useCallback(N=>{if(!N)return;L(G=>({...G,[N.value]:N}));const O=d?N.value:{value:N.value,label:N.label};let M;if(u)M=[O],b(!1);else{const G=Array.isArray(W)?W:[];M=G.some(Z=>(Z?.value??Z)===N.value)?G.filter(Z=>(Z?.value??Z)!==N.value):[...G,O]}n(e.name,M),r(e.name),e.clearSearchOnSelect&&k("")},[W,e.clearSearchOnSelect,e.name,n,r,u,d]),P=N=>{if(!l)switch(N.key){case"ArrowDown":N.preventDefault(),f?w(O=>O<m.length-1?O+1:O):b(!0);break;case"ArrowUp":N.preventDefault(),f&&w(O=>O>0?O-1:0);break;case"Enter":N.preventDefault(),f&&E>=0&&m[E]?C(m[E]):f||b(!0);break;case"Escape":b(!1);break;case"Tab":b(!1),r(e.name);break}},_=N=>{const O=N.target.value;k(O),w(-1),$.current&&clearTimeout($.current),$.current=setTimeout(()=>D(O),300)};z.useEffect(()=>{if(f){D(S);const N=setTimeout(()=>x.current?.focus(),50);return()=>clearTimeout(N)}else w(-1)},[f,D,S]),z.useEffect(()=>{if(!f)return;const N=O=>{A.current&&!A.current.contains(O.target)&&(b(!1),r(e.name))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[f,e.name,r]);const F=(N,O)=>{N.stopPropagation();const M=Array.isArray(W)?W:[],G=u?[]:M.filter(se=>(se?.value??se)!==O);n(e.name,G),r(e.name)};return c.jsxs("div",{className:`mb-4 relative ${e.fieldClass||"col-span-full"}`,ref:A,children:[c.jsxs("div",{role:"combobox","aria-expanded":f,"aria-haspopup":"listbox","aria-controls":`${e.name}-listbox`,tabIndex:l?-1:0,onClick:()=>!l&&b(!f),onKeyDown:P,className:`
10
10
  w-full min-h-10 px-2 py-1 border rounded-lg bg-background cursor-pointer
11
11
  flex items-center flex-wrap gap-2 transition-all outline-none
12
12
  ${o?"border-destructive ring-1 ring-destructive":"border-input hover:border-accent-foreground/20"}
13
- ${m?"ring-2 ring-ring border-primary":"focus-visible:ring-2 focus-visible:ring-ring"}
13
+ ${f?"ring-2 ring-ring border-primary":"focus-visible:ring-2 focus-visible:ring-ring"}
14
14
  ${l?"bg-muted opacity-60 cursor-not-allowed":""}
15
- `,children:[q.length>0?q.map(E=>c.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-sm border border-primary/20",children:[E.label,!l&&c.jsx("button",{type:"button","aria-label":`Remove ${E.label}`,onClick:M=>F(M,E.value),className:"ml-1 p-0.5 hover:bg-primary/20 rounded-full transition-colors",children:c.jsx(Jn,{className:"w-3 h-3"})})]},E.value)):c.jsx("span",{className:"text-muted-foreground text-sm leading-tight",children:e.placeholder||"Select..."}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[p&&c.jsx(bo,{className:"w-4 h-4 animate-spin text-muted-foreground"}),c.jsx(on,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"rotate-180":""}`})]})]}),m&&!l&&c.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-popover border border-border rounded-lg shadow-xl overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-border bg-muted/30",children:c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(Ac,{className:"absolute left-3 w-4 h-4 text-muted-foreground"}),c.jsx("input",{ref:T,type:"search","aria-autocomplete":"list","aria-controls":`${e.name}-listbox`,"aria-activedescendant":N>=0?`${e.name}-opt-${N}`:void 0,value:S,onChange:_,onKeyDown:P,className:"w-full h-9 pl-9 pr-3 text-sm bg-transparent border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Type to search..."})]})}),c.jsx("div",{id:`${e.name}-listbox`,role:"listbox","aria-label":e.label,className:"max-h-60 overflow-y-auto p-1",children:h.length>0?h.map((E,M)=>{const D=q.some(se=>se.value===E.value),V=M===N;return c.jsxs("div",{id:`${e.name}-opt-${M}`,role:"option",tabIndex:-1,"aria-selected":D,onClick:()=>C(E),onKeyDown:se=>se.key==="Enter"&&C(E),onMouseEnter:()=>w(M),className:`
15
+ `,children:[j.length>0?j.map(N=>c.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-sm border border-primary/20",children:[N.label,!l&&c.jsx("button",{type:"button","aria-label":`Remove ${N.label}`,onClick:O=>F(O,N.value),className:"ml-1 p-0.5 hover:bg-primary/20 rounded-full transition-colors",children:c.jsx(Jn,{className:"w-3 h-3"})})]},N.value)):c.jsx("span",{className:"text-muted-foreground text-sm leading-tight",children:e.placeholder||"Select..."}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[h&&c.jsx(bo,{className:"w-4 h-4 animate-spin text-muted-foreground"}),c.jsx(on,{className:`w-4 h-4 text-muted-foreground transition-transform ${f?"rotate-180":""}`})]})]}),f&&!l&&c.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-popover border border-border rounded-lg shadow-xl overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-border bg-muted/30",children:c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(Ac,{className:"absolute left-3 w-4 h-4 text-muted-foreground"}),c.jsx("input",{ref:x,type:"search","aria-autocomplete":"list","aria-controls":`${e.name}-listbox`,"aria-activedescendant":E>=0?`${e.name}-opt-${E}`:void 0,value:S,onChange:_,onKeyDown:P,className:"w-full h-9 pl-9 pr-3 text-sm bg-transparent border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Type to search..."})]})}),c.jsx("div",{id:`${e.name}-listbox`,role:"listbox","aria-label":e.label,className:"max-h-60 overflow-y-auto p-1",children:m.length>0?m.map((N,O)=>{const M=j.some(se=>se.value===N.value),G=O===E;return c.jsxs("div",{id:`${e.name}-opt-${O}`,role:"option",tabIndex:-1,"aria-selected":M,onClick:()=>C(N),onKeyDown:se=>se.key==="Enter"&&C(N),onMouseEnter:()=>w(O),className:`
16
16
  px-3 py-2 text-sm rounded-md cursor-pointer flex items-center justify-between transition-colors outline-none
17
- ${V?"bg-accent text-accent-foreground":""}
18
- ${D?"text-primary font-medium":"text-foreground"}
19
- ${!V&&!D?"hover:bg-muted":""}
20
- `,children:[c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"truncate",children:E.label}),E.description&&c.jsx("span",{className:"text-xs text-muted-foreground truncate",children:E.description})]}),D&&c.jsx(uc,{className:"w-4 h-4 text-primary shrink-0 ml-2"})]},E.value)}):c.jsx("output",{className:"block py-8 text-center text-sm text-muted-foreground",children:p?"Searching...":"No results found"})})]})]})}function yo(e,[t,n]){return Math.min(n,Math.max(t,e))}function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ct(e,t=[]){let n=[];function r(s,a){const i=f.createContext(a),l=n.length;n=[...n,a];const u=h=>{const{scope:g,children:p,...b}=h,m=g?.[e]?.[l]||i,v=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:v,children:p})};u.displayName=s+"Provider";function d(h,g){const p=g?.[e]?.[l]||i,b=f.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(a=>f.createContext(a));return function(i){const l=i?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Mc(o,...t)]}function Mc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...i,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function vo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function er(...e){return t=>{let n=!1;const r=e.map(o=>{const s=vo(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():vo(e[o],null)}}}}function ce(...e){return f.useCallback(er(...e),e)}function Ce(e){const t=Dc(e),n=f.forwardRef((r,o)=>{const{children:s,...a}=r,i=f.Children.toArray(s),l=i.find(Lc);if(l){const u=l.props.children,d=i.map(h=>h===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...a,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dc(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const a=$c(o),i=Fc(s,o.props);return o.type!==f.Fragment&&(i.ref=r?er(r,a):a),f.cloneElement(o,i)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ic=Symbol("radix.slottable");function Lc(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ic}function Fc(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wo(e){const t=e+"CollectionProvider",[n,r]=ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:v,children:S}=m,k=R.useRef(null),N=R.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:N,collectionRef:k,children:S})};a.displayName=t;const i=e+"CollectionSlot",l=Ce(i),u=R.forwardRef((m,v)=>{const{scope:S,children:k}=m,N=s(i,S),w=ce(v,N.collectionRef);return c.jsx(l,{ref:w,children:k})});u.displayName=i;const d=e+"CollectionItemSlot",h="data-radix-collection-item",g=Ce(d),p=R.forwardRef((m,v)=>{const{scope:S,children:k,...N}=m,w=R.useRef(null),x=ce(v,w),A=s(d,S);return R.useEffect(()=>(A.itemMap.set(w,{ref:w,...N}),()=>{A.itemMap.delete(w)})),c.jsx(g,{[h]:"",ref:x,children:k})});p.displayName=d;function b(m){const v=s(e+"CollectionConsumer",m);return R.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const N=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((A,O)=>N.indexOf(A.ref.current)-N.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},b,r]}var zc=f.createContext(void 0);function tr(e){const t=f.useContext(zc);return e||t||"ltr"}var Rc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xo=Rc.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wc(e,t){e&&rn.flushSync(()=>e.dispatchEvent(t))}function Ke(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Bc(e,t=globalThis?.document){const n=Ke(e);f.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 Hc="DismissableLayer",nr="dismissableLayer.update",Uc="dismissableLayer.pointerDownOutside",jc="dismissableLayer.focusOutside",So,Co=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,u=f.useContext(Co),[d,h]=f.useState(null),g=d?.ownerDocument??globalThis?.document,[,p]=f.useState({}),b=ce(t,O=>h(O)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=m.indexOf(v),k=d?m.indexOf(d):-1,N=u.layersWithOutsidePointerEventsDisabled.size>0,w=k>=S,x=Yc(O=>{const T=O.target,z=[...u.branches].some($=>$.contains(T));!w||z||(o?.(O),a?.(O),O.defaultPrevented||i?.())},g),A=qc(O=>{const T=O.target;[...u.branches].some($=>$.contains(T))||(s?.(O),a?.(O),O.defaultPrevented||i?.())},g);return Bc(O=>{k===u.layers.size-1&&(r?.(O),!O.defaultPrevented&&i&&(O.preventDefault(),i()))},g),f.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(So=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Eo(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=So)}},[d,g,n,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Eo())},[d,u]),f.useEffect(()=>{const O=()=>p({});return document.addEventListener(nr,O),()=>document.removeEventListener(nr,O)},[]),c.jsx(xo.div,{...l,ref:b,style:{pointerEvents:N?w?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,A.onFocusCapture),onBlurCapture:J(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,x.onPointerDownCapture)})});rr.displayName=Hc;var Vc="DismissableLayerBranch",Gc=f.forwardRef((e,t)=>{const n=f.useContext(Co),r=f.useRef(null),o=ce(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(xo.div,{...e,ref:o})});Gc.displayName=Vc;function Yc(e,t=globalThis?.document){const n=Ke(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){No(Uc,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qc(e,t=globalThis?.document){const n=Ke(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&No(jc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Eo(){const e=new CustomEvent(nr);document.dispatchEvent(e)}function No(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Wc(o,s):o.dispatchEvent(s)}var or=0;function ko(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ao()),document.body.insertAdjacentElement("beforeend",e[1]??Ao()),or++,()=>{or===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),or--}},[])}function Ao(){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 Kc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xc=Kc.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sr="focusScope.autoFocusOnMount",ar="focusScope.autoFocusOnUnmount",To={bubbles:!1,cancelable:!0},Qc="FocusScope",ir=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,l]=f.useState(null),u=Ke(o),d=Ke(s),h=f.useRef(null),g=ce(t,m=>l(m)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let m=function(N){if(p.paused||!i)return;const w=N.target;i.contains(w)?h.current=w:Xe(h.current,{select:!0})},v=function(N){if(p.paused||!i)return;const w=N.relatedTarget;w!==null&&(i.contains(w)||Xe(h.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const x of N)x.removedNodes.length>0&&Xe(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const k=new MutationObserver(S);return i&&k.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),k.disconnect()}}},[r,i,p.paused]),f.useEffect(()=>{if(i){Oo.add(p);const m=document.activeElement;if(!i.contains(m)){const S=new CustomEvent(sr,To);i.addEventListener(sr,u),i.dispatchEvent(S),S.defaultPrevented||(Zc(rl(Po(i)),{select:!0}),document.activeElement===m&&Xe(i))}return()=>{i.removeEventListener(sr,u),setTimeout(()=>{const S=new CustomEvent(ar,To);i.addEventListener(ar,d),i.dispatchEvent(S),S.defaultPrevented||Xe(m??document.body,{select:!0}),i.removeEventListener(ar,d),Oo.remove(p)},0)}}},[i,u,d,p]);const b=f.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,S=document.activeElement;if(v&&S){const k=m.currentTarget,[N,w]=Jc(k);N&&w?!m.shiftKey&&S===w?(m.preventDefault(),n&&Xe(N,{select:!0})):m.shiftKey&&S===N&&(m.preventDefault(),n&&Xe(w,{select:!0})):S===k&&m.preventDefault()}},[n,r,p.paused]);return c.jsx(Xc.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});ir.displayName=Qc;function Zc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xe(r,{select:t}),document.activeElement!==n)return}function Jc(e){const t=Po(e),n=_o(t,e),r=_o(t.reverse(),e);return[n,r]}function Po(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 _o(e,t){for(const n of e)if(!el(n,{upTo:t}))return n}function el(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 tl(e){return e instanceof HTMLInputElement&&"select"in e}function Xe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tl(e)&&t&&e.select()}}var Oo=nl();function nl(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Mo(e,t),e.unshift(t)},remove(t){e=Mo(e,t),e[0]?.resume()}}}function Mo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rl(e){return e.filter(t=>t.tagName!=="A")}var ye=globalThis?.document?f.useLayoutEffect:()=>{},ol=f[" useId ".trim().toString()]||(()=>{}),sl=0;function Lt(e){const[t,n]=f.useState(ol());return ye(()=>{n(r=>r??String(sl++))},[e]),e||(t?`radix-${t}`:"")}const al=["top","right","bottom","left"],Qe=Math.min,Ne=Math.max,sn=Math.round,an=Math.floor,$e=e=>({x:e,y:e}),il={left:"right",right:"left",bottom:"top",top:"bottom"};function cr(e,t,n){return Ne(e,Qe(t,n))}function je(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function lr(e){return e==="x"?"y":"x"}function ur(e){return e==="y"?"height":"width"}function ze(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function dr(e){return lr(ze(e))}function cl(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=dr(e),s=ur(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=cn(a)),[a,cn(a)]}function ll(e){const t=cn(e);return[fr(e),t,fr(t)]}function fr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Do=["left","right"],Io=["right","left"],ul=["top","bottom"],dl=["bottom","top"];function fl(e,t,n){switch(e){case"top":case"bottom":return n?t?Io:Do:t?Do:Io;case"left":case"right":return t?ul:dl;default:return[]}}function pl(e,t,n,r){const o=vt(e);let s=fl(Ve(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(fr)))),s}function cn(e){const t=Ve(e);return il[t]+e.slice(t.length)}function ml(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lo(e){return typeof e!="number"?ml(e):{top:e,right:e,bottom:e,left:e}}function ln(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 Fo(e,t,n){let{reference:r,floating:o}=e;const s=ze(t),a=dr(t),i=ur(a),l=Ve(t),u=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,g=r[i]/2-o[i]/2;let p;switch(l){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:h};break;case"left":p={x:r.x-o.width,y:h};break;default:p={x:r.x,y:r.y}}switch(vt(t)){case"start":p[a]-=g*(n&&u?-1:1);break;case"end":p[a]+=g*(n&&u?-1:1);break}return p}async function hl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:g=!1,padding:p=0}=je(t,e),b=Lo(p),v=i[g?h==="floating"?"reference":"floating":h],S=ln(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:d,strategy:l})),k=h==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),w=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},x=ln(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:k,offsetParent:N,strategy:l}):k);return{top:(S.top-x.top+b.top)/w.y,bottom:(x.bottom-S.bottom+b.bottom)/w.y,left:(S.left-x.left+b.left)/w.x,right:(x.right-S.right+b.right)/w.x}}const gl=50,bl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:hl},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Fo(u,r,l),g=r,p=0;const b={};for(let m=0;m<s.length;m++){const v=s[m];if(!v)continue;const{name:S,fn:k}=v,{x:N,y:w,data:x,reset:A}=await k({x:d,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:b,rects:u,platform:i,elements:{reference:e,floating:t}});d=N??d,h=w??h,b[S]={...b[S],...x},A&&p<gl&&(p++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:d,y:h}=Fo(u,g,l)),m=-1)}return{x:d,y:h,placement:g,strategy:o,middlewareData:b}},yl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:u,padding:d=0}=je(e,t)||{};if(u==null)return{};const h=Lo(d),g={x:n,y:r},p=dr(o),b=ur(p),m=await a.getDimensions(u),v=p==="y",S=v?"top":"left",k=v?"bottom":"right",N=v?"clientHeight":"clientWidth",w=s.reference[b]+s.reference[p]-g[p]-s.floating[b],x=g[p]-s.reference[p],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let O=A?A[N]:0;(!O||!await(a.isElement==null?void 0:a.isElement(A)))&&(O=i.floating[N]||s.floating[b]);const T=w/2-x/2,z=O/2-m[b]/2-1,$=Qe(h[S],z),U=Qe(h[k],z),q=$,I=O-m[b]-U,C=O/2-m[b]/2+T,P=cr(q,C,I),_=!l.arrow&&vt(o)!=null&&C!==P&&s.reference[b]/2-(C<q?$:U)-m[b]/2<0,F=_?C<q?C-q:C-I:0;return{[p]:g[p]+F,data:{[p]:P,centerOffset:C-P-F,..._&&{alignmentOffset:F}},reset:_}}}),vl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...v}=je(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=Ve(o),k=ze(i),N=Ve(i)===i,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=g||(N||!m?[cn(i)]:ll(i)),A=b!=="none";!g&&A&&x.push(...pl(i,m,b,w));const O=[i,...x],T=await l.detectOverflow(t,v),z=[];let $=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&z.push(T[S]),h){const C=cl(o,a,w);z.push(T[C[0]],T[C[1]])}if($=[...$,{placement:o,overflows:z}],!z.every(C=>C<=0)){var U,q;const C=(((U=s.flip)==null?void 0:U.index)||0)+1,P=O[C];if(P&&(!(h==="alignment"?k!==ze(P):!1)||$.every(E=>ze(E.placement)===k?E.overflows[0]>0:!0)))return{data:{index:C,overflows:$},reset:{placement:P}};let _=(q=$.filter(F=>F.overflows[0]<=0).sort((F,E)=>F.overflows[1]-E.overflows[1])[0])==null?void 0:q.placement;if(!_)switch(p){case"bestFit":{var I;const F=(I=$.filter(E=>{if(A){const M=ze(E.placement);return M===k||M==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(M=>M>0).reduce((M,D)=>M+D,0)]).sort((E,M)=>E[1]-M[1])[0])==null?void 0:I[0];F&&(_=F);break}case"initialPlacement":_=i;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function $o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zo(e){return al.some(t=>e[t]>=0)}const wl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=je(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),i=$o(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:zo(i)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),i=$o(a,n.floating);return{data:{escapedOffsets:i,escaped:zo(i)}}}default:return{}}}}},Ro=new Set(["left","top"]);async function xl(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Ve(n),i=vt(n),l=ze(n)==="y",u=Ro.has(a)?-1:1,d=s&&l?-1:1,h=je(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof b=="number"&&(p=i==="end"?b*-1:b),l?{x:p*d,y:g*u}:{x:g*u,y:p*d}}const Sl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,l=await xl(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},Cl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:S=>{let{x:k,y:N}=S;return{x:k,y:N}}},...u}=je(e,t),d={x:n,y:r},h=await s.detectOverflow(t,u),g=ze(Ve(o)),p=lr(g);let b=d[p],m=d[g];if(a){const S=p==="y"?"top":"left",k=p==="y"?"bottom":"right",N=b+h[S],w=b-h[k];b=cr(N,b,w)}if(i){const S=g==="y"?"top":"left",k=g==="y"?"bottom":"right",N=m+h[S],w=m-h[k];m=cr(N,m,w)}const v=l.fn({...t,[p]:b,[g]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:a,[g]:i}}}}}},El=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:u=!0}=je(e,t),d={x:n,y:r},h=ze(o),g=lr(h);let p=d[g],b=d[h];const m=je(i,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const N=g==="y"?"height":"width",w=s.reference[g]-s.floating[N]+v.mainAxis,x=s.reference[g]+s.reference[N]-v.mainAxis;p<w?p=w:p>x&&(p=x)}if(u){var S,k;const N=g==="y"?"width":"height",w=Ro.has(Ve(o)),x=s.reference[h]-s.floating[N]+(w&&((S=a.offset)==null?void 0:S[h])||0)+(w?0:v.crossAxis),A=s.reference[h]+s.reference[N]+(w?0:((k=a.offset)==null?void 0:k[h])||0)-(w?v.crossAxis:0);b<x?b=x:b>A&&(b=A)}return{[g]:p,[h]:b}}}},Nl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...u}=je(e,t),d=await a.detectOverflow(t,u),h=Ve(o),g=vt(o),p=ze(o)==="y",{width:b,height:m}=s.floating;let v,S;h==="top"||h==="bottom"?(v=h,S=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(S=h,v=g==="end"?"top":"bottom");const k=m-d.top-d.bottom,N=b-d.left-d.right,w=Qe(m-d[v],k),x=Qe(b-d[S],N),A=!t.middlewareData.shift;let O=w,T=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=k),A&&!g){const $=Ne(d.left,0),U=Ne(d.right,0),q=Ne(d.top,0),I=Ne(d.bottom,0);p?T=b-2*($!==0||U!==0?$+U:Ne(d.left,d.right)):O=m-2*(q!==0||I!==0?q+I:Ne(d.top,d.bottom))}await l({...t,availableWidth:T,availableHeight:O});const z=await a.getDimensions(i.floating);return b!==z.width||m!==z.height?{reset:{rects:!0}}:{}}}};function un(){return typeof window<"u"}function wt(e){return Wo(e)?(e.nodeName||"").toLowerCase():"#document"}function ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(Wo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wo(e){return un()?e instanceof Node||e instanceof ke(e).Node:!1}function _e(e){return un()?e instanceof Element||e instanceof ke(e).Element:!1}function Ge(e){return un()?e instanceof HTMLElement||e instanceof ke(e).HTMLElement:!1}function Bo(e){return!un()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ke(e).ShadowRoot}function Ft(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function kl(e){return/^(table|td|th)$/.test(wt(e))}function dn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Al=/transform|translate|scale|rotate|perspective|filter/,Tl=/paint|layout|strict|content/,lt=e=>!!e&&e!=="none";let pr;function mr(e){const t=_e(e)?Oe(e):e;return lt(t.transform)||lt(t.translate)||lt(t.scale)||lt(t.rotate)||lt(t.perspective)||!hr()&&(lt(t.backdropFilter)||lt(t.filter))||Al.test(t.willChange||"")||Tl.test(t.contain||"")}function Pl(e){let t=Ze(e);for(;Ge(t)&&!xt(t);){if(mr(t))return t;if(dn(t))return null;t=Ze(t)}return null}function hr(){return pr==null&&(pr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pr}function xt(e){return/^(html|body|#document)$/.test(wt(e))}function Oe(e){return ke(e).getComputedStyle(e)}function fn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bo(e)&&e.host||Re(e);return Bo(t)?t.host:t}function Ho(e){const t=Ze(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ge(t)&&Ft(t)?t:Ho(t)}function $t(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ho(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=ke(o);if(s){const i=gr(a);return t.concat(a,a.visualViewport||[],Ft(o)?o:[],i&&n?$t(i):[])}else return t.concat(o,$t(o,[],n))}function gr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Uo(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ge(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=sn(n)!==s||sn(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function br(e){return _e(e)?e:e.contextElement}function St(e){const t=br(e);if(!Ge(t))return $e(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Uo(t);let a=(s?sn(n.width):n.width)/r,i=(s?sn(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const _l=$e(0);function jo(e){const t=ke(e);return!hr()||!t.visualViewport?_l:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ol(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ke(e)?!1:t}function ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=br(e);let a=$e(1);t&&(r?_e(r)&&(a=St(r)):a=St(e));const i=Ol(s,n,r)?jo(s):$e(0);let l=(o.left+i.x)/a.x,u=(o.top+i.y)/a.y,d=o.width/a.x,h=o.height/a.y;if(s){const g=ke(s),p=r&&_e(r)?ke(r):r;let b=g,m=gr(b);for(;m&&r&&p!==b;){const v=St(m),S=m.getBoundingClientRect(),k=Oe(m),N=S.left+(m.clientLeft+parseFloat(k.paddingLeft))*v.x,w=S.top+(m.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,h*=v.y,l+=N,u+=w,b=ke(m),m=gr(b)}}return ln({width:d,height:h,x:l,y:u})}function pn(e,t){const n=fn(e).scrollLeft;return t?t.left+n:ut(Re(e)).left+n}function Vo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ml(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Re(r),i=t?dn(t.floating):!1;if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},u=$e(1);const d=$e(0),h=Ge(r);if((h||!h&&!s)&&((wt(r)!=="body"||Ft(a))&&(l=fn(r)),h)){const p=ut(r);u=St(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const g=a&&!h&&!s?Vo(a,l):$e(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-l.scrollTop*u.y+d.y+g.y}}function Dl(e){return Array.from(e.getClientRects())}function Il(e){const t=Re(e),n=fn(e),r=e.ownerDocument.body,o=Ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pn(e);const i=-n.scrollTop;return Oe(r).direction==="rtl"&&(a+=Ne(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}const Go=25;function Ll(e,t){const n=ke(e),r=Re(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,l=0;if(o){s=o.width,a=o.height;const d=hr();(!d||d&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}const u=pn(r);if(u<=0){const d=r.ownerDocument,h=d.body,g=getComputedStyle(h),p=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-p);b<=Go&&(s-=b)}else u<=Go&&(s+=u);return{width:s,height:a,x:i,y:l}}function Fl(e,t){const n=ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ge(e)?St(e):$e(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:a,height:i,x:l,y:u}}function Yo(e,t,n){let r;if(t==="viewport")r=Ll(e,n);else if(t==="document")r=Il(Re(e));else if(_e(t))r=Fl(t,n);else{const o=jo(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ln(r)}function qo(e,t){const n=Ze(e);return n===t||!_e(n)||xt(n)?!1:Oe(n).position==="fixed"||qo(n,t)}function $l(e,t){const n=t.get(e);if(n)return n;let r=$t(e,[],!1).filter(i=>_e(i)&&wt(i)!=="body"),o=null;const s=Oe(e).position==="fixed";let a=s?Ze(e):e;for(;_e(a)&&!xt(a);){const i=Oe(a),l=mr(a);!l&&i.position==="fixed"&&(o=null),(s?!l&&!o:!l&&i.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ft(a)&&!l&&qo(e,a))?r=r.filter(d=>d!==a):o=i,a=Ze(a)}return t.set(e,r),r}function zl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?dn(t)?[]:$l(t,this._c):[].concat(n),r],i=Yo(t,a[0],o);let l=i.top,u=i.right,d=i.bottom,h=i.left;for(let g=1;g<a.length;g++){const p=Yo(t,a[g],o);l=Ne(p.top,l),u=Qe(p.right,u),d=Qe(p.bottom,d),h=Ne(p.left,h)}return{width:u-h,height:d-l,x:h,y:l}}function Rl(e){const{width:t,height:n}=Uo(e);return{width:t,height:n}}function Wl(e,t,n){const r=Ge(t),o=Re(t),s=n==="fixed",a=ut(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=$e(0);function u(){l.x=pn(o)}if(r||!r&&!s)if((wt(t)!=="body"||Ft(o))&&(i=fn(t)),r){const p=ut(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Vo(o,i):$e(0),h=a.left+i.scrollLeft-l.x-d.x,g=a.top+i.scrollTop-l.y-d.y;return{x:h,y:g,width:a.width,height:a.height}}function yr(e){return Oe(e).position==="static"}function Ko(e,t){if(!Ge(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Re(e)===n&&(n=n.ownerDocument.body),n}function Xo(e,t){const n=ke(e);if(dn(e))return n;if(!Ge(e)){let o=Ze(e);for(;o&&!xt(o);){if(_e(o)&&!yr(o))return o;o=Ze(o)}return n}let r=Ko(e,t);for(;r&&kl(r)&&yr(r);)r=Ko(r,t);return r&&xt(r)&&yr(r)&&!mr(r)?n:r||Pl(e)||n}const Bl=async function(e){const t=this.getOffsetParent||Xo,n=this.getDimensions,r=await n(e.floating);return{reference:Wl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hl(e){return Oe(e).direction==="rtl"}const Ul={convertOffsetParentRelativeRectToViewportRelativeRect:Ml,getDocumentElement:Re,getClippingRect:zl,getOffsetParent:Xo,getElementRects:Bl,getClientRects:Dl,getDimensions:Rl,getScale:St,isElement:_e,isRTL:Hl};function Qo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jl(e,t){let n=null,r;const o=Re(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:g,height:p}=u;if(i||t(),!g||!p)return;const b=an(h),m=an(o.clientWidth-(d+g)),v=an(o.clientHeight-(h+p)),S=an(d),N={rootMargin:-b+"px "+-m+"px "+-v+"px "+-S+"px",threshold:Ne(0,Qe(1,l))||1};let w=!0;function x(A){const O=A[0].intersectionRatio;if(O!==l){if(!w)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!Qo(u,e.getBoundingClientRect())&&a(),w=!1}try{n=new IntersectionObserver(x,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,N)}n.observe(e)}return a(!0),s}function Vl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=br(e),d=o||s?[...u?$t(u):[],...t?$t(t):[]]:[];d.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const h=u&&i?jl(u,n):null;let g=-1,p=null;a&&(p=new ResizeObserver(S=>{let[k]=S;k&&k.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=p)==null||N.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let b,m=l?ut(e):null;l&&v();function v(){const S=ut(e);m&&!Qo(m,S)&&n(),m=S,b=requestAnimationFrame(v)}return n(),()=>{var S;d.forEach(k=>{o&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),h?.(),(S=p)==null||S.disconnect(),p=null,l&&cancelAnimationFrame(b)}}const Gl=Sl,Yl=Cl,ql=vl,Kl=Nl,Xl=wl,Zo=yl,Ql=El,Zl=(e,t,n)=>{const r=new Map,o={platform:Ul,...n},s={...o.platform,_c:r};return bl(e,t,{...o,platform:s})};var Jl=typeof document<"u",eu=function(){},mn=Jl?R.useLayoutEffect:eu;function hn(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(!hn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!hn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Jo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function es(e,t){const n=Jo(e);return Math.round(t*n)/n}function vr(e){const t=f.useRef(e);return mn(()=>{t.current=e}),t}function tu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[d,h]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=f.useState(r);hn(g,r)||p(r);const[b,m]=f.useState(null),[v,S]=f.useState(null),k=f.useCallback(E=>{E!==A.current&&(A.current=E,m(E))},[]),N=f.useCallback(E=>{E!==O.current&&(O.current=E,S(E))},[]),w=s||b,x=a||v,A=f.useRef(null),O=f.useRef(null),T=f.useRef(d),z=l!=null,$=vr(l),U=vr(o),q=vr(u),I=f.useCallback(()=>{if(!A.current||!O.current)return;const E={placement:t,strategy:n,middleware:g};U.current&&(E.platform=U.current),Zl(A.current,O.current,E).then(M=>{const D={...M,isPositioned:q.current!==!1};C.current&&!hn(T.current,D)&&(T.current=D,rn.flushSync(()=>{h(D)}))})},[g,t,n,U,q]);mn(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(E=>({...E,isPositioned:!1})))},[u]);const C=f.useRef(!1);mn(()=>(C.current=!0,()=>{C.current=!1}),[]),mn(()=>{if(w&&(A.current=w),x&&(O.current=x),w&&x){if($.current)return $.current(w,x,I);I()}},[w,x,I,$,z]);const P=f.useMemo(()=>({reference:A,floating:O,setReference:k,setFloating:N}),[k,N]),_=f.useMemo(()=>({reference:w,floating:x}),[w,x]),F=f.useMemo(()=>{const E={position:n,left:0,top:0};if(!_.floating)return E;const M=es(_.floating,d.x),D=es(_.floating,d.y);return i?{...E,transform:"translate("+M+"px, "+D+"px)",...Jo(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:D}},[n,i,_.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:I,refs:P,elements:_,floatingStyles:F}),[d,I,P,_,F])}const nu=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?Zo({element:r.current,padding:o}).fn(n):{}:r?Zo({element:r,padding:o}).fn(n):{}}}},ru=(e,t)=>{const n=Gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ou=(e,t)=>{const n=Yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},su=(e,t)=>({fn:Ql(e).fn,options:[e,t]}),au=(e,t)=>{const n=ql(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{const n=Kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},cu=(e,t)=>{const n=Xl(e);return{name:n.name,fn:n.fn,options:[e,t]}},lu=(e,t)=>{const n=nu(e);return{name:n.name,fn:n.fn,options:[e,t]}};var uu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],du=uu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fu="Arrow",ts=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(du.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});ts.displayName=fu;var pu=ts,mu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ns=mu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function rs(e){const[t,n]=f.useState(void 0);return ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wr="Popper",[os,gn]=ct(wr),[hu,ss]=os(wr),as=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return c.jsx(hu,{scope:t,anchor:r,onAnchorChange:o,children:n})};as.displayName=wr;var is="PopperAnchor",cs=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ss(is,n),a=f.useRef(null),i=ce(t,a),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=r?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(ns.div,{...o,ref:i})});cs.displayName=is;var xr="PopperContent",[gu,bu]=os(xr),ls=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:b,...m}=e,v=ss(xr,n),[S,k]=f.useState(null),N=ce(t,j=>k(j)),[w,x]=f.useState(null),A=rs(w),O=A?.width??0,T=A?.height??0,z=r+(s!=="center"?"-"+s:""),$=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},U=Array.isArray(u)?u:[u],q=U.length>0,I={padding:$,boundary:U.filter(vu),altBoundary:q},{refs:C,floatingStyles:P,placement:_,isPositioned:F,middlewareData:E}=tu({strategy:"fixed",placement:z,whileElementsMounted:(...j)=>Vl(...j,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[ru({mainAxis:o+T,alignmentAxis:a}),l&&ou({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?su():void 0,...I}),l&&au({...I}),iu({...I,apply:({elements:j,rects:ee,availableWidth:Q,availableHeight:te})=>{const{width:ne,height:ae}=ee.reference,le=j.floating.style;le.setProperty("--radix-popper-available-width",`${Q}px`),le.setProperty("--radix-popper-available-height",`${te}px`),le.setProperty("--radix-popper-anchor-width",`${ne}px`),le.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),w&&lu({element:w,padding:i}),wu({arrowWidth:O,arrowHeight:T}),g&&cu({strategy:"referenceHidden",...I})]}),[M,D]=fs(_),V=Ke(b);ye(()=>{F&&V?.()},[F,V]);const se=E.arrow?.x,Z=E.arrow?.y,ge=E.arrow?.centerOffset!==0,[Y,oe]=f.useState();return ye(()=>{S&&oe(window.getComputedStyle(S).zIndex)},[S]),c.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:F?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[E.transformOrigin?.x,E.transformOrigin?.y].join(" "),...E.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(gu,{scope:n,placedSide:M,onArrowChange:x,arrowX:se,arrowY:Z,shouldHideArrow:ge,children:c.jsx(ns.div,{"data-side":M,"data-align":D,...m,ref:N,style:{...m.style,animation:F?void 0:"none"}})})})});ls.displayName=xr;var us="PopperArrow",yu={top:"bottom",right:"left",bottom:"top",left:"right"},ds=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=bu(us,r),a=yu[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(pu,{...o,ref:n,style:{...o.style,display:"block"}})})});ds.displayName=us;function vu(e){return e!==null}var wu=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=fs(n),h={start:"0%",center:"50%",end:"100%"}[d],g=(o.arrow?.x??0)+i/2,p=(o.arrow?.y??0)+l/2;let b="",m="";return u==="bottom"?(b=a?h:`${g}px`,m=`${-l}px`):u==="top"?(b=a?h:`${g}px`,m=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,m=a?h:`${p}px`):u==="left"&&(b=`${r.floating.width+l}px`,m=a?h:`${p}px`),{data:{x:b,y:m}}}});function fs(e){const[t,n="center"]=e.split("-");return[t,n]}var ps=as,Sr=cs,ms=ls,hs=ds,xu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Su=xu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Cu="Portal",Cr=f.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=f.useState(!1);ye(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?uo.createPortal(c.jsx(Su.div,{...r,ref:t}),a):null});Cr.displayName=Cu;var Eu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=Eu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Nu=f[" useInsertionEffect ".trim().toString()]||ye;function zt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=ku({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const h=d.current;h!==i&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${i?"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=i},[i,r])}const u=f.useCallback(d=>{if(i){const h=Au(d)?d(e):d;h!==e&&a.current?.(h)}else s(d)},[i,e,s,a]);return[l,u]}function ku({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Nu(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Au(e){return typeof e=="function"}function gs(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Tu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pu=Tu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bs=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"}),_u="VisuallyHidden",Ou=f.forwardRef((e,t)=>c.jsx(Pu.span,{...e,ref:t,style:{...bs,...e.style}}));Ou.displayName=_u;var Mu=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ct=new WeakMap,bn=new WeakMap,yn={},Er=0,ys=function(e){return e&&(e.host||ys(e.parentNode))},Du=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ys(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})},Iu=function(e,t,n,r){var o=Du(t,Array.isArray(e)?e:[e]);yn[n]||(yn[n]=new WeakMap);var s=yn[n],a=[],i=new Set,l=new Set(o),u=function(h){!h||i.has(h)||(i.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(g){if(i.has(g))d(g);else try{var p=g.getAttribute(r),b=p!==null&&p!=="false",m=(Ct.get(g)||0)+1,v=(s.get(g)||0)+1;Ct.set(g,m),s.set(g,v),a.push(g),m===1&&b&&bn.set(g,!0),v===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return d(t),i.clear(),Er++,function(){a.forEach(function(h){var g=Ct.get(h)-1,p=s.get(h)-1;Ct.set(h,g),s.set(h,p),g||(bn.has(h)||h.removeAttribute(r),bn.delete(h)),p||h.removeAttribute(n)}),Er--,Er||(Ct=new WeakMap,Ct=new WeakMap,bn=new WeakMap,yn={})}},vs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Mu(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Iu(r,o,n,"aria-hidden")):function(){return null}},We=function(){return We=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},We.apply(this,arguments)};function ws(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 Lu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var vn="right-scroll-bar-position",wn="width-before-scroll-bar",Fu="with-scroll-bars-hidden",$u="--removed-body-scroll-bar-size";function Nr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zu(e,t){var n=R.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 Ru=typeof window<"u"?f.useLayoutEffect:f.useEffect,xs=new WeakMap;function Wu(e,t){var n=zu(null,function(r){return e.forEach(function(o){return Nr(o,r)})});return Ru(function(){var r=xs.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||Nr(i,null)}),s.forEach(function(i){o.has(i)||Nr(i,a)})}xs.set(n,e)},[e]),n}function Bu(e){return e}function Hu(e,t){t===void 0&&(t=Bu);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Uu(e){e===void 0&&(e={});var t=Hu(null);return t.options=We({async:!0,ssr:!1},e),t}var Ss=function(e){var t=e.sideCar,n=ws(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 f.createElement(r,We({},n))};Ss.isSideCarExport=!0;function ju(e,t){return e.useMedium(t),Ss}var Cs=Uu(),kr=function(){},xn=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:kr,onWheelCapture:kr,onTouchMoveCapture:kr}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,g=e.sideCar,p=e.noRelative,b=e.noIsolation,m=e.inert,v=e.allowPinchZoom,S=e.as,k=S===void 0?"div":S,N=e.gapMode,w=ws(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=g,A=Wu([n,t]),O=We(We({},w),o);return f.createElement(f.Fragment,null,d&&f.createElement(x,{sideCar:Cs,removeScrollBar:u,shards:h,noRelative:p,noIsolation:b,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:N}),a?f.cloneElement(f.Children.only(i),We(We({},O),{ref:A})):f.createElement(k,We({},O,{className:l,ref:A}),i))});xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xn.classNames={fullWidth:wn,zeroRight:vn};var Vu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Vu();return t&&e.setAttribute("nonce",t),e}function Yu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ku=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gu())&&(Yu(t,n),qu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xu=function(){var e=Ku();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Es=function(){var e=Xu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Qu={left:0,top:0,right:0,gap:0},Ar=function(e){return parseInt(e||"",10)||0},Zu=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[Ar(n),Ar(r),Ar(o)]},Ju=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qu;var t=Zu(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])}},ed=Es(),Et="data-scroll-locked",td=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
17
+ ${G?"bg-accent text-accent-foreground":""}
18
+ ${M?"text-primary font-medium":"text-foreground"}
19
+ ${!G&&!M?"hover:bg-muted":""}
20
+ `,children:[c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"truncate",children:N.label}),N.description&&c.jsx("span",{className:"text-xs text-muted-foreground truncate",children:N.description})]}),M&&c.jsx(uc,{className:"w-4 h-4 text-primary shrink-0 ml-2"})]},N.value)}):c.jsx("output",{className:"block py-8 text-center text-sm text-muted-foreground",children:h?"Searching...":"No results found"})})]})]})}function yo(e,[t,n]){return Math.min(n,Math.max(t,e))}function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ct(e,t=[]){let n=[];function r(s,a){const i=p.createContext(a),l=n.length;n=[...n,a];const u=m=>{const{scope:g,children:h,...y}=m,f=g?.[e]?.[l]||i,b=p.useMemo(()=>y,Object.values(y));return c.jsx(f.Provider,{value:b,children:h})};u.displayName=s+"Provider";function d(m,g){const h=g?.[e]?.[l]||i,y=p.useContext(h);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(a=>p.createContext(a));return function(i){const l=i?.[e]||s;return p.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Mc(o,...t)]}function Mc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:l,scopeName:u})=>{const m=l(s)[`__scope${u}`];return{...i,...m}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function vo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function er(...e){return t=>{let n=!1;const r=e.map(o=>{const s=vo(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():vo(e[o],null)}}}}function ce(...e){return p.useCallback(er(...e),e)}function Ce(e){const t=Dc(e),n=p.forwardRef((r,o)=>{const{children:s,...a}=r,i=p.Children.toArray(s),l=i.find(Lc);if(l){const u=l.props.children,d=i.map(m=>m===l?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:m);return c.jsx(t,{...a,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dc(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const a=$c(o),i=Fc(s,o.props);return o.type!==p.Fragment&&(i.ref=r?er(r,a):a),p.cloneElement(o,i)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ic=Symbol("radix.slottable");function Lc(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ic}function Fc(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wo(e){const t=e+"CollectionProvider",[n,r]=ct(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=f=>{const{scope:b,children:S}=f,k=z.useRef(null),E=z.useRef(new Map).current;return c.jsx(o,{scope:b,itemMap:E,collectionRef:k,children:S})};a.displayName=t;const i=e+"CollectionSlot",l=Ce(i),u=z.forwardRef((f,b)=>{const{scope:S,children:k}=f,E=s(i,S),w=ce(b,E.collectionRef);return c.jsx(l,{ref:w,children:k})});u.displayName=i;const d=e+"CollectionItemSlot",m="data-radix-collection-item",g=Ce(d),h=z.forwardRef((f,b)=>{const{scope:S,children:k,...E}=f,w=z.useRef(null),T=ce(b,w),L=s(d,S);return z.useEffect(()=>(L.itemMap.set(w,{ref:w,...E}),()=>{L.itemMap.delete(w)})),c.jsx(g,{[m]:"",ref:T,children:k})});h.displayName=d;function y(f){const b=s(e+"CollectionConsumer",f);return z.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${m}]`));return Array.from(b.itemMap.values()).sort((L,A)=>E.indexOf(L.ref.current)-E.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},y,r]}var zc=p.createContext(void 0);function tr(e){const t=p.useContext(zc);return e||t||"ltr"}var Rc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xo=Rc.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wc(e,t){e&&rn.flushSync(()=>e.dispatchEvent(t))}function Ke(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>t.current?.(...n),[])}function Bc(e,t=globalThis?.document){const n=Ke(e);p.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 Hc="DismissableLayer",nr="dismissableLayer.update",Uc="dismissableLayer.pointerDownOutside",jc="dismissableLayer.focusOutside",So,Co=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rr=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,u=p.useContext(Co),[d,m]=p.useState(null),g=d?.ownerDocument??globalThis?.document,[,h]=p.useState({}),y=ce(t,A=>m(A)),f=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=f.indexOf(b),k=d?f.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,w=k>=S,T=Yc(A=>{const x=A.target,$=[...u.branches].some(W=>W.contains(x));!w||$||(o?.(A),a?.(A),A.defaultPrevented||i?.())},g),L=qc(A=>{const x=A.target;[...u.branches].some(W=>W.contains(x))||(s?.(A),a?.(A),A.defaultPrevented||i?.())},g);return Bc(A=>{k===u.layers.size-1&&(r?.(A),!A.defaultPrevented&&i&&(A.preventDefault(),i()))},g),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(So=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Eo(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=So)}},[d,g,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Eo())},[d,u]),p.useEffect(()=>{const A=()=>h({});return document.addEventListener(nr,A),()=>document.removeEventListener(nr,A)},[]),c.jsx(xo.div,{...l,ref:y,style:{pointerEvents:E?w?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,L.onFocusCapture),onBlurCapture:J(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,T.onPointerDownCapture)})});rr.displayName=Hc;var Vc="DismissableLayerBranch",Gc=p.forwardRef((e,t)=>{const n=p.useContext(Co),r=p.useRef(null),o=ce(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(xo.div,{...e,ref:o})});Gc.displayName=Vc;function Yc(e,t=globalThis?.document){const n=Ke(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){No(Uc,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qc(e,t=globalThis?.document){const n=Ke(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&No(jc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Eo(){const e=new CustomEvent(nr);document.dispatchEvent(e)}function No(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Wc(o,s):o.dispatchEvent(s)}var or=0;function ko(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ao()),document.body.insertAdjacentElement("beforeend",e[1]??Ao()),or++,()=>{or===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),or--}},[])}function Ao(){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 Kc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xc=Kc.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sr="focusScope.autoFocusOnMount",ar="focusScope.autoFocusOnUnmount",To={bubbles:!1,cancelable:!0},Qc="FocusScope",ir=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,l]=p.useState(null),u=Ke(o),d=Ke(s),m=p.useRef(null),g=ce(t,f=>l(f)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let f=function(E){if(h.paused||!i)return;const w=E.target;i.contains(w)?m.current=w:Xe(m.current,{select:!0})},b=function(E){if(h.paused||!i)return;const w=E.relatedTarget;w!==null&&(i.contains(w)||Xe(m.current,{select:!0}))},S=function(E){if(document.activeElement===document.body)for(const T of E)T.removedNodes.length>0&&Xe(i)};document.addEventListener("focusin",f),document.addEventListener("focusout",b);const k=new MutationObserver(S);return i&&k.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",b),k.disconnect()}}},[r,i,h.paused]),p.useEffect(()=>{if(i){Oo.add(h);const f=document.activeElement;if(!i.contains(f)){const S=new CustomEvent(sr,To);i.addEventListener(sr,u),i.dispatchEvent(S),S.defaultPrevented||(Zc(rl(Po(i)),{select:!0}),document.activeElement===f&&Xe(i))}return()=>{i.removeEventListener(sr,u),setTimeout(()=>{const S=new CustomEvent(ar,To);i.addEventListener(ar,d),i.dispatchEvent(S),S.defaultPrevented||Xe(f??document.body,{select:!0}),i.removeEventListener(ar,d),Oo.remove(h)},0)}}},[i,u,d,h]);const y=p.useCallback(f=>{if(!n&&!r||h.paused)return;const b=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,S=document.activeElement;if(b&&S){const k=f.currentTarget,[E,w]=Jc(k);E&&w?!f.shiftKey&&S===w?(f.preventDefault(),n&&Xe(E,{select:!0})):f.shiftKey&&S===E&&(f.preventDefault(),n&&Xe(w,{select:!0})):S===k&&f.preventDefault()}},[n,r,h.paused]);return c.jsx(Xc.div,{tabIndex:-1,...a,ref:g,onKeyDown:y})});ir.displayName=Qc;function Zc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xe(r,{select:t}),document.activeElement!==n)return}function Jc(e){const t=Po(e),n=_o(t,e),r=_o(t.reverse(),e);return[n,r]}function Po(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 _o(e,t){for(const n of e)if(!el(n,{upTo:t}))return n}function el(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 tl(e){return e instanceof HTMLInputElement&&"select"in e}function Xe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tl(e)&&t&&e.select()}}var Oo=nl();function nl(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Mo(e,t),e.unshift(t)},remove(t){e=Mo(e,t),e[0]?.resume()}}}function Mo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rl(e){return e.filter(t=>t.tagName!=="A")}var ye=globalThis?.document?p.useLayoutEffect:()=>{},ol=p[" useId ".trim().toString()]||(()=>{}),sl=0;function Lt(e){const[t,n]=p.useState(ol());return ye(()=>{n(r=>r??String(sl++))},[e]),e||(t?`radix-${t}`:"")}const al=["top","right","bottom","left"],Qe=Math.min,Ne=Math.max,sn=Math.round,an=Math.floor,$e=e=>({x:e,y:e}),il={left:"right",right:"left",bottom:"top",top:"bottom"};function cr(e,t,n){return Ne(e,Qe(t,n))}function je(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function vt(e){return e.split("-")[1]}function lr(e){return e==="x"?"y":"x"}function ur(e){return e==="y"?"height":"width"}function ze(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function dr(e){return lr(ze(e))}function cl(e,t,n){n===void 0&&(n=!1);const r=vt(e),o=dr(e),s=ur(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=cn(a)),[a,cn(a)]}function ll(e){const t=cn(e);return[fr(e),t,fr(t)]}function fr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Do=["left","right"],Io=["right","left"],ul=["top","bottom"],dl=["bottom","top"];function fl(e,t,n){switch(e){case"top":case"bottom":return n?t?Io:Do:t?Do:Io;case"left":case"right":return t?ul:dl;default:return[]}}function pl(e,t,n,r){const o=vt(e);let s=fl(Ve(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(fr)))),s}function cn(e){const t=Ve(e);return il[t]+e.slice(t.length)}function ml(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lo(e){return typeof e!="number"?ml(e):{top:e,right:e,bottom:e,left:e}}function ln(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 Fo(e,t,n){let{reference:r,floating:o}=e;const s=ze(t),a=dr(t),i=ur(a),l=Ve(t),u=s==="y",d=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,g=r[i]/2-o[i]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:m};break;case"left":h={x:r.x-o.width,y:m};break;default:h={x:r.x,y:r.y}}switch(vt(t)){case"start":h[a]-=g*(n&&u?-1:1);break;case"end":h[a]+=g*(n&&u?-1:1);break}return h}async function hl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:m="floating",altBoundary:g=!1,padding:h=0}=je(t,e),y=Lo(h),b=i[g?m==="floating"?"reference":"floating":m],S=ln(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:d,strategy:l})),k=m==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),w=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},T=ln(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:k,offsetParent:E,strategy:l}):k);return{top:(S.top-T.top+y.top)/w.y,bottom:(T.bottom-S.bottom+y.bottom)/w.y,left:(S.left-T.left+y.left)/w.x,right:(T.right-S.right+y.right)/w.x}}const gl=50,bl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:hl},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:m}=Fo(u,r,l),g=r,h=0;const y={};for(let f=0;f<s.length;f++){const b=s[f];if(!b)continue;const{name:S,fn:k}=b,{x:E,y:w,data:T,reset:L}=await k({x:d,y:m,initialPlacement:r,placement:g,strategy:o,middlewareData:y,rects:u,platform:i,elements:{reference:e,floating:t}});d=E??d,m=w??m,y[S]={...y[S],...T},L&&h<gl&&(h++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(u=L.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):L.rects),{x:d,y:m}=Fo(u,g,l)),f=-1)}return{x:d,y:m,placement:g,strategy:o,middlewareData:y}},yl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:u,padding:d=0}=je(e,t)||{};if(u==null)return{};const m=Lo(d),g={x:n,y:r},h=dr(o),y=ur(h),f=await a.getDimensions(u),b=h==="y",S=b?"top":"left",k=b?"bottom":"right",E=b?"clientHeight":"clientWidth",w=s.reference[y]+s.reference[h]-g[h]-s.floating[y],T=g[h]-s.reference[h],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let A=L?L[E]:0;(!A||!await(a.isElement==null?void 0:a.isElement(L)))&&(A=i.floating[E]||s.floating[y]);const x=w/2-T/2,$=A/2-f[y]/2-1,W=Qe(m[S],$),R=Qe(m[k],$),j=W,D=A-f[y]-R,C=A/2-f[y]/2+x,P=cr(j,C,D),_=!l.arrow&&vt(o)!=null&&C!==P&&s.reference[y]/2-(C<j?W:R)-f[y]/2<0,F=_?C<j?C-j:C-D:0;return{[h]:g[h]+F,data:{[h]:P,centerOffset:C-P-F,..._&&{alignmentOffset:F}},reset:_}}}),vl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:f=!0,...b}=je(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=Ve(o),k=ze(i),E=Ve(i)===i,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=g||(E||!f?[cn(i)]:ll(i)),L=y!=="none";!g&&L&&T.push(...pl(i,f,y,w));const A=[i,...T],x=await l.detectOverflow(t,b),$=[];let W=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&$.push(x[S]),m){const C=cl(o,a,w);$.push(x[C[0]],x[C[1]])}if(W=[...W,{placement:o,overflows:$}],!$.every(C=>C<=0)){var R,j;const C=(((R=s.flip)==null?void 0:R.index)||0)+1,P=A[C];if(P&&(!(m==="alignment"?k!==ze(P):!1)||W.every(N=>ze(N.placement)===k?N.overflows[0]>0:!0)))return{data:{index:C,overflows:W},reset:{placement:P}};let _=(j=W.filter(F=>F.overflows[0]<=0).sort((F,N)=>F.overflows[1]-N.overflows[1])[0])==null?void 0:j.placement;if(!_)switch(h){case"bestFit":{var D;const F=(D=W.filter(N=>{if(L){const O=ze(N.placement);return O===k||O==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(O=>O>0).reduce((O,M)=>O+M,0)]).sort((N,O)=>N[1]-O[1])[0])==null?void 0:D[0];F&&(_=F);break}case"initialPlacement":_=i;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function $o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zo(e){return al.some(t=>e[t]>=0)}const wl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=je(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),i=$o(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:zo(i)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),i=$o(a,n.floating);return{data:{escapedOffsets:i,escaped:zo(i)}}}default:return{}}}}},Ro=new Set(["left","top"]);async function xl(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Ve(n),i=vt(n),l=ze(n)==="y",u=Ro.has(a)?-1:1,d=s&&l?-1:1,m=je(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof y=="number"&&(h=i==="end"?y*-1:y),l?{x:h*d,y:g*u}:{x:g*u,y:h*d}}const Sl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,l=await xl(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},Cl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:S=>{let{x:k,y:E}=S;return{x:k,y:E}}},...u}=je(e,t),d={x:n,y:r},m=await s.detectOverflow(t,u),g=ze(Ve(o)),h=lr(g);let y=d[h],f=d[g];if(a){const S=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=y+m[S],w=y-m[k];y=cr(E,y,w)}if(i){const S=g==="y"?"top":"left",k=g==="y"?"bottom":"right",E=f+m[S],w=f-m[k];f=cr(E,f,w)}const b=l.fn({...t,[h]:y,[g]:f});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[h]:a,[g]:i}}}}}},El=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:u=!0}=je(e,t),d={x:n,y:r},m=ze(o),g=lr(m);let h=d[g],y=d[m];const f=je(i,t),b=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const E=g==="y"?"height":"width",w=s.reference[g]-s.floating[E]+b.mainAxis,T=s.reference[g]+s.reference[E]-b.mainAxis;h<w?h=w:h>T&&(h=T)}if(u){var S,k;const E=g==="y"?"width":"height",w=Ro.has(Ve(o)),T=s.reference[m]-s.floating[E]+(w&&((S=a.offset)==null?void 0:S[m])||0)+(w?0:b.crossAxis),L=s.reference[m]+s.reference[E]+(w?0:((k=a.offset)==null?void 0:k[m])||0)-(w?b.crossAxis:0);y<T?y=T:y>L&&(y=L)}return{[g]:h,[m]:y}}}},Nl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...u}=je(e,t),d=await a.detectOverflow(t,u),m=Ve(o),g=vt(o),h=ze(o)==="y",{width:y,height:f}=s.floating;let b,S;m==="top"||m==="bottom"?(b=m,S=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(S=m,b=g==="end"?"top":"bottom");const k=f-d.top-d.bottom,E=y-d.left-d.right,w=Qe(f-d[b],k),T=Qe(y-d[S],E),L=!t.middlewareData.shift;let A=w,x=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(x=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=k),L&&!g){const W=Ne(d.left,0),R=Ne(d.right,0),j=Ne(d.top,0),D=Ne(d.bottom,0);h?x=y-2*(W!==0||R!==0?W+R:Ne(d.left,d.right)):A=f-2*(j!==0||D!==0?j+D:Ne(d.top,d.bottom))}await l({...t,availableWidth:x,availableHeight:A});const $=await a.getDimensions(i.floating);return y!==$.width||f!==$.height?{reset:{rects:!0}}:{}}}};function un(){return typeof window<"u"}function wt(e){return Wo(e)?(e.nodeName||"").toLowerCase():"#document"}function ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(Wo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wo(e){return un()?e instanceof Node||e instanceof ke(e).Node:!1}function _e(e){return un()?e instanceof Element||e instanceof ke(e).Element:!1}function Ge(e){return un()?e instanceof HTMLElement||e instanceof ke(e).HTMLElement:!1}function Bo(e){return!un()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ke(e).ShadowRoot}function Ft(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function kl(e){return/^(table|td|th)$/.test(wt(e))}function dn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Al=/transform|translate|scale|rotate|perspective|filter/,Tl=/paint|layout|strict|content/,lt=e=>!!e&&e!=="none";let pr;function mr(e){const t=_e(e)?Oe(e):e;return lt(t.transform)||lt(t.translate)||lt(t.scale)||lt(t.rotate)||lt(t.perspective)||!hr()&&(lt(t.backdropFilter)||lt(t.filter))||Al.test(t.willChange||"")||Tl.test(t.contain||"")}function Pl(e){let t=Ze(e);for(;Ge(t)&&!xt(t);){if(mr(t))return t;if(dn(t))return null;t=Ze(t)}return null}function hr(){return pr==null&&(pr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pr}function xt(e){return/^(html|body|#document)$/.test(wt(e))}function Oe(e){return ke(e).getComputedStyle(e)}function fn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(wt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bo(e)&&e.host||Re(e);return Bo(t)?t.host:t}function Ho(e){const t=Ze(e);return xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ge(t)&&Ft(t)?t:Ho(t)}function $t(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ho(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=ke(o);if(s){const i=gr(a);return t.concat(a,a.visualViewport||[],Ft(o)?o:[],i&&n?$t(i):[])}else return t.concat(o,$t(o,[],n))}function gr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Uo(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ge(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=sn(n)!==s||sn(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function br(e){return _e(e)?e:e.contextElement}function St(e){const t=br(e);if(!Ge(t))return $e(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Uo(t);let a=(s?sn(n.width):n.width)/r,i=(s?sn(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const _l=$e(0);function jo(e){const t=ke(e);return!hr()||!t.visualViewport?_l:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ol(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ke(e)?!1:t}function ut(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=br(e);let a=$e(1);t&&(r?_e(r)&&(a=St(r)):a=St(e));const i=Ol(s,n,r)?jo(s):$e(0);let l=(o.left+i.x)/a.x,u=(o.top+i.y)/a.y,d=o.width/a.x,m=o.height/a.y;if(s){const g=ke(s),h=r&&_e(r)?ke(r):r;let y=g,f=gr(y);for(;f&&r&&h!==y;){const b=St(f),S=f.getBoundingClientRect(),k=Oe(f),E=S.left+(f.clientLeft+parseFloat(k.paddingLeft))*b.x,w=S.top+(f.clientTop+parseFloat(k.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,m*=b.y,l+=E,u+=w,y=ke(f),f=gr(y)}}return ln({width:d,height:m,x:l,y:u})}function pn(e,t){const n=fn(e).scrollLeft;return t?t.left+n:ut(Re(e)).left+n}function Vo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ml(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Re(r),i=t?dn(t.floating):!1;if(r===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},u=$e(1);const d=$e(0),m=Ge(r);if((m||!m&&!s)&&((wt(r)!=="body"||Ft(a))&&(l=fn(r)),m)){const h=ut(r);u=St(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const g=a&&!m&&!s?Vo(a,l):$e(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-l.scrollTop*u.y+d.y+g.y}}function Dl(e){return Array.from(e.getClientRects())}function Il(e){const t=Re(e),n=fn(e),r=e.ownerDocument.body,o=Ne(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ne(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pn(e);const i=-n.scrollTop;return Oe(r).direction==="rtl"&&(a+=Ne(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}const Go=25;function Ll(e,t){const n=ke(e),r=Re(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,l=0;if(o){s=o.width,a=o.height;const d=hr();(!d||d&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}const u=pn(r);if(u<=0){const d=r.ownerDocument,m=d.body,g=getComputedStyle(m),h=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(r.clientWidth-m.clientWidth-h);y<=Go&&(s-=y)}else u<=Go&&(s+=u);return{width:s,height:a,x:i,y:l}}function Fl(e,t){const n=ut(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ge(e)?St(e):$e(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:a,height:i,x:l,y:u}}function Yo(e,t,n){let r;if(t==="viewport")r=Ll(e,n);else if(t==="document")r=Il(Re(e));else if(_e(t))r=Fl(t,n);else{const o=jo(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ln(r)}function qo(e,t){const n=Ze(e);return n===t||!_e(n)||xt(n)?!1:Oe(n).position==="fixed"||qo(n,t)}function $l(e,t){const n=t.get(e);if(n)return n;let r=$t(e,[],!1).filter(i=>_e(i)&&wt(i)!=="body"),o=null;const s=Oe(e).position==="fixed";let a=s?Ze(e):e;for(;_e(a)&&!xt(a);){const i=Oe(a),l=mr(a);!l&&i.position==="fixed"&&(o=null),(s?!l&&!o:!l&&i.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ft(a)&&!l&&qo(e,a))?r=r.filter(d=>d!==a):o=i,a=Ze(a)}return t.set(e,r),r}function zl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?dn(t)?[]:$l(t,this._c):[].concat(n),r],i=Yo(t,a[0],o);let l=i.top,u=i.right,d=i.bottom,m=i.left;for(let g=1;g<a.length;g++){const h=Yo(t,a[g],o);l=Ne(h.top,l),u=Qe(h.right,u),d=Qe(h.bottom,d),m=Ne(h.left,m)}return{width:u-m,height:d-l,x:m,y:l}}function Rl(e){const{width:t,height:n}=Uo(e);return{width:t,height:n}}function Wl(e,t,n){const r=Ge(t),o=Re(t),s=n==="fixed",a=ut(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=$e(0);function u(){l.x=pn(o)}if(r||!r&&!s)if((wt(t)!=="body"||Ft(o))&&(i=fn(t)),r){const h=ut(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Vo(o,i):$e(0),m=a.left+i.scrollLeft-l.x-d.x,g=a.top+i.scrollTop-l.y-d.y;return{x:m,y:g,width:a.width,height:a.height}}function yr(e){return Oe(e).position==="static"}function Ko(e,t){if(!Ge(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Re(e)===n&&(n=n.ownerDocument.body),n}function Xo(e,t){const n=ke(e);if(dn(e))return n;if(!Ge(e)){let o=Ze(e);for(;o&&!xt(o);){if(_e(o)&&!yr(o))return o;o=Ze(o)}return n}let r=Ko(e,t);for(;r&&kl(r)&&yr(r);)r=Ko(r,t);return r&&xt(r)&&yr(r)&&!mr(r)?n:r||Pl(e)||n}const Bl=async function(e){const t=this.getOffsetParent||Xo,n=this.getDimensions,r=await n(e.floating);return{reference:Wl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hl(e){return Oe(e).direction==="rtl"}const Ul={convertOffsetParentRelativeRectToViewportRelativeRect:Ml,getDocumentElement:Re,getClippingRect:zl,getOffsetParent:Xo,getElementRects:Bl,getClientRects:Dl,getDimensions:Rl,getScale:St,isElement:_e,isRTL:Hl};function Qo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jl(e,t){let n=null,r;const o=Re(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:m,width:g,height:h}=u;if(i||t(),!g||!h)return;const y=an(m),f=an(o.clientWidth-(d+g)),b=an(o.clientHeight-(m+h)),S=an(d),E={rootMargin:-y+"px "+-f+"px "+-b+"px "+-S+"px",threshold:Ne(0,Qe(1,l))||1};let w=!0;function T(L){const A=L[0].intersectionRatio;if(A!==l){if(!w)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!Qo(u,e.getBoundingClientRect())&&a(),w=!1}try{n=new IntersectionObserver(T,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,E)}n.observe(e)}return a(!0),s}function Vl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=br(e),d=o||s?[...u?$t(u):[],...t?$t(t):[]]:[];d.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const m=u&&i?jl(u,n):null;let g=-1,h=null;a&&(h=new ResizeObserver(S=>{let[k]=S;k&&k.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=h)==null||E.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let y,f=l?ut(e):null;l&&b();function b(){const S=ut(e);f&&!Qo(f,S)&&n(),f=S,y=requestAnimationFrame(b)}return n(),()=>{var S;d.forEach(k=>{o&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),m?.(),(S=h)==null||S.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const Gl=Sl,Yl=Cl,ql=vl,Kl=Nl,Xl=wl,Zo=yl,Ql=El,Zl=(e,t,n)=>{const r=new Map,o={platform:Ul,...n},s={...o.platform,_c:r};return bl(e,t,{...o,platform:s})};var Jl=typeof document<"u",eu=function(){},mn=Jl?z.useLayoutEffect:eu;function hn(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(!hn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!hn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Jo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function es(e,t){const n=Jo(e);return Math.round(t*n)/n}function vr(e){const t=p.useRef(e);return mn(()=>{t.current=e}),t}function tu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[d,m]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=p.useState(r);hn(g,r)||h(r);const[y,f]=p.useState(null),[b,S]=p.useState(null),k=p.useCallback(N=>{N!==L.current&&(L.current=N,f(N))},[]),E=p.useCallback(N=>{N!==A.current&&(A.current=N,S(N))},[]),w=s||y,T=a||b,L=p.useRef(null),A=p.useRef(null),x=p.useRef(d),$=l!=null,W=vr(l),R=vr(o),j=vr(u),D=p.useCallback(()=>{if(!L.current||!A.current)return;const N={placement:t,strategy:n,middleware:g};R.current&&(N.platform=R.current),Zl(L.current,A.current,N).then(O=>{const M={...O,isPositioned:j.current!==!1};C.current&&!hn(x.current,M)&&(x.current=M,rn.flushSync(()=>{m(M)}))})},[g,t,n,R,j]);mn(()=>{u===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,m(N=>({...N,isPositioned:!1})))},[u]);const C=p.useRef(!1);mn(()=>(C.current=!0,()=>{C.current=!1}),[]),mn(()=>{if(w&&(L.current=w),T&&(A.current=T),w&&T){if(W.current)return W.current(w,T,D);D()}},[w,T,D,W,$]);const P=p.useMemo(()=>({reference:L,floating:A,setReference:k,setFloating:E}),[k,E]),_=p.useMemo(()=>({reference:w,floating:T}),[w,T]),F=p.useMemo(()=>{const N={position:n,left:0,top:0};if(!_.floating)return N;const O=es(_.floating,d.x),M=es(_.floating,d.y);return i?{...N,transform:"translate("+O+"px, "+M+"px)",...Jo(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:M}},[n,i,_.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:D,refs:P,elements:_,floatingStyles:F}),[d,D,P,_,F])}const nu=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?Zo({element:r.current,padding:o}).fn(n):{}:r?Zo({element:r,padding:o}).fn(n):{}}}},ru=(e,t)=>{const n=Gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ou=(e,t)=>{const n=Yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},su=(e,t)=>({fn:Ql(e).fn,options:[e,t]}),au=(e,t)=>{const n=ql(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{const n=Kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},cu=(e,t)=>{const n=Xl(e);return{name:n.name,fn:n.fn,options:[e,t]}},lu=(e,t)=>{const n=nu(e);return{name:n.name,fn:n.fn,options:[e,t]}};var uu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],du=uu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fu="Arrow",ts=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(du.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});ts.displayName=fu;var pu=ts,mu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ns=mu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function rs(e){const[t,n]=p.useState(void 0);return ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wr="Popper",[os,gn]=ct(wr),[hu,ss]=os(wr),as=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return c.jsx(hu,{scope:t,anchor:r,onAnchorChange:o,children:n})};as.displayName=wr;var is="PopperAnchor",cs=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ss(is,n),a=p.useRef(null),i=ce(t,a),l=p.useRef(null);return p.useEffect(()=>{const u=l.current;l.current=r?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(ns.div,{...o,ref:i})});cs.displayName=is;var xr="PopperContent",[gu,bu]=os(xr),ls=p.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:y,...f}=e,b=ss(xr,n),[S,k]=p.useState(null),E=ce(t,V=>k(V)),[w,T]=p.useState(null),L=rs(w),A=L?.width??0,x=L?.height??0,$=r+(s!=="center"?"-"+s:""),W=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},R=Array.isArray(u)?u:[u],j=R.length>0,D={padding:W,boundary:R.filter(vu),altBoundary:j},{refs:C,floatingStyles:P,placement:_,isPositioned:F,middlewareData:N}=tu({strategy:"fixed",placement:$,whileElementsMounted:(...V)=>Vl(...V,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[ru({mainAxis:o+x,alignmentAxis:a}),l&&ou({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?su():void 0,...D}),l&&au({...D}),iu({...D,apply:({elements:V,rects:ee,availableWidth:Q,availableHeight:te})=>{const{width:ne,height:ae}=ee.reference,le=V.floating.style;le.setProperty("--radix-popper-available-width",`${Q}px`),le.setProperty("--radix-popper-available-height",`${te}px`),le.setProperty("--radix-popper-anchor-width",`${ne}px`),le.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),w&&lu({element:w,padding:i}),wu({arrowWidth:A,arrowHeight:x}),g&&cu({strategy:"referenceHidden",...D})]}),[O,M]=fs(_),G=Ke(y);ye(()=>{F&&G?.()},[F,G]);const se=N.arrow?.x,Z=N.arrow?.y,ge=N.arrow?.centerOffset!==0,[q,oe]=p.useState();return ye(()=>{S&&oe(window.getComputedStyle(S).zIndex)},[S]),c.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:F?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(gu,{scope:n,placedSide:O,onArrowChange:T,arrowX:se,arrowY:Z,shouldHideArrow:ge,children:c.jsx(ns.div,{"data-side":O,"data-align":M,...f,ref:E,style:{...f.style,animation:F?void 0:"none"}})})})});ls.displayName=xr;var us="PopperArrow",yu={top:"bottom",right:"left",bottom:"top",left:"right"},ds=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=bu(us,r),a=yu[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(pu,{...o,ref:n,style:{...o.style,display:"block"}})})});ds.displayName=us;function vu(e){return e!==null}var wu=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=fs(n),m={start:"0%",center:"50%",end:"100%"}[d],g=(o.arrow?.x??0)+i/2,h=(o.arrow?.y??0)+l/2;let y="",f="";return u==="bottom"?(y=a?m:`${g}px`,f=`${-l}px`):u==="top"?(y=a?m:`${g}px`,f=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,f=a?m:`${h}px`):u==="left"&&(y=`${r.floating.width+l}px`,f=a?m:`${h}px`),{data:{x:y,y:f}}}});function fs(e){const[t,n="center"]=e.split("-");return[t,n]}var ps=as,Sr=cs,ms=ls,hs=ds,xu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Su=xu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Cu="Portal",Cr=p.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=p.useState(!1);ye(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?uo.createPortal(c.jsx(Su.div,{...r,ref:t}),a):null});Cr.displayName=Cu;var Eu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=Eu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Nu=p[" useInsertionEffect ".trim().toString()]||ye;function zt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=ku({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:o;{const d=p.useRef(e!==void 0);p.useEffect(()=>{const m=d.current;m!==i&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${i?"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=i},[i,r])}const u=p.useCallback(d=>{if(i){const m=Au(d)?d(e):d;m!==e&&a.current?.(m)}else s(d)},[i,e,s,a]);return[l,u]}function ku({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return Nu(()=>{s.current=t},[t]),p.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Au(e){return typeof e=="function"}function gs(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Tu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pu=Tu.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),bs=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"}),_u="VisuallyHidden",Ou=p.forwardRef((e,t)=>c.jsx(Pu.span,{...e,ref:t,style:{...bs,...e.style}}));Ou.displayName=_u;var Mu=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ct=new WeakMap,bn=new WeakMap,yn={},Er=0,ys=function(e){return e&&(e.host||ys(e.parentNode))},Du=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ys(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})},Iu=function(e,t,n,r){var o=Du(t,Array.isArray(e)?e:[e]);yn[n]||(yn[n]=new WeakMap);var s=yn[n],a=[],i=new Set,l=new Set(o),u=function(m){!m||i.has(m)||(i.add(m),u(m.parentNode))};o.forEach(u);var d=function(m){!m||l.has(m)||Array.prototype.forEach.call(m.children,function(g){if(i.has(g))d(g);else try{var h=g.getAttribute(r),y=h!==null&&h!=="false",f=(Ct.get(g)||0)+1,b=(s.get(g)||0)+1;Ct.set(g,f),s.set(g,b),a.push(g),f===1&&y&&bn.set(g,!0),b===1&&g.setAttribute(n,"true"),y||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return d(t),i.clear(),Er++,function(){a.forEach(function(m){var g=Ct.get(m)-1,h=s.get(m)-1;Ct.set(m,g),s.set(m,h),g||(bn.has(m)||m.removeAttribute(r),bn.delete(m)),h||m.removeAttribute(n)}),Er--,Er||(Ct=new WeakMap,Ct=new WeakMap,bn=new WeakMap,yn={})}},vs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Mu(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Iu(r,o,n,"aria-hidden")):function(){return null}},We=function(){return We=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},We.apply(this,arguments)};function ws(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 Lu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var vn="right-scroll-bar-position",wn="width-before-scroll-bar",Fu="with-scroll-bars-hidden",$u="--removed-body-scroll-bar-size";function Nr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zu(e,t){var n=z.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 Ru=typeof window<"u"?p.useLayoutEffect:p.useEffect,xs=new WeakMap;function Wu(e,t){var n=zu(null,function(r){return e.forEach(function(o){return Nr(o,r)})});return Ru(function(){var r=xs.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||Nr(i,null)}),s.forEach(function(i){o.has(i)||Nr(i,a)})}xs.set(n,e)},[e]),n}function Bu(e){return e}function Hu(e,t){t===void 0&&(t=Bu);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Uu(e){e===void 0&&(e={});var t=Hu(null);return t.options=We({async:!0,ssr:!1},e),t}var Ss=function(e){var t=e.sideCar,n=ws(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 p.createElement(r,We({},n))};Ss.isSideCarExport=!0;function ju(e,t){return e.useMedium(t),Ss}var Cs=Uu(),kr=function(){},xn=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:kr,onWheelCapture:kr,onTouchMoveCapture:kr}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,m=e.shards,g=e.sideCar,h=e.noRelative,y=e.noIsolation,f=e.inert,b=e.allowPinchZoom,S=e.as,k=S===void 0?"div":S,E=e.gapMode,w=ws(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,L=Wu([n,t]),A=We(We({},w),o);return p.createElement(p.Fragment,null,d&&p.createElement(T,{sideCar:Cs,removeScrollBar:u,shards:m,noRelative:h,noIsolation:y,inert:f,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:E}),a?p.cloneElement(p.Children.only(i),We(We({},A),{ref:L})):p.createElement(k,We({},A,{className:l,ref:L}),i))});xn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xn.classNames={fullWidth:wn,zeroRight:vn};var Vu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Vu();return t&&e.setAttribute("nonce",t),e}function Yu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ku=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gu())&&(Yu(t,n),qu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xu=function(){var e=Ku();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Es=function(){var e=Xu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Qu={left:0,top:0,right:0,gap:0},Ar=function(e){return parseInt(e||"",10)||0},Zu=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[Ar(n),Ar(r),Ar(o)]},Ju=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qu;var t=Zu(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])}},ed=Es(),Et="data-scroll-locked",td=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
21
21
  .`.concat(Fu,` {
22
22
  overflow: hidden `).concat(r,`;
23
23
  padding-right: `).concat(i,"px ").concat(r,`;
@@ -54,49 +54,49 @@
54
54
  body[`).concat(Et,`] {
55
55
  `).concat($u,": ").concat(i,`px;
56
56
  }
57
- `)},Ns=function(){var e=parseInt(document.body.getAttribute(Et)||"0",10);return isFinite(e)?e:0},nd=function(){f.useEffect(function(){return document.body.setAttribute(Et,(Ns()+1).toString()),function(){var e=Ns()-1;e<=0?document.body.removeAttribute(Et):document.body.setAttribute(Et,e.toString())}},[])},rd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;nd();var s=f.useMemo(function(){return Ju(o)},[o]);return f.createElement(ed,{styles:td(s,!t,o,n?"":"!important")})},Tr=!1;if(typeof window<"u")try{var Sn=Object.defineProperty({},"passive",{get:function(){return Tr=!0,!0}});window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{Tr=!1}var Nt=Tr?{passive:!1}:!1,od=function(e){return e.tagName==="TEXTAREA"},ks=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!od(e)&&n[t]==="visible")},sd=function(e){return ks(e,"overflowY")},ad=function(e){return ks(e,"overflowX")},As=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ts(e,r);if(o){var s=Ps(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},id=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cd=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ts=function(e,t){return e==="v"?sd(t):ad(t)},Ps=function(e,t){return e==="v"?id(t):cd(t)},ld=function(e,t){return e==="h"&&t==="rtl"?-1:1},ud=function(e,t,n,r,o){var s=ld(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,l=t.contains(i),u=!1,d=a>0,h=0,g=0;do{if(!i)break;var p=Ps(e,i),b=p[0],m=p[1],v=p[2],S=m-v-s*b;(b||S)&&Ts(e,i)&&(h+=S,g+=b);var k=i.parentNode;i=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(d&&Math.abs(h)<1||!d&&Math.abs(g)<1)&&(u=!0),u},Cn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_s=function(e){return[e.deltaX,e.deltaY]},Os=function(e){return e&&"current"in e?e.current:e},dd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fd=function(e){return`
57
+ `)},Ns=function(){var e=parseInt(document.body.getAttribute(Et)||"0",10);return isFinite(e)?e:0},nd=function(){p.useEffect(function(){return document.body.setAttribute(Et,(Ns()+1).toString()),function(){var e=Ns()-1;e<=0?document.body.removeAttribute(Et):document.body.setAttribute(Et,e.toString())}},[])},rd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;nd();var s=p.useMemo(function(){return Ju(o)},[o]);return p.createElement(ed,{styles:td(s,!t,o,n?"":"!important")})},Tr=!1;if(typeof window<"u")try{var Sn=Object.defineProperty({},"passive",{get:function(){return Tr=!0,!0}});window.addEventListener("test",Sn,Sn),window.removeEventListener("test",Sn,Sn)}catch{Tr=!1}var Nt=Tr?{passive:!1}:!1,od=function(e){return e.tagName==="TEXTAREA"},ks=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!od(e)&&n[t]==="visible")},sd=function(e){return ks(e,"overflowY")},ad=function(e){return ks(e,"overflowX")},As=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ts(e,r);if(o){var s=Ps(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},id=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cd=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ts=function(e,t){return e==="v"?sd(t):ad(t)},Ps=function(e,t){return e==="v"?id(t):cd(t)},ld=function(e,t){return e==="h"&&t==="rtl"?-1:1},ud=function(e,t,n,r,o){var s=ld(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,l=t.contains(i),u=!1,d=a>0,m=0,g=0;do{if(!i)break;var h=Ps(e,i),y=h[0],f=h[1],b=h[2],S=f-b-s*y;(y||S)&&Ts(e,i)&&(m+=S,g+=y);var k=i.parentNode;i=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(d&&Math.abs(m)<1||!d&&Math.abs(g)<1)&&(u=!0),u},Cn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_s=function(e){return[e.deltaX,e.deltaY]},Os=function(e){return e&&"current"in e?e.current:e},dd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fd=function(e){return`
58
58
  .block-interactivity-`.concat(e,` {pointer-events: none;}
59
59
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
60
- `)},pd=0,kt=[];function md(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(pd++)[0],s=f.useState(Es)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Lu([e.lockRef.current],(e.shards||[]).map(Os),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=f.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var S=Cn(m),k=n.current,N="deltaX"in m?m.deltaX:k[0]-S[0],w="deltaY"in m?m.deltaY:k[1]-S[1],x,A=m.target,O=Math.abs(N)>Math.abs(w)?"h":"v";if("touches"in m&&O==="h"&&A.type==="range")return!1;var T=window.getSelection(),z=T&&T.anchorNode,$=z?z===A||z.contains(A):!1;if($)return!1;var U=As(O,A);if(!U)return!0;if(U?x=O:(x=O==="v"?"h":"v",U=As(O,A)),!U)return!1;if(!r.current&&"changedTouches"in m&&(N||w)&&(r.current=x),!x)return!0;var q=r.current||x;return ud(q,v,m,q==="h"?N:w)},[]),l=f.useCallback(function(m){var v=m;if(!(!kt.length||kt[kt.length-1]!==s)){var S="deltaY"in v?_s(v):Cn(v),k=t.current.filter(function(x){return x.name===v.type&&(x.target===v.target||v.target===x.shadowParent)&&dd(x.delta,S)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var N=(a.current.shards||[]).map(Os).filter(Boolean).filter(function(x){return x.contains(v.target)}),w=N.length>0?i(v,N[0]):!a.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=f.useCallback(function(m,v,S,k){var N={name:m,delta:v,target:S,should:k,shadowParent:hd(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(w){return w!==N})},1)},[]),d=f.useCallback(function(m){n.current=Cn(m),r.current=void 0},[]),h=f.useCallback(function(m){u(m.type,_s(m),m.target,i(m,e.lockRef.current))},[]),g=f.useCallback(function(m){u(m.type,Cn(m),m.target,i(m,e.lockRef.current))},[]);f.useEffect(function(){return kt.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Nt),document.addEventListener("touchmove",l,Nt),document.addEventListener("touchstart",d,Nt),function(){kt=kt.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Nt),document.removeEventListener("touchmove",l,Nt),document.removeEventListener("touchstart",d,Nt)}},[]);var p=e.removeScrollBar,b=e.inert;return f.createElement(f.Fragment,null,b?f.createElement(s,{styles:fd(o)}):null,p?f.createElement(rd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gd=ju(Cs,md);var Pr=f.forwardRef(function(e,t){return f.createElement(xn,We({},e,{ref:t,sideCar:gd}))});Pr.classNames=xn.classNames;var bd=[" ","Enter","ArrowUp","ArrowDown"],yd=[" ","Enter"],dt="Select",[En,Nn,vd]=wo(dt),[At]=ct(dt,[vd,gn]),kn=gn(),[wd,Je]=At(dt),[xd,Sd]=At(dt),Ms=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:g,required:p,form:b}=e,m=kn(t),[v,S]=f.useState(null),[k,N]=f.useState(null),[w,x]=f.useState(!1),A=tr(u),[O,T]=zt({prop:r,defaultProp:o??!1,onChange:s,caller:dt}),[z,$]=zt({prop:a,defaultProp:i,onChange:l,caller:dt}),U=f.useRef(null),q=v?b||!!v.closest("form"):!0,[I,C]=f.useState(new Set),P=Array.from(I).map(_=>_.props.value).join(";");return c.jsx(ps,{...m,children:c.jsxs(wd,{required:p,scope:t,trigger:v,onTriggerChange:S,valueNode:k,onValueNodeChange:N,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:Lt(),value:z,onValueChange:$,open:O,onOpenChange:T,dir:A,triggerPointerDownPosRef:U,disabled:g,children:[c.jsx(En.Provider,{scope:t,children:c.jsx(xd,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(_=>{C(F=>new Set(F).add(_))},[]),onNativeOptionRemove:f.useCallback(_=>{C(F=>{const E=new Set(F);return E.delete(_),E})},[]),children:n})}),q?c.jsxs(na,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:z,onChange:_=>$(_.target.value),disabled:g,form:b,children:[z===void 0?c.jsx("option",{value:""}):null,Array.from(I)]},P):null]})})};Ms.displayName=dt;var Ds="SelectTrigger",Is=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=kn(n),a=Je(Ds,n),i=a.disabled||r,l=ce(t,a.onTriggerChange),u=Nn(n),d=f.useRef("touch"),[h,g,p]=oa(m=>{const v=u().filter(N=>!N.disabled),S=v.find(N=>N.value===a.value),k=sa(v,m,S);k!==void 0&&a.onValueChange(k.value)}),b=m=>{i||(a.onOpenChange(!0),p()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(Sr,{asChild:!0,...s,children:c.jsx(Ae.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:i,"data-disabled":i?"":void 0,"data-placeholder":ra(a.value)?"":void 0,...o,ref:l,onClick:J(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&b(m)}),onPointerDown:J(o.onPointerDown,m=>{d.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(b(m),m.preventDefault())}),onKeyDown:J(o.onKeyDown,m=>{const v=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(v&&m.key===" ")&&bd.includes(m.key)&&(b(),m.preventDefault())})})})});Is.displayName=Ds;var Ls="SelectValue",Fs=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,l=Je(Ls,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,h=ce(t,l.onValueNodeChange);return ye(()=>{u(d)},[u,d]),c.jsx(Ae.span,{...i,ref:h,style:{pointerEvents:"none"},children:ra(l.value)?c.jsx(c.Fragment,{children:a}):s})});Fs.displayName=Ls;var Cd="SelectIcon",$s=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});$s.displayName=Cd;var Ed="SelectPortal",zs=e=>c.jsx(Cr,{asChild:!0,...e});zs.displayName=Ed;var ft="SelectContent",Rs=f.forwardRef((e,t)=>{const n=Je(ft,e.__scopeSelect),[r,o]=f.useState();if(ye(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?rn.createPortal(c.jsx(Ws,{scope:e.__scopeSelect,children:c.jsx(En.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Bs,{...e,ref:t})});Rs.displayName=ft;var Me=10,[Ws,et]=At(ft),Nd="SelectContentImpl",kd=Ce("SelectContent.RemoveScroll"),Bs=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:g,collisionPadding:p,sticky:b,hideWhenDetached:m,avoidCollisions:v,...S}=e,k=Je(ft,n),[N,w]=f.useState(null),[x,A]=f.useState(null),O=ce(t,j=>w(j)),[T,z]=f.useState(null),[$,U]=f.useState(null),q=Nn(n),[I,C]=f.useState(!1),P=f.useRef(!1);f.useEffect(()=>{if(N)return vs(N)},[N]),ko();const _=f.useCallback(j=>{const[ee,...Q]=q().map(ae=>ae.ref.current),[te]=Q.slice(-1),ne=document.activeElement;for(const ae of j)if(ae===ne||(ae?.scrollIntoView({block:"nearest"}),ae===ee&&x&&(x.scrollTop=0),ae===te&&x&&(x.scrollTop=x.scrollHeight),ae?.focus(),document.activeElement!==ne))return},[q,x]),F=f.useCallback(()=>_([T,N]),[_,T,N]);f.useEffect(()=>{I&&F()},[I,F]);const{onOpenChange:E,triggerPointerDownPosRef:M}=k;f.useEffect(()=>{if(N){let j={x:0,y:0};const ee=te=>{j={x:Math.abs(Math.round(te.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(te.pageY)-(M.current?.y??0))}},Q=te=>{j.x<=10&&j.y<=10?te.preventDefault():N.contains(te.target)||E(!1),document.removeEventListener("pointermove",ee),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",Q,{capture:!0})}}},[N,E,M]),f.useEffect(()=>{const j=()=>E(!1);return window.addEventListener("blur",j),window.addEventListener("resize",j),()=>{window.removeEventListener("blur",j),window.removeEventListener("resize",j)}},[E]);const[D,V]=oa(j=>{const ee=q().filter(ne=>!ne.disabled),Q=ee.find(ne=>ne.ref.current===document.activeElement),te=sa(ee,j,Q);te&&setTimeout(()=>te.ref.current.focus())}),se=f.useCallback((j,ee,Q)=>{const te=!P.current&&!Q;(k.value!==void 0&&k.value===ee||te)&&(z(j),te&&(P.current=!0))},[k.value]),Z=f.useCallback(()=>N?.focus(),[N]),ge=f.useCallback((j,ee,Q)=>{const te=!P.current&&!Q;(k.value!==void 0&&k.value===ee||te)&&U(j)},[k.value]),Y=r==="popper"?_r:Hs,oe=Y===_r?{side:i,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:g,collisionPadding:p,sticky:b,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(Ws,{scope:n,content:N,viewport:x,onViewportChange:A,itemRefCallback:se,selectedItem:T,onItemLeave:Z,itemTextRefCallback:ge,focusSelectedItem:F,selectedItemText:$,position:r,isPositioned:I,searchRef:D,children:c.jsx(Pr,{as:kd,allowPinchZoom:!0,children:c.jsx(ir,{asChild:!0,trapped:k.open,onMountAutoFocus:j=>{j.preventDefault()},onUnmountAutoFocus:J(o,j=>{k.trigger?.focus({preventScroll:!0}),j.preventDefault()}),children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:j=>j.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(Y,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:j=>j.preventDefault(),...S,...oe,onPlaced:()=>C(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:J(S.onKeyDown,j=>{const ee=j.ctrlKey||j.altKey||j.metaKey;if(j.key==="Tab"&&j.preventDefault(),!ee&&j.key.length===1&&V(j.key),["ArrowUp","ArrowDown","Home","End"].includes(j.key)){let te=q().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(j.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(j.key)){const ne=j.target,ae=te.indexOf(ne);te=te.slice(ae+1)}setTimeout(()=>_(te)),j.preventDefault()}})})})})})})});Bs.displayName=Nd;var Ad="SelectItemAlignedPosition",Hs=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Je(ft,n),a=et(ft,n),[i,l]=f.useState(null),[u,d]=f.useState(null),h=ce(t,O=>d(O)),g=Nn(n),p=f.useRef(!1),b=f.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:S,focusSelectedItem:k}=a,N=f.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&m&&v&&S){const O=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),z=s.valueNode.getBoundingClientRect(),$=S.getBoundingClientRect();if(s.dir!=="rtl"){const ne=$.left-T.left,ae=z.left-ne,le=O.left-ae,he=O.width+le,Le=Math.max(he,T.width),gt=window.innerWidth-Me,bt=yo(ae,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.left=bt+"px"}else{const ne=T.right-$.right,ae=window.innerWidth-z.right-ne,le=window.innerWidth-O.right-ae,he=O.width+le,Le=Math.max(he,T.width),gt=window.innerWidth-Me,bt=yo(ae,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.right=bt+"px"}const U=g(),q=window.innerHeight-Me*2,I=m.scrollHeight,C=window.getComputedStyle(u),P=parseInt(C.borderTopWidth,10),_=parseInt(C.paddingTop,10),F=parseInt(C.borderBottomWidth,10),E=parseInt(C.paddingBottom,10),M=P+_+I+E+F,D=Math.min(v.offsetHeight*5,M),V=window.getComputedStyle(m),se=parseInt(V.paddingTop,10),Z=parseInt(V.paddingBottom,10),ge=O.top+O.height/2-Me,Y=q-ge,oe=v.offsetHeight/2,j=v.offsetTop+oe,ee=P+_+j,Q=M-ee;if(ee<=ge){const ne=U.length>0&&v===U[U.length-1].ref.current;i.style.bottom="0px";const ae=u.clientHeight-m.offsetTop-m.offsetHeight,le=Math.max(Y,oe+(ne?Z:0)+ae+F),he=ee+le;i.style.height=he+"px"}else{const ne=U.length>0&&v===U[0].ref.current;i.style.top="0px";const le=Math.max(ge,P+m.offsetTop+(ne?se:0)+oe)+Q;i.style.height=le+"px",m.scrollTop=ee-ge+m.offsetTop}i.style.margin=`${Me}px 0`,i.style.minHeight=D+"px",i.style.maxHeight=q+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[g,s.trigger,s.valueNode,i,u,m,v,S,s.dir,r]);ye(()=>N(),[N]);const[w,x]=f.useState();ye(()=>{u&&x(window.getComputedStyle(u).zIndex)},[u]);const A=f.useCallback(O=>{O&&b.current===!0&&(N(),k?.(),b.current=!1)},[N,k]);return c.jsx(Pd,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:p,onScrollButtonChange:A,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:c.jsx(Ae.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Hs.displayName=Ad;var Td="SelectPopperPosition",_r=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Me,...s}=e,a=kn(n);return c.jsx(ms,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_r.displayName=Td;var[Pd,Or]=At(ft,{}),Mr="SelectViewport",Us=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=et(Mr,n),a=Or(Mr,n),i=ce(t,s.onViewportChange),l=f.useRef(0);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(En.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=a;if(g?.current&&h){const p=Math.abs(l.current-d.scrollTop);if(p>0){const b=window.innerHeight-Me*2,m=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),S=Math.max(m,v);if(S<b){const k=S+p,N=Math.min(b,k),w=k-N;h.style.height=N+"px",h.style.bottom==="0px"&&(d.scrollTop=w>0?w:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Us.displayName=Mr;var js="SelectGroup",[_d,Od]=At(js),Vs=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Lt();return c.jsx(_d,{scope:n,id:o,children:c.jsx(Ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Vs.displayName=js;var Gs="SelectLabel",Ys=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Od(Gs,n);return c.jsx(Ae.div,{id:o.id,...r,ref:t})});Ys.displayName=Gs;var An="SelectItem",[Md,qs]=At(An),Ks=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=Je(An,n),l=et(An,n),u=i.value===r,[d,h]=f.useState(s??""),[g,p]=f.useState(!1),b=ce(t,k=>l.itemRefCallback?.(k,r,o)),m=Lt(),v=f.useRef("touch"),S=()=>{o||(i.onValueChange(r),i.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 c.jsx(Md,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:f.useCallback(k=>{h(N=>N||(k?.textContent??"").trim())},[]),children:c.jsx(En.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ae.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:b,onFocus:J(a.onFocus,()=>p(!0)),onBlur:J(a.onBlur,()=>p(!1)),onClick:J(a.onClick,()=>{v.current!=="mouse"&&S()}),onPointerUp:J(a.onPointerUp,()=>{v.current==="mouse"&&S()}),onPointerDown:J(a.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:J(a.onPointerMove,k=>{v.current=k.pointerType,o?l.onItemLeave?.():v.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(a.onPointerLeave,k=>{k.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:J(a.onKeyDown,k=>{l.searchRef?.current!==""&&k.key===" "||(yd.includes(k.key)&&S(),k.key===" "&&k.preventDefault())})})})})});Ks.displayName=An;var Rt="SelectItemText",Xs=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Je(Rt,n),i=et(Rt,n),l=qs(Rt,n),u=Sd(Rt,n),[d,h]=f.useState(null),g=ce(t,S=>h(S),l.onItemTextChange,S=>i.itemTextRefCallback?.(S,l.value,l.disabled)),p=d?.textContent,b=f.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return ye(()=>(m(b),()=>v(b)),[m,v,b]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:l.textId,...s,ref:g}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?rn.createPortal(s.children,a.valueNode):null]})});Xs.displayName=Rt;var Qs="SelectItemIndicator",Dd=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qs(Qs,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});Dd.displayName=Qs;var Dr="SelectScrollUpButton",Zs=f.forwardRef((e,t)=>{const n=et(Dr,e.__scopeSelect),r=Or(Dr,e.__scopeSelect),[o,s]=f.useState(!1),a=ce(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Js,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Zs.displayName=Dr;var Ir="SelectScrollDownButton",Id=f.forwardRef((e,t)=>{const n=et(Ir,e.__scopeSelect),r=Or(Ir,e.__scopeSelect),[o,s]=f.useState(!1),a=ce(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Js,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});Id.displayName=Ir;var Js=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=et("SelectScrollButton",n),a=f.useRef(null),i=Nn(n),l=f.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),ye(()=>{i().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),c.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{l()})})}),Ld="SelectSeparator",ea=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});ea.displayName=Ld;var Lr="SelectArrow",ta=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=kn(n),s=Je(Lr,n),a=et(Lr,n);return s.open&&a.position==="popper"?c.jsx(hs,{...o,...r,ref:t}):null});ta.displayName=Lr;var Fd="SelectBubbleInput",na=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=f.useRef(null),s=ce(r,o),a=gs(t);return f.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(i,t),i.dispatchEvent(h)}},[a,t]),c.jsx(Ae.select,{...n,style:{...bs,...n.style},ref:s,defaultValue:t})});na.displayName=Fd;function ra(e){return e===""||e===void 0}function oa(e){const t=Ke(e),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(a=>{const i=n.current+a;t(i),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(i)},[t]),s=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function sa(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=$d(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $d(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zd=Ms,Rd=Is,Wd=Fs,Bd=$s,Hd=zs,Ud=Rs,jd=Us,Vd=Vs,Gd=Ys,Yd=Ks,qd=Xs,Kd=Zs,Xd=ea,aa=ta;function Qd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,apiClient:s}){const a=t[e.name]||"",i=typeof e.disabled=="function"?e.disabled(t):e.disabled,[l,u]=R.useState(e.options||[]),[d,h]=R.useState(!1),g=typeof e.refresh=="function"?e.refresh(t):e.refresh;return R.useEffect(()=>{(async()=>{if(!e.optionsUrl||!s){e.options&&u(e.options);return}h(!0);try{let b=e.optionsUrl,m={};if(e.queryParams){const w=typeof e.queryParams=="function"?e.queryParams(t):e.queryParams;typeof w=="string"?b+=w.startsWith("?")?w:`?${w}`:m={params:w}}const v=await s(b,m),S=v.data||v,N=(Array.isArray(S)?S:[]).map(w=>({value:w[e.valueId||"key"]||w.key,label:w[e.labelId||"value"]||w.value}));u(N),e.name+"_count"in t&&n(e.name+"_count",N.length)}catch(b){console.error("Failed to load options for SelectField:",b),u(e.options||[])}finally{h(!1)}})()},[e.optionsUrl,e.options,s,e.valueId,e.labelId,JSON.stringify(g),JSON.stringify(typeof e.queryParams=="function"?e.queryParams(t):e.queryParams)]),c.jsx(c.Fragment,{children:c.jsxs(zd,{value:a,onValueChange:p=>n(e.name,p),disabled:i,children:[c.jsxs(Rd,{id:e.name,onBlur:()=>r(e.name),className:`inline-flex items-center justify-between w-full h-10 rounded-md border 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 bg-background transition-all
60
+ `)},pd=0,kt=[];function md(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(pd++)[0],s=p.useState(Es)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Lu([e.lockRef.current],(e.shards||[]).map(Os),!0).filter(Boolean);return f.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=p.useCallback(function(f,b){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!a.current.allowPinchZoom;var S=Cn(f),k=n.current,E="deltaX"in f?f.deltaX:k[0]-S[0],w="deltaY"in f?f.deltaY:k[1]-S[1],T,L=f.target,A=Math.abs(E)>Math.abs(w)?"h":"v";if("touches"in f&&A==="h"&&L.type==="range")return!1;var x=window.getSelection(),$=x&&x.anchorNode,W=$?$===L||$.contains(L):!1;if(W)return!1;var R=As(A,L);if(!R)return!0;if(R?T=A:(T=A==="v"?"h":"v",R=As(A,L)),!R)return!1;if(!r.current&&"changedTouches"in f&&(E||w)&&(r.current=T),!T)return!0;var j=r.current||T;return ud(j,b,f,j==="h"?E:w)},[]),l=p.useCallback(function(f){var b=f;if(!(!kt.length||kt[kt.length-1]!==s)){var S="deltaY"in b?_s(b):Cn(b),k=t.current.filter(function(T){return T.name===b.type&&(T.target===b.target||b.target===T.shadowParent)&&dd(T.delta,S)})[0];if(k&&k.should){b.cancelable&&b.preventDefault();return}if(!k){var E=(a.current.shards||[]).map(Os).filter(Boolean).filter(function(T){return T.contains(b.target)}),w=E.length>0?i(b,E[0]):!a.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),u=p.useCallback(function(f,b,S,k){var E={name:f,delta:b,target:S,should:k,shadowParent:hd(S)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(w){return w!==E})},1)},[]),d=p.useCallback(function(f){n.current=Cn(f),r.current=void 0},[]),m=p.useCallback(function(f){u(f.type,_s(f),f.target,i(f,e.lockRef.current))},[]),g=p.useCallback(function(f){u(f.type,Cn(f),f.target,i(f,e.lockRef.current))},[]);p.useEffect(function(){return kt.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Nt),document.addEventListener("touchmove",l,Nt),document.addEventListener("touchstart",d,Nt),function(){kt=kt.filter(function(f){return f!==s}),document.removeEventListener("wheel",l,Nt),document.removeEventListener("touchmove",l,Nt),document.removeEventListener("touchstart",d,Nt)}},[]);var h=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(s,{styles:fd(o)}):null,h?p.createElement(rd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gd=ju(Cs,md);var Pr=p.forwardRef(function(e,t){return p.createElement(xn,We({},e,{ref:t,sideCar:gd}))});Pr.classNames=xn.classNames;var bd=[" ","Enter","ArrowUp","ArrowDown"],yd=[" ","Enter"],dt="Select",[En,Nn,vd]=wo(dt),[At]=ct(dt,[vd,gn]),kn=gn(),[wd,Je]=At(dt),[xd,Sd]=At(dt),Ms=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:u,name:d,autoComplete:m,disabled:g,required:h,form:y}=e,f=kn(t),[b,S]=p.useState(null),[k,E]=p.useState(null),[w,T]=p.useState(!1),L=tr(u),[A,x]=zt({prop:r,defaultProp:o??!1,onChange:s,caller:dt}),[$,W]=zt({prop:a,defaultProp:i,onChange:l,caller:dt}),R=p.useRef(null),j=b?y||!!b.closest("form"):!0,[D,C]=p.useState(new Set),P=Array.from(D).map(_=>_.props.value).join(";");return c.jsx(ps,{...f,children:c.jsxs(wd,{required:h,scope:t,trigger:b,onTriggerChange:S,valueNode:k,onValueNodeChange:E,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:Lt(),value:$,onValueChange:W,open:A,onOpenChange:x,dir:L,triggerPointerDownPosRef:R,disabled:g,children:[c.jsx(En.Provider,{scope:t,children:c.jsx(xd,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(_=>{C(F=>new Set(F).add(_))},[]),onNativeOptionRemove:p.useCallback(_=>{C(F=>{const N=new Set(F);return N.delete(_),N})},[]),children:n})}),j?c.jsxs(na,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:m,value:$,onChange:_=>W(_.target.value),disabled:g,form:y,children:[$===void 0?c.jsx("option",{value:""}):null,Array.from(D)]},P):null]})})};Ms.displayName=dt;var Ds="SelectTrigger",Is=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=kn(n),a=Je(Ds,n),i=a.disabled||r,l=ce(t,a.onTriggerChange),u=Nn(n),d=p.useRef("touch"),[m,g,h]=oa(f=>{const b=u().filter(E=>!E.disabled),S=b.find(E=>E.value===a.value),k=sa(b,f,S);k!==void 0&&a.onValueChange(k.value)}),y=f=>{i||(a.onOpenChange(!0),h()),f&&(a.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return c.jsx(Sr,{asChild:!0,...s,children:c.jsx(Ae.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:i,"data-disabled":i?"":void 0,"data-placeholder":ra(a.value)?"":void 0,...o,ref:l,onClick:J(o.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&y(f)}),onPointerDown:J(o.onPointerDown,f=>{d.current=f.pointerType;const b=f.target;b.hasPointerCapture(f.pointerId)&&b.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(y(f),f.preventDefault())}),onKeyDown:J(o.onKeyDown,f=>{const b=m.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&g(f.key),!(b&&f.key===" ")&&bd.includes(f.key)&&(y(),f.preventDefault())})})})});Is.displayName=Ds;var Ls="SelectValue",Fs=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,l=Je(Ls,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,m=ce(t,l.onValueNodeChange);return ye(()=>{u(d)},[u,d]),c.jsx(Ae.span,{...i,ref:m,style:{pointerEvents:"none"},children:ra(l.value)?c.jsx(c.Fragment,{children:a}):s})});Fs.displayName=Ls;var Cd="SelectIcon",$s=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});$s.displayName=Cd;var Ed="SelectPortal",zs=e=>c.jsx(Cr,{asChild:!0,...e});zs.displayName=Ed;var ft="SelectContent",Rs=p.forwardRef((e,t)=>{const n=Je(ft,e.__scopeSelect),[r,o]=p.useState();if(ye(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?rn.createPortal(c.jsx(Ws,{scope:e.__scopeSelect,children:c.jsx(En.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Bs,{...e,ref:t})});Rs.displayName=ft;var Me=10,[Ws,et]=At(ft),Nd="SelectContentImpl",kd=Ce("SelectContent.RemoveScroll"),Bs=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:u,alignOffset:d,arrowPadding:m,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:f,avoidCollisions:b,...S}=e,k=Je(ft,n),[E,w]=p.useState(null),[T,L]=p.useState(null),A=ce(t,V=>w(V)),[x,$]=p.useState(null),[W,R]=p.useState(null),j=Nn(n),[D,C]=p.useState(!1),P=p.useRef(!1);p.useEffect(()=>{if(E)return vs(E)},[E]),ko();const _=p.useCallback(V=>{const[ee,...Q]=j().map(ae=>ae.ref.current),[te]=Q.slice(-1),ne=document.activeElement;for(const ae of V)if(ae===ne||(ae?.scrollIntoView({block:"nearest"}),ae===ee&&T&&(T.scrollTop=0),ae===te&&T&&(T.scrollTop=T.scrollHeight),ae?.focus(),document.activeElement!==ne))return},[j,T]),F=p.useCallback(()=>_([x,E]),[_,x,E]);p.useEffect(()=>{D&&F()},[D,F]);const{onOpenChange:N,triggerPointerDownPosRef:O}=k;p.useEffect(()=>{if(E){let V={x:0,y:0};const ee=te=>{V={x:Math.abs(Math.round(te.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(te.pageY)-(O.current?.y??0))}},Q=te=>{V.x<=10&&V.y<=10?te.preventDefault():E.contains(te.target)||N(!1),document.removeEventListener("pointermove",ee),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",Q,{capture:!0})}}},[E,N,O]),p.useEffect(()=>{const V=()=>N(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[N]);const[M,G]=oa(V=>{const ee=j().filter(ne=>!ne.disabled),Q=ee.find(ne=>ne.ref.current===document.activeElement),te=sa(ee,V,Q);te&&setTimeout(()=>te.ref.current.focus())}),se=p.useCallback((V,ee,Q)=>{const te=!P.current&&!Q;(k.value!==void 0&&k.value===ee||te)&&($(V),te&&(P.current=!0))},[k.value]),Z=p.useCallback(()=>E?.focus(),[E]),ge=p.useCallback((V,ee,Q)=>{const te=!P.current&&!Q;(k.value!==void 0&&k.value===ee||te)&&R(V)},[k.value]),q=r==="popper"?_r:Hs,oe=q===_r?{side:i,sideOffset:l,align:u,alignOffset:d,arrowPadding:m,collisionBoundary:g,collisionPadding:h,sticky:y,hideWhenDetached:f,avoidCollisions:b}:{};return c.jsx(Ws,{scope:n,content:E,viewport:T,onViewportChange:L,itemRefCallback:se,selectedItem:x,onItemLeave:Z,itemTextRefCallback:ge,focusSelectedItem:F,selectedItemText:W,position:r,isPositioned:D,searchRef:M,children:c.jsx(Pr,{as:kd,allowPinchZoom:!0,children:c.jsx(ir,{asChild:!0,trapped:k.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:J(o,V=>{k.trigger?.focus({preventScroll:!0}),V.preventDefault()}),children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(q,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:V=>V.preventDefault(),...S,...oe,onPlaced:()=>C(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:J(S.onKeyDown,V=>{const ee=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!ee&&V.key.length===1&&G(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let te=j().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(V.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ne=V.target,ae=te.indexOf(ne);te=te.slice(ae+1)}setTimeout(()=>_(te)),V.preventDefault()}})})})})})})});Bs.displayName=Nd;var Ad="SelectItemAlignedPosition",Hs=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Je(ft,n),a=et(ft,n),[i,l]=p.useState(null),[u,d]=p.useState(null),m=ce(t,A=>d(A)),g=Nn(n),h=p.useRef(!1),y=p.useRef(!0),{viewport:f,selectedItem:b,selectedItemText:S,focusSelectedItem:k}=a,E=p.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&f&&b&&S){const A=s.trigger.getBoundingClientRect(),x=u.getBoundingClientRect(),$=s.valueNode.getBoundingClientRect(),W=S.getBoundingClientRect();if(s.dir!=="rtl"){const ne=W.left-x.left,ae=$.left-ne,le=A.left-ae,he=A.width+le,Le=Math.max(he,x.width),gt=window.innerWidth-Me,bt=yo(ae,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.left=bt+"px"}else{const ne=x.right-W.right,ae=window.innerWidth-$.right-ne,le=window.innerWidth-A.right-ae,he=A.width+le,Le=Math.max(he,x.width),gt=window.innerWidth-Me,bt=yo(ae,[Me,Math.max(Me,gt-Le)]);i.style.minWidth=he+"px",i.style.right=bt+"px"}const R=g(),j=window.innerHeight-Me*2,D=f.scrollHeight,C=window.getComputedStyle(u),P=parseInt(C.borderTopWidth,10),_=parseInt(C.paddingTop,10),F=parseInt(C.borderBottomWidth,10),N=parseInt(C.paddingBottom,10),O=P+_+D+N+F,M=Math.min(b.offsetHeight*5,O),G=window.getComputedStyle(f),se=parseInt(G.paddingTop,10),Z=parseInt(G.paddingBottom,10),ge=A.top+A.height/2-Me,q=j-ge,oe=b.offsetHeight/2,V=b.offsetTop+oe,ee=P+_+V,Q=O-ee;if(ee<=ge){const ne=R.length>0&&b===R[R.length-1].ref.current;i.style.bottom="0px";const ae=u.clientHeight-f.offsetTop-f.offsetHeight,le=Math.max(q,oe+(ne?Z:0)+ae+F),he=ee+le;i.style.height=he+"px"}else{const ne=R.length>0&&b===R[0].ref.current;i.style.top="0px";const le=Math.max(ge,P+f.offsetTop+(ne?se:0)+oe)+Q;i.style.height=le+"px",f.scrollTop=ee-ge+f.offsetTop}i.style.margin=`${Me}px 0`,i.style.minHeight=M+"px",i.style.maxHeight=j+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,i,u,f,b,S,s.dir,r]);ye(()=>E(),[E]);const[w,T]=p.useState();ye(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);const L=p.useCallback(A=>{A&&y.current===!0&&(E(),k?.(),y.current=!1)},[E,k]);return c.jsx(Pd,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:h,onScrollButtonChange:L,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:c.jsx(Ae.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Hs.displayName=Ad;var Td="SelectPopperPosition",_r=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Me,...s}=e,a=kn(n);return c.jsx(ms,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_r.displayName=Td;var[Pd,Or]=At(ft,{}),Mr="SelectViewport",Us=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=et(Mr,n),a=Or(Mr,n),i=ce(t,s.onViewportChange),l=p.useRef(0);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(En.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=a;if(g?.current&&m){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-Me*2,f=parseFloat(m.style.minHeight),b=parseFloat(m.style.height),S=Math.max(f,b);if(S<y){const k=S+h,E=Math.min(y,k),w=k-E;m.style.height=E+"px",m.style.bottom==="0px"&&(d.scrollTop=w>0?w:0,m.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Us.displayName=Mr;var js="SelectGroup",[_d,Od]=At(js),Vs=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Lt();return c.jsx(_d,{scope:n,id:o,children:c.jsx(Ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Vs.displayName=js;var Gs="SelectLabel",Ys=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Od(Gs,n);return c.jsx(Ae.div,{id:o.id,...r,ref:t})});Ys.displayName=Gs;var An="SelectItem",[Md,qs]=At(An),Ks=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=Je(An,n),l=et(An,n),u=i.value===r,[d,m]=p.useState(s??""),[g,h]=p.useState(!1),y=ce(t,k=>l.itemRefCallback?.(k,r,o)),f=Lt(),b=p.useRef("touch"),S=()=>{o||(i.onValueChange(r),i.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 c.jsx(Md,{scope:n,value:r,disabled:o,textId:f,isSelected:u,onItemTextChange:p.useCallback(k=>{m(E=>E||(k?.textContent??"").trim())},[]),children:c.jsx(En.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ae.div,{role:"option","aria-labelledby":f,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:y,onFocus:J(a.onFocus,()=>h(!0)),onBlur:J(a.onBlur,()=>h(!1)),onClick:J(a.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:J(a.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:J(a.onPointerDown,k=>{b.current=k.pointerType}),onPointerMove:J(a.onPointerMove,k=>{b.current=k.pointerType,o?l.onItemLeave?.():b.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(a.onPointerLeave,k=>{k.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:J(a.onKeyDown,k=>{l.searchRef?.current!==""&&k.key===" "||(yd.includes(k.key)&&S(),k.key===" "&&k.preventDefault())})})})})});Ks.displayName=An;var Rt="SelectItemText",Xs=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Je(Rt,n),i=et(Rt,n),l=qs(Rt,n),u=Sd(Rt,n),[d,m]=p.useState(null),g=ce(t,S=>m(S),l.onItemTextChange,S=>i.itemTextRefCallback?.(S,l.value,l.disabled)),h=d?.textContent,y=p.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:f,onNativeOptionRemove:b}=u;return ye(()=>(f(y),()=>b(y)),[f,b,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:l.textId,...s,ref:g}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?rn.createPortal(s.children,a.valueNode):null]})});Xs.displayName=Rt;var Qs="SelectItemIndicator",Dd=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qs(Qs,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});Dd.displayName=Qs;var Dr="SelectScrollUpButton",Zs=p.forwardRef((e,t)=>{const n=et(Dr,e.__scopeSelect),r=Or(Dr,e.__scopeSelect),[o,s]=p.useState(!1),a=ce(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Js,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Zs.displayName=Dr;var Ir="SelectScrollDownButton",Id=p.forwardRef((e,t)=>{const n=et(Ir,e.__scopeSelect),r=Or(Ir,e.__scopeSelect),[o,s]=p.useState(!1),a=ce(t,r.onScrollButtonChange);return ye(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?c.jsx(Js,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});Id.displayName=Ir;var Js=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=et("SelectScrollButton",n),a=p.useRef(null),i=Nn(n),l=p.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return p.useEffect(()=>()=>l(),[l]),ye(()=>{i().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),c.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{l()})})}),Ld="SelectSeparator",ea=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});ea.displayName=Ld;var Lr="SelectArrow",ta=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=kn(n),s=Je(Lr,n),a=et(Lr,n);return s.open&&a.position==="popper"?c.jsx(hs,{...o,...r,ref:t}):null});ta.displayName=Lr;var Fd="SelectBubbleInput",na=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=p.useRef(null),s=ce(r,o),a=gs(t);return p.useEffect(()=>{const i=o.current;if(!i)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const m=new Event("change",{bubbles:!0});d.call(i,t),i.dispatchEvent(m)}},[a,t]),c.jsx(Ae.select,{...n,style:{...bs,...n.style},ref:s,defaultValue:t})});na.displayName=Fd;function ra(e){return e===""||e===void 0}function oa(e){const t=Ke(e),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(a=>{const i=n.current+a;t(i),(function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(i)},[t]),s=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function sa(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=$d(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $d(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zd=Ms,Rd=Is,Wd=Fs,Bd=$s,Hd=zs,Ud=Rs,jd=Us,Vd=Vs,Gd=Ys,Yd=Ks,qd=Xs,Kd=Zs,Xd=ea,aa=ta;function Qd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,apiClient:s}){const a=t[e.name]||"",i=typeof e.disabled=="function"?e.disabled(t):e.disabled,[l,u]=z.useState(e.options||[]),[d,m]=z.useState(!1),g=typeof e.refresh=="function"?e.refresh(t):e.refresh;return z.useEffect(()=>{(async()=>{if(!e.optionsUrl||!s){e.options&&u(e.options);return}m(!0);try{let y=e.optionsUrl,f={};if(e.queryParams){const w=typeof e.queryParams=="function"?e.queryParams(t):e.queryParams;typeof w=="string"?y+=w.startsWith("?")?w:`?${w}`:f={params:w}}const b=await s(y,f),S=b.data||b,E=(Array.isArray(S)?S:[]).map(w=>({value:w[e.valueId||"key"]||w.key,label:w[e.labelId||"value"]||w.value}));u(E),e.name+"_count"in t&&n(e.name+"_count",E.length)}catch(y){console.error("Failed to load options for SelectField:",y),u(e.options||[])}finally{m(!1)}})()},[e.optionsUrl,e.options,s,e.valueId,e.labelId,JSON.stringify(g),JSON.stringify(typeof e.queryParams=="function"?e.queryParams(t):e.queryParams)]),c.jsx(c.Fragment,{children:c.jsxs(zd,{value:a,onValueChange:h=>n(e.name,h),disabled:i,children:[c.jsxs(Rd,{id:e.name,onBlur:()=>r(e.name),className:`inline-flex items-center justify-between w-full h-10 rounded-md border 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 bg-background transition-all
61
61
  ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"}
62
62
  ${i?"cursor-not-allowed opacity-50":""}
63
- `,children:[c.jsx(Wd,{placeholder:d?"Loading...":e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),c.jsx(Bd,{className:"ml-2 text-gray-500 flex items-center",children:d?c.jsx(bo,{className:"w-4 h-4 animate-spin"}):c.jsx(on,{className:"w-4 h-4"})})]}),c.jsx(Hd,{children:c.jsxs(Ud,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[c.jsx(Kd,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:c.jsx(aa,{className:"fill-white stroke-gray-200"})}),c.jsxs(jd,{className:"p-1",children:[e.groupLabel&&c.jsx(Vd,{children:c.jsx(Gd,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),l.map(p=>c.jsx(Yd,{value:p.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
63
+ `,children:[c.jsx(Wd,{placeholder:d?"Loading...":e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),c.jsx(Bd,{className:"ml-2 text-gray-500 flex items-center",children:d?c.jsx(bo,{className:"w-4 h-4 animate-spin"}):c.jsx(on,{className:"w-4 h-4"})})]}),c.jsx(Hd,{children:c.jsxs(Ud,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[c.jsx(Kd,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:c.jsx(aa,{className:"fill-white stroke-gray-200"})}),c.jsxs(jd,{className:"p-1",children:[e.groupLabel&&c.jsx(Vd,{children:c.jsx(Gd,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),l.map(h=>c.jsx(Yd,{value:h.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
64
64
  data-[state=checked]:bg-blue-50
65
65
  data-[state=checked]:text-blue-600
66
- `,children:c.jsx(qd,{children:p.label})},p.value)),e.separator&&c.jsx(Xd,{className:"my-1 h-px bg-gray-200"})]}),c.jsx(aa,{className:"fill-white stroke-gray-200"})]})})]})})}function Zd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return c.jsx(c.Fragment,{children:c.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>{a||n(e.name,i.target.value)},onBlur:()=>r(e.name),disabled:a,readOnly:a,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`})})}function ia({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=s,b=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:e.type||"text",value:t[e.name]||"",onChange:m=>n(e.name,m.target.value),onBlur:()=>r(e.name),disabled:p,placeholder:e.placeholder||"",minLength:e.minLength,maxLength:e.maxLength,"aria-invalid":!!o,"aria-describedby":o?b:void 0,className:`
66
+ `,children:c.jsx(qd,{children:h.label})},h.value)),e.separator&&c.jsx(Xd,{className:"my-1 h-px bg-gray-200"})]}),c.jsx(aa,{className:"fill-white stroke-gray-200"})]})})]})})}function Zd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return c.jsx(c.Fragment,{children:c.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>{a||n(e.name,i.target.value)},onBlur:()=>r(e.name),disabled:a,readOnly:a,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`})})}function ia({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:m,...g}=a,h=s,y=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:e.type||"text",value:t[e.name]||"",onChange:f=>n(e.name,f.target.value),onBlur:()=>r(e.name),disabled:h,placeholder:e.placeholder||"",minLength:e.minLength,maxLength:e.maxLength,"aria-invalid":!!o,"aria-describedby":o?y:void 0,className:`
67
67
  flex h-10 w-full rounded-md border px-3 py-2 text-sm
68
68
  transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium
69
69
  placeholder:text-muted-foreground
70
70
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
71
71
  disabled:cursor-not-allowed disabled:opacity-50
72
72
  ${o?"border-destructive focus-visible:ring-destructive":"border-input focus-visible:ring-ring"}
73
- ${p?"bg-muted text-muted-foreground":"bg-background text-foreground"}
73
+ ${h?"bg-muted text-muted-foreground":"bg-background text-foreground"}
74
74
  ${e.className||""}
75
- `})}function Jd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=s,b=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:"number",value:t[e.name]??"",onChange:m=>n(e.name,m.target.value),onBlur:()=>r(e.name),disabled:p,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step||"any","aria-invalid":!!o,"aria-describedby":o?b:void 0,className:`
75
+ `})}function Jd({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:m,...g}=a,h=s,y=g["aria-describedby"];return c.jsx("input",{...e.props,...g,id:e.name,name:e.name,type:"number",value:t[e.name]??"",onChange:f=>n(e.name,f.target.value),onBlur:()=>r(e.name),disabled:h,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step||"any","aria-invalid":!!o,"aria-describedby":o?y:void 0,className:`
76
76
  flex h-10 w-full rounded-md border px-3 py-2 text-sm
77
77
  transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium
78
78
  placeholder:text-muted-foreground
79
79
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
80
80
  disabled:cursor-not-allowed disabled:opacity-50
81
81
  ${o?"border-destructive focus-visible:ring-destructive":"border-input focus-visible:ring-ring"}
82
- ${p?"bg-muted text-muted-foreground":"bg-background text-foreground"}
82
+ ${h?"bg-muted text-muted-foreground":"bg-background text-foreground"}
83
83
  ${e.className||""}
84
- `})}const{entries:ca,setPrototypeOf:la,isFrozen:ef,getPrototypeOf:tf,getOwnPropertyDescriptor:nf}=Object;let{freeze:we,seal:Pe,create:Wt}=Object,{apply:Fr,construct:$r}=typeof Reflect<"u"&&Reflect;we||(we=function(t){return t}),Pe||(Pe=function(t){return t}),Fr||(Fr=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)}),$r||($r=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const Bt=Se(Array.prototype.forEach),rf=Se(Array.prototype.lastIndexOf),ua=Se(Array.prototype.pop),Ht=Se(Array.prototype.push),of=Se(Array.prototype.splice),Tn=Se(String.prototype.toLowerCase),zr=Se(String.prototype.toString),Rr=Se(String.prototype.match),Tt=Se(String.prototype.replace),sf=Se(String.prototype.indexOf),af=Se(String.prototype.trim),De=Se(Object.prototype.hasOwnProperty),xe=Se(RegExp.prototype.test),Ut=cf(TypeError);function Se(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Fr(e,t,r)}}function cf(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $r(e,n)}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tn;la&&la(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(ef(t)||(t[r]=s),o=s)}e[o]=!0}return e}function lf(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Be(e){const t=Wt(null);for(const[n,r]of ca(e))De(e,n)&&(Array.isArray(r)?t[n]=lf(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Be(r):t[n]=r);return t}function jt(e,t){for(;e!==null;){const r=nf(e,t);if(r){if(r.get)return Se(r.get);if(typeof r.value=="function")return Se(r.value)}e=tf(e)}function n(){return null}return n}const da=we(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wr=we(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Br=we(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),uf=we(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hr=we(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),df=we(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fa=we(["#text"]),pa=we(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ur=we(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ma=we(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pn=we(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ff=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pf=Pe(/<%[\w\W]*|[\w\W]*%>/gm),mf=Pe(/\$\{[\w\W]*/gm),hf=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),gf=Pe(/^aria-[\-\w]+$/),ha=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bf=Pe(/^(?:\w+script|data):/i),yf=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ga=Pe(/^html$/i),vf=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var ba=Object.freeze({__proto__:null,ARIA_ATTR:gf,ATTR_WHITESPACE:yf,CUSTOM_ELEMENT:vf,DATA_ATTR:hf,DOCTYPE_NAME:ga,ERB_EXPR:pf,IS_ALLOWED_URI:ha,IS_SCRIPT_OR_DATA:bf,MUSTACHE_EXPR:ff,TMPLIT_EXPR:mf});const Vt={element:1,text:3,progressingInstruction:7,comment:8,document:9},wf=function(){return typeof window>"u"?null:window},xf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},ya=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function va(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wf();const t=G=>va(G);if(t.version="3.4.0",t.removed=[],!e||!e.document||e.document.nodeType!==Vt.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:i,Element:l,NodeFilter:u,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:p}=e,b=l.prototype,m=jt(b,"cloneNode"),v=jt(b,"remove"),S=jt(b,"nextSibling"),k=jt(b,"childNodes"),N=jt(b,"parentNode");if(typeof a=="function"){const G=n.createElement("template");G.content&&G.content.ownerDocument&&(n=G.content.ownerDocument)}let w,x="";const{implementation:A,createNodeIterator:O,createDocumentFragment:T,getElementsByTagName:z}=n,{importNode:$}=r;let U=ya();t.isSupported=typeof ca=="function"&&typeof N=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:I,TMPLIT_EXPR:C,DATA_ATTR:P,ARIA_ATTR:_,IS_SCRIPT_OR_DATA:F,ATTR_WHITESPACE:E,CUSTOM_ELEMENT:M}=ba;let{IS_ALLOWED_URI:D}=ba,V=null;const se=X({},[...da,...Wr,...Br,...Hr,...fa]);let Z=null;const ge=X({},[...pa,...Ur,...ma,...Pn]);let Y=Object.seal(Wt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,j=null;const ee=Object.seal(Wt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,te=!0,ne=!1,ae=!0,le=!1,he=!0,Le=!1,gt=!1,bt=!1,Ot=!1,Gn=!1,Yn=!1,Li=!0,Fi=!1;const Fh="user-content-";let to=!0,Jt=!1,Mt={},He=null;const no=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $i=null;const zi=X({},["audio","video","img","source","image","track"]);let ro=null;const Ri=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let Dt=Ue,oo=!1,so=null;const $h=X({},[qn,Kn,Ue],zr);let Xn=X({},["mi","mo","mn","ms","mtext"]),Qn=X({},["annotation-xml"]);const zh=X({},["title","style","font","a","script"]);let en=null;const Rh=["application/xhtml+xml","text/html"],Wh="text/html";let pe=null,It=null;const Bh=n.createElement("form"),Wi=function(y){return y instanceof RegExp||y instanceof Function},ao=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(It&&It===y)){if((!y||typeof y!="object")&&(y={}),y=Be(y),en=Rh.indexOf(y.PARSER_MEDIA_TYPE)===-1?Wh:y.PARSER_MEDIA_TYPE,pe=en==="application/xhtml+xml"?zr:Tn,V=De(y,"ALLOWED_TAGS")?X({},y.ALLOWED_TAGS,pe):se,Z=De(y,"ALLOWED_ATTR")?X({},y.ALLOWED_ATTR,pe):ge,so=De(y,"ALLOWED_NAMESPACES")?X({},y.ALLOWED_NAMESPACES,zr):$h,ro=De(y,"ADD_URI_SAFE_ATTR")?X(Be(Ri),y.ADD_URI_SAFE_ATTR,pe):Ri,$i=De(y,"ADD_DATA_URI_TAGS")?X(Be(zi),y.ADD_DATA_URI_TAGS,pe):zi,He=De(y,"FORBID_CONTENTS")?X({},y.FORBID_CONTENTS,pe):no,oe=De(y,"FORBID_TAGS")?X({},y.FORBID_TAGS,pe):Be({}),j=De(y,"FORBID_ATTR")?X({},y.FORBID_ATTR,pe):Be({}),Mt=De(y,"USE_PROFILES")?y.USE_PROFILES:!1,Q=y.ALLOW_ARIA_ATTR!==!1,te=y.ALLOW_DATA_ATTR!==!1,ne=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ae=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=y.SAFE_FOR_TEMPLATES||!1,he=y.SAFE_FOR_XML!==!1,Le=y.WHOLE_DOCUMENT||!1,Ot=y.RETURN_DOM||!1,Gn=y.RETURN_DOM_FRAGMENT||!1,Yn=y.RETURN_TRUSTED_TYPE||!1,bt=y.FORCE_BODY||!1,Li=y.SANITIZE_DOM!==!1,Fi=y.SANITIZE_NAMED_PROPS||!1,to=y.KEEP_CONTENT!==!1,Jt=y.IN_PLACE||!1,D=y.ALLOWED_URI_REGEXP||ha,Dt=y.NAMESPACE||Ue,Xn=y.MATHML_TEXT_INTEGRATION_POINTS||Xn,Qn=y.HTML_INTEGRATION_POINTS||Qn,Y=y.CUSTOM_ELEMENT_HANDLING||Wt(null),y.CUSTOM_ELEMENT_HANDLING&&Wi(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),y.CUSTOM_ELEMENT_HANDLING&&Wi(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),y.CUSTOM_ELEMENT_HANDLING&&typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),le&&(te=!1),Gn&&(Ot=!0),Mt&&(V=X({},fa),Z=Wt(null),Mt.html===!0&&(X(V,da),X(Z,pa)),Mt.svg===!0&&(X(V,Wr),X(Z,Ur),X(Z,Pn)),Mt.svgFilters===!0&&(X(V,Br),X(Z,Ur),X(Z,Pn)),Mt.mathMl===!0&&(X(V,Hr),X(Z,ma),X(Z,Pn))),ee.tagCheck=null,ee.attributeCheck=null,y.ADD_TAGS&&(typeof y.ADD_TAGS=="function"?ee.tagCheck=y.ADD_TAGS:(V===se&&(V=Be(V)),X(V,y.ADD_TAGS,pe))),y.ADD_ATTR&&(typeof y.ADD_ATTR=="function"?ee.attributeCheck=y.ADD_ATTR:(Z===ge&&(Z=Be(Z)),X(Z,y.ADD_ATTR,pe))),y.ADD_URI_SAFE_ATTR&&X(ro,y.ADD_URI_SAFE_ATTR,pe),y.FORBID_CONTENTS&&(He===no&&(He=Be(He)),X(He,y.FORBID_CONTENTS,pe)),y.ADD_FORBID_CONTENTS&&(He===no&&(He=Be(He)),X(He,y.ADD_FORBID_CONTENTS,pe)),to&&(V["#text"]=!0),Le&&X(V,["html","head","body"]),V.table&&(X(V,["tbody"]),delete oe.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=y.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else w===void 0&&(w=xf(p,o)),w!==null&&typeof x=="string"&&(x=w.createHTML(""));we&&we(y),It=y}},Bi=X({},[...Wr,...Br,...uf]),Hi=X({},[...Hr,...df]),Hh=function(y){let L=N(y);(!L||!L.tagName)&&(L={namespaceURI:Dt,tagName:"template"});const H=Tn(y.tagName),ue=Tn(L.tagName);return so[y.namespaceURI]?y.namespaceURI===Kn?L.namespaceURI===Ue?H==="svg":L.namespaceURI===qn?H==="svg"&&(ue==="annotation-xml"||Xn[ue]):!!Bi[H]:y.namespaceURI===qn?L.namespaceURI===Ue?H==="math":L.namespaceURI===Kn?H==="math"&&Qn[ue]:!!Hi[H]:y.namespaceURI===Ue?L.namespaceURI===Kn&&!Qn[ue]||L.namespaceURI===qn&&!Xn[ue]?!1:!Hi[H]&&(zh[H]||!Bi[H]):!!(en==="application/xhtml+xml"&&so[y.namespaceURI]):!1},Fe=function(y){Ht(t.removed,{element:y});try{N(y).removeChild(y)}catch{v(y)}},yt=function(y,L){try{Ht(t.removed,{attribute:L.getAttributeNode(y),from:L})}catch{Ht(t.removed,{attribute:null,from:L})}if(L.removeAttribute(y),y==="is")if(Ot||Gn)try{Fe(L)}catch{}else try{L.setAttribute(y,"")}catch{}},Ui=function(y){let L=null,H=null;if(bt)y="<remove></remove>"+y;else{const de=Rr(y,/^[\r\n\t ]+/);H=de&&de[0]}en==="application/xhtml+xml"&&Dt===Ue&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const ue=w?w.createHTML(y):y;if(Dt===Ue)try{L=new g().parseFromString(ue,en)}catch{}if(!L||!L.documentElement){L=A.createDocument(Dt,"template",null);try{L.documentElement.innerHTML=oo?x:ue}catch{}}const ve=L.body||L.documentElement;return y&&H&&ve.insertBefore(n.createTextNode(H),ve.childNodes[0]||null),Dt===Ue?z.call(L,Le?"html":"body")[0]:Le?L.documentElement:ve},ji=function(y){return O.call(y.ownerDocument||y,y,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},io=function(y){return y instanceof h&&(typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||!(y.attributes instanceof d)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function")},co=function(y){return typeof i=="function"&&y instanceof i};function qe(G,y,L){Bt(G,H=>{H.call(t,y,L,It)})}const Vi=function(y){let L=null;if(qe(U.beforeSanitizeElements,y,null),io(y))return Fe(y),!0;const H=pe(y.nodeName);if(qe(U.uponSanitizeElement,y,{tagName:H,allowedTags:V}),he&&y.hasChildNodes()&&!co(y.firstElementChild)&&xe(/<[/\w!]/g,y.innerHTML)&&xe(/<[/\w!]/g,y.textContent)||he&&y.namespaceURI===Ue&&H==="style"&&co(y.firstElementChild)||y.nodeType===Vt.progressingInstruction||he&&y.nodeType===Vt.comment&&xe(/<[/\w]/g,y.data))return Fe(y),!0;if(oe[H]||!(ee.tagCheck instanceof Function&&ee.tagCheck(H))&&!V[H]){if(!oe[H]&&Yi(H)&&(Y.tagNameCheck instanceof RegExp&&xe(Y.tagNameCheck,H)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(H)))return!1;if(to&&!He[H]){const ue=N(y)||y.parentNode,ve=k(y)||y.childNodes;if(ve&&ue){const de=ve.length;for(let Ee=de-1;Ee>=0;--Ee){const Te=m(ve[Ee],!0);Te.__removalCount=(y.__removalCount||0)+1,ue.insertBefore(Te,S(y))}}}return Fe(y),!0}return y instanceof l&&!Hh(y)||(H==="noscript"||H==="noembed"||H==="noframes")&&xe(/<\/no(script|embed|frames)/i,y.innerHTML)?(Fe(y),!0):(le&&y.nodeType===Vt.text&&(L=y.textContent,Bt([q,I,C],ue=>{L=Tt(L,ue," ")}),y.textContent!==L&&(Ht(t.removed,{element:y.cloneNode()}),y.textContent=L)),qe(U.afterSanitizeElements,y,null),!1)},Gi=function(y,L,H){if(j[L]||Li&&(L==="id"||L==="name")&&(H in n||H in Bh))return!1;if(!(te&&!j[L]&&xe(P,L))){if(!(Q&&xe(_,L))){if(!(ee.attributeCheck instanceof Function&&ee.attributeCheck(L,y))){if(!Z[L]||j[L]){if(!(Yi(y)&&(Y.tagNameCheck instanceof RegExp&&xe(Y.tagNameCheck,y)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(y))&&(Y.attributeNameCheck instanceof RegExp&&xe(Y.attributeNameCheck,L)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(L,y))||L==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&xe(Y.tagNameCheck,H)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(H))))return!1}else if(!ro[L]){if(!xe(D,Tt(H,E,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&y!=="script"&&sf(H,"data:")===0&&$i[y])){if(!(ne&&!xe(F,Tt(H,E,"")))){if(H)return!1}}}}}}}return!0},Yi=function(y){return y!=="annotation-xml"&&Rr(y,M)},qi=function(y){qe(U.beforeSanitizeAttributes,y,null);const{attributes:L}=y;if(!L||io(y))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let ue=L.length;for(;ue--;){const ve=L[ue],{name:de,namespaceURI:Ee,value:Te}=ve,it=pe(de),lo=Te;let be=de==="value"?lo:af(lo);if(H.attrName=it,H.attrValue=be,H.keepAttr=!0,H.forceKeepAttr=void 0,qe(U.uponSanitizeAttribute,y,H),be=H.attrValue,Fi&&(it==="id"||it==="name")&&(yt(de,y),be=Fh+be),he&&xe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,be)){yt(de,y);continue}if(it==="attributename"&&Rr(be,"href")){yt(de,y);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){yt(de,y);continue}if(!ae&&xe(/\/>/i,be)){yt(de,y);continue}le&&Bt([q,I,C],Qi=>{be=Tt(be,Qi," ")});const Xi=pe(y.nodeName);if(!Gi(Xi,it,be)){yt(de,y);continue}if(w&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Ee)switch(p.getAttributeType(Xi,it)){case"TrustedHTML":{be=w.createHTML(be);break}case"TrustedScriptURL":{be=w.createScriptURL(be);break}}if(be!==lo)try{Ee?y.setAttributeNS(Ee,de,be):y.setAttribute(de,be),io(y)?Fe(y):ua(t.removed)}catch{yt(de,y)}}qe(U.afterSanitizeAttributes,y,null)},Ki=function(y){let L=null;const H=ji(y);for(qe(U.beforeSanitizeShadowDOM,y,null);L=H.nextNode();)qe(U.uponSanitizeShadowNode,L,null),Vi(L),qi(L),L.content instanceof s&&Ki(L.content);qe(U.afterSanitizeShadowDOM,y,null)};return t.sanitize=function(G){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,H=null,ue=null,ve=null;if(oo=!G,oo&&(G="<!-->"),typeof G!="string"&&!co(G))if(typeof G.toString=="function"){if(G=G.toString(),typeof G!="string")throw Ut("dirty is not a string, aborting")}else throw Ut("toString is not a function");if(!t.isSupported)return G;if(gt||ao(y),t.removed=[],typeof G=="string"&&(Jt=!1),Jt){if(G.nodeName){const Te=pe(G.nodeName);if(!V[Te]||oe[Te])throw Ut("root node is forbidden and cannot be sanitized in-place")}}else if(G instanceof i)L=Ui("<!---->"),H=L.ownerDocument.importNode(G,!0),H.nodeType===Vt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?L=H:L.appendChild(H);else{if(!Ot&&!le&&!Le&&G.indexOf("<")===-1)return w&&Yn?w.createHTML(G):G;if(L=Ui(G),!L)return Ot?null:Yn?x:""}L&&bt&&Fe(L.firstChild);const de=ji(Jt?G:L);for(;ue=de.nextNode();)Vi(ue),qi(ue),ue.content instanceof s&&Ki(ue.content);if(Jt)return G;if(Ot){if(le){L.normalize();let Te=L.innerHTML;Bt([q,I,C],it=>{Te=Tt(Te,it," ")}),L.innerHTML=Te}if(Gn)for(ve=T.call(L.ownerDocument);L.firstChild;)ve.appendChild(L.firstChild);else ve=L;return(Z.shadowroot||Z.shadowrootmode)&&(ve=$.call(r,ve,!0)),ve}let Ee=Le?L.outerHTML:L.innerHTML;return Le&&V["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&xe(ga,L.ownerDocument.doctype.name)&&(Ee="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
85
- `+Ee),le&&Bt([q,I,C],Te=>{Ee=Tt(Ee,Te," ")}),w&&Yn?w.createHTML(Ee):Ee},t.setConfig=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ao(G),gt=!0},t.clearConfig=function(){It=null,gt=!1},t.isValidAttribute=function(G,y,L){It||ao({});const H=pe(G),ue=pe(y);return Gi(H,ue,L)},t.addHook=function(G,y){typeof y=="function"&&Ht(U[G],y)},t.removeHook=function(G,y){if(y!==void 0){const L=rf(U[G],y);return L===-1?void 0:of(U[G],L,1)[0]}return ua(U[G])},t.removeHooks=function(G){U[G]=[]},t.removeAllHooks=function(){U=ya()},t}var Sf=va();const Cf=({editor:e,error:t})=>{const[,n]=R.useState(0);if(R.useEffect(()=>{if(!e)return;const s=()=>n(a=>a+1);return e.on("transaction",s),()=>e.off("transaction",s)},[e]),!e)return null;const r=s=>`p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(),o=()=>c.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return c.jsxs("div",{className:`flex flex-wrap gap-1 p-1.5 border-b bg-muted/30 rounded-t-lg transition-colors ${t?"border-red-500/50":"border-input"}`,role:"toolbar","aria-label":"Text formatting options",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:r(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:c.jsx(lc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:r(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:c.jsx(Sc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:r(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:c.jsx(Pc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:r(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:c.jsx(Tc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>c.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:r(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&c.jsx(yc,{size:16}),s===2&&c.jsx(vc,{size:16}),s===3&&c.jsx(wc,{size:14})]},s))}),c.jsx(o,{}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:r(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:c.jsx(Ec,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:r(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:c.jsx(Cc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:r(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:c.jsx(Nc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:r(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:c.jsx(gc,{size:14})})}),c.jsxs("div",{className:"flex gap-1 ml-auto",children:[c.jsx(o,{}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:r(!1),"aria-label":"Undo",children:c.jsx(_c,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:r(!1),"aria-label":"Redo",children:c.jsx(kc,{size:14})})]})]})};function Ef({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=!!s,i=t[e.name],l=typeof i=="string"?i:e.content||"",[u,d]=R.useState(150),[h,g]=R.useState(!1),p=m=>{m.preventDefault(),g(!0)};R.useEffect(()=>{if(!h)return;const m=S=>{const k=Math.max(150,Math.min(600,u+S.movementY));d(k)},v=()=>{g(!1)};return document.body.style.userSelect="none",document.body.style.cursor="ns-resize",document.addEventListener("mousemove",m),document.addEventListener("mouseup",v),()=>{document.body.style.userSelect="",document.body.style.cursor="",document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v)}},[h,u]);const b=fo.useEditor({extensions:[ec.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),tc.configure({limit:e.maxLength||null})],content:Sf.sanitize(l),editable:!a,onUpdate:({editor:m})=>{const v=m.getHTML(),S=m.getText().trim().length===0;n(e.name,S?"":v)},onBlur:()=>{r(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none overflow-y-auto p-4 text-foreground",style:`min-height: ${u}px; max-height: ${u}px;`,role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":o?"true":"false",id:e.name}}});return R.useEffect(()=>{b&&t[e.name]!==b.getHTML()&&b.commands.setContent(t[e.name]||"")},[t[e.name],b]),R.useEffect(()=>{b&&b.setEditable(!a)},[a,b]),c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:c.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${o?"border-red-500 focus-within:ring-1 focus-within:ring-red-500":"border-input focus-within:border-ring/40 focus-within:shadow-[0_0_0_1px_rgba(var(--ring),0.1)]"} ${a?"opacity-70 bg-muted cursor-not-allowed":"bg-background"}`,children:[!a&&c.jsx(Cf,{editor:b,error:o}),c.jsx(fo.EditorContent,{editor:b}),!a&&c.jsx("div",{className:`flex justify-center items-center py-1 cursor-ns-resize border-t border-b transition-colors ${h?"bg-primary/10 border-primary/50":"hover:bg-muted/50 border-border"}`,onMouseDown:p,role:"separator","aria-orientation":"horizontal","aria-label":"Resize editor",children:c.jsx(bc,{size:16,className:"text-muted-foreground"})}),c.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${o?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:b&&c.jsxs("div",{"aria-live":"polite",children:[b.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})})}function Nf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=s,b=e.options||[],m=e.inline||e.layout==="inline",v=g["aria-describedby"],S=`
84
+ `})}const{entries:ca,setPrototypeOf:la,isFrozen:ef,getPrototypeOf:tf,getOwnPropertyDescriptor:nf}=Object;let{freeze:we,seal:Pe,create:Wt}=Object,{apply:Fr,construct:$r}=typeof Reflect<"u"&&Reflect;we||(we=function(t){return t}),Pe||(Pe=function(t){return t}),Fr||(Fr=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)}),$r||($r=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const Bt=Se(Array.prototype.forEach),rf=Se(Array.prototype.lastIndexOf),ua=Se(Array.prototype.pop),Ht=Se(Array.prototype.push),of=Se(Array.prototype.splice),Tn=Se(String.prototype.toLowerCase),zr=Se(String.prototype.toString),Rr=Se(String.prototype.match),Tt=Se(String.prototype.replace),sf=Se(String.prototype.indexOf),af=Se(String.prototype.trim),De=Se(Object.prototype.hasOwnProperty),xe=Se(RegExp.prototype.test),Ut=cf(TypeError);function Se(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Fr(e,t,r)}}function cf(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $r(e,n)}}function X(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tn;la&&la(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(ef(t)||(t[r]=s),o=s)}e[o]=!0}return e}function lf(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Be(e){const t=Wt(null);for(const[n,r]of ca(e))De(e,n)&&(Array.isArray(r)?t[n]=lf(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Be(r):t[n]=r);return t}function jt(e,t){for(;e!==null;){const r=nf(e,t);if(r){if(r.get)return Se(r.get);if(typeof r.value=="function")return Se(r.value)}e=tf(e)}function n(){return null}return n}const da=we(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wr=we(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Br=we(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),uf=we(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hr=we(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),df=we(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fa=we(["#text"]),pa=we(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ur=we(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ma=we(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pn=we(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ff=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pf=Pe(/<%[\w\W]*|[\w\W]*%>/gm),mf=Pe(/\$\{[\w\W]*/gm),hf=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),gf=Pe(/^aria-[\-\w]+$/),ha=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bf=Pe(/^(?:\w+script|data):/i),yf=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ga=Pe(/^html$/i),vf=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var ba=Object.freeze({__proto__:null,ARIA_ATTR:gf,ATTR_WHITESPACE:yf,CUSTOM_ELEMENT:vf,DATA_ATTR:hf,DOCTYPE_NAME:ga,ERB_EXPR:pf,IS_ALLOWED_URI:ha,IS_SCRIPT_OR_DATA:bf,MUSTACHE_EXPR:ff,TMPLIT_EXPR:mf});const Vt={element:1,text:3,progressingInstruction:7,comment:8,document:9},wf=function(){return typeof window>"u"?null:window},xf=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},ya=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function va(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wf();const t=Y=>va(Y);if(t.version="3.4.0",t.removed=[],!e||!e.document||e.document.nodeType!==Vt.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:i,Element:l,NodeFilter:u,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:m,DOMParser:g,trustedTypes:h}=e,y=l.prototype,f=jt(y,"cloneNode"),b=jt(y,"remove"),S=jt(y,"nextSibling"),k=jt(y,"childNodes"),E=jt(y,"parentNode");if(typeof a=="function"){const Y=n.createElement("template");Y.content&&Y.content.ownerDocument&&(n=Y.content.ownerDocument)}let w,T="";const{implementation:L,createNodeIterator:A,createDocumentFragment:x,getElementsByTagName:$}=n,{importNode:W}=r;let R=ya();t.isSupported=typeof ca=="function"&&typeof E=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:D,TMPLIT_EXPR:C,DATA_ATTR:P,ARIA_ATTR:_,IS_SCRIPT_OR_DATA:F,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:O}=ba;let{IS_ALLOWED_URI:M}=ba,G=null;const se=X({},[...da,...Wr,...Br,...Hr,...fa]);let Z=null;const ge=X({},[...pa,...Ur,...ma,...Pn]);let q=Object.seal(Wt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,V=null;const ee=Object.seal(Wt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,te=!0,ne=!1,ae=!0,le=!1,he=!0,Le=!1,gt=!1,bt=!1,Ot=!1,Gn=!1,Yn=!1,Li=!0,Fi=!1;const Fh="user-content-";let to=!0,Jt=!1,Mt={},He=null;const no=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $i=null;const zi=X({},["audio","video","img","source","image","track"]);let ro=null;const Ri=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let Dt=Ue,oo=!1,so=null;const $h=X({},[qn,Kn,Ue],zr);let Xn=X({},["mi","mo","mn","ms","mtext"]),Qn=X({},["annotation-xml"]);const zh=X({},["title","style","font","a","script"]);let en=null;const Rh=["application/xhtml+xml","text/html"],Wh="text/html";let pe=null,It=null;const Bh=n.createElement("form"),Wi=function(v){return v instanceof RegExp||v instanceof Function},ao=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(It&&It===v)){if((!v||typeof v!="object")&&(v={}),v=Be(v),en=Rh.indexOf(v.PARSER_MEDIA_TYPE)===-1?Wh:v.PARSER_MEDIA_TYPE,pe=en==="application/xhtml+xml"?zr:Tn,G=De(v,"ALLOWED_TAGS")?X({},v.ALLOWED_TAGS,pe):se,Z=De(v,"ALLOWED_ATTR")?X({},v.ALLOWED_ATTR,pe):ge,so=De(v,"ALLOWED_NAMESPACES")?X({},v.ALLOWED_NAMESPACES,zr):$h,ro=De(v,"ADD_URI_SAFE_ATTR")?X(Be(Ri),v.ADD_URI_SAFE_ATTR,pe):Ri,$i=De(v,"ADD_DATA_URI_TAGS")?X(Be(zi),v.ADD_DATA_URI_TAGS,pe):zi,He=De(v,"FORBID_CONTENTS")?X({},v.FORBID_CONTENTS,pe):no,oe=De(v,"FORBID_TAGS")?X({},v.FORBID_TAGS,pe):Be({}),V=De(v,"FORBID_ATTR")?X({},v.FORBID_ATTR,pe):Be({}),Mt=De(v,"USE_PROFILES")?v.USE_PROFILES:!1,Q=v.ALLOW_ARIA_ATTR!==!1,te=v.ALLOW_DATA_ATTR!==!1,ne=v.ALLOW_UNKNOWN_PROTOCOLS||!1,ae=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=v.SAFE_FOR_TEMPLATES||!1,he=v.SAFE_FOR_XML!==!1,Le=v.WHOLE_DOCUMENT||!1,Ot=v.RETURN_DOM||!1,Gn=v.RETURN_DOM_FRAGMENT||!1,Yn=v.RETURN_TRUSTED_TYPE||!1,bt=v.FORCE_BODY||!1,Li=v.SANITIZE_DOM!==!1,Fi=v.SANITIZE_NAMED_PROPS||!1,to=v.KEEP_CONTENT!==!1,Jt=v.IN_PLACE||!1,M=v.ALLOWED_URI_REGEXP||ha,Dt=v.NAMESPACE||Ue,Xn=v.MATHML_TEXT_INTEGRATION_POINTS||Xn,Qn=v.HTML_INTEGRATION_POINTS||Qn,q=v.CUSTOM_ELEMENT_HANDLING||Wt(null),v.CUSTOM_ELEMENT_HANDLING&&Wi(v.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=v.CUSTOM_ELEMENT_HANDLING.tagNameCheck),v.CUSTOM_ELEMENT_HANDLING&&Wi(v.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=v.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),v.CUSTOM_ELEMENT_HANDLING&&typeof v.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(q.allowCustomizedBuiltInElements=v.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),le&&(te=!1),Gn&&(Ot=!0),Mt&&(G=X({},fa),Z=Wt(null),Mt.html===!0&&(X(G,da),X(Z,pa)),Mt.svg===!0&&(X(G,Wr),X(Z,Ur),X(Z,Pn)),Mt.svgFilters===!0&&(X(G,Br),X(Z,Ur),X(Z,Pn)),Mt.mathMl===!0&&(X(G,Hr),X(Z,ma),X(Z,Pn))),ee.tagCheck=null,ee.attributeCheck=null,v.ADD_TAGS&&(typeof v.ADD_TAGS=="function"?ee.tagCheck=v.ADD_TAGS:(G===se&&(G=Be(G)),X(G,v.ADD_TAGS,pe))),v.ADD_ATTR&&(typeof v.ADD_ATTR=="function"?ee.attributeCheck=v.ADD_ATTR:(Z===ge&&(Z=Be(Z)),X(Z,v.ADD_ATTR,pe))),v.ADD_URI_SAFE_ATTR&&X(ro,v.ADD_URI_SAFE_ATTR,pe),v.FORBID_CONTENTS&&(He===no&&(He=Be(He)),X(He,v.FORBID_CONTENTS,pe)),v.ADD_FORBID_CONTENTS&&(He===no&&(He=Be(He)),X(He,v.ADD_FORBID_CONTENTS,pe)),to&&(G["#text"]=!0),Le&&X(G,["html","head","body"]),G.table&&(X(G,["tbody"]),delete oe.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=v.TRUSTED_TYPES_POLICY,T=w.createHTML("")}else w===void 0&&(w=xf(h,o)),w!==null&&typeof T=="string"&&(T=w.createHTML(""));we&&we(v),It=v}},Bi=X({},[...Wr,...Br,...uf]),Hi=X({},[...Hr,...df]),Hh=function(v){let I=E(v);(!I||!I.tagName)&&(I={namespaceURI:Dt,tagName:"template"});const U=Tn(v.tagName),ue=Tn(I.tagName);return so[v.namespaceURI]?v.namespaceURI===Kn?I.namespaceURI===Ue?U==="svg":I.namespaceURI===qn?U==="svg"&&(ue==="annotation-xml"||Xn[ue]):!!Bi[U]:v.namespaceURI===qn?I.namespaceURI===Ue?U==="math":I.namespaceURI===Kn?U==="math"&&Qn[ue]:!!Hi[U]:v.namespaceURI===Ue?I.namespaceURI===Kn&&!Qn[ue]||I.namespaceURI===qn&&!Xn[ue]?!1:!Hi[U]&&(zh[U]||!Bi[U]):!!(en==="application/xhtml+xml"&&so[v.namespaceURI]):!1},Fe=function(v){Ht(t.removed,{element:v});try{E(v).removeChild(v)}catch{b(v)}},yt=function(v,I){try{Ht(t.removed,{attribute:I.getAttributeNode(v),from:I})}catch{Ht(t.removed,{attribute:null,from:I})}if(I.removeAttribute(v),v==="is")if(Ot||Gn)try{Fe(I)}catch{}else try{I.setAttribute(v,"")}catch{}},Ui=function(v){let I=null,U=null;if(bt)v="<remove></remove>"+v;else{const de=Rr(v,/^[\r\n\t ]+/);U=de&&de[0]}en==="application/xhtml+xml"&&Dt===Ue&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const ue=w?w.createHTML(v):v;if(Dt===Ue)try{I=new g().parseFromString(ue,en)}catch{}if(!I||!I.documentElement){I=L.createDocument(Dt,"template",null);try{I.documentElement.innerHTML=oo?T:ue}catch{}}const ve=I.body||I.documentElement;return v&&U&&ve.insertBefore(n.createTextNode(U),ve.childNodes[0]||null),Dt===Ue?$.call(I,Le?"html":"body")[0]:Le?I.documentElement:ve},ji=function(v){return A.call(v.ownerDocument||v,v,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},io=function(v){return v instanceof m&&(typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||!(v.attributes instanceof d)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function")},co=function(v){return typeof i=="function"&&v instanceof i};function qe(Y,v,I){Bt(Y,U=>{U.call(t,v,I,It)})}const Vi=function(v){let I=null;if(qe(R.beforeSanitizeElements,v,null),io(v))return Fe(v),!0;const U=pe(v.nodeName);if(qe(R.uponSanitizeElement,v,{tagName:U,allowedTags:G}),he&&v.hasChildNodes()&&!co(v.firstElementChild)&&xe(/<[/\w!]/g,v.innerHTML)&&xe(/<[/\w!]/g,v.textContent)||he&&v.namespaceURI===Ue&&U==="style"&&co(v.firstElementChild)||v.nodeType===Vt.progressingInstruction||he&&v.nodeType===Vt.comment&&xe(/<[/\w]/g,v.data))return Fe(v),!0;if(oe[U]||!(ee.tagCheck instanceof Function&&ee.tagCheck(U))&&!G[U]){if(!oe[U]&&Yi(U)&&(q.tagNameCheck instanceof RegExp&&xe(q.tagNameCheck,U)||q.tagNameCheck instanceof Function&&q.tagNameCheck(U)))return!1;if(to&&!He[U]){const ue=E(v)||v.parentNode,ve=k(v)||v.childNodes;if(ve&&ue){const de=ve.length;for(let Ee=de-1;Ee>=0;--Ee){const Te=f(ve[Ee],!0);Te.__removalCount=(v.__removalCount||0)+1,ue.insertBefore(Te,S(v))}}}return Fe(v),!0}return v instanceof l&&!Hh(v)||(U==="noscript"||U==="noembed"||U==="noframes")&&xe(/<\/no(script|embed|frames)/i,v.innerHTML)?(Fe(v),!0):(le&&v.nodeType===Vt.text&&(I=v.textContent,Bt([j,D,C],ue=>{I=Tt(I,ue," ")}),v.textContent!==I&&(Ht(t.removed,{element:v.cloneNode()}),v.textContent=I)),qe(R.afterSanitizeElements,v,null),!1)},Gi=function(v,I,U){if(V[I]||Li&&(I==="id"||I==="name")&&(U in n||U in Bh))return!1;if(!(te&&!V[I]&&xe(P,I))){if(!(Q&&xe(_,I))){if(!(ee.attributeCheck instanceof Function&&ee.attributeCheck(I,v))){if(!Z[I]||V[I]){if(!(Yi(v)&&(q.tagNameCheck instanceof RegExp&&xe(q.tagNameCheck,v)||q.tagNameCheck instanceof Function&&q.tagNameCheck(v))&&(q.attributeNameCheck instanceof RegExp&&xe(q.attributeNameCheck,I)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(I,v))||I==="is"&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&xe(q.tagNameCheck,U)||q.tagNameCheck instanceof Function&&q.tagNameCheck(U))))return!1}else if(!ro[I]){if(!xe(M,Tt(U,N,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&v!=="script"&&sf(U,"data:")===0&&$i[v])){if(!(ne&&!xe(F,Tt(U,N,"")))){if(U)return!1}}}}}}}return!0},Yi=function(v){return v!=="annotation-xml"&&Rr(v,O)},qi=function(v){qe(R.beforeSanitizeAttributes,v,null);const{attributes:I}=v;if(!I||io(v))return;const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let ue=I.length;for(;ue--;){const ve=I[ue],{name:de,namespaceURI:Ee,value:Te}=ve,it=pe(de),lo=Te;let be=de==="value"?lo:af(lo);if(U.attrName=it,U.attrValue=be,U.keepAttr=!0,U.forceKeepAttr=void 0,qe(R.uponSanitizeAttribute,v,U),be=U.attrValue,Fi&&(it==="id"||it==="name")&&(yt(de,v),be=Fh+be),he&&xe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,be)){yt(de,v);continue}if(it==="attributename"&&Rr(be,"href")){yt(de,v);continue}if(U.forceKeepAttr)continue;if(!U.keepAttr){yt(de,v);continue}if(!ae&&xe(/\/>/i,be)){yt(de,v);continue}le&&Bt([j,D,C],Qi=>{be=Tt(be,Qi," ")});const Xi=pe(v.nodeName);if(!Gi(Xi,it,be)){yt(de,v);continue}if(w&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Ee)switch(h.getAttributeType(Xi,it)){case"TrustedHTML":{be=w.createHTML(be);break}case"TrustedScriptURL":{be=w.createScriptURL(be);break}}if(be!==lo)try{Ee?v.setAttributeNS(Ee,de,be):v.setAttribute(de,be),io(v)?Fe(v):ua(t.removed)}catch{yt(de,v)}}qe(R.afterSanitizeAttributes,v,null)},Ki=function(v){let I=null;const U=ji(v);for(qe(R.beforeSanitizeShadowDOM,v,null);I=U.nextNode();)qe(R.uponSanitizeShadowNode,I,null),Vi(I),qi(I),I.content instanceof s&&Ki(I.content);qe(R.afterSanitizeShadowDOM,v,null)};return t.sanitize=function(Y){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,U=null,ue=null,ve=null;if(oo=!Y,oo&&(Y="<!-->"),typeof Y!="string"&&!co(Y))if(typeof Y.toString=="function"){if(Y=Y.toString(),typeof Y!="string")throw Ut("dirty is not a string, aborting")}else throw Ut("toString is not a function");if(!t.isSupported)return Y;if(gt||ao(v),t.removed=[],typeof Y=="string"&&(Jt=!1),Jt){if(Y.nodeName){const Te=pe(Y.nodeName);if(!G[Te]||oe[Te])throw Ut("root node is forbidden and cannot be sanitized in-place")}}else if(Y instanceof i)I=Ui("<!---->"),U=I.ownerDocument.importNode(Y,!0),U.nodeType===Vt.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?I=U:I.appendChild(U);else{if(!Ot&&!le&&!Le&&Y.indexOf("<")===-1)return w&&Yn?w.createHTML(Y):Y;if(I=Ui(Y),!I)return Ot?null:Yn?T:""}I&&bt&&Fe(I.firstChild);const de=ji(Jt?Y:I);for(;ue=de.nextNode();)Vi(ue),qi(ue),ue.content instanceof s&&Ki(ue.content);if(Jt)return Y;if(Ot){if(le){I.normalize();let Te=I.innerHTML;Bt([j,D,C],it=>{Te=Tt(Te,it," ")}),I.innerHTML=Te}if(Gn)for(ve=x.call(I.ownerDocument);I.firstChild;)ve.appendChild(I.firstChild);else ve=I;return(Z.shadowroot||Z.shadowrootmode)&&(ve=W.call(r,ve,!0)),ve}let Ee=Le?I.outerHTML:I.innerHTML;return Le&&G["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&xe(ga,I.ownerDocument.doctype.name)&&(Ee="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
85
+ `+Ee),le&&Bt([j,D,C],Te=>{Ee=Tt(Ee,Te," ")}),w&&Yn?w.createHTML(Ee):Ee},t.setConfig=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ao(Y),gt=!0},t.clearConfig=function(){It=null,gt=!1},t.isValidAttribute=function(Y,v,I){It||ao({});const U=pe(Y),ue=pe(v);return Gi(U,ue,I)},t.addHook=function(Y,v){typeof v=="function"&&Ht(R[Y],v)},t.removeHook=function(Y,v){if(v!==void 0){const I=rf(R[Y],v);return I===-1?void 0:of(R[Y],I,1)[0]}return ua(R[Y])},t.removeHooks=function(Y){R[Y]=[]},t.removeAllHooks=function(){R=ya()},t}var Sf=va();const Cf=({editor:e,error:t})=>{const[,n]=z.useState(0);if(z.useEffect(()=>{if(!e)return;const s=()=>n(a=>a+1);return e.on("transaction",s),()=>e.off("transaction",s)},[e]),!e)return null;const r=s=>`p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(),o=()=>c.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return c.jsxs("div",{className:`flex flex-wrap gap-1 p-1.5 border-b bg-muted/30 rounded-t-lg transition-colors ${t?"border-red-500/50":"border-input"}`,role:"toolbar","aria-label":"Text formatting options",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:r(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:c.jsx(lc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:r(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:c.jsx(Sc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:r(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:c.jsx(Pc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:r(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:c.jsx(Tc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>c.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:r(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&c.jsx(yc,{size:16}),s===2&&c.jsx(vc,{size:16}),s===3&&c.jsx(wc,{size:14})]},s))}),c.jsx(o,{}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:r(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:c.jsx(Ec,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:r(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:c.jsx(Cc,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:r(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:c.jsx(Nc,{size:14})})]}),c.jsx(o,{}),c.jsx("div",{className:"flex gap-1",children:c.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:r(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:c.jsx(gc,{size:14})})}),c.jsxs("div",{className:"flex gap-1 ml-auto",children:[c.jsx(o,{}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:r(!1),"aria-label":"Undo",children:c.jsx(_c,{size:14})}),c.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:r(!1),"aria-label":"Redo",children:c.jsx(kc,{size:14})})]})]})};function Ef({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=!!s,i=t[e.name],l=typeof i=="string"?i:e.content||"",[u,d]=z.useState(150),[m,g]=z.useState(!1),h=f=>{f.preventDefault(),g(!0)};z.useEffect(()=>{if(!m)return;const f=S=>{const k=Math.max(150,Math.min(600,u+S.movementY));d(k)},b=()=>{g(!1)};return document.body.style.userSelect="none",document.body.style.cursor="ns-resize",document.addEventListener("mousemove",f),document.addEventListener("mouseup",b),()=>{document.body.style.userSelect="",document.body.style.cursor="",document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",b)}},[m,u]);const y=fo.useEditor({extensions:[ec.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),tc.configure({limit:e.maxLength||null})],content:Sf.sanitize(l),editable:!a,onUpdate:({editor:f})=>{const b=f.getHTML(),S=f.getText().trim().length===0;n(e.name,S?"":b)},onBlur:()=>{r(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none overflow-y-auto p-4 text-foreground",style:`min-height: ${u}px; max-height: ${u}px;`,role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":o?"true":"false",id:e.name}}});return z.useEffect(()=>{y&&t[e.name]!==y.getHTML()&&y.commands.setContent(t[e.name]||"")},[t[e.name],y]),z.useEffect(()=>{y&&y.setEditable(!a)},[a,y]),c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:c.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${o?"border-red-500 focus-within:ring-1 focus-within:ring-red-500":"border-input focus-within:border-ring/40 focus-within:shadow-[0_0_0_1px_rgba(var(--ring),0.1)]"} ${a?"opacity-70 bg-muted cursor-not-allowed":"bg-background"}`,children:[!a&&c.jsx(Cf,{editor:y,error:o}),c.jsx(fo.EditorContent,{editor:y}),!a&&c.jsx("div",{className:`flex justify-center items-center py-1 cursor-ns-resize border-t border-b transition-colors ${m?"bg-primary/10 border-primary/50":"hover:bg-muted/50 border-border"}`,onMouseDown:h,role:"separator","aria-orientation":"horizontal","aria-label":"Resize editor",children:c.jsx(bc,{size:16,className:"text-muted-foreground"})}),c.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${o?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:y&&c.jsxs("div",{"aria-live":"polite",children:[y.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})})}function Nf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:m,...g}=a,h=s,y=e.options||[],f=e.inline||e.layout==="inline",b=g["aria-describedby"],S=`
86
86
  size-4 rounded border-input bg-background transition-all accent-primary
87
87
  focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
88
88
  disabled:cursor-not-allowed disabled:opacity-50
89
- `;if(b.length>0){const k=Array.isArray(t[e.name])?t[e.name]:[],N=(w,x)=>{let A=x?[...k,w]:k.filter(O=>O!==w);n(e.name,A),r(e.name)};return c.jsxs("fieldset",{className:"mt-2","aria-invalid":!!o,"aria-describedby":o?v:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx("div",{className:m?"flex flex-wrap gap-x-6 gap-y-3":"space-y-4",children:b.map(w=>{const x=typeof w=="object"?w.value:w,A=typeof w=="object"?w.label:w,O=typeof w=="object"?w.description:null,T=`${e.name}-${x}`,z=k.includes(x);return c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,type:"checkbox",id:T,checked:z,onChange:$=>N(x,$.target.checked),onBlur:()=>r(e.name),disabled:p,className:`${S} ${!p&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive ring-destructive/20":"border-input"}`})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:T,className:`font-medium select-none transition-colors ${p?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:A}),O&&!m&&c.jsx("p",{className:`text-xs ${p?"text-muted-foreground/60":"text-muted-foreground"}`,children:O})]})]},x)})})]})}return c.jsxs("div",{className:"mt-1 flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,id:e.name,type:"checkbox",checked:!!t[e.name],onChange:k=>{n(e.name,k.target.checked),r(e.name)},onBlur:()=>r(e.name),disabled:p,className:`${S} ${!p&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive":"border-input"}`})}),c.jsx("div",{className:"ml-3 text-sm leading-6",children:c.jsxs("label",{htmlFor:e.name,className:`font-medium select-none transition-colors ${p?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:[e.label,e.required&&c.jsx("span",{className:"text-destructive ml-1","aria-hidden":"true",children:"*"})]})})]})}const wa=6048e5,kf=864e5,xa=Symbol.for("constructDateFrom");function tt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&xa in e?e[xa](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ie(e,t){return tt(t||e,e)}let Af={};function _n(){return Af}function Gt(e,t){const n=_n(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ie(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function On(e,t){return Gt(e,{...t,weekStartsOn:1})}function Sa(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=tt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=On(o),a=tt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=On(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Ca(e){const t=Ie(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 Tf(e,...t){const n=tt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ea(e,t){const n=Ie(e,t?.in);return n.setHours(0,0,0,0),n}function Pf(e,t,n){const[r,o]=Tf(n?.in,e,t),s=Ea(r),a=Ea(o),i=+s-Ca(s),l=+a-Ca(a);return Math.round((i-l)/kf)}function _f(e,t){const n=Sa(e,t),r=tt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),On(r)}function Of(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Yt(e){return!(!Of(e)&&typeof e!="number"||isNaN(+Ie(e)))}function Mf(e,t){const n=Ie(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Df={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"}},If=(e,t,n)=>{let r;const o=Df[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function jr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Lf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ff={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$f={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zf={date:jr({formats:Lf,defaultWidth:"full"}),time:jr({formats:Ff,defaultWidth:"full"}),dateTime:jr({formats:$f,defaultWidth:"full"})},Rf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wf=(e,t,n,r)=>Rf[e];function qt(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Bf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Uf={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"]},jf={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"]},Vf={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"}},Gf={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"}},Yf={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:qt({values:Bf,defaultWidth:"wide"}),quarter:qt({values:Hf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:qt({values:Uf,defaultWidth:"wide"}),day:qt({values:jf,defaultWidth:"wide"}),dayPeriod:qt({values:Vf,defaultWidth:"wide",formattingValues:Gf,defaultFormattingWidth:"wide"})};function Kt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?Kf(i,h=>h.test(a)):qf(i,h=>h.test(a));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function qf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kf(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xf(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const Qf=/^(\d+)(th|st|nd|rd)?/i,Zf=/\d+/i,Jf={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]},tp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},np={any:[/1/i,/2/i,/3/i,/4/i]},rp={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]},sp={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},ap={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]},ip={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},cp={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}},lp={ordinalNumber:Xf({matchPattern:Qf,parsePattern:Zf,valueCallback:e=>parseInt(e,10)}),era:Kt({matchPatterns:Jf,defaultMatchWidth:"wide",parsePatterns:ep,defaultParseWidth:"any"}),quarter:Kt({matchPatterns:tp,defaultMatchWidth:"wide",parsePatterns:np,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kt({matchPatterns:rp,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),day:Kt({matchPatterns:sp,defaultMatchWidth:"wide",parsePatterns:ap,defaultParseWidth:"any"}),dayPeriod:Kt({matchPatterns:ip,defaultMatchWidth:"any",parsePatterns:cp,defaultParseWidth:"any"})},up={code:"en-US",formatDistance:If,formatLong:zf,formatRelative:Wf,localize:Yf,match:lp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dp(e,t){const n=Ie(e,t?.in);return Pf(n,Mf(n))+1}function fp(e,t){const n=Ie(e,t?.in),r=+On(n)-+_f(n);return Math.round(r/wa)+1}function Na(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=_n(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=tt(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const i=Gt(a,t),l=tt(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Gt(l,t);return+n>=+i?r+1:+n>=+u?r:r-1}function pp(e,t){const n=_n(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Na(e,t),s=tt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Gt(s,t)}function mp(e,t){const n=Ie(e,t?.in),r=+Gt(n,t)-+pp(n,t);return Math.round(r/wa)+1}function re(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const nt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return re(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):re(n+1,2)},d(e,t){return re(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];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return re(e.getHours()%12||12,t.length)},H(e,t){return re(e.getHours(),t.length)},m(e,t){return re(e.getMinutes(),t.length)},s(e,t){return re(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return re(o,t.length)}},Pt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ka={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"});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 nt.y(e,t)},Y:function(e,t,n,r){const o=Na(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return re(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):re(s,t.length)},R:function(e,t){const n=Sa(e);return re(n,t.length)},u:function(e,t){const n=e.getFullYear();return re(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 re(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"});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 re(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"});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 nt.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"});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 re(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=mp(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):re(o,t.length)},I:function(e,t,n){const r=fp(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):re(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):nt.d(e,t)},D:function(e,t,n){const r=dp(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):re(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return re(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return re(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});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 re(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"});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"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Pt.noon:r===0?o=Pt.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Pt.evening:r>=12?o=Pt.afternoon:r>=4?o=Pt.morning:o=Pt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});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 nt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):nt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nt.s(e,t)},S:function(e,t){return nt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ta(r);case"XXXX":case"XX":return pt(r);default:return pt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ta(r);case"xxxx":case"xx":return pt(r);default:return pt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Aa(r,":");default:return"GMT"+pt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Aa(r,":");default:return"GMT"+pt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return re(r,t.length)},T:function(e,t,n){return re(+e,t.length)}};function Aa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+re(s,2)}function Ta(e,t){return e%60===0?(e>0?"-":"+")+re(Math.abs(e)/60,2):pt(e,t)}function pt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=re(Math.trunc(r/60),2),s=re(r%60,2);return n+o+t+s}const Pa=(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"});default:return t.date({width:"full"})}},_a=(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"});default:return t.time({width:"full"})}},hp={p:_a,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Pa(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Pa(r,t)).replace("{{time}}",_a(o,t))}},gp=/^D+$/,bp=/^Y+$/,yp=["D","DD","YY","YYYY"];function vp(e){return gp.test(e)}function wp(e){return bp.test(e)}function xp(e,t,n){const r=Sp(e,t,n);if(console.warn(r),yp.includes(e))throw new RangeError(r)}function Sp(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 Cp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ep=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Np=/^'([^]*?)'?$/,kp=/''/g,Ap=/[a-zA-Z]/;function Mn(e,t,n){const r=_n(),o=r.locale??up,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Ie(e,n?.in);if(!Yt(i))throw new RangeError("Invalid time value");let l=t.match(Ep).map(d=>{const h=d[0];if(h==="p"||h==="P"){const g=hp[h];return g(d,o.formatLong)}return d}).join("").match(Cp).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:Tp(d)};if(ka[h])return{isToken:!0,value:d};if(h.match(Ap))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(wp(h)||vp(h))&&xp(h,t,String(e));const g=ka[h[0]];return g(i,h,o.localize,u)}).join("")}function Tp(e){const t=e.match(Np);return t?t[1].replace(kp,"'"):e}function Pp(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Dn=e=>{const{present:t,children:n}=e,r=_p(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=ce(r.ref,Op(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Dn.displayName="Presence";function _p(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),a=e?"mounted":"unmounted",[i,l]=Pp(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=In(r.current);s.current=i==="mounted"?u:"none"},[i]),ye(()=>{const u=r.current,d=o.current;if(d!==e){const g=s.current,p=In(u);e?l("MOUNT"):p==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ye(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=p=>{const m=In(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},g=p=>{p.target===t&&(s.current=In(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function In(e){return e?.animationName||"none"}function Op(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oa=Mp.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ln="Popover",[Ma]=ct(Ln,[gn]),Xt=gn(),[Dp,rt]=Ma(Ln),Da=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Xt(t),l=f.useRef(null),[u,d]=f.useState(!1),[h,g]=zt({prop:r,defaultProp:o??!1,onChange:s,caller:Ln});return c.jsx(ps,{...i,children:c.jsx(Dp,{scope:t,contentId:Lt(),triggerRef:l,open:h,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:u,onCustomAnchorAdd:f.useCallback(()=>d(!0),[]),onCustomAnchorRemove:f.useCallback(()=>d(!1),[]),modal:a,children:n})})};Da.displayName=Ln;var Ia="PopoverAnchor",Ip=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Ia,n),s=Xt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return f.useEffect(()=>(a(),()=>i()),[a,i]),c.jsx(Sr,{...s,...r,ref:t})});Ip.displayName=Ia;var La="PopoverTrigger",Fa=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(La,n),s=Xt(n),a=ce(t,o.triggerRef),i=c.jsx(Oa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ba(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Sr,{asChild:!0,...s,children:i})});Fa.displayName=La;var Vr="PopoverPortal",[Lp,Fp]=Ma(Vr,{forceMount:void 0}),$a=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=rt(Vr,t);return c.jsx(Lp,{scope:t,forceMount:n,children:c.jsx(Dn,{present:n||s.open,children:c.jsx(Cr,{asChild:!0,container:o,children:r})})})};$a.displayName=Vr;var _t="PopoverContent",za=f.forwardRef((e,t)=>{const n=Fp(_t,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=rt(_t,e.__scopePopover);return c.jsx(Dn,{present:r||s.open,children:s.modal?c.jsx(zp,{...o,ref:t}):c.jsx(Rp,{...o,ref:t})})});za.displayName=_t;var $p=Ce("PopoverContent.RemoveScroll"),zp=f.forwardRef((e,t)=>{const n=rt(_t,e.__scopePopover),r=f.useRef(null),o=ce(t,r),s=f.useRef(!1);return f.useEffect(()=>{const a=r.current;if(a)return vs(a)},[]),c.jsx(Pr,{as:$p,allowPinchZoom:!0,children:c.jsx(Ra,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,u=i.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rp=f.forwardRef((e,t)=>{const n=rt(_t,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return c.jsx(Ra,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ra=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=e,g=rt(_t,n),p=Xt(n);return ko(),c.jsx(ir,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:c.jsx(ms,{"data-state":Ba(g.open),role:"dialog",id:g.contentId,...p,...h,ref:t,style:{...h.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)"}})})})}),Wa="PopoverClose",Wp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Wa,n);return c.jsx(Oa.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});Wp.displayName=Wa;var Bp="PopoverArrow",Hp=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(n);return c.jsx(hs,{...o,...r,ref:t})});Hp.displayName=Bp;function Ba(e){return e?"open":"closed"}var Up=Da,jp=Fa,Vp=$a,Gp=za;function Ha(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=Ha(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ha(e))&&(r&&(r+=" "),r+=t);return r}const qp=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Kp=(e,t)=>({classGroupId:e,validator:t}),Ua=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fn="-",ja=[],Xp="arbitrary..",Qp=e=>{const t=Jp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Zp(a);const i=a.split(Fn),l=i[0]===""&&i.length>1?1:0;return Va(i,l,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const l=r[a],u=n[a];return l?u?qp(u,l):l:u||ja}return n[a]||ja}}},Va=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=Va(e,t+1,s);if(u)return u}const a=n.validators;if(a===null)return;const i=t===0?e.join(Fn):e.slice(t).join(Fn),l=a.length;for(let u=0;u<l;u++){const d=a[u];if(d.validator(i))return d.classGroupId}},Zp=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Xp+r:void 0})(),Jp=e=>{const{theme:t,classGroups:n}=e;return em(n,t)},em=(e,t)=>{const n=Ua();for(const r in e){const o=e[r];Gr(o,n,r,t)}return n},Gr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];tm(a,t,n,r)}},tm=(e,t,n,r)=>{if(typeof e=="string"){nm(e,t,n);return}if(typeof e=="function"){rm(e,t,n,r);return}om(e,t,n,r)},nm=(e,t,n)=>{const r=e===""?t:Ga(t,e);r.classGroupId=n},rm=(e,t,n,r)=>{if(sm(e)){Gr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Kp(n,e))},om=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,l]=o[a];Gr(l,Ga(t,i),n,r)}},Ga=(e,t)=>{let n=e;const r=t.split(Fn),o=r.length;for(let s=0;s<o;s++){const a=r[s];let i=n.nextPart.get(a);i||(i=Ua(),n.nextPart.set(a,i)),n=i}return n},sm=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,am=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},Yr="!",Ya=":",im=[],qa=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),cm=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,l=0,u;const d=o.length;for(let m=0;m<d;m++){const v=o[m];if(a===0&&i===0){if(v===Ya){s.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){u=m;continue}}v==="["?a++:v==="]"?a--:v==="("?i++:v===")"&&i--}const h=s.length===0?o:o.slice(l);let g=h,p=!1;h.endsWith(Yr)?(g=h.slice(0,-1),p=!0):h.startsWith(Yr)&&(g=h.slice(1),p=!0);const b=u&&u>l?u-l:void 0;return qa(s,p,g,b)};if(t){const o=t+Ya,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):qa(im,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},lm=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",l=t.has(a);i||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},um=e=>({cache:am(e.cacheSize),parseClassName:cm(e),sortModifiers:lm(e),...Qp(e)}),dm=/\s+/,fm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(dm);let l="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{isExternal:h,modifiers:g,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:m}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let v=!!m,S=r(v?b.substring(0,m):b);if(!S){if(!v){l=d+(l.length>0?" "+l:l);continue}if(S=r(b),!S){l=d+(l.length>0?" "+l:l);continue}v=!1}const k=g.length===0?"":g.length===1?g[0]:s(g).join(":"),N=p?k+Yr:k,w=N+S;if(a.indexOf(w)>-1)continue;a.push(w);const x=o(S,v);for(let A=0;A<x.length;++A){const O=x[A];a.push(N+O)}l=d+(l.length>0?" "+l:l)}return l},pm=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Ka(n))&&(o&&(o+=" "),o+=r);return o},Ka=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ka(e[r]))&&(n&&(n+=" "),n+=t);return n},mm=(e,...t)=>{let n,r,o,s;const a=l=>{const u=t.reduce((d,h)=>h(d),e());return n=um(u),r=n.cache.get,o=n.cache.set,s=i,i(l)},i=l=>{const u=r(l);if(u)return u;const d=fm(l,n);return o(l,d),d};return s=a,(...l)=>s(pm(...l))},hm=[],fe=e=>{const t=n=>n[e]||hm;return t.isThemeGetter=!0,t},Xa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ym=/\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$/,vm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>gm.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),st=e=>!!e&&Number.isInteger(Number(e)),qr=e=>e.endsWith("%")&&K(e.slice(0,-1)),Ye=e=>bm.test(e),Za=()=>!0,Sm=e=>ym.test(e)&&!vm.test(e),Kr=()=>!1,Cm=e=>wm.test(e),Em=e=>xm.test(e),Nm=e=>!W(e)&&!B(e),km=e=>at(e,oi,Kr),W=e=>Xa.test(e),mt=e=>at(e,si,Sm),Ja=e=>at(e,Im,K),Am=e=>at(e,ii,Za),Tm=e=>at(e,ai,Kr),ei=e=>at(e,ni,Kr),Pm=e=>at(e,ri,Em),$n=e=>at(e,ci,Cm),B=e=>Qa.test(e),Qt=e=>ht(e,si),_m=e=>ht(e,ai),ti=e=>ht(e,ni),Om=e=>ht(e,oi),Mm=e=>ht(e,ri),zn=e=>ht(e,ci,!0),Dm=e=>ht(e,ii,!0),at=(e,t,n)=>{const r=Xa.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ht=(e,t,n=!1)=>{const r=Qa.exec(e);return r?r[1]?t(r[1]):n:!1},ni=e=>e==="position"||e==="percentage",ri=e=>e==="image"||e==="url",oi=e=>e==="length"||e==="size"||e==="bg-size",si=e=>e==="length",Im=e=>e==="number",ai=e=>e==="family-name",ii=e=>e==="number"||e==="weight",ci=e=>e==="shadow",Lm=mm(()=>{const e=fe("color"),t=fe("font"),n=fe("text"),r=fe("font-weight"),o=fe("tracking"),s=fe("leading"),a=fe("breakpoint"),i=fe("container"),l=fe("spacing"),u=fe("radius"),d=fe("shadow"),h=fe("inset-shadow"),g=fe("text-shadow"),p=fe("drop-shadow"),b=fe("blur"),m=fe("perspective"),v=fe("aspect"),S=fe("ease"),k=fe("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),B,W],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],T=()=>[B,W,l],z=()=>[ot,"full","auto",...T()],$=()=>[st,"none","subgrid",B,W],U=()=>["auto",{span:["full",st,B,W]},st,B,W],q=()=>[st,"auto",B,W],I=()=>["auto","min","max","fr",B,W],C=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...T()],F=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],E=()=>[ot,"screen","full","dvw","lvw","svw","min","max","fit",...T()],M=()=>[ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],D=()=>[e,B,W],V=()=>[...w(),ti,ei,{position:[B,W]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Om,km,{size:[B,W]}],ge=()=>[qr,Qt,mt],Y=()=>["","none","full",u,B,W],oe=()=>["",K,Qt,mt],j=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[K,qr,ti,ei],te=()=>["","none",b,B,W],ne=()=>["none",K,B,W],ae=()=>["none",K,B,W],le=()=>[K,B,W],he=()=>[ot,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Za],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[Nm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",K],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,W,B,v]}],container:["container"],columns:[{columns:[K,W,B,i]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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"],sr:["sr-only","not-sr-only"],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:x()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[st,"auto",B,W]}],basis:[{basis:[ot,"full","auto",i,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[K,ot,"auto","initial","none",W]}],grow:[{grow:["",K,B,W]}],shrink:[{shrink:["",K,B,W]}],order:[{order:[st,"first","last","none",B,W]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...C(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...C()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":C()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...E()]}],"min-inline-size":[{"min-inline":["auto",...E()]}],"max-inline-size":[{"max-inline":["none",...E()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[i,"screen",...F()]}],"min-w":[{"min-w":[i,"screen","none",...F()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,Qt,mt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Dm,Am]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qr,W]}],"font-family":[{font:[_m,Tm,t]}],"font-features":[{"font-features":[W]}],"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:[o,B,W]}],"line-clamp":[{"line-clamp":[K,"none",B,Ja]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",B,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",B,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:[K,"from-font","auto",B,mt]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[K,"auto",B,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},st,B,W],radial:["",B,W],conic:[st,B,W]},Mm,Pm]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...j(),"hidden","none"]}],"divide-style":[{divide:[...j(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...j(),"none","hidden"]}],"outline-offset":[{"outline-offset":[K,B,W]}],"outline-w":[{outline:["",K,Qt,mt]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,zn,$n]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",h,zn,$n]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[K,mt]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",g,zn,$n]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[K,B,W]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[B,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",B,W]}],filter:[{filter:["","none",B,W]}],blur:[{blur:te()}],brightness:[{brightness:[K,B,W]}],contrast:[{contrast:[K,B,W]}],"drop-shadow":[{"drop-shadow":["","none",p,zn,$n]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",K,B,W]}],"hue-rotate":[{"hue-rotate":[K,B,W]}],invert:[{invert:["",K,B,W]}],saturate:[{saturate:[K,B,W]}],sepia:[{sepia:["",K,B,W]}],"backdrop-filter":[{"backdrop-filter":["","none",B,W]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[K,B,W]}],"backdrop-contrast":[{"backdrop-contrast":[K,B,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",K,B,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,B,W]}],"backdrop-invert":[{"backdrop-invert":["",K,B,W]}],"backdrop-opacity":[{"backdrop-opacity":[K,B,W]}],"backdrop-saturate":[{"backdrop-saturate":[K,B,W]}],"backdrop-sepia":[{"backdrop-sepia":["",K,B,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",B,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[K,"initial",B,W]}],ease:[{ease:["linear","initial",S,B,W]}],delay:[{delay:[K,B,W]}],animate:[{animate:["none",k,B,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,B,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[B,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",B,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",B,W]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[K,Qt,mt,Ja]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Rn(...e){return Lm(Yp(e))}function Wn({...e}){return c.jsx(Up,{"data-slot":"popover",...e})}function Bn({...e}){return c.jsx(jp,{"data-slot":"popover-trigger",...e})}function Hn({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(Vp,{children:c.jsx(Gp,{"data-slot":"popover-content",align:t,sideOffset:n,className:Rn("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Fm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const[a,i]=R.useState(!1),l=p=>{if(!p)return;if(p instanceof Date)return Yt(p)?p:void 0;if(typeof p=="string"){const m=p.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(m){const[,k,N,w]=m,x=new Date(Number(k),Number(N)-1,Number(w));return Yt(x)?x:void 0}const v=p.includes("T")?p:p.replace(" ","T"),S=new Date(v);return Yt(S)?S:void 0}const b=new Date(p);return Yt(b)?b:void 0},u=t[e.name],d=R.useMemo(()=>{const p={from:void 0,to:void 0};if(!u)return p;if(Array.isArray(u)){const b=u[0]?.startDate||u[0],m=u[0]?.endDate||u[1];return{from:l(b),to:l(m)}}return{from:l(u.from),to:l(u.to)}},[u]),h=p=>{p.preventDefault(),p.stopPropagation(),n(e.name,{from:void 0,to:void 0}),r(e.name)},g=[];if(e.maxDate){const p=l(e.maxDate);p&&g.push({after:p})}if(e.minDate){const p=l(e.minDate);p&&g.push({before:p})}return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:s?!1:a,onOpenChange:p=>{s||i(p)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":a,"aria-haspopup":"dialog","aria-controls":`${e.name}-popover`,tabIndex:s?-1:0,onClick:()=>!s&&i(!0),onKeyDown:p=>{s||(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i(!0))},className:`
89
+ `;if(y.length>0){const k=Array.isArray(t[e.name])?t[e.name]:[],E=(w,T)=>{let L=T?[...k,w]:k.filter(A=>A!==w);n(e.name,L),r(e.name)};return c.jsxs("fieldset",{className:"mt-2","aria-invalid":!!o,"aria-describedby":o?b:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx("div",{className:f?"flex flex-wrap gap-x-6 gap-y-3":"space-y-4",children:y.map(w=>{const T=typeof w=="object"?w.value:w,L=typeof w=="object"?w.label:w,A=typeof w=="object"?w.description:null,x=`${e.name}-${T}`,$=k.includes(T);return c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,type:"checkbox",id:x,checked:$,onChange:W=>E(T,W.target.checked),onBlur:()=>r(e.name),disabled:h,className:`${S} ${!h&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive ring-destructive/20":"border-input"}`})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:x,className:`font-medium select-none transition-colors ${h?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:L}),A&&!f&&c.jsx("p",{className:`text-xs ${h?"text-muted-foreground/60":"text-muted-foreground"}`,children:A})]})]},T)})})]})}return c.jsxs("div",{className:"mt-1 flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx("input",{...e.props,...g,id:e.name,type:"checkbox",checked:!!t[e.name],onChange:k=>{n(e.name,k.target.checked),r(e.name)},onBlur:()=>r(e.name),disabled:h,className:`${S} ${!h&&"cursor-pointer hover:border-primary/50"} ${o?"border-destructive":"border-input"}`})}),c.jsx("div",{className:"ml-3 text-sm leading-6",children:c.jsxs("label",{htmlFor:e.name,className:`font-medium select-none transition-colors ${h?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:[e.label,e.required&&c.jsx("span",{className:"text-destructive ml-1","aria-hidden":"true",children:"*"})]})})]})}const wa=6048e5,kf=864e5,xa=Symbol.for("constructDateFrom");function tt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&xa in e?e[xa](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ie(e,t){return tt(t||e,e)}let Af={};function _n(){return Af}function Gt(e,t){const n=_n(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ie(e,t?.in),s=o.getDay(),a=(s<r?7:0)+s-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function On(e,t){return Gt(e,{...t,weekStartsOn:1})}function Sa(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=tt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=On(o),a=tt(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const i=On(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Ca(e){const t=Ie(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 Tf(e,...t){const n=tt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Ea(e,t){const n=Ie(e,t?.in);return n.setHours(0,0,0,0),n}function Pf(e,t,n){const[r,o]=Tf(n?.in,e,t),s=Ea(r),a=Ea(o),i=+s-Ca(s),l=+a-Ca(a);return Math.round((i-l)/kf)}function _f(e,t){const n=Sa(e,t),r=tt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),On(r)}function Of(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Yt(e){return!(!Of(e)&&typeof e!="number"||isNaN(+Ie(e)))}function Mf(e,t){const n=Ie(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Df={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"}},If=(e,t,n)=>{let r;const o=Df[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function jr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Lf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ff={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$f={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zf={date:jr({formats:Lf,defaultWidth:"full"}),time:jr({formats:Ff,defaultWidth:"full"}),dateTime:jr({formats:$f,defaultWidth:"full"})},Rf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wf=(e,t,n,r)=>Rf[e];function qt(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):a;o=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Bf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Uf={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"]},jf={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"]},Vf={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"}},Gf={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"}},Yf={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:qt({values:Bf,defaultWidth:"wide"}),quarter:qt({values:Hf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:qt({values:Uf,defaultWidth:"wide"}),day:qt({values:jf,defaultWidth:"wide"}),dayPeriod:qt({values:Vf,defaultWidth:"wide",formattingValues:Gf,defaultFormattingWidth:"wide"})};function Kt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const a=s[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(i)?Kf(i,m=>m.test(a)):qf(i,m=>m.test(a));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function qf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Kf(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xf(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const i=t.slice(o.length);return{value:a,rest:i}}}const Qf=/^(\d+)(th|st|nd|rd)?/i,Zf=/\d+/i,Jf={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]},tp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},np={any:[/1/i,/2/i,/3/i,/4/i]},rp={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]},sp={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},ap={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]},ip={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},cp={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}},lp={ordinalNumber:Xf({matchPattern:Qf,parsePattern:Zf,valueCallback:e=>parseInt(e,10)}),era:Kt({matchPatterns:Jf,defaultMatchWidth:"wide",parsePatterns:ep,defaultParseWidth:"any"}),quarter:Kt({matchPatterns:tp,defaultMatchWidth:"wide",parsePatterns:np,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kt({matchPatterns:rp,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),day:Kt({matchPatterns:sp,defaultMatchWidth:"wide",parsePatterns:ap,defaultParseWidth:"any"}),dayPeriod:Kt({matchPatterns:ip,defaultMatchWidth:"any",parsePatterns:cp,defaultParseWidth:"any"})},up={code:"en-US",formatDistance:If,formatLong:zf,formatRelative:Wf,localize:Yf,match:lp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dp(e,t){const n=Ie(e,t?.in);return Pf(n,Mf(n))+1}function fp(e,t){const n=Ie(e,t?.in),r=+On(n)-+_f(n);return Math.round(r/wa)+1}function Na(e,t){const n=Ie(e,t?.in),r=n.getFullYear(),o=_n(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=tt(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const i=Gt(a,t),l=tt(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Gt(l,t);return+n>=+i?r+1:+n>=+u?r:r-1}function pp(e,t){const n=_n(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Na(e,t),s=tt(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Gt(s,t)}function mp(e,t){const n=Ie(e,t?.in),r=+Gt(n,t)-+pp(n,t);return Math.round(r/wa)+1}function re(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const nt={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return re(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):re(n+1,2)},d(e,t){return re(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];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return re(e.getHours()%12||12,t.length)},H(e,t){return re(e.getHours(),t.length)},m(e,t){return re(e.getMinutes(),t.length)},s(e,t){return re(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return re(o,t.length)}},Pt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ka={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"});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 nt.y(e,t)},Y:function(e,t,n,r){const o=Na(e,r),s=o>0?o:1-o;if(t==="YY"){const a=s%100;return re(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):re(s,t.length)},R:function(e,t){const n=Sa(e);return re(n,t.length)},u:function(e,t){const n=e.getFullYear();return re(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 re(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"});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 re(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"});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 nt.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"});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 re(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=mp(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):re(o,t.length)},I:function(e,t,n){const r=fp(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):re(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):nt.d(e,t)},D:function(e,t,n){const r=dp(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):re(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return re(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return re(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});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 re(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"});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"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Pt.noon:r===0?o=Pt.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Pt.evening:r>=12?o=Pt.afternoon:r>=4?o=Pt.morning:o=Pt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});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 nt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):nt.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nt.s(e,t)},S:function(e,t){return nt.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ta(r);case"XXXX":case"XX":return pt(r);default:return pt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ta(r);case"xxxx":case"xx":return pt(r);default:return pt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Aa(r,":");default:return"GMT"+pt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Aa(r,":");default:return"GMT"+pt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return re(r,t.length)},T:function(e,t,n){return re(+e,t.length)}};function Aa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+re(s,2)}function Ta(e,t){return e%60===0?(e>0?"-":"+")+re(Math.abs(e)/60,2):pt(e,t)}function pt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=re(Math.trunc(r/60),2),s=re(r%60,2);return n+o+t+s}const Pa=(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"});default:return t.date({width:"full"})}},_a=(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"});default:return t.time({width:"full"})}},hp={p:_a,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Pa(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Pa(r,t)).replace("{{time}}",_a(o,t))}},gp=/^D+$/,bp=/^Y+$/,yp=["D","DD","YY","YYYY"];function vp(e){return gp.test(e)}function wp(e){return bp.test(e)}function xp(e,t,n){const r=Sp(e,t,n);if(console.warn(r),yp.includes(e))throw new RangeError(r)}function Sp(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 Cp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ep=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Np=/^'([^]*?)'?$/,kp=/''/g,Ap=/[a-zA-Z]/;function Mn(e,t,n){const r=_n(),o=r.locale??up,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Ie(e,n?.in);if(!Yt(i))throw new RangeError("Invalid time value");let l=t.match(Ep).map(d=>{const m=d[0];if(m==="p"||m==="P"){const g=hp[m];return g(d,o.formatLong)}return d}).join("").match(Cp).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const m=d[0];if(m==="'")return{isToken:!1,value:Tp(d)};if(ka[m])return{isToken:!0,value:d};if(m.match(Ap))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:d}});o.localize.preprocessor&&(l=o.localize.preprocessor(i,l));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:o};return l.map(d=>{if(!d.isToken)return d.value;const m=d.value;(wp(m)||vp(m))&&xp(m,t,String(e));const g=ka[m[0]];return g(i,m,o.localize,u)}).join("")}function Tp(e){const t=e.match(Np);return t?t[1].replace(kp,"'"):e}function Pp(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Dn=e=>{const{present:t,children:n}=e,r=_p(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=ce(r.ref,Op(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};Dn.displayName="Presence";function _p(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),a=e?"mounted":"unmounted",[i,l]=Pp(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=In(r.current);s.current=i==="mounted"?u:"none"},[i]),ye(()=>{const u=r.current,d=o.current;if(d!==e){const g=s.current,h=In(u);e?l("MOUNT"):h==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&g!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ye(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,m=h=>{const f=In(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&f&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=h=>{h.target===t&&(s.current=In(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function In(e){return e?.animationName||"none"}function Op(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oa=Mp.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ln="Popover",[Ma]=ct(Ln,[gn]),Xt=gn(),[Dp,rt]=Ma(Ln),Da=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Xt(t),l=p.useRef(null),[u,d]=p.useState(!1),[m,g]=zt({prop:r,defaultProp:o??!1,onChange:s,caller:Ln});return c.jsx(ps,{...i,children:c.jsx(Dp,{scope:t,contentId:Lt(),triggerRef:l,open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(h=>!h),[g]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:n})})};Da.displayName=Ln;var Ia="PopoverAnchor",Ip=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Ia,n),s=Xt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return p.useEffect(()=>(a(),()=>i()),[a,i]),c.jsx(Sr,{...s,...r,ref:t})});Ip.displayName=Ia;var La="PopoverTrigger",Fa=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(La,n),s=Xt(n),a=ce(t,o.triggerRef),i=c.jsx(Oa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ba(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(Sr,{asChild:!0,...s,children:i})});Fa.displayName=La;var Vr="PopoverPortal",[Lp,Fp]=Ma(Vr,{forceMount:void 0}),$a=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=rt(Vr,t);return c.jsx(Lp,{scope:t,forceMount:n,children:c.jsx(Dn,{present:n||s.open,children:c.jsx(Cr,{asChild:!0,container:o,children:r})})})};$a.displayName=Vr;var _t="PopoverContent",za=p.forwardRef((e,t)=>{const n=Fp(_t,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=rt(_t,e.__scopePopover);return c.jsx(Dn,{present:r||s.open,children:s.modal?c.jsx(zp,{...o,ref:t}):c.jsx(Rp,{...o,ref:t})})});za.displayName=_t;var $p=Ce("PopoverContent.RemoveScroll"),zp=p.forwardRef((e,t)=>{const n=rt(_t,e.__scopePopover),r=p.useRef(null),o=ce(t,r),s=p.useRef(!1);return p.useEffect(()=>{const a=r.current;if(a)return vs(a)},[]),c.jsx(Pr,{as:$p,allowPinchZoom:!0,children:c.jsx(Ra,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,u=i.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rp=p.forwardRef((e,t)=>{const n=rt(_t,e.__scopePopover),r=p.useRef(!1),o=p.useRef(!1);return c.jsx(Ra,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ra=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...m}=e,g=rt(_t,n),h=Xt(n);return ko(),c.jsx(ir,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(rr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:c.jsx(ms,{"data-state":Ba(g.open),role:"dialog",id:g.contentId,...h,...m,ref:t,style:{...m.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)"}})})})}),Wa="PopoverClose",Wp=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=rt(Wa,n);return c.jsx(Oa.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});Wp.displayName=Wa;var Bp="PopoverArrow",Hp=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Xt(n);return c.jsx(hs,{...o,...r,ref:t})});Hp.displayName=Bp;function Ba(e){return e?"open":"closed"}var Up=Da,jp=Fa,Vp=$a,Gp=za;function Ha(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=Ha(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ha(e))&&(r&&(r+=" "),r+=t);return r}const qp=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Kp=(e,t)=>({classGroupId:e,validator:t}),Ua=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fn="-",ja=[],Xp="arbitrary..",Qp=e=>{const t=Jp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Zp(a);const i=a.split(Fn),l=i[0]===""&&i.length>1?1:0;return Va(i,l,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const l=r[a],u=n[a];return l?u?qp(u,l):l:u||ja}return n[a]||ja}}},Va=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=Va(e,t+1,s);if(u)return u}const a=n.validators;if(a===null)return;const i=t===0?e.join(Fn):e.slice(t).join(Fn),l=a.length;for(let u=0;u<l;u++){const d=a[u];if(d.validator(i))return d.classGroupId}},Zp=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Xp+r:void 0})(),Jp=e=>{const{theme:t,classGroups:n}=e;return em(n,t)},em=(e,t)=>{const n=Ua();for(const r in e){const o=e[r];Gr(o,n,r,t)}return n},Gr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];tm(a,t,n,r)}},tm=(e,t,n,r)=>{if(typeof e=="string"){nm(e,t,n);return}if(typeof e=="function"){rm(e,t,n,r);return}om(e,t,n,r)},nm=(e,t,n)=>{const r=e===""?t:Ga(t,e);r.classGroupId=n},rm=(e,t,n,r)=>{if(sm(e)){Gr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Kp(n,e))},om=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,l]=o[a];Gr(l,Ga(t,i),n,r)}},Ga=(e,t)=>{let n=e;const r=t.split(Fn),o=r.length;for(let s=0;s<o;s++){const a=r[s];let i=n.nextPart.get(a);i||(i=Ua(),n.nextPart.set(a,i)),n=i}return n},sm=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,am=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return o(s,a),a},set(s,a){s in n?n[s]=a:o(s,a)}}},Yr="!",Ya=":",im=[],qa=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),cm=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,l=0,u;const d=o.length;for(let f=0;f<d;f++){const b=o[f];if(a===0&&i===0){if(b===Ya){s.push(o.slice(l,f)),l=f+1;continue}if(b==="/"){u=f;continue}}b==="["?a++:b==="]"?a--:b==="("?i++:b===")"&&i--}const m=s.length===0?o:o.slice(l);let g=m,h=!1;m.endsWith(Yr)?(g=m.slice(0,-1),h=!0):m.startsWith(Yr)&&(g=m.slice(1),h=!0);const y=u&&u>l?u-l:void 0;return qa(s,h,g,y)};if(t){const o=t+Ya,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):qa(im,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},lm=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",l=t.has(a);i||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},um=e=>({cache:am(e.cacheSize),parseClassName:cm(e),sortModifiers:lm(e),...Qp(e)}),dm=/\s+/,fm=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(dm);let l="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{isExternal:m,modifiers:g,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:f}=n(d);if(m){l=d+(l.length>0?" "+l:l);continue}let b=!!f,S=r(b?y.substring(0,f):y);if(!S){if(!b){l=d+(l.length>0?" "+l:l);continue}if(S=r(y),!S){l=d+(l.length>0?" "+l:l);continue}b=!1}const k=g.length===0?"":g.length===1?g[0]:s(g).join(":"),E=h?k+Yr:k,w=E+S;if(a.indexOf(w)>-1)continue;a.push(w);const T=o(S,b);for(let L=0;L<T.length;++L){const A=T[L];a.push(E+A)}l=d+(l.length>0?" "+l:l)}return l},pm=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Ka(n))&&(o&&(o+=" "),o+=r);return o},Ka=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ka(e[r]))&&(n&&(n+=" "),n+=t);return n},mm=(e,...t)=>{let n,r,o,s;const a=l=>{const u=t.reduce((d,m)=>m(d),e());return n=um(u),r=n.cache.get,o=n.cache.set,s=i,i(l)},i=l=>{const u=r(l);if(u)return u;const d=fm(l,n);return o(l,d),d};return s=a,(...l)=>s(pm(...l))},hm=[],fe=e=>{const t=n=>n[e]||hm;return t.isThemeGetter=!0,t},Xa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ym=/\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$/,vm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ot=e=>gm.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),st=e=>!!e&&Number.isInteger(Number(e)),qr=e=>e.endsWith("%")&&K(e.slice(0,-1)),Ye=e=>bm.test(e),Za=()=>!0,Sm=e=>ym.test(e)&&!vm.test(e),Kr=()=>!1,Cm=e=>wm.test(e),Em=e=>xm.test(e),Nm=e=>!B(e)&&!H(e),km=e=>at(e,oi,Kr),B=e=>Xa.test(e),mt=e=>at(e,si,Sm),Ja=e=>at(e,Im,K),Am=e=>at(e,ii,Za),Tm=e=>at(e,ai,Kr),ei=e=>at(e,ni,Kr),Pm=e=>at(e,ri,Em),$n=e=>at(e,ci,Cm),H=e=>Qa.test(e),Qt=e=>ht(e,si),_m=e=>ht(e,ai),ti=e=>ht(e,ni),Om=e=>ht(e,oi),Mm=e=>ht(e,ri),zn=e=>ht(e,ci,!0),Dm=e=>ht(e,ii,!0),at=(e,t,n)=>{const r=Xa.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ht=(e,t,n=!1)=>{const r=Qa.exec(e);return r?r[1]?t(r[1]):n:!1},ni=e=>e==="position"||e==="percentage",ri=e=>e==="image"||e==="url",oi=e=>e==="length"||e==="size"||e==="bg-size",si=e=>e==="length",Im=e=>e==="number",ai=e=>e==="family-name",ii=e=>e==="number"||e==="weight",ci=e=>e==="shadow",Lm=mm(()=>{const e=fe("color"),t=fe("font"),n=fe("text"),r=fe("font-weight"),o=fe("tracking"),s=fe("leading"),a=fe("breakpoint"),i=fe("container"),l=fe("spacing"),u=fe("radius"),d=fe("shadow"),m=fe("inset-shadow"),g=fe("text-shadow"),h=fe("drop-shadow"),y=fe("blur"),f=fe("perspective"),b=fe("aspect"),S=fe("ease"),k=fe("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...w(),H,B],L=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],x=()=>[H,B,l],$=()=>[ot,"full","auto",...x()],W=()=>[st,"none","subgrid",H,B],R=()=>["auto",{span:["full",st,H,B]},st,H,B],j=()=>[st,"auto",H,B],D=()=>["auto","min","max","fr",H,B],C=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...x()],F=()=>[ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],N=()=>[ot,"screen","full","dvw","lvw","svw","min","max","fit",...x()],O=()=>[ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],M=()=>[e,H,B],G=()=>[...w(),ti,ei,{position:[H,B]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Om,km,{size:[H,B]}],ge=()=>[qr,Qt,mt],q=()=>["","none","full",u,H,B],oe=()=>["",K,Qt,mt],V=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[K,qr,ti,ei],te=()=>["","none",y,H,B],ne=()=>["none",K,H,B],ae=()=>["none",K,H,B],le=()=>[K,H,B],he=()=>[ot,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Za],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[Nm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",K],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ot,B,H,b]}],container:["container"],columns:[{columns:[K,B,H,i]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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"],sr:["sr-only","not-sr-only"],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:T()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[st,"auto",H,B]}],basis:[{basis:[ot,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[K,ot,"auto","initial","none",B]}],grow:[{grow:["",K,H,B]}],shrink:[{shrink:["",K,H,B]}],order:[{order:[st,"first","last","none",H,B]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...C(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...C()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":C()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],w:[{w:[i,"screen",...F()]}],"min-w":[{"min-w":[i,"screen","none",...F()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,Qt,mt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Dm,Am]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qr,B]}],"font-family":[{font:[_m,Tm,t]}],"font-features":[{"font-features":[B]}],"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:[o,H,B]}],"line-clamp":[{"line-clamp":[K,"none",H,Ja]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",H,B]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",H,B]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:[K,"from-font","auto",H,mt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[K,"auto",H,B]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",H,B]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",H,B]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},st,H,B],radial:["",H,B],conic:[st,H,B]},Mm,Pm]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...V(),"hidden","none"]}],"divide-style":[{divide:[...V(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...V(),"none","hidden"]}],"outline-offset":[{"outline-offset":[K,H,B]}],"outline-w":[{outline:["",K,Qt,mt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,zn,$n]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",m,zn,$n]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[K,mt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,zn,$n]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[K,H,B]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[K]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[H,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[K]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",H,B]}],filter:[{filter:["","none",H,B]}],blur:[{blur:te()}],brightness:[{brightness:[K,H,B]}],contrast:[{contrast:[K,H,B]}],"drop-shadow":[{"drop-shadow":["","none",h,zn,$n]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",K,H,B]}],"hue-rotate":[{"hue-rotate":[K,H,B]}],invert:[{invert:["",K,H,B]}],saturate:[{saturate:[K,H,B]}],sepia:[{sepia:["",K,H,B]}],"backdrop-filter":[{"backdrop-filter":["","none",H,B]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[K,H,B]}],"backdrop-contrast":[{"backdrop-contrast":[K,H,B]}],"backdrop-grayscale":[{"backdrop-grayscale":["",K,H,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,H,B]}],"backdrop-invert":[{"backdrop-invert":["",K,H,B]}],"backdrop-opacity":[{"backdrop-opacity":[K,H,B]}],"backdrop-saturate":[{"backdrop-saturate":[K,H,B]}],"backdrop-sepia":[{"backdrop-sepia":["",K,H,B]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",H,B]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[K,"initial",H,B]}],ease:[{ease:["linear","initial",S,H,B]}],delay:[{delay:[K,H,B]}],animate:[{animate:["none",k,H,B]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,H,B]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[H,B,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",H,B]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",H,B]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[K,Qt,mt,Ja]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Rn(...e){return Lm(Yp(e))}function Wn({...e}){return c.jsx(Up,{"data-slot":"popover",...e})}function Bn({...e}){return c.jsx(jp,{"data-slot":"popover-trigger",...e})}function Hn({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(Vp,{children:c.jsx(Gp,{"data-slot":"popover-content",align:t,sideOffset:n,className:Rn("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Fm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const[a,i]=z.useState(!1),l=f=>{if(!f)return;if(f instanceof Date)return Yt(f)?f:void 0;if(typeof f=="string"){const S=f.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(S){const[,w,T,L]=S,A=new Date(Number(w),Number(T)-1,Number(L));return Yt(A)?A:void 0}const k=f.includes("T")?f:f.replace(" ","T"),E=new Date(k);return Yt(E)?E:void 0}const b=new Date(f);return Yt(b)?b:void 0},u=t[e.name],d=z.useMemo(()=>{const f={from:void 0,to:void 0};if(!u)return f;if(Array.isArray(u)){const b=u[0]?.startDate||u[0],S=u[0]?.endDate||u[1];return{from:l(b),to:l(S)}}return{from:l(u.from),to:l(u.to)}},[u]),m=f=>{f.preventDefault(),f.stopPropagation(),n(e.name,{from:void 0,to:void 0}),r(e.name)},g=typeof e.maxDate=="function"?e.maxDate(t):e.maxDate,h=typeof e.minDate=="function"?e.minDate(t):e.minDate,y=[];if(g){const f=l(g);f&&y.push({after:f})}if(h){const f=l(h);f&&y.push({before:f})}return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:s?!1:a,onOpenChange:f=>{s||i(f)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":a,"aria-haspopup":"dialog","aria-controls":`${e.name}-popover`,tabIndex:s?-1:0,onClick:()=>!s&&i(!0),onKeyDown:f=>{s||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i(!0))},className:`
90
90
  flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm
91
91
  transition-all outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
92
92
  ${s?"bg-muted text-muted-foreground cursor-not-allowed opacity-50":"bg-background text-foreground hover:border-primary/50 cursor-pointer"}
93
93
  ${o?"border-destructive focus-visible:ring-destructive":"border-input"}
94
- `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(go,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),c.jsx("div",{className:"truncate",children:d?.from?c.jsxs("span",{children:[Mn(d.from,"PP"),d.to?` - ${Mn(d.to,"PP")}`:""]}):c.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select range"})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[d?.from&&!s&&c.jsx("button",{type:"button","aria-label":"Clear selection",onClick:h,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform ${a?"rotate-180":""}`})]})]})}),c.jsxs(Hn,{align:"start",className:"w-auto p-0",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"range",selected:d,onSelect:p=>n(e.name,p||{from:void 0,to:void 0}),showOutsideDays:!0,disabled:g,classNames:{day_range_start:"bg-primary text-primary-foreground rounded-l-md",day_range_end:"bg-primary text-primary-foreground rounded-r-md",day_range_middle:"bg-primary/20 text-foreground !rounded-none",day_selected:"bg-primary text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors"}})}),c.jsx("div",{className:"flex items-center justify-end gap-2 border-t p-3 bg-muted/20",children:c.jsx("button",{type:"button",onClick:()=>i(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90",children:"Done"})})]})]})})}function li({field:e,formValues:t,error:n,fileUploads:r,fileInputRefs:o,handleChange:s,onFieldsChange:a,api_URL:i,disabled:l}){const u=l,d=e.type==="multifile",h=r?.[e.name]||{},g=t[e.name],p=d?g||[]:[g].filter(Boolean),[b,m]=R.useState(!1),v=i?`${i}uploads`:null;!v&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const S=I=>{if(I===0)return"0 Bytes";const C=1024,P=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(I)/Math.log(C));return`${parseFloat((I/C**_).toFixed(2))} ${P[_]}`},k=async I=>{const C=new FormData;C.append("file",I);const P=await fetch(`${v}`,{method:"POST",body:C});if(!P.ok)throw tn.toast.error("Upload failed"),new Error("Upload failed");return await P.json()},N=async(I,C)=>{if(!C)return;if(I.maxSize&&C.size>I.maxSize)throw new Error(`File size must not exceed ${S(I.maxSize)}`);const P=await k(C),_={...t,[I.name]:P};s(I.name,P),a(_)},w=async(I,C)=>{const P=t[I.name]||[];if(I.maxFiles&&P.length+C.length>I.maxFiles)throw new Error(`Maximum ${I.maxFiles} files allowed`);C.forEach(E=>{if(I.maxSize&&E.size>I.maxSize)throw new Error(`Each file must not exceed ${S(I.maxSize)}`)});const _=await Promise.all(C.map(E=>k(E))),F=[...P,..._];s(I.name,F),a({...t,[I.name]:F})},x=async(I,C)=>{if(u)return;const P=Array.from(C);try{e.type==="multifile"?await w(e,P):await N(e,P[0]),o.current?.[I]&&(o.current[I].value="")}catch(_){tn.toast.error(`Upload failed: ${_.message}`)}},A=async(I,C)=>{if(u)return;let P;e.type==="file"?P="":P=(t[I]||[]).filter(F=>F!==C),s(I,P),a({...t,[I]:P}),o.current?.[I]&&(o.current[I].value="")},O=I=>{I.preventDefault(),u||m(!0)},T=I=>{I.preventDefault(),u||m(!1)},z=I=>{I.preventDefault(),m(!1),!u&&I.dataTransfer.files&&I.dataTransfer.files.length>0&&x(e.name,I.dataTransfer.files)},$=e.accept?e.accept.split(",").map(I=>I.split("/")[1]||I.split(".")[1]||I).join(", ").toUpperCase():"PNG, JPG, PDF",U=e.maxSize?`, up to ${S(e.maxSize)}`:"",q=`
94
+ `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(go,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),c.jsx("div",{className:"truncate",children:d?.from?c.jsxs("span",{children:[Mn(d.from,"PP"),d.to?` - ${Mn(d.to,"PP")}`:""]}):c.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select range"})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[d?.from&&!s&&c.jsx("button",{type:"button","aria-label":"Clear selection",onClick:m,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform ${a?"rotate-180":""}`})]})]})}),c.jsxs(Hn,{align:"start",className:"w-auto p-0",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"range",selected:d,onSelect:f=>n(e.name,f||{from:void 0,to:void 0}),showOutsideDays:!0,disabled:y,classNames:{day_range_start:"bg-primary text-primary-foreground rounded-l-md",day_range_end:"bg-primary text-primary-foreground rounded-r-md",day_range_middle:"bg-primary/20 text-foreground !rounded-none",day_selected:"bg-primary text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors"}})}),c.jsx("div",{className:"flex items-center justify-end gap-2 border-t p-3 bg-muted/20",children:c.jsx("button",{type:"button",onClick:()=>i(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90",children:"Done"})})]})]})})}function li({field:e,formValues:t,error:n,fileUploads:r,fileInputRefs:o,handleChange:s,onFieldsChange:a,api_URL:i,disabled:l}){const u=l,d=e.type==="multifile",m=r?.[e.name]||{},g=t[e.name],h=d?g||[]:[g].filter(Boolean),[y,f]=z.useState(!1),b=i?`${i}uploads`:null;!b&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const S=D=>{if(D===0)return"0 Bytes";const C=1024,P=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(D)/Math.log(C));return`${parseFloat((D/C**_).toFixed(2))} ${P[_]}`},k=async D=>{const C=new FormData;C.append("file",D);const P=await fetch(`${b}`,{method:"POST",body:C});if(!P.ok)throw tn.toast.error("Upload failed"),new Error("Upload failed");return await P.json()},E=async(D,C)=>{if(!C)return;if(D.maxSize&&C.size>D.maxSize)throw new Error(`File size must not exceed ${S(D.maxSize)}`);const P=await k(C),_={...t,[D.name]:P};s(D.name,P),a(_)},w=async(D,C)=>{const P=t[D.name]||[];if(D.maxFiles&&P.length+C.length>D.maxFiles)throw new Error(`Maximum ${D.maxFiles} files allowed`);C.forEach(N=>{if(D.maxSize&&N.size>D.maxSize)throw new Error(`Each file must not exceed ${S(D.maxSize)}`)});const _=await Promise.all(C.map(N=>k(N))),F=[...P,..._];s(D.name,F),a({...t,[D.name]:F})},T=async(D,C)=>{if(u)return;const P=Array.from(C);try{e.type==="multifile"?await w(e,P):await E(e,P[0]),o.current?.[D]&&(o.current[D].value="")}catch(_){tn.toast.error(`Upload failed: ${_.message}`)}},L=async(D,C)=>{if(u)return;let P;e.type==="file"?P="":P=(t[D]||[]).filter(F=>F!==C),s(D,P),a({...t,[D]:P}),o.current?.[D]&&(o.current[D].value="")},A=D=>{D.preventDefault(),u||f(!0)},x=D=>{D.preventDefault(),u||f(!1)},$=D=>{D.preventDefault(),f(!1),!u&&D.dataTransfer.files&&D.dataTransfer.files.length>0&&T(e.name,D.dataTransfer.files)},W=e.accept?e.accept.split(",").map(D=>D.split("/")[1]||D.split(".")[1]||D).join(", ").toUpperCase():"PNG, JPG, PDF",R=e.maxSize?`, up to ${S(e.maxSize)}`:"",j=`
95
95
  w-full flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg transition-all duration-200
96
96
  // Ensure focus styling is handled correctly for the button element
97
97
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50
98
- ${u?"bg-gray-50 border-gray-300 text-gray-400 cursor-not-allowed opacity-70":b?"bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 hover:border-blue-400 hover:bg-gray-50 cursor-pointer"}
99
- `;return c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("button",{type:"button",className:q,onClick:()=>{u||o?.current?.[e.name]?.click()},onDragOver:O,onDragEnter:O,onDragLeave:T,onDrop:z,disabled:u,children:[c.jsx("div",{className:"border-gray-400 border p-1 mb-3 rounded-md bg-gray-100 shadow-md ",children:c.jsx(hc,{size:24,className:"m-1"})}),c.jsxs("p",{className:"text-sm font-normal",children:[c.jsxs("span",{className:u?"text-gray-400":"text-blue-600 hover:text-blue-700 underline",children:["Upload ",d?"Files":"a file"]}),c.jsx("span",{className:"font-light",children:" or drag and drop"})]}),c.jsxs("p",{className:"text-xs mt-1 text-gray-500",children:[$,U,d&&e.maxFiles&&`, Max ${e.maxFiles} files`]})]}),c.jsx("input",{ref:I=>{I&&o&&o.current&&(o.current[e.name]=I)},id:e.name,type:"file",accept:e.accept,multiple:d,className:"sr-only",onChange:I=>x(e.name,I.target.files),disabled:u}),p.length>0&&c.jsx("div",{className:"space-y-2 pt-2 border-t border-gray-200",children:p.map((I,C)=>{const P=I.original_name||I.name||"File",_=I.size||null;return c.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[c.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[c.jsx("span",{className:"text-sm truncate",children:P}),_&&c.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:["(",S(_),")"]})]}),c.jsx("button",{type:"button",onClick:()=>A(e.name,I),className:`text-red-500 hover:text-red-700 ml-3 flex-shrink-0 ${u?"cursor-not-allowed opacity-50":""}`,disabled:u,children:"Remove"})]},I.url||I.original_name||C)})}),Object.entries(h).map(([I,C])=>C.status==="uploading"?c.jsxs("div",{className:"relative pt-1",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",I]}),c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[C.progress,"%"]})]}),c.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:c.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${C.progress}%`}})})]},I):null)]})},e.name)}function $m({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,charCount:s,setCharCounts:a}){const i=R.useRef(null),l=t[e.name]||"",u=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,d=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};R.useEffect(()=>{d()},[l]);const h=g=>{n(e.name,g.target.value),d(),a&&a(p=>({...p,[e.name]:g.target.value.length}))};return c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:l,onChange:h,onBlur:()=>r(e.name),disabled:u,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border 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 resize-none overflow-y-auto ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${u?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),c.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&c.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})})]})}function zm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=R.useState(!1),i=A=>{if(!A)return null;if(A instanceof Date)return Number.isNaN(A.getTime())?null:A;if(typeof A=="string"){const T=A.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(T){const[,U,q,I]=T,C=new Date(Number(U),Number(q)-1,Number(I));return Number.isNaN(C.getTime())?null:C}const z=A.includes("T")?A:A.replace(" ","T"),$=new Date(z);return Number.isNaN($.getTime())?null:$}const O=new Date(A);return Number.isNaN(O.getTime())?null:O},l=t[e.name],u=i(l),d=u?(u.getHours()%12||12).toString().padStart(2,"0"):"12",h=u?u.getMinutes().toString().padStart(2,"0"):"00",g=u?u.getHours()>=12?"PM":"AM":"PM",p=A=>{if(!A){n(e.name,null);return}const O=new Date(A);u?(O.setHours(u.getHours()),O.setMinutes(u.getMinutes())):(O.setHours(12),O.setMinutes(0)),n(e.name,O)},b=(A,O,T)=>{const z=u?new Date(u):new Date;let $=parseInt(A);T==="PM"&&$!==12&&($+=12),T==="AM"&&$===12&&($=0),z.setHours($),z.setMinutes(parseInt(O)),n(e.name,z)},m=()=>{let A=parseInt(d);A=A%12+1,b(A.toString(),h,g)},v=()=>{let A=parseInt(d);A=A===1?12:A-1,b(A.toString(),h,g)},S=()=>{let A=parseInt(h);A=(A+5)%60,b(d,A.toString(),g)},k=()=>{let A=parseInt(h);A=A===0?55:A-5,b(d,A.toString(),g)},N=()=>{b(d,h,g==="AM"?"PM":"AM")},w=()=>n(e.name,null),x=[];if(e.maxDate){const A=i(e.maxDate);A&&x.push({after:A})}if(e.minDate){const A=i(e.minDate);A&&x.push({before:A})}return c.jsxs("div",{className:"relative",children:[c.jsxs(Wn,{open:e.disabled?!1:s,onOpenChange:A=>{e.disabled||a(A)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,disabled:e.disabled,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>!e.disabled&&a(!0),onKeyDown:A=>!e.disabled&&A.key==="Enter"&&a(!0),className:`
98
+ ${u?"bg-gray-50 border-gray-300 text-gray-400 cursor-not-allowed opacity-70":y?"bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 hover:border-blue-400 hover:bg-gray-50 cursor-pointer"}
99
+ `;return c.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("button",{type:"button",className:j,onClick:()=>{u||o?.current?.[e.name]?.click()},onDragOver:A,onDragEnter:A,onDragLeave:x,onDrop:$,disabled:u,children:[c.jsx("div",{className:"border-gray-400 border p-1 mb-3 rounded-md bg-gray-100 shadow-md ",children:c.jsx(hc,{size:24,className:"m-1"})}),c.jsxs("p",{className:"text-sm font-normal",children:[c.jsxs("span",{className:u?"text-gray-400":"text-blue-600 hover:text-blue-700 underline",children:["Upload ",d?"Files":"a file"]}),c.jsx("span",{className:"font-light",children:" or drag and drop"})]}),c.jsxs("p",{className:"text-xs mt-1 text-gray-500",children:[W,R,d&&e.maxFiles&&`, Max ${e.maxFiles} files`]})]}),c.jsx("input",{ref:D=>{D&&o&&o.current&&(o.current[e.name]=D)},id:e.name,type:"file",accept:e.accept,multiple:d,className:"sr-only",onChange:D=>T(e.name,D.target.files),disabled:u}),h.length>0&&c.jsx("div",{className:"space-y-2 pt-2 border-t border-gray-200",children:h.map((D,C)=>{const P=D.original_name||D.name||"File",_=D.size||null;return c.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[c.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[c.jsx("span",{className:"text-sm truncate",children:P}),_&&c.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:["(",S(_),")"]})]}),c.jsx("button",{type:"button",onClick:()=>L(e.name,D),className:`text-red-500 hover:text-red-700 ml-3 flex-shrink-0 ${u?"cursor-not-allowed opacity-50":""}`,disabled:u,children:"Remove"})]},D.url||D.original_name||C)})}),Object.entries(m).map(([D,C])=>C.status==="uploading"?c.jsxs("div",{className:"relative pt-1",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",D]}),c.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[C.progress,"%"]})]}),c.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:c.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${C.progress}%`}})})]},D):null)]})},e.name)}function $m({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,charCount:s,setCharCounts:a}){const i=z.useRef(null),l=t[e.name]||"",u=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,d=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};z.useEffect(()=>{d()},[l]);const m=g=>{n(e.name,g.target.value),d(),a&&a(h=>({...h,[e.name]:g.target.value.length}))};return c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:l,onChange:m,onBlur:()=>r(e.name),disabled:u,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border 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 resize-none overflow-y-auto ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${u?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),c.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&c.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})})]})}function zm({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=z.useState(!1),i=x=>{if(!x)return null;if(x instanceof Date)return Number.isNaN(x.getTime())?null:x;if(typeof x=="string"){const W=x.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(W){const[,D,C,P]=W,_=new Date(Number(D),Number(C)-1,Number(P));return Number.isNaN(_.getTime())?null:_}const R=x.includes("T")?x:x.replace(" ","T"),j=new Date(R);return Number.isNaN(j.getTime())?null:j}const $=new Date(x);return Number.isNaN($.getTime())?null:$},l=t[e.name],u=i(l),d=u?(u.getHours()%12||12).toString().padStart(2,"0"):"12",m=u?u.getMinutes().toString().padStart(2,"0"):"00",g=u?u.getHours()>=12?"PM":"AM":"PM",h=x=>{if(!x){n(e.name,null);return}const $=new Date(x);u?($.setHours(u.getHours()),$.setMinutes(u.getMinutes())):($.setHours(12),$.setMinutes(0)),n(e.name,$)},y=(x,$,W)=>{const R=u?new Date(u):new Date;let j=parseInt(x);W==="PM"&&j!==12&&(j+=12),W==="AM"&&j===12&&(j=0),R.setHours(j),R.setMinutes(parseInt($)),n(e.name,R)},f=()=>{let x=parseInt(d);x=x%12+1,y(x.toString(),m,g)},b=()=>{let x=parseInt(d);x=x===1?12:x-1,y(x.toString(),m,g)},S=()=>{let x=parseInt(m);x=(x+5)%60,y(d,x.toString(),g)},k=()=>{let x=parseInt(m);x=x===0?55:x-5,y(d,x.toString(),g)},E=()=>{y(d,m,g==="AM"?"PM":"AM")},w=()=>n(e.name,null),T=typeof e.maxDate=="function"?e.maxDate(t):e.maxDate,L=typeof e.minDate=="function"?e.minDate(t):e.minDate,A=[];if(T){const x=i(T);x&&A.push({after:x})}if(L){const x=i(L);x&&A.push({before:x})}return c.jsxs("div",{className:"relative",children:[c.jsxs(Wn,{open:e.disabled?!1:s,onOpenChange:x=>{e.disabled||a(x)},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,disabled:e.disabled,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>!e.disabled&&a(!0),onKeyDown:x=>!e.disabled&&x.key==="Enter"&&a(!0),className:`
100
100
  group inline-flex items-center justify-between gap-2
101
101
  w-full h-10 rounded-lg border bg-white
102
102
  px-3 py-2 text-sm font-normal shadow-sm transition-all
@@ -104,18 +104,18 @@
104
104
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
105
105
  disabled:cursor-not-allowed disabled:opacity-50
106
106
  ${o?"border-red-500 focus-visible:ring-red-500":"border-slate-200 focus-visible:ring-blue-500"}
107
- `,children:[u?c.jsx("span",{className:"text-slate-900 ",children:u.toLocaleString()}):c.jsx("span",{className:"text-slate-400",children:e.placeholder||"Select date and time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-calendar text-slate-400 group-hover:text-slate-600 transition-colors",children:[c.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),c.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),c.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),c.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-white rounded-xl shadow-xl border border-slate-200",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:u,onSelect:p,showOutsideDays:!0,disabled:x,className:"p-0",classNames:{day_selected:"bg-blue-600 text-white hover:bg-blue-600 hover:text-white focus:bg-blue-600 focus:text-white rounded-md",day_today:"bg-slate-100 text-slate-900 font-bold rounded-md",day:"h-9 w-9 p-0 font-normal aria-selected:opacity-100 hover:bg-slate-100 rounded-md transition-colors",head_cell:"text-slate-500 rounded-md w-9 font-normal text-[0.8rem]"}})}),c.jsx("div",{className:"border-t border-slate-100 p-4 bg-slate-50/50",children:c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:m,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:d}),c.jsx("button",{type:"button",onClick:v,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),c.jsx("span",{className:"text-xl font-medium text-slate-300 pb-1",children:":"}),c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:S,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:h}),c.jsx("button",{type:"button",onClick:k,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),c.jsxs("div",{className:"flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm",children:[c.jsx("button",{type:"button",onClick:()=>g!=="AM"&&N(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="AM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),c.jsx("button",{type:"button",onClick:()=>g!=="PM"&&N(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="PM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"PM"})]})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-slate-100 p-3 bg-white rounded-b-xl",children:[c.jsx("button",{type:"button",onClick:w,className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-slate-500 hover:text-slate-900 hover:bg-slate-100 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 shadow-sm h-9 px-6 py-2",children:"Done"})]})]})]}),o&&c.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]})}var Rm=Symbol.for("react.lazy"),Un=f[" use ".trim().toString()];function Wm(e){return typeof e=="object"&&e!==null&&"then"in e}function ui(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Rm&&"_payload"in e&&Wm(e._payload)}function Bm(e){const t=Hm(e),n=f.forwardRef((r,o)=>{let{children:s,...a}=r;ui(s)&&typeof Un=="function"&&(s=Un(s._payload));const i=f.Children.toArray(s),l=i.find(jm);if(l){const u=l.props.children,d=i.map(h=>h===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...a,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Hm(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(ui(o)&&typeof Un=="function"&&(o=Un(o._payload)),f.isValidElement(o)){const a=Gm(o),i=Vm(s,o.props);return o.type!==f.Fragment&&(i.ref=r?er(r,a):a),f.cloneElement(o,i)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Um=Symbol("radix.slottable");function jm(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Um}function Vm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Gm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ym=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qm=Ym.reduce((e,t)=>{const n=Bm(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Km="Separator",di="horizontal",Xm=["horizontal","vertical"],fi=f.forwardRef((e,t)=>{const{decorative:n,orientation:r=di,...o}=e,s=Qm(r)?r:di,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(qm.div,{"data-orientation":s,...i,...o,ref:t})});fi.displayName=Km;function Qm(e){return Xm.includes(e)}var Zm=fi;function Xr({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(Zm,{"data-slot":"separator",decorative:n,orientation:t,className:Rn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Jm({field:e}){return e?.label?c.jsxs("div",{className:"relative flex items-center py-4",children:[c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"}),c.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"})]}):c.jsx(Xr,{className:"my-4 h-px bg-gray-300"})}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jn=eh.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pi=th.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qr="rovingFocusGroup.onEntryFocus",nh={bubbles:!1,cancelable:!0},Zt="RovingFocusGroup",[Zr,mi,rh]=wo(Zt),[oh,hi]=ct(Zt,[rh]),[sh,ah]=oh(Zt),gi=f.forwardRef((e,t)=>c.jsx(Zr.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Zr.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(ih,{...e,ref:t})})}));gi.displayName=Zt;var ih=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,g=f.useRef(null),p=ce(t,g),b=tr(s),[m,v]=zt({prop:a,defaultProp:i??null,onChange:l,caller:Zt}),[S,k]=f.useState(!1),N=Ke(u),w=mi(n),x=f.useRef(!1),[A,O]=f.useState(0);return f.useEffect(()=>{const T=g.current;if(T)return T.addEventListener(Qr,N),()=>T.removeEventListener(Qr,N)},[N]),c.jsx(sh,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:m,onItemFocus:f.useCallback(T=>v(T),[v]),onItemShiftTab:f.useCallback(()=>k(!0),[]),onFocusableItemAdd:f.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:f.useCallback(()=>O(T=>T-1),[]),children:c.jsx(pi.div,{tabIndex:S||A===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{x.current=!0}),onFocus:J(e.onFocus,T=>{const z=!x.current;if(T.target===T.currentTarget&&z&&!S){const $=new CustomEvent(Qr,nh);if(T.currentTarget.dispatchEvent($),!$.defaultPrevented){const U=w().filter(_=>_.focusable),q=U.find(_=>_.active),I=U.find(_=>_.id===m),P=[q,I,...U].filter(Boolean).map(_=>_.ref.current);vi(P,d)}}x.current=!1}),onBlur:J(e.onBlur,()=>k(!1))})})}),bi="RovingFocusGroupItem",yi=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,l=Lt(),u=s||l,d=ah(bi,n),h=d.currentTabStopId===u,g=mi(n),{onFocusableItemAdd:p,onFocusableItemRemove:b,currentTabStopId:m}=d;return f.useEffect(()=>{if(r)return p(),()=>b()},[r,p,b]),c.jsx(Zr.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(pi.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:J(e.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:J(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:J(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const S=uh(v,d.orientation,d.dir);if(S!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let N=g().filter(w=>w.focusable).map(w=>w.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const w=N.indexOf(v.currentTarget);N=d.loop?dh(N,w+1):N.slice(w+1)}setTimeout(()=>vi(N))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:m!=null}):a})})});yi.displayName=bi;var ch={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lh(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uh(e,t,n){const r=lh(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ch[r]}function vi(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fh=gi,ph=yi,Jr="Radio",[mh,wi]=ct(Jr),[hh,gh]=mh(Jr),xi=f.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:i="on",onCheck:l,form:u,...d}=e,[h,g]=f.useState(null),p=ce(t,v=>g(v)),b=f.useRef(!1),m=h?u||!!h.closest("form"):!0;return c.jsxs(hh,{scope:n,checked:o,disabled:a,children:[c.jsx(jn.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ni(o),"data-disabled":a?"":void 0,disabled:a,value:i,...d,ref:p,onClick:J(e.onClick,v=>{o||l?.(),m&&(b.current=v.isPropagationStopped(),b.current||v.stopPropagation())})}),m&&c.jsx(Ei,{control:h,bubbles:!b.current,name:r,value:i,checked:o,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});xi.displayName=Jr;var Si="RadioIndicator",Ci=f.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=gh(Si,n);return c.jsx(Dn,{present:r||s.checked,children:c.jsx(jn.span,{"data-state":Ni(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Ci.displayName=Si;var bh="RadioBubbleInput",Ei=f.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=f.useRef(null),i=ce(a,s),l=gs(n),u=rs(t);return f.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&p){const b=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(b)}},[l,n,r]),c.jsx(jn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ei.displayName=bh;function Ni(e){return e?"checked":"unchecked"}var yh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vn="RadioGroup",[vh]=ct(Vn,[hi,wi]),ki=hi(),Ai=wi(),[wh,xh]=vh(Vn),Ti=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:i=!1,orientation:l,dir:u,loop:d=!0,onValueChange:h,...g}=e,p=ki(n),b=tr(u),[m,v]=zt({prop:s,defaultProp:o??null,onChange:h,caller:Vn});return c.jsx(wh,{scope:n,name:r,required:a,disabled:i,value:m,onValueChange:v,children:c.jsx(fh,{asChild:!0,...p,orientation:l,dir:b,loop:d,children:c.jsx(jn.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":i?"":void 0,dir:b,...g,ref:t})})})});Ti.displayName=Vn;var Pi="RadioGroupItem",_i=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=xh(Pi,n),a=s.disabled||r,i=ki(n),l=Ai(n),u=f.useRef(null),d=ce(t,u),h=s.value===o.value,g=f.useRef(!1);return f.useEffect(()=>{const p=m=>{yh.includes(m.key)&&(g.current=!0)},b=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",b)}},[]),c.jsx(ph,{asChild:!0,...i,focusable:!a,active:h,children:c.jsx(xi,{disabled:a,required:s.required,checked:h,...l,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:J(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:J(o.onFocus,()=>{g.current&&u.current?.click()})})})});_i.displayName=Pi;var Sh="RadioGroupIndicator",Oi=f.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Ai(n);return c.jsx(Ci,{...o,...r,ref:t})});Oi.displayName=Sh;var Ch=Ti,Eh=_i,Nh=Oi;function kh({className:e,...t}){return c.jsx(Ch,{"data-slot":"radio-group",className:Rn("grid gap-3",e),...t})}function Mi({className:e,...t}){return c.jsx(Eh,{"data-slot":"radio-group-item",className:Rn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(Nh,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(mc,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Ah({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:h,...g}=a,p=t[e.name]??"",b=s,m=e.options||[],v=e.inline||!1,S=e.renderType==="segment",k=g["aria-describedby"],N=S?"mt-2 inline-flex w-full p-1 rounded-lg bg-muted/50 border border-border shadow-inner":v?"flex flex-wrap gap-6 mt-2":"space-y-4 mt-2";return c.jsxs("fieldset",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,"aria-labelledby":`${e.name}-legend`,"aria-describedby":o?k:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx(kh,{...g,value:String(p),onValueChange:w=>{const x=m.find(O=>String(typeof O=="object"?O.value:O)===w),A=x?typeof x=="object"?x.value:x:w;n(e.name,A),r(e.name)},disabled:b,className:N,children:m.map(w=>{const x=typeof w=="object"?w.value:w,A=typeof w=="object"?w.label:w,O=typeof w=="object"?w.description:null,T=`${e.name}-${String(x)}`,z=String(p)===String(x);return S?c.jsxs("label",{htmlFor:T,className:`
107
+ `,children:[u?c.jsx("span",{className:"text-slate-900 ",children:u.toLocaleString()}):c.jsx("span",{className:"text-slate-400",children:e.placeholder||"Select date and time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-calendar text-slate-400 group-hover:text-slate-600 transition-colors",children:[c.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),c.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),c.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),c.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-white rounded-xl shadow-xl border border-slate-200",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:u,onSelect:h,showOutsideDays:!0,disabled:A,className:"p-0",classNames:{day_selected:"bg-blue-600 text-white hover:bg-blue-600 hover:text-white focus:bg-blue-600 focus:text-white rounded-md",day_today:"bg-slate-100 text-slate-900 font-bold rounded-md",day:"h-9 w-9 p-0 font-normal aria-selected:opacity-100 hover:bg-slate-100 rounded-md transition-colors",head_cell:"text-slate-500 rounded-md w-9 font-normal text-[0.8rem]"}})}),c.jsx("div",{className:"border-t border-slate-100 p-4 bg-slate-50/50",children:c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:f,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:d}),c.jsx("button",{type:"button",onClick:b,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),c.jsx("span",{className:"text-xl font-medium text-slate-300 pb-1",children:":"}),c.jsxs("div",{className:"flex flex-col items-center gap-1",children:[c.jsx("button",{type:"button",onClick:S,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m18 15-6-6-6 6"})})}),c.jsx("div",{className:"w-12 h-10 flex items-center justify-center bg-white border border-slate-200 rounded-lg text-lg font-semibold shadow-sm text-slate-700",children:m}),c.jsx("button",{type:"button",onClick:k,className:"p-1 h-6 w-6 flex items-center justify-center text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded-full transition-all",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),c.jsxs("div",{className:"flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm",children:[c.jsx("button",{type:"button",onClick:()=>g!=="AM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="AM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),c.jsx("button",{type:"button",onClick:()=>g!=="PM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${g==="PM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"PM"})]})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-slate-100 p-3 bg-white rounded-b-xl",children:[c.jsx("button",{type:"button",onClick:w,className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-slate-500 hover:text-slate-900 hover:bg-slate-100 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 shadow-sm h-9 px-6 py-2",children:"Done"})]})]})]}),o&&c.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]})}var Rm=Symbol.for("react.lazy"),Un=p[" use ".trim().toString()];function Wm(e){return typeof e=="object"&&e!==null&&"then"in e}function ui(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Rm&&"_payload"in e&&Wm(e._payload)}function Bm(e){const t=Hm(e),n=p.forwardRef((r,o)=>{let{children:s,...a}=r;ui(s)&&typeof Un=="function"&&(s=Un(s._payload));const i=p.Children.toArray(s),l=i.find(jm);if(l){const u=l.props.children,d=i.map(m=>m===l?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:m);return c.jsx(t,{...a,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return c.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Hm(e){const t=p.forwardRef((n,r)=>{let{children:o,...s}=n;if(ui(o)&&typeof Un=="function"&&(o=Un(o._payload)),p.isValidElement(o)){const a=Gm(o),i=Vm(s,o.props);return o.type!==p.Fragment&&(i.ref=r?er(r,a):a),p.cloneElement(o,i)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Um=Symbol("radix.slottable");function jm(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Um}function Vm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const l=s(...i);return o(...i),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Gm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ym=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qm=Ym.reduce((e,t)=>{const n=Bm(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Km="Separator",di="horizontal",Xm=["horizontal","vertical"],fi=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=di,...o}=e,s=Qm(r)?r:di,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(qm.div,{"data-orientation":s,...i,...o,ref:t})});fi.displayName=Km;function Qm(e){return Xm.includes(e)}var Zm=fi;function Xr({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(Zm,{"data-slot":"separator",decorative:n,orientation:t,className:Rn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Jm({field:e}){return e?.label?c.jsxs("div",{className:"relative flex items-center py-4",children:[c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"}),c.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),c.jsx(Xr,{className:"flex-1 h-px bg-gray-300"})]}):c.jsx(Xr,{className:"my-4 h-px bg-gray-300"})}var eh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jn=eh.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pi=th.reduce((e,t)=>{const n=Ce(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:a,...i}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qr="rovingFocusGroup.onEntryFocus",nh={bubbles:!1,cancelable:!0},Zt="RovingFocusGroup",[Zr,mi,rh]=wo(Zt),[oh,hi]=ct(Zt,[rh]),[sh,ah]=oh(Zt),gi=p.forwardRef((e,t)=>c.jsx(Zr.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Zr.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(ih,{...e,ref:t})})}));gi.displayName=Zt;var ih=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...m}=e,g=p.useRef(null),h=ce(t,g),y=tr(s),[f,b]=zt({prop:a,defaultProp:i??null,onChange:l,caller:Zt}),[S,k]=p.useState(!1),E=Ke(u),w=mi(n),T=p.useRef(!1),[L,A]=p.useState(0);return p.useEffect(()=>{const x=g.current;if(x)return x.addEventListener(Qr,E),()=>x.removeEventListener(Qr,E)},[E]),c.jsx(sh,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:f,onItemFocus:p.useCallback(x=>b(x),[b]),onItemShiftTab:p.useCallback(()=>k(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(x=>x+1),[]),onFocusableItemRemove:p.useCallback(()=>A(x=>x-1),[]),children:c.jsx(pi.div,{tabIndex:S||L===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{T.current=!0}),onFocus:J(e.onFocus,x=>{const $=!T.current;if(x.target===x.currentTarget&&$&&!S){const W=new CustomEvent(Qr,nh);if(x.currentTarget.dispatchEvent(W),!W.defaultPrevented){const R=w().filter(_=>_.focusable),j=R.find(_=>_.active),D=R.find(_=>_.id===f),P=[j,D,...R].filter(Boolean).map(_=>_.ref.current);vi(P,d)}}T.current=!1}),onBlur:J(e.onBlur,()=>k(!1))})})}),bi="RovingFocusGroupItem",yi=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,l=Lt(),u=s||l,d=ah(bi,n),m=d.currentTabStopId===u,g=mi(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:f}=d;return p.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),c.jsx(Zr.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(pi.span,{tabIndex:m?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:J(e.onMouseDown,b=>{r?d.onItemFocus(u):b.preventDefault()}),onFocus:J(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:J(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const S=uh(b,d.orientation,d.dir);if(S!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let E=g().filter(w=>w.focusable).map(w=>w.ref.current);if(S==="last")E.reverse();else if(S==="prev"||S==="next"){S==="prev"&&E.reverse();const w=E.indexOf(b.currentTarget);E=d.loop?dh(E,w+1):E.slice(w+1)}setTimeout(()=>vi(E))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:f!=null}):a})})});yi.displayName=bi;var ch={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lh(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uh(e,t,n){const r=lh(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ch[r]}function vi(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fh=gi,ph=yi,Jr="Radio",[mh,wi]=ct(Jr),[hh,gh]=mh(Jr),xi=p.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:i="on",onCheck:l,form:u,...d}=e,[m,g]=p.useState(null),h=ce(t,b=>g(b)),y=p.useRef(!1),f=m?u||!!m.closest("form"):!0;return c.jsxs(hh,{scope:n,checked:o,disabled:a,children:[c.jsx(jn.button,{type:"button",role:"radio","aria-checked":o,"data-state":Ni(o),"data-disabled":a?"":void 0,disabled:a,value:i,...d,ref:h,onClick:J(e.onClick,b=>{o||l?.(),f&&(y.current=b.isPropagationStopped(),y.current||b.stopPropagation())})}),f&&c.jsx(Ei,{control:m,bubbles:!y.current,name:r,value:i,checked:o,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});xi.displayName=Jr;var Si="RadioIndicator",Ci=p.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=gh(Si,n);return c.jsx(Dn,{present:r||s.checked,children:c.jsx(jn.span,{"data-state":Ni(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Ci.displayName=Si;var bh="RadioBubbleInput",Ei=p.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=p.useRef(null),i=ce(a,s),l=gs(n),u=rs(t);return p.useEffect(()=>{const d=a.current;if(!d)return;const m=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(m,"checked").set;if(l!==n&&h){const y=new Event("click",{bubbles:r});h.call(d,n),d.dispatchEvent(y)}},[l,n,r]),c.jsx(jn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ei.displayName=bh;function Ni(e){return e?"checked":"unchecked"}var yh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vn="RadioGroup",[vh]=ct(Vn,[hi,wi]),ki=hi(),Ai=wi(),[wh,xh]=vh(Vn),Ti=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:i=!1,orientation:l,dir:u,loop:d=!0,onValueChange:m,...g}=e,h=ki(n),y=tr(u),[f,b]=zt({prop:s,defaultProp:o??null,onChange:m,caller:Vn});return c.jsx(wh,{scope:n,name:r,required:a,disabled:i,value:f,onValueChange:b,children:c.jsx(fh,{asChild:!0,...h,orientation:l,dir:y,loop:d,children:c.jsx(jn.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":i?"":void 0,dir:y,...g,ref:t})})})});Ti.displayName=Vn;var Pi="RadioGroupItem",_i=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=xh(Pi,n),a=s.disabled||r,i=ki(n),l=Ai(n),u=p.useRef(null),d=ce(t,u),m=s.value===o.value,g=p.useRef(!1);return p.useEffect(()=>{const h=f=>{yh.includes(f.key)&&(g.current=!0)},y=()=>g.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",y),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",y)}},[]),c.jsx(ph,{asChild:!0,...i,focusable:!a,active:m,children:c.jsx(xi,{disabled:a,required:s.required,checked:m,...l,...o,name:s.name,ref:d,onCheck:()=>s.onValueChange(o.value),onKeyDown:J(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:J(o.onFocus,()=>{g.current&&u.current?.click()})})})});_i.displayName=Pi;var Sh="RadioGroupIndicator",Oi=p.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Ai(n);return c.jsx(Ci,{...o,...r,ref:t})});Oi.displayName=Sh;var Ch=Ti,Eh=_i,Nh=Oi;function kh({className:e,...t}){return c.jsx(Ch,{"data-slot":"radio-group",className:Rn("grid gap-3",e),...t})}function Mi({className:e,...t}){return c.jsx(Eh,{"data-slot":"radio-group-item",className:Rn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(Nh,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(mc,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Ah({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const{apiClient:i,api_URL:l,charCount:u,setCharCounts:d,fileInputRefs:m,...g}=a,h=t[e.name]??"",y=s,f=e.options||[],b=e.inline||!1,S=e.renderType==="segment",k=g["aria-describedby"],E=S?"mt-2 inline-flex w-full p-1 rounded-lg bg-muted/50 border border-border shadow-inner":b?"flex flex-wrap gap-6 mt-2":"space-y-4 mt-2";return c.jsxs("fieldset",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,"aria-labelledby":`${e.name}-legend`,"aria-describedby":o?k:void 0,children:[c.jsx("legend",{className:"sr-only",children:e.label}),c.jsx(kh,{...g,value:String(h),onValueChange:w=>{const T=f.find(A=>String(typeof A=="object"?A.value:A)===w),L=T?typeof T=="object"?T.value:T:w;n(e.name,L),r(e.name)},disabled:y,className:E,children:f.map(w=>{const T=typeof w=="object"?w.value:w,L=typeof w=="object"?w.label:w,A=typeof w=="object"?w.description:null,x=`${e.name}-${String(T)}`,$=String(h)===String(T);return S?c.jsxs("label",{htmlFor:x,className:`
108
108
  relative flex-1 min-w-max text-center px-4 py-2 rounded-md text-sm font-medium
109
109
  transition-all duration-200 cursor-pointer select-none
110
110
  focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
111
- ${z?"bg-background text-primary shadow-sm":"text-muted-foreground hover:text-foreground"}
112
- ${b?"opacity-40 cursor-not-allowed":""}
113
- `,children:[c.jsx(Mi,{value:String(x),id:T,disabled:b,className:"sr-only"}),A]},String(x)):c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx(Mi,{value:String(x),id:T,disabled:b,className:`
111
+ ${$?"bg-background text-primary shadow-sm":"text-muted-foreground hover:text-foreground"}
112
+ ${y?"opacity-40 cursor-not-allowed":""}
113
+ `,children:[c.jsx(Mi,{value:String(T),id:x,disabled:y,className:"sr-only"}),L]},String(T)):c.jsxs("div",{className:"relative flex items-start group",children:[c.jsx("div",{className:"flex h-6 items-center",children:c.jsx(Mi,{value:String(T),id:x,disabled:y,className:`
114
114
  size-4 flex items-center justify-center rounded-full border border-input transition-all
115
115
  focus:ring-2 focus:ring-ring focus:ring-offset-2
116
- ${b?"bg-muted opacity-50":"bg-background cursor-pointer hover:border-primary/50"}
116
+ ${y?"bg-muted opacity-50":"bg-background cursor-pointer hover:border-primary/50"}
117
117
  ${o?"border-destructive":""}
118
- `})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:T,className:`font-medium transition-colors ${b?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:A}),O&&!v&&c.jsx("p",{className:`text-xs ${b?"text-muted-foreground/60":"text-muted-foreground"}`,children:O})]})]},String(x))})})]})}function Th({field:e}){const t=e.text||e.label||"",n=e.description||"",r=e.size||"lg",o=e.underline||!1,s=e.align||"left",a=e.className||"",i={sm:"text-xl font-bold",base:"text-2xl font-bold",lg:"text-3xl font-bold"},l={left:"text-left",center:"text-center",right:"text-right"},u=`
118
+ `})}),c.jsxs("div",{className:"ml-3 text-sm leading-6",children:[c.jsx("label",{htmlFor:x,className:`font-medium transition-colors ${y?"text-muted-foreground":"text-foreground cursor-pointer group-hover:text-primary"}`,children:L}),A&&!b&&c.jsx("p",{className:`text-xs ${y?"text-muted-foreground/60":"text-muted-foreground"}`,children:A})]})]},String(T))})})]})}function Th({field:e}){const t=e.text||e.label||"",n=e.description||"",r=e.size||"lg",o=e.underline||!1,s=e.align||"left",a=e.className||"",i={sm:"text-xl font-bold",base:"text-2xl font-bold",lg:"text-3xl font-bold"},l={left:"text-left",center:"text-center",right:"text-right"},u=`
119
119
  ${i[r]||i.lg}
120
120
  ${l[s]||l.left}
121
121
  ${a}
@@ -123,12 +123,12 @@
123
123
  `.trim(),d=`
124
124
  mt-1 text-sm text-gray-500 w-full
125
125
  ${l[s]||l.left}
126
- `.trim();return c.jsxs("div",{className:`my-6 col-span-full w-full ${o?"border-b border-gray-200 pb-3":""}`,children:[c.jsx("h2",{className:u,children:t}),n&&c.jsx("p",{className:d,children:n})]})}function Ph({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const i=x=>{if(!x)return null;if(x instanceof Date)return Number.isNaN(x.getTime())?null:x;if(typeof x=="string"){const A=x.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!A)return null;const[,O,T,z]=A,$=new Date(Number(O),Number(T)-1,Number(z));return Number.isNaN($.getTime())?null:$}return null},l=x=>!(x instanceof Date)||Number.isNaN(x.getTime())?null:Mn(x,"yyyy-MM-dd"),u=x=>i(x),[d,h]=R.useState(!1),g=s,p=t[e.name],b=R.useMemo(()=>u(p),[p]),[m,v]=R.useState(b||new Date);a["aria-describedby"],R.useEffect(()=>{if(d){const x=b||new Date;v(A=>A.getFullYear()===x.getFullYear()&&A.getMonth()===x.getMonth()?A:x)}},[d,b]);const S=[];if(e.maxDate){const x=i(e.maxDate);x&&S.push({after:x})}if(e.minDate){const x=i(e.minDate);x&&S.push({before:x})}const k=x=>{n(e.name,x?l(x):null),x&&v(x),e.closeOnSelect!==!1&&h(!1),r(e.name)},N=()=>{const x=new Date;n(e.name,l(x)),v(x),e.closeOnSelect!==!1&&h(!1),r(e.name)},w=x=>{x.preventDefault(),x.stopPropagation(),n(e.name,null),v(new Date),r(e.name)};return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:g?!1:d,onOpenChange:x=>{g||(h(x),x||r(e.name))},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":d,"aria-haspopup":"dialog","aria-controls":e.name+"-calendar",tabIndex:g?-1:0,onClick:()=>!g&&h(!0),onKeyDown:x=>{g||(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),h(!0))},className:`
126
+ `.trim();return c.jsxs("div",{className:`my-6 col-span-full w-full ${o?"border-b border-gray-200 pb-3":""}`,children:[c.jsx("h2",{className:u,children:t}),n&&c.jsx("p",{className:d,children:n})]})}function Ph({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s,...a}){const i=A=>{if(!A)return null;if(A instanceof Date)return Number.isNaN(A.getTime())?null:A;if(typeof A=="string"){const x=A.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!x)return null;const[,$,W,R]=x,j=new Date(Number($),Number(W)-1,Number(R));return Number.isNaN(j.getTime())?null:j}return null},l=A=>!(A instanceof Date)||Number.isNaN(A.getTime())?null:Mn(A,"yyyy-MM-dd"),u=A=>i(A),[d,m]=z.useState(!1),g=s,h=t[e.name],y=z.useMemo(()=>u(h),[h]),[f,b]=z.useState(y||new Date);a["aria-describedby"],z.useEffect(()=>{if(d){const A=y||new Date;b(x=>x.getFullYear()===A.getFullYear()&&x.getMonth()===A.getMonth()?x:A)}},[d,y]);const S=typeof e.maxDate=="function"?e.maxDate(t):e.maxDate,k=typeof e.minDate=="function"?e.minDate(t):e.minDate,E=[];if(S){const A=i(S);A&&E.push({after:A})}if(k){const A=i(k);A&&E.push({before:A})}const w=A=>{n(e.name,A?l(A):null),A&&b(A),e.closeOnSelect!==!1&&m(!1),r(e.name)},T=()=>{const A=new Date;n(e.name,l(A)),b(A),e.closeOnSelect!==!1&&m(!1),r(e.name)},L=A=>{A.preventDefault(),A.stopPropagation(),n(e.name,null),b(new Date),r(e.name)};return c.jsx("div",{className:"relative w-full",children:c.jsxs(Wn,{open:g?!1:d,onOpenChange:A=>{g||(m(A),A||r(e.name))},children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("div",{role:"combobox","aria-expanded":d,"aria-haspopup":"dialog","aria-controls":e.name+"-calendar",tabIndex:g?-1:0,onClick:()=>!g&&m(!0),onKeyDown:A=>{g||(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),m(!0))},className:`
127
127
  flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm
128
128
  transition-all outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
129
129
  ${g?"bg-muted text-muted-foreground cursor-not-allowed opacity-50":"bg-background text-foreground hover:border-primary/50 cursor-pointer"}
130
130
  ${o?"border-destructive focus-within:ring-destructive":"border-input"}
131
- `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(go,{className:`h-4 w-4 shrink-0 ${o?"text-destructive":"text-muted-foreground"}`,"aria-hidden":"true"}),b?c.jsx("span",{className:"truncate",children:Mn(b,"PPP")}):c.jsx("span",{className:"text-muted-foreground truncate",children:e.placeholder||"Pick a date"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[b&&!g&&c.jsx("button",{type:"button","aria-label":"Clear selected date",onClick:w,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none relative z-10",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform duration-200 ${d?"rotate-180":""}`,"aria-hidden":"true"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-popover border border-border rounded-lg shadow-xl",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:b,month:m,onMonthChange:v,onSelect:k,showOutsideDays:!0,disabled:S,classNames:{day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors",nav_button:"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md flex items-center justify-center",caption_label:"text-sm font-medium"}})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border p-3 bg-muted/20",children:[c.jsx("button",{type:"button",onClick:N,className:"text-xs font-medium px-4 py-2 rounded-md border border-input bg-background hover:bg-muted transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Today"}),c.jsx("button",{type:"button",onClick:()=>h(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Done"})]})]})]})})}function _h({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=R.useState(!1),[i,l]=R.useState("12"),[u,d]=R.useState("00"),[h,g]=R.useState("PM"),p=t[e.name]||"";R.useEffect(()=>{if(p){const w=p.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);w&&(l(w[1].padStart(2,"0")),d(w[2]),g(w[3].toUpperCase()))}},[p]);const b=()=>{const w=`${i}:${u} ${h}`;n(e.name,w),a(!1)},m=()=>{n(e.name,""),l("12"),d("00"),g("PM")},v=()=>{const w=parseInt(i);l((w%12+1).toString().padStart(2,"0"))},S=()=>{const w=parseInt(i);l((w===1?12:w-1).toString().padStart(2,"0"))},k=()=>{const w=parseInt(u);d(((w+5)%60).toString().padStart(2,"0"))},N=()=>{const w=parseInt(u);d((w===0?55:w-5).toString().padStart(2,"0"))};return c.jsx("div",{children:c.jsxs(Wn,{open:s,onOpenChange:a,children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
131
+ `,children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden pointer-events-none",children:[c.jsx(go,{className:`h-4 w-4 shrink-0 ${o?"text-destructive":"text-muted-foreground"}`,"aria-hidden":"true"}),y?c.jsx("span",{className:"truncate",children:Mn(y,"PPP")}):c.jsx("span",{className:"text-muted-foreground truncate",children:e.placeholder||"Pick a date"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[y&&!g&&c.jsx("button",{type:"button","aria-label":"Clear selected date",onClick:L,className:"p-1 hover:bg-muted rounded-full transition-colors focus-visible:ring-1 focus-visible:ring-ring outline-none relative z-10",children:c.jsx(Jn,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"})}),c.jsx(on,{className:`h-4 w-4 shrink-0 opacity-50 transition-transform duration-200 ${d?"rotate-180":""}`,"aria-hidden":"true"})]})]})}),c.jsxs(Hn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-popover border border-border rounded-lg shadow-xl",children:[c.jsx("div",{className:"p-3",children:c.jsx(Zn.DayPicker,{mode:"single",selected:y,month:f,onMonthChange:b,onSelect:w,showOutsideDays:!0,disabled:E,classNames:{day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",day_today:"bg-accent text-accent-foreground font-bold",day:"h-9 w-9 p-0 font-normal hover:bg-muted rounded-md transition-colors",nav_button:"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md flex items-center justify-center",caption_label:"text-sm font-medium"}})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-border p-3 bg-muted/20",children:[c.jsx("button",{type:"button",onClick:T,className:"text-xs font-medium px-4 py-2 rounded-md border border-input bg-background hover:bg-muted transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Today"}),c.jsx("button",{type:"button",onClick:()=>m(!1),className:"text-xs font-medium px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-all focus-visible:ring-2 focus-visible:ring-ring",children:"Done"})]})]})]})})}function _h({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=z.useState(!1),[i,l]=z.useState("12"),[u,d]=z.useState("00"),[m,g]=z.useState("PM"),h=t[e.name]||"";z.useEffect(()=>{if(h){const w=h.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);w&&(l(w[1].padStart(2,"0")),d(w[2]),g(w[3].toUpperCase()))}},[h]);const y=()=>{const w=`${i}:${u} ${m}`;n(e.name,w),a(!1)},f=()=>{n(e.name,""),l("12"),d("00"),g("PM")},b=()=>{const w=parseInt(i);l((w%12+1).toString().padStart(2,"0"))},S=()=>{const w=parseInt(i);l((w===1?12:w-1).toString().padStart(2,"0"))},k=()=>{const w=parseInt(u);d(((w+5)%60).toString().padStart(2,"0"))},E=()=>{const w=parseInt(u);d((w===0?55:w-5).toString().padStart(2,"0"))};return c.jsx("div",{children:c.jsxs(Wn,{open:s,onOpenChange:a,children:[c.jsx(Bn,{asChild:!0,children:c.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
132
132
  inline-flex items-center justify-between gap-2
133
133
  w-full h-9 rounded-md border bg-white
134
134
  px-3 py-2 text-sm font-normal shadow-sm
@@ -136,10 +136,10 @@
136
136
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
137
137
  disabled:cursor-not-allowed disabled:opacity-50
138
138
  ${o?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
139
- `,children:[p?c.jsx("span",{children:p}):c.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),c.jsx(Hn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:v,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:i,onChange:w=>{const x=w.target.value.replace(/\D/g,"");(x===""||parseInt(x)>=1&&parseInt(x)<=12)&&l(x.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:S,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsx("span",{className:"text-2xl font-semibold",children:":"}),c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:k,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:u,onChange:w=>{const x=w.target.value.replace(/\D/g,"");(x===""||parseInt(x)>=0&&parseInt(x)<=59)&&d(x.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:N,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[c.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
139
+ `,children:[h?c.jsx("span",{children:h}):c.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),c.jsx(Hn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:b,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:i,onChange:w=>{const T=w.target.value.replace(/\D/g,"");(T===""||parseInt(T)>=1&&parseInt(T)<=12)&&l(T.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:S,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsx("span",{className:"text-2xl font-semibold",children:":"}),c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("button",{type:"button",onClick:k,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"18 15 12 9 6 15"})})}),c.jsx("input",{type:"text",value:u,onChange:w=>{const T=w.target.value.replace(/\D/g,"");(T===""||parseInt(T)>=0&&parseInt(T)<=59)&&d(T.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),c.jsx("button",{type:"button",onClick:E,className:"p-1 hover:bg-gray-100 rounded",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),c.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[c.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
140
140
  px-3 py-1 text-sm font-medium rounded
141
- ${h==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
141
+ ${m==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
142
142
  `,children:"AM"}),c.jsx("button",{type:"button",onClick:()=>g("PM"),className:`
143
143
  px-3 py-1 text-sm font-medium rounded
144
- ${h==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
145
- `,children:"PM"})]})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[c.jsx("button",{type:"button",onClick:m,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]})})}function Oh({message:e}){return c.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(pc,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function Mh({message:e}){return c.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(dc,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function Dh({message:e}){return c.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(fc,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function Ih({message:e}){return c.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(xc,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function Lh({field:e}){const{variant:t="info",message:n,content:r}=e,o=n||r||"";switch(t.toLowerCase()){case"error":case"danger":return c.jsx(Oh,{message:o});case"success":return c.jsx(Dh,{message:o});case"warning":case"warn":return c.jsx(Mh,{message:o});default:return c.jsx(Ih,{message:o})}}function Di(e){if(e instanceof Date)return e;if(typeof e=="string"&&e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(t){const[,o,s,a]=t,i=new Date(Number(o),Number(s)-1,Number(a));if(!isNaN(i.getTime()))return i}const n=e.includes("T")?e:e.replace(" ","T"),r=new Date(n);if(!isNaN(r.getTime()))return r}return null}function eo(e){if(!e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}if(typeof e=="string"){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(t)return`${t[1]}-${t[2]}-${t[3]}`;const n=Di(e);if(!n)return"";const r=n.getFullYear(),o=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0");return`${r}-${o}-${s}`}return""}const Ii=({apiClient:e,api_URL:t,footerMode:n="normal",formDefinition:r,returnType:o=!1,sendFormValues:s=()=>{},children:a,defaultValues:i={},onFieldsChange:l=()=>{},debugMode:u=!1})=>{const[d,h]=R.useState({...i}),[g,p]=R.useState({}),[b,m]=R.useState({}),[v,S]=R.useState({}),k=R.useRef({}),N=R.useRef(!1),w=["hidden","linebreak","header","alert"],x=R.useMemo(()=>({file:li,multifile:li,dateRange:Fm,date:Ph,dayTimePicker:zm,time:_h,hidden:nc,multiselect:rc,searchselect:Oc,select:Qd,email:Zd,html:Ef,checkbox:Nf,radiogroup:Ah,input:ia,number:Jd,textarea:$m,header:Th,alert:Lh,linebreak:Jm}),[]),A=async(C,P=null)=>{if(!(C.optionsUrl&&!C.preloadOptions)){if(!e){const _=`apiClient prop is required when using fields with optionsUrl. Field "${C.name}" requires optionsUrl but no apiClient was provided.`;u&&console.error(_),tn.toast.error(_);return}try{const _=await e(`/${C.optionsUrl}`);let F=[];C.type==="select"?F=[{value:"",label:`Select ${C.label.toLowerCase()}`},..._.data]:F=[..._.data.map(E=>({value:E.value,label:E.label}))],r.fields.forEach(E=>{E&&E.name===C.name&&(E.options=F)})}catch(_){u&&console.error(`Failed to load options for ${C.name}:`,_)}}};R.useEffect(()=>{if(!N.current&&r?.fields&&r.fields.length>0){if(!r.fields.some(_=>_&&_.value))return;r.fields.forEach(_=>{_&&_.optionsUrl&&A(_)});const P={};r.fields.forEach(_=>{if(!_||!_.name)return;const F=_.type==="multiselect"||_.type==="searchselect"||_.type==="checkbox"&&_.options&&_.options.length>0;let E=i[_.name]??_.value??(F?[]:"");const M=_.type?.toLowerCase(),D=["datetime","daytimepicker"].includes(M),V=["date","datepicker"].includes(M);D&&E&&(E=Di(E)||E),V&&E&&(E=eo(E)),P[_.name]=E}),h(P),N.current=!0}},[r]);const O=(C,P,_)=>{const F=typeof P=="object"&&P!==null&&!Array.isArray(P)&&!(P instanceof Date),E=P==null||typeof P=="string"&&P.trim()===""||Array.isArray(P)&&P.length===0||C.type==="checkbox"&&P===!1||F&&Object.keys(P).length===0;if(C.required&&E)return u&&console.warn(`VALIDATION FAILED (REQUIRED): ${C.name} is empty.`),`${C.label} is required`;if(E&&!C.required)return null;if(C.validate){const M=C.validate(P,_);if(M)return M}if(C.type==="email"&&P&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P))return"Please enter a valid email address";if(C.type==="number"){if(C.min!==void 0&&P<C.min)return`${C.label} must be at least ${C.min}`;if(C.max!==void 0&&P>C.max)return`${C.label} must be no more than ${C.max}`}return C.type==="date"&&P&&!nn(P).isValid()?`${C.label} must be a valid date`:C.maxLength&&P&&P.length>C.maxLength?`${C.label} must not exceed ${C.maxLength} characters`:null},T=(C,P)=>{const _=r.fields.find(E=>E&&E.name===C);if(!_)return;const F={...d};_.type==="multiselect"||_.type==="searchselect"?Array.isArray(P)?F[C]=P:P&&P.target&&P.target.selectedOptions?F[C]=Array.from(P.target.selectedOptions).map(E=>E.value):F[C]=P:_.type==="dateRange"?F[C]=[{startDate:P.from,endDate:P.to||P.from,key:"selection"}]:_.type==="dayTimePicker"?F[C]=P?nn(P).format("YYYY-MM-DD HH:mm:ss"):"":_.type==="date"?F[C]=eo(P):_.type==="number"?F[C]=P===""?"":Number(P):F[C]=P,_.type==="select"&&r.fields.forEach(E=>{if(E&&E.showIf&&!E.showIf(F)){const M=E.type==="multiselect"||E.type==="searchselect"||E.type==="checkbox"&&E.options&&E.options.length>0;F[E.name]=M?[]:""}}),r.fields.forEach(E=>{if(E&&typeof E.disabled=="function"&&E.disabled(F)){const M=E.type==="multiselect"||E.type==="searchselect"||E.type==="checkbox"&&E.options&&E.options.length>0;F[E.name]=M?[]:""}}),h(F)},z=C=>{m({...b,[C]:!0})},$=C=>{C.preventDefault();const P={};r.fields.forEach(F=>{F&&F.name&&(P[F.name]=!0)}),m(P);const _={};if(r.fields.forEach(F=>{if(!(!F||!F.name)&&(!F.showIf||F.showIf(d))){const E=O(F,d[F.name],d);E&&(_[F.name]=E)}}),p(_),Object.keys(_).length===0){const F=(M,D)=>{if(M===""||M===null||M===void 0)return null;const V=D?.toLowerCase();if(Array.isArray(M))return V==="number"||V==="integer"?M.map(se=>se===""?null:Number(se)):M;switch(V){case"number":case"integer":case"float":return Number(M);case"boolean":case"bool":return String(M).toLowerCase()==="true"||M===!0;case"date":case"datepicker":return eo(M)||M;case"datetime":return nn(M).isValid()?nn(M).format("YYYY-MM-DDTHH:mm:ss"):M;default:return M}},E={};r.fields.forEach(M=>{if(M&&M.name){const D=d[M.name],V=M.type||"string",se=F(D,V);o?E[M.name]={value:se,fieldType:V}:E[M.name]=se}}),u?console.log("Form submitted with values:",E):s(E)}else tn.toast.error("Please correct the errors in the form")};R.useEffect(()=>{l(d)},[d,l]);const U={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function q(C,P,_){const F=`${P.name}-error`;if(u&&(_?console.log(`[fieldFormat RENDER] Rendering error for ${P.name}: ${_}`):g[P.name]&&console.log(`[fieldFormat RENDER] Error exists in state for ${P.name} but not passed in props!`)),w.includes(P.type))return c.jsx("div",{className:P.class||"col-span-full",children:C});const E=P.containerStyle,M=P.color||"blue",D=E==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${P.containerClassName||U[M]||U.blue}`:"",V=c.jsxs(c.Fragment,{children:[P.label&&c.jsxs("label",{htmlFor:P.name,className:"block text-sm font-medium mb-1",children:[P.label,P.required&&c.jsx("span",{className:"text-red-500 ml-1","aria-hidden":"true",children:"*"})]}),c.jsx("div",{children:R.cloneElement(C,{"aria-describedby":_?F:void 0,"aria-invalid":!!_,"aria-required":P.required})}),P.description&&c.jsx("p",{className:"text-xs mt-1.5 text-gray-400",children:P.description}),_&&c.jsx("p",{id:F,className:"text-sm text-red-500 mt-1",role:"alert",children:_})]});return c.jsx("div",{className:"mb-4",children:E==="card"?c.jsx("div",{className:D,children:V}):V})}const I=C=>{if(C.showIf&&!C.showIf(d))return null;const P=x[C.type]||ia;if(d[C.name]===void 0){const E=C.type==="multiselect"||C.type==="searchselect"||C.type==="checkbox"&&C.options&&C.options.length>0;d[C.name]=C.value!==void 0?C.value:E?[]:""}const _=g[C.name]?g[C.name]:null,F=typeof C.disabled=="function"?C.disabled(d):!!C.disabled;return q(c.jsx(P,{field:C,formValues:d,handleChange:T,handleBlur:()=>z(C.name),setCharCounts:S,charCount:v[C.name]||0,api_URL:t,error:_,fileInputRefs:k,disabled:F,apiClient:e}),C,_)};return c.jsxs("form",{onSubmit:$,className:"grid grid-cols-12 gap-x-4 mx-auto w-full  ",children:[r?r.fields.filter(C=>C).map(C=>c.jsx("div",{className:`${C.class||"col-span-full"} `,children:I(C)},C.name+C.type)):c.jsx("div",{children:"Loading..."}),c.jsx("div",{className:n==="sticky"?"absolute col-span-full w-full bottom-0  bg-white py-4 flex justify-end gap-2 z-50":"col-span-full mt-4 flex justify-end gap-2",children:R.Children.map(a,C=>R.isValidElement(C)&&C.props.onClick?R.cloneElement(C,{onClick:P=>{C.props.onClick(d,P)}}):C)})]})};me.DynamicForm=Ii,me.default=Ii,Object.defineProperties(me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
144
+ ${m==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
145
+ `,children:"PM"})]})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[c.jsx("button",{type:"button",onClick:f,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),c.jsx("button",{type:"button",onClick:y,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]})})}function Oh({message:e}){return c.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(pc,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function Mh({message:e}){return c.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(dc,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function Dh({message:e}){return c.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(fc,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function Ih({message:e}){return c.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(xc,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function Lh({field:e}){const{variant:t="info",message:n,content:r}=e,o=n||r||"";switch(t.toLowerCase()){case"error":case"danger":return c.jsx(Oh,{message:o});case"success":return c.jsx(Dh,{message:o});case"warning":case"warn":return c.jsx(Mh,{message:o});default:return c.jsx(Ih,{message:o})}}function Di(e){if(e instanceof Date)return e;if(typeof e=="string"&&e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(t){const[,o,s,a]=t,i=new Date(Number(o),Number(s)-1,Number(a));if(!isNaN(i.getTime()))return i}const n=e.includes("T")?e:e.replace(" ","T"),r=new Date(n);if(!isNaN(r.getTime()))return r}return null}function eo(e){if(!e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}if(typeof e=="string"){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(t)return`${t[1]}-${t[2]}-${t[3]}`;const n=Di(e);if(!n)return"";const r=n.getFullYear(),o=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0");return`${r}-${o}-${s}`}return""}const Ii=({apiClient:e,api_URL:t,footerMode:n="normal",formDefinition:r,returnType:o=!1,sendFormValues:s=()=>{},children:a,defaultValues:i={},onFieldsChange:l=()=>{},debugMode:u=!1})=>{const[d,m]=z.useState({...i}),[g,h]=z.useState({}),[y,f]=z.useState({}),[b,S]=z.useState({}),k=z.useRef({}),E=z.useRef(!1),w=["hidden","linebreak","header","alert"],T=z.useMemo(()=>({file:li,multifile:li,dateRange:Fm,date:Ph,dayTimePicker:zm,time:_h,hidden:nc,multiselect:rc,searchselect:Oc,select:Qd,email:Zd,html:Ef,checkbox:Nf,radiogroup:Ah,input:ia,number:Jd,textarea:$m,header:Th,alert:Lh,linebreak:Jm}),[]),L=async(C,P=null)=>{if(!(C.optionsUrl&&!C.preloadOptions)){if(!e){const _=`apiClient prop is required when using fields with optionsUrl. Field "${C.name}" requires optionsUrl but no apiClient was provided.`;u&&console.error(_),tn.toast.error(_);return}try{const _=await e(`/${C.optionsUrl}`);let F=[];C.type==="select"?F=[{value:"",label:`Select ${C.label.toLowerCase()}`},..._.data]:F=[..._.data.map(N=>({value:N.value,label:N.label}))],r.fields.forEach(N=>{N&&N.name===C.name&&(N.options=F)})}catch(_){u&&console.error(`Failed to load options for ${C.name}:`,_)}}};z.useEffect(()=>{if(!E.current&&r?.fields&&r.fields.length>0){if(!r.fields.some(_=>_&&_.value))return;r.fields.forEach(_=>{_&&_.optionsUrl&&L(_)});const P={};r.fields.forEach(_=>{if(!_||!_.name)return;const F=_.type==="multiselect"||_.type==="searchselect"||_.type==="checkbox"&&_.options&&_.options.length>0;let N=i[_.name]??_.value??(F?[]:"");const O=_.type?.toLowerCase(),M=["datetime","daytimepicker"].includes(O),G=["date","datepicker"].includes(O);M&&N&&(N=Di(N)||N),G&&N&&(N=eo(N)),P[_.name]=N}),m(P),E.current=!0}},[r]);const A=(C,P,_)=>{const F=typeof P=="object"&&P!==null&&!Array.isArray(P)&&!(P instanceof Date),N=P==null||typeof P=="string"&&P.trim()===""||Array.isArray(P)&&P.length===0||C.type==="checkbox"&&P===!1||F&&Object.keys(P).length===0;if(C.required&&N)return u&&console.warn(`VALIDATION FAILED (REQUIRED): ${C.name} is empty.`),`${C.label} is required`;if(N&&!C.required)return null;if(C.validate){const O=C.validate(P,_);if(O)return O}if(C.type==="email"&&P&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P))return"Please enter a valid email address";if(C.type==="number"){if(C.min!==void 0&&P<C.min)return`${C.label} must be at least ${C.min}`;if(C.max!==void 0&&P>C.max)return`${C.label} must be no more than ${C.max}`}return C.type==="date"&&P&&!nn(P).isValid()?`${C.label} must be a valid date`:C.maxLength&&P&&P.length>C.maxLength?`${C.label} must not exceed ${C.maxLength} characters`:null},x=(C,P)=>{const _=r.fields.find(N=>N&&N.name===C);if(!_)return;const F={...d};_.type==="multiselect"||_.type==="searchselect"?Array.isArray(P)?F[C]=P:P&&P.target&&P.target.selectedOptions?F[C]=Array.from(P.target.selectedOptions).map(N=>N.value):F[C]=P:_.type==="dateRange"?F[C]=[{startDate:P.from,endDate:P.to||P.from,key:"selection"}]:_.type==="dayTimePicker"?F[C]=P?nn(P).format("YYYY-MM-DD HH:mm:ss"):"":_.type==="date"?F[C]=eo(P):_.type==="number"?F[C]=P===""?"":Number(P):F[C]=P,_.type==="select"&&r.fields.forEach(N=>{if(N&&N.showIf&&!N.showIf(F)){const O=N.type==="multiselect"||N.type==="searchselect"||N.type==="checkbox"&&N.options&&N.options.length>0;F[N.name]=O?[]:""}}),r.fields.forEach(N=>{if(N&&typeof N.disabled=="function"&&N.disabled(F)){const O=N.type==="multiselect"||N.type==="searchselect"||N.type==="checkbox"&&N.options&&N.options.length>0;F[N.name]=O?[]:""}}),m(F)},$=C=>{f({...y,[C]:!0})},W=C=>{C.preventDefault();const P={};r.fields.forEach(F=>{F&&F.name&&(P[F.name]=!0)}),f(P);const _={};if(r.fields.forEach(F=>{if(!(!F||!F.name)&&(!F.showIf||F.showIf(d))){const N=A(F,d[F.name],d);N&&(_[F.name]=N)}}),h(_),Object.keys(_).length===0){const F=(O,M)=>{if(O===""||O===null||O===void 0)return null;const G=M?.toLowerCase();if(Array.isArray(O))return G==="number"||G==="integer"?O.map(se=>se===""?null:Number(se)):O;switch(G){case"number":case"integer":case"float":return Number(O);case"boolean":case"bool":return String(O).toLowerCase()==="true"||O===!0;case"date":case"datepicker":return eo(O)||O;case"datetime":return nn(O).isValid()?nn(O).format("YYYY-MM-DDTHH:mm:ss"):O;default:return O}},N={};r.fields.forEach(O=>{if(O&&O.name){const M=d[O.name],G=O.type||"string",se=F(M,G);o?N[O.name]={value:se,fieldType:G}:N[O.name]=se}}),u?console.log("Form submitted with values:",N):s(N)}else tn.toast.error("Please correct the errors in the form")};z.useEffect(()=>{l(d)},[d,l]);const R={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function j(C,P,_){const F=`${P.name}-error`;if(u&&(_?console.log(`[fieldFormat RENDER] Rendering error for ${P.name}: ${_}`):g[P.name]&&console.log(`[fieldFormat RENDER] Error exists in state for ${P.name} but not passed in props!`)),w.includes(P.type))return c.jsx("div",{className:P.class||"col-span-full",children:C});const N=P.containerStyle,O=P.color||"blue",M=N==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${P.containerClassName||R[O]||R.blue}`:"",G=c.jsxs(c.Fragment,{children:[P.label&&c.jsxs("label",{htmlFor:P.name,className:"block text-sm font-medium mb-1",children:[P.label,P.required&&c.jsx("span",{className:"text-red-500 ml-1","aria-hidden":"true",children:"*"})]}),c.jsx("div",{children:z.cloneElement(C,{"aria-describedby":_?F:void 0,"aria-invalid":!!_,"aria-required":P.required})}),P.description&&c.jsx("p",{className:"text-xs mt-1.5 text-gray-400",children:P.description}),_&&c.jsx("p",{id:F,className:"text-sm text-red-500 mt-1",role:"alert",children:_})]});return c.jsx("div",{className:"mb-4",children:N==="card"?c.jsx("div",{className:M,children:G}):G})}const D=C=>{if(C.showIf&&!C.showIf(d))return null;const P=T[C.type]||ia;if(d[C.name]===void 0){const N=C.type==="multiselect"||C.type==="searchselect"||C.type==="checkbox"&&C.options&&C.options.length>0;d[C.name]=C.value!==void 0?C.value:N?[]:""}const _=g[C.name]?g[C.name]:null,F=typeof C.disabled=="function"?C.disabled(d):!!C.disabled;return j(c.jsx(P,{field:C,formValues:d,handleChange:x,handleBlur:()=>$(C.name),setCharCounts:S,charCount:b[C.name]||0,api_URL:t,error:_,fileInputRefs:k,disabled:F,apiClient:e}),C,_)};return c.jsxs("form",{onSubmit:W,className:"grid grid-cols-12 gap-x-4 mx-auto w-full  ",children:[r?r.fields.filter(C=>C).map(C=>c.jsx("div",{className:`${C.class||"col-span-full"} `,children:D(C)},C.name+C.type)):c.jsx("div",{children:"Loading..."}),c.jsx("div",{className:n==="sticky"?"absolute col-span-full w-full bottom-0  bg-white py-4 flex justify-end gap-2 z-50":"col-span-full mt-4 flex justify-end gap-2",children:z.Children.map(a,C=>z.isValidElement(C)&&C.props.onClick?z.cloneElement(C,{onClick:P=>{C.props.onClick(d,P)}}):C)})]})};me.DynamicForm=Ii,me.default=Ii,Object.defineProperties(me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));