@lax-wp/design-system 0.10.10 → 0.10.12
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 +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7 -6
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
-webkit-text-fill-color: white !important;
|
|
18
18
|
-webkit-box-shadow: 0 0 0px 1000px var(--input-bg-color) inset !important;
|
|
19
19
|
}
|
|
20
|
-
`}),f?A.jsx("label",{htmlFor:_,className:"mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",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.jsx(Zt,{label:f||"",required:u||!1})})})}):null,A.jsxs("div",{className:"relative input-field",children:[A.jsx("input",{...S,ref:E,id:_,type:p,value:e,defaultValue:s,placeholder:h,required:u,disabled:o,max:l,min:c,onKeyDown:n,style:I(),className:B("border border-solid h-8 rounded-md block w-full pl-3","text-sm font-medium text-neutral-900 dark:text-black-100","bg-white dark:bg-black-600","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2",O(),o&&"opacity-70 cursor-not-allowed bg-neutral-50 dark:bg-black-700",v),onChange:N=>r(N.target.value),onClick:N=>N.stopPropagation()}),m&&A.jsx("div",{ref:k,className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:m})]}),A.jsx(ze.AnimatePresence,{children:a&&A.jsx(ze.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:A.jsx(ee,{className:B("mt-1",C()),appearance:"custom",size:"extra-small",variant:"medium",children:a})})})]})});ob.displayName="InputField";const Kr=({size:t=16,className:e="",...r})=>A.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`text-neutral-500 hover:text-neutral-700 ${e}`,...r,children:[A.jsx("circle",{cx:"12",cy:"12",r:"10"}),A.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),A.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),B4=x.forwardRef(({size:t=24,fill:e="currentColor",className:r,...n},a)=>A.jsx("svg",{ref:a,className:B(r),width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",...n,children:A.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z",fill:"currentColor"})}));B4.displayName="CloseIcon";const wa={primary:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#001c35",975:"#00111f"},black:{50:"#f0f0f0",100:"#d9d9d9",200:"#bfbfbf",300:"#8c8c8c",400:"#595959",500:"#454545",600:"#262626",700:"#1f1f1f",800:"#141414",900:"#000000",950:"#0a0a0a",975:"#050505"},blue:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#002547",975:"#001529"},success:{50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31",950:"#033625",975:"#022419"},neutral:{50:"#F9FAFB",100:"#F2F4F7",200:"#EAECF0",300:"#D0D5DD",400:"#98A2B3",500:"#667085",600:"#475467",700:"#344054",800:"#1D2939",900:"#101828",950:"#0c1219",975:"#080a0f"},error:{50:"#FEF3F2",100:"#FEE4E2",200:"#FECDCA",300:"#FDA29B",400:"#F97066",500:"#F04438",600:"#D92D20",700:"#B42318",800:"#912018",900:"#7A271A",950:"#3d1008",975:"#2a0b05"},warning:{50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E",950:"#662505",975:"#451803"},teal:{50:"#ebf5f5",100:"#c2e0df",200:"#a4d1d0",300:"#7abcba",400:"#61afad",500:"#399b98",600:"#348d8a",700:"#286e6c",800:"#1f5554",900:"#184140",950:"#133534",975:"#0c2222"},green:{50:"#f2f7f2",100:"#d5e5d5",200:"#c1d9c1",300:"#a5c7a5",400:"#94bd93",500:"#79ac78",600:"#6e9d6d",700:"#567a55",800:"#435f42",900:"#334832",950:"#001e00",975:"#182818"},yellow:{50:"#fffaed",100:"#fff0c7",200:"#ffe8ac",300:"#ffde86",400:"#ffd76f",500:"#ffcd4b",600:"#e8bb44",700:"#b59235",800:"#8c7129",900:"#6b5620",950:"#524314",975:"#382e0e"},orange:{50:"#fef4e8",100:"#fddeb7",200:"#fcce94",300:"#fbb764",400:"#faa945",500:"#f99417",600:"#e38715",700:"#b16910",800:"#89510d",900:"#693e0a",950:"#4d2d07",975:"#331e05"},peach:{50:"#fceef3",100:"#f5cad9",200:"#f0b0c6",300:"#ea8cad",400:"#e5759d",500:"#df5384",600:"#cb4c78",700:"#9e3b5e",800:"#7b2e49",900:"#5e2337",950:"#451a2b",975:"#2e111d"},red:{50:"#fceaeb",100:"#f6bec0",200:"#f29ea2",300:"#ec7278",400:"#e9575d",500:"#e32d35",600:"#cf2930",700:"#a12026",800:"#7d191d",900:"#5f1316",950:"#470c0f",975:"#2f080a"},purple:{50:"#f5e7ff",100:"#dfb4ff",200:"#d090ff",300:"#bb5dff",400:"#ad3dff",500:"#990dff",600:"#8b0ce8",700:"#6d09b5",800:"#54078c",900:"#40056b",950:"#300450",975:"#200336"},navy:{50:"#eaebf6",100:"#bebfe2",200:"#9ea1d3",300:"#7276bf",400:"#575bb3",500:"#2d32a0",600:"#292e92",700:"#202472",800:"#191c58",900:"#131543",950:"#0d0e2f",975:"#090a20"},grey:{50:"#f2f2f2",100:"#d5d5d5",200:"#c1c1c1",300:"#a5a5a5",400:"#939393",500:"#787878",600:"#6d6d6d",700:"#555555",800:"#424242",900:"#323232",950:"#252525",975:"#191919"}},FN=t=>{let e=0;for(let a=0;a<t.length;a++)e=t.charCodeAt(a)+((e<<5)-e);const r=(e&16777215).toString(16).toUpperCase();return`#${"00000".substring(0,6-r.length)+r}`},Fu=(t,e=80)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.min(255,r+(255-r)*(e/100)),n=Math.min(255,n+(255-n)*(e/100)),a=Math.min(255,a+(255-a)*(e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},v3=(t,e=30)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.max(0,r*(1-e/100)),n=Math.max(0,n*(1-e/100)),a=Math.max(0,a*(1-e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},UN=(t,e)=>({background:e?wa[t]?.[975]:wa[t]?.[50],borderColor:e?wa[t]?.[900]:wa[t]?.[100],color:e?wa[t]?.[500]:wa[t]?.[600]}),zN=(t,e)=>{const r=t.startsWith("#")?t:FN(t);return{background:e?v3(r,80):Fu(r,90),borderColor:e?v3(r,40):Fu(r,50),color:e?Fu(r,40):r}},BN=t=>({background:t?"#2D3748":"#F7FAFC",borderColor:t?"#4A5568":"#E2E8F0",color:t?"#A0AEC0":"#4A5568"}),qN=t=>{switch(t){case"xs":return"text-xs px-1 py-0.5";case"lg":return"text-sm px-2.5 py-1.5";case"md":return"text-sm px-2 py-1";default:return"text-xs px-1.5 py-0.5"}},VN=(t,e,r,n)=>t?r?e.color:wa[t]?.[500]||e.color:n?"#A0AEC0":"#4A5568",vr=x.forwardRef(({label:t,color:e,size:r="sm",className:n,onClick:a,onMouseDown:i,truncate:s,isHashColor:o=!1,icon:l,removable:c=!1,onRemove:u,onUpload:f,acceptsUpload:p=!1,"aria-label":h},m)=>{const v=x.useMemo(()=>typeof window>"u"?"light":localStorage.getItem("vite-ui-theme")||"light",[])==="dark",g=()=>e?e in wa?UN(e,v):zN(e,v):BN(v),S=w=>{const T=w.target.files?.[0];T&&f&&f(T),w.target.value=""},E=g(),k=VN(e,E,o,v);return A.jsx("div",{ref:m,className:B("inline-flex items-center border rounded-md transition-colors bg-primary-50 border-primary-100 text-primary-600 dark:bg-primary-900 dark:border-primary-800 dark:text-primary-400",qN(r),(a||p)&&"cursor-pointer hover:opacity-80",n),style:{maxWidth:"100%"},onMouseDown:i,onClick:a,"aria-label":h||`Tag: ${t}`,role:"button",tabIndex:a||p?0:void 0,children:A.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-hidden",style:{maxWidth:"100%"},children:[l,s?A.jsx("p",{title:t,className:`text-${r} ${a||p?"cursor-pointer":""} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t.length>s?`${t.slice(0,s)}...`:t}):A.jsx("p",{className:`text-${r} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t}),p&&A.jsx("input",{type:"file",onChange:S,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`}),c&&u&&A.jsx("button",{onClick:u,className:"ml-1 flex-shrink-0","aria-label":`Remove ${t}`,type:"button",children:A.jsx(B4,{size:12,fill:k,className:"cursor-pointer text-primary-600 dark:text-primary-400"})})]})})});vr.displayName="Tag";const Zr=({labels:t=[]})=>{const e=[],r=[];return t.forEach(n=>{typeof n=="string"&&!e.includes(n)?e.push(n):typeof n!="string"&&!r.some(a=>a.label===n.label)&&r.push(n)}),A.jsxs(A.Fragment,{children:[e?.map(n=>A.jsx(vr,{size:"xs",label:n,color:"primary"},n)),r?.map((n,a)=>A.jsx(vr,{size:"xs",label:n?.label,color:n?.color},n?.id||a))]})},rA=()=>{if(typeof window>"u"||typeof navigator>"u")return"other";const t=navigator.platform?.toLowerCase()||"",e=navigator.userAgent?.toLowerCase()||"";return t.includes("mac")||e.includes("mac")?"macos":t.includes("win")||e.includes("win")?"windows":t.includes("linux")||e.includes("linux")?"linux":"other"},nA=()=>x.useMemo(()=>rA(),[]),WN=()=>rA()==="macos",Fc={Meta:{macos:"⌘",other:"Ctrl"},Alt:{macos:"⌥",other:"Alt"},Shift:{macos:"⇧",other:"Shift"},Control:{macos:"⌃",other:"Ctrl"},Enter:{macos:"↵",other:"Enter"},Delete:{macos:"⌫",other:"Delete"},ArrowUp:{macos:"↑",other:"↑"},ArrowDown:{macos:"↓",other:"↓"},ArrowLeft:{macos:"←",other:"←"},ArrowRight:{macos:"→",other:"→"}},q4=(t,e)=>{const r=e??rA(),n=Fc[t];return n?r==="macos"?n.macos:n.other:t},Ab=(t,e)=>{const r=e??rA();return t.map(n=>q4(n,r))},XN=t=>{const e=nA();return x.useMemo(()=>Ab(t,e),[t,e])},QN={auto:"top","auto-start":"topLeft","auto-end":"topRight",top:"top","top-start":"topLeft","top-end":"topRight",bottom:"bottom","bottom-start":"bottomLeft","bottom-end":"bottomRight",right:"right","right-start":"rightTop","right-end":"rightBottom",left:"left","left-start":"leftTop","left-end":"leftBottom"},He=({children:t,title:e,hideTooltip:r=!1,delayShow:n=!1,whiteSpace:a="initial",placement:i="top",className:s,shortcuts:o,open:l,onOpenChange:c})=>{const u=nA(),f=x.useMemo(()=>o?Ab(o,u):void 0,[o,u]),p=QN[i],h=x.useMemo(()=>{if(!f)return[];const v={};return f.map(g=>(v[g]=(v[g]??0)+1,{id:`${g}-${v[g]}`,label:g}))},[f]),m=A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"flex-1 min-w-0",children:e}),h.length>0&&A.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:h.map(v=>A.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none",style:{backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",color:"rgba(255, 255, 255, 0.8)"},children:v.label},v.id))})]}),b=A.jsx("span",{className:s,children:t});return r?b:A.jsx(Xe.Tooltip,{title:e?m:null,placement:p,trigger:["hover"],mouseEnterDelay:n?1:0,mouseLeaveDelay:0,color:"#101828",open:l,onOpenChange:c,classNames:{body:"lax-tooltip-body-important-whitespace"},styles:{body:{"--lax-tooltip-white-space":a,borderRadius:8,border:"1px solid #252525",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.18)",color:"#fff",maxWidth:"40ch",fontSize:12,fontWeight:500,wordWrap:"break-word",padding:"4px 8px"}},children:b})},GN=({size:t=24,fill:e="currentColor",fillSecondary:r="white"})=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("path",{d:"M17.5128 13.6276L13.7184 11.9717C12.8016 11.5708 12.0696 10.8389 11.6688 9.92205L10.0128 6.12765C9.88322 5.83245 9.46802 5.83245 9.33842 6.12765L7.68242 9.92205C7.28162 10.8389 6.54962 11.5708 5.63282 11.9717L1.83122 13.63C1.53842 13.7572 1.53602 14.1748 1.83122 14.3044L5.69762 16.0132C6.61202 16.4188 7.34162 17.1532 7.73762 18.0724L9.34082 21.7948C9.46802 22.09 9.88802 22.0924 10.0152 21.7948L11.6688 18.0052C12.0696 17.0884 12.8016 16.3565 13.7184 15.9557L17.5128 14.2997C17.808 14.17 17.808 13.7548 17.5128 13.6252V13.6276Z",fill:e}),A.jsx("path",{d:"M22.2624 6.43876L20.0688 5.48116C19.5384 5.25076 19.116 4.82596 18.8856 4.29796L17.928 2.10436C17.8536 1.93396 17.6136 1.93396 17.5392 2.10436L16.5816 4.29796C16.3512 4.82836 15.9264 5.25076 15.3984 5.48116L13.2024 6.43876C13.032 6.51316 13.032 6.75316 13.2024 6.82756L15.4368 7.81636C15.9648 8.04916 16.3872 8.47636 16.6152 9.00676L17.5416 11.1572C17.616 11.3276 17.8584 11.3276 17.9328 11.1572L18.888 8.96836C19.1184 8.43796 19.5432 8.01556 20.0712 7.78516L22.2648 6.82756C22.4352 6.75316 22.4352 6.51316 22.2648 6.43876H22.2624Z",fill:e})]}),vn=({position:t="top",title:e="AI Extracted Field"})=>A.jsx(He,{placement:t,title:e,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(GN,{size:12,fill:"#016DCF",fillSecondary:"#54A4EC"})})}),YN=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),A.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),KN=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),A.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),ZN=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),A.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),$N=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),A.jsx("path",{d:"M3 3v5h5"})]}),Ha=x.forwardRef(({id:t,label:e,onChange:r,errorMessage:n,successMessage:a,required:i,isRequiredConditional:s=!1,bg:o,tags:l,color:c,className:u,isPasswordField:f,setIsPasswordVisible:p,inputRef:h,tooltip:m,suffixIcon:b,revertBackValue:v,originalCase:g=!1,textSize:S,isAiExtracted:E=!1,isGTN:k=!1,gtnName:w=null,inputClassName:T="",inputStyle:O={},labelClassName:C,onBlur:_,isLiveField:I=!1,isClearable:N=!1,riskDetails:R,isRiskAnalysisOpen:D=!1,RiskDetailsCard:P,onAddGTNToDocument:j,...z},M)=>{const{t:L}=Kt.useTranslation(),[V,U]=x.useState(!1),[q,Q]=x.useState(!1),X=G=>{j&&j({key:w,value:G})};return A.jsxs("div",{className:B("flex gap-0.5 relative",q&&k?"border rounded-lg border-primary-100 bg-primary-50 p-1 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-neutral-50 dark:focus:border-neutral-50":""),onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),children:[k&&!q?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",u),children:[A.jsx("style",{children:`
|
|
20
|
+
`}),f?A.jsx("label",{htmlFor:_,className:"mb-1 text-xs font-medium text-gray-600 dark:text-gray-300 inline-flex items-center gap-1",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.jsx(Zt,{label:f||"",required:u||!1})})})}):null,A.jsxs("div",{className:"relative input-field",children:[A.jsx("input",{...S,ref:E,id:_,type:p,value:e,defaultValue:s,placeholder:h,required:u,disabled:o,max:l,min:c,onKeyDown:n,style:I(),className:B("border border-solid h-8 rounded-md block w-full pl-3","text-sm font-medium text-neutral-900 dark:text-black-100","bg-white dark:bg-black-600","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2",O(),o&&"opacity-70 cursor-not-allowed bg-neutral-50 dark:bg-black-700",v),onChange:N=>r(N.target.value),onClick:N=>N.stopPropagation()}),m&&A.jsx("div",{ref:k,className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:m})]}),A.jsx(ze.AnimatePresence,{children:a&&A.jsx(ze.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:A.jsx(ee,{className:B("mt-1",C()),appearance:"custom",size:"extra-small",variant:"medium",children:a})})})]})});ob.displayName="InputField";const Kr=({size:t=16,className:e="",...r})=>A.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`text-neutral-500 hover:text-neutral-700 ${e}`,...r,children:[A.jsx("circle",{cx:"12",cy:"12",r:"10"}),A.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),A.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),B4=x.forwardRef(({size:t=24,fill:e="currentColor",className:r,...n},a)=>A.jsx("svg",{ref:a,className:B(r),width:t,height:t,viewBox:"0 0 20 20",fill:e,xmlns:"http://www.w3.org/2000/svg",...n,children:A.jsx("path",{d:"M10.0002 11.1666L5.91683 15.2499C5.76405 15.4027 5.56961 15.4791 5.3335 15.4791C5.09739 15.4791 4.90294 15.4027 4.75016 15.2499C4.59738 15.0971 4.521 14.9027 4.521 14.6666C4.521 14.4305 4.59738 14.236 4.75016 14.0833L8.8335 9.99992L4.75016 5.91659C4.59738 5.76381 4.521 5.56936 4.521 5.33325C4.521 5.09714 4.59738 4.9027 4.75016 4.74992C4.90294 4.59714 5.09739 4.52075 5.3335 4.52075C5.56961 4.52075 5.76405 4.59714 5.91683 4.74992L10.0002 8.83325L14.0835 4.74992C14.2363 4.59714 14.4307 4.52075 14.6668 4.52075C14.9029 4.52075 15.0974 4.59714 15.2502 4.74992C15.4029 4.9027 15.4793 5.09714 15.4793 5.33325C15.4793 5.56936 15.4029 5.76381 15.2502 5.91659L11.1668 9.99992L15.2502 14.0833C15.4029 14.236 15.4793 14.4305 15.4793 14.6666C15.4793 14.9027 15.4029 15.0971 15.2502 15.2499C15.0974 15.4027 14.9029 15.4791 14.6668 15.4791C14.4307 15.4791 14.2363 15.4027 14.0835 15.2499L10.0002 11.1666Z",fill:"currentColor"})}));B4.displayName="CloseIcon";const wa={primary:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#001c35",975:"#00111f"},black:{50:"#f0f0f0",100:"#d9d9d9",200:"#bfbfbf",300:"#8c8c8c",400:"#595959",500:"#454545",600:"#262626",700:"#1f1f1f",800:"#141414",900:"#000000",950:"#0a0a0a",975:"#050505"},blue:{50:"#E6F1FC",100:"#C6E1F9",200:"#8AC0F2",300:"#54A4EC",400:"#3392E9",500:"#0077E3",600:"#016DCF",700:"#0054A1",800:"#00417D",900:"#00325F",950:"#002547",975:"#001529"},success:{50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31",950:"#033625",975:"#022419"},neutral:{50:"#F9FAFB",100:"#F2F4F7",200:"#EAECF0",300:"#D0D5DD",400:"#98A2B3",500:"#667085",600:"#475467",700:"#344054",800:"#1D2939",900:"#101828",950:"#0c1219",975:"#080a0f"},error:{50:"#FEF3F2",100:"#FEE4E2",200:"#FECDCA",300:"#FDA29B",400:"#F97066",500:"#F04438",600:"#D92D20",700:"#B42318",800:"#912018",900:"#7A271A",950:"#3d1008",975:"#2a0b05"},warning:{50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E",950:"#662505",975:"#451803"},teal:{50:"#ebf5f5",100:"#c2e0df",200:"#a4d1d0",300:"#7abcba",400:"#61afad",500:"#399b98",600:"#348d8a",700:"#286e6c",800:"#1f5554",900:"#184140",950:"#133534",975:"#0c2222"},green:{50:"#f2f7f2",100:"#d5e5d5",200:"#c1d9c1",300:"#a5c7a5",400:"#94bd93",500:"#79ac78",600:"#6e9d6d",700:"#567a55",800:"#435f42",900:"#334832",950:"#001e00",975:"#182818"},yellow:{50:"#fffaed",100:"#fff0c7",200:"#ffe8ac",300:"#ffde86",400:"#ffd76f",500:"#ffcd4b",600:"#e8bb44",700:"#b59235",800:"#8c7129",900:"#6b5620",950:"#524314",975:"#382e0e"},orange:{50:"#fef4e8",100:"#fddeb7",200:"#fcce94",300:"#fbb764",400:"#faa945",500:"#f99417",600:"#e38715",700:"#b16910",800:"#89510d",900:"#693e0a",950:"#4d2d07",975:"#331e05"},peach:{50:"#fceef3",100:"#f5cad9",200:"#f0b0c6",300:"#ea8cad",400:"#e5759d",500:"#df5384",600:"#cb4c78",700:"#9e3b5e",800:"#7b2e49",900:"#5e2337",950:"#451a2b",975:"#2e111d"},red:{50:"#fceaeb",100:"#f6bec0",200:"#f29ea2",300:"#ec7278",400:"#e9575d",500:"#e32d35",600:"#cf2930",700:"#a12026",800:"#7d191d",900:"#5f1316",950:"#470c0f",975:"#2f080a"},purple:{50:"#f5e7ff",100:"#dfb4ff",200:"#d090ff",300:"#bb5dff",400:"#ad3dff",500:"#990dff",600:"#8b0ce8",700:"#6d09b5",800:"#54078c",900:"#40056b",950:"#300450",975:"#200336"},navy:{50:"#eaebf6",100:"#bebfe2",200:"#9ea1d3",300:"#7276bf",400:"#575bb3",500:"#2d32a0",600:"#292e92",700:"#202472",800:"#191c58",900:"#131543",950:"#0d0e2f",975:"#090a20"},grey:{50:"#f2f2f2",100:"#d5d5d5",200:"#c1c1c1",300:"#a5a5a5",400:"#939393",500:"#787878",600:"#6d6d6d",700:"#555555",800:"#424242",900:"#323232",950:"#252525",975:"#191919"}},FN=t=>{let e=0;for(let a=0;a<t.length;a++)e=t.charCodeAt(a)+((e<<5)-e);const r=(e&16777215).toString(16).toUpperCase();return`#${"00000".substring(0,6-r.length)+r}`},Fu=(t,e=80)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.min(255,r+(255-r)*(e/100)),n=Math.min(255,n+(255-n)*(e/100)),a=Math.min(255,a+(255-a)*(e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},v3=(t,e=30)=>{let r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),a=parseInt(t.slice(5,7),16);return r=Math.max(0,r*(1-e/100)),n=Math.max(0,n*(1-e/100)),a=Math.max(0,a*(1-e/100)),`#${Math.round(r).toString(16).padStart(2,"0")}${Math.round(n).toString(16).padStart(2,"0")}${Math.round(a).toString(16).padStart(2,"0")}`},UN=(t,e)=>({background:e?wa[t]?.[975]:wa[t]?.[50],borderColor:e?wa[t]?.[900]:wa[t]?.[100],color:e?wa[t]?.[500]:wa[t]?.[600]}),zN=(t,e)=>{const r=t.startsWith("#")?t:FN(t);return{background:e?v3(r,80):Fu(r,90),borderColor:e?v3(r,40):Fu(r,50),color:e?Fu(r,40):r}},BN=t=>({background:t?"#2D3748":"#F7FAFC",borderColor:t?"#4A5568":"#E2E8F0",color:t?"#A0AEC0":"#4A5568"}),qN=t=>{switch(t){case"xs":return"text-xs px-1 py-0.5";case"lg":return"text-sm px-2.5 py-1.5";case"md":return"text-sm px-2 py-1";default:return"text-xs px-1.5 py-0.5"}},VN=(t,e,r,n)=>t?r?e.color:wa[t]?.[500]||e.color:n?"#A0AEC0":"#4A5568",vr=x.forwardRef(({label:t,color:e,size:r="sm",className:n,onClick:a,onMouseDown:i,truncate:s,isHashColor:o=!1,icon:l,removable:c=!1,onRemove:u,onUpload:f,acceptsUpload:p=!1,"aria-label":h},m)=>{const v=x.useMemo(()=>typeof window>"u"?"light":localStorage.getItem("vite-ui-theme")||"light",[])==="dark",g=()=>e?e in wa?UN(e,v):zN(e,v):BN(v),S=w=>{const T=w.target.files?.[0];T&&f&&f(T),w.target.value=""},E=g(),k=VN(e,E,o,v);return A.jsx("div",{ref:m,className:B("inline-flex items-center border rounded-md transition-colors bg-primary-50 border-primary-100 text-primary-600 dark:bg-primary-900 dark:border-primary-800 dark:text-primary-400",qN(r),(a||p)&&"cursor-pointer hover:opacity-80",n),style:{maxWidth:"100%"},onMouseDown:i,onClick:a,"aria-label":h||`Tag: ${t}`,role:"button",tabIndex:a||p?0:void 0,children:A.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-hidden",style:{maxWidth:"100%"},children:[l,s?A.jsx("p",{title:t,className:`text-${r} ${a||p?"cursor-pointer":""} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t.length>s?`${t.slice(0,s)}...`:t}):A.jsx("p",{className:`text-${r} overflow-hidden whitespace-nowrap text-ellipsis`,style:{maxWidth:"100%"},children:t}),p&&A.jsx("input",{type:"file",onChange:S,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`}),c&&u&&A.jsx("button",{onClick:u,className:"ml-1 flex-shrink-0","aria-label":`Remove ${t}`,type:"button",children:A.jsx(B4,{size:12,fill:k,className:"cursor-pointer text-primary-600 dark:text-primary-400"})})]})})});vr.displayName="Tag";const Zr=({labels:t=[]})=>{const e=[],r=[];return t.forEach(n=>{typeof n=="string"&&!e.includes(n)?e.push(n):typeof n!="string"&&!r.some(a=>a.label===n.label)&&r.push(n)}),A.jsxs(A.Fragment,{children:[e?.map(n=>A.jsx(vr,{size:"xs",label:n,color:"primary"},n)),r?.map((n,a)=>A.jsx(vr,{size:"xs",label:n?.label,color:n?.color},n?.id||a))]})},rA=()=>{if(typeof window>"u"||typeof navigator>"u")return"other";const t=navigator.platform?.toLowerCase()||"",e=navigator.userAgent?.toLowerCase()||"";return t.includes("mac")||e.includes("mac")?"macos":t.includes("win")||e.includes("win")?"windows":t.includes("linux")||e.includes("linux")?"linux":"other"},nA=()=>x.useMemo(()=>rA(),[]),WN=()=>rA()==="macos",Fc={Meta:{macos:"⌘",other:"Ctrl"},Alt:{macos:"⌥",other:"Alt"},Shift:{macos:"⇧",other:"Shift"},Control:{macos:"⌃",other:"Ctrl"},Enter:{macos:"↵",other:"Enter"},Delete:{macos:"⌫",other:"Delete"},ArrowUp:{macos:"↑",other:"↑"},ArrowDown:{macos:"↓",other:"↓"},ArrowLeft:{macos:"←",other:"←"},ArrowRight:{macos:"→",other:"→"}},q4=(t,e)=>{const r=e??rA(),n=Fc[t];return n?r==="macos"?n.macos:n.other:t},Ab=(t,e)=>{const r=e??rA();return t.map(n=>q4(n,r))},XN=t=>{const e=nA();return x.useMemo(()=>Ab(t,e),[t,e])},QN={auto:"top","auto-start":"topLeft","auto-end":"topRight",top:"top","top-start":"topLeft","top-end":"topRight",bottom:"bottom","bottom-start":"bottomLeft","bottom-end":"bottomRight",right:"right","right-start":"rightTop","right-end":"rightBottom",left:"left","left-start":"leftTop","left-end":"leftBottom"},He=({children:t,title:e,hideTooltip:r=!1,delayShow:n=!1,whiteSpace:a="initial",placement:i="top",className:s,shortcuts:o,open:l,onOpenChange:c})=>{const u=nA(),f=x.useMemo(()=>o?Ab(o,u):void 0,[o,u]),p=QN[i],h=x.useMemo(()=>{if(!f)return[];const v={};return f.map(g=>(v[g]=(v[g]??0)+1,{id:`${g}-${v[g]}`,label:g}))},[f]),m=A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"flex-1 min-w-0",children:e}),h.length>0&&A.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:h.map(v=>A.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1 rounded text-[11px] font-medium leading-none",style:{backgroundColor:"rgba(255, 255, 255, 0.1)",border:"1px solid rgba(255, 255, 255, 0.2)",color:"rgba(255, 255, 255, 0.8)"},children:v.label},v.id))})]}),b=A.jsx("span",{className:s,children:t});return r?b:A.jsx(Xe.Tooltip,{title:e?m:null,placement:p,trigger:["hover"],mouseEnterDelay:n?1:0,mouseLeaveDelay:0,color:"#101828",open:l,onOpenChange:c,classNames:{body:"lax-tooltip-body-important-whitespace"},styles:{body:{"--lax-tooltip-white-space":a,borderRadius:8,border:"1px solid #252525",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.18)",color:"#fff",maxWidth:"40ch",fontSize:12,fontWeight:500,wordWrap:"break-word",padding:"4px 8px"}},children:b})},GN=({size:t=24,fill:e="currentColor",fillSecondary:r="white"})=>A.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[A.jsx("path",{d:"M17.5128 13.6276L13.7184 11.9717C12.8016 11.5708 12.0696 10.8389 11.6688 9.92205L10.0128 6.12765C9.88322 5.83245 9.46802 5.83245 9.33842 6.12765L7.68242 9.92205C7.28162 10.8389 6.54962 11.5708 5.63282 11.9717L1.83122 13.63C1.53842 13.7572 1.53602 14.1748 1.83122 14.3044L5.69762 16.0132C6.61202 16.4188 7.34162 17.1532 7.73762 18.0724L9.34082 21.7948C9.46802 22.09 9.88802 22.0924 10.0152 21.7948L11.6688 18.0052C12.0696 17.0884 12.8016 16.3565 13.7184 15.9557L17.5128 14.2997C17.808 14.17 17.808 13.7548 17.5128 13.6252V13.6276Z",fill:e}),A.jsx("path",{d:"M22.2624 6.43876L20.0688 5.48116C19.5384 5.25076 19.116 4.82596 18.8856 4.29796L17.928 2.10436C17.8536 1.93396 17.6136 1.93396 17.5392 2.10436L16.5816 4.29796C16.3512 4.82836 15.9264 5.25076 15.3984 5.48116L13.2024 6.43876C13.032 6.51316 13.032 6.75316 13.2024 6.82756L15.4368 7.81636C15.9648 8.04916 16.3872 8.47636 16.6152 9.00676L17.5416 11.1572C17.616 11.3276 17.8584 11.3276 17.9328 11.1572L18.888 8.96836C19.1184 8.43796 19.5432 8.01556 20.0712 7.78516L22.2648 6.82756C22.4352 6.75316 22.4352 6.51316 22.2648 6.43876H22.2624Z",fill:e})]}),vn=({position:t="top",title:e="AI Extracted Field"})=>A.jsx(He,{placement:t,title:e,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(GN,{size:12,fill:"var(--color-primary-600)",fillSecondary:"var(--color-primary-300)"})})}),YN=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),A.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),KN=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),A.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),ZN=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),A.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),$N=({className:t,size:e=16})=>A.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[A.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),A.jsx("path",{d:"M3 3v5h5"})]}),Ha=x.forwardRef(({id:t,label:e,onChange:r,errorMessage:n,successMessage:a,required:i,isRequiredConditional:s=!1,bg:o,tags:l,color:c,className:u,isPasswordField:f,setIsPasswordVisible:p,inputRef:h,tooltip:m,suffixIcon:b,revertBackValue:v,originalCase:g=!1,textSize:S,isAiExtracted:E=!1,isGTN:k=!1,gtnName:w=null,inputClassName:T="",inputStyle:O={},labelClassName:C,onBlur:_,isLiveField:I=!1,isClearable:N=!1,riskDetails:R,isRiskAnalysisOpen:D=!1,RiskDetailsCard:P,onAddGTNToDocument:j,...z},M)=>{const{t:L}=Kt.useTranslation(),[V,U]=x.useState(!1),[q,Q]=x.useState(!1),X=G=>{j&&j({key:w,value:G})};return A.jsxs("div",{className:B("flex gap-0.5 relative",q&&k?"border rounded-lg border-primary-100 bg-primary-50 p-1 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-neutral-50 dark:focus:border-neutral-50":""),onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),children:[k&&!q?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",u),children:[A.jsx("style",{children:`
|
|
21
21
|
.dark input:-webkit-autofill,
|
|
22
22
|
.dark input:-webkit-autofill:hover,
|
|
23
23
|
.dark input:-webkit-autofill:focus {
|
|
@@ -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 ae="";ue==null?ae="":typeof ue=="string"||typeof ue=="number"?ae=String(ue):Array.isArray(ue)?ae=ue.map(xe=>typeof xe=="object"&&xe!==null&&"value"in xe?xe.value:xe).join(", "):typeof ue=="object"&&"value"in ue&&(ae=String(ue.value)),V({key:h,value:ae})}},ue=eI(e),K=x.useMemo(()=>b?mN(b,v):null,[b,v]),re=(ae,pe)=>{if(ie.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(ae)?ae:[ae];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 ae=Array.isArray(ue)?ue:[];return Ae.map(xe=>xe.value).every(xe=>ae.some(Ne=>typeof Ne=="object"&&Ne!==null&&"value"in Ne?String(Ne.value)===String(xe):String(Ne)===String(xe)))},[ue,Ae,r]),Qe=()=>{!r||r!=="multiple"||!m||m(Ie?[]:Ae)},qe=x.useCallback(ae=>{if(!ae)return;const pe=new Event("submit",{bubbles:!0,cancelable:!0});ae.dispatchEvent(pe);const xe=ae.querySelector('button[type="submit"]');xe&&xe.click()},[]),rt=x.useCallback(ae=>{if(ae.key==="Enter"&&!te&&(ae.preventDefault(),ae.stopPropagation(),ue)){const pe=ae.currentTarget.closest("form");qe(pe)}},[te,ue,qe]),Be=x.useCallback(ae=>{const{label:pe,value:xe,onClose:Ne}=ae,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]),de=x.useCallback(ae=>{fe(ae),(l||K)?.(ae)},[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:ae=>ae.stopPropagation(),onKeyDownCapture:rt,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(He,{placement:"top",title:c,children:A.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ae=>{(ae.key==="Enter"||ae.key===" ")&&ae.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(He,{placement:"top",title:G("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(Xe.Select,{onOpenChange:se,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:re,filterOption:b?g:(ae,pe)=>(pe?.label||"")?.toLowerCase()?.includes(ae?.toLowerCase()),showSearch:!0,onSearch:de||void 0,onPopupScroll:S,popupClassName:"select-field-dropdown-popup",popupRender:ae=>A.jsx(aI,{showSelectAll:N,mode:r,options:Ae,searchValue:me,handleSelectAll:Qe,isAllSelected:Ie,menu:ae,isLoading:E,hasExistingData:Ee,t:G}),options:Ae.map(({label:ae,value:pe,color:xe,...Ne})=>({label:String(ae),value:String(pe),key:String(pe),id:String(pe),color:xe,...Ne})),optionRender:ae=>{const pe=ae?.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:ae?.data?.url||"",size:"xs",enablePopper:!0,userId:ae?.data?.value}),A.jsx("span",{className:"ml-2",children:ae.label})]})}return A.jsx("span",{children:ae.label})},autoClearSearchValue:w,onClear:()=>m&&m(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&O?void 0:"responsive",maxTagPlaceholder:ae=>A.jsx(He,{placement:"top",title:ae.length>3?ae.slice(0,3).map(({label:pe})=>pe).join(", ")+"...":ae.map(({label:pe})=>pe).join(", "),children:A.jsxs("span",{children:["+",ae.length," more"]})}),tagRender:C||Be,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:ae=>ae.stopPropagation(),onMouseDown:ae=>ae.preventDefault(),onKeyDown:ae=>{ae.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(Xe.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(ze.AnimatePresence,{children:o&&A.jsx(ze.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(Xe.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(ze.AnimatePresence,{children:l&&A.jsx(ze.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(Xe.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(Xe.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",appearance:"custom",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",appearance:"custom",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",appearance:"custom",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 ",appearance:"custom",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 ",appearance:"custom",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",appearance:"custom",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",appearance:"custom",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(He,{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(Xe.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(ze.AnimatePresence,{children:T&&A.jsx(ze.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(He,{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(He,{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 ae="";ue==null?ae="":typeof ue=="string"||typeof ue=="number"?ae=String(ue):Array.isArray(ue)?ae=ue.map(xe=>typeof xe=="object"&&xe!==null&&"value"in xe?xe.value:xe).join(", "):typeof ue=="object"&&"value"in ue&&(ae=String(ue.value)),V({key:h,value:ae})}},ue=eI(e),K=x.useMemo(()=>b?mN(b,v):null,[b,v]),re=(ae,pe)=>{if(ie.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(ae)?ae:[ae];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 ae=Array.isArray(ue)?ue:[];return Ae.map(xe=>xe.value).every(xe=>ae.some(Ne=>typeof Ne=="object"&&Ne!==null&&"value"in Ne?String(Ne.value)===String(xe):String(Ne)===String(xe)))},[ue,Ae,r]),Qe=()=>{!r||r!=="multiple"||!m||m(Ie?[]:Ae)},qe=x.useCallback(ae=>{if(!ae)return;const pe=new Event("submit",{bubbles:!0,cancelable:!0});ae.dispatchEvent(pe);const xe=ae.querySelector('button[type="submit"]');xe&&xe.click()},[]),rt=x.useCallback(ae=>{if(ae.key==="Enter"&&!te&&(ae.preventDefault(),ae.stopPropagation(),ue)){const pe=ae.currentTarget.closest("form");qe(pe)}},[te,ue,qe]),Be=x.useCallback(ae=>{const{label:pe,value:xe,onClose:Ne}=ae,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]),de=x.useCallback(ae=>{fe(ae),(l||K)?.(ae)},[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:ae=>ae.stopPropagation(),onKeyDownCapture:rt,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(He,{placement:"top",title:c,children:A.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:ae=>{(ae.key==="Enter"||ae.key===" ")&&ae.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(He,{placement:"top",title:G("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(Xe.Select,{onOpenChange:se,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:re,filterOption:b?g:(ae,pe)=>(pe?.label||"")?.toLowerCase()?.includes(ae?.toLowerCase()),showSearch:!0,onSearch:de||void 0,onPopupScroll:S,popupClassName:"select-field-dropdown-popup",popupRender:ae=>A.jsx(aI,{showSelectAll:N,mode:r,options:Ae,searchValue:me,handleSelectAll:Qe,isAllSelected:Ie,menu:ae,isLoading:E,hasExistingData:Ee,t:G}),options:Ae.map(({label:ae,value:pe,color:xe,...Ne})=>({label:String(ae),value:String(pe),key:String(pe),id:String(pe),color:xe,...Ne})),optionRender:ae=>{const pe=ae?.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:ae?.data?.url||"",size:"xs",enablePopper:!0,userId:ae?.data?.value}),A.jsx("span",{className:"ml-2",children:ae.label})]})}return A.jsx("span",{children:ae.label})},autoClearSearchValue:w,onClear:()=>m&&m(r==="tags"||r==="multiple"?[]:null),maxTagCount:r==="tags"&&O?void 0:"responsive",maxTagPlaceholder:ae=>A.jsx(He,{placement:"top",title:ae.length>3?ae.slice(0,3).map(({label:pe})=>pe).join(", ")+"...":ae.map(({label:pe})=>pe).join(", "),children:A.jsxs("span",{children:["+",ae.length," more"]})}),tagRender:C||Be,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:ae=>ae.stopPropagation(),onMouseDown:ae=>ae.preventDefault(),onKeyDown:ae=>{ae.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(Xe.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(ze.AnimatePresence,{children:o&&A.jsx(ze.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(Xe.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(ze.AnimatePresence,{children:l&&A.jsx(ze.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(Xe.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(Xe.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,{variant:"semibold",size:"extra-small",className:"text-white",children:S("Normal Search")}),A.jsx(ee,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",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",appearance:"custom",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",appearance:"custom",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",appearance:"custom",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("div",{className:"h-[1px] w-full bg-neutral-800 dark:bg-black-200 my-2"}),A.jsx(ee,{variant:"semibold",size:"extra-small",className:"text-white",children:"Wildcard Search"}),A.jsx(ee,{variant:"medium",size:"extra-small",className:"text-white dark:text-black-200",appearance:"custom",children:"Use * as a wildcard to refine your search."}),A.jsx(ee,{variant:"medium",size:"extra-small",className:"text-primary-400 dark:text-primary-400",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 ",appearance:"custom",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 ",appearance:"custom",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",appearance:"custom",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",appearance:"custom",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(He,{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(Xe.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(ze.AnimatePresence,{children:T&&A.jsx(ze.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(He,{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(He,{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"),[ie,te]=x.useState(!1),se=re=>{R&&R({key:v,value:re})},me=re=>{if(re==null)return"";const Ae=Number(re);return isNaN(Ae)?re:Ae?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},fe=re=>{const Ae=re.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 Qe=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:Ee,currency_code:Y},type:"change"}});Ie.dispatchEvent(Qe)}},ce=()=>{U(!0)},ue=()=>{U(!1),(r==null||r==="")&&fe({target:{value:"0.00"}}),C?.()},K=()=>{const re="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`${re} ${Ae} ${Ee} ${h}`};return x.useEffect(()=>{k&&oe(k)},[k]),x.useEffect(()=>{if(Y){const re=r===""||r===null||r===void 0?0:Number(r);k!==Y&&n(re,Y);const Ae=document.getElementById(t);if(Ae&&(Ae.setAttribute("data-selected-value",JSON.stringify({value:re,currency_code:Y})),I||N)){const Ee=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${t}`,value:{value:re,currency_code:Y},type:"change"}});Ae.dispatchEvent(Ee)}}},[Y]),x.useEffect(()=>{const re=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(re)},[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:fe,min:0,onFocus:ce,onBlur:ue,value:V?r:me(r),...i&&!r?{defaultValue:V?i:me(i)}:{},id:t||e,autoFocus:_})]}):A.jsxs("div",{className:B("flex gap-0.5 relative",ie&&b?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>te(!0),onMouseLeave:()=>te(!1),children:[b&&!ie?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(He,{placement:"top",title:f,children:A.jsx("div",{className:"cursor-pointer",children:A.jsx(Kr,{})})})]}),b&&ie&&R?A.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>se(me(r)),type:"button",children:A.jsx(Xe.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:fe,min:0,onFocus:ce,onBlur:ue,value:V?r:me(r),defaultValue:V?i:me(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(Xe.Dropdown,{menu:{items:[...q]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:re=>re.parentElement,popupRender:re=>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"}),re]}),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})]}),ie&&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:re=>re.stopPropagation(),onMouseDown:re=>re.preventDefault(),onKeyDown:re=>{re.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(ze.AnimatePresence,{children:o&&A.jsx(ze.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}=Xe.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(re=>{const Ae=Ms(re,l);Ae&&fe(Ae)}))}),O3("keydown",K=>{if(K.key===C3.ENTER&&document.activeElement instanceof HTMLInputElement&&document.activeElement.id===G){const re=Ms(document?.activeElement?.value,l);re&&fe(re)}});const ie=x.useCallback(K=>{if(!I)return;let re=K||"";if(N&&K)re=N(K,{skipTimezone:!0,withTime:l});else if(K){const Ee=Ht(K);Ee.isValid()&&(re=Ee.format(X))}I({key:g,value:re})},[I,g,N,l,X]),te=x.useCallback(()=>{const K=document.getElementsByClassName("ant-picker-footer")[0];K&&(K.style.display="none")},[]),se=x.useCallback(K=>{if(!E){const re=l?T3:w3;if(o(K?K.format(re):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 re;if(l?re=Ht(K).utc().toISOString():re=Ht(K).utc().add(Ht(K).utcOffset(),"minute").startOf("day").toISOString(),re){o(re);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]),me=x.useCallback(K=>{if(!K)return null;if(!E)try{const re=Ht(K);if(re.isValid())return re;const Ae=Ht(K,X);return Ae.isValid()?Ae:null}catch{return null}if(l){const re=Ht(K);return Ht(re).isValid()?re:null}else if(K?.toString()?.includes("Z")){const re=Ht.utc(K);return Ht(re).isValid()?re:null}else{const re=Ht(K);return Ht(re).isValid()?re:null}},[E,X,l]),fe=x.useCallback(K=>{if(K?.isValid()||K===null){L(K);const re=l?T3:w3,Ae=E?K?.toISOString():K?K.format(re):"";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(me(e))},[e,me]),x.useEffect(()=>{V&&U(null)},[V]),x.useEffect(()=>{const K=document.getElementById(G);if(!K)return;const re=Ae=>{const{value:Ee,type:Ie}=Ae.detail;if(Ie==="date-playback"&&Ee){const Qe=Ms(Ee,l);Qe&&Qe.isValid()&&(L(Qe),se(Qe),setTimeout(()=>{const qe=K.querySelector("input");if(qe&&(qe.focus(),setTimeout(()=>{qe.blur()},10)),Y.current)try{const rt=Y.current;typeof rt.blur=="function"&&rt.blur()}catch{}setTimeout(()=>{document.querySelectorAll(".ant-picker-dropdown:not(.ant-picker-dropdown-hidden)").forEach(Be=>{Be instanceof HTMLElement&&(Be.style.display="none",Be.classList.add("ant-picker-dropdown-hidden"))})},50)},50))}};return K.addEventListener("pilot-date-playback",re),()=>{K.removeEventListener("pilot-date-playback",re)}},[G,X,se,l]);const ce=x.useCallback(K=>{if(K.key===C3.ENTER&&!q){K.preventDefault(),K.stopPropagation();const re=K.target.closest("form");if(re){const Ae=re.querySelector('button[type="submit"]');Ae?Ae.click():re.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(Xe.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),se(K),U(K?.toISOString()||null)},className:i,showNow:!1,onFocus:te,onOpenChange:ue,onBlur:K=>{const re=K.target.value;if(re){const Ae=Ms(re,l);Ae&&fe(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(He,{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:()=>ie(e),type:"button",children:A.jsx(Xe.Tooltip,{placement:"top",title:P("Add to document"),children:A.jsx(be.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})}):null,A.jsx(Xe.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),se(K),U(K?.toISOString()||null)},onBlur:K=>{const re=K.target.value;if(re){const Ae=Ms(re,l);Ae&&(L(Ae),se(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(ze.AnimatePresence,{children:n&&A.jsx(ze.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=me=>{if(me.keyCode===9||me.key==="Enter"){const fe=G.current||X.current;fe&&(V!==null&&a(V),U(V),fe.blur())}},ie=()=>{U(""),a("")},te=me=>{w&&v&&w({key:v,value:me})},se=()=>{const me="border h-[32px] text-sm rounded-lg block w-full p-2.5 font-inter font-medium",fe=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`${me} ${fe} ${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(He,{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(Xe.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:se(),onChange:me=>{a(me.target.value),U(me.target?.value)},onKeyDown:oe,value:V!==null?V:n,defaultValue:s,disabled:!0}),A.jsx(ur,{id:"btn-dynamic-data-input-rx-cross",onClick:ie,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:me=>{a(me),U(me)},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:me=>me.stopPropagation(),onMouseDown:me=>me.preventDefault(),onKeyDown:me=>{me.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(He,{title:h,placement:m,shortcuts:v,delayShow:!0,children:A.jsxs("button",{ref:E,className:`
|