@lax-wp/design-system 0.10.7 → 0.10.8

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.cjs.js CHANGED
@@ -47,7 +47,7 @@
47
47
  .dark [class*="virtual-list-scrollbar-thumb"] {
48
48
  background: #454545 !important;
49
49
  }
50
- `,document.head.appendChild(pe)},[]);const ce=()=>{if(V){let se="";ue==null?se="":typeof ue=="string"||typeof ue=="number"?se=String(ue):Array.isArray(ue)?se=ue.map(xe=>typeof xe=="object"&&xe!==null&&"value"in xe?xe.value:xe).join(", "):typeof ue=="object"&&"value"in ue&&(se=String(ue.value)),V({key:h,value:se})}},ue=eI(e),K=x.useMemo(()=>b?mN(b,v):null,[b,v]),ne=(se,pe)=>{if(ae.current&&Q.id){const xe=document.getElementById(Q.id);if(xe){const Ne=Array.isArray(pe)?pe.map(ot=>ot.value):pe?.value;xe.dataset.selectedValue=JSON.stringify(Ne);const Ge=new Event("change",{bubbles:!0});Object.defineProperty(Ge,"target",{writable:!1,value:xe}),xe.dispatchEvent(Ge);const st=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${Q.id}`,value:Ne,type:"change"}});xe.dispatchEvent(st)}}if(r==="tags"){const xe=Array.isArray(se)?se:[se];m?.(xe?.map(Ne=>({label:Ne,value:Ne})))}else m?.(pe)},Ae=rI({options:a,value:e,defaultValue:Q?.defaultValue}),Ee=x.useMemo(()=>Ae.length>0||ue!=null,[Ae,ue]),Ie=x.useMemo(()=>{if(!r||r!=="multiple"||Ae.length===0)return!1;const se=Array.isArray(ue)?ue:[];return Ae.map(xe=>xe.value).every(xe=>se.some(Ne=>typeof Ne=="object"&&Ne!==null&&"value"in Ne?String(Ne.value)===String(xe):String(Ne)===String(xe)))},[ue,Ae,r]),Xe=()=>{!r||r!=="multiple"||!m||m(Ie?[]:Ae)},De=x.useCallback(se=>{if(!se)return;const pe=new Event("submit",{bubbles:!0,cancelable:!0});se.dispatchEvent(pe);const xe=se.querySelector('button[type="submit"]');xe&&xe.click()},[]),Qe=x.useCallback(se=>{if(se.key==="Enter"&&!te&&(se.preventDefault(),se.stopPropagation(),ue)){const pe=se.currentTarget.closest("form");De(pe)}},[te,ue,De]),at=x.useCallback(se=>{const{label:pe,value:xe,onClose:Ne}=se,st=Ae.find(ut=>String(ut.value)===String(xe))?.color||"blue",ot=ut=>{ut.preventDefault(),ut.stopPropagation()};return A.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:A.jsx(vr,{label:pe,color:st,size:"sm",onMouseDown:ot,onClick:I?void 0:Ne,isHashColor:!0,removable:!0,onRemove:Ne})})},[Ae,I]),me=x.useCallback(se=>{de(se),(l||K)?.(se)},[l,K]);return A.jsxs("div",{ref:X,className:B("flex gap-0.5 w-full relative",Y&&p?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),id:Q.id,children:[p&&!Y?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:B("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:se=>se.stopPropagation(),onKeyDownCapture:Qe,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?A.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 ${u?"":"capitalize"} ${R||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Zt,{label:t||"",required:i||!1,isRequiredConditional:U||!1}),q&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&A.jsx(vn,{}),A.jsx(Zr,{labels:s}),c&&A.jsx(je,{placement:"top",title:c,children:A.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:se=>{(se.key==="Enter"||se.key===" ")&&se.preventDefault()},children:A.jsx(Kr,{})})})]}),p&&Y?A.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:ce,type:"button",children:A.jsx(je,{placement:"top",title:G("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(We.Select,{onOpenChange:ie,disabled:I,className:`w-full text-black-900 dark:text-black-200 ${n&&i?"ant-select-status-error":"#e2e8f0"} ${P&&D?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":P&&D?.hexBgColor?D?.hexBgColor:"","--risk-border-color":P&&D?.hexBorderColor?D?.hexBorderColor:""},"aria-required":i,mode:r,value:ue,onChange:ne,filterOption:b?g:(se,pe)=>(pe?.label||"")?.toLowerCase()?.includes(se?.toLowerCase()),showSearch:!0,onSearch:me||void 0,onPopupScroll:S,popupClassName:"select-field-dropdown-popup",popupRender:se=>A.jsx(aI,{showSelectAll:N,mode:r,options:Ae,searchValue:he,handleSelectAll:Xe,isAllSelected:Ie,menu:se,isLoading:E,hasExistingData:Ee,t:G}),options:Ae.map(({label:se,value:pe,color:xe,...Ne})=>({label:String(se),value:String(pe),key:String(pe),id:String(pe),color:xe,...Ne})),optionRender:se=>{const pe=se?.data?.fullname;if(pe&&L){const[xe,Ne]=pe.split(" ");return A.jsxs("div",{className:"flex items-center justify-start gap-1",children:[A.jsx(L,{firstName:xe,lastName:Ne,profilePic:se?.data?.url||"",size:"xs",enablePopper:!0,userId:se?.data?.value}),A.jsx("span",{className:"ml-2",children:se.label})]})}return A.jsx("span",{children:se.label})},autoClearSearchValue:w,onClear:()=>m&&m(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&O?void 0:"responsive",maxTagPlaceholder:se=>A.jsx(je,{placement:"top",title:se.length>3?se.slice(0,3).map(({label:pe})=>pe).join(", ")+"...":se.map(({label:pe})=>pe).join(", "),children:A.jsxs("span",{children:["+",se.length," more"]})}),tagRender:C||at,allowClear:k,...Q}),n&&A.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),Y&&D&&P&&j&&A.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:se=>se.stopPropagation(),onMouseDown:se=>se.preventDefault(),onKeyDown:se=>{se.key==="Escape"&&oe(!1)},children:A.jsx(j,{riskDetails:D})})]})});aA.displayName="SelectField";const W4=x.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:l="default",wrapperClassName:c,checkboxClassName:u,labelClassName:f,size:p="medium",variant:h="default",labelPosition:m="right",checkboxProps:b},v)=>{const g=r!==void 0?r:n||!1,S=()=>{switch(p){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},E=()=>{if(l==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(l==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(l==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(h){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"}},k=()=>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-neutral-500 dark:text-neutral-400",w=()=>{switch(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},T=_=>{a(_.target.checked,_)},O=A.jsx(We.Checkbox,{...b,ref:v,id:t,checked:g,onChange:T,disabled:i,className:B("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",S(),E(),i&&"opacity-50 cursor-not-allowed",u),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),C=e?A.jsx("label",{htmlFor:t,className:B("font-medium cursor-pointer transition-colors duration-200",i?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",m==="right"?"ml-2":"mr-2",f),children:A.jsxs(ee,{variant:"medium",size:w(),appearance:"body",children:[e,s&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return A.jsxs("div",{className:B("flex flex-col",c),children:[A.jsx("div",{className:B("flex items-center",m==="left"&&"flex-row-reverse justify-end"),children:m==="left"?A.jsxs(A.Fragment,{children:[O,C]}):A.jsxs(A.Fragment,{children:[O,C]})}),A.jsx(Be.AnimatePresence,{children:o&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:l==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",k()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});W4.displayName="Checkbox";const X4=({label:t,isChecked:e,onChange:r,id:n,...a})=>A.jsxs("div",{className:"flex items-center",children:[A.jsx(We.Checkbox,{checked:e,onChange:r,id:n,type:"checkbox",value:"",className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500 dark:focus:ring-primary-400 dark:ring-offset-gray-800 focus:ring-2 dark:!bg-neutral-600 dark:border-gray-600",...a}),A.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),Q4=x.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:a,onColorChange:i,disabled:s=!1,required:o=!1,message:l,messageType:c="default",wrapperClassName:u,inputClassName:f,labelClassName:p,size:h="medium",showValue:m=!1,valueFormat:b="hex",inputProps:v,helpText:g},S)=>{const E=x.useRef(null),k=S||E,w=x.useCallback(()=>{requestAnimationFrame(()=>{k.current?.focus()})},[k]),T=x.useCallback(z=>{if(z.key==="Enter"&&!z.shiftKey){z.preventDefault();const M=z.target.closest("form");if(M){const L=M.querySelector('button[type="submit"]');L?L.click():M.requestSubmit()}}v?.onKeyDown?.(z)},[v]),O=r!==void 0?r:n,C=()=>{switch(h){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},_=()=>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",I=()=>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",N=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},R=z=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(z);if(!M)return z;const L=parseInt(M[1],16),V=parseInt(M[2],16),U=parseInt(M[3],16);return`rgb(${L}, ${V}, ${U})`},D=z=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(z);if(!M)return z;const L=parseInt(M[1],16)/255,V=parseInt(M[2],16)/255,U=parseInt(M[3],16)/255,q=Math.max(L,V,U),Q=Math.min(L,V,U);let X=0,G=0;const Y=(q+Q)/2;if(q!==Q){const oe=q-Q;switch(G=Y>.5?oe/(2-q-Q):oe/(q+Q),q){case L:X=(V-U)/oe+(V<U?6:0);break;case V:X=(U-L)/oe+2;break;case U:X=(L-V)/oe+4;break}X/=6}return`hsl(${Math.round(X*360)}, ${Math.round(G*100)}%, ${Math.round(Y*100)}%)`},P=()=>{switch(b){case"rgb":return R(O);case"hsl":return D(O);default:return O.toUpperCase()}},j=z=>{const M=z.target.value;a(M,z),i?.(M)};return A.jsxs("div",{className:B("flex flex-col w-full",u),children:[e&&A.jsx("label",{htmlFor:t,className:B("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",p),children:A.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:A.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:A.jsxs(ee,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),g&&A.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:g}),A.jsxs("div",{className:"flex items-center gap-3",children:[A.jsx("div",{className:"relative",children:A.jsx("input",{...v,ref:k,onBlur:w,onKeyDown:T,type:"color",id:t,value:O,onChange:j,disabled:s,required:o,className:B("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",C(),I(),s&&"opacity-50 cursor-not-allowed",f),style:{backgroundColor:O},"aria-required":o,"aria-invalid":l&&c==="error"?"true":"false","aria-describedby":l||g?`${t}-description`:void 0})}),m&&A.jsx("div",{className:"flex-1",children:A.jsx(ee,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:P()})})]}),A.jsx(Be.AnimatePresence,{children:l&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:c==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",_()),appearance:"custom",size:"extra-small",variant:"medium",children:l})})}),g&&!l&&A.jsx("div",{id:`${t}-description`,className:"sr-only",children:g})]})});Q4.displayName="ColorPicker";const G4=({id:t,label:e,errorMessage:r,selectOptions:n,loading:a,isClearable:i,multiSelect:s,selectedValues:o,disabled:l,required:c,value:u,className:f,tooltip:p,tags:h,originalCase:m=!1,onChange:b,filterOption:v,placeholder:g,...S})=>{const E=d.useIsDarkMode(),[k,w]=x.useState(!1),T=(P,j)=>{b&&b(P);const z=document.getElementById(t);if(z){const M=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:P,type:"change"}});z.dispatchEvent(M)}},O={control:(P,j)=>({...P,borderColor:r&&c?E?"#F04438":"#fda49b":j.isFocused?"var(--color-primary-600)":E?"#434343":"#d9d9d9",backgroundColor:E?"#141414":j.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:j.isDisabled?.6:1,cursor:j.isDisabled?"not-allowed":"pointer",boxShadow:j.isFocused?E?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&c?E?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:P=>({...P,fontSize:"14px",padding:0}),input:P=>({...P,margin:"0",padding:"0",color:E?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:P=>({...P,padding:0}),option:(P,j)=>({...P,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:j.isSelected?E?"var(--color-primary-975)":"var(--color-primary-50)":j.isFocused?E?"var(--color-primary-950)":"var(--color-primary-100)":E?"#141414":"#fff",color:j.isDisabled?E?"rgba(255,255,255,0.25)":"#a3a3a3":E?j.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:j.isDisabled?"not-allowed":"pointer",opacity:j.isDisabled?.6:1,"&:hover":{backgroundColor:j.isDisabled?E?"#141414":"#fff":E?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:E?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(P,j)=>({...P,fontSize:"14px",lineHeight:"20px",color:j.isDisabled?E?"rgba(255,255,255,0.25)":"#a3a3a3":E?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:P=>({...P,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:E?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:P=>({...P,backgroundColor:E?"rgba(255,255,255,0.08)":"#f0f5ff",border:E?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:P=>({...P,color:E?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:P=>({...P,color:E?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:E?"rgba(255,255,255,0.16)":"#e6f4ff",color:E?"#fff":"var(--color-primary-600)"}}),menu:P=>({...P,zIndex:5001,borderRadius:"8px",boxShadow:E?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:E?"#141414":"#fff",border:E?"1px solid #303030":"none",overflow:"hidden"}),menuList:P=>({...P,padding:"0",maxHeight:"256px"})},C=!!o?.length,N=k&&!l&&(i?C||!!u:!1),R=P=>{P.stopPropagation(),P.preventDefault(),T(s?[]:null)},D=()=>A.jsx("div",{className:"flex items-center",children:N?A.jsx(be.CancelRounded,{onClick:R,sx:{fontSize:"16px",cursor:"pointer",color:E?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:E?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):A.jsx(be.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:E?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return A.jsxs("div",{id:t,className:B("w-full flex flex-col gap-1",f),onMouseDown:P=>P.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&A.jsxs("label",{id:t+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${m?"":"capitalize"}`,children:[A.jsx(Zt,{label:e||"",required:c||!1}),A.jsx(Zr,{labels:h}),p&&A.jsx(We.Tooltip,{placement:"top",title:p,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),A.jsx("div",{onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:A.jsx(gN,{...S,id:"cm"+e,classNamePrefix:"lax-select",required:c,options:n,isClearable:!1,isLoading:a,isDisabled:l,styles:O,isMulti:s,value:s?o:u,onChange:T,filterOption:v,placeholder:g,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:D,IndicatorSeparator:()=>null}})}),r&&A.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};G4.displayName="CreatableSelectField";const cb=({ref:t,handler:e,enabled:r=!0})=>{x.useEffect(()=>{if(!r)return;const n=a=>{t.current&&!t.current.contains(a.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[t,e,r])},iI={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"},Y4=({id:t,label:e,options:r,placeholder:n,onChange:a,isLoading:i=!1,hideLabel:s=!1,errorMessage:o,required:l=!1,optionConfig:c,menuConfig:u,value:f,isMulti:p=!1,isClearable:h=!0,disabled:m=!1,className:b,isDark:v=!1,primaryColorShades:g=iI})=>{const S=x.useRef(null),[E,k]=x.useState(null),[w,T]=x.useState("");cb({ref:S,handler:()=>{k(null)}});const O={control:(D,P)=>({...D,borderColor:o&&l?"#F04438":P.isFocused?v?g[400]:g[600]:v?"#1e1e1e":"#e2e8f0",backgroundColor:P.isDisabled?v?"#1a1a1a":"#f5f5f5":v?"#262626":"#FFFFFF",color:P.isDisabled?v?"#666666":"#a0a0a0":v?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:P.isDisabled?"not-allowed":"default",opacity:(P.isDisabled,1),boxShadow:P.isFocused?v?`0 0 0 3px ${g[950]}`:`0 0 0 3px ${g[100]}`:"none"}),valueContainer:D=>({...D,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:v?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:D=>({...D,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:D=>({...D,fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:v?"1px solid #1e1e1e":"1px solid #eee",backgroundColor:v?"#000000":"#FFFFFF",color:v?"#d4d4d4":"#0F172A",display:"flex",alignItems:"center",zIndex:200,":hover":{backgroundColor:v?"#171717":g[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(D,P)=>({...D,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(P.isDisabled,v?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(D,P)=>({...D,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(P.isDisabled,v?"#595959":"#9CA3AF")}),multiValue:D=>({...D,backgroundColor:v?"#000000":g[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:D=>({...D,padding:"0",height:"30px"}),multiValueLabel:D=>({...D,color:v?"#d4d4d4":g[600],fontSize:"12px"}),multiValueRemove:D=>({...D,color:v?"#d4d4d4":g[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:v?"#171717":g[50]},svg:{height:"12px",width:"12px"}})},C=D=>{const P=r.filter(j=>j?.label?.toLowerCase()?.includes(w?.toLowerCase()));return A.jsx(MA.components.MenuList,{...D,className:B("!z-50 rounded !visible overflow-x-scroll",v?"bg-black-800":"bg-white",v?"text-neutral-300":"text-navy-900",u?.className),ref:S,children:P?.length?P.map((j,z)=>A.jsxs("div",{className:B("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",m?"cursor-not-allowed opacity-50":"cursor-pointer",v?"text-neutral-300":"text-navy-900",!m&&_(j)?v?"bg-black-700":"bg-primary-50":m?"":v?"hover:bg-black-700":"hover:bg-primary-50",u?.optionClassName?"":v?"border-b border-black-700":"border-b border-[#eee]"),onClick:M=>{m||(M.stopPropagation(),D.selectOption(j))},children:[c?.component?A.jsx(c.component,{...c.componentProps,...j}):A.jsx("div",{children:j.label}),A.jsx("div",{className:"flex items-center gap-1",children:_(j)&&c?.selectIndecator?c?.selectIndecator:null})]},z)):A.jsx("div",{className:B("opacity-50 flex justify-center items-center p-1 font-medium",v?"text-neutral-400":"text-gray-700"),children:"No options"})})},_=D=>p?E?.some(P=>P.value===D.value):D.value===E?.value,I=D=>{const{children:P,innerProps:j,isDisabled:z,getValue:M}=D,L=M();return A.jsx(MA.components.SingleValue,{...D,innerProps:j,isDisabled:z,children:L.length>0?L.map((V,U)=>A.jsx("span",{children:c?.component?A.jsx(c.component,{...c.componentProps,...V}):A.jsx("div",{children:V.label})},U)):A.jsx(A.Fragment,{children:P})})},N=D=>{const{innerProps:P,isDisabled:j,data:z}=D;return A.jsx(MA.components.MultiValue,{...D,innerProps:P,isDisabled:j,children:c?.component?A.jsx(c.component,{...c.componentProps,...z}):A.jsx("div",{children:z.label})})},R=(D,P)=>(T(P),!0);return A.jsxs("div",{className:B("flex flex-col",v?"text-black-300":"text-navy-900",i?"opacity-50":"opacity-100",m?"cursor-not-allowed":""),id:t,children:[s||!e?null:A.jsx(Zt,{label:e||"",required:l||!1}),A.jsx(MA,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:f,onChange:D=>{k(D),a(D)},styles:O,isMulti:p,className:B(v&&"bg-black-800 border-black-700",b),components:{MenuList:C,SingleValue:I,MultiValue:N},filterOption:R,closeMenuOnSelect:!0,isClearable:h,isDisabled:m}),o&&A.jsx(ee,{className:B("mt-1",v?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};Y4.displayName="CustomizableSelectField";const K4=[{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"}],ub={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:"$"},Wl=({classValue:t,size:e=24,fill:r="currentColor",...n})=>A.jsxs("svg",{className:B(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[A.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),A.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:A.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"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_8212_362816",children:A.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});Wl.displayName="CloseRounded";const Z4=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:n,children:A.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"})}),db=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,handleKeyDown:o,isClearable:l,onFocusText:c,autoComplete:u="false",searchRef:f,hasNavigation:p=!1,autoFocus:h=!1,searchConfig:m,hideSearchIcon:b,allowAStarSearch:v=!1,...g}=t,{t:S}=Kt.useTranslation(),[E,k]=x.useState(!1),[w,T]=x.useState("search"),O=x.useRef(null),{searchCount:C,searchPointer:_,setSearchPointer:I}=m||{},N=()=>{k(!0),T(c||r||S("Search"));const D=f||O;D.current&&D.current.focus()},R=()=>{k(!1),T("")};return A.jsxs("label",{className:B("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",s),children:[!b&&A.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:A.jsx(Z4,{width:"16",height:"16"})}),A.jsx(rb.DebounceInput,{...g,spellCheck:"false",debounceTimeout:i,id:a,inputRef:f||O,type:"text",className:B(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${b?"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",s),onKeyDown:D=>{D.key==="Enter"&&D.preventDefault(),o&&o(D)},value:e||"",placeholder:E?w:v?"":`${S("Search")}`,onChange:D=>n?.(D.target.value),autoComplete:u,onFocus:D=>{k(!0),N(),t.onFocus&&t.onFocus(D)},onBlur:D=>{k(!1),R(),t.onBlur&&t.onBlur(D)},autoFocus:h}),p&&e&&A.jsxs("div",{className:B("absolute mr-2 focus:outline-none flex gap-1",l?"right-6":"right-0"),children:[!!C&&(C||0)>0&&A.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(_||0)+1,"/",C]}),A.jsxs("div",{className:"flex gap-1 items-center",children:[A.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{I&&I(D=>(D||0)-1)},disabled:_===0,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),A.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{I&&I(D=>(D||0)+1)},disabled:_===(C||0)-1,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),v&&!(l&&e)&&!E&&!e?A.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[A.jsxs(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[S("Search")," (use"]}),A.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:A.jsx(We.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:A.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[A.jsx(ee,{className:"text-white text-lg font-semibold leading-5",children:S("Normal Search")}),A.jsx(ee,{className:"text-primary-300 dark:text-primary-300 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:S("Examples")}),A.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"data"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"text"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"base"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),A.jsx(ee,{className:"text-white text-lg font-semibold leading-5 mt-2",children:"Wildcard Search"}),A.jsx(ee,{className:"text-white dark:text-black-200 text-sm font-medium leading-[18px] font-inter",appearance:"custom",children:"Use * as a wildcard to refine your search."}),A.jsx(ee,{className:"text-primary-300 dark:text-primary-300 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:"Examples:"}),A.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"contract*"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"*agreement"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*clause*"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-primary-700 rounded-sm",children:A.jsx(ee,{className:"text-primary-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*l*s*"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:A.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),A.jsx(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):l&&e&&A.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:A.jsx(Wl,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Bi=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Bi||{});const sI=(t,e,r,n="medium")=>{const a={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"},i={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return B("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",a[n],i[n],{"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":t,"after:bg-white dark:after:bg-black-500":!t,"text-white dark:text-black-900":e,"cursor-not-allowed opacity-70":r})},oI=({size:t=18,fill:e="#016DCF"})=>A.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:A.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),AI=({size:t=18,fill:e="#101828"})=>A.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:A.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})}),Qn=x.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:a,required:i,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:l=Bi.TOP,statusText:c,withIcon:u=!1,tags:f,isAiExtracted:p=!1,tooltip:h="",className:m="",isDisabled:b=!1,icon:v,stopClickPropagation:g=!0,gtnName:S,variant:E="primary",labelClassName:k,isLiveField:w=!1,message:T,messageType:O="default",wrapperClassName:C,helpText:_,size:I="medium",renderGTNAddButton:N,onAddGTNToDocument:R},D)=>{const{t:P}=Kt.useTranslation(),j=l===Bi.TOP,z=l===Bi.LEFT,M=l===Bi.RIGHT,[L,V]=x.useState(!1),U=()=>{R&&R({key:S,value:e?"Yes":"No"})},q=()=>O==="error"?"text-red-500 dark:text-red-400":O==="success"?"text-green-500 dark:text-green-400":O==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return A.jsxs("div",{className:B("flex gap-0.5",L&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",C),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),onClick:Q=>{g&&Q.stopPropagation()},children:[t&&!L?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,A.jsxs("div",{className:"w-full flex flex-col",children:[j&&a&&A.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[A.jsxs("h1",{className:B("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",k),children:[A.jsx(Zt,{label:a||"",required:i||!1,isRequiredConditional:s||!1}),w&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),p&&A.jsx(vn,{}),A.jsx(Zr,{labels:f||[]}),h&&A.jsx(je,{placement:"top",title:h,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),t&&L?N?N(U):A.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:U,type:"button",children:A.jsx(We.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),_&&A.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:_}),A.jsxs("div",{className:"flex",children:[z&&A.jsx(ee,{size:"small",variant:"medium",className:B("mr-2 text-neutral-700 dark:text-black-200",k),appearance:"custom",children:a}),A.jsxs("label",{className:B("relative inline-flex items-center",M||c?"":"w-min",b?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:Q=>Q.stopPropagation(),children:[A.jsx("input",{ref:D,type:"checkbox",id:r,onChange:Q=>!b&&n(Q.target.checked),value:"",disabled:b,checked:e,className:B("sr-only peer w-full",m),"aria-required":i,"aria-invalid":T&&O==="error"?"true":"false","aria-describedby":T||_?`${r}-description`:void 0}),A.jsx("div",{className:sI(e,u,b,I),children:u?A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsx("div",{className:B("z-10 transition-all transform",I==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),I==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),I==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?v?.checkedIcon?v.checkedIcon:A.jsx(oI,{size:18,fill:"#016DCF"}):v?.uncheckedIcon?v.uncheckedIcon:A.jsx(AI,{size:18,fill:"#101828"})})}):null}),M&&A.jsx(ee,{size:"small",variant:"medium",className:B("ml-2 text-neutral-700 dark:text-black-300",k),appearance:"custom",children:a}),o?null:A.jsx(ee,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:c||(e?"Yes":"No")})]})]}),A.jsx(Be.AnimatePresence,{children:T&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:O==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",q()),appearance:"custom",size:"extra-small",variant:"medium",children:T})})}),_&&!T&&A.jsx("div",{id:`${r}-description`,className:"sr-only",children:_})]})]})});Qn.displayName="Toggle";const lI=t=>{try{return JSON.parse(t)}catch{return null}},cI=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},uI=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),dI=t=>{const e=[...t].sort((n,a)=>n.length-a.length),r=[];for(const n of e)r.some(i=>n!==i&&n.startsWith(i+"."))||r.push(n);return r},qi=t=>{let e="";if(t){let r=0;Object.keys(t).forEach(n=>{if(t[n]!==void 0&&t[n]!==null&&t[n]!==""){let a=t[n];typeof a=="object"?a=JSON.stringify(a):Array.isArray(a)&&(a=a.join(",")),a!=null&&a!==""&&(r===0?e+=`?${n}=${encodeURIComponent(a)}`:e+=`&${n}=${encodeURIComponent(a)}`,r+=1)}})}return e},$4=({shortcuts:t,variant:e="dark",className:r})=>{const a=nA()==="macos",i=x.useMemo(()=>t.map(s=>{const o=Fc[s];return o?a?o.macos:o.other:s}),[t,a]);return A.jsx("div",{className:B("flex flex-1 gap-1",r),children:i.map((s,o)=>A.jsx("kbd",{className:B("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:s},o))})},fI=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>A.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:A.jsx("g",{mask:"url(#mask0_6752_28309)",children:A.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})})}),Dr=({id:t,onClick:e,icon:r,text:n,className:a,isDisabled:i,onClose:s,notVisible:o,hideHoverEffect:l,leadingIcon:c,suffixRecord:u,stopPropagation:f,onToggle:p,isChecked:h=!1,highlight:m,truncateText:b=!1,showTick:v=!1,width:g="100%",tooltip:S,isFlowAvailable:E=!0,shortcuts:k,textClassName:w})=>{const T=x.useCallback(D=>{s&&s(),D.preventDefault(),e?.(D),f&&D.stopPropagation()},[s,e,f]),O=(D,P)=>{if(!P||!D||typeof D!="string"&&typeof D!="number")return D;const j=uI(P),z=new RegExp(`(${j?.trim()})`,"gi"),M=D?.toString()?.split(z);return A.jsxs("span",{className:"overflow-clip text-ellipsis",children:[M[0],A.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:M[1]}),M?.slice(2)?.join("")]})},C=x.useCallback(D=>{p?.(),D.stopPropagation()},[p]),_=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions","trash"].some(P=>n?.toLowerCase().includes(P)),I=i||!E;if(o)return null;const N=!!(e||p),R=N?"button":"div";return A.jsx(R,{id:t,className:B("w-full p-1 bg-white dark:bg-black-800 group",a,I&&"opacity-60"),...N?{onClick:p?()=>null:T,disabled:I}:{},onMouseMove:D=>D.stopPropagation(),children:A.jsxs("div",{className:B("option-button-inner flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!l&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?A.jsx("div",{className:B("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:A.jsx(je,{placement:"top",title:S,children:r})}):null,A.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[A.jsx("div",{className:B("flex-1 min-w-0",b&&"max-w-[150px]"),style:{width:g},children:A.jsx(ee,{className:B("font-medium text-sm truncate transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400",w),appearance:"custom",children:m?O(n,m):n})}),u?.[n]?A.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:u[n]||""}):null,v?A.jsx("div",{className:"flex-shrink-0",children:A.jsx(fI,{fill:"var(--color-primary-600)"})}):null]}),c?A.jsx(A.Fragment,{children:S?A.jsx(je,{placement:"top",title:S,children:A.jsx("div",{className:B("flex-shrink-0 transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):A.jsx("div",{className:B("flex-shrink-0 transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):null,k?A.jsx("div",{className:"flex items-center justify-end",children:A.jsx($4,{variant:"light",shortcuts:k})}):null,p?A.jsx("div",{className:"flex-shrink-0",children:A.jsx(Qn,{onChange:C,isChecked:h,isDisabled:i,hideStatus:!0})}):null]})})};Dr.displayName="OptionButton";const ko=(t,e)=>{const r=t.slice(0,2),n=tA[r];return n?A.jsx("div",{className:`
50
+ `,document.head.appendChild(pe)},[]);const ce=()=>{if(V){let se="";ue==null?se="":typeof ue=="string"||typeof ue=="number"?se=String(ue):Array.isArray(ue)?se=ue.map(xe=>typeof xe=="object"&&xe!==null&&"value"in xe?xe.value:xe).join(", "):typeof ue=="object"&&"value"in ue&&(se=String(ue.value)),V({key:h,value:se})}},ue=eI(e),K=x.useMemo(()=>b?mN(b,v):null,[b,v]),ne=(se,pe)=>{if(ae.current&&Q.id){const xe=document.getElementById(Q.id);if(xe){const Ne=Array.isArray(pe)?pe.map(ot=>ot.value):pe?.value;xe.dataset.selectedValue=JSON.stringify(Ne);const Ge=new Event("change",{bubbles:!0});Object.defineProperty(Ge,"target",{writable:!1,value:xe}),xe.dispatchEvent(Ge);const st=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${Q.id}`,value:Ne,type:"change"}});xe.dispatchEvent(st)}}if(r==="tags"){const xe=Array.isArray(se)?se:[se];m?.(xe?.map(Ne=>({label:Ne,value:Ne})))}else m?.(pe)},Ae=rI({options:a,value:e,defaultValue:Q?.defaultValue}),Ee=x.useMemo(()=>Ae.length>0||ue!=null,[Ae,ue]),Ie=x.useMemo(()=>{if(!r||r!=="multiple"||Ae.length===0)return!1;const se=Array.isArray(ue)?ue:[];return Ae.map(xe=>xe.value).every(xe=>se.some(Ne=>typeof Ne=="object"&&Ne!==null&&"value"in Ne?String(Ne.value)===String(xe):String(Ne)===String(xe)))},[ue,Ae,r]),Xe=()=>{!r||r!=="multiple"||!m||m(Ie?[]:Ae)},De=x.useCallback(se=>{if(!se)return;const pe=new Event("submit",{bubbles:!0,cancelable:!0});se.dispatchEvent(pe);const xe=se.querySelector('button[type="submit"]');xe&&xe.click()},[]),Qe=x.useCallback(se=>{if(se.key==="Enter"&&!te&&(se.preventDefault(),se.stopPropagation(),ue)){const pe=se.currentTarget.closest("form");De(pe)}},[te,ue,De]),at=x.useCallback(se=>{const{label:pe,value:xe,onClose:Ne}=se,st=Ae.find(ut=>String(ut.value)===String(xe))?.color||"blue",ot=ut=>{ut.preventDefault(),ut.stopPropagation()};return A.jsx("div",{className:"cursor-pointer me-1 inline-flex",children:A.jsx(vr,{label:pe,color:st,size:"sm",onMouseDown:ot,onClick:I?void 0:Ne,isHashColor:!0,removable:!0,onRemove:Ne})})},[Ae,I]),me=x.useCallback(se=>{de(se),(l||K)?.(se)},[l,K]);return A.jsxs("div",{ref:X,className:B("flex gap-0.5 w-full relative",Y&&p?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),id:Q.id,children:[p&&!Y?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:B("w-full flex flex-col gap-1 risk-analysis-select-field",o),onMouseDown:se=>se.stopPropagation(),onKeyDownCapture:Qe,role:"group","aria-labelledby":t?"select-field-label":void 0,children:[t?A.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 ${u?"":"capitalize"} ${R||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Zt,{label:t||"",required:i||!1,isRequiredConditional:U||!1}),q&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),f&&A.jsx(vn,{}),A.jsx(Zr,{labels:s}),c&&A.jsx(je,{placement:"top",title:c,children:A.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:se=>{(se.key==="Enter"||se.key===" ")&&se.preventDefault()},children:A.jsx(Kr,{})})})]}),p&&Y?A.jsx("button",{id:"btn-select-field-base-add-to-document",className:"cursor-pointer",onClick:ce,type:"button",children:A.jsx(je,{placement:"top",title:G("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(We.Select,{onOpenChange:ie,disabled:I,className:`w-full text-black-900 dark:text-black-200 ${n&&i?"ant-select-status-error":"#e2e8f0"} ${P&&D?.color?"risk-select-field":""}`,classNames:{popup:{root:"!z-[5001]"}},style:{width:"100%","--risk-color":P&&D?.hexBgColor?D?.hexBgColor:"","--risk-border-color":P&&D?.hexBorderColor?D?.hexBorderColor:""},"aria-required":i,mode:r,value:ue,onChange:ne,filterOption:b?g:(se,pe)=>(pe?.label||"")?.toLowerCase()?.includes(se?.toLowerCase()),showSearch:!0,onSearch:me||void 0,onPopupScroll:S,popupClassName:"select-field-dropdown-popup",popupRender:se=>A.jsx(aI,{showSelectAll:N,mode:r,options:Ae,searchValue:he,handleSelectAll:Xe,isAllSelected:Ie,menu:se,isLoading:E,hasExistingData:Ee,t:G}),options:Ae.map(({label:se,value:pe,color:xe,...Ne})=>({label:String(se),value:String(pe),key:String(pe),id:String(pe),color:xe,...Ne})),optionRender:se=>{const pe=se?.data?.fullname;if(pe&&L){const[xe,Ne]=pe.split(" ");return A.jsxs("div",{className:"flex items-center justify-start gap-1",children:[A.jsx(L,{firstName:xe,lastName:Ne,profilePic:se?.data?.url||"",size:"xs",enablePopper:!0,userId:se?.data?.value}),A.jsx("span",{className:"ml-2",children:se.label})]})}return A.jsx("span",{children:se.label})},autoClearSearchValue:w,onClear:()=>m&&m(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&O?void 0:"responsive",maxTagPlaceholder:se=>A.jsx(je,{placement:"top",title:se.length>3?se.slice(0,3).map(({label:pe})=>pe).join(", ")+"...":se.map(({label:pe})=>pe).join(", "),children:A.jsxs("span",{children:["+",se.length," more"]})}),tagRender:C||at,allowClear:k,...Q}),n&&A.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]}),Y&&D&&P&&j&&A.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:se=>se.stopPropagation(),onMouseDown:se=>se.preventDefault(),onKeyDown:se=>{se.key==="Escape"&&oe(!1)},children:A.jsx(j,{riskDetails:D})})]})});aA.displayName="SelectField";const W4=x.forwardRef(({id:t,label:e,checked:r,isChecked:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:l="default",wrapperClassName:c,checkboxClassName:u,labelClassName:f,size:p="medium",variant:h="default",labelPosition:m="right",checkboxProps:b},v)=>{const g=r!==void 0?r:n||!1,S=()=>{switch(p){case"small":return"w-3 h-3";case"large":return"w-5 h-5";default:return"w-4 h-4"}},E=()=>{if(l==="error")return"text-red-600 border-red-300 focus:ring-red-500 dark:focus:ring-red-600";if(l==="success")return"text-green-600 border-green-300 focus:ring-green-500 dark:focus:ring-green-600";if(l==="info")return"text-blue-600 border-blue-300 focus:ring-blue-500 dark:focus:ring-blue-600";switch(h){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"}},k=()=>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-neutral-500 dark:text-neutral-400",w=()=>{switch(p){case"small":return"extra-small";case"large":return"medium";default:return"small"}},T=_=>{a(_.target.checked,_)},O=A.jsx(We.Checkbox,{...b,ref:v,id:t,checked:g,onChange:T,disabled:i,className:B("rounded focus:ring-2 focus:ring-primary-500 dark:focus:ring-primary-400 focus:ring-offset-gray-800 transition-colors duration-200",S(),E(),i&&"opacity-50 cursor-not-allowed",u),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o?`${t}-message`:void 0}),C=e?A.jsx("label",{htmlFor:t,className:B("font-medium cursor-pointer transition-colors duration-200",i?"text-neutral-400 dark:text-neutral-600 cursor-not-allowed":"text-neutral-900 dark:text-neutral-100",m==="right"?"ml-2":"mr-2",f),children:A.jsxs(ee,{variant:"medium",size:w(),appearance:"body",children:[e,s&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})}):null;return A.jsxs("div",{className:B("flex flex-col",c),children:[A.jsx("div",{className:B("flex items-center",m==="left"&&"flex-row-reverse justify-end"),children:m==="left"?A.jsxs(A.Fragment,{children:[O,C]}):A.jsxs(A.Fragment,{children:[O,C]})}),A.jsx(Be.AnimatePresence,{children:o&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-message`,role:l==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",k()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})})]})});W4.displayName="Checkbox";const X4=({label:t,isChecked:e,onChange:r,id:n,...a})=>A.jsxs("div",{className:"flex items-center",children:[A.jsx(We.Checkbox,{checked:e,onChange:r,id:n,type:"checkbox",value:"",className:"w-4 h-4 text-primary-600 bg-gray-100 border-gray-300 rounded focus:ring-primary-500 dark:focus:ring-primary-400 dark:ring-offset-gray-800 focus:ring-2 dark:!bg-neutral-600 dark:border-gray-600",...a}),A.jsx("label",{className:"ml-2 text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]}),Q4=x.forwardRef(({id:t,label:e,value:r,defaultValue:n="#000000",onChange:a,onColorChange:i,disabled:s=!1,required:o=!1,message:l,messageType:c="default",wrapperClassName:u,inputClassName:f,labelClassName:p,size:h="medium",showValue:m=!1,valueFormat:b="hex",inputProps:v,helpText:g},S)=>{const E=x.useRef(null),k=S||E,w=x.useCallback(()=>{requestAnimationFrame(()=>{k.current?.focus()})},[k]),T=x.useCallback(z=>{if(z.key==="Enter"&&!z.shiftKey){z.preventDefault();const M=z.target.closest("form");if(M){const L=M.querySelector('button[type="submit"]');L?L.click():M.requestSubmit()}}v?.onKeyDown?.(z)},[v]),O=r!==void 0?r:n,C=()=>{switch(h){case"small":return"w-8 h-8";case"large":return"w-16 h-16";default:return"w-12 h-12"}},_=()=>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",I=()=>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",N=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},R=z=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(z);if(!M)return z;const L=parseInt(M[1],16),V=parseInt(M[2],16),U=parseInt(M[3],16);return`rgb(${L}, ${V}, ${U})`},D=z=>{const M=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(z);if(!M)return z;const L=parseInt(M[1],16)/255,V=parseInt(M[2],16)/255,U=parseInt(M[3],16)/255,q=Math.max(L,V,U),Q=Math.min(L,V,U);let X=0,G=0;const Y=(q+Q)/2;if(q!==Q){const oe=q-Q;switch(G=Y>.5?oe/(2-q-Q):oe/(q+Q),q){case L:X=(V-U)/oe+(V<U?6:0);break;case V:X=(U-L)/oe+2;break;case U:X=(L-V)/oe+4;break}X/=6}return`hsl(${Math.round(X*360)}, ${Math.round(G*100)}%, ${Math.round(Y*100)}%)`},P=()=>{switch(b){case"rgb":return R(O);case"hsl":return D(O);default:return O.toUpperCase()}},j=z=>{const M=z.target.value;a(M,z),i?.(M)};return A.jsxs("div",{className:B("flex flex-col w-full",u),children:[e&&A.jsx("label",{htmlFor:t,className:B("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",p),children:A.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:A.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:A.jsxs(ee,{variant:"medium",size:N(),appearance:"subtitle",children:[e,o&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),g&&A.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:g}),A.jsxs("div",{className:"flex items-center gap-3",children:[A.jsx("div",{className:"relative",children:A.jsx("input",{...v,ref:k,onBlur:w,onKeyDown:T,type:"color",id:t,value:O,onChange:j,disabled:s,required:o,className:B("border rounded-md cursor-pointer transition-all duration-200","focus:outline-none focus:ring-2",C(),I(),s&&"opacity-50 cursor-not-allowed",f),style:{backgroundColor:O},"aria-required":o,"aria-invalid":l&&c==="error"?"true":"false","aria-describedby":l||g?`${t}-description`:void 0})}),m&&A.jsx("div",{className:"flex-1",children:A.jsx(ee,{variant:"medium",size:"small",appearance:"body",className:"font-mono text-neutral-700 dark:text-neutral-300",children:P()})})]}),A.jsx(Be.AnimatePresence,{children:l&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:c==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",_()),appearance:"custom",size:"extra-small",variant:"medium",children:l})})}),g&&!l&&A.jsx("div",{id:`${t}-description`,className:"sr-only",children:g})]})});Q4.displayName="ColorPicker";const G4=({id:t,label:e,errorMessage:r,selectOptions:n,loading:a,isClearable:i,multiSelect:s,selectedValues:o,disabled:l,required:c,value:u,className:f,tooltip:p,tags:h,originalCase:m=!1,onChange:b,filterOption:v,placeholder:g,...S})=>{const E=d.useIsDarkMode(),[k,w]=x.useState(!1),T=(P,j)=>{b&&b(P);const z=document.getElementById(t);if(z){const M=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:P,type:"change"}});z.dispatchEvent(M)}},O={control:(P,j)=>({...P,borderColor:r&&c?E?"#F04438":"#fda49b":j.isFocused?"var(--color-primary-600)":E?"#434343":"#d9d9d9",backgroundColor:E?"#141414":j.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:j.isDisabled?.6:1,cursor:j.isDisabled?"not-allowed":"pointer",boxShadow:j.isFocused?E?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:r&&c?E?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:P=>({...P,fontSize:"14px",padding:0}),input:P=>({...P,margin:"0",padding:"0",color:E?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:P=>({...P,padding:0}),option:(P,j)=>({...P,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:j.isSelected?E?"var(--color-primary-975)":"var(--color-primary-50)":j.isFocused?E?"var(--color-primary-950)":"var(--color-primary-100)":E?"#141414":"#fff",color:j.isDisabled?E?"rgba(255,255,255,0.25)":"#a3a3a3":E?j.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:j.isDisabled?"not-allowed":"pointer",opacity:j.isDisabled?.6:1,"&:hover":{backgroundColor:j.isDisabled?E?"#141414":"#fff":E?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:E?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(P,j)=>({...P,fontSize:"14px",lineHeight:"20px",color:j.isDisabled?E?"rgba(255,255,255,0.25)":"#a3a3a3":E?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:P=>({...P,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:E?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:P=>({...P,backgroundColor:E?"rgba(255,255,255,0.08)":"#f0f5ff",border:E?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:P=>({...P,color:E?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:P=>({...P,color:E?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:E?"rgba(255,255,255,0.16)":"#e6f4ff",color:E?"#fff":"var(--color-primary-600)"}}),menu:P=>({...P,zIndex:5001,borderRadius:"8px",boxShadow:E?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:E?"#141414":"#fff",border:E?"1px solid #303030":"none",overflow:"hidden"}),menuList:P=>({...P,padding:"0",maxHeight:"256px"})},C=!!o?.length,N=k&&!l&&(i?C||!!u:!1),R=P=>{P.stopPropagation(),P.preventDefault(),T(s?[]:null)},D=()=>A.jsx("div",{className:"flex items-center",children:N?A.jsx(be.CancelRounded,{onClick:R,sx:{fontSize:"16px",cursor:"pointer",color:E?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:E?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):A.jsx(be.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:E?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return A.jsxs("div",{id:t,className:B("w-full flex flex-col gap-1",f),onMouseDown:P=>P.stopPropagation(),role:"group","aria-labelledby":e?t+"Label":void 0,children:[e&&A.jsxs("label",{id:t+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${m?"":"capitalize"}`,children:[A.jsx(Zt,{label:e||"",required:c||!1}),A.jsx(Zr,{labels:h}),p&&A.jsx(We.Tooltip,{placement:"top",title:p,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),A.jsx("div",{onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:A.jsx(gN,{...S,id:"cm"+e,classNamePrefix:"lax-select",required:c,options:n,isClearable:!1,isLoading:a,isDisabled:l,styles:O,isMulti:s,value:s?o:u,onChange:T,filterOption:v,placeholder:g,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:D,IndicatorSeparator:()=>null}})}),r&&A.jsx(ee,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:r})]})};G4.displayName="CreatableSelectField";const cb=({ref:t,handler:e,enabled:r=!0})=>{x.useEffect(()=>{if(!r)return;const n=a=>{t.current&&!t.current.contains(a.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[t,e,r])},iI={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"},Y4=({id:t,label:e,options:r,placeholder:n,onChange:a,isLoading:i=!1,hideLabel:s=!1,errorMessage:o,required:l=!1,optionConfig:c,menuConfig:u,value:f,isMulti:p=!1,isClearable:h=!0,disabled:m=!1,className:b,isDark:v=!1,primaryColorShades:g=iI})=>{const S=x.useRef(null),[E,k]=x.useState(null),[w,T]=x.useState("");cb({ref:S,handler:()=>{k(null)}});const O={control:(D,P)=>({...D,borderColor:o&&l?"#F04438":P.isFocused?v?g[400]:g[600]:v?"#1e1e1e":"#e2e8f0",backgroundColor:P.isDisabled?v?"#1a1a1a":"#f5f5f5":v?"#262626":"#FFFFFF",color:P.isDisabled?v?"#666666":"#a0a0a0":v?"#d4d4d4":"#0F172A",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0px 10px",cursor:P.isDisabled?"not-allowed":"default",opacity:(P.isDisabled,1),boxShadow:P.isFocused?v?`0 0 0 3px ${g[950]}`:`0 0 0 3px ${g[100]}`:"none"}),valueContainer:D=>({...D,fontSize:"14px",maxHeight:"60px",overflowY:"auto",padding:"0px",margin:"0px",color:v?"#d4d4d4":"inherit","::-webkit-scrollbar":{display:"none"}}),input:D=>({...D,margin:"0"}),indicatorSeparator:()=>({display:"none"}),option:D=>({...D,fontWeight:500,fontSize:"14px",lineHeight:"1",borderBottom:v?"1px solid #1e1e1e":"1px solid #eee",backgroundColor:v?"#000000":"#FFFFFF",color:v?"#d4d4d4":"#0F172A",display:"flex",alignItems:"center",zIndex:200,":hover":{backgroundColor:v?"#171717":g[50]},".icon":{height:"14px",width:"14px"}}),singleValue:(D,P)=>({...D,fontWeight:500,fontSize:"14px",lineHeight:"1.25rem",color:(P.isDisabled,v?"#d4d4d4":"#0F172A"),display:"flex",alignItems:"center",".icon":{height:"14px",width:"14px"}}),placeholder:(D,P)=>({...D,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:(P.isDisabled,v?"#595959":"#9CA3AF")}),multiValue:D=>({...D,backgroundColor:v?"#000000":g[50],borderRadius:"6px",fontFamily:"Inter",fontSize:"12px",height:"20px",alignItems:"center"}),indicatorsContainer:D=>({...D,padding:"0",height:"30px"}),multiValueLabel:D=>({...D,color:v?"#d4d4d4":g[600],fontSize:"12px"}),multiValueRemove:D=>({...D,color:v?"#d4d4d4":g[600],height:"12px",fontSize:"8px",":hover":{backgroundColor:v?"#171717":g[50]},svg:{height:"12px",width:"12px"}})},C=D=>{const P=r.filter(j=>j?.label?.toLowerCase()?.includes(w?.toLowerCase()));return A.jsx(MA.components.MenuList,{...D,className:B("!z-50 rounded !visible overflow-x-scroll",v?"bg-black-800":"bg-white",v?"text-neutral-300":"text-navy-900",u?.className),ref:S,children:P?.length?P.map((j,z)=>A.jsxs("div",{className:B("item z-[9999] flex items-center justify-between px-4 py-1.5 no-wheel",m?"cursor-not-allowed opacity-50":"cursor-pointer",v?"text-neutral-300":"text-navy-900",!m&&_(j)?v?"bg-black-700":"bg-primary-50":m?"":v?"hover:bg-black-700":"hover:bg-primary-50",u?.optionClassName?"":v?"border-b border-black-700":"border-b border-[#eee]"),onClick:M=>{m||(M.stopPropagation(),D.selectOption(j))},children:[c?.component?A.jsx(c.component,{...c.componentProps,...j}):A.jsx("div",{children:j.label}),A.jsx("div",{className:"flex items-center gap-1",children:_(j)&&c?.selectIndecator?c?.selectIndecator:null})]},z)):A.jsx("div",{className:B("opacity-50 flex justify-center items-center p-1 font-medium",v?"text-neutral-400":"text-gray-700"),children:"No options"})})},_=D=>p?E?.some(P=>P.value===D.value):D.value===E?.value,I=D=>{const{children:P,innerProps:j,isDisabled:z,getValue:M}=D,L=M();return A.jsx(MA.components.SingleValue,{...D,innerProps:j,isDisabled:z,children:L.length>0?L.map((V,U)=>A.jsx("span",{children:c?.component?A.jsx(c.component,{...c.componentProps,...V}):A.jsx("div",{children:V.label})},U)):A.jsx(A.Fragment,{children:P})})},N=D=>{const{innerProps:P,isDisabled:j,data:z}=D;return A.jsx(MA.components.MultiValue,{...D,innerProps:P,isDisabled:j,children:c?.component?A.jsx(c.component,{...c.componentProps,...z}):A.jsx("div",{children:z.label})})},R=(D,P)=>(T(P),!0);return A.jsxs("div",{className:B("flex flex-col",v?"text-black-300":"text-navy-900",i?"opacity-50":"opacity-100",m?"cursor-not-allowed":""),id:t,children:[s||!e?null:A.jsx(Zt,{label:e||"",required:l||!1}),A.jsx(MA,{required:!0,classNamePrefix:"lax-select",options:r,placeholder:n,value:f,onChange:D=>{k(D),a(D)},styles:O,isMulti:p,className:B(v&&"bg-black-800 border-black-700",b),components:{MenuList:C,SingleValue:I,MultiValue:N},filterOption:R,closeMenuOnSelect:!0,isClearable:h,isDisabled:m}),o&&A.jsx(ee,{className:B("mt-1",v?"text-red-400":"text-red-500"),appearance:"custom",size:"extra-small",variant:"medium",children:o})]})};Y4.displayName="CustomizableSelectField";const K4=[{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"}],ub={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:"$"},Wl=({classValue:t,size:e=24,fill:r="currentColor",...n})=>A.jsxs("svg",{className:B(t),width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[A.jsx("rect",{width:"12",height:"12",rx:"6",fill:r}),A.jsx("g",{clipPath:"url(#clip0_8212_362816)",children:A.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"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_8212_362816",children:A.jsx("rect",{width:"8",height:"8",fill:"white",transform:"translate(2 2)"})})})]});Wl.displayName="CloseRounded";const Z4=({width:t=15,height:e=15,fill:r="#98A2B3",className:n})=>A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t.toString(),height:e.toString(),viewBox:"0 0 20 20",fill:"none",className:n,children:A.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"})}),db=t=>{const{value:e,placeholder:r,onChange:n,id:a,debounceTimeout:i=0,classValues:s,handleKeyDown:o,isClearable:l,onFocusText:c,autoComplete:u="false",searchRef:f,hasNavigation:p=!1,autoFocus:h=!1,searchConfig:m,hideSearchIcon:b,allowAStarSearch:v=!1,...g}=t,{t:S}=Kt.useTranslation(),[E,k]=x.useState(!1),[w,T]=x.useState("search"),O=x.useRef(null),{searchCount:C,searchPointer:_,setSearchPointer:I}=m||{},N=()=>{k(!0),T(c||r||S("Search"));const D=f||O;D.current&&D.current.focus()},R=()=>{k(!1),T("")};return A.jsxs("label",{className:B("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",s),children:[!b&&A.jsx("div",{className:"flex items-center h-6 w-6 pointer-events-none",children:A.jsx(Z4,{width:"16",height:"16"})}),A.jsx(rb.DebounceInput,{...g,spellCheck:"false",debounceTimeout:i,id:a,inputRef:f||O,type:"text",className:B(`absolute inset-0 dark:text-[#98A2B3] text-neutral-900 ${b?"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",s),onKeyDown:D=>{D.key==="Enter"&&D.preventDefault(),o&&o(D)},value:e||"",placeholder:E?w:v?"":`${S("Search")}`,onChange:D=>n?.(D.target.value),autoComplete:u,onFocus:D=>{k(!0),N(),t.onFocus&&t.onFocus(D)},onBlur:D=>{k(!1),R(),t.onBlur&&t.onBlur(D)},autoFocus:h}),p&&e&&A.jsxs("div",{className:B("absolute mr-2 focus:outline-none flex gap-1",l?"right-6":"right-0"),children:[!!C&&(C||0)>0&&A.jsxs("span",{className:"text-xs border-r pr-2 border-gray-200",children:[(_||0)+1,"/",C]}),A.jsxs("div",{className:"flex gap-1 items-center",children:[A.jsx("button",{id:"btn-search-bar-set-search-pointer-forward",onClick:()=>{I&&I(D=>(D||0)-1)},disabled:_===0,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M15 18l-6-6 6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),A.jsx("button",{id:"btn-search-bar-set-search-pointer-backward",onClick:()=>{I&&I(D=>(D||0)+1)},disabled:_===(C||0)-1,children:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M9 18l6-6-6-6",stroke:"#98A2B3",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),v&&!(l&&e)&&!E&&!e?A.jsxs("div",{className:"absolute flex ml-6 items-center justify-center focus:outline-none gap-1 flex-wrap-none",children:[A.jsxs(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:[S("Search")," (use"]}),A.jsx("button",{className:" bg-[#EAECF0] dark:bg-black-800 rounded-sm text-sm w-3 h-5",children:A.jsx(We.Tooltip,{placement:"bottomRight",color:"#141414",classNames:{root:"custom-tooltip dark:!bg-black-800"},title:A.jsxs("div",{className:"flex flex-col items-start justify-center p-2 w-full h-full gap-2 dark:bg-black-800",children:[A.jsx(ee,{className:"text-white text-lg font-semibold leading-5",children:S("Normal Search")}),A.jsx(ee,{className:"text-primary-400 dark:text-primary-400 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:S("Examples")}),A.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"data"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "data", "Data".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"text"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "text", "context", "plaintext".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"base"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "database", "baseball", "basename".'})]})]}),A.jsx(ee,{className:"text-white text-lg font-semibold leading-5 mt-2",children:"Wildcard Search"}),A.jsx(ee,{className:"text-white dark:text-black-200 text-sm font-medium leading-[18px] font-inter",appearance:"custom",children:"Use * as a wildcard to refine your search."}),A.jsx(ee,{className:"text-primary-400 dark:text-primary-400 text-sm font-bold leading-[18px] font-inter",appearance:"custom",children:"Examples:"}),A.jsxs("div",{className:"flex flex-col items-start justify-center ",children:[A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"contract*"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ "contracts", "contractor", "CONTRACTOR".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter ",children:"*agreement"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "service agreement", "legal agreement".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*clause*"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "subclause", "clauses".'})]}),A.jsxs("div",{className:"flex items-center justify-center gap-1",children:[A.jsx(ee,{className:"flex-shrink-0",appearance:"custom",children:"•"}),A.jsx("div",{className:"flex px-1 items-center justify-center bg-neutral-700 rounded-sm",children:A.jsx(ee,{className:"text-neutral-300 dark:text-black-200 text-xs font-medium leading-[18px] font-inter",children:"*l*s*"})}),A.jsx(ee,{className:"text-white dark:text-black-100 text-xs font-medium leading-[18px] font-inter",appearance:"custom",children:'→ finds "clause", "clauses".'})]})]})]}),children:A.jsx("div",{className:"text-[#475467] dark:text-black-300 dark:bg-black-600",children:"*"})})}),A.jsx(ee,{className:"text-[#98A2B3] dark:text-black-400 font-inter text-sm font-medium leading-5",children:"as a wildcard)"})]}):l&&e&&A.jsx("button",{id:"btn-search-bar-close",className:"absolute right-0 mr-2 focus:outline-none",onClick:()=>n?.(""),children:A.jsx(Wl,{classValue:"text-neutral-200 dark:text-black-500",size:16})})]})};var Bi=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t))(Bi||{});const sI=(t,e,r,n="medium")=>{const a={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"},i={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return B("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",a[n],i[n],{"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":t,"after:bg-white dark:after:bg-black-500":!t,"text-white dark:text-black-900":e,"cursor-not-allowed opacity-70":r})},oI=({size:t=18,fill:e="#016DCF"})=>A.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:A.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:e})}),AI=({size:t=18,fill:e="#101828"})=>A.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:A.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})}),Qn=x.forwardRef(({isGTN:t=!1,isChecked:e,id:r,onChange:n,label:a,required:i,isRequiredConditional:s=!1,hideStatus:o=!1,labelDirection:l=Bi.TOP,statusText:c,withIcon:u=!1,tags:f,isAiExtracted:p=!1,tooltip:h="",className:m="",isDisabled:b=!1,icon:v,stopClickPropagation:g=!0,gtnName:S,variant:E="primary",labelClassName:k,isLiveField:w=!1,message:T,messageType:O="default",wrapperClassName:C,helpText:_,size:I="medium",renderGTNAddButton:N,onAddGTNToDocument:R},D)=>{const{t:P}=Kt.useTranslation(),j=l===Bi.TOP,z=l===Bi.LEFT,M=l===Bi.RIGHT,[L,V]=x.useState(!1),U=()=>{R&&R({key:S,value:e?"Yes":"No"})},q=()=>O==="error"?"text-red-500 dark:text-red-400":O==="success"?"text-green-500 dark:text-green-400":O==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return A.jsxs("div",{className:B("flex gap-0.5",L&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",C),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),onClick:Q=>{g&&Q.stopPropagation()},children:[t&&!L?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,A.jsxs("div",{className:"w-full flex flex-col",children:[j&&a&&A.jsxs("div",{className:"w-full flex justify-between flex-wrap",children:[A.jsxs("h1",{className:B("mb-1 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",k),children:[A.jsx(Zt,{label:a||"",required:i||!1,isRequiredConditional:s||!1}),w&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),p&&A.jsx(vn,{}),A.jsx(Zr,{labels:f||[]}),h&&A.jsx(je,{placement:"top",title:h,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),t&&L?N?N(U):A.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:U,type:"button",children:A.jsx(We.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]}),_&&A.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:_}),A.jsxs("div",{className:"flex",children:[z&&A.jsx(ee,{size:"small",variant:"medium",className:B("mr-2 text-neutral-700 dark:text-black-200",k),appearance:"custom",children:a}),A.jsxs("label",{className:B("relative inline-flex items-center",M||c?"":"w-min",b?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:Q=>Q.stopPropagation(),children:[A.jsx("input",{ref:D,type:"checkbox",id:r,onChange:Q=>!b&&n(Q.target.checked),value:"",disabled:b,checked:e,className:B("sr-only peer w-full",m),"aria-required":i,"aria-invalid":T&&O==="error"?"true":"false","aria-describedby":T||_?`${r}-description`:void 0}),A.jsx("div",{className:sI(e,u,b,I),children:u?A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsx("div",{className:B("z-10 transition-all transform",I==="small"&&(e?"translate-x-2":"translate-x-[-6px]"),I==="medium"&&(e?"translate-x-[8.5px]":"translate-x-[-8px]"),I==="large"&&(e?"translate-x-2.5":"translate-x-[-10px]")),children:e?v?.checkedIcon?v.checkedIcon:A.jsx(oI,{size:18,fill:"#016DCF"}):v?.uncheckedIcon?v.uncheckedIcon:A.jsx(AI,{size:18,fill:"#101828"})})}):null}),M&&A.jsx(ee,{size:"small",variant:"medium",className:B("ml-2 text-neutral-700 dark:text-black-300",k),appearance:"custom",children:a}),o?null:A.jsx(ee,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:c||(e?"Yes":"No")})]})]}),A.jsx(Be.AnimatePresence,{children:T&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${r}-description`,role:O==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",q()),appearance:"custom",size:"extra-small",variant:"medium",children:T})})}),_&&!T&&A.jsx("div",{id:`${r}-description`,className:"sr-only",children:_})]})]})});Qn.displayName="Toggle";const lI=t=>{try{return JSON.parse(t)}catch{return null}},cI=t=>{let e="";const r="0123456789abcdef";for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e},uI=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),dI=t=>{const e=[...t].sort((n,a)=>n.length-a.length),r=[];for(const n of e)r.some(i=>n!==i&&n.startsWith(i+"."))||r.push(n);return r},qi=t=>{let e="";if(t){let r=0;Object.keys(t).forEach(n=>{if(t[n]!==void 0&&t[n]!==null&&t[n]!==""){let a=t[n];typeof a=="object"?a=JSON.stringify(a):Array.isArray(a)&&(a=a.join(",")),a!=null&&a!==""&&(r===0?e+=`?${n}=${encodeURIComponent(a)}`:e+=`&${n}=${encodeURIComponent(a)}`,r+=1)}})}return e},$4=({shortcuts:t,variant:e="dark",className:r})=>{const a=nA()==="macos",i=x.useMemo(()=>t.map(s=>{const o=Fc[s];return o?a?o.macos:o.other:s}),[t,a]);return A.jsx("div",{className:B("flex flex-1 gap-1",r),children:i.map((s,o)=>A.jsx("kbd",{className:B("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:s},o))})},fI=({className:t="",fill:e="var(--color-primary-600)",size:r=24})=>A.jsx("svg",{className:t,width:r,height:r,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",children:A.jsx("g",{mask:"url(#mask0_6752_28309)",children:A.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})})}),Dr=({id:t,onClick:e,icon:r,text:n,className:a,isDisabled:i,onClose:s,notVisible:o,hideHoverEffect:l,leadingIcon:c,suffixRecord:u,stopPropagation:f,onToggle:p,isChecked:h=!1,highlight:m,truncateText:b=!1,showTick:v=!1,width:g="100%",tooltip:S,isFlowAvailable:E=!0,shortcuts:k,textClassName:w})=>{const T=x.useCallback(D=>{s&&s(),D.preventDefault(),e?.(D),f&&D.stopPropagation()},[s,e,f]),O=(D,P)=>{if(!P||!D||typeof D!="string"&&typeof D!="number")return D;const j=uI(P),z=new RegExp(`(${j?.trim()})`,"gi"),M=D?.toString()?.split(z);return A.jsxs("span",{className:"overflow-clip text-ellipsis",children:[M[0],A.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900 rounded-sm",children:M[1]}),M?.slice(2)?.join("")]})},C=x.useCallback(D=>{p?.(),D.stopPropagation()},[p]),_=["delete","remove","clear","terminate session","terminate sessions","terminate all sessions","trash"].some(P=>n?.toLowerCase().includes(P)),I=i||!E;if(o)return null;const N=!!(e||p),R=N?"button":"div";return A.jsx(R,{id:t,className:B("w-full p-1 bg-white dark:bg-black-800 group",a,I&&"opacity-60"),...N?{onClick:p?()=>null:T,disabled:I}:{},onMouseMove:D=>D.stopPropagation(),children:A.jsxs("div",{className:B("option-button-inner flex w-full justify-start items-center gap-2 px-2 py-1 rounded-lg transition-all duration-300 ease-in-out",!l&&"hover:bg-gray-50 dark:hover:bg-black-600 hover:shadow-md dark:hover:shadow-lg dark:hover:shadow-primary-500/20"),children:[r?A.jsx("div",{className:B("h-5 w-5 flex-shrink-0 flex items-center text-neutral-900 dark:text-white transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:A.jsx(je,{placement:"top",title:S,children:r})}):null,A.jsxs("div",{className:"flex gap-2 flex-1 min-w-0 text-left justify-between items-center",children:[A.jsx("div",{className:B("flex-1 min-w-0",b&&"max-w-[150px]"),style:{width:g},children:A.jsx(ee,{className:B("font-medium text-sm truncate transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:!text-primary-600 dark:group-hover:!text-primary-400",w),appearance:"custom",children:m?O(n,m):n})}),u?.[n]?A.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:u[n]||""}):null,v?A.jsx("div",{className:"flex-shrink-0",children:A.jsx(fI,{fill:"var(--color-primary-600)"})}):null]}),c?A.jsx(A.Fragment,{children:S?A.jsx(je,{placement:"top",title:S,children:A.jsx("div",{className:B("flex-shrink-0 transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):A.jsx("div",{className:B("flex-shrink-0 transition-colors duration-300 ease-in-out",_?"group-hover:!text-red-600":"group-hover:text-primary-600 dark:group-hover:text-primary-400"),children:c})}):null,k?A.jsx("div",{className:"flex items-center justify-end",children:A.jsx($4,{variant:"light",shortcuts:k})}):null,p?A.jsx("div",{className:"flex-shrink-0",children:A.jsx(Qn,{onChange:C,isChecked:h,isDisabled:i,hideStatus:!0})}):null]})})};Dr.displayName="OptionButton";const ko=(t,e)=>{const r=t.slice(0,2),n=tA[r];return n?A.jsx("div",{className:`
51
51
  w-5 h-5 rounded-full overflow-hidden border-[0.9px] flex items-center justify-center relative
52
52
  ${e?"border-neutral-100 dark:border-neutral-100":"border-neutral-400 dark:border-neutral-500"}
53
53
  `,children:A.jsx(n,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},pI=t=>{const e=t.slice(0,2),r=tA[e];return r?A.jsx("div",{className:"w-4 h-4 rounded-full overflow-hidden flex items-center justify-center relative",children:A.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},hI=t=>{const e=t.slice(0,2),r=tA[e];return r?A.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:A.jsx(r,{style:{width:"110%",height:"110%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},mI=t=>{const e=t.slice(0,2),r=tA[e];return r?A.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:A.jsx(r,{style:{width:"120%",height:"120%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},J4=t=>{const e=t.slice(0,2),r=tA[e];return r?A.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:A.jsx(r,{style:{width:"115%",height:"115%",transform:"translate(-50%, -50%)",position:"absolute",top:"50%",left:"50%"}})}):null},eE=x.forwardRef(({id:t,label:e,value:r,onChange:n,errorMessage:a,defaultValue:i,required:s=!1,isRequiredConditional:o=!1,tags:l,className:c,originalCase:u=!1,tooltip:f,simpleMode:p=!1,inputFieldClassName:h="",isAiExtracted:m=!1,isGTN:b=!1,gtnName:v=null,allowMultiCurrency:g=!1,placeholder:S,disabled:E=!1,currencyCode:k="USD",inputStyle:w,labelClassName:T,isLiveField:O=!1,onBlur:C,autoFocus:_=!1,isRecording:I=!1,isPlaying:N=!1,onAddGTNToDocument:R,riskDetails:D,isRiskAnalysisOpen:P=!1,RiskDetailsCard:j,...z},M)=>{const{t:L}=Kt.useTranslation(),[V,U]=x.useState(!1),[q,Q]=x.useState([]),[X,G]=x.useState(""),[Y,oe]=x.useState(k||"USD"),[ae,te]=x.useState(!1),ie=ne=>{R&&R({key:v,value:ne})},he=ne=>{if(ne==null)return"";const Ae=Number(ne);return isNaN(Ae)?ne:Ae?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},de=ne=>{const Ae=ne.target.value,Ee=Ae===""||Ae===null||Ae===void 0?0:Number(Ae);n(Ee,Y);const Ie=document.getElementById(t);if(Ie&&Ie.setAttribute("data-selected-value",JSON.stringify({value:Ee,currency_code:Y})),Ie&&(I||N)){const Xe=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:Ee,currency_code:Y},type:"change"}});Ie.dispatchEvent(Xe)}},ce=()=>{U(!0)},ue=()=>{U(!1),(r==null||r==="")&&de({target:{value:"0.00"}}),C?.()},K=()=>{const ne="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 focus:outline-none focus:ring-0 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]",Ae=a?"border-red-300":P&&D?.color?`border-${D.color}-300`:"border-gray-300 dark:border-black-600",Ee=`${P&&D?.color?`bg-${D.color}-50`:"bg-white dark:bg-black-600"}`;return`${ne} ${Ae} ${Ee} ${h}`};return x.useEffect(()=>{k&&oe(k)},[k]),x.useEffect(()=>{if(Y){const ne=r===""||r===null||r===void 0?0:Number(r);k!==Y&&n(ne,Y);const Ae=document.getElementById(t);if(Ae&&(Ae.setAttribute("data-selected-value",JSON.stringify({value:ne,currency_code:Y})),I||N)){const Ee=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:ne,currency_code:Y},type:"change"}});Ae.dispatchEvent(Ee)}}},[Y]),x.useEffect(()=>{const ne=K4.filter(Ae=>(Ae.value+" - "+Ae.label).toLowerCase().includes(X.toLowerCase())).map(Ae=>({label:A.jsx(Dr,{text:`${Ae.value} - ${Ae.label}`,icon:ko(Ae.value),showTick:Y===Ae.value,onClick:()=>oe(Ae.value),className:"text-black-900 dark:text-white"}),key:Ae.value}));Q(ne)},[X,Y]),x.useEffect(()=>{G("")},[Y]),p?A.jsxs("label",{id:t,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${u?"":"capitalize"} ${T||""}`,children:[A.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),A.jsx("input",{...z,ref:M,type:V?"number":"text",required:s,className:B(h,"pl-8 h-[32px]"),onChange:de,min:0,onFocus:ce,onBlur:ue,value:V?r:he(r),...i&&!r?{defaultValue:V?i:he(i)}:{},id:t||e,autoFocus:_})]}):A.jsxs("div",{className:B("flex gap-0.5 relative",ae&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>te(!0),onMouseLeave:()=>te(!1),children:[b&&!ae?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:B("w-full flex flex-col",c),children:[A.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${u?"":"uppercase"} ${T||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Zt,{label:e||"",required:s||!1,isRequiredConditional:o||!1}),O&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),m&&A.jsx(vn,{}),A.jsx(Zr,{labels:l}),f&&A.jsx(je,{placement:"top",title:f,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),b&&ae&&R?A.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ie(he(r)),type:"button",children:A.jsx(We.Tooltip,{placement:"top",title:L("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}),A.jsxs("label",{className:"relative block",children:[A.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:ub[Y]}),A.jsx("input",{...z,ref:M,placeholder:S,type:V?"number":"text",required:s,disabled:E,className:K(),onChange:de,min:0,onFocus:ce,onBlur:ue,value:V?r:he(r),defaultValue:V?i:he(i),id:t||e,style:w,autoComplete:"off",autoFocus:_}),A.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${g?"cursor-pointer":""}`,children:g?A.jsx(We.Dropdown,{menu:{items:[...q]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:ne=>ne.parentElement,popupRender:ne=>A.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:[A.jsx(db,{id:"search-bar-currency-input",value:X,onChange:Ae=>G(Ae),className:"mb-2"}),ne]}),children:A.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:[ko(Y)," ",Y]})}):Y})]}),a&&A.jsx(ee,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]}),ae&&D&&P&&j&&A.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:ne=>ne.stopPropagation(),onMouseDown:ne=>ne.preventDefault(),onKeyDown:ne=>{ne.key==="Escape"&&te(!1)},children:A.jsx(j,{riskDetails:D})})]})});eE.displayName="CurrencyInputField";const tE=x.forwardRef(({id:t,label:e,value:r,defaultValue:n,onChange:a,disabled:i=!1,required:s=!1,message:o,messageType:l="default",wrapperClassName:c,inputClassName:u,labelClassName:f,helpText:p,size:h="medium",minDate:m,maxDate:b,startPlaceholder:v="Start date",endPlaceholder:g="End date",allowClear:S=!0,inputProps:E},k)=>{const w=r!==void 0?r:n||{startDate:null,endDate:null},T=()=>{switch(h){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"}}},O=()=>l==="error"?"border-red-300 focus:border-red-500 focus:ring-red-200 dark:focus:ring-red-400/20":l==="success"?"border-green-300 focus:border-green-500 focus:ring-green-200 dark:focus:ring-green-400/20":l==="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",C=()=>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-neutral-500 dark:text-neutral-400",_=()=>{switch(h){case"small":return"extra-small";case"large":return"medium";default:return"small"}},I=M=>{if(!M)return"";const L=M.getFullYear(),V=String(M.getMonth()+1).padStart(2,"0"),U=String(M.getDate()).padStart(2,"0");return`${L}-${V}-${U}`},N=M=>{if(!M)return null;const L=new Date(M);return isNaN(L.getTime())?null:L},R=M=>{const L=N(M.target.value);a({startDate:L,endDate:w.endDate})},D=M=>{const L=N(M.target.value);a({startDate:w.startDate,endDate:L})},P=()=>{a({startDate:null,endDate:null})},j=M=>M?I(M):void 0,z=T();return A.jsxs("div",{className:B("flex flex-col w-full",c),ref:k,children:[e&&A.jsx("label",{htmlFor:`${t}-start`,className:B("mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",f),children:A.jsx("div",{className:"flex flex-wrap items-center justify-between w-full",children:A.jsx("div",{className:"inline-flex flex-wrap items-center gap-1",children:A.jsxs(ee,{variant:"medium",size:_(),appearance:"subtitle",children:[e,s&&A.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})})}),p&&A.jsx(ee,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:p}),A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("div",{className:"flex-1",children:A.jsx("input",{...E,id:`${t}-start`,type:"date",value:I(w.startDate),onChange:R,disabled:i,required:s,min:j(m),max:j(b),placeholder:v,className:B("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",z.height,z.padding,z.fontSize,O(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",u),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o||p?`${t}-description`:void 0})}),A.jsx("div",{className:"flex-shrink-0 text-neutral-500 dark:text-neutral-400",children:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})}),A.jsx("div",{className:"flex-1",children:A.jsx("input",{...E,id:`${t}-end`,type:"date",value:I(w.endDate),onChange:D,disabled:i,required:s,min:j(w.startDate||m),max:j(b),placeholder:g,className:B("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",z.height,z.padding,z.fontSize,O(),i&&"opacity-50 cursor-not-allowed bg-neutral-50 dark:bg-neutral-700",u),"aria-required":s,"aria-invalid":o&&l==="error"?"true":"false","aria-describedby":o||p?`${t}-description`:void 0})}),S&&(w.startDate||w.endDate)&&!i&&A.jsx("button",{type:"button",onClick:P,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:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),A.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:A.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.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"})})}),A.jsx(Be.AnimatePresence,{children:o&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${t}-description`,role:l==="error"?"alert":void 0,children:A.jsx(ee,{className:B("mt-1",C()),appearance:"custom",size:"extra-small",variant:"medium",children:o})})}),p&&!o&&A.jsx("div",{id:`${t}-description`,className:"sr-only",children:p})]})});tE.displayName="DateRange2";const{RangePicker:S3}=We.DatePicker,E3={ENTER:"Enter"},k3=()=>Math.random().toString(36).substring(2,9),gI=(t,e)=>{const r=x.useRef(e);x.useEffect(()=>{r.current=e},[e]),x.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},rE=({onCalendarChange:t=void 0,onChange:e,required:r,label:n,startDate:a,endDate:i,errorMessage:s,className:o,id:l,disabled:c=!1,dateFormat:u,shouldPopOnParent:f=!0,getPopupContainer:p,maxDateRange:h,open:m,onOpenChange:b,placement:v="bottomLeft",renderAsIconButton:g=!1,iconButtonClassName:S,iconClassName:E})=>{const[k,w]=x.useState(!1),[T,O]=x.useState(!1),C=x.useRef(null),_=x.useRef(null),I=x.useRef(!1),N=x.useRef(!1),R=U=>U?Ht(U):null,D=`date-range-start-${k3()}`,P=`date-range-end-${k3()}`,j=()=>{w(!0),setTimeout(()=>{C.current&&C.current.focus()},0)};gI("keydown",U=>{if(U.key===E3.ENTER&&document.activeElement instanceof HTMLInputElement){if(document?.activeElement?.id===D){const q=Ht(document?.activeElement?.value);q.isValid()&&e([q,R(i)])}if(document?.activeElement?.id===P){const q=Ht(document?.activeElement?.value);q.isValid()&&e([R(a),q])}}});const z=x.useCallback(U=>{const[q,Q]=[R(a),R(i)];return h?q?U.isBefore(q.startOf("day"))||U.isAfter(q.add(h,"day").endOf("day")):Q?U.isBefore(Q.subtract(h,"day").startOf("day"))||U.isAfter(Q.endOf("day")):!1:!1},[a,i,h]),M=x.useCallback(U=>{if(U.key===E3.ENTER&&!(g?k:m??T)){U.preventDefault(),U.stopPropagation();const Q=U.target.closest("form");if(Q){const X=Q.querySelector('button[type="submit"]');X?X.click():Q.requestSubmit()}}},[g,k,m,T]),L=x.useCallback(U=>{if(U&&I.current){I.current=!1,w(!1);return}w(U),U||(I.current=!0,requestAnimationFrame(()=>{C.current?.focus(),requestAnimationFrame(()=>{I.current=!1})}))},[]),V=x.useCallback(U=>{if(U&&N.current){N.current=!1,O(!1),b?.(!1);return}O(U),b?.(U),U||(N.current=!0,requestAnimationFrame(()=>{_.current?.focus(),requestAnimationFrame(()=>{N.current=!1})}))},[b]);return g?A.jsxs("div",{id:l,className:o,onKeyDownCapture:M,children:[A.jsx(ur,{onClick:j,disabled:c,variant:"default",className:S,children:A.jsx(ro.BiCalendar,{className:B("w-5 h-5",E)})}),A.jsx(S3,{ref:C,onChange:U=>{e(U),w(!1)},onCalendarChange:t,value:[R(a),R(i)],id:{start:D,end:P},allowClear:!0,format:u||"DD MMM, YYYY",separator:A.jsx(Mn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:A.jsx(ro.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:p||(f?U=>U.parentElement:()=>document.body),disabled:c,disabledDate:h?z:void 0,autoComplete:"off",open:k,onOpenChange:L,placement:v,style:{position:"absolute",opacity:0,pointerEvents:"none",width:0,height:0}})]}):A.jsxs("div",{id:l,className:B("flex flex-col",o),onKeyDownCapture:M,children:[A.jsx(Zt,{label:n||"",required:r||!1}),A.jsx(S3,{ref:_,onChange:e,onCalendarChange:t,value:[R(a),R(i)],id:{start:D,end:P},allowClear:!0,format:u||"DD MMM, YYYY",separator:A.jsx(Mn.BsDash,{className:"dark:text-gray-100"}),suffixIcon:A.jsx(ro.BiCalendar,{className:"dark:text-gray-100"}),getPopupContainer:p||(f?U=>U.parentElement:()=>document.body),disabled:c,disabledDate:h?z:void 0,open:m??T,onOpenChange:V,autoComplete:"off",placement:v}),s&&A.jsx("p",{className:B("text-sm font-inter font-normal text-left pt-[6px]","text-red-500"),children:s})]})};rE.displayName="DateRange";Ht.extend(vN);Ht.extend(xN);Ht.extend(SN);Ht.extend(yN);const nE="MM/DD/YYYY",Sl="MM/DD/YYYY - hh:mm A",w3="YYYY-MM-DD",T3="YYYY-MM-DDTHH:mm:ss",C3={ENTER:"Enter"},aE=["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"],bI=["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",...aE,"YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ssZ"],xI=()=>Math.random().toString(36).substring(2,9),Ms=(t,e=!1)=>{if(!t)return null;const r=e?bI:aE;for(const a of r){const i=Ht(t,a,!0);if(i.isValid())return i}const n=Ht(t);return n.isValid()?n:null},O3=(t,e)=>{const r=x.useRef(e);x.useEffect(()=>{r.current=e},[e]),x.useEffect(()=>{const n=a=>r.current(a);return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[t])},fb=x.forwardRef(({label:t,value:e,required:r,isRequiredConditional:n=!1,disabled:a,className:i=void 0,errorMessage:s,handleOnChange:o,showTime:l=!0,tags:c,needConfirm:u=!1,simpleMode:f,originalCase:p=!1,dateFormat:h=void 0,tooltip:m,isAiExtracted:b=!1,isGTN:v=!1,gtnName:g=null,shouldPopOnParent:S=!1,allowTimezoneConversion:E=!0,inputStyle:k,labelClassName:w,isLiveField:T=!1,riskDetails:O,isRiskAnalysisOpen:C=!1,RiskDetailsCard:_,onAddGTNToDocument:I,formatDateForGTN:N,...R},D)=>{const{t:P}=Kt.useTranslation(),[j,z]=x.useState(!1),[M,L]=x.useState(null),[V,U]=x.useState(null),[q,Q]=x.useState(!1),X=h||(l?Sl:nE),G=R?.id||`date-picker-${xI()}`,Y=x.useRef(null),oe=x.useRef(!1);O3("paste",K=>{document.activeElement?.id===G&&(K.preventDefault(),navigator.clipboard.readText().then(ne=>{const Ae=Ms(ne,l);Ae&&de(Ae)}))}),O3("keydown",K=>{if(K.key===C3.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===G){const ne=Ms(document?.activeElement?.value,l);ne&&de(ne)}});const ae=x.useCallback(K=>{if(!I)return;let ne=K||"";if(N&&K)ne=N(K,{skipTimezone:!0,withTime:l});else if(K){const Ee=Ht(K);Ee.isValid()&&(ne=Ee.format(X))}I({key:g,value:ne})},[I,g,N,l,X]),te=x.useCallback(()=>{const K=document.getElementsByClassName("ant-picker-footer")[0];K&&(K.style.display="none")},[]),ie=x.useCallback(K=>{if(!E){const ne=l?T3:w3;if(o(K?K.format(ne):null),K){const Ae=document.getElementById(G);if(Ae){const Ee=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${G}`,value:K.format?K.format(X):K,type:"date-change",elementId:G}});Ae.dispatchEvent(Ee)}}return}if(K){let ne;if(l?ne=Ht(K).utc().toISOString():ne=Ht(K).utc().add(Ht(K).utcOffset(),"minute").startOf("day").toISOString(),ne){o(ne);const Ae=document.getElementById(G);if(Ae){const Ee=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${G}`,value:K.format(X),type:"date-change",elementId:G}});Ae.dispatchEvent(Ee)}}}else o(null)},[E,o,l,G,X]),he=x.useCallback(K=>{if(!K)return null;if(!E)try{const ne=Ht(K);if(ne.isValid())return ne;const Ae=Ht(K,X);return Ae.isValid()?Ae:null}catch{return null}if(l){const ne=Ht(K);return Ht(ne).isValid()?ne:null}else if(K?.toString()?.includes("Z")){const ne=Ht.utc(K);return Ht(ne).isValid()?ne:null}else{const ne=Ht(K);return Ht(ne).isValid()?ne:null}},[E,X,l]),de=x.useCallback(K=>{if(K?.isValid()||K===null){L(K);const ne=l?T3:w3,Ae=E?K?.toISOString():K?K.format(ne):"";if(o(Ae||null),K?.isValid()){const Ee=document.getElementById(G);if(Ee){const Ie=new CustomEvent("pilot-date-change",{bubbles:!0,detail:{selector:`#${G}`,value:K.format(X),type:"date-change",elementId:G}});Ee.dispatchEvent(Ie)}}}},[E,X,o,G,l]);x.useEffect(()=>{L(he(e))},[e,he]),x.useEffect(()=>{V&&U(null)},[V]),x.useEffect(()=>{const K=document.getElementById(G);if(!K)return;const ne=Ae=>{const{value:Ee,type:Ie}=Ae.detail;if(Ie==="date-playback"&&Ee){const Xe=Ms(Ee,l);Xe&&Xe.isValid()&&(L(Xe),ie(Xe),setTimeout(()=>{const De=K.querySelector("input");if(De&&(De.focus(),setTimeout(()=>{De.blur()},10)),Y.current)try{const Qe=Y.current;typeof Qe.blur=="function"&&Qe.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(at=>{at instanceof HTMLElement&&(at.style.display="none",at.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return K.addEventListener("pilot-date-playback",ne),()=>{K.removeEventListener("pilot-date-playback",ne)}},[G,X,ie,l]);const ce=x.useCallback(K=>{if(K.key===C3.ENTER&&!q){K.preventDefault(),K.stopPropagation();const ne=K.target.closest("form");if(ne){const Ae=ne.querySelector('button[type="submit"]');Ae?Ae.click():ne.requestSubmit()}}},[q]),ue=x.useCallback(K=>{if(K&&oe.current){oe.current=!1,Q(!1);return}Q(K),K||(oe.current=!0,requestAnimationFrame(()=>{Y.current?.focus(),requestAnimationFrame(()=>{oe.current=!1})}))},[]);return f?A.jsx("div",{onKeyDownCapture:ce,children:A.jsx(We.DatePicker,{...R,showTime:l,open:q,format:X,placeholder:X===Sl?"MM/DD/YYYY hh:mm":X,value:M,needConfirm:!1,onChange:K=>{L(K),ie(K),U(K?.toISOString()||null)},className:i,showNow:!1,onFocus:te,onOpenChange:ue,onBlur:K=>{const ne=K.target.value;if(ne){const Ae=Ms(ne,l);Ae&&de(Ae)}},ref:Y,disabled:a,id:G})}):A.jsxs("div",{ref:D,className:B("flex gap-0.5 relative",j&&v?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[v&&!j?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:`w-full flex flex-col font-inter ${i||""}`,onKeyDownCapture:ce,children:[t?A.jsx("label",{className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${p?"":"capitalize"} ${w||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Zt,{label:t||"",required:r||!1,isRequiredConditional:n||!1}),T&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),b&&A.jsx(vn,{}),A.jsx(Zr,{labels:c}),m&&A.jsx(je,{placement:"top",title:m,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),v&&j&&I?A.jsx("button",{id:"btn-date-field-add-to-document",className:"cursor-pointer",onClick:()=>ae(e),type:"button",children:A.jsx(We.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(We.DatePicker,{...R,showTime:l?{use12Hours:!0}:!1,open:q,format:X,placeholder:X===Sl?"MM/DD/YYYY - HH:MM":X,className:`w-full h-8 text-inter font-medium ${s?"border-red-400":""} dark:text-black-300 ${C&&O?.color&&`bg-${O.color}-50 border-${O.color}-300`}`,styles:{root:{...k,borderRadius:"7px"}},showNow:!1,value:M,onChange:K=>{L(K),ie(K),U(K?.toISOString()||null)},onBlur:K=>{const ne=K.target.value;if(ne){const Ae=Ms(ne,l);Ae&&(L(Ae),ie(Ae))}},needConfirm:u,ref:Y,disabled:a,inputReadOnly:!1,onOpenChange:ue,getPopupContainer:S?K=>K.parentElement:()=>document.body,id:G,autoComplete:"off"}),s&&A.jsx(ee,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:s})]}),j&&O&&C&&_&&A.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:K=>K.stopPropagation(),onMouseDown:K=>K.preventDefault(),onKeyDown:K=>{K.key==="Escape"&&z(!1)},children:A.jsx(_,{riskDetails:O})})]})});fb.displayName="DateTimeField";const iE=({id:t,label:e,onChange:r,errorMessage:n,required:a,bg:i,tags:s,color:o,debounceTimeout:l=0,className:c,isDarkMode:u,...f})=>{const{inputRef:p,...h}=f;return A.jsxs("div",{className:B("flex flex-col",c),children:[e&&A.jsxs("label",{htmlFor:t,className:"block mb-1 text-xs font-medium leading-[18px] text-neutral-600 dark:text-black-300 font-inter capitalize",children:[A.jsx(Zt,{label:e||"",required:a||!1}),A.jsx(Zr,{labels:s})]}),A.jsx("label",{className:"relative block h-8",children:x.createElement(rb.DebounceInput,{...h,debounceTimeout:l,id:t,key:t,required:a,className:B("border",n?"!border-error-300":"border-neutral-200 dark:border-black-600",i,o,"dark:bg-black-700 text-neutral-900 dark:text-neutral-100 text-[14px] rounded-md","focus:outline-none focus:ring-0","focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)]","focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]","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:m=>{r(m.target.value)},autoComplete:"off"})}),A.jsx(Be.AnimatePresence,{children:n&&A.jsx(Be.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.15},children:A.jsx(ee,{className:"pt-1 text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})})})]})};iE.displayName="DebounceInputField";const sE=x.forwardRef(({id:t,label:e,placeholder:r,value:n,onChange:a,errorMessage:i,defaultValue:s,required:o=!1,isRequiredConditional:l=!1,dataSource:c,dataKey:u,tags:f,tooltip:p="",originalCase:h=!1,color:m="",isGTN:b=!1,gtnName:v,isAiExtracted:g=!1,labelClassName:S,disabled:E=!1,isLiveField:k=!1,onAddGTNToDocument:w,riskDetails:T,isRiskAnalysisOpen:O=!1,RiskDetailsCard:C,primaryColorShades:_,isRecording:I=!1,isPlaying:N=!1,setDisableActions:R,showDeprecatedFieldWarning:D,DynamicDataModal:P},j)=>{const{t:z}=Kt.useTranslation(),[M,L]=x.useState(!1),[V,U]=x.useState(n),[q,Q]=x.useState(!1),X=x.useRef(null),G=j||X,Y=()=>{R?.(!q),Q(!q)},oe=he=>{if(he.keyCode===9||he.key==="Enter"){const de=G.current||X.current;de&&(V!==null&&a(V),U(V),de.blur())}},ae=()=>{U(""),a("")},te=he=>{w&&v&&w({key:v,value:he})},ie=()=>{const he="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",de=i?"border-red-300":O&&T?.color?`border-${T?.color}-300`:"border-gray-300 dark:border-black-600",ce="placeholder:text-neutral-900 dark:placeholder:text-black-400",ue=`${O&&T?.color?`bg-${T?.color}-50`:"bg-gray-200 dark:bg-black-600 "} ${m||"text-neutral-900 dark:text-black-200"}`;return`${he} ${de} ${ue} ${ce}`};return x.useEffect(()=>{q&&!c&&(D?.(),Q(!1))},[q,c,D]),x.useEffect(()=>{U(n)},[n]),A.jsxs("div",{className:B("flex gap-0.5 w-full relative",M&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",{"error-field":!!i}),onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),children:[b&&!M?A.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,A.jsxs("div",{className:B("flex flex-col w-full"),children:[A.jsx("label",{htmlFor:"text",className:`text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${h?"":"capitalize"} ${S||""}`,children:A.jsxs("div",{className:"w-full flex items-center justify-between flex-wrap",children:[A.jsxs("div",{className:"inline-flex items-center gap-1 flex-wrap",children:[A.jsx(Zt,{label:e||"",required:o||!1,isRequiredConditional:l||!1}),k&&A.jsx(be.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),g&&A.jsx(vn,{}),A.jsx(Zr,{labels:f}),p&&A.jsx(je,{placement:"top",title:p,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),b&&M&&w?A.jsx("button",{id:"btn-dynamic-data-input-add-to-document",className:"cursor-pointer",onClick:()=>te(n?.toString()||""),type:"button",children:A.jsx(We.Tooltip,{placement:"top",title:z("Add to document"),children:A.jsx(be.NoteAddOutlined,{sx:{fontSize:16,color:_?.[600]||"var(--color-primary-600)"}})})}):null]})}),A.jsxs("label",{className:"relative block mt-1",children:[A.jsx("input",{id:t,ref:G,required:o,placeholder:r,className:ie(),onChange:he=>{a(he.target.value),U(he.target?.value)},onKeyDown:oe,value:V!==null?V:n,defaultValue:s,disabled:!0}),A.jsx(ur,{id:"btn-dynamic-data-input-rx-cross",onClick:ae,className:"absolute inset-y-0 right-1 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:E,children:A.jsx(be.CloseRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})}),A.jsx(ur,{id:"btn-dynamic-data-input-ai-outline-pic-center",onClick:Y,className:"absolute inset-y-0 right-8 flex items-center px-2 focus:border-transparent",variant:"ghost",disabled:E,children:A.jsx(be.TableChartRounded,{className:"text-neutral-900 dark:text-black-300",sx:{fontSize:16}})})]}),i&&A.jsx(ee,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i}),q&&P&&A.jsx(P,{isVisible:q,onSelect:he=>{a(he),U(he)},onClose:Y,dataKey:u,dataSource:c})]}),M&&T&&O&&C&&A.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:he=>he.stopPropagation(),onMouseDown:he=>he.preventDefault(),onKeyDown:he=>{he.key==="Escape"&&L(!1)},children:A.jsx(C,{riskDetails:T})})]})});sE.displayName="DynamicDataInputField";const Tt=x.forwardRef(({status:t="primary",appearance:e,className:r,disabled:n,children:a,isLoading:i,title:s,id:o,onClick:l,onKeyDown:c,badge:u,type:f="button",options:p,tooltip:h,tooltipPlacement:m="top",shortcuts:b,tooltipShortcuts:v,theme:g="light",autoFocus:S},E)=>{const k=x.useCallback(()=>{switch(e){case"outline":return T();case"ghost":return O();case"dashed":return C();default:return w()}},[e,t,n,g]),w=x.useCallback(()=>{switch(t){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"}},[t,n,g]),T=x.useCallback(()=>{switch(t){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"}},[t,g]),O=x.useCallback(()=>{switch(t){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"}},[t,g]),C=x.useCallback(()=>{switch(t){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 [background-repeat:no-repeat] [background-size:1px_100%,100%_1px,1px_100%,100%_1px] [background-position:0_0,0_0,100%_0,0_100%] [background-image:repeating-linear-gradient(3deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(93deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(183deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(273deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px)] dark:[background-image:repeating-linear-gradient(3deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(93deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(183deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(273deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px)]";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 [background-repeat:no-repeat] [background-size:1px_100%,100%_1px,1px_100%,100%_1px] [background-position:0_0,0_0,100%_0,0_100%] [background-image:repeating-linear-gradient(3deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(93deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(183deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px),repeating-linear-gradient(273deg,var(--color-primary-600),var(--color-primary-600)_10px,transparent_10px,transparent_19px,var(--color-primary-600)_19px)] dark:[background-image:repeating-linear-gradient(3deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(93deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(183deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px),repeating-linear-gradient(273deg,var(--color-primary-500),var(--color-primary-500)_10px,transparent_10px,transparent_19px,var(--color-primary-500)_19px)]"}},[t,g]),_=x.useCallback(()=>{if(!e||e==="filled")switch(t){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(t){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"}},[t,e]),I=nA(),N=x.useMemo(()=>b?.length?b.map(P=>{const j=Fc[P];return j?I==="macos"?j.macos:j.other:P}):[],[b,I]),R=()=>A.jsx(A.Fragment,{children:A.jsx(Ra.CgSpinner,{size:24,className:"inline mr-2 spinner"})}),D=f||(t==="primary"&&e==="filled"?"submit":f);return A.jsx(je,{title:h,placement:m,shortcuts:v,delayShow:!0,children:A.jsxs("button",{ref:E,className:`