1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4908],{41052:(e,t,r)=>{r.d(t,{C7:()=>N,LR:()=>k,MJ:()=>g,ay:()=>j,cx:()=>y,gE:()=>h,hg:()=>w,lV:()=>m,ly:()=>v});var l=r(95155),n=r(12115),s=r(24274),a=r(64269),i=r(85665),o=r(13734),c=r(49738),d=r(74551),u=r(3978);r(74062),r(1878);var p=r(43617),x=r(96538);let m=(0,n.forwardRef)((e,t)=>{let{children:r,className:n,onSubmit:s,...i}=e;return(0,l.jsx)("form",{ref:t,className:(0,a.cn)("space-y-4",n),onSubmit:e=>{e.preventDefault(),s&&s(e)},noValidate:!0,...i,children:r})});m.displayName="Form";let h=e=>{let{children:t,className:r}=e;return(0,l.jsx)("div",{className:(0,a.cn)("md:mb-5",r),children:t})},f=(0,n.forwardRef)((e,t)=>{let{children:r,className:n,...s}=e;return(0,l.jsx)("label",{ref:t,className:(0,a.cn)("mb-1 block text-sm font-medium text-gray-700",n),...s,children:r})});f.displayName="FormLabel";let g=(0,n.forwardRef)((e,t)=>{let{className:r,containerClassName:s,icon:i,iconPosition:o="left",iconClassName:c,placeholder:d,required:u,errorMessage:p,toggleVisibility:x,grey:m,customHeight:h,blackText:f,...g}=e,[v,b]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{void 0!==g.value&&null!==g.value&&""!==g.value&&w(!0)},[g.value]);let y=v||j;return(0,l.jsxs)("div",{className:(0,a.cn)(s),children:[(0,l.jsxs)("div",{className:"relative",children:[i&&(0,l.jsx)("div",{className:(0,a.cn)("absolute inset-y-0 flex items-center pointer-events-none z-10","left"===o?"left-0 pl-4":"right-0 pr-3",c,f||y?"text-black":"text-[#909090]",g.disabled&&"opacity-50"),children:i}),(0,l.jsx)("input",{ref:t,className:(0,a.cn)("block w-full rounded-[8px] border border-[#E3E3E3] px-3 py-2 lg:text-[15px] focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary",h?"h-[57px] lg:h-[50px] lg:text-[16px]":"h-[57px] lg:h-[44px]",m&&"bg-[#F8F8FA] text-[#909090] border-[#F8F8FA]",m&&j&&"text-black",p&&"border-red-500",i&&"left"===o&&"pl-11",i&&"right"===o&&"pr-11",g.disabled&&"cursor-not-allowed opacity-50",r),placeholder:"",onFocus:e=>{b(!0),g.onFocus&&g.onFocus(e)},onBlur:e=>{b(!1),w(""!==e.target.value),g.onBlur&&g.onBlur(e)},onChange:e=>{w(""!==e.target.value),g.onChange&&g.onChange(e)},...g}),d&&(0,l.jsxs)("span",{className:(0,a.cn)("absolute top-[15px] lg:top-[11px] left-5 pointer-events-none transition-all duration-200",f?"text-black":"text-[#909090]",i&&"left"===o&&"left-11",h&&"lg:top-[14px]",y?"transform -translate-y-[23px] translate-x-[-34px] text-[12px] bg-white px-2 text-[#CCCCCC]":"",!i&&y&&"translate-x-[-10px]"),children:[d,u&&(0,l.jsx)("span",{className:"ml-1",children:"*"})]}),x&&(0,l.jsx)("div",{className:"absolute top-0 bottom-0 right-0",children:x})]}),p&&(0,l.jsx)("div",{className:"mt-1 text-sm text-red-500",children:p})]})});g.displayName="FormControl";let v=(0,n.forwardRef)((e,t)=>{let{label:r,id:n,className:s,type:i="checkbox",labelClassName:o,labelTestId:c,renderAsBox:d,additionalDescription:u,errorMessage:p,hideIcon:x,required:m,hasImage:h,onChange:f,"data-testid":g,...v}=e;return(0,l.jsxs)("div",{className:(0,a.cn)(d&&"border border-[#E3E3E3] hover:border-[var(--pastel)] rounded-[13px] text-black h-full contain-paint hover:bg-[var(--pastel)] transition-all duration-200",h&&"hover:border-[#E3E3E3] hover:bg-[#FFF]",h&&v.checked&&"border-[#E3E3E3] bg-[#FFF]",v.checked&&d&&!h&&"border-[var(--pastel)] bg-[var(--pastel)]"),children:[u&&(0,l.jsx)("div",{children:u}),(0,l.jsxs)("div",{className:(0,a.cn)("relative flex items-start flex-wrap",d&&!x&&"pl-5.25 pb-7",s),children:[(0,l.jsx)("input",{ref:t,id:n,type:i,className:(0,a.cn)("sr-only","radio"===i&&"rounded-full"),style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:0},onChange:e=>{f&&f(e.target.checked)},"data-testid":g,...v}),(0,l.jsx)("label",{htmlFor:n,className:(0,a.cn)("absolute flex items-center justify-center w-4.5 h-4.5 top-[3px] border border-[#E3E3E3] rounded cursor-pointer flex-shrink-0","radio"===i&&"rounded-full",v.checked&&"border-primary bg-primary",x&&"hidden",d&&"pl-5",o),children:v.checked&&"checkbox"===i&&(0,l.jsx)("span",{className:"absolute w-2.5 h-1.5 border-l-2 border-b-2 border-white rotate-[-45deg] top-[4px] left-[3px] z-10"})}),(0,l.jsx)("div",{className:(0,a.cn)(!x&&"pl-6.5"),children:r&&(0,l.jsxs)("label",{htmlFor:n,className:(0,a.cn)("block cursor-pointer",o),"data-testid":c,children:[r,m&&(0,l.jsx)("span",{className:"ml-1",children:"*"})]})}),p&&(0,l.jsx)("div",{className:"mt-1 pl-7.5 text-sm text-red-500 basis-full",children:p})]})]})});v.displayName="FormCheck";let b=(0,n.forwardRef)((e,t)=>{let{children:r,className:s,icon:i,iconClassName:o,placeholder:c,...d}
1=e,[u,p]=(0,n.useState)(!1),[x,m]=(0,n.useState)(!1),h=u||x;return(0,l.jsxs)("div",{className:"relative",children:[i&&(0,l.jsx)("div",{className:(0,a.cn)("absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none z-10",o),children:i}),(0,l.jsxs)("select",{ref:t,className:(0,a.cn)("block w-full h-[57px] lg:h-[44px] rounded-[8px] border border-gray-300 px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary",i&&"pl-10",s),onFocus:e=>{p(!0),d.onFocus&&d.onFocus(e)},onBlur:e=>{p(!1),m(""!==e.target.value),d.onBlur&&d.onBlur(e)},onChange:e=>{m(""!==e.target.value),d.onChange&&d.onChange(e)},...d,children:[c&&!h&&(0,l.jsx)("option",{value:"",disabled:!0,selected:!0,hidden:!0}),r]}),c&&(0,l.jsx)("span",{className:(0,a.cn)("absolute left-3 pointer-events-none transition-all duration-200 text-gray-500",i&&"left-10",h?"transform -translate-y-[22px] scale-75 bg-white px-1 text-primary":"top-[13px]"),children:c})]})});b.displayName="FormSelect";let j=(0,n.forwardRef)((e,t)=>{let{className:r,...n}=e;return(0,l.jsx)("p",{ref:t,className:(0,a.cn)("text-sm text-gray-500",r),...n})});j.displayName="FormText";let w=(0,n.forwardRef)((e,t)=>{let{className:r,icon:s,iconPosition:i="left",iconClassName:o,placeholder:c,errorMessage:d,resizable:u=!0,required:p=!1,...x}=e,[m,h]=(0,n.useState)(!1),[f,g]=(0,n.useState)(!1);(0,n.useEffect)(()=>{void 0!==x.value&&null!==x.value&&g(""!==String(x.value))},[x.value]);let v=m||f;return(0,l.jsxs)("div",{className:"relative",children:[s&&(0,l.jsx)("div",{className:(0,a.cn)("absolute top-3 flex items-start pointer-events-none z-10","left"===i?"left-0 pl-4":"right-0 pr-3",o,v?"text-black":"text-[#909090]"),children:s}),(0,l.jsx)("textarea",{ref:t,className:(0,a.cn)("block w-full rounded-[8px] border border-[#E3E3E3] px-3 py-2 text-[15px] focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary",s&&"left"===i&&"pl-11",s&&"right"===i&&"pr-11",d&&"border-red-500",u?"resize-y":"resize-none",r),placeholder:"",onFocus:e=>{h(!0),x.onFocus&&x.onFocus(e)},onBlur:e=>{h(!1),g(""!==e.target.value),x.onBlur&&x.onBlur(e)},onChange:e=>{g(""!==e.target.value),x.onChange&&x.onChange(e)},...x}),c&&(0,l.jsxs)("span",{className:(0,a.cn)("absolute top-[11px] left-4 pointer-events-none transition-all duration-200 text-[#909090]",s&&"left"===i&&"left-11",v?"transform -translate-y-[23px] translate-x-[-5px] text-[12px] bg-white px-2 text-[#CCCCCC]":""),children:[c,p&&(0,l.jsx)("span",{className:"ml-1",children:"*"})]}),d&&(0,l.jsx)("div",{className:"mt-1 text-sm text-red-500",children:d})]})});w.displayName="FormTextarea";let y=(0,n.forwardRef)((e,t)=>{let{className:r,icon:s,iconPosition:i="left",iconClassName:o,placeholder:c,errorMessage:d,tags:u=[],onChange:p,tagClassName:x,...m}=e,[h,f]=(0,n.useState)(!1),[g,v]=(0,n.useState)(!1),[b,j]=(0,n.useState)(""),w=(0,n.useRef)(null),y=e=>{if(e&&!u.includes(e)){let t=[...u,e];p&&p(t),j("")}else j("")},N=e=>{let t=[...u];t.splice(e,1),p&&p(t),v(""!==b||t.length>0),w.current&&w.current.focus()};(0,n.useEffect)(()=>{v(""!==b||u.length>0)},[u,b]);let k=h||g;return(0,l.jsxs)("div",{className:"relative",children:[s&&(0,l.jsx)("div",{className:(0,a.cn)("absolute top-3 flex items-start pointer-events-none z-10","left"===i?"left-0 pl-4":"right-0 pr-3",o,k?"text-black":"text-[#ccc]"),children:s}),(0,l.jsxs)("div",{className:(0,a.cn)("block w-full rounded-[8px] border border-[#E3E3E3] px-3 py-2 text-[15px] min-h-[100px]","focus-within:border-primary focus-within:outline-none focus-within:ring-1 focus-within:ring-primary",s&&"left"===i&&"pl-11",s&&"right"===i&&"pr-11",d&&"border-red-500",r),children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mb-2",children:u.map((e,t)=>(0,l.jsxs)("div",{className:(0,a.cn)("flex items-center bg-gray-100 text-gray-800 rounded-full px-3 py-1 text-sm",x),children:[(0,l.jsx)("span",{children:e}),(0,l.jsx)("button",{type:"button",className:"ml-2 text-white focus:outline-none cursor-pointer",onClick:()=>N(t),children:"\xd7"})]},t))}),(0,l.jsx)("textarea",{ref:e=>{w.current=e,"function"==typeof t?t(e):t&&(t.current=e)},className:"w-full border-none p-0 focus:outline-none focus:ring-0 resize-none bg-transparent",value:b,onFocus:e=>{f(!0),m.onFocus&&m.onFocus(e)},onBlur:e=>{f(!1),v(""!==b||u.length>0),m.onBlur&&m.onBlur(e),b.trim()&&y(b.trim())},onChange:e=>{j(e.target.value),v(""!==e.target.value||u.length>0)},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey?"Backspace"===e.key&&""===b&&u.length>0&&N(u.length-1):(e.preventDefault(),b.trim()&&y(b.trim())),m.onKeyDown&&m.onKeyDown(e)},rows:1,...m})]}),c&&(0,l.jsx)("span",{className:(0,a.cn)("absolute top-[11px] left-4 pointer-events-none transition-all duration-200 text-[#909090]",s&&"left"===i&&"left-11",k?"transform -translate-y-[23px] translate-x-[-5px] text-[12px] bg-white px-2 text-[#CCCCCC] line-clamp-1":""),children:c}),d&&(0,l.jsx)("div",{className:"mt-1 text-sm text-red-500",children:d})]})});y.displayName="FormTextareaTags";let N=(0,n.forwardRef)((e,t)=>{var i,p;let{className:m,dropzoneClassName:h,labelClassName:f,label:g,description:v,max:b="10 MB",icon:j,acceptedFileTypes:w="*/*",multiple:y=!1,value:N=null,onFileChange:k,onFileRemove:C,errorMessage:E,uploadToken:
1F,context:L="default",autoUpload:S=!1,uploadMethod:R="anonymousMediaElementCreate",onUploadSuccess:B,onUploadError:V,onUploadingChange:P,additionalPayload:z,layout:A="grid",...D}=e,{t:O}=(0,s.Bd)(),M=(0,o.$)(),[T,U]=(0,n.useState)(!1),[W,I]=(0,n.useState)({}),[H,_]=(0,n.useState)({}),[q,K]=(0,n.useState)({}),[G,$]=(0,n.useState)({}),[J,Y]=(0,n.useState)({}),Q=n.useRef(null),X=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.useCallback)(e=>{t.forEach(t=>{t&&("function"==typeof t?t(e):t.current=e)})},[t])}(t,Q),Z=(0,n.useRef)({}),[ee,et]=(0,n.useState)(null),er=(0,n.useRef)(null),el=e=>"application/pdf"===e.type,en=async e=>new Promise((t,l)=>{let n=new FileReader;n.onload=async function(){try{let e=await r.e(2084).then(r.bind(r,98045));e.GlobalWorkerOptions.workerSrc="https://unpkg.com/pdfjs-dist@".concat(e.version,"/build/pdf.worker.min.mjs");let n=new Uint8Array(this.result),s=await e.getDocument({data:n}).promise,a=await s.getPage(1),i=a.getViewport({scale:1.5}),o=document.createElement("canvas"),c=o.getContext("2d");o.height=i.height,o.width=i.width,c?(await a.render({canvasContext:c,viewport:i}).promise,t(o.toDataURL())):l(Error("Could not get canvas context"))}catch(e){console.error("Error generating PDF thumbnail:",e),l(e)}},n.onerror=l,n.readAsArrayBuffer(e)});(0,n.useEffect)(()=>{if(!N||0===N.length){$({}),Y({});return}let e={},t=[];return N.forEach((r,l)=>{r instanceof File&&r.type.startsWith("image/")&&(G[l]&&t.push(G[l]),e[l]=URL.createObjectURL(r))}),$(e),(async()=>{let e={};for(let t=0;t<N.length;t++){let r=N[t];if(r instanceof File&&el(r))try{let l=await en(r);e[t]=l}catch(e){console.error("Failed to generate thumbnail for ".concat(r.name,":"),e)}}Y(e)})(),()=>{t.forEach(e=>URL.revokeObjectURL(e)),Object.values(e).forEach(e=>URL.revokeObjectURL(e))}},[N]),(0,n.useEffect)(()=>{let e=Object.values(W).some(e=>!0===e);P&&P(e)},[W,P]);let es=async e=>{let t=y?e:e.slice(0,1),r=y&&N?N.length:0;if(t.forEach((e,t)=>{let l=r+t;y&&Z.current[l]||(Z.current[l]="".concat(e.name,"-").concat(e.size,"-").concat(Date.now()))}),k){let e=y?(N||[]).filter(e=>e instanceof File):[];k(y?[...e,...t]:t)}if(S&&F)for(let e=0;e<t.length;e++){let l=r+e,n=Z.current[l];await ea(t[e],n)}},ea=async(e,t)=>{if(!F)return void console.error("Upload token is required for file upload");try{I(e=>({...e,[t]:!0})),_(e=>({...e,[t]:"uploading"})),K(e=>({...e,[t]:0}));let r=setInterval(()=>{K(e=>{let r=e[t]||0;return r<90?{...e,[t]:r+10}:e})},300),l=await M[R](e.name,e,L,F,z);clearInterval(r),K(e=>({...e,[t]:100})),_(e=>({...e,[t]:"success"})),B&&B(l)}catch(e){_(e=>({...e,[t]:"error"})),V&&V(e)}finally{I(e=>({...e,[t]:!1}))}},ei=(e,t)=>{t.stopPropagation(),t.preventDefault(),C&&C(e)},eo=N&&N.length>0,ec=(e,t)=>{var r,n;if(e instanceof File){let r=Z.current[t]||"".concat(e.name,"-").concat(e.size),s=H[r],a=q[r];return(0,l.jsxs)("div",{className:"flex flex-col w-[190px] h-full relative",children:[(0,l.jsx)("div",{className:"w-full overflow-hidden border border-[#E3E3E3] rounded-[16px] flex items-center justify-center h-[270px]",children:G[t]?(0,l.jsx)("img",{src:G[t],alt:e.name,className:"max-w-full max-h-full object-contain"}):J[t]?(0,l.jsxs)("div",{className:"relative w-full h-full",children:[(0,l.jsx)("img",{src:J[t],alt:e.name,className:"max-w-full max-h-full object-contain"}),(0,l.jsx)("div",{className:"absolute bottom-2 right-2 bg-red-600 text-white text-xs px-2 py-1 rounded",children:"PDF"})]}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,l.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,l.jsx)("span",{className:"text-xs mt-1",children:(null==(n=e.type.split("/")[1])?void 0:n.toUpperCase())||"FILE"})]})}),(0,l.jsxs)("div",{className:"absolute top-full left-0 right-0 flex-1 flex",children:["uploading"===s&&(0,l.jsx)("div",{className:"w-[calc(100%-20px)] bg-gray-200 rounded-full h-2 mb-2 mx-auto",children:(0,l.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-200",style:{width:"".concat(a,"%")}})}),"error"===s&&(0,l.jsx)("span",{className:"text-red-500 pt-2 text-sm",children:"â Error"})]}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsxs)("div",{className:"flex gap-2 mb-2",children:[(0,l.jsx)("button",{type:"button",onClick:t=>((e,t,r)=>{r.stopPropagation(),r.preventDefault();let l=URL.createObjectURL(e);window.open(l,"_blank"),setTimeout(()=>{URL.revokeObjectURL(l)},1e3)})(e,0,t),className:"cursor-pointer flex items-center justify-center text-grey hover:text-primary focus:outline-none bg-white border border-[#
1E3E3E3] rounded-full w-[35px] h-[35px]",disabled:W[r],title:"Preview file",children:(0,l.jsx)(c.bM,{className:"size-4"})}),(0,l.jsx)("button",{type:"button",onClick:e=>ei(t,e),className:"cursor-pointer flex items-center justify-center text-grey hover:text-red-700 focus:outline-none bg-white border border-[#E3E3E3] rounded-full w-[35px] h-[35px]",disabled:W[r],title:"Remove file",children:(0,l.jsx)(c.US,{className:"size-3"})})]})})]},t)}return(0,l.jsxs)("div",{className:"flex flex-col w-[190px] h-full relative",children:[(0,l.jsxs)("div",{className:"w-full overflow-hidden border border-[#E3E3E3] rounded-[16px] flex flex-col h-[270px]",children:[(0,l.jsx)("div",{className:"flex-1 flex items-center justify-center relative",children:(e=>{if(e.mimeType)return e.mimeType.startsWith("image/");let t=e.url||e.name;return/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(t)})(e)&&e.url?(0,l.jsx)("img",{src:e.url,alt:e.name,className:"max-w-full max-h-full object-contain"}):(e=>{if(e.mimeType)return"application/pdf"===e.mimeType;let t=e.url||e.name;return/\.pdf$/i.test(t)})(e)?(0,l.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,l.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,l.jsx)("span",{className:"text-xs mt-1",children:"PDF"})]}),(0,l.jsx)("div",{className:"absolute bottom-2 right-2 bg-red-600 text-white text-xs px-2 py-1 rounded",children:"PDF"})]}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,l.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,l.jsx)("span",{className:"text-xs mt-1",children:(null==(r=e.name.split(".").pop())?void 0:r.toUpperCase())||"FILE"})]})}),(0,l.jsx)("div",{className:"px-3 py-2 border-t border-[#E3E3E3]",children:(0,l.jsx)("span",{className:"text-xs text-gray-500 break-all",children:e.name})})]}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsxs)("div",{className:"flex gap-2 mb-2",children:[e.url&&(0,l.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),t.preventDefault(),window.open(e.url,"_blank")},className:"cursor-pointer flex items-center justify-center text-grey hover:text-primary focus:outline-none bg-white border border-[#E3E3E3] rounded-full w-[35px] h-[35px]",title:"Preview file",children:(0,l.jsx)(c.bM,{className:"size-4"})}),(0,l.jsx)("button",{type:"button",onClick:e=>ei(t,e),className:"cursor-pointer flex items-center justify-center text-grey hover:text-red-700 focus:outline-none bg-white border border-[#E3E3E3] rounded-full w-[35px] h-[35px]",title:"Remove file",children:(0,l.jsx)(c.US,{className:"size-3"})})]})})]},"existing-".concat(e.id))};return(0,l.jsxs)("div",{className:(0,a.cn)("relative flex gap-6 items-start",m),children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:(0,a.cn)("overflow-hidden flex flex-col gap-4 lg:gap-6 justify-center border border-[#E3E3E3] rounded-[8px] py-4 px-3 lg:px-5 cursor-pointer transition-colors",T?"bg-gray-50 border-primary":"bg-white","grid"===A&&eo&&"flex-wrap w-[260px] h-[270px] rounded-[16px]","slider"===A&&"w-[260px] h-[270px] rounded-[16px]",!eo&&"grid"===A&&"w-full h-[120px] md:h-[120px] flex-row items-center",h),onDragOver:e=>{e.preventDefault(),e.stopPropagation(),U(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),U(!1)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),U(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0&&es(Array.from(e.dataTransfer.files))},onClick:()=>{Q.current&&Q.current.click()},children:[j&&(0,l.jsx)("div",{className:"flex justify-center lg:justify-start shrink-0 min-w-[65px] lg:min-w-auto pt-2 lg:pt-0",children:j}),(0,l.jsxs)("label",{className:(0,a.cn)("block lg:mb-1",f),children:[(0,l.jsx)("strong",{className:(0,a.cn)(eo&&"block mb-1","[&>span]:hidden [&>span]:lg:inline"),children:null!=g?g:O("common.formUploadLabel")})," ",(0,l.jsx)("br",{}),v?(0,l.jsx)("span",{className:"text-sm lg:text-base break-all pt-4 block",children:v}):(0,l.jsxs)("span",{className:"text-sm lg:text-base uppercase break-all pt-4 block",children:["(",w,") - max. ",b]})]})]}),eo&&"slider"===A&&(0,l.jsx)(x.A,{containerClass:"mt-3 justify-start",ref:er})]}),eo&&"grid"===A&&(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)("ul",{className:"flex gap-6 h-full w-full flex-wrap",children:N.map((e,t)=>(0,l.jsx)("li",{children:ec(e,t)},e instanceof File?t:"existing-".concat(e.id)))})}),eo&&"slider"===A&&(0,l.jsx)("div",{className:"flex-1 min-w-0 relative",children:(0,l.jsx)(d.RC,{modules:[u.Vx],spaceBetween:24,slidesPerView:1,navigation:{prevEl:null==(i=er.current)?void 0:i.prevButton,nextEl:null==(p=er.current)?void 0:p.nextButton},onSwiper:et,onBeforeInit:e=>{if("boolean"!=typeof e.params.navigation){let l=e.params.navigation;if(l){var t,r;l.prevEl=null==(t=er.current)?void 0:t.prevButton,l.nextEl=null==(r=er.current)?void 0:r.nextButton}}},breakpoints:{640:{slidesPerView:2},1024:{slidesPerView:3}},className:"h-full",children:N.map((e,t)=>(0,l.jsx)(d.qr,{children:ec(e,t)},e instanceof File?t:"existing-".concat(e.id)))})}),(0,l.jsx)("input",{ref:X,type:"file",className:"hidden",accept:w,multiple:y,onChange:e=>{e.target.files&&e.target.files.length>0&&(es(Array.from(e.target.files)),e.target.value="")},...D}),E&&(0,l.jsx)("div",{className:"mt-1 text-sm text-red-500 basis-full",children:E})]})});N.displayName="FormUpload";let k=(0,n.forwardRef)((e,t)=>{let{className:r,countryOptions:s,countryValue:o,defaultCountry:c,phoneValue:d="",value:u,onChange:x,placeholder:m="",errorMessage:h,isLoading:f=!1,disabled:v=!1,toggleVisibility:b,required:j=!1,label:w,phoneCountryCodeTestId:y,"data-testid":N}=e,k=s.filter(e=>
1e.phoneCode&&/^\+[1-9]/.test(e.phoneCode)),[C,E]=(0,n.useState)(o||c||(k.length>0?k[0]:null)),[F,L]=(0,n.useState)(d||""),S=(0,n.useRef)(null),R=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{if(R.current){R.current=!1;return}let e=u||d;if(e)try{let t=(0,p.L)(e);if(t){let r=k.find(e=>e.code===t.country);if(r)E(r),L(t.nationalNumber);else{let t=k.find(t=>e.startsWith(t.phoneCode));t?(E(t),L(e.substring(t.phoneCode.length))):L(e)}}else{let t=k.find(t=>e.startsWith(t.phoneCode));t?(E(t),L(e.substring(t.phoneCode.length))):L(e)}}catch(r){let t=k.find(t=>e.startsWith(t.phoneCode));t?(E(t),L(e.substring(t.phoneCode.length))):L(e)}else L("")},[u,d,k]),(0,n.useEffect)(()=>{o&&o!==C&&E(o)},[o]),(0,n.useEffect)(()=>{c&&!o&&""===F&&(x("",{phoneNumber:"",country:C}),E(c))},[c]),(0,l.jsxs)("div",{className:(0,a.cn)("phone-field relative",r),"data-testid":N,children:[w&&(0,l.jsxs)("label",{className:"mb-1 block text-sm font-medium text-gray-700",children:[w,j&&(0,l.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-0 relative",children:[(0,l.jsx)("div",{className:"w-3/12 min-w-[140px]",children:(0,l.jsx)(i.A,{name:"phoneCountry","data-testid":y,value:C,onChange:e=>{E(e),F&&x("".concat(e.phoneCode).concat(F),{phoneNumber:F,country:e})},options:k,getOptionLabel:e=>"".concat(e.icon," ").concat(e.name),getOptionValue:e=>e.code,formatOptionLabel:e=>{var t;return(0,l.jsx)("div",{className:"flex items-center",children:(0,l.jsxs)("span",{className:"pl-1",children:[(0,l.jsx)("span",{className:"mr-1.5 fi fi-".concat(null==e||null==(t=e.code)?void 0:t.toLowerCase())})," ",e.name]})})},components:{SingleValue:e=>{var t;let{data:r}=e;return(0,l.jsx)("div",{className:"flex items-center gap-3",children:(0,l.jsxs)("span",{className:"pl-1",children:[(0,l.jsx)("span",{className:"mr-1.5 fi fi-".concat(null==r||null==(t=r.code)?void 0:t.toLowerCase())})," ",r.phoneCode]})})}},styles:{menu:e=>({...e,minWidth:"280px"})},placeholder:"",isLoading:f,isDisabled:v,className:"rounded-r-none"})}),(0,l.jsxs)("div",{className:"w-9/12 relative shrink-1",children:[(0,l.jsx)(g,{ref:S,type:"tel","data-testid":N,value:F,onChange:e=>{let t=e.target.value;R.current=!0,L(t),C&&x("".concat(C.phoneCode).concat(t),{phoneNumber:t,country:C})},className:"rounded-l-none border-l-0",placeholder:m,disabled:v,required:j}),b&&(0,l.jsx)("div",{className:"absolute top-0 bottom-0 right-0",children:b})]})]}),h&&(0,l.jsx)("div",{className:"mt-1 text-sm text-red-500",children:h})]})});m.Group=h,m.Label=f,m.Control=g,m.Check=v,m.Select=b,m.Text=j,m.Textarea=w,m.TextareaTags=y,m.Upload=N,m.PhoneInput=k},72576:(e,t,r)=>{r.d(t,{A:()=>j});var l=r(95155),n=r(12115),s=r(45953),a=r(61543),i=r(4738),o=r(64269),c=r(24274),d=r(16714);let u=e=>{let{data:t,isSelected:r,selectProps:n}=e,a=n.primaryColor||"#000000";return(0,l.jsx)(s.c.Option,{...e,children:(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[t.icon&&(0,l.jsx)("span",{className:"mr-2",children:t.icon}),t.label]}),r&&(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:a,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]})})},p=e=>{let{data:t}=e;return(0,l.jsx)(s.c.SingleValue,{...e,children:(0,l.jsxs)("div",{className:"flex items-center",children:[t.icon&&(0,l.jsx)("span",{className:"mr-2",children:t.icon}),t.label]})})},x=e=>{let{data:t}=e;return(0,l.jsx)(s.c.MultiValue,{...e,children:(0,l.jsxs)("div",{className:"flex items-center",children:[t.icon&&(0,l.jsx)("span",{className:"mr-1",children:t.icon}),t.label||t.title]})})},m=e=>(0,l.jsx)(s.c.MultiValueRemove,{...e,children:(0,l.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M6 18L18 6M6 6l12 12"})})}),h=e=>(0,l.jsx)(s.c.ClearIndicator,{...e,children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M6 18L18 6M6 6l12 12"})})}),f=e=>(0,l.jsx)(s.c.Group,{...e,children:(0,l.jsx)("div",{className:"group",children:(0,l.jsx)("div",{className:"group-options",children:e.children})})}),g=e=>(0,l.jsx)(s.c.DropdownIndicator,{...e,children:(0,l.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M19 9l-7 7-7-7"})})}),v=e=>{let{children:t,...r}=e,{t:n}=(0,c.Bd)(),{getValue:a,isMulti:i}=r;if(!i)return(0,l.jsx)(s.c.ValueContainer,{...r,children:t});let o=a().length,d=r.selectProps.inputValue;return o<2?(0,l.jsx)(s.c.ValueContainer,{...r,children:t}):(0,l.jsxs)(s.c.ValueContainer,{...r,children:[!d&&(0,l.jsxs)("div",{className:"absolute left-2 text-black pointer-events-none whitespace-nowrap text-ellipsis",children:[o," ",n("personal.form.selected")]}),t[1]]})},b=e=>{let{getValue:t,options:r}=e,n=t(),a=(e,t)=>{for(let r of e)if("options"in r&&r.options){if(a(r.options,t))return!0}else if(r["@id"]===t||r.value===t)return!0;return!1},i=[];
1n.forEach(e=>{a(r,e["@id"]||e.value)||i.push(e)});let o=e.selectProps.primaryColor||"#000000",c=e.selectProps.inputValue,d=c&&""!==c.trim(),u=i.length>0&&(0,l.jsx)(l.Fragment,{children:i.map(t=>(0,l.jsx)("div",{className:"px-3 py-2 cursor-pointer rounded hover:bg-[rgba(var(--color-primary-rgb),0.1)]",onClick:r=>{r.stopPropagation();let l=e.selectProps;if(l.onChange&&l.isMulti){let e=n.filter(e=>(e["@id"]||e.value)!==(t["@id"]||t.value));l.onChange(e,{action:"remove-value",removedValue:t})}},children:(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,l.jsx)("span",{children:t.label}),(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:o,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]})},t["@id"]||t.value))});return(0,l.jsx)(s.c.MenuList,{...e,children:d?(0,l.jsxs)(l.Fragment,{children:[e.children,u]}):(0,l.jsxs)(l.Fragment,{children:[u,e.children]})})},j=e=>{let{options:t,loadOptions:r,defaultOptions:j=!1,apiResponseTransformer:w,debounceDelay:y=300,minInputLength:N=0,icon:k,iconClassName:C,containerClassName:E,"data-testid":F,controlClassName:L,onChange:S,value:R,isSearchable:B=!0,placeholder:V="Select...",hideActivePlaceholder:P=!1,placeholderColor:z="#909090",isMulti:A=!1,errorMessage:D,required:O=!1,getOptionValue:M,getOptionLabel:T,labelField:U,grey:W,closeMenuOnSelect:I=!0,customHeight:H,blackText:_,styles:q,fontSize:K,...G}=e,{t:$}
1=(0,c.Bd)(),[J,Y]=(0,n.useState)(!1),Q=(0,n.useRef)(null),X=(0,d.usePrimaryColor)(),Z=(0,n.useId)(),ee=(0,n.useCallback)(async e=>{if(!r||e.length<N)return[];try{Y(!0);let t=await r(e);if(w)return w(t);if(Array.isArray(t)){if(t.some(e=>"options"in e)||t.length>0&&"value"in t[0]&&"label"in t[0])return t;return t.map(e=>({value:e["@id"]||e.id||e.value||String(e),"@id":e["@id"]||e.id||e.value||String(e),label:U?e[U]||String(e):e.name||e.label||e.title||String(e),icon:e.icon}))}if(t&&"object"==typeof t&&"data"in t){let e=t.data;if(e["hydra:member"])return e["hydra:member"].map(e=>({value:e["@id"]||e.id||e.value,"@id":e["@id"]||e.id||e.value,label:U?e[U]:e.name||e.label||e.title,icon:e.icon}));if(Array.isArray(e))return e.map(e=>({value:e["@id"]||e.id||e.value,"@id":e["@id"]||e.id||e.value,label:U?e[U]:e.name||e.label||e.title,icon:e.icon}))}return[]}catch(e){return console.error("Error loading options:",e),[]}finally{Y(!1)}},[r,w,N,U]),et=(0,n.useCallback)((e,t)=>{Q.current&&clearTimeout(Q.current),Q.current=setTimeout(async()=>{t(await ee(e))},y)},[ee,y]),er=A?Array.isArray(R)&&R.length>0:null!=R,el={control:(e,t)=>({...e,color:"#000",fontSize:K||"16px",minHeight:K?"unset":768>(window.innerWidth||1024)?"57px":H?"50px":"44px",borderRadius:(null==L?void 0:L.includes("rounded-tr-none"))||(null==L?void 0:L.includes("rounded-br-none"))?"0":"8px",borderColor:D?"#ef4444":t.isFocused?"var(--color-primary)":W?"#F8F8FA":"#E3E3E3",boxShadow:D?"0 0 0 1px #ef4444":t.isFocused?"0 0 0 1px var(--color-primary)":"none","&:hover":{borderColor:D?"#ef4444":t.isFocused?"var(--color-primary)":"#E3E3E3"},padding:k?"0 5px 0 38px":"0 8px 0 10px",backgroundColor:W?"#F8F8FA":"white"}),menu:e=>({...e,borderRadius:"8px",overflow:"hidden",zIndex:20}),menuList:e=>({...e,padding:"4px"}),option:(e,t)=>({...e,backgroundColor:t.isFocused?"rgba(var(--color-primary-rgb), 0.1)":"transparent",color:"inherit",borderRadius:"4px",fontSize:K||"16px","&:active":{backgroundColor:"rgba(var(--color-primary-rgb), 0.2)"}}),valueContainer:e=>({...e,padding:K?"0px 8px":"2px 8px"}),input:e=>({...e,color:"#000",margin:"0",padding:"0"}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"8px",color:_?"#000":e.color,display:(null==L?void 0:L.includes("rounded-tr-none"))||(null==L?void 0:L.includes("rounded-br-none"))?"none":e.display}),clearIndicator:e=>({...e,color:_?"#000":e.color,display:(null==L?void 0:L.includes("rounded-tr-none"))||(null==L?void 0:L.includes("rounded-br-none"))?"none":e.display}),multiValue:(e,t)=>{var r;let l=t.selectProps,n=(null==l||null==(r=l.value)?void 0:r.length)||0;return{...e,display:n>=2?"none":"flex"}},group:e=>({...e,paddingBottom:"10px",paddingLeft:"20px"}),placeholder:e=>({...e,color:_?"#000":z,position:"absolute",left:"5px",top:H?"4px":"2px",marginLeft:"0",transition:"all 0.2s ease",transform:"translateY(0)",fontSize:K||"16px",lineHeight:K?"1":"inherit"}),groupHeading:(e,t)=>{var r;let l=!!(null==(r=t.data)?void 0:r.label);return{...e,fontSize:"0.85em",fontWeight:600,color:"#000",marginBottom:l?"4px":0,marginLeft:"-20px",paddingTop:l?e.paddingTop:0,paddingBottom:l?e.paddingBottom:0,display:l?e.display:"none"}},multiValue:e=>({...e,backgroundColor:"rgba(var(--color-primary-rgb), 0.1)",borderRadius:"4px"}),multiValueLabel:e=>({...e,color:"#000",padding:"2px 6px 2px 8px",fontSize:"0.85em"}),multiValueRemove:e=>({...e,color:"#000",":hover":{backgroundColor:"transparent",color:"red"}}),valueContainer:e=>({...e,padding:er?"2px 2px 0 6px":"2px 2px",display:"flex",flexWrap:A?"wrap":"nowrap"})};if(q)for(let e of Object.keys(q)){let t=q[e],r=el[e];"function"==typeof t&&"function"==typeof r?el[e]=(e,l)=>({...r(e,l),...t(e,l)}):void 0!==t&&(el[e]=t)}let en={value:R,onChange:e=>{S&&S(e)},placeholder:er?" ":O?"".concat(V," *"):V,isSearchable:B,hideSelectedOptions:!1,isMulti:A,getOptionValue:M,getOptionLabel:T,closeMenuOnSelect:I,primaryColor:X,instanceId:Z,loadingMessage:()=>$("types.treeSelect.loading"),noOptionsMessage:()=>$("types.treeSelect.noOptions"),components:{Option:u,SingleValue:p,MultiValue:x,MultiValueRemove:m,ClearIndicator:h,Group:f,MenuList:b,DropdownIndicator:g,ValueContainer:A?v:s.c.ValueContainer},styles:el,className:"w-full",classNamePrefix:"enhanced-select",classNames:{control:()=>L||""},...G};return(0,l.jsxs)("div",{className:(0,o.cn)("relative",E),"data-testid":F,children:[k&&(0,l.jsx)("div",{className:(0,o.cn)("absolute inset-y-0 left-0 pl-4.25 flex items-center pointer-events-none z-1",_||er?"text-black":"text-[#7b7b7b]",C),children:k}),er&&!P&&(0,l.jsxs)("div",{className:"absolute px-2 text-xs text-[#ccc] transform bg-white translate-y-[-8px] translate-x-[10px] z-100 transition-all",children:[V,O&&(0,l.jsx)("span",{className:"ml-1",children:"*"})]}),r?(0,l.jsx)(i.A,{...en,loadOptions:et,defaultOptions:j,cacheOptions:!0,isLoading:J}):(0,l.jsx)(a.Ay,{...en,options:t||[]}),D&&(0,l.jsx)("div",{className:"mt-1 text-sm text-red-500",children:D})]})}},85665:(e,t,r)=>{r.d(t,{A:()=>i});var l=r(95155);r(12115);var n=r(64269),s=r(72576),a=r(41052);let i=e=>{let{options:t,value:r,onChange:i,placeholder:o="Select...",icon:c,className:d,isSearchable:u=!0,hideActivePlaceholder:p=!1,placeholderColor:x="#909090",errorMessage:m,required:h=!1,getOptionValue:f,getOptionLabel:g,toggleVisibility:v,...b}=e;return(0,l.jsxs)("div",{className:"relative selectWithIcon",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(s.A,{options:t,value:r,onChange:i,placeholder:o,icon:c,isSearchable:u,containerClassName:(0,n.cn)(d,m&&"border-red-500 ring-1 ring-red-500 rounded-[8px]"),hideActivePlaceholder:p,placeholderColor:x,required:h,getOptionValue:f,getOptionLabel:g,...b}),v&&(0,l.jsx)("div",{className:"toggleVisibility absolute top-0 bottom-0 right-0",children:v})]}),m&&(0,l.jsx)(a.ay,{className:"text-red-500",children:m})]})}},96538:(e,t,r)=>{r.d(t,{A:()=>c});var l=r(95155),n=r(12115),s=r(64269),a=r(64837),i=r(53054);let o=(0,n.forwardRef)((e,t)=>{let{prevButtonClass:r="swiper-button-prev-custom",nextButtonClass:o="swiper-button-next-custom",containerClass:c="",iconSize:d=20,variant:u="primary"}=e,p=(0,n.useRef)(null),x=(0,n.useRef)(null);(0,n.useImperativeHandle)(t,()=>({prevButton:p.current,nextButton:x.current}));let m=(0,s.cn)("rounded-full w-10 h-10 flex items-center justify-center shadow-md hover:cursor-pointer transition-all","primary"===u?"bg-primary hover:bg-(--primary_dark) text-white":"bg-white hover:bg-white/80 text-black","[&.swiper-button-disabled]:cursor-not-allowed [&.swiper-button-disabled]:opacity-50");return(0,l.jsxs)("div",{className:(0,s.cn)("flex justify-end gap-3 lg:gap-4 shrink-0",c),children:[(0,l.jsxs)("button",{ref:p,className:(0,s.cn)(m,r),children:[(0,l.jsx)("span",{className:"sr-only",children:"Previous"}),(0,l.jsx)(a.default,{width:d,height:d})]}),(0,l.jsxs)("button",{ref:x,className:(0,s.cn)(m,o),children:[(0,l.jsx)("span",{className:"sr-only",children:"Next"}),(0,l.jsx)(i.default,{width:d,height:d})]})]})});
1o.displayName="CarouselNavigation";let c=o}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.