1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4766],{80148:function(e,t,r){r.d(t,{Z:function(){return c}});var n=r(85893),o=r(10990),a=r(67294),s=r(20333),l=r(6655);function c(e){var t=e.isOpen,r=e.onClose,c=e.children,i=e.className,u=void 0===i?"":i,m=e.overlayClassName,d=void 0===m?"":m,p=e.showCloseButton,_=void 0===p||p,h=e.closeOnOverlayClick,f=void 0===h||h,y=e.mobileFromBottom,b=void 0!==y&&y,x=e.containerClassName,v=void 0===x?"min-h-full flex flex-col justify-end sm:items-center sm:justify-center":x,g=e.title,j=e.active_overflow_hidden,N=void 0===j||j,w=e.title_class,C=e.pattern_class,k=void 0===C?"relative z-50":C,S=e.overlayPosition,I=void 0===S?"fixed":S,O=e.children_class,F=(0,a.useRef)(null),A=(0,a.useRef)(null),E=(0,a.useRef)(null),P=(0,a.useState)(t),J=P[0],D=P[1],T=function(){return b&&window.innerWidth<640?"100%":"-200%"};(0,a.useEffect)((function(){var e;t?(N&&(document.body.style.overflow="hidden"),D(!0)):J&&(N&&(document.body.style.overflow=""),e=function(){D(!1)},F.current&&E.current?(o.p8.killTweensOf([F.current,E.current]),o.p8.to(E.current,{y:T(),opacity:1,duration:.7,ease:"power2.in"}),o.p8.to(F.current,{opacity:0,duration:.7,ease:"power2.in",onComplete:e})):e())}),[t]),(0,a.useEffect)((function(){t&&J&&F.current&&E.current&&(o.p8.killTweensOf([F.current,E.current]),o.p8.fromTo(F.current,{opacity:0},{opacity:1,duration:.7,ease:"power2.out"}),o.p8.fromTo(E.current,{y:T(),opacity:1},{y:"0%",opacity:1,duration:.7,ease:"power3.out"}))}),[J,t]),(0,a.useEffect)((function(){return function(){document.body.style.overflow=""}}),[]);var z=function(){r()};return J?(0,n.jsxs)("div",{ref:A,className:(0,l.AK)(k,"font-NeueHassGroteskDisplayPro"),children:[(0,n.jsx)("div",{ref:F,className:"".concat(I," inset-0 bg-black bg-opacity-25 ").concat(d),onClick:function(e){f&&e.target===e.currentTarget&&z()},style:{opacity:0}}),(0,n.jsx)("div",{className:(0,l.AK)(I,"inset-0 modal-address-main flex items-center justify-center"),children:(0,n.jsx)("div",{className:(0,l.AK)("w-full",v),children:(0,n.jsxs)("div",{ref:E,className:u,style:{opacity:0},children:[g||_?(0,n.jsxs)("div",{className:(0,l.AK)("relative w-full py-3 px-10 font-bold text-center lg:text-left text-base lg:text-lg border-b-[1px] border-[#D9D9D9]",null!==w&&void 0!==w?w:""),children:[(0,n.jsx)("p",{children:g}),_&&(0,n.jsx)("div",{className:"absolute top-[15px] right-[15px] w-5 h-5 flex items-center justify-center z-10",children:(0,n.jsxs)("button",{className:"rounded-full p-1 outline-none",type:"button",onClick:z,"aria-label":"Close modal",children:[(0,n.jsx)("span",{className:"sr-only",children:"Close"}),(0,n.jsx)(s.Z,{})]})})]}):null,(0,n.jsx)("div",{className:(0,l.AK)("h-full w-full overflow-auto",null!==O&&void 0!==O?O:""),children:c})]})})})]}):null}},7595:function(e,t,r){var n=r(85893),o=r(6655),a=r(47523);t.Z=function(e){var t=e.text,r=e.isSecondary,s=void 0!==r&&r,l=e.type,c=e.onClick,i=e.isLoading,u=e.className;return(0,n.jsx)("div",{className:(0,o.AK)("flex justify-center fixed bottom-0 touch-none z-60 w-full bg-white h-14",u||""),style:{boxShadow:"0 0 6px -3px #000"},children:(0,n.jsx)(a.Mm,{text:t,isSecondary:s,className:"m-2 bg-white text-black font-bold rounded-[15px] hover:bg-black hover:text-white transition-all duration-300 !text-lg outline-none focus:ring-0 focus:ring-offset-0 focus:outline-none",type:l,onClick:c,disabled:i,isLoading:i})})}},54766:function(e,t,r){r.r(t);var n=r(34051),o=r.n(n),a=r(85893),s=r(67294),l=r(50259),c=r(87536),i=r(80148),u=r(8678),m=r(72235),d=r(6655),p=r(54848),_=r(92242),h=r(47523),f=r(74666),y=r(7595);function b(e,t,r,n,o,a,s){try{var l=e[a](s),c=l.value}catch(i){return void r(i)}l.done?t(c):Promise.resolve(c).then(n,o)}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1)))),n.forEach((function(t){x(e,t,r[t])}))}return e}t.default=function(e){var t=e.isOpenModal,r=e.closeModal,n=e.color_scheme,x=e.general,g=e.options,j=e.setBillingConfig,N=(0,l.xX)().executeRecaptcha,w=(0,s.useState)(!1),C=w[0],k=w[1],S=(0,s.useState)(!!x.apis_pro_peru)[0],I=(0,_.Sg)(n).aletx_col,O=(0,s.useState)([{value:"dni",title:"C\xe9dula de ciudadan\xeda"},{value:"foreigner_card",title:"C\xe9dula de extranjer\xeda"},{value:"passport",title:"Pasaporte"}])[0],F=(0,s.useState)(g[0].value),A=F[0],E=F[1],P=(0,s.useState)("dni"),J=P[0],D=P[1],T=(0,s.useState)(""),z=T[0],K=T[1],Z=(0,u.PN)(),R=(0,c.cI)(v({},f.d9,{mode:"all"})),G=R.watch,L=R.setError,$=R.setValue,B=R.register,M=R.handleSubmit,H=R.formState.errors,V=function(e){k(!1),$("mother_last_name",e.apellido_materno),$("father_last_name",e.apellido_paterno),$("name",e.nombre)},q=function(e){k(!1),L("document",{type:"custom",message:"Documento incorrecto"}),$("mother_last_name",null),$("father_last_name",null),$("name",null)},U=function(e){k(!1),$("business_name",e.razon_social),$("address",e.domicilio_fiscal)},W=function(e){k(!1),L("ruc",{type:"custom",message:"NIT incorrecto"}),$("business_name",null),$("address",null)};(0,s.useEffect)((function(){var e;(e=z)&&/^[0-9]*$/.test(e.toString())&&8==e.toString().length&&"dni"==J&&S&&(k(!0),X(V,q,"dni",z)),function(e){return e&&/^[0-9]*$/.test(e.toString())&&11==e.toString().length}(z)&&"ruc"==J&&S&&(k(!0),X(U,W,"ruc",z))}),[z]);var X=(0,s.useCallback)((function(e,t,r,n){N&&N("enquiryFormSubmit").then(function(){var a,s=(a=o().mark((function a(s){var l;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=1,o.next=4,(0,m.uD)(r,n,s);case 4:(l=o.sent).data.status||t(l.data.data),e(l.data.data),o.next=12;break;case 9:o.prev=9,o.t0=o.catch(1),t(o.t0);case 12:case"end":return o.stop()}}),a,null,[[1,9]])})),function(){var e=this,t=arguments;return new Promise((function(r,n){var o=a.apply(e,t);function s(e){b(o,r,n,s,l,"next",e)}function l(e){b(o,r,n,s,l,"throw",e)}s(void 0)}))});return function(e){return s.apply(this,arguments)}}())}),[N]);(0,s.useEffect)((function(){var e=G((function(e,t){t.name,t.type;var r=e.type_document?e.type_document:"dni";"bill"==e.type_voucher?(K((function(t){return e.ruc?e.ruc:""})),D("ruc")):(K((function(t){return e.document?e.document:""})),D(r)),E(e.type_voucher)}));return function(){return e.unsubscribe()}}),[G]),(0,s.useEffect)((function(){if(t){var e=sessionStorage.getItem("billing_data")?sessionStorage.getItem("billing_data"):"";if(e){var r=JSON.parse(e).form_data;Object.keys(r).forEach((function(e){$(e,r[e])}))}}}),[$,t]);var Q=G("type_voucher");return(0,s.useEffect)((function(){"dni_voucher"==Q&&($("document",""),$("father_last_name",""),$("mother_last_name",""),$("name",""),$("phone",""),$("email","")),"bill"==Q&&($("business_name",""),$("ruc",""),$("address",""),$("phone",""),$("email",""))}),[Q]),(0,a.jsx)(i.Z,{isOpen:t,onClose:function(){return r()},showCloseButton:!0,containerClassName:"min-h-[90vh] max-h-[90vh] h-full flex sm:py-4 w-[95%] sm:w-[90%] md:w-[80%] lg:w-[70%] xl:w-[60%]",className:"relative w-full bg-white flex flex-col mx-auto shadow-xl max-w-3xl sm:rounded-[25px]",title:"Opciones de Facturaci\xf3n",children:(0,a.jsxs)("form",{onSubmit:M((function(e){var t={with_apis_pro_peru:S};"simple_voucher"==e.type_voucher&&(t=v({},t,{type_voucher:e.type_voucher}));if("dni_voucher"==e.type_voucher){var n=e.document;"dni"==J&&(n=(0,p.ub)(e.document)?p.GC:e.document),t=v({},t,{type_voucher:e.type_voucher,customer_document_number:n,customer_document_type:e.type_document,customer_last_name:e.mother_last_name?e.father_last_name+" "+e.mother_last_name:e.father_last_name,customer_name:e.name,customer_phone:e.phone,customer_email:e.email})}"bill"==e.type_voucher&&(t=v({},t,S?{type_voucher:e.type_voucher,customer_document_number:(0,p.m3)(e.ruc),customer_document_type:"nit",customer_phone:e.phone,customer_email:e.email}:{type_voucher:e.type_voucher,customer_document_number:(0,p.m3)(e.ruc),customer_document_type:"nit",customer_business_name:e.business_name,customer_fiscal_residence:e.address,customer_phone:e.phone,customer_email:e.email}));j(t),Z({ga4_event:"CUSTOM_EVENT",data:{event_name:"checkout_set_billing",event_category:"Popup opciones de facturaci\xf3n",event_label:"Actualizar",event_action:"Seleccionar bot\xf3n Actualizar",products:[]}}),sessionStorage.setItem("billing_data",JSON.stringify({data:t,form_data:e})),r()})),className:"font-NeueHassGroteskDisplayPro h-auto pb-16 lg:pb-0",children:[(0,a.jsxs)("div",{className:"w-full px-4 sm:px-6 lg:px-8 py-4 sm:py-6",children:[(0,a.jsxs)(h.xJ,{className:"mb-2 lg:mb-4",isDescription:!0,label:"Tipo de persona",labelClassName:"!text-black !font-medium !pl-3",htmlFor:"type_voucher",error:H.addressee_country,children:[(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsx)(h.Ph,{color_scheme:n,style_type:"background",id:"type_voucher",name:"type_voucher",options:g,error:H.addressee_country,register:B("type_voucher")})}),H.type_voucher&&(0,a.jsx)("span",{className:(0,d.AK)(I||"text-color01","text-xs font-medium inline-block -mt-3 col-span-2"),children:"string"==typeof H.type_voucher.message?H.type_voucher.message:""})]}),"dni_voucher"==A&&(0,a.jsxs)("div",{className:"sm:grid sm:grid-cols-3 space-y-2 md:space-y-0 gap-3 mt-4 md:mt-0",children:[(0,a.jsx)(h.xJ,{htmlFor:"type_document",label:"Tipo de documento",labelClassName:"pl-3",error:H.type_document,children:(0,a.jsx)(h.Ph,{color_scheme:n,style_type:"background",id:"type_document",name:"type_document",options:O,error:H.type_document,register:B("type_document")})}),(0,a.jsx)(h.xJ,{htmlFor:"document",label:"N\xfamero de documento",className:"col-span-2",labelClassName:"pl-2",error:H.document,children:(0,a.jsx)(h.II,{color_scheme:n,type:"dni"==J?"number":void 0,name:"document",id:"document",error:H.document,register:B("document"),style_type:"background",isLoading:C,show_error:!0,disableSpaces:!0})}),(0,a.jsx)(h.xJ,{label:"Apellido 1",labelClassName:"pl-3",htmlFor:"father_last_name",error:H.father_last_name,children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",name:"father_last_name",id:"father_last_name",readOnly:S,error:H.father_last_name,register:B("father_last_name"),show_error:!0})}),(0,a.jsx)(h.xJ,{label:"Apellido 2",labelClassName:"pl-3",htmlFor:"mother_last_name",error:H.mother_last_name,children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",name:"mother_last_name",id:"mother_last_name",readOnly:S,error:H.mother_last_name,register:B("mother_last_name"),show_error:!0})}),(0,a.jsx)(h.xJ,{label:"Nombres",labelClassName:"pl-3",htmlFor:"name",error:H.name,children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",name:"name",id:"name",readOnly:S,error:H.name,register:B("name"),show_error:!0})})]}
1),"bill"==A&&(0,a.jsxs)("div",{className:"sm:grid sm:grid-cols-2 space-y-2 md:space-y-0 gap-3 mt-4 lg:mt-0",children:[(0,a.jsx)(h.xJ,{label:"Raz\xf3n social",labelClassName:"pl-3",error:H.business_name,htmlFor:"business_name",children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",type:"text",name:"business_name",id:"business_name",error:H.business_name,register:B("business_name"),readOnly:S,show_error:!0})}),(0,a.jsxs)(h.xJ,{label:"N\xfamero de NIT",error:H.ruc,labelClassName:"pl-3",htmlFor:"ruc",children:[(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",type:"number",name:"ruc",id:"ruc",error:H.ruc,register:B("ruc"),isLoading:C,show_error:!0}),(0,a.jsx)("span",{className:"text-xs italic text-gray-500",children:"*Sin d\xedgito de verificaci\xf3n"})]}),(0,a.jsx)(h.xJ,{label:"Correo electr\xf3nico",labelClassName:"pl-3",className:"col-span-3",htmlFor:"email",error:H.email,children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",id:"email",name:"email",type:"email",error:H.email,register:B("email"),show_error:!0})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 col-span-3 gap-3 md:gap-4 mt-3 md:mt-4",children:[(0,a.jsx)(h.xJ,{label:"Tel\xe9fono",labelClassName:"pl-3",htmlFor:"phone",error:H.phone,children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",id:"phone",name:"phone",type:"number",error:H.phone,register:B("phone"),show_error:!0})}),"bill"==A?(0,a.jsx)(h.xJ,{label:"Direcci\xf3n",labelClassName:"pl-3",error:H.address,htmlFor:"address",children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",type:"text",name:"address",id:"address",error:H.address,register:B("address"),readOnly:S})}):(0,a.jsx)(h.xJ,{label:"Correo electr\xf3nico",labelClassName:"pl-3",className:(0,d.AK)("bill"==A?"col-span-3":""),htmlFor:"email",error:H.email,children:(0,a.jsx)(h.II,{color_scheme:n,style_type:"background",id:"email",name:"email",type:"email",error:H.email,register:B("email"),show_error:!0})})]})]}),(0,a.jsx)(y.Z,{className:"lg:rounded-b-[25px] font-NeueHassGroteskDisplayPro !text-base lg:!text-lg",type:"submit",text:"Actualizar",isLoading:C})]})})}},54848:function(e,t,r){r.d(t,{Co:function(){return n},GC:function(){return s},m3:function(){return l},pA:function(){return o},ub:function(){return a}});var n=/^[a-zA-Z0-9\s\xe1\xe9\xed\xf3\xfa\xc1\xc9\xcd\xd3\xda\xf1\xd1,.\-]+$/,o=(RegExp("^[a-zA-Z\\u00C0-\\u017F\\u00F1\\u00D1\\-\\/.\\-'\xb4`0-9 ]+$","u"),/^[0-9]+$/);function a(e){return/^[09]/.test(e.trim())}var s="222222222222";function l(e){var t=e.replace(/[.\-\s]/g,"");return/^[0-7]/.test(t)?s:t}}}]);
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.