module.exports=[254799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},522734,(a,b,c)=>{b.exports=a.x("fs",()=>require("fs"))},446786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},688947,(a,b,c)=>{b.exports=a.x("stream",()=>require("stream"))},814747,(a,b,c)=>{b.exports=a.x("path",()=>require("path"))},224361,(a,b,c)=>{b.exports=a.x("util",()=>require("util"))},449719,(a,b,c)=>{b.exports=a.x("assert",()=>require("assert"))},406461,(a,b,c)=>{b.exports=a.x("zlib",()=>require("zlib"))},792509,(a,b,c)=>{b.exports=a.x("url",()=>require("url"))},524836,(a,b,c)=>{b.exports=a.x("https",()=>require("https"))},921517,(a,b,c)=>{b.exports=a.x("http",()=>require("http"))},925328,(a,b,c)=>{b.exports=a.x("http2",()=>require("http2"))},870722,(a,b,c)=>{b.exports=a.x("tty",()=>require("tty"))},427699,(a,b,c)=>{b.exports=a.x("events",()=>require("events"))},596221,a=>{"use strict";let b=(0,a.i(170106).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["Loader2",0,b],596221)},669520,a=>{"use strict";let b=(0,a.i(170106).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);a.s(["RefreshCw",0,b],669520)},177156,a=>{"use strict";let b=(0,a.i(170106).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);a.s(["Eye",0,b],177156)},603314,a=>{"use strict";let b=(0,a.i(170106).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);a.s(["Shield",0,b],603314)},400210,a=>{"use strict";let b=(0,a.i(170106).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],400210)},797063,a=>{"use strict";let b=(0,a.i(170106).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);a.s(["Info",0,b],797063)},1631,a=>{"use strict";let b=(0,a.i(170106).default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);a.s(["Smartphone",0,b],1631)},713513,a=>{"use strict";let b=(0,a.i(170106).default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);a.s(["Camera",0,b],713513)},585711,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("403eb3895a4136f51ce157243d533ce8105326106c",b.callServer,void 0,b.findSourceMapURL,"getAddressesAction");a.s(["getAddressesAction",0,c])},874646,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("00ba48c3ba0d04c37d50232fe4b4e7d47758f30f43",b.callServer,void 0,b.findSourceMapURL,"getWardsAction");a.s(["getWardsAction",0,c])},114548,a=>{"use strict";let b=(0,a.i(170106).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);a.s(["Save",0,b],114548)},903012,a=>{"use strict";var b=a.i(187924);a.s(["default",0,({options:a=[],value:c,onChange:d,horizontal:e=!1,columns:f=2,hideCircle:g=!1})=>Array.isArray(a)?"function"!=typeof d?(console.error("RadioGroup: onChange must be a function"),null):(0,b.jsx)("div",{className:`mb-2 ${e?"flex flex-wrap":"flex flex-row flex-wrap"}`,children:a.map(a=>{let e=c===a.value,h=`${100/f-1}%`;return(0,b.jsxs)("button",{type:"button",onClick:()=>d(a.value),className:`
              flex items-center py-1.5 px-2 rounded-lg border transition-all mb-2 mr-[1%] min-h-[32px]
              ${e?"border-primary bg-blue-50":"border-gray-300 bg-white hover:border-primary/50"}
            `,style:{width:h},children:[!g&&(0,b.jsx)("div",{className:`
                  w-5 h-5 rounded-full border-2 mr-2.5 flex items-center justify-center flex-shrink-0
                  ${e?"border-primary":"border-gray-300"}
                `,children:e&&(0,b.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-primary"})}),(0,b.jsx)("span",{className:`
                text-[15px] font-bangla truncate flex-1 ${g?"text-center":"text-left"}
                ${e?"text-primary font-medium":"text-gray-700"}
              `,children:a.label})]},a.value.toString())})}):(console.error("RadioGroup: options must be an array"),null)])},108838,a=>{"use strict";let b=(0,a.i(170106).default)("scan-line",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]);a.s(["ScanLine",0,b],108838)},660912,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(773320),e=a.i(435487),f=a.i(781560),g=a.i(816201),h=a.i(292e3),i=a.i(838632),j=a.i(104720),k=a.i(633508),l=a.i(587532);let m=(0,a.i(170106).default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);var n=a.i(797063),o=a.i(405784);a.s(["default",0,({requiredDocuments:a,uploadedFiles:p,onFileUploaded:q,onFileRemoved:r})=>{let[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(null),[w,x]=(0,c.useState)(""),[y,z]=(0,c.useState)(!1),A=(0,c.useRef)({}),B=["image/jpeg","image/jpg","image/png","application/pdf"],C=async(b,c)=>{if(!c||0===c.length)return;let d=c[0],e=B.includes(d.type)?d.size>2097152?"ফাইলের আকার অবশ্যই ২ MB এর কম হতে হবে":null:"শুধুমাত্র JPG, PNG এবং PDF ফাইল আপলোড করা যাবে";if(e)return void alert(e);v(b);try{let c=await new Promise((a,b)=>{let c=new FileReader;c.onload=()=>{let b=c.result.split(",")[1];a(b)},c.onerror=b,c.readAsDataURL(d)}),e=a.find(a=>a.id===b),f=null,g=!1,h=null;for(let a=1;a<=3;a++)try{if(console.log(`🔄 [Correction] File upload attempt ${a} for document ${b}`),a>1){console.log(`🔄 [Correction] Regenerating session before attempt ${a}`);try{(await fetch("/api/bdris/refresh-session",{method:"POST",credentials:"include"})).ok?console.log(`✅ [Correction] Session refreshed successfully for attempt ${a}`):console.warn(`⚠️ [Correction] Session refresh failed on attempt ${a}`)}catch(b){console.warn(`⚠️ [Correction] Session refresh error on attempt ${a}:`,b)}}let e=await fetch("/api/bdris/api-caller",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({baseUrl:"https://bdris.gov.bd/br/application",apiUrl:"https://bdris.gov.bd/admin/doc/upload",method:"POST",fileUpload:!0,body:{attachmentType:b,attachmentSubType:"-1",files:{name:d.name,type:d.type,base64:c}}})}),i=await e.json();if(console.log(`📡 [Correction] Upload attempt ${a} response:`,i),i.success&&i.data&&!i.data.error){g=!0,h=i,console.log(`✅ [Correction] Upload successful on attempt ${a}`);break}f=i,i.data&&!0===i.data.error?console.warn(`⚠️ [Correction] BDRIS error on attempt ${a}:`,i.data.message||i.error):console.warn(`⚠️ [Correction] Upload failed on attempt ${a}:`,i.error||"Unknown error"),a<3&&(console.log("⏳ [Correction] Waiting 1 second before retry..."),await new Promise(a=>setTimeout(a,1e3)))}catch(b){console.error(`💥 [Correction] Upload attempt ${a} failed with exception:`,b),f={error:!0,message:b instanceof Error?b.message:"Network error",exception:b},a<3&&(console.log("⏳ [Correction] Waiting 1 second before retry..."),await new Promise(a=>setTimeout(a,1e3)))}if(!g||!h){let a=f?.data?.message||f?.message||f?.error||"ফাইল আপলোড করতে সমস্যা হয়েছে। অনুগ্রহ করে আবার চেষ্টা করুন।";console.error("❌ [Correction] All upload attempts failed. Last error:",f),alert(`আপলোড ব্যর্থ হয়েছে (৩ বার চেষ্টা করা হয়েছে)

ত্রুটি বার্তা: ${a}`);return}let i={documentType:b,name:e?.label||d.name,file:d,timestamp:new Date().toISOString(),bdrisResponse:h.data,files:h.data?.files||[]};q(i)}catch(a){console.error("💥 [Correction] Upload process failed:",a),alert("ফাইল আপলোড প্রক্রিয়ায় সমস্যা হয়েছে। অনুগ্রহ করে আবার চেষ্টা করুন।")}finally{v(null)}},D=()=>{t(null)},E=b=>{let c=a.find(a=>a.label===b);return!!c&&p.some(a=>a.documentType===b||a.documentType===c.id)},F=a.filter(a=>{if(!w.trim())return!0;let b=w.toLowerCase();return a.label.toLowerCase().includes(b)}),G=w||y?F:F.slice(0,10),H=!w&&F.length>10,I=a.filter(a=>a.required);I.every(a=>E(a.label)),I.filter(a=>E(a.label)).length;let J=F.filter(a=>a.required),K=J.filter(a=>E(a.label)).length;return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"rounded-lg border border-primary/20 bg-gradient-to-r from-primary/10 to-primary/5 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/20",children:(0,b.jsx)(d.Upload,{className:"h-6 w-6 text-primary"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-gray-900 font-bangla text-lg font-semibold",children:"সংশোধনের ডকুমেন্ট"}),(0,b.jsxs)("p",{className:"text-gray-600 font-bangla text-sm",children:[p.length," টি ডকুমেন্ট আপলোড করা হয়েছে"]})]})]}),(0,b.jsxs)("div",{className:"text-right",children:[(0,b.jsx)("div",{className:"text-2xl font-bold text-primary",children:p.length}),(0,b.jsx)("div",{className:"text-gray-600 font-bangla text-xs",children:"আপলোড সম্পন্ন"})]})]})}),(0,b.jsxs)("div",{className:"border-gray-200 rounded-lg border bg-white p-3",children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(l.Search,{className:"text-gray-400 absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 transform"}),(0,b.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:"ডকুমেন্ট খুঁজুন...",className:"border-gray-300 w-full rounded-lg border py-2 pl-10 pr-9 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"}),w&&(0,b.jsx)("button",{onClick:()=>x(""),className:"text-gray-400 hover:text-gray-600 absolute right-3 top-1/2 -translate-y-1/2 transform",children:(0,b.jsx)(k.X,{className:"h-4 w-4"})})]}),w&&(0,b.jsxs)("div",{className:"text-gray-600 mt-2 font-bangla text-xs",children:[F.length," টি পাওয়া গেছে •"," ",K,"/",J.length," আবশ্যক আপলোড সম্পন্ন"]})]}),(0,b.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:0===G.length&&w?(0,b.jsxs)("div",{className:"bg-gray-50 border-gray-200 rounded-lg border py-8 text-center",children:[(0,b.jsx)(l.Search,{className:"text-gray-400 mx-auto mb-3 h-12 w-12"}),(0,b.jsx)("h4",{className:"text-gray-900 mb-2 font-bangla font-semibold",children:"কোন ডকুমেন্ট পাওয়া যায়নি"}),(0,b.jsxs)("p",{className:"text-gray-600 mb-3 font-bangla text-sm",children:['"',w,'" দিয়ে কোন ডকুমেন্ট খুঁজে পাওয়া যায়নি']}),(0,b.jsx)("button",{onClick:()=>x(""),className:"font-bangla text-sm font-medium text-primary transition-colors hover:text-primary/80",children:"সার্চ পরিষ্কার করুন"})]}):G.map(c=>{var k;let l,n=E(c.label),o=(b=>{let c=a.find(a=>a.label===b);if(c)return p.find(a=>a.documentType===b||a.documentType===c.id)})(c.label),q=u===c.id,v=s===c.id;return(0,b.jsxs)("div",{className:"border-gray-200 relative overflow-hidden rounded-md border bg-white transition-shadow hover:shadow-sm",children:[(0,b.jsx)("div",{className:"border-gray-100 border-b px-3 py-2",children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-1.5",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-center space-x-1.5",children:[n?(0,b.jsx)(g.CheckCircle,{className:"h-4 w-4 flex-shrink-0 text-green-500"}):c.required?(0,b.jsx)(h.AlertCircle,{className:"h-4 w-4 flex-shrink-0 text-amber-500"}):(0,b.jsx)(m,{className:"text-gray-400 h-4 w-4 flex-shrink-0"}),(0,b.jsx)("h4",{className:"text-gray-900 truncate font-bangla text-sm font-bold",children:c.label})]}),c.required&&(0,b.jsx)("span",{className:"bg-red-100 text-red-700 flex-shrink-0 rounded-full px-2 py-0.5 font-bangla text-xs",children:"আবশ্যক"})]})}),(0,b.jsx)("div",{className:"p-1.5",children:n?o&&(0,b.jsx)("div",{className:"flex min-h-[60px] items-center rounded-md border-2 border-dashed border-green-300 bg-green-50 p-2",children:(0,b.jsxs)("div",{className:"flex w-full items-center justify-between gap-1.5",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-center space-x-1.5",children:[(k=o.name,["jpg","jpeg","png"].includes((l=k.split(".").pop()?.toLowerCase())||"")?(0,b.jsx)(i.Image,{className:"h-4 w-4 text-primary"}):"pdf"===l?(0,b.jsx)(j.FileText,{className:"h-4 w-4 text-secondary"}):(0,b.jsx)(e.File,{className:"text-gray-500 h-4 w-4"})),(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)("p",{className:"text-gray-900 truncate text-xs font-medium",children:o.name})})]}),(0,b.jsx)("button",{onClick:()=>{var a;return a=o.documentType,void(r&&r(a))},className:"text-gray-400 hover:text-red-500 flex-shrink-0 rounded p-0.5 transition-colors",title:"মুছে ফেলুন",children:(0,b.jsx)(f.Trash2,{className:"h-3 w-3"})})]})}):(0,b.jsxs)("div",{className:`flex min-h-[60px] cursor-pointer items-center justify-center rounded-md border border-dashed border-slate-400 p-2 text-center transition-all ${v?"scale-[1.02] border-primary bg-primary/5":"border-gray-400 hover:bg-gray-50 hover:border-primary"} ${q?"pointer-events-none opacity-60":""} `,onDrop:a=>{var b;return b=c.id,void(a.preventDefault(),t(null),C(b,a.dataTransfer.files))},onDragOver:a=>{var b;return b=c.id,void(a.preventDefault(),t(b))},onDragLeave:D,onClick:()=>{var a;let b;return!q&&(a=c.id,void((b=A.current[a])&&b.click()))},children:[q?(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{className:"mx-auto h-4 w-4 animate-spin rounded-full border-b-2 border-primary"}),(0,b.jsx)("p",{className:"text-gray-600 font-bangla text-[10px]",children:"আপলোড হচ্ছে..."})]}):(0,b.jsxs)("div",{className:"flex items-center justify-center gap-1.5",children:[(0,b.jsx)(d.Upload,{className:"text-gray-400 h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("div",{className:"text-left",children:[(0,b.jsx)("p",{className:"text-gray-700 font-bangla text-xs font-medium leading-tight",children:"ফাইল নির্বাচন করুন"}),(0,b.jsx)("p",{className:"text-gray-500 font-bangla text-[11px] leading-tight",children:"বা ড্র্যাগ করুন"})]})]}),(0,b.jsx)("input",{ref:a=>{A.current[c.id]=a},type:"file",accept:".jpg,.jpeg,.png,.pdf",onChange:a=>C(c.id,a.target.files),className:"hidden"})]})})]},c.id)})}),H&&!y&&(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsxs)("button",{onClick:()=>z(!0),className:"flex items-center space-x-2 rounded-lg border-2 border-primary bg-white px-6 py-2.5 font-bangla text-sm font-medium text-primary shadow-sm transition-all hover:bg-primary hover:text-white",children:[(0,b.jsxs)("span",{children:["আরও (",F.length-10,"টি ডকুমেন্ট)"]}),(0,b.jsx)(o.ChevronDown,{className:"h-4 w-4"})]})}),y&&H&&(0,b.jsx)("div",{className:"flex justify-center",children:(0,b.jsxs)("button",{onClick:()=>z(!1),className:"border-gray-300 text-gray-700 hover:bg-gray-50 flex items-center space-x-2 rounded-lg border-2 bg-white px-6 py-2.5 font-bangla text-sm font-medium shadow-sm transition-all",children:[(0,b.jsx)("span",{children:"কম দেখান"}),(0,b.jsx)(o.ChevronDown,{className:"h-4 w-4 rotate-180 transform"})]})}),(0,b.jsx)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3",children:(0,b.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,b.jsx)(n.Info,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-blue-600"}),(0,b.jsxs)("div",{className:"font-bangla text-xs text-blue-800",children:[(0,b.jsx)("p",{className:"mb-1 font-medium",children:"সহায়তা:"}),(0,b.jsxs)("div",{className:"space-y-0.5 text-blue-700",children:[(0,b.jsx)("p",{children:"• সর্বোচ্চ ফাইল সাইজ: ২ MB, ফরম্যাট: JPG, PNG, PDF"}),(0,b.jsx)("p",{children:"• ফাইল ড্র্যাগ করে আপলোড করতে পারেন"}),(0,b.jsx)("p",{children:"• আবশ্যক ডকুমেন্টগুলো অবশ্যই আপলোড করতে হবে"})]})]})]})})]})}],660912)},488474,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_app_lib_actions_entrepreneur_entrepreneur_actions_ts_0lbb4~_._.js"].map(b=>a.l(b))).then(()=>b(827966)))}];

//# sourceMappingURL=%5Broot-of-the-server%5D__0x2kfev._.js.map