!function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoggerComponent=void 0,e.LoggerComponent=function(t){Object.getOwnPropertyNames(t.prototype).filter(t=>!(t[0]===t[0].toUpperCase())).forEach(e=>{const n=t.prototype[e];t.prototype[e]=function(...o){const i=window.location.search.includes("_APLAZO_DEBUG_");i&&(console.log(`[${t.name}][${e}] inputs`),console.log({inputs:o}));const r=n.apply(this,o);return i&&(console.log(`[${t.name}][${e}] output `),console.log({output:r})),r}})}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(20),e),i(n(1),e)},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.AplazoInstall=void 0;const s=n(0);r(n(3),e),r(n(6),e),r(n(13),e),r(n(1),e),r(n(24),e);let a=class extends HTMLElement{constructor(){super(),window._APLAZO_INSTALL_=this.installWidgets.bind(this),window._APLAZO_MANUAL_INSERT_=this.insertBannerOnElement.bind(this)}static get observedAttributes(){return["respawn-spot","ignore","theme","multi-spawn"]}attributeChangedCallback(t){switch(t){case"ignore":case"respawn-spot":case"multi-spawn":case"theme":this.installWidgets()}}connectedCallback(){document.addEventListener("DOMContentLoaded",()=>this.installWidgets())}installWidgets(){const t=this.getAttribute("respawn-spot"),e=this.getAttribute("ignore"),n=null!==this.getAttribute("multi-spawn"),o=this.getAttribute("theme")||"light",i=this.getAttribute("merchant-id")||"",r=this.getAttribute("integration-type")||"",s=this.getAttribute("env")||"";if(!t)return;t.split(",").map(t=>t.trim()).filter(t=>t.length>0).forEach(t=>{const[a,l]=t.split(":");if(n){const t=document.querySelectorAll(a);document.querySelectorAll(l).forEach((t,e)=>t.setAttribute("aplazo-banner-price",""+(e+1))),t.forEach((t,n)=>{t.setAttribute("aplazo-banner-position",""+(n+1)),this.insertBannerOnElement(`[aplazo-banner-position="${n+1}"]`,`[aplazo-banner-price="${n+1}"]`,o,e,i,r,s)})}else this.insertBannerOnElement(a,l,o,e,i,r,s)})}insertBannerOnElement(t,e,n,o,i,r,s){console.log(`inserting on [${t}]`);const a=document.createElement("aplazo-placement");e&&a.setAttribute("price-element-selector",e),a.setAttribute("price-format",this.getAttribute("price-format")||""),a.setAttribute("theme",n),a.setAttribute("merchant-id",i),a.setAttribute("integration-type",r),a.setAttribute("env",s),o&&a.setAttribute("ignore",o),a.setAttribute("default-selector",t)}};a=i([s.LoggerComponent],a),e.AplazoInstall=a,customElements.get("aplazo-install")||customElements.define("aplazo-install",a)},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(4),e)},function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.AplazoQuotesElement=void 0;const i=n(0),r=n(5);let s=class extends HTMLElement{constructor(){var t,e,n;super(),this.pricingComponent=new r.PricingComponent(this),this.attachShadow({mode:"open"});const o=document.createElement("template");this.setAttribute("aplazo-element","true"),o.innerHTML='\n \n 5 plazos \n \n ',null===(t=this.shadowRoot)||void 0===t||t.appendChild(o.content.cloneNode(!0)),this.priceSpot=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("#price-slot"),this.quotesElement=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".quotes-amount")}connectedCallback(){this.updateQuotes(),document.addEventListener("DOMContentLoaded",t=>{this.pricingComponent.trackElement(this.getAttribute("price-element-selector"),this.getAttribute("ignore"))}),window.addEventListener("resize",t=>{this.pricingComponent.trackElement(this.getAttribute("price-element-selector"),this.getAttribute("ignore"))})}static get observedAttributes(){return["product-price","price-element-selector","ignore","theme","merchant-id","integration-type","quotes"]}attributeChangedCallback(t,e,n){var o;switch(this.priceSpot=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector("#price-slot"),this.updateQuotes(),t){case"product-price":this.updateQuotes();break;case"price-element-selector":case"price-format":this.ProductPrice||this.pricingComponent.trackElement(n,this.getAttribute("ignore"));break;case"ignore":this.pricingComponent.trackElement(this.getAttribute("price-element-selector"),this.getAttribute("ignore"))}}updateQuotes(){const t=this.ProductPrice;if(!t)return void(this.priceSpot&&(this.priceSpot.textContent=""));if(!this.priceSpot||!this.quotesElement)return;const e=Number(this.getAttribute("quotes"))||5;this.quotesElement.innerHTML=e+" plazos",this.priceSpot.textContent="desde $"+parseFloat(""+t/e).toFixed(2)}get ProductPrice(){return"NO-DECIMAL"===this.PriceFormat?Number(this.getAttribute("product-price")):Number(this.getAttribute("product-price"))/100}get PriceFormat(){return this.getAttribute("price-format")||""}get MerchantID(){return this.getAttribute("merchant-id")||""}};s=o([i.LoggerComponent],s),e.AplazoQuotesElement=s,customElements.get("aplazo-quotes")||customElements.define("aplazo-quotes",s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PricingComponent=void 0;e.PricingComponent=class{constructor(t){this.target=t}trackElement(t,e=null){var n;if(this.target.setAttribute("product-price",""),!t)return;const o=e?`${t}:not(${e})`:t;let i=document.querySelector(o);if(i){const t=null===(n=i.textContent)||void 0===n?void 0:n.trim().replace("$","").replace("MXN","").replace("mxn","").replace(".","").replace(",","");t&&this.target.setAttribute("product-price",t),window.onclick=t=>{var e;if(!i)return;const n=null===(e=i.textContent)||void 0===e?void 0:e.trim().replace("$","").replace("MXN","").replace(".","").replace(",","");n&&this.target.setAttribute("product-price",n)}}else this.target.setAttribute("product-price","")}init(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Typography=e.AplazoButton=e.StepCard=e.InstructionCard=e.Icon=e.AplazoLogo=void 0;var o=n(7);Object.defineProperty(e,"AplazoLogo",{enumerable:!0,get:function(){return o.AplazoLogo}});var i=n(8);Object.defineProperty(e,"Icon",{enumerable:!0,get:function(){return i.Icon}});var r=n(9);Object.defineProperty(e,"InstructionCard",{enumerable:!0,get:function(){return r.InstructionCard}});var s=n(10);Object.defineProperty(e,"StepCard",{enumerable:!0,get:function(){return s.StepCard}});var a=n(11);Object.defineProperty(e,"AplazoButton",{enumerable:!0,get:function(){return a.AplazoButton}});var l=n(12);Object.defineProperty(e,"Typography",{enumerable:!0,get:function(){return l.Typography}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AplazoLogo=void 0;const o=document.createElement("template");o.innerHTML='\n \n
\n';class i extends HTMLElement{constructor(){var t;super(),this.attachShadow({mode:"open"}),null===(t=this.shadowRoot)||void 0===t||t.appendChild(o.content.cloneNode(!0))}connectedCallback(){var t;const e=this.getAttribute("logo-size"),n=this.getAttribute("theme")||"light",o=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("logo-image");if(!o)return;"dark"===n&&o.setAttribute("src","https://cdn.aplazo.mx/logo-black.svg");const i=e||(window.innerWidth,"25");o.style.height=i+"px"}static get observedAttributes(){return["theme"]}attributeChangedCallback(t,e,n){var o;switch(t){case"theme":const t=null===(o=this.shadowRoot)||void 0===o?void 0:o.getElementById("logo-image");if(!t)return;"dark"===n&&t.setAttribute("src","https://cdn.aplazo.mx/logo-black.svg")}}}e.AplazoLogo=i,customElements.get("aplazo-logo")||customElements.define("aplazo-logo",i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Icon=void 0;const o=document.createElement("template");o.innerHTML="\n