ynotsoft-dynamic-form 1.0.78 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamic-form.js +3107 -2768
- package/dist/dynamic-form.umd.cjs +43 -46
- package/dist/index.css +1 -1
- package/package.json +7 -2
|
@@ -1,128 +1,125 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
${
|
|
1
|
+
(function(ce,l){typeof exports=="object"&&typeof module<"u"?l(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"],l):(ce=typeof globalThis<"u"?globalThis:ce||self,l(ce.YnotsoftDynamicForm={},ce.jsxRuntime,ce.React,ce.ReactHotToast,ce.dayjs,ce.ReactSelect,ce.ReactSelectAnimated,ce.ReactDOM,ce.TiptapReact,ce.StarterKit,ce.Underline$1,ce.CharacterCount,ce.ReactDayPicker))})(this,(function(ce,l,U,Wt,Fn,bi,vi,Go,Yo,yi,wi,xi,$n){"use strict";function qo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=qo(U),jt=qo(Go);function Si(e){return l.jsx("input",{type:"hidden",name:e.name,value:e.value},e.name)}function Ci({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=e.disabled&&typeof e.disabled=="function"?e.disabled(t):e.disabled,i=s||a,c=e.options||[],d=vi(),f=t[e.name]||e.value||[],p=m=>Array.isArray(m)&&m.length>0&&typeof m[0]=="object"&&m[0]!==null&&"value"in m[0];let g;return p(f)?g=f:g=f.filter(m=>m!=null).map(m=>c.find(w=>w.value===m)).filter(m=>m!==void 0),l.jsx("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:l.jsx(bi,{components:d,isMulti:!0,isDisabled:i,name:e.label,value:g,onChange:m=>{const w=m.map(h=>h.value);n(e.name,w)},options:c,placeholder:e.placeholder,closeMenuOnSelect:!1,onBlur:()=>o(e.name),classNamePrefix:"react-select",classNames:{control:m=>`!rounded-lg !min-h-[42px] transition duration-150 !shadow-sm
|
|
2
|
+
${r?"!border-red-500":"!border-gray-300"}
|
|
3
3
|
${i?"!bg-gray-100 !cursor-not-allowed":"!bg-white"}
|
|
4
4
|
${!i&&m.isFocused?"!border-blue-500 ring-2 ring-blue-200":""}
|
|
5
|
-
${!i&&!m.isFocused&&!
|
|
5
|
+
${!i&&!m.isFocused&&!r?"hover:!border-gray-400":""}
|
|
6
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:m=>`!py-2 !px-3 !text-sm !cursor-pointer
|
|
7
7
|
${m.isSelected?"!bg-blue-500 !text-white":""}
|
|
8
8
|
${m.isFocused&&!m.isSelected?"!bg-gray-100 !text-gray-800":""}
|
|
9
|
-
`}})})}const
|
|
9
|
+
`}})})}const Ei=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ai=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),Ko=e=>{const t=Ai(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xo=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),Ni=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ki={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 Ti=U.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:s,iconNode:a,...i},c)=>U.createElement("svg",{ref:c,...ki,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Xo("lucide",r),...!s&&!Ni(i)&&{"aria-hidden":"true"},...i},[...a.map(([d,f])=>U.createElement(d,f)),...Array.isArray(s)?s:[s]]));const re=(e,t)=>{const n=U.forwardRef(({className:o,...r},s)=>U.createElement(Ti,{ref:s,iconNode:t,className:Xo(`lucide-${Ei(Ko(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Ko(e),n};const _i=re("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 Pi=re("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Zo=re("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Oi=re("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 Ii=re("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Mi=re("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 Li=re("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Di=re("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 Fi=re("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const $i=re("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 zi=re("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 Ri=re("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 Bi=re("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 Ui=re("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 Hi=re("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 Wi=re("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 ji=re("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Vi=re("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 Gi=re("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 Yi=re("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const qi=re("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 Ki=re("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 Xi=re("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 Zi=re("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Qi({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s,apiClient:a}){const i=s||e.disabled&&(typeof e.disabled=="function"?e.disabled(t):e.disabled),c=e.selectMode!=="multiple",[d,f]=U.useState([]),[p,g]=U.useState(!1),[m,w]=U.useState(!1),[h,y]=U.useState(""),[C,E]=U.useState({}),A=U.useRef(null),x=U.useRef(null),T=U.useRef(null),L=t[e.name],P=L==null||L===""?[]:(Array.isArray(L)?L:[L]).map(S=>{const k=d.find(_=>_.value===S);return k||(C[S]?C[S]:{value:S,label:S})}),H=U.useCallback(async(b="")=>{if(e.onSearch&&typeof e.onSearch=="function"){const S=await e.onSearch(b,t);f(S);return}if(!e.optionsUrl||!a){if(e.options&&Array.isArray(e.options)){const S=e.options.map(k=>({value:k[e.valueId||"value"]||k.value||k.id,label:k[e.labelId||"label"]||k.label||k.name}));if(!b)f(S);else{const k=b.toLowerCase(),_=S.filter(O=>String(O.label).toLowerCase().includes(k));f(_)}}else f([]);return}g(!0);try{const S=e.searchParam||"search",k=e.optionsUrl.includes("?")?"&":"?",_=`${e.optionsUrl}${k}${S}=${encodeURIComponent(b)}`,O=await a(_),N=O.data||O,te=(Array.isArray(N)?N:[]).map(j=>({value:j[e.valueId||"value"]||j.value||j.id,label:j[e.labelId||"label"]||j.label||j.name}));f(te)}catch(S){console.error("Search failed:",S),f([])}finally{g(!1)}},[e,a,t]),W=b=>{const S=b.target.value;y(S),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>H(S),300)};U.useEffect(()=>{m&&(h===""?H(""):(d.length===0||!e.optionsUrl&&!a&&!e.onSearch)&&H(h),setTimeout(()=>x.current?.focus(),50))},[m]),U.useEffect(()=>{const b=S=>{A.current&&!A.current.contains(S.target)&&(w(!1),y(""),o(e.name))};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[e.name,o]);const B=b=>{E(k=>({...k,[b.value]:b}));let S;if(c)S=b.value,w(!1);else{const k=Array.isArray(L)?L:[];S=k.includes(b.value)?k.filter(O=>O!==b.value):[...k,b.value]}console.log("Selected value(s) for field",e.name,":",S),n(e.name,S),e.clearSearchOnSelect&&y("")},V=(b,S)=>{if(b.stopPropagation(),c)n(e.name,null);else{const k=Array.isArray(L)?L:[];n(e.name,k.filter(_=>_!==S))}};return l.jsxs("div",{className:`mb-4 relative ${e.fieldClass||"col-span-full"}`,ref:A,children:[l.jsxs("div",{onClick:()=>!i&&w(!m),className:`
|
|
10
10
|
w-full min-h-[42px] px-3 py-2 border rounded-lg bg-white cursor-pointer
|
|
11
11
|
flex items-center flex-wrap gap-2
|
|
12
|
-
${
|
|
12
|
+
${r?"border-red-500":"border-gray-300 hover:border-gray-400"}
|
|
13
13
|
${m?"ring-2 ring-blue-100 border-blue-500":""}
|
|
14
14
|
${i?"bg-gray-100 opacity-60 cursor-not-allowed":""}
|
|
15
|
-
`,children:[_.length>0?_.map(g=>l.jsxs("span",{className:"inline-flex items-center px-2 py-1 bg-blue-50 text-blue-700 text-sm rounded-md border border-blue-100",children:[g.label,!i&&l.jsx("button",{type:"button",onClick:S=>j(S,g.value),className:"ml-1 p-0.5 hover:bg-blue-200 rounded-full",children:l.jsx(Di,{className:"w-3 h-3"})})]},g.value)):l.jsx("span",{className:"text-gray-400 text-sm",children:e.placeholder||"Select..."}),l.jsxs("div",{className:"ml-auto flex items-center",children:[p&&l.jsx(Ii,{className:"w-4 h-4 mr-2 animate-spin text-gray-400"}),l.jsx(qr,{className:`w-4 h-4 text-gray-400 transition-transform ${m?"rotate-180":""}`})]})]}),m&&!i&&l.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-xl overflow-hidden",children:[l.jsx("div",{className:"p-2 border-b border-gray-100 bg-gray-50",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx(Mi,{className:"absolute left-3 w-4 h-4 text-gray-400"}),l.jsx("input",{ref:x,type:"text",value:h,onChange:H,className:"w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500",placeholder:"Type to search..."})]})}),l.jsx("div",{className:"max-h-60 overflow-y-auto p-1",children:d.length>0?d.map(g=>{const S=_.some(T=>T.value===g.value);return l.jsxs("div",{onClick:()=>B(g),className:`px-3 py-2 text-sm rounded cursor-pointer flex items-center justify-between ${S?"bg-blue-50 text-blue-700":"hover:bg-gray-100 text-gray-700"}`,children:[l.jsx("span",{children:g.label}),S&&l.jsx(Ai,{className:"w-4 h-4"})]},g.value)}):l.jsx("div",{className:"py-4 text-center text-sm text-gray-500",children:p?"Loading...":"No results found"})})]})]})}function Xr(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function tt(e,t=[]){let n=[];function r(s,a){const i=u.createContext(a),c=n.length;n=[...n,a];const d=p=>{const{scope:b,children:m,...w}=p,h=b?.[e]?.[c]||i,y=u.useMemo(()=>w,Object.values(w));return l.jsx(h.Provider,{value:y,children:m})};d.displayName=s+"Provider";function f(p,b){const m=b?.[e]?.[c]||i,w=u.useContext(m);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,f]}const o=()=>{const s=n.map(a=>u.createContext(a));return function(i){const c=i?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,Fi(o,...t)]}function Fi(...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:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...i,...p}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Zr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Zr(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():Zr(e[o],null)}}}}function oe(...e){return u.useCallback(Rn(...e),e)}function ye(e){const t=$i(e),n=u.forwardRef((r,o)=>{const{children:s,...a}=r,i=u.Children.toArray(s),c=i.find(zi);if(c){const d=c.props.children,f=i.map(p=>p===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...a,ref:o,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function $i(e){const t=u.forwardRef((n,r)=>{const{children:o,...s}=n;if(u.isValidElement(o)){const a=Ui(o),i=Bi(s,o.props);return o.type!==u.Fragment&&(i.ref=r?Rn(r,a):a),u.cloneElement(o,i)}return u.Children.count(o)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ri=Symbol("radix.slottable");function zi(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ri}function Bi(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 c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ui(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 Qr(e){const t=e+"CollectionProvider",[n,r]=tt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:y,children:C}=h,E=W.useRef(null),A=W.useRef(new Map).current;return l.jsx(o,{scope:y,itemMap:A,collectionRef:E,children:C})};a.displayName=t;const i=e+"CollectionSlot",c=ye(i),d=W.forwardRef((h,y)=>{const{scope:C,children:E}=h,A=s(i,C),x=oe(y,A.collectionRef);return l.jsx(c,{ref:x,children:E})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",b=ye(f),m=W.forwardRef((h,y)=>{const{scope:C,children:E,...A}=h,x=W.useRef(null),k=oe(y,x),D=s(f,C);return W.useEffect(()=>(D.itemMap.set(x,{ref:x,...A}),()=>void D.itemMap.delete(x))),l.jsx(b,{[p]:"",ref:k,children:E})});m.displayName=f;function w(h){const y=s(e+"CollectionConsumer",h);return W.useCallback(()=>{const E=y.collectionRef.current;if(!E)return[];const A=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((D,I)=>A.indexOf(D.ref.current)-A.indexOf(I.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:d,ItemSlot:m},w,r]}var Wi=u.createContext(void 0);function zn(e){const t=u.useContext(Wi);return e||t||"ltr"}var Hi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jr=Hi.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vi(e,t){e&&Vt.flushSync(()=>e.dispatchEvent(t))}function Ye(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>t.current?.(...n),[])}function ji(e,t=globalThis?.document){const n=Ye(e);u.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 Gi="DismissableLayer",Bn="dismissableLayer.update",Yi="dismissableLayer.pointerDownOutside",Ki="dismissableLayer.focusOutside",eo,to=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Un=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,d=u.useContext(to),[f,p]=u.useState(null),b=f?.ownerDocument??globalThis?.document,[,m]=u.useState({}),w=oe(t,I=>p(I)),h=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=h.indexOf(y),E=f?h.indexOf(f):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,x=E>=C,k=Zi(I=>{const _=I.target,U=[...d.branches].some(H=>H.contains(_));!x||U||(o?.(I),a?.(I),I.defaultPrevented||i?.())},b),D=Qi(I=>{const _=I.target;[...d.branches].some(H=>H.contains(_))||(s?.(I),a?.(I),I.defaultPrevented||i?.())},b);return ji(I=>{E===d.layers.size-1&&(r?.(I),!I.defaultPrevented&&i&&(I.preventDefault(),i()))},b),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(eo=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),no(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=eo)}},[f,b,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),no())},[f,d]),u.useEffect(()=>{const I=()=>m({});return document.addEventListener(Bn,I),()=>document.removeEventListener(Bn,I)},[]),l.jsx(Jr.div,{...c,ref:w,style:{pointerEvents:A?x?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,D.onFocusCapture),onBlurCapture:X(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,k.onPointerDownCapture)})});Un.displayName=Gi;var qi="DismissableLayerBranch",Xi=u.forwardRef((e,t)=>{const n=u.useContext(to),r=u.useRef(null),o=oe(t,r);return u.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Jr.div,{...e,ref:o})});Xi.displayName=qi;function Zi(e,t=globalThis?.document){const n=Ye(e),r=u.useRef(!1),o=u.useRef(()=>{});return u.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let c=function(){ro(Yi,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Qi(e,t=globalThis?.document){const n=Ye(e),r=u.useRef(!1);return u.useEffect(()=>{const o=s=>{s.target&&!r.current&&ro(Ki,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 no(){const e=new CustomEvent(Bn);document.dispatchEvent(e)}function ro(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?Vi(o,s):o.dispatchEvent(s)}var Wn=0;function oo(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??so()),document.body.insertAdjacentElement("beforeend",e[1]??so()),Wn++,()=>{Wn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wn--}},[])}function so(){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 Ji=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],el=Ji.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Hn="focusScope.autoFocusOnMount",Vn="focusScope.autoFocusOnUnmount",ao={bubbles:!1,cancelable:!0},tl="FocusScope",jn=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,c]=u.useState(null),d=Ye(o),f=Ye(s),p=u.useRef(null),b=oe(t,h=>c(h)),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let h=function(A){if(m.paused||!i)return;const x=A.target;i.contains(x)?p.current=x:Ke(p.current,{select:!0})},y=function(A){if(m.paused||!i)return;const x=A.relatedTarget;x!==null&&(i.contains(x)||Ke(p.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const k of A)k.removedNodes.length>0&&Ke(i)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const E=new MutationObserver(C);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),E.disconnect()}}},[r,i,m.paused]),u.useEffect(()=>{if(i){co.add(m);const h=document.activeElement;if(!i.contains(h)){const C=new CustomEvent(Hn,ao);i.addEventListener(Hn,d),i.dispatchEvent(C),C.defaultPrevented||(nl(il(io(i)),{select:!0}),document.activeElement===h&&Ke(i))}return()=>{i.removeEventListener(Hn,d),setTimeout(()=>{const C=new CustomEvent(Vn,ao);i.addEventListener(Vn,f),i.dispatchEvent(C),C.defaultPrevented||Ke(h??document.body,{select:!0}),i.removeEventListener(Vn,f),co.remove(m)},0)}}},[i,d,f,m]);const w=u.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,C=document.activeElement;if(y&&C){const E=h.currentTarget,[A,x]=rl(E);A&&x?!h.shiftKey&&C===x?(h.preventDefault(),n&&Ke(A,{select:!0})):h.shiftKey&&C===A&&(h.preventDefault(),n&&Ke(x,{select:!0})):C===E&&h.preventDefault()}},[n,r,m.paused]);return l.jsx(el.div,{tabIndex:-1,...a,ref:b,onKeyDown:w})});jn.displayName=tl;function nl(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ke(r,{select:t}),document.activeElement!==n)return}function rl(e){const t=io(e),n=lo(t,e),r=lo(t.reverse(),e);return[n,r]}function io(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 lo(e,t){for(const n of e)if(!ol(n,{upTo:t}))return n}function ol(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 sl(e){return e instanceof HTMLInputElement&&"select"in e}function Ke(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&sl(e)&&t&&e.select()}}var co=al();function al(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=uo(e,t),e.unshift(t)},remove(t){e=uo(e,t),e[0]?.resume()}}}function uo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function il(e){return e.filter(t=>t.tagName!=="A")}var fe=globalThis?.document?u.useLayoutEffect:()=>{},ll=u[" useId ".trim().toString()]||(()=>{}),cl=0;function Tt(e){const[t,n]=u.useState(ll());return fe(()=>{n(r=>r??String(cl++))},[e]),e||(t?`radix-${t}`:"")}const dl=["top","right","bottom","left"],qe=Math.min,xe=Math.max,jt=Math.round,Gt=Math.floor,Me=e=>({x:e,y:e}),ul={left:"right",right:"left",bottom:"top",top:"bottom"},fl={start:"end",end:"start"};function Gn(e,t,n){return xe(e,qe(t,n))}function Ue(e,t){return typeof e=="function"?e(t):e}function We(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Yn(e){return e==="x"?"y":"x"}function Kn(e){return e==="y"?"height":"width"}const pl=new Set(["top","bottom"]);function De(e){return pl.has(We(e))?"y":"x"}function qn(e){return Yn(De(e))}function ml(e,t,n){n===void 0&&(n=!1);const r=ct(e),o=qn(e),s=Kn(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Yt(a)),[a,Yt(a)]}function hl(e){const t=Yt(e);return[Xn(e),t,Xn(t)]}function Xn(e){return e.replace(/start|end/g,t=>fl[t])}const fo=["left","right"],po=["right","left"],gl=["top","bottom"],bl=["bottom","top"];function vl(e,t,n){switch(e){case"top":case"bottom":return n?t?po:fo:t?fo:po;case"left":case"right":return t?gl:bl;default:return[]}}function yl(e,t,n,r){const o=ct(e);let s=vl(We(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(Xn)))),s}function Yt(e){return e.replace(/left|right|bottom|top/g,t=>ul[t])}function wl(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e!="number"?wl(e):{top:e,right:e,bottom:e,left:e}}function Kt(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 ho(e,t,n){let{reference:r,floating:o}=e;const s=De(t),a=qn(t),i=Kn(a),c=We(t),d=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,b=r[i]/2-o[i]/2;let m;switch(c){case"top":m={x:f,y:r.y-o.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-o.width,y:p};break;default:m={x:r.x,y:r.y}}switch(ct(t)){case"start":m[a]-=b*(n&&d?-1:1);break;case"end":m[a]+=b*(n&&d?-1:1);break}return m}const xl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=ho(d,r,c),b=r,m={},w=0;for(let h=0;h<i.length;h++){const{name:y,fn:C}=i[h],{x:E,y:A,data:x,reset:k}=await C({x:f,y:p,initialPlacement:r,placement:b,strategy:o,middlewareData:m,rects:d,platform:a,elements:{reference:e,floating:t}});f=E??f,p=A??p,m={...m,[y]:{...m[y],...x}},k&&w<=50&&(w++,typeof k=="object"&&(k.placement&&(b=k.placement),k.rects&&(d=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:f,y:p}=ho(d,b,c)),h=-1)}return{x:f,y:p,placement:b,strategy:o,middlewareData:m}};async function kt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:b=!1,padding:m=0}=Ue(t,e),w=mo(m),y=i[b?p==="floating"?"reference":"floating":p],C=Kt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),E=p==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),x=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},k=Kt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:E,offsetParent:A,strategy:c}):E);return{top:(C.top-k.top+w.top)/x.y,bottom:(k.bottom-C.bottom+w.bottom)/x.y,left:(C.left-k.left+w.left)/x.x,right:(k.right-C.right+w.right)/x.x}}const Sl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=Ue(e,t)||{};if(d==null)return{};const p=mo(f),b={x:n,y:r},m=qn(o),w=Kn(m),h=await a.getDimensions(d),y=m==="y",C=y?"top":"left",E=y?"bottom":"right",A=y?"clientHeight":"clientWidth",x=s.reference[w]+s.reference[m]-b[m]-s.floating[w],k=b[m]-s.reference[m],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let I=D?D[A]:0;(!I||!await(a.isElement==null?void 0:a.isElement(D)))&&(I=i.floating[A]||s.floating[w]);const _=x/2-k/2,U=I/2-h[w]/2-1,H=qe(p[C],U),B=qe(p[E],U),j=H,g=I-h[w]-B,S=I/2-h[w]/2+_,T=Gn(j,S,g),P=!c.arrow&&ct(o)!=null&&S!==T&&s.reference[w]/2-(S<j?H:B)-h[w]/2<0,O=P?S<j?S-j:S-g:0;return{[m]:b[m]+O,data:{[m]:T,centerOffset:S-T-O,...P&&{alignmentOffset:O}},reset:P}}}),Cl=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:c,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:h=!0,...y}=Ue(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=We(o),E=De(i),A=We(i)===i,x=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=b||(A||!h?[Yt(i)]:hl(i)),D=w!=="none";!b&&D&&k.push(...yl(i,h,w,x));const I=[i,...k],_=await kt(t,y),U=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&U.push(_[C]),p){const S=ml(o,a,x);U.push(_[S[0]],_[S[1]])}if(H=[...H,{placement:o,overflows:U}],!U.every(S=>S<=0)){var B,j;const S=(((B=s.flip)==null?void 0:B.index)||0)+1,T=I[S];if(T&&(!(p==="alignment"?E!==De(T):!1)||H.every(N=>De(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:S,overflows:H},reset:{placement:T}};let P=(j=H.filter(O=>O.overflows[0]<=0).sort((O,N)=>O.overflows[1]-N.overflows[1])[0])==null?void 0:j.placement;if(!P)switch(m){case"bestFit":{var g;const O=(g=H.filter(N=>{if(D){const q=De(N.placement);return q===E||q==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((N,q)=>N[1]-q[1])[0])==null?void 0:g[0];O&&(P=O);break}case"initialPlacement":P=i;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function go(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bo(e){return dl.some(t=>e[t]>=0)}const El=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ue(e,t);switch(r){case"referenceHidden":{const s=await kt(t,{...o,elementContext:"reference"}),a=go(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bo(a)}}}case"escaped":{const s=await kt(t,{...o,altBoundary:!0}),a=go(s,n.floating);return{data:{escapedOffsets:a,escaped:bo(a)}}}default:return{}}}}},vo=new Set(["left","top"]);async function Al(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=We(n),i=ct(n),c=De(n)==="y",d=vo.has(a)?-1:1,f=s&&c?-1:1,p=Ue(t,e);let{mainAxis:b,crossAxis:m,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof w=="number"&&(m=i==="end"?w*-1:w),c?{x:m*f,y:b*d}:{x:b*d,y:m*f}}const Nl=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,c=await Al(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:a}}}}},Tl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:y=>{let{x:C,y:E}=y;return{x:C,y:E}}},...c}=Ue(e,t),d={x:n,y:r},f=await kt(t,c),p=De(We(o)),b=Yn(p);let m=d[b],w=d[p];if(s){const y=b==="y"?"top":"left",C=b==="y"?"bottom":"right",E=m+f[y],A=m-f[C];m=Gn(E,m,A)}if(a){const y=p==="y"?"top":"left",C=p==="y"?"bottom":"right",E=w+f[y],A=w-f[C];w=Gn(E,w,A)}const h=i.fn({...t,[b]:m,[p]:w});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[b]:s,[p]:a}}}}}},kl=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:c=!0,crossAxis:d=!0}=Ue(e,t),f={x:n,y:r},p=De(o),b=Yn(p);let m=f[b],w=f[p];const h=Ue(i,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const A=b==="y"?"height":"width",x=s.reference[b]-s.floating[A]+y.mainAxis,k=s.reference[b]+s.reference[A]-y.mainAxis;m<x?m=x:m>k&&(m=k)}if(d){var C,E;const A=b==="y"?"width":"height",x=vo.has(We(o)),k=s.reference[p]-s.floating[A]+(x&&((C=a.offset)==null?void 0:C[p])||0)+(x?0:y.crossAxis),D=s.reference[p]+s.reference[A]+(x?0:((E=a.offset)==null?void 0:E[p])||0)-(x?y.crossAxis:0);w<k?w=k:w>D&&(w=D)}return{[b]:m,[p]:w}}}},Pl=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:c=()=>{},...d}=Ue(e,t),f=await kt(t,d),p=We(o),b=ct(o),m=De(o)==="y",{width:w,height:h}=s.floating;let y,C;p==="top"||p==="bottom"?(y=p,C=b===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(C=p,y=b==="end"?"top":"bottom");const E=h-f.top-f.bottom,A=w-f.left-f.right,x=qe(h-f[y],E),k=qe(w-f[C],A),D=!t.middlewareData.shift;let I=x,_=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=A),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=E),D&&!b){const H=xe(f.left,0),B=xe(f.right,0),j=xe(f.top,0),g=xe(f.bottom,0);m?_=w-2*(H!==0||B!==0?H+B:xe(f.left,f.right)):I=h-2*(j!==0||g!==0?j+g:xe(f.top,f.bottom))}await c({...t,availableWidth:_,availableHeight:I});const U=await a.getDimensions(i.floating);return w!==U.width||h!==U.height?{reset:{rects:!0}}:{}}}};function qt(){return typeof window<"u"}function dt(e){return yo(e)?(e.nodeName||"").toLowerCase():"#document"}function Se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){var t;return(t=(yo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yo(e){return qt()?e instanceof Node||e instanceof Se(e).Node:!1}function ke(e){return qt()?e instanceof Element||e instanceof Se(e).Element:!1}function Fe(e){return qt()?e instanceof HTMLElement||e instanceof Se(e).HTMLElement:!1}function wo(e){return!qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Se(e).ShadowRoot}const _l=new Set(["inline","contents"]);function Pt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_l.has(o)}const Ol=new Set(["table","td","th"]);function Il(e){return Ol.has(dt(e))}const Ml=[":popover-open",":modal"];function Xt(e){return Ml.some(t=>{try{return e.matches(t)}catch{return!1}})}const Dl=["transform","translate","scale","rotate","perspective"],Ll=["transform","translate","scale","rotate","perspective","filter"],Fl=["paint","layout","strict","content"];function Zn(e){const t=Qn(),n=ke(e)?Pe(e):e;return Dl.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ll.some(r=>(n.willChange||"").includes(r))||Fl.some(r=>(n.contain||"").includes(r))}function $l(e){let t=Xe(e);for(;Fe(t)&&!ut(t);){if(Zn(t))return t;if(Xt(t))return null;t=Xe(t)}return null}function Qn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rl=new Set(["html","body","#document"]);function ut(e){return Rl.has(dt(e))}function Pe(e){return Se(e).getComputedStyle(e)}function Zt(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xe(e){if(dt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wo(e)&&e.host||Le(e);return wo(t)?t.host:t}function xo(e){const t=Xe(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(t)&&Pt(t)?t:xo(t)}function _t(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xo(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=Se(o);if(s){const i=Jn(a);return t.concat(a,a.visualViewport||[],Pt(o)?o:[],i&&n?_t(i):[])}return t.concat(o,_t(o,[],n))}function Jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function So(e){const t=Pe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Fe(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=jt(n)!==s||jt(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function er(e){return ke(e)?e:e.contextElement}function ft(e){const t=er(e);if(!Fe(t))return Me(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=So(t);let a=(s?jt(n.width):n.width)/r,i=(s?jt(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const zl=Me(0);function Co(e){const t=Se(e);return!Qn()||!t.visualViewport?zl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Se(e)?!1:t}function nt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=er(e);let a=Me(1);t&&(r?ke(r)&&(a=ft(r)):a=ft(e));const i=Bl(s,n,r)?Co(s):Me(0);let c=(o.left+i.x)/a.x,d=(o.top+i.y)/a.y,f=o.width/a.x,p=o.height/a.y;if(s){const b=Se(s),m=r&&ke(r)?Se(r):r;let w=b,h=Jn(w);for(;h&&r&&m!==w;){const y=ft(h),C=h.getBoundingClientRect(),E=Pe(h),A=C.left+(h.clientLeft+parseFloat(E.paddingLeft))*y.x,x=C.top+(h.clientTop+parseFloat(E.paddingTop))*y.y;c*=y.x,d*=y.y,f*=y.x,p*=y.y,c+=A,d+=x,w=Se(h),h=Jn(w)}}return Kt({width:f,height:p,x:c,y:d})}function Qt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:nt(Le(e)).left+n}function Eo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Qt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ul(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Le(r),i=t?Xt(t.floating):!1;if(r===a||i&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Me(1);const f=Me(0),p=Fe(r);if((p||!p&&!s)&&((dt(r)!=="body"||Pt(a))&&(c=Zt(r)),Fe(r))){const m=nt(r);d=ft(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const b=a&&!p&&!s?Eo(a,c):Me(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+b.x,y:n.y*d.y-c.scrollTop*d.y+f.y+b.y}}function Wl(e){return Array.from(e.getClientRects())}function Hl(e){const t=Le(e),n=Zt(e),r=e.ownerDocument.body,o=xe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=xe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Qt(e);const i=-n.scrollTop;return Pe(r).direction==="rtl"&&(a+=xe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}const Ao=25;function Vl(e,t){const n=Se(e),r=Le(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,c=0;if(o){s=o.width,a=o.height;const f=Qn();(!f||f&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}const d=Qt(r);if(d<=0){const f=r.ownerDocument,p=f.body,b=getComputedStyle(p),m=f.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(r.clientWidth-p.clientWidth-m);w<=Ao&&(s-=w)}else d<=Ao&&(s+=d);return{width:s,height:a,x:i,y:c}}const jl=new Set(["absolute","fixed"]);function Gl(e,t){const n=nt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Fe(e)?ft(e):Me(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=o*s.x,d=r*s.y;return{width:a,height:i,x:c,y:d}}function No(e,t,n){let r;if(t==="viewport")r=Vl(e,n);else if(t==="document")r=Hl(Le(e));else if(ke(t))r=Gl(t,n);else{const o=Co(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Kt(r)}function To(e,t){const n=Xe(e);return n===t||!ke(n)||ut(n)?!1:Pe(n).position==="fixed"||To(n,t)}function Yl(e,t){const n=t.get(e);if(n)return n;let r=_t(e,[],!1).filter(i=>ke(i)&&dt(i)!=="body"),o=null;const s=Pe(e).position==="fixed";let a=s?Xe(e):e;for(;ke(a)&&!ut(a);){const i=Pe(a),c=Zn(a);!c&&i.position==="fixed"&&(o=null),(s?!c&&!o:!c&&i.position==="static"&&!!o&&jl.has(o.position)||Pt(a)&&!c&&To(e,a))?r=r.filter(f=>f!==a):o=i,a=Xe(a)}return t.set(e,r),r}function Kl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Xt(t)?[]:Yl(t,this._c):[].concat(n),r],i=a[0],c=a.reduce((d,f)=>{const p=No(t,f,o);return d.top=xe(p.top,d.top),d.right=qe(p.right,d.right),d.bottom=qe(p.bottom,d.bottom),d.left=xe(p.left,d.left),d},No(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ql(e){const{width:t,height:n}=So(e);return{width:t,height:n}}function Xl(e,t,n){const r=Fe(t),o=Le(t),s=n==="fixed",a=nt(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=Me(0);function d(){c.x=Qt(o)}if(r||!r&&!s)if((dt(t)!=="body"||Pt(o))&&(i=Zt(t)),r){const m=nt(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&d();s&&!r&&o&&d();const f=o&&!r&&!s?Eo(o,i):Me(0),p=a.left+i.scrollLeft-c.x-f.x,b=a.top+i.scrollTop-c.y-f.y;return{x:p,y:b,width:a.width,height:a.height}}function tr(e){return Pe(e).position==="static"}function ko(e,t){if(!Fe(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function Po(e,t){const n=Se(e);if(Xt(e))return n;if(!Fe(e)){let o=Xe(e);for(;o&&!ut(o);){if(ke(o)&&!tr(o))return o;o=Xe(o)}return n}let r=ko(e,t);for(;r&&Il(r)&&tr(r);)r=ko(r,t);return r&&ut(r)&&tr(r)&&!Zn(r)?n:r||$l(e)||n}const Zl=async function(e){const t=this.getOffsetParent||Po,n=this.getDimensions,r=await n(e.floating);return{reference:Xl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ql(e){return Pe(e).direction==="rtl"}const Jl={convertOffsetParentRelativeRectToViewportRelativeRect:Ul,getDocumentElement:Le,getClippingRect:Kl,getOffsetParent:Po,getElementRects:Zl,getClientRects:Wl,getDimensions:ql,getScale:ft,isElement:ke,isRTL:Ql};function _o(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ec(e,t){let n=null,r;const o=Le(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:b,height:m}=d;if(i||t(),!b||!m)return;const w=Gt(p),h=Gt(o.clientWidth-(f+b)),y=Gt(o.clientHeight-(p+m)),C=Gt(f),A={rootMargin:-w+"px "+-h+"px "+-y+"px "+-C+"px",threshold:xe(0,qe(1,c))||1};let x=!0;function k(D){const I=D[0].intersectionRatio;if(I!==c){if(!x)return a();I?a(!1,I):r=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!_o(d,e.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(k,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,A)}n.observe(e)}return a(!0),s}function tc(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:c=!1}=r,d=er(e),f=o||s?[...d?_t(d):[],..._t(t)]:[];f.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const p=d&&i?ec(d,n):null;let b=-1,m=null;a&&(m=new ResizeObserver(C=>{let[E]=C;E&&E.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=m)==null||A.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let w,h=c?nt(e):null;c&&y();function y(){const C=nt(e);h&&!_o(h,C)&&n(),h=C,w=requestAnimationFrame(y)}return n(),()=>{var C;f.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),p?.(),(C=m)==null||C.disconnect(),m=null,c&&cancelAnimationFrame(w)}}const nc=Nl,rc=Tl,oc=Cl,sc=Pl,ac=El,Oo=Sl,ic=kl,lc=(e,t,n)=>{const r=new Map,o={platform:Jl,...n},s={...o.platform,_c:r};return xl(e,t,{...o,platform:s})};var cc=typeof document<"u",dc=function(){},Jt=cc?W.useLayoutEffect:dc;function en(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(!en(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)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Io(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mo(e,t){const n=Io(e);return Math.round(t*n)/n}function nr(e){const t=u.useRef(e);return Jt(()=>{t.current=e}),t}function uc(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:c,open:d}=e,[f,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,m]=u.useState(r);en(b,r)||m(r);const[w,h]=u.useState(null),[y,C]=u.useState(null),E=u.useCallback(N=>{N!==D.current&&(D.current=N,h(N))},[]),A=u.useCallback(N=>{N!==I.current&&(I.current=N,C(N))},[]),x=s||w,k=a||y,D=u.useRef(null),I=u.useRef(null),_=u.useRef(f),U=c!=null,H=nr(c),B=nr(o),j=nr(d),g=u.useCallback(()=>{if(!D.current||!I.current)return;const N={placement:t,strategy:n,middleware:b};B.current&&(N.platform=B.current),lc(D.current,I.current,N).then(q=>{const te={...q,isPositioned:j.current!==!1};S.current&&!en(_.current,te)&&(_.current=te,Vt.flushSync(()=>{p(te)}))})},[b,t,n,B,j]);Jt(()=>{d===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(N=>({...N,isPositioned:!1})))},[d]);const S=u.useRef(!1);Jt(()=>(S.current=!0,()=>{S.current=!1}),[]),Jt(()=>{if(x&&(D.current=x),k&&(I.current=k),x&&k){if(H.current)return H.current(x,k,g);g()}},[x,k,g,H,U]);const T=u.useMemo(()=>({reference:D,floating:I,setReference:E,setFloating:A}),[E,A]),P=u.useMemo(()=>({reference:x,floating:k}),[x,k]),O=u.useMemo(()=>{const N={position:n,left:0,top:0};if(!P.floating)return N;const q=Mo(P.floating,f.x),te=Mo(P.floating,f.y);return i?{...N,transform:"translate("+q+"px, "+te+"px)",...Io(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:te}},[n,i,P.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:g,refs:T,elements:P,floatingStyles:O}),[f,g,T,P,O])}const fc=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?Oo({element:r.current,padding:o}).fn(n):{}:r?Oo({element:r,padding:o}).fn(n):{}}}},pc=(e,t)=>({...nc(e),options:[e,t]}),mc=(e,t)=>({...rc(e),options:[e,t]}),hc=(e,t)=>({...ic(e),options:[e,t]}),gc=(e,t)=>({...oc(e),options:[e,t]}),bc=(e,t)=>({...sc(e),options:[e,t]}),vc=(e,t)=>({...ac(e),options:[e,t]}),yc=(e,t)=>({...fc(e),options:[e,t]});var wc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xc=wc.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Sc="Arrow",Do=u.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(xc.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Do.displayName=Sc;var Cc=Do,Ec=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lo=Ec.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fo(e){const[t,n]=u.useState(void 0);return fe(()=>{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 c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.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 rr="Popper",[$o,tn]=tt(rr),[Ac,Ro]=$o(rr),zo=e=>{const{__scopePopper:t,children:n}=e,[r,o]=u.useState(null);return l.jsx(Ac,{scope:t,anchor:r,onAnchorChange:o,children:n})};zo.displayName=rr;var Bo="PopperAnchor",Uo=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Ro(Bo,n),a=u.useRef(null),i=oe(t,a),c=u.useRef(null);return u.useEffect(()=>{const d=c.current;c.current=r?.current||a.current,d!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(Lo.div,{...o,ref:i})});Uo.displayName=Bo;var or="PopperContent",[Nc,Tc]=$o(or),Wo=u.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:m="optimized",onPlaced:w,...h}=e,y=Ro(or,n),[C,E]=u.useState(null),A=oe(t,L=>E(L)),[x,k]=u.useState(null),D=Fo(x),I=D?.width??0,_=D?.height??0,U=r+(s!=="center"?"-"+s:""),H=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(d)?d:[d],j=B.length>0,g={padding:H,boundary:B.filter(Pc),altBoundary:j},{refs:S,floatingStyles:T,placement:P,isPositioned:O,middlewareData:N}=uc({strategy:"fixed",placement:U,whileElementsMounted:(...L)=>tc(...L,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[pc({mainAxis:o+_,alignmentAxis:a}),c&&mc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?hc():void 0,...g}),c&&gc({...g}),bc({...g,apply:({elements:L,rects:J,availableWidth:ae,availableHeight:Z})=>{const{width:ee,height:ne}=J.reference,ce=L.floating.style;ce.setProperty("--radix-popper-available-width",`${ae}px`),ce.setProperty("--radix-popper-available-height",`${Z}px`),ce.setProperty("--radix-popper-anchor-width",`${ee}px`),ce.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),x&&yc({element:x,padding:i}),_c({arrowWidth:I,arrowHeight:_}),b&&vc({strategy:"referenceHidden",...g})]}),[q,te]=jo(P),V=Ye(w);fe(()=>{O&&V?.()},[O,V]);const Ae=N.arrow?.x,Y=N.arrow?.y,re=N.arrow?.centerOffset!==0,[Q,pe]=u.useState();return fe(()=>{C&&pe(window.getComputedStyle(C).zIndex)},[C]),l.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:O?T.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:l.jsx(Nc,{scope:n,placedSide:q,onArrowChange:k,arrowX:Ae,arrowY:Y,shouldHideArrow:re,children:l.jsx(Lo.div,{"data-side":q,"data-align":te,...h,ref:A,style:{...h.style,animation:O?void 0:"none"}})})})});Wo.displayName=or;var Ho="PopperArrow",kc={top:"bottom",right:"left",bottom:"top",left:"right"},Vo=u.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Tc(Ho,r),a=kc[s.placedSide];return l.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:l.jsx(Cc,{...o,ref:n,style:{...o.style,display:"block"}})})});Vo.displayName=Ho;function Pc(e){return e!==null}var _c=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,c=a?0:e.arrowHeight,[d,f]=jo(n),p={start:"0%",center:"50%",end:"100%"}[f],b=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+c/2;let w="",h="";return d==="bottom"?(w=a?p:`${b}px`,h=`${-c}px`):d==="top"?(w=a?p:`${b}px`,h=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,h=a?p:`${m}px`):d==="left"&&(w=`${r.floating.width+c}px`,h=a?p:`${m}px`),{data:{x:w,y:h}}}});function jo(e){const[t,n="center"]=e.split("-");return[t,n]}var Go=zo,sr=Uo,Yo=Wo,Ko=Vo,Oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ic=Oc.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Mc="Portal",ar=u.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=u.useState(!1);fe(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?jr.createPortal(l.jsx(Ic.div,{...r,ref:t}),a):null});ar.displayName=Mc;var Dc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=Dc.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Lc=u[" useInsertionEffect ".trim().toString()]||fe;function Ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=Fc({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${r} is changing from ${p?"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.`),f.current=i},[i,r])}const d=u.useCallback(f=>{if(i){const p=$c(f)?f(e):f;p!==e&&a.current?.(p)}else s(f)},[i,e,s,a]);return[c,d]}function Fc({defaultProp:e,onChange:t}){const[n,r]=u.useState(e),o=u.useRef(n),s=u.useRef(t);return Lc(()=>{s.current=t},[t]),u.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function $c(e){return typeof e=="function"}function qo(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Rc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zc=Rc.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Xo=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"}),Bc="VisuallyHidden",Uc=u.forwardRef((e,t)=>l.jsx(zc.span,{...e,ref:t,style:{...Xo,...e.style}}));Uc.displayName=Bc;var Wc=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pt=new WeakMap,nn=new WeakMap,rn={},ir=0,Zo=function(e){return e&&(e.host||Zo(e.parentNode))},Hc=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Zo(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})},Vc=function(e,t,n,r){var o=Hc(t,Array.isArray(e)?e:[e]);rn[n]||(rn[n]=new WeakMap);var s=rn[n],a=[],i=new Set,c=new Set(o),d=function(p){!p||i.has(p)||(i.add(p),d(p.parentNode))};o.forEach(d);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(b){if(i.has(b))f(b);else try{var m=b.getAttribute(r),w=m!==null&&m!=="false",h=(pt.get(b)||0)+1,y=(s.get(b)||0)+1;pt.set(b,h),s.set(b,y),a.push(b),h===1&&w&&nn.set(b,!0),y===1&&b.setAttribute(n,"true"),w||b.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return f(t),i.clear(),ir++,function(){a.forEach(function(p){var b=pt.get(p)-1,m=s.get(p)-1;pt.set(p,b),s.set(p,m),b||(nn.has(p)||p.removeAttribute(r),nn.delete(p)),m||p.removeAttribute(n)}),ir--,ir||(pt=new WeakMap,pt=new WeakMap,nn=new WeakMap,rn={})}},Qo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Wc(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Vc(r,o,n,"aria-hidden")):function(){return null}},$e=function(){return $e=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},$e.apply(this,arguments)};function Jo(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 jc(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 on="right-scroll-bar-position",sn="width-before-scroll-bar",Gc="with-scroll-bars-hidden",Yc="--removed-body-scroll-bar-size";function lr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Kc(e,t){var n=W.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 qc=typeof window<"u"?u.useLayoutEffect:u.useEffect,es=new WeakMap;function Xc(e,t){var n=Kc(null,function(r){return e.forEach(function(o){return lr(o,r)})});return qc(function(){var r=es.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||lr(i,null)}),s.forEach(function(i){o.has(i)||lr(i,a)})}es.set(n,e)},[e]),n}function Zc(e){return e}function Qc(e,t){t===void 0&&(t=Zc);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 c=function(){var f=a;a=[],f.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return o}function Jc(e){e===void 0&&(e={});var t=Qc(null);return t.options=$e({async:!0,ssr:!1},e),t}var ts=function(e){var t=e.sideCar,n=Jo(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 u.createElement(r,$e({},n))};ts.isSideCarExport=!0;function ed(e,t){return e.useMedium(t),ts}var ns=Jc(),cr=function(){},an=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:cr,onWheelCapture:cr,onTouchMoveCapture:cr}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,b=e.sideCar,m=e.noRelative,w=e.noIsolation,h=e.inert,y=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,A=e.gapMode,x=Jo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=b,D=Xc([n,t]),I=$e($e({},x),o);return u.createElement(u.Fragment,null,f&&u.createElement(k,{sideCar:ns,removeScrollBar:d,shards:p,noRelative:m,noIsolation:w,inert:h,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:A}),a?u.cloneElement(u.Children.only(i),$e($e({},I),{ref:D})):u.createElement(E,$e({},I,{className:c,ref:D}),i))});an.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},an.classNames={fullWidth:sn,zeroRight:on};var td=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=td();return t&&e.setAttribute("nonce",t),e}function rd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function od(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sd=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nd())&&(rd(t,n),od(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ad=function(){var e=sd();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rs=function(){var e=ad(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},id={left:0,top:0,right:0,gap:0},dr=function(e){return parseInt(e||"",10)||0},ld=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[dr(n),dr(r),dr(o)]},cd=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return id;var t=ld(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])}},dd=rs(),mt="data-scroll-locked",ud=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
16
|
-
.`.concat(
|
|
17
|
-
overflow: hidden `).concat(
|
|
18
|
-
padding-right: `).concat(i,"px ").concat(
|
|
15
|
+
`,children:[P.length>0?P.map(b=>l.jsxs("span",{className:"inline-flex items-center px-2 py-1 bg-blue-50 text-blue-700 text-sm rounded-md border border-blue-100",children:[b.label,!i&&l.jsx("button",{type:"button",onClick:S=>V(S,b.value),className:"ml-1 p-0.5 hover:bg-blue-200 rounded-full",children:l.jsx(Zi,{className:"w-3 h-3"})})]},b.value)):l.jsx("span",{className:"text-gray-400 text-sm",children:e.placeholder||"Select..."}),l.jsxs("div",{className:"ml-auto flex items-center",children:[p&&l.jsx(ji,{className:"w-4 h-4 mr-2 animate-spin text-gray-400"}),l.jsx(Zo,{className:`w-4 h-4 text-gray-400 transition-transform ${m?"rotate-180":""}`})]})]}),m&&!i&&l.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-xl overflow-hidden",children:[l.jsx("div",{className:"p-2 border-b border-gray-100 bg-gray-50",children:l.jsxs("div",{className:"relative flex items-center",children:[l.jsx(Yi,{className:"absolute left-3 w-4 h-4 text-gray-400"}),l.jsx("input",{ref:x,type:"text",value:h,onChange:W,className:"w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500",placeholder:"Type to search..."})]})}),l.jsx("div",{className:"max-h-60 overflow-y-auto p-1",children:d.length>0?d.map(b=>{const S=P.some(k=>k.value===b.value);return l.jsxs("div",{onClick:()=>B(b),className:`px-3 py-2 text-sm rounded cursor-pointer flex items-center justify-between ${S?"bg-blue-50 text-blue-700":"hover:bg-gray-100 text-gray-700"}`,children:[l.jsx("span",{children:b.label}),S&&l.jsx(Pi,{className:"w-4 h-4"})]},b.value)}):l.jsx("div",{className:"py-4 text-center text-sm text-gray-500",children:p?"Loading...":"No results found"})})]})]})}function Qo(e,[t,n]){return Math.min(n,Math.max(t,e))}function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function tt(e,t=[]){let n=[];function o(s,a){const i=u.createContext(a),c=n.length;n=[...n,a];const d=p=>{const{scope:g,children:m,...w}=p,h=g?.[e]?.[c]||i,y=u.useMemo(()=>w,Object.values(w));return l.jsx(h.Provider,{value:y,children:m})};d.displayName=s+"Provider";function f(p,g){const m=g?.[e]?.[c]||i,w=u.useContext(m);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,f]}const r=()=>{const s=n.map(a=>u.createContext(a));return function(i){const c=i?.[e]||s;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return r.scopeName=e,[o,Ji(r,...t)]}function Ji(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const a=o.reduce((i,{useScope:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...i,...p}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Jo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zn(...e){return t=>{let n=!1;const o=e.map(r=>{const s=Jo(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():Jo(e[r],null)}}}}function se(...e){return u.useCallback(zn(...e),e)}function we(e){const t=el(e),n=u.forwardRef((o,r)=>{const{children:s,...a}=o,i=u.Children.toArray(s),c=i.find(nl);if(c){const d=c.props.children,f=i.map(p=>p===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...a,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function el(e){const t=u.forwardRef((n,o)=>{const{children:r,...s}=n;if(u.isValidElement(r)){const a=rl(r),i=ol(s,r.props);return r.type!==u.Fragment&&(i.ref=o?zn(o,a):a),u.cloneElement(r,i)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tl=Symbol("radix.slottable");function nl(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tl}function ol(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...i)=>{const c=s(...i);return r(...i),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function rl(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 er(e){const t=e+"CollectionProvider",[n,o]=tt(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:y,children:C}=h,E=U.useRef(null),A=U.useRef(new Map).current;return l.jsx(r,{scope:y,itemMap:A,collectionRef:E,children:C})};a.displayName=t;const i=e+"CollectionSlot",c=we(i),d=U.forwardRef((h,y)=>{const{scope:C,children:E}=h,A=s(i,C),x=se(y,A.collectionRef);return l.jsx(c,{ref:x,children:E})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=we(f),m=U.forwardRef((h,y)=>{const{scope:C,children:E,...A}=h,x=U.useRef(null),T=se(y,x),L=s(f,C);return U.useEffect(()=>(L.itemMap.set(x,{ref:x,...A}),()=>void L.itemMap.delete(x))),l.jsx(g,{[p]:"",ref:T,children:E})});m.displayName=f;function w(h){const y=s(e+"CollectionConsumer",h);return U.useCallback(()=>{const E=y.collectionRef.current;if(!E)return[];const A=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((L,I)=>A.indexOf(L.ref.current)-A.indexOf(I.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:d,ItemSlot:m},w,o]}var sl=u.createContext(void 0);function Rn(e){const t=u.useContext(sl);return e||t||"ltr"}var al=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tr=al.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function il(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}function Ye(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>t.current?.(...n),[])}function ll(e,t=globalThis?.document){const n=Ye(e);u.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var cl="DismissableLayer",Bn="dismissableLayer.update",dl="dismissableLayer.pointerDownOutside",ul="dismissableLayer.focusOutside",nr,or=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Un=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,d=u.useContext(or),[f,p]=u.useState(null),g=f?.ownerDocument??globalThis?.document,[,m]=u.useState({}),w=se(t,I=>p(I)),h=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=h.indexOf(y),E=f?h.indexOf(f):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,x=E>=C,T=ml(I=>{const P=I.target,H=[...d.branches].some(W=>W.contains(P));!x||H||(r?.(I),a?.(I),I.defaultPrevented||i?.())},g),L=hl(I=>{const P=I.target;[...d.branches].some(W=>W.contains(P))||(s?.(I),a?.(I),I.defaultPrevented||i?.())},g);return ll(I=>{E===d.layers.size-1&&(o?.(I),!I.defaultPrevented&&i&&(I.preventDefault(),i()))},g),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(nr=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),rr(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=nr)}},[f,g,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),rr())},[f,d]),u.useEffect(()=>{const I=()=>m({});return document.addEventListener(Bn,I),()=>document.removeEventListener(Bn,I)},[]),l.jsx(tr.div,{...c,ref:w,style:{pointerEvents:A?x?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,L.onFocusCapture),onBlurCapture:X(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,T.onPointerDownCapture)})});Un.displayName=cl;var fl="DismissableLayerBranch",pl=u.forwardRef((e,t)=>{const n=u.useContext(or),o=u.useRef(null),r=se(t,o);return u.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(tr.div,{...e,ref:r})});pl.displayName=fl;function ml(e,t=globalThis?.document){const n=Ye(e),o=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const s=i=>{if(i.target&&!o.current){let c=function(){sr(dl,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function hl(e,t=globalThis?.document){const n=Ye(e),o=u.useRef(!1);return u.useEffect(()=>{const r=s=>{s.target&&!o.current&&sr(ul,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function rr(){const e=new CustomEvent(Bn);document.dispatchEvent(e)}function sr(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?il(r,s):r.dispatchEvent(s)}var Hn=0;function ar(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ir()),document.body.insertAdjacentElement("beforeend",e[1]??ir()),Hn++,()=>{Hn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hn--}},[])}function ir(){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 gl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bl=gl.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Wn="focusScope.autoFocusOnMount",jn="focusScope.autoFocusOnUnmount",lr={bubbles:!1,cancelable:!0},vl="FocusScope",Vn=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[i,c]=u.useState(null),d=Ye(r),f=Ye(s),p=u.useRef(null),g=se(t,h=>c(h)),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let h=function(A){if(m.paused||!i)return;const x=A.target;i.contains(x)?p.current=x:qe(p.current,{select:!0})},y=function(A){if(m.paused||!i)return;const x=A.relatedTarget;x!==null&&(i.contains(x)||qe(p.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const T of A)T.removedNodes.length>0&&qe(i)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const E=new MutationObserver(C);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),E.disconnect()}}},[o,i,m.paused]),u.useEffect(()=>{if(i){ur.add(m);const h=document.activeElement;if(!i.contains(h)){const C=new CustomEvent(Wn,lr);i.addEventListener(Wn,d),i.dispatchEvent(C),C.defaultPrevented||(yl(El(cr(i)),{select:!0}),document.activeElement===h&&qe(i))}return()=>{i.removeEventListener(Wn,d),setTimeout(()=>{const C=new CustomEvent(jn,lr);i.addEventListener(jn,f),i.dispatchEvent(C),C.defaultPrevented||qe(h??document.body,{select:!0}),i.removeEventListener(jn,f),ur.remove(m)},0)}}},[i,d,f,m]);const w=u.useCallback(h=>{if(!n&&!o||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,C=document.activeElement;if(y&&C){const E=h.currentTarget,[A,x]=wl(E);A&&x?!h.shiftKey&&C===x?(h.preventDefault(),n&&qe(A,{select:!0})):h.shiftKey&&C===A&&(h.preventDefault(),n&&qe(x,{select:!0})):C===E&&h.preventDefault()}},[n,o,m.paused]);return l.jsx(bl.div,{tabIndex:-1,...a,ref:g,onKeyDown:w})});Vn.displayName=vl;function yl(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(qe(o,{select:t}),document.activeElement!==n)return}function wl(e){const t=cr(e),n=dr(t,e),o=dr(t.reverse(),e);return[n,o]}function cr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dr(e,t){for(const n of e)if(!xl(n,{upTo:t}))return n}function xl(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 Sl(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Sl(e)&&t&&e.select()}}var ur=Cl();function Cl(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fr(e,t),e.unshift(t)},remove(t){e=fr(e,t),e[0]?.resume()}}}function fr(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function El(e){return e.filter(t=>t.tagName!=="A")}var me=globalThis?.document?u.useLayoutEffect:()=>{},Al=u[" useId ".trim().toString()]||(()=>{}),Nl=0;function kt(e){const[t,n]=u.useState(Al());return me(()=>{n(o=>o??String(Nl++))},[e]),e||(t?`radix-${t}`:"")}const kl=["top","right","bottom","left"],Ke=Math.min,Se=Math.max,Vt=Math.round,Gt=Math.floor,Me=e=>({x:e,y:e}),Tl={left:"right",right:"left",bottom:"top",top:"bottom"},_l={start:"end",end:"start"};function Gn(e,t,n){return Se(e,Ke(t,n))}function Ue(e,t){return typeof e=="function"?e(t):e}function He(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Yn(e){return e==="x"?"y":"x"}function qn(e){return e==="y"?"height":"width"}const Pl=new Set(["top","bottom"]);function Le(e){return Pl.has(He(e))?"y":"x"}function Kn(e){return Yn(Le(e))}function Ol(e,t,n){n===void 0&&(n=!1);const o=ct(e),r=Kn(e),s=qn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Yt(a)),[a,Yt(a)]}function Il(e){const t=Yt(e);return[Xn(e),t,Xn(t)]}function Xn(e){return e.replace(/start|end/g,t=>_l[t])}const pr=["left","right"],mr=["right","left"],Ml=["top","bottom"],Ll=["bottom","top"];function Dl(e,t,n){switch(e){case"top":case"bottom":return n?t?mr:pr:t?pr:mr;case"left":case"right":return t?Ml:Ll;default:return[]}}function Fl(e,t,n,o){const r=ct(e);let s=Dl(He(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(Xn)))),s}function Yt(e){return e.replace(/left|right|bottom|top/g,t=>Tl[t])}function $l(e){return{top:0,right:0,bottom:0,left:0,...e}}function hr(e){return typeof e!="number"?$l(e):{top:e,right:e,bottom:e,left:e}}function qt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function gr(e,t,n){let{reference:o,floating:r}=e;const s=Le(t),a=Kn(t),i=qn(a),c=He(t),d=s==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,g=o[i]/2-r[i]/2;let m;switch(c){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:p};break;case"left":m={x:o.x-r.width,y:p};break;default:m={x:o.x,y:o.y}}switch(ct(t)){case"start":m[a]-=g*(n&&d?-1:1);break;case"end":m[a]+=g*(n&&d?-1:1);break}return m}const zl=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:p}=gr(d,o,c),g=o,m={},w=0;for(let h=0;h<i.length;h++){const{name:y,fn:C}=i[h],{x:E,y:A,data:x,reset:T}=await C({x:f,y:p,initialPlacement:o,placement:g,strategy:r,middlewareData:m,rects:d,platform:a,elements:{reference:e,floating:t}});f=E??f,p=A??p,m={...m,[y]:{...m[y],...x}},T&&w<=50&&(w++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(d=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):T.rects),{x:f,y:p}=gr(d,g,c)),h=-1)}return{x:f,y:p,placement:g,strategy:r,middlewareData:m}};async function Tt(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:m=0}=Ue(t,e),w=hr(m),y=i[g?p==="floating"?"reference":"floating":p],C=qt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),E=p==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),x=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},T=qt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:E,offsetParent:A,strategy:c}):E);return{top:(C.top-T.top+w.top)/x.y,bottom:(T.bottom-C.bottom+w.bottom)/x.y,left:(C.left-T.left+w.left)/x.x,right:(T.right-C.right+w.right)/x.x}}const Rl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=Ue(e,t)||{};if(d==null)return{};const p=hr(f),g={x:n,y:o},m=Kn(r),w=qn(m),h=await a.getDimensions(d),y=m==="y",C=y?"top":"left",E=y?"bottom":"right",A=y?"clientHeight":"clientWidth",x=s.reference[w]+s.reference[m]-g[m]-s.floating[w],T=g[m]-s.reference[m],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let I=L?L[A]:0;(!I||!await(a.isElement==null?void 0:a.isElement(L)))&&(I=i.floating[A]||s.floating[w]);const P=x/2-T/2,H=I/2-h[w]/2-1,W=Ke(p[C],H),B=Ke(p[E],H),V=W,b=I-h[w]-B,S=I/2-h[w]/2+P,k=Gn(V,S,b),_=!c.arrow&&ct(r)!=null&&S!==k&&s.reference[w]/2-(S<V?W:B)-h[w]/2<0,O=_?S<V?S-V:S-b:0;return{[m]:g[m]+O,data:{[m]:k,centerOffset:S-k-O,..._&&{alignmentOffset:O}},reset:_}}}),Bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:h=!0,...y}=Ue(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=He(r),E=Le(i),A=He(i)===i,x=await(c.isRTL==null?void 0:c.isRTL(d.floating)),T=g||(A||!h?[Yt(i)]:Il(i)),L=w!=="none";!g&&L&&T.push(...Fl(i,h,w,x));const I=[i,...T],P=await Tt(t,y),H=[];let W=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&H.push(P[C]),p){const S=Ol(r,a,x);H.push(P[S[0]],P[S[1]])}if(W=[...W,{placement:r,overflows:H}],!H.every(S=>S<=0)){var B,V;const S=(((B=s.flip)==null?void 0:B.index)||0)+1,k=I[S];if(k&&(!(p==="alignment"?E!==Le(k):!1)||W.every(N=>Le(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:S,overflows:W},reset:{placement:k}};let _=(V=W.filter(O=>O.overflows[0]<=0).sort((O,N)=>O.overflows[1]-N.overflows[1])[0])==null?void 0:V.placement;if(!_)switch(m){case"bestFit":{var b;const O=(b=W.filter(N=>{if(L){const K=Le(N.placement);return K===E||K==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(K=>K>0).reduce((K,te)=>K+te,0)]).sort((N,K)=>N[1]-K[1])[0])==null?void 0:b[0];O&&(_=O);break}case"initialPlacement":_=i;break}if(r!==_)return{reset:{placement:_}}}return{}}}};function br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vr(e){return kl.some(t=>e[t]>=0)}const Ul=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Ue(e,t);switch(o){case"referenceHidden":{const s=await Tt(t,{...r,elementContext:"reference"}),a=br(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vr(a)}}}case"escaped":{const s=await Tt(t,{...r,altBoundary:!0}),a=br(s,n.floating);return{data:{escapedOffsets:a,escaped:vr(a)}}}default:return{}}}}},yr=new Set(["left","top"]);async function Hl(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=He(n),i=ct(n),c=Le(n)==="y",d=yr.has(a)?-1:1,f=s&&c?-1:1,p=Ue(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof w=="number"&&(m=i==="end"?w*-1:w),c?{x:m*f,y:g*d}:{x:g*d,y:m*f}}const Wl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:i}=t,c=await Hl(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(o=i.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:a}}}}},jl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:y=>{let{x:C,y:E}=y;return{x:C,y:E}}},...c}=Ue(e,t),d={x:n,y:o},f=await Tt(t,c),p=Le(He(r)),g=Yn(p);let m=d[g],w=d[p];if(s){const y=g==="y"?"top":"left",C=g==="y"?"bottom":"right",E=m+f[y],A=m-f[C];m=Gn(E,m,A)}if(a){const y=p==="y"?"top":"left",C=p==="y"?"bottom":"right",E=w+f[y],A=w-f[C];w=Gn(E,w,A)}const h=i.fn({...t,[g]:m,[p]:w});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[g]:s,[p]:a}}}}}},Vl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:d=!0}=Ue(e,t),f={x:n,y:o},p=Le(r),g=Yn(p);let m=f[g],w=f[p];const h=Ue(i,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const A=g==="y"?"height":"width",x=s.reference[g]-s.floating[A]+y.mainAxis,T=s.reference[g]+s.reference[A]-y.mainAxis;m<x?m=x:m>T&&(m=T)}if(d){var C,E;const A=g==="y"?"width":"height",x=yr.has(He(r)),T=s.reference[p]-s.floating[A]+(x&&((C=a.offset)==null?void 0:C[p])||0)+(x?0:y.crossAxis),L=s.reference[p]+s.reference[A]+(x?0:((E=a.offset)==null?void 0:E[p])||0)-(x?y.crossAxis:0);w<T?w=T:w>L&&(w=L)}return{[g]:m,[p]:w}}}},Gl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...d}=Ue(e,t),f=await Tt(t,d),p=He(r),g=ct(r),m=Le(r)==="y",{width:w,height:h}=s.floating;let y,C;p==="top"||p==="bottom"?(y=p,C=g===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(C=p,y=g==="end"?"top":"bottom");const E=h-f.top-f.bottom,A=w-f.left-f.right,x=Ke(h-f[y],E),T=Ke(w-f[C],A),L=!t.middlewareData.shift;let I=x,P=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=A),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(I=E),L&&!g){const W=Se(f.left,0),B=Se(f.right,0),V=Se(f.top,0),b=Se(f.bottom,0);m?P=w-2*(W!==0||B!==0?W+B:Se(f.left,f.right)):I=h-2*(V!==0||b!==0?V+b:Se(f.top,f.bottom))}await c({...t,availableWidth:P,availableHeight:I});const H=await a.getDimensions(i.floating);return w!==H.width||h!==H.height?{reset:{rects:!0}}:{}}}};function Kt(){return typeof window<"u"}function dt(e){return wr(e)?(e.nodeName||"").toLowerCase():"#document"}function Ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function De(e){var t;return(t=(wr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wr(e){return Kt()?e instanceof Node||e instanceof Ce(e).Node:!1}function Te(e){return Kt()?e instanceof Element||e instanceof Ce(e).Element:!1}function Fe(e){return Kt()?e instanceof HTMLElement||e instanceof Ce(e).HTMLElement:!1}function xr(e){return!Kt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ce(e).ShadowRoot}const Yl=new Set(["inline","contents"]);function _t(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=_e(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Yl.has(r)}const ql=new Set(["table","td","th"]);function Kl(e){return ql.has(dt(e))}const Xl=[":popover-open",":modal"];function Xt(e){return Xl.some(t=>{try{return e.matches(t)}catch{return!1}})}const Zl=["transform","translate","scale","rotate","perspective"],Ql=["transform","translate","scale","rotate","perspective","filter"],Jl=["paint","layout","strict","content"];function Zn(e){const t=Qn(),n=Te(e)?_e(e):e;return Zl.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ql.some(o=>(n.willChange||"").includes(o))||Jl.some(o=>(n.contain||"").includes(o))}function ec(e){let t=Xe(e);for(;Fe(t)&&!ut(t);){if(Zn(t))return t;if(Xt(t))return null;t=Xe(t)}return null}function Qn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tc=new Set(["html","body","#document"]);function ut(e){return tc.has(dt(e))}function _e(e){return Ce(e).getComputedStyle(e)}function Zt(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xe(e){if(dt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xr(e)&&e.host||De(e);return xr(t)?t.host:t}function Sr(e){const t=Xe(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(t)&&_t(t)?t:Sr(t)}function Pt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Sr(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=Ce(r);if(s){const i=Jn(a);return t.concat(a,a.visualViewport||[],_t(r)?r:[],i&&n?Pt(i):[])}return t.concat(r,Pt(r,[],n))}function Jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cr(e){const t=_e(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Fe(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,i=Vt(n)!==s||Vt(o)!==a;return i&&(n=s,o=a),{width:n,height:o,$:i}}function eo(e){return Te(e)?e:e.contextElement}function ft(e){const t=eo(e);if(!Fe(t))return Me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Cr(t);let a=(s?Vt(n.width):n.width)/o,i=(s?Vt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const nc=Me(0);function Er(e){const t=Ce(e);return!Qn()||!t.visualViewport?nc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ce(e)?!1:t}function nt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=eo(e);let a=Me(1);t&&(o?Te(o)&&(a=ft(o)):a=ft(e));const i=oc(s,n,o)?Er(s):Me(0);let c=(r.left+i.x)/a.x,d=(r.top+i.y)/a.y,f=r.width/a.x,p=r.height/a.y;if(s){const g=Ce(s),m=o&&Te(o)?Ce(o):o;let w=g,h=Jn(w);for(;h&&o&&m!==w;){const y=ft(h),C=h.getBoundingClientRect(),E=_e(h),A=C.left+(h.clientLeft+parseFloat(E.paddingLeft))*y.x,x=C.top+(h.clientTop+parseFloat(E.paddingTop))*y.y;c*=y.x,d*=y.y,f*=y.x,p*=y.y,c+=A,d+=x,w=Ce(h),h=Jn(w)}}return qt({width:f,height:p,x:c,y:d})}function Qt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:nt(De(e)).left+n}function Ar(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Qt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function rc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=De(o),i=t?Xt(t.floating):!1;if(o===a||i&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Me(1);const f=Me(0),p=Fe(o);if((p||!p&&!s)&&((dt(o)!=="body"||_t(a))&&(c=Zt(o)),Fe(o))){const m=nt(o);d=ft(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const g=a&&!p&&!s?Ar(a,c):Me(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-c.scrollTop*d.y+f.y+g.y}}function sc(e){return Array.from(e.getClientRects())}function ac(e){const t=De(e),n=Zt(e),o=e.ownerDocument.body,r=Se(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Se(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Qt(e);const i=-n.scrollTop;return _e(o).direction==="rtl"&&(a+=Se(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:i}}const Nr=25;function ic(e,t){const n=Ce(e),o=De(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,i=0,c=0;if(r){s=r.width,a=r.height;const f=Qn();(!f||f&&t==="fixed")&&(i=r.offsetLeft,c=r.offsetTop)}const d=Qt(o);if(d<=0){const f=o.ownerDocument,p=f.body,g=getComputedStyle(p),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(o.clientWidth-p.clientWidth-m);w<=Nr&&(s-=w)}else d<=Nr&&(s+=d);return{width:s,height:a,x:i,y:c}}const lc=new Set(["absolute","fixed"]);function cc(e,t){const n=nt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Fe(e)?ft(e):Me(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=r*s.x,d=o*s.y;return{width:a,height:i,x:c,y:d}}function kr(e,t,n){let o;if(t==="viewport")o=ic(e,n);else if(t==="document")o=ac(De(e));else if(Te(t))o=cc(t,n);else{const r=Er(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return qt(o)}function Tr(e,t){const n=Xe(e);return n===t||!Te(n)||ut(n)?!1:_e(n).position==="fixed"||Tr(n,t)}function dc(e,t){const n=t.get(e);if(n)return n;let o=Pt(e,[],!1).filter(i=>Te(i)&&dt(i)!=="body"),r=null;const s=_e(e).position==="fixed";let a=s?Xe(e):e;for(;Te(a)&&!ut(a);){const i=_e(a),c=Zn(a);!c&&i.position==="fixed"&&(r=null),(s?!c&&!r:!c&&i.position==="static"&&!!r&&lc.has(r.position)||_t(a)&&!c&&Tr(e,a))?o=o.filter(f=>f!==a):r=i,a=Xe(a)}return t.set(e,o),o}function uc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Xt(t)?[]:dc(t,this._c):[].concat(n),o],i=a[0],c=a.reduce((d,f)=>{const p=kr(t,f,r);return d.top=Se(p.top,d.top),d.right=Ke(p.right,d.right),d.bottom=Ke(p.bottom,d.bottom),d.left=Se(p.left,d.left),d},kr(t,i,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fc(e){const{width:t,height:n}=Cr(e);return{width:t,height:n}}function pc(e,t,n){const o=Fe(t),r=De(t),s=n==="fixed",a=nt(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=Me(0);function d(){c.x=Qt(r)}if(o||!o&&!s)if((dt(t)!=="body"||_t(r))&&(i=Zt(t)),o){const m=nt(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&d();s&&!o&&r&&d();const f=r&&!o&&!s?Ar(r,i):Me(0),p=a.left+i.scrollLeft-c.x-f.x,g=a.top+i.scrollTop-c.y-f.y;return{x:p,y:g,width:a.width,height:a.height}}function to(e){return _e(e).position==="static"}function _r(e,t){if(!Fe(e)||_e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return De(e)===n&&(n=n.ownerDocument.body),n}function Pr(e,t){const n=Ce(e);if(Xt(e))return n;if(!Fe(e)){let r=Xe(e);for(;r&&!ut(r);){if(Te(r)&&!to(r))return r;r=Xe(r)}return n}let o=_r(e,t);for(;o&&Kl(o)&&to(o);)o=_r(o,t);return o&&ut(o)&&to(o)&&!Zn(o)?n:o||ec(e)||n}const mc=async function(e){const t=this.getOffsetParent||Pr,n=this.getDimensions,o=await n(e.floating);return{reference:pc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function hc(e){return _e(e).direction==="rtl"}const gc={convertOffsetParentRelativeRectToViewportRelativeRect:rc,getDocumentElement:De,getClippingRect:uc,getOffsetParent:Pr,getElementRects:mc,getClientRects:sc,getDimensions:fc,getScale:ft,isElement:Te,isRTL:hc};function Or(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bc(e,t){let n=null,o;const r=De(e);function s(){var i;clearTimeout(o),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:g,height:m}=d;if(i||t(),!g||!m)return;const w=Gt(p),h=Gt(r.clientWidth-(f+g)),y=Gt(r.clientHeight-(p+m)),C=Gt(f),A={rootMargin:-w+"px "+-h+"px "+-y+"px "+-C+"px",threshold:Se(0,Ke(1,c))||1};let x=!0;function T(L){const I=L[0].intersectionRatio;if(I!==c){if(!x)return a();I?a(!1,I):o=setTimeout(()=>{a(!1,1e-7)},1e3)}I===1&&!Or(d,e.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(T,{...A,root:r.ownerDocument})}catch{n=new IntersectionObserver(T,A)}n.observe(e)}return a(!0),s}function vc(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=eo(e),f=r||s?[...d?Pt(d):[],...Pt(t)]:[];f.forEach(C=>{r&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const p=d&&i?bc(d,n):null;let g=-1,m=null;a&&(m=new ResizeObserver(C=>{let[E]=C;E&&E.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=m)==null||A.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let w,h=c?nt(e):null;c&&y();function y(){const C=nt(e);h&&!Or(h,C)&&n(),h=C,w=requestAnimationFrame(y)}return n(),()=>{var C;f.forEach(E=>{r&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),p?.(),(C=m)==null||C.disconnect(),m=null,c&&cancelAnimationFrame(w)}}const yc=Wl,wc=jl,xc=Bl,Sc=Gl,Cc=Ul,Ir=Rl,Ec=Vl,Ac=(e,t,n)=>{const o=new Map,r={platform:gc,...n},s={...r.platform,_c:o};return zl(e,t,{...r,platform:s})};var Nc=typeof document<"u",kc=function(){},Jt=Nc?U.useLayoutEffect:kc;function en(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!en(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Mr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lr(e,t){const n=Mr(e);return Math.round(t*n)/n}function no(e){const t=u.useRef(e);return Jt(()=>{t.current=e}),t}function Tc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[f,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,m]=u.useState(o);en(g,o)||m(o);const[w,h]=u.useState(null),[y,C]=u.useState(null),E=u.useCallback(N=>{N!==L.current&&(L.current=N,h(N))},[]),A=u.useCallback(N=>{N!==I.current&&(I.current=N,C(N))},[]),x=s||w,T=a||y,L=u.useRef(null),I=u.useRef(null),P=u.useRef(f),H=c!=null,W=no(c),B=no(r),V=no(d),b=u.useCallback(()=>{if(!L.current||!I.current)return;const N={placement:t,strategy:n,middleware:g};B.current&&(N.platform=B.current),Ac(L.current,I.current,N).then(K=>{const te={...K,isPositioned:V.current!==!1};S.current&&!en(P.current,te)&&(P.current=te,jt.flushSync(()=>{p(te)}))})},[g,t,n,B,V]);Jt(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(N=>({...N,isPositioned:!1})))},[d]);const S=u.useRef(!1);Jt(()=>(S.current=!0,()=>{S.current=!1}),[]),Jt(()=>{if(x&&(L.current=x),T&&(I.current=T),x&&T){if(W.current)return W.current(x,T,b);b()}},[x,T,b,W,H]);const k=u.useMemo(()=>({reference:L,floating:I,setReference:E,setFloating:A}),[E,A]),_=u.useMemo(()=>({reference:x,floating:T}),[x,T]),O=u.useMemo(()=>{const N={position:n,left:0,top:0};if(!_.floating)return N;const K=Lr(_.floating,f.x),te=Lr(_.floating,f.y);return i?{...N,transform:"translate("+K+"px, "+te+"px)",...Mr(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:te}},[n,i,_.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:b,refs:k,elements:_,floatingStyles:O}),[f,b,k,_,O])}const _c=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Ir({element:o.current,padding:r}).fn(n):{}:o?Ir({element:o,padding:r}).fn(n):{}}}},Pc=(e,t)=>({...yc(e),options:[e,t]}),Oc=(e,t)=>({...wc(e),options:[e,t]}),Ic=(e,t)=>({...Ec(e),options:[e,t]}),Mc=(e,t)=>({...xc(e),options:[e,t]}),Lc=(e,t)=>({...Sc(e),options:[e,t]}),Dc=(e,t)=>({...Cc(e),options:[e,t]}),Fc=(e,t)=>({..._c(e),options:[e,t]});var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zc=$c.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Rc="Arrow",Dr=u.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return l.jsx(zc.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dr.displayName=Rc;var Bc=Dr,Uc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fr=Uc.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function $r(e){const[t,n]=u.useState(void 0);return me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var oo="Popper",[zr,tn]=tt(oo),[Hc,Rr]=zr(oo),Br=e=>{const{__scopePopper:t,children:n}=e,[o,r]=u.useState(null);return l.jsx(Hc,{scope:t,anchor:o,onAnchorChange:r,children:n})};Br.displayName=oo;var Ur="PopperAnchor",Hr=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Rr(Ur,n),a=u.useRef(null),i=se(t,a),c=u.useRef(null);return u.useEffect(()=>{const d=c.current;c.current=o?.current||a.current,d!==c.current&&s.onAnchorChange(c.current)}),o?null:l.jsx(Fr.div,{...r,ref:i})});Hr.displayName=Ur;var ro="PopperContent",[Wc,jc]=zr(ro),Wr=u.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:w,...h}=e,y=Rr(ro,n),[C,E]=u.useState(null),A=se(t,D=>E(D)),[x,T]=u.useState(null),L=$r(x),I=L?.width??0,P=L?.height??0,H=o+(s!=="center"?"-"+s:""),W=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(d)?d:[d],V=B.length>0,b={padding:W,boundary:B.filter(Gc),altBoundary:V},{refs:S,floatingStyles:k,placement:_,isPositioned:O,middlewareData:N}=Tc({strategy:"fixed",placement:H,whileElementsMounted:(...D)=>vc(...D,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Pc({mainAxis:r+P,alignmentAxis:a}),c&&Oc({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ic():void 0,...b}),c&&Mc({...b}),Lc({...b,apply:({elements:D,rects:J,availableWidth:ie,availableHeight:Z})=>{const{width:ee,height:ne}=J.reference,ue=D.floating.style;ue.setProperty("--radix-popper-available-width",`${ie}px`),ue.setProperty("--radix-popper-available-height",`${Z}px`),ue.setProperty("--radix-popper-anchor-width",`${ee}px`),ue.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),x&&Fc({element:x,padding:i}),Yc({arrowWidth:I,arrowHeight:P}),g&&Dc({strategy:"referenceHidden",...b})]}),[K,te]=Gr(_),j=Ye(w);me(()=>{O&&j?.()},[O,j]);const Ne=N.arrow?.x,Y=N.arrow?.y,oe=N.arrow?.centerOffset!==0,[Q,he]=u.useState();return me(()=>{C&&he(window.getComputedStyle(C).zIndex)},[C]),l.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:O?k.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:l.jsx(Wc,{scope:n,placedSide:K,onArrowChange:T,arrowX:Ne,arrowY:Y,shouldHideArrow:oe,children:l.jsx(Fr.div,{"data-side":K,"data-align":te,...h,ref:A,style:{...h.style,animation:O?void 0:"none"}})})})});Wr.displayName=ro;var jr="PopperArrow",Vc={top:"bottom",right:"left",bottom:"top",left:"right"},Vr=u.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=jc(jr,o),a=Vc[s.placedSide];return l.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:l.jsx(Bc,{...r,ref:n,style:{...r.style,display:"block"}})})});Vr.displayName=jr;function Gc(e){return e!==null}var Yc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,f]=Gr(n),p={start:"0%",center:"50%",end:"100%"}[f],g=(r.arrow?.x??0)+i/2,m=(r.arrow?.y??0)+c/2;let w="",h="";return d==="bottom"?(w=a?p:`${g}px`,h=`${-c}px`):d==="top"?(w=a?p:`${g}px`,h=`${o.floating.height+c}px`):d==="right"?(w=`${-c}px`,h=a?p:`${m}px`):d==="left"&&(w=`${o.floating.width+c}px`,h=a?p:`${m}px`),{data:{x:w,y:h}}}});function Gr(e){const[t,n="center"]=e.split("-");return[t,n]}var Yr=Br,so=Hr,qr=Wr,Kr=Vr,qc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kc=qc.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Xc="Portal",ao=u.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=u.useState(!1);me(()=>s(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Go.createPortal(l.jsx(Kc.div,{...o,ref:t}),a):null});ao.displayName=Xc;var Zc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Zc.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Qc=u[" useInsertionEffect ".trim().toString()]||me;function Ot({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=Jc({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:r;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${o} is changing from ${p?"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.`),f.current=i},[i,o])}const d=u.useCallback(f=>{if(i){const p=ed(f)?f(e):f;p!==e&&a.current?.(p)}else s(f)},[i,e,s,a]);return[c,d]}function Jc({defaultProp:e,onChange:t}){const[n,o]=u.useState(e),r=u.useRef(n),s=u.useRef(t);return Qc(()=>{s.current=t},[t]),u.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function ed(e){return typeof e=="function"}function Xr(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var td=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nd=td.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Zr=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"}),od="VisuallyHidden",rd=u.forwardRef((e,t)=>l.jsx(nd.span,{...e,ref:t,style:{...Zr,...e.style}}));rd.displayName=od;var sd=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pt=new WeakMap,nn=new WeakMap,on={},io=0,Qr=function(e){return e&&(e.host||Qr(e.parentNode))},ad=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Qr(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},id=function(e,t,n,o){var r=ad(t,Array.isArray(e)?e:[e]);on[n]||(on[n]=new WeakMap);var s=on[n],a=[],i=new Set,c=new Set(r),d=function(p){!p||i.has(p)||(i.add(p),d(p.parentNode))};r.forEach(d);var f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(g){if(i.has(g))f(g);else try{var m=g.getAttribute(o),w=m!==null&&m!=="false",h=(pt.get(g)||0)+1,y=(s.get(g)||0)+1;pt.set(g,h),s.set(g,y),a.push(g),h===1&&w&&nn.set(g,!0),y===1&&g.setAttribute(n,"true"),w||g.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",g,C)}})};return f(t),i.clear(),io++,function(){a.forEach(function(p){var g=pt.get(p)-1,m=s.get(p)-1;pt.set(p,g),s.set(p,m),g||(nn.has(p)||p.removeAttribute(o),nn.delete(p)),m||p.removeAttribute(n)}),io--,io||(pt=new WeakMap,pt=new WeakMap,nn=new WeakMap,on={})}},Jr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=sd(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),id(o,r,n,"aria-hidden")):function(){return null}},$e=function(){return $e=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},$e.apply(this,arguments)};function es(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function ld(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var rn="right-scroll-bar-position",sn="width-before-scroll-bar",cd="with-scroll-bars-hidden",dd="--removed-body-scroll-bar-size";function lo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ud(e,t){var n=U.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var fd=typeof window<"u"?u.useLayoutEffect:u.useEffect,ts=new WeakMap;function pd(e,t){var n=ud(null,function(o){return e.forEach(function(r){return lo(r,o)})});return fd(function(){var o=ts.get(n);if(o){var r=new Set(o),s=new Set(e),a=n.current;r.forEach(function(i){s.has(i)||lo(i,null)}),s.forEach(function(i){r.has(i)||lo(i,a)})}ts.set(n,e)},[e]),n}function md(e){return e}function hd(e,t){t===void 0&&(t=md);var n=[],o=!1,r={read:function(){if(o)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,o);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(o=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){o=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var c=function(){var f=a;a=[],f.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return r}function gd(e){e===void 0&&(e={});var t=hd(null);return t.options=$e({async:!0,ssr:!1},e),t}var ns=function(e){var t=e.sideCar,n=es(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return u.createElement(o,$e({},n))};ns.isSideCarExport=!0;function bd(e,t){return e.useMedium(t),ns}var os=gd(),co=function(){},an=u.forwardRef(function(e,t){var n=u.useRef(null),o=u.useState({onScrollCapture:co,onWheelCapture:co,onTouchMoveCapture:co}),r=o[0],s=o[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,g=e.sideCar,m=e.noRelative,w=e.noIsolation,h=e.inert,y=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,A=e.gapMode,x=es(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,L=pd([n,t]),I=$e($e({},x),r);return u.createElement(u.Fragment,null,f&&u.createElement(T,{sideCar:os,removeScrollBar:d,shards:p,noRelative:m,noIsolation:w,inert:h,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:A}),a?u.cloneElement(u.Children.only(i),$e($e({},I),{ref:L})):u.createElement(E,$e({},I,{className:c,ref:L}),i))});an.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},an.classNames={fullWidth:sn,zeroRight:rn};var vd=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vd();return t&&e.setAttribute("nonce",t),e}function wd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xd(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Sd=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yd())&&(wd(t,n),xd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Cd=function(){var e=Sd();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rs=function(){var e=Cd(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Ed={left:0,top:0,right:0,gap:0},uo=function(e){return parseInt(e||"",10)||0},Ad=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[uo(n),uo(o),uo(r)]},Nd=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ed;var t=Ad(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},kd=rs(),mt="data-scroll-locked",Td=function(e,t,n,o){var r=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
16
|
+
.`.concat(cd,` {
|
|
17
|
+
overflow: hidden `).concat(o,`;
|
|
18
|
+
padding-right: `).concat(i,"px ").concat(o,`;
|
|
19
19
|
}
|
|
20
20
|
body[`).concat(mt,`] {
|
|
21
|
-
overflow: hidden `).concat(
|
|
21
|
+
overflow: hidden `).concat(o,`;
|
|
22
22
|
overscroll-behavior: contain;
|
|
23
|
-
`).concat([t&&"position: relative ".concat(
|
|
24
|
-
padding-left: `.concat(
|
|
23
|
+
`).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
|
|
24
|
+
padding-left: `.concat(r,`px;
|
|
25
25
|
padding-top: `).concat(s,`px;
|
|
26
26
|
padding-right: `).concat(a,`px;
|
|
27
27
|
margin-left:0;
|
|
28
28
|
margin-top:0;
|
|
29
|
-
margin-right: `).concat(i,"px ").concat(
|
|
30
|
-
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(
|
|
29
|
+
margin-right: `).concat(i,"px ").concat(o,`;
|
|
30
|
+
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.`).concat(
|
|
34
|
-
right: `).concat(i,"px ").concat(
|
|
33
|
+
.`).concat(rn,` {
|
|
34
|
+
right: `).concat(i,"px ").concat(o,`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.`).concat(sn,` {
|
|
38
|
-
margin-right: `).concat(i,"px ").concat(
|
|
38
|
+
margin-right: `).concat(i,"px ").concat(o,`;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.`).concat(
|
|
42
|
-
right: 0 `).concat(
|
|
41
|
+
.`).concat(rn," .").concat(rn,` {
|
|
42
|
+
right: 0 `).concat(o,`;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.`).concat(sn," .").concat(sn,` {
|
|
46
|
-
margin-right: 0 `).concat(
|
|
46
|
+
margin-right: 0 `).concat(o,`;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
body[`).concat(mt,`] {
|
|
50
|
-
`).concat(
|
|
50
|
+
`).concat(dd,": ").concat(i,`px;
|
|
51
51
|
}
|
|
52
|
-
`)},
|
|
52
|
+
`)},ss=function(){var e=parseInt(document.body.getAttribute(mt)||"0",10);return isFinite(e)?e:0},_d=function(){u.useEffect(function(){return document.body.setAttribute(mt,(ss()+1).toString()),function(){var e=ss()-1;e<=0?document.body.removeAttribute(mt):document.body.setAttribute(mt,e.toString())}},[])},Pd=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;_d();var s=u.useMemo(function(){return Nd(r)},[r]);return u.createElement(kd,{styles:Td(s,!t,r,n?"":"!important")})},fo=!1;if(typeof window<"u")try{var ln=Object.defineProperty({},"passive",{get:function(){return fo=!0,!0}});window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{fo=!1}var ht=fo?{passive:!1}:!1,Od=function(e){return e.tagName==="TEXTAREA"},as=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")},Id=function(e){return as(e,"overflowY")},Md=function(e){return as(e,"overflowX")},is=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=ls(e,o);if(r){var s=cs(e,o),a=s[1],i=s[2];if(a>i)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Ld=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Dd=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},ls=function(e,t){return e==="v"?Id(t):Md(t)},cs=function(e,t){return e==="v"?Ld(t):Dd(t)},Fd=function(e,t){return e==="h"&&t==="rtl"?-1:1},$d=function(e,t,n,o,r){var s=Fd(e,window.getComputedStyle(t).direction),a=s*o,i=n.target,c=t.contains(i),d=!1,f=a>0,p=0,g=0;do{if(!i)break;var m=cs(e,i),w=m[0],h=m[1],y=m[2],C=h-y-s*w;(w||C)&&ls(e,i)&&(p+=C,g+=w);var E=i.parentNode;i=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(d=!0),d},cn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ds=function(e){return[e.deltaX,e.deltaY]},us=function(e){return e&&"current"in e?e.current:e},zd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rd=function(e){return`
|
|
53
53
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
54
54
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
55
|
-
`)},Cd=0,gt=[];function Ed(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(Cd++)[0],s=u.useState(rs)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=jc([e.lockRef.current],(e.shards||[]).map(ds),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var C=cn(h),E=n.current,A="deltaX"in h?h.deltaX:E[0]-C[0],x="deltaY"in h?h.deltaY:E[1]-C[1],k,D=h.target,I=Math.abs(A)>Math.abs(x)?"h":"v";if("touches"in h&&I==="h"&&D.type==="range")return!1;var _=as(I,D);if(!_)return!0;if(_?k=I:(k=I==="v"?"h":"v",_=as(I,D)),!_)return!1;if(!r.current&&"changedTouches"in h&&(A||x)&&(r.current=k),!k)return!0;var U=r.current||k;return wd(U,y,h,U==="h"?A:x)},[]),c=u.useCallback(function(h){var y=h;if(!(!gt.length||gt[gt.length-1]!==s)){var C="deltaY"in y?cs(y):cn(y),E=t.current.filter(function(k){return k.name===y.type&&(k.target===y.target||y.target===k.shadowParent)&&xd(k.delta,C)})[0];if(E&&E.should){y.cancelable&&y.preventDefault();return}if(!E){var A=(a.current.shards||[]).map(ds).filter(Boolean).filter(function(k){return k.contains(y.target)}),x=A.length>0?i(y,A[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),d=u.useCallback(function(h,y,C,E){var A={name:h,delta:y,target:C,should:E,shadowParent:Ad(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(x){return x!==A})},1)},[]),f=u.useCallback(function(h){n.current=cn(h),r.current=void 0},[]),p=u.useCallback(function(h){d(h.type,cs(h),h.target,i(h,e.lockRef.current))},[]),b=u.useCallback(function(h){d(h.type,cn(h),h.target,i(h,e.lockRef.current))},[]);u.useEffect(function(){return gt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:b}),document.addEventListener("wheel",c,ht),document.addEventListener("touchmove",c,ht),document.addEventListener("touchstart",f,ht),function(){gt=gt.filter(function(h){return h!==s}),document.removeEventListener("wheel",c,ht),document.removeEventListener("touchmove",c,ht),document.removeEventListener("touchstart",f,ht)}},[]);var m=e.removeScrollBar,w=e.inert;return u.createElement(u.Fragment,null,w?u.createElement(s,{styles:Sd(o)}):null,m?u.createElement(pd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ad(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nd=ed(ns,Ed);var fr=u.forwardRef(function(e,t){return u.createElement(an,$e({},e,{ref:t,sideCar:Nd}))});fr.classNames=an.classNames;var Td=[" ","Enter","ArrowUp","ArrowDown"],kd=[" ","Enter"],rt="Select",[dn,un,Pd]=Qr(rt),[bt]=tt(rt,[Pd,tn]),fn=tn(),[_d,Ze]=bt(rt),[Od,Id]=bt(rt),us=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:b,required:m,form:w}=e,h=fn(t),[y,C]=u.useState(null),[E,A]=u.useState(null),[x,k]=u.useState(!1),D=zn(d),[I,_]=Ot({prop:r,defaultProp:o??!1,onChange:s,caller:rt}),[U,H]=Ot({prop:a,defaultProp:i,onChange:c,caller:rt}),B=u.useRef(null),j=y?w||!!y.closest("form"):!0,[g,S]=u.useState(new Set),T=Array.from(g).map(P=>P.props.value).join(";");return l.jsx(Go,{...h,children:l.jsxs(_d,{required:m,scope:t,trigger:y,onTriggerChange:C,valueNode:E,onValueNodeChange:A,valueNodeHasChildren:x,onValueNodeHasChildrenChange:k,contentId:Tt(),value:U,onValueChange:H,open:I,onOpenChange:_,dir:D,triggerPointerDownPosRef:B,disabled:b,children:[l.jsx(dn.Provider,{scope:t,children:l.jsx(Od,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(P=>{S(O=>new Set(O).add(P))},[]),onNativeOptionRemove:u.useCallback(P=>{S(O=>{const N=new Set(O);return N.delete(P),N})},[]),children:n})}),j?l.jsxs(Ls,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:U,onChange:P=>H(P.target.value),disabled:b,form:w,children:[U===void 0?l.jsx("option",{value:""}):null,Array.from(g)]},T):null]})})};us.displayName=rt;var fs="SelectTrigger",ps=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=fn(n),a=Ze(fs,n),i=a.disabled||r,c=oe(t,a.onTriggerChange),d=un(n),f=u.useRef("touch"),[p,b,m]=$s(h=>{const y=d().filter(A=>!A.disabled),C=y.find(A=>A.value===a.value),E=Rs(y,h,C);E!==void 0&&a.onValueChange(E.value)}),w=h=>{i||(a.onOpenChange(!0),m()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return l.jsx(sr,{asChild:!0,...s,children:l.jsx(Ce.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":Fs(a.value)?"":void 0,...o,ref:c,onClick:X(o.onClick,h=>{h.currentTarget.focus(),f.current!=="mouse"&&w(h)}),onPointerDown:X(o.onPointerDown,h=>{f.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(w(h),h.preventDefault())}),onKeyDown:X(o.onKeyDown,h=>{const y=p.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&b(h.key),!(y&&h.key===" ")&&Td.includes(h.key)&&(w(),h.preventDefault())})})})});ps.displayName=fs;var ms="SelectValue",hs=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...i}=e,c=Ze(ms,n),{onValueNodeHasChildrenChange:d}=c,f=s!==void 0,p=oe(t,c.onValueNodeChange);return fe(()=>{d(f)},[d,f]),l.jsx(Ce.span,{...i,ref:p,style:{pointerEvents:"none"},children:Fs(c.value)?l.jsx(l.Fragment,{children:a}):s})});hs.displayName=ms;var Md="SelectIcon",gs=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});gs.displayName=Md;var Dd="SelectPortal",bs=e=>l.jsx(ar,{asChild:!0,...e});bs.displayName=Dd;var ot="SelectContent",vs=u.forwardRef((e,t)=>{const n=Ze(ot,e.__scopeSelect),[r,o]=u.useState();if(fe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Vt.createPortal(l.jsx(ys,{scope:e.__scopeSelect,children:l.jsx(dn.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(ws,{...e,ref:t})});vs.displayName=ot;var _e=10,[ys,Qe]=bt(ot),Ld="SelectContentImpl",Fd=ye("SelectContent.RemoveScroll"),ws=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:b,collisionPadding:m,sticky:w,hideWhenDetached:h,avoidCollisions:y,...C}=e,E=Ze(ot,n),[A,x]=u.useState(null),[k,D]=u.useState(null),I=oe(t,L=>x(L)),[_,U]=u.useState(null),[H,B]=u.useState(null),j=un(n),[g,S]=u.useState(!1),T=u.useRef(!1);u.useEffect(()=>{if(A)return Qo(A)},[A]),oo();const P=u.useCallback(L=>{const[J,...ae]=j().map(ne=>ne.ref.current),[Z]=ae.slice(-1),ee=document.activeElement;for(const ne of L)if(ne===ee||(ne?.scrollIntoView({block:"nearest"}),ne===J&&k&&(k.scrollTop=0),ne===Z&&k&&(k.scrollTop=k.scrollHeight),ne?.focus(),document.activeElement!==ee))return},[j,k]),O=u.useCallback(()=>P([_,A]),[P,_,A]);u.useEffect(()=>{g&&O()},[g,O]);const{onOpenChange:N,triggerPointerDownPosRef:q}=E;u.useEffect(()=>{if(A){let L={x:0,y:0};const J=Z=>{L={x:Math.abs(Math.round(Z.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(q.current?.y??0))}},ae=Z=>{L.x<=10&&L.y<=10?Z.preventDefault():A.contains(Z.target)||N(!1),document.removeEventListener("pointermove",J),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ae,{capture:!0})}}},[A,N,q]),u.useEffect(()=>{const L=()=>N(!1);return window.addEventListener("blur",L),window.addEventListener("resize",L),()=>{window.removeEventListener("blur",L),window.removeEventListener("resize",L)}},[N]);const[te,V]=$s(L=>{const J=j().filter(ee=>!ee.disabled),ae=J.find(ee=>ee.ref.current===document.activeElement),Z=Rs(J,L,ae);Z&&setTimeout(()=>Z.ref.current.focus())}),Ae=u.useCallback((L,J,ae)=>{const Z=!T.current&&!ae;(E.value!==void 0&&E.value===J||Z)&&(U(L),Z&&(T.current=!0))},[E.value]),Y=u.useCallback(()=>A?.focus(),[A]),re=u.useCallback((L,J,ae)=>{const Z=!T.current&&!ae;(E.value!==void 0&&E.value===J||Z)&&B(L)},[E.value]),Q=r==="popper"?pr:xs,pe=Q===pr?{side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:b,collisionPadding:m,sticky:w,hideWhenDetached:h,avoidCollisions:y}:{};return l.jsx(ys,{scope:n,content:A,viewport:k,onViewportChange:D,itemRefCallback:Ae,selectedItem:_,onItemLeave:Y,itemTextRefCallback:re,focusSelectedItem:O,selectedItemText:H,position:r,isPositioned:g,searchRef:te,children:l.jsx(fr,{as:Fd,allowPinchZoom:!0,children:l.jsx(jn,{asChild:!0,trapped:E.open,onMountAutoFocus:L=>{L.preventDefault()},onUnmountAutoFocus:X(o,L=>{E.trigger?.focus({preventScroll:!0}),L.preventDefault()}),children:l.jsx(Un,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:L=>L.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:l.jsx(Q,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:L=>L.preventDefault(),...C,...pe,onPlaced:()=>S(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:X(C.onKeyDown,L=>{const J=L.ctrlKey||L.altKey||L.metaKey;if(L.key==="Tab"&&L.preventDefault(),!J&&L.key.length===1&&V(L.key),["ArrowUp","ArrowDown","Home","End"].includes(L.key)){let Z=j().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(L.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(L.key)){const ee=L.target,ne=Z.indexOf(ee);Z=Z.slice(ne+1)}setTimeout(()=>P(Z)),L.preventDefault()}})})})})})})});ws.displayName=Ld;var $d="SelectItemAlignedPosition",xs=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Ze(ot,n),a=Qe(ot,n),[i,c]=u.useState(null),[d,f]=u.useState(null),p=oe(t,I=>f(I)),b=un(n),m=u.useRef(!1),w=u.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:C,focusSelectedItem:E}=a,A=u.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&d&&h&&y&&C){const I=s.trigger.getBoundingClientRect(),_=d.getBoundingClientRect(),U=s.valueNode.getBoundingClientRect(),H=C.getBoundingClientRect();if(s.dir!=="rtl"){const ee=H.left-_.left,ne=U.left-ee,ce=I.left-ne,Ne=I.width+ce,Ie=Math.max(Ne,_.width),at=window.innerWidth-_e,it=Xr(ne,[_e,Math.max(_e,at-Ie)]);i.style.minWidth=Ne+"px",i.style.left=it+"px"}else{const ee=_.right-H.right,ne=window.innerWidth-U.right-ee,ce=window.innerWidth-I.right-ne,Ne=I.width+ce,Ie=Math.max(Ne,_.width),at=window.innerWidth-_e,it=Xr(ne,[_e,Math.max(_e,at-Ie)]);i.style.minWidth=Ne+"px",i.style.right=it+"px"}const B=b(),j=window.innerHeight-_e*2,g=h.scrollHeight,S=window.getComputedStyle(d),T=parseInt(S.borderTopWidth,10),P=parseInt(S.paddingTop,10),O=parseInt(S.borderBottomWidth,10),N=parseInt(S.paddingBottom,10),q=T+P+g+N+O,te=Math.min(y.offsetHeight*5,q),V=window.getComputedStyle(h),Ae=parseInt(V.paddingTop,10),Y=parseInt(V.paddingBottom,10),re=I.top+I.height/2-_e,Q=j-re,pe=y.offsetHeight/2,L=y.offsetTop+pe,J=T+P+L,ae=q-J;if(J<=re){const ee=B.length>0&&y===B[B.length-1].ref.current;i.style.bottom="0px";const ne=d.clientHeight-h.offsetTop-h.offsetHeight,ce=Math.max(Q,pe+(ee?Y:0)+ne+O),Ne=J+ce;i.style.height=Ne+"px"}else{const ee=B.length>0&&y===B[0].ref.current;i.style.top="0px";const ce=Math.max(re,T+h.offsetTop+(ee?Ae:0)+pe)+ae;i.style.height=ce+"px",h.scrollTop=J-re+h.offsetTop}i.style.margin=`${_e}px 0`,i.style.minHeight=te+"px",i.style.maxHeight=j+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[b,s.trigger,s.valueNode,i,d,h,y,C,s.dir,r]);fe(()=>A(),[A]);const[x,k]=u.useState();fe(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const D=u.useCallback(I=>{I&&w.current===!0&&(A(),E?.(),w.current=!1)},[A,E]);return l.jsx(zd,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:m,onScrollButtonChange:D,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:l.jsx(Ce.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});xs.displayName=$d;var Rd="SelectPopperPosition",pr=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_e,...s}=e,a=fn(n);return l.jsx(Yo,{...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)"}})});pr.displayName=Rd;var[zd,mr]=bt(ot,{}),hr="SelectViewport",Ss=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Qe(hr,n),a=mr(hr,n),i=oe(t,s.onViewportChange),c=u.useRef(0);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(dn.Slot,{scope:n,children:l.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:X(o.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:b}=a;if(b?.current&&p){const m=Math.abs(c.current-f.scrollTop);if(m>0){const w=window.innerHeight-_e*2,h=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),C=Math.max(h,y);if(C<w){const E=C+m,A=Math.min(w,E),x=E-A;p.style.height=A+"px",p.style.bottom==="0px"&&(f.scrollTop=x>0?x:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});Ss.displayName=hr;var Cs="SelectGroup",[Bd,Ud]=bt(Cs),Es=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return l.jsx(Bd,{scope:n,id:o,children:l.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Es.displayName=Cs;var As="SelectLabel",Ns=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ud(As,n);return l.jsx(Ce.div,{id:o.id,...r,ref:t})});Ns.displayName=As;var pn="SelectItem",[Wd,Ts]=bt(pn),ks=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,i=Ze(pn,n),c=Qe(pn,n),d=i.value===r,[f,p]=u.useState(s??""),[b,m]=u.useState(!1),w=oe(t,E=>c.itemRefCallback?.(E,r,o)),h=Tt(),y=u.useRef("touch"),C=()=>{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 l.jsx(Wd,{scope:n,value:r,disabled:o,textId:h,isSelected:d,onItemTextChange:u.useCallback(E=>{p(A=>A||(E?.textContent??"").trim())},[]),children:l.jsx(dn.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:l.jsx(Ce.div,{role:"option","aria-labelledby":h,"data-highlighted":b?"":void 0,"aria-selected":d&&b,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:w,onFocus:X(a.onFocus,()=>m(!0)),onBlur:X(a.onBlur,()=>m(!1)),onClick:X(a.onClick,()=>{y.current!=="mouse"&&C()}),onPointerUp:X(a.onPointerUp,()=>{y.current==="mouse"&&C()}),onPointerDown:X(a.onPointerDown,E=>{y.current=E.pointerType}),onPointerMove:X(a.onPointerMove,E=>{y.current=E.pointerType,o?c.onItemLeave?.():y.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(a.onPointerLeave,E=>{E.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:X(a.onKeyDown,E=>{c.searchRef?.current!==""&&E.key===" "||(kd.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});ks.displayName=pn;var It="SelectItemText",Ps=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=Ze(It,n),i=Qe(It,n),c=Ts(It,n),d=Id(It,n),[f,p]=u.useState(null),b=oe(t,C=>p(C),c.onItemTextChange,C=>i.itemTextRefCallback?.(C,c.value,c.disabled)),m=f?.textContent,w=u.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=d;return fe(()=>(h(w),()=>y(w)),[h,y,w]),l.jsxs(l.Fragment,{children:[l.jsx(Ce.span,{id:c.textId,...s,ref:b}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Vt.createPortal(s.children,a.valueNode):null]})});Ps.displayName=It;var _s="SelectItemIndicator",Hd=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ts(_s,n).isSelected?l.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});Hd.displayName=_s;var gr="SelectScrollUpButton",Os=u.forwardRef((e,t)=>{const n=Qe(gr,e.__scopeSelect),r=mr(gr,e.__scopeSelect),[o,s]=u.useState(!1),a=oe(t,r.onScrollButtonChange);return fe(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=c.scrollTop>0;s(d)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?l.jsx(Is,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});Os.displayName=gr;var br="SelectScrollDownButton",Vd=u.forwardRef((e,t)=>{const n=Qe(br,e.__scopeSelect),r=mr(br,e.__scopeSelect),[o,s]=u.useState(!1),a=oe(t,r.onScrollButtonChange);return fe(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;s(f)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),o?l.jsx(Is,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});Vd.displayName=br;var Is=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Qe("SelectScrollButton",n),a=u.useRef(null),i=un(n),c=u.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),fe(()=>{i().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),l.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:X(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:X(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:X(o.onPointerLeave,()=>{c()})})}),jd="SelectSeparator",Ms=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});Ms.displayName=jd;var vr="SelectArrow",Ds=u.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fn(n),s=Ze(vr,n),a=Qe(vr,n);return s.open&&a.position==="popper"?l.jsx(Ko,{...o,...r,ref:t}):null});Ds.displayName=vr;var Gd="SelectBubbleInput",Ls=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=u.useRef(null),s=oe(r,o),a=qo(t);return u.useEffect(()=>{const i=o.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(p)}},[a,t]),l.jsx(Ce.select,{...n,style:{...Xo,...n.style},ref:s,defaultValue:t})});Ls.displayName=Gd;function Fs(e){return e===""||e===void 0}function $s(e){const t=Ye(e),n=u.useRef(""),r=u.useRef(0),o=u.useCallback(a=>{const i=n.current+a;t(i),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(i)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Rs(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Yd(e,Math.max(s,0));o.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Yd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Kd=us,qd=ps,Xd=hs,Zd=gs,Qd=bs,Jd=vs,eu=Ss,tu=Es,nu=Ns,ru=ks,ou=Ps,su=Os,au=Ms,zs=Ds;function iu({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const s=t[e.name]||"",a=typeof e.disabled=="function"?e.disabled(t):e.disabled,i=e.options||[];return l.jsxs(l.Fragment,{children:[l.jsxs(Kd,{value:s,onValueChange:c=>n(e.name,c),disabled:a,children:[l.jsxs(qd,{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
|
|
56
|
-
${
|
|
55
|
+
`)},Bd=0,gt=[];function Ud(e){var t=u.useRef([]),n=u.useRef([0,0]),o=u.useRef(),r=u.useState(Bd++)[0],s=u.useState(rs)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var h=ld([e.lockRef.current],(e.shards||[]).map(us),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var C=cn(h),E=n.current,A="deltaX"in h?h.deltaX:E[0]-C[0],x="deltaY"in h?h.deltaY:E[1]-C[1],T,L=h.target,I=Math.abs(A)>Math.abs(x)?"h":"v";if("touches"in h&&I==="h"&&L.type==="range")return!1;var P=is(I,L);if(!P)return!0;if(P?T=I:(T=I==="v"?"h":"v",P=is(I,L)),!P)return!1;if(!o.current&&"changedTouches"in h&&(A||x)&&(o.current=T),!T)return!0;var H=o.current||T;return $d(H,y,h,H==="h"?A:x)},[]),c=u.useCallback(function(h){var y=h;if(!(!gt.length||gt[gt.length-1]!==s)){var C="deltaY"in y?ds(y):cn(y),E=t.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&zd(T.delta,C)})[0];if(E&&E.should){y.cancelable&&y.preventDefault();return}if(!E){var A=(a.current.shards||[]).map(us).filter(Boolean).filter(function(T){return T.contains(y.target)}),x=A.length>0?i(y,A[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),d=u.useCallback(function(h,y,C,E){var A={name:h,delta:y,target:C,should:E,shadowParent:Hd(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(x){return x!==A})},1)},[]),f=u.useCallback(function(h){n.current=cn(h),o.current=void 0},[]),p=u.useCallback(function(h){d(h.type,ds(h),h.target,i(h,e.lockRef.current))},[]),g=u.useCallback(function(h){d(h.type,cn(h),h.target,i(h,e.lockRef.current))},[]);u.useEffect(function(){return gt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",c,ht),document.addEventListener("touchmove",c,ht),document.addEventListener("touchstart",f,ht),function(){gt=gt.filter(function(h){return h!==s}),document.removeEventListener("wheel",c,ht),document.removeEventListener("touchmove",c,ht),document.removeEventListener("touchstart",f,ht)}},[]);var m=e.removeScrollBar,w=e.inert;return u.createElement(u.Fragment,null,w?u.createElement(s,{styles:Rd(r)}):null,m?u.createElement(Pd,{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 Wd=bd(os,Ud);var po=u.forwardRef(function(e,t){return u.createElement(an,$e({},e,{ref:t,sideCar:Wd}))});po.classNames=an.classNames;var jd=[" ","Enter","ArrowUp","ArrowDown"],Vd=[" ","Enter"],ot="Select",[dn,un,Gd]=er(ot),[bt]=tt(ot,[Gd,tn]),fn=tn(),[Yd,Ze]=bt(ot),[qd,Kd]=bt(ot),fs=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:g,required:m,form:w}=e,h=fn(t),[y,C]=u.useState(null),[E,A]=u.useState(null),[x,T]=u.useState(!1),L=Rn(d),[I,P]=Ot({prop:o,defaultProp:r??!1,onChange:s,caller:ot}),[H,W]=Ot({prop:a,defaultProp:i,onChange:c,caller:ot}),B=u.useRef(null),V=y?w||!!y.closest("form"):!0,[b,S]=u.useState(new Set),k=Array.from(b).map(_=>_.props.value).join(";");return l.jsx(Yr,{...h,children:l.jsxs(Yd,{required:m,scope:t,trigger:y,onTriggerChange:C,valueNode:E,onValueNodeChange:A,valueNodeHasChildren:x,onValueNodeHasChildrenChange:T,contentId:kt(),value:H,onValueChange:W,open:I,onOpenChange:P,dir:L,triggerPointerDownPosRef:B,disabled:g,children:[l.jsx(dn.Provider,{scope:t,children:l.jsx(qd,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(_=>{S(O=>new Set(O).add(_))},[]),onNativeOptionRemove:u.useCallback(_=>{S(O=>{const N=new Set(O);return N.delete(_),N})},[]),children:n})}),V?l.jsxs(Fs,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:H,onChange:_=>W(_.target.value),disabled:g,form:w,children:[H===void 0?l.jsx("option",{value:""}):null,Array.from(b)]},k):null]})})};fs.displayName=ot;var ps="SelectTrigger",ms=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=fn(n),a=Ze(ps,n),i=a.disabled||o,c=se(t,a.onTriggerChange),d=un(n),f=u.useRef("touch"),[p,g,m]=zs(h=>{const y=d().filter(A=>!A.disabled),C=y.find(A=>A.value===a.value),E=Rs(y,h,C);E!==void 0&&a.onValueChange(E.value)}),w=h=>{i||(a.onOpenChange(!0),m()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return l.jsx(so,{asChild:!0,...s,children:l.jsx(Ee.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":$s(a.value)?"":void 0,...r,ref:c,onClick:X(r.onClick,h=>{h.currentTarget.focus(),f.current!=="mouse"&&w(h)}),onPointerDown:X(r.onPointerDown,h=>{f.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(w(h),h.preventDefault())}),onKeyDown:X(r.onKeyDown,h=>{const y=p.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&g(h.key),!(y&&h.key===" ")&&jd.includes(h.key)&&(w(),h.preventDefault())})})})});ms.displayName=ps;var hs="SelectValue",gs=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...i}=e,c=Ze(hs,n),{onValueNodeHasChildrenChange:d}=c,f=s!==void 0,p=se(t,c.onValueNodeChange);return me(()=>{d(f)},[d,f]),l.jsx(Ee.span,{...i,ref:p,style:{pointerEvents:"none"},children:$s(c.value)?l.jsx(l.Fragment,{children:a}):s})});gs.displayName=hs;var Xd="SelectIcon",bs=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return l.jsx(Ee.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});bs.displayName=Xd;var Zd="SelectPortal",vs=e=>l.jsx(ao,{asChild:!0,...e});vs.displayName=Zd;var rt="SelectContent",ys=u.forwardRef((e,t)=>{const n=Ze(rt,e.__scopeSelect),[o,r]=u.useState();if(me(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?jt.createPortal(l.jsx(ws,{scope:e.__scopeSelect,children:l.jsx(dn.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(xs,{...e,ref:t})});ys.displayName=rt;var Pe=10,[ws,Qe]=bt(rt),Qd="SelectContentImpl",Jd=we("SelectContent.RemoveScroll"),xs=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:m,sticky:w,hideWhenDetached:h,avoidCollisions:y,...C}=e,E=Ze(rt,n),[A,x]=u.useState(null),[T,L]=u.useState(null),I=se(t,D=>x(D)),[P,H]=u.useState(null),[W,B]=u.useState(null),V=un(n),[b,S]=u.useState(!1),k=u.useRef(!1);u.useEffect(()=>{if(A)return Jr(A)},[A]),ar();const _=u.useCallback(D=>{const[J,...ie]=V().map(ne=>ne.ref.current),[Z]=ie.slice(-1),ee=document.activeElement;for(const ne of D)if(ne===ee||(ne?.scrollIntoView({block:"nearest"}),ne===J&&T&&(T.scrollTop=0),ne===Z&&T&&(T.scrollTop=T.scrollHeight),ne?.focus(),document.activeElement!==ee))return},[V,T]),O=u.useCallback(()=>_([P,A]),[_,P,A]);u.useEffect(()=>{b&&O()},[b,O]);const{onOpenChange:N,triggerPointerDownPosRef:K}=E;u.useEffect(()=>{if(A){let D={x:0,y:0};const J=Z=>{D={x:Math.abs(Math.round(Z.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Z.pageY)-(K.current?.y??0))}},ie=Z=>{D.x<=10&&D.y<=10?Z.preventDefault():A.contains(Z.target)||N(!1),document.removeEventListener("pointermove",J),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ie,{capture:!0})}}},[A,N,K]),u.useEffect(()=>{const D=()=>N(!1);return window.addEventListener("blur",D),window.addEventListener("resize",D),()=>{window.removeEventListener("blur",D),window.removeEventListener("resize",D)}},[N]);const[te,j]=zs(D=>{const J=V().filter(ee=>!ee.disabled),ie=J.find(ee=>ee.ref.current===document.activeElement),Z=Rs(J,D,ie);Z&&setTimeout(()=>Z.ref.current.focus())}),Ne=u.useCallback((D,J,ie)=>{const Z=!k.current&&!ie;(E.value!==void 0&&E.value===J||Z)&&(H(D),Z&&(k.current=!0))},[E.value]),Y=u.useCallback(()=>A?.focus(),[A]),oe=u.useCallback((D,J,ie)=>{const Z=!k.current&&!ie;(E.value!==void 0&&E.value===J||Z)&&B(D)},[E.value]),Q=o==="popper"?mo:Ss,he=Q===mo?{side:i,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:g,collisionPadding:m,sticky:w,hideWhenDetached:h,avoidCollisions:y}:{};return l.jsx(ws,{scope:n,content:A,viewport:T,onViewportChange:L,itemRefCallback:Ne,selectedItem:P,onItemLeave:Y,itemTextRefCallback:oe,focusSelectedItem:O,selectedItemText:W,position:o,isPositioned:b,searchRef:te,children:l.jsx(po,{as:Jd,allowPinchZoom:!0,children:l.jsx(Vn,{asChild:!0,trapped:E.open,onMountAutoFocus:D=>{D.preventDefault()},onUnmountAutoFocus:X(r,D=>{E.trigger?.focus({preventScroll:!0}),D.preventDefault()}),children:l.jsx(Un,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:D=>D.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:l.jsx(Q,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:D=>D.preventDefault(),...C,...he,onPlaced:()=>S(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:X(C.onKeyDown,D=>{const J=D.ctrlKey||D.altKey||D.metaKey;if(D.key==="Tab"&&D.preventDefault(),!J&&D.key.length===1&&j(D.key),["ArrowUp","ArrowDown","Home","End"].includes(D.key)){let Z=V().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(D.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(D.key)){const ee=D.target,ne=Z.indexOf(ee);Z=Z.slice(ne+1)}setTimeout(()=>_(Z)),D.preventDefault()}})})})})})})});xs.displayName=Qd;var eu="SelectItemAlignedPosition",Ss=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Ze(rt,n),a=Qe(rt,n),[i,c]=u.useState(null),[d,f]=u.useState(null),p=se(t,I=>f(I)),g=un(n),m=u.useRef(!1),w=u.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:C,focusSelectedItem:E}=a,A=u.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&d&&h&&y&&C){const I=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),W=C.getBoundingClientRect();if(s.dir!=="rtl"){const ee=W.left-P.left,ne=H.left-ee,ue=I.left-ne,ke=I.width+ue,Ie=Math.max(ke,P.width),at=window.innerWidth-Pe,it=Qo(ne,[Pe,Math.max(Pe,at-Ie)]);i.style.minWidth=ke+"px",i.style.left=it+"px"}else{const ee=P.right-W.right,ne=window.innerWidth-H.right-ee,ue=window.innerWidth-I.right-ne,ke=I.width+ue,Ie=Math.max(ke,P.width),at=window.innerWidth-Pe,it=Qo(ne,[Pe,Math.max(Pe,at-Ie)]);i.style.minWidth=ke+"px",i.style.right=it+"px"}const B=g(),V=window.innerHeight-Pe*2,b=h.scrollHeight,S=window.getComputedStyle(d),k=parseInt(S.borderTopWidth,10),_=parseInt(S.paddingTop,10),O=parseInt(S.borderBottomWidth,10),N=parseInt(S.paddingBottom,10),K=k+_+b+N+O,te=Math.min(y.offsetHeight*5,K),j=window.getComputedStyle(h),Ne=parseInt(j.paddingTop,10),Y=parseInt(j.paddingBottom,10),oe=I.top+I.height/2-Pe,Q=V-oe,he=y.offsetHeight/2,D=y.offsetTop+he,J=k+_+D,ie=K-J;if(J<=oe){const ee=B.length>0&&y===B[B.length-1].ref.current;i.style.bottom="0px";const ne=d.clientHeight-h.offsetTop-h.offsetHeight,ue=Math.max(Q,he+(ee?Y:0)+ne+O),ke=J+ue;i.style.height=ke+"px"}else{const ee=B.length>0&&y===B[0].ref.current;i.style.top="0px";const ue=Math.max(oe,k+h.offsetTop+(ee?Ne:0)+he)+ie;i.style.height=ue+"px",h.scrollTop=J-oe+h.offsetTop}i.style.margin=`${Pe}px 0`,i.style.minHeight=te+"px",i.style.maxHeight=V+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[g,s.trigger,s.valueNode,i,d,h,y,C,s.dir,o]);me(()=>A(),[A]);const[x,T]=u.useState();me(()=>{d&&T(window.getComputedStyle(d).zIndex)},[d]);const L=u.useCallback(I=>{I&&w.current===!0&&(A(),E?.(),w.current=!1)},[A,E]);return l.jsx(nu,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:m,onScrollButtonChange:L,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:l.jsx(Ee.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Ss.displayName=eu;var tu="SelectPopperPosition",mo=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Pe,...s}=e,a=fn(n);return l.jsx(qr,{...a,...s,ref:t,align:o,collisionPadding:r,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)"}})});mo.displayName=tu;var[nu,ho]=bt(rt,{}),go="SelectViewport",Cs=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Qe(go,n),a=ho(go,n),i=se(t,s.onViewportChange),c=u.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:o}),l.jsx(dn.Slot,{scope:n,children:l.jsx(Ee.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:X(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=a;if(g?.current&&p){const m=Math.abs(c.current-f.scrollTop);if(m>0){const w=window.innerHeight-Pe*2,h=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),C=Math.max(h,y);if(C<w){const E=C+m,A=Math.min(w,E),x=E-A;p.style.height=A+"px",p.style.bottom==="0px"&&(f.scrollTop=x>0?x:0,p.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});Cs.displayName=go;var Es="SelectGroup",[ou,ru]=bt(Es),As=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=kt();return l.jsx(ou,{scope:n,id:r,children:l.jsx(Ee.div,{role:"group","aria-labelledby":r,...o,ref:t})})});As.displayName=Es;var Ns="SelectLabel",ks=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ru(Ns,n);return l.jsx(Ee.div,{id:r.id,...o,ref:t})});ks.displayName=Ns;var pn="SelectItem",[su,Ts]=bt(pn),_s=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,i=Ze(pn,n),c=Qe(pn,n),d=i.value===o,[f,p]=u.useState(s??""),[g,m]=u.useState(!1),w=se(t,E=>c.itemRefCallback?.(E,o,r)),h=kt(),y=u.useRef("touch"),C=()=>{r||(i.onValueChange(o),i.onOpenChange(!1))};if(o==="")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 l.jsx(su,{scope:n,value:o,disabled:r,textId:h,isSelected:d,onItemTextChange:u.useCallback(E=>{p(A=>A||(E?.textContent??"").trim())},[]),children:l.jsx(dn.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:l.jsx(Ee.div,{role:"option","aria-labelledby":h,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:X(a.onFocus,()=>m(!0)),onBlur:X(a.onBlur,()=>m(!1)),onClick:X(a.onClick,()=>{y.current!=="mouse"&&C()}),onPointerUp:X(a.onPointerUp,()=>{y.current==="mouse"&&C()}),onPointerDown:X(a.onPointerDown,E=>{y.current=E.pointerType}),onPointerMove:X(a.onPointerMove,E=>{y.current=E.pointerType,r?c.onItemLeave?.():y.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(a.onPointerLeave,E=>{E.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:X(a.onKeyDown,E=>{c.searchRef?.current!==""&&E.key===" "||(Vd.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});_s.displayName=pn;var It="SelectItemText",Ps=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=Ze(It,n),i=Qe(It,n),c=Ts(It,n),d=Kd(It,n),[f,p]=u.useState(null),g=se(t,C=>p(C),c.onItemTextChange,C=>i.itemTextRefCallback?.(C,c.value,c.disabled)),m=f?.textContent,w=u.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=d;return me(()=>(h(w),()=>y(w)),[h,y,w]),l.jsxs(l.Fragment,{children:[l.jsx(Ee.span,{id:c.textId,...s,ref:g}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?jt.createPortal(s.children,a.valueNode):null]})});Ps.displayName=It;var Os="SelectItemIndicator",au=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Ts(Os,n).isSelected?l.jsx(Ee.span,{"aria-hidden":!0,...o,ref:t}):null});au.displayName=Os;var bo="SelectScrollUpButton",Is=u.forwardRef((e,t)=>{const n=Qe(bo,e.__scopeSelect),o=ho(bo,e.__scopeSelect),[r,s]=u.useState(!1),a=se(t,o.onScrollButtonChange);return me(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=c.scrollTop>0;s(d)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),r?l.jsx(Ms,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});Is.displayName=bo;var vo="SelectScrollDownButton",iu=u.forwardRef((e,t)=>{const n=Qe(vo,e.__scopeSelect),o=ho(vo,e.__scopeSelect),[r,s]=u.useState(!1),a=se(t,o.onScrollButtonChange);return me(()=>{if(n.viewport&&n.isPositioned){let i=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;s(f)};const c=n.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),r?l.jsx(Ms,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=n;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});iu.displayName=vo;var Ms=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Qe("SelectScrollButton",n),a=u.useRef(null),i=un(n),c=u.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),me(()=>{i().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),l.jsx(Ee.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:X(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:X(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:X(r.onPointerLeave,()=>{c()})})}),lu="SelectSeparator",Ls=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return l.jsx(Ee.div,{"aria-hidden":!0,...o,ref:t})});Ls.displayName=lu;var yo="SelectArrow",Ds=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=fn(n),s=Ze(yo,n),a=Qe(yo,n);return s.open&&a.position==="popper"?l.jsx(Kr,{...r,...o,ref:t}):null});Ds.displayName=yo;var cu="SelectBubbleInput",Fs=u.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=u.useRef(null),s=se(o,r),a=Xr(t);return u.useEffect(()=>{const i=r.current;if(!i)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&f){const p=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(p)}},[a,t]),l.jsx(Ee.select,{...n,style:{...Zr,...n.style},ref:s,defaultValue:t})});Fs.displayName=cu;function $s(e){return e===""||e===void 0}function zs(e){const t=Ye(e),n=u.useRef(""),o=u.useRef(0),r=u.useCallback(a=>{const i=n.current+a;t(i),(function c(d){n.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(i)},[t]),s=u.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function Rs(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=du(e,Math.max(s,0));r.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function du(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var uu=fs,fu=ms,pu=gs,mu=bs,hu=vs,gu=ys,bu=Cs,vu=As,yu=ks,wu=_s,xu=Ps,Su=Is,Cu=Ls,Bs=Ds;function Eu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const s=t[e.name]||"",a=typeof e.disabled=="function"?e.disabled(t):e.disabled,i=e.options||[];return l.jsxs(l.Fragment,{children:[l.jsxs(uu,{value:s,onValueChange:c=>n(e.name,c),disabled:a,children:[l.jsxs(fu,{id:e.name,onBlur:()=>o(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
|
|
56
|
+
${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"}
|
|
57
57
|
${a?"cursor-not-allowed opacity-50":""}
|
|
58
|
-
`,children:[l.jsx(
|
|
58
|
+
`,children:[l.jsx(pu,{placeholder:e.placeholder||`Select ${e.label?.toLowerCase()||""}`}),l.jsx(mu,{className:"ml-2 text-gray-500",children:l.jsx(Zo,{className:"w-4 h-4"})})]}),l.jsx(hu,{children:l.jsxs(gu,{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:[l.jsx(Su,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:l.jsx(Bs,{className:"fill-white stroke-gray-200"})}),l.jsxs(bu,{className:"p-1",children:[e.groupLabel&&l.jsx(vu,{children:l.jsx(yu,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),i.map(c=>l.jsx(wu,{value:c.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
|
|
59
59
|
data-[state=checked]:bg-blue-50
|
|
60
60
|
data-[state=checked]:text-blue-600
|
|
61
|
-
`,children:l.jsx(ou,{children:c.label})},c.value)),e.separator&&l.jsx(au,{className:"my-1 h-px bg-gray-200"})]}),l.jsx(zs,{className:"fill-white stroke-gray-200"})]})})]}),o&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]})}function lu({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>r(e.name),disabled: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 Bs({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,id:e.name,type:e.type||"",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>r(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`})})}function cu({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,id:e.name,type:"number",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>r(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${o?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`})})}const{entries:Us,setPrototypeOf:Ws,isFrozen:du,getPrototypeOf:uu,getOwnPropertyDescriptor:fu}=Object;let{freeze:ge,seal:Ee,create:yr}=Object,{apply:wr,construct:xr}=typeof Reflect<"u"&&Reflect;ge||(ge=function(t){return t}),Ee||(Ee=function(t){return t}),wr||(wr=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)}),xr||(xr=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 mn=ve(Array.prototype.forEach),pu=ve(Array.prototype.lastIndexOf),Hs=ve(Array.prototype.pop),Mt=ve(Array.prototype.push),mu=ve(Array.prototype.splice),hn=ve(String.prototype.toLowerCase),Sr=ve(String.prototype.toString),Cr=ve(String.prototype.match),Dt=ve(String.prototype.replace),hu=ve(String.prototype.indexOf),gu=ve(String.prototype.trim),Oe=ve(Object.prototype.hasOwnProperty),be=ve(RegExp.prototype.test),Lt=bu(TypeError);function ve(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 wr(e,t,r)}}function bu(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xr(e,n)}}function K(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hn;Ws&&Ws(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(du(t)||(t[r]=s),o=s)}e[o]=!0}return e}function vu(e){for(let t=0;t<e.length;t++)Oe(e,t)||(e[t]=null);return e}function Re(e){const t=yr(null);for(const[n,r]of Us(e))Oe(e,n)&&(Array.isArray(r)?t[n]=vu(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Re(r):t[n]=r);return t}function Ft(e,t){for(;e!==null;){const r=fu(e,t);if(r){if(r.get)return ve(r.get);if(typeof r.value=="function")return ve(r.value)}e=uu(e)}function n(){return null}return n}const Vs=ge(["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"]),Er=ge(["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"]),Ar=ge(["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"]),yu=ge(["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"]),Nr=ge(["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"]),wu=ge(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),js=ge(["#text"]),Gs=ge(["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"]),Tr=ge(["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"]),Ys=ge(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),gn=ge(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xu=Ee(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Su=Ee(/<%[\w\W]*|[\w\W]*%>/gm),Cu=Ee(/\$\{[\w\W]*/gm),Eu=Ee(/^data-[\-\w.\u00B7-\uFFFF]+$/),Au=Ee(/^aria-[\-\w]+$/),Ks=Ee(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nu=Ee(/^(?:\w+script|data):/i),Tu=Ee(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qs=Ee(/^html$/i),ku=Ee(/^[a-z][.\w]*(-[.\w]+)+$/i);var Xs=Object.freeze({__proto__:null,ARIA_ATTR:Au,ATTR_WHITESPACE:Tu,CUSTOM_ELEMENT:ku,DATA_ATTR:Eu,DOCTYPE_NAME:qs,ERB_EXPR:Su,IS_ALLOWED_URI:Ks,IS_SCRIPT_OR_DATA:Nu,MUSTACHE_EXPR:xu,TMPLIT_EXPR:Cu});const $t={element:1,text:3,progressingInstruction:7,comment:8,document:9},Pu=function(){return typeof window>"u"?null:window},_u=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}},Zs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pu();const t=z=>Qs(z);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==$t.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:c,NodeFilter:d,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:b,trustedTypes:m}=e,w=c.prototype,h=Ft(w,"cloneNode"),y=Ft(w,"remove"),C=Ft(w,"nextSibling"),E=Ft(w,"childNodes"),A=Ft(w,"parentNode");if(typeof a=="function"){const z=n.createElement("template");z.content&&z.content.ownerDocument&&(n=z.content.ownerDocument)}let x,k="";const{implementation:D,createNodeIterator:I,createDocumentFragment:_,getElementsByTagName:U}=n,{importNode:H}=r;let B=Zs();t.isSupported=typeof Us=="function"&&typeof A=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:g,TMPLIT_EXPR:S,DATA_ATTR:T,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:q}=Xs;let{IS_ALLOWED_URI:te}=Xs,V=null;const Ae=K({},[...Vs,...Er,...Ar,...Nr,...js]);let Y=null;const re=K({},[...Gs,...Tr,...Ys,...gn]);let Q=Object.seal(yr(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}})),pe=null,L=null;const J=Object.seal(yr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,Z=!0,ee=!1,ne=!0,ce=!1,Ne=!0,Ie=!1,at=!1,it=!1,St=!1,_n=!1,On=!1,Ja=!0,ei=!1;const Wp="user-content-";let $r=!0,Ut=!1,Ct={},ze=null;const Rr=K({},["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 ti=null;const ni=K({},["audio","video","img","source","image","track"]);let zr=null;const ri=K({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),In="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let Et=Ve,Br=!1,Ur=null;const Hp=K({},[In,Mn,Ve],Sr);let Dn=K({},["mi","mo","mn","ms","mtext"]),Ln=K({},["annotation-xml"]);const Vp=K({},["title","style","font","a","script"]);let Wt=null;const jp=["application/xhtml+xml","text/html"],Gp="text/html";let de=null,At=null;const Yp=n.createElement("form"),oi=function(v){return v instanceof RegExp||v instanceof Function},Wr=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(At&&At===v)){if((!v||typeof v!="object")&&(v={}),v=Re(v),Wt=jp.indexOf(v.PARSER_MEDIA_TYPE)===-1?Gp:v.PARSER_MEDIA_TYPE,de=Wt==="application/xhtml+xml"?Sr:hn,V=Oe(v,"ALLOWED_TAGS")?K({},v.ALLOWED_TAGS,de):Ae,Y=Oe(v,"ALLOWED_ATTR")?K({},v.ALLOWED_ATTR,de):re,Ur=Oe(v,"ALLOWED_NAMESPACES")?K({},v.ALLOWED_NAMESPACES,Sr):Hp,zr=Oe(v,"ADD_URI_SAFE_ATTR")?K(Re(ri),v.ADD_URI_SAFE_ATTR,de):ri,ti=Oe(v,"ADD_DATA_URI_TAGS")?K(Re(ni),v.ADD_DATA_URI_TAGS,de):ni,ze=Oe(v,"FORBID_CONTENTS")?K({},v.FORBID_CONTENTS,de):Rr,pe=Oe(v,"FORBID_TAGS")?K({},v.FORBID_TAGS,de):Re({}),L=Oe(v,"FORBID_ATTR")?K({},v.FORBID_ATTR,de):Re({}),Ct=Oe(v,"USE_PROFILES")?v.USE_PROFILES:!1,ae=v.ALLOW_ARIA_ATTR!==!1,Z=v.ALLOW_DATA_ATTR!==!1,ee=v.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=v.SAFE_FOR_TEMPLATES||!1,Ne=v.SAFE_FOR_XML!==!1,Ie=v.WHOLE_DOCUMENT||!1,St=v.RETURN_DOM||!1,_n=v.RETURN_DOM_FRAGMENT||!1,On=v.RETURN_TRUSTED_TYPE||!1,it=v.FORCE_BODY||!1,Ja=v.SANITIZE_DOM!==!1,ei=v.SANITIZE_NAMED_PROPS||!1,$r=v.KEEP_CONTENT!==!1,Ut=v.IN_PLACE||!1,te=v.ALLOWED_URI_REGEXP||Ks,Et=v.NAMESPACE||Ve,Dn=v.MATHML_TEXT_INTEGRATION_POINTS||Dn,Ln=v.HTML_INTEGRATION_POINTS||Ln,Q=v.CUSTOM_ELEMENT_HANDLING||{},v.CUSTOM_ELEMENT_HANDLING&&oi(v.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=v.CUSTOM_ELEMENT_HANDLING.tagNameCheck),v.CUSTOM_ELEMENT_HANDLING&&oi(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),ce&&(Z=!1),_n&&(St=!0),Ct&&(V=K({},js),Y=[],Ct.html===!0&&(K(V,Vs),K(Y,Gs)),Ct.svg===!0&&(K(V,Er),K(Y,Tr),K(Y,gn)),Ct.svgFilters===!0&&(K(V,Ar),K(Y,Tr),K(Y,gn)),Ct.mathMl===!0&&(K(V,Nr),K(Y,Ys),K(Y,gn))),v.ADD_TAGS&&(typeof v.ADD_TAGS=="function"?J.tagCheck=v.ADD_TAGS:(V===Ae&&(V=Re(V)),K(V,v.ADD_TAGS,de))),v.ADD_ATTR&&(typeof v.ADD_ATTR=="function"?J.attributeCheck=v.ADD_ATTR:(Y===re&&(Y=Re(Y)),K(Y,v.ADD_ATTR,de))),v.ADD_URI_SAFE_ATTR&&K(zr,v.ADD_URI_SAFE_ATTR,de),v.FORBID_CONTENTS&&(ze===Rr&&(ze=Re(ze)),K(ze,v.FORBID_CONTENTS,de)),v.ADD_FORBID_CONTENTS&&(ze===Rr&&(ze=Re(ze)),K(ze,v.ADD_FORBID_CONTENTS,de)),$r&&(V["#text"]=!0),Ie&&K(V,["html","head","body"]),V.table&&(K(V,["tbody"]),delete pe.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=v.TRUSTED_TYPES_POLICY,k=x.createHTML("")}else x===void 0&&(x=_u(m,o)),x!==null&&typeof k=="string"&&(k=x.createHTML(""));ge&&ge(v),At=v}},si=K({},[...Er,...Ar,...yu]),ai=K({},[...Nr,...wu]),Kp=function(v){let M=A(v);(!M||!M.tagName)&&(M={namespaceURI:Et,tagName:"template"});const R=hn(v.tagName),se=hn(M.tagName);return Ur[v.namespaceURI]?v.namespaceURI===Mn?M.namespaceURI===Ve?R==="svg":M.namespaceURI===In?R==="svg"&&(se==="annotation-xml"||Dn[se]):!!si[R]:v.namespaceURI===In?M.namespaceURI===Ve?R==="math":M.namespaceURI===Mn?R==="math"&&Ln[se]:!!ai[R]:v.namespaceURI===Ve?M.namespaceURI===Mn&&!Ln[se]||M.namespaceURI===In&&!Dn[se]?!1:!ai[R]&&(Vp[R]||!si[R]):!!(Wt==="application/xhtml+xml"&&Ur[v.namespaceURI]):!1},Be=function(v){Mt(t.removed,{element:v});try{A(v).removeChild(v)}catch{y(v)}},lt=function(v,M){try{Mt(t.removed,{attribute:M.getAttributeNode(v),from:M})}catch{Mt(t.removed,{attribute:null,from:M})}if(M.removeAttribute(v),v==="is")if(St||_n)try{Be(M)}catch{}else try{M.setAttribute(v,"")}catch{}},ii=function(v){let M=null,R=null;if(it)v="<remove></remove>"+v;else{const ie=Cr(v,/^[\r\n\t ]+/);R=ie&&ie[0]}Wt==="application/xhtml+xml"&&Et===Ve&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const se=x?x.createHTML(v):v;if(Et===Ve)try{M=new b().parseFromString(se,Wt)}catch{}if(!M||!M.documentElement){M=D.createDocument(Et,"template",null);try{M.documentElement.innerHTML=Br?k:se}catch{}}const me=M.body||M.documentElement;return v&&R&&me.insertBefore(n.createTextNode(R),me.childNodes[0]||null),Et===Ve?U.call(M,Ie?"html":"body")[0]:Ie?M.documentElement:me},li=function(v){return I.call(v.ownerDocument||v,v,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Hr=function(v){return v instanceof p&&(typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||!(v.attributes instanceof f)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function")},ci=function(v){return typeof i=="function"&&v instanceof i};function je(z,v,M){mn(z,R=>{R.call(t,v,M,At)})}const di=function(v){let M=null;if(je(B.beforeSanitizeElements,v,null),Hr(v))return Be(v),!0;const R=de(v.nodeName);if(je(B.uponSanitizeElement,v,{tagName:R,allowedTags:V}),Ne&&v.hasChildNodes()&&!ci(v.firstElementChild)&&be(/<[/\w!]/g,v.innerHTML)&&be(/<[/\w!]/g,v.textContent)||v.nodeType===$t.progressingInstruction||Ne&&v.nodeType===$t.comment&&be(/<[/\w]/g,v.data))return Be(v),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(R))&&(!V[R]||pe[R])){if(!pe[R]&&fi(R)&&(Q.tagNameCheck instanceof RegExp&&be(Q.tagNameCheck,R)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(R)))return!1;if($r&&!ze[R]){const se=A(v)||v.parentNode,me=E(v)||v.childNodes;if(me&&se){const ie=me.length;for(let we=ie-1;we>=0;--we){const Ge=h(me[we],!0);Ge.__removalCount=(v.__removalCount||0)+1,se.insertBefore(Ge,C(v))}}}return Be(v),!0}return v instanceof c&&!Kp(v)||(R==="noscript"||R==="noembed"||R==="noframes")&&be(/<\/no(script|embed|frames)/i,v.innerHTML)?(Be(v),!0):(ce&&v.nodeType===$t.text&&(M=v.textContent,mn([j,g,S],se=>{M=Dt(M,se," ")}),v.textContent!==M&&(Mt(t.removed,{element:v.cloneNode()}),v.textContent=M)),je(B.afterSanitizeElements,v,null),!1)},ui=function(v,M,R){if(Ja&&(M==="id"||M==="name")&&(R in n||R in Yp))return!1;if(!(Z&&!L[M]&&be(T,M))){if(!(ae&&be(P,M))){if(!(J.attributeCheck instanceof Function&&J.attributeCheck(M,v))){if(!Y[M]||L[M]){if(!(fi(v)&&(Q.tagNameCheck instanceof RegExp&&be(Q.tagNameCheck,v)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(v))&&(Q.attributeNameCheck instanceof RegExp&&be(Q.attributeNameCheck,M)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(M,v))||M==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&be(Q.tagNameCheck,R)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(R))))return!1}else if(!zr[M]){if(!be(te,Dt(R,N,""))){if(!((M==="src"||M==="xlink:href"||M==="href")&&v!=="script"&&hu(R,"data:")===0&&ti[v])){if(!(ee&&!be(O,Dt(R,N,"")))){if(R)return!1}}}}}}}return!0},fi=function(v){return v!=="annotation-xml"&&Cr(v,q)},pi=function(v){je(B.beforeSanitizeAttributes,v,null);const{attributes:M}=v;if(!M||Hr(v))return;const R={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let se=M.length;for(;se--;){const me=M[se],{name:ie,namespaceURI:we,value:Ge}=me,Nt=de(ie),Vr=Ge;let ue=ie==="value"?Vr:gu(Vr);if(R.attrName=Nt,R.attrValue=ue,R.keepAttr=!0,R.forceKeepAttr=void 0,je(B.uponSanitizeAttribute,v,R),ue=R.attrValue,ei&&(Nt==="id"||Nt==="name")&&(lt(ie,v),ue=Wp+ue),Ne&&be(/((--!?|])>)|<\/(style|title|textarea)/i,ue)){lt(ie,v);continue}if(Nt==="attributename"&&Cr(ue,"href")){lt(ie,v);continue}if(R.forceKeepAttr)continue;if(!R.keepAttr){lt(ie,v);continue}if(!ne&&be(/\/>/i,ue)){lt(ie,v);continue}ce&&mn([j,g,S],hi=>{ue=Dt(ue,hi," ")});const mi=de(v.nodeName);if(!ui(mi,Nt,ue)){lt(ie,v);continue}if(x&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!we)switch(m.getAttributeType(mi,Nt)){case"TrustedHTML":{ue=x.createHTML(ue);break}case"TrustedScriptURL":{ue=x.createScriptURL(ue);break}}if(ue!==Vr)try{we?v.setAttributeNS(we,ie,ue):v.setAttribute(ie,ue),Hr(v)?Be(v):Hs(t.removed)}catch{lt(ie,v)}}je(B.afterSanitizeAttributes,v,null)},qp=function z(v){let M=null;const R=li(v);for(je(B.beforeSanitizeShadowDOM,v,null);M=R.nextNode();)je(B.uponSanitizeShadowNode,M,null),di(M),pi(M),M.content instanceof s&&z(M.content);je(B.afterSanitizeShadowDOM,v,null)};return t.sanitize=function(z){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=null,R=null,se=null,me=null;if(Br=!z,Br&&(z="<!-->"),typeof z!="string"&&!ci(z))if(typeof z.toString=="function"){if(z=z.toString(),typeof z!="string")throw Lt("dirty is not a string, aborting")}else throw Lt("toString is not a function");if(!t.isSupported)return z;if(at||Wr(v),t.removed=[],typeof z=="string"&&(Ut=!1),Ut){if(z.nodeName){const Ge=de(z.nodeName);if(!V[Ge]||pe[Ge])throw Lt("root node is forbidden and cannot be sanitized in-place")}}else if(z instanceof i)M=ii("<!---->"),R=M.ownerDocument.importNode(z,!0),R.nodeType===$t.element&&R.nodeName==="BODY"||R.nodeName==="HTML"?M=R:M.appendChild(R);else{if(!St&&!ce&&!Ie&&z.indexOf("<")===-1)return x&&On?x.createHTML(z):z;if(M=ii(z),!M)return St?null:On?k:""}M&&it&&Be(M.firstChild);const ie=li(Ut?z:M);for(;se=ie.nextNode();)di(se),pi(se),se.content instanceof s&&qp(se.content);if(Ut)return z;if(St){if(_n)for(me=_.call(M.ownerDocument);M.firstChild;)me.appendChild(M.firstChild);else me=M;return(Y.shadowroot||Y.shadowrootmode)&&(me=H.call(r,me,!0)),me}let we=Ie?M.outerHTML:M.innerHTML;return Ie&&V["!doctype"]&&M.ownerDocument&&M.ownerDocument.doctype&&M.ownerDocument.doctype.name&&be(qs,M.ownerDocument.doctype.name)&&(we="<!DOCTYPE "+M.ownerDocument.doctype.name+`>
|
|
62
|
-
`+
|
|
63
|
-
w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none shadow-inner transition duration-150
|
|
64
|
-
${r?"bg-gray-100 text-gray-500 border-gray-300 cursor-not-allowed":"bg-white text-gray-800 border-gray-200 hover:border-gray-300"}
|
|
65
|
-
`.trim();return l.jsxs("div",{className:s,id:`${e.name}_id`,children:[l.jsx("label",{htmlFor:e.name,className:"block text-sm font-medium mb-1",children:e.label}),l.jsx("div",{className:a,dangerouslySetInnerHTML:{__html:Iu(o)}})]},e.name)}function Du({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const s=typeof e.disabled=="function"?e.disabled(t):e.disabled,a=e.options||[],i=e.inline||e.layout==="inline";if(a.length>0){const c=Array.isArray(t[e.name])?t[e.name]:[],d=(p,b)=>{let m;b?m=[...c,p]:m=c.filter(w=>w!==p),n(e.name,m)},f=o&&e.required&&c.length===0;return l.jsx(l.Fragment,{children:l.jsx("div",{className:i?"grid grid-cols-4 gap-3 mt-3":"space-y-3 mt-3",children:a.map(p=>{const b=typeof p=="object"?p.value:p,m=typeof p=="object"?p.label:p,w=typeof p=="object"?p.description:null,h=`${e.name}-${b}`,y=c.includes(b);return l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx("input",{...e.props,type:"checkbox",id:h,checked:y,onChange:C=>d(b,C.target.checked),onBlur:()=>r(e.name),disabled:s,className:`
|
|
61
|
+
`,children:l.jsx(xu,{children:c.label})},c.value)),e.separator&&l.jsx(Cu,{className:"my-1 h-px bg-gray-200"})]}),l.jsx(Bs,{className:"fill-white stroke-gray-200"})]})})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function Au({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>o(e.name),disabled: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 ${r?"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 Us({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,id:e.name,type:e.type||"",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>o(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`})})}function Nu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,id:e.name,type:"number",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>o(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`})})}const{entries:Hs,setPrototypeOf:Ws,isFrozen:ku,getPrototypeOf:Tu,getOwnPropertyDescriptor:_u}=Object;let{freeze:be,seal:Ae,create:wo}=Object,{apply:xo,construct:So}=typeof Reflect<"u"&&Reflect;be||(be=function(t){return t}),Ae||(Ae=function(t){return t}),xo||(xo=function(t,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),s=2;s<o;s++)r[s-2]=arguments[s];return t.apply(n,r)}),So||(So=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return new t(...o)});const mn=ye(Array.prototype.forEach),Pu=ye(Array.prototype.lastIndexOf),js=ye(Array.prototype.pop),Mt=ye(Array.prototype.push),Ou=ye(Array.prototype.splice),hn=ye(String.prototype.toLowerCase),Co=ye(String.prototype.toString),Eo=ye(String.prototype.match),Lt=ye(String.prototype.replace),Iu=ye(String.prototype.indexOf),Mu=ye(String.prototype.trim),Oe=ye(Object.prototype.hasOwnProperty),ve=ye(RegExp.prototype.test),Dt=Lu(TypeError);function ye(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return xo(e,t,o)}}function Lu(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return So(e,n)}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hn;Ws&&Ws(e,null);let o=t.length;for(;o--;){let r=t[o];if(typeof r=="string"){const s=n(r);s!==r&&(ku(t)||(t[o]=s),r=s)}e[r]=!0}return e}function Du(e){for(let t=0;t<e.length;t++)Oe(e,t)||(e[t]=null);return e}function ze(e){const t=wo(null);for(const[n,o]of Hs(e))Oe(e,n)&&(Array.isArray(o)?t[n]=Du(o):o&&typeof o=="object"&&o.constructor===Object?t[n]=ze(o):t[n]=o);return t}function Ft(e,t){for(;e!==null;){const o=_u(e,t);if(o){if(o.get)return ye(o.get);if(typeof o.value=="function")return ye(o.value)}e=Tu(e)}function n(){return null}return n}const Vs=be(["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"]),Ao=be(["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"]),No=be(["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"]),Fu=be(["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"]),ko=be(["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"]),$u=be(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gs=be(["#text"]),Ys=be(["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"]),To=be(["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"]),qs=be(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),gn=be(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zu=Ae(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ru=Ae(/<%[\w\W]*|[\w\W]*%>/gm),Bu=Ae(/\$\{[\w\W]*/gm),Uu=Ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hu=Ae(/^aria-[\-\w]+$/),Ks=Ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wu=Ae(/^(?:\w+script|data):/i),ju=Ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xs=Ae(/^html$/i),Vu=Ae(/^[a-z][.\w]*(-[.\w]+)+$/i);var Zs=Object.freeze({__proto__:null,ARIA_ATTR:Hu,ATTR_WHITESPACE:ju,CUSTOM_ELEMENT:Vu,DATA_ATTR:Uu,DOCTYPE_NAME:Xs,ERB_EXPR:Ru,IS_ALLOWED_URI:Ks,IS_SCRIPT_OR_DATA:Wu,MUSTACHE_EXPR:zu,TMPLIT_EXPR:Bu});const $t={element:1,text:3,progressingInstruction:7,comment:8,document:9},Gu=function(){return typeof window>"u"?null:window},Yu=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(o=n.getAttribute(r));const s="dompurify"+(o?"#"+o:"");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}},Qs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Js(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gu();const t=R=>Js(R);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==$t.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const o=n,r=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:i,Element:c,NodeFilter:d,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:g,trustedTypes:m}=e,w=c.prototype,h=Ft(w,"cloneNode"),y=Ft(w,"remove"),C=Ft(w,"nextSibling"),E=Ft(w,"childNodes"),A=Ft(w,"parentNode");if(typeof a=="function"){const R=n.createElement("template");R.content&&R.content.ownerDocument&&(n=R.content.ownerDocument)}let x,T="";const{implementation:L,createNodeIterator:I,createDocumentFragment:P,getElementsByTagName:H}=n,{importNode:W}=o;let B=Qs();t.isSupported=typeof Hs=="function"&&typeof A=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:V,ERB_EXPR:b,TMPLIT_EXPR:S,DATA_ATTR:k,ARIA_ATTR:_,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:K}=Zs;let{IS_ALLOWED_URI:te}=Zs,j=null;const Ne=q({},[...Vs,...Ao,...No,...ko,...Gs]);let Y=null;const oe=q({},[...Ys,...To,...qs,...gn]);let Q=Object.seal(wo(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}})),he=null,D=null;const J=Object.seal(wo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,Z=!0,ee=!1,ne=!0,ue=!1,ke=!0,Ie=!1,at=!1,it=!1,St=!1,Pn=!1,On=!1,ei=!0,ti=!1;const sm="user-content-";let zo=!0,Ut=!1,Ct={},Re=null;const Ro=q({},["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 ni=null;const oi=q({},["audio","video","img","source","image","track"]);let Bo=null;const ri=q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),In="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let Et=je,Uo=!1,Ho=null;const am=q({},[In,Mn,je],Co);let Ln=q({},["mi","mo","mn","ms","mtext"]),Dn=q({},["annotation-xml"]);const im=q({},["title","style","font","a","script"]);let Ht=null;const lm=["application/xhtml+xml","text/html"],cm="text/html";let fe=null,At=null;const dm=n.createElement("form"),si=function(v){return v instanceof RegExp||v instanceof Function},Wo=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(At&&At===v)){if((!v||typeof v!="object")&&(v={}),v=ze(v),Ht=lm.indexOf(v.PARSER_MEDIA_TYPE)===-1?cm:v.PARSER_MEDIA_TYPE,fe=Ht==="application/xhtml+xml"?Co:hn,j=Oe(v,"ALLOWED_TAGS")?q({},v.ALLOWED_TAGS,fe):Ne,Y=Oe(v,"ALLOWED_ATTR")?q({},v.ALLOWED_ATTR,fe):oe,Ho=Oe(v,"ALLOWED_NAMESPACES")?q({},v.ALLOWED_NAMESPACES,Co):am,Bo=Oe(v,"ADD_URI_SAFE_ATTR")?q(ze(ri),v.ADD_URI_SAFE_ATTR,fe):ri,ni=Oe(v,"ADD_DATA_URI_TAGS")?q(ze(oi),v.ADD_DATA_URI_TAGS,fe):oi,Re=Oe(v,"FORBID_CONTENTS")?q({},v.FORBID_CONTENTS,fe):Ro,he=Oe(v,"FORBID_TAGS")?q({},v.FORBID_TAGS,fe):ze({}),D=Oe(v,"FORBID_ATTR")?q({},v.FORBID_ATTR,fe):ze({}),Ct=Oe(v,"USE_PROFILES")?v.USE_PROFILES:!1,ie=v.ALLOW_ARIA_ATTR!==!1,Z=v.ALLOW_DATA_ATTR!==!1,ee=v.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=v.SAFE_FOR_TEMPLATES||!1,ke=v.SAFE_FOR_XML!==!1,Ie=v.WHOLE_DOCUMENT||!1,St=v.RETURN_DOM||!1,Pn=v.RETURN_DOM_FRAGMENT||!1,On=v.RETURN_TRUSTED_TYPE||!1,it=v.FORCE_BODY||!1,ei=v.SANITIZE_DOM!==!1,ti=v.SANITIZE_NAMED_PROPS||!1,zo=v.KEEP_CONTENT!==!1,Ut=v.IN_PLACE||!1,te=v.ALLOWED_URI_REGEXP||Ks,Et=v.NAMESPACE||je,Ln=v.MATHML_TEXT_INTEGRATION_POINTS||Ln,Dn=v.HTML_INTEGRATION_POINTS||Dn,Q=v.CUSTOM_ELEMENT_HANDLING||{},v.CUSTOM_ELEMENT_HANDLING&&si(v.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=v.CUSTOM_ELEMENT_HANDLING.tagNameCheck),v.CUSTOM_ELEMENT_HANDLING&&si(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),ue&&(Z=!1),Pn&&(St=!0),Ct&&(j=q({},Gs),Y=[],Ct.html===!0&&(q(j,Vs),q(Y,Ys)),Ct.svg===!0&&(q(j,Ao),q(Y,To),q(Y,gn)),Ct.svgFilters===!0&&(q(j,No),q(Y,To),q(Y,gn)),Ct.mathMl===!0&&(q(j,ko),q(Y,qs),q(Y,gn))),v.ADD_TAGS&&(typeof v.ADD_TAGS=="function"?J.tagCheck=v.ADD_TAGS:(j===Ne&&(j=ze(j)),q(j,v.ADD_TAGS,fe))),v.ADD_ATTR&&(typeof v.ADD_ATTR=="function"?J.attributeCheck=v.ADD_ATTR:(Y===oe&&(Y=ze(Y)),q(Y,v.ADD_ATTR,fe))),v.ADD_URI_SAFE_ATTR&&q(Bo,v.ADD_URI_SAFE_ATTR,fe),v.FORBID_CONTENTS&&(Re===Ro&&(Re=ze(Re)),q(Re,v.FORBID_CONTENTS,fe)),v.ADD_FORBID_CONTENTS&&(Re===Ro&&(Re=ze(Re)),q(Re,v.ADD_FORBID_CONTENTS,fe)),zo&&(j["#text"]=!0),Ie&&q(j,["html","head","body"]),j.table&&(q(j,["tbody"]),delete he.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=v.TRUSTED_TYPES_POLICY,T=x.createHTML("")}else x===void 0&&(x=Yu(m,r)),x!==null&&typeof T=="string"&&(T=x.createHTML(""));be&&be(v),At=v}},ai=q({},[...Ao,...No,...Fu]),ii=q({},[...ko,...$u]),um=function(v){let M=A(v);(!M||!M.tagName)&&(M={namespaceURI:Et,tagName:"template"});const z=hn(v.tagName),ae=hn(M.tagName);return Ho[v.namespaceURI]?v.namespaceURI===Mn?M.namespaceURI===je?z==="svg":M.namespaceURI===In?z==="svg"&&(ae==="annotation-xml"||Ln[ae]):!!ai[z]:v.namespaceURI===In?M.namespaceURI===je?z==="math":M.namespaceURI===Mn?z==="math"&&Dn[ae]:!!ii[z]:v.namespaceURI===je?M.namespaceURI===Mn&&!Dn[ae]||M.namespaceURI===In&&!Ln[ae]?!1:!ii[z]&&(im[z]||!ai[z]):!!(Ht==="application/xhtml+xml"&&Ho[v.namespaceURI]):!1},Be=function(v){Mt(t.removed,{element:v});try{A(v).removeChild(v)}catch{y(v)}},lt=function(v,M){try{Mt(t.removed,{attribute:M.getAttributeNode(v),from:M})}catch{Mt(t.removed,{attribute:null,from:M})}if(M.removeAttribute(v),v==="is")if(St||Pn)try{Be(M)}catch{}else try{M.setAttribute(v,"")}catch{}},li=function(v){let M=null,z=null;if(it)v="<remove></remove>"+v;else{const le=Eo(v,/^[\r\n\t ]+/);z=le&&le[0]}Ht==="application/xhtml+xml"&&Et===je&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const ae=x?x.createHTML(v):v;if(Et===je)try{M=new g().parseFromString(ae,Ht)}catch{}if(!M||!M.documentElement){M=L.createDocument(Et,"template",null);try{M.documentElement.innerHTML=Uo?T:ae}catch{}}const ge=M.body||M.documentElement;return v&&z&&ge.insertBefore(n.createTextNode(z),ge.childNodes[0]||null),Et===je?H.call(M,Ie?"html":"body")[0]:Ie?M.documentElement:ge},ci=function(v){return I.call(v.ownerDocument||v,v,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},jo=function(v){return v instanceof p&&(typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||!(v.attributes instanceof f)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function")},di=function(v){return typeof i=="function"&&v instanceof i};function Ve(R,v,M){mn(R,z=>{z.call(t,v,M,At)})}const ui=function(v){let M=null;if(Ve(B.beforeSanitizeElements,v,null),jo(v))return Be(v),!0;const z=fe(v.nodeName);if(Ve(B.uponSanitizeElement,v,{tagName:z,allowedTags:j}),ke&&v.hasChildNodes()&&!di(v.firstElementChild)&&ve(/<[/\w!]/g,v.innerHTML)&&ve(/<[/\w!]/g,v.textContent)||v.nodeType===$t.progressingInstruction||ke&&v.nodeType===$t.comment&&ve(/<[/\w]/g,v.data))return Be(v),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(z))&&(!j[z]||he[z])){if(!he[z]&&pi(z)&&(Q.tagNameCheck instanceof RegExp&&ve(Q.tagNameCheck,z)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(z)))return!1;if(zo&&!Re[z]){const ae=A(v)||v.parentNode,ge=E(v)||v.childNodes;if(ge&&ae){const le=ge.length;for(let xe=le-1;xe>=0;--xe){const Ge=h(ge[xe],!0);Ge.__removalCount=(v.__removalCount||0)+1,ae.insertBefore(Ge,C(v))}}}return Be(v),!0}return v instanceof c&&!um(v)||(z==="noscript"||z==="noembed"||z==="noframes")&&ve(/<\/no(script|embed|frames)/i,v.innerHTML)?(Be(v),!0):(ue&&v.nodeType===$t.text&&(M=v.textContent,mn([V,b,S],ae=>{M=Lt(M,ae," ")}),v.textContent!==M&&(Mt(t.removed,{element:v.cloneNode()}),v.textContent=M)),Ve(B.afterSanitizeElements,v,null),!1)},fi=function(v,M,z){if(ei&&(M==="id"||M==="name")&&(z in n||z in dm))return!1;if(!(Z&&!D[M]&&ve(k,M))){if(!(ie&&ve(_,M))){if(!(J.attributeCheck instanceof Function&&J.attributeCheck(M,v))){if(!Y[M]||D[M]){if(!(pi(v)&&(Q.tagNameCheck instanceof RegExp&&ve(Q.tagNameCheck,v)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(v))&&(Q.attributeNameCheck instanceof RegExp&&ve(Q.attributeNameCheck,M)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(M,v))||M==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&ve(Q.tagNameCheck,z)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(z))))return!1}else if(!Bo[M]){if(!ve(te,Lt(z,N,""))){if(!((M==="src"||M==="xlink:href"||M==="href")&&v!=="script"&&Iu(z,"data:")===0&&ni[v])){if(!(ee&&!ve(O,Lt(z,N,"")))){if(z)return!1}}}}}}}return!0},pi=function(v){return v!=="annotation-xml"&&Eo(v,K)},mi=function(v){Ve(B.beforeSanitizeAttributes,v,null);const{attributes:M}=v;if(!M||jo(v))return;const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let ae=M.length;for(;ae--;){const ge=M[ae],{name:le,namespaceURI:xe,value:Ge}=ge,Nt=fe(le),Vo=Ge;let pe=le==="value"?Vo:Mu(Vo);if(z.attrName=Nt,z.attrValue=pe,z.keepAttr=!0,z.forceKeepAttr=void 0,Ve(B.uponSanitizeAttribute,v,z),pe=z.attrValue,ti&&(Nt==="id"||Nt==="name")&&(lt(le,v),pe=sm+pe),ke&&ve(/((--!?|])>)|<\/(style|title|textarea)/i,pe)){lt(le,v);continue}if(Nt==="attributename"&&Eo(pe,"href")){lt(le,v);continue}if(z.forceKeepAttr)continue;if(!z.keepAttr){lt(le,v);continue}if(!ne&&ve(/\/>/i,pe)){lt(le,v);continue}ue&&mn([V,b,S],gi=>{pe=Lt(pe,gi," ")});const hi=fe(v.nodeName);if(!fi(hi,Nt,pe)){lt(le,v);continue}if(x&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!xe)switch(m.getAttributeType(hi,Nt)){case"TrustedHTML":{pe=x.createHTML(pe);break}case"TrustedScriptURL":{pe=x.createScriptURL(pe);break}}if(pe!==Vo)try{xe?v.setAttributeNS(xe,le,pe):v.setAttribute(le,pe),jo(v)?Be(v):js(t.removed)}catch{lt(le,v)}}Ve(B.afterSanitizeAttributes,v,null)},fm=function R(v){let M=null;const z=ci(v);for(Ve(B.beforeSanitizeShadowDOM,v,null);M=z.nextNode();)Ve(B.uponSanitizeShadowNode,M,null),ui(M),mi(M),M.content instanceof s&&R(M.content);Ve(B.afterSanitizeShadowDOM,v,null)};return t.sanitize=function(R){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=null,z=null,ae=null,ge=null;if(Uo=!R,Uo&&(R="<!-->"),typeof R!="string"&&!di(R))if(typeof R.toString=="function"){if(R=R.toString(),typeof R!="string")throw Dt("dirty is not a string, aborting")}else throw Dt("toString is not a function");if(!t.isSupported)return R;if(at||Wo(v),t.removed=[],typeof R=="string"&&(Ut=!1),Ut){if(R.nodeName){const Ge=fe(R.nodeName);if(!j[Ge]||he[Ge])throw Dt("root node is forbidden and cannot be sanitized in-place")}}else if(R instanceof i)M=li("<!---->"),z=M.ownerDocument.importNode(R,!0),z.nodeType===$t.element&&z.nodeName==="BODY"||z.nodeName==="HTML"?M=z:M.appendChild(z);else{if(!St&&!ue&&!Ie&&R.indexOf("<")===-1)return x&&On?x.createHTML(R):R;if(M=li(R),!M)return St?null:On?T:""}M&&it&&Be(M.firstChild);const le=ci(Ut?R:M);for(;ae=le.nextNode();)ui(ae),mi(ae),ae.content instanceof s&&fm(ae.content);if(Ut)return R;if(St){if(Pn)for(ge=P.call(M.ownerDocument);M.firstChild;)ge.appendChild(M.firstChild);else ge=M;return(Y.shadowroot||Y.shadowrootmode)&&(ge=W.call(o,ge,!0)),ge}let xe=Ie?M.outerHTML:M.innerHTML;return Ie&&j["!doctype"]&&M.ownerDocument&&M.ownerDocument.doctype&&M.ownerDocument.doctype.name&&ve(Xs,M.ownerDocument.doctype.name)&&(xe="<!DOCTYPE "+M.ownerDocument.doctype.name+`>
|
|
62
|
+
`+xe),ue&&mn([V,b,S],Ge=>{xe=Lt(xe,Ge," ")}),x&&On?x.createHTML(xe):xe},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wo(R),at=!0},t.clearConfig=function(){At=null,at=!1},t.isValidAttribute=function(R,v,M){At||Wo({});const z=fe(R),ae=fe(v);return fi(z,ae,M)},t.addHook=function(R,v){typeof v=="function"&&Mt(B[R],v)},t.removeHook=function(R,v){if(v!==void 0){const M=Pu(B[R],v);return M===-1?void 0:Ou(B[R],M,1)[0]}return js(B[R])},t.removeHooks=function(R){B[R]=[]},t.removeAllHooks=function(){B=Qs()},t}var qu=Js();const Ku=({editor:e,error:t})=>{const[,n]=U.useState(0);if(U.useEffect(()=>{if(!e)return;const s=()=>{n(a=>a+1)};return e.on("transaction",s),()=>{e.off("transaction",s)}},[e]),!e)return null;const o=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(),r=()=>l.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return l.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:[l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:o(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:l.jsx(_i,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:o(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:l.jsx(Ui,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:o(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:l.jsx(Ki,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:o(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:l.jsx(qi,{size:14})})]}),l.jsx(r,{}),l.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>l.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:o(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&l.jsx($i,{size:16}),s===2&&l.jsx(zi,{size:16}),s===3&&l.jsx(Ri,{size:14})]},s))}),l.jsx(r,{}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:o(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:l.jsx(Wi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:o(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:l.jsx(Hi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:o(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:l.jsx(Vi,{size:14})})]}),l.jsx(r,{}),l.jsx("div",{className:"flex gap-1",children:l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:o(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:l.jsx(Fi,{size:14})})}),l.jsxs("div",{className:"flex gap-1 ml-auto",children:[l.jsx(r,{}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:o(!1),"aria-label":"Undo",children:l.jsx(Xi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:o(!1),"aria-label":"Redo",children:l.jsx(Gi,{size:14})})]})]})};function Xu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=!!s,i=t[e.name],c=typeof i=="string"?i:e.content||"",d=Yo.useEditor({extensions:[yi.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),wi,xi.configure({limit:e.maxLength||null})],content:qu.sanitize(c),editable:!a,onUpdate:({editor:f})=>{const p=f.getHTML(),g=f.getText().trim().length===0;n(e.name,g?"":p)},onBlur:()=>{o(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[150px] p-4 text-foreground",role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":r?"true":"false",id:e.name}}});return U.useEffect(()=>{d&&t[e.name]!==d.getHTML()&&d.commands.setContent(t[e.name]||"")},[t[e.name],d]),U.useEffect(()=>{d&&d.setEditable(!a)},[a,d]),l.jsxs("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:[e.label&&l.jsx("label",{htmlFor:e.name,className:`block text-sm font-medium mb-1.5 ${r?"text-red-500":"text-foreground"}`,children:e.label}),l.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${r?"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&&l.jsx(Ku,{editor:d,error:r}),l.jsx(Yo.EditorContent,{editor:d}),l.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${r?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:d&&l.jsxs("div",{"aria-live":"polite",children:[d.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})]})}function Zu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const s=typeof e.disabled=="function"?e.disabled(t):e.disabled,a=e.options||[],i=e.inline||e.layout==="inline";if(a.length>0){const c=Array.isArray(t[e.name])?t[e.name]:[],d=(p,g)=>{let m;g?m=[...c,p]:m=c.filter(w=>w!==p),n(e.name,m)},f=r&&e.required&&c.length===0;return l.jsx(l.Fragment,{children:l.jsx("div",{className:i?"grid grid-cols-4 gap-3 mt-3":"space-y-3 mt-3",children:a.map(p=>{const g=typeof p=="object"?p.value:p,m=typeof p=="object"?p.label:p,w=typeof p=="object"?p.description:null,h=`${e.name}-${g}`,y=c.includes(g);return l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx("input",{...e.props,type:"checkbox",id:h,checked:y,onChange:C=>d(g,C.target.checked),onBlur:()=>o(e.name),disabled:s,className:`
|
|
66
63
|
size-4 rounded border-gray-300 text-blue-600 transition-all
|
|
67
64
|
focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
|
68
65
|
${s?"opacity-50 cursor-not-allowed bg-gray-100":"cursor-pointer hover:border-blue-400"}
|
|
69
66
|
${f?"border-red-500":""}
|
|
70
|
-
`})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsxs("label",{htmlFor:h,className:`font-medium ${s?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:[m,e.required&&c.length===0&&l.jsx("span",{className:"text-red-500 ml-1"})]}),w&&!i&&l.jsx("p",{className:`text-sm ${s?"text-gray-400":"text-gray-500"}`,children:w})]})]},b)})})})}return l.jsx("div",{className:"mt-1",children:l.jsxs("div",{className:"space-x-2",children:[l.jsx("input",{...e.props,id:"id_"+e.name,type:"checkbox",checked:t[e.name]||!1,onChange:c=>n(e.name,c.target.checked),onBlur:()=>r(e.name),disabled:s,className:`rounded border-gray-300 ${s?"opacity-50 cursor-not-allowed":""} ${o?"border-red-500":""}`}),l.jsxs("label",{className:"",htmlFor:"id_"+e.name,children:[e.label,e.required&&l.jsx("span",{className:"text-red-500",children:"*"})]})]})})}function Lu(e,t){return u.useReducer((n,r)=>t[n][r]??n,e)}var bn=e=>{const{present:t,children:n}=e,r=Fu(t),o=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),s=oe(r.ref,$u(o));return typeof n=="function"||r.isPresent?u.cloneElement(o,{ref:s}):null};bn.displayName="Presence";function Fu(e){const[t,n]=u.useState(),r=u.useRef(null),o=u.useRef(e),s=u.useRef("none"),a=e?"mounted":"unmounted",[i,c]=Lu(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=vn(r.current);s.current=i==="mounted"?d:"none"},[i]),fe(()=>{const d=r.current,f=o.current;if(f!==e){const b=s.current,m=vn(d);e?c("MOUNT"):m==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&b!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),fe(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=m=>{const h=vn(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&h&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},b=m=>{m.target===t&&(s.current=vn(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function vn(e){return e?.animationName||"none"}function $u(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 Ru=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Js=Ru.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn="Popover",[ea]=tt(yn,[tn]),Rt=tn(),[zu,Je]=ea(yn),ta=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,i=Rt(t),c=u.useRef(null),[d,f]=u.useState(!1),[p,b]=Ot({prop:r,defaultProp:o??!1,onChange:s,caller:yn});return l.jsx(Go,{...i,children:l.jsx(zu,{scope:t,contentId:Tt(),triggerRef:c,open:p,onOpenChange:b,onOpenToggle:u.useCallback(()=>b(m=>!m),[b]),hasCustomAnchor:d,onCustomAnchorAdd:u.useCallback(()=>f(!0),[]),onCustomAnchorRemove:u.useCallback(()=>f(!1),[]),modal:a,children:n})})};ta.displayName=yn;var na="PopoverAnchor",Bu=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Je(na,n),s=Rt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return u.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(sr,{...s,...r,ref:t})});Bu.displayName=na;var ra="PopoverTrigger",oa=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Je(ra,n),s=Rt(n),a=oe(t,o.triggerRef),i=l.jsx(Js.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ca(o.open),...r,ref:a,onClick:X(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(sr,{asChild:!0,...s,children:i})});oa.displayName=ra;var kr="PopoverPortal",[Uu,Wu]=ea(kr,{forceMount:void 0}),sa=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Je(kr,t);return l.jsx(Uu,{scope:t,forceMount:n,children:l.jsx(bn,{present:n||s.open,children:l.jsx(ar,{asChild:!0,container:o,children:r})})})};sa.displayName=kr;var vt="PopoverContent",aa=u.forwardRef((e,t)=>{const n=Wu(vt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Je(vt,e.__scopePopover);return l.jsx(bn,{present:r||s.open,children:s.modal?l.jsx(Vu,{...o,ref:t}):l.jsx(ju,{...o,ref:t})})});aa.displayName=vt;var Hu=ye("PopoverContent.RemoveScroll"),Vu=u.forwardRef((e,t)=>{const n=Je(vt,e.__scopePopover),r=u.useRef(null),o=oe(t,r),s=u.useRef(!1);return u.useEffect(()=>{const a=r.current;if(a)return Qo(a)},[]),l.jsx(fr,{as:Hu,allowPinchZoom:!0,children:l.jsx(ia,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:X(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ju=u.forwardRef((e,t)=>{const n=Je(vt,e.__scopePopover),r=u.useRef(!1),o=u.useRef(!1);return l.jsx(ia,{...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()}})}),ia=u.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...p}=e,b=Je(vt,n),m=Rt(n);return oo(),l.jsx(jn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Un,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>b.onOpenChange(!1),children:l.jsx(Yo,{"data-state":ca(b.open),role:"dialog",id:b.contentId,...m,...p,ref:t,style:{...p.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)"}})})})}),la="PopoverClose",Gu=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Je(la,n);return l.jsx(Js.button,{type:"button",...r,ref:t,onClick:X(e.onClick,()=>o.onOpenChange(!1))})});Gu.displayName=la;var Yu="PopoverArrow",Ku=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Rt(n);return l.jsx(Ko,{...o,...r,ref:t})});Ku.displayName=Yu;function ca(e){return e?"open":"closed"}var qu=ta,Xu=oa,Zu=sa,Qu=aa;function da(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=da(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ju(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=da(e))&&(r&&(r+=" "),r+=t);return r}const ef=(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},tf=(e,t)=>({classGroupId:e,validator:t}),ua=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wn="-",fa=[],nf="arbitrary..",rf=e=>{const t=sf(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return of(a);const i=a.split(wn),c=i[0]===""&&i.length>1?1:0;return pa(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=r[a],d=n[a];return c?d?ef(d,c):c:d||fa}return n[a]||fa}}},pa=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const d=pa(e,t+1,s);if(d)return d}const a=n.validators;if(a===null)return;const i=t===0?e.join(wn):e.slice(t).join(wn),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},of=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?nf+r:void 0})(),sf=e=>{const{theme:t,classGroups:n}=e;return af(n,t)},af=(e,t)=>{const n=ua();for(const r in e){const o=e[r];Pr(o,n,r,t)}return n},Pr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];lf(a,t,n,r)}},lf=(e,t,n,r)=>{if(typeof e=="string"){cf(e,t,n);return}if(typeof e=="function"){df(e,t,n,r);return}uf(e,t,n,r)},cf=(e,t,n)=>{const r=e===""?t:ma(t,e);r.classGroupId=n},df=(e,t,n,r)=>{if(ff(e)){Pr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(tf(n,e))},uf=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,c]=o[a];Pr(c,ma(t,i),n,r)}},ma=(e,t)=>{let n=e;const r=t.split(wn),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},ff=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,pf=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)}}},_r="!",ha=":",mf=[],ga=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),hf=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,c=0,d;const f=o.length;for(let h=0;h<f;h++){const y=o[h];if(a===0&&i===0){if(y===ha){s.push(o.slice(c,h)),c=h+1;continue}if(y==="/"){d=h;continue}}y==="["?a++:y==="]"?a--:y==="("?i++:y===")"&&i--}const p=s.length===0?o:o.slice(c);let b=p,m=!1;p.endsWith(_r)?(b=p.slice(0,-1),m=!0):p.startsWith(_r)&&(b=p.slice(1),m=!0);const w=d&&d>c?d-c:void 0;return ga(s,m,b,w)};if(t){const o=t+ha,s=r;r=a=>a.startsWith(o)?s(a.slice(o.length)):ga(mf,!1,a,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},gf=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]==="[",c=t.has(a);i||c?(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}},bf=e=>({cache:pf(e.cacheSize),parseClassName:hf(e),sortModifiers:gf(e),...rf(e)}),vf=/\s+/,yf=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(vf);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{isExternal:p,modifiers:b,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:h}=n(f);if(p){c=f+(c.length>0?" "+c:c);continue}let y=!!h,C=r(y?w.substring(0,h):w);if(!C){if(!y){c=f+(c.length>0?" "+c:c);continue}if(C=r(w),!C){c=f+(c.length>0?" "+c:c);continue}y=!1}const E=b.length===0?"":b.length===1?b[0]:s(b).join(":"),A=m?E+_r:E,x=A+C;if(a.indexOf(x)>-1)continue;a.push(x);const k=o(C,y);for(let D=0;D<k.length;++D){const I=k[D];a.push(A+I)}c=f+(c.length>0?" "+c:c)}return c},wf=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=ba(n))&&(o&&(o+=" "),o+=r);return o},ba=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ba(e[r]))&&(n&&(n+=" "),n+=t);return n},xf=(e,...t)=>{let n,r,o,s;const a=c=>{const d=t.reduce((f,p)=>p(f),e());return n=bf(d),r=n.cache.get,o=n.cache.set,s=i,i(c)},i=c=>{const d=r(c);if(d)return d;const f=yf(c,n);return o(c,f),f};return s=a,(...c)=>s(wf(...c))},Sf=[],le=e=>{const t=n=>n[e]||Sf;return t.isThemeGetter=!0,t},va=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ya=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cf=/^\d+\/\d+$/,Ef=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Af=/\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$/,Nf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Tf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yt=e=>Cf.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),et=e=>!!e&&Number.isInteger(Number(e)),Or=e=>e.endsWith("%")&&G(e.slice(0,-1)),He=e=>Ef.test(e),Pf=()=>!0,_f=e=>Af.test(e)&&!Nf.test(e),wa=()=>!1,Of=e=>Tf.test(e),If=e=>kf.test(e),Mf=e=>!F(e)&&!$(e),Df=e=>wt(e,Aa,wa),F=e=>va.test(e),st=e=>wt(e,Na,_f),Ir=e=>wt(e,zf,G),xa=e=>wt(e,Ca,wa),Lf=e=>wt(e,Ea,If),xn=e=>wt(e,Ta,Of),$=e=>ya.test(e),zt=e=>xt(e,Na),Ff=e=>xt(e,Bf),Sa=e=>xt(e,Ca),$f=e=>xt(e,Aa),Rf=e=>xt(e,Ea),Sn=e=>xt(e,Ta,!0),wt=(e,t,n)=>{const r=va.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},xt=(e,t,n=!1)=>{const r=ya.exec(e);return r?r[1]?t(r[1]):n:!1},Ca=e=>e==="position"||e==="percentage",Ea=e=>e==="image"||e==="url",Aa=e=>e==="length"||e==="size"||e==="bg-size",Na=e=>e==="length",zf=e=>e==="number",Bf=e=>e==="family-name",Ta=e=>e==="shadow",Uf=xf(()=>{const e=le("color"),t=le("font"),n=le("text"),r=le("font-weight"),o=le("tracking"),s=le("leading"),a=le("breakpoint"),i=le("container"),c=le("spacing"),d=le("radius"),f=le("shadow"),p=le("inset-shadow"),b=le("text-shadow"),m=le("drop-shadow"),w=le("blur"),h=le("perspective"),y=le("aspect"),C=le("ease"),E=le("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...x(),$,F],D=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],_=()=>[$,F,c],U=()=>[yt,"full","auto",..._()],H=()=>[et,"none","subgrid",$,F],B=()=>["auto",{span:["full",et,$,F]},et,$,F],j=()=>[et,"auto",$,F],g=()=>["auto","min","max","fr",$,F],S=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],T=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",..._()],O=()=>[yt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],N=()=>[e,$,F],q=()=>[...x(),Sa,xa,{position:[$,F]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",$f,Df,{size:[$,F]}],Ae=()=>[Or,zt,st],Y=()=>["","none","full",d,$,F],re=()=>["",G,zt,st],Q=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>[G,Or,Sa,xa],J=()=>["","none",w,$,F],ae=()=>["none",G,$,F],Z=()=>["none",G,$,F],ee=()=>[G,$,F],ne=()=>[yt,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[He],breakpoint:[He],color:[Pf],container:[He],"drop-shadow":[He],ease:["in","out","in-out"],font:[Mf],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[He],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[He],shadow:[He],spacing:["px",G],text:[He],"text-shadow":[He],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yt,F,$,y]}],container:["container"],columns:[{columns:[G,F,$,i]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:k()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[et,"auto",$,F]}],basis:[{basis:[yt,"full","auto",i,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[G,yt,"auto","initial","none",F]}],grow:[{grow:["",G,$,F]}],shrink:[{shrink:["",G,$,F]}],order:[{order:[et,"first","last","none",$,F]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:B()}],"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":g()}],"auto-rows":[{"auto-rows":g()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...S(),"normal"]}],"justify-items":[{"justify-items":[...T(),"normal"]}],"justify-self":[{"justify-self":["auto",...T()]}],"align-content":[{content:["normal",...S()]}],"align-items":[{items:[...T(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...T(),{baseline:["","last"]}]}],"place-content":[{"place-content":S()}],"place-items":[{"place-items":[...T(),"baseline"]}],"place-self":[{"place-self":["auto",...T()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[i,"screen",...O()]}],"min-w":[{"min-w":[i,"screen","none",...O()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,zt,st]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,$,Ir]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Or,F]}],"font-family":[{font:[Ff,F,t]}],"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,$,F]}],"line-clamp":[{"line-clamp":[G,"none",$,Ir]}],leading:[{leading:[s,..._()]}],"list-image":[{"list-image":["none",$,F]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$,F]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[G,"from-font","auto",$,st]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[G,"auto",$,F]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$,F]}],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",$,F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},et,$,F],radial:["",$,F],conic:[et,$,F]},Rf,Lf]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:Ae()}],"gradient-via-pos":[{via:Ae()}],"gradient-to-pos":[{to:Ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],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:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[G,$,F]}],"outline-w":[{outline:["",G,zt,st]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",f,Sn,xn]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",p,Sn,xn]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[G,st]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",b,Sn,xn]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[G,$,F]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"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":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[$,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":x()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$,F]}],filter:[{filter:["","none",$,F]}],blur:[{blur:J()}],brightness:[{brightness:[G,$,F]}],contrast:[{contrast:[G,$,F]}],"drop-shadow":[{"drop-shadow":["","none",m,Sn,xn]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",G,$,F]}],"hue-rotate":[{"hue-rotate":[G,$,F]}],invert:[{invert:["",G,$,F]}],saturate:[{saturate:[G,$,F]}],sepia:[{sepia:["",G,$,F]}],"backdrop-filter":[{"backdrop-filter":["","none",$,F]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[G,$,F]}],"backdrop-contrast":[{"backdrop-contrast":[G,$,F]}],"backdrop-grayscale":[{"backdrop-grayscale":["",G,$,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,$,F]}],"backdrop-invert":[{"backdrop-invert":["",G,$,F]}],"backdrop-opacity":[{"backdrop-opacity":[G,$,F]}],"backdrop-saturate":[{"backdrop-saturate":[G,$,F]}],"backdrop-sepia":[{"backdrop-sepia":["",G,$,F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$,F]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[G,"initial",$,F]}],ease:[{ease:["linear","initial",C,$,F]}],delay:[{delay:[G,$,F]}],animate:[{animate:["none",E,$,F]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,$,F]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[$,F,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",$,F]}],"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":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",$,F]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[G,zt,st,Ir]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Cn(...e){return Uf(Ju(e))}function En({...e}){return l.jsx(qu,{"data-slot":"popover",...e})}function An({...e}){return l.jsx(Xu,{"data-slot":"popover-trigger",...e})}function Nn({className:e,align:t="center",sideOffset:n=4,...r}){return l.jsx(Zu,{children:l.jsx(Qu,{"data-slot":"popover-content",align:t,sideOffset:n,className:Cn("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 Wf({field:e,formValues:t,handleChange:n,handleBlur:r,error:o}){const[s,a]=W.useState(!1),i=t[e.name]??{from:null,to:null},c=f=>n(e.name,f),d=()=>n(e.name,{from:null,to:null});return l.jsx("div",{children:l.jsxs(En,{open:s,onOpenChange:a,children:[l.jsx(An,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
|
|
67
|
+
`})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsxs("label",{htmlFor:h,className:`font-medium ${s?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:[m,e.required&&c.length===0&&l.jsx("span",{className:"text-red-500 ml-1"})]}),w&&!i&&l.jsx("p",{className:`text-sm ${s?"text-gray-400":"text-gray-500"}`,children:w})]})]},g)})})})}return l.jsx("div",{className:"mt-1",children:l.jsxs("div",{className:"space-x-2",children:[l.jsx("input",{...e.props,id:"id_"+e.name,type:"checkbox",checked:t[e.name]||!1,onChange:c=>n(e.name,c.target.checked),onBlur:()=>o(e.name),disabled:s,className:`rounded border-gray-300 ${s?"opacity-50 cursor-not-allowed":""} ${r?"border-red-500":""}`}),l.jsxs("label",{className:"",htmlFor:"id_"+e.name,children:[e.label,e.required&&l.jsx("span",{className:"text-red-500",children:"*"})]})]})})}function Qu(e,t){return u.useReducer((n,o)=>t[n][o]??n,e)}var bn=e=>{const{present:t,children:n}=e,o=Ju(t),r=typeof n=="function"?n({present:o.isPresent}):u.Children.only(n),s=se(o.ref,ef(r));return typeof n=="function"||o.isPresent?u.cloneElement(r,{ref:s}):null};bn.displayName="Presence";function Ju(e){const[t,n]=u.useState(),o=u.useRef(null),r=u.useRef(e),s=u.useRef("none"),a=e?"mounted":"unmounted",[i,c]=Qu(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=vn(o.current);s.current=i==="mounted"?d:"none"},[i]),me(()=>{const d=o.current,f=r.current;if(f!==e){const g=s.current,m=vn(d);e?c("MOUNT"):m==="none"||d?.display==="none"?c("UNMOUNT"):c(f&&g!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),me(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=m=>{const h=vn(o.current).includes(CSS.escape(m.animationName));if(m.target===t&&h&&(c("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},g=m=>{m.target===t&&(s.current=vn(o.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:u.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function vn(e){return e?.animationName||"none"}function ef(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 tf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ea=tf.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),yn="Popover",[ta]=tt(yn,[tn]),zt=tn(),[nf,Je]=ta(yn),na=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,i=zt(t),c=u.useRef(null),[d,f]=u.useState(!1),[p,g]=Ot({prop:o,defaultProp:r??!1,onChange:s,caller:yn});return l.jsx(Yr,{...i,children:l.jsx(nf,{scope:t,contentId:kt(),triggerRef:c,open:p,onOpenChange:g,onOpenToggle:u.useCallback(()=>g(m=>!m),[g]),hasCustomAnchor:d,onCustomAnchorAdd:u.useCallback(()=>f(!0),[]),onCustomAnchorRemove:u.useCallback(()=>f(!1),[]),modal:a,children:n})})};na.displayName=yn;var oa="PopoverAnchor",of=u.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Je(oa,n),s=zt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=r;return u.useEffect(()=>(a(),()=>i()),[a,i]),l.jsx(so,{...s,...o,ref:t})});of.displayName=oa;var ra="PopoverTrigger",sa=u.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Je(ra,n),s=zt(n),a=se(t,r.triggerRef),i=l.jsx(ea.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":da(r.open),...o,ref:a,onClick:X(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?i:l.jsx(so,{asChild:!0,...s,children:i})});sa.displayName=ra;var _o="PopoverPortal",[rf,sf]=ta(_o,{forceMount:void 0}),aa=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=Je(_o,t);return l.jsx(rf,{scope:t,forceMount:n,children:l.jsx(bn,{present:n||s.open,children:l.jsx(ao,{asChild:!0,container:r,children:o})})})};aa.displayName=_o;var vt="PopoverContent",ia=u.forwardRef((e,t)=>{const n=sf(vt,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=Je(vt,e.__scopePopover);return l.jsx(bn,{present:o||s.open,children:s.modal?l.jsx(lf,{...r,ref:t}):l.jsx(cf,{...r,ref:t})})});ia.displayName=vt;var af=we("PopoverContent.RemoveScroll"),lf=u.forwardRef((e,t)=>{const n=Je(vt,e.__scopePopover),o=u.useRef(null),r=se(t,o),s=u.useRef(!1);return u.useEffect(()=>{const a=o.current;if(a)return Jr(a)},[]),l.jsx(po,{as:af,allowPinchZoom:!0,children:l.jsx(la,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0,d=i.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:X(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),cf=u.forwardRef((e,t)=>{const n=Je(vt,e.__scopePopover),o=u.useRef(!1),r=u.useRef(!1);return l.jsx(la,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),la=u.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...p}=e,g=Je(vt,n),m=zt(n);return ar(),l.jsx(Vn,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:l.jsx(Un,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:l.jsx(qr,{"data-state":da(g.open),role:"dialog",id:g.contentId,...m,...p,ref:t,style:{...p.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)"}})})})}),ca="PopoverClose",df=u.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Je(ca,n);return l.jsx(ea.button,{type:"button",...o,ref:t,onClick:X(e.onClick,()=>r.onOpenChange(!1))})});df.displayName=ca;var uf="PopoverArrow",ff=u.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=zt(n);return l.jsx(Kr,{...r,...o,ref:t})});ff.displayName=uf;function da(e){return e?"open":"closed"}var pf=na,mf=sa,hf=aa,gf=ia;function ua(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=ua(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function bf(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ua(e))&&(o&&(o+=" "),o+=t);return o}const vf=(e,t)=>{const n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},yf=(e,t)=>({classGroupId:e,validator:t}),fa=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wn="-",pa=[],wf="arbitrary..",xf=e=>{const t=Cf(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Sf(a);const i=a.split(wn),c=i[0]===""&&i.length>1?1:0;return ma(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=o[a],d=n[a];return c?d?vf(d,c):c:d||pa}return n[a]||pa}}},ma=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const d=ma(e,t+1,s);if(d)return d}const a=n.validators;if(a===null)return;const i=t===0?e.join(wn):e.slice(t).join(wn),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},Sf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?wf+o:void 0})(),Cf=e=>{const{theme:t,classGroups:n}=e;return Ef(n,t)},Ef=(e,t)=>{const n=fa();for(const o in e){const r=e[o];Po(r,n,o,t)}return n},Po=(e,t,n,o)=>{const r=e.length;for(let s=0;s<r;s++){const a=e[s];Af(a,t,n,o)}},Af=(e,t,n,o)=>{if(typeof e=="string"){Nf(e,t,n);return}if(typeof e=="function"){kf(e,t,n,o);return}Tf(e,t,n,o)},Nf=(e,t,n)=>{const o=e===""?t:ha(t,e);o.classGroupId=n},kf=(e,t,n,o)=>{if(_f(e)){Po(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(yf(n,e))},Tf=(e,t,n,o)=>{const r=Object.entries(e),s=r.length;for(let a=0;a<s;a++){const[i,c]=r[a];Po(c,ha(t,i),n,o)}},ha=(e,t)=>{let n=e;const o=t.split(wn),r=o.length;for(let s=0;s<r;s++){const a=o[s];let i=n.nextPart.get(a);i||(i=fa(),n.nextPart.set(a,i)),n=i}return n},_f=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Pf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const r=(s,a)=>{n[s]=a,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=o[s])!==void 0)return r(s,a),a},set(s,a){s in n?n[s]=a:r(s,a)}}},Oo="!",ga=":",Of=[],ba=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),If=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const s=[];let a=0,i=0,c=0,d;const f=r.length;for(let h=0;h<f;h++){const y=r[h];if(a===0&&i===0){if(y===ga){s.push(r.slice(c,h)),c=h+1;continue}if(y==="/"){d=h;continue}}y==="["?a++:y==="]"?a--:y==="("?i++:y===")"&&i--}const p=s.length===0?r:r.slice(c);let g=p,m=!1;p.endsWith(Oo)?(g=p.slice(0,-1),m=!0):p.startsWith(Oo)&&(g=p.slice(1),m=!0);const w=d&&d>c?d-c:void 0;return ba(s,m,g,w)};if(t){const r=t+ga,s=o;o=a=>a.startsWith(r)?s(a.slice(r.length)):ba(Of,!1,a,void 0,!0)}if(n){const r=o;o=s=>n({className:s,parseClassName:r})}return o},Mf=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let r=[];for(let s=0;s<n.length;s++){const a=n[s],i=a[0]==="[",c=t.has(a);i||c?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(a)):r.push(a)}return r.length>0&&(r.sort(),o.push(...r)),o}},Lf=e=>({cache:Pf(e.cacheSize),parseClassName:If(e),sortModifiers:Mf(e),...xf(e)}),Df=/\s+/,Ff=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:s}=t,a=[],i=e.trim().split(Df);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{isExternal:p,modifiers:g,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:h}=n(f);if(p){c=f+(c.length>0?" "+c:c);continue}let y=!!h,C=o(y?w.substring(0,h):w);if(!C){if(!y){c=f+(c.length>0?" "+c:c);continue}if(C=o(w),!C){c=f+(c.length>0?" "+c:c);continue}y=!1}const E=g.length===0?"":g.length===1?g[0]:s(g).join(":"),A=m?E+Oo:E,x=A+C;if(a.indexOf(x)>-1)continue;a.push(x);const T=r(C,y);for(let L=0;L<T.length;++L){const I=T[L];a.push(A+I)}c=f+(c.length>0?" "+c:c)}return c},$f=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=va(n))&&(r&&(r+=" "),r+=o);return r},va=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=va(e[o]))&&(n&&(n+=" "),n+=t);return n},zf=(e,...t)=>{let n,o,r,s;const a=c=>{const d=t.reduce((f,p)=>p(f),e());return n=Lf(d),o=n.cache.get,r=n.cache.set,s=i,i(c)},i=c=>{const d=o(c);if(d)return d;const f=Ff(c,n);return r(c,f),f};return s=a,(...c)=>s($f(...c))},Rf=[],de=e=>{const t=n=>n[e]||Rf;return t.isThemeGetter=!0,t},ya=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bf=/^\d+\/\d+$/,Uf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hf=/\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$/,Wf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yt=e=>Bf.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),et=e=>!!e&&Number.isInteger(Number(e)),Io=e=>e.endsWith("%")&&G(e.slice(0,-1)),We=e=>Uf.test(e),Gf=()=>!0,Yf=e=>Hf.test(e)&&!Wf.test(e),xa=()=>!1,qf=e=>jf.test(e),Kf=e=>Vf.test(e),Xf=e=>!F(e)&&!$(e),Zf=e=>wt(e,Na,xa),F=e=>ya.test(e),st=e=>wt(e,ka,Yf),Mo=e=>wt(e,np,G),Sa=e=>wt(e,Ea,xa),Qf=e=>wt(e,Aa,Kf),xn=e=>wt(e,Ta,qf),$=e=>wa.test(e),Rt=e=>xt(e,ka),Jf=e=>xt(e,op),Ca=e=>xt(e,Ea),ep=e=>xt(e,Na),tp=e=>xt(e,Aa),Sn=e=>xt(e,Ta,!0),wt=(e,t,n)=>{const o=ya.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},xt=(e,t,n=!1)=>{const o=wa.exec(e);return o?o[1]?t(o[1]):n:!1},Ea=e=>e==="position"||e==="percentage",Aa=e=>e==="image"||e==="url",Na=e=>e==="length"||e==="size"||e==="bg-size",ka=e=>e==="length",np=e=>e==="number",op=e=>e==="family-name",Ta=e=>e==="shadow",rp=zf(()=>{const e=de("color"),t=de("font"),n=de("text"),o=de("font-weight"),r=de("tracking"),s=de("leading"),a=de("breakpoint"),i=de("container"),c=de("spacing"),d=de("radius"),f=de("shadow"),p=de("inset-shadow"),g=de("text-shadow"),m=de("drop-shadow"),w=de("blur"),h=de("perspective"),y=de("aspect"),C=de("ease"),E=de("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...x(),$,F],L=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[$,F,c],H=()=>[yt,"full","auto",...P()],W=()=>[et,"none","subgrid",$,F],B=()=>["auto",{span:["full",et,$,F]},et,$,F],V=()=>[et,"auto",$,F],b=()=>["auto","min","max","fr",$,F],S=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],k=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...P()],O=()=>[yt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],N=()=>[e,$,F],K=()=>[...x(),Ca,Sa,{position:[$,F]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",ep,Zf,{size:[$,F]}],Ne=()=>[Io,Rt,st],Y=()=>["","none","full",d,$,F],oe=()=>["",G,Rt,st],Q=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>[G,Io,Ca,Sa],J=()=>["","none",w,$,F],ie=()=>["none",G,$,F],Z=()=>["none",G,$,F],ee=()=>[G,$,F],ne=()=>[yt,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[We],breakpoint:[We],color:[Gf],container:[We],"drop-shadow":[We],ease:["in","out","in-out"],font:[Xf],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[We],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[We],shadow:[We],spacing:["px",G],text:[We],"text-shadow":[We],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yt,F,$,y]}],container:["container"],columns:[{columns:[G,F,$,i]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{start:H()}],end:[{end:H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[et,"auto",$,F]}],basis:[{basis:[yt,"full","auto",i,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[G,yt,"auto","initial","none",F]}],grow:[{grow:["",G,$,F]}],shrink:[{shrink:["",G,$,F]}],order:[{order:[et,"first","last","none",$,F]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":b()}],"auto-rows":[{"auto-rows":b()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...S(),"normal"]}],"justify-items":[{"justify-items":[...k(),"normal"]}],"justify-self":[{"justify-self":["auto",...k()]}],"align-content":[{content:["normal",...S()]}],"align-items":[{items:[...k(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...k(),{baseline:["","last"]}]}],"place-content":[{"place-content":S()}],"place-items":[{"place-items":[...k(),"baseline"]}],"place-self":[{"place-self":["auto",...k()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[i,"screen",...O()]}],"min-w":[{"min-w":[i,"screen","none",...O()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,Rt,st]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,$,Mo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Io,F]}],"font-family":[{font:[Jf,F,t]}],"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:[r,$,F]}],"line-clamp":[{"line-clamp":[G,"none",$,Mo]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",$,F]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$,F]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[G,"from-font","auto",$,st]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[G,"auto",$,F]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$,F]}],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",$,F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},et,$,F],radial:["",$,F],conic:[et,$,F]},tp,Qf]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:Ne()}],"gradient-via-pos":[{via:Ne()}],"gradient-to-pos":[{to:Ne()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],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-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:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[G,$,F]}],"outline-w":[{outline:["",G,Rt,st]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",f,Sn,xn]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",p,Sn,xn]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[G,st]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",g,Sn,xn]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[G,$,F]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[$,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":x()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$,F]}],filter:[{filter:["","none",$,F]}],blur:[{blur:J()}],brightness:[{brightness:[G,$,F]}],contrast:[{contrast:[G,$,F]}],"drop-shadow":[{"drop-shadow":["","none",m,Sn,xn]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",G,$,F]}],"hue-rotate":[{"hue-rotate":[G,$,F]}],invert:[{invert:["",G,$,F]}],saturate:[{saturate:[G,$,F]}],sepia:[{sepia:["",G,$,F]}],"backdrop-filter":[{"backdrop-filter":["","none",$,F]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[G,$,F]}],"backdrop-contrast":[{"backdrop-contrast":[G,$,F]}],"backdrop-grayscale":[{"backdrop-grayscale":["",G,$,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,$,F]}],"backdrop-invert":[{"backdrop-invert":["",G,$,F]}],"backdrop-opacity":[{"backdrop-opacity":[G,$,F]}],"backdrop-saturate":[{"backdrop-saturate":[G,$,F]}],"backdrop-sepia":[{"backdrop-sepia":["",G,$,F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$,F]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[G,"initial",$,F]}],ease:[{ease:["linear","initial",C,$,F]}],delay:[{delay:[G,$,F]}],animate:[{animate:["none",E,$,F]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,$,F]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[$,F,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",$,F]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",$,F]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[G,Rt,st,Mo]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Cn(...e){return rp(bf(e))}function En({...e}){return l.jsx(pf,{"data-slot":"popover",...e})}function An({...e}){return l.jsx(mf,{"data-slot":"popover-trigger",...e})}function Nn({className:e,align:t="center",sideOffset:n=4,...o}){return l.jsx(hf,{children:l.jsx(gf,{"data-slot":"popover-content",align:t,sideOffset:n,className:Cn("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),...o})})}function sp({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const[s,a]=U.useState(!1),i=t[e.name]??{from:null,to:null},c=f=>n(e.name,f),d=()=>n(e.name,{from:null,to:null});return l.jsx("div",{children:l.jsxs(En,{open:s,onOpenChange:a,children:[l.jsx(An,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
|
|
71
68
|
inline-flex items-center justify-between gap-2
|
|
72
69
|
w-full h-9 rounded-md border bg-white
|
|
73
70
|
px-3 py-2 text-sm font-normal shadow-sm
|
|
74
71
|
hover:bg-gray-50 hover:text-gray-900
|
|
75
72
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
|
|
76
73
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
77
|
-
${
|
|
78
|
-
`,children:[i.from?i.to?l.jsxs("span",{children:[i.from.toLocaleDateString()," –"," ",i.to.toLocaleDateString()]}):l.jsx("span",{children:i.from.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date range"}),l.jsx("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-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(Nn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($n.DayPicker,{mode:"range",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,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"}),l.jsx("button",{type:"button",onClick:()=>a(!1),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
|
|
74
|
+
${r?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
|
|
75
|
+
`,children:[i.from?i.to?l.jsxs("span",{children:[i.from.toLocaleDateString()," –"," ",i.to.toLocaleDateString()]}):l.jsx("span",{children:i.from.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date range"}),l.jsx("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-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(Nn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($n.DayPicker,{mode:"range",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,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"}),l.jsx("button",{type:"button",onClick:()=>a(!1),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 _a({field:e,formValues:t,error:n,fileUploads:o,fileInputRefs:r,handleChange:s,onFieldsChange:a,api_URL:i,disabled:c}){const d=c,f=e.type==="multifile",p=o?.[e.name]||{},g=t[e.name],m=f?g||[]:[g].filter(Boolean),[w,h]=U.useState(!1),y=i?`${i}uploads`:null;!y&&e.uploadEndpoint&&console.error(`api_URL prop is required when using FileField with upload functionality for field "${e.name}"`);const C=b=>{if(b===0)return"0 Bytes";const S=1024,k=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(b)/Math.log(S));return`${parseFloat((b/S**_).toFixed(2))} ${k[_]}`},E=async b=>{const S=new FormData;S.append("file",b);const k=await fetch(`${y}`,{method:"POST",body:S});if(!k.ok)throw Wt.toast.error("Upload failed"),new Error("Upload failed");return await k.json()},A=async(b,S)=>{if(!S)return;if(b.maxSize&&S.size>b.maxSize)throw new Error(`File size must not exceed ${C(b.maxSize)}`);const k=await E(S),_={...t,[b.name]:k};s(b.name,k),a(_)},x=async(b,S)=>{const k=t[b.name]||[];if(b.maxFiles&&k.length+S.length>b.maxFiles)throw new Error(`Maximum ${b.maxFiles} files allowed`);S.forEach(N=>{if(b.maxSize&&N.size>b.maxSize)throw new Error(`Each file must not exceed ${C(b.maxSize)}`)});const _=await Promise.all(S.map(N=>E(N))),O=[...k,..._];s(b.name,O),a({...t,[b.name]:O})},T=async(b,S)=>{if(d)return;const k=Array.from(S);try{e.type==="multifile"?await x(e,k):await A(e,k[0]),r.current?.[b]&&(r.current[b].value="")}catch(_){Wt.toast.error(`Upload failed: ${_.message}`)}},L=async(b,S)=>{if(d)return;let k;e.type==="file"?k="":k=(t[b]||[]).filter(O=>O!==S),s(b,k),a({...t,[b]:k}),r.current?.[b]&&(r.current[b].value="")},I=b=>{b.preventDefault(),d||h(!0)},P=b=>{b.preventDefault(),d||h(!1)},H=b=>{b.preventDefault(),h(!1),!d&&b.dataTransfer.files&&b.dataTransfer.files.length>0&&T(e.name,b.dataTransfer.files)},W=e.accept?e.accept.split(",").map(b=>b.split("/")[1]||b.split(".")[1]||b).join(", ").toUpperCase():"PNG, JPG, PDF",B=e.maxSize?`, up to ${C(e.maxSize)}`:"",V=`
|
|
79
76
|
w-full flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg transition-all duration-200
|
|
80
77
|
// Ensure focus styling is handled correctly for the button element
|
|
81
78
|
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50
|
|
82
79
|
${d?"bg-gray-50 border-gray-300 text-gray-400 cursor-not-allowed opacity-70":w?"bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 hover:border-blue-400 hover:bg-gray-50 cursor-pointer"}
|
|
83
|
-
`;return l.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("button",{type:"button",className:
|
|
80
|
+
`;return l.jsx("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("button",{type:"button",className:V,onClick:()=>{d||r?.current?.[e.name]?.click()},onDragOver:I,onDragEnter:I,onDragLeave:P,onDrop:H,disabled:d,children:[l.jsx("div",{className:"border-gray-400 border p-1 mb-3 rounded-md bg-gray-100 shadow-md ",children:l.jsx(Di,{size:24,className:"m-1"})}),l.jsxs("p",{className:"text-sm font-normal",children:[l.jsxs("span",{className:d?"text-gray-400":"text-blue-600 hover:text-blue-700 underline",children:["Upload ",f?"Files":"a file"]}),l.jsx("span",{className:"font-light",children:" or drag and drop"})]}),l.jsxs("p",{className:"text-xs mt-1 text-gray-500",children:[W,B,f&&e.maxFiles&&`, Max ${e.maxFiles} files`]})]}),l.jsx("input",{ref:b=>{b&&r&&r.current&&(r.current[e.name]=b)},id:e.name,type:"file",accept:e.accept,multiple:f,className:"sr-only",onChange:b=>T(e.name,b.target.files),disabled:d}),m.length>0&&l.jsx("div",{className:"space-y-2 pt-2 border-t border-gray-200",children:m.map((b,S)=>{const k=b.original_name||b.name||"File",_=b.size||null;return l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[l.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[l.jsx("span",{className:"text-sm truncate",children:k}),_&&l.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:["(",C(_),")"]})]}),l.jsx("button",{type:"button",onClick:()=>L(e.name,b),className:`text-red-500 hover:text-red-700 ml-3 flex-shrink-0 ${d?"cursor-not-allowed opacity-50":""}`,disabled:d,children:"Remove"})]},b.url||b.original_name||S)})}),Object.entries(p).map(([b,S])=>S.status==="uploading"?l.jsxs("div",{className:"relative pt-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",b]}),l.jsxs("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[S.progress,"%"]})]}),l.jsx("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:l.jsx("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${S.progress}%`}})})]},b):null)]})},e.name)}function ap({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,charCount:s,setCharCounts:a}){const i=U.useRef(null),c=t[e.name]||"",d=typeof e.disabled=="function"?e.disabled(t):e.disabled||e.readOnly,f=()=>{const g=i.current;g&&(g.style.height="auto",g.style.height=`${g.scrollHeight+2}px`)};U.useEffect(()=>{f()},[c]);const p=g=>{n(e.name,g.target.value),f(),a&&a(m=>({...m,[e.name]:g.target.value.length}))};return l.jsxs("div",{className:"space-y-2",children:[l.jsx("textarea",{...e.props,ref:i,id:e.name,name:e.name,placeholder:e.placeholder||"",value:c,onChange:p,onBlur:()=>o(e.name),disabled:d,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 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${d?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),l.jsx("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&l.jsxs("span",{className:"text-xs text-gray-500",children:[s||0,"/",e.maxLength," characters"]})})]})}function ip({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const[s,a]=U.useState(!1),i=t[e.name],c=i?new Date(i):null,d=c?(c.getHours()%12||12).toString().padStart(2,"0"):"12",f=c?c.getMinutes().toString().padStart(2,"0"):"00",p=c?c.getHours()>=12?"PM":"AM":"PM",g=x=>{if(!x){n(e.name,null);return}const T=new Date(x);c?(T.setHours(c.getHours()),T.setMinutes(c.getMinutes())):(T.setHours(12),T.setMinutes(0)),n(e.name,T)},m=(x,T,L)=>{const I=c?new Date(c):new Date;let P=parseInt(x);L==="PM"&&P!==12&&(P+=12),L==="AM"&&P===12&&(P=0),I.setHours(P),I.setMinutes(parseInt(T)),n(e.name,I)},w=()=>{let x=parseInt(d);x=x%12+1,m(x.toString(),f,p)},h=()=>{let x=parseInt(d);x=x===1?12:x-1,m(x.toString(),f,p)},y=()=>{let x=parseInt(f);x=(x+5)%60,m(d,x.toString(),p)},C=()=>{let x=parseInt(f);x=x===0?55:x-5,m(d,x.toString(),p)},E=()=>{m(d,f,p==="AM"?"PM":"AM")},A=()=>n(e.name,null);return l.jsxs("div",{className:"relative",children:[l.jsxs(En,{open:s,onOpenChange:a,children:[l.jsx(An,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:x=>x.key==="Enter"&&a(!0),className:`
|
|
84
81
|
group inline-flex items-center justify-between gap-2
|
|
85
82
|
w-full h-10 rounded-lg border bg-white
|
|
86
83
|
px-3 py-2 text-sm font-normal shadow-sm transition-all
|
|
87
84
|
hover:bg-slate-50 hover:border-slate-300
|
|
88
85
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
|
|
89
86
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
90
|
-
${
|
|
91
|
-
`,children:[c?l.jsx("span",{className:"text-slate-900 ",children:c.toLocaleString()}):l.jsx("span",{className:"text-slate-400",children:e.placeholder||"Select date and time"}),l.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:[l.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),l.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),l.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),l.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})]})}),l.jsxs(Nn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-white rounded-xl shadow-xl border border-slate-200",children:[l.jsx("div",{className:"p-3",children:l.jsx($n.DayPicker,{mode:"single",selected:c,onSelect:b,showOutsideDays:!0,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]"}})}),l.jsx("div",{className:"border-t border-slate-100 p-4 bg-slate-50/50",children:l.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx("button",{type:"button",onClick:w,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:l.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:l.jsx("path",{d:"m18 15-6-6-6 6"})})}),l.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}),l.jsx("button",{type:"button",onClick:h,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:l.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:l.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),l.jsx("span",{className:"text-xl font-medium text-slate-300 pb-1",children:":"}),l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx("button",{type:"button",onClick:y,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:l.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:l.jsx("path",{d:"m18 15-6-6-6 6"})})}),l.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:f}),l.jsx("button",{type:"button",onClick:C,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:l.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:l.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),l.jsxs("div",{className:"flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm",children:[l.jsx("button",{type:"button",onClick:()=>p!=="AM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${p==="AM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),l.jsx("button",{type:"button",onClick:()=>p!=="PM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${p==="PM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"PM"})]})]})}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-slate-100 p-3 bg-white rounded-b-xl",children:[l.jsx("button",{type:"button",onClick:A,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"}),l.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&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:o})]})}var jf=Symbol.for("react.lazy"),Tn=u[" use ".trim().toString()];function Gf(e){return typeof e=="object"&&e!==null&&"then"in e}function Pa(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===jf&&"_payload"in e&&Gf(e._payload)}function Yf(e){const t=Kf(e),n=u.forwardRef((r,o)=>{let{children:s,...a}=r;Pa(s)&&typeof Tn=="function"&&(s=Tn(s._payload));const i=u.Children.toArray(s),c=i.find(Xf);if(c){const d=c.props.children,f=i.map(p=>p===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...a,ref:o,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Kf(e){const t=u.forwardRef((n,r)=>{let{children:o,...s}=n;if(Pa(o)&&typeof Tn=="function"&&(o=Tn(o._payload)),u.isValidElement(o)){const a=Qf(o),i=Zf(s,o.props);return o.type!==u.Fragment&&(i.ref=r?Rn(r,a):a),u.cloneElement(o,i)}return u.Children.count(o)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qf=Symbol("radix.slottable");function Xf(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qf}function Zf(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 c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Qf(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 Jf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ep=Jf.reduce((e,t)=>{const n=Yf(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),tp="Separator",_a="horizontal",np=["horizontal","vertical"],Oa=u.forwardRef((e,t)=>{const{decorative:n,orientation:r=_a,...o}=e,s=rp(r)?r:_a,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(ep.div,{"data-orientation":s,...i,...o,ref:t})});Oa.displayName=tp;function rp(e){return np.includes(e)}var op=Oa;function Mr({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return l.jsx(op,{"data-slot":"separator",decorative:n,orientation:t,className:Cn("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 sp({field:e}){return e?.label?l.jsxs("div",{className:"relative flex items-center py-4",children:[l.jsx(Mr,{className:"flex-1 h-px bg-gray-300"}),l.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),l.jsx(Mr,{className:"flex-1 h-px bg-gray-300"})]}):l.jsx(Mr,{className:"my-4 h-px bg-gray-300"})}var ap=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kn=ap.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ip=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ia=ip.reduce((e,t)=>{const n=ye(`Primitive.${t}`),r=u.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Dr="rovingFocusGroup.onEntryFocus",lp={bubbles:!1,cancelable:!0},Bt="RovingFocusGroup",[Lr,Ma,cp]=Qr(Bt),[dp,Da]=tt(Bt,[cp]),[up,fp]=dp(Bt),La=u.forwardRef((e,t)=>l.jsx(Lr.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Lr.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(pp,{...e,ref:t})})}));La.displayName=Bt;var pp=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,b=u.useRef(null),m=oe(t,b),w=zn(s),[h,y]=Ot({prop:a,defaultProp:i??null,onChange:c,caller:Bt}),[C,E]=u.useState(!1),A=Ye(d),x=Ma(n),k=u.useRef(!1),[D,I]=u.useState(0);return u.useEffect(()=>{const _=b.current;if(_)return _.addEventListener(Dr,A),()=>_.removeEventListener(Dr,A)},[A]),l.jsx(up,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:h,onItemFocus:u.useCallback(_=>y(_),[y]),onItemShiftTab:u.useCallback(()=>E(!0),[]),onFocusableItemAdd:u.useCallback(()=>I(_=>_+1),[]),onFocusableItemRemove:u.useCallback(()=>I(_=>_-1),[]),children:l.jsx(Ia.div,{tabIndex:C||D===0?-1:0,"data-orientation":r,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:X(e.onMouseDown,()=>{k.current=!0}),onFocus:X(e.onFocus,_=>{const U=!k.current;if(_.target===_.currentTarget&&U&&!C){const H=new CustomEvent(Dr,lp);if(_.currentTarget.dispatchEvent(H),!H.defaultPrevented){const B=x().filter(P=>P.focusable),j=B.find(P=>P.active),g=B.find(P=>P.id===h),T=[j,g,...B].filter(Boolean).map(P=>P.ref.current);Ra(T,f)}}k.current=!1}),onBlur:X(e.onBlur,()=>E(!1))})})}),Fa="RovingFocusGroupItem",$a=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,c=Tt(),d=s||c,f=fp(Fa,n),p=f.currentTabStopId===d,b=Ma(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:h}=f;return u.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),l.jsx(Lr.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:l.jsx(Ia.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:X(e.onMouseDown,y=>{r?f.onItemFocus(d):y.preventDefault()}),onFocus:X(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:X(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const C=gp(y,f.orientation,f.dir);if(C!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let A=b().filter(x=>x.focusable).map(x=>x.ref.current);if(C==="last")A.reverse();else if(C==="prev"||C==="next"){C==="prev"&&A.reverse();const x=A.indexOf(y.currentTarget);A=f.loop?bp(A,x+1):A.slice(x+1)}setTimeout(()=>Ra(A))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:h!=null}):a})})});$a.displayName=Fa;var mp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gp(e,t,n){const r=hp(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mp[r]}function Ra(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vp=La,yp=$a,Fr="Radio",[wp,za]=tt(Fr),[xp,Sp]=wp(Fr),Ba=u.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:s,disabled:a,value:i="on",onCheck:c,form:d,...f}=e,[p,b]=u.useState(null),m=oe(t,y=>b(y)),w=u.useRef(!1),h=p?d||!!p.closest("form"):!0;return l.jsxs(xp,{scope:n,checked:o,disabled:a,children:[l.jsx(kn.button,{type:"button",role:"radio","aria-checked":o,"data-state":Va(o),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:m,onClick:X(e.onClick,y=>{o||c?.(),h&&(w.current=y.isPropagationStopped(),w.current||y.stopPropagation())})}),h&&l.jsx(Ha,{control:p,bubbles:!w.current,name:r,value:i,checked:o,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Ba.displayName=Fr;var Ua="RadioIndicator",Wa=u.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,s=Sp(Ua,n);return l.jsx(bn,{present:r||s.checked,children:l.jsx(kn.span,{"data-state":Va(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t})})});Wa.displayName=Ua;var Cp="RadioBubbleInput",Ha=u.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=u.useRef(null),i=oe(a,s),c=qo(n),d=Fo(t);return u.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&m){const w=new Event("click",{bubbles:r});m.call(f,n),f.dispatchEvent(w)}},[c,n,r]),l.jsx(kn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ha.displayName=Cp;function Va(e){return e?"checked":"unchecked"}var Ep=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Pn="RadioGroup",[Ap]=tt(Pn,[Da,za]),ja=Da(),Ga=za(),[Np,Tp]=Ap(Pn),Ya=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:s,required:a=!1,disabled:i=!1,orientation:c,dir:d,loop:f=!0,onValueChange:p,...b}=e,m=ja(n),w=zn(d),[h,y]=Ot({prop:s,defaultProp:o??null,onChange:p,caller:Pn});return l.jsx(Np,{scope:n,name:r,required:a,disabled:i,value:h,onValueChange:y,children:l.jsx(vp,{asChild:!0,...m,orientation:c,dir:w,loop:f,children:l.jsx(kn.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:w,...b,ref:t})})})});Ya.displayName=Pn;var Ka="RadioGroupItem",qa=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,s=Tp(Ka,n),a=s.disabled||r,i=ja(n),c=Ga(n),d=u.useRef(null),f=oe(t,d),p=s.value===o.value,b=u.useRef(!1);return u.useEffect(()=>{const m=h=>{Ep.includes(h.key)&&(b.current=!0)},w=()=>b.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",w)}},[]),l.jsx(yp,{asChild:!0,...i,focusable:!a,active:p,children:l.jsx(Ba,{disabled:a,required:s.required,checked:p,...c,...o,name:s.name,ref:f,onCheck:()=>s.onValueChange(o.value),onKeyDown:X(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:X(o.onFocus,()=>{b.current&&d.current?.click()})})})});qa.displayName=Ka;var kp="RadioGroupIndicator",Xa=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=Ga(n);return l.jsx(Wa,{...o,...r,ref:t})});Xa.displayName=kp;var Pp=Ya,_p=qa,Op=Xa;function Ip({className:e,...t}){return l.jsx(Pp,{"data-slot":"radio-group",className:Cn("grid gap-3",e),...t})}function Za({className:e,...t}){return l.jsx(_p,{"data-slot":"radio-group-item",className:Cn("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:l.jsx(Op,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:l.jsx(Pi,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Mp({field:e,formValues:t,handleChange:n,handleBlur:r,error:o,disabled:s}){const a=t[e.name]||"",i=s,c=e.options||[],d=e.inline||!1,f=e.renderType==="segment",p=f?"mt-2 inline-flex w-full md:w-auto p-1 rounded-md bg-gray-50 border border-gray-200 shadow-inner":d?"flex flex-wrap gap-4":"space-y-3";return l.jsxs("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:[l.jsx(Ip,{value:a,onValueChange:b=>n(e.name,b),onBlur:()=>r(e.name),disabled:i,className:p,"aria-label":e.label||e.name,children:c.map(b=>{const m=typeof b=="object"?b.value:b,w=typeof b=="object"?b.label:b,h=typeof b=="object"?b.description:null,y=`${e.name}-${m}`,C=a===m;return f?l.jsxs("label",{htmlFor:y,className:`
|
|
87
|
+
${r?"border-red-500 focus-visible:ring-red-500":"border-slate-200 focus-visible:ring-blue-500"}
|
|
88
|
+
`,children:[c?l.jsx("span",{className:"text-slate-900 ",children:c.toLocaleString()}):l.jsx("span",{className:"text-slate-400",children:e.placeholder||"Select date and time"}),l.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:[l.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"}),l.jsx("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),l.jsx("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),l.jsx("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})]})}),l.jsxs(Nn,{align:"start",sideOffset:4,className:"z-50 w-auto p-0 bg-white rounded-xl shadow-xl border border-slate-200",children:[l.jsx("div",{className:"p-3",children:l.jsx($n.DayPicker,{mode:"single",selected:c,onSelect:g,showOutsideDays:!0,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]"}})}),l.jsx("div",{className:"border-t border-slate-100 p-4 bg-slate-50/50",children:l.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx("button",{type:"button",onClick:w,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:l.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:l.jsx("path",{d:"m18 15-6-6-6 6"})})}),l.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}),l.jsx("button",{type:"button",onClick:h,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:l.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:l.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),l.jsx("span",{className:"text-xl font-medium text-slate-300 pb-1",children:":"}),l.jsxs("div",{className:"flex flex-col items-center gap-1",children:[l.jsx("button",{type:"button",onClick:y,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:l.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:l.jsx("path",{d:"m18 15-6-6-6 6"})})}),l.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:f}),l.jsx("button",{type:"button",onClick:C,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:l.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:l.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),l.jsxs("div",{className:"flex flex-col gap-1 bg-white p-1 rounded-lg border border-slate-200 shadow-sm",children:[l.jsx("button",{type:"button",onClick:()=>p!=="AM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${p==="AM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),l.jsx("button",{type:"button",onClick:()=>p!=="PM"&&E(),className:`px-3 py-1 text-xs font-bold rounded-md transition-all ${p==="PM"?"bg-blue-50 text-blue-600":"text-slate-400 hover:text-slate-600"}`,children:"PM"})]})]})}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-slate-100 p-3 bg-white rounded-b-xl",children:[l.jsx("button",{type:"button",onClick:A,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"}),l.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"})]})]})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}var lp=Symbol.for("react.lazy"),kn=u[" use ".trim().toString()];function cp(e){return typeof e=="object"&&e!==null&&"then"in e}function Pa(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===lp&&"_payload"in e&&cp(e._payload)}function dp(e){const t=up(e),n=u.forwardRef((o,r)=>{let{children:s,...a}=o;Pa(s)&&typeof kn=="function"&&(s=kn(s._payload));const i=u.Children.toArray(s),c=i.find(pp);if(c){const d=c.props.children,f=i.map(p=>p===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...a,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return l.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function up(e){const t=u.forwardRef((n,o)=>{let{children:r,...s}=n;if(Pa(r)&&typeof kn=="function"&&(r=kn(r._payload)),u.isValidElement(r)){const a=hp(r),i=mp(s,r.props);return r.type!==u.Fragment&&(i.ref=o?zn(o,a):a),u.cloneElement(r,i)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fp=Symbol("radix.slottable");function pp(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fp}function mp(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...i)=>{const c=s(...i);return r(...i),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function hp(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 gp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bp=gp.reduce((e,t)=>{const n=dp(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),vp="Separator",Oa="horizontal",yp=["horizontal","vertical"],Ia=u.forwardRef((e,t)=>{const{decorative:n,orientation:o=Oa,...r}=e,s=wp(o)?o:Oa,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(bp.div,{"data-orientation":s,...i,...r,ref:t})});Ia.displayName=vp;function wp(e){return yp.includes(e)}var xp=Ia;function Lo({className:e,orientation:t="horizontal",decorative:n=!0,...o}){return l.jsx(xp,{"data-slot":"separator",decorative:n,orientation:t,className:Cn("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),...o})}function Sp({field:e}){return e?.label?l.jsxs("div",{className:"relative flex items-center py-4",children:[l.jsx(Lo,{className:"flex-1 h-px bg-gray-300"}),l.jsx("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),l.jsx(Lo,{className:"flex-1 h-px bg-gray-300"})]}):l.jsx(Lo,{className:"my-4 h-px bg-gray-300"})}var Cp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tn=Cp.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ep=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ma=Ep.reduce((e,t)=>{const n=we(`Primitive.${t}`),o=u.forwardRef((r,s)=>{const{asChild:a,...i}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Do="rovingFocusGroup.onEntryFocus",Ap={bubbles:!1,cancelable:!0},Bt="RovingFocusGroup",[Fo,La,Np]=er(Bt),[kp,Da]=tt(Bt,[Np]),[Tp,_p]=kp(Bt),Fa=u.forwardRef((e,t)=>l.jsx(Fo.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Fo.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Pp,{...e,ref:t})})}));Fa.displayName=Bt;var Pp=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=u.useRef(null),m=se(t,g),w=Rn(s),[h,y]=Ot({prop:a,defaultProp:i??null,onChange:c,caller:Bt}),[C,E]=u.useState(!1),A=Ye(d),x=La(n),T=u.useRef(!1),[L,I]=u.useState(0);return u.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(Do,A),()=>P.removeEventListener(Do,A)},[A]),l.jsx(Tp,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:h,onItemFocus:u.useCallback(P=>y(P),[y]),onItemShiftTab:u.useCallback(()=>E(!0),[]),onFocusableItemAdd:u.useCallback(()=>I(P=>P+1),[]),onFocusableItemRemove:u.useCallback(()=>I(P=>P-1),[]),children:l.jsx(Ma.div,{tabIndex:C||L===0?-1:0,"data-orientation":o,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:X(e.onMouseDown,()=>{T.current=!0}),onFocus:X(e.onFocus,P=>{const H=!T.current;if(P.target===P.currentTarget&&H&&!C){const W=new CustomEvent(Do,Ap);if(P.currentTarget.dispatchEvent(W),!W.defaultPrevented){const B=x().filter(_=>_.focusable),V=B.find(_=>_.active),b=B.find(_=>_.id===h),k=[V,b,...B].filter(Boolean).map(_=>_.ref.current);Ra(k,f)}}T.current=!1}),onBlur:X(e.onBlur,()=>E(!1))})})}),$a="RovingFocusGroupItem",za=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:a,...i}=e,c=kt(),d=s||c,f=_p($a,n),p=f.currentTabStopId===d,g=La(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:h}=f;return u.useEffect(()=>{if(o)return m(),()=>w()},[o,m,w]),l.jsx(Fo.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:l.jsx(Ma.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:X(e.onMouseDown,y=>{o?f.onItemFocus(d):y.preventDefault()}),onFocus:X(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:X(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const C=Mp(y,f.orientation,f.dir);if(C!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let A=g().filter(x=>x.focusable).map(x=>x.ref.current);if(C==="last")A.reverse();else if(C==="prev"||C==="next"){C==="prev"&&A.reverse();const x=A.indexOf(y.currentTarget);A=f.loop?Lp(A,x+1):A.slice(x+1)}setTimeout(()=>Ra(A))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:h!=null}):a})})});za.displayName=$a;var Op={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ip(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Mp(e,t,n){const o=Ip(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Op[o]}function Ra(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Lp(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Dp=Fa,Fp=za,$o="Radio",[$p,Ba]=tt($o),[zp,Rp]=$p($o),Ua=u.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:r=!1,required:s,disabled:a,value:i="on",onCheck:c,form:d,...f}=e,[p,g]=u.useState(null),m=se(t,y=>g(y)),w=u.useRef(!1),h=p?d||!!p.closest("form"):!0;return l.jsxs(zp,{scope:n,checked:r,disabled:a,children:[l.jsx(Tn.button,{type:"button",role:"radio","aria-checked":r,"data-state":Va(r),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:m,onClick:X(e.onClick,y=>{r||c?.(),h&&(w.current=y.isPropagationStopped(),w.current||y.stopPropagation())})}),h&&l.jsx(ja,{control:p,bubbles:!w.current,name:o,value:i,checked:r,required:s,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Ua.displayName=$o;var Ha="RadioIndicator",Wa=u.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...r}=e,s=Rp(Ha,n);return l.jsx(bn,{present:o||s.checked,children:l.jsx(Tn.span,{"data-state":Va(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})})});Wa.displayName=Ha;var Bp="RadioBubbleInput",ja=u.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const a=u.useRef(null),i=se(a,s),c=Xr(n),d=$r(t);return u.useEffect(()=>{const f=a.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&m){const w=new Event("click",{bubbles:o});m.call(f,n),f.dispatchEvent(w)}},[c,n,o]),l.jsx(Tn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:i,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ja.displayName=Bp;function Va(e){return e?"checked":"unchecked"}var Up=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_n="RadioGroup",[Hp]=tt(_n,[Da,Ba]),Ga=Da(),Ya=Ba(),[Wp,jp]=Hp(_n),qa=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:r,value:s,required:a=!1,disabled:i=!1,orientation:c,dir:d,loop:f=!0,onValueChange:p,...g}=e,m=Ga(n),w=Rn(d),[h,y]=Ot({prop:s,defaultProp:r??null,onChange:p,caller:_n});return l.jsx(Wp,{scope:n,name:o,required:a,disabled:i,value:h,onValueChange:y,children:l.jsx(Dp,{asChild:!0,...m,orientation:c,dir:w,loop:f,children:l.jsx(Tn.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":i?"":void 0,dir:w,...g,ref:t})})})});qa.displayName=_n;var Ka="RadioGroupItem",Xa=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...r}=e,s=jp(Ka,n),a=s.disabled||o,i=Ga(n),c=Ya(n),d=u.useRef(null),f=se(t,d),p=s.value===r.value,g=u.useRef(!1);return u.useEffect(()=>{const m=h=>{Up.includes(h.key)&&(g.current=!0)},w=()=>g.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",w)}},[]),l.jsx(Fp,{asChild:!0,...i,focusable:!a,active:p,children:l.jsx(Ua,{disabled:a,required:s.required,checked:p,...c,...r,name:s.name,ref:f,onCheck:()=>s.onValueChange(r.value),onKeyDown:X(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:X(r.onFocus,()=>{g.current&&d.current?.click()})})})});Xa.displayName=Ka;var Vp="RadioGroupIndicator",Za=u.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,r=Ya(n);return l.jsx(Wa,{...r,...o,ref:t})});Za.displayName=Vp;var Gp=qa,Yp=Xa,qp=Za;function Kp({className:e,...t}){return l.jsx(Gp,{"data-slot":"radio-group",className:Cn("grid gap-3",e),...t})}function Qa({className:e,...t}){return l.jsx(Yp,{"data-slot":"radio-group-item",className:Cn("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:l.jsx(qp,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:l.jsx(Li,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Xp({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=t[e.name]||"",i=s,c=e.options||[],d=e.inline||!1,f=e.renderType==="segment",p=f?"mt-2 inline-flex w-full md:w-auto p-1 rounded-md bg-gray-50 border border-gray-200 shadow-inner":d?"flex flex-wrap gap-4":"space-y-3";return l.jsxs("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,children:[l.jsx(Kp,{value:a,onValueChange:g=>n(e.name,g),onBlur:()=>o(e.name),disabled:i,className:p,"aria-label":e.label||e.name,children:c.map(g=>{const m=typeof g=="object"?g.value:g,w=typeof g=="object"?g.label:g,h=typeof g=="object"?g.description:null,y=`${e.name}-${m}`,C=a===m;return f?l.jsxs("label",{htmlFor:y,className:`
|
|
92
89
|
relative flex-1 min-w-max text-center px-4 py-2 rounded-lg text-sm font-medium transition-colors duration-200 ease-in-out cursor-pointer select-none
|
|
93
90
|
${C?"bg-white text-gray-900 shadow-md ring-2 ring-gray-100":"text-gray-500 hover:bg-gray-100"}
|
|
94
|
-
${i?"opacity-50 cursor-not-allowed":""} `,children:[l.jsx(
|
|
91
|
+
${i?"opacity-50 cursor-not-allowed":""} `,children:[l.jsx(Qa,{value:m,id:y,disabled:i,className:"absolute truncate h-0 w-0 opacity-0 pointer-events-none"}),w]},m):l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx(Qa,{value:m,id:y,disabled:i,className:`
|
|
95
92
|
relative size-4 rounded-full border transition-all
|
|
96
93
|
${i?"border-gray-300 bg-gray-100 cursor-not-allowed":"border-gray-300 bg-white hover:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"}
|
|
97
94
|
data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600
|
|
98
|
-
`})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsx("label",{htmlFor:y,className:`font-medium ${i?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:w}),h&&!d&&l.jsx("p",{className:`text-sm ${i?"text-gray-400":"text-gray-500"}`,children:h})]})]},m)})}),
|
|
99
|
-
${i[
|
|
95
|
+
`})}),l.jsxs("div",{className:"ml-3 text-sm",children:[l.jsx("label",{htmlFor:y,className:`font-medium ${i?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:w}),h&&!d&&l.jsx("p",{className:`text-sm ${i?"text-gray-400":"text-gray-500"}`,children:h})]})]},m)})}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function Zp({field:e}){const t=e.text||e.label||"",n=e.description||"",o=e.size||"2xl",r=e.separator||!1,s=e.align||"left",a=e.className||"",i={md:"text-lg font-semibold",lg:"text-xl font-bold",xl:"text-2xl font-extrabold","2xl":"text-3xl font-extrabold","3xl":"text-4xl font-extrabold"},c={left:"text-left",center:"text-center",right:"text-right"},d={line:"border-b border-gray-200 pb-3",space:"pb-4",false:""},f=`
|
|
96
|
+
${i[o]||i["2xl"]}
|
|
100
97
|
${c[s]||c.left}
|
|
101
98
|
${a}
|
|
102
99
|
text-gray-900 tracking-tight w-full
|
|
103
100
|
`.trim(),p=`
|
|
104
101
|
mt-1 text-lg text-gray-500 w-full
|
|
105
102
|
${c[s]||c.left}
|
|
106
|
-
`.trim();return l.jsxs("div",{className:`my-6 col-span-full w-full border-b border-gray-300 pb-2 ${d[
|
|
103
|
+
`.trim();return l.jsxs("div",{className:`my-6 col-span-full w-full border-b border-gray-300 pb-2 ${d[r]||d.false}`,children:[l.jsx("h2",{className:f,children:t}),n&&l.jsx("p",{className:p,children:n})]})}function Qp({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const[s,a]=U.useState(!1),i=t[e.name]??null,c=f=>n(e.name,f),d=()=>n(e.name,null);return l.jsx("div",{children:l.jsxs(En,{open:s,onOpenChange:a,children:[l.jsx(An,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),onKeyDown:f=>f.key==="Enter"&&a(!0),className:`
|
|
107
104
|
inline-flex items-center justify-between gap-2
|
|
108
105
|
w-full h-9 rounded-md border bg-white
|
|
109
106
|
px-3 py-2 text-sm font-normal shadow-sm
|
|
110
107
|
hover:bg-gray-50 hover:text-gray-900
|
|
111
108
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
|
|
112
109
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
113
|
-
${
|
|
114
|
-
`,children:[i?l.jsx("span",{children:i.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date"}),l.jsx("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-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(Nn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($n.DayPicker,{mode:"single",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,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"}),l.jsx("button",{type:"button",onClick:()=>a(!1),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
|
|
110
|
+
${r?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
|
|
111
|
+
`,children:[i?l.jsx("span",{children:i.toLocaleDateString()}):l.jsx("span",{className:"text-muted-foreground",children:e.placeholder||"Select date"}),l.jsx("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-chevron-down opacity-70",children:l.jsx("path",{d:"m6 9 6 6 6-6"})})]})}),l.jsxs(Nn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[l.jsx($n.DayPicker,{mode:"single",selected:i,onSelect:c,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[l.jsx("button",{type:"button",onClick:d,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"}),l.jsx("button",{type:"button",onClick:()=>a(!1),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 Jp({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const[s,a]=U.useState(!1),[i,c]=U.useState("12"),[d,f]=U.useState("00"),[p,g]=U.useState("PM"),m=t[e.name]||"";U.useEffect(()=>{if(m){const x=m.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);x&&(c(x[1].padStart(2,"0")),f(x[2]),g(x[3].toUpperCase()))}},[m]);const w=()=>{const x=`${i}:${d} ${p}`;n(e.name,x),a(!1)},h=()=>{n(e.name,""),c("12"),f("00"),g("PM")},y=()=>{const x=parseInt(i);c((x%12+1).toString().padStart(2,"0"))},C=()=>{const x=parseInt(i);c((x===1?12:x-1).toString().padStart(2,"0"))},E=()=>{const x=parseInt(d);f(((x+5)%60).toString().padStart(2,"0"))},A=()=>{const x=parseInt(d);f((x===0?55:x-5).toString().padStart(2,"0"))};return l.jsx("div",{children:l.jsxs(En,{open:s,onOpenChange:a,children:[l.jsx(An,{asChild:!0,children:l.jsxs("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":s,onClick:()=>a(!0),className:`
|
|
115
112
|
inline-flex items-center justify-between gap-2
|
|
116
113
|
w-full h-9 rounded-md border bg-white
|
|
117
114
|
px-3 py-2 text-sm font-normal shadow-sm
|
|
118
115
|
hover:bg-gray-50 hover:text-gray-900
|
|
119
116
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
|
|
120
117
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
121
|
-
${
|
|
122
|
-
`,children:[m?l.jsx("span",{children:m}):l.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),l.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:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),l.jsx(Nn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:y,className:"p-1 hover:bg-gray-100 rounded",children:l.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:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:i,onChange:x=>{const
|
|
118
|
+
${r?"border-red-500 focus-visible:ring-red-500":"border-gray-300 focus-visible:ring-blue-500"}
|
|
119
|
+
`,children:[m?l.jsx("span",{children:m}):l.jsx("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),l.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:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]})]})}),l.jsx(Nn,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:y,className:"p-1 hover:bg-gray-100 rounded",children:l.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:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:i,onChange:x=>{const T=x.target.value.replace(/\D/g,"");(T===""||parseInt(T)>=1&&parseInt(T)<=12)&&c(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"}),l.jsx("button",{type:"button",onClick:C,className:"p-1 hover:bg-gray-100 rounded",children:l.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:l.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),l.jsx("span",{className:"text-2xl font-semibold",children:":"}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("button",{type:"button",onClick:E,className:"p-1 hover:bg-gray-100 rounded",children:l.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:l.jsx("polyline",{points:"18 15 12 9 6 15"})})}),l.jsx("input",{type:"text",value:d,onChange:x=>{const T=x.target.value.replace(/\D/g,"");(T===""||parseInt(T)>=0&&parseInt(T)<=59)&&f(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"}),l.jsx("button",{type:"button",onClick:A,className:"p-1 hover:bg-gray-100 rounded",children:l.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:l.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),l.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[l.jsx("button",{type:"button",onClick:()=>g("AM"),className:`
|
|
123
120
|
px-3 py-1 text-sm font-medium rounded
|
|
124
121
|
${p==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
125
|
-
`,children:"AM"}),l.jsx("button",{type:"button",onClick:()=>
|
|
122
|
+
`,children:"AM"}),l.jsx("button",{type:"button",onClick:()=>g("PM"),className:`
|
|
126
123
|
px-3 py-1 text-sm font-medium rounded
|
|
127
124
|
${p==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
128
|
-
`,children:"PM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[l.jsx("button",{type:"button",onClick:h,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"}),l.jsx("button",{type:"button",onClick:w,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
|
|
125
|
+
`,children:"PM"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[l.jsx("button",{type:"button",onClick:h,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"}),l.jsx("button",{type:"button",onClick:w,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 em({message:e}){return l.jsx("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Mi,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function tm({message:e}){return l.jsx("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Oi,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function nm({message:e}){return l.jsx("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Ii,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function om({message:e}){return l.jsx("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Bi,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),l.jsx("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}function rm({field:e}){const{variant:t="info",message:n,content:o}=e,r=n||o||"";switch(t.toLowerCase()){case"error":case"danger":return l.jsx(em,{message:r});case"success":return l.jsx(nm,{message:r});case"warning":case"warn":return l.jsx(tm,{message:r});case"info":case"information":default:return l.jsx(om,{message:r})}}const Ja=({apiClient:e,api_URL:t,footerMode:n="normal",formDefinition:o,returnType:r=!1,sendFormValues:s=()=>{},children:a,defaultValues:i={},onFieldsChange:c=()=>{},debugMode:d=!1})=>{const[f,p]=U.useState({...i}),[g,m]=U.useState({}),[w,h]=U.useState({}),[y,C]=U.useState({}),E=U.useRef({}),A=["hidden","html","linebreak","header","alert"],x=U.useMemo(()=>({file:_a,multifile:_a,dateRange:sp,date:Qp,dayTimePicker:ip,time:Jp,hidden:Si,multiselect:Ci,searchselect:Qi,select:Eu,email:Au,html:Xu,checkbox:Zu,radiogroup:Xp,input:Us,number:Nu,textarea:ap,header:Zp,alert:rm,linebreak:Sp}),[]),T=async(b,S=null)=>{if(!e){const k=`apiClient prop is required when using fields with optionsUrl. Field "${b.name}" requires optionsUrl but no apiClient was provided.`;d&&console.error(k),Wt.toast.error(k);return}try{const k=await e(`/${b.optionsUrl}`);let _=[];b.type==="select"?_=[{value:"",label:`Select ${b.label.toLowerCase()}`},...k.data]:_=[...k.data.map(O=>({value:O.value,label:O.label}))],o.fields.forEach(O=>{O.name===b.name&&(O.options=_)})}catch(k){d&&console.error(`Failed to load options for ${b.name}:`,k)}finally{}};U.useEffect(()=>{if(o?.fields&&o.fields.length>0){if(!o.fields.some(k=>k.value))return;o.fields.forEach(k=>{k.optionsUrl&&T(k)});const S={};o.fields.forEach(k=>{if(!k.name)return;const _=k.type==="multiselect"||k.type==="searchselect"||k.type==="checkbox"&&k.options&&k.options.length>0;S[k.name]=i[k.name]??k.value??(_?[]:"")}),p(S)}},[o]);const L=(b,S,k)=>{const _=typeof S=="object"&&S!==null&&!Array.isArray(S)&&!(S instanceof Date),O=S==null||typeof S=="string"&&S.trim()===""||Array.isArray(S)&&S.length===0||b.type==="checkbox"&&S===!1||_&&Object.keys(S).length===0;if(b.required&&O)return d&&console.warn(`VALIDATION FAILED (REQUIRED): ${b.name} is empty.`),`${b.label} is required`;if(O&&!b.required)return null;if(b.validate){const N=b.validate(S,k);if(N)return N}if(b.type==="email"&&S&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S))return"Please enter a valid email address";if(b.type==="number"){if(b.min!==void 0&&S<b.min)return`${b.label} must be at least ${b.min}`;if(b.max!==void 0&&S>b.max)return`${b.label} must be no more than ${b.max}`}return b.type==="date"&&S&&!Fn(S).isValid()?`${b.label} must be a valid date`:b.maxLength&&S&&S.length>b.maxLength?`${b.label} must not exceed ${b.maxLength} characters`:null},I=(b,S)=>{const k=o.fields.find(O=>O.name===b);if(!k)return;const _={...f};k.type==="multiselect"||k.type==="searchselect"?Array.isArray(S)?_[b]=S:S&&S.target&&S.target.selectedOptions?_[b]=Array.from(S.target.selectedOptions).map(O=>O.value):_[b]=S:k.type==="dateRange"?_[b]=[{startDate:S[0].from,endDate:S[0].to,key:"selection"}]:k.type==="dayTimePicker"?_[b]=S?Fn(S).format("YYYY-MM-DD HH:mm:ss"):"":k.type==="number"?_[b]=S===""?"":Number(S):_[b]=S,k.type==="select"&&o.fields.forEach(O=>{if(O.showIf&&!O.showIf(_)){const N=O.type==="multiselect"||O.type==="searchselect"||O.type==="checkbox"&&O.options&&O.options.length>0;_[O.name]=N?[]:""}}),o.fields.forEach(O=>{if(typeof O.disabled=="function"&&O.disabled(_)){const N=O.type==="multiselect"||O.type==="searchselect"||O.type==="checkbox"&&O.options&&O.options.length>0;_[O.name]=N?[]:""}}),p(_)},P=b=>{h({...w,[b]:!0})},H=b=>{b.preventDefault();const S={};o.fields.forEach(_=>{_.name&&(S[_.name]=!0)}),h(S);const k={};if(o.fields.forEach(_=>{if(_.name&&(!_.showIf||_.showIf(f))){const O=L(_,f[_.name],f);O&&(k[_.name]=O)}}),m(k),Object.keys(k).length===0){const _=(N,K)=>{if(N===""||N===null||N===void 0)return null;const te=K?.toLowerCase();if(Array.isArray(N))return te==="number"||te==="integer"?N.map(j=>j===""?null:Number(j)):N;switch(te){case"number":case"integer":case"float":return Number(N);case"boolean":case"bool":return String(N).toLowerCase()==="true"||N===!0;case"date":case"datetime":{const j=Fn(N);return j.isValid()?j.toISOString():N}default:return N}},O={};o.fields.forEach(N=>{if(N.name){const K=f[N.name],te=N.fieldType||"string",j=_(K,te);r?O[N.name]={value:j,fieldType:te}:O[N.name]=j}}),d?console.log("Form submitted with values:",O):s(O)}else Wt.toast.error("Please correct the errors in the form")};U.useEffect(()=>{c(f)},[f,c]);const W={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 B(b,S,k){if(d&&(k?console.log(`[fieldFormat RENDER] Rendering error for ${S.name}: ${k}`):g[S.name]&&console.log(`[fieldFormat RENDER] Error exists in state for ${S.name} but not passed in props!`)),A.includes(S.type))return l.jsx("div",{className:S.fieldClass||"col-span-full",children:b});const _=S.containerStyle,O=S.color||"blue",N=_==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${S.containerClassName||W[O]||W.blue}`:"",K=l.jsxs(l.Fragment,{children:[S.label&&l.jsxs("label",{htmlFor:S.name,className:"block text-sm font-medium mb-1",children:[S.label,S.required&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),l.jsx("div",{children:b}),k&&l.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]});return l.jsx("div",{className:`mb-4 ${S.fieldClass||"col-span-8"}`,children:_==="card"?l.jsx("div",{className:N,children:K}):K})}const V=b=>{if(b.showIf&&!b.showIf(f))return null;const S=x[b.type]||Us;if(f[b.name]===void 0){const O=b.type==="multiselect"||b.type==="searchselect"||b.type==="checkbox"&&b.options&&b.options.length>0;f[b.name]=b.value!==void 0?b.value:O?[]:""}const k=g[b.name]?g[b.name]:null,_=typeof b.disabled=="function"?b.disabled(f):!!b.disabled;return B(l.jsx(S,{field:b,formValues:f,handleChange:I,handleBlur:()=>P(b.name),setCharCounts:C,charCount:y[b.name]||0,api_URL:t,error:k,fileInputRefs:E,disabled:_,apiClient:e}),b,k)};return l.jsxs("form",{onSubmit:H,className:"grid grid-cols-12 gap-x-4 mx-auto w-full ",children:[o?o.fields.map(b=>l.jsx("div",{className:"col-span-full",children:V(b)},b.name+b.type)):l.jsx("div",{children:"Loading..."}),l.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:U.Children.map(a,b=>U.isValidElement(b)&&b.props.onClick?U.cloneElement(b,{onClick:S=>{b.props.onClick(f,S)}}):b)})]})};ce.DynamicForm=Ja,ce.default=Ja,Object.defineProperties(ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|