@lax-wp/design-system 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
`}),e&&t.jsx("label",{id:A,htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${h?"":"capitalize"} ${w||"!uppercse"}`,children:t.jsxs("div",{className:"flex flex-wrap items-center justify-between w-full",children:[t.jsxs("div",{className:"inline-flex flex-wrap items-center gap-1",children:[t.jsx(kA,{label:String(e)||"",required:o||!1,isRequiredConditional:l||!1}),x?.length>0&&x!==X.value&&t.jsx(dA.Tooltip,{placement:"top",title:x,children:t.jsx("button",{className:"cursor-pointer",onClick:()=>r(x),type:"button",children:t.jsx(ui,{size:16,className:"cursor-pointer pb-0.5 text-primary-600"})})}),D&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),m&&t.jsx(GA,{}),t.jsx(EA,{labels:i}),g&&t.jsx(dA.Tooltip,{placement:"top",title:g,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),P&&j&&O?t.jsx("button",{id:`btn-base-input-field-add-to-document-${A}`,className:"cursor-pointer",onClick:()=>K(X?.value),type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:z("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),t.jsx("label",{className:"relative block",children:t.jsxs("div",{className:"relative",children:[v.createElement("input",{...X,ref:p||q,id:A||e,key:A,required:o,style:{"--input-bg-color":"var(--tw-bg-opacity, 1) rgb(var(--bg-color))",...T},className:E("border text-neutral-900 dark:text-black-100 border-solid h-[32px] hover:border-primary-500 dark:hover:border-primary-400",a?"border-red-300":n?"border-green-300":"border-neutral-200 dark:border-black-600",s&&s,c||"text-neutral-900 dark:text-black-100",b||"text-sm","rounded-md block w-full px-3 py-1.5 font-medium disabled:opacity-70 focus:outline-none focus:ring-2","focus:ring-primary-500 dark:focus:ring-primary-400 focus:border-primary-500 dark:focus:border-primary-400 disabled:!bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400",N||"",M&&L?.color?`bg-${L?.color}-50 border-${L?.color}-300`:"bg-white dark:bg-black-600"),onChange:W=>{r(W.target.value)},onClick:W=>W.stopPropagation(),autoComplete:"off",onBlur:k}),f?t.jsx("button",{className:"absolute inset-y-0 flex items-center cursor-pointer right-2",onClick:()=>{F(!V),u?.(!V)},type:"button",children:V?t.jsx(di,{className:"text-gray-400",size:16}):t.jsx(ci,{className:"text-gray-400",size:16})}):C&&X.value?t.jsx("button",{id:`btn-input-field-clear-${A}`,className:"absolute inset-y-0 flex items-center cursor-pointer right-2 focus:outline-none",onClick:W=>{W.stopPropagation(),r("")},type:"button",children:t.jsx(fi,{className:"text-neutral-200 dark:text-black-500",size:16})}):y?t.jsx("div",{className:"absolute inset-y-0 flex items-center right-2",children:y}):null]})}),t.jsx(uA.AnimatePresence,{children:a&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:t.jsx(G,{className:"mt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:a})})}),t.jsx(uA.AnimatePresence,{children:n&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:t.jsx(G,{className:"mt-1 text-success-500 dark:text-success-300",appearance:"custom",size:"extra-small",variant:"medium",children:n})})})]}),j&&L&&M&&U&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:W=>W.stopPropagation(),onMouseDown:W=>W.preventDefault(),onKeyDown:W=>{W.key==="Escape"&&Q(!1)},children:t.jsx(U,{riskDetails:L})})]})});be.displayName="BaseInputField";const pi=v.forwardRef(({label:A,placeholder:e,value:r,onChange:a,rows:n=4,message:o,messageType:l="default",defaultValue:s,required:i=!1,disabled:c=!1,className:d,inputRef:f,maxLength:u,originalCase:p=!1,noBorder:g=!1,id:y,inputStyle:x,...h},b)=>{const m=y||`textarea-${Math.random().toString(36).substr(2,9)}`,P=r?.length||0,H=u&&P>u-Math.min(50,u/5),N=u&&P>=u,T=()=>l==="error"?"border-red-300 dark:border-red-500 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400":l==="success"?"border-green-300 dark:border-green-500 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400":l==="info"?"border-blue-300 dark:border-blue-500 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400":"border-gray-300 dark:border-gray-600",w=()=>l==="error"?"text-red-500 dark:text-red-400":l==="success"?"text-green-500 dark:text-green-400":l==="info"?"text-blue-500 dark:text-blue-400":"text-gray-500 dark:text-gray-400";return t.jsxs("div",{className:E("flex flex-col gap-0.5 relative",d),children:[A&&t.jsx("label",{htmlFor:m,className:E("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",{capitalize:!p}),children:t.jsx(kA,{label:String(A)||"",required:i||!1})}),t.jsx("textarea",{...h,id:m,ref:b||f,onChange:k=>a(k.target.value),defaultValue:s,value:r,required:i,disabled:c,rows:n,placeholder:e,maxLength:u||void 0,style:x,className:E("border rounded-lg bg-white dark:bg-black-600 block w-full py-2.5 px-3","font-inter font-medium text-sm transition-colors duration-200","focus:ring-2 focus:outline-none resize-vertical min-h-[2.5rem]",!g&&T(),{"border-none focus:border-none focus:ring-0":g,"bg-gray-50 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed":c,"placeholder:text-gray-400 dark:placeholder:text-gray-500":c,"text-gray-900 dark:text-gray-100":!c,"placeholder:text-gray-400 dark:placeholder:text-gray-400":!c}),onClick:k=>k.stopPropagation(),"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o?`${m}-message`:void 0}),u&&t.jsxs(G,{className:"mt-0.5 text-right text-gray-600 dark:text-gray-400",appearance:"custom",size:"extra-small",children:[t.jsx("span",{className:E({"text-red-500 dark:text-red-400":N,"text-yellow-500 dark:text-yellow-400":H&&!N}),children:P}),t.jsxs("span",{className:"text-gray-400 dark:text-gray-500",children:[" ","/ ",u]})]}),t.jsx(uA.AnimatePresence,{children:o&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${m}-message`,role:l==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",w()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})}),ht=v.forwardRef(({label:A,placeholder:e,value:r,onChange:a,row:n=4,errorMessage:o,defaultValue:l,required:s,isRequiredConditional:i=!1,tags:c=[],disabled:d,className:f,inputRef:u,maxLength:p=void 0,tooltip:g="",originalCase:y=!1,isAiExtracted:x=!1,isGTN:h=!1,gtnName:b="",noBorder:m=!1,id:P,inputStyle:H,labelClassName:N,isLiveField:T=!1,onBlur:w,riskDetails:k,isRiskAnalysisOpen:D=!1,RiskDetailsCard:C,onAddGTNToDocument:L,...M},U)=>{const{t:O}=CA.useTranslation(),[X,q]=v.useState(!1),z=()=>{L&&L({key:b,value:r||""})};return t.jsxs("div",{ref:U,id:P,className:E("flex gap-0.5 relative",X&&h?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),children:[h&&!X?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("w-full flex flex-col"),children:[t.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${y?"":"capitalize"} ${N||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(A)||"",required:s||!1,isRequiredConditional:i||!1}),T&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),x&&t.jsx(GA,{}),t.jsx(EA,{labels:c||[]}),g&&t.jsx(dA.Tooltip,{placement:"top",title:g,children:t.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&V.preventDefault()},children:t.jsx(VA,{})})})]}),h&&X?t.jsx("button",{id:"btn-textarea-field-add-to-document",className:"cursor-pointer",onClick:z,type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:O("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),t.jsx("textarea",{...M,onBlur:w,onChange:V=>a(V.target.value),defaultValue:l,value:r,required:s,className:E(`border rounded-lg bg-white dark:bg-black-600 focus:ring-primary-500 focus:border-primary-500
|
|
37
37
|
dark:focus:ring-primary-400 dark:focus:border-primary-400 block w-full py-2.5 px-3 font-inter font-medium text-sm
|
|
38
|
-
disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400`,{"border-red-300":o,"border-gray-300 dark:border-black-700":!o,"text-neutral-400 dark:text-neutral-500":d,"text-neutral-900 dark:text-neutral-50":!d,"border-none":m,"focus:border-none":m,"placeholder:text-neutral-400 dark:placeholder:text-black-400":d,"placeholder:text-neutral-400 dark:placeholder:text-black-300":!d},f,D&&k?.color&&`!bg-${k.color}-50 border-${k.color}-300`),style:D&&k?{backgroundColor:k.hexBgColor||void 0,borderColor:k.hexBorderColor||void 0,...H}:H,rows:n,placeholder:e,disabled:d,maxLength:p||void 0,id:P,ref:u,onClick:V=>V.stopPropagation(),autoComplete:"off"}),p?t.jsxs(G,{className:"mt-0.5 text-right text-neutral-900 dark:text-white",appearance:"custom",size:"extra-small",children:[t.jsxs("span",{className:`${r?.length>=p?"text-error-500":r?.length>p-Math.min(50,p/5)?"text-warning-500 dark:text-warning-300":""}`,children:[r?.length||0," "]}),"/ ",p]}):null,o&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:o})]}),X&&D&&k&&C&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:V=>V.stopPropagation(),onMouseDown:V=>V.preventDefault(),onKeyDown:V=>{V.key==="Escape"&&q(!1)},children:t.jsx(C,{riskDetails:k})})]})});ht.displayName="TextAreaField";const XA=({children:A,className:e,variant:r="default",onClick:a,disabled:n,tooltip:o,tooltipPlacement:l="top",noborder:s,id:i})=>{const c="flex items-center",d={default:`bg-white dark:bg-black-800 hover:bg-neutral-100 dark:hover:bg-black-700 rounded-lg ${s?"":"border border-neutral-300 dark:border-neutral-800"} p-2 hover:opacity-80`,secondary:`bg-transparent rounded-lg ${s?"":"border border-neutral-300 dark:border-black-400"} p-2 hover:opacity-80`,native:`bg-transparent rounded-lg ${s?"":"border border-neutral-300"} p-2 hover:opacity-80`,ghost:"text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 dark:hover:text-neutral-200 dark:hover:bg-neutral-800 p-1 cursor-pointer rounded-full hover:scale-75 transition-all duration-500 ease-in-out"},f=n?"cursor-not-allowed opacity-50":"cursor-pointer";return t.jsx(fA,{title:o,placement:l,delayShow:!0,children:t.jsx("button",{id:i,disabled:n,className:`${c} ${d[r]} ${e||""} ${f}`,onClick:a,children:A})})},Ea=v.forwardRef(({id:A,label:e,placeholder:r,value:a,onChange:n,errorMessage:o,defaultValue:l,required:s=!1,isRequiredConditional:i=!1,masterDataName:c,masterDataColumnName:d,masterDataFormula:f,masterDataFilters:u,tags:p,index:g,tooltip:y="",originalCase:x=!1,color:h="",isGTN:b=!1,labelClassName:m,gtnName:P=null,isAiExtracted:H=!1,disabled:N=!1,reference:T={},isLiveField:w=!1,onBlur:k,onAddGTNToDocument:D,riskDetails:C,isRiskAnalysisOpen:L=!1,RiskDetailsCard:M,primaryColorShades:U,setDisableActions:O,showDeprecatedFieldWarning:X,MasterDataModal:q,parseMasterDataFormula:z},V)=>{const{t:F}=CA.useTranslation(),[j,Q]=v.useState(!1),[K,W]=v.useState(null),[I,_]=v.useState(!1),[Y,eA]=v.useState(""),[B,Z]=v.useState(null),AA=v.useRef(null),sA=V||AA;v.useEffect(()=>{W(a)},[g]),v.useEffect(()=>{K!==null&&K!==a&&n(K,B)},[K,B]);const lA=()=>{O?.(!I),_(!I)},xA=hA=>{if(hA.keyCode===9||hA.key==="Enter"){const MA=sA.current||AA.current;MA&&(W(Y),MA.blur())}},J=(hA,MA)=>{let ne=hA;f&&z&&(ne=z(f,MA)),eA(""),W(ne),lA(),Z(MA)},$=()=>{W(""),Z(null)},iA=hA=>{D&&P&&D({key:P,value:hA})},SA=()=>{const hA="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",MA=o?"border-red-300":L&&C?.color?`border-${C?.color}-300`:"border-gray-300 dark:border-black-600",ne="placeholder:text-neutral-900 dark:placeholder:text-black-400",Fe=`${L&&C?.color?`bg-${C?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${h||"text-neutral-900 dark:text-black-200"}`;return`${hA} ${MA} ${Fe} ${ne}`},qA=()=>K!==null?K:f&&z?z(f,T):a;return v.useEffect(()=>{I&&!c&&(X?.(),_(!1))},[I,c,X]),t.jsxs("div",{className:E("flex gap-0.5 w-full relative",j&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!o}),onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),children:[b&&!j?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("flex flex-col w-full"),children:[t.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${x?"":"capitalize"} ${m||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(e)||"",required:s||!1,isRequiredConditional:i||!1}),w&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),H&&t.jsx(GA,{}),t.jsx(EA,{labels:p}),y&&t.jsx(fA,{placement:"top",title:`${y}${f?` | ${f}`:""}`,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),b&&j&&D?t.jsx("button",{id:"btn-master-data-input-add-to-document",className:"cursor-pointer",onClick:()=>iA(a?.toString()||""),type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:F("Add to document"),children:t.jsx(nA.NoteAddOutlined,{sx:{fontSize:16,color:U?.[600]||"var(--color-primary-600)"}})})}):null]})}),t.jsxs("label",{className:"relative block mt-1",children:[t.jsx("input",{id:A,ref:sA,required:s,placeholder:r,className:SA(),onChange:hA=>{n(hA.target.value,B),W(hA.target?.value)},onKeyDown:xA,value:qA(),defaultValue:l,disabled:!0,autoComplete:"off",onBlur:k}),t.jsx(XA,{id:"btn-dynamic-data-input-rx-cross",onClick:$,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:N,children:t.jsx(nA.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),t.jsx(XA,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:lA,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:N,children:t.jsx(nA.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),o&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:o}),I&&q&&t.jsx(q,{isVisible:I,onSelected:J,onClose:lA,masterDataColumnName:d,masterDataFilters:u,masterDataName:c,masterDataId:c,showFilters:!0})]}),j&&C&&L&&M&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:hA=>hA.stopPropagation(),onMouseDown:hA=>hA.preventDefault(),onKeyDown:hA=>{hA.key==="Escape"&&Q(!1)},children:t.jsx(M,{riskDetails:C})})]})});Ea.displayName="MasterDataInputField";const hi=A=>Array.isArray(A)?A.map(e=>typeof e=="string"||typeof e=="number"?e:e.value):A||null,vi=A=>A.filter((e,r,a)=>a.findIndex(n=>n.value===e.value&&n.label===e.label)===r),mi=({options:A,value:e,defaultValue:r})=>A?.length?vi(A.map(a=>({...a,color:a.color}))):Array.isArray(e)&&e.length&&typeof e[0]=="object"&&"label"in e[0]?e.map(a=>({label:String(a?.label||""),value:String(a?.value||""),color:a?.color})):e&&typeof e=="object"&&"label"in e?[{label:String(e.label||""),value:String(e.value||""),color:e?.color}]:Array.isArray(r)&&r.length&&typeof r[0]=="object"&&"label"in r[0]?r.map(a=>({label:String(a?.label||""),value:String(a?.value||""),color:a?.color})):r&&typeof r=="object"&&"label"in r?[{label:String(r.label||""),value:String(r.value||""),color:r?.color}]:[],bi=({hasExistingData:A})=>t.jsx("div",{className:"!w-full px-3 py-1.5",children:A?t.jsx(dA.Skeleton,{paragraph:{rows:1,width:"100%"}}):t.jsx(dA.Skeleton,{})}),gi=({showSelectAll:A,mode:e,options:r,searchValue:a,handleSelectAll:n,isAllSelected:o,menu:l,isLoading:s,hasExistingData:i,t:c})=>t.jsxs(t.Fragment,{children:[A&&e==="multiple"&&r.length>0&&a.trim().length===0&&t.jsx("div",{role:"button",tabIndex:0,className:"px-3 py-2 border-b border-gray-200 dark:border-gray-600 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700",onClick:d=>{d.stopPropagation(),n()},onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())},children:t.jsx(G,{size:"small",variant:"semibold",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:c(o?"Deselect all":"Select all")})}),l,s&&t.jsx(bi,{hasExistingData:i})]}),vt=v.forwardRef(({label:A,value:e,mode:r,errorMessage:a,selectOptions:n=[],required:o=!1,tags:l,className:s,onInputChange:i,tooltip:c,originalCase:d=!1,isAiExtracted:f=!1,isGTN:u=!1,gtnName:p=null,onChange:g,onSearch:y,debounceTimeout:x=500,filterOption:h=!0,onScroll:b,isLoading:m=!1,allowClear:P=!0,autoClearSearchValue:H=!0,fullOpacityLabel:N=!1,showAllTags:T=!1,customTagRender:w,inputStyles:k,disabled:D=!1,showSelectAll:C=!1,labelClassName:L,riskDetails:M,isRiskAnalysisOpen:U=!1,RiskDetailsCard:O,AddToDocumentIcon:X,primaryColorShades:q,UserAvatar:z,onAddGTNToDocument:V,isRequiredConditional:F,isLiveField:j=!1,...Q},K)=>{const{t:W}=CA.useTranslation(),[I,_]=v.useState(!1),Y=v.useRef(null),[eA,B]=v.useState(!1),[Z,AA]=v.useState(""),sA=()=>{if(V){let oA="";lA==null?oA="":typeof lA=="string"||typeof lA=="number"?oA=String(lA):Array.isArray(lA)?oA=lA.map(pA=>typeof pA=="object"&&pA!==null&&"value"in pA?pA.value:pA).join(", "):typeof lA=="object"&&"value"in lA&&(oA=String(lA.value)),V({key:p,value:oA})}},lA=hi(e),xA=v.useMemo(()=>y?qs(y,x):null,[y,x]),J=(oA,vA)=>{if(Y.current&&Q.id){const pA=document.getElementById(Q.id);if(pA){const yA=Array.isArray(vA)?vA.map(Ha=>Ha.value):vA?.value;pA.dataset.selectedValue=JSON.stringify(yA);const We=new Event("change",{bubbles:!0});Object.defineProperty(We,"target",{writable:!1,value:pA}),pA.dispatchEvent(We);const ka=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${Q.id}`,value:yA,type:"change"}});pA.dispatchEvent(ka)}}if(r==="tags"){const pA=Array.isArray(oA)?oA:[oA];g?.(pA?.map(yA=>({label:yA,value:yA})))}else g?.(vA)},$=mi({options:n,value:e,defaultValue:Q?.defaultValue}),iA=v.useMemo(()=>$.length>0||lA!=null,[$,lA]),SA=v.useMemo(()=>{if(!r||r!=="multiple"||$.length===0)return!1;const oA=Array.isArray(lA)?lA:[];return $.map(pA=>pA.value).every(pA=>oA.some(yA=>typeof yA=="object"&&yA!==null&&"value"in yA?String(yA.value)===String(pA):String(yA)===String(pA)))},[lA,$,r]),qA=()=>{!r||r!=="multiple"||!g||g(SA?[]:$)},hA=v.useCallback(oA=>{if(!oA)return;const vA=new Event("submit",{bubbles:!0,cancelable:!0});oA.dispatchEvent(vA);const pA=oA.querySelector('button[type="submit"]');pA&&pA.click()},[]),MA=v.useCallback(oA=>{if(oA.key==="Enter"&&!eA&&lA){oA.preventDefault(),oA.stopPropagation();const vA=oA.currentTarget.closest("form");hA(vA)}},[eA,lA,hA]),ne=v.useCallback(oA=>{const{label:vA,value:pA,onClose:yA}=oA,ka=$.find(at=>String(at.value)===String(pA))?.color||"blue",Ha=at=>{at.preventDefault(),at.stopPropagation()};return t.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:t.jsx(TA,{label:vA,color:ka,size:"sm",onMouseDown:Ha,onClick:D?void 0:yA,isHashColor:!0,removable:!0,onRemove:yA})})},[$,D]),Fe=v.useCallback(oA=>{AA(oA),(i||xA)?.(oA)},[i,xA]);return t.jsxs("div",{ref:K,className:E("flex gap-0.5 w-full relative",I&&u?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),id:Q.id,children:[u&&!I?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("w-full flex flex-col gap-1 risk-analysis-select-field",s),onMouseDown:oA=>oA.stopPropagation(),role:"group","aria-labelledby":A?"select-field-label":void 0,children:[A?t.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${d?"":"capitalize"} ${L||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(A)||"",required:o||!1,isRequiredConditional:F||!1}),j&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&t.jsx(GA,{}),t.jsx(EA,{labels:l}),c&&t.jsx(dA.Tooltip,{placement:"top",title:c,children:t.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:oA=>{(oA.key==="Enter"||oA.key===" ")&&oA.preventDefault()},children:t.jsx(VA,{})})})]}),u&&I&&X?t.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:sA,type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:W("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,t.jsx(dA.Select,{onKeyDown:MA,onOpenChange:B,disabled:D,className:`w-full text-black-900 dark:text-black-200 ${a&&o?"ant-select-status-error":"#e2e8f0"} ${U&&M?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":U&&M?.hexBgColor?M?.hexBgColor:"","--risk-border-color":U&&M?.hexBorderColor?M?.hexBorderColor:""},"aria-required":o,mode:r,value:lA,onChange:J,filterOption:y?h:(oA,vA)=>(vA?.label||"")?.toLowerCase()?.includes(oA?.toLowerCase()),showSearch:!0,onSearch:Fe||void 0,onPopupScroll:b,popupClassName:"select-field-dropdown-popup",popupRender:oA=>t.jsx(gi,{showSelectAll:C,mode:r,options:$,searchValue:Z,handleSelectAll:qA,isAllSelected:SA,menu:oA,isLoading:m,hasExistingData:iA,t:W}),options:$.map(({label:oA,value:vA,color:pA,...yA})=>({label:String(oA),value:String(vA),key:String(vA),id:String(vA),color:pA,...yA})),optionRender:oA=>{const vA=oA?.data?.fullname;if(vA&&z){const[pA,yA]=vA.split(" ");return t.jsxs("div",{className:"flex items-center justify-start gap-1",children:[t.jsx(z,{firstName:pA,lastName:yA,profilePic:oA?.data?.url||"",size:"xs",enablePopper:!0,userId:oA?.data?.value}),t.jsx("span",{className:"ml-2",children:oA.label})]})}return t.jsx("span",{children:oA.label})},autoClearSearchValue:H,onClear:()=>g&&g(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&T?void 0:"responsive",maxTagPlaceholder:oA=>t.jsx(dA.Tooltip,{styles:{root:{zIndex:5002}},trigger:"hover",title:oA.length>3?oA.slice(0,3).map(({label:vA})=>vA).join(", ")+"...":oA.map(({label:vA})=>vA).join(", "),overlayStyle:{pointerEvents:"none"},children:t.jsxs("span",{children:["+",oA.length," more"]})}),tagRender:w||ne,allowClear:P,...Q}),a&&t.jsx(G,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:a})]}),I&&M&&U&&O&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:oA=>oA.stopPropagation(),onMouseDown:oA=>oA.preventDefault(),onKeyDown:oA=>{oA.key==="Escape"&&_(!1)},children:t.jsx(O,{riskDetails:M})})]})});vt.displayName="SelectField";const Fa=v.forwardRef(({id:A,label:e,checked:r,isChecked:a,onChange:n,disabled:o=!1,required:l=!1,message:s,messageType:i="default",wrapperClassName:c,checkboxClassName:d,labelClassName:f,size:u="medium",variant:p="default",labelPosition:g="right",checkboxProps:y},x)=>{const h=r!==void 0?r:a||!1,b=()=>{switch(u){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},m=()=>{if(i==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(i==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(i==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(p){case"outline":return"text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600";case"solid":return"text-primary-600 bg-primary-50 border-primary-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-primary-900/20";default:return"text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600"}},P=()=>i==="error"?"text-red-500 dark:text-red-400":i==="success"?"text-green-500 dark:text-green-400":i==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",H=()=>{switch(u){case"small":return"extra-small";case"large":return"medium";default:return"small"}},N=k=>{n(k.target.checked,k)},T=t.jsx(dA.Checkbox,{...y,ref:x,id:A,checked:h,onChange:N,disabled:o,className:E("rounded focus:ring-2 focus:ring-offset-gray-800 transition-colors duration-200",b(),m(),o&&"opacity-50 cursor-not-allowed",d),"aria-required":l,"aria-invalid":s&&i==="error"?"true":"false","aria-describedby":s?`${A}-message`:void 0}),w=e?t.jsx("label",{htmlFor:A,className:E("font-medium cursor-pointer transition-colors duration-200",o?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",g==="right"?"ml-2":"mr-2",f),children:t.jsxs(G,{variant:"medium",size:H(),appearance:"body",children:[e,l&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return t.jsxs("div",{className:E("flex flex-col",c),children:[t.jsx("div",{className:E("flex items-center",g==="left"&&"flex-row-reverse justify-end"),children:g==="left"?t.jsxs(t.Fragment,{children:[T,w]}):t.jsxs(t.Fragment,{children:[T,w]})}),t.jsx(uA.AnimatePresence,{children:s&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${A}-message`,role:i==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",P()),appearance:"custom",size:"extra-small",variant:"medium",children:s})})})]})});Fa.displayName="Checkbox";const Wa=({label:A,isChecked:e,onChange:r,id:a,...n})=>t.jsxs("div",{className:"flex items-center",children:[t.jsx(dA.Checkbox,{checked:e,onChange:r,id:a,type:"checkbox",value:"",className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:!bg-neutral-600 dark:border-gray-600",...n}),t.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:A})]}),ja=v.forwardRef(({id:A,label:e,value:r,defaultValue:a="#000000",onChange:n,onColorChange:o,disabled:l=!1,required:s=!1,message:i,messageType:c="default",wrapperClassName:d,inputClassName:f,labelClassName:u,size:p="medium",showValue:g=!1,valueFormat:y="hex",inputProps:x,helpText:h},b)=>{const m=r!==void 0?r:a,P=()=>{switch(p){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},H=()=>c==="error"?"text-red-500 dark:text-red-400":c==="success"?"text-green-500 dark:text-green-400":c==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",N=()=>c==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":c==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":c==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",T=()=>{switch(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},w=L=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(L);if(!M)return L;const U=parseInt(M[1],16),O=parseInt(M[2],16),X=parseInt(M[3],16);return`rgb(${U}, ${O}, ${X})`},k=L=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(L);if(!M)return L;const U=parseInt(M[1],16)/255,O=parseInt(M[2],16)/255,X=parseInt(M[3],16)/255,q=Math.max(U,O,X),z=Math.min(U,O,X);let V=0,F=0;const j=(q+z)/2;if(q!==z){const Q=q-z;switch(F=j>.5?Q/(2-q-z):Q/(q+z),q){case U:V=(O-X)/Q+(O<X?6:0);break;case O:V=(X-U)/Q+2;break;case X:V=(U-O)/Q+4;break}V/=6}return`hsl(${Math.round(V*360)}, ${Math.round(F*100)}%, ${Math.round(j*100)}%)`},D=()=>{switch(y){case"rgb":return w(m);case"hsl":return k(m);default:return m.toUpperCase()}},C=L=>{const M=L.target.value;n(M,L),o?.(M)};return t.jsxs("div",{className:E("flex flex-col w-full",d),children:[e&&t.jsx("label",{htmlFor:A,className:E("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",u),children:t.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:t.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:t.jsxs(G,{variant:"medium",size:T(),appearance:"subtitle",children:[e,s&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),h&&t.jsx(G,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:h}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"relative",children:t.jsx("input",{...x,ref:b,type:"color",id:A,value:m,onChange:C,disabled:l,required:s,className:E("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",P(),N(),l&&"opacity-50 cursor-not-allowed",f),style:{backgroundColor:m},"aria-required":s,"aria-invalid":i&&c==="error"?"true":"false","aria-describedby":i||h?`${A}-description`:void 0})}),g&&t.jsx("div",{className:"flex-1",children:t.jsx(G,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:D()})})]}),t.jsx(uA.AnimatePresence,{children:i&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${A}-description`,role:c==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",H()),appearance:"custom",size:"extra-small",variant:"medium",children:i})})}),h&&!i&&t.jsx("div",{id:`${A}-description`,className:"sr-only",children:h})]})});ja.displayName="ColorPicker";const mt=()=>{const[A,e]=v.useState(!1);return v.useEffect(()=>{const r=()=>{e(document.documentElement.classList.contains("dark"))};r();const a=new MutationObserver(n=>{n.forEach(o=>{o.attributeName==="class"&&r()})});return a.observe(document.documentElement,{attributes:!0}),()=>a.disconnect()},[]),A},Qa=({id:A,label:e,errorMessage:r,selectOptions:a,loading:n,isClearable:o,multiSelect:l,selectedValues:s,disabled:i,required:c,value:d,className:f,tooltip:u,tags:p,originalCase:g=!1,onChange:y,filterOption:x,placeholder:h,...b})=>{const m=mt(),P=(C,L)=>{y&&y(C);const M=document.getElementById(A);if(M){const U=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${A}`,value:C,type:"change"}});M.dispatchEvent(U)}},H={control:(C,L)=>({...C,borderColor:r&&c?m?"#F04438":"rgb(253 164 155)":L.isFocused?m?"rgb(64 64 64)":"var(--color-primary-600)":m?"rgb(38 38 38)":"rgb(229 229 229)",backgroundColor:m?(L.isDisabled,"rgb(38 38 38)"):L.isDisabled?"rgb(245 245 245)":"rgb(255 255 255)",borderRadius:"6px",height:"32px",minHeight:"32px",fontSize:"14px",padding:"4px 10px",opacity:L.isDisabled?.6:1,cursor:L.isDisabled?"not-allowed":"default",boxShadow:(L.isFocused,"none"),"&:hover":{borderColor:L.isFocused?m?"rgb(64 64 64)":"var(--color-primary-600)":m?"rgb(38 38 38)":"rgb(229 229 229)"},placeholder:{color:m?"rgb(38 38 38)":"rgb(163 163 163)"}}),valueContainer:C=>({...C,fontSize:"14px",padding:0,height:"20px"}),input:C=>({...C,margin:"0",padding:"0",color:m?"rgb(229 229 229)":"inherit"}),indicatorsContainer:C=>({...C,fontSize:"14px",padding:0,height:"20px"}),option:(C,L)=>({...C,fontFamily:"Inter",fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:m?"1px solid rgb(38 38 38)":"1px solid rgb(229 229 229)",backgroundColor:m?"rgb(10 10 10)":"rgb(255 255 255)",color:L.isDisabled?m?"rgb(115 115 115)":"rgb(163 163 163)":m?"rgb(229 229 229)":"inherit",cursor:L.isDisabled?"not-allowed":"pointer",opacity:L.isDisabled?.6:1,"&:hover":{backgroundColor:L.isDisabled?m?"rgb(38 38 38)":"rgb(255 255 255)":m?"rgb(64 64 64)":"rgb(245 245 245)"}}),singleValue:(C,L)=>({...C,fontFamily:"Inter",fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",display:"block",color:L.isDisabled?m?"rgb(115 115 115)":"rgb(163 163 163)":m?"rgb(229 229 229)":"inherit"}),placeholder:(C,L)=>({...C,fontFamily:"Inter",fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:L.isDisabled?m?"rgb(82 82 82)":"rgb(163 163 163)":"rgb(115 115 115)"}),multiValue:C=>({...C,backgroundColor:"rgb(230 241 252)",border:"1px solid rgb(198 225 249)",borderRadius:"6px",font:"Inter"}),multiValueLabel:C=>({...C,color:"var(--color-primary-600)"}),multiValueRemove:C=>({...C,color:"var(--color-primary-600)",":hover":{backgroundColor:"rgb(230 241 252)"}}),menu:C=>({...C,zIndex:1e3,backgroundColor:m?"rgb(10 10 10)":"rgb(255 255 255)",border:m?"1px solid rgb(64 64 64)":"1px solid rgb(229 229 229)"})},N=()=>t.jsx("div",{children:t.jsx(nA.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"16px"}})}),T=({...C})=>t.jsx("div",{className:"absolute top-0 left-0 h-full flex items-center dark:text-black-100",children:C.data.label}),w=!!s?.length,D=o?w||!!d:!1;return t.jsxs("div",{id:A,className:E("flex flex-col",f),children:[e&&t.jsxs("label",{id:A+"Label",htmlFor:"text",className:`mb-1 ${m?"text-black-300":"text-neutral-600"} inline-flex items-center gap-1 ${g?"":"capitalize"}`,children:[t.jsx(kA,{label:String(e)||"",required:c||!1}),t.jsx(EA,{labels:p}),u&&t.jsx(dA.Tooltip,{placement:"top",title:u,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),t.jsx(Vs,{...b,id:"cm"+e,required:c,options:a,isClearable:D,isLoading:n,isDisabled:i,styles:H,isMulti:l,value:l?s:d,onChange:P,filterOption:x,placeholder:h,classNames:{menuList:()=>"nowheel"},components:{IndicatorsContainer:N,SingleValue:T}}),r&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};Qa.displayName="CreatableSelectField";const mr=({ref:A,handler:e,enabled:r=!0})=>{v.useEffect(()=>{if(!r)return;const a=n=>{A.current&&!A.current.contains(n.target)&&e()};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[A,e,r])},yi={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",850:"#1e3a8a",900:"#1e3a8a",950:"#172554",975:"#121f47"},Ka=({id:A,label:e,options:r,placeholder:a,onChange:n,isLoading:o=!1,hideLabel:l=!1,errorMessage:s,required:i=!1,optionConfig:c,menuConfig:d,value:f,isMulti:u=!1,isClearable:p=!0,disabled:g=!1,className:y,isDark:x=!1,primaryColorShades:h=yi})=>{const b=v.useRef(null),[m,P]=v.useState(null),[H,N]=v.useState("");mr({ref:b,handler:()=>{P(null)}});const T={control:(M,U)=>({...M,borderColor:s&&i?"#F04438":U.isFocused?x?"#1e1e1e":h[600]:x?"#1e1e1e":"#e2e8f0",backgroundColor:U.isDisabled?x?"#1a1a1a":"#f5f5f5":x?"#262626":"#FFFFFF",color:U.isDisabled?x?"#666666":"#a0a0a0":x?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:U.isDisabled?"not-allowed":"default",opacity:(U.isDisabled,1),boxShadow:U.isFocused?x?`0 0 0 2px ${h[400]}`:`0 0 0 2px ${h[500]}`:"none"}),valueContainer:M=>({...M,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:x?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:M=>({...M,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:M=>({...M,fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:x?"1px solid #1e1e1e":"1px solid #eee",backgroundColor:x?"#000000":"#FFFFFF",color:x?"#d4d4d4":"#0F172A",display:"flex",alignItems:"center",zIndex:200,":hover":{backgroundColor:x?"#171717":h[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(M,U)=>({...M,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(U.isDisabled,x?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(M,U)=>({...M,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(U.isDisabled,x?"#595959":"#9CA3AF")}),multiValue:M=>({...M,backgroundColor:x?"#000000":h[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:M=>({...M,padding:"0",height:"30px"}),multiValueLabel:M=>({...M,color:x?"#d4d4d4":h[600],fontSize:"12px"}),multiValueRemove:M=>({...M,color:x?"#d4d4d4":h[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:x?"#171717":h[50]},svg:{height:"12px",width:"12px"}})},w=M=>{const U=r.filter(O=>O?.label?.toLowerCase()?.includes(H?.toLowerCase()));return t.jsx(fr.components.MenuList,{...M,className:E("!z-50 rounded !visible overflow-x-scroll",x?"bg-black-800":"bg-white",x?"text-neutral-300":"text-slate-900",d?.className),ref:b,children:U?.length?U.map((O,X)=>t.jsxs("div",{className:E("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",g?"cursor-not-allowed opacity-50":"cursor-pointer",x?"text-neutral-300":"text-slate-900",!g&&k(O)?x?"bg-black-700":"bg-primary-50":g?"":x?"hover:bg-black-700":"hover:bg-primary-50",d?.optionClassName?"":x?"border-b border-black-700":"border-b border-[#eee]"),onClick:q=>{g||(q.stopPropagation(),M.selectOption(O))},children:[c?.component?t.jsx(c.component,{...c.componentProps,...O}):t.jsx("div",{children:O.label}),t.jsx("div",{className:"flex items-center gap-1",children:k(O)&&c?.selectIndecator?c?.selectIndecator:null})]},X)):t.jsx("div",{className:E("opacity-50 flex justify-center items-center p-1 font-medium",x?"text-neutral-400":"text-gray-700"),children:"No options"})})},k=M=>u?m?.some(U=>U.value===M.value):M.value===m?.value,D=M=>{const{children:U,innerProps:O,isDisabled:X,getValue:q}=M,z=q();return t.jsx(fr.components.SingleValue,{...M,innerProps:O,isDisabled:X,children:z.length>0?z.map((V,F)=>t.jsx("span",{children:c?.component?t.jsx(c.component,{...c.componentProps,...V}):t.jsx("div",{children:V.label})},F)):t.jsx(t.Fragment,{children:U})})},C=M=>{const{innerProps:U,isDisabled:O,data:X}=M;return t.jsx(fr.components.MultiValue,{...M,innerProps:U,isDisabled:O,children:c?.component?t.jsx(c.component,{...c.componentProps,...X}):t.jsx("div",{children:X.label})})},L=(M,U)=>(N(U),!0);return t.jsxs("div",{className:E("flex flex-col",x?"text-black-300":"text-slate-900",o?"opacity-50":"opacity-100",g?"cursor-not-allowed":""),id:A,children:[l||!e?null:t.jsx(kA,{label:String(e)||"",required:i||!1}),t.jsx(fr,{required:!0,options:r,placeholder:a,value:f,onChange:M=>{P(M),n(M)},styles:T,isMulti:u,className:E(x&&"bg-black-800 border-black-700",y),components:{MenuList:w,SingleValue:D,MultiValue:C},filterOption:L,closeMenuOnSelect:!0,isClearable:p,isDisabled:g}),s&&t.jsx(G,{className:E("mt-1",x?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:s})]})};Ka.displayName="CustomizableSelectField";const Ya=[{value:"AED",label:"UAE Dirham"},{value:"AFN",label:"Afghan Afghani"},{value:"ALL",label:"Albanian Lek"},{value:"AMD",label:"Armenian Dram"},{value:"AOA",label:"Angolan Kwanza"},{value:"ARS",label:"Argentine Peso"},{value:"AUD",label:"Australian Dollar"},{value:"AWG",label:"Aruban Florin"},{value:"AZN",label:"Azerbaijani Manat"},{value:"BBD",label:"Barbadian Dollar"},{value:"BDT",label:"Bangladeshi Taka"},{value:"BGN",label:"Bulgarian Lev"},{value:"BHD",label:"Bahraini Dinar"},{value:"BIF",label:"Burundian Franc"},{value:"BMD",label:"Bermudian Dollar"},{value:"BND",label:"Brunei Dollar"},{value:"BRL",label:"Brazilian Real"},{value:"BSD",label:"Bahamian Dollar"},{value:"BTN",label:"Bhutanese Ngultrum"},{value:"BWP",label:"Botswanan Pula"},{value:"BYN",label:"Belarusian Ruble"},{value:"BZD",label:"Belize Dollar"},{value:"CAD",label:"Canadian Dollar"},{value:"CDF",label:"Congolese Franc"},{value:"CHE",label:"WIR Euro"},{value:"CHF",label:"Swiss Franc"},{value:"CHW",label:"WIR Franc"},{value:"CLP",label:"Chilean Peso"},{value:"CNY",label:"Chinese Yuan"},{value:"COP",label:"Colombian Peso"},{value:"CRC",label:"Costa Rican Colón"},{value:"CUC",label:"Cuban Convertible Peso"},{value:"CUP",label:"Cuban Peso"},{value:"CVE",label:"Cape Verdean Escudo"},{value:"CZK",label:"Czech Koruna"},{value:"DJF",label:"Djiboutian Franc"},{value:"DKK",label:"Danish Krone"},{value:"DOP",label:"Dominican Peso"},{value:"DZD",label:"Algerian Dinar"},{value:"EGP",label:"Egyptian Pound"},{value:"ERN",label:"Eritrean Nakfa"},{value:"ESP",label:"Spanish Peseta"},{value:"ETB",label:"Ethiopian Birr"},{value:"EUR",label:"Euro"},{value:"FJD",label:"Fijian Dollar"},{value:"FKP",label:"Falkland Islands Pound"},{value:"GBP",label:"British Pound"},{value:"GEL",label:"Georgian Lari"},{value:"GHS",label:"Ghanaian Cedi"},{value:"GIP",label:"Gibraltar Pound"},{value:"GMD",label:"Gambian Dalasi"},{value:"GNF",label:"Guinean Franc"},{value:"GTQ",label:"Guatemalan Quetzal"},{value:"GYD",label:"Guyanese Dollar"},{value:"HKD",label:"Hong Kong Dollar"},{value:"HNL",label:"Honduran Lempira"},{value:"HRK",label:"Croatian Kuna"},{value:"HTG",label:"Haitian Gourde"},{value:"HUF",label:"Hungarian Forint"},{value:"IDR",label:"Indonesian Rupiah"},{value:"ILS",label:"Israeli New Shekel"},{value:"INR",label:"Indian Rupee"},{value:"IQD",label:"Iraqi Dinar"},{value:"IRR",label:"Iranian Rial"},{value:"ISK",label:"Icelandic Króna"},{value:"JMD",label:"Jamaican Dollar"},{value:"JOD",label:"Jordanian Dinar"},{value:"JPY",label:"Japanese Yen"},{value:"KES",label:"Kenyan Shilling"},{value:"KGS",label:"Kyrgyzstani Som"},{value:"KHR",label:"Cambodian Riel"},{value:"KMF",label:"Comorian Franc"},{value:"KPW",label:"North Korean Won"},{value:"KRW",label:"South Korean Won"},{value:"KWD",label:"Kuwaiti Dinar"},{value:"KYD",label:"Caymanian Dollar"},{value:"KZT",label:"Kazakhstani Tenge"},{value:"LAK",label:"Lao Kip"},{value:"LBP",label:"Lebanese Pound"},{value:"LKR",label:"Sri Lankan Rupee"},{value:"LRD",label:"Liberian Dollar"},{value:"LSL",label:"Lesotho Loti"},{value:"LTL",label:"Lithuanian Litas"},{value:"LVL",label:"Latvian Lats"},{value:"LYD",label:"Libyan Dinar"},{value:"MAD",label:"Moroccan Dirham"},{value:"MDL",label:"Moldovan Leu"},{value:"MGA",label:"Malagasy Ariary"},{value:"MKD",label:"Macedonian Denar"},{value:"MMK",label:"Myanmar Kyat"},{value:"MNT",label:"Mongolian Tögrög"},{value:"MOP",label:"Macanese Pataca"},{value:"MRU",label:"Mauritanian Ouguiya"},{value:"MUR",label:"Mauritian Rupee"},{value:"MVR",label:"Maldivian Rufiyaa"},{value:"MWK",label:"Malawian Kwacha"},{value:"MXN",label:"Mexican Peso"},{value:"MYR",label:"Malaysian Ringgit"},{value:"MZN",label:"Mozambican Metical"},{value:"NAD",label:"Namibian Dollar"},{value:"NGN",label:"Nigerian Naira"},{value:"NIO",label:"Nicaraguan Córdoba"},{value:"NOK",label:"Norwegian Krone"},{value:"NPR",label:"Nepalese Rupee"},{value:"NZD",label:"New Zealand Dollar"},{value:"OMR",label:"Omani Rial"},{value:"PAB",label:"Panamanian Balboa"},{value:"PEN",label:"Peruvian Sol"},{value:"PHP",label:"Philippine Peso"},{value:"PKR",label:"Pakistani Rupee"},{value:"PLN",label:"Polish Zloty"},{value:"PRB",label:"Transnistrian Ruble"},{value:"PYG",label:"Paraguayan Guarani"},{value:"QAR",label:"Qatari Riyal"},{value:"RON",label:"Romanian Leu"},{value:"RSD",label:"Serbian Dinar"},{value:"RUB",label:"Russian Ruble"},{value:"RWF",label:"Rwandan Franc"},{value:"SAR",label:"Saudi Riyal"},{value:"SCR",label:"Seychellois Rupee"},{value:"SDG",label:"Sudanese Pound"},{value:"SEK",label:"Swedish Krona"},{value:"SGD",label:"Singapore Dollar"},{value:"SHP",label:"Saint Helena Pound"},{value:"SLL",label:"Sierra Leonean Leone"},{value:"SOS",label:"Somali Shilling"},{value:"SRD",label:"Surinamese Dollar"},{value:"SSP",label:"South Sudanese Pound"},{value:"SVC",label:"Salvadoran Colón"},{value:"SYP",label:"Syrian Pound"},{value:"SZL",label:"Swazi Lilangeni"},{value:"THB",label:"Thai Baht"},{value:"TJS",label:"Tajikistani Somoni"},{value:"TMT",label:"Turkmenistani Manat"},{value:"TND",label:"Tunisian Dinar"},{value:"TOP",label:"Tongan Paʻanga"},{value:"TRY",label:"Turkish Lira"},{value:"TWD",label:"New Taiwan Dollar"},{value:"TZS",label:"Tanzanian Shilling"},{value:"UAH",label:"Ukrainian Hryvnia"},{value:"UGX",label:"Ugandan Shilling"},{value:"USD",label:"United States Dollar"},{value:"UYU",label:"Uruguayan Peso"},{value:"UZS",label:"Uzbekistani Som"},{value:"VEF",label:"Venezuelan Bolívar"},{value:"VND",label:"Vietnamese Dong"},{value:"VUV",label:"Vanuatu Vatu"},{value:"WST",label:"Samoan Tala"},{value:"YER",label:"Yemeni Rial"},{value:"ZAR",label:"South African Rand"},{value:"ZMW",label:"Zambian Kwacha"},{value:"ZWL",label:"Zimbabwean Dollar"}],Za={AED:"د.إ",AFN:"؋",ALL:"Lek",AMD:"դր",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"Fr",BMD:"$",BND:"$",BOB:"Bs.",BOV:"Bs.",BRL:"R$",BSD:"$",BTN:"Nu.",BWP:"P",BYN:"Br",BZD:"$",CAD:"$",CDF:"Fr",CHE:"Fr",CHF:"Fr",CHW:"Fr",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fr",DKK:"kr",DOP:"$",DZD:"د.ج",EGP:"£",ERN:"Nkf",ESP:"₧",ETB:"Br",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GHS:"₵",GIP:"£",GMD:"D",GNF:"Fr",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",INR:"₹",IQD:"ع.د",IRR:"ریال",ISK:"kr",JMD:"$",JOD:"د.ا",JPY:"¥",KES:"Sh",KGS:"лв",KHR:"៛",KMF:"Fr",KPW:"₩",KRW:"₩",KWD:"د.ك",KYD:"$",KZT:"₸",LAK:"₭",LBP:"ل.ل",LKR:"₨",LRD:"$",LSL:"M",LTL:"Lt",LVL:"Ls",LYD:"د.ل",MAD:"د.م.",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"P",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"ر.ع.",PAB:"B/.",PEN:"S/",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PRB:"₽",PYG:"₲",QAR:"ر.ق",RON:"lei",RSD:"дин.",RUB:"₽",RWF:"Fr",SAR:"ر.س",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SOS:"Sh",SRD:"$",SSP:"£",STN:"Db",SVC:"$",SYP:"ل.س",SZL:"L",THB:"฿",TJS:"SM",TMT:"m",TND:"د.ت",TOP:"T$",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"Sh",UAH:"₴",UGX:"Sh",USD:"$",UYU:"$",UZS:"сўм",VEF:"Bs.F",VND:"₫",VUV:"Vt",WST:"T",XAF:"Fr",XAG:"XAG",XAU:"XAU",XBA:"XBA",XBB:"XBB",XBC:"XBC",XBD:"XBD",XCD:"$",XDR:"XDR",XOF:"Fr",XPD:"XPD",XPF:"₣",XPT:"XPT",XSU:"XSU",XTS:"XTS",XUA:"XUA",YER:"ر.ي",ZAR:"R",ZMW:"K",ZWL:"$"},br=({classValue:A,size:e=24,fill:r="currentColor",...a})=>t.jsxs("svg",{className:E(A),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[t.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),t.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:t.jsx("path",{d:"M8.10023 3.90357C7.97023 3.77357 7.76023 3.77357 7.63023 3.90357L6.00023 5.53023L4.37023 3.90023C4.24023 3.77023 4.03023 3.77023 3.90023 3.90023C3.77023 4.03023 3.77023 4.24023 3.90023 4.37023L5.53023 6.00023L3.90023 7.63023C3.77023 7.76023 3.77023 7.97023 3.90023 8.10023C4.03023 8.23023 4.24023 8.23023 4.37023 8.10023L6.00023 6.47023L7.63023 8.10023C7.76023 8.23023 7.97023 8.23023 8.10023 8.10023C8.23023 7.97023 8.23023 7.76023 8.10023 7.63023L6.47023 6.00023L8.10023 4.37023C8.2269 4.24357 8.2269 4.03023 8.10023 3.90357Z",fill:"#98A2B3"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_8212_362816",children:t.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});br.displayName="CloseRounded";const Ba=({width:A=15,height:e=15,fill:r="#98A2B3",className:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:A.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:a,children:t.jsx("path",{d:"M17.5 17.5L12.5001 12.5M14.1667 8.33333C14.1667 11.555 11.555 14.1667 8.33333 14.1667C5.11167 14.1667 2.5 11.555 2.5 8.33333C2.5 5.11167 5.11167 2.5 8.33333 2.5C11.555 2.5 14.1667 5.11167 14.1667 8.33333Z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ia=A=>{const{value:e,placeholder:r,onChange:a,id:n,debounceTimeout:o=0,classValues:l,handleKeyDown:s,isClearable:i,onFocusText:c,autoComplete:d="false",searchRef:f,hasNavigation:u=!1,autoFocus:p=!1,searchConfig:g,hideSearchIcon:y,allowAStarSearch:x=!1,...h}=A,{t:b}=CA.useTranslation(),[m,P]=v.useState(!1),[H,N]=v.useState("search"),T=v.useRef(null),{searchCount:w,searchPointer:k,setSearchPointer:D}=g||{},C=()=>{P(!0),N(c||r||b("Search"));const M=f||T;M.current&&M.current.focus()},L=()=>{P(!1),N("")};return t.jsxs("label",{className:E("relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",l),children:[!y&&t.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:t.jsx(Ba,{width:"16",height:"16"})}),t.jsx(nt.DebounceInput,{...h,spellCheck:"false",debounceTimeout:o,id:n,inputRef:f||T,type:"text",className:E(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${y?"pl-2":"pl-10"} pl-10 pr-7 w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:!ring-primary-500 focus:!border-primary-500`,"border border-solid","dark:border-neutral-800 border-neutral-200","dark:caret-white",l),onKeyDown:M=>{M.key==="Enter"&&M.preventDefault(),s&&s(M)},value:e||"",placeholder:m?H:x?"":`${b("Search")}`,onChange:M=>a?.(M.target.value),autoComplete:d,onFocus:M=>{P(!0),C(),A.onFocus&&A.onFocus(M)},onBlur:M=>{P(!1),L(),A.onBlur&&A.onBlur(M)},autoFocus:p}),u&&e&&t.jsxs("div",{className:E("absolute mr-2 focus:outline-none flex gap-1",i?"right-6":"right-0"),children:[!!w&&(w||0)>0&&t.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(k||0)+1,"/",w]}),t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{D&&D(M=>(M||0)-1)},disabled:k===0,children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{D&&D(M=>(M||0)+1)},disabled:k===(w||0)-1,children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),x&&!(i&&e)&&!m&&!e?t.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[t.jsxs(G,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[b("Search")," (use"]}),t.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:t.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})}),t.jsx(G,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):i&&e&&t.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>a?.(""),children:t.jsx(br,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var He=(A=>(A.LEFT="left",A.RIGHT="right",A.TOP="top",A))(He||{});const xi=(A,e,r,a="medium")=>{const n={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-9 h-5 after:h-4 after:w-4 after:top-0.5 after:left-0.5",large:"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5"},o={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return E("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400",n[a],o[a],{"peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500":A,"after:bg-white dark:after:bg-black-500":!A,"text-white dark:text-black-900":e,"cursor-not-allowed opacity-70":r})},Pi=({size:A=18,fill:e="#016DCF"})=>t.jsx("svg",{width:A,height:A,viewBox:"0 0 24 24",fill:"none",children:t.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),wi=({size:A=18,fill:e="#101828"})=>t.jsx("svg",{width:A,height:A,viewBox:"0 0 24 24",fill:"none",children:t.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:e})}),Ye=v.forwardRef(({isGTN:A=!1,isChecked:e,id:r,onChange:a,label:n,required:o,isRequiredConditional:l=!1,hideStatus:s=!1,labelDirection:i=He.TOP,statusText:c,withIcon:d=!1,tags:f,isAiExtracted:u=!1,tooltip:p="",className:g="",isDisabled:y=!1,icon:x,stopClickPropagation:h=!0,gtnName:b,variant:m="primary",labelClassName:P,isLiveField:H=!1,message:N,messageType:T="default",wrapperClassName:w,helpText:k,size:D="medium",renderGTNAddButton:C,onAddGTNToDocument:L},M)=>{const{t:U}=CA.useTranslation(),O=i===He.TOP,X=i===He.LEFT,q=i===He.RIGHT,[z,V]=v.useState(!1),F=()=>{L&&L({key:b,value:e?"Yes":"No"})},j=()=>T==="error"?"text-red-500 dark:text-red-400":T==="success"?"text-green-500 dark:text-green-400":T==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return t.jsxs("div",{className:E("flex gap-0.5",z&&A?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",w),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),onClick:Q=>{h&&Q.stopPropagation()},children:[A&&!z?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,t.jsxs("div",{className:"w-full flex flex-col",children:[O&&n&&t.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[t.jsxs("h1",{className:E("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",P),children:[t.jsx(kA,{label:String(n)||"",required:o||!1,isRequiredConditional:l||!1}),H&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),u&&t.jsx(GA,{}),t.jsx(EA,{labels:f||[]}),p&&t.jsx(fA,{placement:"top",title:p,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),A&&z?C?C(F):t.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:F,type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:U("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),k&&t.jsx(G,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:k}),t.jsxs("div",{className:"flex",children:[X&&t.jsx(G,{size:"small",variant:"medium",className:E("mr-2 text-neutral-700 dark:text-black-200",P),appearance:"custom",children:n}),t.jsxs("label",{className:E("relative inline-flex items-center",q||c?"":"w-min",y?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:Q=>Q.stopPropagation(),children:[t.jsx("input",{ref:M,type:"checkbox",id:r,onChange:Q=>!y&&a(Q.target.checked),value:"",disabled:y,checked:e,className:E("sr-only peer w-full",g),"aria-required":o,"aria-invalid":N&&T==="error"?"true":"false","aria-describedby":N||k?`${r}-description`:void 0}),t.jsx("div",{className:xi(e,d,y,D),children:d?t.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.jsx("div",{className:E("z-10 transition-all transform",D==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),D==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),D==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?x?.checkedIcon?x.checkedIcon:t.jsx(Pi,{size:18,fill:"#016DCF"}):x?.uncheckedIcon?x.uncheckedIcon:t.jsx(wi,{size:18,fill:"#101828"})})}):null}),q&&t.jsx(G,{size:"small",variant:"medium",className:E("ml-2 text-neutral-700 dark:text-black-300",P),appearance:"custom",children:n}),s?null:t.jsx(G,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:c||(e?"Yes":"No")})]})]}),t.jsx(uA.AnimatePresence,{children:N&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:T==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",j()),appearance:"custom",size:"extra-small",variant:"medium",children:N})})}),k&&!N&&t.jsx("div",{id:`${r}-description`,className:"sr-only",children:k})]})]})});Ye.displayName="Toggle";const Ci=A=>{try{return JSON.parse(A)}catch{return null}},ki=A=>{let e="";const r="0123456789abcdef";for(let a=0;a<A;a++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},Hi=A=>A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Di=A=>{const e=[...A].sort((a,n)=>a.length-n.length),r=[];for(const a of e)r.some(o=>a!==o&&a.startsWith(o+"."))||r.push(a);return r},De=A=>{let e="";if(A){let r=0;Object.keys(A).forEach(a=>{if(A[a]!==void 0&&A[a]!==null&&A[a]!==""){let n=A[a];typeof n=="object"?n=JSON.stringify(n):Array.isArray(n)&&(n=n.join(",")),n!=null&&n!==""&&(r===0?e+=`?${a}=${encodeURIComponent(n)}`:e+=`&${a}=${encodeURIComponent(n)}`,r+=1)}})}return e},Ga=({shortcuts:A,variant:e="dark",className:r})=>{const n=Ke()==="macos",o=v.useMemo(()=>A.map(l=>{const s=vr[l];return s?n?s.macos:s.other:l}),[A,n]);return t.jsx("div",{className:E("flex flex-1 gap-1",r),children:o.map((l,s)=>t.jsx("kbd",{className:E("flex items-center rounded-[3px] px-1.5 py-[2px] min-w-[26px] justify-center text-xs font-medium",{"bg-neutral-800 text-white":e==="dark","bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-white":e==="light"}),children:l},s))})},Si=({className:A="",fill:e="var(--color-primary-600)",size:r=24})=>t.jsx("svg",{className:A,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{mask:"url(#mask0_6752_28309)",children:t.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),gr=({id:A,onClick:e,icon:r,text:a,className:n,isDisabled:o,onClose:l,notVisible:s,hideHoverEffect:i,leadingIcon:c,suffixRecord:d,stopPropagation:f,onToggle:u,isChecked:p=!1,highlight:g,truncateText:y=!1,showTick:x=!1,width:h="100%",tooltip:b,isFlowAvailable:m=!0,shortcuts:P})=>{const H=v.useCallback(D=>{l&&l(),D.preventDefault(),e?.(D),f&&D.stopPropagation()},[l,e,f]),N=(D,C)=>{if(!C||!D||typeof D!="string"&&typeof D!="number")return D;const L=Hi(C),M=new RegExp(`(${L?.trim()})`,"gi"),U=D?.toString()?.split(M);return t.jsxs("span",{className:"overflow-clip text-ellipsis",children:[U[0],t.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:U[1]}),U?.slice(2)?.join("")]})},T=v.useCallback(D=>{u?.(),D.stopPropagation()},[u]),w=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions"].some(C=>a?.toLowerCase().includes(C)),k=o||!m;return s?null:t.jsx("button",{id:A,className:E("w-full p-1 bg-white dark:bg-black-800 group",n,k&&"opacity-60"),onClick:u?()=>null:H,disabled:k,onMouseMove:D=>D.stopPropagation(),children:t.jsxs("div",{className:E("flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!i&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?t.jsx("div",{className:E("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:t.jsx(fA,{placement:"top",title:b,children:r})}):null,t.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[t.jsx("div",{className:E("flex-1 min-w-0",y&&"max-w-[150px]"),style:{width:h},children:t.jsx(G,{className:E("font-medium text-sm truncate transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400"),appearance:"custom",children:g?N(a,g):a})}),d?.[a]?t.jsx("span",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-200 bg-neutral-100 dark:bg-black-700 border-[#D0D5DD] dark:border-black-700 text-xs leading-[18px] font-normal border rounded-full px-2 py-0.5",children:d[a]||""}):null,x?t.jsx("div",{className:"flex-shrink-0",children:t.jsx(Si,{fill:"var(--color-primary-600)"})}):null]}),c?t.jsx(t.Fragment,{children:b?t.jsx(fA,{placement:"top",title:b,children:t.jsx("div",{className:E("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):t.jsx("div",{className:E("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):null,P?t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(Ga,{variant:"light",shortcuts:P})}):null,u?t.jsx("div",{className:"flex-shrink-0",children:t.jsx(Ye,{onChange:T,isChecked:p,isDisabled:o,hideStatus:!0})}):null]})})};gr.displayName="OptionButton";const yr=(A,e)=>{const r=A.slice(0,2),a=je[r];return a?t.jsx("div",{className:`
|
|
38
|
+
disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400`,{"border-red-300":o,"border-gray-300 dark:border-black-700":!o,"text-neutral-400 dark:text-neutral-500":d,"text-neutral-900 dark:text-neutral-50":!d,"border-none":m,"focus:border-none":m,"placeholder:text-neutral-400 dark:placeholder:text-black-400":d,"placeholder:text-neutral-400 dark:placeholder:text-black-300":!d},f,D&&k?.color&&`!bg-${k.color}-50 border-${k.color}-300`),style:D&&k?{backgroundColor:k.hexBgColor||void 0,borderColor:k.hexBorderColor||void 0,...H}:H,rows:n,placeholder:e,disabled:d,maxLength:p||void 0,id:P,ref:u,onClick:V=>V.stopPropagation(),autoComplete:"off"}),p?t.jsxs(G,{className:"mt-0.5 text-right text-neutral-900 dark:text-white",appearance:"custom",size:"extra-small",children:[t.jsxs("span",{className:`${r?.length>=p?"text-error-500":r?.length>p-Math.min(50,p/5)?"text-warning-500 dark:text-warning-300":""}`,children:[r?.length||0," "]}),"/ ",p]}):null,o&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:o})]}),X&&D&&k&&C&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:V=>V.stopPropagation(),onMouseDown:V=>V.preventDefault(),onKeyDown:V=>{V.key==="Escape"&&q(!1)},children:t.jsx(C,{riskDetails:k})})]})});ht.displayName="TextAreaField";const XA=({children:A,className:e,variant:r="default",onClick:a,disabled:n,tooltip:o,tooltipPlacement:l="top",noborder:s,id:i})=>{const c="flex items-center",d={default:`bg-white dark:bg-black-800 hover:bg-neutral-100 dark:hover:bg-black-700 rounded-lg ${s?"":"border border-neutral-300 dark:border-neutral-800"} p-2 hover:opacity-80`,secondary:`bg-transparent rounded-lg ${s?"":"border border-neutral-300 dark:border-black-400"} p-2 hover:opacity-80`,native:`bg-transparent rounded-lg ${s?"":"border border-neutral-300"} p-2 hover:opacity-80`,ghost:"text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 dark:hover:text-neutral-200 dark:hover:bg-neutral-800 p-1 cursor-pointer rounded-full hover:scale-75 transition-all duration-500 ease-in-out"},f=n?"cursor-not-allowed opacity-50":"cursor-pointer";return t.jsx(fA,{title:o,placement:l,delayShow:!0,children:t.jsx("button",{id:i,disabled:n,className:`${c} ${d[r]} ${e||""} ${f}`,onClick:a,children:A})})},Ea=v.forwardRef(({id:A,label:e,placeholder:r,value:a,onChange:n,errorMessage:o,defaultValue:l,required:s=!1,isRequiredConditional:i=!1,masterDataName:c,masterDataColumnName:d,masterDataFormula:f,masterDataFilters:u,tags:p,index:g,tooltip:y="",originalCase:x=!1,color:h="",isGTN:b=!1,labelClassName:m,gtnName:P=null,isAiExtracted:H=!1,disabled:N=!1,reference:T={},isLiveField:w=!1,onBlur:k,onAddGTNToDocument:D,riskDetails:C,isRiskAnalysisOpen:L=!1,RiskDetailsCard:M,primaryColorShades:U,setDisableActions:O,showDeprecatedFieldWarning:X,MasterDataModal:q,parseMasterDataFormula:z},V)=>{const{t:F}=CA.useTranslation(),[j,Q]=v.useState(!1),[K,W]=v.useState(null),[I,_]=v.useState(!1),[Y,eA]=v.useState(""),[B,Z]=v.useState(null),AA=v.useRef(null),sA=V||AA;v.useEffect(()=>{W(a)},[g]),v.useEffect(()=>{K!==null&&K!==a&&n(K,B)},[K,B]);const lA=()=>{O?.(!I),_(!I)},xA=hA=>{if(hA.keyCode===9||hA.key==="Enter"){const MA=sA.current||AA.current;MA&&(W(Y),MA.blur())}},J=(hA,MA)=>{let ne=hA;f&&z&&(ne=z(f,MA)),eA(""),W(ne),lA(),Z(MA)},$=()=>{W(""),Z(null)},iA=hA=>{D&&P&&D({key:P,value:hA})},SA=()=>{const hA="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",MA=o?"border-red-300":L&&C?.color?`border-${C?.color}-300`:"border-gray-300 dark:border-black-600",ne="placeholder:text-neutral-900 dark:placeholder:text-black-400",Fe=`${L&&C?.color?`bg-${C?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${h||"text-neutral-900 dark:text-black-200"}`;return`${hA} ${MA} ${Fe} ${ne}`},qA=()=>K!==null?K:f&&z?z(f,T):a;return v.useEffect(()=>{I&&!c&&(X?.(),_(!1))},[I,c,X]),t.jsxs("div",{className:E("flex gap-0.5 w-full relative",j&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!o}),onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),children:[b&&!j?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("flex flex-col w-full"),children:[t.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${x?"":"capitalize"} ${m||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(e)||"",required:s||!1,isRequiredConditional:i||!1}),w&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),H&&t.jsx(GA,{}),t.jsx(EA,{labels:p}),y&&t.jsx(fA,{placement:"top",title:`${y}${f?` | ${f}`:""}`,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),b&&j&&D?t.jsx("button",{id:"btn-master-data-input-add-to-document",className:"cursor-pointer",onClick:()=>iA(a?.toString()||""),type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:F("Add to document"),children:t.jsx(nA.NoteAddOutlined,{sx:{fontSize:16,color:U?.[600]||"var(--color-primary-600)"}})})}):null]})}),t.jsxs("label",{className:"relative block mt-1",children:[t.jsx("input",{id:A,ref:sA,required:s,placeholder:r,className:SA(),onChange:hA=>{n(hA.target.value,B),W(hA.target?.value)},onKeyDown:xA,value:qA(),defaultValue:l,disabled:!0,autoComplete:"off",onBlur:k}),t.jsx(XA,{id:"btn-dynamic-data-input-rx-cross",onClick:$,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:N,children:t.jsx(nA.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),t.jsx(XA,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:lA,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:N,children:t.jsx(nA.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),o&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:o}),I&&q&&t.jsx(q,{isVisible:I,onSelected:J,onClose:lA,masterDataColumnName:d,masterDataFilters:u,masterDataName:c,masterDataId:c,showFilters:!0})]}),j&&C&&L&&M&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:hA=>hA.stopPropagation(),onMouseDown:hA=>hA.preventDefault(),onKeyDown:hA=>{hA.key==="Escape"&&Q(!1)},children:t.jsx(M,{riskDetails:C})})]})});Ea.displayName="MasterDataInputField";const hi=A=>Array.isArray(A)?A.map(e=>typeof e=="string"||typeof e=="number"?e:e.value):A||null,vi=A=>A.filter((e,r,a)=>a.findIndex(n=>n.value===e.value&&n.label===e.label)===r),mi=({options:A,value:e,defaultValue:r})=>A?.length?vi(A.map(a=>({...a,color:a.color}))):Array.isArray(e)&&e.length&&typeof e[0]=="object"&&"label"in e[0]?e.map(a=>({label:String(a?.label||""),value:String(a?.value||""),color:a?.color})):e&&typeof e=="object"&&"label"in e?[{label:String(e.label||""),value:String(e.value||""),color:e?.color}]:Array.isArray(r)&&r.length&&typeof r[0]=="object"&&"label"in r[0]?r.map(a=>({label:String(a?.label||""),value:String(a?.value||""),color:a?.color})):r&&typeof r=="object"&&"label"in r?[{label:String(r.label||""),value:String(r.value||""),color:r?.color}]:[],bi=({hasExistingData:A})=>t.jsx("div",{className:"!w-full px-3 py-1.5",children:A?t.jsx(dA.Skeleton,{paragraph:{rows:1,width:"100%"}}):t.jsx(dA.Skeleton,{})}),gi=({showSelectAll:A,mode:e,options:r,searchValue:a,handleSelectAll:n,isAllSelected:o,menu:l,isLoading:s,hasExistingData:i,t:c})=>t.jsxs(t.Fragment,{children:[A&&e==="multiple"&&r.length>0&&a.trim().length===0&&t.jsx("div",{role:"button",tabIndex:0,className:"px-3 py-2 border-b border-gray-200 dark:border-gray-600 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700",onClick:d=>{d.stopPropagation(),n()},onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())},children:t.jsx(G,{size:"small",variant:"semibold",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:c(o?"Deselect all":"Select all")})}),l,s&&t.jsx(bi,{hasExistingData:i})]}),vt=v.forwardRef(({label:A,value:e,mode:r,errorMessage:a,selectOptions:n=[],required:o=!1,tags:l,className:s,onInputChange:i,tooltip:c,originalCase:d=!1,isAiExtracted:f=!1,isGTN:u=!1,gtnName:p=null,onChange:g,onSearch:y,debounceTimeout:x=500,filterOption:h=!0,onScroll:b,isLoading:m=!1,allowClear:P=!0,autoClearSearchValue:H=!0,fullOpacityLabel:N=!1,showAllTags:T=!1,customTagRender:w,inputStyles:k,disabled:D=!1,showSelectAll:C=!1,labelClassName:L,riskDetails:M,isRiskAnalysisOpen:U=!1,RiskDetailsCard:O,AddToDocumentIcon:X,primaryColorShades:q,UserAvatar:z,onAddGTNToDocument:V,isRequiredConditional:F,isLiveField:j=!1,...Q},K)=>{const{t:W}=CA.useTranslation(),[I,_]=v.useState(!1),Y=v.useRef(null),[eA,B]=v.useState(!1),[Z,AA]=v.useState(""),sA=()=>{if(V){let oA="";lA==null?oA="":typeof lA=="string"||typeof lA=="number"?oA=String(lA):Array.isArray(lA)?oA=lA.map(pA=>typeof pA=="object"&&pA!==null&&"value"in pA?pA.value:pA).join(", "):typeof lA=="object"&&"value"in lA&&(oA=String(lA.value)),V({key:p,value:oA})}},lA=hi(e),xA=v.useMemo(()=>y?qs(y,x):null,[y,x]),J=(oA,vA)=>{if(Y.current&&Q.id){const pA=document.getElementById(Q.id);if(pA){const yA=Array.isArray(vA)?vA.map(Ha=>Ha.value):vA?.value;pA.dataset.selectedValue=JSON.stringify(yA);const We=new Event("change",{bubbles:!0});Object.defineProperty(We,"target",{writable:!1,value:pA}),pA.dispatchEvent(We);const ka=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${Q.id}`,value:yA,type:"change"}});pA.dispatchEvent(ka)}}if(r==="tags"){const pA=Array.isArray(oA)?oA:[oA];g?.(pA?.map(yA=>({label:yA,value:yA})))}else g?.(vA)},$=mi({options:n,value:e,defaultValue:Q?.defaultValue}),iA=v.useMemo(()=>$.length>0||lA!=null,[$,lA]),SA=v.useMemo(()=>{if(!r||r!=="multiple"||$.length===0)return!1;const oA=Array.isArray(lA)?lA:[];return $.map(pA=>pA.value).every(pA=>oA.some(yA=>typeof yA=="object"&&yA!==null&&"value"in yA?String(yA.value)===String(pA):String(yA)===String(pA)))},[lA,$,r]),qA=()=>{!r||r!=="multiple"||!g||g(SA?[]:$)},hA=v.useCallback(oA=>{if(!oA)return;const vA=new Event("submit",{bubbles:!0,cancelable:!0});oA.dispatchEvent(vA);const pA=oA.querySelector('button[type="submit"]');pA&&pA.click()},[]),MA=v.useCallback(oA=>{if(oA.key==="Enter"&&!eA&&lA){oA.preventDefault(),oA.stopPropagation();const vA=oA.currentTarget.closest("form");hA(vA)}},[eA,lA,hA]),ne=v.useCallback(oA=>{const{label:vA,value:pA,onClose:yA}=oA,ka=$.find(at=>String(at.value)===String(pA))?.color||"blue",Ha=at=>{at.preventDefault(),at.stopPropagation()};return t.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:t.jsx(TA,{label:vA,color:ka,size:"sm",onMouseDown:Ha,onClick:D?void 0:yA,isHashColor:!0,removable:!0,onRemove:yA})})},[$,D]),Fe=v.useCallback(oA=>{AA(oA),(i||xA)?.(oA)},[i,xA]);return t.jsxs("div",{ref:K,className:E("flex gap-0.5 w-full relative",I&&u?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),id:Q.id,children:[u&&!I?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("w-full flex flex-col gap-1 risk-analysis-select-field",s),onMouseDown:oA=>oA.stopPropagation(),role:"group","aria-labelledby":A?"select-field-label":void 0,children:[A?t.jsx("label",{id:"select-field-label",htmlFor:"label",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${d?"":"capitalize"} ${L||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(A)||"",required:o||!1,isRequiredConditional:F||!1}),j&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&t.jsx(GA,{}),t.jsx(EA,{labels:l}),c&&t.jsx(dA.Tooltip,{placement:"top",title:c,children:t.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:oA=>{(oA.key==="Enter"||oA.key===" ")&&oA.preventDefault()},children:t.jsx(VA,{})})})]}),u&&I&&X?t.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:sA,type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:W("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,t.jsx(dA.Select,{onKeyDown:MA,onOpenChange:B,disabled:D,className:`w-full text-black-900 dark:text-black-200 ${a&&o?"ant-select-status-error":"#e2e8f0"} ${U&&M?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":U&&M?.hexBgColor?M?.hexBgColor:"","--risk-border-color":U&&M?.hexBorderColor?M?.hexBorderColor:""},"aria-required":o,mode:r,value:lA,onChange:J,filterOption:y?h:(oA,vA)=>(vA?.label||"")?.toLowerCase()?.includes(oA?.toLowerCase()),showSearch:!0,onSearch:Fe||void 0,onPopupScroll:b,popupClassName:"select-field-dropdown-popup",popupRender:oA=>t.jsx(gi,{showSelectAll:C,mode:r,options:$,searchValue:Z,handleSelectAll:qA,isAllSelected:SA,menu:oA,isLoading:m,hasExistingData:iA,t:W}),options:$.map(({label:oA,value:vA,color:pA,...yA})=>({label:String(oA),value:String(vA),key:String(vA),id:String(vA),color:pA,...yA})),optionRender:oA=>{const vA=oA?.data?.fullname;if(vA&&z){const[pA,yA]=vA.split(" ");return t.jsxs("div",{className:"flex items-center justify-start gap-1",children:[t.jsx(z,{firstName:pA,lastName:yA,profilePic:oA?.data?.url||"",size:"xs",enablePopper:!0,userId:oA?.data?.value}),t.jsx("span",{className:"ml-2",children:oA.label})]})}return t.jsx("span",{children:oA.label})},autoClearSearchValue:H,onClear:()=>g&&g(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&T?void 0:"responsive",maxTagPlaceholder:oA=>t.jsx(dA.Tooltip,{styles:{root:{zIndex:5002}},trigger:"hover",title:oA.length>3?oA.slice(0,3).map(({label:vA})=>vA).join(", ")+"...":oA.map(({label:vA})=>vA).join(", "),overlayStyle:{pointerEvents:"none"},children:t.jsxs("span",{children:["+",oA.length," more"]})}),tagRender:w||ne,allowClear:P,...Q}),a&&t.jsx(G,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:a})]}),I&&M&&U&&O&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:oA=>oA.stopPropagation(),onMouseDown:oA=>oA.preventDefault(),onKeyDown:oA=>{oA.key==="Escape"&&_(!1)},children:t.jsx(O,{riskDetails:M})})]})});vt.displayName="SelectField";const Fa=v.forwardRef(({id:A,label:e,checked:r,isChecked:a,onChange:n,disabled:o=!1,required:l=!1,message:s,messageType:i="default",wrapperClassName:c,checkboxClassName:d,labelClassName:f,size:u="medium",variant:p="default",labelPosition:g="right",checkboxProps:y},x)=>{const h=r!==void 0?r:a||!1,b=()=>{switch(u){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},m=()=>{if(i==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(i==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(i==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(p){case"outline":return"text-primary-600 bg-transparent border-neutral-300 focus:ring-primary-500 dark:focus:ring-primary-600";case"solid":return"text-primary-600 bg-primary-50 border-primary-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-primary-900/20";default:return"text-primary-600 bg-gray-100 border-gray-300 focus:ring-primary-500 dark:focus:ring-primary-600 dark:bg-neutral-600 dark:border-gray-600"}},P=()=>i==="error"?"text-red-500 dark:text-red-400":i==="success"?"text-green-500 dark:text-green-400":i==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",H=()=>{switch(u){case"small":return"extra-small";case"large":return"medium";default:return"small"}},N=k=>{n(k.target.checked,k)},T=t.jsx(dA.Checkbox,{...y,ref:x,id:A,checked:h,onChange:N,disabled:o,className:E("rounded focus:ring-2 focus:ring-offset-gray-800 transition-colors duration-200",b(),m(),o&&"opacity-50 cursor-not-allowed",d),"aria-required":l,"aria-invalid":s&&i==="error"?"true":"false","aria-describedby":s?`${A}-message`:void 0}),w=e?t.jsx("label",{htmlFor:A,className:E("font-medium cursor-pointer transition-colors duration-200",o?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",g==="right"?"ml-2":"mr-2",f),children:t.jsxs(G,{variant:"medium",size:H(),appearance:"body",children:[e,l&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return t.jsxs("div",{className:E("flex flex-col",c),children:[t.jsx("div",{className:E("flex items-center",g==="left"&&"flex-row-reverse justify-end"),children:g==="left"?t.jsxs(t.Fragment,{children:[T,w]}):t.jsxs(t.Fragment,{children:[T,w]})}),t.jsx(uA.AnimatePresence,{children:s&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${A}-message`,role:i==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",P()),appearance:"custom",size:"extra-small",variant:"medium",children:s})})})]})});Fa.displayName="Checkbox";const Wa=({label:A,isChecked:e,onChange:r,id:a,...n})=>t.jsxs("div",{className:"flex items-center",children:[t.jsx(dA.Checkbox,{checked:e,onChange:r,id:a,type:"checkbox",value:"",className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:!bg-neutral-600 dark:border-gray-600",...n}),t.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:A})]}),ja=v.forwardRef(({id:A,label:e,value:r,defaultValue:a="#000000",onChange:n,onColorChange:o,disabled:l=!1,required:s=!1,message:i,messageType:c="default",wrapperClassName:d,inputClassName:f,labelClassName:u,size:p="medium",showValue:g=!1,valueFormat:y="hex",inputProps:x,helpText:h},b)=>{const m=r!==void 0?r:a,P=()=>{switch(p){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},H=()=>c==="error"?"text-red-500 dark:text-red-400":c==="success"?"text-green-500 dark:text-green-400":c==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",N=()=>c==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":c==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":c==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",T=()=>{switch(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},w=L=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(L);if(!M)return L;const U=parseInt(M[1],16),O=parseInt(M[2],16),X=parseInt(M[3],16);return`rgb(${U}, ${O}, ${X})`},k=L=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(L);if(!M)return L;const U=parseInt(M[1],16)/255,O=parseInt(M[2],16)/255,X=parseInt(M[3],16)/255,q=Math.max(U,O,X),z=Math.min(U,O,X);let V=0,F=0;const j=(q+z)/2;if(q!==z){const Q=q-z;switch(F=j>.5?Q/(2-q-z):Q/(q+z),q){case U:V=(O-X)/Q+(O<X?6:0);break;case O:V=(X-U)/Q+2;break;case X:V=(U-O)/Q+4;break}V/=6}return`hsl(${Math.round(V*360)}, ${Math.round(F*100)}%, ${Math.round(j*100)}%)`},D=()=>{switch(y){case"rgb":return w(m);case"hsl":return k(m);default:return m.toUpperCase()}},C=L=>{const M=L.target.value;n(M,L),o?.(M)};return t.jsxs("div",{className:E("flex flex-col w-full",d),children:[e&&t.jsx("label",{htmlFor:A,className:E("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",u),children:t.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:t.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:t.jsxs(G,{variant:"medium",size:T(),appearance:"subtitle",children:[e,s&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),h&&t.jsx(G,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:h}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"relative",children:t.jsx("input",{...x,ref:b,type:"color",id:A,value:m,onChange:C,disabled:l,required:s,className:E("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",P(),N(),l&&"opacity-50 cursor-not-allowed",f),style:{backgroundColor:m},"aria-required":s,"aria-invalid":i&&c==="error"?"true":"false","aria-describedby":i||h?`${A}-description`:void 0})}),g&&t.jsx("div",{className:"flex-1",children:t.jsx(G,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:D()})})]}),t.jsx(uA.AnimatePresence,{children:i&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${A}-description`,role:c==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",H()),appearance:"custom",size:"extra-small",variant:"medium",children:i})})}),h&&!i&&t.jsx("div",{id:`${A}-description`,className:"sr-only",children:h})]})});ja.displayName="ColorPicker";const mt=()=>{const[A,e]=v.useState(!1);return v.useEffect(()=>{const r=()=>{e(document.documentElement.classList.contains("dark"))};r();const a=new MutationObserver(n=>{n.forEach(o=>{o.attributeName==="class"&&r()})});return a.observe(document.documentElement,{attributes:!0}),()=>a.disconnect()},[]),A},Qa=({id:A,label:e,errorMessage:r,selectOptions:a,loading:n,isClearable:o,multiSelect:l,selectedValues:s,disabled:i,required:c,value:d,className:f,tooltip:u,tags:p,originalCase:g=!1,onChange:y,filterOption:x,placeholder:h,...b})=>{const m=mt(),P=(C,L)=>{y&&y(C);const M=document.getElementById(A);if(M){const U=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${A}`,value:C,type:"change"}});M.dispatchEvent(U)}},H={control:(C,L)=>({...C,borderColor:r&&c?m?"#F04438":"rgb(253 164 155)":L.isFocused?m?"rgb(64 64 64)":"var(--color-primary-600)":m?"rgb(38 38 38)":"rgb(229 229 229)",backgroundColor:m?(L.isDisabled,"rgb(38 38 38)"):L.isDisabled?"rgb(245 245 245)":"rgb(255 255 255)",borderRadius:"6px",height:"32px",minHeight:"32px",fontSize:"14px",padding:"4px 10px",opacity:L.isDisabled?.6:1,cursor:L.isDisabled?"not-allowed":"default",boxShadow:(L.isFocused,"none"),"&:hover":{borderColor:L.isFocused?m?"rgb(64 64 64)":"var(--color-primary-600)":m?"rgb(38 38 38)":"rgb(229 229 229)"},placeholder:{color:m?"rgb(38 38 38)":"rgb(163 163 163)"}}),valueContainer:C=>({...C,fontSize:"14px",padding:0,height:"20px"}),input:C=>({...C,margin:"0",padding:"0",color:m?"rgb(229 229 229)":"inherit"}),indicatorsContainer:C=>({...C,fontSize:"14px",padding:0,height:"20px"}),option:(C,L)=>({...C,fontFamily:"Inter",fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:m?"1px solid rgb(38 38 38)":"1px solid rgb(229 229 229)",backgroundColor:m?"rgb(10 10 10)":"rgb(255 255 255)",color:L.isDisabled?m?"rgb(115 115 115)":"rgb(163 163 163)":m?"rgb(229 229 229)":"inherit",cursor:L.isDisabled?"not-allowed":"pointer",opacity:L.isDisabled?.6:1,"&:hover":{backgroundColor:L.isDisabled?m?"rgb(38 38 38)":"rgb(255 255 255)":m?"rgb(64 64 64)":"rgb(245 245 245)"}}),singleValue:(C,L)=>({...C,fontFamily:"Inter",fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",display:"block",color:L.isDisabled?m?"rgb(115 115 115)":"rgb(163 163 163)":m?"rgb(229 229 229)":"inherit"}),placeholder:(C,L)=>({...C,fontFamily:"Inter",fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:L.isDisabled?m?"rgb(82 82 82)":"rgb(163 163 163)":"rgb(115 115 115)"}),multiValue:C=>({...C,backgroundColor:"rgb(230 241 252)",border:"1px solid rgb(198 225 249)",borderRadius:"6px",font:"Inter"}),multiValueLabel:C=>({...C,color:"var(--color-primary-600)"}),multiValueRemove:C=>({...C,color:"var(--color-primary-600)",":hover":{backgroundColor:"rgb(230 241 252)"}}),menu:C=>({...C,zIndex:1e3,backgroundColor:m?"rgb(10 10 10)":"rgb(255 255 255)",border:m?"1px solid rgb(64 64 64)":"1px solid rgb(229 229 229)"})},N=()=>t.jsx("div",{children:t.jsx(nA.ChevronLeftRounded,{className:"-rotate-90 dark:text-black-100",sx:{fontSize:"16px"}})}),T=({...C})=>t.jsx("div",{className:"absolute top-0 left-0 h-full flex items-center dark:text-black-100",children:C.data.label}),w=!!s?.length,D=o?w||!!d:!1;return t.jsxs("div",{id:A,className:E("flex flex-col",f),children:[e&&t.jsxs("label",{id:A+"Label",htmlFor:"text",className:`mb-1 ${m?"text-black-300":"text-neutral-600"} inline-flex items-center gap-1 ${g?"":"capitalize"}`,children:[t.jsx(kA,{label:String(e)||"",required:c||!1}),t.jsx(EA,{labels:p}),u&&t.jsx(dA.Tooltip,{placement:"top",title:u,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),t.jsx(Vs,{...b,id:"cm"+e,required:c,options:a,isClearable:D,isLoading:n,isDisabled:i,styles:H,isMulti:l,value:l?s:d,onChange:P,filterOption:x,placeholder:h,classNames:{menuList:()=>"nowheel"},components:{IndicatorsContainer:N,SingleValue:T}}),r&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};Qa.displayName="CreatableSelectField";const mr=({ref:A,handler:e,enabled:r=!0})=>{v.useEffect(()=>{if(!r)return;const a=n=>{A.current&&!A.current.contains(n.target)&&e()};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[A,e,r])},yi={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",850:"#1e3a8a",900:"#1e3a8a",950:"#172554",975:"#121f47"},Ka=({id:A,label:e,options:r,placeholder:a,onChange:n,isLoading:o=!1,hideLabel:l=!1,errorMessage:s,required:i=!1,optionConfig:c,menuConfig:d,value:f,isMulti:u=!1,isClearable:p=!0,disabled:g=!1,className:y,isDark:x=!1,primaryColorShades:h=yi})=>{const b=v.useRef(null),[m,P]=v.useState(null),[H,N]=v.useState("");mr({ref:b,handler:()=>{P(null)}});const T={control:(M,U)=>({...M,borderColor:s&&i?"#F04438":U.isFocused?x?"#1e1e1e":h[600]:x?"#1e1e1e":"#e2e8f0",backgroundColor:U.isDisabled?x?"#1a1a1a":"#f5f5f5":x?"#262626":"#FFFFFF",color:U.isDisabled?x?"#666666":"#a0a0a0":x?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:U.isDisabled?"not-allowed":"default",opacity:(U.isDisabled,1),boxShadow:U.isFocused?x?`0 0 0 2px ${h[400]}`:`0 0 0 2px ${h[500]}`:"none"}),valueContainer:M=>({...M,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:x?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:M=>({...M,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:M=>({...M,fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:x?"1px solid #1e1e1e":"1px solid #eee",backgroundColor:x?"#000000":"#FFFFFF",color:x?"#d4d4d4":"#0F172A",display:"flex",alignItems:"center",zIndex:200,":hover":{backgroundColor:x?"#171717":h[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(M,U)=>({...M,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(U.isDisabled,x?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(M,U)=>({...M,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(U.isDisabled,x?"#595959":"#9CA3AF")}),multiValue:M=>({...M,backgroundColor:x?"#000000":h[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:M=>({...M,padding:"0",height:"30px"}),multiValueLabel:M=>({...M,color:x?"#d4d4d4":h[600],fontSize:"12px"}),multiValueRemove:M=>({...M,color:x?"#d4d4d4":h[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:x?"#171717":h[50]},svg:{height:"12px",width:"12px"}})},w=M=>{const U=r.filter(O=>O?.label?.toLowerCase()?.includes(H?.toLowerCase()));return t.jsx(fr.components.MenuList,{...M,className:E("!z-50 rounded !visible overflow-x-scroll",x?"bg-black-800":"bg-white",x?"text-neutral-300":"text-slate-900",d?.className),ref:b,children:U?.length?U.map((O,X)=>t.jsxs("div",{className:E("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",g?"cursor-not-allowed opacity-50":"cursor-pointer",x?"text-neutral-300":"text-slate-900",!g&&k(O)?x?"bg-black-700":"bg-primary-50":g?"":x?"hover:bg-black-700":"hover:bg-primary-50",d?.optionClassName?"":x?"border-b border-black-700":"border-b border-[#eee]"),onClick:q=>{g||(q.stopPropagation(),M.selectOption(O))},children:[c?.component?t.jsx(c.component,{...c.componentProps,...O}):t.jsx("div",{children:O.label}),t.jsx("div",{className:"flex items-center gap-1",children:k(O)&&c?.selectIndecator?c?.selectIndecator:null})]},X)):t.jsx("div",{className:E("opacity-50 flex justify-center items-center p-1 font-medium",x?"text-neutral-400":"text-gray-700"),children:"No options"})})},k=M=>u?m?.some(U=>U.value===M.value):M.value===m?.value,D=M=>{const{children:U,innerProps:O,isDisabled:X,getValue:q}=M,z=q();return t.jsx(fr.components.SingleValue,{...M,innerProps:O,isDisabled:X,children:z.length>0?z.map((V,F)=>t.jsx("span",{children:c?.component?t.jsx(c.component,{...c.componentProps,...V}):t.jsx("div",{children:V.label})},F)):t.jsx(t.Fragment,{children:U})})},C=M=>{const{innerProps:U,isDisabled:O,data:X}=M;return t.jsx(fr.components.MultiValue,{...M,innerProps:U,isDisabled:O,children:c?.component?t.jsx(c.component,{...c.componentProps,...X}):t.jsx("div",{children:X.label})})},L=(M,U)=>(N(U),!0);return t.jsxs("div",{className:E("flex flex-col",x?"text-black-300":"text-slate-900",o?"opacity-50":"opacity-100",g?"cursor-not-allowed":""),id:A,children:[l||!e?null:t.jsx(kA,{label:String(e)||"",required:i||!1}),t.jsx(fr,{required:!0,options:r,placeholder:a,value:f,onChange:M=>{P(M),n(M)},styles:T,isMulti:u,className:E(x&&"bg-black-800 border-black-700",y),components:{MenuList:w,SingleValue:D,MultiValue:C},filterOption:L,closeMenuOnSelect:!0,isClearable:p,isDisabled:g}),s&&t.jsx(G,{className:E("mt-1",x?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:s})]})};Ka.displayName="CustomizableSelectField";const Ya=[{value:"AED",label:"UAE Dirham"},{value:"AFN",label:"Afghan Afghani"},{value:"ALL",label:"Albanian Lek"},{value:"AMD",label:"Armenian Dram"},{value:"AOA",label:"Angolan Kwanza"},{value:"ARS",label:"Argentine Peso"},{value:"AUD",label:"Australian Dollar"},{value:"AWG",label:"Aruban Florin"},{value:"AZN",label:"Azerbaijani Manat"},{value:"BBD",label:"Barbadian Dollar"},{value:"BDT",label:"Bangladeshi Taka"},{value:"BGN",label:"Bulgarian Lev"},{value:"BHD",label:"Bahraini Dinar"},{value:"BIF",label:"Burundian Franc"},{value:"BMD",label:"Bermudian Dollar"},{value:"BND",label:"Brunei Dollar"},{value:"BRL",label:"Brazilian Real"},{value:"BSD",label:"Bahamian Dollar"},{value:"BTN",label:"Bhutanese Ngultrum"},{value:"BWP",label:"Botswanan Pula"},{value:"BYN",label:"Belarusian Ruble"},{value:"BZD",label:"Belize Dollar"},{value:"CAD",label:"Canadian Dollar"},{value:"CDF",label:"Congolese Franc"},{value:"CHE",label:"WIR Euro"},{value:"CHF",label:"Swiss Franc"},{value:"CHW",label:"WIR Franc"},{value:"CLP",label:"Chilean Peso"},{value:"CNY",label:"Chinese Yuan"},{value:"COP",label:"Colombian Peso"},{value:"CRC",label:"Costa Rican Colón"},{value:"CUC",label:"Cuban Convertible Peso"},{value:"CUP",label:"Cuban Peso"},{value:"CVE",label:"Cape Verdean Escudo"},{value:"CZK",label:"Czech Koruna"},{value:"DJF",label:"Djiboutian Franc"},{value:"DKK",label:"Danish Krone"},{value:"DOP",label:"Dominican Peso"},{value:"DZD",label:"Algerian Dinar"},{value:"EGP",label:"Egyptian Pound"},{value:"ERN",label:"Eritrean Nakfa"},{value:"ESP",label:"Spanish Peseta"},{value:"ETB",label:"Ethiopian Birr"},{value:"EUR",label:"Euro"},{value:"FJD",label:"Fijian Dollar"},{value:"FKP",label:"Falkland Islands Pound"},{value:"GBP",label:"British Pound"},{value:"GEL",label:"Georgian Lari"},{value:"GHS",label:"Ghanaian Cedi"},{value:"GIP",label:"Gibraltar Pound"},{value:"GMD",label:"Gambian Dalasi"},{value:"GNF",label:"Guinean Franc"},{value:"GTQ",label:"Guatemalan Quetzal"},{value:"GYD",label:"Guyanese Dollar"},{value:"HKD",label:"Hong Kong Dollar"},{value:"HNL",label:"Honduran Lempira"},{value:"HRK",label:"Croatian Kuna"},{value:"HTG",label:"Haitian Gourde"},{value:"HUF",label:"Hungarian Forint"},{value:"IDR",label:"Indonesian Rupiah"},{value:"ILS",label:"Israeli New Shekel"},{value:"INR",label:"Indian Rupee"},{value:"IQD",label:"Iraqi Dinar"},{value:"IRR",label:"Iranian Rial"},{value:"ISK",label:"Icelandic Króna"},{value:"JMD",label:"Jamaican Dollar"},{value:"JOD",label:"Jordanian Dinar"},{value:"JPY",label:"Japanese Yen"},{value:"KES",label:"Kenyan Shilling"},{value:"KGS",label:"Kyrgyzstani Som"},{value:"KHR",label:"Cambodian Riel"},{value:"KMF",label:"Comorian Franc"},{value:"KPW",label:"North Korean Won"},{value:"KRW",label:"South Korean Won"},{value:"KWD",label:"Kuwaiti Dinar"},{value:"KYD",label:"Caymanian Dollar"},{value:"KZT",label:"Kazakhstani Tenge"},{value:"LAK",label:"Lao Kip"},{value:"LBP",label:"Lebanese Pound"},{value:"LKR",label:"Sri Lankan Rupee"},{value:"LRD",label:"Liberian Dollar"},{value:"LSL",label:"Lesotho Loti"},{value:"LTL",label:"Lithuanian Litas"},{value:"LVL",label:"Latvian Lats"},{value:"LYD",label:"Libyan Dinar"},{value:"MAD",label:"Moroccan Dirham"},{value:"MDL",label:"Moldovan Leu"},{value:"MGA",label:"Malagasy Ariary"},{value:"MKD",label:"Macedonian Denar"},{value:"MMK",label:"Myanmar Kyat"},{value:"MNT",label:"Mongolian Tögrög"},{value:"MOP",label:"Macanese Pataca"},{value:"MRU",label:"Mauritanian Ouguiya"},{value:"MUR",label:"Mauritian Rupee"},{value:"MVR",label:"Maldivian Rufiyaa"},{value:"MWK",label:"Malawian Kwacha"},{value:"MXN",label:"Mexican Peso"},{value:"MYR",label:"Malaysian Ringgit"},{value:"MZN",label:"Mozambican Metical"},{value:"NAD",label:"Namibian Dollar"},{value:"NGN",label:"Nigerian Naira"},{value:"NIO",label:"Nicaraguan Córdoba"},{value:"NOK",label:"Norwegian Krone"},{value:"NPR",label:"Nepalese Rupee"},{value:"NZD",label:"New Zealand Dollar"},{value:"OMR",label:"Omani Rial"},{value:"PAB",label:"Panamanian Balboa"},{value:"PEN",label:"Peruvian Sol"},{value:"PHP",label:"Philippine Peso"},{value:"PKR",label:"Pakistani Rupee"},{value:"PLN",label:"Polish Zloty"},{value:"PRB",label:"Transnistrian Ruble"},{value:"PYG",label:"Paraguayan Guarani"},{value:"QAR",label:"Qatari Riyal"},{value:"RON",label:"Romanian Leu"},{value:"RSD",label:"Serbian Dinar"},{value:"RUB",label:"Russian Ruble"},{value:"RWF",label:"Rwandan Franc"},{value:"SAR",label:"Saudi Riyal"},{value:"SCR",label:"Seychellois Rupee"},{value:"SDG",label:"Sudanese Pound"},{value:"SEK",label:"Swedish Krona"},{value:"SGD",label:"Singapore Dollar"},{value:"SHP",label:"Saint Helena Pound"},{value:"SLL",label:"Sierra Leonean Leone"},{value:"SOS",label:"Somali Shilling"},{value:"SRD",label:"Surinamese Dollar"},{value:"SSP",label:"South Sudanese Pound"},{value:"SVC",label:"Salvadoran Colón"},{value:"SYP",label:"Syrian Pound"},{value:"SZL",label:"Swazi Lilangeni"},{value:"THB",label:"Thai Baht"},{value:"TJS",label:"Tajikistani Somoni"},{value:"TMT",label:"Turkmenistani Manat"},{value:"TND",label:"Tunisian Dinar"},{value:"TOP",label:"Tongan Paʻanga"},{value:"TRY",label:"Turkish Lira"},{value:"TWD",label:"New Taiwan Dollar"},{value:"TZS",label:"Tanzanian Shilling"},{value:"UAH",label:"Ukrainian Hryvnia"},{value:"UGX",label:"Ugandan Shilling"},{value:"USD",label:"United States Dollar"},{value:"UYU",label:"Uruguayan Peso"},{value:"UZS",label:"Uzbekistani Som"},{value:"VEF",label:"Venezuelan Bolívar"},{value:"VND",label:"Vietnamese Dong"},{value:"VUV",label:"Vanuatu Vatu"},{value:"WST",label:"Samoan Tala"},{value:"YER",label:"Yemeni Rial"},{value:"ZAR",label:"South African Rand"},{value:"ZMW",label:"Zambian Kwacha"},{value:"ZWL",label:"Zimbabwean Dollar"}],Za={AED:"د.إ",AFN:"؋",ALL:"Lek",AMD:"դր",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"Fr",BMD:"$",BND:"$",BOB:"Bs.",BOV:"Bs.",BRL:"R$",BSD:"$",BTN:"Nu.",BWP:"P",BYN:"Br",BZD:"$",CAD:"$",CDF:"Fr",CHE:"Fr",CHF:"Fr",CHW:"Fr",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fr",DKK:"kr",DOP:"$",DZD:"د.ج",EGP:"£",ERN:"Nkf",ESP:"₧",ETB:"Br",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GHS:"₵",GIP:"£",GMD:"D",GNF:"Fr",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",INR:"₹",IQD:"ع.د",IRR:"ریال",ISK:"kr",JMD:"$",JOD:"د.ا",JPY:"¥",KES:"Sh",KGS:"лв",KHR:"៛",KMF:"Fr",KPW:"₩",KRW:"₩",KWD:"د.ك",KYD:"$",KZT:"₸",LAK:"₭",LBP:"ل.ل",LKR:"₨",LRD:"$",LSL:"M",LTL:"Lt",LVL:"Ls",LYD:"د.ل",MAD:"د.م.",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"P",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"ر.ع.",PAB:"B/.",PEN:"S/",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PRB:"₽",PYG:"₲",QAR:"ر.ق",RON:"lei",RSD:"дин.",RUB:"₽",RWF:"Fr",SAR:"ر.س",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SOS:"Sh",SRD:"$",SSP:"£",STN:"Db",SVC:"$",SYP:"ل.س",SZL:"L",THB:"฿",TJS:"SM",TMT:"m",TND:"د.ت",TOP:"T$",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"Sh",UAH:"₴",UGX:"Sh",USD:"$",UYU:"$",UZS:"сўм",VEF:"Bs.F",VND:"₫",VUV:"Vt",WST:"T",XAF:"Fr",XAG:"XAG",XAU:"XAU",XBA:"XBA",XBB:"XBB",XBC:"XBC",XBD:"XBD",XCD:"$",XDR:"XDR",XOF:"Fr",XPD:"XPD",XPF:"₣",XPT:"XPT",XSU:"XSU",XTS:"XTS",XUA:"XUA",YER:"ر.ي",ZAR:"R",ZMW:"K",ZWL:"$"},br=({classValue:A,size:e=24,fill:r="currentColor",...a})=>t.jsxs("svg",{className:E(A),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[t.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),t.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:t.jsx("path",{d:"M8.10023 3.90357C7.97023 3.77357 7.76023 3.77357 7.63023 3.90357L6.00023 5.53023L4.37023 3.90023C4.24023 3.77023 4.03023 3.77023 3.90023 3.90023C3.77023 4.03023 3.77023 4.24023 3.90023 4.37023L5.53023 6.00023L3.90023 7.63023C3.77023 7.76023 3.77023 7.97023 3.90023 8.10023C4.03023 8.23023 4.24023 8.23023 4.37023 8.10023L6.00023 6.47023L7.63023 8.10023C7.76023 8.23023 7.97023 8.23023 8.10023 8.10023C8.23023 7.97023 8.23023 7.76023 8.10023 7.63023L6.47023 6.00023L8.10023 4.37023C8.2269 4.24357 8.2269 4.03023 8.10023 3.90357Z",fill:"#98A2B3"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"clip0_8212_362816",children:t.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});br.displayName="CloseRounded";const Ba=({width:A=15,height:e=15,fill:r="#98A2B3",className:a})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:A.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:a,children:t.jsx("path",{d:"M17.5 17.5L12.5001 12.5M14.1667 8.33333C14.1667 11.555 11.555 14.1667 8.33333 14.1667C5.11167 14.1667 2.5 11.555 2.5 8.33333C2.5 5.11167 5.11167 2.5 8.33333 2.5C11.555 2.5 14.1667 5.11167 14.1667 8.33333Z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ia=A=>{const{value:e,placeholder:r,onChange:a,id:n,debounceTimeout:o=0,classValues:l,handleKeyDown:s,isClearable:i,onFocusText:c,autoComplete:d="false",searchRef:f,hasNavigation:u=!1,autoFocus:p=!1,searchConfig:g,hideSearchIcon:y,allowAStarSearch:x=!1,...h}=A,{t:b}=CA.useTranslation(),[m,P]=v.useState(!1),[H,N]=v.useState("search"),T=v.useRef(null),{searchCount:w,searchPointer:k,setSearchPointer:D}=g||{},C=()=>{P(!0),N(c||r||b("Search"));const M=f||T;M.current&&M.current.focus()},L=()=>{P(!1),N("")};return t.jsxs("label",{className:E("relative flex items-center justify-start px-4 py-[9px] w-full dark:bg-neutral-900 bg-white dark:bg-black-700 rounded-lg text-neutral-400 h-8",l),children:[!y&&t.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:t.jsx(Ba,{width:"16",height:"16"})}),t.jsx(nt.DebounceInput,{...h,spellCheck:"false",debounceTimeout:o,id:n,inputRef:f||T,type:"text",className:E(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${y?"pl-2":"pl-10"} pl-10 pr-7 w-full text-sm dark:text-white bg-transparent rounded-lg focus:outline-none focus:!ring-primary-500 focus:!border-primary-500`,"border border-solid","dark:border-neutral-800 border-neutral-200","dark:caret-white",l),onKeyDown:M=>{M.key==="Enter"&&M.preventDefault(),s&&s(M)},value:e||"",placeholder:m?H:x?"":`${b("Search")}`,onChange:M=>a?.(M.target.value),autoComplete:d,onFocus:M=>{P(!0),C(),A.onFocus&&A.onFocus(M)},onBlur:M=>{P(!1),L(),A.onBlur&&A.onBlur(M)},autoFocus:p}),u&&e&&t.jsxs("div",{className:E("absolute mr-2 focus:outline-none flex gap-1",i?"right-6":"right-0"),children:[!!w&&(w||0)>0&&t.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(k||0)+1,"/",w]}),t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{D&&D(M=>(M||0)-1)},disabled:k===0,children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{D&&D(M=>(M||0)+1)},disabled:k===(w||0)-1,children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),x&&!(i&&e)&&!m&&!e?t.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[t.jsxs(G,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[b("Search")," (use"]}),t.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:t.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})}),t.jsx(G,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):i&&e&&t.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>a?.(""),children:t.jsx(br,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var He=(A=>(A.LEFT="left",A.RIGHT="right",A.TOP="top",A))(He||{});const xi=(A,e,r,a="medium")=>{const n={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-9 h-5 after:h-4 after:w-4 after:top-0.5 after:left-0.5",large:"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5"},o={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return E("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400",n[a],o[a],{"peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500":A,"after:bg-white dark:after:bg-black-500":!A,"text-white dark:text-black-900":e,"cursor-not-allowed opacity-70":r})},Pi=({size:A=18,fill:e="#016DCF"})=>t.jsx("svg",{width:A,height:A,viewBox:"0 0 24 24",fill:"none",children:t.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),wi=({size:A=18,fill:e="#101828"})=>t.jsx("svg",{width:A,height:A,viewBox:"0 0 24 24",fill:"none",children:t.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:e})}),Ye=v.forwardRef(({isGTN:A=!1,isChecked:e,id:r,onChange:a,label:n,required:o,isRequiredConditional:l=!1,hideStatus:s=!1,labelDirection:i=He.TOP,statusText:c,withIcon:d=!1,tags:f,isAiExtracted:u=!1,tooltip:p="",className:g="",isDisabled:y=!1,icon:x,stopClickPropagation:h=!0,gtnName:b,variant:m="primary",labelClassName:P,isLiveField:H=!1,message:N,messageType:T="default",wrapperClassName:w,helpText:k,size:D="medium",renderGTNAddButton:C,onAddGTNToDocument:L},M)=>{const{t:U}=CA.useTranslation(),O=i===He.TOP,X=i===He.LEFT,q=i===He.RIGHT,[z,V]=v.useState(!1),F=()=>{L&&L({key:b,value:e?"Yes":"No"})},j=()=>T==="error"?"text-red-500 dark:text-red-400":T==="success"?"text-green-500 dark:text-green-400":T==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return t.jsxs("div",{className:E("flex gap-0.5",z&&A?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",w),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),onClick:Q=>{h&&Q.stopPropagation()},children:[A&&!z?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,t.jsxs("div",{className:"w-full flex flex-col",children:[O&&n&&t.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[t.jsxs("h1",{className:E("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",P),children:[t.jsx(kA,{label:String(n)||"",required:o||!1,isRequiredConditional:l||!1}),H&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),u&&t.jsx(GA,{}),t.jsx(EA,{labels:f||[]}),p&&t.jsx(fA,{placement:"top",title:p,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),A&&z?C?C(F):t.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:F,type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:U("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),k&&t.jsx(G,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:k}),t.jsxs("div",{className:"flex",children:[X&&t.jsx(G,{size:"small",variant:"medium",className:E("mr-2 text-neutral-700 dark:text-black-200",P),appearance:"custom",children:n}),t.jsxs("label",{className:E("relative inline-flex items-center",q||c?"":"w-min",y?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:Q=>Q.stopPropagation(),children:[t.jsx("input",{ref:M,type:"checkbox",id:r,onChange:Q=>!y&&a(Q.target.checked),value:"",disabled:y,checked:e,className:E("sr-only peer w-full",g),"aria-required":o,"aria-invalid":N&&T==="error"?"true":"false","aria-describedby":N||k?`${r}-description`:void 0}),t.jsx("div",{className:xi(e,d,y,D),children:d?t.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.jsx("div",{className:E("z-10 transition-all transform",D==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),D==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),D==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?x?.checkedIcon?x.checkedIcon:t.jsx(Pi,{size:18,fill:"#016DCF"}):x?.uncheckedIcon?x.uncheckedIcon:t.jsx(wi,{size:18,fill:"#101828"})})}):null}),q&&t.jsx(G,{size:"small",variant:"medium",className:E("ml-2 text-neutral-700 dark:text-black-300",P),appearance:"custom",children:n}),s?null:t.jsx(G,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:c||(e?"Yes":"No")})]})]}),t.jsx(uA.AnimatePresence,{children:N&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:T==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",j()),appearance:"custom",size:"extra-small",variant:"medium",children:N})})}),k&&!N&&t.jsx("div",{id:`${r}-description`,className:"sr-only",children:k})]})]})});Ye.displayName="Toggle";const Ci=A=>{try{return JSON.parse(A)}catch{return null}},ki=A=>{let e="";const r="0123456789abcdef";for(let a=0;a<A;a++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},Hi=A=>A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Di=A=>{const e=[...A].sort((a,n)=>a.length-n.length),r=[];for(const a of e)r.some(o=>a!==o&&a.startsWith(o+"."))||r.push(a);return r},De=A=>{let e="";if(A){let r=0;Object.keys(A).forEach(a=>{if(A[a]!==void 0&&A[a]!==null&&A[a]!==""){let n=A[a];typeof n=="object"?n=JSON.stringify(n):Array.isArray(n)&&(n=n.join(",")),n!=null&&n!==""&&(r===0?e+=`?${a}=${encodeURIComponent(n)}`:e+=`&${a}=${encodeURIComponent(n)}`,r+=1)}})}return e},Ga=({shortcuts:A,variant:e="dark",className:r})=>{const n=Ke()==="macos",o=v.useMemo(()=>A.map(l=>{const s=vr[l];return s?n?s.macos:s.other:l}),[A,n]);return t.jsx("div",{className:E("flex flex-1 gap-1",r),children:o.map((l,s)=>t.jsx("kbd",{className:E("flex items-center rounded-[3px] px-1.5 py-[2px] min-w-[26px] justify-center text-xs font-medium",{"bg-neutral-800 text-white":e==="dark","bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-white":e==="light"}),children:l},s))})},Si=({className:A="",fill:e="var(--color-primary-600)",size:r=24})=>t.jsx("svg",{className:A,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{mask:"url(#mask0_6752_28309)",children:t.jsx("path",{d:"M8.33317 11.3333L13.2498 6.41667C13.4026 6.26389 13.5971 6.1875 13.8332 6.1875C14.0693 6.1875 14.2637 6.26389 14.4165 6.41667C14.5693 6.56944 14.6457 6.76389 14.6457 7C14.6457 7.23611 14.5693 7.43056 14.4165 7.58333L8.9165 13.0833C8.74984 13.25 8.55539 13.3333 8.33317 13.3333C8.11095 13.3333 7.9165 13.25 7.74984 13.0833L5.58317 10.9167C5.43039 10.7639 5.354 10.5694 5.354 10.3333C5.354 10.0972 5.43039 9.90278 5.58317 9.75C5.73595 9.59722 5.93039 9.52083 6.1665 9.52083C6.40262 9.52083 6.59706 9.59722 6.74984 9.75L8.33317 11.3333Z",fill:e})})}),gr=({id:A,onClick:e,icon:r,text:a,className:n,isDisabled:o,onClose:l,notVisible:s,hideHoverEffect:i,leadingIcon:c,suffixRecord:d,stopPropagation:f,onToggle:u,isChecked:p=!1,highlight:g,truncateText:y=!1,showTick:x=!1,width:h="100%",tooltip:b,isFlowAvailable:m=!0,shortcuts:P})=>{const H=v.useCallback(D=>{l&&l(),D.preventDefault(),e?.(D),f&&D.stopPropagation()},[l,e,f]),N=(D,C)=>{if(!C||!D||typeof D!="string"&&typeof D!="number")return D;const L=Hi(C),M=new RegExp(`(${L?.trim()})`,"gi"),U=D?.toString()?.split(M);return t.jsxs("span",{className:"overflow-clip text-ellipsis",children:[U[0],t.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:U[1]}),U?.slice(2)?.join("")]})},T=v.useCallback(D=>{u?.(),D.stopPropagation()},[u]),w=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions"].some(C=>a?.toLowerCase().includes(C)),k=o||!m;return s?null:t.jsx("button",{id:A,className:E("w-full p-1 bg-white dark:bg-black-800 group",n,k&&"opacity-60"),onClick:u?()=>null:H,disabled:k,onMouseMove:D=>D.stopPropagation(),children:t.jsxs("div",{className:E("flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!i&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?t.jsx("div",{className:E("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:t.jsx(fA,{placement:"top",title:b,children:r})}):null,t.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[t.jsx("div",{className:E("flex-1 min-w-0",y&&"max-w-[150px]"),style:{width:h},children:t.jsx(G,{className:E("font-medium text-sm truncate transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400"),appearance:"custom",children:g?N(a,g):a})}),d?.[a]?t.jsx("span",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-200 bg-neutral-100 dark:bg-black-700 border-[#D0D5DD] dark:border-black-700 text-xs leading-[18px] font-normal border rounded-full px-2 py-0.5",children:d[a]||""}):null,x?t.jsx("div",{className:"flex-shrink-0",children:t.jsx(Si,{fill:"var(--color-primary-600)"})}):null]}),c?t.jsx(t.Fragment,{children:b?t.jsx(fA,{placement:"top",title:b,children:t.jsx("div",{className:E("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):t.jsx("div",{className:E("flex-shrink-0 transition-colors duration-300 ease-in-out",w?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):null,P?t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(Ga,{variant:"light",shortcuts:P})}):null,u?t.jsx("div",{className:"flex-shrink-0",children:t.jsx(Ye,{onChange:T,isChecked:p,isDisabled:o,hideStatus:!0})}):null]})})};gr.displayName="OptionButton";const yr=(A,e)=>{const r=A.slice(0,2),a=je[r];return a?t.jsx("div",{className:`
|
|
39
39
|
w-5 h-5 rounded-full overflow-hidden border-[0.9px] flex items-center justify-center relative
|
|
40
40
|
${e?"border-neutral-100 dark:border-neutral-100":"border-neutral-400 dark:border-neutral-500"}
|
|
41
41
|
`,children:t.jsx(a,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},Ni=A=>{const e=A.slice(0,2),r=je[e];return r?t.jsx("div",{className:"w-4 h-4 rounded-full overflow-hidden flex items-center justify-center relative",children:t.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},Li=A=>{const e=A.slice(0,2),r=je[e];return r?t.jsx("div",{className:"w-7 h-5 rounded-md overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:t.jsx(r,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},zi=A=>{const e=A.slice(0,2),r=je[e];return r?t.jsx("div",{className:"w-4 h-3 rounded-sm overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:t.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},Ja=A=>{const e=A.slice(0,2),r=je[e];return r?t.jsx("div",{className:"w-5 h-4 rounded-sm overflow-hidden border border-neutral-300 dark:border-neutral-300 flex items-center justify-center relative",children:t.jsx(r,{style:{width:"115%",height:"115%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},$a=v.forwardRef(({id:A,label:e,value:r,onChange:a,errorMessage:n,defaultValue:o,required:l=!1,isRequiredConditional:s=!1,tags:i,className:c,originalCase:d=!1,tooltip:f,simpleMode:u=!1,inputFieldClassName:p="",isAiExtracted:g=!1,isGTN:y=!1,gtnName:x=null,allowMultiCurrency:h=!1,placeholder:b,disabled:m=!1,currencyCode:P="USD",inputStyle:H,labelClassName:N,isLiveField:T=!1,onBlur:w,autoFocus:k=!1,isRecording:D=!1,isPlaying:C=!1,onAddGTNToDocument:L,riskDetails:M,isRiskAnalysisOpen:U=!1,RiskDetailsCard:O,...X},q)=>{const{t:z}=CA.useTranslation(),[V,F]=v.useState(!1),[j,Q]=v.useState([]),[K,W]=v.useState(""),[I,_]=v.useState(P||"USD"),[Y,eA]=v.useState(!1),B=J=>{L&&L({key:x,value:J})},Z=J=>{if(J==null)return"";const $=Number(J);return isNaN($)?J:$?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},AA=J=>{const $=J.target.value,iA=$===""||$===null||$===void 0?0:Number($);a(iA,I);const SA=document.getElementById(A);if(SA&&SA.setAttribute("data-selected-value",JSON.stringify({value:iA,currency_code:I})),SA&&(D||C)){const qA=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${A}`,value:{value:iA,currency_code:I},type:"change"}});SA.dispatchEvent(qA)}},sA=()=>{F(!0)},lA=()=>{F(!1),(r==null||r==="")&&AA({target:{value:"0.00"}}),w?.()},xA=()=>{const J="pl-11 border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400",$=n?"border-red-300":U&&M?.color?`border-${M.color}-300`:"border-gray-300 dark:border-black-600",iA=`${U&&M?.color?`bg-${M.color}-50`:"bg-white dark:bg-black-600"}`;return`${J} ${$} ${iA} ${p}`};return v.useEffect(()=>{P&&_(P)},[P]),v.useEffect(()=>{if(I){const J=r===""||r===null||r===void 0?0:Number(r);P!==I&&a(J,I);const $=document.getElementById(A);if($&&($.setAttribute("data-selected-value",JSON.stringify({value:J,currency_code:I})),D||C)){const iA=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${A}`,value:{value:J,currency_code:I},type:"change"}});$.dispatchEvent(iA)}}},[I]),v.useEffect(()=>{const J=Ya.filter($=>($.value+" - "+$.label).toLowerCase().includes(K.toLowerCase())).map($=>({label:t.jsx(gr,{text:`${$.value} - ${$.label}`,icon:yr($.value),showTick:I===$.value,onClick:()=>_($.value),className:"text-black-900 dark:text-white"}),key:$.value}));Q(J)},[K,I]),v.useEffect(()=>{W("")},[I]),u?t.jsxs("label",{id:A,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${d?"":"capitalize"} ${N||""}`,children:[t.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),t.jsx("input",{...X,ref:q,type:V?"number":"text",required:l,className:E(p,"pl-8 h-[32px]"),onChange:AA,min:0,onFocus:sA,onBlur:lA,value:V?r:Z(r),...o&&!r?{defaultValue:V?o:Z(o)}:{},id:A||e,autoFocus:k})]}):t.jsxs("div",{className:E("flex gap-0.5 relative",Y&&y?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>eA(!0),onMouseLeave:()=>eA(!1),children:[y&&!Y?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("w-full flex flex-col",c),children:[t.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${d?"":"uppercase"} ${N||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(e)||"",required:l||!1,isRequiredConditional:s||!1}),T&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),g&&t.jsx(GA,{}),t.jsx(EA,{labels:i}),f&&t.jsx(fA,{placement:"top",title:f,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),y&&Y&&L?t.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>B(Z(r)),type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:z("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),t.jsxs("label",{className:"relative block",children:[t.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:Za[I]}),t.jsx("input",{...X,ref:q,placeholder:b,type:V?"number":"text",required:l,disabled:m,className:xA(),onChange:AA,min:0,onFocus:sA,onBlur:lA,value:V?r:Z(r),defaultValue:V?o:Z(o),id:A||e,style:H,autoComplete:"off",autoFocus:k}),t.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${h?"cursor-pointer":""}`,children:h?t.jsx(dA.Dropdown,{menu:{items:[...j]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:J=>J.parentElement,popupRender:J=>t.jsxs("div",{style:{maxHeight:"200px",width:"330px",textOverflow:"ellipsis",overflowY:"auto",zIndex:"999px",borderRadius:"6px"},className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600",children:[t.jsx(Ia,{id:"search-bar-currency-input",value:K,onChange:$=>W($),className:"mb-2"}),J]}),children:t.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[yr(I)," ",I]})}):I})]}),n&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),Y&&M&&U&&O&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:J=>J.stopPropagation(),onMouseDown:J=>J.preventDefault(),onKeyDown:J=>{J.key==="Escape"&&eA(!1)},children:t.jsx(O,{riskDetails:M})})]})});$a.displayName="CurrencyInputField";const _a=v.forwardRef(({id:A,label:e,value:r,defaultValue:a,onChange:n,disabled:o=!1,required:l=!1,message:s,messageType:i="default",wrapperClassName:c,inputClassName:d,labelClassName:f,helpText:u,size:p="medium",minDate:g,maxDate:y,startPlaceholder:x="Start date",endPlaceholder:h="End date",allowClear:b=!0,inputProps:m},P)=>{const H=r!==void 0?r:a||{startDate:null,endDate:null},N=()=>{switch(p){case"small":return{height:"h-7",padding:"px-2 py-1",fontSize:"text-xs"};case"large":return{height:"h-10",padding:"px-4 py-2",fontSize:"text-base"};default:return{height:"h-8",padding:"px-3 py-1.5",fontSize:"text-sm"}}},T=()=>i==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":i==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":i==="info"?"border-blue-300 focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20":"border-neutral-300 dark:border-neutral-600 focus:border-primary-500 dark:focus:border-primary-400 focus:ring-primary-200 dark:focus:ring-primary-400/20",w=()=>i==="error"?"text-red-500 dark:text-red-400":i==="success"?"text-green-500 dark:text-green-400":i==="info"?"text-blue-500 dark:text-blue-400":"text-neutral-500 dark:text-neutral-400",k=()=>{switch(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},D=q=>{if(!q)return"";const z=q.getFullYear(),V=String(q.getMonth()+1).padStart(2,"0"),F=String(q.getDate()).padStart(2,"0");return`${z}-${V}-${F}`},C=q=>{if(!q)return null;const z=new Date(q);return isNaN(z.getTime())?null:z},L=q=>{const z=C(q.target.value);n({startDate:z,endDate:H.endDate})},M=q=>{const z=C(q.target.value);n({startDate:H.startDate,endDate:z})},U=()=>{n({startDate:null,endDate:null})},O=q=>q?D(q):void 0,X=N();return t.jsxs("div",{className:E("flex flex-col w-full",c),ref:P,children:[e&&t.jsx("label",{htmlFor:`${A}-start`,className:E("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:t.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:t.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:t.jsxs(G,{variant:"medium",size:k(),appearance:"subtitle",children:[e,l&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),u&&t.jsx(G,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:u}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"flex-1",children:t.jsx("input",{...m,id:`${A}-start`,type:"date",value:D(H.startDate),onChange:L,disabled:o,required:l,min:O(g),max:O(y),placeholder:x,className:E("border rounded-md bg-white dark:bg-neutral-800 block w-full font-medium text-neutral-900 dark:text-neutral-100","transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2",X.height,X.padding,X.fontSize,T(),o&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",d),"aria-required":l,"aria-invalid":s&&i==="error"?"true":"false","aria-describedby":s||u?`${A}-description`:void 0})}),t.jsx("div",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-400",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})}),t.jsx("div",{className:"flex-1",children:t.jsx("input",{...m,id:`${A}-end`,type:"date",value:D(H.endDate),onChange:M,disabled:o,required:l,min:O(H.startDate||g),max:O(y),placeholder:h,className:E("border rounded-md bg-white dark:bg-neutral-800 block w-full font-medium text-neutral-900 dark:text-neutral-100","transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2",X.height,X.padding,X.fontSize,T(),o&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",d),"aria-required":l,"aria-invalid":s&&i==="error"?"true":"false","aria-describedby":s||u?`${A}-description`:void 0})}),b&&(H.startDate||H.endDate)&&!o&&t.jsx("button",{type:"button",onClick:U,className:"flex-shrink-0 p-1 text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200 transition-colors","aria-label":"Clear date range",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 pointer-events-none text-neutral-400 dark:text-neutral-500",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),t.jsx(uA.AnimatePresence,{children:s&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${A}-description`,role:i==="error"?"alert":void 0,children:t.jsx(G,{className:E("mt-1",w()),appearance:"custom",size:"extra-small",variant:"medium",children:s})})}),u&&!s&&t.jsx("div",{id:`${A}-description`,className:"sr-only",children:u})]})});_a.displayName="DateRange2";var xr={exports:{}},Mi=xr.exports,Ra;function Ti(){return Ra||(Ra=1,function(A,e){(function(r,a){A.exports=a()})(Mi,function(){var r=1e3,a=6e4,n=36e5,o="millisecond",l="second",s="minute",i="hour",c="day",d="week",f="month",u="quarter",p="year",g="date",y="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(U){var O=["th","st","nd","rd"],X=U%100;return"["+U+(O[(X-20)%10]||O[X]||O[0])+"]"}},m=function(U,O,X){var q=String(U);return!q||q.length>=O?U:""+Array(O+1-q.length).join(X)+U},P={s:m,z:function(U){var O=-U.utcOffset(),X=Math.abs(O),q=Math.floor(X/60),z=X%60;return(O<=0?"+":"-")+m(q,2,"0")+":"+m(z,2,"0")},m:function U(O,X){if(O.date()<X.date())return-U(X,O);var q=12*(X.year()-O.year())+(X.month()-O.month()),z=O.clone().add(q,f),V=X-z<0,F=O.clone().add(q+(V?-1:1),f);return+(-(q+(X-z)/(V?z-F:F-z))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:f,y:p,w:d,d:c,D:g,h:i,m:s,s:l,ms:o,Q:u}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},H="en",N={};N[H]=b;var T="$isDayjsObject",w=function(U){return U instanceof L||!(!U||!U[T])},k=function U(O,X,q){var z;if(!O)return H;if(typeof O=="string"){var V=O.toLowerCase();N[V]&&(z=V),X&&(N[V]=X,z=V);var F=O.split("-");if(!z&&F.length>1)return U(F[0])}else{var j=O.name;N[j]=O,z=j}return!q&&z&&(H=z),z||!q&&H},D=function(U,O){if(w(U))return U.clone();var X=typeof O=="object"?O:{};return X.date=U,X.args=arguments,new L(X)},C=P;C.l=k,C.i=w,C.w=function(U,O){return D(U,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var L=function(){function U(X){this.$L=k(X.locale,null,!0),this.parse(X),this.$x=this.$x||X.x||{},this[T]=!0}var O=U.prototype;return O.parse=function(X){this.$d=function(q){var z=q.date,V=q.utc;if(z===null)return new Date(NaN);if(C.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var F=z.match(x);if(F){var j=F[2]-1||0,Q=(F[7]||"0").substring(0,3);return V?new Date(Date.UTC(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,Q)):new Date(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,Q)}}return new Date(z)}(X),this.init()},O.init=function(){var X=this.$d;this.$y=X.getFullYear(),this.$M=X.getMonth(),this.$D=X.getDate(),this.$W=X.getDay(),this.$H=X.getHours(),this.$m=X.getMinutes(),this.$s=X.getSeconds(),this.$ms=X.getMilliseconds()},O.$utils=function(){return C},O.isValid=function(){return this.$d.toString()!==y},O.isSame=function(X,q){var z=D(X);return this.startOf(q)<=z&&z<=this.endOf(q)},O.isAfter=function(X,q){return D(X)<this.startOf(q)},O.isBefore=function(X,q){return this.endOf(q)<D(X)},O.$g=function(X,q,z){return C.u(X)?this[q]:this.set(z,X)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(X,q){var z=this,V=!!C.u(q)||q,F=C.p(X),j=function(B,Z){var AA=C.w(z.$u?Date.UTC(z.$y,Z,B):new Date(z.$y,Z,B),z);return V?AA:AA.endOf(c)},Q=function(B,Z){return C.w(z.toDate()[B].apply(z.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Z)),z)},K=this.$W,W=this.$M,I=this.$D,_="set"+(this.$u?"UTC":"");switch(F){case p:return V?j(1,0):j(31,11);case f:return V?j(1,W):j(0,W+1);case d:var Y=this.$locale().weekStart||0,eA=(K<Y?K+7:K)-Y;return j(V?I-eA:I+(6-eA),W);case c:case g:return Q(_+"Hours",0);case i:return Q(_+"Minutes",1);case s:return Q(_+"Seconds",2);case l:return Q(_+"Milliseconds",3);default:return this.clone()}},O.endOf=function(X){return this.startOf(X,!1)},O.$set=function(X,q){var z,V=C.p(X),F="set"+(this.$u?"UTC":""),j=(z={},z[c]=F+"Date",z[g]=F+"Date",z[f]=F+"Month",z[p]=F+"FullYear",z[i]=F+"Hours",z[s]=F+"Minutes",z[l]=F+"Seconds",z[o]=F+"Milliseconds",z)[V],Q=V===c?this.$D+(q-this.$W):q;if(V===f||V===p){var K=this.clone().set(g,1);K.$d[j](Q),K.init(),this.$d=K.set(g,Math.min(this.$D,K.daysInMonth())).$d}else j&&this.$d[j](Q);return this.init(),this},O.set=function(X,q){return this.clone().$set(X,q)},O.get=function(X){return this[C.p(X)]()},O.add=function(X,q){var z,V=this;X=Number(X);var F=C.p(q),j=function(W){var I=D(V);return C.w(I.date(I.date()+Math.round(W*X)),V)};if(F===f)return this.set(f,this.$M+X);if(F===p)return this.set(p,this.$y+X);if(F===c)return j(1);if(F===d)return j(7);var Q=(z={},z[s]=a,z[i]=n,z[l]=r,z)[F]||1,K=this.$d.getTime()+X*Q;return C.w(K,this)},O.subtract=function(X,q){return this.add(-1*X,q)},O.format=function(X){var q=this,z=this.$locale();if(!this.isValid())return z.invalidDate||y;var V=X||"YYYY-MM-DDTHH:mm:ssZ",F=C.z(this),j=this.$H,Q=this.$m,K=this.$M,W=z.weekdays,I=z.months,_=z.meridiem,Y=function(Z,AA,sA,lA){return Z&&(Z[AA]||Z(q,V))||sA[AA].slice(0,lA)},eA=function(Z){return C.s(j%12||12,Z,"0")},B=_||function(Z,AA,sA){var lA=Z<12?"AM":"PM";return sA?lA.toLowerCase():lA};return V.replace(h,function(Z,AA){return AA||function(sA){switch(sA){case"YY":return String(q.$y).slice(-2);case"YYYY":return C.s(q.$y,4,"0");case"M":return K+1;case"MM":return C.s(K+1,2,"0");case"MMM":return Y(z.monthsShort,K,I,3);case"MMMM":return Y(I,K);case"D":return q.$D;case"DD":return C.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return Y(z.weekdaysMin,q.$W,W,2);case"ddd":return Y(z.weekdaysShort,q.$W,W,3);case"dddd":return W[q.$W];case"H":return String(j);case"HH":return C.s(j,2,"0");case"h":return eA(1);case"hh":return eA(2);case"a":return B(j,Q,!0);case"A":return B(j,Q,!1);case"m":return String(Q);case"mm":return C.s(Q,2,"0");case"s":return String(q.$s);case"ss":return C.s(q.$s,2,"0");case"SSS":return C.s(q.$ms,3,"0");case"Z":return F}return null}(Z)||F.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(X,q,z){var V,F=this,j=C.p(q),Q=D(X),K=(Q.utcOffset()-this.utcOffset())*a,W=this-Q,I=function(){return C.m(F,Q)};switch(j){case p:V=I()/12;break;case f:V=I();break;case u:V=I()/3;break;case d:V=(W-K)/6048e5;break;case c:V=(W-K)/864e5;break;case i:V=W/n;break;case s:V=W/a;break;case l:V=W/r;break;default:V=W}return z?V:C.a(V)},O.daysInMonth=function(){return this.endOf(f).$D},O.$locale=function(){return N[this.$L]},O.locale=function(X,q){if(!X)return this.$L;var z=this.clone(),V=k(X,q,!0);return V&&(z.$L=V),z},O.clone=function(){return C.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},U}(),M=L.prototype;return D.prototype=M,[["$ms",o],["$s",l],["$m",s],["$H",i],["$W",c],["$M",f],["$y",p],["$D",g]].forEach(function(U){M[U[1]]=function(O){return this.$g(O,U[0],U[1])}}),D.extend=function(U,O){return U.$i||(U(O,L,D),U.$i=!0),D},D.locale=k,D.isDayjs=w,D.unix=function(U){return D(1e3*U)},D.en=N[H],D.Ls=N,D.p={},D})}(xr)),xr.exports}var Xi=Ti();const gA=me(Xi),{RangePicker:An}=dA.DatePicker,Oi={ENTER:"Enter"},en=()=>Math.random().toString(36).substring(2,9),Ui=(A,e)=>{const r=v.useRef(e);v.useEffect(()=>{r.current=e},[e]),v.useEffect(()=>{const a=n=>r.current(n);return document.addEventListener(A,a),()=>{document.removeEventListener(A,a)}},[A])},rn=({onCalendarChange:A=void 0,onChange:e,required:r,label:a,startDate:n,endDate:o,errorMessage:l,className:s,id:i,disabled:c=!1,dateFormat:d,shouldPopOnParent:f=!0,getPopupContainer:u,maxDateRange:p,open:g,onOpenChange:y,placement:x="bottomLeft",renderAsIconButton:h=!1,iconButtonClassName:b,iconClassName:m})=>{const[P,H]=v.useState(!1),N=v.useRef(null),T=L=>L?gA(L):null,w=`date-range-start-${en()}`,k=`date-range-end-${en()}`,D=()=>{H(!0),setTimeout(()=>{N.current&&N.current.focus()},0)};Ui("keydown",L=>{if(L.key===Oi.ENTER&&document.activeElement instanceof HTMLInputElement){if(document?.activeElement?.id===w){const M=gA(document?.activeElement?.value);M.isValid()&&e([M,T(o)])}if(document?.activeElement?.id===k){const M=gA(document?.activeElement?.value);M.isValid()&&e([T(n),M])}}});const C=v.useCallback(L=>{const[M,U]=[T(n),T(o)];return p?M?L.isBefore(M.startOf("day"))||L.isAfter(M.add(p,"day").endOf("day")):U?L.isBefore(U.subtract(p,"day").startOf("day"))||L.isAfter(U.endOf("day")):!1:!1},[n,o,p]);return h?t.jsxs("div",{id:i,className:s,children:[t.jsx(XA,{onClick:D,disabled:c,variant:"default",className:b,children:t.jsx(ot.BiCalendar,{className:E("w-5 h-5",m)})}),t.jsx(An,{ref:N,onChange:L=>{e(L),H(!1)},onCalendarChange:A,value:[T(n),T(o)],id:{start:w,end:k},allowClear:!0,format:d||"DD MMM, YYYY",separator:t.jsx(ur.BsDash,{className:"dark:text-gray-100"}),suffixIcon:t.jsx(ot.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:u||(f?L=>L.parentElement:()=>document.body),disabled:c,disabledDate:p?C:void 0,autoComplete:"off",open:P,onOpenChange:H,placement:x,style:{position:"absolute",opacity:0,pointerEvents:"none",width:0,height:0}})]}):t.jsxs("div",{id:i,className:E("flex flex-col",s),children:[t.jsx(kA,{label:String(a)||"",required:r||!1}),t.jsx(An,{onChange:e,onCalendarChange:A,value:[T(n),T(o)],id:{start:w,end:k},allowClear:!0,format:d||"DD MMM, YYYY",separator:t.jsx(ur.BsDash,{className:"dark:text-gray-100"}),suffixIcon:t.jsx(ot.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:u||(f?L=>L.parentElement:()=>document.body),disabled:c,disabledDate:p?C:void 0,open:g,onOpenChange:y,autoComplete:"off",placement:x}),l&&t.jsx("p",{className:E("text-sm font-inter font-normal text-left pt-[6px]","text-red-500"),children:l})]})};rn.displayName="DateRange";var Pr={exports:{}},qi=Pr.exports,tn;function Vi(){return tn||(tn=1,function(A,e){(function(r,a){A.exports=a()})(qi,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},a=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,o=/\d\d/,l=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,i={},c=function(x){return(x=+x)+(x>68?1900:2e3)},d=function(x){return function(h){this[x]=+h}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(x){(this.zone||(this.zone={})).offset=function(h){if(!h||h==="Z")return 0;var b=h.match(/([+-]|\d\d)/g),m=60*b[1]+(+b[2]||0);return m===0?0:b[0]==="+"?-m:m}(x)}],u=function(x){var h=i[x];return h&&(h.indexOf?h:h.s.concat(h.f))},p=function(x,h){var b,m=i.meridiem;if(m){for(var P=1;P<=24;P+=1)if(x.indexOf(m(P,0,h))>-1){b=P>12;break}}else b=x===(h?"pm":"PM");return b},g={A:[s,function(x){this.afternoon=p(x,!1)}],a:[s,function(x){this.afternoon=p(x,!0)}],Q:[n,function(x){this.month=3*(x-1)+1}],S:[n,function(x){this.milliseconds=100*+x}],SS:[o,function(x){this.milliseconds=10*+x}],SSS:[/\d{3}/,function(x){this.milliseconds=+x}],s:[l,d("seconds")],ss:[l,d("seconds")],m:[l,d("minutes")],mm:[l,d("minutes")],H:[l,d("hours")],h:[l,d("hours")],HH:[l,d("hours")],hh:[l,d("hours")],D:[l,d("day")],DD:[o,d("day")],Do:[s,function(x){var h=i.ordinal,b=x.match(/\d+/);if(this.day=b[0],h)for(var m=1;m<=31;m+=1)h(m).replace(/\[|\]/g,"")===x&&(this.day=m)}],w:[l,d("week")],ww:[o,d("week")],M:[l,d("month")],MM:[o,d("month")],MMM:[s,function(x){var h=u("months"),b=(u("monthsShort")||h.map(function(m){return m.slice(0,3)})).indexOf(x)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[s,function(x){var h=u("months").indexOf(x)+1;if(h<1)throw new Error;this.month=h%12||h}],Y:[/[+-]?\d+/,d("year")],YY:[o,function(x){this.year=c(x)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function y(x){var h,b;h=x,b=i&&i.formats;for(var m=(x=h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,C,L){var M=L&&L.toUpperCase();return C||b[L]||r[L]||b[M].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,O,X){return O||X.slice(1)})})).match(a),P=m.length,H=0;H<P;H+=1){var N=m[H],T=g[N],w=T&&T[0],k=T&&T[1];m[H]=k?{regex:w,parser:k}:N.replace(/^\[|\]$/g,"")}return function(D){for(var C={},L=0,M=0;L<P;L+=1){var U=m[L];if(typeof U=="string")M+=U.length;else{var O=U.regex,X=U.parser,q=D.slice(M),z=O.exec(q)[0];X.call(C,z),D=D.replace(z,"")}}return function(V){var F=V.afternoon;if(F!==void 0){var j=V.hours;F?j<12&&(V.hours+=12):j===12&&(V.hours=0),delete V.afternoon}}(C),C}}return function(x,h,b){b.p.customParseFormat=!0,x&&x.parseTwoDigitYear&&(c=x.parseTwoDigitYear);var m=h.prototype,P=m.parse;m.parse=function(H){var N=H.date,T=H.utc,w=H.args;this.$u=T;var k=w[1];if(typeof k=="string"){var D=w[2]===!0,C=w[3]===!0,L=D||C,M=w[2];C&&(M=w[2]),i=this.$locale(),!D&&M&&(i=b.Ls[M]),this.$d=function(q,z,V,F){try{if(["x","X"].indexOf(z)>-1)return new Date((z==="X"?1e3:1)*q);var j=y(z)(q),Q=j.year,K=j.month,W=j.day,I=j.hours,_=j.minutes,Y=j.seconds,eA=j.milliseconds,B=j.zone,Z=j.week,AA=new Date,sA=W||(Q||K?1:AA.getDate()),lA=Q||AA.getFullYear(),xA=0;Q&&!K||(xA=K>0?K-1:AA.getMonth());var J,$=I||0,iA=_||0,SA=Y||0,qA=eA||0;return B?new Date(Date.UTC(lA,xA,sA,$,iA,SA,qA+60*B.offset*1e3)):V?new Date(Date.UTC(lA,xA,sA,$,iA,SA,qA)):(J=new Date(lA,xA,sA,$,iA,SA,qA),Z&&(J=F(J).week(Z).toDate()),J)}catch{return new Date("")}}(N,k,T,b),this.init(),M&&M!==!0&&(this.$L=this.locale(M).$L),L&&N!=this.format(k)&&(this.$d=new Date("")),i={}}else if(k instanceof Array)for(var U=k.length,O=1;O<=U;O+=1){w[1]=k[O-1];var X=b.apply(this,w);if(X.isValid()){this.$d=X.$d,this.$L=X.$L,this.init();break}O===U&&(this.$d=new Date(""))}else P.call(this,H)}}})}(Pr)),Pr.exports}var Ei=Vi();const Fi=me(Ei);var wr={exports:{}},Wi=wr.exports,an;function ji(){return an||(an=1,function(A,e){(function(r,a){A.exports=a()})(Wi,function(){return function(r,a,n){var o=a.prototype,l=function(f){return f&&(f.indexOf?f:f.s)},s=function(f,u,p,g,y){var x=f.name?f:f.$locale(),h=l(x[u]),b=l(x[p]),m=h||b.map(function(H){return H.slice(0,g)});if(!y)return m;var P=x.weekStart;return m.map(function(H,N){return m[(N+(P||0))%7]})},i=function(){return n.Ls[n.locale()]},c=function(f,u){return f.formats[u]||function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,y,x){return y||x.slice(1)})}(f.formats[u.toUpperCase()])},d=function(){var f=this;return{months:function(u){return u?u.format("MMMM"):s(f,"months")},monthsShort:function(u){return u?u.format("MMM"):s(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(u){return u?u.format("dddd"):s(f,"weekdays")},weekdaysMin:function(u){return u?u.format("dd"):s(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(u){return u?u.format("ddd"):s(f,"weekdaysShort","weekdays",3)},longDateFormat:function(u){return c(f.$locale(),u)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return d.bind(this)()},n.localeData=function(){var f=i();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(u){return c(f,u)},meridiem:f.meridiem,ordinal:f.ordinal}},n.months=function(){return s(i(),"months")},n.monthsShort=function(){return s(i(),"monthsShort","months",3)},n.weekdays=function(f){return s(i(),"weekdays",null,null,f)},n.weekdaysShort=function(f){return s(i(),"weekdaysShort","weekdays",3,f)},n.weekdaysMin=function(f){return s(i(),"weekdaysMin","weekdays",2,f)}}})}(wr)),wr.exports}var Qi=ji();const Ki=me(Qi);var Cr={exports:{}},Yi=Cr.exports,nn;function Zi(){return nn||(nn=1,function(A,e){(function(r,a){A.exports=a()})(Yi,function(){var r="minute",a=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(o,l,s){var i=l.prototype;s.utc=function(y){var x={date:y,utc:!0,args:arguments};return new l(x)},i.utc=function(y){var x=s(this.toDate(),{locale:this.$L,utc:!0});return y?x.add(this.utcOffset(),r):x},i.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var c=i.parse;i.parse=function(y){y.utc&&(this.$u=!0),this.$utils().u(y.$offset)||(this.$offset=y.$offset),c.call(this,y)};var d=i.init;i.init=function(){if(this.$u){var y=this.$d;this.$y=y.getUTCFullYear(),this.$M=y.getUTCMonth(),this.$D=y.getUTCDate(),this.$W=y.getUTCDay(),this.$H=y.getUTCHours(),this.$m=y.getUTCMinutes(),this.$s=y.getUTCSeconds(),this.$ms=y.getUTCMilliseconds()}else d.call(this)};var f=i.utcOffset;i.utcOffset=function(y,x){var h=this.$utils().u;if(h(y))return this.$u?0:h(this.$offset)?f.call(this):this.$offset;if(typeof y=="string"&&(y=function(H){H===void 0&&(H="");var N=H.match(a);if(!N)return null;var T=(""+N[0]).match(n)||["-",0,0],w=T[0],k=60*+T[1]+ +T[2];return k===0?0:w==="+"?k:-k}(y),y===null))return this;var b=Math.abs(y)<=16?60*y:y,m=this;if(x)return m.$offset=b,m.$u=y===0,m;if(y!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(m=this.local().add(b+P,r)).$offset=b,m.$x.$localOffset=P}else m=this.utc();return m};var u=i.format;i.format=function(y){var x=y||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,x)},i.valueOf=function(){var y=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*y},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var p=i.toDate;i.toDate=function(y){return y==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var g=i.diff;i.diff=function(y,x,h){if(y&&this.$u===y.$u)return g.call(this,y,x,h);var b=this.local(),m=s(y).local();return g.call(b,m,x,h)}}})}(Cr)),Cr.exports}var Bi=Zi();const Ii=me(Bi);var kr={exports:{}},Gi=kr.exports,on;function Ji(){return on||(on=1,function(A,e){(function(r,a){A.exports=a()})(Gi,function(){return function(r,a){a.prototype.weekday=function(n){var o=this.$locale().weekStart||0,l=this.$W,s=(l<o?l+7:l)-o;return this.$utils().u(n)?s:this.subtract(s,"day").add(n,"day")}}})}(kr)),kr.exports}var $i=Ji();const _i=me($i);gA.extend(Ii),gA.extend(Fi),gA.extend(_i),gA.extend(Ki);const ln="MM/DD/YYYY",Hr="MM/DD/YYYY - hh:mm A",sn="YYYY-MM-DD",dn="YYYY-MM-DDTHH:mm:ss",Ri={ENTER:"Enter"},cn=["MM/DD/YYYY","M/DD/YYYY","MM/D/YYYY","M/D/YYYY","MM/DD/YY","M/DD/YY","MM/D/YY","M/D/YY","YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],A1=["MM/DD/YYYY - hh:mm A","M/DD/YYYY - hh:mm A","MM/D/YYYY - hh:mm A","M/D/YYYY - hh:mm A","MM/DD/YYYY hh:mm A","M/DD/YYYY hh:mm A","MM/D/YYYY hh:mm A","M/D/YYYY hh:mm A","MM/DD/YYYY HH:mm","M/DD/YYYY HH:mm","MM/D/YYYY HH:mm","M/D/YYYY HH:mm","MM/DD/YY - hh:mm A","M/DD/YY - hh:mm A","MM/D/YY - hh:mm A","M/D/YY - hh:mm A","MM/DD/YY hh:mm A","M/DD/YY hh:mm A","MM/D/YY hh:mm A","M/D/YY hh:mm A","MM/DD/YY HH:mm","M/DD/YY HH:mm","MM/D/YY HH:mm","M/D/YY HH:mm",...cn,"YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],e1=()=>Math.random().toString(36).substring(2,9),Ze=(A,e=!1)=>{if(!A)return null;const r=e?A1:cn;for(const n of r){const o=gA(A,n,!0);if(o.isValid())return o}const a=gA(A);return a.isValid()?a:null},fn=(A,e)=>{const r=v.useRef(e);v.useEffect(()=>{r.current=e},[e]),v.useEffect(()=>{const a=n=>r.current(n);return document.addEventListener(A,a),()=>{document.removeEventListener(A,a)}},[A])},un=v.forwardRef(({label:A,value:e,required:r,isRequiredConditional:a=!1,disabled:n,className:o=void 0,errorMessage:l,handleOnChange:s,showTime:i=!0,tags:c,needConfirm:d=!1,simpleMode:f,originalCase:u=!1,dateFormat:p=void 0,tooltip:g,isAiExtracted:y=!1,isGTN:x=!1,gtnName:h=null,shouldPopOnParent:b=!1,allowTimezoneConversion:m=!0,inputStyle:P,labelClassName:H,isLiveField:N=!1,riskDetails:T,isRiskAnalysisOpen:w=!1,RiskDetailsCard:k,onAddGTNToDocument:D,formatDateForGTN:C,...L},M)=>{const{t:U}=CA.useTranslation(),[O,X]=v.useState(!1),[q,z]=v.useState(null),[V,F]=v.useState(null),j=p||(i?Hr:ln),Q=L?.id||`date-picker-${e1()}`,K=v.useRef(null);fn("paste",B=>{document.activeElement?.id===Q&&(B.preventDefault(),navigator.clipboard.readText().then(Z=>{const AA=Ze(Z,i);AA&&eA(AA)}))}),fn("keydown",B=>{if(B.key===Ri.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===Q){const Z=Ze(document?.activeElement?.value,i);Z&&eA(Z)}});const W=v.useCallback(B=>{if(!D)return;let Z=B||"";if(C&&B)Z=C(B,{skipTimezone:!0,withTime:i});else if(B){const sA=gA(B);sA.isValid()&&(Z=sA.format(j))}D({key:h,value:Z})},[D,h,C,i,j]),I=v.useCallback(()=>{const B=document.getElementsByClassName("ant-picker-footer")[0];B&&(B.style.display="none")},[]),_=v.useCallback(B=>{if(!m){const Z=i?dn:sn;if(s(B?B.format(Z):null),B){const AA=document.getElementById(Q);if(AA){const sA=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Q}`,value:B.format?B.format(j):B,type:"date-change",elementId:Q}});AA.dispatchEvent(sA)}}return}if(B){let Z;if(i?Z=gA(B).utc().toISOString():Z=gA(B).utc().add(gA(B).utcOffset(),"minute").startOf("day").toISOString(),Z){s(Z);const AA=document.getElementById(Q);if(AA){const sA=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Q}`,value:B.format(j),type:"date-change",elementId:Q}});AA.dispatchEvent(sA)}}}else s(null)},[m,s,i,Q,j]),Y=v.useCallback(B=>{if(!B)return null;if(!m)try{const Z=gA(B);if(Z.isValid())return Z;const AA=gA(B,j);return AA.isValid()?AA:null}catch{return null}if(i){const Z=gA(B);return gA(Z).isValid()?Z:null}else if(B?.toString()?.includes("Z")){const Z=gA.utc(B);return gA(Z).isValid()?Z:null}else{const Z=gA(B);return gA(Z).isValid()?Z:null}},[m,j,i]),eA=v.useCallback(B=>{if(B?.isValid()||B===null){z(B);const Z=i?dn:sn,AA=m?B?.toISOString():B?B.format(Z):"";if(s(AA||null),B?.isValid()){const sA=document.getElementById(Q);if(sA){const lA=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${Q}`,value:B.format(j),type:"date-change",elementId:Q}});sA.dispatchEvent(lA)}}}},[m,j,s,Q,i]);return v.useEffect(()=>{z(Y(e))},[e,Y]),v.useEffect(()=>{V&&F(null)},[V]),v.useEffect(()=>{const B=document.getElementById(Q);if(!B)return;const Z=AA=>{const{value:sA,type:lA}=AA.detail;if(lA==="date-playback"&&sA){const xA=Ze(sA,i);xA&&xA.isValid()&&(z(xA),_(xA),setTimeout(()=>{const J=B.querySelector("input");if(J&&(J.focus(),setTimeout(()=>{J.blur()},10)),K.current)try{const $=K.current;typeof $.blur=="function"&&$.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(iA=>{iA instanceof HTMLElement&&(iA.style.display="none",iA.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return B.addEventListener("pilot-date-playback",Z),()=>{B.removeEventListener("pilot-date-playback",Z)}},[Q,j,_,i]),f?t.jsx(dA.DatePicker,{...L,showTime:i,format:j,placeholder:j===Hr?"MM/DD/YYYY hh:mm":j,value:q,needConfirm:!1,onChange:B=>{z(B),_(B),F(B?.toISOString()||null)},className:o,showNow:!1,onFocus:I,onBlur:B=>{const Z=B.target.value;if(Z){const AA=Ze(Z,i);AA&&eA(AA)}},ref:K,disabled:n,id:Q}):t.jsxs("div",{ref:M,className:E("flex gap-0.5 relative",O&&x?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),children:[x&&!O?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:`w-full flex flex-col font-inter ${o||""}`,children:[A?t.jsx("label",{className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${u?"":"capitalize"} ${H||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(A)||"",required:r||!1,isRequiredConditional:a||!1}),N&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),y&&t.jsx(GA,{}),t.jsx(EA,{labels:c}),g&&t.jsx(fA,{placement:"top",title:g,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),x&&O&&D?t.jsx("button",{id:"btn-date-field-add-to-document",className:"cursor-pointer",onClick:()=>W(e),type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:U("Add to document"),children:t.jsx(nA.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,t.jsx(dA.DatePicker,{...L,showTime:i?{use12Hours:!0}:!1,format:j,placeholder:j===Hr?"MM/DD/YYYY - HH:MM":j,className:`w-full h-8 text-inter font-medium ${l?"border-red-400":""} dark:text-black-300 ${w&&T?.color&&`bg-${T.color}-50 border-${T.color}-300`}`,styles:{root:{...P,borderRadius:"7px"}},showNow:!1,value:q,onChange:B=>{z(B),_(B),F(B?.toISOString()||null)},onBlur:B=>{const Z=B.target.value;if(Z){const AA=Ze(Z,i);AA&&(z(AA),_(AA))}},needConfirm:d,ref:K,disabled:n,inputReadOnly:!1,getPopupContainer:b?B=>B.parentElement:()=>document.body,id:Q,autoComplete:"off"}),l&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:l})]}),O&&T&&w&&k&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:B=>B.stopPropagation(),onMouseDown:B=>B.preventDefault(),onKeyDown:B=>{B.key==="Escape"&&X(!1)},children:t.jsx(k,{riskDetails:T})})]})});un.displayName="DateTimeField";const pn=({id:A,label:e,onChange:r,errorMessage:a,required:n,bg:o,tags:l,color:s,debounceTimeout:i=0,className:c,isDarkMode:d,...f})=>{const{inputRef:u,...p}=f;return t.jsxs("div",{className:E("flex flex-col",c),children:[e&&t.jsxs("label",{htmlFor:A,className:"block mb-1 text-xs font-medium leading-[18px] text-neutral-600 dark:text-black-300 font-inter capitalize",children:[t.jsx(kA,{label:String(e)||"",required:n||!1}),t.jsx(EA,{labels:l})]}),t.jsx("label",{className:"relative block h-8",children:v.createElement(nt.DebounceInput,{...p,debounceTimeout:i,id:A,key:A,required:n,className:E("border",a?"!border-error-300":"border-neutral-200 dark:border-black-600",o,s,"dark:bg-black-700 text-neutral-900 dark:text-neutral-100 text-[14px] rounded-md","focus:outline-none focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400","focus:border-primary-500 dark:focus:border-primary-400","block w-full h-8 px-3 py-1.5 font-inter font-medium","disabled:opacity-70 disabled:!bg-neutral-50 dark:disabled:!bg-black-800"),onChange:g=>{r(g.target.value)},autoComplete:"off"})}),t.jsx(uA.AnimatePresence,{children:a&&t.jsx(uA.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15},children:t.jsx(G,{className:"pt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:a})})})]})};pn.displayName="DebounceInputField";const hn=v.forwardRef(({id:A,label:e,placeholder:r,value:a,onChange:n,errorMessage:o,defaultValue:l,required:s=!1,isRequiredConditional:i=!1,dataSource:c,dataKey:d,tags:f,tooltip:u="",originalCase:p=!1,color:g="",isGTN:y=!1,gtnName:x,isAiExtracted:h=!1,labelClassName:b,disabled:m=!1,isLiveField:P=!1,onAddGTNToDocument:H,riskDetails:N,isRiskAnalysisOpen:T=!1,RiskDetailsCard:w,primaryColorShades:k,isRecording:D=!1,isPlaying:C=!1,setDisableActions:L,showDeprecatedFieldWarning:M,DynamicDataModal:U},O)=>{const{t:X}=CA.useTranslation(),[q,z]=v.useState(!1),[V,F]=v.useState(a),[j,Q]=v.useState(!1),K=v.useRef(null),W=O||K,I=()=>{L?.(!j),Q(!j)},_=Z=>{if(Z.keyCode===9||Z.key==="Enter"){const AA=W.current||K.current;AA&&(V!==null&&n(V),F(V),AA.blur())}},Y=()=>{F(""),n("")},eA=Z=>{H&&x&&H({key:x,value:Z})},B=()=>{const Z="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",AA=o?"border-red-300":T&&N?.color?`border-${N?.color}-300`:"border-gray-300 dark:border-black-600",sA="placeholder:text-neutral-900 dark:placeholder:text-black-400",lA=`${T&&N?.color?`bg-${N?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${g||"text-neutral-900 dark:text-black-200"}`;return`${Z} ${AA} ${lA} ${sA}`};return v.useEffect(()=>{j&&!c&&(M?.(),Q(!1))},[j,c,M]),v.useEffect(()=>{F(a)},[a]),t.jsxs("div",{className:E("flex gap-0.5 w-full relative",q&&y?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!o}),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[y&&!q?t.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,t.jsxs("div",{className:E("flex flex-col w-full"),children:[t.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${p?"":"capitalize"} ${b||""}`,children:t.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[t.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[t.jsx(kA,{label:String(e)||"",required:s||!1,isRequiredConditional:i||!1}),P&&t.jsx(nA.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),h&&t.jsx(GA,{}),t.jsx(EA,{labels:f}),u&&t.jsx(fA,{placement:"top",title:u,children:t.jsx("div",{className:"cursor-pointer",children:t.jsx(VA,{})})})]}),y&&q&&H?t.jsx("button",{id:"btn-dynamic-data-input-add-to-document",className:"cursor-pointer",onClick:()=>eA(a?.toString()||""),type:"button",children:t.jsx(dA.Tooltip,{placement:"top",title:X("Add to document"),children:t.jsx(nA.NoteAddOutlined,{sx:{fontSize:16,color:k?.[600]||"var(--color-primary-600)"}})})}):null]})}),t.jsxs("label",{className:"relative block mt-1",children:[t.jsx("input",{id:A,ref:W,required:s,placeholder:r,className:B(),onChange:Z=>{n(Z.target.value),F(Z.target?.value)},onKeyDown:_,value:V!==null?V:a,defaultValue:l,disabled:!0}),t.jsx(XA,{id:"btn-dynamic-data-input-rx-cross",onClick:Y,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:m,children:t.jsx(nA.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),t.jsx(XA,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:I,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:m,children:t.jsx(nA.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),o&&t.jsx(G,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:o}),j&&U&&t.jsx(U,{isVisible:j,onSelect:Z=>{n(Z),F(Z)},onClose:I,dataKey:d,dataSource:c})]}),q&&N&&T&&w&&t.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:Z=>Z.stopPropagation(),onMouseDown:Z=>Z.preventDefault(),onKeyDown:Z=>{Z.key==="Escape"&&z(!1)},children:t.jsx(w,{riskDetails:N})})]})});hn.displayName="DynamicDataInputField";const LA=({status:A="primary",appearance:e,className:r,disabled:a,children:n,isLoading:o,title:l,id:s,onClick:i,onKeyDown:c,badge:d,type:f="button",options:u,tooltip:p,tooltipPlacement:g="top",shortcuts:y,tooltipShortcuts:x,theme:h="light"})=>{const b=v.useCallback(()=>{switch(e){case"outline":return H();case"ghost":return N();case"dashed":return T();default:return P()}},[e,A,a,h]),m=v.useCallback(()=>{switch(e){case"dashed":return w();default:return{}}},[e,A,a,h]),P=v.useCallback(()=>{switch(A){case"primary":return"bg-primary-600 text-white focus:border-primary-200 hover:bg-primary-700 disabled:opacity-60";case"secondary":return"bg-primary-50 dark:bg-black-800 text-primary-600 dark:hover:text-primary-400 border border-primary-200 dark:border-primary-600 hover:bg-primary-100 dark:hover:bg-black-800 focus:border-primary-200 hover:border-primary-200 dark:hover:border-primary-400 disabled:opacity-60";case"error":return"bg-error-600 dark:bg-error-500 text-white hover:bg-error-700 dark:hover:bg-error-600 focus:!border-error-300 dark:focus:!border-error-600 dark:focus:bg-error-800 disabled:opacity-60";case"error-secondary":return"bg-error-100 dark:bg-black-800 text-error-600 border !border-error-300 dark:!border-error-900 hover:bg-error-200 focus:!border-error-300 dark:focus:!border-error-400 disabled:opacity-60";case"secondary-neutral":return"bg-white dark:bg-black-800 text-neutral-900 border border-neutral-300 dark:border-black-600 dark:hover:bg-black-600 dark:text-black-200 hover:bg-neutral-100 focus:border-primary-200 disabled:opacity-60";case"warning":return"bg-warning-300 dark:bg-warning-600 text-white border-warning-300 border hover:bg-warning-400 disabled:opacity-60";case"success":return"bg-success-600 text-white border-success-600 border hover:bg-success-700 disabled:opacity-60";case"publish":return"bg-teal-800 text-white border-teal-800 border hover:bg-teal-900 disabled:opacity-60";case"no-background":return"bg-transparent text-neutral-900 dark:text-black-100 border-transparent border";default:return"bg-white dark:bg-black-800 text-neutral-900 dark:text-white border-white border hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60"}},[A,a,h]),H=v.useCallback(()=>{switch(A){case"primary":return"text-primary-700 dark:text-primary-600 border-primary-700 border dark:border-primary-600 hover:bg-primary-100 disabled:opacity-60";case"secondary":return"text-primary-700 dark:text-primary-600 border-primary-100 dark:border-primary-600 border bg-primary-50 dark:bg-black-800 hover:bg-primary-100 disabled:opacity-60";case"secondary-neutral":return"text-neutral-900 dark:text-white border-neutral-300 dark:border-neutral-700 border bg-white dark:bg-black-800 hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60";case"error":return"text-error-600 dark:text-error-500 !border-error-600 dark:!border-error-500 border hover:bg-[#FEF3F2] disabled:opacity-60";case"warning":return"text-warning-300 dark:text-warning-500 border-warning-300 dark:border-warning-500 border hover:bg-[#FFFAEB] disabled:opacity-60";case"success":return"text-success-600 dark:text-success-500 border-success-600 dark:border-success-500 border hover:bg-[#ECFDF3] disabled:opacity-60";default:return"bg-white dark:bg-black-800 text-neutral-900 dark:text-white border-neutral-300 dark:border-neutral-700 border hover:bg-neutral-100 dark:hover:bg-black-600 disabled:opacity-60"}},[A,h]),N=v.useCallback(()=>{switch(A){case"primary":return"text-primary-700 dark:text-primary-600 border border-transparent dark:border-transparent hover:text-primary-700 disabled:opacity-60";case"secondary":return"text-primary-50 dark:text-primary-900 border border-transparent dark:border-transparent hover:text-primary-100 disabled:opacity-60";case"error":return"text-error-600 dark:text-error-500 border border-transparent dark:border-transparent hover:text-error-600 disabled:opacity-60";case"warning":return"text-warning-300 dark:text-warning-500 border border-transparent dark:border-transparent hover:text-warning-400 disabled:opacity-60";case"success":return"text-success-600 dark:text-success-500 border border-transparent dark:border-transparent hover:text-success-700 disabled:opacity-60";default:return"text-neutral-900 dark:text-white border border-transparent dark:border-transparent hover:text-[#667085] disabled:opacity-60"}},[A,h]),T=v.useCallback(()=>{switch(A){case"primary":return"bg-primary-50 dark:bg-black-700 text-primary-600 dark:text-primary-600 disabled:text-primary-100 hover:bg-primary-100 dark:hover:bg-black-600";default:return"bg-primary-50 dark:bg-black-700 text-primary-600 dark:text-primary-600 disabled:text-primary-100 hover:bg-primary-100 dark:hover:bg-black-600"}},[A,h]),w=v.useCallback(()=>{switch(A){case"primary":return{backgroundImage:"repeating-linear-gradient(3deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px), repeating-linear-gradient(93deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px), repeating-linear-gradient(183deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px), repeating-linear-gradient(273deg, #016DCF, #016DCF 10px, transparent 10px, transparent 19px, #016DCF 19px)",backgroundSize:"1px 100%, 100% 1px, 1px 100% , 100% 1px",backgroundPosition:"0 0, 0 0, 100% 0, 0 100%",backgroundRepeat:"no-repeat"};default:return{}}},[A,h]),k=v.useCallback(()=>{if(!e||e==="filled")switch(A){case"primary":return"bg-primary-700 text-primary-100";case"secondary":return"bg-primary-100 text-primary-700 dark:bg-black-700 dark:text-primary-400";case"secondary-neutral":return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-black-300";case"error":return"bg-error-700 text-error-100 dark:bg-error-600 dark:text-error-100";case"error-secondary":return"bg-error-200 text-error-700 dark:bg-black-700 dark:text-error-400";case"warning":return"bg-warning-400 text-white dark:bg-warning-700 dark:text-warning-100";case"success":return"bg-success-700 text-success-100";case"publish":return"bg-teal-900 text-teal-200";case"no-background":return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400";default:return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400"}switch(A){case"primary":case"secondary":return"bg-primary-100 text-primary-800 dark:bg-primary-950 dark:text-primary-400";case"error":case"error-secondary":return"bg-error-100 text-error-700 dark:bg-error-950 dark:text-error-400";case"warning":return"bg-warning-100 text-warning-700 dark:bg-warning-950 dark:text-warning-400";case"success":return"bg-success-100 text-success-700 dark:bg-success-950 dark:text-success-400";default:return"bg-neutral-100 text-neutral-500 dark:bg-black-700 dark:text-neutral-400"}},[A,e]),D=Ke(),C=v.useMemo(()=>y?.length?y.map(M=>{const U=vr[M];return U?D==="macos"?U.macos:U.other:M}):[],[y,D]),L=()=>t.jsx(t.Fragment,{children:t.jsx(lt.CgSpinner,{size:24,className:"inline mr-2 spinner"})});return t.jsx(fA,{title:p,placement:g,shortcuts:x,delayShow:!0,children:t.jsxs("button",{className:`
|