@notmrabhi/flowforge 0.1.58 → 0.1.59

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.
Files changed (27) hide show
  1. package/dist/{SchemaBuilderDrawer-9m1q_f4y.js → SchemaBuilderDrawer-CJHR9dPS.js} +2 -2
  2. package/dist/{SchemaBuilderDrawer-9m1q_f4y.js.map → SchemaBuilderDrawer-CJHR9dPS.js.map} +1 -1
  3. package/dist/{SchemaBuilderDrawer-C54xKa-P.js → SchemaBuilderDrawer-CfM5EWlM.js} +2 -2
  4. package/dist/{SchemaBuilderDrawer-C54xKa-P.js.map → SchemaBuilderDrawer-CfM5EWlM.js.map} +1 -1
  5. package/dist/{WorkflowExecutionHistory-6N7KWqCG.js → WorkflowExecutionHistory-Bpw-YeJU.js} +2 -2
  6. package/dist/{WorkflowExecutionHistory-6N7KWqCG.js.map → WorkflowExecutionHistory-Bpw-YeJU.js.map} +1 -1
  7. package/dist/{WorkflowExecutionHistory-DwIjOwPH.js → WorkflowExecutionHistory-CEaTBcS4.js} +2 -2
  8. package/dist/{WorkflowExecutionHistory-DwIjOwPH.js.map → WorkflowExecutionHistory-CEaTBcS4.js.map} +1 -1
  9. package/dist/canvas.cjs +1 -1
  10. package/dist/canvas.js +1 -1
  11. package/dist/form.cjs +1 -1
  12. package/dist/form.js +2 -2
  13. package/dist/{index-BypSWEYO.js → index-CQkqNHY-.js} +5 -5
  14. package/dist/{index-BypSWEYO.js.map → index-CQkqNHY-.js.map} +1 -1
  15. package/dist/{index-D-ObmLY1.js → index-CicT49Ft.js} +652 -714
  16. package/dist/{index-D-ObmLY1.js.map → index-CicT49Ft.js.map} +1 -1
  17. package/dist/{index-hByI0uXP.js → index-D1Z2CD30.js} +2 -2
  18. package/dist/{index-hByI0uXP.js.map → index-D1Z2CD30.js.map} +1 -1
  19. package/dist/{index-BQHjXZIn.js → index-D6vJpiFn.js} +2 -2
  20. package/dist/{index-BQHjXZIn.js.map → index-D6vJpiFn.js.map} +1 -1
  21. package/dist/{index-b0hy-r3d.js → index-Dy4YP_j2.js} +2 -2
  22. package/dist/{index-b0hy-r3d.js.map → index-Dy4YP_j2.js.map} +1 -1
  23. package/dist/{index-DNBDuEzF.js → index-rveXnmm0.js} +2 -2
  24. package/dist/{index-DNBDuEzF.js.map → index-rveXnmm0.js.map} +1 -1
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.js +3 -3
  27. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- "use strict";const c=require("react/jsx-runtime"),p=require("react"),ve=require("formik"),U=require("react-icons/md"),R=require("@mui/material"),pr=require("react-dom"),ke=require("react-select"),X=require("@emotion/react");function eo(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const $=eo(p),qe=new Map,q={register(t,e){qe.set(t,e)},get(t){return qe.get(t)},has(t){return qe.has(t)},keys(){return Array.from(qe.keys())}},O={INPUT_HEIGHT:38,INPUT_PADDING:"0 12px",INPUT_FONT_SIZE:14,BORDER_RADIUS:6,BORDER_COLOR:"#ced4da",BORDER_COLOR_HOVER:"#adb5bd",BORDER_COLOR_FOCUS:"#86b7fe",BORDER_COLOR_ERROR:"#dc3545",BORDER:"1px solid #ced4da",BORDER_ERROR:"1px solid #dc3545",FOCUS_SHADOW:"0 0 0 3px rgba(13,110,253,0.18)",FOCUS_SHADOW_ERROR:"0 0 0 3px rgba(220,53,69,0.18)",COLOR_LABEL:"#212529",COLOR_PLACEHOLDER:"rgba(0,0,0,0.38)",COLOR_HELPER:"#6c757d",COLOR_ERROR:"#dc3545",COLOR_DISABLED_BG:"#f8f9fa",COLOR_DISABLED_TEXT:"rgba(0,0,0,0.38)",FONT_SIZE_LABEL:13,FONT_SIZE_INPUT:14,FONT_SIZE_HELPER:12,FONT_WEIGHT_LABEL:500,LABEL_MB:5,HELPER_MT:4,FIELD_MB:20};function to(t){return{height:O.INPUT_HEIGHT,width:"100%",padding:O.INPUT_PADDING,fontSize:O.INPUT_FONT_SIZE,fontFamily:"inherit",color:t.isDisabled?O.COLOR_DISABLED_TEXT:O.COLOR_LABEL,background:t.isDisabled?O.COLOR_DISABLED_BG:"#fff",border:t.hasError?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,outline:"none",boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s",cursor:t.isDisabled?"not-allowed":void 0,...t.extraStyle}}function en(t,e){return{control:(n,i)=>({...n,minHeight:O.INPUT_HEIGHT,height:e?void 0:O.INPUT_HEIGHT,fontSize:O.INPUT_FONT_SIZE,fontFamily:"inherit",borderRadius:O.BORDER_RADIUS,borderColor:t?O.BORDER_COLOR_ERROR:i.isFocused?O.BORDER_COLOR_FOCUS:O.BORDER_COLOR,boxShadow:i.isFocused?t?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW:"none",transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:t?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_HOVER}}),valueContainer:n=>({...n,padding:e?"1px 8px":"0 8px",fontSize:O.INPUT_FONT_SIZE}),input:n=>({...n,margin:0,padding:0,fontSize:O.INPUT_FONT_SIZE}),placeholder:n=>({...n,color:O.COLOR_PLACEHOLDER,fontSize:O.INPUT_FONT_SIZE}),singleValue:n=>({...n,fontSize:O.INPUT_FONT_SIZE,color:O.COLOR_LABEL}),dropdownIndicator:n=>({...n,padding:"0 8px"}),clearIndicator:n=>({...n,padding:"0 4px"}),indicatorSeparator:n=>({...n,marginTop:6,marginBottom:6}),option:(n,{isDisabled:i})=>({...n,fontSize:O.INPUT_FONT_SIZE,cursor:i?"not-allowed":"pointer"}),menu:n=>({...n,borderRadius:O.BORDER_RADIUS,zIndex:9999}),menuPortal:n=>({...n,zIndex:9999})}}const ae={display:"flex",color:O.COLOR_ERROR,fontSize:O.FONT_SIZE_HELPER,marginTop:O.HELPER_MT,lineHeight:1.4},oe={color:O.COLOR_HELPER,fontSize:O.FONT_SIZE_HELPER,marginTop:O.HELPER_MT,lineHeight:1.4},no=/_DE_\{_P\('([^']*)'\)\}|_P\('([^']*)'\)/g,ro=/_DE_\{_P\('([^']*)'\)\}/g;function gr(t){const e=[...t.matchAll(/\[\\?"([^"\\]+)\\?"\]/g)];if(e.length>0)return e[e.length-1][1];const n=t.split(".");return n[n.length-1]??t}function io(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function oo(t,...e){return e.length===0?t:`${t}.${e.map(n=>`["${io(n)}"]`).join(".")}`}function Ae(t,e=!1){const n=new RegExp(e?no.source:ro.source,"g"),i=[];let r=0;for(const s of(t??"").matchAll(n)){s.index>r&&i.push({type:"text",value:t.slice(r,s.index)});const o=s[1]??s[2];i.push({type:"path-ref",path:o,label:gr(o)}),r=s.index+s[0].length}return r<(t??"").length&&i.push({type:"text",value:t.slice(r)}),i}function Re(t){return t.map(Oe).join("")}function Oe(t){switch(t.type){case"text":return t.value;case"path-ref":return`_DE_{_P('${t.path}')}`;case"concat":return t.values.map(Oe).join("");case"function":return`_DE_{_FN_('${t.name}', ${t.args.map(Oe).join(", ")})}`;case"condition":return`_DE_{_IF_(${Oe(t.if)}, ${Oe(t.then)}, ${Oe(t.else)})}`}}function $e(t){return t.map(De).join("")}function De(t){switch(t.type){case"text":return t.value;case"path-ref":return`_P('${t.path}')`;case"concat":return t.values.map(De).join("");case"function":return`_DE_{_FN_('${t.name}', ${t.args.map(De).join(", ")})}`;case"condition":return`_DE_{_IF_(${De(t.if)}, ${De(t.then)}, ${De(t.else)})}`}}function tn(){return{}}const so=new Set(["isPresent","isNotPresent","isEmpty","isNotEmpty"]);function br(t){return t.type==="group"}function ao(t){return!so.has(t)}function hr(t){const e=t.trim(),n=e.match(/^_DE_\{_P\('([^']*)'\)\}$/);return n?`_P('${n[1]}')`:/^_P\('[^']*'\)$/.test(e)?e:t}function lo(t){const e={field:hr(t.field),operator:t.operator,...t.connector&&{connector:t.connector}};return ao(t.operator)&&(e.value=t.value??""),e}function mr(t){return br(t)?{type:"group",entries:t.entries.map(mr),...t.connector&&{connector:t.connector}}:lo(t)}function uo({values:t,conditionConfig:e}){const n=e?Object.fromEntries(Object.entries(e).filter(([,i])=>i.length>0).map(([i,r])=>[i,r.map(mr)])):{};return{values:t,...Object.keys(n).length>0&&{conditions:n}}}function be(t){return t!==""&&!isNaN(Number(t))?t:`'${t}'`}const co={equals:(t,e)=>`${t} == ${be(e)}`,notEquals:(t,e)=>`${t} != ${be(e)}`,contains:(t,e)=>`contains(${t}, ${be(e)})`,notContains:(t,e)=>`!contains(${t}, ${be(e)})`,startsWith:(t,e)=>`startsWith(${t}, ${be(e)})`,endsWith:(t,e)=>`endsWith(${t}, ${be(e)})`,isPresent:t=>`isPresent(${t})`,isNotPresent:t=>`isNotPresent(${t})`,greaterThan:(t,e)=>`${t} > ${be(e)}`,lessThan:(t,e)=>`${t} < ${be(e)}`,greaterOrEquals:(t,e)=>`${t} >= ${be(e)}`,lessOrEquals:(t,e)=>`${t} <= ${be(e)}`};function fo(t){if(br(t))return`(${xr(t.entries)})`;const e=hr(t.field)||`_P('${t.field}')`,n=co[t.operator];return n?n(e,t.value??""):`${e} ${t.operator} '${t.value??""}'`}function xr(t){return t.map((e,n)=>{const i=fo(e);return n===0?i:(e.connector==="or"?" || ":" && ")+i}).join("")}function po(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e.length>0).map(([e,n])=>[e,xr(n)]))}function go(t){return typeof t=="string"&&/_DE_\{_P\('[^']*'\)\}|_P\('[^']*'\)/.test(t)}function bo(t){return t.some(e=>e.type!=="text")}function nn(t,e=!1){const n=[];for(const i of t)if(i.type==="text")i.value&&n.push({type:"text",value:i.value});else if(i.type==="path-ref")n.push({type:"chip",expr:e?`_P('${i.path}')`:`_DE_{_P('${i.path}')}`,label:i.label,path:i.path,kind:e?"path-ref":"de-expr"});else{const r=Oe(i);n.push({type:"chip",expr:r,label:r.slice(0,20)+"…",path:"",kind:"de-expr"})}return n}function vr(t,e=!1){return nn(Ae(t,e),e)}const rn="_DE_{_P(",on=")}";function ho(t){return typeof t=="string"&&t.startsWith(rn)&&t.endsWith(on)}function mo(t){return`${rn}'${t}'${on}`}function xo(t){return t.slice(rn.length,-on.length).replace(/^['"]|['"]$/g,"")}function vo(t){return t.replace(/_DE_\{_P\('[^']*'\)\}/g,"")}function se({label:t,required:e,showOptional:n,info:i,htmlFor:r,dataTestId:s}){return t?c.jsxs("label",{htmlFor:r,"data-testid":s?`${s}-label`:void 0,className:"ff-form-text-14 ff-form-text-dark ff-form-fw-medium ff-form-mb-1 ff-form-d-flex ff-form-align-start ff-form-flex-wrap ff-form-gap-1",style:{fontSize:14,lineHeight:1.4},children:[c.jsx("span",{style:{overflowWrap:"anywhere"},children:t}),e&&c.jsx("span",{className:"ff-form-text-danger","aria-hidden":"true",children:" *"}),n&&!e&&c.jsx("span",{className:"ff-form-text-12 ff-form-ps-1 ff-form-text-body-tertiary",children:" (Optional)"}),i&&c.jsx(R.Tooltip,{title:i,arrow:!0,placement:"top",children:c.jsx(R.IconButton,{size:"small",color:"inherit",className:"ff-form-p-0",tabIndex:-1,sx:{mt:"1px",flexShrink:0},children:c.jsx(U.MdInfoOutline,{size:14})})})]}):null}const Io={display:"inline-flex",alignItems:"center",background:"#ede9fe",color:"#5b21b6",border:"1px solid #ddd6fe",borderRadius:"4px",padding:"0px 6px",fontSize:"inherit",fontWeight:"500",lineHeight:"1.6",margin:"0 2px",verticalAlign:"middle",cursor:"default",whiteSpace:"nowrap",fontFamily:"inherit"},yo="font-family:monospace;font-size:inherit;opacity:0.5;margin-right:2px;";function sn(t){const{expr:e,label:n,path:i}=t,r=document.createElement("span");r.contentEditable="false",r.dataset.expr=e,r.dataset.label=n,r.dataset.path=i;const s=document.createElement("span");return s.textContent="{ } ",s.style.cssText=yo,r.appendChild(s),r.appendChild(document.createTextNode(n)),Object.assign(r.style,Io),r}function Ir(t){return`_DE_{_P('${t}')}`}const yr=p.createContext(null);function Cr({groups:t,children:e}){const[n,i]=p.useState(!1),[r,s]=p.useState(null),[o,u]=p.useState(null),a=p.useRef(null),l=p.useRef(0),d=p.useCallback(()=>i(!0),[]),f=p.useCallback(()=>{i(!1),u(null)},[]),b=p.useCallback((m,v)=>{m?(l.current+=1,v&&u(v)):(l.current=Math.max(0,l.current-1),l.current===0&&(i(!1),u(null)))},[]),g=p.useCallback(m=>{a.current=m,s(m.fieldId)},[]),x=p.useCallback(m=>{a.current&&(a.current.savedRange=m)},[]),h=p.useCallback((m,v)=>{const A=a.current;if(!A)return;if(A.onInsert){A.onInsert(m,v);return}const C=A.editorRef.current;if(!C)return;C.focus();const I=Co(m,v);let S=A.savedRange;if(!S){const E=window.getSelection();E&&E.rangeCount>0&&(S=E.getRangeAt(0),C.contains(S.commonAncestorContainer)||(S=null))}S||(S=document.createRange(),S.selectNodeContents(C),S.collapse(!1)),S.deleteContents(),S.insertNode(I),S.setStartAfter(I),S.collapse(!0);const y=window.getSelection();y==null||y.removeAllRanges(),y==null||y.addRange(S),a.current&&(a.current.savedRange=S.cloneRange()),C.dispatchEvent(new Event("input",{bubbles:!0}))},[]);return c.jsx(yr.Provider,{value:{groups:t,isOpen:n,openPicker:d,closePicker:f,notifyFormulaToggle:b,registerField:g,saveRange:x,insertVariable:h,activeFieldId:r,notifyFieldFocus:(m,v)=>{s(m),v&&u(v),i(!0)},anchorEl:o},children:e})}function Le(){return p.useContext(yr)}function Co(t,e){return sn({expr:Ir(t),label:e,path:t})}const Lt="application/x-flowforge-variable";function an(t){return t.flatMap(e=>e.children?[e,...an(e.children)]:[e])}function Sr(t,e){var i;const n=e.toLowerCase();return t.label.toLowerCase().includes(n)||t.path.toLowerCase().includes(n)||(((i=t.description)==null?void 0:i.toLowerCase().includes(n))??!1)}function So({item:t}){const e=Le(),[n,i]=p.useState(!1),r=s=>{s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData(Lt,JSON.stringify({path:t.path,label:t.label}));const o=document.createElement("span");o.textContent=`{ } ${t.label}`,Object.assign(o.style,{position:"fixed",top:"-200px",left:"-200px",display:"inline-flex",alignItems:"center",background:"#ede9fe",color:"#5b21b6",border:"1px solid #ddd6fe",borderRadius:"4px",padding:"2px 8px",fontSize:"13px",fontWeight:"500",fontFamily:"inherit",whiteSpace:"nowrap",boxShadow:"0 2px 8px rgba(99,102,241,0.25)"}),document.body.appendChild(o),s.dataTransfer.setDragImage(o,o.offsetWidth/2,o.offsetHeight/2),requestAnimationFrame(()=>document.body.removeChild(o)),i(!0)};return c.jsx(R.Tooltip,{title:t.path,placement:"left",enterDelay:600,children:c.jsxs(R.Box,{draggable:!0,onDragStart:r,onDragEnd:()=>i(!1),onClick:()=>e==null?void 0:e.insertVariable(t.path,t.label),sx:{display:"flex",alignItems:"flex-start",gap:1,px:1.5,py:.75,borderRadius:"6px",cursor:"grab",opacity:n?.4:1,transition:"background 0.12s, opacity 0.12s","&:hover":{bgcolor:"rgba(99,102,241,0.07)"},"&:active":{cursor:"grabbing"}},children:[c.jsx(R.Box,{sx:{mt:"2px",flexShrink:0,color:"#6366f1",display:"flex",alignItems:"center"},children:c.jsx(U.MdDataObject,{size:14})}),c.jsxs(R.Box,{sx:{minWidth:0},children:[c.jsx(R.Typography,{sx:{fontSize:13,fontWeight:500,color:"#0f172a",lineHeight:1.35,overflowWrap:"anywhere"},children:t.label}),t.description&&c.jsx(R.Typography,{sx:{fontSize:11,color:"#64748b",lineHeight:1.4,mt:.2,overflowWrap:"anywhere"},children:t.description})]})]})})}function Ar({group:t,searchQuery:e}){const[n,i]=p.useState(!0),r=p.useMemo(()=>{const s=an(t.items).filter(o=>!o.children);return e?s.filter(o=>Sr(o,e)):t.items},[t.items,e]);return e&&r.length===0?null:c.jsxs(R.Box,{children:[!e&&c.jsxs(R.Box,{onClick:()=>i(s=>!s),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:.75,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.03)"}},children:[c.jsx(R.Box,{sx:{color:"#94a3b8",transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s",display:"flex"},children:c.jsx(U.MdKeyboardArrowRight,{size:14})}),t.icon&&c.jsx(R.Box,{sx:{color:"#64748b",display:"flex",mr:.25},children:t.icon}),c.jsx(R.Typography,{sx:{fontSize:11,fontWeight:700,color:"#64748b",textTransform:"uppercase",letterSpacing:.6,flex:1},children:t.label})]}),c.jsx(R.Collapse,{in:n||!!e,children:c.jsx(R.Box,{sx:{pb:.5},children:r.map((s,o)=>s.children?c.jsx(Ar,{group:{label:s.label,items:s.children},searchQuery:e},o):c.jsx(So,{item:s},o))})})]})}function Ao({width:t=300,title:e="Values",mode:n="drawer",floating:i=!1}){const r=Le(),[s,o]=p.useState(""),[u,a]=p.useState(null),l=p.useRef(null);if(p.useEffect(()=>{if(!(n==="popover"||n==="drawer"&&i)||!(r!=null&&r.isOpen))return;function g(x){var A,C;const h=x.target,m=(A=l.current)==null?void 0:A.contains(h),v=(C=r==null?void 0:r.anchorEl)==null?void 0:C.contains(h);!m&&!v&&(r==null||r.closePicker())}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[n,i,r==null?void 0:r.isOpen,r==null?void 0:r.anchorEl,r]),p.useEffect(()=>{if(!(n==="popover"||n==="drawer"&&i)||!(r!=null&&r.anchorEl)||!r.isOpen){a(null);return}const g=r.anchorEl.getBoundingClientRect(),x=t,h=440,m=r.anchorEl.closest(".MuiDrawer-paper")||r.anchorEl.closest(".MuiDialog-paper")||r.anchorEl.closest(".MuiPaper-root"),v=m?m.getBoundingClientRect():g,A=v.left-8,C=window.innerWidth-v.right-8,I=A>=x?v.left-x-8:C>=x?v.right+8:Math.max(8,v.left-x-8),S=g.top,y=Math.min(S,window.innerHeight-h-8);a({top:y,left:I})},[n,r==null?void 0:r.anchorEl,r==null?void 0:r.isOpen,t]),!r||n==="popover"&&!r.isOpen||n==="drawer"&&i&&!r.isOpen)return null;const d=r.groups.some(b=>s?an(b.items).some(g=>!g.children&&Sr(g,s)):!0),f=c.jsxs(R.Box,{ref:l,sx:{width:t,flexShrink:0,display:"flex",flexDirection:"column",bgcolor:"#1e2130",borderRadius:"10px",border:"1px solid rgba(255,255,255,0.08)",boxShadow:"0 8px 32px rgba(0,0,0,0.28)",overflow:"hidden",color:"#e2e8f0",maxHeight:440,...n==="popover"&&u?{position:"fixed",top:u.top,left:u.left,zIndex:1400}:n==="popover"?{display:"none"}:n==="drawer"&&i&&u?{position:"fixed",top:u.top,left:u.left,zIndex:1400}:n==="drawer"&&i?{display:"none"}:{}},children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:1.75,pb:1.25,borderBottom:"1px solid rgba(255,255,255,0.07)",flexShrink:0},children:[c.jsx(U.MdDataObject,{size:16,color:"#6366f1"}),c.jsx(R.Typography,{sx:{fontSize:13,fontWeight:700,flex:1,color:"#e2e8f0"},children:e}),(n==="popover"||n==="drawer"&&i)&&c.jsx(R.Box,{component:"button",type:"button",onClick:r.closePicker,sx:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",p:.25,borderRadius:"4px","&:hover":{color:"#e2e8f0",bgcolor:"rgba(255,255,255,0.08)"}},children:c.jsx(U.MdClose,{size:15})})]}),c.jsx(R.Box,{sx:{px:1.5,py:1,flexShrink:0},children:c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:.75,bgcolor:"rgba(255,255,255,0.07)",borderRadius:"7px",px:1.25,py:.6,border:"1px solid rgba(255,255,255,0.08)","&:focus-within":{border:"1px solid rgba(99,102,241,0.5)"}},children:[c.jsx(U.MdSearch,{size:15,color:"#64748b"}),c.jsx(R.InputBase,{placeholder:"Search variables...",value:s,onChange:b=>o(b.target.value),sx:{fontSize:12,flex:1,color:"#e2e8f0","& input::placeholder":{color:"#64748b",opacity:1}}}),s&&c.jsx(R.Box,{component:"button",type:"button",onClick:()=>o(""),sx:{background:"none",border:"none",cursor:"pointer",color:"#64748b",display:"flex",p:0,"&:hover":{color:"#94a3b8"}},children:c.jsx(U.MdClose,{size:12})})]})}),c.jsx(R.Divider,{sx:{borderColor:"rgba(255,255,255,0.06)"}}),c.jsx(R.Box,{sx:{flex:1,overflowY:"auto",py:.5,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(255,255,255,0.12)",borderRadius:4}},children:c.jsx(R.Box,{sx:{"& .MuiTypography-root":{color:"#cbd5e1"}},children:d?r.groups.map((b,g)=>c.jsx(Ar,{group:b,searchQuery:s},g)):c.jsx(R.Box,{sx:{px:2,py:3,textAlign:"center"},children:c.jsxs(R.Typography,{sx:{fontSize:12,color:"#475569"},children:['No variables match "',s,'"']})})})}),c.jsx(R.Box,{sx:{px:2,py:1,borderTop:"1px solid rgba(255,255,255,0.06)",flexShrink:0},children:c.jsx(R.Typography,{sx:{fontSize:10,color:"#475569",lineHeight:1.4},children:"Click to insert · Drag onto any field"})})]});return n==="popover"||n==="drawer"&&i?pr.createPortal(f,document.body):f}function Rr(t){return sn({expr:t.expr,label:t.label,path:t.path})}function ln(t){var i;if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";const e=t;if((i=e.dataset)!=null&&i.expr)return e.dataset.expr;if(e.tagName==="BR")return"";let n="";return e.childNodes.forEach(r=>{n+=ln(r)}),n}function Ro(t){let e="";return t.childNodes.forEach(n=>{e+=ln(n)}),e}function Eo(t,e){t.innerHTML="";for(const n of e)n.type==="text"?n.value&&t.appendChild(document.createTextNode(n.value)):t.appendChild(Rr(n))}function Oo(t){const e=document.createDocumentFragment();for(const n of t)n.type==="text"?n.value&&e.appendChild(document.createTextNode(n.value)):e.appendChild(Rr(n));return e}function Cn(t){let e="";return t.childNodes.forEach(n=>{e+=ln(n)}),e}function un({expression:t,onExpressionChange:e,onBlur:n,placeholder:i,disabled:r,error:s,id:o,formulaConfigEnabled:u,onFormulaConfigToggle:a,onPickerOpen:l,compact:d}){const f=p.useRef(null),b=p.useRef(null),g=p.useRef(""),x=p.useRef(!1),h=t.length===0||t.length===1&&t[0].type==="text"&&!t[0].value,m=Le(),[v,A]=p.useState(null),[C,I]=p.useState(!1),S=p.useRef(void 0);p.useEffect(()=>{const T=f.current;if(!T)return;const z=Re(t),B=`${u?"1":"0"}:${z}`,P=S.current!==(m==null?void 0:m.groups);if(B===g.current&&!P)return;const Z=new Map;if(m!=null&&m.groups){const te=me=>{for(const ge of me)ge.path&&Z.set(ge.path,ge.label),ge.children&&te(ge.children)};for(const me of m.groups)te(me.items)}const Y=new Map;T.querySelectorAll("[data-path]").forEach(te=>{te.dataset.path&&te.dataset.label&&Y.set(te.dataset.path,te.dataset.label)});const K=nn(t,u).map(te=>{if(te.type!=="chip"||!te.path)return te;const me=Z.get(te.path)??Y.get(te.path)??te.label;return{...te,label:me}});Eo(T,K),g.current=B,S.current=m==null?void 0:m.groups},[t,u,m==null?void 0:m.groups]);const y=p.useCallback(()=>{const T=f.current;if(!T)return;const z=Ro(T),B=Ae(z,u),P=`${u?"1":"0"}:${Re(B)}`;P!==g.current&&(g.current=P,e(B))},[e,u]),E=p.useCallback(()=>{x.current||y()},[y]),F=p.useCallback(T=>{T.preventDefault();const z=T.clipboardData.getData("text/plain"),B=window.getSelection();if(!(B!=null&&B.rangeCount))return;const P=B.getRangeAt(0);P.deleteContents(),P.insertNode(Oo(vr(z,u))),P.collapse(!1),B.removeAllRanges(),B.addRange(P),y()},[y,u]),j=p.useCallback(T=>{const z=window.getSelection();if(!(z!=null&&z.rangeCount))return;const B=Cn(z.getRangeAt(0).cloneContents());B&&(T.clipboardData.setData("text/plain",B),T.preventDefault())},[]),M=p.useCallback(T=>{const z=window.getSelection();if(!(z!=null&&z.rangeCount))return;const B=z.getRangeAt(0),P=Cn(B.cloneContents());P&&(T.clipboardData.setData("text/plain",P),T.preventDefault(),B.deleteContents(),y())},[y]),D=p.useCallback(T=>{T.key==="Enter"&&T.preventDefault()},[]),N=p.useCallback((T,z)=>{const B=f.current;if(!B)return;B.focus();const P=window.getSelection();let Z=null;P&&P.rangeCount>0&&B.contains(P.getRangeAt(0).commonAncestorContainer)?Z=P.getRangeAt(0):(Z=document.createRange(),Z.selectNodeContents(B),Z.collapse(!1));const Y=Sn(T,z);Z.deleteContents(),Z.insertNode(Y),Z.setStartAfter(Y),Z.collapse(!0),P==null||P.removeAllRanges(),P==null||P.addRange(Z),y()},[y]),G=p.useCallback(()=>{!m||!o||(m.registerField({editorRef:f,savedRange:null,fieldId:o,onInsert:N}),m.notifyFieldFocus(o,f.current),m.openPicker())},[m,o,N]),w=p.useCallback(()=>{var z;if(!m)return;const T=window.getSelection();T&&T.rangeCount>0&&((z=f.current)!=null&&z.contains(T.anchorNode))&&m.saveRange(T.getRangeAt(0).cloneRange())},[m]);p.useEffect(()=>{document.addEventListener("selectionchange",w);const T=f.current;return T&&T.addEventListener("input",E),()=>{document.removeEventListener("selectionchange",w),T&&T.removeEventListener("input",E)}},[w,E]);const V=p.useCallback(T=>{r||!T.dataTransfer.types.includes(Lt)||(T.preventDefault(),T.dataTransfer.dropEffect="copy",A("valid"))},[r]),W=p.useCallback(()=>{A(null)},[]),J=p.useCallback(T=>{if(T.preventDefault(),A(null),r){I(!0);return}const z=T.dataTransfer.getData(Lt);if(!z)return;let B;try{B=JSON.parse(z)}catch{return}const P=Fo(T.clientX,T.clientY);if(!P)return;const Z=f.current;if(!Z||!Z.contains(P.commonAncestorContainer))return;const Y=Sn(B.path,B.label);P.deleteContents(),P.insertNode(Y),P.setStartAfter(Y),P.collapse(!0);const K=window.getSelection();K==null||K.removeAllRanges(),K==null||K.addRange(P),Z.dispatchEvent(new Event("input",{bubbles:!0}))},[r]),_=(a?1:0)+(l?1:0),ee=_>0?`${_*30+8}px`:"12px",re=v==="valid"?"#16a34a":v==="invalid"||s?"#d32f2f":"rgba(0,0,0,0.23)",k=v==="valid"?"0 0 0 2px rgba(22,163,74,0.2)":v==="invalid"?"0 0 0 2px rgba(211,47,47,0.2)":void 0;return c.jsxs(R.Box,{sx:{position:"relative"},children:[c.jsxs(R.Box,{sx:{border:`1px solid ${re}`,borderRadius:"4px",...d?{display:"flex",alignItems:"center",pl:1,py:"6px",pr:ee,overflow:"hidden"}:{display:"flex",alignItems:"center",pl:1.5,py:"6px",pr:ee,overflow:"hidden"},fontSize:d?13:14,lineHeight:1.5,cursor:r?"not-allowed":"text",bgcolor:v==="valid"?"rgba(22,163,74,0.04)":r?"rgba(0,0,0,0.04)":"#fff",transition:"border-color 0.15s, box-shadow 0.15s, background 0.15s",boxShadow:k,"&:focus-within":{borderColor:s?"#d32f2f":"#1976d2",boxShadow:s?"0 0 0 2px rgba(211,47,47,0.2)":"0 0 0 2px rgba(25,118,210,0.2)"}},onDragOver:V,onDragLeave:W,onDrop:J,onClick:()=>{var T;r||(T=f.current)==null||T.focus()},children:[h&&i&&c.jsx(R.Typography,{component:"span",sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",left:d?8:14,right:ee,fontSize:d?13:14,color:"rgba(0,0,0,0.38)",pointerEvents:"none",userSelect:"none",lineHeight:1.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i}),c.jsx("div",{ref:f,id:o,contentEditable:r?"false":"true",suppressContentEditableWarning:!0,onPaste:F,onCopy:j,onCut:M,onKeyDown:D,onFocus:G,onBlur:n,onCompositionStart:()=>{x.current=!0},onCompositionEnd:()=>{x.current=!1,y()},style:{outline:"none",flex:1,minWidth:0,overflow:"hidden",minHeight:"21px",lineHeight:1.5,whiteSpace:"nowrap"}})]}),_>0&&!r&&c.jsxs(R.Box,{sx:{position:"absolute",right:4,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[a&&c.jsx(R.Tooltip,{title:u?"Disable formula config":"Enable formula config",placement:"top",children:c.jsx(R.Box,{component:"button",type:"button",ref:b,onClick:T=>{T.stopPropagation();const z=!u;m==null||m.notifyFormulaToggle(z,z?b.current:null),a()},sx:{border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:26,height:26,borderRadius:"4px",p:0,color:u?"#7c4dff":"#94a3b8",bgcolor:u?"#ede9fe":"transparent","&:hover":{bgcolor:"#ede9fe",color:"#7c4dff"}},children:c.jsx(U.MdDataObject,{size:17})})}),l&&c.jsx(R.Tooltip,{title:"Insert variable",placement:"top",children:c.jsx(R.Box,{component:"button",type:"button",onClick:T=>{T.stopPropagation(),l()},sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:26,height:26,borderRadius:"4px",color:"#64748b",p:0,"&:hover":{bgcolor:"#f1f5f9"}},children:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:14,height:14,children:c.jsx("path",{d:"M4.06 13a8 8 0 0 0 5.18 6.51A18.5 18.5 0 0 1 8.02 17c0-1.49.18-2.95.52-4.32L4.06 13zm0-2h4.48A18.5 18.5 0 0 0 8.02 7c0-1.02.06-2 .2-2.94A8 8 0 0 0 4.06 11zm11.88 0h4.48a8 8 0 0 0-4.16-6.94c.14.94.2 1.92.2 2.94 0 1.38-.15 2.71-.52 4zm0 2c-.37 1.29-.52 2.62-.52 4 0 1.02.06 2 .2 2.94A8 8 0 0 0 19.94 13h-4.18zM9.03 13c-.4 1.32-.57 2.7-.57 4 0 1.12.13 2.2.38 3.22A8 8 0 0 0 12 21a8 8 0 0 0 3.16-.78c.25-1.02.38-2.1.38-3.22 0-1.3-.17-2.68-.57-4H9.03zm.52-2h4.9C14.13 9.71 14 8.37 14 7c0-1.12-.13-2.2-.38-3.22A8 8 0 0 0 12 3a8 8 0 0 0-3.16.78C8.59 4.8 8.46 5.88 8.46 7c0 1.37.2 2.7.52 4h.57z"})})})})]}),c.jsx(R.Snackbar,{open:C,autoHideDuration:3e3,onClose:()=>I(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:c.jsx(R.Alert,{severity:"error",onClose:()=>I(!1),sx:{fontSize:13},children:"This field is disabled — cannot insert variable"})})]})}function Fo(t,e){var i;if(document.caretRangeFromPoint)return document.caretRangeFromPoint(t,e);const n=(i=document.caretPositionFromPoint)==null?void 0:i.call(document,t,e);if(n){const r=document.createRange();return r.setStart(n.offsetNode,n.offset),r.collapse(!0),r}return null}function Sn(t,e){return sn({expr:Ir(t),label:e,path:t})}function Er({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s,formulaConfig:o,onFormulaConfigChange:u,inlineLabel:a}){const l={...t,multiline:t.multiline||t.type==="textarea"},d=l.id??l.name??"",f=l.formula===!0,b=Le(),[g,x]=p.useState(()=>f&&d in(o??{})),h=p.useRef(g);h.current=g,p.useEffect(()=>()=>{h.current&&(b==null||b.notifyFormulaToggle(!1))},[]);const[m,v]=p.useState(()=>f?Ae(String(e??""),d in(o??{})):[]),[A,C]=p.useState(()=>String(e??"")),I=p.useRef(e);p.useEffect(()=>{if(e===I.current)return;I.current=e;const k=String(e??"");C(k),f&&v(Ae(k,g))},[e]);const S=k=>{v(k);const T=g?$e(k):Re(k);I.current=T,n(T)},y=()=>{const k=!g;if(x(k),k){const T=Re(m),z=Ae(T,!0);v(z);const B=$e(z);I.current=B,n(B),u==null||u({...o,[d]:tn()})}else{const T=Re(m);I.current=T,n(T);const z={...o};delete z[d],u==null||u(z)}},E=s&&!!r,F=l.disabled===!0,j=c.jsx(se,{label:l.label,required:l.required,showOptional:l.showOptional,info:l.info,htmlFor:d,dataTestId:l.dataTestId});if(f){const k=l.helperText&&!a?c.jsx("small",{style:oe,children:l.helperText}):null,T=c.jsxs(c.Fragment,{children:[k,c.jsx(un,{id:d,expression:m,onExpressionChange:S,onBlur:i,placeholder:l.formulaPlaceholder??"Type or paste a variable expression...",disabled:F,error:E,formulaConfigEnabled:g,onFormulaConfigToggle:y,compact:l.compact}),E&&c.jsx("small",{"data-testid":`${d}-error`,style:ae,children:r})]});return a?c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 0"},children:[c.jsx("div",{style:{flex:"0 0 160px",minWidth:0},children:j}),c.jsx("div",{style:{flex:1,minWidth:0},children:T})]}):c.jsxs("div",{children:[j,T]})}const M=!!l.prefix,D=!!l.suffix,N=!!l.copyable,G=D||N,w={width:"100%",fontSize:14,color:"#374151",backgroundColor:F?"#f9fafb":"#fff",border:`1px solid ${E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,outline:"none",paddingTop:l.multiline?"8px":"6px",paddingBottom:l.multiline?"8px":"6px",paddingLeft:M?0:"12px",paddingRight:G?0:"12px",boxSizing:"border-box",lineHeight:1.5,cursor:F?"not-allowed":void 0,resize:l.multiline?"vertical":"none"},V={position:"relative",display:"flex",alignItems:"stretch",width:"100%",border:`1px solid ${E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,backgroundColor:F?"#f9fafb":"#fff",boxSizing:"border-box"},W={display:"flex",alignItems:"center",padding:"0 10px",color:"#6b7280",fontSize:13,whiteSpace:"nowrap",flexShrink:0},J={flex:1,minHeight:0,border:"none",outline:"none",backgroundColor:"transparent",fontSize:14,color:"#374151",padding:l.multiline?"8px 12px":"6px 12px",cursor:F?"not-allowed":void 0,resize:l.multiline?"vertical":"none",boxSizing:"border-box",lineHeight:1.5},ee=M||G?c.jsxs("div",{style:V,onFocus:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,k.currentTarget.style.boxShadow=E?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlur:k=>{k.currentTarget.contains(k.relatedTarget)||(k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,k.currentTarget.style.boxShadow="none")},children:[M&&c.jsx("span",{style:W,children:l.prefix}),l.multiline?c.jsx("textarea",{id:d,name:d,style:{...J,minHeight:72},placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,rows:l.rows??3,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i}):c.jsx("input",{id:d,name:d,type:l.inputType??"text",style:J,placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i}),D&&c.jsx("span",{style:W,children:l.suffix}),N&&c.jsx(R.Tooltip,{title:"Copy",placement:"top",children:c.jsx("button",{type:"button",onClick:()=>navigator.clipboard.writeText(A),"aria-label":"copy",tabIndex:-1,style:{...W,background:"none",border:"none",cursor:"pointer",padding:"0 8px"},children:c.jsx(U.MdContentCopy,{size:16})})})]}):l.multiline?c.jsx("textarea",{id:d,name:d,style:{...w,minHeight:72,height:void 0,padding:"8px 12px"},placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,rows:l.rows??3,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i,onFocus:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,k.currentTarget.style.boxShadow=E?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,k.currentTarget.style.boxShadow="none"}}):c.jsx("input",{id:d,name:d,type:l.inputType??"text",style:w,placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i,onFocus:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,k.currentTarget.style.boxShadow=E?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,k.currentTarget.style.boxShadow="none"}}),re=c.jsxs(c.Fragment,{children:[l.helperText&&!E&&!a&&c.jsx("small",{style:oe,children:l.helperText}),ee,E&&c.jsx("small",{"data-testid":`${d}-error`,style:ae,children:r})]});return a?c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 0"},children:[c.jsx("div",{style:{flex:"0 0 160px",minWidth:0},children:j}),c.jsx("div",{style:{flex:1,minWidth:0},children:re})]}):c.jsxs("div",{children:[j,re]})}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},H.apply(null,arguments)}function Te(t){"@babel/helpers - typeof";return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(t)}function wo(t,e){if(Te(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Te(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Or(t){var e=wo(t,"string");return Te(e)=="symbol"?e:e+""}function Pe(t,e,n){return(e=Or(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function An(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?An(Object(n),!0).forEach(function(i){Pe(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function To(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Or(i.key),i)}}function Bo(t,e,n){return e&&Rn(t.prototype,e),n&&Rn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wt(t,e){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Wt(t,e)}function jo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wt(t,e)}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ct(t)}function Fr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fr=function(){return!!t})()}function Go(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vo(t,e){if(e&&(Te(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Go(t)}function Do(t){var e=Fr();return function(){var n,i=ct(t);if(e){var r=ct(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Vo(this,n)}}function Xt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Po(t){if(Array.isArray(t))return Xt(t)}function No(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wr(t,e){if(t){if(typeof t=="string")return Xt(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(t,e):void 0}}function Mo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ "use strict";const c=require("react/jsx-runtime"),p=require("react"),R=require("@mui/material"),ve=require("formik"),U=require("react-icons/md"),pr=require("react-dom"),ke=require("react-select"),X=require("@emotion/react");function eo(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const $=eo(p),qe=new Map,q={register(t,e){qe.set(t,e)},get(t){return qe.get(t)},has(t){return qe.has(t)},keys(){return Array.from(qe.keys())}},O={INPUT_HEIGHT:38,INPUT_PADDING:"0 12px",INPUT_FONT_SIZE:14,BORDER_RADIUS:6,BORDER_COLOR:"#ced4da",BORDER_COLOR_HOVER:"#adb5bd",BORDER_COLOR_FOCUS:"#86b7fe",BORDER_COLOR_ERROR:"#dc3545",BORDER:"1px solid #ced4da",BORDER_ERROR:"1px solid #dc3545",FOCUS_SHADOW:"0 0 0 3px rgba(13,110,253,0.18)",FOCUS_SHADOW_ERROR:"0 0 0 3px rgba(220,53,69,0.18)",COLOR_LABEL:"#212529",COLOR_PLACEHOLDER:"rgba(0,0,0,0.38)",COLOR_HELPER:"#6c757d",COLOR_ERROR:"#dc3545",COLOR_DISABLED_BG:"#f8f9fa",COLOR_DISABLED_TEXT:"rgba(0,0,0,0.38)",FONT_SIZE_LABEL:13,FONT_SIZE_INPUT:14,FONT_SIZE_HELPER:12,FONT_WEIGHT_LABEL:500,LABEL_MB:5,HELPER_MT:4,FIELD_MB:20};function to(t){return{height:O.INPUT_HEIGHT,width:"100%",padding:O.INPUT_PADDING,fontSize:O.INPUT_FONT_SIZE,fontFamily:"inherit",color:t.isDisabled?O.COLOR_DISABLED_TEXT:O.COLOR_LABEL,background:t.isDisabled?O.COLOR_DISABLED_BG:"#fff",border:t.hasError?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,outline:"none",boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s",cursor:t.isDisabled?"not-allowed":void 0,...t.extraStyle}}function en(t,e){return{control:(n,i)=>({...n,minHeight:O.INPUT_HEIGHT,height:e?void 0:O.INPUT_HEIGHT,fontSize:O.INPUT_FONT_SIZE,fontFamily:"inherit",borderRadius:O.BORDER_RADIUS,borderColor:t?O.BORDER_COLOR_ERROR:i.isFocused?O.BORDER_COLOR_FOCUS:O.BORDER_COLOR,boxShadow:i.isFocused?t?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW:"none",transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:t?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_HOVER}}),valueContainer:n=>({...n,padding:e?"1px 8px":"0 8px",fontSize:O.INPUT_FONT_SIZE}),input:n=>({...n,margin:0,padding:0,fontSize:O.INPUT_FONT_SIZE}),placeholder:n=>({...n,color:O.COLOR_PLACEHOLDER,fontSize:O.INPUT_FONT_SIZE}),singleValue:n=>({...n,fontSize:O.INPUT_FONT_SIZE,color:O.COLOR_LABEL}),dropdownIndicator:n=>({...n,padding:"0 8px"}),clearIndicator:n=>({...n,padding:"0 4px"}),indicatorSeparator:n=>({...n,marginTop:6,marginBottom:6}),option:(n,{isDisabled:i})=>({...n,fontSize:O.INPUT_FONT_SIZE,cursor:i?"not-allowed":"pointer"}),menu:n=>({...n,borderRadius:O.BORDER_RADIUS,zIndex:9999}),menuPortal:n=>({...n,zIndex:9999})}}const ae={display:"flex",color:O.COLOR_ERROR,fontSize:O.FONT_SIZE_HELPER,marginTop:O.HELPER_MT,lineHeight:1.4},oe={color:O.COLOR_HELPER,fontSize:O.FONT_SIZE_HELPER,marginTop:O.HELPER_MT,lineHeight:1.4},no=/_DE_\{_P\('([^']*)'\)\}|_P\('([^']*)'\)/g,ro=/_DE_\{_P\('([^']*)'\)\}/g;function gr(t){const e=[...t.matchAll(/\[\\?"([^"\\]+)\\?"\]/g)];if(e.length>0)return e[e.length-1][1];const n=t.split(".");return n[n.length-1]??t}function io(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function oo(t,...e){return e.length===0?t:`${t}.${e.map(n=>`["${io(n)}"]`).join(".")}`}function Ae(t,e=!1){const n=new RegExp(e?no.source:ro.source,"g"),i=[];let r=0;for(const s of(t??"").matchAll(n)){s.index>r&&i.push({type:"text",value:t.slice(r,s.index)});const o=s[1]??s[2];i.push({type:"path-ref",path:o,label:gr(o)}),r=s.index+s[0].length}return r<(t??"").length&&i.push({type:"text",value:t.slice(r)}),i}function Re(t){return t.map(Oe).join("")}function Oe(t){switch(t.type){case"text":return t.value;case"path-ref":return`_DE_{_P('${t.path}')}`;case"concat":return t.values.map(Oe).join("");case"function":return`_DE_{_FN_('${t.name}', ${t.args.map(Oe).join(", ")})}`;case"condition":return`_DE_{_IF_(${Oe(t.if)}, ${Oe(t.then)}, ${Oe(t.else)})}`}}function $e(t){return t.map(De).join("")}function De(t){switch(t.type){case"text":return t.value;case"path-ref":return`_P('${t.path}')`;case"concat":return t.values.map(De).join("");case"function":return`_DE_{_FN_('${t.name}', ${t.args.map(De).join(", ")})}`;case"condition":return`_DE_{_IF_(${De(t.if)}, ${De(t.then)}, ${De(t.else)})}`}}function tn(){return{}}const so=new Set(["isPresent","isNotPresent","isEmpty","isNotEmpty"]);function br(t){return t.type==="group"}function ao(t){return!so.has(t)}function hr(t){const e=t.trim(),n=e.match(/^_DE_\{_P\('([^']*)'\)\}$/);return n?`_P('${n[1]}')`:/^_P\('[^']*'\)$/.test(e)?e:t}function lo(t){const e={field:hr(t.field),operator:t.operator,...t.connector&&{connector:t.connector}};return ao(t.operator)&&(e.value=t.value??""),e}function mr(t){return br(t)?{type:"group",entries:t.entries.map(mr),...t.connector&&{connector:t.connector}}:lo(t)}function uo({values:t,conditionConfig:e}){const n=e?Object.fromEntries(Object.entries(e).filter(([,i])=>i.length>0).map(([i,r])=>[i,r.map(mr)])):{};return{values:t,...Object.keys(n).length>0&&{conditions:n}}}function be(t){return t!==""&&!isNaN(Number(t))?t:`'${t}'`}const co={equals:(t,e)=>`${t} == ${be(e)}`,notEquals:(t,e)=>`${t} != ${be(e)}`,contains:(t,e)=>`contains(${t}, ${be(e)})`,notContains:(t,e)=>`!contains(${t}, ${be(e)})`,startsWith:(t,e)=>`startsWith(${t}, ${be(e)})`,endsWith:(t,e)=>`endsWith(${t}, ${be(e)})`,isPresent:t=>`isPresent(${t})`,isNotPresent:t=>`isNotPresent(${t})`,greaterThan:(t,e)=>`${t} > ${be(e)}`,lessThan:(t,e)=>`${t} < ${be(e)}`,greaterOrEquals:(t,e)=>`${t} >= ${be(e)}`,lessOrEquals:(t,e)=>`${t} <= ${be(e)}`};function fo(t){if(br(t))return`(${xr(t.entries)})`;const e=hr(t.field)||`_P('${t.field}')`,n=co[t.operator];return n?n(e,t.value??""):`${e} ${t.operator} '${t.value??""}'`}function xr(t){return t.map((e,n)=>{const i=fo(e);return n===0?i:(e.connector==="or"?" || ":" && ")+i}).join("")}function po(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e.length>0).map(([e,n])=>[e,xr(n)]))}function go(t){return typeof t=="string"&&/_DE_\{_P\('[^']*'\)\}|_P\('[^']*'\)/.test(t)}function bo(t){return t.some(e=>e.type!=="text")}function nn(t,e=!1){const n=[];for(const i of t)if(i.type==="text")i.value&&n.push({type:"text",value:i.value});else if(i.type==="path-ref")n.push({type:"chip",expr:e?`_P('${i.path}')`:`_DE_{_P('${i.path}')}`,label:i.label,path:i.path,kind:e?"path-ref":"de-expr"});else{const r=Oe(i);n.push({type:"chip",expr:r,label:r.slice(0,20)+"…",path:"",kind:"de-expr"})}return n}function vr(t,e=!1){return nn(Ae(t,e),e)}const rn="_DE_{_P(",on=")}";function ho(t){return typeof t=="string"&&t.startsWith(rn)&&t.endsWith(on)}function mo(t){return`${rn}'${t}'${on}`}function xo(t){return t.slice(rn.length,-on.length).replace(/^['"]|['"]$/g,"")}function vo(t){return t.replace(/_DE_\{_P\('[^']*'\)\}/g,"")}function se({label:t,required:e,showOptional:n,info:i,htmlFor:r,dataTestId:s}){return t?c.jsxs("label",{htmlFor:r,"data-testid":s?`${s}-label`:void 0,className:"ff-form-text-14 ff-form-text-dark ff-form-fw-medium ff-form-mb-1 ff-form-d-flex ff-form-align-start ff-form-flex-wrap ff-form-gap-1",style:{fontSize:14,lineHeight:1.4},children:[c.jsx("span",{style:{overflowWrap:"anywhere"},children:t}),e&&c.jsx("span",{className:"ff-form-text-danger","aria-hidden":"true",children:" *"}),n&&!e&&c.jsx("span",{className:"ff-form-text-12 ff-form-ps-1 ff-form-text-body-tertiary",children:" (Optional)"}),i&&c.jsx(R.Tooltip,{title:i,arrow:!0,placement:"top",children:c.jsx(R.IconButton,{size:"small",color:"inherit",className:"ff-form-p-0",tabIndex:-1,sx:{mt:"1px",flexShrink:0},children:c.jsx(U.MdInfoOutline,{size:14})})})]}):null}const Io={display:"inline-flex",alignItems:"center",background:"#ede9fe",color:"#5b21b6",border:"1px solid #ddd6fe",borderRadius:"4px",padding:"0px 6px",fontSize:"inherit",fontWeight:"500",lineHeight:"1.6",margin:"0 2px",verticalAlign:"middle",cursor:"default",whiteSpace:"nowrap",fontFamily:"inherit"},yo="font-family:monospace;font-size:inherit;opacity:0.5;margin-right:2px;";function sn(t){const{expr:e,label:n,path:i}=t,r=document.createElement("span");r.contentEditable="false",r.dataset.expr=e,r.dataset.label=n,r.dataset.path=i;const s=document.createElement("span");return s.textContent="{ } ",s.style.cssText=yo,r.appendChild(s),r.appendChild(document.createTextNode(n)),Object.assign(r.style,Io),r}function Ir(t){return`_DE_{_P('${t}')}`}const yr=p.createContext(null);function Cr({groups:t,children:e}){const[n,i]=p.useState(!1),[r,s]=p.useState(null),[o,u]=p.useState(null),a=p.useRef(null),l=p.useRef(0),d=p.useCallback(()=>i(!0),[]),f=p.useCallback(()=>{i(!1),u(null)},[]),b=p.useCallback((m,v)=>{m?(l.current+=1,v&&u(v)):(l.current=Math.max(0,l.current-1),l.current===0&&(i(!1),u(null)))},[]),g=p.useCallback(m=>{a.current=m,s(m.fieldId)},[]),x=p.useCallback(m=>{a.current&&(a.current.savedRange=m)},[]),h=p.useCallback((m,v)=>{const A=a.current;if(!A)return;if(A.onInsert){A.onInsert(m,v);return}const C=A.editorRef.current;if(!C)return;C.focus();const I=Co(m,v);let S=A.savedRange;if(!S){const E=window.getSelection();E&&E.rangeCount>0&&(S=E.getRangeAt(0),C.contains(S.commonAncestorContainer)||(S=null))}S||(S=document.createRange(),S.selectNodeContents(C),S.collapse(!1)),S.deleteContents(),S.insertNode(I),S.setStartAfter(I),S.collapse(!0);const y=window.getSelection();y==null||y.removeAllRanges(),y==null||y.addRange(S),a.current&&(a.current.savedRange=S.cloneRange()),C.dispatchEvent(new Event("input",{bubbles:!0}))},[]);return c.jsx(yr.Provider,{value:{groups:t,isOpen:n,openPicker:d,closePicker:f,notifyFormulaToggle:b,registerField:g,saveRange:x,insertVariable:h,activeFieldId:r,notifyFieldFocus:(m,v)=>{s(m),v&&u(v),i(!0)},anchorEl:o},children:e})}function Le(){return p.useContext(yr)}function Co(t,e){return sn({expr:Ir(t),label:e,path:t})}const Lt="application/x-flowforge-variable";function an(t){return t.flatMap(e=>e.children?[e,...an(e.children)]:[e])}function Sr(t,e){var i;const n=e.toLowerCase();return t.label.toLowerCase().includes(n)||t.path.toLowerCase().includes(n)||(((i=t.description)==null?void 0:i.toLowerCase().includes(n))??!1)}function So({item:t}){const e=Le(),[n,i]=p.useState(!1),r=s=>{s.dataTransfer.effectAllowed="copy",s.dataTransfer.setData(Lt,JSON.stringify({path:t.path,label:t.label}));const o=document.createElement("span");o.textContent=`{ } ${t.label}`,Object.assign(o.style,{position:"fixed",top:"-200px",left:"-200px",display:"inline-flex",alignItems:"center",background:"#ede9fe",color:"#5b21b6",border:"1px solid #ddd6fe",borderRadius:"4px",padding:"2px 8px",fontSize:"13px",fontWeight:"500",fontFamily:"inherit",whiteSpace:"nowrap",boxShadow:"0 2px 8px rgba(99,102,241,0.25)"}),document.body.appendChild(o),s.dataTransfer.setDragImage(o,o.offsetWidth/2,o.offsetHeight/2),requestAnimationFrame(()=>document.body.removeChild(o)),i(!0)};return c.jsx(R.Tooltip,{title:t.path,placement:"left",enterDelay:600,children:c.jsxs(R.Box,{draggable:!0,onDragStart:r,onDragEnd:()=>i(!1),onClick:()=>e==null?void 0:e.insertVariable(t.path,t.label),sx:{display:"flex",alignItems:"flex-start",gap:1,px:1.5,py:.75,borderRadius:"6px",cursor:"grab",opacity:n?.4:1,transition:"background 0.12s, opacity 0.12s","&:hover":{bgcolor:"rgba(99,102,241,0.07)"},"&:active":{cursor:"grabbing"}},children:[c.jsx(R.Box,{sx:{mt:"2px",flexShrink:0,color:"#6366f1",display:"flex",alignItems:"center"},children:c.jsx(U.MdDataObject,{size:14})}),c.jsxs(R.Box,{sx:{minWidth:0},children:[c.jsx(R.Typography,{sx:{fontSize:13,fontWeight:500,color:"#0f172a",lineHeight:1.35,overflowWrap:"anywhere"},children:t.label}),t.description&&c.jsx(R.Typography,{sx:{fontSize:11,color:"#64748b",lineHeight:1.4,mt:.2,overflowWrap:"anywhere"},children:t.description})]})]})})}function Ar({group:t,searchQuery:e}){const[n,i]=p.useState(!0),r=p.useMemo(()=>{const s=an(t.items).filter(o=>!o.children);return e?s.filter(o=>Sr(o,e)):t.items},[t.items,e]);return e&&r.length===0?null:c.jsxs(R.Box,{children:[!e&&c.jsxs(R.Box,{onClick:()=>i(s=>!s),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:.75,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.03)"}},children:[c.jsx(R.Box,{sx:{color:"#94a3b8",transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s",display:"flex"},children:c.jsx(U.MdKeyboardArrowRight,{size:14})}),t.icon&&c.jsx(R.Box,{sx:{color:"#64748b",display:"flex",mr:.25},children:t.icon}),c.jsx(R.Typography,{sx:{fontSize:11,fontWeight:700,color:"#64748b",textTransform:"uppercase",letterSpacing:.6,flex:1},children:t.label})]}),c.jsx(R.Collapse,{in:n||!!e,children:c.jsx(R.Box,{sx:{pb:.5},children:r.map((s,o)=>s.children?c.jsx(Ar,{group:{label:s.label,items:s.children},searchQuery:e},o):c.jsx(So,{item:s},o))})})]})}function Ao({width:t=300,title:e="Values",mode:n="drawer",floating:i=!1}){const r=Le(),[s,o]=p.useState(""),[u,a]=p.useState(null),l=p.useRef(null);if(p.useEffect(()=>{if(!(n==="popover"||n==="drawer"&&i)||!(r!=null&&r.isOpen))return;function g(x){var A,C;const h=x.target,m=(A=l.current)==null?void 0:A.contains(h),v=(C=r==null?void 0:r.anchorEl)==null?void 0:C.contains(h);!m&&!v&&(r==null||r.closePicker())}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[n,i,r==null?void 0:r.isOpen,r==null?void 0:r.anchorEl,r]),p.useEffect(()=>{if(!(n==="popover"||n==="drawer"&&i)||!(r!=null&&r.anchorEl)||!r.isOpen){a(null);return}const g=r.anchorEl.getBoundingClientRect(),x=t,h=440,m=r.anchorEl.closest(".MuiDrawer-paper")||r.anchorEl.closest(".MuiDialog-paper")||r.anchorEl.closest(".MuiPaper-root"),v=m?m.getBoundingClientRect():g,A=v.left-8,C=window.innerWidth-v.right-8,I=A>=x?v.left-x-8:C>=x?v.right+8:Math.max(8,v.left-x-8),S=g.top,y=Math.min(S,window.innerHeight-h-8);a({top:y,left:I})},[n,r==null?void 0:r.anchorEl,r==null?void 0:r.isOpen,t]),!r||n==="popover"&&!r.isOpen||n==="drawer"&&i&&!r.isOpen)return null;const d=r.groups.some(b=>s?an(b.items).some(g=>!g.children&&Sr(g,s)):!0),f=c.jsxs(R.Box,{ref:l,sx:{width:t,flexShrink:0,display:"flex",flexDirection:"column",bgcolor:"#1e2130",borderRadius:"10px",border:"1px solid rgba(255,255,255,0.08)",boxShadow:"0 8px 32px rgba(0,0,0,0.28)",overflow:"hidden",color:"#e2e8f0",maxHeight:440,...n==="popover"&&u?{position:"fixed",top:u.top,left:u.left,zIndex:1400}:n==="popover"?{display:"none"}:n==="drawer"&&i&&u?{position:"fixed",top:u.top,left:u.left,zIndex:1400}:n==="drawer"&&i?{display:"none"}:{}},children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:1.75,pb:1.25,borderBottom:"1px solid rgba(255,255,255,0.07)",flexShrink:0},children:[c.jsx(U.MdDataObject,{size:16,color:"#6366f1"}),c.jsx(R.Typography,{sx:{fontSize:13,fontWeight:700,flex:1,color:"#e2e8f0"},children:e}),(n==="popover"||n==="drawer"&&i)&&c.jsx(R.Box,{component:"button",type:"button",onClick:r.closePicker,sx:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",p:.25,borderRadius:"4px","&:hover":{color:"#e2e8f0",bgcolor:"rgba(255,255,255,0.08)"}},children:c.jsx(U.MdClose,{size:15})})]}),c.jsx(R.Box,{sx:{px:1.5,py:1,flexShrink:0},children:c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:.75,bgcolor:"rgba(255,255,255,0.07)",borderRadius:"7px",px:1.25,py:.6,border:"1px solid rgba(255,255,255,0.08)","&:focus-within":{border:"1px solid rgba(99,102,241,0.5)"}},children:[c.jsx(U.MdSearch,{size:15,color:"#64748b"}),c.jsx(R.InputBase,{placeholder:"Search variables...",value:s,onChange:b=>o(b.target.value),sx:{fontSize:12,flex:1,color:"#e2e8f0","& input::placeholder":{color:"#64748b",opacity:1}}}),s&&c.jsx(R.Box,{component:"button",type:"button",onClick:()=>o(""),sx:{background:"none",border:"none",cursor:"pointer",color:"#64748b",display:"flex",p:0,"&:hover":{color:"#94a3b8"}},children:c.jsx(U.MdClose,{size:12})})]})}),c.jsx(R.Divider,{sx:{borderColor:"rgba(255,255,255,0.06)"}}),c.jsx(R.Box,{sx:{flex:1,overflowY:"auto",py:.5,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(255,255,255,0.12)",borderRadius:4}},children:c.jsx(R.Box,{sx:{"& .MuiTypography-root":{color:"#cbd5e1"}},children:d?r.groups.map((b,g)=>c.jsx(Ar,{group:b,searchQuery:s},g)):c.jsx(R.Box,{sx:{px:2,py:3,textAlign:"center"},children:c.jsxs(R.Typography,{sx:{fontSize:12,color:"#475569"},children:['No variables match "',s,'"']})})})}),c.jsx(R.Box,{sx:{px:2,py:1,borderTop:"1px solid rgba(255,255,255,0.06)",flexShrink:0},children:c.jsx(R.Typography,{sx:{fontSize:10,color:"#475569",lineHeight:1.4},children:"Click to insert · Drag onto any field"})})]});return n==="popover"||n==="drawer"&&i?pr.createPortal(f,document.body):f}function Rr(t){return sn({expr:t.expr,label:t.label,path:t.path})}function ln(t){var i;if(t.nodeType===Node.TEXT_NODE)return t.textContent??"";const e=t;if((i=e.dataset)!=null&&i.expr)return e.dataset.expr;if(e.tagName==="BR")return"";let n="";return e.childNodes.forEach(r=>{n+=ln(r)}),n}function Ro(t){let e="";return t.childNodes.forEach(n=>{e+=ln(n)}),e}function Eo(t,e){t.innerHTML="";for(const n of e)n.type==="text"?n.value&&t.appendChild(document.createTextNode(n.value)):t.appendChild(Rr(n))}function Oo(t){const e=document.createDocumentFragment();for(const n of t)n.type==="text"?n.value&&e.appendChild(document.createTextNode(n.value)):e.appendChild(Rr(n));return e}function Cn(t){let e="";return t.childNodes.forEach(n=>{e+=ln(n)}),e}function un({expression:t,onExpressionChange:e,onBlur:n,placeholder:i,disabled:r,error:s,id:o,formulaConfigEnabled:u,onFormulaConfigToggle:a,onPickerOpen:l,compact:d}){const f=p.useRef(null),b=p.useRef(null),g=p.useRef(""),x=p.useRef(!1),h=t.length===0||t.length===1&&t[0].type==="text"&&!t[0].value,m=Le(),[v,A]=p.useState(null),[C,I]=p.useState(!1),S=p.useRef(void 0);p.useEffect(()=>{const B=f.current;if(!B)return;const z=Re(t),T=`${u?"1":"0"}:${z}`,P=S.current!==(m==null?void 0:m.groups);if(T===g.current&&!P)return;const Z=new Map;if(m!=null&&m.groups){const te=me=>{for(const ge of me)ge.path&&Z.set(ge.path,ge.label),ge.children&&te(ge.children)};for(const me of m.groups)te(me.items)}const Y=new Map;B.querySelectorAll("[data-path]").forEach(te=>{te.dataset.path&&te.dataset.label&&Y.set(te.dataset.path,te.dataset.label)});const K=nn(t,u).map(te=>{if(te.type!=="chip"||!te.path)return te;const me=Z.get(te.path)??Y.get(te.path)??te.label;return{...te,label:me}});Eo(B,K),g.current=T,S.current=m==null?void 0:m.groups},[t,u,m==null?void 0:m.groups]);const y=p.useCallback(()=>{const B=f.current;if(!B)return;const z=Ro(B),T=Ae(z,u),P=`${u?"1":"0"}:${Re(T)}`;P!==g.current&&(g.current=P,e(T))},[e,u]),E=p.useCallback(()=>{x.current||y()},[y]),F=p.useCallback(B=>{B.preventDefault();const z=B.clipboardData.getData("text/plain"),T=window.getSelection();if(!(T!=null&&T.rangeCount))return;const P=T.getRangeAt(0);P.deleteContents(),P.insertNode(Oo(vr(z,u))),P.collapse(!1),T.removeAllRanges(),T.addRange(P),y()},[y,u]),G=p.useCallback(B=>{const z=window.getSelection();if(!(z!=null&&z.rangeCount))return;const T=Cn(z.getRangeAt(0).cloneContents());T&&(B.clipboardData.setData("text/plain",T),B.preventDefault())},[]),M=p.useCallback(B=>{const z=window.getSelection();if(!(z!=null&&z.rangeCount))return;const T=z.getRangeAt(0),P=Cn(T.cloneContents());P&&(B.clipboardData.setData("text/plain",P),B.preventDefault(),T.deleteContents(),y())},[y]),D=p.useCallback(B=>{B.key==="Enter"&&B.preventDefault()},[]),N=p.useCallback((B,z)=>{const T=f.current;if(!T)return;T.focus();const P=window.getSelection();let Z=null;P&&P.rangeCount>0&&T.contains(P.getRangeAt(0).commonAncestorContainer)?Z=P.getRangeAt(0):(Z=document.createRange(),Z.selectNodeContents(T),Z.collapse(!1));const Y=Sn(B,z);Z.deleteContents(),Z.insertNode(Y),Z.setStartAfter(Y),Z.collapse(!0),P==null||P.removeAllRanges(),P==null||P.addRange(Z),y()},[y]),j=p.useCallback(()=>{!m||!o||(m.registerField({editorRef:f,savedRange:null,fieldId:o,onInsert:N}),m.notifyFieldFocus(o,f.current),m.openPicker())},[m,o,N]),w=p.useCallback(()=>{var z;if(!m)return;const B=window.getSelection();B&&B.rangeCount>0&&((z=f.current)!=null&&z.contains(B.anchorNode))&&m.saveRange(B.getRangeAt(0).cloneRange())},[m]);p.useEffect(()=>{document.addEventListener("selectionchange",w);const B=f.current;return B&&B.addEventListener("input",E),()=>{document.removeEventListener("selectionchange",w),B&&B.removeEventListener("input",E)}},[w,E]);const V=p.useCallback(B=>{r||!B.dataTransfer.types.includes(Lt)||(B.preventDefault(),B.dataTransfer.dropEffect="copy",A("valid"))},[r]),W=p.useCallback(()=>{A(null)},[]),J=p.useCallback(B=>{if(B.preventDefault(),A(null),r){I(!0);return}const z=B.dataTransfer.getData(Lt);if(!z)return;let T;try{T=JSON.parse(z)}catch{return}const P=Fo(B.clientX,B.clientY);if(!P)return;const Z=f.current;if(!Z||!Z.contains(P.commonAncestorContainer))return;const Y=Sn(T.path,T.label);P.deleteContents(),P.insertNode(Y),P.setStartAfter(Y),P.collapse(!0);const K=window.getSelection();K==null||K.removeAllRanges(),K==null||K.addRange(P),Z.dispatchEvent(new Event("input",{bubbles:!0}))},[r]),_=(a?1:0)+(l?1:0),ee=_>0?`${_*30+8}px`:"12px",re=v==="valid"?"#16a34a":v==="invalid"||s?"#d32f2f":"rgba(0,0,0,0.23)",k=v==="valid"?"0 0 0 2px rgba(22,163,74,0.2)":v==="invalid"?"0 0 0 2px rgba(211,47,47,0.2)":void 0;return c.jsxs(R.Box,{sx:{position:"relative"},children:[c.jsxs(R.Box,{sx:{border:`1px solid ${re}`,borderRadius:"4px",...d?{display:"flex",alignItems:"center",pl:1,py:"6px",pr:ee,overflow:"hidden"}:{display:"flex",alignItems:"center",pl:1.5,py:"6px",pr:ee,overflow:"hidden"},fontSize:d?13:14,lineHeight:1.5,cursor:r?"not-allowed":"text",bgcolor:v==="valid"?"rgba(22,163,74,0.04)":r?"rgba(0,0,0,0.04)":"#fff",transition:"border-color 0.15s, box-shadow 0.15s, background 0.15s",boxShadow:k,"&:focus-within":{borderColor:s?"#d32f2f":"#1976d2",boxShadow:s?"0 0 0 2px rgba(211,47,47,0.2)":"0 0 0 2px rgba(25,118,210,0.2)"}},onDragOver:V,onDragLeave:W,onDrop:J,onClick:()=>{var B;r||(B=f.current)==null||B.focus()},children:[h&&i&&c.jsx(R.Typography,{component:"span",sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",left:d?8:14,right:ee,fontSize:d?13:14,color:"rgba(0,0,0,0.38)",pointerEvents:"none",userSelect:"none",lineHeight:1.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i}),c.jsx("div",{ref:f,id:o,contentEditable:r?"false":"true",suppressContentEditableWarning:!0,onPaste:F,onCopy:G,onCut:M,onKeyDown:D,onFocus:j,onBlur:n,onCompositionStart:()=>{x.current=!0},onCompositionEnd:()=>{x.current=!1,y()},style:{outline:"none",flex:1,minWidth:0,overflow:"hidden",minHeight:"21px",lineHeight:1.5,whiteSpace:"nowrap"}})]}),_>0&&!r&&c.jsxs(R.Box,{sx:{position:"absolute",right:4,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[a&&c.jsx(R.Tooltip,{title:u?"Disable formula config":"Enable formula config",placement:"top",children:c.jsx(R.Box,{component:"button",type:"button",ref:b,onClick:B=>{B.stopPropagation();const z=!u;m==null||m.notifyFormulaToggle(z,z?b.current:null),a()},sx:{border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:26,height:26,borderRadius:"4px",p:0,color:u?"#7c4dff":"#94a3b8",bgcolor:u?"#ede9fe":"transparent","&:hover":{bgcolor:"#ede9fe",color:"#7c4dff"}},children:c.jsx(U.MdDataObject,{size:17})})}),l&&c.jsx(R.Tooltip,{title:"Insert variable",placement:"top",children:c.jsx(R.Box,{component:"button",type:"button",onClick:B=>{B.stopPropagation(),l()},sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:26,height:26,borderRadius:"4px",color:"#64748b",p:0,"&:hover":{bgcolor:"#f1f5f9"}},children:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:14,height:14,children:c.jsx("path",{d:"M4.06 13a8 8 0 0 0 5.18 6.51A18.5 18.5 0 0 1 8.02 17c0-1.49.18-2.95.52-4.32L4.06 13zm0-2h4.48A18.5 18.5 0 0 0 8.02 7c0-1.02.06-2 .2-2.94A8 8 0 0 0 4.06 11zm11.88 0h4.48a8 8 0 0 0-4.16-6.94c.14.94.2 1.92.2 2.94 0 1.38-.15 2.71-.52 4zm0 2c-.37 1.29-.52 2.62-.52 4 0 1.02.06 2 .2 2.94A8 8 0 0 0 19.94 13h-4.18zM9.03 13c-.4 1.32-.57 2.7-.57 4 0 1.12.13 2.2.38 3.22A8 8 0 0 0 12 21a8 8 0 0 0 3.16-.78c.25-1.02.38-2.1.38-3.22 0-1.3-.17-2.68-.57-4H9.03zm.52-2h4.9C14.13 9.71 14 8.37 14 7c0-1.12-.13-2.2-.38-3.22A8 8 0 0 0 12 3a8 8 0 0 0-3.16.78C8.59 4.8 8.46 5.88 8.46 7c0 1.37.2 2.7.52 4h.57z"})})})})]}),c.jsx(R.Snackbar,{open:C,autoHideDuration:3e3,onClose:()=>I(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:c.jsx(R.Alert,{severity:"error",onClose:()=>I(!1),sx:{fontSize:13},children:"This field is disabled — cannot insert variable"})})]})}function Fo(t,e){var i;if(document.caretRangeFromPoint)return document.caretRangeFromPoint(t,e);const n=(i=document.caretPositionFromPoint)==null?void 0:i.call(document,t,e);if(n){const r=document.createRange();return r.setStart(n.offsetNode,n.offset),r.collapse(!0),r}return null}function Sn(t,e){return sn({expr:Ir(t),label:e,path:t})}function Er({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s,formulaConfig:o,onFormulaConfigChange:u,inlineLabel:a}){const l={...t,multiline:t.multiline||t.type==="textarea"},d=l.id??l.name??"",f=l.formula===!0,b=Le(),[g,x]=p.useState(()=>f&&d in(o??{})),h=p.useRef(g);h.current=g,p.useEffect(()=>()=>{h.current&&(b==null||b.notifyFormulaToggle(!1))},[]);const[m,v]=p.useState(()=>f?Ae(String(e??""),d in(o??{})):[]),[A,C]=p.useState(()=>String(e??"")),I=p.useRef(e);p.useEffect(()=>{if(e===I.current)return;I.current=e;const k=String(e??"");C(k),f&&v(Ae(k,g))},[e]);const S=k=>{v(k);const B=g?$e(k):Re(k);I.current=B,n(B)},y=()=>{const k=!g;if(x(k),k){const B=Re(m),z=Ae(B,!0);v(z);const T=$e(z);I.current=T,n(T),u==null||u({...o,[d]:tn()})}else{const B=Re(m);I.current=B,n(B);const z={...o};delete z[d],u==null||u(z)}},E=s&&!!r,F=l.disabled===!0,G=c.jsx(se,{label:l.label,required:l.required,showOptional:l.showOptional,info:l.info,htmlFor:d,dataTestId:l.dataTestId});if(f){const k=l.helperText&&!a?c.jsx("small",{style:oe,children:l.helperText}):null,B=c.jsxs(c.Fragment,{children:[k,c.jsx(un,{id:d,expression:m,onExpressionChange:S,onBlur:i,placeholder:l.formulaPlaceholder??"Type or paste a variable expression...",disabled:F,error:E,formulaConfigEnabled:g,onFormulaConfigToggle:y,compact:l.compact}),E&&c.jsx("small",{"data-testid":`${d}-error`,style:ae,children:r})]});return a?c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 0"},children:[c.jsx("div",{style:{flex:"0 0 160px",minWidth:0},children:G}),c.jsx("div",{style:{flex:1,minWidth:0},children:B})]}):c.jsxs("div",{children:[G,B]})}const M=!!l.prefix,D=!!l.suffix,N=!!l.copyable,j=D||N,w={width:"100%",fontSize:14,color:"#374151",backgroundColor:F?"#f9fafb":"#fff",border:`1px solid ${E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,outline:"none",paddingTop:l.multiline?"8px":"6px",paddingBottom:l.multiline?"8px":"6px",paddingLeft:M?0:"12px",paddingRight:j?0:"12px",boxSizing:"border-box",lineHeight:1.5,cursor:F?"not-allowed":void 0,resize:l.multiline?"vertical":"none"},V={position:"relative",display:"flex",alignItems:"stretch",width:"100%",border:`1px solid ${E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,backgroundColor:F?"#f9fafb":"#fff",boxSizing:"border-box"},W={display:"flex",alignItems:"center",padding:"0 10px",color:"#6b7280",fontSize:13,whiteSpace:"nowrap",flexShrink:0},J={flex:1,minHeight:0,border:"none",outline:"none",backgroundColor:"transparent",fontSize:14,color:"#374151",padding:l.multiline?"8px 12px":"6px 12px",cursor:F?"not-allowed":void 0,resize:l.multiline?"vertical":"none",boxSizing:"border-box",lineHeight:1.5},ee=M||j?c.jsxs("div",{style:V,onFocus:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,k.currentTarget.style.boxShadow=E?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlur:k=>{k.currentTarget.contains(k.relatedTarget)||(k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,k.currentTarget.style.boxShadow="none")},children:[M&&c.jsx("span",{style:W,children:l.prefix}),l.multiline?c.jsx("textarea",{id:d,name:d,style:{...J,minHeight:72},placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,rows:l.rows??3,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i}):c.jsx("input",{id:d,name:d,type:l.inputType??"text",style:J,placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i}),D&&c.jsx("span",{style:W,children:l.suffix}),N&&c.jsx(R.Tooltip,{title:"Copy",placement:"top",children:c.jsx("button",{type:"button",onClick:()=>navigator.clipboard.writeText(A),"aria-label":"copy",tabIndex:-1,style:{...W,background:"none",border:"none",cursor:"pointer",padding:"0 8px"},children:c.jsx(U.MdContentCopy,{size:16})})})]}):l.multiline?c.jsx("textarea",{id:d,name:d,style:{...w,minHeight:72,height:void 0,padding:"8px 12px"},placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,rows:l.rows??3,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i,onFocus:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,k.currentTarget.style.boxShadow=E?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,k.currentTarget.style.boxShadow="none"}}):c.jsx("input",{id:d,name:d,type:l.inputType??"text",style:w,placeholder:l.placeholder??"",value:A,disabled:F,readOnly:l.readOnly,autoComplete:l.autocomplete??"off",autoFocus:l.autoFocus,"data-testid":l.dataTestId??`${d}-input`,"aria-label":l.ariaLabel??l.label,"aria-describedby":l.ariaDescribedBy,"aria-required":l.required||void 0,"aria-invalid":E||void 0,onChange:k=>{C(k.target.value),I.current=k.target.value,n(k.target.value)},onBlur:i,onFocus:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,k.currentTarget.style.boxShadow=E?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:k=>{k.currentTarget.style.borderColor=E?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,k.currentTarget.style.boxShadow="none"}}),re=c.jsxs(c.Fragment,{children:[l.helperText&&!E&&!a&&c.jsx("small",{style:oe,children:l.helperText}),ee,E&&c.jsx("small",{"data-testid":`${d}-error`,style:ae,children:r})]});return a?c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 0"},children:[c.jsx("div",{style:{flex:"0 0 160px",minWidth:0},children:G}),c.jsx("div",{style:{flex:1,minWidth:0},children:re})]}):c.jsxs("div",{children:[G,re]})}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},H.apply(null,arguments)}function Be(t){"@babel/helpers - typeof";return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(t)}function wo(t,e){if(Be(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Be(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Or(t){var e=wo(t,"string");return Be(e)=="symbol"?e:e+""}function Pe(t,e,n){return(e=Or(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function An(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?An(Object(n),!0).forEach(function(i){Pe(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Or(i.key),i)}}function To(t,e,n){return e&&Rn(t.prototype,e),n&&Rn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wt(t,e){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Wt(t,e)}function Go(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wt(t,e)}function ct(t){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ct(t)}function Fr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fr=function(){return!!t})()}function jo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vo(t,e){if(e&&(Be(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jo(t)}function Do(t){var e=Fr();return function(){var n,i=ct(t);if(e){var r=ct(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Vo(this,n)}}function Xt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Po(t){if(Array.isArray(t))return Xt(t)}function No(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wr(t,e){if(t){if(typeof t=="string")return Xt(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(t,e):void 0}}function Mo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Me(t){return Po(t)||No(t)||wr(t)||Mo()}function ko(t){if(Array.isArray(t))return t}function Lo(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,s,o,u=[],a=!0,l=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;a=!1}else for(;!(a=(i=s.call(n)).done)&&(u.push(i.value),u.length!==e);a=!0);}catch(d){l=!0,r=d}finally{try{if(!a&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw r}}return u}}function Wo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ie(t,e){return ko(t)||Lo(t,e)||wr(t,e)||Wo()}function Tr(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}function pe(t,e){if(t==null)return{};var n,i,r=Tr(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Xo(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const zo=Math.min,Ho=Math.max,dt=Math.round,Ke=Math.floor,ft=t=>({x:t,y:t});function Zo(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function It(){return typeof window<"u"}function Br(t){return Gr(t)?(t.nodeName||"").toLowerCase():"#document"}function Ce(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function jr(t){var e;return(e=(Gr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gr(t){return It()?t instanceof Node||t instanceof Ce(t).Node:!1}function _o(t){return It()?t instanceof Element||t instanceof Ce(t).Element:!1}function cn(t){return It()?t instanceof HTMLElement||t instanceof Ce(t).HTMLElement:!1}function En(t){return!It()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ce(t).ShadowRoot}function Vr(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=dn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}let Ft;function Jo(){return Ft==null&&(Ft=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ft}function Yo(t){return/^(html|body|#document)$/.test(Br(t))}function dn(t){return Ce(t).getComputedStyle(t)}function $o(t){if(Br(t)==="html")return t;const e=t.assignedSlot||t.parentNode||En(t)&&t.host||jr(t);return En(e)?e.host:e}function Dr(t){const e=$o(t);return Yo(e)?t.ownerDocument?t.ownerDocument.body:t.body:cn(e)&&Vr(e)?e:Dr(e)}function pt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Dr(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=Ce(r);if(s){const u=zt(o);return e.concat(o,o.visualViewport||[],Vr(r)?r:[],u&&n?pt(u):[])}else return e.concat(r,pt(r,[],n))}function zt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Uo(t){const e=dn(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=cn(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,u=dt(n)!==s||dt(i)!==o;return u&&(n=s,i=o),{width:n,height:i,$:u}}function fn(t){return _o(t)?t:t.contextElement}function On(t){const e=fn(t);if(!cn(e))return ft(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=Uo(e);let o=(s?dt(n.width):n.width)/i,u=(s?dt(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const Qo=ft(0);function qo(t){const e=Ce(t);return!Jo()||!e.visualViewport?Qo:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ko(t,e,n){return!1}function Fn(t,e,n,i){e===void 0&&(e=!1);const r=t.getBoundingClientRect(),s=fn(t);let o=ft(1);e&&(o=On(t));const u=Ko()?qo(s):ft(0);let a=(r.left+u.x)/o.x,l=(r.top+u.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s){const b=Ce(s),g=i;let x=b,h=zt(x);for(;h&&i&&g!==x;){const m=On(h),v=h.getBoundingClientRect(),A=dn(h),C=v.left+(h.clientLeft+parseFloat(A.paddingLeft))*m.x,I=v.top+(h.clientTop+parseFloat(A.paddingTop))*m.y;a*=m.x,l*=m.y,d*=m.x,f*=m.y,a+=C,l+=I,x=Ce(h),h=zt(x)}}return Zo({width:d,height:f,x:a,y:l})}function Pr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function es(t,e){let n=null,i;const r=jr(t);function s(){var u;clearTimeout(i),(u=n)==null||u.disconnect(),n=null}function o(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),s();const l=t.getBoundingClientRect(),{left:d,top:f,width:b,height:g}=l;if(u||e(),!b||!g)return;const x=Ke(f),h=Ke(r.clientWidth-(d+b)),m=Ke(r.clientHeight-(f+g)),v=Ke(d),C={rootMargin:-x+"px "+-h+"px "+-m+"px "+-v+"px",threshold:Ho(0,zo(1,a))||1};let I=!0;function S(y){const E=y[0].intersectionRatio;if(E!==a){if(!I)return o();E?o(!1,E):i=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!Pr(l,t.getBoundingClientRect())&&o(),I=!1}try{n=new IntersectionObserver(S,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,C)}n.observe(t)}return o(!0),s}function ts(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,l=fn(t),d=r||s?[...l?pt(l):[],...e?pt(e):[]]:[];d.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const f=l&&u?es(l,n):null;let b=-1,g=null;o&&(g=new ResizeObserver(v=>{let[A]=v;A&&A.target===l&&g&&e&&(g.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(e)})),n()}),l&&!a&&g.observe(l),e&&g.observe(e));let x,h=a?Fn(t):null;a&&m();function m(){const v=Fn(t);h&&!Pr(h,v)&&n(),h=v,x=requestAnimationFrame(m)}return n(),()=>{var v;d.forEach(A=>{r&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),f==null||f(),(v=g)==null||v.disconnect(),g=null,a&&cancelAnimationFrame(x)}}var Ht=p.useLayoutEffect,ns=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],gt=function(){};function rs(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function is(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var s=[].concat(i);if(e&&t)for(var o in e)e.hasOwnProperty(o)&&e[o]&&s.push("".concat(rs(t,o)));return s.filter(function(u){return u}).map(function(u){return String(u).trim()}).join(" ")}var bt=function(e){return gs(e)?e.filter(Boolean):Te(e)==="object"&&e!==null?[e]:[]},Nr=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=pe(e,ns);return L({},n)},ne=function(e,n,i){var r=e.cx,s=e.getStyles,o=e.getClassNames,u=e.className;return{css:s(n,e),className:r(i??{},o(n,e),u)}};function os(t,e,n){if(n){var i=n(t,e);if(typeof i=="string")return i}return t}function yt(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function ss(t){return yt(t)?window.innerHeight:t.clientHeight}function Mr(t){return yt(t)?window.pageYOffset:t.scrollTop}function ht(t,e){if(yt(t)){window.scrollTo(0,e);return}t.scrollTop=e}function as(t){var e=getComputedStyle(t),n=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=t;r=r.parentElement;)if(e=getComputedStyle(r),!(n&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function ls(t,e,n,i){return n*((t=t/i-1)*t*t+1)+e}function et(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:gt,r=Mr(t),s=e-r,o=10,u=0;function a(){u+=o;var l=ls(u,r,s,n);ht(t,l),u<n?window.requestAnimationFrame(a):i(t)}a()}function wn(t,e){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetHeight/3;i.bottom+r>n.bottom?ht(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):i.top-r<n.top&&ht(t,Math.max(e.offsetTop-r,0))}function us(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function Tn(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function cs(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var kr=!1,ds={get passive(){return kr=!0}},tt=typeof window<"u"?window:{};tt.addEventListener&&tt.removeEventListener&&(tt.addEventListener("p",gt,ds),tt.removeEventListener("p",gt,!1));var fs=kr;function ps(t){return t!=null}function gs(t){return Array.isArray(t)}function _e(t,e,n){return t?e:n}var bs=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var s=Object.entries(e).filter(function(o){var u=ie(o,1),a=u[0];return!i.includes(a)});return s.reduce(function(o,u){var a=ie(u,2),l=a[0],d=a[1];return o[l]=d,o},{})},hs=["children","innerProps"],ms=["children","innerProps"];function xs(t){var e=t.maxHeight,n=t.menuEl,i=t.minHeight,r=t.placement,s=t.shouldScroll,o=t.isFixedPosition,u=t.controlHeight,a=as(n),l={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return l;var d=a.getBoundingClientRect(),f=d.height,b=n.getBoundingClientRect(),g=b.bottom,x=b.height,h=b.top,m=n.offsetParent.getBoundingClientRect(),v=m.top,A=o?window.innerHeight:ss(a),C=Mr(a),I=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),y=v-S,E=A-h,F=y+C,j=f-C-h,M=g-A+C+I,D=C+h-S,N=160;switch(r){case"auto":case"bottom":if(E>=x)return{placement:"bottom",maxHeight:e};if(j>=x&&!o)return s&&et(a,M,N),{placement:"bottom",maxHeight:e};if(!o&&j>=i||o&&E>=i){s&&et(a,M,N);var G=o?E-I:j-I;return{placement:"bottom",maxHeight:G}}if(r==="auto"||o){var w=e,V=o?y:F;return V>=i&&(w=Math.min(V-I-u,e)),{placement:"top",maxHeight:w}}if(r==="bottom")return s&&ht(a,M),{placement:"bottom",maxHeight:e};break;case"top":if(y>=x)return{placement:"top",maxHeight:e};if(F>=x&&!o)return s&&et(a,D,N),{placement:"top",maxHeight:e};if(!o&&F>=i||o&&y>=i){var W=e;return(!o&&F>=i||o&&y>=i)&&(W=o?y-S:F-S),s&&et(a,D,N),{placement:"top",maxHeight:W}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return l}function vs(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var Lr=function(e){return e==="auto"?"bottom":e},Is=function(e,n){var i,r=e.placement,s=e.theme,o=s.borderRadius,u=s.spacing,a=s.colors;return L((i={label:"menu"},Pe(i,vs(r),"100%"),Pe(i,"position","absolute"),Pe(i,"width","100%"),Pe(i,"zIndex",1),i),n?{}:{backgroundColor:a.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},Wr=p.createContext(null),ys=function(e){var n=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,u=e.menuShouldScrollIntoView,a=e.theme,l=p.useContext(Wr)||{},d=l.setPortalPlacement,f=p.useRef(null),b=p.useState(r),g=ie(b,2),x=g[0],h=g[1],m=p.useState(null),v=ie(m,2),A=v[0],C=v[1],I=a.spacing.controlHeight;return Ht(function(){var S=f.current;if(S){var y=o==="fixed",E=u&&!y,F=xs({maxHeight:r,menuEl:S,minHeight:i,placement:s,shouldScroll:E,isFixedPosition:y,controlHeight:I});h(F.maxHeight),C(F.placement),d==null||d(F.placement)}},[r,s,o,u,i,d,I]),n({ref:f,placerProps:L(L({},e),{},{placement:A||Lr(s),maxHeight:x})})},Cs=function(e){var n=e.children,i=e.innerRef,r=e.innerProps;return X.jsx("div",H({},ne(e,"menu",{menu:!0}),{ref:i},r),n)},Ss=Cs,As=function(e,n){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return L({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},Rs=function(e){var n=e.children,i=e.innerProps,r=e.innerRef,s=e.isMulti;return X.jsx("div",H({},ne(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},i),n)},Xr=function(e,n){var i=e.theme,r=i.spacing.baseUnit,s=i.colors;return L({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Es=Xr,Os=Xr,Fs=function(e){var n=e.children,i=n===void 0?"No options":n,r=e.innerProps,s=pe(e,hs);return X.jsx("div",H({},ne(L(L({},s),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},ws=function(e){var n=e.children,i=n===void 0?"Loading...":n,r=e.innerProps,s=pe(e,ms);return X.jsx("div",H({},ne(L(L({},s),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},Ts=function(e){var n=e.rect,i=e.offset,r=e.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},Bs=function(e){var n=e.appendTo,i=e.children,r=e.controlElement,s=e.innerProps,o=e.menuPlacement,u=e.menuPosition,a=p.useRef(null),l=p.useRef(null),d=p.useState(Lr(o)),f=ie(d,2),b=f[0],g=f[1],x=p.useMemo(function(){return{setPortalPlacement:g}},[]),h=p.useState(null),m=ie(h,2),v=m[0],A=m[1],C=p.useCallback(function(){if(r){var E=us(r),F=u==="fixed"?0:window.pageYOffset,j=E[b]+F;(j!==(v==null?void 0:v.offset)||E.left!==(v==null?void 0:v.rect.left)||E.width!==(v==null?void 0:v.rect.width))&&A({offset:j,rect:E})}},[r,u,b,v==null?void 0:v.offset,v==null?void 0:v.rect.left,v==null?void 0:v.rect.width]);Ht(function(){C()},[C]);var I=p.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),r&&a.current&&(l.current=ts(r,a.current,C,{elementResize:"ResizeObserver"in window}))},[r,C]);Ht(function(){I()},[I]);var S=p.useCallback(function(E){a.current=E,I()},[I]);if(!n&&u!=="fixed"||!v)return null;var y=X.jsx("div",H({ref:S},ne(L(L({},e),{},{offset:v.offset,position:u,rect:v.rect}),"menuPortal",{"menu-portal":!0}),s),i);return X.jsx(Wr.Provider,{value:x},n?pr.createPortal(y,n):y)},js=function(e){var n=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Gs=function(e){var n=e.children,i=e.innerProps,r=e.isDisabled,s=e.isRtl;return X.jsx("div",H({},ne(e,"container",{"--is-disabled":r,"--is-rtl":s}),i),n)},Vs=function(e,n){var i=e.theme.spacing,r=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return L({alignItems:"center",display:r&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},Ds=function(e){var n=e.children,i=e.innerProps,r=e.isMulti,s=e.hasValue;return X.jsx("div",H({},ne(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),i),n)},Ps=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Ns=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"indicatorsContainer",{indicators:!0}),i),n)},Bn,Ms=["size"],ks=["innerProps","isRtl","size"];function Ls(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Ws=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpb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ey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */",toString:Ls},zr=function(e){var n=e.size,i=pe(e,Ms);return X.jsx("svg",H({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ws},i))},pn=function(e){return X.jsx(zr,H({size:20},e),X.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Hr=function(e){return X.jsx(zr,H({size:20},e),X.jsx("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Zr=function(e,n){var i=e.isFocused,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return L({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?o.neutral60:o.neutral20,padding:s*2,":hover":{color:i?o.neutral80:o.neutral40}})},Xs=Zr,zs=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||X.jsx(Hr,null))},Hs=Zr,Zs=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||X.jsx(pn,null))},_s=function(e,n){var i=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return L({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},Js=function(e){var n=e.innerProps;return X.jsx("span",H({},n,ne(e,"indicatorSeparator",{"indicator-separator":!0})))},Ys=X.keyframes(Bn||(Bn=Xo([`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ie(t,e){return ko(t)||Lo(t,e)||wr(t,e)||Wo()}function Br(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}function pe(t,e){if(t==null)return{};var n,i,r=Br(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Xo(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const zo=Math.min,Ho=Math.max,dt=Math.round,Ke=Math.floor,ft=t=>({x:t,y:t});function Zo(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function It(){return typeof window<"u"}function Tr(t){return jr(t)?(t.nodeName||"").toLowerCase():"#document"}function Ce(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Gr(t){var e;return(e=(jr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jr(t){return It()?t instanceof Node||t instanceof Ce(t).Node:!1}function _o(t){return It()?t instanceof Element||t instanceof Ce(t).Element:!1}function cn(t){return It()?t instanceof HTMLElement||t instanceof Ce(t).HTMLElement:!1}function En(t){return!It()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ce(t).ShadowRoot}function Vr(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=dn(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}let Ft;function Jo(){return Ft==null&&(Ft=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ft}function Yo(t){return/^(html|body|#document)$/.test(Tr(t))}function dn(t){return Ce(t).getComputedStyle(t)}function $o(t){if(Tr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||En(t)&&t.host||Gr(t);return En(e)?e.host:e}function Dr(t){const e=$o(t);return Yo(e)?t.ownerDocument?t.ownerDocument.body:t.body:cn(e)&&Vr(e)?e:Dr(e)}function pt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Dr(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=Ce(r);if(s){const u=zt(o);return e.concat(o,o.visualViewport||[],Vr(r)?r:[],u&&n?pt(u):[])}else return e.concat(r,pt(r,[],n))}function zt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Uo(t){const e=dn(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=cn(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,u=dt(n)!==s||dt(i)!==o;return u&&(n=s,i=o),{width:n,height:i,$:u}}function fn(t){return _o(t)?t:t.contextElement}function On(t){const e=fn(t);if(!cn(e))return ft(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=Uo(e);let o=(s?dt(n.width):n.width)/i,u=(s?dt(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const Qo=ft(0);function qo(t){const e=Ce(t);return!Jo()||!e.visualViewport?Qo:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ko(t,e,n){return!1}function Fn(t,e,n,i){e===void 0&&(e=!1);const r=t.getBoundingClientRect(),s=fn(t);let o=ft(1);e&&(o=On(t));const u=Ko()?qo(s):ft(0);let a=(r.left+u.x)/o.x,l=(r.top+u.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s){const b=Ce(s),g=i;let x=b,h=zt(x);for(;h&&i&&g!==x;){const m=On(h),v=h.getBoundingClientRect(),A=dn(h),C=v.left+(h.clientLeft+parseFloat(A.paddingLeft))*m.x,I=v.top+(h.clientTop+parseFloat(A.paddingTop))*m.y;a*=m.x,l*=m.y,d*=m.x,f*=m.y,a+=C,l+=I,x=Ce(h),h=zt(x)}}return Zo({width:d,height:f,x:a,y:l})}function Pr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function es(t,e){let n=null,i;const r=Gr(t);function s(){var u;clearTimeout(i),(u=n)==null||u.disconnect(),n=null}function o(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),s();const l=t.getBoundingClientRect(),{left:d,top:f,width:b,height:g}=l;if(u||e(),!b||!g)return;const x=Ke(f),h=Ke(r.clientWidth-(d+b)),m=Ke(r.clientHeight-(f+g)),v=Ke(d),C={rootMargin:-x+"px "+-h+"px "+-m+"px "+-v+"px",threshold:Ho(0,zo(1,a))||1};let I=!0;function S(y){const E=y[0].intersectionRatio;if(E!==a){if(!I)return o();E?o(!1,E):i=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!Pr(l,t.getBoundingClientRect())&&o(),I=!1}try{n=new IntersectionObserver(S,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,C)}n.observe(t)}return o(!0),s}function ts(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,l=fn(t),d=r||s?[...l?pt(l):[],...e?pt(e):[]]:[];d.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const f=l&&u?es(l,n):null;let b=-1,g=null;o&&(g=new ResizeObserver(v=>{let[A]=v;A&&A.target===l&&g&&e&&(g.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(e)})),n()}),l&&!a&&g.observe(l),e&&g.observe(e));let x,h=a?Fn(t):null;a&&m();function m(){const v=Fn(t);h&&!Pr(h,v)&&n(),h=v,x=requestAnimationFrame(m)}return n(),()=>{var v;d.forEach(A=>{r&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),f==null||f(),(v=g)==null||v.disconnect(),g=null,a&&cancelAnimationFrame(x)}}var Ht=p.useLayoutEffect,ns=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],gt=function(){};function rs(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function is(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var s=[].concat(i);if(e&&t)for(var o in e)e.hasOwnProperty(o)&&e[o]&&s.push("".concat(rs(t,o)));return s.filter(function(u){return u}).map(function(u){return String(u).trim()}).join(" ")}var bt=function(e){return gs(e)?e.filter(Boolean):Be(e)==="object"&&e!==null?[e]:[]},Nr=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=pe(e,ns);return L({},n)},ne=function(e,n,i){var r=e.cx,s=e.getStyles,o=e.getClassNames,u=e.className;return{css:s(n,e),className:r(i??{},o(n,e),u)}};function os(t,e,n){if(n){var i=n(t,e);if(typeof i=="string")return i}return t}function yt(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function ss(t){return yt(t)?window.innerHeight:t.clientHeight}function Mr(t){return yt(t)?window.pageYOffset:t.scrollTop}function ht(t,e){if(yt(t)){window.scrollTo(0,e);return}t.scrollTop=e}function as(t){var e=getComputedStyle(t),n=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=t;r=r.parentElement;)if(e=getComputedStyle(r),!(n&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function ls(t,e,n,i){return n*((t=t/i-1)*t*t+1)+e}function et(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:gt,r=Mr(t),s=e-r,o=10,u=0;function a(){u+=o;var l=ls(u,r,s,n);ht(t,l),u<n?window.requestAnimationFrame(a):i(t)}a()}function wn(t,e){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetHeight/3;i.bottom+r>n.bottom?ht(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):i.top-r<n.top&&ht(t,Math.max(e.offsetTop-r,0))}function us(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function Bn(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function cs(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var kr=!1,ds={get passive(){return kr=!0}},tt=typeof window<"u"?window:{};tt.addEventListener&&tt.removeEventListener&&(tt.addEventListener("p",gt,ds),tt.removeEventListener("p",gt,!1));var fs=kr;function ps(t){return t!=null}function gs(t){return Array.isArray(t)}function _e(t,e,n){return t?e:n}var bs=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var s=Object.entries(e).filter(function(o){var u=ie(o,1),a=u[0];return!i.includes(a)});return s.reduce(function(o,u){var a=ie(u,2),l=a[0],d=a[1];return o[l]=d,o},{})},hs=["children","innerProps"],ms=["children","innerProps"];function xs(t){var e=t.maxHeight,n=t.menuEl,i=t.minHeight,r=t.placement,s=t.shouldScroll,o=t.isFixedPosition,u=t.controlHeight,a=as(n),l={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return l;var d=a.getBoundingClientRect(),f=d.height,b=n.getBoundingClientRect(),g=b.bottom,x=b.height,h=b.top,m=n.offsetParent.getBoundingClientRect(),v=m.top,A=o?window.innerHeight:ss(a),C=Mr(a),I=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),y=v-S,E=A-h,F=y+C,G=f-C-h,M=g-A+C+I,D=C+h-S,N=160;switch(r){case"auto":case"bottom":if(E>=x)return{placement:"bottom",maxHeight:e};if(G>=x&&!o)return s&&et(a,M,N),{placement:"bottom",maxHeight:e};if(!o&&G>=i||o&&E>=i){s&&et(a,M,N);var j=o?E-I:G-I;return{placement:"bottom",maxHeight:j}}if(r==="auto"||o){var w=e,V=o?y:F;return V>=i&&(w=Math.min(V-I-u,e)),{placement:"top",maxHeight:w}}if(r==="bottom")return s&&ht(a,M),{placement:"bottom",maxHeight:e};break;case"top":if(y>=x)return{placement:"top",maxHeight:e};if(F>=x&&!o)return s&&et(a,D,N),{placement:"top",maxHeight:e};if(!o&&F>=i||o&&y>=i){var W=e;return(!o&&F>=i||o&&y>=i)&&(W=o?y-S:F-S),s&&et(a,D,N),{placement:"top",maxHeight:W}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return l}function vs(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var Lr=function(e){return e==="auto"?"bottom":e},Is=function(e,n){var i,r=e.placement,s=e.theme,o=s.borderRadius,u=s.spacing,a=s.colors;return L((i={label:"menu"},Pe(i,vs(r),"100%"),Pe(i,"position","absolute"),Pe(i,"width","100%"),Pe(i,"zIndex",1),i),n?{}:{backgroundColor:a.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},Wr=p.createContext(null),ys=function(e){var n=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,u=e.menuShouldScrollIntoView,a=e.theme,l=p.useContext(Wr)||{},d=l.setPortalPlacement,f=p.useRef(null),b=p.useState(r),g=ie(b,2),x=g[0],h=g[1],m=p.useState(null),v=ie(m,2),A=v[0],C=v[1],I=a.spacing.controlHeight;return Ht(function(){var S=f.current;if(S){var y=o==="fixed",E=u&&!y,F=xs({maxHeight:r,menuEl:S,minHeight:i,placement:s,shouldScroll:E,isFixedPosition:y,controlHeight:I});h(F.maxHeight),C(F.placement),d==null||d(F.placement)}},[r,s,o,u,i,d,I]),n({ref:f,placerProps:L(L({},e),{},{placement:A||Lr(s),maxHeight:x})})},Cs=function(e){var n=e.children,i=e.innerRef,r=e.innerProps;return X.jsx("div",H({},ne(e,"menu",{menu:!0}),{ref:i},r),n)},Ss=Cs,As=function(e,n){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return L({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},Rs=function(e){var n=e.children,i=e.innerProps,r=e.innerRef,s=e.isMulti;return X.jsx("div",H({},ne(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},i),n)},Xr=function(e,n){var i=e.theme,r=i.spacing.baseUnit,s=i.colors;return L({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Es=Xr,Os=Xr,Fs=function(e){var n=e.children,i=n===void 0?"No options":n,r=e.innerProps,s=pe(e,hs);return X.jsx("div",H({},ne(L(L({},s),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},ws=function(e){var n=e.children,i=n===void 0?"Loading...":n,r=e.innerProps,s=pe(e,ms);return X.jsx("div",H({},ne(L(L({},s),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},Bs=function(e){var n=e.rect,i=e.offset,r=e.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},Ts=function(e){var n=e.appendTo,i=e.children,r=e.controlElement,s=e.innerProps,o=e.menuPlacement,u=e.menuPosition,a=p.useRef(null),l=p.useRef(null),d=p.useState(Lr(o)),f=ie(d,2),b=f[0],g=f[1],x=p.useMemo(function(){return{setPortalPlacement:g}},[]),h=p.useState(null),m=ie(h,2),v=m[0],A=m[1],C=p.useCallback(function(){if(r){var E=us(r),F=u==="fixed"?0:window.pageYOffset,G=E[b]+F;(G!==(v==null?void 0:v.offset)||E.left!==(v==null?void 0:v.rect.left)||E.width!==(v==null?void 0:v.rect.width))&&A({offset:G,rect:E})}},[r,u,b,v==null?void 0:v.offset,v==null?void 0:v.rect.left,v==null?void 0:v.rect.width]);Ht(function(){C()},[C]);var I=p.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),r&&a.current&&(l.current=ts(r,a.current,C,{elementResize:"ResizeObserver"in window}))},[r,C]);Ht(function(){I()},[I]);var S=p.useCallback(function(E){a.current=E,I()},[I]);if(!n&&u!=="fixed"||!v)return null;var y=X.jsx("div",H({ref:S},ne(L(L({},e),{},{offset:v.offset,position:u,rect:v.rect}),"menuPortal",{"menu-portal":!0}),s),i);return X.jsx(Wr.Provider,{value:x},n?pr.createPortal(y,n):y)},Gs=function(e){var n=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},js=function(e){var n=e.children,i=e.innerProps,r=e.isDisabled,s=e.isRtl;return X.jsx("div",H({},ne(e,"container",{"--is-disabled":r,"--is-rtl":s}),i),n)},Vs=function(e,n){var i=e.theme.spacing,r=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return L({alignItems:"center",display:r&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},Ds=function(e){var n=e.children,i=e.innerProps,r=e.isMulti,s=e.hasValue;return X.jsx("div",H({},ne(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),i),n)},Ps=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Ns=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"indicatorsContainer",{indicators:!0}),i),n)},Tn,Ms=["size"],ks=["innerProps","isRtl","size"];function Ls(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Ws=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7X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ZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */",toString:Ls},zr=function(e){var n=e.size,i=pe(e,Ms);return X.jsx("svg",H({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ws},i))},pn=function(e){return X.jsx(zr,H({size:20},e),X.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Hr=function(e){return X.jsx(zr,H({size:20},e),X.jsx("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Zr=function(e,n){var i=e.isFocused,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return L({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?o.neutral60:o.neutral20,padding:s*2,":hover":{color:i?o.neutral80:o.neutral40}})},Xs=Zr,zs=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||X.jsx(Hr,null))},Hs=Zr,Zs=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||X.jsx(pn,null))},_s=function(e,n){var i=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return L({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},Js=function(e){var n=e.innerProps;return X.jsx("span",H({},n,ne(e,"indicatorSeparator",{"indicator-separator":!0})))},Ys=X.keyframes(Tn||(Tn=Xo([`
4
4
  0%, 80%, 100% { opacity: 0; }
5
5
  40% { opacity: 1; }
6
- `]))),$s=function(e,n){var i=e.isFocused,r=e.size,s=e.theme,o=s.colors,u=s.spacing.baseUnit;return L({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?o.neutral60:o.neutral20,padding:u*2})},wt=function(e){var n=e.delay,i=e.offset;return X.jsx("span",{css:X.css({animation:"".concat(Ys," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gI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n07XG4iXX0= */")})},Us=function(e){var n=e.innerProps,i=e.isRtl,r=e.size,s=r===void 0?4:r,o=pe(e,ks);return X.jsx("div",H({},ne(L(L({},o),{},{innerProps:n,isRtl:i,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),X.jsx(wt,{delay:0,offset:i}),X.jsx(wt,{delay:160,offset:!0}),X.jsx(wt,{delay:320,offset:!i}))},Qs=function(e,n){var i=e.isDisabled,r=e.isFocused,s=e.theme,o=s.colors,u=s.borderRadius,a=s.spacing;return L({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?o.neutral5:o.neutral0,borderColor:i?o.neutral10:r?o.primary:o.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},qs=function(e){var n=e.children,i=e.isDisabled,r=e.isFocused,s=e.innerRef,o=e.innerProps,u=e.menuIsOpen;return X.jsx("div",H({ref:s},ne(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":u}),o,{"aria-disabled":i||void 0}),n)},Ks=qs,ea=["data"],ta=function(e,n){var i=e.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},na=function(e){var n=e.children,i=e.cx,r=e.getStyles,s=e.getClassNames,o=e.Heading,u=e.headingProps,a=e.innerProps,l=e.label,d=e.theme,f=e.selectProps;return X.jsx("div",H({},ne(e,"group",{group:!0}),a),X.jsx(o,H({},u,{selectProps:f,theme:d,getStyles:r,getClassNames:s,cx:i}),l),X.jsx("div",null,n))},ra=function(e,n){var i=e.theme,r=i.colors,s=i.spacing;return L({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},ia=function(e){var n=Nr(e);n.data;var i=pe(n,ea);return X.jsx("div",H({},ne(e,"groupHeading",{"group-heading":!0}),i))},oa=na,sa=["innerRef","isDisabled","isHidden","inputClassName"],aa=function(e,n){var i=e.isDisabled,r=e.value,s=e.theme,o=s.spacing,u=s.colors;return L(L({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},la),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:u.neutral80})},_r={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},la={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":L({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},_r)},ua=function(e){return L({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},_r)},ca=function(e){var n=e.cx,i=e.value,r=Nr(e),s=r.innerRef,o=r.isDisabled,u=r.isHidden,a=r.inputClassName,l=pe(r,sa);return X.jsx("div",H({},ne(e,"input",{"input-container":!0}),{"data-value":i||""}),X.jsx("input",H({className:n({input:!0},a),ref:s,style:ua(u),disabled:o},l)))},da=ca,fa=function(e,n){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors;return L({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},pa=function(e,n){var i=e.theme,r=i.borderRadius,s=i.colors,o=e.cropWithEllipsis;return L({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},ga=function(e,n){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors,u=e.isFocused;return L({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:u?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},Jr=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",i,n)},ba=Jr,ha=Jr;function ma(t){var e=t.children,n=t.innerProps;return X.jsx("div",H({role:"button"},n),e||X.jsx(pn,{size:14}))}var xa=function(e){var n=e.children,i=e.components,r=e.data,s=e.innerProps,o=e.isDisabled,u=e.removeProps,a=e.selectProps,l=i.Container,d=i.Label,f=i.Remove;return X.jsx(l,{data:r,innerProps:L(L({},ne(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:a},X.jsx(d,{data:r,innerProps:L({},ne(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},n),X.jsx(f,{data:r,innerProps:L(L({},ne(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},u),selectProps:a}))},va=xa,Ia=function(e,n){var i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.theme,u=o.spacing,a=o.colors;return L({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?a.primary:r?a.primary25:"transparent",color:i?a.neutral20:s?a.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:s?a.primary:a.primary50}})},ya=function(e){var n=e.children,i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.innerRef,u=e.innerProps;return X.jsx("div",H({},ne(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":s}),{ref:o,"aria-disabled":i},u),n)},Ca=ya,Sa=function(e,n){var i=e.theme,r=i.spacing,s=i.colors;return L({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Aa=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"placeholder",{placeholder:!0}),i),n)},Ra=Aa,Ea=function(e,n){var i=e.isDisabled,r=e.theme,s=r.spacing,o=r.colors;return L({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Oa=function(e){var n=e.children,i=e.isDisabled,r=e.innerProps;return X.jsx("div",H({},ne(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},Fa=Oa,wa={ClearIndicator:Zs,Control:Ks,DropdownIndicator:zs,DownChevron:Hr,CrossIcon:pn,Group:oa,GroupHeading:ia,IndicatorsContainer:Ns,IndicatorSeparator:Js,Input:da,LoadingIndicator:Us,Menu:Ss,MenuList:Rs,MenuPortal:Bs,LoadingMessage:ws,NoOptionsMessage:Fs,MultiValue:va,MultiValueContainer:ba,MultiValueLabel:ha,MultiValueRemove:ma,Option:Ca,Placeholder:Ra,SelectContainer:Gs,SingleValue:Fa,ValueContainer:Ds},Ta=function(e){return L(L({},wa),e.components)},jn=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ba(t,e){return!!(t===e||jn(t)&&jn(e))}function ja(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!Ba(t[n],e[n]))return!1;return!0}function Ga(t,e){e===void 0&&(e=ja);var n=null;function i(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(n&&n.lastThis===this&&e(r,n.lastArgs))return n.lastResult;var o=t.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return i.clear=function(){n=null},i}function Va(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Da=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IEpTWCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:Va},Pa=function(e){return X.jsx("span",H({css:Da},e))},Gn=Pa,Na={guidance:function(e){var n=e.isSearchable,i=e.isMulti,r=e.tabSelectsValue,s=e.context,o=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,i=e.label,r=i===void 0?"":i,s=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var n=e.context,i=e.focused,r=e.options,s=e.label,o=s===void 0?"":s,u=e.selectValue,a=e.isDisabled,l=e.isSelected,d=e.isAppleDevice,f=function(h,m){return h&&h.length?"".concat(h.indexOf(m)+1," of ").concat(h.length):""};if(n==="value"&&u)return"value ".concat(o," focused, ").concat(f(u,i),".");if(n==="menu"&&d){var b=a?" disabled":"",g="".concat(l?" selected":"").concat(b);return"".concat(o).concat(g,", ").concat(f(r,i),".")}return""},onFilter:function(e){var n=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},Ma=function(e){var n=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,o=e.isFocused,u=e.selectValue,a=e.selectProps,l=e.id,d=e.isAppleDevice,f=a.ariaLiveMessages,b=a.getOptionLabel,g=a.inputValue,x=a.isMulti,h=a.isOptionDisabled,m=a.isSearchable,v=a.menuIsOpen,A=a.options,C=a.screenReaderStatus,I=a.tabSelectsValue,S=a.isLoading,y=a["aria-label"],E=a["aria-live"],F=p.useMemo(function(){return L(L({},Na),f||{})},[f]),j=p.useMemo(function(){var V="";if(n&&F.onChange){var W=n.option,J=n.options,_=n.removedValue,ee=n.removedValues,re=n.value,k=function(K){return Array.isArray(K)?null:K},T=_||W||k(re),z=T?b(T):"",B=J||ee||void 0,P=B?B.map(b):[],Z=L({isDisabled:T&&h(T,u),label:z,labels:P},n);V=F.onChange(Z)}return V},[n,F,h,u,b]),M=p.useMemo(function(){var V="",W=i||r,J=!!(i&&u&&u.includes(i));if(W&&F.onFocus){var _={focused:W,label:b(W),isDisabled:h(W,u),isSelected:J,options:s,context:W===i?"menu":"value",selectValue:u,isAppleDevice:d};V=F.onFocus(_)}return V},[i,r,b,h,F,s,u,d]),D=p.useMemo(function(){var V="";if(v&&A.length&&!S&&F.onFilter){var W=C({count:s.length});V=F.onFilter({inputValue:g,resultsMessage:W})}return V},[s,g,v,F,A,C,S]),N=(n==null?void 0:n.action)==="initial-input-focus",G=p.useMemo(function(){var V="";if(F.guidance){var W=r?"value":v?"menu":"input";V=F.guidance({"aria-label":y,context:W,isDisabled:i&&h(i,u),isMulti:x,isSearchable:m,tabSelectsValue:I,isInitialFocus:N})}return V},[y,i,r,x,h,m,v,F,u,I,N]),w=X.jsx(p.Fragment,null,X.jsx("span",{id:"aria-selection"},j),X.jsx("span",{id:"aria-focused"},M),X.jsx("span",{id:"aria-results"},D),X.jsx("span",{id:"aria-guidance"},G));return X.jsx(p.Fragment,null,X.jsx(Gn,{id:l},N&&w),X.jsx(Gn,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!N&&w))},ka=Ma,Zt=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],La=new RegExp("["+Zt.map(function(t){return t.letters}).join("")+"]","g"),Yr={};for(var Tt=0;Tt<Zt.length;Tt++)for(var Bt=Zt[Tt],jt=0;jt<Bt.letters.length;jt++)Yr[Bt.letters[jt]]=Bt.base;var $r=function(e){return e.replace(La,function(n){return Yr[n]})},Wa=Ga($r),Vn=function(e){return e.replace(/^\s+|\s+$/g,"")},Xa=function(e){return"".concat(e.label," ").concat(e.value)},za=function(e){return function(n,i){if(n.data.__isNew__)return!0;var r=L({ignoreCase:!0,ignoreAccents:!0,stringify:Xa,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,o=r.ignoreAccents,u=r.stringify,a=r.trim,l=r.matchFrom,d=a?Vn(i):i,f=a?Vn(u(n)):u(n);return s&&(d=d.toLowerCase(),f=f.toLowerCase()),o&&(d=Wa(d),f=$r(f)),l==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},Ha=["innerRef"];function Za(t){var e=t.innerRef,n=pe(t,Ha),i=bs(n,"onExited","in","enter","exit","appear");return X.jsx("input",H({ref:e},i,{css:X.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyByZW1vdmVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gRHVtbXlJbnB1dCh7XG4gIGlubmVyUmVmLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydpbnB1dCddICYge1xuICByZWFkb25seSBpbm5lclJlZjogUmVmPEhUTUxJbnB1dEVsZW1lbnQ+O1xufSkge1xuICAvLyBSZW1vdmUgYW5pbWF0aW9uIHByb3BzIG5vdCBtZWFudCBmb3IgSFRNTCBlbGVtZW50c1xuICBjb25zdCBmaWx0ZXJlZFByb3BzID0gcmVtb3ZlUHJvcHMoXG4gICAgcHJvcHMsXG4gICAgJ29uRXhpdGVkJyxcbiAgICAnaW4nLFxuICAgICdlbnRlcicsXG4gICAgJ2V4aXQnLFxuICAgICdhcHBlYXInXG4gICk7XG5cbiAgcmV0dXJuIChcbiAgICA8aW5wdXRcbiAgICAgIHJlZj17aW5uZXJSZWZ9XG4gICAgICB7Li4uZmlsdGVyZWRQcm9wc31cbiAgICAgIGNzcz17e1xuICAgICAgICBsYWJlbDogJ2R1bW15SW5wdXQnLFxuICAgICAgICAvLyBnZXQgcmlkIG9mIGFueSBkZWZhdWx0IHN0eWxlc1xuICAgICAgICBiYWNrZ3JvdW5kOiAwLFxuICAgICAgICBib3JkZXI6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgdGhpcyBoaWRlcyB0aGUgZmxhc2hpbmcgY3Vyc29yXG4gICAgICAgIGNhcmV0Q29sb3I6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgIGZvbnRTaXplOiAnaW5oZXJpdCcsXG4gICAgICAgIGdyaWRBcmVhOiAnMSAvIDEgLyAyIC8gMycsXG4gICAgICAgIG91dGxpbmU6IDAsXG4gICAgICAgIHBhZGRpbmc6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgd2l0aG91dCBgd2lkdGhgIGJyb3dzZXJzIHdvbid0IGFsbG93IGZvY3VzXG4gICAgICAgIHdpZHRoOiAxLFxuXG4gICAgICAgIC8vIHJlbW92ZSBjdXJzb3Igb24gZGVza3RvcFxuICAgICAgICBjb2xvcjogJ3RyYW5zcGFyZW50JyxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIG1vYmlsZSB3aGlsc3QgbWFpbnRhaW5pbmcgXCJzY3JvbGwgaW50byB2aWV3XCIgYmVoYXZpb3VyXG4gICAgICAgIGxlZnQ6IC0xMDAsXG4gICAgICAgIG9wYWNpdHk6IDAsXG4gICAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgICB0cmFuc2Zvcm06ICdzY2FsZSguMDEpJyxcbiAgICAgIH19XG4gICAgLz5cbiAgKTtcbn1cbiJdfQ== */")}))}var _a=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Ja(t){var e=t.isEnabled,n=t.onBottomArrive,i=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,o=p.useRef(!1),u=p.useRef(!1),a=p.useRef(0),l=p.useRef(null),d=p.useCallback(function(m,v){if(l.current!==null){var A=l.current,C=A.scrollTop,I=A.scrollHeight,S=A.clientHeight,y=l.current,E=v>0,F=I-S-C,j=!1;F>v&&o.current&&(i&&i(m),o.current=!1),E&&u.current&&(s&&s(m),u.current=!1),E&&v>F?(n&&!o.current&&n(m),y.scrollTop=I,j=!0,o.current=!0):!E&&-v>C&&(r&&!u.current&&r(m),y.scrollTop=0,j=!0,u.current=!0),j&&_a(m)}},[n,i,r,s]),f=p.useCallback(function(m){d(m,m.deltaY)},[d]),b=p.useCallback(function(m){a.current=m.changedTouches[0].clientY},[]),g=p.useCallback(function(m){var v=a.current-m.changedTouches[0].clientY;d(m,v)},[d]),x=p.useCallback(function(m){if(m){var v=fs?{passive:!1}:!1;m.addEventListener("wheel",f,v),m.addEventListener("touchstart",b,v),m.addEventListener("touchmove",g,v)}},[g,b,f]),h=p.useCallback(function(m){m&&(m.removeEventListener("wheel",f,!1),m.removeEventListener("touchstart",b,!1),m.removeEventListener("touchmove",g,!1))},[g,b,f]);return p.useEffect(function(){if(e){var m=l.current;return x(m),function(){h(m)}}},[e,x,h]),function(m){l.current=m}}var Dn=["boxSizing","height","overflow","paddingRight","position"],Pn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Nn(t){t.cancelable&&t.preventDefault()}function Mn(t){t.stopPropagation()}function kn(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function Ln(){return"ontouchstart"in window||navigator.maxTouchPoints}var Wn=!!(typeof window<"u"&&window.document&&window.document.createElement),Ze=0,Ge={capture:!1,passive:!1};function Ya(t){var e=t.isEnabled,n=t.accountForScrollbars,i=n===void 0?!0:n,r=p.useRef({}),s=p.useRef(null),o=p.useCallback(function(a){if(Wn){var l=document.body,d=l&&l.style;if(i&&Dn.forEach(function(x){var h=d&&d[x];r.current[x]=h}),i&&Ze<1){var f=parseInt(r.current.paddingRight,10)||0,b=document.body?document.body.clientWidth:0,g=window.innerWidth-b+f||0;Object.keys(Pn).forEach(function(x){var h=Pn[x];d&&(d[x]=h)}),d&&(d.paddingRight="".concat(g,"px"))}l&&Ln()&&(l.addEventListener("touchmove",Nn,Ge),a&&(a.addEventListener("touchstart",kn,Ge),a.addEventListener("touchmove",Mn,Ge))),Ze+=1}},[i]),u=p.useCallback(function(a){if(Wn){var l=document.body,d=l&&l.style;Ze=Math.max(Ze-1,0),i&&Ze<1&&Dn.forEach(function(f){var b=r.current[f];d&&(d[f]=b)}),l&&Ln()&&(l.removeEventListener("touchmove",Nn,Ge),a&&(a.removeEventListener("touchstart",kn,Ge),a.removeEventListener("touchmove",Mn,Ge)))}},[i]);return p.useEffect(function(){if(e){var a=s.current;return o(a),function(){u(a)}}},[e,o,u]),function(a){s.current=a}}function $a(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Ua=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Qa=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J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uICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:$a};function qa(t){var e=t.children,n=t.lockEnabled,i=t.captureEnabled,r=i===void 0?!0:i,s=t.onBottomArrive,o=t.onBottomLeave,u=t.onTopArrive,a=t.onTopLeave,l=Ja({isEnabled:r,onBottomArrive:s,onBottomLeave:o,onTopArrive:u,onTopLeave:a}),d=Ya({isEnabled:n}),f=function(g){l(g),d(g)};return X.jsx(p.Fragment,null,n&&X.jsx("div",{onClick:Ua,css:Qa}),e(f))}function Ka(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var el=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:Ka},tl=function(e){var n=e.name,i=e.onFocus;return X.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:el,value:"",onChange:function(){}})},nl=tl;function gn(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function rl(){return gn(/^iPhone/i)}function Ur(){return gn(/^Mac/i)}function il(){return gn(/^iPad/i)||Ur()&&navigator.maxTouchPoints>1}function ol(){return rl()||il()}function sl(){return Ur()||ol()}var al=function(e){return e.label},Qr=function(e){return e.label},qr=function(e){return e.value},ll=function(e){return!!e.isDisabled},ul={clearIndicator:Hs,container:js,control:Qs,dropdownIndicator:Xs,group:ta,groupHeading:ra,indicatorsContainer:Ps,indicatorSeparator:_s,input:aa,loadingIndicator:$s,loadingMessage:Os,menu:Is,menuList:As,menuPortal:Ts,multiValue:fa,multiValueLabel:pa,multiValueRemove:ga,noOptionsMessage:Es,option:Ia,placeholder:Sa,singleValue:Ea,valueContainer:Vs},cl={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},dl=4,Kr=4,fl=38,pl=Kr*2,gl={baseUnit:Kr,controlHeight:fl,menuGutter:pl},Gt={borderRadius:dl,colors:cl,spacing:gl},bl={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Tn(),captureMenuScroll:!Tn(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:za(),formatGroupLabel:al,getOptionLabel:Qr,getOptionValue:qr,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ll,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!cs(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Xn(t,e,n,i){var r=ni(t,e,n),s=ri(t,e,n),o=ti(t,e),u=mt(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:o,value:u,index:i}}function ot(t,e){return t.options.map(function(n,i){if("options"in n){var r=n.options.map(function(o,u){return Xn(t,o,e,u)}).filter(function(o){return Hn(t,o)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var s=Xn(t,n,e,i);return Hn(t,s)?s:void 0}).filter(ps)}function ei(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,Me(n.options.map(function(i){return i.data}))):e.push(n.data),e},[])}function zn(t,e){return t.reduce(function(n,i){return i.type==="group"?n.push.apply(n,Me(i.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),n},[])}function hl(t,e){return ei(ot(t,e))}function Hn(t,e){var n=t.inputValue,i=n===void 0?"":n,r=e.data,s=e.isSelected,o=e.label,u=e.value;return(!oi(t)||!s)&&ii(t,{label:o,value:u,data:r},i)}function ml(t,e){var n=t.focusedValue,i=t.selectValue,r=i.indexOf(n);if(r>-1){var s=e.indexOf(n);if(s>-1)return n;if(r<e.length)return e[r]}return null}function xl(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var Vt=function(e,n){var i,r=(i=e.find(function(s){return s.data===n}))===null||i===void 0?void 0:i.id;return r||null},ti=function(e,n){return e.getOptionLabel(n)},mt=function(e,n){return e.getOptionValue(n)};function ni(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function ri(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var i=mt(t,e);return n.some(function(r){return mt(t,r)===i})}function ii(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var oi=function(e){var n=e.hideSelectedOptions,i=e.isMulti;return n===void 0?i:n},vl=1,Ct=function(t){jo(n,t);var e=Do(n);function n(i){var r;if(To(this,n),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,l){var d=r.props,f=d.onChange,b=d.name;l.name=b,r.ariaOnChange(a,l),f(a,l)},r.setValue=function(a,l,d){var f=r.props,b=f.closeMenuOnSelect,g=f.isMulti,x=f.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:x}),b&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(a,{action:l,option:d})},r.selectOption=function(a){var l=r.props,d=l.blurInputOnSelect,f=l.isMulti,b=l.name,g=r.state.selectValue,x=f&&r.isOptionSelected(a,g),h=r.isOptionDisabled(a,g);if(x){var m=r.getOptionValue(a);r.setValue(g.filter(function(v){return r.getOptionValue(v)!==m}),"deselect-option",a)}else if(!h)f?r.setValue([].concat(Me(g),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:b});return}d&&r.blurInput()},r.removeValue=function(a){var l=r.props.isMulti,d=r.state.selectValue,f=r.getOptionValue(a),b=d.filter(function(x){return r.getOptionValue(x)!==f}),g=_e(l,b,b[0]||null);r.onChange(g,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(_e(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,l=r.state.selectValue,d=l[l.length-1],f=l.slice(0,l.length-1),b=_e(a,f,f[0]||null);d&&r.onChange(b,{action:"pop-value",removedValue:d})},r.getFocusedOptionId=function(a){return Vt(r.state.focusableOptionsWithIds,a)},r.getFocusableOptionsWithIds=function(){return zn(ot(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];return is.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(a){return ti(r.props,a)},r.getOptionValue=function(a){return mt(r.props,a)},r.getStyles=function(a,l){var d=r.props.unstyled,f=ul[a](l,d);f.boxSizing="border-box";var b=r.props.styles[a];return b?b(f,l):f},r.getClassNames=function(a,l){var d,f;return(d=(f=r.props.classNames)[a])===null||d===void 0?void 0:d.call(f,l)},r.getElementId=function(a){return"".concat(r.state.instancePrefix,"-").concat(a)},r.getComponents=function(){return Ta(r.props)},r.buildCategorizedOptions=function(){return ot(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return ei(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,l){r.setState({ariaSelection:L({value:a},l)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var l=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():l&&r.openMenu("first"):(l&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!r.props.isDisabled){var l=r.props,d=l.isMulti,f=l.menuIsOpen;r.focusInput(),f?(r.setState({inputIsHiddenAfterUpdate:!d}),r.onMenuClose()):r.openMenu("first"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&yt(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var l=a.touches,d=l&&l.item(0);d&&(r.initialTouchX=d.clientX,r.initialTouchY=d.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var l=a.touches,d=l&&l.item(0);if(d){var f=Math.abs(d.clientX-r.initialTouchX),b=Math.abs(d.clientY-r.initialTouchY),g=5;r.userIsDragging=f>g||b>g}},r.onTouchEnd=function(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var l=r.props.inputValue,d=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(d,{action:"input-change",prevInputValue:l}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var l=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:l}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){if(!(r.blockOptionHover||r.state.focusedOption===a)){var l=r.getFocusableOptions(),d=l.indexOf(a);r.setState({focusedOption:a,focusedOptionId:d>-1?r.getFocusedOptionId(a):null})}},r.shouldHideSelectedOptions=function(){return oi(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){var l=r.props,d=l.isMulti,f=l.backspaceRemovesValue,b=l.escapeClearsValue,g=l.inputValue,x=l.isClearable,h=l.isDisabled,m=l.menuIsOpen,v=l.onKeyDown,A=l.tabSelectsValue,C=l.openMenuOnFocus,I=r.state,S=I.focusedOption,y=I.focusedValue,E=I.selectValue;if(!h&&!(typeof v=="function"&&(v(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.key){case"ArrowLeft":if(!d||g)return;r.focusValue("previous");break;case"ArrowRight":if(!d||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(y)r.removeValue(y);else{if(!f)return;d?r.popValue():x&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!m||!A||!S||C&&r.isOptionSelected(S,E))return;r.selectOption(S);break;case"Enter":if(a.keyCode===229)break;if(m){if(!S||r.isComposing)return;r.selectOption(S);break}return;case"Escape":m?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):x&&b&&r.clearValue();break;case" ":if(g)return;if(!m){r.openMenu("first");break}if(!S)return;r.selectOption(S);break;case"ArrowUp":m?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":m?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!m)return;r.focusOption("pageup");break;case"PageDown":if(!m)return;r.focusOption("pagedown");break;case"Home":if(!m)return;r.focusOption("first");break;case"End":if(!m)return;r.focusOption("last");break;default:return}a.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++vl),r.state.selectValue=bt(i.value),i.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),u=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=o[u],r.state.focusedOptionId=Vt(s,o[u])}return r}return Bo(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&wn(this.menuListRef,this.focusedOptionRef),sl()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var s=this.props,o=s.isDisabled,u=s.menuIsOpen,a=this.state.isFocused;(a&&!o&&r.isDisabled||a&&u&&!r.menuIsOpen)&&this.focusInput(),a&&o&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!o&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(wn(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,o=this.state,u=o.selectValue,a=o.isFocused,l=this.buildFocusableOptions(),d=r==="first"?0:l.length-1;if(!this.props.isMulti){var f=l.indexOf(u[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[d],focusedOptionId:this.getFocusedOptionId(l[d])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,o=s.selectValue,u=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=o.indexOf(u);u||(a=-1);var l=o.length-1,d=-1;if(o.length){switch(r){case"previous":a===0?d=0:a===-1?d=l:d=a-1;break;case"next":a>-1&&a<l&&(d=a+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:o[d]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var a=0,l=u.indexOf(o);o||(l=-1),r==="up"?a=l>0?l-1:u.length-1:r==="down"?a=(l+1)%u.length:r==="pageup"?(a=l-s,a<0&&(a=0)):r==="pagedown"?(a=l+s,a>u.length-1&&(a=u.length-1)):r==="last"&&(a=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Gt):L(L({},Gt),this.props.theme):Gt}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,o=this.getStyles,u=this.getClassNames,a=this.getValue,l=this.selectOption,d=this.setValue,f=this.props,b=f.isMulti,g=f.isRtl,x=f.options,h=this.hasValue();return{clearValue:r,cx:s,getStyles:o,getClassNames:u,getValue:a,hasValue:h,isMulti:b,isRtl:g,options:x,selectOption:l,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,o=r.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(r,s){return ni(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return ri(this.props,r,s)}},{key:"filterOption",value:function(r,s){return ii(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:o,selectValue:u})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,o=r.isSearchable,u=r.inputId,a=r.inputValue,l=r.tabIndex,d=r.form,f=r.menuIsOpen,b=r.required,g=this.getComponents(),x=g.Input,h=this.state,m=h.inputIsHidden,v=h.ariaSelection,A=this.commonProps,C=u||this.getElementId("input"),I=L(L(L({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":b,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(v==null?void 0:v.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?$.createElement(x,H({},A,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:s,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:d,type:"text",value:a},I)):$.createElement(Za,H({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:gt,onFocus:this.onInputFocus,disabled:s,tabIndex:l,inputMode:"none",form:d,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),o=s.MultiValue,u=s.MultiValueContainer,a=s.MultiValueLabel,l=s.MultiValueRemove,d=s.SingleValue,f=s.Placeholder,b=this.commonProps,g=this.props,x=g.controlShouldRenderValue,h=g.isDisabled,m=g.isMulti,v=g.inputValue,A=g.placeholder,C=this.state,I=C.selectValue,S=C.focusedValue,y=C.isFocused;if(!this.hasValue()||!x)return v?null:$.createElement(f,H({},b,{key:"placeholder",isDisabled:h,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),A);if(m)return I.map(function(F,j){var M=F===S,D="".concat(r.getOptionLabel(F),"-").concat(r.getOptionValue(F));return $.createElement(o,H({},b,{components:{Container:u,Label:a,Remove:l},isFocused:M,isDisabled:h,key:D,index:j,removeProps:{onClick:function(){return r.removeValue(F)},onTouchEnd:function(){return r.removeValue(F)},onMouseDown:function(G){G.preventDefault()}},data:F}),r.formatOptionLabel(F,"value"))});if(v)return null;var E=I[0];return $.createElement(d,H({},b,{data:E,isDisabled:h}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,o=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,d=this.state.isFocused;if(!this.isClearable()||!s||a||!this.hasValue()||l)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(s,H({},o,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,o=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,d=this.state.isFocused;if(!s||!l)return null;var f={"aria-hidden":"true"};return $.createElement(s,H({},o,{innerProps:f,isDisabled:a,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,o=r.IndicatorSeparator;if(!s||!o)return null;var u=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused;return $.createElement(o,H({},u,{isDisabled:a,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var o=this.commonProps,u=this.props.isDisabled,a=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(s,H({},o,{innerProps:l,isDisabled:u,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),o=s.Group,u=s.GroupHeading,a=s.Menu,l=s.MenuList,d=s.MenuPortal,f=s.LoadingMessage,b=s.NoOptionsMessage,g=s.Option,x=this.commonProps,h=this.state.focusedOption,m=this.props,v=m.captureMenuScroll,A=m.inputValue,C=m.isLoading,I=m.loadingMessage,S=m.minMenuHeight,y=m.maxMenuHeight,E=m.menuIsOpen,F=m.menuPlacement,j=m.menuPosition,M=m.menuPortalTarget,D=m.menuShouldBlockScroll,N=m.menuShouldScrollIntoView,G=m.noOptionsMessage,w=m.onMenuScrollToTop,V=m.onMenuScrollToBottom;if(!E)return null;var W=function(z,B){var P=z.type,Z=z.data,Y=z.isDisabled,K=z.isSelected,te=z.label,me=z.value,ge=h===Z,Xe=Y?void 0:function(){return r.onOptionHover(Z)},Et=Y?void 0:function(){return r.selectOption(Z)},Qe="".concat(r.getElementId("option"),"-").concat(B),ze={id:Qe,onClick:Et,onMouseMove:Xe,onMouseOver:Xe,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:K};return $.createElement(g,H({},x,{innerProps:ze,data:Z,isDisabled:Y,isSelected:K,key:Qe,label:te,type:P,value:me,isFocused:ge,innerRef:ge?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(z.data,"menu"))},J;if(this.hasOptions())J=this.getCategorizedOptions().map(function(T){if(T.type==="group"){var z=T.data,B=T.options,P=T.index,Z="".concat(r.getElementId("group"),"-").concat(P),Y="".concat(Z,"-heading");return $.createElement(o,H({},x,{key:Z,data:z,options:B,Heading:u,headingProps:{id:Y,data:T.data},label:r.formatGroupLabel(T.data)}),T.options.map(function(K){return W(K,"".concat(P,"-").concat(K.index))}))}else if(T.type==="option")return W(T,"".concat(T.index))});else if(C){var _=I({inputValue:A});if(_===null)return null;J=$.createElement(f,x,_)}else{var ee=G({inputValue:A});if(ee===null)return null;J=$.createElement(b,x,ee)}var re={minMenuHeight:S,maxMenuHeight:y,menuPlacement:F,menuPosition:j,menuShouldScrollIntoView:N},k=$.createElement(ys,H({},x,re),function(T){var z=T.ref,B=T.placerProps,P=B.placement,Z=B.maxHeight;return $.createElement(a,H({},x,re,{innerRef:z,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:C,placement:P}),$.createElement(qa,{captureEnabled:v,onTopArrive:w,onBottomArrive:V,lockEnabled:D},function(Y){return $.createElement(l,H({},x,{innerRef:function(te){r.getMenuListRef(te),Y(te)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:r.getElementId("listbox")},isLoading:C,maxHeight:Z,focusedOption:h}),J)}))});return M||j==="fixed"?$.createElement(d,H({},x,{appendTo:M,controlElement:this.controlRef,menuPlacement:F,menuPosition:j}),k):k}},{key:"renderFormField",value:function(){var r=this,s=this.props,o=s.delimiter,u=s.isDisabled,a=s.isMulti,l=s.name,d=s.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!u)return $.createElement(nl,{name:l,onFocus:this.onValueInputFocus});if(!(!l||u))if(a)if(o){var b=f.map(function(h){return r.getOptionValue(h)}).join(o);return $.createElement("input",{name:l,type:"hidden",value:b})}else{var g=f.length>0?f.map(function(h,m){return $.createElement("input",{key:"i-".concat(m),name:l,type:"hidden",value:r.getOptionValue(h)})}):$.createElement("input",{name:l,type:"hidden",value:""});return $.createElement("div",null,g)}else{var x=f[0]?this.getOptionValue(f[0]):"";return $.createElement("input",{name:l,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,o=s.ariaSelection,u=s.focusedOption,a=s.focusedValue,l=s.isFocused,d=s.selectValue,f=this.getFocusableOptions();return $.createElement(ka,H({},r,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:u,focusedValue:a,isFocused:l,selectValue:d,focusableOptions:f,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,o=r.IndicatorsContainer,u=r.SelectContainer,a=r.ValueContainer,l=this.props,d=l.className,f=l.id,b=l.isDisabled,g=l.menuIsOpen,x=this.state.isFocused,h=this.commonProps=this.getCommonProps();return $.createElement(u,H({},h,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:b,isFocused:x}),this.renderLiveRegion(),$.createElement(s,H({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:b,isFocused:x,menuIsOpen:g}),$.createElement(a,H({},h,{isDisabled:b}),this.renderPlaceholderOrValue(),this.renderInput()),$.createElement(o,H({},h,{isDisabled:b}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var o=s.prevProps,u=s.clearFocusValueOnUpdate,a=s.inputIsHiddenAfterUpdate,l=s.ariaSelection,d=s.isFocused,f=s.prevWasFocused,b=s.instancePrefix,g=r.options,x=r.value,h=r.menuIsOpen,m=r.inputValue,v=r.isMulti,A=bt(x),C={};if(o&&(x!==o.value||g!==o.options||h!==o.menuIsOpen||m!==o.inputValue)){var I=h?hl(r,A):[],S=h?zn(ot(r,A),"".concat(b,"-option")):[],y=u?ml(s,A):null,E=xl(s,I),F=Vt(S,E);C={selectValue:A,focusedOption:E,focusedOptionId:F,focusableOptionsWithIds:S,focusedValue:y,clearFocusValueOnUpdate:!1}}var j=a!=null&&r!==o?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},M=l,D=d&&f;return d&&!D&&(M={value:_e(v,A,A[0]||null),options:A,action:"initial-input-focus"},D=!f),(l==null?void 0:l.action)==="initial-input-focus"&&(M=null),L(L(L({},C),j),{},{prevProps:r,ariaSelection:M,prevWasFocused:D})}}]),n}(p.Component);Ct.defaultProps=bl;var Il=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function bn(t){var e=t.defaultInputValue,n=e===void 0?"":e,i=t.defaultMenuIsOpen,r=i===void 0?!1:i,s=t.defaultValue,o=s===void 0?null:s,u=t.inputValue,a=t.menuIsOpen,l=t.onChange,d=t.onInputChange,f=t.onMenuClose,b=t.onMenuOpen,g=t.value,x=pe(t,Il),h=p.useState(u!==void 0?u:n),m=ie(h,2),v=m[0],A=m[1],C=p.useState(a!==void 0?a:r),I=ie(C,2),S=I[0],y=I[1],E=p.useState(g!==void 0?g:o),F=ie(E,2),j=F[0],M=F[1],D=p.useCallback(function(_,ee){typeof l=="function"&&l(_,ee),M(_)},[l]),N=p.useCallback(function(_,ee){var re;typeof d=="function"&&(re=d(_,ee)),A(re!==void 0?re:_)},[d]),G=p.useCallback(function(){typeof b=="function"&&b(),y(!0)},[b]),w=p.useCallback(function(){typeof f=="function"&&f(),y(!1)},[f]),V=u!==void 0?u:v,W=a!==void 0?a:S,J=g!==void 0?g:j;return L(L({},x),{},{inputValue:V,menuIsOpen:W,onChange:D,onInputChange:N,onMenuClose:w,onMenuOpen:G,value:J})}var yl=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function si(t){var e=t.defaultOptions,n=e===void 0?!1:e,i=t.cacheOptions,r=i===void 0?!1:i,s=t.loadOptions;t.options;var o=t.isLoading,u=o===void 0?!1:o,a=t.onInputChange,l=t.filterOption,d=l===void 0?null:l,f=pe(t,yl),b=f.inputValue,g=p.useRef(void 0),x=p.useRef(!1),h=p.useState(Array.isArray(n)?n:void 0),m=ie(h,2),v=m[0],A=m[1],C=p.useState(typeof b<"u"?b:""),I=ie(C,2),S=I[0],y=I[1],E=p.useState(n===!0),F=ie(E,2),j=F[0],M=F[1],D=p.useState(void 0),N=ie(D,2),G=N[0],w=N[1],V=p.useState([]),W=ie(V,2),J=W[0],_=W[1],ee=p.useState(!1),re=ie(ee,2),k=re[0],T=re[1],z=p.useState({}),B=ie(z,2),P=B[0],Z=B[1],Y=p.useState(void 0),K=ie(Y,2),te=K[0],me=K[1],ge=p.useState(void 0),Xe=ie(ge,2),Et=Xe[0],Qe=Xe[1];r!==Et&&(Z({}),Qe(r)),n!==te&&(A(Array.isArray(n)?n:void 0),me(n)),p.useEffect(function(){return x.current=!0,function(){x.current=!1}},[]);var ze=p.useCallback(function(He,je){if(!s)return je();var ce=s(He,je);ce&&typeof ce.then=="function"&&ce.then(je,function(){return je()})},[s]);p.useEffect(function(){n===!0&&ze(S,function(He){x.current&&(A(He||[]),M(!!g.current))})},[]);var Qi=p.useCallback(function(He,je){var ce=os(He,je,a);if(!ce){g.current=void 0,y(""),w(""),_([]),M(!1),T(!1);return}if(r&&P[ce])y(ce),w(ce),_(P[ce]),M(!1),T(!1);else{var Ki=g.current={};y(ce),M(!0),T(!G),ze(ce,function(Ot){x&&Ki===g.current&&(g.current=void 0,M(!1),w(ce),_(Ot||[]),T(!1),Z(Ot?L(L({},P),{},Pe({},ce,Ot)):P))})}},[r,ze,G,P,a]),qi=k?[]:S&&G?J:v||[];return L(L({},f),{},{options:qi,isLoading:j||u,onInputChange:Qi,filterOption:d})}var Cl=p.forwardRef(function(t,e){var n=si(t),i=bn(n);return $.createElement(Ct,H({ref:e},i))}),Sl=Cl,Al=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Zn=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),s=String(i.getOptionValue(n)).toLowerCase(),o=String(i.getOptionLabel(n)).toLowerCase();return s===r||o===r},Dt={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,i,r){return!(!e||n.some(function(s){return Zn(e,s,r)})||i.some(function(s){return Zn(e,s,r)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function ai(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,i=t.createOptionPosition,r=i===void 0?"last":i,s=t.formatCreateLabel,o=s===void 0?Dt.formatCreateLabel:s,u=t.isValidNewOption,a=u===void 0?Dt.isValidNewOption:u,l=t.getNewOptionData,d=l===void 0?Dt.getNewOptionData:l,f=t.onCreateOption,b=t.options,g=b===void 0?[]:b,x=t.onChange,h=pe(t,Al),m=h.getOptionValue,v=m===void 0?qr:m,A=h.getOptionLabel,C=A===void 0?Qr:A,I=h.inputValue,S=h.isLoading,y=h.isMulti,E=h.value,F=h.name,j=p.useMemo(function(){return a(I,bt(E),g,{getOptionValue:v,getOptionLabel:C})?d(I,o(I)):void 0},[o,d,C,v,I,a,g,E]),M=p.useMemo(function(){return(n||!S)&&j?r==="first"?[j].concat(Me(g)):[].concat(Me(g),[j]):g},[n,r,S,j,g]),D=p.useCallback(function(N,G){if(G.action!=="select-option")return x(N,G);var w=Array.isArray(N)?N:[N];if(w[w.length-1]===j){if(f)f(I);else{var V=d(I,I),W={action:"create-option",name:F,option:V};x(_e(y,[].concat(Me(bt(E)),[V]),V),W)}return}x(N,G)},[d,I,y,F,j,f,x,E]);return L(L({},h),{},{options:M,onChange:D})}var Rl=p.forwardRef(function(t,e){var n=bn(t),i=ai(n);return $.createElement(Ct,H({ref:e},i))}),El=Rl,Ol=p.forwardRef(function(t,e){var n=si(t),i=bn(n),r=ai(i);return $.createElement(Ct,H({ref:e},r))}),Fl=Ol;function li({field:t,fieldId:e,value:n,onChange:i,onBlur:r,error:s,helperText:o,formulaConfig:u,onFormulaConfigChange:a,renderNative:l}){const d=t.formula===!0,f=Le(),b=p.useRef(null),[g,x]=p.useState(()=>d&&(t.formula===!0||e in(u??{}))),h=p.useRef(g);h.current=g,p.useEffect(()=>{if(!(!d||!f))return h.current&&f.notifyFormulaToggle(!0),()=>{h.current&&f.notifyFormulaToggle(!1)}},[]);const m=g,[v,A]=p.useState(()=>d&&g?Ae(String(n??""),!0):[]),C=p.useRef(n),I=y=>{A(y);const E=m?$e(y):Re(y);C.current=E,i(E)},S=p.useCallback(()=>{const y=!g;if(x(y),f==null||f.notifyFormulaToggle(y,y?b.current:null),y){const E=String(n??""),F=Ae(E,!0);A(F);const j=$e(F);C.current=j,i(j),a==null||a({...u,[e]:tn()})}else{const E=Re(v);C.current=E,i(E);const F={...u};delete F[e],a==null||a(F),A([])}},[g,f,n,v,u,e,a,i]);return d?c.jsxs("div",{children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info,htmlFor:e,dataTestId:t.dataTestId}),c.jsx(R.Tooltip,{title:g?"Use static value (dropdown)":"Use dynamic formula expression",placement:"top",children:c.jsxs(R.Box,{component:"button",type:"button",ref:b,onClick:S,sx:{border:"none",cursor:"pointer",mb:"4px",display:"inline-flex",alignItems:"center",gap:.4,px:g?.75:.5,py:.25,borderRadius:"4px",fontSize:11,fontWeight:600,lineHeight:1,color:g?"#7c4dff":"#94a3b8",bgcolor:g?"#ede9fe":"transparent",transition:"all 0.15s","&:hover":{bgcolor:"#ede9fe",color:"#7c4dff"},flexShrink:0},children:[c.jsx(U.MdDataObject,{size:14}),g&&"Formula"]})})]}),o&&c.jsx("small",{style:oe,children:o}),g?c.jsx(un,{id:e,expression:v,onExpressionChange:I,onBlur:r,placeholder:t.formulaPlaceholder??"Type or paste a variable expression...",disabled:t.disabled===!0,error:s,formulaConfigEnabled:m}):l()]}):c.jsxs("div",{children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info,htmlFor:e,dataTestId:t.dataTestId}),o&&c.jsx("small",{style:oe,children:o}),l()]})}const hn=p.createContext({resolvers:{},invalidate:()=>{}}),ui=Symbol("options-cache");function ci({resolvers:t,children:e}){const n=p.useRef(new Map),i=p.useRef(new Map),r=p.useCallback((o,u)=>{const a=n.current.get(o);a&&(u==null?a.clear():a.delete(u))},[]),s=p.useMemo(()=>({resolvers:t??{},invalidate:r,[ui]:{cacheRef:n,inFlightRef:i}}),[t,r]);return c.jsx(hn.Provider,{value:s,children:e})}function wl(t,e,n){const i={...n??{}};if(!t)return i;if(Array.isArray(t))for(const r of t)i[r]=e==null?void 0:e[r];else for(const[r,s]of Object.entries(t))i[r]=e==null?void 0:e[s];return i}function _n(t){if(t==null)return"";if(typeof t!="object")return String(t);const e=Object.keys(t).sort();return JSON.stringify(e.reduce((n,i)=>(n[i]=t[i],n),{}))}function di({source:t,values:e}){const n=p.useContext(hn),i=n[ui],r=t==null?void 0:t.id,s=r?n.resolvers[r]:void 0,o=p.useMemo(()=>t?wl(t.dependsOn,e,t.params):{},[t,...Object.values(e??{})]),u=p.useMemo(()=>_n(o),[o]),a=p.useRef(null);p.useEffect(()=>()=>{var g;return(g=a.current)==null?void 0:g.abort()},[u]);const l=p.useCallback(async(g,x)=>{var j;if(!r||!s||!i)return{options:[]};const h=`${_n(g)}|${x??""}`,m=i.cacheRef.current.get(r)??new Map;i.cacheRef.current.set(r,m);const v=m.get(u)??new Map;m.set(u,v);const A=v.get(h);if(A)return A;const C=i.inFlightRef.current.get(r)??new Map;i.inFlightRef.current.set(r,C);const I=C.get(u)??new Map;C.set(u,I);const S=I.get(h);if(S)return S;(j=a.current)==null||j.abort();const y=new AbortController;a.current=y;const E={cursor:g,input:x,values:e,signal:y.signal},F=Promise.resolve().then(()=>s(o,E)).then(M=>(v.set(h,M),I.delete(h),M)).catch(M=>{throw I.delete(h),M});return I.set(h,F),F},[s,r,o,u,i,e]),d=p.useCallback(async g=>s?(await l(void 0,g)).options:[],[s,l]),f=p.useCallback(async g=>{if(!s)return[];if(t!=null&&t.resolveValueId){const m=n.resolvers[t.resolveValueId];if(m)return(await m({...o,ids:g},{values:e})).options}const x=await l(void 0),h=g.map(m=>String(m));return x.options.filter(m=>h.includes(String(m.value)))},[s,l,t==null?void 0:t.resolveValueId,n.resolvers,o,e]),b=p.useCallback(()=>{r&&n.invalidate(r,u)},[n,r,u]);return{enabled:!!s,loadOptions:s?d:void 0,loadValue:s?f:void 0,depsKey:u,refresh:b}}function Tl(){return p.useContext(hn)}function Bl({field:t,value:e,values:n,onChange:i,onBlur:r,error:s,touched:o,formulaConfig:u,onFormulaConfigChange:a}){var G;const l=t,d=!!(o&&s),f=l.disabled===!0,b=w=>l.getOptionValue?l.getOptionValue(w):w.value??w.id,g=p.useMemo(()=>(l.options??[]).map(w=>({...w,value:b(w)})),[l.options]),x=di({source:l.optionsSource,values:n}),h=l.loadOptions??(x.enabled?x.loadOptions:void 0),m=l.loadValue??(x.enabled?x.loadValue:void 0),[v,A]=p.useState(0),C=((G=l.dependsOn)==null?void 0:G.map(w=>n[w]))??[];p.useEffect(()=>{var w;(w=l.dependsOn)!=null&&w.length&&A(V=>V+1)},C),p.useEffect(()=>{x.enabled&&A(w=>w+1)},[x.depsKey]);const I=!!h,[S,y]=p.useState(null),E=p.useRef(!1);p.useEffect(()=>{if(!I||E.current||e==null||e===""||Array.isArray(e)&&e.length===0)return;const w=Array.isArray(e)?e:[e];E.current=!0,(m?m(w):h("").then(W=>W.filter(J=>w.some(_=>String(b(J))===String(_))))).then(W=>{W.length!==0&&y(l.isMulti?W:W[0])}).catch(()=>{E.current=!1})},[I,e]);const F=p.useMemo(()=>{if(e==null||e==="")return l.isMulti?[]:null;if(I)return S;if(l.isMulti){const w=Array.isArray(e)?e:[e];return g.filter(V=>w.includes(b(V)))}return g.find(w=>String(b(w))===String(e))??null},[e,g,l.isMulti,I,S]),j=w=>(I&&y(w),w?l.isMulti?i(w.map(b)):i(b(w)):i(l.isMulti?[]:null)),M={inputId:l.id??l.name,name:l.id??l.name,placeholder:l.placeholder??"Select...",isDisabled:f,isMulti:l.isMulti??!1,isSearchable:l.isSearchable??!0,isClearable:l.isClearable??!1,value:F,onChange:j,onBlur:r,styles:en(d,l.isMulti),menuPortalTarget:typeof document<"u"?document.body:void 0,menuPosition:"fixed",classNamePrefix:"ff-select","data-testid":l.dataTestId??`${l.name}-select`,...l.getOptionLabel?{getOptionLabel:l.getOptionLabel}:{}},D=()=>{const w=!!h,V=l.isCreatable??!1;return w&&V?c.jsx(Fl,{loadOptions:h,defaultOptions:!0,cacheOptions:!0,...M},v):w?c.jsx(Sl,{loadOptions:h,defaultOptions:!0,cacheOptions:!0,...M},v):V?c.jsx(El,{options:g,...M}):c.jsx(ke,{options:g,...M})},N=l.id??l.name??"";return c.jsx(li,{field:l,fieldId:N,value:e,onChange:i,onBlur:r,error:d,helperText:l.helperText,formulaConfig:u,onFormulaConfigChange:a,renderNative:()=>c.jsxs(c.Fragment,{children:[D(),d&&c.jsx("small",{"data-testid":`${l.name}-error`,style:ae,children:s})]})})}const jl={fontSize:14,fontWeight:500,lineHeight:1.35,overflowWrap:"anywhere"},Gl={fontSize:12,lineHeight:1.45,marginTop:3,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflowWrap:"anywhere"},Vl=t=>{const{data:e,isSelected:n,isDisabled:i}=t;return c.jsx(ke.components.Option,{...t,children:c.jsxs("div",{className:"ff-form-d-flex ff-form-align-start ff-form-justify-between ff-form-w-100",title:i?e.disabledReason??"Coming soon":void 0,children:[c.jsxs("div",{className:"ff-form-d-flex ff-form-align-start ff-form-gap-2 ff-form-flex-grow-1",style:{minWidth:0},children:[e.icon&&c.jsx("div",{className:"ff-form-mt-1 ff-form-flex-shrink-0 ff-form-d-flex ff-form-align-center",style:{fontSize:18,opacity:i?.65:1,filter:i?"grayscale(0.45)":"none"},children:e.icon}),c.jsxs("div",{className:"ff-form-flex-grow-1",style:{minWidth:0},children:[c.jsx("div",{className:"ff-form-text-14",style:{...jl,color:i?"#7f8790":"#212529"},title:e.label,children:e.label}),e.description&&c.jsx("div",{className:"ff-form-text-12",style:{...Gl,color:i?"#9198a1":"#6c757d"},title:e.description,children:e.description})]})]}),n&&c.jsx(U.MdCheckCircle,{size:16,className:"ff-form-ms-2 ff-form-mt-1 ff-form-text-primary ff-form-flex-shrink-0"})]})})},Dl=t=>{const{data:e}=t;return c.jsx(ke.components.SingleValue,{...t,children:c.jsxs("div",{className:"ff-form-d-flex ff-form-align-center ff-form-gap-2 ff-form-text-dark ff-form-w-100",title:e.label,children:[e.icon&&c.jsx("div",{className:"ff-form-d-flex ff-form-align-center ff-form-flex-shrink-0",style:{fontSize:16},children:e.icon}),c.jsx("span",{className:"ff-form-text-14 ff-form-fw-medium",style:{lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})]})})},Pl=t=>({control:(e,n)=>({...e,minHeight:38,height:38,fontSize:14,borderRadius:6,borderColor:t?"#dc3545":n.isFocused?"#86b7fe":"#ced4da",boxShadow:n.isFocused?t?"0 0 0 3px rgba(220,53,69,0.18)":"0 0 0 3px rgba(13,110,253,0.18)":"none",transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:t?"#dc3545":"#adb5bd"}}),valueContainer:e=>({...e,paddingTop:1,paddingBottom:1,gap:4}),option:(e,n)=>({...e,backgroundColor:n.isDisabled?"#f6f7f9":n.isSelected?"#e8f4fd":n.isFocused?"#f8f9fa":"#fff",padding:"10px 12px",cursor:n.isDisabled?"not-allowed":"pointer",color:n.isDisabled?"#8f98a3":e.color,borderBottom:"1px solid #f1f1f1","&:active":{backgroundColor:n.isDisabled?"#f6f7f9":"#e9ecef"},"&:last-child":{borderBottom:"none"}}),singleValue:e=>({...e,maxWidth:"calc(100% - 8px)",color:"#111827"}),multiValue:e=>({...e,maxWidth:"100%",backgroundColor:"#eef2ff",borderRadius:6}),multiValueLabel:e=>({...e,fontSize:12,lineHeight:1.35,color:"#3730a3",paddingTop:3,paddingBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:180}),multiValueRemove:e=>({...e,color:"#6366f1",":hover":{backgroundColor:"#c7d2fe",color:"#3730a3"}}),menu:e=>({...e,zIndex:9999}),menuPortal:e=>({...e,zIndex:9999}),placeholder:e=>({...e,color:"#9ca3af",fontSize:14}),noOptionsMessage:e=>({...e,fontSize:12,color:"#6b7280"})});function Nl({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s,formulaConfig:o,onFormulaConfigChange:u}){const a=!!(s&&r),l=t.isMulti??!1,d=t.id??t.name??"",f=p.useMemo(()=>(t.options??[]).map(v=>({...v,value:v.id??v.value})),[t.options]),b=Array.isArray(e)?e:e!=null?[e]:[],g=p.useMemo(()=>new Set(b.map(v=>String(v))),[b]),x=p.useMemo(()=>l?f.filter(v=>g.has(String(v.value??""))):f.find(v=>String(v.value??"")===String(e??""))??null,[l,f,e,g]),h=v=>{if(l){const C=v;n(C==null?[]:C.map(I=>I.value));return}const A=v;n(A==null?null:A.value)},m=c.jsxs(c.Fragment,{children:[c.jsx(ke,{inputId:d,value:x,onChange:h,onBlur:i,options:f,placeholder:t.placeholder??"Select option...",isMulti:l,isDisabled:t.disabled??!1,isOptionDisabled:v=>!!v.isDisabled,isSearchable:!0,styles:Pl(a),components:{Option:Vl,SingleValue:Dl},menuPortalTarget:typeof document<"u"?document.body:void 0,menuPosition:"fixed",classNamePrefix:"ff-select"}),a&&c.jsx("small",{"data-testid":`${d}-error`,style:{display:"flex",color:"#dc3545",fontSize:12,marginTop:4,lineHeight:1.4},children:r})]});return c.jsx("div",{className:`${t.customClass??""} ${t.hidden?"ff-form-hidden":""}`,children:c.jsx(li,{field:t,fieldId:d,value:e,onChange:n,onBlur:i,error:a,helperText:t.helperText,formulaConfig:o,onFormulaConfigChange:u,renderNative:()=>m})})}const Ie="__id";let Ml=0;function Ee(){return`af_${++Ml}_${Math.random().toString(36).slice(2,7)}`}function Pt(t){return t.map(e=>{if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const n=e;return n[Ie]?e:{...n,[Ie]:Ee()}}return e!==null&&typeof e!="object"?{[Ie]:Ee(),__value:e}:e})}function Nt(t){return t.map(e=>{if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const{[Ie]:n,__value:i,...r}=e;return i!==void 0&&Object.keys(r).length===0?i:r}return e})}function Mt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?String(t[Ie]??Ee()):Ee()}function fi(t){return Object.fromEntries(t.map(e=>{const n=e.id??e.name??"";return e.type==="object"&&e.children?[n,fi(e.children)]:e.type==="array"?[n,[]]:[n,""]}))}function kl(t,e){const n=t==="object"&&e?fi(e):t==="array"?[]:"";return n!==null&&typeof n=="object"&&!Array.isArray(n)?{...n,[Ie]:Ee()}:n}function nt(t){return Array.isArray(t)?t:[]}function Ll(t){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){const e=t;if("__value"in e)return e.__value;const{[Ie]:n,...i}=e;return i}return t}function Wl({value:t,onChange:e,inputType:n="text",placeholder:i,disabled:r}){return c.jsx(R.TextField,{size:"small",fullWidth:!0,type:n,value:String(t??""),onChange:s=>e(s.target.value),placeholder:i,disabled:r,sx:{"& .MuiInputBase-input":{fontSize:13}}})}function Xl({value:t,onChange:e,options:n,disabled:i}){return c.jsxs(R.Select,{size:"small",fullWidth:!0,value:String(t??""),onChange:r=>e(r.target.value),disabled:i,displayEmpty:!0,sx:{fontSize:13,".MuiSelect-select":{py:"8px"}},children:[c.jsx(R.MenuItem,{value:"",disabled:!0,sx:{fontSize:13},children:"Select…"}),n.map(r=>c.jsx(R.MenuItem,{value:r.value,sx:{fontSize:13},children:r.label},r.value))]})}function pi({fields:t,value:e,onChange:n,disabled:i,depth:r=0}){return c.jsx(R.Box,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:t.map(s=>{const o=s.id??s.name??"",u=s.colSpan??Math.max(2,Math.floor(12/t.length)),a=`${Math.round(u/12*100)}%`;return c.jsxs(R.Box,{sx:{flex:`0 0 calc(${a} - 8px)`,minWidth:100},children:[s.label&&c.jsxs(R.Typography,{sx:{fontSize:11,color:"#64748b",mb:.25,fontWeight:500},children:[s.label,s.required&&c.jsx("span",{style:{color:"#ef4444"},children:" *"})]}),s.type==="object"&&s.children?c.jsx(R.Box,{sx:{border:"1px solid #e2e8f0",borderRadius:"6px",p:1,bgcolor:r%2===0?"#f8fafc":"#fff"},children:c.jsx(pi,{fields:s.children,value:e[o]??{},onChange:l=>n({...e,[o]:l}),disabled:i,depth:r+1})}):s.type==="array"?c.jsx(St,{field:{...s,id:o,disabled:i??s.disabled},value:e[o],values:{},onChange:l=>n({...e,[o]:l}),onBlur:()=>{}}):s.type==="select"?c.jsxs(R.Select,{size:"small",fullWidth:!0,value:String(e[o]??""),onChange:l=>n({...e,[o]:l.target.value}),disabled:i,displayEmpty:!0,sx:{fontSize:13,".MuiSelect-select":{py:"8px"}},children:[c.jsx(R.MenuItem,{value:"",disabled:!0,sx:{fontSize:13},children:"Select…"}),(s.itemOptions??[]).map(l=>c.jsx(R.MenuItem,{value:l.value,sx:{fontSize:13},children:l.label},l.value))]}):c.jsx(R.TextField,{size:"small",fullWidth:!0,type:s.inputType??(s.type==="number"?"number":"text"),value:String(e[o]??""),onChange:l=>n({...e,[o]:l.target.value}),placeholder:s.placeholder,disabled:i,sx:{"& .MuiInputBase-input":{fontSize:13}}})]},o)})})}function gi({index:t,itemLabel:e,canRemove:n,onRemove:i,children:r}){return c.jsxs(R.Box,{sx:{position:"relative",px:2,pt:1.75,pb:1.5,bgcolor:"#fff",border:"1px solid #e2e8f0",borderRadius:"8px",mb:1.5,"& .ff-form-mb-4:last-of-type":{marginBottom:"0 !important"}},children:[e&&c.jsxs(R.Box,{component:"span",sx:{display:"inline-block",fontSize:11,fontWeight:600,color:"#475569",bgcolor:"#e2e8f0",px:1,py:"2px",borderRadius:"6px",mb:1.5,textTransform:"uppercase",letterSpacing:.5},children:[e," ",t+1]}),r,c.jsx(R.Tooltip,{title:"Remove",children:c.jsx("span",{style:{position:"absolute",top:10,right:10},children:c.jsx(R.IconButton,{size:"small",disabled:!n,onClick:i,sx:{cursor:n?"pointer":"not-allowed",p:"4px"},children:c.jsx(U.MdClose,{size:16,color:n?"#64748b":"#e2e8f0"})})})})]})}function bi(t){const e={};for(const n of t){const i=n.id??n.name??"";i&&(n.type==="object"&&Array.isArray(n.children)?e[i]=bi(n.children):n.type==="array"?e[i]=[]:e[i]="")}return e}function zl({field:t,pathPrefix:e,childFields:n,items:i,values:r,errors:s,touched:o,setFieldValue:u,setFieldTouched:a,depth:l,compact:d,renderFieldRouter:f,disabled:b,minItems:g,maxItems:x}){const[h,m]=p.useState(()=>i.map(()=>Ee()));p.useEffect(()=>{h.length!==i.length&&m(I=>i.length>I.length?[...I,...Array.from({length:i.length-I.length},()=>Ee())]:I.slice(0,i.length))},[i.length]);const v=p.useCallback(()=>{i.length>=x||(u(e,[...i,bi(n)]),m(I=>[...I,Ee()]))},[i,x,u,e,n]),A=p.useCallback(I=>{i.length<=g||(u(e,i.filter((S,y)=>y!==I)),m(S=>S.filter((y,E)=>E!==I)))},[i,g,u,e]),C=t;return c.jsxs(R.Box,{children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info,htmlFor:t.id}),t.helperText&&c.jsx(R.Typography,{sx:{fontSize:12,color:"#6c757d",mb:.75},children:t.helperText}),i.length===0&&c.jsx(R.Box,{sx:{py:2.5,textAlign:"center",border:"1.5px dashed #e2e8f0",borderRadius:"8px",mb:1,color:"#94a3b8",fontSize:13},children:"No items yet — click Add to start"}),i.map((I,S)=>c.jsx(gi,{index:S,itemLabel:C.itemLabel,canRemove:i.length>g&&!b,onRemove:()=>A(S),children:c.jsx(R.Box,{children:n.map(y=>{const E=y.id??y.name??"",F=`${e}.${S}.${E}`;return f({field:y,pathPrefix:F,depth:l+1,values:r,errors:s,touched:o,setFieldValue:u,setFieldTouched:a,item:I&&typeof I=="object"?I:void 0,compact:!1,inlineLabel:!1})})})},h[S]??S)),i.length>0&&c.jsx(R.Divider,{sx:{mb:1,borderColor:"transparent"}}),i.length<x&&c.jsxs(R.Box,{component:"button",type:"button",onClick:v,disabled:b,sx:{display:"inline-flex",alignItems:"center",gap:.5,border:"1px dashed #cbd5e1",borderRadius:"6px",background:"none",cursor:b?"not-allowed":"pointer",px:1.5,py:.6,fontSize:12.5,color:"#6366f1",opacity:b?.5:1,"&:hover:not(:disabled)":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[c.jsx(U.MdAdd,{size:14}),C.addLabel??`Add ${C.itemLabel??"item"}`]})]})}function St(t){const{field:e,value:n,onChange:i,pathPrefix:r,values:s,parentErrors:o,parentTouched:u,parentSetFieldValue:a,parentSetFieldTouched:l,depth:d=0,compact:f,renderFieldRouter:b}=t,g=e,x=e.disabled===!0,h=g.itemType??"text",m=g.minItems??0,v=g.maxItems??1/0,A=e.children??g.itemFields;if(!!b&&typeof r=="string"&&Array.isArray(A)&&A.length>0)return c.jsx(zl,{field:e,pathPrefix:r,childFields:A,items:nt(n),values:s??{},errors:o??{},touched:u??{},setFieldValue:a??(()=>{}),setFieldTouched:l??(()=>{}),depth:d,compact:f,renderFieldRouter:b,disabled:x,minItems:m,maxItems:v});const[I,S]=p.useState(()=>Pt(nt(n))),y=p.useRef(JSON.stringify(Nt(I)));p.useEffect(()=>{if(JSON.stringify(nt(n))!==y.current){const N=Pt(nt(n));S(N),y.current=JSON.stringify(Nt(N))}},[n]);const E=p.useCallback(D=>{const N=Pt(D);S(N);const G=Nt(N);y.current=JSON.stringify(G),i(G)},[i]),F=p.useCallback(()=>{I.length>=v||E([...I,kl(h,g.itemFields)])},[I,h,g.itemFields,v,E]),j=p.useCallback(D=>{I.length<=m||E(I.filter(N=>Mt(N)!==D))},[I,m,E]),M=p.useCallback((D,N)=>{E(I.map(G=>Mt(G)!==D?G:N!==null&&typeof N=="object"&&!Array.isArray(N)?{...N,[Ie]:D}:{[Ie]:D,__value:N}))},[I,E]);return c.jsxs(R.Box,{children:[c.jsx(se,{label:e.label,required:e.required,showOptional:e.showOptional,info:e.info,htmlFor:e.id}),e.helperText&&c.jsx(R.Typography,{sx:{fontSize:12,color:"#6c757d",mb:.75},children:e.helperText}),I.length===0&&c.jsx(R.Box,{sx:{py:2.5,textAlign:"center",border:"1.5px dashed #e2e8f0",borderRadius:"8px",mb:1,color:"#94a3b8",fontSize:13},children:"No items yet — click Add to start"}),I.map((D,N)=>{const G=Mt(D),w=Ll(D);return c.jsx(gi,{index:N,itemLabel:g.itemLabel,canRemove:I.length>m&&!x,onRemove:()=>j(G),children:h==="object"&&g.itemFields?c.jsx(pi,{fields:g.itemFields,value:w??{},onChange:V=>M(G,V),disabled:x}):h==="select"?c.jsx(Xl,{value:w,onChange:V=>M(G,V),options:g.itemOptions??[],disabled:x}):h==="array"?c.jsx(St,{field:{...g.itemSchema,id:`${e.id}-${G}`,type:"array",label:void 0},value:w,values:{},onChange:V=>M(G,V),onBlur:()=>{}}):c.jsx(Wl,{value:w,onChange:V=>M(G,h==="number"?V===""?"":Number(V):V),inputType:h,placeholder:g.itemPlaceholder,disabled:x})},G)}),I.length>0&&c.jsx(R.Divider,{sx:{mb:1,borderColor:"transparent"}}),I.length<v&&c.jsxs(R.Box,{component:"button",type:"button",onClick:F,disabled:x,sx:{display:"inline-flex",alignItems:"center",gap:.5,border:"1px dashed #cbd5e1",borderRadius:"6px",background:"none",cursor:x?"not-allowed":"pointer",px:1.5,py:.6,fontSize:12.5,color:"#6366f1",opacity:x?.5:1,"&:hover:not(:disabled)":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[c.jsx(U.MdAdd,{size:14}),g.addLabel??`Add ${g.itemLabel??"item"}`]})]})}function Hl(t){return`ff-form-col-${t}`}function Je({field:t,children:e,compact:n}){const i=typeof t.colSpan=="number"?t.colSpan:12;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:[Hl(i),n?"ff-form-mb-0":"ff-form-mb-4",t.hidden?"ff-form-hidden":""].filter(Boolean).join(" "),children:e}),t.dividerAfter&&c.jsx("div",{className:"ff-form-col-12",children:c.jsx("hr",{className:"ff-form-divider"})})]})}function Jn(t,e){const n={};for(const i of t){const r=i.id??i.name??"";r&&(r in e?n[r]=e[r]:i.type==="array"?n[r]=[]:i.type==="object"||i.type==="schema"?n[r]={}:n[r]="")}return n}function Zl({field:t,value:e,allValues:n,onChange:i,onBlur:r}){const s=q.get(t.type);return s?c.jsx(Je,{field:t,children:c.jsx(s,{field:t,value:e,values:n,onChange:i,onBlur:r})}):null}function _l({field:t,value:e,onChange:n,onBlur:i}){const r=t.children??[],s=e??{},o=Jn(r,s),u=p.useRef(s);u.current=s;function a(l,d){const b={...Jn(r,u.current),[l]:d};u.current=b,n(b)}return c.jsxs(R.Box,{children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info}),t.helperText&&c.jsx(R.Typography,{sx:{fontSize:12,color:"#6c757d",mb:.75},children:t.helperText}),r.length===0?c.jsx(R.Box,{sx:{py:2.5,textAlign:"center",border:"1.5px dashed #e2e8f0",borderRadius:"8px",color:"#94a3b8",fontSize:13},children:"No child fields defined — edit this field to add them"}):c.jsx(R.Box,{sx:{border:"1px solid #e2e8f0",borderRadius:"8px",p:2,bgcolor:"#fafafa"},children:c.jsx("div",{className:"ff-form-row",children:r.map(l=>{const d=l.id??l.name??"";return d?c.jsx(Zl,{field:l,value:o[d],allValues:o,onChange:f=>a(d,f),onBlur:i},d):null})})})]})}function Jl({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>e==null||e===""?"":String(e)),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(e==null||e===""?"":String(e)))},[e]);const g=!!o.prefix,x=!!o.suffix,h=g||x,m={flex:1,border:"none",outline:"none",backgroundColor:"transparent",fontSize:14,color:"#374151",padding:"6px 12px",cursor:l?"not-allowed":void 0,boxSizing:"border-box",lineHeight:1.5,width:"100%",appearance:"none",MozAppearance:"textfield"},v={display:"flex",alignItems:"stretch",width:"100%",border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff",boxSizing:"border-box",transition:"border-color .15s, box-shadow .15s"},A={display:"flex",alignItems:"center",padding:"0 10px",color:"#6b7280",fontSize:13,whiteSpace:"nowrap",flexShrink:0,borderLeft:x?"1px solid rgba(0,0,0,0.1)":void 0,borderRight:g?"1px solid rgba(0,0,0,0.1)":void 0},C=S=>{S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,S.currentTarget.style.boxShadow=a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},I=S=>{S.currentTarget.contains(S.relatedTarget)||(S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,S.currentTarget.style.boxShadow="none",i())};return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{style:h?v:void 0,onFocus:h?C:void 0,onBlur:h?I:void 0,children:[g&&c.jsx("span",{style:A,children:o.prefix}),c.jsx("input",{id:u,name:u,type:"number",min:o.min,max:o.max,step:o.step??1,disabled:l,readOnly:o.readOnly,placeholder:o.placeholder??"",value:d,"data-testid":o.dataTestId??`${u}-input`,style:h?m:{...m,border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff"},onChange:S=>{const y=S.target.value;f(y);const E=y===""?null:Number(y);b.current=E,n(E)},onFocus:h?void 0:S=>{S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,S.currentTarget.style.boxShadow=a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:h?void 0:S=>{S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,S.currentTarget.style.boxShadow="none",i()}}),x&&c.jsx("span",{style:{...A,borderRight:void 0},children:o.suffix})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Yl({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=!!e,f=c.jsx(R.FormControlLabel,{control:c.jsx(R.Switch,{id:u,name:u,checked:d,onChange:b=>{n(b.target.checked)},onBlur:i,disabled:l,color:o.color??"primary",inputProps:{"aria-label":o.ariaLabel??(typeof o.label=="string"?o.label:void 0),"aria-describedby":o.ariaDescribedBy,"data-testid":o.dataTestId??`${u}-input`}}),label:o.label?c.jsx("span",{style:{fontSize:14,color:l?"#9ca3af":"#374151",fontWeight:500},children:o.label}):void 0,sx:{m:0}});return c.jsxs("div",{children:[f,o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function $l({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=e!=null?String(e):"";return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx(R.RadioGroup,{id:u,name:u,value:d,onChange:f=>{n(f.target.value)},onBlur:i,row:o.row,children:(o.options??[]).map(f=>c.jsx(R.FormControlLabel,{value:f.value,control:c.jsx(R.Radio,{disabled:l||f.disabled,color:o.color??"primary",inputProps:{"data-testid":o.dataTestId?`${o.dataTestId}-opt-${f.value}`:`${u}-opt-${f.value}`}}),label:c.jsx("span",{style:{fontSize:14,color:l||f.disabled?"#9ca3af":"#374151"},children:f.label}),sx:{mr:o.row?3:0}},String(f.value)))}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function mn({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=o.inputType==="datetime"?"datetime-local":o.inputType==="time"?"time":"date",[f,b]=p.useState(()=>String(e??"")),g=p.useRef(e);p.useEffect(()=>{e!==g.current&&(g.current=e,b(String(e??"")))},[e]);const x={width:"100%",fontSize:14,color:"#374151",backgroundColor:l?"#f9fafb":"#fff",border:`1px solid ${a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,outline:"none",padding:"6px 12px",boxSizing:"border-box",lineHeight:1.5,cursor:l?"not-allowed":void 0};return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("input",{id:u,name:u,type:d,style:x,value:f,min:o.min,max:o.max,disabled:l,readOnly:o.readOnly,"data-testid":o.dataTestId??`${u}-input`,onChange:h=>{b(h.target.value),g.current=h.target.value,n(h.target.value)},onBlur:i,onFocus:h=>{h.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,h.currentTarget.style.boxShadow=a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:h=>{h.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,h.currentTarget.style.boxShadow="none"}}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Ul({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=Array.isArray(e)?e:[],[f,b]=p.useState(""),[g,x]=p.useState(!1),h=p.useRef(null),m=I=>{const S=I.trim();!S||d.includes(S)||o.maxTags&&d.length>=o.maxTags||(n([...d,S]),b(""))},v=I=>{n(d.filter((S,y)=>y!==I))},A=a?O.BORDER_COLOR_ERROR:g?O.BORDER_COLOR_FOCUS:O.BORDER_COLOR,C=g?a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW:"none";return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{onClick:()=>{var I;return(I=h.current)==null?void 0:I.focus()},style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,minHeight:38,padding:"4px 8px",border:`1px solid ${A}`,borderRadius:O.BORDER_RADIUS,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff",boxShadow:C,boxSizing:"border-box",cursor:l?"not-allowed":"text",transition:"border-color .15s, box-shadow .15s"},children:[d.map((I,S)=>c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"#ede9fe",color:"#5b21b6",border:"1px solid #ddd6fe",borderRadius:4,padding:"1px 6px",fontSize:13,fontWeight:500,lineHeight:1.6},children:[I,!l&&c.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),v(S)},style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",color:"#7c3aed"},children:c.jsx(U.MdClose,{size:12})})]},I)),c.jsx("input",{ref:h,id:u,value:f,disabled:l,placeholder:d.length===0?o.placeholder??"Type and press Enter...":"","data-testid":o.dataTestId??`${u}-input`,style:{flex:1,minWidth:80,border:"none",outline:"none",fontSize:14,color:"#374151",backgroundColor:"transparent",padding:"2px 4px",cursor:l?"not-allowed":void 0},onChange:I=>b(I.target.value),onKeyDown:I=>{(I.key==="Enter"||I.key===",")&&(I.preventDefault(),m(f)),I.key==="Backspace"&&!f&&d.length>0&&v(d.length-1)},onFocus:()=>x(!0),onBlur:()=>{x(!1),f.trim()&&m(f),i()}})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Ql({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=o.min??0,f=o.max??100,b=o.step??1,[g,x]=p.useState(()=>typeof e=="number"?e:d),h=p.useRef(e);return p.useEffect(()=>{e!==h.current&&(h.current=e,x(typeof e=="number"?e:d))},[e,d]),c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,px:1},children:[c.jsx(R.Slider,{id:u,value:g,min:d,max:f,step:b,disabled:l,marks:o.marks,onChange:(m,v)=>{const A=Array.isArray(v)?v[0]:v;x(A),h.current=A,n(A)},onChangeCommitted:()=>i(),sx:{color:a?"#d32f2f":"#6366f1",flex:1},"data-testid":o.dataTestId??`${u}-input`}),o.showValue!==!1&&c.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#374151",minWidth:36,textAlign:"right"},children:g})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function ql({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>String(e??"#6366f1")),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(String(e??"#6366f1")))},[e]);const g=x=>{f(x),b.current=x,n(x)};return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsxs("div",{style:{width:O.INPUT_HEIGHT,height:O.INPUT_HEIGHT,borderRadius:O.BORDER_RADIUS,border:a?O.BORDER_ERROR:O.BORDER,overflow:"hidden",flexShrink:0,cursor:l?"not-allowed":"pointer",position:"relative"},children:[c.jsx("input",{type:"color",id:u,value:d,disabled:l,"data-testid":o.dataTestId??`${u}-input`,onChange:x=>g(x.target.value),onBlur:i,style:{position:"absolute",inset:0,width:"150%",height:"150%",border:"none",outline:"none",padding:0,cursor:l?"not-allowed":"pointer",opacity:0}}),c.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:d}})]}),o.showHex!==!1&&c.jsx("input",{type:"text",value:d,disabled:l,maxLength:7,placeholder:"#000000",onChange:x=>{const h=x.target.value;f(h),/^#[0-9a-fA-F]{6}$/.test(h)&&(b.current=h,n(h))},onBlur:i,style:{fontSize:O.FONT_SIZE_INPUT,fontFamily:"monospace",color:O.COLOR_LABEL,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff",border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,padding:"0 10px",outline:"none",height:O.INPUT_HEIGHT,width:100,boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s"}})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Kl(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function eu({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=p.useRef(null),[f,b]=p.useState(!1),[g,x]=p.useState(null),h=e instanceof File?[e]:Array.isArray(e)?e:[],m=C=>{if(!C)return;const I=Array.from(C);if(o.maxSizeMb){const S=I.find(y=>y.size>o.maxSizeMb*1024*1024);if(S){x(`"${S.name}" exceeds ${o.maxSizeMb} MB`);return}}x(null),n(o.multiple?I:I[0]??null)},v=C=>{o.multiple?n(h.filter((I,S)=>S!==C)):n(null),d.current&&(d.current.value="")},A=a||g?O.BORDER_COLOR_ERROR:f?O.BORDER_COLOR_FOCUS:O.BORDER_COLOR;return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{onClick:()=>{var C;return!l&&((C=d.current)==null?void 0:C.click())},onDragOver:C=>{C.preventDefault(),l||b(!0)},onDragLeave:()=>b(!1),onDrop:C=>{C.preventDefault(),b(!1),l||m(C.dataTransfer.files)},style:{border:`1px dashed ${A}`,borderRadius:O.BORDER_RADIUS,padding:"14px 16px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:f?"rgba(99,102,241,0.04)":l?"#f9fafb":"#fff",transition:"border-color .15s, background .15s"},children:[c.jsx("input",{ref:d,id:u,type:"file",accept:o.accept,multiple:o.multiple,disabled:l,"data-testid":o.dataTestId??`${u}-input`,style:{display:"none"},onChange:C=>{m(C.target.files),i()}}),c.jsx(U.MdUploadFile,{size:24,color:l?"#9ca3af":"#6366f1",style:{marginBottom:4}}),c.jsx("div",{style:{fontSize:13,color:l?"#9ca3af":"#374151",fontWeight:500},children:f?"Drop file here":"Click or drag file to upload"}),o.accept&&c.jsx("div",{style:{fontSize:11,color:"#6b7280",marginTop:2},children:o.accept}),o.maxSizeMb&&c.jsxs("div",{style:{fontSize:11,color:"#6b7280"},children:["Max ",o.maxSizeMb," MB"]})]}),h.length>0&&c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginTop:8},children:h.map((C,I)=>c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",border:"1px solid #e5e7eb",borderRadius:4,backgroundColor:"#f9fafb"},children:[c.jsx(U.MdInsertDriveFile,{size:16,color:"#6366f1"}),c.jsx("span",{style:{fontSize:13,color:"#374151",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.name}),c.jsx("span",{style:{fontSize:11,color:"#6b7280",flexShrink:0},children:Kl(C.size)}),!l&&c.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),v(I)},style:{background:"none",border:"none",cursor:"pointer",color:"#9ca3af",display:"flex",padding:0},children:c.jsx(U.MdClose,{size:14})})]},`${C.name}-${C.size}-${C.lastModified}`))}),(a||g)&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:g??r})]})}const tu=p.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./index-hByI0uXP.js"))).default}));async function nu(t){switch(t){case"python":return[(await Promise.resolve().then(()=>require("./index-gtgq_241.js"))).python()];case"json":return[(await Promise.resolve().then(()=>require("./index-BysKSEtZ.js"))).json()];case"typescript":return[(await Promise.resolve().then(()=>require("./index-B3aHpb84.js"))).javascript({typescript:!0})];default:return[(await Promise.resolve().then(()=>require("./index-B3aHpb84.js"))).javascript()]}}function hi({language:t,value:e,readOnly:n,minHeight:i,maxHeight:r,basicSetup:s,onChange:o,onBlur:u,style:a,fallbackHeight:l}){const[d,f]=p.useState(null);p.useEffect(()=>{let g=!0;return nu(t).then(x=>{g&&f(x)}),()=>{g=!1}},[t]);const b=p.useMemo(()=>c.jsx("div",{style:{minHeight:l??i,padding:8,color:"#9ca3af",fontSize:12},children:"Loading editor…"}),[l,i]);return d?c.jsx(p.Suspense,{fallback:b,children:c.jsx(tu,{value:e,extensions:d,readOnly:n,minHeight:i,maxHeight:r,theme:"light",basicSetup:s,onChange:o,onBlur:u,style:a})}):b}function ru({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(null),[b,g]=p.useState(()=>typeof e=="string"?e:e!=null?JSON.stringify(e,null,2):""),x=p.useRef(e);p.useEffect(()=>{e!==x.current&&(x.current=e,typeof e=="string"?g(e):e!=null?g(JSON.stringify(e,null,2)):g(""))},[e]);const h=S=>{g(S);try{S.trim()&&JSON.parse(S),f(null)}catch(y){f(y.message)}x.current=S,n(S)},m=()=>{try{const S=JSON.stringify(JSON.parse(b),null,2);g(S),f(null),x.current=S,n(S)}catch{}},v=o.rows??8,A=`${v*22}px`,C=`${v*22}px`,I=a||d?O.BORDER_COLOR_ERROR:O.BORDER_COLOR;return c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),!l&&!o.readOnly&&c.jsx("button",{type:"button",onClick:m,style:{fontSize:11,fontWeight:600,color:"#6366f1",background:"none",border:"none",cursor:"pointer",padding:"0 0 4px"},children:"Format"})]}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("div",{id:u,"data-testid":o.dataTestId??`${u}-input`,style:{border:`1px solid ${I}`,borderRadius:O.BORDER_RADIUS,overflow:"hidden",fontSize:13},children:c.jsx(hi,{language:"json",value:b,readOnly:l||o.readOnly,minHeight:A,maxHeight:C,basicSetup:{lineNumbers:!0,foldGutter:!0},onChange:h,onBlur:i,style:{fontSize:13}})}),(a||d)&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:d??r})]})}const iu={javascript:"JS",typescript:"TS",python:"PY",json:"JSON"};function ou({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>String(e??"")),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(String(e??"")))},[e]);const g=A=>{f(A),b.current=A,n(A)},x=o.rows??8,h=`${x*22}px`,m=`${x*22}px`,v=iu[o.language??"javascript"]??"CODE";return c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),c.jsx("span",{style:{fontSize:10,fontWeight:700,color:"#6b7280",backgroundColor:"#f1f5f9",border:"1px solid #e2e8f0",borderRadius:4,padding:"1px 6px",letterSpacing:.5,marginBottom:4},children:v})]}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("div",{id:u,"data-testid":o.dataTestId??`${u}-input`,style:{border:`1px solid ${a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,overflow:"hidden"},children:c.jsx(hi,{language:o.language,value:d,readOnly:l||o.readOnly,minHeight:h,maxHeight:m,basicSetup:{lineNumbers:!0,foldGutter:!0,autocompletion:!0},onChange:g,onBlur:i,style:{fontSize:13}})}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}const su=p.lazy(()=>Promise.resolve().then(()=>require("./index-DNBDuEzF.js")).then(t=>t.index).then(t=>(Promise.resolve().then(()=>require("./quill.snow-Dyvby5gX.js")),{default:t.default}))),au=[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]];function lu({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>String(e??"")),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(String(e??"")))},[e]);const g=m=>{f(m),b.current=m,n(m)},x=(o.rows??6)*24,h=o.toolbar!==!1;return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("div",{id:u,"data-testid":o.dataTestId??`${u}-input`,style:{border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,overflow:"hidden",fontSize:14},children:c.jsx(p.Suspense,{fallback:c.jsx("div",{style:{minHeight:x,display:"flex",alignItems:"center",padding:"8px 12px",color:"rgba(0,0,0,0.38)",fontSize:13},children:"Loading editor…"}),children:c.jsx(su,{value:d,onChange:g,onBlur:i,readOnly:l||o.readOnly,modules:{toolbar:h?au:!1},style:{minHeight:x},theme:"snow"})})}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}const _t="ff-infinite-open";function uu(t){typeof window<"u"&&window.dispatchEvent(new CustomEvent(_t,{detail:t}))}if(typeof document<"u"&&!document.getElementById("ff-spin-style")){const t=document.createElement("style");t.id="ff-spin-style",t.textContent="@keyframes ff-spin { to { transform: rotate(360deg); } }",document.head.appendChild(t)}function cu(t){const{onScrollBottom:e,isLoading:n,hasMore:i,innerRef:r,children:s,...o}=t,u=p.Children.count(s)>0,a=p.useRef(null),l=p.useCallback(d=>{a.current=d,typeof r=="function"?r(d):r&&"current"in r&&(r.current=d)},[r]);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=()=>{n||!i||d.scrollTop+d.clientHeight>=d.scrollHeight-50&&e()};return d.addEventListener("scroll",f,{passive:!0}),()=>d.removeEventListener("scroll",f)},[n,i,e]),p.useEffect(()=>{const d=a.current;!d||n||!i||d.scrollHeight<=d.clientHeight+4&&e()},[s,n,i,e]),c.jsxs(ke.components.MenuList,{...o,innerRef:l,children:[s,u&&(n||i)&&c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px 12px",gap:8,color:"#6b7280",fontSize:12,borderTop:"1px solid #f1f3f5",pointerEvents:"none",userSelect:"none"},children:n?c.jsxs(c.Fragment,{children:[c.jsx(du,{}),"Loading…"]}):c.jsx("span",{style:{color:"#adb5bd"},children:"Scroll for more"})})]})}function du(){return c.jsx("div",{style:{width:13,height:13,flexShrink:0,border:"2px solid #e5e7eb",borderTopColor:"#6366f1",borderRadius:"50%",animation:"ff-spin 0.7s linear infinite"}})}function fu({loadPage:t,loadSelected:e,currentValues:n,isOpen:i}){const[r,s]=p.useState([]),[o,u]=p.useState(0),[a,l]=p.useState(!0),[d,f]=p.useState(!1),b=p.useRef(new Map),[g,x]=p.useState(0),[h,m]=p.useState(""),[v,A]=p.useState(""),C=p.useRef(null),I=p.useRef(null),S=p.useRef(null),y=p.useCallback(G=>{m(G),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>A(G),300)},[]);p.useEffect(()=>{var w;if(!i||S.current===v)return;S.current=v,(w=I.current)==null||w.abort();const G=new AbortController;return I.current=G,s([]),u(0),l(!0),f(!0),t({page:1,search:v,signal:G.signal}).then(V=>{if(G.signal.aborted)return;const W=Yn(V.options);s(W),u(1),l(V.hasMore),f(!1)}).catch(V=>{$n(V)||f(!1)}),()=>G.abort()},[v,i]);const E=p.useCallback(()=>{var V;if(d||!a)return;(V=I.current)==null||V.abort();const G=new AbortController;I.current=G,f(!0);const w=o+1;t({page:w,search:v,signal:G.signal}).then(W=>{G.signal.aborted||(s(J=>Yn([...J,...W.options])),u(w),l(W.hasMore),f(!1))}).catch(W=>{$n(W)||f(!1)})},[d,a,o,v]),F=p.useRef(new Set);p.useEffect(()=>{if(!e||n.length===0)return;const G=n.filter(w=>!b.current.has(w)&&!F.current.has(w));G.length!==0&&(G.forEach(w=>F.current.add(w)),e(G).then(w=>{w.forEach(V=>b.current.set(V.value,V)),x(V=>V+1)}).catch(()=>{}).finally(()=>{G.forEach(w=>F.current.delete(w))}))},[n.join("|")]);const j=p.useCallback(()=>{var G;S.current=null,m(""),A(""),C.current&&clearTimeout(C.current),(G=I.current)==null||G.abort()},[]),M=p.useMemo(()=>r,[r,g]),D=p.useCallback(G=>{const w=r.find(V=>V.value===G);return w||b.current.get(G)},[r,g]),N=p.useCallback(G=>{if(!G)return;(Array.isArray(G)?G:[G]).forEach(V=>b.current.set(V.value,V))},[]);return{options:M,lookupOption:D,isLoading:d,hasMore:a,inputValue:h,handleInputChange:y,loadMore:E,handleMenuClose:j,updateSelectedCache:N}}function Yn(t){const e=new Set;return t.filter(n=>e.has(n.value)?!1:(e.add(n.value),!0))}function $n(t){return t instanceof Error&&(t.name==="AbortError"||t.message==="AbortError")}function Un(t){return t==null?[]:Array.isArray(t)?t.map(String):[String(t)]}function mi({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.isMulti??!1,a=o.id??o.name??"",l=!!(s&&r),d=o.disabled===!0,f=p.useRef(`ff-inf-${Math.random().toString(36).slice(2)}`).current,[b,g]=p.useState(!1);p.useEffect(()=>{const J=_=>{_.detail!==f&&g(!1)};return window.addEventListener(_t,J),()=>window.removeEventListener(_t,J)},[f]),p.useEffect(()=>{b&&uu(f)},[b,f]);const x=p.useCallback(()=>g(!0),[]),h=p.useMemo(()=>Un(e),[e]),{options:m,lookupOption:v,isLoading:A,hasMore:C,inputValue:I,handleInputChange:S,loadMore:y,handleMenuClose:E,updateSelectedCache:F}=fu({loadPage:o.loadPage,loadSelected:o.loadSelected,currentValues:h,isOpen:b}),j=p.useRef(E);j.current=E;const M=p.useRef(!1);p.useEffect(()=>{M.current&&!b&&j.current(),M.current=b},[b]);const D=p.useCallback(()=>g(!1),[]),N=p.useMemo(()=>e==null||e===""||Array.isArray(e)&&e.length===0?u?[]:null:u?Un(e).map(J=>v(J)).filter(J=>!!J):v(String(e))??null,[e,v,u]),G=p.useCallback(J=>{if(u){const _=J??[];F(_),n(_.map(ee=>ee.value))}else{const _=J;_&&F(_),n(_?_.value:null)}},[u,n,F]),w=p.useRef({loadMore:y,isLoading:A,hasMore:C});w.current={loadMore:y,isLoading:A,hasMore:C};const V=p.useRef(function(_){return c.jsx(cu,{..._,onScrollBottom:()=>w.current.loadMore(),isLoading:w.current.isLoading,hasMore:w.current.hasMore})}).current,W=p.useCallback(()=>A?"Loading…":"No options found",[A]);return c.jsxs("div",{className:`${o.customClass??""} ${o.hidden?"ff-form-hidden":""}`,children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:a}),o.helperText&&!l&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx(ke,{inputId:a,value:N,inputValue:I,onInputChange:S,onChange:G,onBlur:i,options:m,isMulti:u,isDisabled:d,isClearable:o.isClearable??!1,isSearchable:!0,filterOption:null,menuIsOpen:b,onMenuOpen:x,onMenuClose:D,placeholder:o.placeholder??"Search…",noOptionsMessage:W,styles:en(l,u),components:{MenuList:V},classNamePrefix:"ff-select",menuPortalTarget:typeof document<"u"?document.body:void 0,menuPosition:"fixed",closeMenuOnSelect:!u,hideSelectedOptions:u}),l&&c.jsx("small",{"data-testid":`${a}-error`,style:ae,children:r})]})}q.register("text",Er);q.register("textarea",Er);q.register("select",Bl);q.register("descriptive-select",Nl);q.register("array",St);q.register("schema",_l);q.register("number",Jl);q.register("toggle",Yl);q.register("radio-group",$l);q.register("date",mn);q.register("datetime",mn);q.register("time",mn);q.register("tags",Ul);q.register("slider",Ql);q.register("color",ql);q.register("file",eu);q.register("json-editor",ru);q.register("code",ou);q.register("rich-text",lu);q.register("infinite-select",mi);var pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function We(t){this._maxSize=t,this.clear()}We.prototype.clear=function(){this._size=0,this._values=Object.create(null)};We.prototype.get=function(t){return this._values[t]};We.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var gu=/[^.^\]^[]+|(?=\[\]|\.\.)/g,vi=/^\d+$/,bu=/^\d/,hu=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,mu=/^\s*(['"]?)(.*?)(\1)\s*$/,xn=512,Qn=new We(xn);new We(xn);var qn=new We(xn),Fe={split:Jt,normalizePath:Kn,getter:function(t,e){var n=Kn(t);return qn.get(t)||qn.set(t,function(r){for(var s=0,o=n.length;s<o;)if(r!=null||!e)r=r[n[s++]];else return;return r})},join:function(t){return t.reduce(function(e,n){return e+(vn(n)||vi.test(n)?"["+n+"]":(e?".":"")+n)},"")},forEach:function(t,e,n){xu(Array.isArray(t)?t:Jt(t),e,n)}};function Kn(t){return Qn.get(t)||Qn.set(t,Jt(t).map(function(e){return e.replace(mu,"$2")}))}function Jt(t){return t.match(gu)||[""]}function xu(t,e,n){var i=t.length,r,s,o,u;for(s=0;s<i;s++)r=t[s],r&&(yu(r)&&(r='"'+r+'"'),u=vn(r),o=!u&&/^\d+$/.test(r),e.call(n,r,u,o,s,t))}function vn(t){return typeof t=="string"&&t&&["'",'"'].indexOf(t.charAt(0))!==-1}function vu(t){return t.match(bu)&&!t.match(vi)}function Iu(t){return hu.test(t)}function yu(t){return!vn(t)&&(vu(t)||Iu(t))}const Cu=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ii=t=>t.match(Cu)||[],Su=(t,e)=>Ii(t).join(e).toLowerCase(),Au=t=>Ii(t).reduce((e,n)=>`${e}${e?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),Ru=t=>Su(t,"_");var kt={camelCase:Au,snakeCase:Ru},In={exports:{}};In.exports=function(t){return yi(Eu(t),t)};In.exports.array=yi;function yi(t,e){var n=t.length,i=new Array(n),r={},s=n,o=Ou(e),u=Fu(t);for(e.forEach(function(l){if(!u.has(l[0])||!u.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)r[s]||a(t[s],s,new Set);return i;function a(l,d,f){if(f.has(l)){var b;try{b=", node was:"+JSON.stringify(l)}catch{b=""}throw new Error("Cyclic dependency"+b)}if(!u.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!r[d]){r[d]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),d=g.length){f.add(l);do{var x=g[--d];a(x,u.get(x),f)}while(d);f.delete(l)}i[--n]=l}}}function Eu(t){for(var e=new Set,n=0,i=t.length;n<i;n++){var r=t[n];e.add(r[0]),e.add(r[1])}return Array.from(e)}function Ou(t){for(var e=new Map,n=0,i=t.length;n<i;n++){var r=t[n];e.has(r[0])||e.set(r[0],new Set),e.has(r[1])||e.set(r[1],new Set),e.get(r[0]).add(r[1])}return e}function Fu(t){for(var e=new Map,n=0,i=t.length;n<i;n++)e.set(t[n],n);return e}var wu=In.exports;const Tu=xi(wu),Bu=Object.prototype.toString,ju=Error.prototype.toString,Gu=RegExp.prototype.toString,Vu=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Du=/^Symbol\((.*)\)(.*)$/;function Pu(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function er(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Pu(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Vu.call(t).replace(Du,"Symbol($1)");const i=Bu.call(t).slice(8,-1);return i==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):i==="Error"||t instanceof Error?"["+ju.call(t)+"]":i==="RegExp"?Gu.call(t):null}function ye(t,e){let n=er(t,e);return n!==null?n:JSON.stringify(t,function(i,r){let s=er(this[i],e);return s!==null?s:r},2)}function Ci(t){return t==null?[]:[].concat(t)}let Si,Ai,Ri,Nu=/\$\{\s*(\w+)\s*\}/g;Si=Symbol.toStringTag;class tr{constructor(e,n,i,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Si]="Error",this.name="ValidationError",this.value=n,this.path=i,this.type=r,this.errors=[],this.inner=[],Ci(e).forEach(s=>{if(le.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ai=Symbol.hasInstance;Ri=Symbol.toStringTag;class le extends Error{static formatError(e,n){const i=n.label||n.path||"this";return n=Object.assign({},n,{path:i,originalPath:n.path}),typeof e=="string"?e.replace(Nu,(r,s)=>ye(n[s])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,i,r,s){const o=new tr(e,n,i,r);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ri]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,le)}static[Ai](e){return tr[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let he={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:i})=>{const r=i!=null&&i!==n?` (cast from the value \`${ye(i,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${ye(n,!0)}\``+r:`${t} must match the configured type. The validated value was: \`${ye(n,!0)}\``+r}},ue={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Se={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Yt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},$t={isValue:"${path} field must be ${value}"},st={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},at={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Mu={notType:t=>{const{path:e,value:n,spec:i}=t,r=i.types.length;if(Array.isArray(n)){if(n.length<r)return`${e} tuple value has too few items, expected a length of ${r} but got ${n.length} for value: \`${ye(n,!0)}\``;if(n.length>r)return`${e} tuple value has too many items, expected a length of ${r} but got ${n.length} for value: \`${ye(n,!0)}\``}return le.formatError(he.notType,t)}};Object.assign(Object.create(null),{mixed:he,string:ue,number:Se,date:Yt,object:st,array:at,boolean:$t,tuple:Mu});const At=t=>t&&t.__isYupSchema__;class xt{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:r,otherwise:s}=n,o=typeof i=="function"?i:(...u)=>u.every(a=>a===i);return new xt(e,(u,a)=>{var l;let d=o(...u)?r:s;return(l=d==null?void 0:d(a))!=null?l:a})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let i=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),r=this.fn(i,e,n);if(r===void 0||r===e)return e;if(!At(r))throw new TypeError("conditions must return a schema object");return r.resolve(n)}}const rt={context:"$",value:"."};class Be{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===rt.context,this.isValue=this.key[0]===rt.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?rt.context:this.isValue?rt.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Fe.getter(this.path,!0),this.map=n.map}getValue(e,n,i){let r=this.isContext?i:this.isValue?e:n;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Be.prototype.__isYupRef=!0;const fe=t=>t==null;function Ve(t){function e({value:n,path:i="",options:r,originalValue:s,schema:o},u,a){const{name:l,test:d,params:f,message:b,skipAbsent:g}=t;let{parent:x,context:h,abortEarly:m=o.spec.abortEarly,disableStackTrace:v=o.spec.disableStackTrace}=r;const A={value:n,parent:x,context:h};function C(D={}){const N=Ei(Object.assign({value:n,originalValue:s,label:o.spec.label,path:D.path||i,spec:o.spec,disableStackTrace:D.disableStackTrace||v},f,D.params),A),G=new le(le.formatError(D.message||b,N),n,N.path,D.type||l,N.disableStackTrace);return G.params=N,G}const I=m?u:a;let S={path:i,parent:x,type:l,from:r.from,createError:C,resolve(D){return Oi(D,A)},options:r,originalValue:s,schema:o};const y=D=>{le.isError(D)?I(D):D?a(null):I(C())},E=D=>{le.isError(D)?I(D):u(D)};if(g&&fe(n))return y(!0);let j;try{var M;if(j=d.call(S,n,S),typeof((M=j)==null?void 0:M.then)=="function"){if(r.sync)throw new Error(`Validation test of type: "${S.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(j).then(y,E)}}catch(D){E(D);return}y(j)}return e.OPTIONS=t,e}function Ei(t,e){if(!t)return t;for(const n of Object.keys(t))t[n]=Oi(t[n],e);return t}function Oi(t,e){return Be.isRef(t)?t.getValue(e.value,e.parent,e.context):t}function ku(t,e,n,i=n){let r,s,o;return e?(Fe.forEach(e,(u,a,l)=>{let d=a?u.slice(1,u.length-1):u;t=t.resolve({context:i,parent:r,value:n});let f=t.type==="tuple",b=l?parseInt(d,10):0;if(t.innerType||f){if(f&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&b>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);r=n,n=n&&n[b],t=f?t.spec.types[b]:t.innerType}if(!l){if(!t.fields||!t.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${t.type}")`);r=n,n=n&&n[d],t=t.fields[d]}s=d,o=a?"["+u+"]":"."+u}),{schema:t,parent:r,parentPath:s}):{parent:r,parentPath:e,schema:t}}class vt extends Set{describe(){const e=[];for(const n of this.values())e.push(Be.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const i of this.values())n.push(e(i));return n}clone(){return new vt(this.values())}merge(e,n){const i=this.clone();return e.forEach(r=>i.add(r)),n.forEach(r=>i.delete(r)),i}}function Ne(t,e=new Map){if(At(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let i=0;i<t.length;i++)n[i]=Ne(t[i],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[i,r]of t.entries())n.set(i,Ne(r,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const i of t)n.add(Ne(i,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[i,r]of Object.entries(t))n[i]=Ne(r,e)}else throw Error(`Unable to clone ${t}`);return n}function Lu(t){if(!(t!=null&&t.length))return;const e=[];let n="",i=!1,r=!1;for(let s=0;s<t.length;s++){const o=t[s];if(o==="["&&!r){n&&(e.push(...n.split(".").filter(Boolean)),n=""),i=!0;continue}if(o==="]"&&!r){n&&(/^\d+$/.test(n)?e.push(n):e.push(n.replace(/^"|"$/g,"")),n=""),i=!1;continue}if(o==='"'){r=!r;continue}if(o==="."&&!i&&!r){n&&(e.push(n),n="");continue}n+=o}return n&&e.push(...n.split(".").filter(Boolean)),e}function Wu(t,e){const n=e?`${e}.${t.path}`:t.path;return t.errors.map(i=>({message:i,path:Lu(n)}))}function Fi(t,e){var n;if(!((n=t.inner)!=null&&n.length)&&t.errors.length)return Wu(t,e);const i=e?`${e}.${t.path}`:t.path;return t.inner.flatMap(r=>Fi(r,i))}class de{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new vt,this._blacklist=new vt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(he.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ne(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=n,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,i=e.clone();const r=Object.assign({},n.spec,i.spec);return i.spec=r,i.internalTests=Object.assign({},n.internalTests,i.internalTests),i._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),i.tests=n.tests,i.exclusiveTests=n.exclusiveTests,i.withMutation(s=>{e.tests.forEach(o=>{s.test(o.OPTIONS)})}),i.transforms=[...n.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let i=n.conditions;n=n.clone(),n.conditions=[],n=i.reduce((r,s)=>s.resolve(r,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,i,r,s;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(r=e.recursive)!=null?r:this.spec.recursive,disableStackTrace:(s=e.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(e,n={}){let i=this.resolve(Object.assign({},n,{value:e})),r=n.assert==="ignore-optionality",s=i._cast(e,n);if(n.assert!==!1&&!i.isType(s)){if(r&&fe(s))return s;let o=ye(e),u=ye(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
6
+ `]))),$s=function(e,n){var i=e.isFocused,r=e.size,s=e.theme,o=s.colors,u=s.spacing.baseUnit;return L({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?o.neutral60:o.neutral20,padding:u*2})},wt=function(e){var n=e.delay,i=e.offset;return X.jsx("span",{css:X.css({animation:"".concat(Ys," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQ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E2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},Us=function(e){var n=e.innerProps,i=e.isRtl,r=e.size,s=r===void 0?4:r,o=pe(e,ks);return X.jsx("div",H({},ne(L(L({},o),{},{innerProps:n,isRtl:i,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),X.jsx(wt,{delay:0,offset:i}),X.jsx(wt,{delay:160,offset:!0}),X.jsx(wt,{delay:320,offset:!i}))},Qs=function(e,n){var i=e.isDisabled,r=e.isFocused,s=e.theme,o=s.colors,u=s.borderRadius,a=s.spacing;return L({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?o.neutral5:o.neutral0,borderColor:i?o.neutral10:r?o.primary:o.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},qs=function(e){var n=e.children,i=e.isDisabled,r=e.isFocused,s=e.innerRef,o=e.innerProps,u=e.menuIsOpen;return X.jsx("div",H({ref:s},ne(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":u}),o,{"aria-disabled":i||void 0}),n)},Ks=qs,ea=["data"],ta=function(e,n){var i=e.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},na=function(e){var n=e.children,i=e.cx,r=e.getStyles,s=e.getClassNames,o=e.Heading,u=e.headingProps,a=e.innerProps,l=e.label,d=e.theme,f=e.selectProps;return X.jsx("div",H({},ne(e,"group",{group:!0}),a),X.jsx(o,H({},u,{selectProps:f,theme:d,getStyles:r,getClassNames:s,cx:i}),l),X.jsx("div",null,n))},ra=function(e,n){var i=e.theme,r=i.colors,s=i.spacing;return L({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},ia=function(e){var n=Nr(e);n.data;var i=pe(n,ea);return X.jsx("div",H({},ne(e,"groupHeading",{"group-heading":!0}),i))},oa=na,sa=["innerRef","isDisabled","isHidden","inputClassName"],aa=function(e,n){var i=e.isDisabled,r=e.value,s=e.theme,o=s.spacing,u=s.colors;return L(L({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},la),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:u.neutral80})},_r={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},la={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":L({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},_r)},ua=function(e){return L({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},_r)},ca=function(e){var n=e.cx,i=e.value,r=Nr(e),s=r.innerRef,o=r.isDisabled,u=r.isHidden,a=r.inputClassName,l=pe(r,sa);return X.jsx("div",H({},ne(e,"input",{"input-container":!0}),{"data-value":i||""}),X.jsx("input",H({className:n({input:!0},a),ref:s,style:ua(u),disabled:o},l)))},da=ca,fa=function(e,n){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors;return L({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},pa=function(e,n){var i=e.theme,r=i.borderRadius,s=i.colors,o=e.cropWithEllipsis;return L({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},ga=function(e,n){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors,u=e.isFocused;return L({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:u?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},Jr=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",i,n)},ba=Jr,ha=Jr;function ma(t){var e=t.children,n=t.innerProps;return X.jsx("div",H({role:"button"},n),e||X.jsx(pn,{size:14}))}var xa=function(e){var n=e.children,i=e.components,r=e.data,s=e.innerProps,o=e.isDisabled,u=e.removeProps,a=e.selectProps,l=i.Container,d=i.Label,f=i.Remove;return X.jsx(l,{data:r,innerProps:L(L({},ne(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:a},X.jsx(d,{data:r,innerProps:L({},ne(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},n),X.jsx(f,{data:r,innerProps:L(L({},ne(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},u),selectProps:a}))},va=xa,Ia=function(e,n){var i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.theme,u=o.spacing,a=o.colors;return L({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?a.primary:r?a.primary25:"transparent",color:i?a.neutral20:s?a.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:s?a.primary:a.primary50}})},ya=function(e){var n=e.children,i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.innerRef,u=e.innerProps;return X.jsx("div",H({},ne(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":s}),{ref:o,"aria-disabled":i},u),n)},Ca=ya,Sa=function(e,n){var i=e.theme,r=i.spacing,s=i.colors;return L({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Aa=function(e){var n=e.children,i=e.innerProps;return X.jsx("div",H({},ne(e,"placeholder",{placeholder:!0}),i),n)},Ra=Aa,Ea=function(e,n){var i=e.isDisabled,r=e.theme,s=r.spacing,o=r.colors;return L({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Oa=function(e){var n=e.children,i=e.isDisabled,r=e.innerProps;return X.jsx("div",H({},ne(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},Fa=Oa,wa={ClearIndicator:Zs,Control:Ks,DropdownIndicator:zs,DownChevron:Hr,CrossIcon:pn,Group:oa,GroupHeading:ia,IndicatorsContainer:Ns,IndicatorSeparator:Js,Input:da,LoadingIndicator:Us,Menu:Ss,MenuList:Rs,MenuPortal:Ts,LoadingMessage:ws,NoOptionsMessage:Fs,MultiValue:va,MultiValueContainer:ba,MultiValueLabel:ha,MultiValueRemove:ma,Option:Ca,Placeholder:Ra,SelectContainer:js,SingleValue:Fa,ValueContainer:Ds},Ba=function(e){return L(L({},wa),e.components)},Gn=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ta(t,e){return!!(t===e||Gn(t)&&Gn(e))}function Ga(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!Ta(t[n],e[n]))return!1;return!0}function ja(t,e){e===void 0&&(e=Ga);var n=null;function i(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(n&&n.lastThis===this&&e(r,n.lastArgs))return n.lastResult;var o=t.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return i.clear=function(){n=null},i}function Va(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Da=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IEpTWCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:Va},Pa=function(e){return X.jsx("span",H({css:Da},e))},jn=Pa,Na={guidance:function(e){var n=e.isSearchable,i=e.isMulti,r=e.tabSelectsValue,s=e.context,o=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,i=e.label,r=i===void 0?"":i,s=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var n=e.context,i=e.focused,r=e.options,s=e.label,o=s===void 0?"":s,u=e.selectValue,a=e.isDisabled,l=e.isSelected,d=e.isAppleDevice,f=function(h,m){return h&&h.length?"".concat(h.indexOf(m)+1," of ").concat(h.length):""};if(n==="value"&&u)return"value ".concat(o," focused, ").concat(f(u,i),".");if(n==="menu"&&d){var b=a?" disabled":"",g="".concat(l?" selected":"").concat(b);return"".concat(o).concat(g,", ").concat(f(r,i),".")}return""},onFilter:function(e){var n=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},Ma=function(e){var n=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,o=e.isFocused,u=e.selectValue,a=e.selectProps,l=e.id,d=e.isAppleDevice,f=a.ariaLiveMessages,b=a.getOptionLabel,g=a.inputValue,x=a.isMulti,h=a.isOptionDisabled,m=a.isSearchable,v=a.menuIsOpen,A=a.options,C=a.screenReaderStatus,I=a.tabSelectsValue,S=a.isLoading,y=a["aria-label"],E=a["aria-live"],F=p.useMemo(function(){return L(L({},Na),f||{})},[f]),G=p.useMemo(function(){var V="";if(n&&F.onChange){var W=n.option,J=n.options,_=n.removedValue,ee=n.removedValues,re=n.value,k=function(K){return Array.isArray(K)?null:K},B=_||W||k(re),z=B?b(B):"",T=J||ee||void 0,P=T?T.map(b):[],Z=L({isDisabled:B&&h(B,u),label:z,labels:P},n);V=F.onChange(Z)}return V},[n,F,h,u,b]),M=p.useMemo(function(){var V="",W=i||r,J=!!(i&&u&&u.includes(i));if(W&&F.onFocus){var _={focused:W,label:b(W),isDisabled:h(W,u),isSelected:J,options:s,context:W===i?"menu":"value",selectValue:u,isAppleDevice:d};V=F.onFocus(_)}return V},[i,r,b,h,F,s,u,d]),D=p.useMemo(function(){var V="";if(v&&A.length&&!S&&F.onFilter){var W=C({count:s.length});V=F.onFilter({inputValue:g,resultsMessage:W})}return V},[s,g,v,F,A,C,S]),N=(n==null?void 0:n.action)==="initial-input-focus",j=p.useMemo(function(){var V="";if(F.guidance){var W=r?"value":v?"menu":"input";V=F.guidance({"aria-label":y,context:W,isDisabled:i&&h(i,u),isMulti:x,isSearchable:m,tabSelectsValue:I,isInitialFocus:N})}return V},[y,i,r,x,h,m,v,F,u,I,N]),w=X.jsx(p.Fragment,null,X.jsx("span",{id:"aria-selection"},G),X.jsx("span",{id:"aria-focused"},M),X.jsx("span",{id:"aria-results"},D),X.jsx("span",{id:"aria-guidance"},j));return X.jsx(p.Fragment,null,X.jsx(jn,{id:l},N&&w),X.jsx(jn,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!N&&w))},ka=Ma,Zt=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],La=new RegExp("["+Zt.map(function(t){return t.letters}).join("")+"]","g"),Yr={};for(var Bt=0;Bt<Zt.length;Bt++)for(var Tt=Zt[Bt],Gt=0;Gt<Tt.letters.length;Gt++)Yr[Tt.letters[Gt]]=Tt.base;var $r=function(e){return e.replace(La,function(n){return Yr[n]})},Wa=ja($r),Vn=function(e){return e.replace(/^\s+|\s+$/g,"")},Xa=function(e){return"".concat(e.label," ").concat(e.value)},za=function(e){return function(n,i){if(n.data.__isNew__)return!0;var r=L({ignoreCase:!0,ignoreAccents:!0,stringify:Xa,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,o=r.ignoreAccents,u=r.stringify,a=r.trim,l=r.matchFrom,d=a?Vn(i):i,f=a?Vn(u(n)):u(n);return s&&(d=d.toLowerCase(),f=f.toLowerCase()),o&&(d=Wa(d),f=$r(f)),l==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},Ha=["innerRef"];function Za(t){var e=t.innerRef,n=pe(t,Ha),i=bs(n,"onExited","in","enter","exit","appear");return X.jsx("input",H({ref:e},i,{css:X.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyByZW1vdmVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gRHVtbXlJbnB1dCh7XG4gIGlubmVyUmVmLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydpbnB1dCddICYge1xuICByZWFkb25seSBpbm5lclJlZjogUmVmPEhUTUxJbnB1dEVsZW1lbnQ+O1xufSkge1xuICAvLyBSZW1vdmUgYW5pbWF0aW9uIHByb3BzIG5vdCBtZWFudCBmb3IgSFRNTCBlbGVtZW50c1xuICBjb25zdCBmaWx0ZXJlZFByb3BzID0gcmVtb3ZlUHJ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dzY2FsZSguMDEpJyxcbiAgICAgIH19XG4gICAgLz5cbiAgKTtcbn1cbiJdfQ== */")}))}var _a=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Ja(t){var e=t.isEnabled,n=t.onBottomArrive,i=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,o=p.useRef(!1),u=p.useRef(!1),a=p.useRef(0),l=p.useRef(null),d=p.useCallback(function(m,v){if(l.current!==null){var A=l.current,C=A.scrollTop,I=A.scrollHeight,S=A.clientHeight,y=l.current,E=v>0,F=I-S-C,G=!1;F>v&&o.current&&(i&&i(m),o.current=!1),E&&u.current&&(s&&s(m),u.current=!1),E&&v>F?(n&&!o.current&&n(m),y.scrollTop=I,G=!0,o.current=!0):!E&&-v>C&&(r&&!u.current&&r(m),y.scrollTop=0,G=!0,u.current=!0),G&&_a(m)}},[n,i,r,s]),f=p.useCallback(function(m){d(m,m.deltaY)},[d]),b=p.useCallback(function(m){a.current=m.changedTouches[0].clientY},[]),g=p.useCallback(function(m){var v=a.current-m.changedTouches[0].clientY;d(m,v)},[d]),x=p.useCallback(function(m){if(m){var v=fs?{passive:!1}:!1;m.addEventListener("wheel",f,v),m.addEventListener("touchstart",b,v),m.addEventListener("touchmove",g,v)}},[g,b,f]),h=p.useCallback(function(m){m&&(m.removeEventListener("wheel",f,!1),m.removeEventListener("touchstart",b,!1),m.removeEventListener("touchmove",g,!1))},[g,b,f]);return p.useEffect(function(){if(e){var m=l.current;return x(m),function(){h(m)}}},[e,x,h]),function(m){l.current=m}}var Dn=["boxSizing","height","overflow","paddingRight","position"],Pn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Nn(t){t.cancelable&&t.preventDefault()}function Mn(t){t.stopPropagation()}function kn(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function Ln(){return"ontouchstart"in window||navigator.maxTouchPoints}var Wn=!!(typeof window<"u"&&window.document&&window.document.createElement),Ze=0,je={capture:!1,passive:!1};function Ya(t){var e=t.isEnabled,n=t.accountForScrollbars,i=n===void 0?!0:n,r=p.useRef({}),s=p.useRef(null),o=p.useCallback(function(a){if(Wn){var l=document.body,d=l&&l.style;if(i&&Dn.forEach(function(x){var h=d&&d[x];r.current[x]=h}),i&&Ze<1){var f=parseInt(r.current.paddingRight,10)||0,b=document.body?document.body.clientWidth:0,g=window.innerWidth-b+f||0;Object.keys(Pn).forEach(function(x){var h=Pn[x];d&&(d[x]=h)}),d&&(d.paddingRight="".concat(g,"px"))}l&&Ln()&&(l.addEventListener("touchmove",Nn,je),a&&(a.addEventListener("touchstart",kn,je),a.addEventListener("touchmove",Mn,je))),Ze+=1}},[i]),u=p.useCallback(function(a){if(Wn){var l=document.body,d=l&&l.style;Ze=Math.max(Ze-1,0),i&&Ze<1&&Dn.forEach(function(f){var b=r.current[f];d&&(d[f]=b)}),l&&Ln()&&(l.removeEventListener("touchmove",Nn,je),a&&(a.removeEventListener("touchstart",kn,je),a.removeEventListener("touchmove",Mn,je)))}},[i]);return p.useEffect(function(){if(e){var a=s.current;return o(a),function(){u(a)}}},[e,o,u]),function(a){s.current=a}}function $a(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Ua=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Qa=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvd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3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:$a};function qa(t){var e=t.children,n=t.lockEnabled,i=t.captureEnabled,r=i===void 0?!0:i,s=t.onBottomArrive,o=t.onBottomLeave,u=t.onTopArrive,a=t.onTopLeave,l=Ja({isEnabled:r,onBottomArrive:s,onBottomLeave:o,onTopArrive:u,onTopLeave:a}),d=Ya({isEnabled:n}),f=function(g){l(g),d(g)};return X.jsx(p.Fragment,null,n&&X.jsx("div",{onClick:Ua,css:Qa}),e(f))}function Ka(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var el=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:Ka},tl=function(e){var n=e.name,i=e.onFocus;return X.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:el,value:"",onChange:function(){}})},nl=tl;function gn(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function rl(){return gn(/^iPhone/i)}function Ur(){return gn(/^Mac/i)}function il(){return gn(/^iPad/i)||Ur()&&navigator.maxTouchPoints>1}function ol(){return rl()||il()}function sl(){return Ur()||ol()}var al=function(e){return e.label},Qr=function(e){return e.label},qr=function(e){return e.value},ll=function(e){return!!e.isDisabled},ul={clearIndicator:Hs,container:Gs,control:Qs,dropdownIndicator:Xs,group:ta,groupHeading:ra,indicatorsContainer:Ps,indicatorSeparator:_s,input:aa,loadingIndicator:$s,loadingMessage:Os,menu:Is,menuList:As,menuPortal:Bs,multiValue:fa,multiValueLabel:pa,multiValueRemove:ga,noOptionsMessage:Es,option:Ia,placeholder:Sa,singleValue:Ea,valueContainer:Vs},cl={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},dl=4,Kr=4,fl=38,pl=Kr*2,gl={baseUnit:Kr,controlHeight:fl,menuGutter:pl},jt={borderRadius:dl,colors:cl,spacing:gl},bl={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Bn(),captureMenuScroll:!Bn(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:za(),formatGroupLabel:al,getOptionLabel:Qr,getOptionValue:qr,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ll,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!cs(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Xn(t,e,n,i){var r=ni(t,e,n),s=ri(t,e,n),o=ti(t,e),u=mt(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:o,value:u,index:i}}function ot(t,e){return t.options.map(function(n,i){if("options"in n){var r=n.options.map(function(o,u){return Xn(t,o,e,u)}).filter(function(o){return Hn(t,o)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var s=Xn(t,n,e,i);return Hn(t,s)?s:void 0}).filter(ps)}function ei(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,Me(n.options.map(function(i){return i.data}))):e.push(n.data),e},[])}function zn(t,e){return t.reduce(function(n,i){return i.type==="group"?n.push.apply(n,Me(i.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),n},[])}function hl(t,e){return ei(ot(t,e))}function Hn(t,e){var n=t.inputValue,i=n===void 0?"":n,r=e.data,s=e.isSelected,o=e.label,u=e.value;return(!oi(t)||!s)&&ii(t,{label:o,value:u,data:r},i)}function ml(t,e){var n=t.focusedValue,i=t.selectValue,r=i.indexOf(n);if(r>-1){var s=e.indexOf(n);if(s>-1)return n;if(r<e.length)return e[r]}return null}function xl(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var Vt=function(e,n){var i,r=(i=e.find(function(s){return s.data===n}))===null||i===void 0?void 0:i.id;return r||null},ti=function(e,n){return e.getOptionLabel(n)},mt=function(e,n){return e.getOptionValue(n)};function ni(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function ri(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var i=mt(t,e);return n.some(function(r){return mt(t,r)===i})}function ii(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var oi=function(e){var n=e.hideSelectedOptions,i=e.isMulti;return n===void 0?i:n},vl=1,Ct=function(t){Go(n,t);var e=Do(n);function n(i){var r;if(Bo(this,n),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,l){var d=r.props,f=d.onChange,b=d.name;l.name=b,r.ariaOnChange(a,l),f(a,l)},r.setValue=function(a,l,d){var f=r.props,b=f.closeMenuOnSelect,g=f.isMulti,x=f.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:x}),b&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(a,{action:l,option:d})},r.selectOption=function(a){var l=r.props,d=l.blurInputOnSelect,f=l.isMulti,b=l.name,g=r.state.selectValue,x=f&&r.isOptionSelected(a,g),h=r.isOptionDisabled(a,g);if(x){var m=r.getOptionValue(a);r.setValue(g.filter(function(v){return r.getOptionValue(v)!==m}),"deselect-option",a)}else if(!h)f?r.setValue([].concat(Me(g),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:b});return}d&&r.blurInput()},r.removeValue=function(a){var l=r.props.isMulti,d=r.state.selectValue,f=r.getOptionValue(a),b=d.filter(function(x){return r.getOptionValue(x)!==f}),g=_e(l,b,b[0]||null);r.onChange(g,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(_e(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,l=r.state.selectValue,d=l[l.length-1],f=l.slice(0,l.length-1),b=_e(a,f,f[0]||null);d&&r.onChange(b,{action:"pop-value",removedValue:d})},r.getFocusedOptionId=function(a){return Vt(r.state.focusableOptionsWithIds,a)},r.getFocusableOptionsWithIds=function(){return zn(ot(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];return is.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(a){return ti(r.props,a)},r.getOptionValue=function(a){return mt(r.props,a)},r.getStyles=function(a,l){var d=r.props.unstyled,f=ul[a](l,d);f.boxSizing="border-box";var b=r.props.styles[a];return b?b(f,l):f},r.getClassNames=function(a,l){var d,f;return(d=(f=r.props.classNames)[a])===null||d===void 0?void 0:d.call(f,l)},r.getElementId=function(a){return"".concat(r.state.instancePrefix,"-").concat(a)},r.getComponents=function(){return Ba(r.props)},r.buildCategorizedOptions=function(){return ot(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return ei(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,l){r.setState({ariaSelection:L({value:a},l)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var l=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():l&&r.openMenu("first"):(l&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!r.props.isDisabled){var l=r.props,d=l.isMulti,f=l.menuIsOpen;r.focusInput(),f?(r.setState({inputIsHiddenAfterUpdate:!d}),r.onMenuClose()):r.openMenu("first"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&yt(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var l=a.touches,d=l&&l.item(0);d&&(r.initialTouchX=d.clientX,r.initialTouchY=d.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var l=a.touches,d=l&&l.item(0);if(d){var f=Math.abs(d.clientX-r.initialTouchX),b=Math.abs(d.clientY-r.initialTouchY),g=5;r.userIsDragging=f>g||b>g}},r.onTouchEnd=function(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var l=r.props.inputValue,d=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(d,{action:"input-change",prevInputValue:l}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var l=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:l}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){if(!(r.blockOptionHover||r.state.focusedOption===a)){var l=r.getFocusableOptions(),d=l.indexOf(a);r.setState({focusedOption:a,focusedOptionId:d>-1?r.getFocusedOptionId(a):null})}},r.shouldHideSelectedOptions=function(){return oi(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){var l=r.props,d=l.isMulti,f=l.backspaceRemovesValue,b=l.escapeClearsValue,g=l.inputValue,x=l.isClearable,h=l.isDisabled,m=l.menuIsOpen,v=l.onKeyDown,A=l.tabSelectsValue,C=l.openMenuOnFocus,I=r.state,S=I.focusedOption,y=I.focusedValue,E=I.selectValue;if(!h&&!(typeof v=="function"&&(v(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.key){case"ArrowLeft":if(!d||g)return;r.focusValue("previous");break;case"ArrowRight":if(!d||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(y)r.removeValue(y);else{if(!f)return;d?r.popValue():x&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!m||!A||!S||C&&r.isOptionSelected(S,E))return;r.selectOption(S);break;case"Enter":if(a.keyCode===229)break;if(m){if(!S||r.isComposing)return;r.selectOption(S);break}return;case"Escape":m?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):x&&b&&r.clearValue();break;case" ":if(g)return;if(!m){r.openMenu("first");break}if(!S)return;r.selectOption(S);break;case"ArrowUp":m?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":m?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!m)return;r.focusOption("pageup");break;case"PageDown":if(!m)return;r.focusOption("pagedown");break;case"Home":if(!m)return;r.focusOption("first");break;case"End":if(!m)return;r.focusOption("last");break;default:return}a.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++vl),r.state.selectValue=bt(i.value),i.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),u=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=o[u],r.state.focusedOptionId=Vt(s,o[u])}return r}return To(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&wn(this.menuListRef,this.focusedOptionRef),sl()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var s=this.props,o=s.isDisabled,u=s.menuIsOpen,a=this.state.isFocused;(a&&!o&&r.isDisabled||a&&u&&!r.menuIsOpen)&&this.focusInput(),a&&o&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!o&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(wn(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,o=this.state,u=o.selectValue,a=o.isFocused,l=this.buildFocusableOptions(),d=r==="first"?0:l.length-1;if(!this.props.isMulti){var f=l.indexOf(u[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[d],focusedOptionId:this.getFocusedOptionId(l[d])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,o=s.selectValue,u=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=o.indexOf(u);u||(a=-1);var l=o.length-1,d=-1;if(o.length){switch(r){case"previous":a===0?d=0:a===-1?d=l:d=a-1;break;case"next":a>-1&&a<l&&(d=a+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:o[d]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var a=0,l=u.indexOf(o);o||(l=-1),r==="up"?a=l>0?l-1:u.length-1:r==="down"?a=(l+1)%u.length:r==="pageup"?(a=l-s,a<0&&(a=0)):r==="pagedown"?(a=l+s,a>u.length-1&&(a=u.length-1)):r==="last"&&(a=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(jt):L(L({},jt),this.props.theme):jt}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,o=this.getStyles,u=this.getClassNames,a=this.getValue,l=this.selectOption,d=this.setValue,f=this.props,b=f.isMulti,g=f.isRtl,x=f.options,h=this.hasValue();return{clearValue:r,cx:s,getStyles:o,getClassNames:u,getValue:a,hasValue:h,isMulti:b,isRtl:g,options:x,selectOption:l,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,o=r.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(r,s){return ni(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return ri(this.props,r,s)}},{key:"filterOption",value:function(r,s){return ii(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:o,selectValue:u})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,o=r.isSearchable,u=r.inputId,a=r.inputValue,l=r.tabIndex,d=r.form,f=r.menuIsOpen,b=r.required,g=this.getComponents(),x=g.Input,h=this.state,m=h.inputIsHidden,v=h.ariaSelection,A=this.commonProps,C=u||this.getElementId("input"),I=L(L(L({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":b,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(v==null?void 0:v.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?$.createElement(x,H({},A,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:s,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:d,type:"text",value:a},I)):$.createElement(Za,H({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:gt,onFocus:this.onInputFocus,disabled:s,tabIndex:l,inputMode:"none",form:d,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),o=s.MultiValue,u=s.MultiValueContainer,a=s.MultiValueLabel,l=s.MultiValueRemove,d=s.SingleValue,f=s.Placeholder,b=this.commonProps,g=this.props,x=g.controlShouldRenderValue,h=g.isDisabled,m=g.isMulti,v=g.inputValue,A=g.placeholder,C=this.state,I=C.selectValue,S=C.focusedValue,y=C.isFocused;if(!this.hasValue()||!x)return v?null:$.createElement(f,H({},b,{key:"placeholder",isDisabled:h,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),A);if(m)return I.map(function(F,G){var M=F===S,D="".concat(r.getOptionLabel(F),"-").concat(r.getOptionValue(F));return $.createElement(o,H({},b,{components:{Container:u,Label:a,Remove:l},isFocused:M,isDisabled:h,key:D,index:G,removeProps:{onClick:function(){return r.removeValue(F)},onTouchEnd:function(){return r.removeValue(F)},onMouseDown:function(j){j.preventDefault()}},data:F}),r.formatOptionLabel(F,"value"))});if(v)return null;var E=I[0];return $.createElement(d,H({},b,{data:E,isDisabled:h}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,o=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,d=this.state.isFocused;if(!this.isClearable()||!s||a||!this.hasValue()||l)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(s,H({},o,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,o=this.commonProps,u=this.props,a=u.isDisabled,l=u.isLoading,d=this.state.isFocused;if(!s||!l)return null;var f={"aria-hidden":"true"};return $.createElement(s,H({},o,{innerProps:f,isDisabled:a,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,o=r.IndicatorSeparator;if(!s||!o)return null;var u=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused;return $.createElement(o,H({},u,{isDisabled:a,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var o=this.commonProps,u=this.props.isDisabled,a=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(s,H({},o,{innerProps:l,isDisabled:u,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),o=s.Group,u=s.GroupHeading,a=s.Menu,l=s.MenuList,d=s.MenuPortal,f=s.LoadingMessage,b=s.NoOptionsMessage,g=s.Option,x=this.commonProps,h=this.state.focusedOption,m=this.props,v=m.captureMenuScroll,A=m.inputValue,C=m.isLoading,I=m.loadingMessage,S=m.minMenuHeight,y=m.maxMenuHeight,E=m.menuIsOpen,F=m.menuPlacement,G=m.menuPosition,M=m.menuPortalTarget,D=m.menuShouldBlockScroll,N=m.menuShouldScrollIntoView,j=m.noOptionsMessage,w=m.onMenuScrollToTop,V=m.onMenuScrollToBottom;if(!E)return null;var W=function(z,T){var P=z.type,Z=z.data,Y=z.isDisabled,K=z.isSelected,te=z.label,me=z.value,ge=h===Z,Xe=Y?void 0:function(){return r.onOptionHover(Z)},Et=Y?void 0:function(){return r.selectOption(Z)},Qe="".concat(r.getElementId("option"),"-").concat(T),ze={id:Qe,onClick:Et,onMouseMove:Xe,onMouseOver:Xe,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:K};return $.createElement(g,H({},x,{innerProps:ze,data:Z,isDisabled:Y,isSelected:K,key:Qe,label:te,type:P,value:me,isFocused:ge,innerRef:ge?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(z.data,"menu"))},J;if(this.hasOptions())J=this.getCategorizedOptions().map(function(B){if(B.type==="group"){var z=B.data,T=B.options,P=B.index,Z="".concat(r.getElementId("group"),"-").concat(P),Y="".concat(Z,"-heading");return $.createElement(o,H({},x,{key:Z,data:z,options:T,Heading:u,headingProps:{id:Y,data:B.data},label:r.formatGroupLabel(B.data)}),B.options.map(function(K){return W(K,"".concat(P,"-").concat(K.index))}))}else if(B.type==="option")return W(B,"".concat(B.index))});else if(C){var _=I({inputValue:A});if(_===null)return null;J=$.createElement(f,x,_)}else{var ee=j({inputValue:A});if(ee===null)return null;J=$.createElement(b,x,ee)}var re={minMenuHeight:S,maxMenuHeight:y,menuPlacement:F,menuPosition:G,menuShouldScrollIntoView:N},k=$.createElement(ys,H({},x,re),function(B){var z=B.ref,T=B.placerProps,P=T.placement,Z=T.maxHeight;return $.createElement(a,H({},x,re,{innerRef:z,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:C,placement:P}),$.createElement(qa,{captureEnabled:v,onTopArrive:w,onBottomArrive:V,lockEnabled:D},function(Y){return $.createElement(l,H({},x,{innerRef:function(te){r.getMenuListRef(te),Y(te)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:r.getElementId("listbox")},isLoading:C,maxHeight:Z,focusedOption:h}),J)}))});return M||G==="fixed"?$.createElement(d,H({},x,{appendTo:M,controlElement:this.controlRef,menuPlacement:F,menuPosition:G}),k):k}},{key:"renderFormField",value:function(){var r=this,s=this.props,o=s.delimiter,u=s.isDisabled,a=s.isMulti,l=s.name,d=s.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!u)return $.createElement(nl,{name:l,onFocus:this.onValueInputFocus});if(!(!l||u))if(a)if(o){var b=f.map(function(h){return r.getOptionValue(h)}).join(o);return $.createElement("input",{name:l,type:"hidden",value:b})}else{var g=f.length>0?f.map(function(h,m){return $.createElement("input",{key:"i-".concat(m),name:l,type:"hidden",value:r.getOptionValue(h)})}):$.createElement("input",{name:l,type:"hidden",value:""});return $.createElement("div",null,g)}else{var x=f[0]?this.getOptionValue(f[0]):"";return $.createElement("input",{name:l,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,o=s.ariaSelection,u=s.focusedOption,a=s.focusedValue,l=s.isFocused,d=s.selectValue,f=this.getFocusableOptions();return $.createElement(ka,H({},r,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:u,focusedValue:a,isFocused:l,selectValue:d,focusableOptions:f,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,o=r.IndicatorsContainer,u=r.SelectContainer,a=r.ValueContainer,l=this.props,d=l.className,f=l.id,b=l.isDisabled,g=l.menuIsOpen,x=this.state.isFocused,h=this.commonProps=this.getCommonProps();return $.createElement(u,H({},h,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:b,isFocused:x}),this.renderLiveRegion(),$.createElement(s,H({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:b,isFocused:x,menuIsOpen:g}),$.createElement(a,H({},h,{isDisabled:b}),this.renderPlaceholderOrValue(),this.renderInput()),$.createElement(o,H({},h,{isDisabled:b}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var o=s.prevProps,u=s.clearFocusValueOnUpdate,a=s.inputIsHiddenAfterUpdate,l=s.ariaSelection,d=s.isFocused,f=s.prevWasFocused,b=s.instancePrefix,g=r.options,x=r.value,h=r.menuIsOpen,m=r.inputValue,v=r.isMulti,A=bt(x),C={};if(o&&(x!==o.value||g!==o.options||h!==o.menuIsOpen||m!==o.inputValue)){var I=h?hl(r,A):[],S=h?zn(ot(r,A),"".concat(b,"-option")):[],y=u?ml(s,A):null,E=xl(s,I),F=Vt(S,E);C={selectValue:A,focusedOption:E,focusedOptionId:F,focusableOptionsWithIds:S,focusedValue:y,clearFocusValueOnUpdate:!1}}var G=a!=null&&r!==o?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},M=l,D=d&&f;return d&&!D&&(M={value:_e(v,A,A[0]||null),options:A,action:"initial-input-focus"},D=!f),(l==null?void 0:l.action)==="initial-input-focus"&&(M=null),L(L(L({},C),G),{},{prevProps:r,ariaSelection:M,prevWasFocused:D})}}]),n}(p.Component);Ct.defaultProps=bl;var Il=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function bn(t){var e=t.defaultInputValue,n=e===void 0?"":e,i=t.defaultMenuIsOpen,r=i===void 0?!1:i,s=t.defaultValue,o=s===void 0?null:s,u=t.inputValue,a=t.menuIsOpen,l=t.onChange,d=t.onInputChange,f=t.onMenuClose,b=t.onMenuOpen,g=t.value,x=pe(t,Il),h=p.useState(u!==void 0?u:n),m=ie(h,2),v=m[0],A=m[1],C=p.useState(a!==void 0?a:r),I=ie(C,2),S=I[0],y=I[1],E=p.useState(g!==void 0?g:o),F=ie(E,2),G=F[0],M=F[1],D=p.useCallback(function(_,ee){typeof l=="function"&&l(_,ee),M(_)},[l]),N=p.useCallback(function(_,ee){var re;typeof d=="function"&&(re=d(_,ee)),A(re!==void 0?re:_)},[d]),j=p.useCallback(function(){typeof b=="function"&&b(),y(!0)},[b]),w=p.useCallback(function(){typeof f=="function"&&f(),y(!1)},[f]),V=u!==void 0?u:v,W=a!==void 0?a:S,J=g!==void 0?g:G;return L(L({},x),{},{inputValue:V,menuIsOpen:W,onChange:D,onInputChange:N,onMenuClose:w,onMenuOpen:j,value:J})}var yl=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function si(t){var e=t.defaultOptions,n=e===void 0?!1:e,i=t.cacheOptions,r=i===void 0?!1:i,s=t.loadOptions;t.options;var o=t.isLoading,u=o===void 0?!1:o,a=t.onInputChange,l=t.filterOption,d=l===void 0?null:l,f=pe(t,yl),b=f.inputValue,g=p.useRef(void 0),x=p.useRef(!1),h=p.useState(Array.isArray(n)?n:void 0),m=ie(h,2),v=m[0],A=m[1],C=p.useState(typeof b<"u"?b:""),I=ie(C,2),S=I[0],y=I[1],E=p.useState(n===!0),F=ie(E,2),G=F[0],M=F[1],D=p.useState(void 0),N=ie(D,2),j=N[0],w=N[1],V=p.useState([]),W=ie(V,2),J=W[0],_=W[1],ee=p.useState(!1),re=ie(ee,2),k=re[0],B=re[1],z=p.useState({}),T=ie(z,2),P=T[0],Z=T[1],Y=p.useState(void 0),K=ie(Y,2),te=K[0],me=K[1],ge=p.useState(void 0),Xe=ie(ge,2),Et=Xe[0],Qe=Xe[1];r!==Et&&(Z({}),Qe(r)),n!==te&&(A(Array.isArray(n)?n:void 0),me(n)),p.useEffect(function(){return x.current=!0,function(){x.current=!1}},[]);var ze=p.useCallback(function(He,Ge){if(!s)return Ge();var ce=s(He,Ge);ce&&typeof ce.then=="function"&&ce.then(Ge,function(){return Ge()})},[s]);p.useEffect(function(){n===!0&&ze(S,function(He){x.current&&(A(He||[]),M(!!g.current))})},[]);var Qi=p.useCallback(function(He,Ge){var ce=os(He,Ge,a);if(!ce){g.current=void 0,y(""),w(""),_([]),M(!1),B(!1);return}if(r&&P[ce])y(ce),w(ce),_(P[ce]),M(!1),B(!1);else{var Ki=g.current={};y(ce),M(!0),B(!j),ze(ce,function(Ot){x&&Ki===g.current&&(g.current=void 0,M(!1),w(ce),_(Ot||[]),B(!1),Z(Ot?L(L({},P),{},Pe({},ce,Ot)):P))})}},[r,ze,j,P,a]),qi=k?[]:S&&j?J:v||[];return L(L({},f),{},{options:qi,isLoading:G||u,onInputChange:Qi,filterOption:d})}var Cl=p.forwardRef(function(t,e){var n=si(t),i=bn(n);return $.createElement(Ct,H({ref:e},i))}),Sl=Cl,Al=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Zn=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),s=String(i.getOptionValue(n)).toLowerCase(),o=String(i.getOptionLabel(n)).toLowerCase();return s===r||o===r},Dt={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,i,r){return!(!e||n.some(function(s){return Zn(e,s,r)})||i.some(function(s){return Zn(e,s,r)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function ai(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,i=t.createOptionPosition,r=i===void 0?"last":i,s=t.formatCreateLabel,o=s===void 0?Dt.formatCreateLabel:s,u=t.isValidNewOption,a=u===void 0?Dt.isValidNewOption:u,l=t.getNewOptionData,d=l===void 0?Dt.getNewOptionData:l,f=t.onCreateOption,b=t.options,g=b===void 0?[]:b,x=t.onChange,h=pe(t,Al),m=h.getOptionValue,v=m===void 0?qr:m,A=h.getOptionLabel,C=A===void 0?Qr:A,I=h.inputValue,S=h.isLoading,y=h.isMulti,E=h.value,F=h.name,G=p.useMemo(function(){return a(I,bt(E),g,{getOptionValue:v,getOptionLabel:C})?d(I,o(I)):void 0},[o,d,C,v,I,a,g,E]),M=p.useMemo(function(){return(n||!S)&&G?r==="first"?[G].concat(Me(g)):[].concat(Me(g),[G]):g},[n,r,S,G,g]),D=p.useCallback(function(N,j){if(j.action!=="select-option")return x(N,j);var w=Array.isArray(N)?N:[N];if(w[w.length-1]===G){if(f)f(I);else{var V=d(I,I),W={action:"create-option",name:F,option:V};x(_e(y,[].concat(Me(bt(E)),[V]),V),W)}return}x(N,j)},[d,I,y,F,G,f,x,E]);return L(L({},h),{},{options:M,onChange:D})}var Rl=p.forwardRef(function(t,e){var n=bn(t),i=ai(n);return $.createElement(Ct,H({ref:e},i))}),El=Rl,Ol=p.forwardRef(function(t,e){var n=si(t),i=bn(n),r=ai(i);return $.createElement(Ct,H({ref:e},r))}),Fl=Ol;function li({field:t,fieldId:e,value:n,onChange:i,onBlur:r,error:s,helperText:o,formulaConfig:u,onFormulaConfigChange:a,renderNative:l}){const d=t.formula===!0,f=Le(),b=p.useRef(null),[g,x]=p.useState(()=>d&&(t.formula===!0||e in(u??{}))),h=p.useRef(g);h.current=g,p.useEffect(()=>{if(!(!d||!f))return h.current&&f.notifyFormulaToggle(!0),()=>{h.current&&f.notifyFormulaToggle(!1)}},[]);const m=g,[v,A]=p.useState(()=>d&&g?Ae(String(n??""),!0):[]),C=p.useRef(n),I=y=>{A(y);const E=m?$e(y):Re(y);C.current=E,i(E)},S=p.useCallback(()=>{const y=!g;if(x(y),f==null||f.notifyFormulaToggle(y,y?b.current:null),y){const E=String(n??""),F=Ae(E,!0);A(F);const G=$e(F);C.current=G,i(G),a==null||a({...u,[e]:tn()})}else{const E=Re(v);C.current=E,i(E);const F={...u};delete F[e],a==null||a(F),A([])}},[g,f,n,v,u,e,a,i]);return d?c.jsxs("div",{children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info,htmlFor:e,dataTestId:t.dataTestId}),c.jsx(R.Tooltip,{title:g?"Use static value (dropdown)":"Use dynamic formula expression",placement:"top",children:c.jsxs(R.Box,{component:"button",type:"button",ref:b,onClick:S,sx:{border:"none",cursor:"pointer",mb:"4px",display:"inline-flex",alignItems:"center",gap:.4,px:g?.75:.5,py:.25,borderRadius:"4px",fontSize:11,fontWeight:600,lineHeight:1,color:g?"#7c4dff":"#94a3b8",bgcolor:g?"#ede9fe":"transparent",transition:"all 0.15s","&:hover":{bgcolor:"#ede9fe",color:"#7c4dff"},flexShrink:0},children:[c.jsx(U.MdDataObject,{size:14}),g&&"Formula"]})})]}),o&&c.jsx("small",{style:oe,children:o}),g?c.jsx(un,{id:e,expression:v,onExpressionChange:I,onBlur:r,placeholder:t.formulaPlaceholder??"Type or paste a variable expression...",disabled:t.disabled===!0,error:s,formulaConfigEnabled:m}):l()]}):c.jsxs("div",{children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info,htmlFor:e,dataTestId:t.dataTestId}),o&&c.jsx("small",{style:oe,children:o}),l()]})}const hn=p.createContext({resolvers:{},invalidate:()=>{}}),ui=Symbol("options-cache");function ci({resolvers:t,children:e}){const n=p.useRef(new Map),i=p.useRef(new Map),r=p.useCallback((o,u)=>{const a=n.current.get(o);a&&(u==null?a.clear():a.delete(u))},[]),s=p.useMemo(()=>({resolvers:t??{},invalidate:r,[ui]:{cacheRef:n,inFlightRef:i}}),[t,r]);return c.jsx(hn.Provider,{value:s,children:e})}function wl(t,e,n){const i={...n??{}};if(!t)return i;if(Array.isArray(t))for(const r of t)i[r]=e==null?void 0:e[r];else for(const[r,s]of Object.entries(t))i[r]=e==null?void 0:e[s];return i}function _n(t){if(t==null)return"";if(typeof t!="object")return String(t);const e=Object.keys(t).sort();return JSON.stringify(e.reduce((n,i)=>(n[i]=t[i],n),{}))}function di({source:t,values:e}){const n=p.useContext(hn),i=n[ui],r=t==null?void 0:t.id,s=r?n.resolvers[r]:void 0,o=p.useMemo(()=>t?wl(t.dependsOn,e,t.params):{},[t,...Object.values(e??{})]),u=p.useMemo(()=>_n(o),[o]),a=p.useRef(null);p.useEffect(()=>()=>{var g;return(g=a.current)==null?void 0:g.abort()},[u]);const l=p.useCallback(async(g,x)=>{var G;if(!r||!s||!i)return{options:[]};const h=`${_n(g)}|${x??""}`,m=i.cacheRef.current.get(r)??new Map;i.cacheRef.current.set(r,m);const v=m.get(u)??new Map;m.set(u,v);const A=v.get(h);if(A)return A;const C=i.inFlightRef.current.get(r)??new Map;i.inFlightRef.current.set(r,C);const I=C.get(u)??new Map;C.set(u,I);const S=I.get(h);if(S)return S;(G=a.current)==null||G.abort();const y=new AbortController;a.current=y;const E={cursor:g,input:x,values:e,signal:y.signal},F=Promise.resolve().then(()=>s(o,E)).then(M=>(v.set(h,M),I.delete(h),M)).catch(M=>{throw I.delete(h),M});return I.set(h,F),F},[s,r,o,u,i,e]),d=p.useCallback(async g=>s?(await l(void 0,g)).options:[],[s,l]),f=p.useCallback(async g=>{if(!s)return[];if(t!=null&&t.resolveValueId){const m=n.resolvers[t.resolveValueId];if(m)return(await m({...o,ids:g},{values:e})).options}const x=await l(void 0),h=g.map(m=>String(m));return x.options.filter(m=>h.includes(String(m.value)))},[s,l,t==null?void 0:t.resolveValueId,n.resolvers,o,e]),b=p.useCallback(()=>{r&&n.invalidate(r,u)},[n,r,u]);return{enabled:!!s,loadOptions:s?d:void 0,loadValue:s?f:void 0,depsKey:u,refresh:b}}function Bl(){return p.useContext(hn)}function Tl({field:t,value:e,values:n,onChange:i,onBlur:r,error:s,touched:o,formulaConfig:u,onFormulaConfigChange:a}){var j;const l=t,d=!!(o&&s),f=l.disabled===!0,b=w=>l.getOptionValue?l.getOptionValue(w):w.value??w.id,g=p.useMemo(()=>(l.options??[]).map(w=>({...w,value:b(w)})),[l.options]),x=di({source:l.optionsSource,values:n}),h=l.loadOptions??(x.enabled?x.loadOptions:void 0),m=l.loadValue??(x.enabled?x.loadValue:void 0),[v,A]=p.useState(0),C=((j=l.dependsOn)==null?void 0:j.map(w=>n[w]))??[];p.useEffect(()=>{var w;(w=l.dependsOn)!=null&&w.length&&A(V=>V+1)},C),p.useEffect(()=>{x.enabled&&A(w=>w+1)},[x.depsKey]);const I=!!h,[S,y]=p.useState(null),E=p.useRef(!1);p.useEffect(()=>{if(!I||E.current||e==null||e===""||Array.isArray(e)&&e.length===0)return;const w=Array.isArray(e)?e:[e];E.current=!0,(m?m(w):h("").then(W=>W.filter(J=>w.some(_=>String(b(J))===String(_))))).then(W=>{W.length!==0&&y(l.isMulti?W:W[0])}).catch(()=>{E.current=!1})},[I,e]);const F=p.useMemo(()=>{if(e==null||e==="")return l.isMulti?[]:null;if(I)return S;if(l.isMulti){const w=Array.isArray(e)?e:[e];return g.filter(V=>w.includes(b(V)))}return g.find(w=>String(b(w))===String(e))??null},[e,g,l.isMulti,I,S]),G=w=>(I&&y(w),w?l.isMulti?i(w.map(b)):i(b(w)):i(l.isMulti?[]:null)),M={inputId:l.id??l.name,name:l.id??l.name,placeholder:l.placeholder??"Select...",isDisabled:f,isMulti:l.isMulti??!1,isSearchable:l.isSearchable??!0,isClearable:l.isClearable??!1,value:F,onChange:G,onBlur:r,styles:en(d,l.isMulti),menuPortalTarget:typeof document<"u"?document.body:void 0,menuPosition:"fixed",classNamePrefix:"ff-select","data-testid":l.dataTestId??`${l.name}-select`,...l.getOptionLabel?{getOptionLabel:l.getOptionLabel}:{}},D=()=>{const w=!!h,V=l.isCreatable??!1;return w&&V?c.jsx(Fl,{loadOptions:h,defaultOptions:!0,cacheOptions:!0,...M},v):w?c.jsx(Sl,{loadOptions:h,defaultOptions:!0,cacheOptions:!0,...M},v):V?c.jsx(El,{options:g,...M}):c.jsx(ke,{options:g,...M})},N=l.id??l.name??"";return c.jsx(li,{field:l,fieldId:N,value:e,onChange:i,onBlur:r,error:d,helperText:l.helperText,formulaConfig:u,onFormulaConfigChange:a,renderNative:()=>c.jsxs(c.Fragment,{children:[D(),d&&c.jsx("small",{"data-testid":`${l.name}-error`,style:ae,children:s})]})})}const Gl={fontSize:14,fontWeight:500,lineHeight:1.35,overflowWrap:"anywhere"},jl={fontSize:12,lineHeight:1.45,marginTop:3,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflowWrap:"anywhere"},Vl=t=>{const{data:e,isSelected:n,isDisabled:i}=t;return c.jsx(ke.components.Option,{...t,children:c.jsxs("div",{className:"ff-form-d-flex ff-form-align-start ff-form-justify-between ff-form-w-100",title:i?e.disabledReason??"Coming soon":void 0,children:[c.jsxs("div",{className:"ff-form-d-flex ff-form-align-start ff-form-gap-2 ff-form-flex-grow-1",style:{minWidth:0},children:[e.icon&&c.jsx("div",{className:"ff-form-mt-1 ff-form-flex-shrink-0 ff-form-d-flex ff-form-align-center",style:{fontSize:18,opacity:i?.65:1,filter:i?"grayscale(0.45)":"none"},children:e.icon}),c.jsxs("div",{className:"ff-form-flex-grow-1",style:{minWidth:0},children:[c.jsx("div",{className:"ff-form-text-14",style:{...Gl,color:i?"#7f8790":"#212529"},title:e.label,children:e.label}),e.description&&c.jsx("div",{className:"ff-form-text-12",style:{...jl,color:i?"#9198a1":"#6c757d"},title:e.description,children:e.description})]})]}),n&&c.jsx(U.MdCheckCircle,{size:16,className:"ff-form-ms-2 ff-form-mt-1 ff-form-text-primary ff-form-flex-shrink-0"})]})})},Dl=t=>{const{data:e}=t;return c.jsx(ke.components.SingleValue,{...t,children:c.jsxs("div",{className:"ff-form-d-flex ff-form-align-center ff-form-gap-2 ff-form-text-dark ff-form-w-100",title:e.label,children:[e.icon&&c.jsx("div",{className:"ff-form-d-flex ff-form-align-center ff-form-flex-shrink-0",style:{fontSize:16},children:e.icon}),c.jsx("span",{className:"ff-form-text-14 ff-form-fw-medium",style:{lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})]})})},Pl=t=>({control:(e,n)=>({...e,minHeight:38,height:38,fontSize:14,borderRadius:6,borderColor:t?"#dc3545":n.isFocused?"#86b7fe":"#ced4da",boxShadow:n.isFocused?t?"0 0 0 3px rgba(220,53,69,0.18)":"0 0 0 3px rgba(13,110,253,0.18)":"none",transition:"border-color 0.15s, box-shadow 0.15s","&:hover":{borderColor:t?"#dc3545":"#adb5bd"}}),valueContainer:e=>({...e,paddingTop:1,paddingBottom:1,gap:4}),option:(e,n)=>({...e,backgroundColor:n.isDisabled?"#f6f7f9":n.isSelected?"#e8f4fd":n.isFocused?"#f8f9fa":"#fff",padding:"10px 12px",cursor:n.isDisabled?"not-allowed":"pointer",color:n.isDisabled?"#8f98a3":e.color,borderBottom:"1px solid #f1f1f1","&:active":{backgroundColor:n.isDisabled?"#f6f7f9":"#e9ecef"},"&:last-child":{borderBottom:"none"}}),singleValue:e=>({...e,maxWidth:"calc(100% - 8px)",color:"#111827"}),multiValue:e=>({...e,maxWidth:"100%",backgroundColor:"#eef2ff",borderRadius:6}),multiValueLabel:e=>({...e,fontSize:12,lineHeight:1.35,color:"#3730a3",paddingTop:3,paddingBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:180}),multiValueRemove:e=>({...e,color:"#6366f1",":hover":{backgroundColor:"#c7d2fe",color:"#3730a3"}}),menu:e=>({...e,zIndex:9999}),menuPortal:e=>({...e,zIndex:9999}),placeholder:e=>({...e,color:"#9ca3af",fontSize:14}),noOptionsMessage:e=>({...e,fontSize:12,color:"#6b7280"})});function Nl({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s,formulaConfig:o,onFormulaConfigChange:u}){const a=!!(s&&r),l=t.isMulti??!1,d=t.id??t.name??"",f=p.useMemo(()=>(t.options??[]).map(v=>({...v,value:v.id??v.value})),[t.options]),b=Array.isArray(e)?e:e!=null?[e]:[],g=p.useMemo(()=>new Set(b.map(v=>String(v))),[b]),x=p.useMemo(()=>l?f.filter(v=>g.has(String(v.value??""))):f.find(v=>String(v.value??"")===String(e??""))??null,[l,f,e,g]),h=v=>{if(l){const C=v;n(C==null?[]:C.map(I=>I.value));return}const A=v;n(A==null?null:A.value)},m=c.jsxs(c.Fragment,{children:[c.jsx(ke,{inputId:d,value:x,onChange:h,onBlur:i,options:f,placeholder:t.placeholder??"Select option...",isMulti:l,isDisabled:t.disabled??!1,isOptionDisabled:v=>!!v.isDisabled,isSearchable:!0,styles:Pl(a),components:{Option:Vl,SingleValue:Dl},menuPortalTarget:typeof document<"u"?document.body:void 0,menuPosition:"fixed",classNamePrefix:"ff-select"}),a&&c.jsx("small",{"data-testid":`${d}-error`,style:{display:"flex",color:"#dc3545",fontSize:12,marginTop:4,lineHeight:1.4},children:r})]});return c.jsx("div",{className:`${t.customClass??""} ${t.hidden?"ff-form-hidden":""}`,children:c.jsx(li,{field:t,fieldId:d,value:e,onChange:n,onBlur:i,error:a,helperText:t.helperText,formulaConfig:o,onFormulaConfigChange:u,renderNative:()=>m})})}const Ie="__id";let Ml=0;function Ee(){return`af_${++Ml}_${Math.random().toString(36).slice(2,7)}`}function Pt(t){return t.map(e=>{if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const n=e;return n[Ie]?e:{...n,[Ie]:Ee()}}return e!==null&&typeof e!="object"?{[Ie]:Ee(),__value:e}:e})}function Nt(t){return t.map(e=>{if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const{[Ie]:n,__value:i,...r}=e;return i!==void 0&&Object.keys(r).length===0?i:r}return e})}function Mt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?String(t[Ie]??Ee()):Ee()}function fi(t){return Object.fromEntries(t.map(e=>{const n=e.id??e.name??"";return e.type==="object"&&e.children?[n,fi(e.children)]:e.type==="array"?[n,[]]:[n,""]}))}function kl(t,e){const n=t==="object"&&e?fi(e):t==="array"?[]:"";return n!==null&&typeof n=="object"&&!Array.isArray(n)?{...n,[Ie]:Ee()}:n}function nt(t){return Array.isArray(t)?t:[]}function Ll(t){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){const e=t;if("__value"in e)return e.__value;const{[Ie]:n,...i}=e;return i}return t}function Wl({value:t,onChange:e,inputType:n="text",placeholder:i,disabled:r}){return c.jsx(R.TextField,{size:"small",fullWidth:!0,type:n,value:String(t??""),onChange:s=>e(s.target.value),placeholder:i,disabled:r,sx:{"& .MuiInputBase-input":{fontSize:13}}})}function Xl({value:t,onChange:e,options:n,disabled:i}){return c.jsxs(R.Select,{size:"small",fullWidth:!0,value:String(t??""),onChange:r=>e(r.target.value),disabled:i,displayEmpty:!0,sx:{fontSize:13,".MuiSelect-select":{py:"8px"}},children:[c.jsx(R.MenuItem,{value:"",disabled:!0,sx:{fontSize:13},children:"Select…"}),n.map(r=>c.jsx(R.MenuItem,{value:r.value,sx:{fontSize:13},children:r.label},r.value))]})}function pi({fields:t,value:e,onChange:n,disabled:i,depth:r=0}){return c.jsx(R.Box,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:t.map(s=>{const o=s.id??s.name??"",u=s.colSpan??Math.max(2,Math.floor(12/t.length)),a=`${Math.round(u/12*100)}%`;return c.jsxs(R.Box,{sx:{flex:`0 0 calc(${a} - 8px)`,minWidth:100},children:[s.label&&c.jsxs(R.Typography,{sx:{fontSize:11,color:"#64748b",mb:.25,fontWeight:500},children:[s.label,s.required&&c.jsx("span",{style:{color:"#ef4444"},children:" *"})]}),s.type==="object"&&s.children?c.jsx(R.Box,{sx:{border:"1px solid #e2e8f0",borderRadius:"6px",p:1,bgcolor:r%2===0?"#f8fafc":"#fff"},children:c.jsx(pi,{fields:s.children,value:e[o]??{},onChange:l=>n({...e,[o]:l}),disabled:i,depth:r+1})}):s.type==="array"?c.jsx(St,{field:{...s,id:o,disabled:i??s.disabled},value:e[o],values:{},onChange:l=>n({...e,[o]:l}),onBlur:()=>{}}):s.type==="select"?c.jsxs(R.Select,{size:"small",fullWidth:!0,value:String(e[o]??""),onChange:l=>n({...e,[o]:l.target.value}),disabled:i,displayEmpty:!0,sx:{fontSize:13,".MuiSelect-select":{py:"8px"}},children:[c.jsx(R.MenuItem,{value:"",disabled:!0,sx:{fontSize:13},children:"Select…"}),(s.itemOptions??[]).map(l=>c.jsx(R.MenuItem,{value:l.value,sx:{fontSize:13},children:l.label},l.value))]}):c.jsx(R.TextField,{size:"small",fullWidth:!0,type:s.inputType??(s.type==="number"?"number":"text"),value:String(e[o]??""),onChange:l=>n({...e,[o]:l.target.value}),placeholder:s.placeholder,disabled:i,sx:{"& .MuiInputBase-input":{fontSize:13}}})]},o)})})}function gi({index:t,itemLabel:e,canRemove:n,onRemove:i,children:r}){return c.jsxs(R.Box,{sx:{position:"relative",px:2,pt:1.75,pb:1.5,bgcolor:"#fff",border:"1px solid #e2e8f0",borderRadius:"8px",mb:1.5,"& .ff-form-mb-4:last-of-type":{marginBottom:"0 !important"}},children:[e&&c.jsxs(R.Box,{component:"span",sx:{display:"inline-block",fontSize:11,fontWeight:600,color:"#475569",bgcolor:"#e2e8f0",px:1,py:"2px",borderRadius:"6px",mb:1.5,textTransform:"uppercase",letterSpacing:.5},children:[e," ",t+1]}),r,c.jsx(R.Tooltip,{title:"Remove",children:c.jsx("span",{style:{position:"absolute",top:10,right:10},children:c.jsx(R.IconButton,{size:"small",disabled:!n,onClick:i,sx:{cursor:n?"pointer":"not-allowed",p:"4px"},children:c.jsx(U.MdClose,{size:16,color:n?"#64748b":"#e2e8f0"})})})})]})}function bi(t){const e={};for(const n of t){const i=n.id??n.name??"";i&&(n.type==="object"&&Array.isArray(n.children)?e[i]=bi(n.children):n.type==="array"?e[i]=[]:e[i]="")}return e}function zl({field:t,pathPrefix:e,childFields:n,items:i,values:r,errors:s,touched:o,setFieldValue:u,setFieldTouched:a,depth:l,compact:d,renderFieldRouter:f,disabled:b,minItems:g,maxItems:x}){const[h,m]=p.useState(()=>i.map(()=>Ee()));p.useEffect(()=>{h.length!==i.length&&m(I=>i.length>I.length?[...I,...Array.from({length:i.length-I.length},()=>Ee())]:I.slice(0,i.length))},[i.length]);const v=p.useCallback(()=>{i.length>=x||(u(e,[...i,bi(n)]),m(I=>[...I,Ee()]))},[i,x,u,e,n]),A=p.useCallback(I=>{i.length<=g||(u(e,i.filter((S,y)=>y!==I)),m(S=>S.filter((y,E)=>E!==I)))},[i,g,u,e]),C=t;return c.jsxs(R.Box,{children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info,htmlFor:t.id}),t.helperText&&c.jsx(R.Typography,{sx:{fontSize:12,color:"#6c757d",mb:.75},children:t.helperText}),i.length===0&&c.jsx(R.Box,{sx:{py:2.5,textAlign:"center",border:"1.5px dashed #e2e8f0",borderRadius:"8px",mb:1,color:"#94a3b8",fontSize:13},children:"No items yet — click Add to start"}),i.map((I,S)=>c.jsx(gi,{index:S,itemLabel:C.itemLabel,canRemove:i.length>g&&!b,onRemove:()=>A(S),children:c.jsx(R.Box,{children:n.map(y=>{const E=y.id??y.name??"",F=`${e}.${S}.${E}`;return f({field:y,pathPrefix:F,depth:l+1,values:r,errors:s,touched:o,setFieldValue:u,setFieldTouched:a,item:I&&typeof I=="object"?I:void 0,compact:!1,inlineLabel:!1})})})},h[S]??S)),i.length>0&&c.jsx(R.Divider,{sx:{mb:1,borderColor:"transparent"}}),i.length<x&&c.jsxs(R.Box,{component:"button",type:"button",onClick:v,disabled:b,sx:{display:"inline-flex",alignItems:"center",gap:.5,border:"1px dashed #cbd5e1",borderRadius:"6px",background:"none",cursor:b?"not-allowed":"pointer",px:1.5,py:.6,fontSize:12.5,color:"#6366f1",opacity:b?.5:1,"&:hover:not(:disabled)":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[c.jsx(U.MdAdd,{size:14}),C.addLabel??`Add ${C.itemLabel??"item"}`]})]})}function St(t){const{field:e,value:n,onChange:i,pathPrefix:r,values:s,parentErrors:o,parentTouched:u,parentSetFieldValue:a,parentSetFieldTouched:l,depth:d=0,compact:f,renderFieldRouter:b}=t,g=e,x=e.disabled===!0,h=g.itemType??"text",m=g.minItems??0,v=g.maxItems??1/0,A=e.children??g.itemFields;if(!!b&&typeof r=="string"&&Array.isArray(A)&&A.length>0)return c.jsx(zl,{field:e,pathPrefix:r,childFields:A,items:nt(n),values:s??{},errors:o??{},touched:u??{},setFieldValue:a??(()=>{}),setFieldTouched:l??(()=>{}),depth:d,compact:f,renderFieldRouter:b,disabled:x,minItems:m,maxItems:v});const[I,S]=p.useState(()=>Pt(nt(n))),y=p.useRef(JSON.stringify(Nt(I)));p.useEffect(()=>{if(JSON.stringify(nt(n))!==y.current){const N=Pt(nt(n));S(N),y.current=JSON.stringify(Nt(N))}},[n]);const E=p.useCallback(D=>{const N=Pt(D);S(N);const j=Nt(N);y.current=JSON.stringify(j),i(j)},[i]),F=p.useCallback(()=>{I.length>=v||E([...I,kl(h,g.itemFields)])},[I,h,g.itemFields,v,E]),G=p.useCallback(D=>{I.length<=m||E(I.filter(N=>Mt(N)!==D))},[I,m,E]),M=p.useCallback((D,N)=>{E(I.map(j=>Mt(j)!==D?j:N!==null&&typeof N=="object"&&!Array.isArray(N)?{...N,[Ie]:D}:{[Ie]:D,__value:N}))},[I,E]);return c.jsxs(R.Box,{children:[c.jsx(se,{label:e.label,required:e.required,showOptional:e.showOptional,info:e.info,htmlFor:e.id}),e.helperText&&c.jsx(R.Typography,{sx:{fontSize:12,color:"#6c757d",mb:.75},children:e.helperText}),I.length===0&&c.jsx(R.Box,{sx:{py:2.5,textAlign:"center",border:"1.5px dashed #e2e8f0",borderRadius:"8px",mb:1,color:"#94a3b8",fontSize:13},children:"No items yet — click Add to start"}),I.map((D,N)=>{const j=Mt(D),w=Ll(D);return c.jsx(gi,{index:N,itemLabel:g.itemLabel,canRemove:I.length>m&&!x,onRemove:()=>G(j),children:h==="object"&&g.itemFields?c.jsx(pi,{fields:g.itemFields,value:w??{},onChange:V=>M(j,V),disabled:x}):h==="select"?c.jsx(Xl,{value:w,onChange:V=>M(j,V),options:g.itemOptions??[],disabled:x}):h==="array"?c.jsx(St,{field:{...g.itemSchema,id:`${e.id}-${j}`,type:"array",label:void 0},value:w,values:{},onChange:V=>M(j,V),onBlur:()=>{}}):c.jsx(Wl,{value:w,onChange:V=>M(j,h==="number"?V===""?"":Number(V):V),inputType:h,placeholder:g.itemPlaceholder,disabled:x})},j)}),I.length>0&&c.jsx(R.Divider,{sx:{mb:1,borderColor:"transparent"}}),I.length<v&&c.jsxs(R.Box,{component:"button",type:"button",onClick:F,disabled:x,sx:{display:"inline-flex",alignItems:"center",gap:.5,border:"1px dashed #cbd5e1",borderRadius:"6px",background:"none",cursor:x?"not-allowed":"pointer",px:1.5,py:.6,fontSize:12.5,color:"#6366f1",opacity:x?.5:1,"&:hover:not(:disabled)":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[c.jsx(U.MdAdd,{size:14}),g.addLabel??`Add ${g.itemLabel??"item"}`]})]})}function Hl(t){return`ff-form-col-${t}`}function Je({field:t,children:e,compact:n}){const i=typeof t.colSpan=="number"?t.colSpan:12;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:[Hl(i),n?"ff-form-mb-0":"ff-form-mb-4",t.hidden?"ff-form-hidden":""].filter(Boolean).join(" "),children:e}),t.dividerAfter&&c.jsx("div",{className:"ff-form-col-12",children:c.jsx("hr",{className:"ff-form-divider"})})]})}function Jn(t,e){const n={};for(const i of t){const r=i.id??i.name??"";r&&(r in e?n[r]=e[r]:i.type==="array"?n[r]=[]:i.type==="object"||i.type==="schema"?n[r]={}:n[r]="")}return n}function Zl({field:t,value:e,allValues:n,onChange:i,onBlur:r}){const s=q.get(t.type);return s?c.jsx(Je,{field:t,children:c.jsx(s,{field:t,value:e,values:n,onChange:i,onBlur:r})}):null}function _l({field:t,value:e,onChange:n,onBlur:i}){const r=t.children??[],s=e??{},o=Jn(r,s),u=p.useRef(s);u.current=s;function a(l,d){const b={...Jn(r,u.current),[l]:d};u.current=b,n(b)}return c.jsxs(R.Box,{children:[c.jsx(se,{label:t.label,required:t.required,showOptional:t.showOptional,info:t.info}),t.helperText&&c.jsx(R.Typography,{sx:{fontSize:12,color:"#6c757d",mb:.75},children:t.helperText}),r.length===0?c.jsx(R.Box,{sx:{py:2.5,textAlign:"center",border:"1.5px dashed #e2e8f0",borderRadius:"8px",color:"#94a3b8",fontSize:13},children:"No child fields defined — edit this field to add them"}):c.jsx(R.Box,{sx:{border:"1px solid #e2e8f0",borderRadius:"8px",p:2,bgcolor:"#fafafa"},children:c.jsx("div",{className:"ff-form-row",children:r.map(l=>{const d=l.id??l.name??"";return d?c.jsx(Zl,{field:l,value:o[d],allValues:o,onChange:f=>a(d,f),onBlur:i},d):null})})})]})}function Jl({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>e==null||e===""?"":String(e)),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(e==null||e===""?"":String(e)))},[e]);const g=!!o.prefix,x=!!o.suffix,h=g||x,m={flex:1,border:"none",outline:"none",backgroundColor:"transparent",fontSize:14,color:"#374151",padding:"6px 12px",cursor:l?"not-allowed":void 0,boxSizing:"border-box",lineHeight:1.5,width:"100%",appearance:"none",MozAppearance:"textfield"},v={display:"flex",alignItems:"stretch",width:"100%",border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff",boxSizing:"border-box",transition:"border-color .15s, box-shadow .15s"},A={display:"flex",alignItems:"center",padding:"0 10px",color:"#6b7280",fontSize:13,whiteSpace:"nowrap",flexShrink:0,borderLeft:x?"1px solid rgba(0,0,0,0.1)":void 0,borderRight:g?"1px solid rgba(0,0,0,0.1)":void 0},C=S=>{S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,S.currentTarget.style.boxShadow=a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},I=S=>{S.currentTarget.contains(S.relatedTarget)||(S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,S.currentTarget.style.boxShadow="none",i())};return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{style:h?v:void 0,onFocus:h?C:void 0,onBlur:h?I:void 0,children:[g&&c.jsx("span",{style:A,children:o.prefix}),c.jsx("input",{id:u,name:u,type:"number",min:o.min,max:o.max,step:o.step??1,disabled:l,readOnly:o.readOnly,placeholder:o.placeholder??"",value:d,"data-testid":o.dataTestId??`${u}-input`,style:h?m:{...m,border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff"},onChange:S=>{const y=S.target.value;f(y);const E=y===""?null:Number(y);b.current=E,n(E)},onFocus:h?void 0:S=>{S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,S.currentTarget.style.boxShadow=a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:h?void 0:S=>{S.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,S.currentTarget.style.boxShadow="none",i()}}),x&&c.jsx("span",{style:{...A,borderRight:void 0},children:o.suffix})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Yl({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=!!e,f=c.jsx(R.FormControlLabel,{control:c.jsx(R.Switch,{id:u,name:u,checked:d,onChange:b=>{n(b.target.checked)},onBlur:i,disabled:l,color:o.color??"primary",inputProps:{"aria-label":o.ariaLabel??(typeof o.label=="string"?o.label:void 0),"aria-describedby":o.ariaDescribedBy,"data-testid":o.dataTestId??`${u}-input`}}),label:o.label?c.jsx("span",{style:{fontSize:14,color:l?"#9ca3af":"#374151",fontWeight:500},children:o.label}):void 0,sx:{m:0}});return c.jsxs("div",{children:[f,o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function $l({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=e!=null?String(e):"";return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx(R.RadioGroup,{id:u,name:u,value:d,onChange:f=>{n(f.target.value)},onBlur:i,row:o.row,children:(o.options??[]).map(f=>c.jsx(R.FormControlLabel,{value:f.value,control:c.jsx(R.Radio,{disabled:l||f.disabled,color:o.color??"primary",inputProps:{"data-testid":o.dataTestId?`${o.dataTestId}-opt-${f.value}`:`${u}-opt-${f.value}`}}),label:c.jsx("span",{style:{fontSize:14,color:l||f.disabled?"#9ca3af":"#374151"},children:f.label}),sx:{mr:o.row?3:0}},String(f.value)))}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function mn({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=o.inputType==="datetime"?"datetime-local":o.inputType==="time"?"time":"date",[f,b]=p.useState(()=>String(e??"")),g=p.useRef(e);p.useEffect(()=>{e!==g.current&&(g.current=e,b(String(e??"")))},[e]);const x={width:"100%",fontSize:14,color:"#374151",backgroundColor:l?"#f9fafb":"#fff",border:`1px solid ${a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,outline:"none",padding:"6px 12px",boxSizing:"border-box",lineHeight:1.5,cursor:l?"not-allowed":void 0};return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("input",{id:u,name:u,type:d,style:x,value:f,min:o.min,max:o.max,disabled:l,readOnly:o.readOnly,"data-testid":o.dataTestId??`${u}-input`,onChange:h=>{b(h.target.value),g.current=h.target.value,n(h.target.value)},onBlur:i,onFocus:h=>{h.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR_FOCUS,h.currentTarget.style.boxShadow=a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW},onBlurCapture:h=>{h.currentTarget.style.borderColor=a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR,h.currentTarget.style.boxShadow="none"}}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Ul({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=Array.isArray(e)?e:[],[f,b]=p.useState(""),[g,x]=p.useState(!1),h=p.useRef(null),m=I=>{const S=I.trim();!S||d.includes(S)||o.maxTags&&d.length>=o.maxTags||(n([...d,S]),b(""))},v=I=>{n(d.filter((S,y)=>y!==I))},A=a?O.BORDER_COLOR_ERROR:g?O.BORDER_COLOR_FOCUS:O.BORDER_COLOR,C=g?a?O.FOCUS_SHADOW_ERROR:O.FOCUS_SHADOW:"none";return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{onClick:()=>{var I;return(I=h.current)==null?void 0:I.focus()},style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,minHeight:38,padding:"4px 8px",border:`1px solid ${A}`,borderRadius:O.BORDER_RADIUS,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff",boxShadow:C,boxSizing:"border-box",cursor:l?"not-allowed":"text",transition:"border-color .15s, box-shadow .15s"},children:[d.map((I,S)=>c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"#ede9fe",color:"#5b21b6",border:"1px solid #ddd6fe",borderRadius:4,padding:"1px 6px",fontSize:13,fontWeight:500,lineHeight:1.6},children:[I,!l&&c.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),v(S)},style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",color:"#7c3aed"},children:c.jsx(U.MdClose,{size:12})})]},I)),c.jsx("input",{ref:h,id:u,value:f,disabled:l,placeholder:d.length===0?o.placeholder??"Type and press Enter...":"","data-testid":o.dataTestId??`${u}-input`,style:{flex:1,minWidth:80,border:"none",outline:"none",fontSize:14,color:"#374151",backgroundColor:"transparent",padding:"2px 4px",cursor:l?"not-allowed":void 0},onChange:I=>b(I.target.value),onKeyDown:I=>{(I.key==="Enter"||I.key===",")&&(I.preventDefault(),m(f)),I.key==="Backspace"&&!f&&d.length>0&&v(d.length-1)},onFocus:()=>x(!0),onBlur:()=>{x(!1),f.trim()&&m(f),i()}})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Ql({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=o.min??0,f=o.max??100,b=o.step??1,[g,x]=p.useState(()=>typeof e=="number"?e:d),h=p.useRef(e);return p.useEffect(()=>{e!==h.current&&(h.current=e,x(typeof e=="number"?e:d))},[e,d]),c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,px:1},children:[c.jsx(R.Slider,{id:u,value:g,min:d,max:f,step:b,disabled:l,marks:o.marks,onChange:(m,v)=>{const A=Array.isArray(v)?v[0]:v;x(A),h.current=A,n(A)},onChangeCommitted:()=>i(),sx:{color:a?"#d32f2f":"#6366f1",flex:1},"data-testid":o.dataTestId??`${u}-input`}),o.showValue!==!1&&c.jsx("span",{style:{fontSize:13,fontWeight:600,color:"#374151",minWidth:36,textAlign:"right"},children:g})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function ql({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>String(e??"#6366f1")),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(String(e??"#6366f1")))},[e]);const g=x=>{f(x),b.current=x,n(x)};return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsxs("div",{style:{width:O.INPUT_HEIGHT,height:O.INPUT_HEIGHT,borderRadius:O.BORDER_RADIUS,border:a?O.BORDER_ERROR:O.BORDER,overflow:"hidden",flexShrink:0,cursor:l?"not-allowed":"pointer",position:"relative"},children:[c.jsx("input",{type:"color",id:u,value:d,disabled:l,"data-testid":o.dataTestId??`${u}-input`,onChange:x=>g(x.target.value),onBlur:i,style:{position:"absolute",inset:0,width:"150%",height:"150%",border:"none",outline:"none",padding:0,cursor:l?"not-allowed":"pointer",opacity:0}}),c.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:d}})]}),o.showHex!==!1&&c.jsx("input",{type:"text",value:d,disabled:l,maxLength:7,placeholder:"#000000",onChange:x=>{const h=x.target.value;f(h),/^#[0-9a-fA-F]{6}$/.test(h)&&(b.current=h,n(h))},onBlur:i,style:{fontSize:O.FONT_SIZE_INPUT,fontFamily:"monospace",color:O.COLOR_LABEL,backgroundColor:l?O.COLOR_DISABLED_BG:"#fff",border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,padding:"0 10px",outline:"none",height:O.INPUT_HEIGHT,width:100,boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s"}})]}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}function Kl(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function eu({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,d=p.useRef(null),[f,b]=p.useState(!1),[g,x]=p.useState(null),h=e instanceof File?[e]:Array.isArray(e)?e:[],m=C=>{if(!C)return;const I=Array.from(C);if(o.maxSizeMb){const S=I.find(y=>y.size>o.maxSizeMb*1024*1024);if(S){x(`"${S.name}" exceeds ${o.maxSizeMb} MB`);return}}x(null),n(o.multiple?I:I[0]??null)},v=C=>{o.multiple?n(h.filter((I,S)=>S!==C)):n(null),d.current&&(d.current.value="")},A=a||g?O.BORDER_COLOR_ERROR:f?O.BORDER_COLOR_FOCUS:O.BORDER_COLOR;return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsxs("div",{onClick:()=>{var C;return!l&&((C=d.current)==null?void 0:C.click())},onDragOver:C=>{C.preventDefault(),l||b(!0)},onDragLeave:()=>b(!1),onDrop:C=>{C.preventDefault(),b(!1),l||m(C.dataTransfer.files)},style:{border:`1px dashed ${A}`,borderRadius:O.BORDER_RADIUS,padding:"14px 16px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:f?"rgba(99,102,241,0.04)":l?"#f9fafb":"#fff",transition:"border-color .15s, background .15s"},children:[c.jsx("input",{ref:d,id:u,type:"file",accept:o.accept,multiple:o.multiple,disabled:l,"data-testid":o.dataTestId??`${u}-input`,style:{display:"none"},onChange:C=>{m(C.target.files),i()}}),c.jsx(U.MdUploadFile,{size:24,color:l?"#9ca3af":"#6366f1",style:{marginBottom:4}}),c.jsx("div",{style:{fontSize:13,color:l?"#9ca3af":"#374151",fontWeight:500},children:f?"Drop file here":"Click or drag file to upload"}),o.accept&&c.jsx("div",{style:{fontSize:11,color:"#6b7280",marginTop:2},children:o.accept}),o.maxSizeMb&&c.jsxs("div",{style:{fontSize:11,color:"#6b7280"},children:["Max ",o.maxSizeMb," MB"]})]}),h.length>0&&c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginTop:8},children:h.map((C,I)=>c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",border:"1px solid #e5e7eb",borderRadius:4,backgroundColor:"#f9fafb"},children:[c.jsx(U.MdInsertDriveFile,{size:16,color:"#6366f1"}),c.jsx("span",{style:{fontSize:13,color:"#374151",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.name}),c.jsx("span",{style:{fontSize:11,color:"#6b7280",flexShrink:0},children:Kl(C.size)}),!l&&c.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),v(I)},style:{background:"none",border:"none",cursor:"pointer",color:"#9ca3af",display:"flex",padding:0},children:c.jsx(U.MdClose,{size:14})})]},`${C.name}-${C.size}-${C.lastModified}`))}),(a||g)&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:g??r})]})}const tu=p.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./index-D1Z2CD30.js"))).default}));async function nu(t){switch(t){case"python":return[(await Promise.resolve().then(()=>require("./index-gtgq_241.js"))).python()];case"json":return[(await Promise.resolve().then(()=>require("./index-BysKSEtZ.js"))).json()];case"typescript":return[(await Promise.resolve().then(()=>require("./index-B3aHpb84.js"))).javascript({typescript:!0})];default:return[(await Promise.resolve().then(()=>require("./index-B3aHpb84.js"))).javascript()]}}function hi({language:t,value:e,readOnly:n,minHeight:i,maxHeight:r,basicSetup:s,onChange:o,onBlur:u,style:a,fallbackHeight:l}){const[d,f]=p.useState(null);p.useEffect(()=>{let g=!0;return nu(t).then(x=>{g&&f(x)}),()=>{g=!1}},[t]);const b=p.useMemo(()=>c.jsx("div",{style:{minHeight:l??i,padding:8,color:"#9ca3af",fontSize:12},children:"Loading editor…"}),[l,i]);return d?c.jsx(p.Suspense,{fallback:b,children:c.jsx(tu,{value:e,extensions:d,readOnly:n,minHeight:i,maxHeight:r,theme:"light",basicSetup:s,onChange:o,onBlur:u,style:a})}):b}function ru({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(null),[b,g]=p.useState(()=>typeof e=="string"?e:e!=null?JSON.stringify(e,null,2):""),x=p.useRef(e);p.useEffect(()=>{e!==x.current&&(x.current=e,typeof e=="string"?g(e):e!=null?g(JSON.stringify(e,null,2)):g(""))},[e]);const h=S=>{g(S);try{S.trim()&&JSON.parse(S),f(null)}catch(y){f(y.message)}x.current=S,n(S)},m=()=>{try{const S=JSON.stringify(JSON.parse(b),null,2);g(S),f(null),x.current=S,n(S)}catch{}},v=o.rows??8,A=`${v*22}px`,C=`${v*22}px`,I=a||d?O.BORDER_COLOR_ERROR:O.BORDER_COLOR;return c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),!l&&!o.readOnly&&c.jsx("button",{type:"button",onClick:m,style:{fontSize:11,fontWeight:600,color:"#6366f1",background:"none",border:"none",cursor:"pointer",padding:"0 0 4px"},children:"Format"})]}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("div",{id:u,"data-testid":o.dataTestId??`${u}-input`,style:{border:`1px solid ${I}`,borderRadius:O.BORDER_RADIUS,overflow:"hidden",fontSize:13},children:c.jsx(hi,{language:"json",value:b,readOnly:l||o.readOnly,minHeight:A,maxHeight:C,basicSetup:{lineNumbers:!0,foldGutter:!0},onChange:h,onBlur:i,style:{fontSize:13}})}),(a||d)&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:d??r})]})}const iu={javascript:"JS",typescript:"TS",python:"PY",json:"JSON"};function ou({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>String(e??"")),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(String(e??"")))},[e]);const g=A=>{f(A),b.current=A,n(A)},x=o.rows??8,h=`${x*22}px`,m=`${x*22}px`,v=iu[o.language??"javascript"]??"CODE";return c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),c.jsx("span",{style:{fontSize:10,fontWeight:700,color:"#6b7280",backgroundColor:"#f1f5f9",border:"1px solid #e2e8f0",borderRadius:4,padding:"1px 6px",letterSpacing:.5,marginBottom:4},children:v})]}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("div",{id:u,"data-testid":o.dataTestId??`${u}-input`,style:{border:`1px solid ${a?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,overflow:"hidden"},children:c.jsx(hi,{language:o.language,value:d,readOnly:l||o.readOnly,minHeight:h,maxHeight:m,basicSetup:{lineNumbers:!0,foldGutter:!0,autocompletion:!0},onChange:g,onBlur:i,style:{fontSize:13}})}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}const su=p.lazy(()=>Promise.resolve().then(()=>require("./index-rveXnmm0.js")).then(t=>t.index).then(t=>(Promise.resolve().then(()=>require("./quill.snow-Dyvby5gX.js")),{default:t.default}))),au=[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]];function lu({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.id??o.name??"",a=!!(s&&r),l=o.disabled===!0,[d,f]=p.useState(()=>String(e??"")),b=p.useRef(e);p.useEffect(()=>{e!==b.current&&(b.current=e,f(String(e??"")))},[e]);const g=m=>{f(m),b.current=m,n(m)},x=(o.rows??6)*24,h=o.toolbar!==!1;return c.jsxs("div",{children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:u,dataTestId:o.dataTestId}),o.helperText&&!a&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx("div",{id:u,"data-testid":o.dataTestId??`${u}-input`,style:{border:a?O.BORDER_ERROR:O.BORDER,borderRadius:O.BORDER_RADIUS,overflow:"hidden",fontSize:14},children:c.jsx(p.Suspense,{fallback:c.jsx("div",{style:{minHeight:x,display:"flex",alignItems:"center",padding:"8px 12px",color:"rgba(0,0,0,0.38)",fontSize:13},children:"Loading editor…"}),children:c.jsx(su,{value:d,onChange:g,onBlur:i,readOnly:l||o.readOnly,modules:{toolbar:h?au:!1},style:{minHeight:x},theme:"snow"})})}),a&&c.jsx("small",{"data-testid":`${u}-error`,style:ae,children:r})]})}const _t="ff-infinite-open";function uu(t){typeof window<"u"&&window.dispatchEvent(new CustomEvent(_t,{detail:t}))}if(typeof document<"u"&&!document.getElementById("ff-spin-style")){const t=document.createElement("style");t.id="ff-spin-style",t.textContent="@keyframes ff-spin { to { transform: rotate(360deg); } }",document.head.appendChild(t)}function cu(t){const{onScrollBottom:e,isLoading:n,hasMore:i,innerRef:r,children:s,...o}=t,u=p.Children.count(s)>0,a=p.useRef(null),l=p.useCallback(d=>{a.current=d,typeof r=="function"?r(d):r&&"current"in r&&(r.current=d)},[r]);return p.useEffect(()=>{const d=a.current;if(!d)return;const f=()=>{n||!i||d.scrollTop+d.clientHeight>=d.scrollHeight-50&&e()};return d.addEventListener("scroll",f,{passive:!0}),()=>d.removeEventListener("scroll",f)},[n,i,e]),p.useEffect(()=>{const d=a.current;!d||n||!i||d.scrollHeight<=d.clientHeight+4&&e()},[s,n,i,e]),c.jsxs(ke.components.MenuList,{...o,innerRef:l,children:[s,u&&(n||i)&&c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px 12px",gap:8,color:"#6b7280",fontSize:12,borderTop:"1px solid #f1f3f5",pointerEvents:"none",userSelect:"none"},children:n?c.jsxs(c.Fragment,{children:[c.jsx(du,{}),"Loading…"]}):c.jsx("span",{style:{color:"#adb5bd"},children:"Scroll for more"})})]})}function du(){return c.jsx("div",{style:{width:13,height:13,flexShrink:0,border:"2px solid #e5e7eb",borderTopColor:"#6366f1",borderRadius:"50%",animation:"ff-spin 0.7s linear infinite"}})}function fu({loadPage:t,loadSelected:e,currentValues:n,isOpen:i}){const[r,s]=p.useState([]),[o,u]=p.useState(0),[a,l]=p.useState(!0),[d,f]=p.useState(!1),b=p.useRef(new Map),[g,x]=p.useState(0),[h,m]=p.useState(""),[v,A]=p.useState(""),C=p.useRef(null),I=p.useRef(null),S=p.useRef(null),y=p.useCallback(j=>{m(j),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>A(j),300)},[]);p.useEffect(()=>{var w;if(!i||S.current===v)return;S.current=v,(w=I.current)==null||w.abort();const j=new AbortController;return I.current=j,s([]),u(0),l(!0),f(!0),t({page:1,search:v,signal:j.signal}).then(V=>{if(j.signal.aborted)return;const W=Yn(V.options);s(W),u(1),l(V.hasMore),f(!1)}).catch(V=>{$n(V)||f(!1)}),()=>j.abort()},[v,i]);const E=p.useCallback(()=>{var V;if(d||!a)return;(V=I.current)==null||V.abort();const j=new AbortController;I.current=j,f(!0);const w=o+1;t({page:w,search:v,signal:j.signal}).then(W=>{j.signal.aborted||(s(J=>Yn([...J,...W.options])),u(w),l(W.hasMore),f(!1))}).catch(W=>{$n(W)||f(!1)})},[d,a,o,v]),F=p.useRef(new Set);p.useEffect(()=>{if(!e||n.length===0)return;const j=n.filter(w=>!b.current.has(w)&&!F.current.has(w));j.length!==0&&(j.forEach(w=>F.current.add(w)),e(j).then(w=>{w.forEach(V=>b.current.set(V.value,V)),x(V=>V+1)}).catch(()=>{}).finally(()=>{j.forEach(w=>F.current.delete(w))}))},[n.join("|")]);const G=p.useCallback(()=>{var j;S.current=null,m(""),A(""),C.current&&clearTimeout(C.current),(j=I.current)==null||j.abort()},[]),M=p.useMemo(()=>r,[r,g]),D=p.useCallback(j=>{const w=r.find(V=>V.value===j);return w||b.current.get(j)},[r,g]),N=p.useCallback(j=>{if(!j)return;(Array.isArray(j)?j:[j]).forEach(V=>b.current.set(V.value,V))},[]);return{options:M,lookupOption:D,isLoading:d,hasMore:a,inputValue:h,handleInputChange:y,loadMore:E,handleMenuClose:G,updateSelectedCache:N}}function Yn(t){const e=new Set;return t.filter(n=>e.has(n.value)?!1:(e.add(n.value),!0))}function $n(t){return t instanceof Error&&(t.name==="AbortError"||t.message==="AbortError")}function Un(t){return t==null?[]:Array.isArray(t)?t.map(String):[String(t)]}function mi({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=o.isMulti??!1,a=o.id??o.name??"",l=!!(s&&r),d=o.disabled===!0,f=p.useRef(`ff-inf-${Math.random().toString(36).slice(2)}`).current,[b,g]=p.useState(!1);p.useEffect(()=>{const J=_=>{_.detail!==f&&g(!1)};return window.addEventListener(_t,J),()=>window.removeEventListener(_t,J)},[f]),p.useEffect(()=>{b&&uu(f)},[b,f]);const x=p.useCallback(()=>g(!0),[]),h=p.useMemo(()=>Un(e),[e]),{options:m,lookupOption:v,isLoading:A,hasMore:C,inputValue:I,handleInputChange:S,loadMore:y,handleMenuClose:E,updateSelectedCache:F}=fu({loadPage:o.loadPage,loadSelected:o.loadSelected,currentValues:h,isOpen:b}),G=p.useRef(E);G.current=E;const M=p.useRef(!1);p.useEffect(()=>{M.current&&!b&&G.current(),M.current=b},[b]);const D=p.useCallback(()=>g(!1),[]),N=p.useMemo(()=>e==null||e===""||Array.isArray(e)&&e.length===0?u?[]:null:u?Un(e).map(J=>v(J)).filter(J=>!!J):v(String(e))??null,[e,v,u]),j=p.useCallback(J=>{if(u){const _=J??[];F(_),n(_.map(ee=>ee.value))}else{const _=J;_&&F(_),n(_?_.value:null)}},[u,n,F]),w=p.useRef({loadMore:y,isLoading:A,hasMore:C});w.current={loadMore:y,isLoading:A,hasMore:C};const V=p.useRef(function(_){return c.jsx(cu,{..._,onScrollBottom:()=>w.current.loadMore(),isLoading:w.current.isLoading,hasMore:w.current.hasMore})}).current,W=p.useCallback(()=>A?"Loading…":"No options found",[A]);return c.jsxs("div",{className:`${o.customClass??""} ${o.hidden?"ff-form-hidden":""}`,children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:a}),o.helperText&&!l&&c.jsx("small",{style:oe,children:o.helperText}),c.jsx(ke,{inputId:a,value:N,inputValue:I,onInputChange:S,onChange:j,onBlur:i,options:m,isMulti:u,isDisabled:d,isClearable:o.isClearable??!1,isSearchable:!0,filterOption:null,menuIsOpen:b,onMenuOpen:x,onMenuClose:D,placeholder:o.placeholder??"Search…",noOptionsMessage:W,styles:en(l,u),components:{MenuList:V},classNamePrefix:"ff-select",menuPortalTarget:typeof document<"u"?document.body:void 0,menuPosition:"fixed",closeMenuOnSelect:!u,hideSelectedOptions:u}),l&&c.jsx("small",{"data-testid":`${a}-error`,style:ae,children:r})]})}q.register("text",Er);q.register("textarea",Er);q.register("select",Tl);q.register("descriptive-select",Nl);q.register("array",St);q.register("schema",_l);q.register("number",Jl);q.register("toggle",Yl);q.register("radio-group",$l);q.register("date",mn);q.register("datetime",mn);q.register("time",mn);q.register("tags",Ul);q.register("slider",Ql);q.register("color",ql);q.register("file",eu);q.register("json-editor",ru);q.register("code",ou);q.register("rich-text",lu);q.register("infinite-select",mi);var pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function We(t){this._maxSize=t,this.clear()}We.prototype.clear=function(){this._size=0,this._values=Object.create(null)};We.prototype.get=function(t){return this._values[t]};We.prototype.set=function(t,e){return this._size>=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var gu=/[^.^\]^[]+|(?=\[\]|\.\.)/g,vi=/^\d+$/,bu=/^\d/,hu=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,mu=/^\s*(['"]?)(.*?)(\1)\s*$/,xn=512,Qn=new We(xn);new We(xn);var qn=new We(xn),Fe={split:Jt,normalizePath:Kn,getter:function(t,e){var n=Kn(t);return qn.get(t)||qn.set(t,function(r){for(var s=0,o=n.length;s<o;)if(r!=null||!e)r=r[n[s++]];else return;return r})},join:function(t){return t.reduce(function(e,n){return e+(vn(n)||vi.test(n)?"["+n+"]":(e?".":"")+n)},"")},forEach:function(t,e,n){xu(Array.isArray(t)?t:Jt(t),e,n)}};function Kn(t){return Qn.get(t)||Qn.set(t,Jt(t).map(function(e){return e.replace(mu,"$2")}))}function Jt(t){return t.match(gu)||[""]}function xu(t,e,n){var i=t.length,r,s,o,u;for(s=0;s<i;s++)r=t[s],r&&(yu(r)&&(r='"'+r+'"'),u=vn(r),o=!u&&/^\d+$/.test(r),e.call(n,r,u,o,s,t))}function vn(t){return typeof t=="string"&&t&&["'",'"'].indexOf(t.charAt(0))!==-1}function vu(t){return t.match(bu)&&!t.match(vi)}function Iu(t){return hu.test(t)}function yu(t){return!vn(t)&&(vu(t)||Iu(t))}const Cu=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ii=t=>t.match(Cu)||[],Su=(t,e)=>Ii(t).join(e).toLowerCase(),Au=t=>Ii(t).reduce((e,n)=>`${e}${e?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),Ru=t=>Su(t,"_");var kt={camelCase:Au,snakeCase:Ru},In={exports:{}};In.exports=function(t){return yi(Eu(t),t)};In.exports.array=yi;function yi(t,e){var n=t.length,i=new Array(n),r={},s=n,o=Ou(e),u=Fu(t);for(e.forEach(function(l){if(!u.has(l[0])||!u.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)r[s]||a(t[s],s,new Set);return i;function a(l,d,f){if(f.has(l)){var b;try{b=", node was:"+JSON.stringify(l)}catch{b=""}throw new Error("Cyclic dependency"+b)}if(!u.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!r[d]){r[d]=!0;var g=o.get(l)||new Set;if(g=Array.from(g),d=g.length){f.add(l);do{var x=g[--d];a(x,u.get(x),f)}while(d);f.delete(l)}i[--n]=l}}}function Eu(t){for(var e=new Set,n=0,i=t.length;n<i;n++){var r=t[n];e.add(r[0]),e.add(r[1])}return Array.from(e)}function Ou(t){for(var e=new Map,n=0,i=t.length;n<i;n++){var r=t[n];e.has(r[0])||e.set(r[0],new Set),e.has(r[1])||e.set(r[1],new Set),e.get(r[0]).add(r[1])}return e}function Fu(t){for(var e=new Map,n=0,i=t.length;n<i;n++)e.set(t[n],n);return e}var wu=In.exports;const Bu=xi(wu),Tu=Object.prototype.toString,Gu=Error.prototype.toString,ju=RegExp.prototype.toString,Vu=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Du=/^Symbol\((.*)\)(.*)$/;function Pu(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function er(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Pu(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Vu.call(t).replace(Du,"Symbol($1)");const i=Tu.call(t).slice(8,-1);return i==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):i==="Error"||t instanceof Error?"["+Gu.call(t)+"]":i==="RegExp"?ju.call(t):null}function ye(t,e){let n=er(t,e);return n!==null?n:JSON.stringify(t,function(i,r){let s=er(this[i],e);return s!==null?s:r},2)}function Ci(t){return t==null?[]:[].concat(t)}let Si,Ai,Ri,Nu=/\$\{\s*(\w+)\s*\}/g;Si=Symbol.toStringTag;class tr{constructor(e,n,i,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Si]="Error",this.name="ValidationError",this.value=n,this.path=i,this.type=r,this.errors=[],this.inner=[],Ci(e).forEach(s=>{if(le.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Ai=Symbol.hasInstance;Ri=Symbol.toStringTag;class le extends Error{static formatError(e,n){const i=n.label||n.path||"this";return n=Object.assign({},n,{path:i,originalPath:n.path}),typeof e=="string"?e.replace(Nu,(r,s)=>ye(n[s])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,i,r,s){const o=new tr(e,n,i,r);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ri]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,le)}static[Ai](e){return tr[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let he={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:i})=>{const r=i!=null&&i!==n?` (cast from the value \`${ye(i,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${ye(n,!0)}\``+r:`${t} must match the configured type. The validated value was: \`${ye(n,!0)}\``+r}},ue={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Se={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Yt={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},$t={isValue:"${path} field must be ${value}"},st={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},at={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Mu={notType:t=>{const{path:e,value:n,spec:i}=t,r=i.types.length;if(Array.isArray(n)){if(n.length<r)return`${e} tuple value has too few items, expected a length of ${r} but got ${n.length} for value: \`${ye(n,!0)}\``;if(n.length>r)return`${e} tuple value has too many items, expected a length of ${r} but got ${n.length} for value: \`${ye(n,!0)}\``}return le.formatError(he.notType,t)}};Object.assign(Object.create(null),{mixed:he,string:ue,number:Se,date:Yt,object:st,array:at,boolean:$t,tuple:Mu});const At=t=>t&&t.__isYupSchema__;class xt{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:r,otherwise:s}=n,o=typeof i=="function"?i:(...u)=>u.every(a=>a===i);return new xt(e,(u,a)=>{var l;let d=o(...u)?r:s;return(l=d==null?void 0:d(a))!=null?l:a})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let i=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),r=this.fn(i,e,n);if(r===void 0||r===e)return e;if(!At(r))throw new TypeError("conditions must return a schema object");return r.resolve(n)}}const rt={context:"$",value:"."};class Te{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===rt.context,this.isValue=this.key[0]===rt.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?rt.context:this.isValue?rt.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&Fe.getter(this.path,!0),this.map=n.map}getValue(e,n,i){let r=this.isContext?i:this.isValue?e:n;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Te.prototype.__isYupRef=!0;const fe=t=>t==null;function Ve(t){function e({value:n,path:i="",options:r,originalValue:s,schema:o},u,a){const{name:l,test:d,params:f,message:b,skipAbsent:g}=t;let{parent:x,context:h,abortEarly:m=o.spec.abortEarly,disableStackTrace:v=o.spec.disableStackTrace}=r;const A={value:n,parent:x,context:h};function C(D={}){const N=Ei(Object.assign({value:n,originalValue:s,label:o.spec.label,path:D.path||i,spec:o.spec,disableStackTrace:D.disableStackTrace||v},f,D.params),A),j=new le(le.formatError(D.message||b,N),n,N.path,D.type||l,N.disableStackTrace);return j.params=N,j}const I=m?u:a;let S={path:i,parent:x,type:l,from:r.from,createError:C,resolve(D){return Oi(D,A)},options:r,originalValue:s,schema:o};const y=D=>{le.isError(D)?I(D):D?a(null):I(C())},E=D=>{le.isError(D)?I(D):u(D)};if(g&&fe(n))return y(!0);let G;try{var M;if(G=d.call(S,n,S),typeof((M=G)==null?void 0:M.then)=="function"){if(r.sync)throw new Error(`Validation test of type: "${S.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(G).then(y,E)}}catch(D){E(D);return}y(G)}return e.OPTIONS=t,e}function Ei(t,e){if(!t)return t;for(const n of Object.keys(t))t[n]=Oi(t[n],e);return t}function Oi(t,e){return Te.isRef(t)?t.getValue(e.value,e.parent,e.context):t}function ku(t,e,n,i=n){let r,s,o;return e?(Fe.forEach(e,(u,a,l)=>{let d=a?u.slice(1,u.length-1):u;t=t.resolve({context:i,parent:r,value:n});let f=t.type==="tuple",b=l?parseInt(d,10):0;if(t.innerType||f){if(f&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&b>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${e}. because there is no value at that index. `);r=n,n=n&&n[b],t=f?t.spec.types[b]:t.innerType}if(!l){if(!t.fields||!t.fields[d])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${t.type}")`);r=n,n=n&&n[d],t=t.fields[d]}s=d,o=a?"["+u+"]":"."+u}),{schema:t,parent:r,parentPath:s}):{parent:r,parentPath:e,schema:t}}class vt extends Set{describe(){const e=[];for(const n of this.values())e.push(Te.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const i of this.values())n.push(e(i));return n}clone(){return new vt(this.values())}merge(e,n){const i=this.clone();return e.forEach(r=>i.add(r)),n.forEach(r=>i.delete(r)),i}}function Ne(t,e=new Map){if(At(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let i=0;i<t.length;i++)n[i]=Ne(t[i],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[i,r]of t.entries())n.set(i,Ne(r,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const i of t)n.add(Ne(i,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[i,r]of Object.entries(t))n[i]=Ne(r,e)}else throw Error(`Unable to clone ${t}`);return n}function Lu(t){if(!(t!=null&&t.length))return;const e=[];let n="",i=!1,r=!1;for(let s=0;s<t.length;s++){const o=t[s];if(o==="["&&!r){n&&(e.push(...n.split(".").filter(Boolean)),n=""),i=!0;continue}if(o==="]"&&!r){n&&(/^\d+$/.test(n)?e.push(n):e.push(n.replace(/^"|"$/g,"")),n=""),i=!1;continue}if(o==='"'){r=!r;continue}if(o==="."&&!i&&!r){n&&(e.push(n),n="");continue}n+=o}return n&&e.push(...n.split(".").filter(Boolean)),e}function Wu(t,e){const n=e?`${e}.${t.path}`:t.path;return t.errors.map(i=>({message:i,path:Lu(n)}))}function Fi(t,e){var n;if(!((n=t.inner)!=null&&n.length)&&t.errors.length)return Wu(t,e);const i=e?`${e}.${t.path}`:t.path;return t.inner.flatMap(r=>Fi(r,i))}class de{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new vt,this._blacklist=new vt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(he.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ne(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=n,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,i=e.clone();const r=Object.assign({},n.spec,i.spec);return i.spec=r,i.internalTests=Object.assign({},n.internalTests,i.internalTests),i._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),i.tests=n.tests,i.exclusiveTests=n.exclusiveTests,i.withMutation(s=>{e.tests.forEach(o=>{s.test(o.OPTIONS)})}),i.transforms=[...n.transforms,...i.transforms],i}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let i=n.conditions;n=n.clone(),n.conditions=[],n=i.reduce((r,s)=>s.resolve(r,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,i,r,s;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(i=e.abortEarly)!=null?i:this.spec.abortEarly,recursive:(r=e.recursive)!=null?r:this.spec.recursive,disableStackTrace:(s=e.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(e,n={}){let i=this.resolve(Object.assign({},n,{value:e})),r=n.assert==="ignore-optionality",s=i._cast(e,n);if(n.assert!==!1&&!i.isType(s)){if(r&&fe(s))return s;let o=ye(e),u=ye(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${i.type}".
7
7
 
8
8
  attempted value: ${o}
9
- `+(u!==o?`result of cast: ${u}`:""))}return s}_cast(e,n){let i=e===void 0?e:this.transforms.reduce((r,s)=>s.call(this,r,e,this,n),e);return i===void 0&&(i=this.getDefault(n)),i}_validate(e,n={},i,r){let{path:s,originalValue:o=e,strict:u=this.spec.strict}=n,a=e;u||(a=this._cast(a,Object.assign({assert:!1},n)));let l=[];for(let d of Object.values(this.internalTests))d&&l.push(d);this.runTests({path:s,value:a,originalValue:o,options:n,tests:l},i,d=>{if(d.length)return r(d,a);this.runTests({path:s,value:a,originalValue:o,options:n,tests:this.tests},i,r)})}runTests(e,n,i){let r=!1,{tests:s,value:o,originalValue:u,path:a,options:l}=e,d=h=>{r||(r=!0,n(h,o))},f=h=>{r||(r=!0,i(h,o))},b=s.length,g=[];if(!b)return f([]);let x={value:o,originalValue:u,path:a,options:l,schema:this};for(let h=0;h<s.length;h++){const m=s[h];m(x,d,function(A){A&&(Array.isArray(A)?g.push(...A):g.push(A)),--b<=0&&f(g)})}}asNestedTest({key:e,index:n,parent:i,parentPath:r,originalParent:s,options:o}){const u=e??n;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const a=typeof u=="number";let l=i[u];const d=Object.assign({},o,{strict:!0,parent:i,value:l,originalValue:s[u],key:void 0,[a?"index":"key"]:u,path:a||u.includes(".")?`${r||""}[${a?u:`"${u}"`}]`:(r?`${r}.`:"")+e});return(f,b,g)=>this.resolve(d)._validate(l,d,b,g)}validate(e,n){var i;let r=this.resolve(Object.assign({},n,{value:e})),s=(i=n==null?void 0:n.disableStackTrace)!=null?i:r.spec.disableStackTrace;return new Promise((o,u)=>r._validate(e,n,(a,l)=>{le.isError(a)&&(a.value=l),u(a)},(a,l)=>{a.length?u(new le(a,l,void 0,void 0,s)):o(l)}))}validateSync(e,n){var i;let r=this.resolve(Object.assign({},n,{value:e})),s,o=(i=n==null?void 0:n.disableStackTrace)!=null?i:r.spec.disableStackTrace;return r._validate(e,Object.assign({},n,{sync:!0}),(u,a)=>{throw le.isError(u)&&(u.value=a),u},(u,a)=>{if(u.length)throw new le(u,e,void 0,void 0,o);s=a}),s}isValid(e,n){return this.validate(e,n).then(()=>!0,i=>{if(le.isError(i))return!1;throw i})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(i){if(le.isError(i))return!1;throw i}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):Ne(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const i=this.clone({nullable:e});return i.internalTests.nullable=Ve({message:n,name:"nullable",test(r){return r===null?this.schema.spec.nullable:!0}}),i}optionality(e,n){const i=this.clone({optional:e});return i.internalTests.optionality=Ve({message:n,name:"optionality",test(r){return r===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=he.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=he.notNull){return this.nullability(!1,e)}required(e=he.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=he.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),r=Ve(n),s=n.exclusive||n.name&&i.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(i.exclusiveTests[n.name]=!!n.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===r.OPTIONS.test))),i.tests.push(r),i}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let i=this.clone(),r=Ci(e).map(s=>new Be(s));return r.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(typeof n=="function"?new xt(r,n):xt.fromOptions(r,n)),i}typeError(e){let n=this.clone();return n.internalTests.typeError=Ve({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=he.oneOf){let i=this.clone();return e.forEach(r=>{i._whitelist.add(r),i._blacklist.delete(r)}),i.internalTests.whiteList=Ve({message:n,name:"oneOf",skipAbsent:!0,test(r){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(r)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),i}notOneOf(e,n=he.notOneOf){let i=this.clone();return e.forEach(r=>{i._blacklist.add(r),i._whitelist.delete(r)}),i.internalTests.blacklist=Ve({message:n,name:"notOneOf",test(r){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(r)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),i}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:i,meta:r,optional:s,nullable:o}=n.spec;return{meta:r,label:i,optional:s,nullable:o,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((a,l,d)=>d.findIndex(f=>f.OPTIONS.name===a.OPTIONS.name)===l).map(a=>{const l=a.OPTIONS.params&&e?Ei(Object.assign({},a.OPTIONS.params),e):a.OPTIONS.params;return{name:a.OPTIONS.name,params:l}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(i){try{return{value:await e.validate(i,{abortEarly:!1})}}catch(r){if(r instanceof le)return{issues:Fi(r)};throw r}}}}}de.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])de.prototype[`${t}At`]=function(e,n,i={}){const{parent:r,parentPath:s,schema:o}=ku(this,e,n,i.context);return o[t](r&&r[s],Object.assign({},i,{parent:r,path:e}))};for(const t of["equals","is"])de.prototype[t]=de.prototype.oneOf;for(const t of["not","nope"])de.prototype[t]=de.prototype.notOneOf;function wi(){return new Ti}class Ti extends de{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,n)=>{if(this.spec.coerce&&!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=$t.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return fe(n)||n===!0}})}isFalse(e=$t.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return fe(n)||n===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}wi.prototype=Ti.prototype;const Xu=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function zu(t){const e=Ut(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function Ut(t){var e,n;const i=Xu.exec(t);return i?{year:xe(i[1]),month:xe(i[2],1)-1,day:xe(i[3],1),hour:xe(i[4]),minute:xe(i[5]),second:xe(i[6]),millisecond:i[7]?xe(i[7].substring(0,3)):0,precision:(e=(n=i[7])==null?void 0:n.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:xe(i[10]),minuteOffset:xe(i[11])}:null}function xe(t,e=0){return Number(t)||e}let Hu=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Zu=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,_u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ju="^\\d{4}-\\d{2}-\\d{2}",Yu="\\d{2}:\\d{2}:\\d{2}",$u="(([+-]\\d{2}(:?\\d{2})?)|Z)",Uu=new RegExp(`${Ju}T${Yu}(\\.\\d+)?${$u}$`),Qu=t=>fe(t)||t===t.trim(),qu={}.toString();function lt(){return new Bi}class Bi extends de{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const i=e!=null&&e.toString?e.toString():e;return i===qu?e:i})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||he.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=ue.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n=ue.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n=ue.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,n){let i=!1,r,s;return n&&(typeof n=="object"?{excludeEmptyString:i=!1,message:r,name:s}=n:r=n),this.test({name:s||"matches",message:r||ue.matches,params:{regex:e},skipAbsent:!0,test:o=>o===""&&i||o.search(e)!==-1})}email(e=ue.email){return this.matches(Hu,{name:"email",message:e,excludeEmptyString:!0})}url(e=ue.url){return this.matches(Zu,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ue.uuid){return this.matches(_u,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",i,r;return e&&(typeof e=="object"?{message:n="",allowOffset:i=!1,precision:r=void 0}=e:n=e),this.matches(Uu,{name:"datetime",message:n||ue.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ue.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:s=>{if(!s||i)return!0;const o=Ut(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||ue.datetime_precision,params:{precision:r},skipAbsent:!0,test:s=>{if(!s||r==null)return!0;const o=Ut(s);return o?o.precision===r:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ue.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Qu})}lowercase(e=ue.lowercase){return this.transform(n=>fe(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>fe(n)||n===n.toLowerCase()})}uppercase(e=ue.uppercase){return this.transform(n=>fe(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>fe(n)||n===n.toUpperCase()})}}lt.prototype=Bi.prototype;let Ku=t=>t!=+t;function ji(){return new Gi}class Gi extends de{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!Ku(e)}}),this.withMutation(()=>{this.transform((e,n)=>{if(!this.spec.coerce)return e;let i=e;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return this.isType(i)||i===null?i:parseFloat(i)})})}min(e,n=Se.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(e)}})}max(e,n=Se.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(e)}})}lessThan(e,n=Se.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(i){return i<this.resolve(e)}})}moreThan(e,n=Se.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(i){return i>this.resolve(e)}})}positive(e=Se.positive){return this.moreThan(0,e)}negative(e=Se.negative){return this.lessThan(0,e)}integer(e=Se.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(e=>fe(e)?e:e|0)}round(e){var n;let i=["ceil","floor","round","trunc"];if(e=((n=e)==null?void 0:n.toLowerCase())||"round",e==="trunc")return this.truncate();if(i.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+i.join(", "));return this.transform(r=>fe(r)?r:Math[e](r))}}ji.prototype=Gi.prototype;let ec=new Date(""),tc=t=>Object.prototype.toString.call(t)==="[object Date]";class yn extends de{constructor(){super({type:"date",check(e){return tc(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=zu(e),isNaN(e)?yn.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let i;if(Be.isRef(e))i=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);i=r}return i}min(e,n=Yt.min){let i=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r>=this.resolve(i)}})}max(e,n=Yt.max){let i=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(r){return r<=this.resolve(i)}})}}yn.INVALID_DATE=ec;function nc(t,e=[]){let n=[],i=new Set,r=new Set(e.map(([o,u])=>`${o}-${u}`));function s(o,u){let a=Fe.split(o)[0];i.add(a),r.has(`${u}-${a}`)||n.push([u,a])}for(const o of Object.keys(t)){let u=t[o];i.add(o),Be.isRef(u)&&u.isSibling?s(u.path,o):At(u)&&"deps"in u&&u.deps.forEach(a=>s(a,o))}return Tu.array(Array.from(i),n).reverse()}function nr(t,e){let n=1/0;return t.some((i,r)=>{var s;if((s=e.path)!=null&&s.includes(i))return n=r,!0}),n}function Vi(t){return(e,n)=>nr(t,e)-nr(t,n)}const Di=(t,e,n)=>{if(typeof t!="string")return t;let i=t;try{i=JSON.parse(t)}catch{}return n.isType(i)?i:t};function ut(t){if("fields"in t){const e={};for(const[n,i]of Object.entries(t.fields))e[n]=ut(i);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=ut(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(ut)}):"optional"in t?t.optional():t}const rc=(t,e)=>{const n=[...Fe.normalizePath(e)];if(n.length===1)return n[0]in t;let i=n.pop(),r=Fe.getter(Fe.join(n),!0)(t);return!!(r&&i in r)};let rr=t=>Object.prototype.toString.call(t)==="[object Object]";function ir(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(i=>n.indexOf(i)===-1)}const ic=Vi([]);function Qt(t){return new Pi(t)}class Pi extends de{constructor(e){super({type:"object",check(n){return rr(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=ic,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var i;let r=super._cast(e,n);if(r===void 0)return this.getDefault(n);if(!this._typeCheck(r))return r;let s=this.fields,o=(i=n.stripUnknown)!=null?i:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(r).filter(f=>!this._nodes.includes(f))),a={},l=Object.assign({},n,{parent:a,__validating:n.__validating||!1}),d=!1;for(const f of u){let b=s[f],g=f in r,x=r[f];if(b){let h;l.path=(n.path?`${n.path}.`:"")+f,b=b.resolve({value:x,context:n.context,parent:a});let m=b instanceof de?b.spec:void 0,v=m==null?void 0:m.strict;if(m!=null&&m.strip){d=d||f in r;continue}h=!n.__validating||!v?b.cast(x,l):x,h!==void 0&&(a[f]=h)}else g&&!o&&(a[f]=x);(g!==f in a||a[f]!==x)&&(d=!0)}return d?a:r}_validate(e,n={},i,r){let{from:s=[],originalValue:o=e,recursive:u=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(e,n,i,(a,l)=>{if(!u||!rr(l)){r(a,l);return}o=o||l;let d=[];for(let f of this._nodes){let b=this.fields[f];!b||Be.isRef(b)||d.push(b.asNestedTest({options:n,key:f,parent:l,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:l,originalValue:o,options:n},i,f=>{r(f.sort(this._sortErrors).concat(a),l)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),i=n.fields;for(let[r,s]of Object.entries(this.fields)){const o=i[r];i[r]=o===void 0?s:o}return n.withMutation(r=>r.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(i=>{var r;const s=this.fields[i];let o=e;(r=o)!=null&&r.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[i]})),n[i]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(e,n){let i=this.clone();return i.fields=e,i._nodes=nc(e,n),i._sortErrors=Vi(Object.keys(e)),n&&(i._excludedEdges=n),i}shape(e,n=[]){return this.clone().withMutation(i=>{let r=i._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),r=[...i._excludedEdges,...n]),i.setFields(Object.assign(i.fields,e),r)})}partial(){const e={};for(const[n,i]of Object.entries(this.fields))e[n]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return ut(this)}pick(e){const n={};for(const i of e)this.fields[i]&&(n[i]=this.fields[i]);return this.setFields(n,this._excludedEdges.filter(([i,r])=>e.includes(i)&&e.includes(r)))}omit(e){const n=[];for(const i of Object.keys(this.fields))e.includes(i)||n.push(i);return this.pick(n)}from(e,n,i){let r=Fe.getter(e,!0);return this.transform(s=>{if(!s)return s;let o=s;return rc(s,e)&&(o=Object.assign({},s),i||delete o[e],o[n]=r(s)),o})}json(){return this.transform(Di)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||st.exact,test(n){if(n==null)return!0;const i=ir(this.schema,n);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=st.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:n,test(r){if(r==null)return!0;const s=ir(this.schema,r);return!e||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,n=st.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const i={};for(const r of Object.keys(n))i[e(r)]=n[r];return i})}camelCase(){return this.transformKeys(kt.camelCase)}snakeCase(){return this.transformKeys(kt.snakeCase)}constantCase(){return this.transformKeys(e=>kt.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[s,o]of Object.entries(n.fields)){var r;let u=e;(r=u)!=null&&r.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[s]})),i.fields[s]=o.describe(u)}return i}}Qt.prototype=Pi.prototype;function qt(t){return new Ni(t)}class Ni extends de{constructor(e){super({type:"array",spec:{types:e},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=e}_cast(e,n){const i=super._cast(e,n);if(!this._typeCheck(i)||!this.innerType)return i;let r=!1;const s=i.map((o,u)=>{const a=this.innerType.cast(o,Object.assign({},n,{path:`${n.path||""}[${u}]`,parent:i,originalValue:o,value:o,index:u}));return a!==o&&(r=!0),a});return r?s:i}_validate(e,n={},i,r){var s;let o=this.innerType,u=(s=n.recursive)!=null?s:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(e,n,i,(a,l)=>{var d;if(!u||!o||!this._typeCheck(l)){r(a,l);return}let f=new Array(l.length);for(let g=0;g<l.length;g++){var b;f[g]=o.asNestedTest({options:n,index:g,parent:l,parentPath:n.path,originalParent:(b=n.originalValue)!=null?b:e})}this.runTests({value:l,tests:f,originalValue:(d=n.originalValue)!=null?d:e,options:n},i,g=>r(g.concat(a),l))})}clone(e){const n=super.clone(e);return n.innerType=this.innerType,n}json(){return this.transform(Di)}concat(e){let n=super.concat(e);return n.innerType=this.innerType,e.innerType&&(n.innerType=n.innerType?n.innerType.concat(e.innerType):e.innerType),n}of(e){let n=this.clone();if(!At(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ye(e));return n.innerType=e,n.spec=Object.assign({},n.spec,{types:e}),n}length(e,n=at.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n){return n=n||at.min,this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n){return n=n||at.max,this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,n)=>this._typeCheck(e)?e:n==null?[]:[].concat(n))}compact(e){let n=e?(i,r,s)=>!e(i,r,s):i=>!!i;return this.transform(i=>i!=null?i.filter(n):i)}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);if(n.innerType){var r;let s=e;(r=s)!=null&&r.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[0]})),i.innerType=n.innerType.describe(s)}return i}}qt.prototype=Ni.prototype;function Ue(t){const e=t.id??t.name;if(!e)throw new Error("[FlowForge] Field descriptor is missing both 'id' and 'name'");return e}class oc{constructor(){this.sources=new Map}register(e,n){this.sources.set(e,n)}get(e){return this.sources.get(e)}has(e){return this.sources.has(e)}}const Mi=new oc,sc=8,Q={wrapper:t=>({border:`1px solid ${t?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,overflow:"hidden",background:"#fff",fontSize:13}),toolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",borderBottom:"1px solid #e0e0e0",minHeight:40,background:"#fff"},selectedLink:{fontSize:13,color:"#1976d2",cursor:"pointer",background:"none",border:"none",padding:0,fontWeight:500},searchWrap:{display:"flex",alignItems:"center",gap:6,border:"1px solid #e0e0e0",borderRadius:4,padding:"3px 8px",background:"#fafafa",flex:"0 0 220px"},searchInput:{border:"none",outline:"none",fontSize:13,background:"transparent",width:"100%"},table:{width:"100%",borderCollapse:"collapse"},thead:{background:"#f5f5f5"},th:t=>({textAlign:"left",padding:"0 16px",height:44,fontSize:12,fontWeight:600,color:"rgba(0,0,0,0.6)",borderBottom:"1px solid #e0e0e0",whiteSpace:"nowrap",width:t,letterSpacing:"0.01em"}),checkTh:{width:48,padding:"0 0 0 12px",height:44,borderBottom:"1px solid #e0e0e0",background:"#f5f5f5"},td:{padding:"0 16px",height:48,borderBottom:"1px solid #f0f0f0",color:"rgba(0,0,0,0.87)",verticalAlign:"middle"},checkTd:{padding:"0 0 0 12px",height:48,borderBottom:"1px solid #f0f0f0",verticalAlign:"middle",width:48},statusRow:{textAlign:"center",padding:"24px 16px",color:"rgba(0,0,0,0.38)",fontSize:13},footer:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:16,padding:"4px 8px",borderTop:"1px solid #e0e0e0",fontSize:12,color:"rgba(0,0,0,0.6)",background:"#fafafa",minHeight:40},pageBtn:t=>({display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",border:"none",background:"transparent",cursor:t?"default":"pointer",color:t?"rgba(0,0,0,0.26)":"rgba(0,0,0,0.54)",fontSize:16,transition:"background 0.15s"}),overlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},modal:{background:"#fff",borderRadius:8,width:560,maxWidth:"90vw",maxHeight:"80vh",display:"flex",flexDirection:"column",boxShadow:"0 8px 32px rgba(0,0,0,0.18)"},modalHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e0e0e0",fontSize:16,fontWeight:600,color:"rgba(0,0,0,0.87)"},modalCloseBtn:{background:"none",border:"none",cursor:"pointer",color:"rgba(0,0,0,0.54)",display:"flex",alignItems:"center",padding:4,borderRadius:4},modalSearch:{display:"flex",alignItems:"center",gap:8,margin:"12px 20px",border:"1px solid #e0e0e0",borderRadius:20,padding:"6px 12px",background:"#fafafa"},modalSearchInput:{flex:1,border:"none",outline:"none",fontSize:14,background:"transparent"},modalList:{flex:1,overflowY:"auto",padding:"0 20px 8px"},modalRow:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 0",borderBottom:"1px solid #f0f0f0",fontSize:14,color:"rgba(0,0,0,0.87)"},modalRemoveBtn:{background:"none",border:"none",cursor:"pointer",color:"#e53935",display:"flex",alignItems:"center",padding:2,borderRadius:4,flexShrink:0},modalFooter:{display:"flex",justifyContent:"flex-end",padding:"12px 20px",borderTop:"1px solid #e0e0e0"},closeBtn:{padding:"6px 20px",border:"1px solid #e0e0e0",borderRadius:4,background:"#fff",cursor:"pointer",fontSize:14,color:"rgba(0,0,0,0.87)"}};function or({checked:t,onChange:e,indeterminate:n,disabled:i}){const r=p.useRef(null);return p.useEffect(()=>{r.current&&(r.current.indeterminate=!!n)},[n]),c.jsx("input",{ref:r,type:"checkbox",checked:t,onChange:e,disabled:i,style:{width:16,height:16,cursor:i?"default":"pointer",accentColor:"#1976d2"}})}function ac({selected:t,onRemove:e,onClose:n}){const[i,r]=p.useState(""),s=t.filter(o=>o.label.toLowerCase().includes(i.toLowerCase()));return c.jsx("div",{style:Q.overlay,onClick:n,children:c.jsxs("div",{style:Q.modal,onClick:o=>o.stopPropagation(),children:[c.jsxs("div",{style:Q.modalHeader,children:[c.jsx("span",{children:"Selected Rows"}),c.jsx("button",{type:"button",style:Q.modalCloseBtn,onClick:n,children:c.jsx(U.MdClose,{size:20})})]}),c.jsxs("div",{style:Q.modalSearch,children:[c.jsx(U.MdSearch,{size:18,color:"rgba(0,0,0,0.38)"}),c.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search",value:i,onChange:o=>r(o.target.value),style:Q.modalSearchInput})]}),c.jsxs("div",{style:Q.modalList,children:[s.length===0&&c.jsx("div",{style:{textAlign:"center",padding:"24px 0",color:"rgba(0,0,0,0.38)",fontSize:13},children:"No items found"}),s.map(o=>c.jsxs("div",{style:Q.modalRow,children:[c.jsx("span",{children:o.label}),c.jsx("button",{type:"button",style:Q.modalRemoveBtn,onClick:()=>e(o.value),title:"Remove",children:c.jsx(U.MdClose,{size:16})})]},o.value))]}),c.jsx("div",{style:Q.modalFooter,children:c.jsx("button",{type:"button",style:Q.closeBtn,onClick:n,children:"Close"})})]})})}function ki({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=!!(s&&r),a=o.isMulti??!1,l=o.pageSize??sc,d=o.id??o.name??"",[f,b]=p.useState(""),[g,x]=p.useState(1),[h,m]=p.useState([]),[v,A]=p.useState(!1),[C,I]=p.useState(!1),[S,y]=p.useState(null),[E,F]=p.useState(!1),j=p.useRef(null),M=p.useRef(0),D=p.useRef(!0);p.useEffect(()=>()=>{D.current=!1,j.current&&clearTimeout(j.current)},[]);const N=a?Array.isArray(e)?e:[]:e?[e]:[],G=N.length,w=p.useCallback((B,P)=>{if(o.fetchOptions)return o.fetchOptions(B,P);if(o.dataSource){const Z=Mi.get(o.dataSource);return Z?Z.fetch(B,P):Promise.reject(new Error(`[FlowForge] DataSource "${o.dataSource}" is not registered.`))}return Promise.reject(new Error(`[FlowForge] table-picker "${o.id}" requires fetchOptions or dataSource.`))},[o.fetchOptions,o.dataSource,o.id]),V=p.useCallback((B,P)=>{const Z=++M.current;I(!0),w(B,P).then(Y=>{!D.current||Z!==M.current||(m(Y.options.slice(0,l)),A(Y.hasNextPage))}).catch(()=>{!D.current||Z!==M.current||(m([]),A(!1))}).finally(()=>{!D.current||Z!==M.current||I(!1)})},[w,l]);p.useEffect(()=>{V("",1)},[]);const W=B=>{const P=B.target.value;b(P),x(1),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>V(P,1),300)},J=B=>{if(a){const P=Array.isArray(e)?e:[],Z=P.some(Y=>Y.value===B.value);n(Z?P.filter(Y=>Y.value!==B.value):[...P,B])}else n((e==null?void 0:e.value)===B.value?null:B);i==null||i()},_=()=>{if(!a)return;const B=Array.isArray(e)?e:[];if(h.every(Z=>B.some(Y=>Y.value===Z.value)))n(B.filter(Z=>!h.some(Y=>Y.value===Z.value)));else{const Z=h.filter(Y=>!B.some(K=>K.value===Y.value));n([...B,...Z])}},ee=B=>{if(a){const Z=(Array.isArray(e)?e:[]).filter(Y=>Y.value!==B);n(Z),Z.length===0&&F(!1)}else n(null),F(!1);i==null||i()},re=o.columns.length+1,k=h.length>0&&h.every(B=>N.some(P=>P.value===B.value)),T=h.some(B=>N.some(P=>P.value===B.value)),z=B=>N.some(P=>P.value===B.value);return c.jsxs("div",{style:{marginBottom:16},children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:d,dataTestId:o.dataTestId??d}),c.jsxs("div",{style:Q.wrapper(u),onBlur:i,id:d,children:[c.jsxs("div",{style:Q.toolbar,children:[G>0?c.jsxs("button",{type:"button",style:Q.selectedLink,onClick:()=>F(!0),children:[G," ",G===1?"Item":"Items"," Selected"]}):c.jsx("span",{style:{fontSize:13,color:"rgba(0,0,0,0.38)"},children:"No selection"}),c.jsxs("div",{style:Q.searchWrap,children:[c.jsx(U.MdSearch,{size:15,color:"rgba(0,0,0,0.38)"}),c.jsx("input",{type:"text",placeholder:o.placeholder??"Search…",value:f,onChange:W,style:Q.searchInput,"aria-label":`Search ${o.label??""}`})]})]}),c.jsx("div",{style:{overflowX:"auto"},children:c.jsxs("table",{style:Q.table,children:[c.jsx("thead",{style:Q.thead,children:c.jsxs("tr",{children:[c.jsx("th",{style:Q.checkTh,children:a&&c.jsx(or,{checked:k,indeterminate:!k&&T,onChange:_,disabled:C||h.length===0})}),o.columns.map(B=>c.jsx("th",{style:Q.th(B.width),children:B.label},B.key))]})}),c.jsx("tbody",{children:C?c.jsx("tr",{children:c.jsx("td",{colSpan:re,style:Q.statusRow,children:"Loading…"})}):h.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:re,style:Q.statusRow,children:"No results found"})}):h.map(B=>{const P=z(B),Z=S===B.value;return c.jsxs("tr",{style:{cursor:"pointer",background:P?"rgba(25,118,210,0.06)":Z?"rgba(0,0,0,0.03)":"#fff",transition:"background 0.1s"},onClick:()=>J(B),onMouseEnter:()=>y(B.value),onMouseLeave:()=>y(null),"aria-selected":P,children:[c.jsx("td",{style:Q.checkTd,children:a?c.jsx(or,{checked:P,onChange:()=>J(B)}):c.jsx("input",{type:"radio",checked:P,onChange:()=>J(B),onClick:Y=>Y.stopPropagation(),name:d,style:{accentColor:"#1976d2",width:16,height:16,cursor:"pointer"}})}),o.columns.map(Y=>c.jsx("td",{style:Q.td,children:String(B[Y.key]??"")},Y.key))]},B.value)})})]})}),c.jsxs("div",{style:Q.footer,children:[c.jsx("span",{children:`${(g-1)*l+1}–${(g-1)*l+h.length} of many`}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[c.jsx("button",{type:"button",onClick:()=>{const B=g-1;x(B),V(f,B)},disabled:g<=1,style:Q.pageBtn(g<=1),"aria-label":"Previous page",children:"‹"}),c.jsx("button",{type:"button",onClick:()=>{const B=g+1;x(B),V(f,B)},disabled:!v,style:Q.pageBtn(!v),"aria-label":"Next page",children:"›"})]})]})]}),o.helperText&&!u&&c.jsx("small",{style:oe,children:o.helperText}),u&&c.jsx("small",{"data-testid":`${d}-error`,style:ae,children:r}),E&&c.jsx(ac,{selected:N,onRemove:ee,onClose:()=>F(!1)})]})}class lc{constructor(){this.fields=new Map,this.register({type:"text",label:"Text"}),this.register({type:"textarea",label:"Textarea"}),this.register({type:"number",label:"Number",configSchema:{fields:[{id:"min",type:"number",label:"Minimum limit"},{id:"max",type:"number",label:"Maximum limit"},{id:"step",type:"number",label:"Step size"},{id:"prefix",type:"text",label:"Prefix (e.g. $)"},{id:"suffix",type:"text",label:"Suffix (e.g. USD)"}]}}),this.register({type:"toggle",label:"Toggle/Switch"}),this.register({type:"select",label:"Select"}),this.register({type:"descriptive-select",label:"Descriptive Select"}),this.register({type:"radio-group",label:"Radio Group"}),this.register({type:"key-value",label:"Key-Value"}),this.register({type:"reference",label:"Reference"}),this.register({type:"cron",label:"Cron"}),this.register({type:"object",label:"Object"}),this.register({type:"schema",label:"Schema (nested form)"}),this.register({type:"tabs",label:"Tabs"}),this.register({type:"date",label:"Date"}),this.register({type:"datetime",label:"Date & Time"}),this.register({type:"time",label:"Time"}),this.register({type:"tags",label:"Tags",configSchema:{fields:[{id:"placeholder",type:"text",label:"Placeholder text"},{id:"maxTags",type:"number",label:"Max tags (leave empty for unlimited)"}]}}),this.register({type:"slider",label:"Slider",configSchema:{fields:[{id:"min",type:"number",label:"Minimum value"},{id:"max",type:"number",label:"Maximum value"},{id:"step",type:"number",label:"Step size"},{id:"showValue",type:"toggle",label:"Show current value"},{id:"marks",type:"toggle",label:"Show tick marks"}]}}),this.register({type:"color",label:"Color",configSchema:{fields:[{id:"showHex",type:"toggle",label:"Show hex input"}]}}),this.register({type:"file",label:"File Upload",configSchema:{fields:[{id:"accept",type:"text",label:"Accepted file types (e.g. .pdf,.png)"},{id:"maxSizeMb",type:"number",label:"Max file size (MB)"},{id:"multiple",type:"toggle",label:"Allow multiple files"}]}}),this.register({type:"json-editor",label:"JSON Editor",configSchema:{fields:[{id:"rows",type:"number",label:"Editor height (rows)"}]}}),this.register({type:"code",label:"Code",configSchema:{fields:[{id:"language",type:"select",label:"Language",options:[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"},{value:"json",label:"JSON"}]},{id:"rows",type:"number",label:"Editor height (rows)"}]}}),this.register({type:"rich-text",label:"Rich Text",configSchema:{fields:[{id:"rows",type:"number",label:"Editor height (rows)"},{id:"toolbar",type:"toggle",label:"Show toolbar"}]}}),this.register({type:"table-picker",label:"Table Picker",component:ki,configSchema:{fields:[{id:"label",type:"text",label:"Label"},{id:"required",type:"toggle",label:"Required"},{id:"isMulti",type:"toggle",label:"Multi-select"},{id:"pageSize",type:"number",label:"Page size"}]}})}register(e){this.fields.set(e.type,e),e.component&&q.register(e.type,e.component)}get(e){return this.fields.get(e)}getAll(){return Array.from(this.fields.values())}getTypeOptions(){return this.getAll().map(e=>({value:e.type,label:e.label}))}}const Li=new lc;function Rt(t){const e={};for(const n of t){let i;try{i=Ue(n)}catch{continue}if(!i||n.hidden)continue;if(n.validation){e[i]=n.validation;continue}let r;const s=Li.get(n.type);if(s!=null&&s.buildValidation)r=s.buildValidation(n);else switch(n.type){case"select":case"descriptive-select":case"infinite-select":case"radio-group":{if(n.isMulti===!0){let u=qt();n.required&&(u=u.min(1,`${n.label??i} is required`)),r=u}else{let u=lt();n.required&&(u=u.required(`${n.label??i} is required`)),r=u}break}case"number":case"slider":{let o=ji().typeError(`${n.label??i} must be a number`);n.min!=null&&(o=o.min(n.min,`${n.label??i} must be at least ${n.min}`)),n.max!=null&&(o=o.max(n.max,`${n.label??i} must be at most ${n.max}`)),n.required&&(o=o.required(`${n.label??i} is required`)),r=o;break}case"toggle":case"checkbox":r=wi(),n.required&&(r=r.oneOf([!0],`${n.label??i} must be checked`));break;case"array":case"tags":{let o=qt();n.required&&(o=o.min(1,`${n.label??i} must have at least one item`)),n.maxTags!=null&&(o=o.max(n.maxTags,`${n.label??i} can have at most ${n.maxTags} items`)),r=o;break}case"object":case"schema":{const o=n.children??[];r=o.length>0?Rt(o):Qt(),n.required&&(r=r.required(`${n.label??i} is required`));break}case"date":case"datetime":case"time":{let o=lt();n.required&&(o=o.required(`${n.label??i} is required`)),r=o;break}default:{const o=n.inputType;let u=lt();o==="email"?u=u.email(`${n.label??i} must be a valid email address`):o==="url"&&(u=u.url(`${n.label??i} must be a valid URL`));const a=n.minLength,l=n.maxLength;a!=null&&(u=u.min(a,`${n.label??i} must be at least ${a} characters`)),l!=null&&(u=u.max(l,`${n.label??i} must be at most ${l} characters`)),n.required&&(u=u.trim().required(`${n.label??i} is required`)),r=u;break}}e[i]=r}return Qt().shape(e)}const it="__ff_field__";function uc(t){const e={...t,id:it,name:it},n=Rt([e]);return async i=>{try{await n.validateAt(it,{[it]:i});return}catch(r){return r instanceof le?r.message:"Invalid"}}}function Wi(t){return t.reduce((e,n)=>n.type==="object"?e+Wi(n.children??[]):e+1,0)}function cc(t,e){return t.label?t.label:(e.split(".").pop()??"Group").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function dc(t,e){const n=t===0,i=t===1,r=t>=2;return{marginBottom:e?8:r?10:12,borderRadius:n?"12px":i?"10px":"0px",border:r?"none":"1px solid #E5E7EB",backgroundColor:n?"#FFFFFF":i?"#FAFAFB":"transparent",boxShadow:n?"0 1px 2px rgba(15, 23, 42, 0.04)":"none",padding:0,overflow:"hidden",marginLeft:n?0:i?"10px":"16px"}}function fc(t,e){const n=t===0,i=t===1,r=t>=2;return{display:"flex",alignItems:"center",gap:1,px:n?1.75:i?1.5:.25,py:n?1.35:i?1.1:.75,cursor:"pointer",userSelect:"none",backgroundColor:e?n?"#FCFCFD":i?"rgba(248, 250, 252, 0.92)":"transparent":n?"#FFFFFF":i?"#FAFAFB":"transparent",borderBottom:e&&!r?"1px solid #EEF2F7":"none",transition:"background-color 0.18s ease","&:hover":{backgroundColor:n?"#F8FAFC":i?"#F5F7FA":"rgba(248, 250, 252, 0.75)"}}}function pc({field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,renderFieldRouter:l,item:d}){const[f,b]=p.useState(!0),g=t.children??[],x=Wi(g),h=cc(t,e),m=typeof t.helperText=="string"?t.helperText:void 0,v=`${x} field${x===1?"":"s"}`;return c.jsxs(R.Box,{sx:dc(n,a),children:[c.jsxs(R.Box,{onClick:()=>b(A=>!A),sx:fc(n,f),children:[c.jsx(R.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:18,height:18,color:"#64748B",transform:f?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.18s ease",flexShrink:0},children:c.jsx(U.MdKeyboardArrowRight,{size:16})}),c.jsxs(R.Box,{sx:{flex:1,minWidth:0},children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[c.jsx(R.Typography,{sx:{fontSize:n>=2?13:14,fontWeight:600,lineHeight:1.35,color:"#0F172A",overflowWrap:"anywhere"},children:h}),c.jsx(R.Chip,{label:v,size:"small",sx:{height:20,fontSize:10.5,fontWeight:600,bgcolor:"#F3F4F6",color:"#6B7280","& .MuiChip-label":{px:1}}})]}),m&&c.jsx(R.Typography,{sx:{mt:.35,fontSize:12,lineHeight:1.45,color:"#6c757d",overflowWrap:"anywhere"},children:m})]})]}),c.jsx(R.Box,{sx:{display:f?"block":"none",px:n===0?1.75:n===1?1.5:.25,py:n>=2?.75:1.5},children:c.jsx(R.Box,{sx:{pl:n===0?0:n===1?1:0},children:g.map(A=>{const C=A.id??A.name??"",I=e?`${e}.${C}`:C;return l({field:A,pathPrefix:I,depth:n+1,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:!1,item:d})})})})]})}const Xi=p.createContext(null);function gc(){return p.useContext(Xi)}function bc({field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,renderFieldRouter:l}){var F;const d=t.tabs??[],[f,b]=p.useState(((F=d[0])==null?void 0:F.id)??"");p.useEffect(()=>{d.length!==0&&(d.some(j=>j.id===f)||b(d[0].id))},[d,f]);const g=gc(),x=t.id??t.name??"",h=t.variant??"line",m=t.alignment??"left",v=t.height??"auto",A=t.margin??"normal",C=t.activeColor??"#6366f1",I=t.activeTextColor??(h==="pill"?"#ffffff":C),S=t.inactiveTextColor??"#64748b",y={left:"flex-start","center-left":"flex-start",center:"center","center-right":"flex-end",right:"flex-end"};if(d.length===0)return c.jsxs(R.Box,{sx:{p:2,border:"1px dashed #e2e8f0",borderRadius:2,color:"#94a3b8",fontSize:13},children:["No tabs defined. Add a ",c.jsx("code",{children:"tabs"})," array to this field descriptor."]});const E=d.find(j=>j.id===f)??d[0];return c.jsxs(R.Box,{sx:{mb:A==="none"?0:void 0,height:v==="fixed"?400:void 0,display:v==="fixed"?"flex":void 0,flexDirection:v==="fixed"?"column":void 0},children:[c.jsx(R.Box,{sx:{display:"flex",justifyContent:y[m]??"flex-start",alignItems:"center",gap:0,px:1.5,pt:1.5,borderBottom:"1px solid #e2e8f0",flexShrink:0},children:d.map(j=>{const M=j.id===f,D=e?`${e}.${j.id}`:j.id,N=j.fields.some(_=>{const ee=_.id??_.name??"";return!!`${D}.${ee}`.split(".").reduce((T,z)=>T&&typeof T=="object"?T[z]:void 0,r)}),G={bgcolor:C,color:I,borderRadius:"20px",border:"none"},w={bgcolor:"transparent",color:S,borderRadius:"20px",border:"none"},V={borderBottom:`2px solid ${C}`,color:I,border:"none"},J=h==="pill"?M?G:w:M?V:{borderBottom:"2px solid transparent",color:S,border:"none"};return c.jsxs(R.Box,{component:"button",type:"button",onClick:()=>b(j.id),sx:{...J,background:h==="pill"&&M?C:"none",cursor:"pointer",px:1.5,py:h==="pill"?.5:1,fontSize:13,fontWeight:M?700:500,display:"flex",alignItems:"center",gap:.5,transition:"color .12s, border-color .12s, background .12s","&:hover":{color:h==="pill"&&M?I:C},mb:h==="line"?"-1px":.5,mr:h==="pill"?.5:0},children:[j.label,N&&c.jsx(R.Box,{sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#ef4444",flexShrink:0}})]},j.id)})}),c.jsxs(R.Box,{sx:{p:2,flex:v==="fixed"?1:void 0,overflowY:v==="fixed"?"auto":void 0},children:[c.jsx(R.Box,{className:"ff-form-row",children:E.fields.map((j,M)=>{const D=j.id??j.name??"",G=`${e?`${e}.${E.id}`:E.id}.${D}`;return c.jsxs(R.Box,{sx:{position:"relative",width:"100%"},children:[g&&c.jsx(R.Box,{component:"button",type:"button",onClick:()=>g.removeFieldFromTab(x,E.id,M),title:"Remove field",sx:{position:"absolute",top:4,right:4,zIndex:10,width:18,height:18,borderRadius:"50%",border:"none",background:"#fee2e2",color:"#dc2626",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transition:"opacity .15s",".field-remove-wrapper:hover &":{opacity:1}},className:"field-remove-btn",children:c.jsx(U.MdClose,{size:11})}),l({field:j,pathPrefix:G,depth:n+1,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:!1})]},G)})}),g&&c.jsxs(R.Box,{component:"button",type:"button",onClick:()=>g.openAddFieldDialog(x,E.id),sx:{mt:E.fields.length>0?1.5:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.75,border:"1.5px dashed #c7d2fe",borderRadius:"8px",background:"none",cursor:"pointer",py:1.25,fontSize:13,fontWeight:600,color:"#6366f1",transition:"all .15s","&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[c.jsx(U.MdAdd,{size:15})," Add field to ",E.label]})]})]})}const hc=[{value:"equals",label:"equals"},{value:"notEquals",label:"not equals"},{value:"contains",label:"contains"},{value:"notContains",label:"not contains"},{value:"startsWith",label:"starts with"},{value:"endsWith",label:"ends with"},{value:"isPresent",label:"is present"},{value:"isNotPresent",label:"is not present"},{value:"greaterThan",label:"greater than"},{value:"lessThan",label:"less than"},{value:"greaterOrEquals",label:"greater or equal"},{value:"lessOrEquals",label:"less or equal"}],mc=new Set(["isPresent","isNotPresent","isEmpty","isNotEmpty"]),sr={textTransform:"none",fontSize:12,fontWeight:500,minWidth:0,color:"#111827",bgcolor:"#f9fafb",borderRadius:"6px",boxShadow:"none","&:hover":{bgcolor:"#f3f4f6",boxShadow:"none"},"& .MuiButton-startIcon":{mr:1.25,ml:0,color:"#111827","& svg":{fontSize:17}}};function zi(t){return t.type==="group"}function ar(){return{field:"",fieldLabel:"",operator:"equals",value:"",connector:"and"}}function lr(t){return!mc.has(t)}function Hi(t){return t.reduce((e,n)=>e+(zi(n)?Hi(n.entries):1),0)}function xc({connector:t,onChange:e}){return c.jsx(R.Box,{sx:{display:"flex",gap:"2px"},children:["and","or"].map(n=>c.jsx(R.Box,{component:"button",type:"button",onClick:()=>e(n),"aria-pressed":t===n,"aria-label":n==="and"?"AND — all conditions must match":"OR — any condition must match",sx:{border:"1px solid",borderRadius:"4px",fontSize:10,fontWeight:700,px:"6px",py:"1px",cursor:"pointer",textTransform:"uppercase",letterSpacing:.6,lineHeight:"18px",...t===n?{bgcolor:"#f1f5f9",color:"#374151",borderColor:"#94a3b8"}:{bgcolor:"transparent",color:"#cbd5e1",borderColor:"#e2e8f0"}},children:n},n))})}function vc({colDef:t,entry:e,onChange:n,cellId:i,formValues:r}){const[s,o]=p.useState({}),u=t.id==="value"&&!lr(e.operator);if(t.type==="operator"){const d=q.get("select");return d?c.jsx(d,{field:{id:i,name:i,type:"select",options:hc,label:void 0,placeholder:"Operator…",compact:!0},value:e.operator??"",values:r,onChange:f=>{const b=String(f??"");n({operator:b,...!lr(b)&&{value:""}})},onBlur:()=>{},error:void 0,touched:!1,formulaConfig:s,onFormulaConfigChange:o}):null}const a=q.get(t.type);if(!a)return null;const l=d=>{const f={[t.id]:d};if(t.id==="field"&&t.type==="select"&&Array.isArray(t.options)){const b=t.options.find(g=>String(g.value)===String(d));f.fieldLabel=(b==null?void 0:b.label)??""}n(f)};return c.jsx(a,{field:{...t,id:i,name:i,disabled:u,placeholder:u?"Not required":t.placeholder,label:void 0,compact:!0},value:e[t.id]??"",values:r,onChange:l,onBlur:()=>{},error:void 0,touched:!1,formulaConfig:s,onFormulaConfigChange:o})}function Ic({node:t,conditionDef:e,depth:n,fieldPath:i,onUpdate:r,onRemove:s,formValues:o}){const[u,a]=p.useState(!1),l=Hi(t.entries);return c.jsxs(R.Box,{sx:{border:"1px solid #e9e9e9",borderLeft:"3px solid #d1d5db",borderRadius:"6px",bgcolor:"#f9fafb",overflow:"hidden"},children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:"5px",borderBottom:u?"none":"1px solid #f0f0f0",cursor:"pointer",userSelect:"none"},onClick:()=>a(d=>!d),children:[c.jsx(R.Box,{sx:{color:"#94a3b8",display:"flex",alignItems:"center"},children:u?c.jsx(U.MdKeyboardArrowRight,{size:15}):c.jsx(U.MdKeyboardArrowDown,{size:15})}),c.jsx(R.Typography,{sx:{fontSize:11,fontWeight:700,color:"#94a3b8",fontFamily:"monospace",letterSpacing:-1},children:"( )"}),c.jsxs(R.Typography,{sx:{fontSize:11,color:"#64748b"},children:["Group",u&&c.jsxs(R.Box,{component:"span",sx:{ml:.5,color:"#94a3b8"},children:["· ",l," condition",l!==1?"s":""]})]}),c.jsx(R.Box,{sx:{ml:"auto"},onClick:d=>d.stopPropagation(),children:c.jsx(R.Tooltip,{title:"Remove group",children:c.jsx(R.Box,{component:"button",type:"button",onClick:s,sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",p:"2px"},children:c.jsx(U.MdDeleteOutline,{size:16,color:"#ef4444"})})})})]}),c.jsx(R.Collapse,{in:!u,children:c.jsx(R.Box,{sx:{p:1,pt:.5},children:c.jsx(Zi,{conditionDef:e,entries:t.entries,onUpdate:r,depth:n+1,fieldPath:i,formValues:o})})})]})}function Zi({conditionDef:t,entries:e,onUpdate:n,depth:i=0,fieldPath:r="cond",formValues:s={}}){const o=t.allowGroups===!0&&(t.maxGroupDepth==null||i<t.maxGroupDepth),u=()=>n([...e,ar()]),a=()=>n([...e,{type:"group",connector:"and",entries:[ar()]}]),l=g=>n(e.filter((x,h)=>h!==g)),d=(g,x)=>n(e.map((h,m)=>m===g?{...h,connector:x}:h)),f=(g,x)=>n(e.map((h,m)=>m===g?{...h,...x}:h)),b=(g,x)=>n(e.map((h,m)=>m===g?{...h,entries:x}:h));return c.jsxs(R.Box,{sx:{mt:i===0?1.25:.25},children:[e.map((g,x)=>c.jsxs(R.Box,{children:[x>0&&c.jsx(R.Box,{sx:{display:"flex",alignItems:"center",my:"10px"},children:c.jsx(xc,{connector:g.connector??"and",onChange:h=>d(x,h)})}),zi(g)?c.jsx(Ic,{node:g,conditionDef:t,depth:i,fieldPath:`${r}__g${x}`,onUpdate:h=>b(x,h),onRemove:()=>l(x),formValues:s}):c.jsxs(R.Box,{children:[x===0&&c.jsx(R.Typography,{sx:{fontSize:12,fontWeight:600,color:"#475569",mb:.75},children:"When"}),c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[c.jsx(R.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:.75,flex:1},children:t.fields.map(h=>c.jsx(R.Box,{sx:{gridColumn:`span ${h.colSpan??4}`},children:c.jsx(vc,{colDef:h,entry:g,onChange:m=>f(x,m),cellId:`${r}__${x}__${h.id}`,formValues:s})},h.id))}),c.jsx(R.Tooltip,{title:"Remove condition",children:c.jsx(R.Box,{component:"button",type:"button",onClick:()=>l(x),"aria-label":"Remove condition",sx:{background:"none",border:"none",cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",p:"3px"},children:c.jsx(U.MdDeleteOutline,{size:17,color:"#ef4444","aria-hidden":"true"})})})]})]})]},x)),c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:e.length>0?1.5:0},children:[c.jsx(R.Button,{variant:"contained",startIcon:c.jsx(U.MdAdd,{}),onClick:u,"data-testid":"add-condition-button",className:"ff-form-text-capitalize ff-form-text-12 ff-form-text-dark ff-form-shadow-none ff-form-bg-light",disableElevation:!0,sx:sr,children:"Add"}),o&&c.jsx(R.Button,{variant:"contained",startIcon:c.jsx(U.MdAdd,{}),onClick:a,"data-testid":"add-group-button",disableElevation:!0,sx:sr,children:"Add Group"})]})]})}const ur=()=>{},_i=p.createContext({formulaConfig:{},onFormulaConfigChange:ur,conditionConfig:{},onConditionConfigChange:ur});function Ji({formulaConfig:t,onFormulaConfigChange:e,conditionConfig:n,onConditionConfigChange:i,children:r}){return c.jsx(_i.Provider,{value:{formulaConfig:t,onFormulaConfigChange:e,conditionConfig:n,onConditionConfigChange:i},children:r})}function yc(){return p.useContext(_i)}function we(t,e){return e.split(".").reduce((n,i)=>{if(!(n==null||typeof n!="object"))return n[i]},t)}function Kt(t){if(Array.isArray(t))return t.map(Kt);if(t!==null&&typeof t=="object"){const e={};for(const n of Object.keys(t))e[n]=Kt(t[n]);return e}return!0}const cr="_conditionConfig",Cc="_formulaConfig";function dr({handleRef:t,onSave:e,conditionConfigKey:n}){const i=ve.useFormikContext(),r=p.useRef(i);r.current=i;const s=p.useRef(e);return s.current=e,p.useImperativeHandle(t,()=>({save:async()=>{var d;const o=r.current;o.setTouched(Kt(o.values),!1);const u=await o.validateForm(),a=!u||Object.keys(u).length===0,l={...o.values};return a&&((d=s.current)==null||d.call(s,l,{isValid:a,errors:{}})),{isValid:a,values:l,errors:u??{}}},reset:()=>r.current.resetForm(),validate:async()=>await r.current.validateForm(),setErrors:o=>r.current.setErrors(o),getValues:()=>r.current.values,setValues:o=>r.current.setValues(o)}),[]),null}function Sc({conditionConfigKey:t,formulaConfigKey:e,explicitConditionConfig:n,explicitOnConditionConfigChange:i,explicitFormulaConfig:r,explicitOnFormulaConfigChange:s,children:o}){const u=ve.useFormikContext(),a=n??we(u.values,t)??{},l=b=>{if(i){i(b);return}u.setFieldValue(t,b,!1)},d=r??we(u.values,e)??{},f=b=>{if(s){s(b);return}u.setFieldValue(e,b,!1)};return c.jsx(Ji,{conditionConfig:a,onConditionConfigChange:l,formulaConfig:d,onFormulaConfigChange:f,children:o})}function Ac({onValuesChange:t}){const{values:e}=ve.useFormikContext();return p.useEffect(()=>{t(e)},[e,t]),null}function Rc({onValidityChange:t}){const{isValid:e}=ve.useFormikContext();return p.useEffect(()=>{t(e)},[e,t]),null}const Yi=p.forwardRef(function(e,n){var a;if("form"in e&&e.form){const{form:l}=e;return c.jsx(ve.FormikProvider,{value:l._formik,children:c.jsxs(Ji,{formulaConfig:l._formulaConfig,onFormulaConfigChange:l._onFormulaConfigChange,conditionConfig:l._conditionConfig,onConditionConfigChange:l._onConditionConfigChange,children:[c.jsx(dr,{handleRef:n,conditionConfigKey:cr}),c.jsx(fr,{schema:l._schema,formik:l._formik})]})})}const i=e.conditionConfigKey??cr,r=e.formulaConfigKey??Cc,s=l=>c.jsxs(c.Fragment,{children:[c.jsx(dr,{handleRef:n,onSave:e.onSave,conditionConfigKey:i}),c.jsx(Sc,{conditionConfigKey:i,formulaConfigKey:r,explicitConditionConfig:e.conditionConfig,explicitOnConditionConfigChange:e.onConditionConfigChange,explicitFormulaConfig:e.formulaConfig,explicitOnFormulaConfigChange:e.onFormulaConfigChange,children:l})]});let u=e.formik?c.jsx(ve.FormikProvider,{value:e.formik,children:s(c.jsx(fr,{schema:e.schema,formik:e.formik}))}):c.jsx(ve.Formik,{initialValues:e.initialValues,onSubmit:e.onSubmit,validationSchema:e.validationSchema??((a=e.schema)!=null&&a.fields?Rt(e.schema.fields):void 0),initialTouched:e.initialTouched,validateOnMount:!!e.initialTouched,enableReinitialize:!0,validateOnChange:!0,validateOnBlur:!0,children:({values:l,errors:d,touched:f,isSubmitting:b,setFieldValue:g,setFieldTouched:x})=>{var h;return c.jsxs(ve.Form,{id:e.formId,children:[e.onValuesChange&&c.jsx(Ac,{onValuesChange:e.onValuesChange}),e.onValidityChange&&c.jsx(Rc,{onValidityChange:e.onValidityChange}),s(c.jsx(Ui,{schema:e.schema,values:l,errors:d,touched:f,setFieldValue:g,setFieldTouched:x})),(h=e.children)==null?void 0:h.call(e,{isSubmitting:b})]})}});return e.variableGroups&&(u=c.jsx(Cr,{groups:e.variableGroups,children:u})),"optionsResolvers"in e&&e.optionsResolvers&&(u=c.jsx(ci,{resolvers:e.optionsResolvers,children:u})),c.jsx(c.Fragment,{children:u})});function fr({schema:t,formik:e}){return c.jsx(Ui,{schema:t,values:e.values,errors:e.errors,touched:e.touched,setFieldValue:e.setFieldValue,setFieldTouched:e.setFieldTouched})}class $i extends p.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(e){return{error:e.message}}render(){return this.state.error?null:this.props.children}}function Ui({schema:t,values:e,errors:n,touched:i,setFieldValue:r,setFieldTouched:s}){const o=t.layout??"flat",u=t.compact??!1;if(o==="stepper"&&Array.isArray(t.steps)&&t.steps.length>0)return c.jsx(Ec,{steps:t.steps,compact:u,values:e,errors:n,touched:i,setFieldValue:r,setFieldTouched:s});const a=o==="flat"?t.fields??[]:[];return c.jsx("div",{className:"ff-form-grid",children:a.map(l=>{const d=Ue(l);return c.jsx($i,{fieldId:d,children:c.jsx(Ye,{field:l,pathPrefix:d,depth:0,values:e,errors:n,touched:i,setFieldValue:r,setFieldTouched:s,compact:u})},d)})})}function Ec({steps:t,compact:e,values:n,errors:i,touched:r,setFieldValue:s,setFieldTouched:o}){const[u,a]=p.useState(0),l=t[u]??t[0],d=p.useMemo(()=>{const f=x=>x.flatMap(h=>{const m=Ue(h),v=Array.isArray(h.children)?f(h.children):[];return[m,...v]}),b=new Set(f(l.fields)),g=(x,h="")=>{for(const[m,v]of Object.entries(x??{})){const A=h?`${h}.${m}`:m;if(b.has(A)&&v||v&&typeof v=="object"&&g(v,A))return!0}return!1};return g(i)},[i,l]);return c.jsxs("div",{className:"ff-form-grid",children:[c.jsx("div",{style:{marginBottom:16,paddingTop:4},children:c.jsx("div",{style:{display:"flex",alignItems:"center",position:"relative"},children:t.map((f,b)=>{const g=b<u,x=b===u,h=b<=u,m=g||x?"#1976d2":"#e2e8f0",v=g||x?"#fff":"#64748b";return c.jsxs(p.Fragment,{children:[c.jsxs("div",{onClick:()=>h&&a(b),style:{display:"flex",flexDirection:"column",alignItems:"center",cursor:h?"pointer":"default",minWidth:100},children:[c.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",background:m,color:v,fontSize:13,fontWeight:700,transition:"background 120ms"},children:g?"✓":b+1}),c.jsx("span",{style:{marginTop:8,fontSize:13,fontWeight:x?700:500,color:x?"#0f172a":"#64748b",textAlign:"center"},children:f.label})]}),b<t.length-1&&c.jsx("div",{style:{flex:1,height:2,background:b<u?"#1976d2":"#e2e8f0",marginTop:-22,alignSelf:"flex-start",transform:"translateY(14px)",transition:"background 120ms"}})]},b)})})}),l.hint&&c.jsx("div",{style:{fontSize:12,color:"#64748b",marginBottom:12},children:l.hint}),l.fields.map(f=>{const b=Ue(f);return c.jsx($i,{fieldId:b,children:c.jsx(Ye,{field:f,pathPrefix:b,depth:0,values:n,errors:i,touched:r,setFieldValue:s,setFieldTouched:o,compact:e})},b)}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:16},children:[c.jsx("button",{type:"button",disabled:u===0,onClick:()=>a(f=>Math.max(0,f-1)),style:{padding:"8px 16px",borderRadius:6,border:"1px solid #e5e7eb",background:"#fff",cursor:u===0?"not-allowed":"pointer",opacity:u===0?.5:1,fontSize:13},children:"← Back"}),u<t.length-1?c.jsx("button",{type:"button",disabled:d,onClick:()=>a(f=>Math.min(t.length-1,f+1)),style:{padding:"8px 16px",borderRadius:6,border:"none",background:d?"#cbd5e1":"#1976d2",color:"#fff",cursor:d?"not-allowed":"pointer",fontSize:13,fontWeight:600},children:"Next →"}):c.jsx("span",{})]})]})}function Ye({field:t,pathPrefix:e,depth:n=0,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:l,item:d}){var S;const{formulaConfig:f,onFormulaConfigChange:b,conditionConfig:g,onConditionConfigChange:x}=yc(),h={values:i,item:d},m=p.useRef(i);m.current=i;const v=p.useRef(d);v.current=d;const A=p.useMemo(()=>{const y=uc(t);return async E=>{var j;const F={values:m.current,item:v.current};if(!(((j=t.shouldHide)==null?void 0:j.call(t,F))??t.hidden))return y(E)}},[t]);ve.useField({name:e,validate:A});const C=((S=t.shouldHide)==null?void 0:S.call(t,h))??t.hidden??!1,I=p.useRef(void 0);return p.useEffect(()=>{const y=I.current;if(I.current=C,!C||y===!0||!t.clearOnHide)return;const E=we(m.current,e);E==null||E===""||Array.isArray(E)&&E.length===0||o(e,t.defaultValue)},[C,e,t.clearOnHide,t.defaultValue,o]),C?null:t.type==="object"?c.jsx(Je,{field:t,compact:a,children:c.jsx(pc,{field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,item:d,renderFieldRouter:y=>c.jsx(Ye,{field:y.field,pathPrefix:y.pathPrefix,depth:y.depth,values:y.values,errors:y.errors,touched:y.touched,setFieldValue:y.setFieldValue,setFieldTouched:y.setFieldTouched,compact:y.compact,inlineLabel:y.inlineLabel,item:y.item},y.pathPrefix)})}):t.type==="array"&&Array.isArray(t.children??t.itemFields)?c.jsx(Je,{field:t,compact:a,children:c.jsx(St,{field:t,value:we(i,e),values:i,onChange:y=>o(e,y),onBlur:()=>u(e,!0),pathPrefix:e,depth:n,compact:a,parentErrors:r,parentTouched:s,parentSetFieldValue:o,parentSetFieldTouched:u,renderFieldRouter:y=>c.jsx(Ye,{field:y.field,pathPrefix:y.pathPrefix,depth:y.depth,values:y.values,errors:y.errors,touched:y.touched,setFieldValue:y.setFieldValue,setFieldTouched:y.setFieldTouched,compact:y.compact,inlineLabel:y.inlineLabel,item:y.item},y.pathPrefix)})}):t.type==="tabs"?c.jsx(Je,{field:t,compact:a,children:c.jsx(bc,{field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,renderFieldRouter:y=>c.jsx(Ye,{field:y.field,pathPrefix:y.pathPrefix,depth:y.depth,values:y.values,errors:y.errors,touched:y.touched,setFieldValue:y.setFieldValue,setFieldTouched:y.setFieldTouched,compact:y.compact,inlineLabel:y.inlineLabel,item:y.item},y.pathPrefix)})}):c.jsx(Oc,{field:t,pathPrefix:e,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:l,item:d,formulaConfig:f,onFormulaConfigChange:b,conditionConfig:g,onConditionConfigChange:x})}function Oc({field:t,pathPrefix:e,values:n,errors:i,touched:r,setFieldValue:s,setFieldTouched:o,compact:u,inlineLabel:a,item:l,formulaConfig:d,onFormulaConfigChange:f,conditionConfig:b,onConditionConfigChange:g}){var N,G,w;const x={values:n,item:l},h=we(n,e),m=p.useRef(t.compute);m.current=t.compute,p.useEffect(()=>{const V=m.current;if(!V)return;const W=V({values:n});W!==h&&s(e,W)},[n,h,e,s]);const v=q.get(t.type);if(!v)return null;const A=typeof t.disabled=="function"?t.disabled(x):((N=t.shouldDisable)==null?void 0:N.call(t,x))??t.disabled??!1,C=we(i,e),I=!!we(r,e),S=(G=t.compute)==null?void 0:G.call(t,x),y=S!==void 0?S:h,E=(w=t.transform)!=null&&w.in?t.transform.in(y):y,F=V=>{var J,_;if(t.compute)return;const W=(J=t.transform)!=null&&J.out?t.transform.out(V):V;s(e,W),o(e,!0),(_=t.onChange)==null||_.call(t,W,{values:n,setFieldValue:s})},j=t.condition&&b?b[e]??[]:[],M=V=>{if(!(!g||!b))if(V.length===0){const W={...b};delete W[e],g(W)}else g({...b,[e]:V})},D={field:{...t,disabled:A,id:e,name:e},value:E,values:n,onChange:F,onBlur:()=>o(e,!0),error:C,touched:I,formulaConfig:d,onFormulaConfigChange:f};return a?c.jsx(v,{...D,inlineLabel:!0}):c.jsxs(Je,{field:t,compact:u,children:[c.jsx(v,{...D,touched:I}),t.condition&&c.jsx(Zi,{conditionDef:t.condition,entries:j,onUpdate:M,fieldPath:e,formValues:n})]})}const Fc=Yi;exports.DynamicFormRenderer=Fc;exports.FF=O;exports.FlowForgeRegistry=Li;exports.FlowForm=Yi;exports.FormulaInput=un;exports.InfiniteSelectField=mi;exports.OptionsResolversProvider=ci;exports.TablePickerField=ki;exports.TabsEditContext=Xi;exports.VariablePicker=Ao;exports.VariablePickerProvider=Cr;exports._extends=H;exports._objectWithoutPropertiesLoose=Tr;exports.astHasRefs=bo;exports.astToTokens=nn;exports.buildEvaluationPayload=uo;exports.buildFieldConfig=tn;exports.buildFormulaPath=oo;exports.buildSelectStyles=en;exports.buildValidationSchema=Rt;exports.commonjsGlobal=pu;exports.dataSourceRegistry=Mi;exports.errorTextStyle=ae;exports.extractLabel=gr;exports.fieldRegistry=q;exports.getDefaultExportFromCjs=xi;exports.hasFormulaTokens=go;exports.helperTextStyle=oe;exports.inputStyle=to;exports.isFormula=ho;exports.parseToAST=Ae;exports.resolveFieldKey=Ue;exports.serializeAST=Re;exports.serializeASTAsConfig=$e;exports.serializeConditionExpressions=po;exports.stripFormulaTokens=vo;exports.tokenize=vr;exports.unwrapFormula=xo;exports.useDynamicOptions=di;exports.useOptionsResolvers=Tl;exports.useVariablePickerContext=Le;exports.wrapFormula=mo;
10
- //# sourceMappingURL=index-BypSWEYO.js.map
9
+ `+(u!==o?`result of cast: ${u}`:""))}return s}_cast(e,n){let i=e===void 0?e:this.transforms.reduce((r,s)=>s.call(this,r,e,this,n),e);return i===void 0&&(i=this.getDefault(n)),i}_validate(e,n={},i,r){let{path:s,originalValue:o=e,strict:u=this.spec.strict}=n,a=e;u||(a=this._cast(a,Object.assign({assert:!1},n)));let l=[];for(let d of Object.values(this.internalTests))d&&l.push(d);this.runTests({path:s,value:a,originalValue:o,options:n,tests:l},i,d=>{if(d.length)return r(d,a);this.runTests({path:s,value:a,originalValue:o,options:n,tests:this.tests},i,r)})}runTests(e,n,i){let r=!1,{tests:s,value:o,originalValue:u,path:a,options:l}=e,d=h=>{r||(r=!0,n(h,o))},f=h=>{r||(r=!0,i(h,o))},b=s.length,g=[];if(!b)return f([]);let x={value:o,originalValue:u,path:a,options:l,schema:this};for(let h=0;h<s.length;h++){const m=s[h];m(x,d,function(A){A&&(Array.isArray(A)?g.push(...A):g.push(A)),--b<=0&&f(g)})}}asNestedTest({key:e,index:n,parent:i,parentPath:r,originalParent:s,options:o}){const u=e??n;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const a=typeof u=="number";let l=i[u];const d=Object.assign({},o,{strict:!0,parent:i,value:l,originalValue:s[u],key:void 0,[a?"index":"key"]:u,path:a||u.includes(".")?`${r||""}[${a?u:`"${u}"`}]`:(r?`${r}.`:"")+e});return(f,b,g)=>this.resolve(d)._validate(l,d,b,g)}validate(e,n){var i;let r=this.resolve(Object.assign({},n,{value:e})),s=(i=n==null?void 0:n.disableStackTrace)!=null?i:r.spec.disableStackTrace;return new Promise((o,u)=>r._validate(e,n,(a,l)=>{le.isError(a)&&(a.value=l),u(a)},(a,l)=>{a.length?u(new le(a,l,void 0,void 0,s)):o(l)}))}validateSync(e,n){var i;let r=this.resolve(Object.assign({},n,{value:e})),s,o=(i=n==null?void 0:n.disableStackTrace)!=null?i:r.spec.disableStackTrace;return r._validate(e,Object.assign({},n,{sync:!0}),(u,a)=>{throw le.isError(u)&&(u.value=a),u},(u,a)=>{if(u.length)throw new le(u,e,void 0,void 0,o);s=a}),s}isValid(e,n){return this.validate(e,n).then(()=>!0,i=>{if(le.isError(i))return!1;throw i})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(i){if(le.isError(i))return!1;throw i}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):Ne(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const i=this.clone({nullable:e});return i.internalTests.nullable=Ve({message:n,name:"nullable",test(r){return r===null?this.schema.spec.nullable:!0}}),i}optionality(e,n){const i=this.clone({optional:e});return i.internalTests.optionality=Ve({message:n,name:"optionality",test(r){return r===void 0?this.schema.spec.optional:!0}}),i}optional(){return this.optionality(!0)}defined(e=he.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=he.notNull){return this.nullability(!1,e)}required(e=he.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=he.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),r=Ve(n),s=n.exclusive||n.name&&i.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(i.exclusiveTests[n.name]=!!n.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===r.OPTIONS.test))),i.tests.push(r),i}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let i=this.clone(),r=Ci(e).map(s=>new Te(s));return r.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(typeof n=="function"?new xt(r,n):xt.fromOptions(r,n)),i}typeError(e){let n=this.clone();return n.internalTests.typeError=Ve({message:e,name:"typeError",skipAbsent:!0,test(i){return this.schema._typeCheck(i)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=he.oneOf){let i=this.clone();return e.forEach(r=>{i._whitelist.add(r),i._blacklist.delete(r)}),i.internalTests.whiteList=Ve({message:n,name:"oneOf",skipAbsent:!0,test(r){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(r)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),i}notOneOf(e,n=he.notOneOf){let i=this.clone();return e.forEach(r=>{i._blacklist.add(r),i._whitelist.delete(r)}),i.internalTests.blacklist=Ve({message:n,name:"notOneOf",test(r){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(r)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),i}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:i,meta:r,optional:s,nullable:o}=n.spec;return{meta:r,label:i,optional:s,nullable:o,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((a,l,d)=>d.findIndex(f=>f.OPTIONS.name===a.OPTIONS.name)===l).map(a=>{const l=a.OPTIONS.params&&e?Ei(Object.assign({},a.OPTIONS.params),e):a.OPTIONS.params;return{name:a.OPTIONS.name,params:l}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(i){try{return{value:await e.validate(i,{abortEarly:!1})}}catch(r){if(r instanceof le)return{issues:Fi(r)};throw r}}}}}de.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])de.prototype[`${t}At`]=function(e,n,i={}){const{parent:r,parentPath:s,schema:o}=ku(this,e,n,i.context);return o[t](r&&r[s],Object.assign({},i,{parent:r,path:e}))};for(const t of["equals","is"])de.prototype[t]=de.prototype.oneOf;for(const t of["not","nope"])de.prototype[t]=de.prototype.notOneOf;function wi(){return new Bi}class Bi extends de{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,n)=>{if(this.spec.coerce&&!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=$t.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return fe(n)||n===!0}})}isFalse(e=$t.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return fe(n)||n===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}wi.prototype=Bi.prototype;const Xu=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function zu(t){const e=Ut(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function Ut(t){var e,n;const i=Xu.exec(t);return i?{year:xe(i[1]),month:xe(i[2],1)-1,day:xe(i[3],1),hour:xe(i[4]),minute:xe(i[5]),second:xe(i[6]),millisecond:i[7]?xe(i[7].substring(0,3)):0,precision:(e=(n=i[7])==null?void 0:n.length)!=null?e:void 0,z:i[8]||void 0,plusMinus:i[9]||void 0,hourOffset:xe(i[10]),minuteOffset:xe(i[11])}:null}function xe(t,e=0){return Number(t)||e}let Hu=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Zu=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,_u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ju="^\\d{4}-\\d{2}-\\d{2}",Yu="\\d{2}:\\d{2}:\\d{2}",$u="(([+-]\\d{2}(:?\\d{2})?)|Z)",Uu=new RegExp(`${Ju}T${Yu}(\\.\\d+)?${$u}$`),Qu=t=>fe(t)||t===t.trim(),qu={}.toString();function lt(){return new Ti}class Ti extends de{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const i=e!=null&&e.toString?e.toString():e;return i===qu?e:i})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||he.required,name:"required",skipAbsent:!0,test:i=>!!i.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=ue.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n=ue.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n=ue.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}matches(e,n){let i=!1,r,s;return n&&(typeof n=="object"?{excludeEmptyString:i=!1,message:r,name:s}=n:r=n),this.test({name:s||"matches",message:r||ue.matches,params:{regex:e},skipAbsent:!0,test:o=>o===""&&i||o.search(e)!==-1})}email(e=ue.email){return this.matches(Hu,{name:"email",message:e,excludeEmptyString:!0})}url(e=ue.url){return this.matches(Zu,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ue.uuid){return this.matches(_u,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",i,r;return e&&(typeof e=="object"?{message:n="",allowOffset:i=!1,precision:r=void 0}=e:n=e),this.matches(Uu,{name:"datetime",message:n||ue.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ue.datetime_offset,params:{allowOffset:i},skipAbsent:!0,test:s=>{if(!s||i)return!0;const o=Ut(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||ue.datetime_precision,params:{precision:r},skipAbsent:!0,test:s=>{if(!s||r==null)return!0;const o=Ut(s);return o?o.precision===r:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ue.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Qu})}lowercase(e=ue.lowercase){return this.transform(n=>fe(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>fe(n)||n===n.toLowerCase()})}uppercase(e=ue.uppercase){return this.transform(n=>fe(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>fe(n)||n===n.toUpperCase()})}}lt.prototype=Ti.prototype;let Ku=t=>t!=+t;function Gi(){return new ji}class ji extends de{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!Ku(e)}}),this.withMutation(()=>{this.transform((e,n)=>{if(!this.spec.coerce)return e;let i=e;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return this.isType(i)||i===null?i:parseFloat(i)})})}min(e,n=Se.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(e)}})}max(e,n=Se.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(e)}})}lessThan(e,n=Se.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(i){return i<this.resolve(e)}})}moreThan(e,n=Se.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(i){return i>this.resolve(e)}})}positive(e=Se.positive){return this.moreThan(0,e)}negative(e=Se.negative){return this.lessThan(0,e)}integer(e=Se.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(e=>fe(e)?e:e|0)}round(e){var n;let i=["ceil","floor","round","trunc"];if(e=((n=e)==null?void 0:n.toLowerCase())||"round",e==="trunc")return this.truncate();if(i.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+i.join(", "));return this.transform(r=>fe(r)?r:Math[e](r))}}Gi.prototype=ji.prototype;let ec=new Date(""),tc=t=>Object.prototype.toString.call(t)==="[object Date]";class yn extends de{constructor(){super({type:"date",check(e){return tc(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=zu(e),isNaN(e)?yn.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let i;if(Te.isRef(e))i=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);i=r}return i}min(e,n=Yt.min){let i=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r>=this.resolve(i)}})}max(e,n=Yt.max){let i=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(r){return r<=this.resolve(i)}})}}yn.INVALID_DATE=ec;function nc(t,e=[]){let n=[],i=new Set,r=new Set(e.map(([o,u])=>`${o}-${u}`));function s(o,u){let a=Fe.split(o)[0];i.add(a),r.has(`${u}-${a}`)||n.push([u,a])}for(const o of Object.keys(t)){let u=t[o];i.add(o),Te.isRef(u)&&u.isSibling?s(u.path,o):At(u)&&"deps"in u&&u.deps.forEach(a=>s(a,o))}return Bu.array(Array.from(i),n).reverse()}function nr(t,e){let n=1/0;return t.some((i,r)=>{var s;if((s=e.path)!=null&&s.includes(i))return n=r,!0}),n}function Vi(t){return(e,n)=>nr(t,e)-nr(t,n)}const Di=(t,e,n)=>{if(typeof t!="string")return t;let i=t;try{i=JSON.parse(t)}catch{}return n.isType(i)?i:t};function ut(t){if("fields"in t){const e={};for(const[n,i]of Object.entries(t.fields))e[n]=ut(i);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=ut(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(ut)}):"optional"in t?t.optional():t}const rc=(t,e)=>{const n=[...Fe.normalizePath(e)];if(n.length===1)return n[0]in t;let i=n.pop(),r=Fe.getter(Fe.join(n),!0)(t);return!!(r&&i in r)};let rr=t=>Object.prototype.toString.call(t)==="[object Object]";function ir(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(i=>n.indexOf(i)===-1)}const ic=Vi([]);function Qt(t){return new Pi(t)}class Pi extends de{constructor(e){super({type:"object",check(n){return rr(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=ic,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var i;let r=super._cast(e,n);if(r===void 0)return this.getDefault(n);if(!this._typeCheck(r))return r;let s=this.fields,o=(i=n.stripUnknown)!=null?i:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(r).filter(f=>!this._nodes.includes(f))),a={},l=Object.assign({},n,{parent:a,__validating:n.__validating||!1}),d=!1;for(const f of u){let b=s[f],g=f in r,x=r[f];if(b){let h;l.path=(n.path?`${n.path}.`:"")+f,b=b.resolve({value:x,context:n.context,parent:a});let m=b instanceof de?b.spec:void 0,v=m==null?void 0:m.strict;if(m!=null&&m.strip){d=d||f in r;continue}h=!n.__validating||!v?b.cast(x,l):x,h!==void 0&&(a[f]=h)}else g&&!o&&(a[f]=x);(g!==f in a||a[f]!==x)&&(d=!0)}return d?a:r}_validate(e,n={},i,r){let{from:s=[],originalValue:o=e,recursive:u=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(e,n,i,(a,l)=>{if(!u||!rr(l)){r(a,l);return}o=o||l;let d=[];for(let f of this._nodes){let b=this.fields[f];!b||Te.isRef(b)||d.push(b.asNestedTest({options:n,key:f,parent:l,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:l,originalValue:o,options:n},i,f=>{r(f.sort(this._sortErrors).concat(a),l)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),i=n.fields;for(let[r,s]of Object.entries(this.fields)){const o=i[r];i[r]=o===void 0?s:o}return n.withMutation(r=>r.setFields(i,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(i=>{var r;const s=this.fields[i];let o=e;(r=o)!=null&&r.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[i]})),n[i]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(e,n){let i=this.clone();return i.fields=e,i._nodes=nc(e,n),i._sortErrors=Vi(Object.keys(e)),n&&(i._excludedEdges=n),i}shape(e,n=[]){return this.clone().withMutation(i=>{let r=i._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),r=[...i._excludedEdges,...n]),i.setFields(Object.assign(i.fields,e),r)})}partial(){const e={};for(const[n,i]of Object.entries(this.fields))e[n]="optional"in i&&i.optional instanceof Function?i.optional():i;return this.setFields(e)}deepPartial(){return ut(this)}pick(e){const n={};for(const i of e)this.fields[i]&&(n[i]=this.fields[i]);return this.setFields(n,this._excludedEdges.filter(([i,r])=>e.includes(i)&&e.includes(r)))}omit(e){const n=[];for(const i of Object.keys(this.fields))e.includes(i)||n.push(i);return this.pick(n)}from(e,n,i){let r=Fe.getter(e,!0);return this.transform(s=>{if(!s)return s;let o=s;return rc(s,e)&&(o=Object.assign({},s),i||delete o[e],o[n]=r(s)),o})}json(){return this.transform(Di)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||st.exact,test(n){if(n==null)return!0;const i=ir(this.schema,n);return i.length===0||this.createError({params:{properties:i.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=st.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:n,test(r){if(r==null)return!0;const s=ir(this.schema,r);return!e||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,n=st.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const i={};for(const r of Object.keys(n))i[e(r)]=n[r];return i})}camelCase(){return this.transformKeys(kt.camelCase)}snakeCase(){return this.transformKeys(kt.snakeCase)}constantCase(){return this.transformKeys(e=>kt.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);i.fields={};for(const[s,o]of Object.entries(n.fields)){var r;let u=e;(r=u)!=null&&r.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[s]})),i.fields[s]=o.describe(u)}return i}}Qt.prototype=Pi.prototype;function qt(t){return new Ni(t)}class Ni extends de{constructor(e){super({type:"array",spec:{types:e},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=e}_cast(e,n){const i=super._cast(e,n);if(!this._typeCheck(i)||!this.innerType)return i;let r=!1;const s=i.map((o,u)=>{const a=this.innerType.cast(o,Object.assign({},n,{path:`${n.path||""}[${u}]`,parent:i,originalValue:o,value:o,index:u}));return a!==o&&(r=!0),a});return r?s:i}_validate(e,n={},i,r){var s;let o=this.innerType,u=(s=n.recursive)!=null?s:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(e,n,i,(a,l)=>{var d;if(!u||!o||!this._typeCheck(l)){r(a,l);return}let f=new Array(l.length);for(let g=0;g<l.length;g++){var b;f[g]=o.asNestedTest({options:n,index:g,parent:l,parentPath:n.path,originalParent:(b=n.originalValue)!=null?b:e})}this.runTests({value:l,tests:f,originalValue:(d=n.originalValue)!=null?d:e,options:n},i,g=>r(g.concat(a),l))})}clone(e){const n=super.clone(e);return n.innerType=this.innerType,n}json(){return this.transform(Di)}concat(e){let n=super.concat(e);return n.innerType=this.innerType,e.innerType&&(n.innerType=n.innerType?n.innerType.concat(e.innerType):e.innerType),n}of(e){let n=this.clone();if(!At(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ye(e));return n.innerType=e,n.spec=Object.assign({},n.spec,{types:e}),n}length(e,n=at.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(i){return i.length===this.resolve(e)}})}min(e,n){return n=n||at.min,this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i.length>=this.resolve(e)}})}max(e,n){return n=n||at.max,this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,n)=>this._typeCheck(e)?e:n==null?[]:[].concat(n))}compact(e){let n=e?(i,r,s)=>!e(i,r,s):i=>!!i;return this.transform(i=>i!=null?i.filter(n):i)}describe(e){const n=(e?this.resolve(e):this).clone(),i=super.describe(e);if(n.innerType){var r;let s=e;(r=s)!=null&&r.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[0]})),i.innerType=n.innerType.describe(s)}return i}}qt.prototype=Ni.prototype;function Ue(t){const e=t.id??t.name;if(!e)throw new Error("[FlowForge] Field descriptor is missing both 'id' and 'name'");return e}class oc{constructor(){this.sources=new Map}register(e,n){this.sources.set(e,n)}get(e){return this.sources.get(e)}has(e){return this.sources.has(e)}}const Mi=new oc,sc=8,Q={wrapper:t=>({border:`1px solid ${t?O.BORDER_COLOR_ERROR:O.BORDER_COLOR}`,borderRadius:O.BORDER_RADIUS,overflow:"hidden",background:"#fff",fontSize:13}),toolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",borderBottom:"1px solid #e0e0e0",minHeight:40,background:"#fff"},selectedLink:{fontSize:13,color:"#1976d2",cursor:"pointer",background:"none",border:"none",padding:0,fontWeight:500},searchWrap:{display:"flex",alignItems:"center",gap:6,border:"1px solid #e0e0e0",borderRadius:4,padding:"3px 8px",background:"#fafafa",flex:"0 0 220px"},searchInput:{border:"none",outline:"none",fontSize:13,background:"transparent",width:"100%"},table:{width:"100%",borderCollapse:"collapse"},thead:{background:"#f5f5f5"},th:t=>({textAlign:"left",padding:"0 16px",height:44,fontSize:12,fontWeight:600,color:"rgba(0,0,0,0.6)",borderBottom:"1px solid #e0e0e0",whiteSpace:"nowrap",width:t,letterSpacing:"0.01em"}),checkTh:{width:48,padding:"0 0 0 12px",height:44,borderBottom:"1px solid #e0e0e0",background:"#f5f5f5"},td:{padding:"0 16px",height:48,borderBottom:"1px solid #f0f0f0",color:"rgba(0,0,0,0.87)",verticalAlign:"middle"},checkTd:{padding:"0 0 0 12px",height:48,borderBottom:"1px solid #f0f0f0",verticalAlign:"middle",width:48},statusRow:{textAlign:"center",padding:"24px 16px",color:"rgba(0,0,0,0.38)",fontSize:13},footer:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:16,padding:"4px 8px",borderTop:"1px solid #e0e0e0",fontSize:12,color:"rgba(0,0,0,0.6)",background:"#fafafa",minHeight:40},pageBtn:t=>({display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",border:"none",background:"transparent",cursor:t?"default":"pointer",color:t?"rgba(0,0,0,0.26)":"rgba(0,0,0,0.54)",fontSize:16,transition:"background 0.15s"}),overlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},modal:{background:"#fff",borderRadius:8,width:560,maxWidth:"90vw",maxHeight:"80vh",display:"flex",flexDirection:"column",boxShadow:"0 8px 32px rgba(0,0,0,0.18)"},modalHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e0e0e0",fontSize:16,fontWeight:600,color:"rgba(0,0,0,0.87)"},modalCloseBtn:{background:"none",border:"none",cursor:"pointer",color:"rgba(0,0,0,0.54)",display:"flex",alignItems:"center",padding:4,borderRadius:4},modalSearch:{display:"flex",alignItems:"center",gap:8,margin:"12px 20px",border:"1px solid #e0e0e0",borderRadius:20,padding:"6px 12px",background:"#fafafa"},modalSearchInput:{flex:1,border:"none",outline:"none",fontSize:14,background:"transparent"},modalList:{flex:1,overflowY:"auto",padding:"0 20px 8px"},modalRow:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 0",borderBottom:"1px solid #f0f0f0",fontSize:14,color:"rgba(0,0,0,0.87)"},modalRemoveBtn:{background:"none",border:"none",cursor:"pointer",color:"#e53935",display:"flex",alignItems:"center",padding:2,borderRadius:4,flexShrink:0},modalFooter:{display:"flex",justifyContent:"flex-end",padding:"12px 20px",borderTop:"1px solid #e0e0e0"},closeBtn:{padding:"6px 20px",border:"1px solid #e0e0e0",borderRadius:4,background:"#fff",cursor:"pointer",fontSize:14,color:"rgba(0,0,0,0.87)"}};function or({checked:t,onChange:e,indeterminate:n,disabled:i}){const r=p.useRef(null);return p.useEffect(()=>{r.current&&(r.current.indeterminate=!!n)},[n]),c.jsx("input",{ref:r,type:"checkbox",checked:t,onChange:e,disabled:i,style:{width:16,height:16,cursor:i?"default":"pointer",accentColor:"#1976d2"}})}function ac({selected:t,onRemove:e,onClose:n}){const[i,r]=p.useState(""),s=t.filter(o=>o.label.toLowerCase().includes(i.toLowerCase()));return c.jsx("div",{style:Q.overlay,onClick:n,children:c.jsxs("div",{style:Q.modal,onClick:o=>o.stopPropagation(),children:[c.jsxs("div",{style:Q.modalHeader,children:[c.jsx("span",{children:"Selected Rows"}),c.jsx("button",{type:"button",style:Q.modalCloseBtn,onClick:n,children:c.jsx(U.MdClose,{size:20})})]}),c.jsxs("div",{style:Q.modalSearch,children:[c.jsx(U.MdSearch,{size:18,color:"rgba(0,0,0,0.38)"}),c.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search",value:i,onChange:o=>r(o.target.value),style:Q.modalSearchInput})]}),c.jsxs("div",{style:Q.modalList,children:[s.length===0&&c.jsx("div",{style:{textAlign:"center",padding:"24px 0",color:"rgba(0,0,0,0.38)",fontSize:13},children:"No items found"}),s.map(o=>c.jsxs("div",{style:Q.modalRow,children:[c.jsx("span",{children:o.label}),c.jsx("button",{type:"button",style:Q.modalRemoveBtn,onClick:()=>e(o.value),title:"Remove",children:c.jsx(U.MdClose,{size:16})})]},o.value))]}),c.jsx("div",{style:Q.modalFooter,children:c.jsx("button",{type:"button",style:Q.closeBtn,onClick:n,children:"Close"})})]})})}function ki({field:t,value:e,onChange:n,onBlur:i,error:r,touched:s}){const o=t,u=!!(s&&r),a=o.isMulti??!1,l=o.pageSize??sc,d=o.id??o.name??"",[f,b]=p.useState(""),[g,x]=p.useState(1),[h,m]=p.useState([]),[v,A]=p.useState(!1),[C,I]=p.useState(!1),[S,y]=p.useState(null),[E,F]=p.useState(!1),G=p.useRef(null),M=p.useRef(0),D=p.useRef(!0);p.useEffect(()=>()=>{D.current=!1,G.current&&clearTimeout(G.current)},[]);const N=a?Array.isArray(e)?e:[]:e?[e]:[],j=N.length,w=p.useCallback((T,P)=>{if(o.fetchOptions)return o.fetchOptions(T,P);if(o.dataSource){const Z=Mi.get(o.dataSource);return Z?Z.fetch(T,P):Promise.reject(new Error(`[FlowForge] DataSource "${o.dataSource}" is not registered.`))}return Promise.reject(new Error(`[FlowForge] table-picker "${o.id}" requires fetchOptions or dataSource.`))},[o.fetchOptions,o.dataSource,o.id]),V=p.useCallback((T,P)=>{const Z=++M.current;I(!0),w(T,P).then(Y=>{!D.current||Z!==M.current||(m(Y.options.slice(0,l)),A(Y.hasNextPage))}).catch(()=>{!D.current||Z!==M.current||(m([]),A(!1))}).finally(()=>{!D.current||Z!==M.current||I(!1)})},[w,l]);p.useEffect(()=>{V("",1)},[]);const W=T=>{const P=T.target.value;b(P),x(1),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>V(P,1),300)},J=T=>{if(a){const P=Array.isArray(e)?e:[],Z=P.some(Y=>Y.value===T.value);n(Z?P.filter(Y=>Y.value!==T.value):[...P,T])}else n((e==null?void 0:e.value)===T.value?null:T);i==null||i()},_=()=>{if(!a)return;const T=Array.isArray(e)?e:[];if(h.every(Z=>T.some(Y=>Y.value===Z.value)))n(T.filter(Z=>!h.some(Y=>Y.value===Z.value)));else{const Z=h.filter(Y=>!T.some(K=>K.value===Y.value));n([...T,...Z])}},ee=T=>{if(a){const Z=(Array.isArray(e)?e:[]).filter(Y=>Y.value!==T);n(Z),Z.length===0&&F(!1)}else n(null),F(!1);i==null||i()},re=o.columns.length+1,k=h.length>0&&h.every(T=>N.some(P=>P.value===T.value)),B=h.some(T=>N.some(P=>P.value===T.value)),z=T=>N.some(P=>P.value===T.value);return c.jsxs("div",{style:{marginBottom:16},children:[c.jsx(se,{label:o.label,required:o.required,showOptional:o.showOptional,info:o.info,htmlFor:d,dataTestId:o.dataTestId??d}),c.jsxs("div",{style:Q.wrapper(u),onBlur:i,id:d,children:[c.jsxs("div",{style:Q.toolbar,children:[j>0?c.jsxs("button",{type:"button",style:Q.selectedLink,onClick:()=>F(!0),children:[j," ",j===1?"Item":"Items"," Selected"]}):c.jsx("span",{style:{fontSize:13,color:"rgba(0,0,0,0.38)"},children:"No selection"}),c.jsxs("div",{style:Q.searchWrap,children:[c.jsx(U.MdSearch,{size:15,color:"rgba(0,0,0,0.38)"}),c.jsx("input",{type:"text",placeholder:o.placeholder??"Search…",value:f,onChange:W,style:Q.searchInput,"aria-label":`Search ${o.label??""}`})]})]}),c.jsx("div",{style:{overflowX:"auto"},children:c.jsxs("table",{style:Q.table,children:[c.jsx("thead",{style:Q.thead,children:c.jsxs("tr",{children:[c.jsx("th",{style:Q.checkTh,children:a&&c.jsx(or,{checked:k,indeterminate:!k&&B,onChange:_,disabled:C||h.length===0})}),o.columns.map(T=>c.jsx("th",{style:Q.th(T.width),children:T.label},T.key))]})}),c.jsx("tbody",{children:C?c.jsx("tr",{children:c.jsx("td",{colSpan:re,style:Q.statusRow,children:"Loading…"})}):h.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:re,style:Q.statusRow,children:"No results found"})}):h.map(T=>{const P=z(T),Z=S===T.value;return c.jsxs("tr",{style:{cursor:"pointer",background:P?"rgba(25,118,210,0.06)":Z?"rgba(0,0,0,0.03)":"#fff",transition:"background 0.1s"},onClick:()=>J(T),onMouseEnter:()=>y(T.value),onMouseLeave:()=>y(null),"aria-selected":P,children:[c.jsx("td",{style:Q.checkTd,children:a?c.jsx(or,{checked:P,onChange:()=>J(T)}):c.jsx("input",{type:"radio",checked:P,onChange:()=>J(T),onClick:Y=>Y.stopPropagation(),name:d,style:{accentColor:"#1976d2",width:16,height:16,cursor:"pointer"}})}),o.columns.map(Y=>c.jsx("td",{style:Q.td,children:String(T[Y.key]??"")},Y.key))]},T.value)})})]})}),c.jsxs("div",{style:Q.footer,children:[c.jsx("span",{children:`${(g-1)*l+1}–${(g-1)*l+h.length} of many`}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[c.jsx("button",{type:"button",onClick:()=>{const T=g-1;x(T),V(f,T)},disabled:g<=1,style:Q.pageBtn(g<=1),"aria-label":"Previous page",children:"‹"}),c.jsx("button",{type:"button",onClick:()=>{const T=g+1;x(T),V(f,T)},disabled:!v,style:Q.pageBtn(!v),"aria-label":"Next page",children:"›"})]})]})]}),o.helperText&&!u&&c.jsx("small",{style:oe,children:o.helperText}),u&&c.jsx("small",{"data-testid":`${d}-error`,style:ae,children:r}),E&&c.jsx(ac,{selected:N,onRemove:ee,onClose:()=>F(!1)})]})}class lc{constructor(){this.fields=new Map,this.register({type:"text",label:"Text"}),this.register({type:"textarea",label:"Textarea"}),this.register({type:"number",label:"Number",configSchema:{fields:[{id:"min",type:"number",label:"Minimum limit"},{id:"max",type:"number",label:"Maximum limit"},{id:"step",type:"number",label:"Step size"},{id:"prefix",type:"text",label:"Prefix (e.g. $)"},{id:"suffix",type:"text",label:"Suffix (e.g. USD)"}]}}),this.register({type:"toggle",label:"Toggle/Switch"}),this.register({type:"select",label:"Select"}),this.register({type:"descriptive-select",label:"Descriptive Select"}),this.register({type:"radio-group",label:"Radio Group"}),this.register({type:"key-value",label:"Key-Value"}),this.register({type:"reference",label:"Reference"}),this.register({type:"cron",label:"Cron"}),this.register({type:"object",label:"Object"}),this.register({type:"schema",label:"Schema (nested form)"}),this.register({type:"tabs",label:"Tabs"}),this.register({type:"date",label:"Date"}),this.register({type:"datetime",label:"Date & Time"}),this.register({type:"time",label:"Time"}),this.register({type:"tags",label:"Tags",configSchema:{fields:[{id:"placeholder",type:"text",label:"Placeholder text"},{id:"maxTags",type:"number",label:"Max tags (leave empty for unlimited)"}]}}),this.register({type:"slider",label:"Slider",configSchema:{fields:[{id:"min",type:"number",label:"Minimum value"},{id:"max",type:"number",label:"Maximum value"},{id:"step",type:"number",label:"Step size"},{id:"showValue",type:"toggle",label:"Show current value"},{id:"marks",type:"toggle",label:"Show tick marks"}]}}),this.register({type:"color",label:"Color",configSchema:{fields:[{id:"showHex",type:"toggle",label:"Show hex input"}]}}),this.register({type:"file",label:"File Upload",configSchema:{fields:[{id:"accept",type:"text",label:"Accepted file types (e.g. .pdf,.png)"},{id:"maxSizeMb",type:"number",label:"Max file size (MB)"},{id:"multiple",type:"toggle",label:"Allow multiple files"}]}}),this.register({type:"json-editor",label:"JSON Editor",configSchema:{fields:[{id:"rows",type:"number",label:"Editor height (rows)"}]}}),this.register({type:"code",label:"Code",configSchema:{fields:[{id:"language",type:"select",label:"Language",options:[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"},{value:"json",label:"JSON"}]},{id:"rows",type:"number",label:"Editor height (rows)"}]}}),this.register({type:"rich-text",label:"Rich Text",configSchema:{fields:[{id:"rows",type:"number",label:"Editor height (rows)"},{id:"toolbar",type:"toggle",label:"Show toolbar"}]}}),this.register({type:"table-picker",label:"Table Picker",component:ki,configSchema:{fields:[{id:"label",type:"text",label:"Label"},{id:"required",type:"toggle",label:"Required"},{id:"isMulti",type:"toggle",label:"Multi-select"},{id:"pageSize",type:"number",label:"Page size"}]}})}register(e){this.fields.set(e.type,e),e.component&&q.register(e.type,e.component)}get(e){return this.fields.get(e)}getAll(){return Array.from(this.fields.values())}getTypeOptions(){return this.getAll().map(e=>({value:e.type,label:e.label}))}}const Li=new lc;function Rt(t){const e={};for(const n of t){let i;try{i=Ue(n)}catch{continue}if(!i||n.hidden)continue;if(n.validation){e[i]=n.validation;continue}let r;const s=Li.get(n.type);if(s!=null&&s.buildValidation)r=s.buildValidation(n);else switch(n.type){case"select":case"descriptive-select":case"infinite-select":case"radio-group":{if(n.isMulti===!0){let u=qt();n.required&&(u=u.min(1,`${n.label??i} is required`)),r=u}else{let u=lt();n.required&&(u=u.required(`${n.label??i} is required`)),r=u}break}case"number":case"slider":{let o=Gi().typeError(`${n.label??i} must be a number`);n.min!=null&&(o=o.min(n.min,`${n.label??i} must be at least ${n.min}`)),n.max!=null&&(o=o.max(n.max,`${n.label??i} must be at most ${n.max}`)),n.required&&(o=o.required(`${n.label??i} is required`)),r=o;break}case"toggle":case"checkbox":r=wi(),n.required&&(r=r.oneOf([!0],`${n.label??i} must be checked`));break;case"array":case"tags":{let o=qt();n.required&&(o=o.min(1,`${n.label??i} must have at least one item`)),n.maxTags!=null&&(o=o.max(n.maxTags,`${n.label??i} can have at most ${n.maxTags} items`)),r=o;break}case"object":case"schema":{const o=n.children??[];r=o.length>0?Rt(o):Qt(),n.required&&(r=r.required(`${n.label??i} is required`));break}case"date":case"datetime":case"time":{let o=lt();n.required&&(o=o.required(`${n.label??i} is required`)),r=o;break}default:{const o=n.inputType;let u=lt();o==="email"?u=u.email(`${n.label??i} must be a valid email address`):o==="url"&&(u=u.url(`${n.label??i} must be a valid URL`));const a=n.minLength,l=n.maxLength;a!=null&&(u=u.min(a,`${n.label??i} must be at least ${a} characters`)),l!=null&&(u=u.max(l,`${n.label??i} must be at most ${l} characters`)),n.required&&(u=u.trim().required(`${n.label??i} is required`)),r=u;break}}e[i]=r}return Qt().shape(e)}const it="__ff_field__";function uc(t){const e={...t,id:it,name:it},n=Rt([e]);return async i=>{try{await n.validateAt(it,{[it]:i});return}catch(r){return r instanceof le?r.message:"Invalid"}}}function Wi(t){return t.reduce((e,n)=>n.type==="object"?e+Wi(n.children??[]):e+1,0)}function cc(t,e){return t.label?t.label:(e.split(".").pop()??"Group").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())}function dc(t,e){const n=t===0,i=t===1,r=t>=2;return{marginBottom:e?8:r?10:12,borderRadius:n?"12px":i?"10px":"0px",border:r?"none":"1px solid #E5E7EB",backgroundColor:n?"#FFFFFF":i?"#FAFAFB":"transparent",boxShadow:n?"0 1px 2px rgba(15, 23, 42, 0.04)":"none",padding:0,overflow:"hidden",marginLeft:n?0:i?"10px":"16px"}}function fc(t,e){const n=t===0,i=t===1,r=t>=2;return{display:"flex",alignItems:"center",gap:1,px:n?1.75:i?1.5:.25,py:n?1.35:i?1.1:.75,cursor:"pointer",userSelect:"none",backgroundColor:e?n?"#FCFCFD":i?"rgba(248, 250, 252, 0.92)":"transparent":n?"#FFFFFF":i?"#FAFAFB":"transparent",borderBottom:e&&!r?"1px solid #EEF2F7":"none",transition:"background-color 0.18s ease","&:hover":{backgroundColor:n?"#F8FAFC":i?"#F5F7FA":"rgba(248, 250, 252, 0.75)"}}}function pc({field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,renderFieldRouter:l,item:d}){const[f,b]=p.useState(!0),g=t.children??[],x=Wi(g),h=cc(t,e),m=typeof t.helperText=="string"?t.helperText:void 0,v=`${x} field${x===1?"":"s"}`;return c.jsxs(R.Box,{sx:dc(n,a),children:[c.jsxs(R.Box,{onClick:()=>b(A=>!A),sx:fc(n,f),children:[c.jsx(R.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:18,height:18,color:"#64748B",transform:f?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.18s ease",flexShrink:0},children:c.jsx(U.MdKeyboardArrowRight,{size:16})}),c.jsxs(R.Box,{sx:{flex:1,minWidth:0},children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[c.jsx(R.Typography,{sx:{fontSize:n>=2?13:14,fontWeight:600,lineHeight:1.35,color:"#0F172A",overflowWrap:"anywhere"},children:h}),c.jsx(R.Chip,{label:v,size:"small",sx:{height:20,fontSize:10.5,fontWeight:600,bgcolor:"#F3F4F6",color:"#6B7280","& .MuiChip-label":{px:1}}})]}),m&&c.jsx(R.Typography,{sx:{mt:.35,fontSize:12,lineHeight:1.45,color:"#6c757d",overflowWrap:"anywhere"},children:m})]})]}),c.jsx(R.Box,{sx:{display:f?"block":"none",px:n===0?1.75:n===1?1.5:.25,py:n>=2?.75:1.5},children:c.jsx(R.Box,{sx:{pl:n===0?0:n===1?1:0},children:g.map(A=>{const C=A.id??A.name??"",I=e?`${e}.${C}`:C;return l({field:A,pathPrefix:I,depth:n+1,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:!1,item:d})})})})]})}const Xi=p.createContext(null);function gc(){return p.useContext(Xi)}function bc({field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,renderFieldRouter:l}){var F;const d=t.tabs??[],[f,b]=p.useState(((F=d[0])==null?void 0:F.id)??"");p.useEffect(()=>{d.length!==0&&(d.some(G=>G.id===f)||b(d[0].id))},[d,f]);const g=gc(),x=t.id??t.name??"",h=t.variant??"line",m=t.alignment??"left",v=t.height??"auto",A=t.margin??"normal",C=t.activeColor??"#6366f1",I=t.activeTextColor??(h==="pill"?"#ffffff":C),S=t.inactiveTextColor??"#64748b",y={left:"flex-start","center-left":"flex-start",center:"center","center-right":"flex-end",right:"flex-end"};if(d.length===0)return c.jsxs(R.Box,{sx:{p:2,border:"1px dashed #e2e8f0",borderRadius:2,color:"#94a3b8",fontSize:13},children:["No tabs defined. Add a ",c.jsx("code",{children:"tabs"})," array to this field descriptor."]});const E=d.find(G=>G.id===f)??d[0];return c.jsxs(R.Box,{sx:{mb:A==="none"?0:void 0,height:v==="fixed"?400:void 0,display:v==="fixed"?"flex":void 0,flexDirection:v==="fixed"?"column":void 0},children:[c.jsx(R.Box,{sx:{display:"flex",justifyContent:y[m]??"flex-start",alignItems:"center",gap:0,px:1.5,pt:1.5,borderBottom:"1px solid #e2e8f0",flexShrink:0},children:d.map(G=>{const M=G.id===f,D=e?`${e}.${G.id}`:G.id,N=G.fields.some(_=>{const ee=_.id??_.name??"";return!!`${D}.${ee}`.split(".").reduce((B,z)=>B&&typeof B=="object"?B[z]:void 0,r)}),j={bgcolor:C,color:I,borderRadius:"20px",border:"none"},w={bgcolor:"transparent",color:S,borderRadius:"20px",border:"none"},V={borderBottom:`2px solid ${C}`,color:I,border:"none"},J=h==="pill"?M?j:w:M?V:{borderBottom:"2px solid transparent",color:S,border:"none"};return c.jsxs(R.Box,{component:"button",type:"button",onClick:()=>b(G.id),sx:{...J,background:h==="pill"&&M?C:"none",cursor:"pointer",px:1.5,py:h==="pill"?.5:1,fontSize:13,fontWeight:M?700:500,display:"flex",alignItems:"center",gap:.5,transition:"color .12s, border-color .12s, background .12s","&:hover":{color:h==="pill"&&M?I:C},mb:h==="line"?"-1px":.5,mr:h==="pill"?.5:0},children:[G.label,N&&c.jsx(R.Box,{sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#ef4444",flexShrink:0}})]},G.id)})}),c.jsxs(R.Box,{sx:{p:2,flex:v==="fixed"?1:void 0,overflowY:v==="fixed"?"auto":void 0},children:[c.jsx(R.Box,{className:"ff-form-row",children:E.fields.map((G,M)=>{const D=G.id??G.name??"",j=`${e?`${e}.${E.id}`:E.id}.${D}`;return c.jsxs(R.Box,{sx:{position:"relative",width:"100%"},children:[g&&c.jsx(R.Box,{component:"button",type:"button",onClick:()=>g.removeFieldFromTab(x,E.id,M),title:"Remove field",sx:{position:"absolute",top:4,right:4,zIndex:10,width:18,height:18,borderRadius:"50%",border:"none",background:"#fee2e2",color:"#dc2626",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transition:"opacity .15s",".field-remove-wrapper:hover &":{opacity:1}},className:"field-remove-btn",children:c.jsx(U.MdClose,{size:11})}),l({field:G,pathPrefix:j,depth:n+1,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:!1})]},j)})}),g&&c.jsxs(R.Box,{component:"button",type:"button",onClick:()=>g.openAddFieldDialog(x,E.id),sx:{mt:E.fields.length>0?1.5:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.75,border:"1.5px dashed #c7d2fe",borderRadius:"8px",background:"none",cursor:"pointer",py:1.25,fontSize:13,fontWeight:600,color:"#6366f1",transition:"all .15s","&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[c.jsx(U.MdAdd,{size:15})," Add field to ",E.label]})]})]})}const hc=[{value:"equals",label:"equals"},{value:"notEquals",label:"not equals"},{value:"contains",label:"contains"},{value:"notContains",label:"not contains"},{value:"startsWith",label:"starts with"},{value:"endsWith",label:"ends with"},{value:"isPresent",label:"is present"},{value:"isNotPresent",label:"is not present"},{value:"greaterThan",label:"greater than"},{value:"lessThan",label:"less than"},{value:"greaterOrEquals",label:"greater or equal"},{value:"lessOrEquals",label:"less or equal"}],mc=new Set(["isPresent","isNotPresent","isEmpty","isNotEmpty"]),sr={textTransform:"none",fontSize:12,fontWeight:500,minWidth:0,color:"#111827",bgcolor:"#f9fafb",borderRadius:"6px",boxShadow:"none","&:hover":{bgcolor:"#f3f4f6",boxShadow:"none"},"& .MuiButton-startIcon":{mr:1.25,ml:0,color:"#111827","& svg":{fontSize:17}}};function zi(t){return t.type==="group"}function ar(){return{field:"",fieldLabel:"",operator:"equals",value:"",connector:"and"}}function lr(t){return!mc.has(t)}function Hi(t){return t.reduce((e,n)=>e+(zi(n)?Hi(n.entries):1),0)}function xc({connector:t,onChange:e}){return c.jsx(R.Box,{sx:{display:"flex",gap:"2px"},children:["and","or"].map(n=>c.jsx(R.Box,{component:"button",type:"button",onClick:()=>e(n),"aria-pressed":t===n,"aria-label":n==="and"?"AND — all conditions must match":"OR — any condition must match",sx:{border:"1px solid",borderRadius:"4px",fontSize:10,fontWeight:700,px:"6px",py:"1px",cursor:"pointer",textTransform:"uppercase",letterSpacing:.6,lineHeight:"18px",...t===n?{bgcolor:"#f1f5f9",color:"#374151",borderColor:"#94a3b8"}:{bgcolor:"transparent",color:"#cbd5e1",borderColor:"#e2e8f0"}},children:n},n))})}function vc({colDef:t,entry:e,onChange:n,cellId:i,formValues:r}){const[s,o]=p.useState({}),u=t.id==="value"&&!lr(e.operator);if(t.type==="operator"){const d=q.get("select");return d?c.jsx(d,{field:{id:i,name:i,type:"select",options:hc,label:void 0,placeholder:"Operator…",compact:!0},value:e.operator??"",values:r,onChange:f=>{const b=String(f??"");n({operator:b,...!lr(b)&&{value:""}})},onBlur:()=>{},error:void 0,touched:!1,formulaConfig:s,onFormulaConfigChange:o}):null}const a=q.get(t.type);if(!a)return null;const l=d=>{const f={[t.id]:d};if(t.id==="field"&&t.type==="select"&&Array.isArray(t.options)){const b=t.options.find(g=>String(g.value)===String(d));f.fieldLabel=(b==null?void 0:b.label)??""}n(f)};return c.jsx(a,{field:{...t,id:i,name:i,disabled:u,placeholder:u?"Not required":t.placeholder,label:void 0,compact:!0},value:e[t.id]??"",values:r,onChange:l,onBlur:()=>{},error:void 0,touched:!1,formulaConfig:s,onFormulaConfigChange:o})}function Ic({node:t,conditionDef:e,depth:n,fieldPath:i,onUpdate:r,onRemove:s,formValues:o}){const[u,a]=p.useState(!1),l=Hi(t.entries);return c.jsxs(R.Box,{sx:{border:"1px solid #e9e9e9",borderLeft:"3px solid #d1d5db",borderRadius:"6px",bgcolor:"#f9fafb",overflow:"hidden"},children:[c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:"5px",borderBottom:u?"none":"1px solid #f0f0f0",cursor:"pointer",userSelect:"none"},onClick:()=>a(d=>!d),children:[c.jsx(R.Box,{sx:{color:"#94a3b8",display:"flex",alignItems:"center"},children:u?c.jsx(U.MdKeyboardArrowRight,{size:15}):c.jsx(U.MdKeyboardArrowDown,{size:15})}),c.jsx(R.Typography,{sx:{fontSize:11,fontWeight:700,color:"#94a3b8",fontFamily:"monospace",letterSpacing:-1},children:"( )"}),c.jsxs(R.Typography,{sx:{fontSize:11,color:"#64748b"},children:["Group",u&&c.jsxs(R.Box,{component:"span",sx:{ml:.5,color:"#94a3b8"},children:["· ",l," condition",l!==1?"s":""]})]}),c.jsx(R.Box,{sx:{ml:"auto"},onClick:d=>d.stopPropagation(),children:c.jsx(R.Tooltip,{title:"Remove group",children:c.jsx(R.Box,{component:"button",type:"button",onClick:s,sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",p:"2px"},children:c.jsx(U.MdDeleteOutline,{size:16,color:"#ef4444"})})})})]}),c.jsx(R.Collapse,{in:!u,children:c.jsx(R.Box,{sx:{p:1,pt:.5},children:c.jsx(Zi,{conditionDef:e,entries:t.entries,onUpdate:r,depth:n+1,fieldPath:i,formValues:o})})})]})}function Zi({conditionDef:t,entries:e,onUpdate:n,depth:i=0,fieldPath:r="cond",formValues:s={}}){const o=t.allowGroups===!0&&(t.maxGroupDepth==null||i<t.maxGroupDepth),u=()=>n([...e,ar()]),a=()=>n([...e,{type:"group",connector:"and",entries:[ar()]}]),l=g=>n(e.filter((x,h)=>h!==g)),d=(g,x)=>n(e.map((h,m)=>m===g?{...h,connector:x}:h)),f=(g,x)=>n(e.map((h,m)=>m===g?{...h,...x}:h)),b=(g,x)=>n(e.map((h,m)=>m===g?{...h,entries:x}:h));return c.jsxs(R.Box,{sx:{mt:i===0?1.25:.25},children:[e.map((g,x)=>c.jsxs(R.Box,{children:[x>0&&c.jsx(R.Box,{sx:{display:"flex",alignItems:"center",my:"10px"},children:c.jsx(xc,{connector:g.connector??"and",onChange:h=>d(x,h)})}),zi(g)?c.jsx(Ic,{node:g,conditionDef:t,depth:i,fieldPath:`${r}__g${x}`,onUpdate:h=>b(x,h),onRemove:()=>l(x),formValues:s}):c.jsxs(R.Box,{children:[x===0&&c.jsx(R.Typography,{sx:{fontSize:12,fontWeight:600,color:"#475569",mb:.75},children:"When"}),c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[c.jsx(R.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:.75,flex:1},children:t.fields.map(h=>c.jsx(R.Box,{sx:{gridColumn:`span ${h.colSpan??4}`},children:c.jsx(vc,{colDef:h,entry:g,onChange:m=>f(x,m),cellId:`${r}__${x}__${h.id}`,formValues:s})},h.id))}),c.jsx(R.Tooltip,{title:"Remove condition",children:c.jsx(R.Box,{component:"button",type:"button",onClick:()=>l(x),"aria-label":"Remove condition",sx:{background:"none",border:"none",cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",p:"3px"},children:c.jsx(U.MdDeleteOutline,{size:17,color:"#ef4444","aria-hidden":"true"})})})]})]})]},x)),c.jsxs(R.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:e.length>0?1.5:0},children:[c.jsx(R.Button,{variant:"contained",startIcon:c.jsx(U.MdAdd,{}),onClick:u,"data-testid":"add-condition-button",className:"ff-form-text-capitalize ff-form-text-12 ff-form-text-dark ff-form-shadow-none ff-form-bg-light",disableElevation:!0,sx:sr,children:"Add"}),o&&c.jsx(R.Button,{variant:"contained",startIcon:c.jsx(U.MdAdd,{}),onClick:a,"data-testid":"add-group-button",disableElevation:!0,sx:sr,children:"Add Group"})]})]})}const ur=()=>{},_i=p.createContext({formulaConfig:{},onFormulaConfigChange:ur,conditionConfig:{},onConditionConfigChange:ur});function Ji({formulaConfig:t,onFormulaConfigChange:e,conditionConfig:n,onConditionConfigChange:i,children:r}){return c.jsx(_i.Provider,{value:{formulaConfig:t,onFormulaConfigChange:e,conditionConfig:n,onConditionConfigChange:i},children:r})}function yc(){return p.useContext(_i)}function we(t,e){return e.split(".").reduce((n,i)=>{if(!(n==null||typeof n!="object"))return n[i]},t)}function Kt(t){if(Array.isArray(t))return t.map(Kt);if(t!==null&&typeof t=="object"){const e={};for(const n of Object.keys(t))e[n]=Kt(t[n]);return e}return!0}const cr="_conditionConfig",Cc="_formulaConfig";function dr({handleRef:t,onSave:e,conditionConfigKey:n}){const i=ve.useFormikContext(),r=p.useRef(i);r.current=i;const s=p.useRef(e);return s.current=e,p.useImperativeHandle(t,()=>({save:async()=>{var d;const o=r.current;o.setTouched(Kt(o.values),!1);const u=await o.validateForm(),a=!u||Object.keys(u).length===0,l={...o.values};return a&&((d=s.current)==null||d.call(s,l,{isValid:a,errors:{}})),{isValid:a,values:l,errors:u??{}}},reset:()=>r.current.resetForm(),validate:async()=>await r.current.validateForm(),setErrors:o=>r.current.setErrors(o),getValues:()=>r.current.values,setValues:o=>r.current.setValues(o)}),[]),null}function Sc({conditionConfigKey:t,formulaConfigKey:e,explicitConditionConfig:n,explicitOnConditionConfigChange:i,explicitFormulaConfig:r,explicitOnFormulaConfigChange:s,children:o}){const u=ve.useFormikContext(),a=n??we(u.values,t)??{},l=b=>{if(i){i(b);return}u.setFieldValue(t,b,!1)},d=r??we(u.values,e)??{},f=b=>{if(s){s(b);return}u.setFieldValue(e,b,!1)};return c.jsx(Ji,{conditionConfig:a,onConditionConfigChange:l,formulaConfig:d,onFormulaConfigChange:f,children:o})}function Ac({onValuesChange:t}){const{values:e}=ve.useFormikContext();return p.useEffect(()=>{t(e)},[e,t]),null}function Rc({onValidityChange:t}){const{isValid:e}=ve.useFormikContext();return p.useEffect(()=>{t(e)},[e,t]),null}const Yi=p.forwardRef(function(e,n){var a;if("form"in e&&e.form){const{form:l}=e;return c.jsx(ve.FormikProvider,{value:l._formik,children:c.jsxs(Ji,{formulaConfig:l._formulaConfig,onFormulaConfigChange:l._onFormulaConfigChange,conditionConfig:l._conditionConfig,onConditionConfigChange:l._onConditionConfigChange,children:[c.jsx(dr,{handleRef:n,conditionConfigKey:cr}),c.jsx(fr,{schema:l._schema,formik:l._formik})]})})}const i=e.conditionConfigKey??cr,r=e.formulaConfigKey??Cc,s=l=>c.jsxs(c.Fragment,{children:[c.jsx(dr,{handleRef:n,onSave:e.onSave,conditionConfigKey:i}),c.jsx(Sc,{conditionConfigKey:i,formulaConfigKey:r,explicitConditionConfig:e.conditionConfig,explicitOnConditionConfigChange:e.onConditionConfigChange,explicitFormulaConfig:e.formulaConfig,explicitOnFormulaConfigChange:e.onFormulaConfigChange,children:l})]});let u=e.formik?c.jsx(ve.FormikProvider,{value:e.formik,children:s(c.jsx(fr,{schema:e.schema,formik:e.formik}))}):c.jsx(ve.Formik,{initialValues:e.initialValues,onSubmit:e.onSubmit,validationSchema:e.validationSchema??((a=e.schema)!=null&&a.fields?Rt(e.schema.fields):void 0),initialTouched:e.initialTouched,validateOnMount:!!e.initialTouched,enableReinitialize:!0,validateOnChange:!0,validateOnBlur:!0,children:({values:l,errors:d,touched:f,isSubmitting:b,setFieldValue:g,setFieldTouched:x})=>{var h;return c.jsxs(ve.Form,{id:e.formId,children:[e.onValuesChange&&c.jsx(Ac,{onValuesChange:e.onValuesChange}),e.onValidityChange&&c.jsx(Rc,{onValidityChange:e.onValidityChange}),s(c.jsx(Ui,{schema:e.schema,values:l,errors:d,touched:f,setFieldValue:g,setFieldTouched:x})),(h=e.children)==null?void 0:h.call(e,{isSubmitting:b})]})}});return e.variableGroups&&(u=c.jsx(Cr,{groups:e.variableGroups,children:u})),"optionsResolvers"in e&&e.optionsResolvers&&(u=c.jsx(ci,{resolvers:e.optionsResolvers,children:u})),c.jsx(c.Fragment,{children:u})});function fr({schema:t,formik:e}){return c.jsx(Ui,{schema:t,values:e.values,errors:e.errors,touched:e.touched,setFieldValue:e.setFieldValue,setFieldTouched:e.setFieldTouched})}class $i extends p.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(e){return{error:e.message}}render(){return this.state.error?null:this.props.children}}function Ui({schema:t,values:e,errors:n,touched:i,setFieldValue:r,setFieldTouched:s}){const o=t.layout??"flat",u=t.compact??!1;if(o==="stepper"&&Array.isArray(t.steps)&&t.steps.length>0)return c.jsx(Ec,{steps:t.steps,compact:u,values:e,errors:n,touched:i,setFieldValue:r,setFieldTouched:s});const a=o==="flat"?t.fields??[]:[];return c.jsx("div",{className:"ff-form-grid",children:a.map(l=>{const d=Ue(l);return c.jsx($i,{fieldId:d,children:c.jsx(Ye,{field:l,pathPrefix:d,depth:0,values:e,errors:n,touched:i,setFieldValue:r,setFieldTouched:s,compact:u})},d)})})}function Ec({steps:t,compact:e,values:n,errors:i,touched:r,setFieldValue:s,setFieldTouched:o}){const[u,a]=p.useState(0),l=t[u]??t[0],d=p.useMemo(()=>{const f=x=>x.flatMap(h=>{const m=Ue(h),v=Array.isArray(h.children)?f(h.children):[];return[m,...v]}),b=new Set(f(l.fields)),g=(x,h="")=>{for(const[m,v]of Object.entries(x??{})){const A=h?`${h}.${m}`:m;if(b.has(A)&&v||v&&typeof v=="object"&&g(v,A))return!0}return!1};return g(i)},[i,l]);return c.jsxs("div",{className:"ff-form-grid",children:[c.jsx(R.Box,{sx:{mb:3,mt:.5},children:c.jsx(R.Stepper,{activeStep:u,alternativeLabel:!0,children:t.map((f,b)=>c.jsx(R.Step,{completed:b<u,children:c.jsx(R.StepLabel,{onClick:()=>b<=u&&a(b),sx:{cursor:b<=u?"pointer":"default"},children:f.label})},b))})}),l.hint&&c.jsx("div",{style:{fontSize:12,color:"#64748b",marginBottom:12},children:l.hint}),l.fields.map(f=>{const b=Ue(f);return c.jsx($i,{fieldId:b,children:c.jsx(Ye,{field:f,pathPrefix:b,depth:0,values:n,errors:i,touched:r,setFieldValue:s,setFieldTouched:o,compact:e})},b)}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:16},children:[c.jsx("button",{type:"button",disabled:u===0,onClick:()=>a(f=>Math.max(0,f-1)),style:{padding:"8px 16px",borderRadius:6,border:"1px solid #e5e7eb",background:"#fff",cursor:u===0?"not-allowed":"pointer",opacity:u===0?.5:1,fontSize:13},children:"← Back"}),u<t.length-1?c.jsx("button",{type:"button",disabled:d,onClick:()=>a(f=>Math.min(t.length-1,f+1)),style:{padding:"8px 16px",borderRadius:6,border:"none",background:d?"#cbd5e1":"#1976d2",color:"#fff",cursor:d?"not-allowed":"pointer",fontSize:13,fontWeight:600},children:"Next →"}):c.jsx("span",{})]})]})}function Ye({field:t,pathPrefix:e,depth:n=0,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:l,item:d}){var S;const{formulaConfig:f,onFormulaConfigChange:b,conditionConfig:g,onConditionConfigChange:x}=yc(),h={values:i,item:d},m=p.useRef(i);m.current=i;const v=p.useRef(d);v.current=d;const A=p.useMemo(()=>{const y=uc(t);return async E=>{var G;const F={values:m.current,item:v.current};if(!(((G=t.shouldHide)==null?void 0:G.call(t,F))??t.hidden))return y(E)}},[t]);ve.useField({name:e,validate:A});const C=((S=t.shouldHide)==null?void 0:S.call(t,h))??t.hidden??!1,I=p.useRef(void 0);return p.useEffect(()=>{const y=I.current;if(I.current=C,!C||y===!0||!t.clearOnHide)return;const E=we(m.current,e);E==null||E===""||Array.isArray(E)&&E.length===0||o(e,t.defaultValue)},[C,e,t.clearOnHide,t.defaultValue,o]),C?null:t.type==="object"?c.jsx(Je,{field:t,compact:a,children:c.jsx(pc,{field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,item:d,renderFieldRouter:y=>c.jsx(Ye,{field:y.field,pathPrefix:y.pathPrefix,depth:y.depth,values:y.values,errors:y.errors,touched:y.touched,setFieldValue:y.setFieldValue,setFieldTouched:y.setFieldTouched,compact:y.compact,inlineLabel:y.inlineLabel,item:y.item},y.pathPrefix)})}):t.type==="array"&&Array.isArray(t.children??t.itemFields)?c.jsx(Je,{field:t,compact:a,children:c.jsx(St,{field:t,value:we(i,e),values:i,onChange:y=>o(e,y),onBlur:()=>u(e,!0),pathPrefix:e,depth:n,compact:a,parentErrors:r,parentTouched:s,parentSetFieldValue:o,parentSetFieldTouched:u,renderFieldRouter:y=>c.jsx(Ye,{field:y.field,pathPrefix:y.pathPrefix,depth:y.depth,values:y.values,errors:y.errors,touched:y.touched,setFieldValue:y.setFieldValue,setFieldTouched:y.setFieldTouched,compact:y.compact,inlineLabel:y.inlineLabel,item:y.item},y.pathPrefix)})}):t.type==="tabs"?c.jsx(Je,{field:t,compact:a,children:c.jsx(bc,{field:t,pathPrefix:e,depth:n,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,renderFieldRouter:y=>c.jsx(Ye,{field:y.field,pathPrefix:y.pathPrefix,depth:y.depth,values:y.values,errors:y.errors,touched:y.touched,setFieldValue:y.setFieldValue,setFieldTouched:y.setFieldTouched,compact:y.compact,inlineLabel:y.inlineLabel,item:y.item},y.pathPrefix)})}):c.jsx(Oc,{field:t,pathPrefix:e,values:i,errors:r,touched:s,setFieldValue:o,setFieldTouched:u,compact:a,inlineLabel:l,item:d,formulaConfig:f,onFormulaConfigChange:b,conditionConfig:g,onConditionConfigChange:x})}function Oc({field:t,pathPrefix:e,values:n,errors:i,touched:r,setFieldValue:s,setFieldTouched:o,compact:u,inlineLabel:a,item:l,formulaConfig:d,onFormulaConfigChange:f,conditionConfig:b,onConditionConfigChange:g}){var N,j,w;const x={values:n,item:l},h=we(n,e),m=p.useRef(t.compute);m.current=t.compute,p.useEffect(()=>{const V=m.current;if(!V)return;const W=V({values:n});W!==h&&s(e,W)},[n,h,e,s]);const v=q.get(t.type);if(!v)return null;const A=typeof t.disabled=="function"?t.disabled(x):((N=t.shouldDisable)==null?void 0:N.call(t,x))??t.disabled??!1,C=we(i,e),I=!!we(r,e),S=(j=t.compute)==null?void 0:j.call(t,x),y=S!==void 0?S:h,E=(w=t.transform)!=null&&w.in?t.transform.in(y):y,F=V=>{var J,_;if(t.compute)return;const W=(J=t.transform)!=null&&J.out?t.transform.out(V):V;s(e,W),o(e,!0),(_=t.onChange)==null||_.call(t,W,{values:n,setFieldValue:s})},G=t.condition&&b?b[e]??[]:[],M=V=>{if(!(!g||!b))if(V.length===0){const W={...b};delete W[e],g(W)}else g({...b,[e]:V})},D={field:{...t,disabled:A,id:e,name:e},value:E,values:n,onChange:F,onBlur:()=>o(e,!0),error:C,touched:I,formulaConfig:d,onFormulaConfigChange:f};return a?c.jsx(v,{...D,inlineLabel:!0}):c.jsxs(Je,{field:t,compact:u,children:[c.jsx(v,{...D,touched:I}),t.condition&&c.jsx(Zi,{conditionDef:t.condition,entries:G,onUpdate:M,fieldPath:e,formValues:n})]})}const Fc=Yi;exports.DynamicFormRenderer=Fc;exports.FF=O;exports.FlowForgeRegistry=Li;exports.FlowForm=Yi;exports.FormulaInput=un;exports.InfiniteSelectField=mi;exports.OptionsResolversProvider=ci;exports.TablePickerField=ki;exports.TabsEditContext=Xi;exports.VariablePicker=Ao;exports.VariablePickerProvider=Cr;exports._extends=H;exports._objectWithoutPropertiesLoose=Br;exports.astHasRefs=bo;exports.astToTokens=nn;exports.buildEvaluationPayload=uo;exports.buildFieldConfig=tn;exports.buildFormulaPath=oo;exports.buildSelectStyles=en;exports.buildValidationSchema=Rt;exports.commonjsGlobal=pu;exports.dataSourceRegistry=Mi;exports.errorTextStyle=ae;exports.extractLabel=gr;exports.fieldRegistry=q;exports.getDefaultExportFromCjs=xi;exports.hasFormulaTokens=go;exports.helperTextStyle=oe;exports.inputStyle=to;exports.isFormula=ho;exports.parseToAST=Ae;exports.resolveFieldKey=Ue;exports.serializeAST=Re;exports.serializeASTAsConfig=$e;exports.serializeConditionExpressions=po;exports.stripFormulaTokens=vo;exports.tokenize=vr;exports.unwrapFormula=xo;exports.useDynamicOptions=di;exports.useOptionsResolvers=Bl;exports.useVariablePickerContext=Le;exports.wrapFormula=mo;
10
+ //# sourceMappingURL=index-CQkqNHY-.js.map