@invoice-sdk/widget 1.126.0 → 1.127.0

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.
@@ -1,5 +1,5 @@
1
- import { c as O, f as G, e as te, b as ne, o as re, p as ie, s as ae, q as oe } from "./loading-Bs9il-yL.js";
2
- import { t, c as Q, k as se } from "./index-CpTaTzi5.js";
1
+ import { c as O, f as G, e as te, b as ne, o as re, p as ie, s as ae, q as oe } from "./loading-BR5rNYi6.js";
2
+ import { t, c as Q, k as se } from "./index-DIqFZUIm.js";
3
3
  function B(i) {
4
4
  const n = i.trim();
5
5
  return n ? n.length < 2 || n.length > 250 ? { valid: !1, error: t("length_2_250") } : /[<>:"\/\\|?*@#$%!^]/.test(n) ? { valid: !1, error: t("invalid_characters") } : { valid: !0 } : { valid: !1, error: t("required_name") };
@@ -5108,7 +5108,7 @@ function ed(e) {
5108
5108
  }
5109
5109
  async function Gd(e) {
5110
5110
  if (ce(e), !TA) {
5111
- const { InvoiceRegisterWidget: i } = await import("./widget-DLORQyjI.js");
5111
+ const { InvoiceRegisterWidget: i } = await import("./widget-BaJrubVV.js");
5112
5112
  TA = i;
5113
5113
  }
5114
5114
  const A = Ee(e.selector), t = await TA(
@@ -5129,7 +5129,7 @@ async function Gd(e) {
5129
5129
  }
5130
5130
  async function Hd(e) {
5131
5131
  if (ce(e), !WA) {
5132
- const { EContractWidget: t } = await import("./widget-DLORQyjI.js");
5132
+ const { EContractWidget: t } = await import("./widget-BaJrubVV.js");
5133
5133
  WA = t;
5134
5134
  }
5135
5135
  const A = Ee(e.selector);
@@ -5175,7 +5175,7 @@ async function bd(e) {
5175
5175
  }
5176
5176
  };
5177
5177
  }
5178
- XA || (XA = (await import("./index-BYnZd_pX.js")).createInvoiceRequestFlow);
5178
+ XA || (XA = (await import("./index-BI9WQkMW.js")).createInvoiceRequestFlow);
5179
5179
  const o = XA({
5180
5180
  uuid: i,
5181
5181
  orderInfo: n,
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as s, B as e, z as i, A as n, J as o, E as r, D as g, F as c } from "./index-CpTaTzi5.js";
1
+ import { H as s, B as e, z as i, A as n, J as o, E as r, D as g, F as c } from "./index-DIqFZUIm.js";
2
2
  export {
3
3
  s as checkContractStatus,
4
4
  e as getSettings,
package/dist/index.umd.js CHANGED
@@ -126,7 +126,7 @@
126
126
  </svg>`:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
127
127
  <path d="M9 6L15 12L9 18" stroke="#0E121B" stroke-width="2"
128
128
  stroke-linecap="round" stroke-linejoin="round"/>
129
- </svg>`,f}const m=g("prev"),C=g("next");m.style.left="8px",C.style.right="8px",s.appendChild(m),s.appendChild(C);let w=n,Q=A,B=a;const E=()=>window.matchMedia("(max-width: 414px)").matches;function p(){const M=u.getBoundingClientRect(),f=s.getBoundingClientRect(),S=M.top-f.top+M.height/2;m.style.top=`${S}px`,C.style.top=`${S}px`,m.style.transform="translateY(-50%)",C.style.transform="translateY(-50%)"}function x(){const M=u.firstElementChild;return M?M.getBoundingClientRect().width+24:300}function N(M){u.scrollBy({left:M*x(),behavior:"smooth"})}function T(){if(E())return;const M=u.scrollWidth-u.clientWidth;m.disabled=u.scrollLeft<=0,C.disabled=u.scrollLeft>=M-2}m.addEventListener("click",()=>N(-1)),C.addEventListener("click",()=>N(1)),u.addEventListener("scroll",T);function k(){if(u.innerHTML="",!w||w.length===0){const M=document.createElement("div");M.className="wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600",M.innerText=q("noPackageFound")||"Không tìm thấy gói phù hợp",u.appendChild(M);return}w.forEach(M=>{const f=M._id===B,S=Q.includes(M.code),{container:V}=Ps({pkg:M,type:t,isDiscounted:S,promotion:e,isSelected:f,isRenew:i,onSelect:()=>{c((h||i)&&f?"":M._id)}});V.classList.add("wgt:snap-start"),u.appendChild(V)}),requestAnimationFrame(()=>{p(),T()})}k();let H=!1,P=0,b=0;u.addEventListener("mousedown",M=>{H=!0,u.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),P=M.pageX,b=u.scrollLeft});const L=()=>{H&&(H=!1,u.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",L),u.addEventListener("mouseleave",L),u.addEventListener("mousemove",M=>{H&&(M.preventDefault(),u.scrollLeft=b-(M.pageX-P)*1.5)}),u.addEventListener("wheel",M=>{M.preventDefault(),u.scrollLeft+=M.deltaY},{passive:!1});const y=new ResizeObserver(()=>p());return y.observe(u),y.observe(s),{container:o,render:k,setSelectedPackageId(M){B=M,k()},updateData(M,f=null,S=null){w=M||w,f!==null&&(Q=f),S!==null&&(B=S),k()},updateDiscountedOnly(M){Q=M,k()}}}const bs="1.126.0";async function Ds({search:t,bank:n,provider:A}){return(await Xn.get(`${vA}`,{params:{isActive:!0,search:t||null,type:"service",bank:n,provider:A}})).data}async function Ks({bank:t,provider:n}){return(await Xn.get(`${vA}`,{params:{isActive:!0,type:"initial_fee",bank:t,provider:n}})).data}async function zs({bank:t,hasRenew:n,isCashRegister:A,customerType:e,provider:a}){return(await Xn.get(`${vA}`,{params:{isActive:!0,type:"service",bank:t,hasRenew:n,limit:99,isCashRegister:A,customerType:"ENTERPRISE",provider:a}})).data}async function Os({bank:t,provider:n}){return(await Xn.get(`${vA}`,{params:{isActive:!0,type:"signature",bank:t,limit:99,provider:n}})).data}async function Vs(t){const n=new FormData;return n.append("eInvoiceRegistration",JSON.stringify(t.eInvoiceRegistration)),n.append("provider",t.provider),n.append("bank",t.bank),n.append("packages",JSON.stringify(t.packages)),n.append("promotionCodes",JSON.stringify(t.promotionCodes)),n.append("logo",t.logo),n.append("organizationRegistrationCert",t.organizationRegistrationCert),t.legalRepresentativeIdCard.forEach(e=>{n.append("legalRepresentativeIdCard",e)}),n.append("isRenew",t.isRenew),n.append("isCashRegister",t.isCashRegister),await Xn.post(_c,n,{headers:{"Content-Type":"multipart/form-data","X-Invoice-Widget-Mode":xA(),"X-Invoice-Widget-Version":bs}})}async function Rs(t){return await Xn.get(`${Uc}/${t}/status`)}async function Gs({isRenewable:t,serialNumber:n,provider:A}={}){const e={isRenewable:!!t,serialNumber:(n??"").trim(),provider:A};return(await Xn.get(hi,{params:e})).data}async function Ys(t){return await Xn.post(`${ci}/${t}`)}async function js(t){return await Xn.get(`${ii}/${encodeURIComponent(t)}`)}async function Fs(t,n){try{return await Xn.post(`${oi}/${encodeURIComponent(t)}`,n)}catch(A){throw A}}async function Zs(t){return await Xn.get(`${si}/${encodeURIComponent(t)}`)}async function Ws(t,n){try{return await Xn.post(`${ri}/${encodeURIComponent(t)}`,n)}catch(A){throw A}}function Us({name:t,value:n,feeLabel:A,required:e,description:a,isChecked:h=!0,onChange:c=null}){const i=document.createElement("label");i.className=["wgt:relative","wgt:flex","wgt:items-start","wgt:gap-3","wgt:px-4","wgt:py-3","wgt:-mt-4","wgt:@max-2xl:px-0"].join(" ");const o=GA({name:t,value:n,checked:h,onChange:g=>{console.log("Checkbox state changed to:",g),c&&c(g)}});i.appendChild(o.container);const s=document.createElement("div");s.className="wgt:flex wgt:flex-col wgt:gap-1";const r=document.createElement("div");r.className="wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";const u=document.createElement("span");u.className="wgt:text-base wgt:font-semibold wgt:text-text-sub-600",u.textContent=A,r.appendChild(u);{const g=document.createElement("span");g.className=["wgt:bg-soft-200","wgt:text-text-sub-600","wgt:text-xs","wgt:font-semibold","wgt:px-1.5","wgt:py-1","wgt:rounded-sm"].join(" "),g.textContent=q("required"),r.appendChild(g)}s.appendChild(r);const l=document.createElement("p");return l.className="wgt:text-text-soft-400 wgt:text-sm",l.textContent=a,s.appendChild(l),i.appendChild(s),{container:i}}function mA(){const t=document.createElement("div");t.className="wgt:absolute wgt:inset-0 wgt:bg-white/80 wgt:items-center wgt:justify-center wgt:z-50 wgt:w-full wgt:h-full wgt:backdrop-blur-sm",t.style.display="none";const n=document.createElement("div");n.className="wgt:flex wgt:flex-col wgt:items-center wgt:gap-4 wgt:bg-white wgt:rounded-lg wgt:p-6 wgt:shadow-lg";const A=document.createElement("div");return A.className="wgt:h-12 wgt:w-12 wgt:animate-spin wgt:rounded-full wgt:border-4 wgt:border-solid wgt:border-primary wgt:border-t-transparent",n.appendChild(A),t.appendChild(n),{container:t,open:()=>{t.style.display="flex"},close:()=>{t.style.display="none"}}}function _s({promotion:t,onSelect:n,isHidden:A=!1,isSelectable:e=!0}){const a=document.createElement("div");if(A)return a.style.display="none",{container:a};e&&t.isSelected,a.className="wgt:w-full wgt:flex wgt:items-center wgt:relative wgt:h-[6.75rem]";const h=document.createElement("div");h.className="wgt:absolute wgt:top-0 wgt:left-0 wgt:z-0",h.innerHTML=`<svg width="177" height="108" viewBox="0 0 177 108" fill="none" xmlns="http://www.w3.org/2000/svg">
129
+ </svg>`,f}const m=g("prev"),C=g("next");m.style.left="8px",C.style.right="8px",s.appendChild(m),s.appendChild(C);let w=n,Q=A,B=a;const E=()=>window.matchMedia("(max-width: 414px)").matches;function p(){const M=u.getBoundingClientRect(),f=s.getBoundingClientRect(),S=M.top-f.top+M.height/2;m.style.top=`${S}px`,C.style.top=`${S}px`,m.style.transform="translateY(-50%)",C.style.transform="translateY(-50%)"}function x(){const M=u.firstElementChild;return M?M.getBoundingClientRect().width+24:300}function N(M){u.scrollBy({left:M*x(),behavior:"smooth"})}function T(){if(E())return;const M=u.scrollWidth-u.clientWidth;m.disabled=u.scrollLeft<=0,C.disabled=u.scrollLeft>=M-2}m.addEventListener("click",()=>N(-1)),C.addEventListener("click",()=>N(1)),u.addEventListener("scroll",T);function k(){if(u.innerHTML="",!w||w.length===0){const M=document.createElement("div");M.className="wgt:col-span-full wgt:text-center wgt:py-8 wgt:text-text-sub-600",M.innerText=q("noPackageFound")||"Không tìm thấy gói phù hợp",u.appendChild(M);return}w.forEach(M=>{const f=M._id===B,S=Q.includes(M.code),{container:V}=Ps({pkg:M,type:t,isDiscounted:S,promotion:e,isSelected:f,isRenew:i,onSelect:()=>{c((h||i)&&f?"":M._id)}});V.classList.add("wgt:snap-start"),u.appendChild(V)}),requestAnimationFrame(()=>{p(),T()})}k();let H=!1,P=0,b=0;u.addEventListener("mousedown",M=>{H=!0,u.classList.replace("wgt:cursor-grab","wgt:cursor-grabbing"),P=M.pageX,b=u.scrollLeft});const L=()=>{H&&(H=!1,u.classList.replace("wgt:cursor-grabbing","wgt:cursor-grab"))};document.addEventListener("mouseup",L),u.addEventListener("mouseleave",L),u.addEventListener("mousemove",M=>{H&&(M.preventDefault(),u.scrollLeft=b-(M.pageX-P)*1.5)}),u.addEventListener("wheel",M=>{M.preventDefault(),u.scrollLeft+=M.deltaY},{passive:!1});const y=new ResizeObserver(()=>p());return y.observe(u),y.observe(s),{container:o,render:k,setSelectedPackageId(M){B=M,k()},updateData(M,f=null,S=null){w=M||w,f!==null&&(Q=f),S!==null&&(B=S),k()},updateDiscountedOnly(M){Q=M,k()}}}const bs="1.127.0";async function Ds({search:t,bank:n,provider:A}){return(await Xn.get(`${vA}`,{params:{isActive:!0,search:t||null,type:"service",bank:n,provider:A}})).data}async function Ks({bank:t,provider:n}){return(await Xn.get(`${vA}`,{params:{isActive:!0,type:"initial_fee",bank:t,provider:n}})).data}async function zs({bank:t,hasRenew:n,isCashRegister:A,customerType:e,provider:a}){return(await Xn.get(`${vA}`,{params:{isActive:!0,type:"service",bank:t,hasRenew:n,limit:99,isCashRegister:A,customerType:"ENTERPRISE",provider:a}})).data}async function Os({bank:t,provider:n}){return(await Xn.get(`${vA}`,{params:{isActive:!0,type:"signature",bank:t,limit:99,provider:n}})).data}async function Vs(t){const n=new FormData;return n.append("eInvoiceRegistration",JSON.stringify(t.eInvoiceRegistration)),n.append("provider",t.provider),n.append("bank",t.bank),n.append("packages",JSON.stringify(t.packages)),n.append("promotionCodes",JSON.stringify(t.promotionCodes)),n.append("logo",t.logo),n.append("organizationRegistrationCert",t.organizationRegistrationCert),t.legalRepresentativeIdCard.forEach(e=>{n.append("legalRepresentativeIdCard",e)}),n.append("isRenew",t.isRenew),n.append("isCashRegister",t.isCashRegister),await Xn.post(_c,n,{headers:{"Content-Type":"multipart/form-data","X-Invoice-Widget-Mode":xA(),"X-Invoice-Widget-Version":bs}})}async function Rs(t){return await Xn.get(`${Uc}/${t}/status`)}async function Gs({isRenewable:t,serialNumber:n,provider:A}={}){const e={isRenewable:!!t,serialNumber:(n??"").trim(),provider:A};return(await Xn.get(hi,{params:e})).data}async function Ys(t){return await Xn.post(`${ci}/${t}`)}async function js(t){return await Xn.get(`${ii}/${encodeURIComponent(t)}`)}async function Fs(t,n){try{return await Xn.post(`${oi}/${encodeURIComponent(t)}`,n)}catch(A){throw A}}async function Zs(t){return await Xn.get(`${si}/${encodeURIComponent(t)}`)}async function Ws(t,n){try{return await Xn.post(`${ri}/${encodeURIComponent(t)}`,n)}catch(A){throw A}}function Us({name:t,value:n,feeLabel:A,required:e,description:a,isChecked:h=!0,onChange:c=null}){const i=document.createElement("label");i.className=["wgt:relative","wgt:flex","wgt:items-start","wgt:gap-3","wgt:px-4","wgt:py-3","wgt:-mt-4","wgt:@max-2xl:px-0"].join(" ");const o=GA({name:t,value:n,checked:h,onChange:g=>{console.log("Checkbox state changed to:",g),c&&c(g)}});i.appendChild(o.container);const s=document.createElement("div");s.className="wgt:flex wgt:flex-col wgt:gap-1";const r=document.createElement("div");r.className="wgt:flex wgt:items-center wgt:gap-2 wgt:@max-2xl:flex-col wgt:@max-2xl:items-start";const u=document.createElement("span");u.className="wgt:text-base wgt:font-semibold wgt:text-text-sub-600",u.textContent=A,r.appendChild(u);{const g=document.createElement("span");g.className=["wgt:bg-soft-200","wgt:text-text-sub-600","wgt:text-xs","wgt:font-semibold","wgt:px-1.5","wgt:py-1","wgt:rounded-sm"].join(" "),g.textContent=q("required"),r.appendChild(g)}s.appendChild(r);const l=document.createElement("p");return l.className="wgt:text-text-soft-400 wgt:text-sm",l.textContent=a,s.appendChild(l),i.appendChild(s),{container:i}}function mA(){const t=document.createElement("div");t.className="wgt:absolute wgt:inset-0 wgt:bg-white/80 wgt:items-center wgt:justify-center wgt:z-50 wgt:w-full wgt:h-full wgt:backdrop-blur-sm",t.style.display="none";const n=document.createElement("div");n.className="wgt:flex wgt:flex-col wgt:items-center wgt:gap-4 wgt:bg-white wgt:rounded-lg wgt:p-6 wgt:shadow-lg";const A=document.createElement("div");return A.className="wgt:h-12 wgt:w-12 wgt:animate-spin wgt:rounded-full wgt:border-4 wgt:border-solid wgt:border-primary wgt:border-t-transparent",n.appendChild(A),t.appendChild(n),{container:t,open:()=>{t.style.display="flex"},close:()=>{t.style.display="none"}}}function _s({promotion:t,onSelect:n,isHidden:A=!1,isSelectable:e=!0}){const a=document.createElement("div");if(A)return a.style.display="none",{container:a};e&&t.isSelected,a.className="wgt:w-full wgt:flex wgt:items-center wgt:relative wgt:h-[6.75rem]";const h=document.createElement("div");h.className="wgt:absolute wgt:top-0 wgt:left-0 wgt:z-0",h.innerHTML=`<svg width="177" height="108" viewBox="0 0 177 108" fill="none" xmlns="http://www.w3.org/2000/svg">
130
130
  <path fill-rule="evenodd" clip-rule="evenodd" d="M35.0743 3.375H37.1375V0H166.603C172.3 0 176.919 5.65535 176.919 12.6316V95.3684C176.919 102.345 172.3 108 166.603 108H37.1375V104.625H35.0743V108H10.316C4.61862 108 4.15411e-08 102.345 0 95.3684V93.4737C3.41841 93.4737 6.18958 90.0805 6.18958 85.8947C6.18958 81.709 3.41841 78.3158 0 78.3158V72C3.41841 72 6.18958 68.6068 6.18958 64.4211C6.18958 60.2353 3.41841 56.8421 0 56.8421V50.5263C3.41841 50.5263 6.18958 47.1331 6.18958 42.9474C6.18958 38.7616 3.41841 35.3684 0 35.3684V29.0526C3.41841 29.0526 6.18958 25.6594 6.18958 21.4737C6.18958 17.2879 3.41841 13.8947 0 13.8947V12.6316C0 5.65535 4.61862 0 10.316 0H35.0743V3.375ZM35.0743 97.875H37.1375V91.125H35.0743V97.875ZM35.0743 84.375H37.1375V77.625H35.0743V84.375ZM35.0743 70.875H37.1375V64.125H35.0743V70.875ZM35.0743 57.375H37.1375V50.625H35.0743V57.375ZM35.0743 43.875H37.1375V37.125H35.0743V43.875ZM35.0743 30.375H37.1375V23.625H35.0743V30.375ZM35.0743 16.875H37.1375V10.125H35.0743V16.875Z" fill="#C0D5FF"/>
131
131
  </svg>
132
132
  `;const c=document.createElement("div");c.className="wgt:w-full wgt:relative wgt:z-10 wgt:h-full wgt:bg-white wgt:rounded-tr wgt:rounded-br wgt:px-4 wgt:py-3 wgt:ml-9 wgt:flex wgt:flex-col wgt:justify-between";const i=document.createElement("div");i.className="wgt:flex wgt:items-start wgt:flex-col wgt:relative";const o=document.createElement("h3");o.className=["wgt:text-base","wgt:font-semibold","wgt:text-gray-500","wgt:mb-1","wgt:text-primary"].join(" "),o.textContent=t.code,i.appendChild(o);const s=document.createElement("p");s.className=["wgt:text-sm","wgt:text-text-sub-600","wgt:mb-2"].join(" ");const r=gA(vt());s.textContent=t[r],i.appendChild(s);const{container:u}=GA({checked:t.isSelected,onChange:()=>{let g=!t.isSelected;n(t.code,g)},isIconCheckbox:!0});e||(u.style.display="none"),u.className="wgt:absolute wgt:top-0 wgt:right-0",i.appendChild(u),c.appendChild(i);const l=document.createElement("p");return l.className=["wgt:text-xs","wgt:font-normal","wgt:text-right","wgt:text-[#335CFF]","wgt:italic"].join(" "),l.textContent=`${q("validityPeriod")}: ${q("expiredDate")} ${t.expiredAt.split("T")[0]}`,c.appendChild(l),a.appendChild(h),a.appendChild(c),{container:a}}function $s({value:t="",placeholder:n="",onInputChange:A=void 0}){const e=n||q("searchUnits"),a=document.createElement("div");a.className="wgt:flex wgt:flex-col";const h=document.createElement("div");h.className="wgt:flex wgt:rounded-lg wgt:border wgt:border-gray-300 wgt:overflow-hidden",a.appendChild(h);const c=document.createElement("input");return c.type="text",c.inputMode="numeric",c.value=t,c.placeholder=e,c.className="wgt:flex-1 wgt:px-4 wgt:py-2 wgt:text-text-sub-600 wgt:placeholder-gray-400 wgt:bg-white wgt:focus:outline-none",typeof A=="function"&&c.addEventListener("input",A),h.appendChild(c),{container:a}}function n1({theme:t,debounceTimer:n,typedUnits:A,onSearchComplete:e,selectedProvider:a}){let h=[],c=[];const i=document.createElement("div");i.className="wgt:flex wgt:flex-col wgt:gap-3";const o=document.createElement("div");o.className="wgt:flex wgt:flex-col wgt:gap-4",i.appendChild(o);const s=document.createElement("h2");s.className="wgt:text-xl wgt:font-bold wgt:text-text-black",s.innerText=q("selectInvoicePackage");const r=document.createElement("span");r.className="wgt:text-sm wgt:text-red-500 wgt:ml-1",r.innerText="*",s.appendChild(r),o.appendChild(s);async function u(){n&&clearTimeout(n),A!==""?n=setTimeout(async()=>{try{const E=A.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g,"."),p=await Ds({search:E,bank:t,provider:a?.route});p&&(c=p),e&&e()}catch(E){console.error("Error searching packages:",E),St.error(q("errorSearchingPackages"),{autoClose:5e3,closeButton:!0,icon:!0})}},500):(c=h,e&&e())}const l=$s({value:"",placeholder:q("searchUnits"),onInputChange:E=>{A=E.target.value.replace(/\D/g,""),u()}});o.appendChild(l.container);const g=document.createElement("div");g.className="wgt:flex wgt:flex-col wgt:gap-2",i.appendChild(g);const m=document.createElement("h3");m.className="wgt:text-sm wgt:font-semibold wgt:text-[#525866]",m.innerText=q("mostSuitablePackage"),g.appendChild(m);const C=document.createElement("div");g.appendChild(C);const w=document.createElement("div");w.className="wgt:flex wgt:items-center wgt:justify-center wgt:py-8",w.innerHTML=`
@@ -412,7 +412,7 @@ Minimum version required to store current data is: `+b+`.
412
412
  OK
413
413
  </button>
414
414
  </div>
415
- `,c.appendChild(i),document.body.appendChild(c),document.body.classList.add("no-scroll"),t&&t.classList.add("block-interaction");const o=i.querySelector("#popup-ok-btn");return o.addEventListener("click",async()=>{if(o.disabled)return;o.disabled=!0;let s=!1;try{typeof e=="function"&&(s=await e())}catch(r){console.error("Popup OK handler failed:",r)}c.classList.remove("animate-fade-in"),i.classList.remove("animate-scale-up"),c.classList.add("animate-fade-out"),i.classList.add("animate-scale-down"),setTimeout(()=>{c.remove(),h.remove(),document.body.classList.remove("no-scroll"),t&&t.classList.remove("block-interaction"),s||(typeof A=="function"?A():(console.log("Signature completed",n),n&&(window.location.href=n)))},300)}),c}async function W1({orderId:t,callbackUrl:n,onCompleteSignature:A}){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.gap="0",e.style.width="100%",e.style.height="100%",e.style.minHeight="0",window.matchMedia("(min-width: 640px)").matches&&(e.style.gap="1rem");let a="",h=null,c=[],i=-1;try{const C=await Ko({orderId:t}),w=await OA({orderId:t});c=Array.isArray(C)?C:Array.isArray(C?.data)?C.data:[];const Q=Array.isArray(w)?w:Array.isArray(w?.data)?w.data:[];for(let B=0;B<c.length;B++){const E=c[B],p=E?.envelopeId,x=Q.find(N=>N?.envelopeId===p);if(x){if(x.isSigned)continue;if(E?.iframeUrl){a=E.iframeUrl,h=p,i=B;break}continue}if(E?.iframeUrl){a=E.iframeUrl,h=p,i=B;break}}}catch(C){return console.error("Failed to fetch wireframe URL:",C),e.innerHTML=`
415
+ `,c.appendChild(i),document.body.appendChild(c),document.body.classList.add("no-scroll"),t&&t.classList.add("block-interaction");const o=i.querySelector("#popup-ok-btn");return o.addEventListener("click",async()=>{if(o.disabled)return;o.disabled=!0;let s=!1;try{typeof e=="function"&&(s=await e())}catch(r){console.error("Popup OK handler failed:",r)}c.classList.remove("animate-fade-in"),i.classList.remove("animate-scale-up"),c.classList.add("animate-fade-out"),i.classList.add("animate-scale-down"),setTimeout(()=>{c.remove(),h.remove(),document.body.classList.remove("no-scroll"),t&&t.classList.remove("block-interaction"),s||(typeof A=="function"?A():(console.log("Signature completed",n),n&&(window.location.href=n)))},300)}),c}async function W1({orderId:t,callbackUrl:n,onCompleteSignature:A}){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.gap="0",e.style.width="100%",e.style.height="100%",e.style.minHeight="0",window.matchMedia("(min-width: 640px)").matches&&(e.style.gap="1rem");let a="",h=null,c=[],i=-1;try{const C=await Ko({orderId:t}),w=await OA({orderId:t});c=Array.isArray(C)?C:Array.isArray(C?.data)?C.data:[],(c.length===1||c.length===2)&&localStorage.setItem("econtractQty",c.length.toString());const Q=Array.isArray(w)?w:Array.isArray(w?.data)?w.data:[];for(let B=0;B<c.length;B++){const E=c[B],p=E?.envelopeId,x=Q.find(N=>N?.envelopeId===p);if(x){if(x.isSigned)continue;if(E?.iframeUrl){a=E.iframeUrl,h=p,i=B;break}continue}if(E?.iframeUrl){a=E.iframeUrl,h=p,i=B;break}}}catch(C){return console.error("Failed to fetch wireframe URL:",C),e.innerHTML=`
416
416
  <div style="display: flex; align-items: center; justify-content: center; height: 100%; padding: 1rem;">
417
417
  <p style="color: #ef4444; text-align: center; font-size: 0.875rem;">
418
418
  Không thể tải hợp đồng.
@@ -1,4 +1,4 @@
1
- import { l as g, g as p, n as d, C as l, G as w, p as m, q as f, I as E, r as R, S as y, u as C, e as I, w as v, x as i, y as T, O as h } from "./index-CpTaTzi5.js";
1
+ import { l as g, g as p, n as d, C as l, G as w, p as m, q as f, I as E, r as R, S as y, u as C, e as I, w as v, x as i, y as T, O as h } from "./index-DIqFZUIm.js";
2
2
  function _({
3
3
  title: e,
4
4
  isDisabled: t = !1,
@@ -73,7 +73,7 @@ async function U(e, t) {
73
73
  }
74
74
  })).data;
75
75
  }
76
- const x = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.126.0";
76
+ const x = (e) => new Intl.NumberFormat("vi-VN").format(e), S = "1.127.0";
77
77
  async function $({ search: e, bank: t, provider: r }) {
78
78
  return (await n.get(`${i}`, {
79
79
  params: {
@@ -1,5 +1,5 @@
1
- import { t as l, g as mh, a as Tt, s as Mt, c as Nt, b as Xh, d as Bh, e as ih, f as Nh, h as zt, o as Eh, m as Hh, i as Ph, j as yh, v as kh } from "./index-CpTaTzi5.js";
2
- import { c as wt, a as Kt, g as Jt, b as vh, f as vn, d as Qh, e as Yt, h as Lh, i as Ih, j as bh, k as Sh, l as Vh, m as Mh, n as Jh } from "./loading-Bs9il-yL.js";
1
+ import { t as l, g as mh, a as Tt, s as Mt, c as Nt, b as Xh, d as Bh, e as ih, f as Nh, h as zt, o as Eh, m as Hh, i as Ph, j as yh, v as kh } from "./index-DIqFZUIm.js";
2
+ import { c as wt, a as Kt, g as Jt, b as vh, f as vn, d as Qh, e as Yt, h as Lh, i as Ih, j as bh, k as Sh, l as Vh, m as Mh, n as Jh } from "./loading-BR5rNYi6.js";
3
3
  import { g as sh } from "./_commonjsHelpers-DaMA6jEr.js";
4
4
  function X0({ steps: n = [], currentStep: t = 1 } = {}) {
5
5
  const e = document.createElement("div");
@@ -6596,7 +6596,7 @@ async function Nc({
6596
6596
  let h = "", c = null, A = [], u = -1;
6597
6597
  try {
6598
6598
  const x = await Nh({ orderId: n }), P = await zt({ orderId: n });
6599
- A = Array.isArray(x) ? x : Array.isArray(x?.data) ? x.data : [];
6599
+ A = Array.isArray(x) ? x : Array.isArray(x?.data) ? x.data : [], (A.length === 1 || A.length === 2) && localStorage.setItem("econtractQty", A.length.toString());
6600
6600
  const L = Array.isArray(P) ? P : Array.isArray(P?.data) ? P.data : [];
6601
6601
  for (let S = 0; S < A.length; S++) {
6602
6602
  const p = A[S], d = p?.envelopeId, N = L.find((H) => H?.envelopeId === d);
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "prepare": "npm run build"
47
47
  },
48
48
  "type": "module",
49
- "version": "1.126.0",
49
+ "version": "1.127.0",
50
50
  "repository": {},
51
51
  "dependencies": {
52
52
  "@invoice-sdk/id_extraction_qr": "^1.8.3",