!function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=6)}([function(e,t,o){var r=o(4),n=o(5),a=n;a.v1=r,a.v4=n,e.exports=a},function(e,t){e.exports.treeIdCompose=function(e){return e.toLowerCase().replace(/\s/gi,"_").replace(/([\xE0-\xFF])/gi,e=>{const t=[[/[\xE0-\xE6]/g,"a"],[/[\xE8-\xEB]/g,"e"],[/[\xEC-\xEF]/g,"i"],[/[\xF2-\xF6]/g,"o"],[/[\xF9-\xFC]/g,"u"],[/\xE7/g,"c"],[/\xF1/g,"n"]].find(t=>t[0].test(e));return t?t[1]:e}).replace(/\W/gi,"")}},function(e,t){var o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(o){var r=new Uint8Array(16);e.exports=function(){return o(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},function(e,t){for(var o=[],r=0;r<256;++r)o[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,n=o;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")}},function(e,t,o){var r,n,a=o(2),i=o(3),s=0,c=0;e.exports=function(e,t,o){var l=t&&o||0,u=t||[],d=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:n;if(null==d||null==p){var m=a();null==d&&(d=r=[1|m[0],m[1],m[2],m[3],m[4],m[5]]),null==p&&(p=n=16383&(m[6]<<8|m[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:c+1,g=h-s+(f-c)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||h>s)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,c=f,n=p;var b=(1e4*(268435455&(h+=122192928e5))+f)%4294967296;u[l++]=b>>>24&255,u[l++]=b>>>16&255,u[l++]=b>>>8&255,u[l++]=255&b;var y=h/4294967296*1e4&268435455;u[l++]=y>>>8&255,u[l++]=255&y,u[l++]=y>>>24&15|16,u[l++]=y>>>16&255,u[l++]=p>>>8|128,u[l++]=255&p;for(var v=0;v<6;++v)u[l+v]=d[v];return t||i(u)}},function(e,t,o){var r=o(2),n=o(3);e.exports=function(e,t,o){var a=t&&o||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[a+s]=i[s];return t||n(i)}},function(e,t,o){"use strict";o.r(t);var r=o(0),n=o.n(r),a=function(e,t){e=e||"beon";return function(){t&&Array.prototype.slice.call(arguments).forEach((function(t){"object"==typeof t?(console.log(e+": object"),console.log(t)):console.log(e+": "+t)}))}};function i(e,t){return this.engine=e,this.log=a("tracker",this.engine.debug),this.parser=t,this}function s(){return this.log=a("Parser",!0),this}i.prototype.init=function(){return this.consumeTrackQueue(),this},i.prototype.consumeTrackQueue=function(){this.engine.getTrackQueue().consume(this.track.bind(this))},i.prototype.track=function(e){var t=e.shift(),o=e.shift(),r=e.shift();switch(/^(cart|customer)/i.test(t)&&"update"!==o&&(r=o),t){case"pageview":this.pageview(o,r);break;case"cart_update":case"cart":this.cartUpdate(r);break;case"customer_update":case"customer":this.customerUpdate(r);break;case"transaction":this.transaction(r);break;default:return void this.log("invalid method to track")}this.engine.dispatchEvent("tracker.dispatch.done",{eventType:t,type:o})},i.prototype.pageview=function(e,t){var o;o=t&&"function"==typeof t?t():t||this.parser.parse(e);var r={event_id:n.a.v4(),timestamp:Date.now(),type:"pageview",payload:Object.assign({pageType:e,title:document.title,url:window.location.href,referer:document.referrer,vw:window.innerWidth,vh:window.innerHeight,hc:Array.from(document.querySelector("html").classList).join(", "),bc:Array.from(document.querySelector("body").classList).join(", ")},o)};beon("send","event",r),this.log(r)},i.prototype.cartUpdate=function(e){var t;t=e&&"function"==typeof e?e():e||this.parser.parse("cart");var o={event_id:n.a.v4(),timestamp:Date.now(),type:"cart",payload:t};beon("send","event",o),this.log(o)},i.prototype.customerUpdate=function(e){var t;t=e&&"function"==typeof e?e():e||this.parser.parse("customer");var o={event_id:n.a.v4(),timestamp:Date.now(),type:"customer",payload:t};beon("send","event",o),this.log(o)},i.prototype.transaction=function(e){var t;t=e&&"function"==typeof e?e():e||this.parser.parse("transaction");var o={event_id:n.a.v4(),timestamp:Date.now(),type:"transaction",payload:t};beon("send","event",o),this.log(o)},s.prototype.getDataLayer=function(e,t,o){var r=[];t=t||"event";if(window.dataLayer)for(var n=0;n #__next")?"faststore":"vtexio"}function m(){var e=[];try{var t=cart.orderFormItems();if(!t)return[];for(var o=0;o0&&n){var i,s,c=o.innerText,l=r[r.length-1].innerText.replace(",","."),u=n.innerText,d=t.getAttribute("data-product-id"),p=t.getAttribute("data-product-sku"),m=g(t,".beon-showcase");if(a&&(s=a.innerHTML),m){const e=m.getAttribute("data-event-analytics");e&&(i=e.replace("[","").split(",")[0])}if(c){var h={name:c,id:d,price:Number(l),brand:u,variant:p,dimension1:s};if(i){var f={};f.list="[bly] "+i,window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"productClick",ecommerce:{click:{actionField:f,products:[h]}}})}}}}}catch(e){console.warn("[Bnly] Sending productClick event has failed with",e)}}function y(e,t){var o=localStorage.getItem("beon-impressions-sent_products");if(o){var r=e;return t&&(r=e+t),(o=JSON.parse(o)).includes(r)}return!1}function v(e,t){var o=localStorage.getItem("beon-impressions-sent_products"),r=e;t&&(r=e+t),(o=o?JSON.parse(o):[]).push(r),localStorage.setItem("beon-impressions-sent_products",JSON.stringify(o))}(d.prototype=Object.create(l.prototype)).constructor=d,d.prototype.observeContainer=function(){var e=this;const t=document.querySelector(".render-container");let o=t?t.classList[1]:"",r=window.location.href;if(t){new MutationObserver((function(t){for(let n of t)if("attributes"===n.type&&"class"===n.attributeName){const t=n.oldValue,a=n.target.classList.value.split(" ");for(let n of a)if("render-container"===t&&n.startsWith("render-route-")){const t=window.location.href;if(n===o)return void(r!==t&&(r=t,e.trackPage()));r=t,o=n,e.trackPage()}}})).observe(t,{attributes:!0,attributeOldValue:!0})}},d.prototype.trackPage=function(){try{if(window.beone.trackAttemps||(window.beone.trackAttemps=0),window.beone.trackAttemps+=1,window.beone.trackAttemps>30)throw new Error("Client's page took more than 30 seconds to load.");localStorage.removeItem("beon-impressions-sent_products");const e={product:[".render-route-store-product"],notFound:[],search:[".render-route-store-search",".render-route-store-custom-search-beon",".render-route-store-not-found-search",".render-route-store-not-found-product"],catalog:[".render-route-store-search-department","[class*='render-route-vtex-store-2-x-store-custom']"],cart:[".body-cart"],home:[".render-route-store-home"],checkout:["#checkoutMainContainer"],success:[".body-order-form"],other:["[class*='render-route-store-home-custom']"]},t=Object.keys(e).find(t=>e[t].some(e=>document.querySelector(e)))||setTimeout(()=>this.trackPage(),1e3);switch(localStorage.setItem("bn-cartpage-items",[]),this.cleanRegion(),this.observeMinicart(),t){case"product":beon("track","pageview","product");break;case"notFound":beon("track","pageview","notfound");break;case"search":beon("track","pageview","search");break;case"catalog":beon("track","pageview","catalog");break;case"cart":beon("track","pageview","cart");break;case"home":beon("track","pageview","homepage");break;case"checkout":window.location.href.endsWith("cart")||beon("track","pageview","checkout");break;case"success":beon("track","pageview","success");break;case"other":beon("track","pageview","other")}}catch(e){console.warn("[bly] Track page failed with",e)}},d.prototype.initParser=function(){l.prototype.initParser.call(this);var e=p();return"vtexio"===e?(this.parser.parseProduct=function(){var e={pathname:void 0};try{var t=window.location.pathname;e.pathname=t}catch(e){console.warn("product parse failed with "+e.message)}return e},this.parser.parseCart=function(){return document.querySelectorAll(".vtex-minicart-2-x-minicartIconContainer").length<=0?this.parseCartPage():this.parseMinicart()},this.parser.parseCartPage=function(){var e={items:[],subtotal:null,coupons:[],shipping:{postcode:null,price:null,method:null},customer:{email:null,name:null},payments:[]};try{var t=JSON.stringify(m());localStorage.setItem("bn-cartpage-items",t);var o=cart.orderFormItems(),r=document.querySelector(".srp-address-title"),n=cart.logisticsInfo(),a=document.querySelector("p.coupon-fields > span.info > span"),i=0;if(a){var s=a.innerHTML;s.length>0&&e.coupons.push(s)}if(r){var c=r.innerText;e.shipping.postcode=c}if(n)for(let t=0;t0&&(e.shipping.price=e.shipping.price+l.slas[0].price/100,e.shipping.method=l.slas[0].name,i+=l.slas[0].price/100)}if(o&&o.length>0){for(let t in o){var u=o[t];e.items.push({product_id:u.productId,sku:u.id,qty:u.quantity,price_to:u.sellingPrice/100})}const t=o.reduce((e,t)=>e+t.quantity*(t.sellingPrice/100),0);e.subtotal=Number(t+i).toFixed(2)}}catch(e){console.warn("[CART] Erro: "+e)}return e},this.parser.parseMinicart=function(){var e={subtotal:0,items:[],coupons:[],customer:{email:null,name:null},shipping:{postcode:null,price:null,method:null}};try{var t=localStorage.getItem("orderform");if((t=JSON.parse(t))||this.log("empty source at parseOrderForm parser"),t.items){const n=t.items.reduce((e,t)=>e+t.quantity*t.sellingPrice/100,0);for(var o=0;o"Shipping"==e.id).value/100,e.shipping.method=t.shippingData.logisticsInfo[0].selectedSla),t.clientProfileData&&t.clientProfileData.firstName&&t.clientProfileData.email&&(e.customer.email=t.clientProfileData.firstName,e.customer.name=t.clientProfileData.email)}catch(e){console.warn("[MINICART] Erro: "+e)}return e},this.parser.parseCatalog=function(){var e=[];try{var t=document.querySelectorAll(".vtex-breadcrumb-1-x-container span");if(t.length>0)for(var o,r=0,n=t.length;r0)for(let t=0;t{const o=e[t].querySelector(".coupon-copied-text");o&&o.remove()},3e3)}))}}()}))},d.prototype.cartPageObserver=function(){const e=this,t={childList:!0,attributes:!0,characterData:!0,subtree:!0};let o=0;var r=document.querySelector(".body-cart .accordion-body tfoot")||function e(){if(!r&&o<30){if(r=document.querySelector(".body-cart .accordion-body tfoot"))return r;o+=1,setTimeout(e,1e3)}}();f=new MutationObserver((function(){var t=localStorage.getItem("bn-cartpage-items"),o=JSON.stringify(m());window.location.href.includes("cart")&&(t&&t===o||(e.cleanRegion(),beon("track","pageview","cart"),localStorage.setItem("bn-cartpage-items",o)))})),r&&f.observe(r,t)},d.prototype.insertProductClickEvents=function(e){e.removeEventListener("click",b),e.addEventListener("click",b)},d.prototype.bindCustomFunctionsToInjectedNodes=function(){var e=this;document.addEventListener("beon.buddy.node.inject.success",(function(t){var o=t.detail||t.details||{};"element"===o.type&&o.node.querySelectorAll(".beon-showcase .beon-showcase__pivot-wrapper, .beon-showcase .beon-showcase__items-wrapper, .beon-showcase .beon-showcase__sliders-wrapper").forEach((function(t){e.insertProductClickEvents(t)}))}))},d.prototype.injectionListeners=function(){document.addEventListener("beon.buddy.elements.handle.item.inject.success",e=>{const{container:t}=e.detail;this.insertDiscountBadgeIntoPriceBox(t);let o=t.querySelectorAll(".beon-showcase__item");o&&o.forEach(e=>{let t=e.querySelector(".beon-showcase__item-badges");e.querySelector(".beon-showcase__item-image").appendChild(t)})}),document.addEventListener("bly_view_item_list",e=>{try{const{showcase:t,products:o}=e.detail;!function(e,t){try{let o;o=t||(e.classList.contains("beon-slider")?e.querySelectorAll(".tns-slide-active"):e.querySelectorAll(".beon-showcase__item"));const r=[];for(let e=0;e0&&a){const e=n[n.length-1].innerText.replace(",","."),o=a.innerText,c=i.innerText,l=t.getAttribute("data-product-id"),u=t.getAttribute("data-product-sku"),d=g(t,".beon-showcase");let p,m;if(s&&(m=s.innerHTML),d){const e=d.getAttribute("data-event-analytics");e&&(p=e.replace("[","").split(",")[0])}if(!y(u,p)){const t={name:c,id:l,price:Number(e),variant:u,brand:o,dimension1:m};p&&(t.list="[bly] "+p,r.push(t),v(u,p))}}}r.length>0&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"productImpressions",ecommerce:{impressions:r}}))}catch(e){console.warn("[Bnly] Send productImpressions event failed with",e)}}(t,o)}catch(e){console.warn("[Bnly-Analytics] Failed to report productImpressions from bly_view_item_list:",e)}}),document.addEventListener("beonly",(function(e){const t=e&&e.detail?e.detail:null;if(!t)return;const o=t.componentName,r=t.componentType,n=new Date;n.setMinutes(n.getMinutes()+30);const a={id:window.location.pathname,name:"[bly] "+r,creative:"[bly] "+o,list:"[bly] "+o},i={value:a,expiration:n.getTime()},s=JSON.stringify(a);btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return window.localStorage.setItem("@hrg:lastPromotionClick",JSON.stringify(i)),i}))},d.prototype.fixFlags=function(e,t){var o=e.querySelector(".beon-showcase__item-details");if(o){var r=o.querySelectorAll("li"),n=document.createElement("ul");n.classList.add("beon-showcase__item-flag"),r.forEach(e=>{if(e.classList.value.startsWith("detail-flag")){var o=encodeURI(e.innerText.slice(7));e.classList.add("detail-flag"),e.style.backgroundImage=`url(https://hering.vtexassets.com/${o})`,n.appendChild(e),t.appendChild(n)}})}},d.prototype.observePopState=function(){const e=this;window.addEventListener("popstate",t=>{t.preventDefault(),localStorage.setItem("bn-cartpage-items",[]);if(!window.location.pathname.includes("checkout"))return;window.location.hash.includes("cart")?(e.cleanRegion(),beon("track","pageview","cart")):e.trackPage()})},d.prototype.heringCustomAddToCart=function(){function e(e){if(e){const n=e.querySelectorAll(".beon-showcase--carousel .beon-showcase__item:has(.beon-button--primary[data-action='buy'])");n.length&&n.forEach((function(e){!function(e){const n=e.getAttribute("data-product-id");fetch("/api/catalog_system/pub/products/search?fq=productId:"+n).then((function(e){return e.json()})).then((function(a){const i=a[0];if(!i)return;const s=i.items,c=i.skuSpecifications.find(e=>"Tamanho"==e.field.name).values.map(e=>{const t=s.find((function(t){return t.Tamanho.includes(e.name)})),o=t.sellers[0].commertialOffer.AvailableQuantity;return{label:e.name,position:e.position,sku:t.itemId,available:o,productId:n}});!function(e,n){const a=e.querySelector(".beon-showcase__item-actions:has(.beon-button)"),i=a.querySelector(".beon-variations");i&&i.parentNode.removeChild(i);const s=document.createElement("div");s.setAttribute("class","beon-variations");const c=n.variations.map((function(e){const t=["variation",e.productId,e.sku].join("__");return'"}));s.innerHTML=c.join(""),a.appendChild(s),function(e){let t=e.querySelector(".beon-variation-arrows");t||(t=document.createElement("div"),t.setAttribute("class","beon-variation-arrows"),t.innerHTML='\n \n \n ',e.appendChild(t));const n=e.querySelectorAll("label");let a=4,i=0,s=o(n);const c=e.querySelector(".beon-variation-arrows");a=r(s,c);const l=()=>{if(n.length<=a)return void c.classList.add("is-hidden");const e=-i*s;n.forEach(t=>{t.style.transform=`translateX(${e}px)`})};t.querySelector(".prev").addEventListener("click",()=>{s=o(n),a=r(s,c),i>0&&(i=Math.max(0,i-a),l())}),t.querySelector(".next").addEventListener("click",()=>{s=o(n),a=r(s,c);const e=n.length-i;e>a?i+=a:e>0&&(i+=e-a),i=Math.min(i,n.length-a),l()}),l()}(a);e.querySelectorAll(".beon-showcase__item-actions:has(.beon-button) .beon-button--primary").forEach(t)}(e,{variations:c.filter(e=>e.available>0)})}))}(e)}))}}function t(e){e.addEventListener("click",(function(e){e.preventDefault(),function(e){const t=function(e,t){var o=document.querySelectorAll(t),r=e.parentNode;for(;r&&!a(o,r);)r=r.parentNode;return r}(e,".beon-showcase__item"),o=t.getAttribute("data-product-sku");n(t,"loading"),fetch(`/checkout/cart/add?sku=${o}&qty=1&seller=1&redirect=false&sc=1`).then(()=>{n(t,"success"),setTimeout(()=>n(t,null),2e3),/checkout/i.test(window.location.pathname)&&/#\/cart/i.test(window.location.hash)&&setTimeout(()=>window.location.reload(),250)})}(e.target)})),e.classList.add("bind"),e.querySelector(".beon-button__label").innerText="Adicionar"}function o(e){return(e[0]&&e[0].getBoundingClientRect()).width+parseFloat(getComputedStyle(e[0]).marginRight)+parseFloat(getComputedStyle(e[0]).marginLeft)}function r(e,t){const o=t.offsetWidth-10;return Math.max(1,Math.floor(o/e))}function n(e,t){e.classList.remove("bly-state-loading"),e.classList.remove("bly-state-success"),e.classList.remove("bly-state-error"),t&&e.classList.add("bly-state-"+t)}function a(e,t){for(var o=0,r=e.length;o-1&&e.classList.add("active")}))})):console.warn("Cards not found for "+o)},document.addEventListener("beon.buddy.elements.handle.item.inject.success",(function(t){const{container:o}=t.detail;e(o)})),e(document)},d.prototype.insertDiscountBadgeIntoPriceBox=function(e){try{const t=e.querySelectorAll(".beon-showcase__item");for(let e=0;e{for(const r of e)if("childList"===r.type&&t.includes(r.target)){o();break}}).observe(document.body,{childList:!0,subtree:!0})},d.prototype.fastObserveCart=function(){window.lastobservedindex=0;const e=()=>{const e=localStorage.getItem("bly::cart");e!==window.lasttrackedcart&&(window.lasttrackedcart=e,beon("track","cart","update"))},t=e=>{try{let t=localStorage.getItem("bly::cart");t=t?JSON.parse(t):{items:[],subtotal:0};const o=e.ecommerce.items;for(let e=0,r=o.length;ee).find(e=>e.sku===n.sku);a&&delete t.items[t.items.indexOf(a)],t.items.push(n)}t.items=t.items.filter(e=>e),t.subtotal=0;for(let e=0,o=t.items.length;e{try{let t=localStorage.getItem("bly::cart");if(!t)return;t=JSON.parse(t);const o=e.ecommerce.items;for(let e=0,r=o.length;ee.sku===r.skuId);n&&delete t.items[t.items.indexOf(n)]}t.items=t.items.filter(e=>e),t.subtotal=0;for(let e=0,o=t.items.length;e{try{let t={items:[],subtotal:0};const o=e.ecommerce.items;for(let e=0,r=o.length;e{const n=window.dataLayer.length;if(!n)return;const a=window.dataLayer.slice(window.lastobservedindex,n);if(window.lastobservedindex=n,!a.length)return;const i=a.filter(e=>e.event&&["addToCart","removeFromCart","viewCart"].includes(e.event));if(i.length){for(let e=0,n=i.length;e30)throw new Error("Client's page took more than 30 seconds to load.");let e;localStorage.removeItem("beon-impressions-sent_products");const t=window.location.pathname,o=window.location.hash;if(""!==t&&"/"!==t||(e="homepage"),/\/p$/i.test(t)&&(e="product"),/\/busca$/i.test(t)&&(e="search"),/\/checkout\/?$/i.test(t)&&/cart/i.test(o)&&(e="cart"),/\/checkout\/?$/i.test(t)&&/(payment|shipping)/i.test(o)&&(e="checkout"),/\/checkout\/?$/i.test(t)&&/success/i.test(o)&&(e="transaction"),!e){const t={notFound:["#__next main > div[class*='styles_pageNotFoundContainer']"],catalog:["#__next main > section[class*='styles_titleCollectionContainer'] + div > section[class*='styles_searchResult']","#__next main > section[class*='styles_titlePLPContainer']","#gallery-grid"]};e=Object.keys(t).find(e=>t[e].some(e=>document.querySelector(e)))}if(e||(e="catalog"),!e)return console.error("[bly] Página atual não foi detectada no tracker");switch(localStorage.setItem("bn-cartpage-items",[]),window.beone.trackAttemps=0,this.cleanRegion(),e){case"product":beon("track","pageview","product");break;case"notFound":beon("track","pageview","notfound");break;case"search":beon("track","pageview","search");break;case"catalog":beon("track","pageview","catalog");break;case"cart":beon("track","pageview","cart");break;case"homepage":beon("track","pageview","homepage");break;case"checkout":beon("track","pageview","checkout");break;case"success":beon("track","pageview","success");break;case"other":beon("track","pageview","other")}}catch(e){console.warn("[Bnly] Track page failed with",e)}},d.prototype.fastInitParser=function(){this.parser.parseProduct=function(){var e={pathname:void 0};try{e.pathname=window.location.pathname}catch(e){console.warn("[bly] product parse failed with "+e.message)}return e},this.parser.parseCart=function(){return localStorage.getItem("bly::cart")?this.parseDataLayerCart():this.parseCartPage()},this.parser.parseCartPage=function(){var e={items:[],subtotal:null,coupons:[],shipping:{postcode:null,price:null,method:null},customer:{email:null,name:null},payments:[]};try{var t=JSON.stringify(m());localStorage.setItem("bn-cartpage-items",t);var o=cart.orderFormItems(),r=document.querySelector(".srp-address-title"),n=cart.logisticsInfo(),a=document.querySelector("p.coupon-fields > span.info > span"),i=0;if(a){var s=a.innerHTML;s.length>0&&e.coupons.push(s)}if(r){var c=r.innerText;e.shipping.postcode=c}if(n)for(let t=0;t0&&(e.shipping.price=e.shipping.price+l.slas[0].price/100,e.shipping.method=l.slas[0].name,i+=l.slas[0].price/100)}if(o&&o.length>0){for(let t in o){var u=o[t];e.items.push({product_id:u.productId,sku:u.id,qty:u.quantity,price_to:u.sellingPrice/100})}const t=o.reduce((e,t)=>e+t.quantity*(t.sellingPrice/100),0);e.subtotal=Number(t+i).toFixed(2)}}catch(e){console.warn("[CART] Erro: "+e)}return e},this.parser.parseMinicart=function(){var e={subtotal:0,items:[],coupons:[],customer:{email:null,name:null},shipping:{postcode:null,price:null,method:null}};try{var t=localStorage.getItem("orderform");if((t=JSON.parse(t))||this.log("empty source at parseOrderForm parser"),t.items){const n=t.items.reduce((e,t)=>e+t.quantity*t.sellingPrice/100,0);for(var o=0;o"Shipping"==e.id).value/100,e.shipping.method=t.shippingData.logisticsInfo[0].selectedSla),t.clientProfileData&&t.clientProfileData.firstName&&t.clientProfileData.email&&(e.customer.email=t.clientProfileData.firstName,e.customer.name=t.clientProfileData.email)}catch(e){console.warn("[MINICART] Erro: "+e)}return e},this.parser.parseDataLayerCart=function(){let e=localStorage.getItem("bly::cart");return e=e?JSON.parse(e):{items:[],subtotal:0},e},this.parser.parseCatalog=function(){var e=[];try{for(var t=window.location.pathname.split("/"),o=0;o=0?t.top-1*t.top},window.beon_custom=new d,window.beon_custom.init()}]);