(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{4265:function(e,t,n){Promise.resolve().then(n.t.bind(n,3400,23)),Promise.resolve().then(n.bind(n,9735)),Promise.resolve().then(n.bind(n,4263)),Promise.resolve().then(n.bind(n,4404)),Promise.resolve().then(n.bind(n,7640)),Promise.resolve().then(n.bind(n,239)),Promise.resolve().then(n.t.bind(n,4080,23)),Promise.resolve().then(n.t.bind(n,3033,23))},8142:function(e,t,n){"use strict";n.d(t,{c:function(){return s}});var a=n(2265);let s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,n]=(0,a.useState)(e);return[t,e=>{let{target:a}=e;n({...t,[a.name]:a.value})},()=>{n(e)}]}},6420:function(e,t,n){"use strict";async function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fetch("https://hook.us1.make.com/6hm7ea1xa1okmcp3ak30xu4if3cu2nsp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e).catch(e=>e)}n.d(t,{$:function(){return a}})},9735:function(e,t,n){"use strict";n.d(t,{default:function(){return l}});var a=n(7437),s=n(2265),r=n(6463),o=n(8142),i=n(6420);function l(){let e=(0,r.useSearchParams)(),t=(0,r.usePathname)(),[n,l,c]=(0,o.c)({fname:"",phone:"",product:"",origin:"whatsapp"}),[d,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(!1),[f,p]=(0,s.useState)(!1),{fname:g,phone:b}=n,[_,x]=(0,s.useState)({fade:"fade-out"});(0,s.useEffect)(()=>{let e=setInterval(()=>{x({fade:"fade-in"})},2e3);return()=>clearInterval(e)},[t,n]);let w=()=>{u(!d),h(!1),p(!1)};return(0,a.jsx)("div",{className:"whatsapp",children:d?(0,a.jsxs)("div",{className:"form",children:[(0,a.jsx)("button",{className:"btn btn-close-form",onClick:w,children:(0,a.jsx)("i",{className:"fa-solid fa-xmark"})}),(0,a.jsxs)("form",{onSubmit:t=>{t.preventDefault(),h(!0),e.get("utm_campaign")&&(n.utm_campaign=e.get("utm_campaign")),e.get("utm_source")&&(n.utm_source=e.get("utm_source")),e.get("utm_medium")&&(n.utm_medium=e.get("utm_medium")),p(!1),(0,i.$)(n).then(e=>{200===e.status?(window.open("https://api.whatsapp.com/send?phone=+5493584206788&text=Estoy%20interesado%20en%20los%20cuadernos%20personalizados","_blank")||window.location.replace("https://api.whatsapp.com/send?phone=+5493584206788&text=Estoy%20interesado%20en%20los%20cuadernos%20personalizados"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"custom.gtm.submittedForm",label:"whatsapp"}),u(!1),c()):console.log("error")}).catch(e=>{console.log(e)})},children:[(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{className:"form-label",htmlFor:"fname",children:"Nombre*"}),(0,a.jsx)("input",{type:"text",name:"fname",value:g,placeholder:"Ingres\xe1 tu nombre",onChange:l,className:"form-control",required:!0})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{className:"form-label",htmlFor:"phone",children:"Tel\xe9fono*"}),(0,a.jsx)("input",{type:"number",name:"phone",value:b,placeholder:"Ingres\xe1 tu tel\xe9fono",onChange:l,className:"form-control",required:!0})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{htmlFor:"product",className:"form-label",children:"Producto"}),(0,a.jsxs)("select",{className:"form-select",name:"product",id:"product",onChange:l,required:!0,children:[(0,a.jsx)("option",{value:"",children:"Elegir"}),(0,a.jsx)("option",{value:"agenda",children:"Agenda"}),(0,a.jsx)("option",{value:"cuaderno",children:"Cuaderno"})]})]}),f?(0,a.jsx)("div",{className:"error",children:"Hubo un error"}):"",m?(0,a.jsxs)("div",{className:"btn btn-submit disabled border-success",children:[(0,a.jsx)("span",{children:"Iniciando "}),(0,a.jsx)("span",{className:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"}),(0,a.jsx)("span",{className:"visually-hidden"})]}):(0,a.jsx)("button",{className:"btn btn-submit",children:"Iniciar Conversaci\xf3n"})]})]}):(0,a.jsxs)("button",{className:"btn btn-whatsapp ".concat(_.fade),onClick:w,id:"whatsapp","aria-label":"Whatsapp",children:[(0,a.jsx)("i",{className:"fa-brands fa-whatsapp fa-3x"}),(0,a.jsx)("span",{className:"d-none",children:"whatsapp"})]})})}},4263:function(e,t,n){"use strict";n.d(t,{Providers:function(){return r}});var a=n(7437),s=n(4746);function r(e){let{children:t}=e;return(0,a.jsx)(s.Xu,{children:t})}},239:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let a=n(7437),s=n(2265);t.default=function(e){let{html:t,height:n=null,width:r=null,children:o,dataNtpc:i=""}=e;return(0,s.useEffect)(()=>{i&&performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-".concat(i)}})},[i]),(0,a.jsxs)(a.Fragment,{children:[o,t?(0,a.jsx)("div",{style:{height:null!=n?"".concat(n,"px"):"auto",width:null!=r?"".concat(r,"px"):"auto"},"data-ntpc":i,dangerouslySetInnerHTML:{__html:t}}):null]})}},4404:function(e,t,n){"use strict";var a;let s;Object.defineProperty(t,"__esModule",{value:!0}),t.sendGAEvent=t.GoogleAnalytics=void 0;let r=n(7437),o=n(2265),i=(a=n(1877))&&a.__esModule?a:{default:a};t.GoogleAnalytics=function(e){let{gaId:t,dataLayerName:n="dataLayer"}=e;return void 0===s&&(s=n),(0,o.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-ga"}})},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{id:"_next-ga-init",dangerouslySetInnerHTML:{__html:"\n          window['".concat(n,"'] = window['").concat(n,"'] || [];\n          function gtag(){window['").concat(n,"'].push(arguments);}\n          gtag('js', new Date());\n\n          gtag('config', '").concat(t,"');")}}),(0,r.jsx)(i.default,{id:"_next-ga",src:"https://www.googletagmanager.com/gtag/js?id=".concat(t)})]})},t.sendGAEvent=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(void 0===s){console.warn("@next/third-parties: GA has not been initialized");return}window[s]?window[s].push(arguments):console.warn("@next/third-parties: GA dataLayer ".concat(s," does not exist"))}},7640:function(e,t,n){"use strict";var a;let s;Object.defineProperty(t,"__esModule",{value:!0}),t.sendGTMEvent=t.GoogleTagManager=void 0;let r=n(7437),o=n(2265),i=(a=n(1877))&&a.__esModule?a:{default:a};t.GoogleTagManager=function(e){let{gtmId:t,dataLayerName:n="dataLayer",auth:a,preview:l,dataLayer:c}=e;void 0===s&&(s=n);let d="dataLayer"!==n?"&l=".concat(n):"";return(0,o.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-gtm"}})},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{id:"_next-gtm-init",dangerouslySetInnerHTML:{__html:"\n      (function(w,l){\n        w[l]=w[l]||[];\n        w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});\n        ".concat(c?"w[l].push(".concat(JSON.stringify(c),")"):"","\n      })(window,'").concat(n,"');")}}),(0,r.jsx)(i.default,{id:"_next-gtm","data-ntpc":"GTM",src:"https://www.googletagmanager.com/gtm.js?id=".concat(t).concat(d).concat(a?"&gtm_auth=".concat(a):"").concat(l?"&gtm_preview=".concat(l,"&gtm_cookies_win=x"):"")})]})},t.sendGTMEvent=e=>{if(void 0===s){console.warn("@next/third-parties: GTM has not been initialized");return}window[s]?window[s].push(e):console.warn("@next/third-parties: GTM dataLayer ".concat(s," does not exist"))}},3400:function(){},3033:function(e){e.exports={style:{fontFamily:"'__Titillium_Web_f9b75b', '__Titillium_Web_Fallback_f9b75b'"},className:"__className_f9b75b",variable:"__variable_f9b75b"}}},function(e){e.O(0,[604,249,190,971,23,744],function(){return e(e.s=4265)}),_N_E=e.O()}]);