mk-sdk-git 1.1.51 → 1.1.53

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.
package/dist/mk-core.js CHANGED
@@ -1 +1 @@
1
- (()=>{var Mr=Object.defineProperty;var C=(t,e)=>{for(var r in e)Mr(t,r,{get:e[r],enumerable:!0})};var At={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},Br={},V=null;function Et(){if(V)return V;let t=null;try{t=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]')||document.querySelector('script[src*="mk-pixel"]')}catch(i){}let e=i=>{try{return t&&t.getAttribute(i)}catch(c){return null}},r=e("data-mk-project")||e("data-mk-client")||window.__MK&&(window.__MK.projectId||window.__MK.clientSlug)||null,n=e("data-mk-product")||window.__MK&&window.__MK.product||"mk-fashion",o=e("data-mk-collector")||window.__MK&&window.__MK.collectorUrl||Br.collectorUrl||At.collectorUrl;return V={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||At.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||At.apiUrl,debug:!!(e("data-mk-debug")!==null||window.__MK&&window.__MK.debug||/[?&]mkdebug\b/.test(location.search)),observe:!!(window.__MK&&window.__MK.observe),forceButton:!!(window.__MK&&window.__MK.forceButton),anchor:window.__MK&&window.__MK.anchor||null,anchors:window.__MK&&window.__MK.anchors||null,cards:window.__MK&&window.__MK.cards||null,cartRedirect:!(window.__MK&&window.__MK.cartRedirect===!1),cartBehavior:window.__MK&&window.__MK.cartBehavior||null,cartOpenSelector:window.__MK&&window.__MK.cartOpenSelector||null,autoTrack:e("data-mk-no-autotrack")===null,batchIntervalMs:window.__MK&&window.__MK.batchIntervalMs||8e3,batchMaxSize:window.__MK&&window.__MK.batchMaxSize||20,engagementIntervalMs:15e3},V}function m(){return V||Et()}function y(...t){let e=m();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var xe="_mk_vid",be="_mk_sid",J=null,W=null;function it(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function _e(){if(J)return J;try{let t=localStorage.getItem(xe);return t||(t="v_"+it(),localStorage.setItem(xe,t)),J=t,t}catch(t){return J="v_"+it(),J}}function Ce(){if(W)return W;try{let t=sessionStorage.getItem(be);return t||(t="s_"+it(),sessionStorage.setItem(be,t)),W=t,t}catch(t){return W="s_"+it(),W}}var ve=[/email/i,/e-?mail/i,/cpf/i,/cnpj/i,/phone/i,/telefone/i,/celular/i,/address/i,/endereco/i,/cep/i,/zip/i,/card/i,/cartao/i,/cvv/i,/password/i,/senha/i,/token/i,/\bnome\b/i,/fullname/i,/firstname/i,/lastname/i,/sobrenome/i,/birth/i,/nascimento/i,/rg\b/i],ke={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},Lt=2e3;function Se(t){for(let e=0;e<ve.length;e++)if(ve[e].test(t))return!0;return!1}function Te(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>Lt?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Se(r))continue;let n=t[r];if(ke[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>Lt){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=Or(n);continue}e[r]=n}return e}function Or(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Se(r))continue;let n=t[r];if(ke[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>Lt){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var ct=[],It=null,q=null,qr=["off","pdp_tryon","pdp","all","tryon_engaged"],G,Rt=null,at="unknown",N=[],O=null;function Ee(){let t=m();return"mk_engaged_"+(t&&t.projectId||"")}function Pt(){if(O!==null)return O;try{O=localStorage.getItem(Ee())==="1"}catch(t){O=!1}return O}function jt(){if(!Pt()){O=!0;try{localStorage.setItem(Ee(),"1")}catch(t){}lt(!1)}}var Nr=/^purchase$/;function Le(t,e){if(G===void 0)return"hold";if(G==="off")return"drop";if(G==="all"||e&&Nr.test(e))return"collect";switch(G){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(Pt())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":at==="available"?"collect":at==="unavailable"?"drop":"hold";default:return"collect"}}function lt(t){if(!N.length)return;let e=[];for(let r of N){let n=Le(r._pt,r.name);n==="collect"?Pe(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}N=e}function Mt(t){G=qr.indexOf(t)>=0?t:"all",lt(!1)}function Ie(t){at=t==="available"?"available":"unavailable",lt(!1)}function Re(t){lt(!0),q=t,Rt=t&&t.pageType||null,at="unknown"}function d(t,e,r){if(!m().projectId){(d._pre=d._pre||[]).push({name:t,params:e,ts:r||Date.now()}),d._pre.length>50&&d._pre.shift();return}if(d._pre&&d._pre.length){let o=d._pre;d._pre=[];for(let i of o)Ae(i.name,i.params,i.ts)}Ae(t,e,r)}function Ae(t,e,r){let n=Le(Rt,t);if(n==="collect"){Pe(t,e,r);return}if(n==="drop"){y("descartado (escopo)",t);return}N.push({name:t,params:e,ts:r||Date.now(),_pt:Rt}),N.length>300&&N.shift()}function Pe(t,e,r){let n=m(),o=Te(e||{}),i="page_"+Dr(t);if(ct.push({name:i,ts:r||Date.now(),params:o}),y("queued",t,o),n.observe)try{window.postMessage({__mkpixel:!0,event:{name:i,params:o},site:q?{pageType:q.pageType,platform:q.platform,url:q.url}:null},"*")}catch(c){}if(ct.length>=n.batchMaxSize){I();return}It||(It=setTimeout(()=>{It=null,I()},n.batchIntervalMs))}function Dr(t){if(typeof t!="string"||!t)return"unknown";let e=t.replace(/^on/,"");return e=e.replace(/[A-Z]/g,(r,n)=>(n>0?"_":"")+r.toLowerCase()),e.indexOf("page_")===0&&(e=e.slice(5)),e}function I(t){if(ct.length===0)return;let e=m();if(!e.projectId||!e.collectorUrl)return;let r=ct.splice(0,50),n=JSON.stringify({product:e.product||void 0,visitorId:_e(),sessionId:Ce(),engaged:Pt()||void 0,events:r,site:q||void 0}),o=e.collectorUrl+"/v1/track";try{fetch(o,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:n}).catch(()=>{})}catch(i){try{navigator.sendBeacon&&navigator.sendBeacon(o+"?projectId="+encodeURIComponent(e.projectId),new Blob([n],{type:"text/plain"}))}catch(c){}}}function je(){try{window.addEventListener("pagehide",()=>I(!0)),window.addEventListener("beforeunload",()=>I(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&I(!0)})}catch(t){}}function A(t){let e=[];try{let r=document.querySelectorAll('script[type="application/ld+json"]');for(let n of r){let o;try{o=JSON.parse(n.textContent)}catch(c){continue}let i=[];Array.isArray(o)?i.push(...o):o["@graph"]?i.push(...o["@graph"]):i.push(o);for(let c of i){if(!c||!c["@type"])continue;let a=Array.isArray(c["@type"])?c["@type"]:[c["@type"]];(!t||t.some(u=>a.includes(u)))&&e.push(c)}}}catch(r){}return e}var Me=["off","pdp_tryon","pdp","all","tryon_engaged"],Ur="all",Fr=30*60*1e3,D=null;function U(){if(D)return D;let t=m();return!t.projectId||!t.apiUrl?(D=Promise.resolve(null),D):(D=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>e.ok?e.json():null).then(e=>e&&e.project||e||null).catch(()=>null),D)}function Be(t){let e=t&&t.analytic&&t.analytic.scope;return Me.indexOf(e)>=0?e:Ur}var Oe=t=>"mk_scope_"+t;function qe(t){try{let e=localStorage.getItem(Oe(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:Me.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function Ne(t,e){try{localStorage.setItem(Oe(t),JSON.stringify({scope:e,exp:Date.now()+Fr}))}catch(r){}}var qt={};C(qt,{addToCart:()=>en,detect:()=>Yr,getCartSummary:()=>Qr,id:()=>Gr,openCartDrawer:()=>rn,resolveSku:()=>Zr,skipRedirect:()=>Xr});var ut={};C(ut,{addToCart:()=>$r,detect:()=>Kr,getCartSummary:()=>Ot,id:()=>zr,openCartDrawer:()=>Wr,resolveSku:()=>Bt});var zr="shopify";function Kr(){return!!(window.Shopify||window.ShopifyAnalytics)}function Bt(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var st=t=>String(t==null?"":t).trim().toLowerCase();async function $r({size:t,color:e,sku:r,quantity:n}){let o=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(!o)throw new Error("shopify: sem handle de produto na URL (n\xE3o \xE9 PDP?)");let c=(await fetch("/products/"+o+".js").then(f=>f.json())).variants||[],a=f=>[f.option1,f.option2,f.option3].concat(String(f.title||"").split("/")).map(st).filter(Boolean),u=(f,T)=>a(f).indexOf(st(T))>=0,l=f=>(!t||u(f,t))&&(!e||u(f,e)),s=null;if((t||e)&&(s=c.find(f=>l(f)&&f.available)||c.find(l)),!s&&r&&(s=c.find(f=>st(f.sku)===st(r))),s||(s=c.find(f=>f.available)||c[0]),!s)throw new Error("shopify: variante n\xE3o encontrada");let w=De(),p=null;if(w&&typeof w.getSectionsToRender=="function")try{p=w.getSectionsToRender().map(f=>({id:f.id,selector:f.selector||"#"+f.id})).filter(f=>f.id)}catch(f){}let g={items:[{id:s.id,quantity:n||1}]};p&&p.length&&(g.sections=p.map(f=>f.id).join(","),g.sections_url=location.pathname);let h=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(!h.ok)throw new Error("shopify: /cart/add.js HTTP "+h.status);let b=await h.json().catch(()=>({}));return w&&p&&b.sections&&Hr(w,p,b.sections),{platform:"shopify",variantId:s.id,size:s.title,sku:s.sku||null}}function De(){return document.querySelector("cart-drawer, cart-notification")}function Hr(t,e,r){for(let n of e){let o=r[n.id];if(o)try{let i=null;if(typeof t.getSectionInnerHTML=="function")i=t.getSectionInnerHTML(o,n.selector);else{let a=new DOMParser().parseFromString(o,"text/html").querySelector(n.selector);i=a?a.innerHTML:null}let c=document.querySelector(n.selector);c&&i!=null&&(c.innerHTML=i)}catch(i){}}}async function Ot(){try{let t=await fetch("/cart.js",{headers:{Accept:"application/json"}}).then(e=>e.json());return{value:(Number(t.total_price)||0)/100,itemCount:Number(t.item_count)||0,currency:t.currency||null}}catch(t){return null}}var Vr=["[data-cart-drawer-toggle]",'[data-action="open-cart-drawer"]','[data-action="open-cart"]',".js-cart-drawer-open",".js-drawer-open-cart",".cart-drawer-toggle",".js-cart-toggle",'[aria-controls="CartDrawer"]','[aria-controls="cart-drawer"]',"#cart-icon-bubble","#lk-cart-icon",".header__cart",".site-header__cart",".cart-link",".header-cart",'a[href="/cart"]','a[href$="/cart"]'];function Jr(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function Wr(){let t=De();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of Vr)try{if(e=[...document.querySelectorAll(r)].find(Jr),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var Gr="zerezes",Xr=!0;function Yr(){try{if(!(window.Shopify||window.ShopifyAnalytics))return!1;let t=window.Shopify&&window.Shopify.shop||"";return/(^|\.)zerezes\./i.test(location.hostname)||/cs-zerezes/i.test(t)}catch(t){return!1}}var Zr=Bt,Qr=Ot;function tn(){let t=[...document.querySelectorAll(".lens-selection__button, [data-has-lens-basket]")];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function en(){let t=tn();if(!t)throw new Error("zerezes: bot\xE3o de sele\xE7\xE3o de lentes n\xE3o encontrado");try{window.postMessage({source:"mkfashion-app",action:"close_request"},"*")}catch(e){}return setTimeout(()=>{try{t.click()}catch(e){}},250),{platform:"zerezes",nativeFlow:"lens-selection"}}function rn(){return!0}var Dt={};C(Dt,{addToCart:()=>an,detect:()=>on,getCartSummary:()=>ln,id:()=>nn,resolveSku:()=>cn});var nn="hybris";function on(){return!!(window.ACC&&window.ACC.config)}function cn(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var Ue=t=>String(t==null?"":t).trim().toLowerCase();async function an({size:t,quantity:e}){let r=[...document.querySelectorAll('.js-product-select-size, a[data-code], [class*="select-size"]')].filter(g=>g.getAttribute&&g.getAttribute("data-code")),n=t?r.find(g=>Ue(g.textContent)===Ue(t)):null;n||(n=r.find(g=>g.offsetParent!==null)||r[0]);let o=n&&n.getAttribute("data-code");if(!o)throw new Error("hybris: variante (data-code) n\xE3o encontrada");let i=document.getElementById("product--add-to-cart-form")||document.querySelector('form[action*="/cart/add"]'),c=i&&i.querySelector('[name="CSRFToken"]'),a=c&&c.value,u=i&&i.getAttribute("action")||"/cart/add";if(!a)throw new Error("hybris: CSRFToken n\xE3o encontrado");let l=new URLSearchParams;l.set("productCodePost",o),l.set("qty",String(e||1)),l.set("CSRFToken",a);let s=await fetch(u,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:l.toString()});if(!s.ok)throw new Error("hybris: "+u+" HTTP "+s.status);let w=null,p=null;try{let g=await s.clone().json(),h=g&&g.cartData;h&&(w=Nt(h.total!=null?h.total:h.totalPrice),p=h.totalUnitCount!=null?Number(h.totalUnitCount):Array.isArray(h.products)?h.products.length:null)}catch(g){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:w,itemCount:p,currency:"BRL"}}function Nt(t){if(t==null||t==="")return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r=e.indexOf(",")>e.indexOf(".")?parseFloat(e.replace(/\./g,"").replace(",",".")):parseFloat(e.replace(/,/g,""));return Number.isFinite(r)?r:null}async function ln(){try{let t=await fetch("/cart/async?nocache="+Date.now(),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(c=>c.ok?c.text():"");if(!t)return null;let e=new DOMParser().parseFromString(t,"text/html"),r=e.querySelector(".minicart-total .price")||e.querySelector(".floating-cart--cart-total"),n=r?Nt(r.textContent):null,o=e.querySelector(".mini-badge"),i=o?parseInt(o.textContent,10)||0:null;return n==null&&i==null?null:{value:n,itemCount:i,currency:"BRL"}}catch(t){}try{let t=[".minicart-total .price",".js-cart-total",".cart-total",".total-price",".grand-total"];for(let e of t){let r=document.querySelector(e),n=r&&Nt(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var Ut={};C(Ut,{addToCart:()=>fn,detect:()=>un,getCartSummary:()=>pn,id:()=>sn,resolveSku:()=>dn});var sn="vtex";function un(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0)}function dn(){let t=window;return t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0]?{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"}:t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0]?{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"}:null}var dt=t=>String(t==null?"":t).trim().toLowerCase();async function fn({size:t,quantity:e}){let r=window.skuJson_0&&window.skuJson_0.skus||[];if(!r.length)throw new Error("vtex: skuJson_0 indispon\xEDvel");let n=i=>dt(i.skuname)===dt(t)||i.dimensions&&Object.values(i.dimensions).some(c=>dt(c)===dt(t)),o=t?r.find(i=>n(i)&&i.available)||r.find(n):null;if(o||(o=r.find(i=>i.available)||r[0]),!o)throw new Error("vtex: variante n\xE3o encontrada");if(window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart)return await window.vtexjs.checkout.addToCart([{id:parseInt(o.sku,10),quantity:e||1,seller:"1"}]),{platform:"vtex",skuId:o.sku,size:o.skuname||t};throw new Error("vtex: vtexjs.checkout indispon\xEDvel")}function pn(){try{let t=window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.orderForm;if(t&&typeof t.value=="number"){let e=t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL",r=(t.items||[]).reduce((n,o)=>n+(Number(o.quantity)||1),0);return{value:t.value/100,itemCount:r,currency:e}}}catch(t){}return null}var Ft={};C(Ft,{addToCart:()=>wn,detect:()=>yn,getCartSummary:()=>bn,id:()=>mn,openCartDrawer:()=>xn,resolveSku:()=>gn,skipRedirect:()=>hn});var mn="nuvemshop",hn=!0;function yn(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function gn(){try{let t=window.LS,e=t&&t.variants||[],r=document.querySelector('[name="variant_id"]'),n=r&&r.value?e.find(o=>String(o.id)===String(r.value)):null;if(n||(n=e.find(o=>o.available!==!1&&o.sku)||e.find(o=>o.sku)||e[0]),n&&n.sku)return{value:String(n.sku),source:"nuvemshop/variant"};if(t&&t.product&&t.product.sku)return{value:String(t.product.sku),source:"nuvemshop/product"}}catch(t){}return null}var ft=t=>String(t==null?"":t).trim().toLowerCase();async function wn({size:t,quantity:e,productId:r}){if(r&&!document.getElementById("product_form")){let a=document.querySelector('[data-product-id="'+String(r).replace(/["\\]/g,"")+'"]'),u=a&&a.querySelector("form[action]"),l=u&&u.getAttribute("action")||"/comprar/",s=!1,w=null;try{let g=await(await fetch(l,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:"add_to_cart="+encodeURIComponent(r)+"&quantity="+(e||1)})).json().catch(()=>({}));s=!!g.success,w=g.error_code||null}catch(p){}return{platform:"nuvemshop",productId:r,via:"gallery",added:s,reason:w}}let n=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!n)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&n.querySelectorAll('select[name^="variation"]').forEach(a=>{let u=[...a.options].find(l=>ft(l.textContent).includes(ft(t))||ft(l.value)===ft(t));u&&(a.value=u.value,a.dispatchEvent(new Event("change",{bubbles:!0})))});let o=n.querySelector('[name="quantity"]');o&&e&&(o.value=String(e)),await new Promise(a=>setTimeout(a,400));let i=n.querySelector(".js-addtocart")||document.querySelector(".js-addtocart");return i?i.click():typeof n.requestSubmit=="function"?n.requestSubmit():n.submit(),await new Promise(a=>setTimeout(a,1200)),{platform:"nuvemshop",variantId:(n.querySelector('[name="variant_id"]')||{}).value||null}}function xn(){try{if([...document.querySelectorAll('.modal-cart, #ajax-cart-details, [class*="cart-modal" i], [class*="modal-cart" i]')].find(n=>n.getBoundingClientRect().width>0))return!0;let e=[...document.querySelectorAll(".js-toggle-cart")],r=e.find(n=>{let o=n.getBoundingClientRect();return o.width>0&&o.height>0})||e[0];if(r)return setTimeout(()=>{try{r.click()}catch(n){}},300),!0}catch(t){}return!1}function bn(){try{let t=window.LS,e=t&&t.cart;if(!e)return null;let r=t.currency&&t.currency.code||"BRL",n=Array.isArray(e.items)?e.items.reduce((i,c)=>i+(Number(c.quantity)||1),0):Number(e.items)||0,o=e.subtotal!=null?Number(e.subtotal):null;return{value:o!=null?o/100:null,itemCount:n,currency:r}}catch(t){return null}}var zt={};C(zt,{addToCart:()=>Sn,detect:()=>vn,getCartSummary:()=>Tn,id:()=>_n,openCartDrawer:()=>En,resolveSku:()=>kn,skipRedirect:()=>Cn});var _n="wake",Cn=!0;function vn(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function kn(){try{let t=document.querySelector('input[name="product-id"], [data-product-id]'),e=t?t.value||t.getAttribute("data-product-id"):null;if(e)return{value:String(e).trim(),source:"wake/product-id"};let r=(location.pathname||"").match(/-(\d+)\/?(?:[?#]|$)/);if(r)return{value:r[1],source:"wake/url"}}catch(t){}return null}var Fe=t=>String(t==null?"":t).trim().toLowerCase();async function Sn({size:t,quantity:e}){if(t){let i=[...document.querySelectorAll("input[attribute-value]")].find(c=>Fe(c.getAttribute("attribute-value"))===Fe(t));if(i){try{i.checked=!0}catch(c){}try{typeof window.selectAttribute=="function"?window.selectAttribute(i):i.click()}catch(c){}await new Promise(c=>setTimeout(c,600))}}let r=document.querySelector('[name="product-variant-id"]'),n=r&&r.value;if(!n)throw new Error("wake: product-variant-id n\xE3o encontrado");if(typeof window.addOrCreateCheckout!="function")throw new Error("wake: addOrCreateCheckout indispon\xEDvel");if(!await window.addOrCreateCheckout([{productVariantId:Number(n),quantity:e||1,customization:[]}]))throw new Error("wake: addOrCreateCheckout retornou false");return{platform:"wake",productVariantId:n,size:t||null}}function ze(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}async function Tn(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?ze(o.textContent):null},e=t();if(e==null&&typeof window.loadMiniCart=="function"){try{window.loadMiniCart()}catch(o){}await new Promise(o=>setTimeout(o,700)),e=t()}e==null&&(e=An());let r=document.querySelector('.mc-products__count, [class*="mc-"][class*="count" i], [class*="minicart" i] [class*="count" i]'),n=r&&parseInt(String(r.textContent||"").replace(/\D/g,""),10)||null;if(e!=null)return{value:e,itemCount:n,currency:"BRL"}}catch(t){}return null}function An(){try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart')||document;for(let e of t.querySelectorAll("div,span,p,li,strong,b")){if(e.children.length>2)continue;let r=(e.textContent||"").replace(/\s+/g," ").trim();if(!(!/R\$/.test(r)||/frete|faltam|gr[aá]tis|desconto|economi/i.test(r))&&/^(sub)?total\b/i.test(r)){let n=ze(r);if(n)return n}}}catch(t){}return null}function En(){if(typeof window.setCartDivVisibility!="function")return!1;try{typeof window.loadMiniCart=="function"&&window.loadMiniCart()}catch(t){}return setTimeout(()=>{try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart');if(t&&t.getBoundingClientRect().width>0)return;window.setCartDivVisibility()}catch(t){}},350),!0}var Ht={};C(Ht,{addToCart:()=>jn,cartUrl:()=>Rn,detect:()=>Pn,getCartSummary:()=>Mn,id:()=>Ln,openCartDrawer:()=>Bn,skipRedirect:()=>In});var Kt="/api/v2/front",$t={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Ke=t=>String(t==null?"":t).trim().toLowerCase(),Ln="wapstore",In=!0,Rn="/checkout/carrinho";function Pn(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function $e(t){if(!t||typeof t!="object")return null;let e=t.subtotal&&t.subtotal.valor;return e==null?null:{value:e,itemCount:t.quantidadeItens!=null?t.quantidadeItens:null,currency:"BRL"}}async function jn({size:t,quantity:e}){let r=await fetch(Kt+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:$t}).then(p=>p.json()),n=(r&&(r.produto||r.data||r)||{}).conteudo||{},o=n.atributos&&n.atributos.simples&&n.atributos.simples.valores||[];if(!o.length)throw new Error("wapstore: sem variante de compra (atributos.simples)");let i=t?o.find(p=>Ke(p.label)===Ke(t)):null;i=i||o.find(p=>p.selecionado)||o.find(p=>(p.estoque||0)>0)||o[0];let c=i&&i.carrinho;if(!c||!c.itens||!c.itens.length)throw new Error("wapstore: variante sem payload de carrinho");let a=c.itens.map(p=>Object.assign({},p,{quantidade:String(e||p.quantidade||1)})),u=await fetch(Kt+"/checkout/cart",{method:"POST",headers:$t,body:JSON.stringify({itens:a,tipo:c.tipo||"produto"})});if(!u.ok)throw new Error("wapstore: add HTTP "+u.status);let l=await u.json().catch(()=>({})),s=$e(l),w={platform:"wapstore",idProduto:a[0]&&a[0].idProduto,size:i&&i.label||null};return s&&(w.cartValue=s.value,w.itemCount=s.itemCount,w.currency=s.currency),w}async function Mn(){try{let t=await fetch(Kt+"/checkout/cart",{headers:$t}).then(e=>e.json());return $e(t)}catch(t){}return null}function Bn(){try{let t=document.querySelector(".common-sheet.side-cart, .side-cart");if(t&&t.getBoundingClientRect().width>0)return!0;let e=document.querySelector('.button-cart, [class*="button-cart"]');if(e)return e.click(),!0}catch(t){}return!1}var Vt={};C(Vt,{addToCart:()=>zn,detect:()=>Dn,getCartSummary:()=>Kn,id:()=>On,openCartDrawer:()=>$n,resolveSku:()=>Un,skipRedirect:()=>qn});var On="linx",qn=!0;function Nn(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}function Dn(){return typeof window.carrinhoLateral=="function"&&typeof window.addToCart=="function"}function Un(){try{let t=(location.pathname.match(/-p(\d+)\/?(?:[?#]|$)/)||[])[1];if(t)return{value:t,source:"linx/url-pid"};let e=(String(document.body.className||"").match(/context-product-(\d+)/)||[])[1];if(e)return{value:e,source:"linx/context"}}catch(t){}return null}function Fn(){let t=[...document.querySelectorAll('.add-to-cart, [data-action="add-to-cart"]')];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function zn(){let t=Fn();if(!t)throw new Error("linx: bot\xE3o .add-to-cart n\xE3o encontrado");return t.click(),await new Promise(e=>setTimeout(e,1400)),{platform:"linx"}}function Kn(){try{let t=document.querySelector("#mini-cart");if(!t)return null;let e=null;for(let n of t.querySelectorAll("div,span,p,li,strong,b,td")){if(n.children.length>2)continue;let o=(n.textContent||"").replace(/\s+/g," ").trim();if(/^(sub)?total\b/i.test(o)&&/R\$/.test(o)&&(e=Nn(o),e))break}if(e==null)return null;let r=(t.textContent||"").match(/cont[ée]m\s+(\d+)\s+ite/i);return{value:e,itemCount:r?parseInt(r[1],10):null,currency:"BRL"}}catch(t){}return null}function $n(){try{let e=typeof window.carrinhoLateral=="function"?window.carrinhoLateral():null;if(e&&typeof e.openCart=="function"){try{typeof e.fetchHTML=="function"&&e.fetchHTML()}catch(r){}return setTimeout(()=>{try{e.openCart()}catch(r){}},400),!0}}catch(e){}let t=document.querySelector("#mini-cart");if(t){try{t.classList.add("open")}catch(e){}return!0}return!1}var Wt={};C(Wt,{addToCart:()=>X,detect:()=>Vn,id:()=>Hn,resolveSku:()=>Jt});var Hn="generic";function Vn(){return!0}function Jt(){let t=A(["Product"]);if(t[0]){let e=t[0],r=e.sku||e.mpn||e.gtin13||e.productID;if(r)return{value:String(r),source:"jsonld"}}try{let e=document.querySelector('[itemprop="sku"]');if(e){let r=e.getAttribute("content")||(e.textContent||"").trim();if(r)return{value:String(r),source:"microdata"}}}catch(e){}try{let e=window.konfidencyData;if(e&&e.product&&e.product.variants&&e.product.variants[0])return{value:String(e.product.variants[0]),source:"konfidency"}}catch(e){}return null}var Jn=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,Wn=/continuar|como comprar|lista|desejos|favorito/i;async function X(){let t=document.querySelectorAll("button,[role=button],input[type=submit]");for(let e of t){let r=(e.textContent||e.value||"").replace(/\s+/g," ").trim();if(r&&r.length<40&&Jn.test(r)&&!Wn.test(r))try{return e.click(),{platform:"native-click",clicked:r}}catch(n){}}return{platform:"none",error:"bot\xE3o de carrinho nativo n\xE3o encontrado"}}var Ve=[qt,ut,Dt,Ut,Ft,zt,Ht,Vt],Gn=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],pt;function F(){return pt||(pt=Ve.find(t=>{try{return t.detect()}catch(e){return!1}})||Wt,pt)}function Je(){let t=Ve.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of Gn)try{if(r())return e}catch(n){}return null}function z(){let t=F();if(t.id!=="generic"&&t.resolveSku)try{let e=t.resolveSku();if(e)return e}catch(e){}return Jt()}async function We(t){t=t||{};let e={size:t.size||t.selectedSize||t.tamanho||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1,productId:t.productId||null},r=F();try{let n=r.addToCart?await r.addToCart(e):await X(e);return y("cart: adicionado",n),Gt(),He(r,n,e.sku),n}catch(n){y('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await X(e);return Gt(),He(r,o,e.sku),o}}async function He(t,e,r){try{let n=null;e&&e.cartValue!=null?n={value:e.cartValue,itemCount:e.itemCount!=null?e.itemCount:null,currency:e.currency||null}:t&&t.getCartSummary&&(n=await t.getCartSummary()),n&&n.value!=null&&(n.value>0||(n.itemCount||0)>0)&&d("cart_value",{via:"tryon",value:n.value,itemCount:n.itemCount!=null?n.itemCount:null,currency:n.currency||null,sku:r||null})}catch(n){}}async function Xt(){let t=F();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function Ge(t){t=t||{};let e=F(),r={platform:e.id};try{let n=z();r.sku=n&&n.value||null;let o={size:t.size||null,color:t.color||null,sku:r.sku,quantity:t.quantity||1};r.added=e.addToCart?await e.addToCart(o):await X(o),Gt();try{await Yt()}catch(i){}r.cart=await Xt(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function Gt(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function Yt(){let t=F(),e=m(),r=null;try{r=await U()}catch(i){}let n=r&&r.template&&r.template.cart||r&&r.cart||{},o=n.afterAdd||n.behavior||e.cartBehavior;if(o||(o=e.cartRedirect===!1?"none":"auto"),o==="none")return!1;if(o==="auto"||o==="drawer"){let i=n.openSelector||e.cartOpenSelector;if(i){let c=document.querySelector(i);if(c)return setTimeout(()=>{try{c.click()}catch(a){}},300),!1}else if(t&&t.openCartDrawer){let c=!1;try{c=t.openCartDrawer()}catch(a){}if(c)return!1}}return!0}function Xe(){let t=F();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var Xn=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced)/i,Yn=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,Zn=/\/checkout/i,Qn=/\/(cart|carrinho|sacola|bag)(\/|$|\?|#)/i,Ye=/\/(products?|produtos?|p)\//i,to=/\/(collections?|categoria|categorias|c|departamento)\//i,eo=/\/(search|busca|s)(\/|\?)/i;function Ze(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=Yn.test(t);try{let r=A(),n=0,o=!1,i=!1;for(let c of r){let a=Array.isArray(c["@type"])?c["@type"]:[c["@type"]];if((a.includes("Order")||a.includes("Invoice"))&&!e)return"purchase";a.includes("SearchResultsPage")&&(o=!0),(a.includes("CollectionPage")||a.includes("ItemList"))&&(i=!0),a.includes("Product")&&n++}if(o)return"search";if(i)return"category";if(n===1)return"pdp";if(n>1)return Ye.test(t)?"pdp":"category"}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":Xn.test(t)&&!e?"purchase":Zn.test(t)?"checkout":Qn.test(t)?"cart":Ye.test(t)?"pdp":to.test(t)?"category":eo.test(t)?"search":"other"}function Qe(t){let e=null;try{let r=new URLSearchParams(location.search),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],o={};for(let i of n){let c=r.get(i);c&&(o[i.replace("utm_","")]=c)}Object.keys(o).length&&(e=o)}catch(r){}return{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:t,utm:e,userAgent:navigator.userAgent,language:navigator.language,viewport:window.innerWidth+"x"+window.innerHeight,platform:ro()}}function ro(){return Je()}var Zt={},no=null,Y=0,tr=!1;function er(t){tr||(tr=!0,rr(t),oo(),io(),co(),ao(),lo(t))}function rr(t){Zt={};let e=Ze(),r=Qe(e);if(Re(r),d("view",{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:e}),typeof t=="function")try{t(e,r)}catch(n){}}function oo(){if(!document.body)return;let t={A:1,BUTTON:1,INPUT:1,SELECT:1,TEXTAREA:1},e=0;document.body.addEventListener("click",r=>{try{let n=Date.now();if(n-e<100)return;e=n;let o=r.target;for(let a=0;a<5&&o&&o!==document.body&&!(t[o.tagName]||o.getAttribute&&o.getAttribute("role")==="button");a++)o=o.parentElement;if(!o||!t[o.tagName]&&!(o.getAttribute&&o.getAttribute("role")==="button"))return;let i={tag:o.tagName},c=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o.value:o.textContent;i.text=(c||"").replace(/\s+/g," ").trim().substring(0,100),o.href&&(i.href=String(o.href).substring(0,500)),o.id&&(i.id=o.id),o.className&&typeof o.className=="string"&&(i.classes=o.className.trim().substring(0,200)),d("click",i)}catch(n){}},{capture:!0,passive:!0})}function io(){let t=[25,50,75,100],e=null,r=()=>{try{let n=window.scrollY||document.documentElement.scrollTop||0,o=Math.max(document.body&&document.body.scrollHeight||0,document.documentElement&&document.documentElement.scrollHeight||0);if(o<=0)return;let i=Math.min(100,Math.floor((n+window.innerHeight)/o*100));for(let c of t)i>=c&&!Zt[c]&&(Zt[c]=!0,d("scroll_depth",{depth:c}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function co(){document.body&&document.body.addEventListener("submit",t=>{try{let e=t.target;if(!e||e.tagName!=="FORM"||e.querySelector('input[type="password"], input[name*="card"], input[name*="cpf"]'))return;let r="other",n=(e.className||"").toLowerCase(),o=(e.action||"").toLowerCase();e.querySelector('input[type="search"], input[name="q"], input[name="s"]')?r="search":/newsletter|subscribe|mailchimp/.test(n+o)?r="newsletter":/contact|contato/.test(n+o)&&(r="contact"),d("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function ao(){let t=m();Y=Date.now(),no=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-Y)/1e3);Y=e,r>0&&r<60&&d("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-Y)/1e3);e>0&&e<600&&d("engagement",{url:location.pathname,dwellSec:e})}Y=Date.now()})}function lo(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,rr(t))};try{let n=history.pushState,o=history.replaceState;history.pushState=function(){n.apply(this,arguments),setTimeout(r,0)},history.replaceState=function(){o.apply(this,arguments),setTimeout(r,0)},window.addEventListener("popstate",r)}catch(n){}}function te(){let t=z(),e=A(["Product"]);if(e.length>0){let o=e[0],i=Array.isArray(o.offers)?o.offers[0]:o.offers;return{sku:t?t.value:o.sku||o.mpn||o.gtin13||o.productID||null,skuSource:t?t.source:null,name:typeof o.name=="string"?o.name:null,price:i&&parseFloat(i.price||i.lowPrice)||null||nr(),currency:i?i.priceCurrency:null,brand:o.brand?typeof o.brand=="string"?o.brand:o.brand.name:null,category:o.category||null}}let r=o=>{let i=document.querySelector('meta[property="og:'+o+'"], meta[property="product:'+o+'"]');return i?i.getAttribute("content"):null},n=o=>{let i=document.querySelector('[itemprop="'+o+'"]');return i?i.getAttribute("content")||(i.textContent||"").trim():null};if(t||r("type")==="product"||r("price:amount")||n("name")){let o=n("price")||r("price:amount"),i=o&&parseFloat(String(o).replace(",","."))||null;return{sku:t?t.value:null,skuSource:t?t.source:null,name:n("name")||r("title")||document.title||null,price:(i&&i>0?i:null)||nr(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function nr(){try{let t=window.dataLayer;if(!Array.isArray(t))return null;for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||typeof r!="object")continue;let n=r.ecommerce||r,o=n&&n.items||null,i=n&&n.detail&&n.detail.products||n&&n.products||r.products||null,c=Array.isArray(o)&&o[0]&&o[0].price||Array.isArray(i)&&i[0]&&i[0].price||null,a=Qt(c!=null?String(c):"");if(a)return a}}catch(t){}return null}function R(){try{let t=location.pathname+location.search,e=t.match(/order[_-]?confirmation\/([\w-]+)/i)||t.match(/[?&]order[_-]?id=([\w-]+)/i)||t.match(/\/orders?\/([\w-]{4,})/i)||t.match(/pedido[_-]?(?:confirmado|realizado|finalizado)?\/([\w-]+)/i);return e?e[1]:null}catch(t){return null}}function ee(){let t=A(["Order","Invoice"]);if(t.length>0){let o=t[0],i=o.totalPaymentDue?parseFloat(o.totalPaymentDue.price):parseFloat(o.price||o.total);return{orderId:o.orderNumber||o.confirmationNumber||o.identifier||R(),revenue:Number.isFinite(i)?i:null,currency:o.totalPaymentDue&&o.totalPaymentDue.priceCurrency||o.priceCurrency||null,source:"jsonld"}}try{let o=window.Shopify&&window.Shopify.checkout;if(o&&o.total_price!=null){let i=parseFloat(o.total_price);return{orderId:(o.order_id!=null?String(o.order_id):null)||o.token||R(),revenue:Number.isFinite(i)?i:null,currency:o.currency||null,itemCount:Array.isArray(o.line_items)?o.line_items.length:null,source:"shopify"}}}catch(o){}try{if(Array.isArray(window.dataLayer))for(let o=window.dataLayer.length-1;o>=0;o--){let i=window.dataLayer[o],c=i&&i.ecommerce||i&&i.ecommerce_data&&i.ecommerce_data.ecommerce;if(c&&(i.event==="purchase"||c.purchase)){let a=c.purchase&&c.purchase.actionField,u=parseFloat(a&&(a.revenue||a.value)||c.value||c.revenue);return{orderId:a&&(a.id||a.transaction_id)||c.transaction_id||c.transactionId||R(),revenue:Number.isFinite(u)?u:null,currency:c.currency||c.currencyCode||a&&a.currency||null,itemCount:(c.purchase&&c.purchase.products||c.items||c.products||[]).length||null,source:"datalayer"}}}}catch(o){}let e=document.querySelector('meta[property="order:total"], meta[name="order-total"]');if(e&&e.content)return{orderId:R(),revenue:parseFloat(e.content)||null,source:"meta"};let r=so();if(r)return r;let n=R();return n?{orderId:n,revenue:null,source:"url"}:null}function so(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=Qt(n.length>1?n[n.length-1]:r);if(o)return{orderId:or(),revenue:o,currency:(n.length>1?n[0]:null)||null,source:"dom"}}let e=[".order-total","#order-total",".total-price",".order__total","[data-order-total]",".summary-total",".grand-total"];for(let r of e){let n=document.querySelector(r);if(n){let o=Qt(n.value||n.textContent);if(o)return{orderId:or(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function or(){try{let t=document.querySelector(".orderID");if(t&&(t.value||t.getAttribute("value")))return t.value||t.getAttribute("value");let r=(document.body.innerText||"").match(/(?:pedido|order|n[º°o]\.?)\s*#?\s*([A-Z0-9-]{4,})/i);return r?r[1]:null}catch(t){return null}}function Qt(t){if(!t)return null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r;e.indexOf(",")>e.indexOf(".")?r=e.replace(/\./g,"").replace(",","."):r=e.replace(/,/g,"");let n=parseFloat(r);return Number.isFinite(n)&&n>0?n:null}function ir(){let t=A(["ItemList","CollectionPage"]);if(t.length===0)return null;let e=t[0],r=e.itemListElement||e.mainEntity&&e.mainEntity.itemListElement||[],n=[];for(let o of r.slice(0,50)){let i=o.item||o;i&&(i.sku||i.productID||i.name)&&n.push(i.sku||i.productID||i.name)}return n.length>0?{count:n.length,skus:n.slice(0,20)}:null}var cr=!1,mt=[/\b(adicionar|adic\.?|colocar|incluir|jogar)\b.{0,30}\b(carrinho|sacola|sacolinha|bag)\b/i,/\bcomprar\b(?!\s+(em|por|sem))/i,/\bcomprar\s*$/i,/^add\s+to\s+(cart|bag)\b/i,/^buy\s+(now|it|this)\b/i,/^(sacolinha|carrinho|sacola)$/i],uo=[/^finalizar(\s+(compra|pedido|pagamento))?\b/i,/^(fechar|confirmar)\s+(compra|pedido|pagamento)\b/i,/^pagar(\s+(agora|pedido))?\b/i,/^(complete|place)\s+(purchase|order)\b/i,/^checkout$/i];function Z(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function sr(t){switch(t){case"pdp":{let e=te();d("view_item",e||{sku:null});break}case"category":case"search":{let e=ir();d("view_item_list",e||{count:0});break}case"cart":Xt().then(e=>d("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>d("view_cart",{}));break;case"checkout":d("begin_checkout",{});break;case"purchase":fo();break}}var ar=500,lr=16;function fo(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,po(o,i))};try{window.addEventListener("pagehide",()=>r(ee(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=ee();if(o&&o.revenue!=null)return r(o);if(e++>=lr)return y("purchase: receita n\xE3o apareceu em "+ar*lr+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,ar)};n()}function po(t,e){if(t&&!t.orderId&&(t.orderId=R()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){y("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}else if(cr)return;if(cr=!0,d("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),y("purchase emitido",t),e)try{I(!0)}catch(r){}}function ur(){if(!document.body)return;let t=0;document.body.addEventListener("click",e=>{try{let r=Date.now();if(r-t<150)return;let n=e.target;for(let a=0;a<5&&n&&n!==document.body&&!(n.tagName==="BUTTON"||n.tagName==="A"||n.getAttribute&&n.getAttribute("role")==="button");a++)n=n.parentElement;if(!n)return;let o=n.tagName!=="A",i=(n.textContent||"").replace(/\s+/g," ").trim();if(!i||i.length>80)return;let c=!1;if((Z([mt[0]],i)||o&&Z([mt[1]],i)||o&&Z([mt[2]],i)||Z(mt.slice(3),i))&&(c=!0),c){t=r;let a=te();d("add_to_cart",{via:"click",buttonText:i,sku:a?a.sku:null,price:a?a.price:null});return}o&&Z(uo,i)&&(t=r,d("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var ht={};C(ht,{available:()=>go,id:()=>mo,iframeSrc:()=>yo,modalSize:()=>ho,onMounted:()=>wo});var mo="mk-fashion",ho={width:430,height:800};function yo(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return m().appUrl+"/"+t+"/"+r}async function go(t,e){let r=m().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function wo(){}var re={};C(re,{available:()=>vo,id:()=>xo,iframeSrc:()=>Co,modalSize:()=>bo,onMounted:()=>Eo});var xo="mk-makeup",bo={width:1160,height:700};function _o(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function Co(t){return _o()+"/"+encodeURIComponent(t)}function vo(){return Promise.resolve({available:!0})}var ko="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",yt=null;function So(){return window.pulpoar?Promise.resolve(window.pulpoar):yt||(yt=new Promise(t=>{try{let e=document.createElement("script");e.src=ko,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),yt)}async function To(t){try{if(window.Shopify||window.ShopifyAnalytics){let e=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(e){let r=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta,n=new URLSearchParams(location.search).get("variant")||r&&r.selectedVariantId,i=(await fetch("/products/"+e+".js").then(u=>u.json())).variants||[],c=n?i.find(u=>String(u.id)===String(n)):null;if(c&&c.sku)return c.sku;let a=i.find(u=>u.available)||i[0];if(a&&a.sku)return a.sku}}}catch(e){}return t||null}function Ao(t){let e=Array.isArray(t)?t[0]:t;return!e||typeof e!="object"?{quantity:1}:{sku:e.sku||e.slug||e.key||e.variant_key||e.barcode||null,color:e.color||e.shade||e.colorName||null,size:e.size||null,quantity:1}}function Eo(t,e){So().then(async r=>{if(!r){y("pulpoar: SDK n\xE3o carregou");return}let n=await To(e.identifier);if(y("pulpoar variante p/ cat\xE1logo",n),n)try{r.applyVariantsWithCatalog([String(n)],o=>{e.track("product_loaded",{via:"makeup",applied:Array.isArray(o)?o.length:0})})}catch(o){y("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{y("pulpoar onAddToCart",o),e.handleAddToCart(Ao(o),"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var Lo={"mk-fashion":ht,"mk-makeup":re};function gt(t){return Lo[t]||ht}var S=null,k=null,xt=!1,bt=!1,L=null,dr={},ne=null,wt=0,v={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},Io={gregory:"698c7e791d3129430f15dddd"};function pr(t){return t?Io[String(t).toLowerCase()]||t:null}async function P(t,e){let r=pr(t),n=String(e||"").trim();return gt(m().product).available(r,n)}async function mr(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await P(t,e)).available===!0}catch(r){return!1}}async function Q(t){if(t=t||{},xt)return;let e=pr(t.projectId||t.projectid||t.store),r=String(t.identifier||t.sku||"").trim();if(!e||!r){console.error("[mk-sdk] open: projectId e identifier obrigatorios");return}let n=e+":"+r;if(dr[n]!==!0){try{if(!(await P(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(i){alert("Produto nao encontrado ou indisponivel.");return}dr[n]=!0}let o=gt(m().product).modalSize||{width:430,height:800};L={projectId:e,identifier:r,width:t.width||o.width,height:t.height||o.height},bt=!1,gr(),Ro(L),xt=!0,wt=Date.now(),d("modal_opened",{projectId:e,identifier:r})}function ie(){if(!xt)return;let t=bt;if(bt=!1,Po(),xt=!1,E("onClose"),d("modal_closed",{projectId:L&&L.projectId,identifier:L&&L.identifier}),t)try{Xe()}catch(e){}}function hr(t){try{Tr().forEach(e=>{t?(e.dataset.mkPrevDisplay===void 0&&(e.dataset.mkPrevDisplay=e.style.display),e.style.display="none"):(e.style.display=e.dataset.mkPrevDisplay||"",delete e.dataset.mkPrevDisplay)})}catch(e){}}function Ro(t){S=document.createElement("div"),S.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",hr(!0);let e=document.createElement("div"),r=typeof t.width=="number"?t.width+"px":t.width,n=typeof t.height=="number"?t.height+"px":t.height;e.style.cssText="position:relative;width:"+r+";height:"+n+";max-width:100vw;max-height:100dvh;border-radius:12px;overflow:hidden;background:#fff;",k=document.createElement("iframe");let o=gt(m().product);k.src=o.iframeSrc(t.projectId,t.identifier),k.style.cssText="width:100%;height:100%;border:none;",k.setAttribute("allow","camera *; microphone *"),k.setAttribute("allowfullscreen","true"),e.appendChild(k),S.appendChild(e),document.body.appendChild(S);try{o.onMounted(k,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:wr,track:d,fire:E})}catch(i){y("launcher.onMounted falhou",i&&i.message)}y("try-on modal aberto",k.src)}function Po(){S&&S.parentNode&&S.parentNode.removeChild(S),S=null,k=null,hr(!1)}var fr=!1;function yr(){gr()}function gr(){fr||(fr=!0,window.addEventListener("message",t=>{let e=t.data;if(!e||e.source!=="mkfashion-app")return;let r=e.action,n=e.data||{};switch(r){case"close_request":ie();break;case"ready":E("onReady",n);break;case"product_loaded":E("onProductLoaded",n),d("product_loaded",oe(n));break;case"interaction":{E("onInteraction",n),n&&n.method&&(ne=n.method),d(jo(n),oe(n));break}case"add_to_cart":wr(n,"tryon");break;case"generation_start":wt=Date.now();break;case"generation_complete":E("onGenerationComplete",n),d("generation_complete",{method:n.method||ne||"unknown",durationMs:wt?Date.now()-wt:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":E("onError",n),d("generation_error",{method:ne||"unknown",error:n&&n.error});break}}))}function wr(t,e){if(d("add_to_cart",Object.assign({via:e||"tryon"},oe(t))),typeof v.onAddToCart=="function"){E("onAddToCart",t);return}let r=Object.assign({productId:L&&L.identifier},t);We(r).then(()=>Yt()).then(n=>{bt=!!n}).catch(()=>{})}function jo(t){return t&&t.action,"interaction"}function oe(t){if(!t||typeof t!="object")return t;let e={};for(let r in t){if(r==="imageUrl"||r==="image"||r==="product"){r==="product"&&t[r]?(e.productSku=t[r].sku||null,e.productName=t[r].name||null):e[r+"Present"]=!!t[r];continue}e[r]=t[r]}return e}function E(t,e){if(typeof v[t]=="function")try{v[t](e)}catch(r){console.error("[mk-sdk]",r)}}function xr(t){v.onReady=t}function br(t){v.onClose=t}function _r(t){v.onAddToCart=t}function Cr(t){v.onProductLoaded=t}function vr(t){v.onError=t}function kr(t){v.onInteraction=t}function Sr(t){v.onGenerationComplete=t}var Bo=767,Oo=1024,qo=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,No=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function ce(t){try{let e=t.getBoundingClientRect();if(e.width<=0||e.height<=0)return!1;let r=getComputedStyle(t);return r.display!=="none"&&r.visibility!=="hidden"&&r.opacity!=="0"}catch(e){return!1}}function Do(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&ce(e)}catch(e){return!1}}function Uo(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function Fo(t){if(!t||typeof t!="object"||t.selector)return t;let e=!1;if(["mobile","tablet","desktop"].forEach(n=>{let o=t[n];o&&o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"&&(e=!0)}),!e)return t;let r={};return["mobile","tablet","desktop"].forEach(n=>{let o=t[n];if(o){if(o.selector){r[n]=o;return}if(o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"){let i=o.anchor[n]||o.anchor.desktop||o.anchor.mobile||o.anchor.tablet;i&&i.selector&&(r[n]=i)}}}),["bpMobile","bpTablet","breakpoint"].forEach(n=>{t[n]!=null&&(r[n]=t[n])}),r}function _t(t){if(!t||typeof t!="object")return null;if(t=Fo(t),t.selector)return t;let e=[["mobile",t.mobile],["tablet",t.tablet],["desktop",t.desktop]].filter(u=>u[1]&&u[1].selector);if(e.length===0)return null;if(e.length===1)return e[0][1];let r=e.filter(([,u])=>Do(u.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||Bo,i=Number(t.bpTablet)||Oo,c=u=>(e.find(l=>l[0]===u)||[])[1],a=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let u of a){let l=c(u);if(l)return l}return e[0][1]}function ae(t){let e=_t(t);if(e&&e.selector)try{let r=document.querySelector(e.selector);if(r&&ce(r))return{el:r,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(r){}return null}function Ar(){let t=m(),e=ae(t&&t.anchor);if(e)return e;let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=Uo(n);if(!(!o||o.length>40)&&!No.test(o)&&qo.test(o)&&ce(n))return{el:n,position:"afterend",mode:"flow",style:"",selector:null}}return null}var _="'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",le={none:"0",sm:"4px",md:"8px",pill:"9999px"},se={none:"0",sm:"4px",md:"8px",lg:"16px"},zo='<svg viewBox="0 0 17.5263 20.6862" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%"><g><path d="M8.49995 12.1862C10.1568 12.1862 11.5 10.8431 11.5 9.18622C11.5 7.52936 10.1568 6.18622 8.49995 6.18622C6.8431 6.18622 5.49995 7.52936 5.49995 9.18622C5.49995 10.8431 6.8431 12.1862 8.49995 12.1862Z" stroke="currentColor" shape-rendering="crispEdges"/><path d="M0.5 9.11152C0.5 6.56953 0.5 5.29894 1.1099 4.38664C1.375 3.9902 1.71424 3.65088 2.10821 3.38809C2.6945 2.9958 3.42899 2.85564 4.55351 2.80588C5.09013 2.80588 5.55183 2.39949 5.65687 1.87284C5.73715 1.48708 5.94572 1.14138 6.24735 0.894155C6.54898 0.646934 6.92516 0.51336 7.31231 0.516006H9.9734C10.7779 0.516006 11.4709 1.08412 11.6288 1.87284C11.7339 2.39949 12.1956 2.80588 12.7322 2.80588C13.8559 2.85564 12.9129 4.67413 13.5 5.06559C13.8949 5.32932 15.1484 3.80355 15.5 4.02647C16.1099 4.93876 16.7857 6.56953 16.7857 9.11152C16.7857 11.6535 16.7857 12.9233 16.1758 13.8364C15.9107 14.2328 15.5715 14.5722 15.1775 14.835C14.2647 15.4445 12.9936 15.4445 10.4522 15.4445H6.83351C4.29213 15.4445 3.02103 15.4445 2.10821 14.835C1.71446 14.5718 1.3755 14.2322 1.11071 13.8356C0.933802 13.5672 0.803519 13.2698 0.725557 12.9564" stroke="currentColor" stroke-linecap="round"/><path d="M12.676 0.607931C12.9446 -0.178095 14.0307 -0.2019 14.3491 0.536515L14.3761 0.60838L14.7385 1.66839C14.8216 1.91149 14.9559 2.13395 15.1322 2.32076C15.3086 2.50757 15.5229 2.65439 15.7608 2.75131L15.8583 2.78769L16.9183 3.14971C17.7044 3.41831 17.7282 4.50437 16.9902 4.82283L16.9183 4.84978L15.8583 5.21225C15.6151 5.29526 15.3926 5.42947 15.2057 5.60582C15.0188 5.78218 14.8719 5.99657 14.7749 6.23453L14.7385 6.33155L14.3765 7.39201C14.1079 8.17803 13.0219 8.20184 12.7039 7.46387L12.676 7.39201L12.314 6.332C12.231 6.08881 12.0968 5.86627 11.9204 5.67938C11.744 5.49249 11.5297 5.3456 11.2917 5.24863L11.1947 5.21225L10.1347 4.85022C9.34817 4.58163 9.32437 3.49557 10.0628 3.17756L10.1347 3.14971L11.1947 2.78769C11.4378 2.70462 11.6602 2.57039 11.847 2.39404C12.0339 2.21769 12.1807 2.00333 12.2776 1.76541L12.314 1.66839L12.676 0.607931Z" fill="currentColor"/></g></svg>',Ko='<svg viewBox="0 0 11.6122 12.7248" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:12px;height:12px"><path d="M4.09055 2.01133C4.43939 0.9905 5.84989 0.959583 6.26347 1.91858L6.29847 2.01192L6.76922 3.38858C6.8771 3.7043 7.05144 3.99321 7.28047 4.23583C7.5095 4.47845 7.7879 4.66912 8.09689 4.795L8.22347 4.84225L9.60014 5.31242C10.621 5.66125 10.6519 7.07175 9.69347 7.48533L9.60014 7.52033L8.22347 7.99108C7.90764 8.09889 7.61862 8.2732 7.3759 8.50223C7.13318 8.73127 6.94241 9.0097 6.81647 9.31875L6.76922 9.44475L6.29905 10.822C5.95022 11.8428 4.53972 11.8737 4.12672 10.9153L4.09055 10.822L3.62039 9.44533C3.51258 9.12951 3.33827 8.84048 3.10924 8.59776C2.8802 8.35504 2.60177 8.16427 2.29272 8.03833L2.16672 7.99108L0.790054 7.52092C-0.231363 7.17208 -0.26228 5.76158 0.69672 5.34858L0.790054 5.31242L2.16672 4.84225C2.48244 4.73437 2.77135 4.56003 3.01397 4.331C3.25658 4.10197 3.44726 3.82357 3.57314 3.51458L3.62039 3.38858L4.09055 2.01133ZM9.86147 0C9.9706 0 10.0775 0.0306123 10.1701 0.0883584C10.2627 0.146104 10.3373 0.228668 10.3853 0.326667L10.4133 0.394917L10.6175 0.993417L11.2166 1.19758C11.3259 1.23474 11.4218 1.30353 11.492 1.39523C11.5623 1.48693 11.6037 1.59741 11.611 1.71268C11.6184 1.82795 11.5914 1.94281 11.5334 2.04271C11.4755 2.14261 11.3891 2.22305 11.2854 2.27383L11.2166 2.30183L10.6181 2.506L10.4139 3.10508C10.3767 3.21442 10.3078 3.31024 10.2161 3.38041C10.1244 3.45058 10.0139 3.49194 9.89859 3.49925C9.78333 3.50656 9.66849 3.47949 9.56863 3.42147C9.46876 3.36345 9.38837 3.27709 9.33764 3.17333L9.30964 3.10508L9.10547 2.50658L8.50639 2.30242C8.39702 2.26526 8.30115 2.19647 8.23092 2.10477C8.16069 2.01307 8.11926 1.90259 8.11189 1.78732C8.10452 1.67205 8.13153 1.55719 8.18951 1.45729C8.24749 1.35739 8.33381 1.27695 8.43755 1.22617L8.50639 1.19817L9.10489 0.994L9.30905 0.394917C9.34839 0.279665 9.42281 0.179613 9.52187 0.108791C9.62094 0.0379686 9.73969 -0.0000730808 9.86147 0Z" fill="currentColor"/></svg>';function x(t,e={}){let r=document.createElement(t);if(e.style&&(r.style.cssText=e.style),e.text!=null&&(r.textContent=e.text),e.html!=null&&(r.innerHTML=e.html),e.attrs)for(let n in e.attrs)r.setAttribute(n,e.attrs[n]);if(e.on)for(let n in e.on)r.addEventListener(n,e.on[n]);if(e.children)for(let n of e.children)n&&r.appendChild(n);return r}function Ct(t,e){let r=Number(e)>0?Number(e):24;return x("span",{style:`width:${r}px;height:${r}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:zo})}function Er(t){return x("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:Ko})}function vt(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function kt(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(x("link",{attrs:{id:"mk-jakarta-font",rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap"}}))}catch(t){}}function $o(t){return t.subtext?x("span",{style:`display:flex;align-items:center;justify-content:center;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,text:t.subtext}):null}function Lr(t,e){kt();let r=x("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[Ct(t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px;width:100%;max-width:238px;box-sizing:border-box;background:${t.bgColor};border:${vt(t)};border-radius:${t.borderRadiusPx};font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,$o(t)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}function Vo(t){return t.subtext?x("span",{style:`display:flex;align-items:center;gap:4px;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:600;font-size:10px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,children:[Er(t.badgeTextColor),x("span",{text:t.subtext})]}):null}function Jo(t,e){return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px 8px 8px;width:100%;margin-top:auto;box-sizing:border-box;background:${t.bgColor};border:${vt(t)};border-radius:${t.borderRadiusPx};filter:drop-shadow(0 0 6px rgba(0,0,0,0.08));font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[Ct(t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;color:${t.textColor};white-space:nowrap;line-height:1;`})],on:{mouseenter:r=>{r.currentTarget.style.opacity="0.85"},mouseleave:r=>{r.currentTarget.style.opacity="1"},click:r=>{try{r.preventDefault(),r.stopPropagation()}catch(n){}try{e&&e()}catch(n){}}}})}function Ir(t,e){kt();let r=x("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&x("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;letter-spacing:1px;text-transform:uppercase;color:${t.cardTitleColor};line-height:1.2;`}),t.cardDescription&&x("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:12px;max-width:177px;line-height:1.2;color:${t.cardTextColor};`})]}),n=x("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&x("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=x("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[Vo(t),Jo(t,e)]}),i=x("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return x("div",{style:`display:flex;flex-direction:column;align-items:flex-start;padding:12px;width:100%;max-width:402px;min-height:140px;box-sizing:border-box;background:${t.cardBgColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};`,children:[i]})}var Go={style:"gregory-black",text:"Provar Virtualmente",fontSize:14,iconSize:24,subtext:"",bgColor:"#1E1E1E",textColor:"#FFFFFF",badgeBgColor:"#C51A1B",badgeTextColor:"#FFFFFF",borderRadius:"md",borderColor:"#1E1E1E",borderWidth:0,cardTitle:"",cardDescription:"",cardFooter:"",cardBgColor:"#F6F6F6",cardTitleColor:"#1E1E1E",cardTextColor:"#717171",cardBorderRadius:"md"};function ue(t){if(!t)return null;let e=Array.isArray(t.anchors)?t.anchors:[];if(t.version===2||t.main)return{version:2,main:t.main||{},anchors:e,cards:t.cards||null};let r=t.desktop||t.tablet||t.mobile||{},n=t.anchor||{};return{version:2,main:Object.assign({},r,{desktop:n.desktop,tablet:n.tablet,mobile:n.mobile,bpMobile:n.bpMobile,bpTablet:n.bpTablet}),anchors:e,cards:t.cards||null}}function tt(t,e){let r={...Go,...t||{}};return r.style==="gregory-card"&&e&&(r.style="gregory-black"),r.borderRadiusPx=le[r.borderRadius]!=null?le[r.borderRadius]:"0",r.cardBorderRadiusPx=se[r.cardBorderRadius]!=null?se[r.cardBorderRadius]:"0",r.fontSize=Number(r.fontSize)||14,r.iconSize=Number(r.iconSize)||24,r.borderWidth=Number(r.borderWidth)||0,r}var de={"gregory-black":Lr,"gregory-card":Ir},rc=Object.keys(de);function Rr(t,e){return(de[t.style]||de["gregory-black"])(t,e)}function Xo(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var ot=null,j=[];function Tr(){return[ot].concat(j).filter(Boolean)}function Yo(t,e){let r;try{r=document.createElement("iframe"),r.setAttribute("aria-hidden","true"),r.style.cssText="display:none!important;width:0;height:0;border:0;position:absolute;left:-9999px;",(document.body||document.documentElement).appendChild(r);let n=r.contentWindow&&r.contentWindow.Element&&r.contentWindow.Element.prototype&&r.contentWindow.Element.prototype.attachShadow;if(typeof n=="function"){let o=n.call(t,e);return r.remove(),o}}catch(n){}try{r&&r.remove()}catch(n){}return t.attachShadow(e)}var Zo=/^(transform|transform-origin|margin|margin-(top|right|bottom|left)|position|inset|top|right|bottom|left|z-index|width|min-width|max-width|height|min-height|max-height)$/i;function Qo(t){return!t||typeof t!="string"?"":t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>Zo.test(e.split(":")[0].trim().toLowerCase())).join(";")}var St=null,fe=!1,K={},Pr=!1,pe=null;function $(){return pe||(pe=U().then(t=>ue(t&&t.template&&t.template.tryOnButton||null)).catch(()=>null)),pe}function ti(){if(Pr)return;Pr=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{St&&M("pdp")},200)})}catch(e){}}function he(t){if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}}function ye(){he(ot),j.forEach(he),ot=null,j=[],St=null}var ei={IMG:1,INPUT:1,VIDEO:1,CANVAS:1,EMBED:1,OBJECT:1,IFRAME:1,BR:1,HR:1,SELECT:1,TEXTAREA:1,SVG:1};function ri(t){switch(t){case"top-center":return"top:0;left:50%;transform:translateX(-50%);";case"top-right":return"top:0;right:0;";case"middle-left":return"top:50%;left:0;transform:translateY(-50%);";case"center":return"top:50%;left:50%;transform:translate(-50%,-50%);";case"middle-right":return"top:50%;right:0;transform:translateY(-50%);";case"bottom-left":return"bottom:0;left:0;";case"bottom-center":return"bottom:0;left:50%;transform:translateX(-50%);";case"bottom-right":return"bottom:0;right:0;";case"top-left":default:return"top:0;left:0;"}}function ni(t,e,r){let o=!ei[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(s){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+ri(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let s=t.getBoundingClientRect(),w=o.getBoundingClientRect(),p=e.offsetWidth,g=e.offsetHeight,h=s.top-w.top+o.scrollTop,b=s.left-w.left+o.scrollLeft,f=r||"top-left",T=h,H=b;f.indexOf("bottom")===0?T=h+s.height-g:(f.indexOf("middle")===0||f==="center")&&(T=h+(s.height-g)/2),f.indexOf("right")>=0?H=b+s.width-p:f.indexOf("center")>=0&&(H=b+(s.width-p)/2),e.style.top=T+"px",e.style.left=H+"px"}catch(s){}};i();let c=()=>i();window.addEventListener("resize",c);let a=setTimeout(i,600),u=setTimeout(i,1500),l=null;try{if(t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",i,{once:!0}),typeof ResizeObserver=="function"){l=new ResizeObserver(()=>i());try{l.observe(t)}catch(s){}try{l.observe(o)}catch(s){}}}catch(s){}e.__mkCleanup=()=>{window.removeEventListener("resize",c),clearTimeout(a),clearTimeout(u);try{t.removeEventListener("load",i)}catch(s){}try{l&&l.disconnect()}catch(s){}}}function oi(t,e,r){try{return t.insertAdjacentElement(r||"afterend",e),!0}catch(n){try{return t.parentNode.insertBefore(e,t.nextSibling),!0}catch(o){return!1}}}async function M(t){let e=m();if(t!=="pdp"){ye();return}if(!e.projectId)return;if(!e._anchorFromPicker){let l=await $();l&&l.main&&(e.anchor=l.main),l&&l.anchors&&(e.anchors=l.anchors),l&&l.cards&&(e.cards=l.cards)}if(fe)return;let r=z(),n=r&&r.value,o=!!e.forceButton,i=l=>l?[l.selector,l.position,l.mode,l.align,l.style].join("~"):"heuristic",c=Array.isArray(e.anchors)?e.anchors:[],a=[n||"demo",i(_t(e.anchor))].concat(c.map(l=>i(_t(l)))).join("|"),u=ot;if(!(u&&St===a)){if(u&&ye(),!n&&!o){y("auto-mount: SKU n\xE3o resolvido na PDP");return}fe=!0;try{let l=o;o||(K[n]||(K[n]=P(e.projectId,n).then(b=>!!(b&&b.available)).catch(()=>!1)),l=await K[n]);try{Ie(l?"available":"unavailable")}catch(b){}if(!l){y("auto-mount: produto sem try-on",n);return}let s=await $(),w=window.matchMedia("(max-width: 767px)").matches,p=tt(s&&s.main||{},w),g=()=>{let b=z(),f=b&&b.value||n||"";jt(),d("button_clicked",{sku:f,style:p.style}),Q({projectId:e.projectId,identifier:f})},h=Ar();ot=ge(h,p,g),j=[];for(let b=0;b<c.length;b++){let f=c[b],T=ae(f);if(!T)continue;let H=s&&s.anchors&&s.anchors[b]||f;j.push(ge(T,tt(H,w),g))}St=a,ti(),y("auto-mount: bot\xE3o injetado",{style:p.style,sku:n,anchorFound:!!h,mode:h&&h.mode,extras:j.length,forced:o}),d("button_rendered",{style:p.style,sku:n||null,skuSource:r&&r.source,anchorFound:!!h,position:h?h.position:null,mode:h?h.mode:null,extras:j.length,forced:o})}finally{fe=!1}}}function ge(t,e,r){let n=t&&t.mode||"flow",o=Rr(e,r),i=document.createElement("div");i.id=Xo(),Yo(i,{mode:"closed"}).appendChild(o),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(u=>{try{i.addEventListener(u,l=>{l.stopPropagation()},!1)}catch(l){}});let a=!1;if(t&&t.el&&t.el.parentNode&&(n==="overlay"?(ni(t.el,i,t.align),a=!0):(i.style.cssText="display:contents;",a=oi(t.el,i,t.position))),a||(i.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(i)),t&&t.style){let u=Qo(t.style);if(u)try{o.style.cssText+=";"+u}catch(l){}}return i}function jr(){try{let t=m(),e={anchor:t.anchor,anchors:t.anchors,cards:t.cards,forceButton:t.forceButton};window.addEventListener("message",r=>{if(r.source!==window)return;let n=r.data;if(!(!n||!n.__mkCmd)){if(n.__mkCmd==="getButtons"){$().then(o=>{let i=o&&Array.isArray(o.anchors)?o.anchors.length:0;try{window.postMessage({__mkButtons:{extras:i,hasMain:!!(o&&o.main)}},"*")}catch(c){}});return}if(n.__mkCmd==="previewSlot"){$().then(o=>{let i=n.slot||"primary",c={desktop:n.live,tablet:n.live,mobile:n.live};t.anchor=i==="primary"?c:o&&o.main||null;let a=o&&Array.isArray(o.anchors)?o.anchors.slice():[];i.indexOf("extra-")===0&&(a[parseInt(i.slice(6),10)||0]=c),t.anchors=a,t._anchorFromPicker=!0,t.forceButton=!0,M("pdp")});return}else if(n.__mkCmd==="remount")t.anchor=n.anchor||null,t.anchors=n.anchors||null,t._anchorFromPicker=!0,t.forceButton=!0,M("pdp");else if(n.__mkCmd==="galleryPreview")t.cards=n.cards||null,t._anchorFromPicker=!0,t.forceButton=!0,nt(),Tt("category");else if(n.__mkCmd==="applyRecipe"){$().then(o=>{o=o||{};let i=s=>!!(s&&(s.desktop||s.mobile||s.tablet||s.selector));t.anchor=i(n.anchor)?n.anchor:o.main||null;let c=Array.isArray(o.anchors)?o.anchors:[],a=Array.isArray(n.anchors)?n.anchors:[],u=Math.max(c.length,a.length),l=[];for(let s=0;s<u;s++)l.push(i(a[s])?a[s]:c[s]||null);t.anchors=l,n.cards!==void 0&&(t.cards=n.cards||null),t._anchorFromPicker=!0,t.forceButton=!0,M("pdp"),t.cards&&(nt(),Tt("category"))});return}else n.__mkCmd==="cancelPreview"&&(t.anchor=e.anchor,t.anchors=e.anchors,t.cards=e.cards,t._anchorFromPicker=!1,t.forceButton=e.forceButton,ye(),nt(),M("pdp"))}})}catch(t){}}var B=null,et=null,we=null,rt=new Map;function ii(t,e){try{if(e.skuAttr){let o=e.skuSelector?t.querySelector(e.skuSelector):t,i=o&&o.getAttribute(e.skuAttr);if(i)return String(i).trim()}if(e.skuSelector&&!e.skuAttr){let o=t.querySelector(e.skuSelector),i=o&&(o.getAttribute("content")||o.textContent||"").trim();if(i)return i}let r=t.querySelector(e.linkSelector||"a[href]"),n=r&&r.getAttribute("href");if(n){let o=n.match(/-p(\d+)|[?&]variant=(\d+)|\/produtos?\/([\w-]+)|\/products?\/([\w-]+)|-(\d+)(?:[/?#]|$)/);if(o)return o[1]||o[2]||o[3]||o[4]||o[5]}}catch(r){}return null}async function ci(t,e,r){if(rt.has(t))return;let n=!!m().forceButton,o=ii(t,e);if(!o&&!n)return;let i=n;if(i||(K[o]||(K[o]=P(m().projectId,o).then(s=>!!(s&&s.available)).catch(()=>!1)),i=await K[o]),!i||rt.has(t)||!t.isConnected)return;let a={el:e.anchorWithin&&t.querySelector(e.anchorWithin)||t,mode:e.mode||"overlay",align:e.align||"top-left",position:e.position||"afterbegin",style:e.style||""},l=ge(a,r,()=>{jt(),d("button_clicked",{sku:o,gallery:!0,style:r.style}),Q({projectId:m().projectId,identifier:o})});rt.set(t,l),d("button_rendered",{gallery:!0,sku:o,style:r.style})}function me(t){try{document.querySelectorAll(t.cardSelector).forEach(e=>{e.__mkCard||(e.__mkCard=!0,B.observe(e))})}catch(e){}}function nt(){if(B){try{B.disconnect()}catch(t){}B=null}if(et){try{et.disconnect()}catch(t){}et=null}clearTimeout(we),rt.forEach(t=>he(t)),rt.clear()}async function Tt(t){let e=m();if(t==="pdp"||t==="cart"||t==="checkout"||t==="purchase"){nt();return}if(!e.projectId)return;let r=await $(),n=e.cards||r&&r.cards||null;if(!n||!n.cardSelector){nt();return}if(B){me(n);return}if(typeof IntersectionObserver!="function")return;let o=tt(n,window.matchMedia("(max-width: 767px)").matches);B=new IntersectionObserver(i=>{for(let c of i)c.isIntersecting&&(B.unobserve(c.target),ci(c.target,n,o))},{rootMargin:"300px"}),me(n);try{et=new MutationObserver(()=>{clearTimeout(we),we=setTimeout(()=>me(n),250)}),et.observe(document.body,{childList:!0,subtree:!0})}catch(i){}y("auto-mount galeria ativa",{cardSelector:n.cardSelector})}(function(){"use strict";try{let r=function(){try{je(),jr(),yr(),e.autoTrack!==!1&&(er((o,i)=>{sr(o,i),M(o),Tt(o)}),ur()),y("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=Et();if(e.projectId){let o=qe(e.projectId);o&&Mt(o),U().then(i=>{let c=Be(i);Mt(c),Ne(e.projectId,c),y("escopo de coleta",c)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:Q,close:ie,isAvailable:mr,getAvailability:P,onReady:xr,onClose:br,onAddToCart:_r,onProductLoaded:Cr,onError:vr,onInteraction:kr,onGenerationComplete:Sr,testCart:Ge,_version:"0.1.0",_isMkSdk:!0};typeof window!="undefined"&&(window.mk=n)}catch(e){typeof console!="undefined"&&console.error("[mk-sdk] boot fatal",e)}})();})();
1
+ (()=>{var qr=Object.defineProperty;var v=(t,e)=>{for(var r in e)qr(t,r,{get:e[r],enumerable:!0})};var Et={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},Dr={},W=null;function Lt(){if(W)return W;let t=null;try{t=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]')||document.querySelector('script[src*="mk-pixel"]')}catch(i){}let e=i=>{try{return t&&t.getAttribute(i)}catch(c){return null}},r=e("data-mk-project")||e("data-mk-client")||window.__MK&&(window.__MK.projectId||window.__MK.clientSlug)||null,n=e("data-mk-product")||window.__MK&&window.__MK.product||"mk-fashion",o=e("data-mk-collector")||window.__MK&&window.__MK.collectorUrl||Dr.collectorUrl||Et.collectorUrl;return W={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||Et.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||Et.apiUrl,debug:!!(e("data-mk-debug")!==null||window.__MK&&window.__MK.debug||/[?&]mkdebug\b/.test(location.search)),observe:!!(window.__MK&&window.__MK.observe),forceButton:!!(window.__MK&&window.__MK.forceButton),anchor:window.__MK&&window.__MK.anchor||null,anchors:window.__MK&&window.__MK.anchors||null,cards:window.__MK&&window.__MK.cards||null,cartRedirect:!(window.__MK&&window.__MK.cartRedirect===!1),cartBehavior:window.__MK&&window.__MK.cartBehavior||null,cartOpenSelector:window.__MK&&window.__MK.cartOpenSelector||null,autoTrack:e("data-mk-no-autotrack")===null,batchIntervalMs:window.__MK&&window.__MK.batchIntervalMs||8e3,batchMaxSize:window.__MK&&window.__MK.batchMaxSize||20,engagementIntervalMs:15e3},W}function m(){return W||Lt()}function g(...t){let e=m();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var be="_mk_vid",_e="_mk_sid",G=null,X=null;function at(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function ve(){if(G)return G;try{let t=localStorage.getItem(be);return t||(t="v_"+at(),localStorage.setItem(be,t)),G=t,t}catch(t){return G="v_"+at(),G}}function Ce(){if(X)return X;try{let t=sessionStorage.getItem(_e);return t||(t="s_"+at(),sessionStorage.setItem(_e,t)),X=t,t}catch(t){return X="s_"+at(),X}}var ke=[/email/i,/e-?mail/i,/cpf/i,/cnpj/i,/phone/i,/telefone/i,/celular/i,/address/i,/endereco/i,/cep/i,/zip/i,/card/i,/cartao/i,/cvv/i,/password/i,/senha/i,/token/i,/\bnome\b/i,/fullname/i,/firstname/i,/lastname/i,/sobrenome/i,/birth/i,/nascimento/i,/rg\b/i],Se={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},It=2e3;function Te(t){for(let e=0;e<ke.length;e++)if(ke[e].test(t))return!0;return!1}function Ae(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>It?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Te(r))continue;let n=t[r];if(Se[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>It){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=Ur(n);continue}e[r]=n}return e}function Ur(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Te(r))continue;let n=t[r];if(Se[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>It){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var lt=[],Rt=null,q=null,Fr=["off","pdp_tryon","pdp","all","tryon_engaged"],Y,Pt=null,st="unknown",D=[],N=null;function Le(){let t=m();return"mk_engaged_"+(t&&t.projectId||"")}function Mt(){if(N!==null)return N;try{N=localStorage.getItem(Le())==="1"}catch(t){N=!1}return N}function jt(){if(!Mt()){N=!0;try{localStorage.setItem(Le(),"1")}catch(t){}ut(!1)}}var zr=/^purchase$/;function Ie(t,e){if(Y===void 0)return"hold";if(Y==="off")return"drop";if(Y==="all"||e&&zr.test(e))return"collect";switch(Y){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(Mt())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":st==="available"?"collect":st==="unavailable"?"drop":"hold";default:return"collect"}}function ut(t){if(!D.length)return;let e=[];for(let r of D){let n=Ie(r._pt,r.name);n==="collect"?Me(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}D=e}function Ot(t){Y=Fr.indexOf(t)>=0?t:"all",ut(!1)}function Re(t){st=t==="available"?"available":"unavailable",ut(!1)}function Pe(t){ut(!0),q=t,Pt=t&&t.pageType||null,st="unknown"}function p(t,e,r){if(!m().projectId){(p._pre=p._pre||[]).push({name:t,params:e,ts:r||Date.now()}),p._pre.length>50&&p._pre.shift();return}if(p._pre&&p._pre.length){let o=p._pre;p._pre=[];for(let i of o)Ee(i.name,i.params,i.ts)}Ee(t,e,r)}function Ee(t,e,r){let n=Ie(Pt,t);if(n==="collect"){Me(t,e,r);return}if(n==="drop"){g("descartado (escopo)",t);return}D.push({name:t,params:e,ts:r||Date.now(),_pt:Pt}),D.length>300&&D.shift()}function Me(t,e,r){let n=m(),o=Ae(e||{}),i="page_"+$r(t);if(lt.push({name:i,ts:r||Date.now(),params:o}),g("queued",t,o),n.observe)try{window.postMessage({__mkpixel:!0,event:{name:i,params:o},site:q?{pageType:q.pageType,platform:q.platform,url:q.url}:null},"*")}catch(c){}if(lt.length>=n.batchMaxSize){P();return}Rt||(Rt=setTimeout(()=>{Rt=null,P()},n.batchIntervalMs))}function $r(t){if(typeof t!="string"||!t)return"unknown";let e=t.replace(/^on/,"");return e=e.replace(/[A-Z]/g,(r,n)=>(n>0?"_":"")+r.toLowerCase()),e.indexOf("page_")===0&&(e=e.slice(5)),e}function P(t){if(lt.length===0)return;let e=m();if(!e.projectId||!e.collectorUrl)return;let r=lt.splice(0,50),n=JSON.stringify({product:e.product||void 0,visitorId:ve(),sessionId:Ce(),engaged:Mt()||void 0,events:r,site:q||void 0}),o=e.collectorUrl+"/v1/track";try{fetch(o,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:n}).catch(()=>{})}catch(i){try{navigator.sendBeacon&&navigator.sendBeacon(o+"?projectId="+encodeURIComponent(e.projectId),new Blob([n],{type:"text/plain"}))}catch(c){}}}function je(){try{window.addEventListener("pagehide",()=>P(!0)),window.addEventListener("beforeunload",()=>P(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&P(!0)})}catch(t){}}function A(t){let e=[];try{let r=document.querySelectorAll('script[type="application/ld+json"]');for(let n of r){let o;try{o=JSON.parse(n.textContent)}catch(c){continue}let i=[];Array.isArray(o)?i.push(...o):o["@graph"]?i.push(...o["@graph"]):i.push(o);for(let c of i){if(!c||!c["@type"])continue;let a=Array.isArray(c["@type"])?c["@type"]:[c["@type"]];(!t||t.some(s=>a.includes(s)))&&e.push(c)}}}catch(r){}return e}var Oe=["off","pdp_tryon","pdp","all","tryon_engaged"],Kr="all",Hr=30*60*1e3,U=null;function F(){if(U)return U;let t=m();return!t.projectId||!t.apiUrl?(U=Promise.resolve(null),U):(U=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>e.ok?e.json():null).then(e=>e&&e.project||e||null).catch(()=>null),U)}function Be(t){let e=t&&t.analytic&&t.analytic.scope;return Oe.indexOf(e)>=0?e:Kr}var Ne=t=>"mk_scope_"+t;function qe(t){try{let e=localStorage.getItem(Ne(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:Oe.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function De(t,e){try{localStorage.setItem(Ne(t),JSON.stringify({scope:e,exp:Date.now()+Hr}))}catch(r){}}var qt={};v(qt,{addToCart:()=>cn,detect:()=>en,getCartSummary:()=>nn,id:()=>Qr,openCartDrawer:()=>an,resolveSku:()=>rn,skipRedirect:()=>tn});var pt={};v(pt,{addToCart:()=>Wr,detect:()=>Jr,getCartSummary:()=>Nt,id:()=>Vr,openCartDrawer:()=>Zr,resolveSku:()=>Bt});var Vr="shopify";function Jr(){return!!(window.Shopify||window.ShopifyAnalytics)}function Bt(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var dt=t=>String(t==null?"":t).trim().toLowerCase();async function Wr({size:t,color:e,sku:r,quantity:n}){let o=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(!o)throw new Error("shopify: sem handle de produto na URL (n\xE3o \xE9 PDP?)");let c=(await fetch("/products/"+o+".js").then(f=>f.json())).variants||[],a=f=>[f.option1,f.option2,f.option3].concat(String(f.title||"").split("/")).map(dt).filter(Boolean),s=(f,T)=>a(f).indexOf(dt(T))>=0,l=f=>(!t||s(f,t))&&(!e||s(f,e)),u=null;if((t||e)&&(u=c.find(f=>l(f)&&f.available)||c.find(l)),!u&&r&&(u=c.find(f=>dt(f.sku)===dt(r))),u||(u=c.find(f=>f.available)||c[0]),!u)throw new Error("shopify: variante n\xE3o encontrada");let w=Ue(),d=null;if(w&&typeof w.getSectionsToRender=="function")try{d=w.getSectionsToRender().map(f=>({id:f.id,selector:f.selector||"#"+f.id})).filter(f=>f.id)}catch(f){}let h={items:[{id:u.id,quantity:n||1}]};d&&d.length&&(h.sections=d.map(f=>f.id).join(","),h.sections_url=location.pathname);let y=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(!y.ok)throw new Error("shopify: /cart/add.js HTTP "+y.status);let b=await y.json().catch(()=>({}));return w&&d&&b.sections&&Gr(w,d,b.sections),{platform:"shopify",variantId:u.id,size:u.title,sku:u.sku||null}}function Ue(){return document.querySelector("cart-drawer, cart-notification")}function Gr(t,e,r){for(let n of e){let o=r[n.id];if(o)try{let i=null;if(typeof t.getSectionInnerHTML=="function")i=t.getSectionInnerHTML(o,n.selector);else{let a=new DOMParser().parseFromString(o,"text/html").querySelector(n.selector);i=a?a.innerHTML:null}let c=document.querySelector(n.selector);c&&i!=null&&(c.innerHTML=i)}catch(i){}}}async function Nt(){try{let t=await fetch("/cart.js",{headers:{Accept:"application/json"}}).then(e=>e.json());return{value:(Number(t.total_price)||0)/100,itemCount:Number(t.item_count)||0,currency:t.currency||null}}catch(t){return null}}var Xr=["[data-cart-drawer-toggle]",'[data-action="open-cart-drawer"]','[data-action="open-cart"]',".js-cart-drawer-open",".js-drawer-open-cart",".cart-drawer-toggle",".js-cart-toggle",'[aria-controls="CartDrawer"]','[aria-controls="cart-drawer"]',"#cart-icon-bubble","#lk-cart-icon",".header__cart",".site-header__cart",".cart-link",".header-cart",'a[href="/cart"]','a[href$="/cart"]'];function Yr(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function Zr(){let t=Ue();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of Xr)try{if(e=[...document.querySelectorAll(r)].find(Yr),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var Qr="zerezes",tn=!0;function en(){try{if(!(window.Shopify||window.ShopifyAnalytics))return!1;let t=window.Shopify&&window.Shopify.shop||"";return/(^|\.)zerezes\./i.test(location.hostname)||/cs-zerezes/i.test(t)}catch(t){return!1}}var rn=Bt,nn=Nt;function on(){let t=[...document.querySelectorAll(".lens-selection__button, [data-has-lens-basket]")];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function cn(){let t=on();if(!t)throw new Error("zerezes: bot\xE3o de sele\xE7\xE3o de lentes n\xE3o encontrado");try{window.postMessage({source:"mkfashion-app",action:"close_request"},"*")}catch(e){}return setTimeout(()=>{try{t.click()}catch(e){}},250),{platform:"zerezes",nativeFlow:"lens-selection"}}function an(){return!0}var Ut={};v(Ut,{addToCart:()=>dn,detect:()=>sn,getCartSummary:()=>pn,id:()=>ln,resolveSku:()=>un});var ln="hybris";function sn(){return!!(window.ACC&&window.ACC.config)}function un(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var Fe=t=>String(t==null?"":t).trim().toLowerCase();async function dn({size:t,quantity:e}){let r=[...document.querySelectorAll('.js-product-select-size, a[data-code], [class*="select-size"]')].filter(h=>h.getAttribute&&h.getAttribute("data-code")),n=t?r.find(h=>Fe(h.textContent)===Fe(t)):null;n||(n=r.find(h=>h.offsetParent!==null)||r[0]);let o=n&&n.getAttribute("data-code");if(!o)throw new Error("hybris: variante (data-code) n\xE3o encontrada");let i=document.getElementById("product--add-to-cart-form")||document.querySelector('form[action*="/cart/add"]'),c=i&&i.querySelector('[name="CSRFToken"]'),a=c&&c.value,s=i&&i.getAttribute("action")||"/cart/add";if(!a)throw new Error("hybris: CSRFToken n\xE3o encontrado");let l=new URLSearchParams;l.set("productCodePost",o),l.set("qty",String(e||1)),l.set("CSRFToken",a);let u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:l.toString()});if(!u.ok)throw new Error("hybris: "+s+" HTTP "+u.status);let w=null,d=null;try{let h=await u.clone().json(),y=h&&h.cartData;y&&(w=Dt(y.total!=null?y.total:y.totalPrice),d=y.totalUnitCount!=null?Number(y.totalUnitCount):Array.isArray(y.products)?y.products.length:null)}catch(h){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:w,itemCount:d,currency:"BRL"}}function Dt(t){if(t==null||t==="")return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r=e.indexOf(",")>e.indexOf(".")?parseFloat(e.replace(/\./g,"").replace(",",".")):parseFloat(e.replace(/,/g,""));return Number.isFinite(r)?r:null}async function pn(){try{let t=await fetch("/cart/async?nocache="+Date.now(),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(c=>c.ok?c.text():"");if(!t)return null;let e=new DOMParser().parseFromString(t,"text/html"),r=e.querySelector(".minicart-total .price")||e.querySelector(".floating-cart--cart-total"),n=r?Dt(r.textContent):null,o=e.querySelector(".mini-badge"),i=o?parseInt(o.textContent,10)||0:null;return n==null&&i==null?null:{value:n,itemCount:i,currency:"BRL"}}catch(t){}try{let t=[".minicart-total .price",".js-cart-total",".cart-total",".total-price",".grand-total"];for(let e of t){let r=document.querySelector(e),n=r&&Dt(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var Ft={};v(Ft,{addToCart:()=>yn,detect:()=>mn,getCartSummary:()=>gn,id:()=>fn,resolveSku:()=>hn});var fn="vtex";function mn(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0)}function hn(){let t=window;return t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0]?{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"}:t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0]?{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"}:null}var ft=t=>String(t==null?"":t).trim().toLowerCase();async function yn({size:t,quantity:e}){let r=window.skuJson_0&&window.skuJson_0.skus||[];if(!r.length)throw new Error("vtex: skuJson_0 indispon\xEDvel");let n=i=>ft(i.skuname)===ft(t)||i.dimensions&&Object.values(i.dimensions).some(c=>ft(c)===ft(t)),o=t?r.find(i=>n(i)&&i.available)||r.find(n):null;if(o||(o=r.find(i=>i.available)||r[0]),!o)throw new Error("vtex: variante n\xE3o encontrada");if(window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart)return await window.vtexjs.checkout.addToCart([{id:parseInt(o.sku,10),quantity:e||1,seller:"1"}]),{platform:"vtex",skuId:o.sku,size:o.skuname||t};throw new Error("vtex: vtexjs.checkout indispon\xEDvel")}function gn(){try{let t=window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.orderForm;if(t&&typeof t.value=="number"){let e=t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL",r=(t.items||[]).reduce((n,o)=>n+(Number(o.quantity)||1),0);return{value:t.value/100,itemCount:r,currency:e}}}catch(t){}return null}var zt={};v(zt,{addToCart:()=>vn,detect:()=>bn,getCartSummary:()=>kn,id:()=>wn,openCartDrawer:()=>Cn,resolveSku:()=>_n,skipRedirect:()=>xn});var wn="nuvemshop",xn=!0;function bn(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function _n(){try{let t=window.LS,e=t&&t.variants||[],r=document.querySelector('[name="variant_id"]'),n=r&&r.value?e.find(o=>String(o.id)===String(r.value)):null;if(n||(n=e.find(o=>o.available!==!1&&o.sku)||e.find(o=>o.sku)||e[0]),n&&n.sku)return{value:String(n.sku),source:"nuvemshop/variant"};if(t&&t.product&&t.product.sku)return{value:String(t.product.sku),source:"nuvemshop/product"}}catch(t){}return null}var mt=t=>String(t==null?"":t).trim().toLowerCase();async function vn({size:t,quantity:e,productId:r}){if(r&&!document.getElementById("product_form")){let a=document.querySelector('[data-product-id="'+String(r).replace(/["\\]/g,"")+'"]'),s=a&&a.querySelector("form[action]"),l=s&&s.getAttribute("action")||"/comprar/",u=!1,w=null;try{let h=await(await fetch(l,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:"add_to_cart="+encodeURIComponent(r)+"&quantity="+(e||1)})).json().catch(()=>({}));u=!!h.success,w=h.error_code||null}catch(d){}return{platform:"nuvemshop",productId:r,via:"gallery",added:u,reason:w}}let n=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!n)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&n.querySelectorAll('select[name^="variation"]').forEach(a=>{let s=[...a.options].find(l=>mt(l.textContent).includes(mt(t))||mt(l.value)===mt(t));s&&(a.value=s.value,a.dispatchEvent(new Event("change",{bubbles:!0})))});let o=n.querySelector('[name="quantity"]');o&&e&&(o.value=String(e)),await new Promise(a=>setTimeout(a,400));let i=n.querySelector(".js-addtocart")||document.querySelector(".js-addtocart");return i?i.click():typeof n.requestSubmit=="function"?n.requestSubmit():n.submit(),await new Promise(a=>setTimeout(a,1200)),{platform:"nuvemshop",variantId:(n.querySelector('[name="variant_id"]')||{}).value||null}}function Cn(){try{if([...document.querySelectorAll('.modal-cart, #ajax-cart-details, [class*="cart-modal" i], [class*="modal-cart" i]')].find(n=>n.getBoundingClientRect().width>0))return!0;let e=[...document.querySelectorAll(".js-toggle-cart")],r=e.find(n=>{let o=n.getBoundingClientRect();return o.width>0&&o.height>0})||e[0];if(r)return setTimeout(()=>{try{r.click()}catch(n){}},300),!0}catch(t){}return!1}function kn(){try{let t=window.LS,e=t&&t.cart;if(!e)return null;let r=t.currency&&t.currency.code||"BRL",n=Array.isArray(e.items)?e.items.reduce((i,c)=>i+(Number(c.quantity)||1),0):Number(e.items)||0,o=e.subtotal!=null?Number(e.subtotal):null;return{value:o!=null?o/100:null,itemCount:n,currency:r}}catch(t){return null}}var $t={};v($t,{addToCart:()=>Ln,detect:()=>An,getCartSummary:()=>In,id:()=>Sn,openCartDrawer:()=>Pn,resolveSku:()=>En,skipRedirect:()=>Tn});var Sn="wake",Tn=!0;function An(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function En(){try{let t=document.querySelector('input[name="product-id"], [data-product-id]'),e=t?t.value||t.getAttribute("data-product-id"):null;if(e)return{value:String(e).trim(),source:"wake/product-id"};let r=(location.pathname||"").match(/-(\d+)\/?(?:[?#]|$)/);if(r)return{value:r[1],source:"wake/url"}}catch(t){}return null}var ze=t=>String(t==null?"":t).trim().toLowerCase();async function Ln({size:t,quantity:e}){if(t){let i=[...document.querySelectorAll("input[attribute-value]")].find(c=>ze(c.getAttribute("attribute-value"))===ze(t));if(i){try{i.checked=!0}catch(c){}try{typeof window.selectAttribute=="function"?window.selectAttribute(i):i.click()}catch(c){}await new Promise(c=>setTimeout(c,600))}}let r=document.querySelector('[name="product-variant-id"]'),n=r&&r.value;if(!n)throw new Error("wake: product-variant-id n\xE3o encontrado");if(typeof window.addOrCreateCheckout!="function")throw new Error("wake: addOrCreateCheckout indispon\xEDvel");if(!await window.addOrCreateCheckout([{productVariantId:Number(n),quantity:e||1,customization:[]}]))throw new Error("wake: addOrCreateCheckout retornou false");return{platform:"wake",productVariantId:n,size:t||null}}function $e(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}async function In(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?$e(o.textContent):null},e=t();if(e==null&&typeof window.loadMiniCart=="function"){try{window.loadMiniCart()}catch(o){}await new Promise(o=>setTimeout(o,700)),e=t()}e==null&&(e=Rn());let r=document.querySelector('.mc-products__count, [class*="mc-"][class*="count" i], [class*="minicart" i] [class*="count" i]'),n=r&&parseInt(String(r.textContent||"").replace(/\D/g,""),10)||null;if(e!=null)return{value:e,itemCount:n,currency:"BRL"}}catch(t){}return null}function Rn(){try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart')||document;for(let e of t.querySelectorAll("div,span,p,li,strong,b")){if(e.children.length>2)continue;let r=(e.textContent||"").replace(/\s+/g," ").trim();if(!(!/R\$/.test(r)||/frete|faltam|gr[aá]tis|desconto|economi/i.test(r))&&/^(sub)?total\b/i.test(r)){let n=$e(r);if(n)return n}}}catch(t){}return null}function Pn(){if(typeof window.setCartDivVisibility!="function")return!1;try{typeof window.loadMiniCart=="function"&&window.loadMiniCart()}catch(t){}return setTimeout(()=>{try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart');if(t&&t.getBoundingClientRect().width>0)return;window.setCartDivVisibility()}catch(t){}},350),!0}var Vt={};v(Vt,{addToCart:()=>Nn,cartUrl:()=>On,detect:()=>Bn,getCartSummary:()=>qn,id:()=>Mn,openCartDrawer:()=>Dn,skipRedirect:()=>jn});var Kt="/api/v2/front",Ht={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Ke=t=>String(t==null?"":t).trim().toLowerCase(),Mn="wapstore",jn=!0,On="/checkout/carrinho";function Bn(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function He(t){if(!t||typeof t!="object")return null;let e=t.subtotal&&t.subtotal.valor;return e==null?null:{value:e,itemCount:t.quantidadeItens!=null?t.quantidadeItens:null,currency:"BRL"}}async function Nn({size:t,quantity:e}){let r=await fetch(Kt+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:Ht}).then(d=>d.json()),n=(r&&(r.produto||r.data||r)||{}).conteudo||{},o=n.atributos&&n.atributos.simples&&n.atributos.simples.valores||[];if(!o.length)throw new Error("wapstore: sem variante de compra (atributos.simples)");let i=t?o.find(d=>Ke(d.label)===Ke(t)):null;i=i||o.find(d=>d.selecionado)||o.find(d=>(d.estoque||0)>0)||o[0];let c=i&&i.carrinho;if(!c||!c.itens||!c.itens.length)throw new Error("wapstore: variante sem payload de carrinho");let a=c.itens.map(d=>Object.assign({},d,{quantidade:String(e||d.quantidade||1)})),s=await fetch(Kt+"/checkout/cart",{method:"POST",headers:Ht,body:JSON.stringify({itens:a,tipo:c.tipo||"produto"})});if(!s.ok)throw new Error("wapstore: add HTTP "+s.status);let l=await s.json().catch(()=>({})),u=He(l),w={platform:"wapstore",idProduto:a[0]&&a[0].idProduto,size:i&&i.label||null};return u&&(w.cartValue=u.value,w.itemCount=u.itemCount,w.currency=u.currency),w}async function qn(){try{let t=await fetch(Kt+"/checkout/cart",{headers:Ht}).then(e=>e.json());return He(t)}catch(t){}return null}function Dn(){try{let t=document.querySelector(".common-sheet.side-cart, .side-cart");if(t&&t.getBoundingClientRect().width>0)return!0;let e=document.querySelector('.button-cart, [class*="button-cart"]');if(e)return e.click(),!0}catch(t){}return!1}var Jt={};v(Jt,{addToCart:()=>Vn,detect:()=>$n,getCartSummary:()=>Jn,id:()=>Un,openCartDrawer:()=>Wn,resolveSku:()=>Kn,skipRedirect:()=>Fn});var Un="linx",Fn=!0;function zn(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}function $n(){return typeof window.carrinhoLateral=="function"&&typeof window.addToCart=="function"}function Kn(){try{let t=(location.pathname.match(/-p(\d+)\/?(?:[?#]|$)/)||[])[1];if(t)return{value:t,source:"linx/url-pid"};let e=(String(document.body.className||"").match(/context-product-(\d+)/)||[])[1];if(e)return{value:e,source:"linx/context"}}catch(t){}return null}function Hn(){let t=[...document.querySelectorAll('.add-to-cart, [data-action="add-to-cart"]')];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function Vn(){let t=Hn();if(!t)throw new Error("linx: bot\xE3o .add-to-cart n\xE3o encontrado");return t.click(),await new Promise(e=>setTimeout(e,1400)),{platform:"linx"}}function Jn(){try{let t=document.querySelector("#mini-cart");if(!t)return null;let e=null;for(let n of t.querySelectorAll("div,span,p,li,strong,b,td")){if(n.children.length>2)continue;let o=(n.textContent||"").replace(/\s+/g," ").trim();if(/^(sub)?total\b/i.test(o)&&/R\$/.test(o)&&(e=zn(o),e))break}if(e==null)return null;let r=(t.textContent||"").match(/cont[ée]m\s+(\d+)\s+ite/i);return{value:e,itemCount:r?parseInt(r[1],10):null,currency:"BRL"}}catch(t){}return null}function Wn(){try{let e=typeof window.carrinhoLateral=="function"?window.carrinhoLateral():null;if(e&&typeof e.openCart=="function"){try{typeof e.fetchHTML=="function"&&e.fetchHTML()}catch(r){}return setTimeout(()=>{try{e.openCart()}catch(r){}},400),!0}}catch(e){}let t=document.querySelector("#mini-cart");if(t){try{t.classList.add("open")}catch(e){}return!0}return!1}var Gt={};v(Gt,{addToCart:()=>Z,detect:()=>Xn,id:()=>Gn,resolveSku:()=>Wt});var Gn="generic";function Xn(){return!0}function Wt(){let t=A(["Product"]);if(t[0]){let e=t[0],r=e.sku||e.mpn||e.gtin13||e.productID;if(r)return{value:String(r),source:"jsonld"}}try{let e=document.querySelector('[itemprop="sku"]');if(e){let r=e.getAttribute("content")||(e.textContent||"").trim();if(r)return{value:String(r),source:"microdata"}}}catch(e){}try{let e=window.konfidencyData;if(e&&e.product&&e.product.variants&&e.product.variants[0])return{value:String(e.product.variants[0]),source:"konfidency"}}catch(e){}return null}var Yn=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,Zn=/continuar|como comprar|lista|desejos|favorito/i;async function Z(){let t=document.querySelectorAll("button,[role=button],input[type=submit]");for(let e of t){let r=(e.textContent||e.value||"").replace(/\s+/g," ").trim();if(r&&r.length<40&&Yn.test(r)&&!Zn.test(r))try{return e.click(),{platform:"native-click",clicked:r}}catch(n){}}return{platform:"none",error:"bot\xE3o de carrinho nativo n\xE3o encontrado"}}var Je=[qt,pt,Ut,Ft,zt,$t,Vt,Jt],Qn=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],ht;function z(){return ht||(ht=Je.find(t=>{try{return t.detect()}catch(e){return!1}})||Gt,ht)}function We(){let t=Je.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of Qn)try{if(r())return e}catch(n){}return null}function $(){let t=z();if(t.id!=="generic"&&t.resolveSku)try{let e=t.resolveSku();if(e)return e}catch(e){}return Wt()}async function Ge(t){t=t||{};let e={size:t.size||t.selectedSize||t.tamanho||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1,productId:t.productId||null},r=z();try{let n=r.addToCart?await r.addToCart(e):await Z(e);return g("cart: adicionado",n),Xt(),Ve(r,n,e.sku),n}catch(n){g('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await Z(e);return Xt(),Ve(r,o,e.sku),o}}async function Ve(t,e,r){try{let n=null;e&&e.cartValue!=null?n={value:e.cartValue,itemCount:e.itemCount!=null?e.itemCount:null,currency:e.currency||null}:t&&t.getCartSummary&&(n=await t.getCartSummary()),n&&n.value!=null&&(n.value>0||(n.itemCount||0)>0)&&p("cart_value",{via:"tryon",value:n.value,itemCount:n.itemCount!=null?n.itemCount:null,currency:n.currency||null,sku:r||null})}catch(n){}}async function Yt(){let t=z();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function Xe(t){t=t||{};let e=z(),r={platform:e.id};try{let n=$();r.sku=n&&n.value||null;let o={size:t.size||null,color:t.color||null,sku:r.sku,quantity:t.quantity||1};r.added=e.addToCart?await e.addToCart(o):await Z(o),Xt();try{await Zt()}catch(i){}r.cart=await Yt(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function Xt(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function Zt(){let t=z(),e=m(),r=null;try{r=await F()}catch(i){}let n=r&&r.template&&r.template.cart||r&&r.cart||{},o=n.afterAdd||n.behavior||e.cartBehavior;if(o||(o=e.cartRedirect===!1?"none":"auto"),o==="none")return!1;if(o==="auto"||o==="drawer"){let i=n.openSelector||e.cartOpenSelector;if(i){let c=document.querySelector(i);if(c)return setTimeout(()=>{try{c.click()}catch(a){}},300),!1}else if(t&&t.openCartDrawer){let c=!1;try{c=t.openCartDrawer()}catch(a){}if(c)return!1}}return!0}function Ye(){let t=z();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var to=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced)/i,eo=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,ro=/\/checkout/i,no=/\/(cart|carrinho|sacola|bag)(\/|$|\?|#)/i,Ze=/\/(products?|produtos?|p)\//i,oo=/\/(collections?|categoria|categorias|c|departamento)\//i,io=/\/(search|busca|s)(\/|\?)/i;function Qe(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=eo.test(t);try{let r=A(),n=0,o=!1,i=!1;for(let c of r){let a=Array.isArray(c["@type"])?c["@type"]:[c["@type"]];if((a.includes("Order")||a.includes("Invoice"))&&!e)return"purchase";a.includes("SearchResultsPage")&&(o=!0),(a.includes("CollectionPage")||a.includes("ItemList"))&&(i=!0),a.includes("Product")&&n++}if(o)return"search";if(i)return"category";if(n===1)return"pdp";if(n>1)return Ze.test(t)?"pdp":"category"}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":to.test(t)&&!e?"purchase":ro.test(t)?"checkout":no.test(t)?"cart":Ze.test(t)?"pdp":oo.test(t)?"category":io.test(t)?"search":"other"}function tr(t){let e=null;try{let r=new URLSearchParams(location.search),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],o={};for(let i of n){let c=r.get(i);c&&(o[i.replace("utm_","")]=c)}Object.keys(o).length&&(e=o)}catch(r){}return{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:t,utm:e,userAgent:navigator.userAgent,language:navigator.language,viewport:window.innerWidth+"x"+window.innerHeight,platform:co()}}function co(){return We()}var Qt={},ao=null,Q=0,er=!1;function rr(t){er||(er=!0,nr(t),lo(),so(),uo(),po(),fo(t))}function nr(t){Qt={};let e=Qe(),r=tr(e);if(Pe(r),p("view",{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:e}),typeof t=="function")try{t(e,r)}catch(n){}}function lo(){if(!document.body)return;let t={A:1,BUTTON:1,INPUT:1,SELECT:1,TEXTAREA:1},e=0;document.body.addEventListener("click",r=>{try{let n=Date.now();if(n-e<100)return;e=n;let o=r.target;for(let a=0;a<5&&o&&o!==document.body&&!(t[o.tagName]||o.getAttribute&&o.getAttribute("role")==="button");a++)o=o.parentElement;if(!o||!t[o.tagName]&&!(o.getAttribute&&o.getAttribute("role")==="button"))return;let i={tag:o.tagName},c=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o.value:o.textContent;i.text=(c||"").replace(/\s+/g," ").trim().substring(0,100),o.href&&(i.href=String(o.href).substring(0,500)),o.id&&(i.id=o.id),o.className&&typeof o.className=="string"&&(i.classes=o.className.trim().substring(0,200)),p("click",i)}catch(n){}},{capture:!0,passive:!0})}function so(){let t=[25,50,75,100],e=null,r=()=>{try{let n=window.scrollY||document.documentElement.scrollTop||0,o=Math.max(document.body&&document.body.scrollHeight||0,document.documentElement&&document.documentElement.scrollHeight||0);if(o<=0)return;let i=Math.min(100,Math.floor((n+window.innerHeight)/o*100));for(let c of t)i>=c&&!Qt[c]&&(Qt[c]=!0,p("scroll_depth",{depth:c}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function uo(){document.body&&document.body.addEventListener("submit",t=>{try{let e=t.target;if(!e||e.tagName!=="FORM"||e.querySelector('input[type="password"], input[name*="card"], input[name*="cpf"]'))return;let r="other",n=(e.className||"").toLowerCase(),o=(e.action||"").toLowerCase();e.querySelector('input[type="search"], input[name="q"], input[name="s"]')?r="search":/newsletter|subscribe|mailchimp/.test(n+o)?r="newsletter":/contact|contato/.test(n+o)&&(r="contact"),p("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function po(){let t=m();Q=Date.now(),ao=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-Q)/1e3);Q=e,r>0&&r<60&&p("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-Q)/1e3);e>0&&e<600&&p("engagement",{url:location.pathname,dwellSec:e})}Q=Date.now()})}function fo(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,nr(t))};try{let n=history.pushState,o=history.replaceState;history.pushState=function(){n.apply(this,arguments),setTimeout(r,0)},history.replaceState=function(){o.apply(this,arguments),setTimeout(r,0)},window.addEventListener("popstate",r)}catch(n){}}function ee(){let t=$(),e=A(["Product"]);if(e.length>0){let o=e[0],i=Array.isArray(o.offers)?o.offers[0]:o.offers;return{sku:t?t.value:o.sku||o.mpn||o.gtin13||o.productID||null,skuSource:t?t.source:null,name:typeof o.name=="string"?o.name:null,price:i&&parseFloat(i.price||i.lowPrice)||null||or(),currency:i?i.priceCurrency:null,brand:o.brand?typeof o.brand=="string"?o.brand:o.brand.name:null,category:o.category||null}}let r=o=>{let i=document.querySelector('meta[property="og:'+o+'"], meta[property="product:'+o+'"]');return i?i.getAttribute("content"):null},n=o=>{let i=document.querySelector('[itemprop="'+o+'"]');return i?i.getAttribute("content")||(i.textContent||"").trim():null};if(t||r("type")==="product"||r("price:amount")||n("name")){let o=n("price")||r("price:amount"),i=o&&parseFloat(String(o).replace(",","."))||null;return{sku:t?t.value:null,skuSource:t?t.source:null,name:n("name")||r("title")||document.title||null,price:(i&&i>0?i:null)||or(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function or(){try{let t=window.dataLayer;if(!Array.isArray(t))return null;for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||typeof r!="object")continue;let n=r.ecommerce||r,o=n&&n.items||null,i=n&&n.detail&&n.detail.products||n&&n.products||r.products||null,c=Array.isArray(o)&&o[0]&&o[0].price||Array.isArray(i)&&i[0]&&i[0].price||null,a=te(c!=null?String(c):"");if(a)return a}}catch(t){}return null}function M(){try{let t=location.pathname+location.search,e=t.match(/order[_-]?confirmation\/([\w-]+)/i)||t.match(/[?&]order[_-]?id=([\w-]+)/i)||t.match(/\/orders?\/([\w-]{4,})/i)||t.match(/pedido[_-]?(?:confirmado|realizado|finalizado)?\/([\w-]+)/i);return e?e[1]:null}catch(t){return null}}function re(){let t=A(["Order","Invoice"]);if(t.length>0){let o=t[0],i=o.totalPaymentDue?parseFloat(o.totalPaymentDue.price):parseFloat(o.price||o.total);return{orderId:o.orderNumber||o.confirmationNumber||o.identifier||M(),revenue:Number.isFinite(i)?i:null,currency:o.totalPaymentDue&&o.totalPaymentDue.priceCurrency||o.priceCurrency||null,source:"jsonld"}}try{let o=window.Shopify&&window.Shopify.checkout;if(o&&o.total_price!=null){let i=parseFloat(o.total_price);return{orderId:(o.order_id!=null?String(o.order_id):null)||o.token||M(),revenue:Number.isFinite(i)?i:null,currency:o.currency||null,itemCount:Array.isArray(o.line_items)?o.line_items.length:null,source:"shopify"}}}catch(o){}try{if(Array.isArray(window.dataLayer))for(let o=window.dataLayer.length-1;o>=0;o--){let i=window.dataLayer[o],c=i&&i.ecommerce||i&&i.ecommerce_data&&i.ecommerce_data.ecommerce;if(c&&(i.event==="purchase"||c.purchase)){let a=c.purchase&&c.purchase.actionField,s=parseFloat(a&&(a.revenue||a.value)||c.value||c.revenue);return{orderId:a&&(a.id||a.transaction_id)||c.transaction_id||c.transactionId||M(),revenue:Number.isFinite(s)?s:null,currency:c.currency||c.currencyCode||a&&a.currency||null,itemCount:(c.purchase&&c.purchase.products||c.items||c.products||[]).length||null,source:"datalayer"}}}}catch(o){}let e=document.querySelector('meta[property="order:total"], meta[name="order-total"]');if(e&&e.content)return{orderId:M(),revenue:parseFloat(e.content)||null,source:"meta"};let r=mo();if(r)return r;let n=M();return n?{orderId:n,revenue:null,source:"url"}:null}function mo(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=te(n.length>1?n[n.length-1]:r);if(o)return{orderId:ir(),revenue:o,currency:(n.length>1?n[0]:null)||null,source:"dom"}}let e=[".order-total","#order-total",".total-price",".order__total","[data-order-total]",".summary-total",".grand-total"];for(let r of e){let n=document.querySelector(r);if(n){let o=te(n.value||n.textContent);if(o)return{orderId:ir(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function ir(){try{let t=document.querySelector(".orderID");if(t&&(t.value||t.getAttribute("value")))return t.value||t.getAttribute("value");let r=(document.body.innerText||"").match(/(?:pedido|order|n[º°o]\.?)\s*#?\s*([A-Z0-9-]{4,})/i);return r?r[1]:null}catch(t){return null}}function te(t){if(!t)return null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r;e.indexOf(",")>e.indexOf(".")?r=e.replace(/\./g,"").replace(",","."):r=e.replace(/,/g,"");let n=parseFloat(r);return Number.isFinite(n)&&n>0?n:null}function cr(){let t=A(["ItemList","CollectionPage"]);if(t.length===0)return null;let e=t[0],r=e.itemListElement||e.mainEntity&&e.mainEntity.itemListElement||[],n=[];for(let o of r.slice(0,50)){let i=o.item||o;i&&(i.sku||i.productID||i.name)&&n.push(i.sku||i.productID||i.name)}return n.length>0?{count:n.length,skus:n.slice(0,20)}:null}var ar=!1,yt=[/\b(adicionar|adic\.?|colocar|incluir|jogar)\b.{0,30}\b(carrinho|sacola|sacolinha|bag)\b/i,/\bcomprar\b(?!\s+(em|por|sem))/i,/\bcomprar\s*$/i,/^add\s+to\s+(cart|bag)\b/i,/^buy\s+(now|it|this)\b/i,/^(sacolinha|carrinho|sacola)$/i],ho=[/^finalizar(\s+(compra|pedido|pagamento))?\b/i,/^(fechar|confirmar)\s+(compra|pedido|pagamento)\b/i,/^pagar(\s+(agora|pedido))?\b/i,/^(complete|place)\s+(purchase|order)\b/i,/^checkout$/i];function tt(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function ur(t){switch(t){case"pdp":{let e=ee();p("view_item",e||{sku:null});break}case"category":case"search":{let e=cr();p("view_item_list",e||{count:0});break}case"cart":Yt().then(e=>p("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>p("view_cart",{}));break;case"checkout":p("begin_checkout",{});break;case"purchase":yo();break}}var lr=500,sr=16;function yo(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,go(o,i))};try{window.addEventListener("pagehide",()=>r(re(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=re();if(o&&o.revenue!=null)return r(o);if(e++>=sr)return g("purchase: receita n\xE3o apareceu em "+lr*sr+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,lr)};n()}function go(t,e){if(t&&!t.orderId&&(t.orderId=M()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){g("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}else if(ar)return;if(ar=!0,p("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),g("purchase emitido",t),e)try{P(!0)}catch(r){}}function dr(){if(!document.body)return;let t=0;document.body.addEventListener("click",e=>{try{let r=Date.now();if(r-t<150)return;let n=e.target;for(let a=0;a<5&&n&&n!==document.body&&!(n.tagName==="BUTTON"||n.tagName==="A"||n.getAttribute&&n.getAttribute("role")==="button");a++)n=n.parentElement;if(!n)return;let o=n.tagName!=="A",i=(n.textContent||"").replace(/\s+/g," ").trim();if(!i||i.length>80)return;let c=!1;if((tt([yt[0]],i)||o&&tt([yt[1]],i)||o&&tt([yt[2]],i)||tt(yt.slice(3),i))&&(c=!0),c){t=r;let a=ee();p("add_to_cart",{via:"click",buttonText:i,sku:a?a.sku:null,price:a?a.price:null});return}o&&tt(ho,i)&&(t=r,p("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var gt={};v(gt,{available:()=>_o,id:()=>wo,iframeSrc:()=>bo,modalSize:()=>xo,onMounted:()=>vo});var wo="mk-fashion",xo={width:430,height:800};function bo(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return m().appUrl+"/"+t+"/"+r}async function _o(t,e){let r=m().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function vo(){}var ne={};v(ne,{available:()=>Ao,id:()=>Co,iframeSrc:()=>To,modalSize:()=>ko,onMounted:()=>Po});var Co="mk-makeup",ko={width:1160,height:700};function So(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function To(t){return So()+"/"+encodeURIComponent(t)}function Ao(){return Promise.resolve({available:!0})}var Eo="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",wt=null;function Lo(){return window.pulpoar?Promise.resolve(window.pulpoar):wt||(wt=new Promise(t=>{try{let e=document.createElement("script");e.src=Eo,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),wt)}async function Io(t){try{if(window.Shopify||window.ShopifyAnalytics){let e=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(e){let r=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta,n=new URLSearchParams(location.search).get("variant")||r&&r.selectedVariantId,i=(await fetch("/products/"+e+".js").then(s=>s.json())).variants||[],c=n?i.find(s=>String(s.id)===String(n)):null;if(c&&c.sku)return c.sku;let a=i.find(s=>s.available)||i[0];if(a&&a.sku)return a.sku}}}catch(e){}return t||null}function Ro(t){let e=Array.isArray(t)?t[0]:t;return!e||typeof e!="object"?{quantity:1}:{sku:e.sku||e.slug||e.key||e.variant_key||e.barcode||null,color:e.color||e.shade||e.colorName||null,size:e.size||null,quantity:1}}function Po(t,e){Lo().then(async r=>{if(!r){g("pulpoar: SDK n\xE3o carregou");return}let n=await Io(e.identifier);if(g("pulpoar variante p/ cat\xE1logo",n),n)try{r.applyVariantsWithCatalog([String(n)],o=>{e.track("product_loaded",{via:"makeup",applied:Array.isArray(o)?o.length:0})})}catch(o){g("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{g("pulpoar onAddToCart",o),e.handleAddToCart(Ro(o),"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var Mo={"mk-fashion":gt,"mk-makeup":ne};function xt(t){return Mo[t]||gt}var S=null,k=null,_t=!1,vt=!1,L=null,pr={},oe=null,bt=0,C={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},jo={gregory:"698c7e791d3129430f15dddd"};function mr(t){return t?jo[String(t).toLowerCase()]||t:null}async function j(t,e){let r=mr(t),n=String(e||"").trim();return xt(m().product).available(r,n)}async function hr(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await j(t,e)).available===!0}catch(r){return!1}}async function et(t){if(t=t||{},_t)return;let e=mr(t.projectId||t.projectid||t.store),r=String(t.identifier||t.sku||"").trim();if(!e||!r){console.error("[mk-sdk] open: projectId e identifier obrigatorios");return}let n=e+":"+r;if(pr[n]!==!0){try{if(!(await j(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(i){alert("Produto nao encontrado ou indisponivel.");return}pr[n]=!0}let o=xt(m().product).modalSize||{width:430,height:800};L={projectId:e,identifier:r,width:t.width||o.width,height:t.height||o.height},vt=!1,wr(),Oo(L),_t=!0,bt=Date.now(),p("modal_opened",{projectId:e,identifier:r})}function ce(){if(!_t)return;let t=vt;if(vt=!1,Bo(),_t=!1,E("onClose"),p("modal_closed",{projectId:L&&L.projectId,identifier:L&&L.identifier}),t)try{Ye()}catch(e){}}function yr(t){try{Ar().forEach(e=>{t?(e.dataset.mkPrevDisplay===void 0&&(e.dataset.mkPrevDisplay=e.style.display),e.style.display="none"):(e.style.display=e.dataset.mkPrevDisplay||"",delete e.dataset.mkPrevDisplay)})}catch(e){}}function Oo(t){S=document.createElement("div"),S.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",yr(!0);let e=document.createElement("div"),r=typeof t.width=="number"?t.width+"px":t.width,n=typeof t.height=="number"?t.height+"px":t.height;e.style.cssText="position:relative;width:"+r+";height:"+n+";max-width:100vw;max-height:100dvh;border-radius:12px;overflow:hidden;background:#fff;",k=document.createElement("iframe");let o=xt(m().product);k.src=o.iframeSrc(t.projectId,t.identifier),k.style.cssText="width:100%;height:100%;border:none;",k.setAttribute("allow","camera *; microphone *"),k.setAttribute("allowfullscreen","true"),e.appendChild(k),S.appendChild(e),document.body.appendChild(S);try{o.onMounted(k,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:xr,track:p,fire:E})}catch(i){g("launcher.onMounted falhou",i&&i.message)}g("try-on modal aberto",k.src)}function Bo(){S&&S.parentNode&&S.parentNode.removeChild(S),S=null,k=null,yr(!1)}var fr=!1;function gr(){wr()}function wr(){fr||(fr=!0,window.addEventListener("message",t=>{let e=t.data;if(!e||e.source!=="mkfashion-app")return;let r=e.action,n=e.data||{};switch(r){case"close_request":ce();break;case"ready":E("onReady",n);break;case"product_loaded":E("onProductLoaded",n),p("product_loaded",ie(n));break;case"interaction":{E("onInteraction",n),n&&n.method&&(oe=n.method),p(No(n),ie(n));break}case"add_to_cart":xr(n,"tryon");break;case"generation_start":bt=Date.now();break;case"generation_complete":E("onGenerationComplete",n),p("generation_complete",{method:n.method||oe||"unknown",durationMs:bt?Date.now()-bt:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":E("onError",n),p("generation_error",{method:oe||"unknown",error:n&&n.error});break}}))}function xr(t,e){if(p("add_to_cart",Object.assign({via:e||"tryon"},ie(t))),typeof C.onAddToCart=="function"){E("onAddToCart",t);return}let r=Object.assign({productId:L&&L.identifier},t);Ge(r).then(()=>Zt()).then(n=>{vt=!!n}).catch(()=>{})}function No(t){return t&&t.action,"interaction"}function ie(t){if(!t||typeof t!="object")return t;let e={};for(let r in t){if(r==="imageUrl"||r==="image"||r==="product"){r==="product"&&t[r]?(e.productSku=t[r].sku||null,e.productName=t[r].name||null):e[r+"Present"]=!!t[r];continue}e[r]=t[r]}return e}function E(t,e){if(typeof C[t]=="function")try{C[t](e)}catch(r){console.error("[mk-sdk]",r)}}function br(t){C.onReady=t}function _r(t){C.onClose=t}function vr(t){C.onAddToCart=t}function Cr(t){C.onProductLoaded=t}function kr(t){C.onError=t}function Sr(t){C.onInteraction=t}function Tr(t){C.onGenerationComplete=t}var Do=767,Uo=1024,Fo=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,zo=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function ae(t){try{let e=t.getBoundingClientRect();if(e.width<=0||e.height<=0)return!1;let r=getComputedStyle(t);return r.display!=="none"&&r.visibility!=="hidden"&&r.opacity!=="0"}catch(e){return!1}}function $o(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&ae(e)}catch(e){return!1}}function Ko(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function Ho(t){if(!t||typeof t!="object"||t.selector)return t;let e=!1;if(["mobile","tablet","desktop"].forEach(n=>{let o=t[n];o&&o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"&&(e=!0)}),!e)return t;let r={};return["mobile","tablet","desktop"].forEach(n=>{let o=t[n];if(o){if(o.selector){r[n]=o;return}if(o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"){let i=o.anchor[n]||o.anchor.desktop||o.anchor.mobile||o.anchor.tablet;i&&i.selector&&(r[n]=i)}}}),["bpMobile","bpTablet","breakpoint"].forEach(n=>{t[n]!=null&&(r[n]=t[n])}),r}function Ct(t){if(!t||typeof t!="object")return null;if(t=Ho(t),t.selector)return t;let e=[["mobile",t.mobile],["tablet",t.tablet],["desktop",t.desktop]].filter(s=>s[1]&&s[1].selector);if(e.length===0)return null;if(e.length===1)return e[0][1];let r=e.filter(([,s])=>$o(s.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||Do,i=Number(t.bpTablet)||Uo,c=s=>(e.find(l=>l[0]===s)||[])[1],a=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let s of a){let l=c(s);if(l)return l}return e[0][1]}function le(t){let e=Ct(t);if(e&&e.selector)try{let r=document.querySelector(e.selector);if(r&&ae(r))return{el:r,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(r){}return null}function Er(){let t=m(),e=le(t&&t.anchor);if(e)return e;let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=Ko(n);if(!(!o||o.length>40)&&!zo.test(o)&&Fo.test(o)&&ae(n))return{el:n,position:"afterend",mode:"flow",style:"",selector:null}}return null}var _="'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",se={none:"0",sm:"4px",md:"8px",pill:"9999px"},ue={none:"0",sm:"4px",md:"8px",lg:"16px"},Vo='<svg viewBox="0 0 17.5263 20.6862" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%"><g><path d="M8.49995 12.1862C10.1568 12.1862 11.5 10.8431 11.5 9.18622C11.5 7.52936 10.1568 6.18622 8.49995 6.18622C6.8431 6.18622 5.49995 7.52936 5.49995 9.18622C5.49995 10.8431 6.8431 12.1862 8.49995 12.1862Z" stroke="currentColor" shape-rendering="crispEdges"/><path d="M0.5 9.11152C0.5 6.56953 0.5 5.29894 1.1099 4.38664C1.375 3.9902 1.71424 3.65088 2.10821 3.38809C2.6945 2.9958 3.42899 2.85564 4.55351 2.80588C5.09013 2.80588 5.55183 2.39949 5.65687 1.87284C5.73715 1.48708 5.94572 1.14138 6.24735 0.894155C6.54898 0.646934 6.92516 0.51336 7.31231 0.516006H9.9734C10.7779 0.516006 11.4709 1.08412 11.6288 1.87284C11.7339 2.39949 12.1956 2.80588 12.7322 2.80588C13.8559 2.85564 12.9129 4.67413 13.5 5.06559C13.8949 5.32932 15.1484 3.80355 15.5 4.02647C16.1099 4.93876 16.7857 6.56953 16.7857 9.11152C16.7857 11.6535 16.7857 12.9233 16.1758 13.8364C15.9107 14.2328 15.5715 14.5722 15.1775 14.835C14.2647 15.4445 12.9936 15.4445 10.4522 15.4445H6.83351C4.29213 15.4445 3.02103 15.4445 2.10821 14.835C1.71446 14.5718 1.3755 14.2322 1.11071 13.8356C0.933802 13.5672 0.803519 13.2698 0.725557 12.9564" stroke="currentColor" stroke-linecap="round"/><path d="M12.676 0.607931C12.9446 -0.178095 14.0307 -0.2019 14.3491 0.536515L14.3761 0.60838L14.7385 1.66839C14.8216 1.91149 14.9559 2.13395 15.1322 2.32076C15.3086 2.50757 15.5229 2.65439 15.7608 2.75131L15.8583 2.78769L16.9183 3.14971C17.7044 3.41831 17.7282 4.50437 16.9902 4.82283L16.9183 4.84978L15.8583 5.21225C15.6151 5.29526 15.3926 5.42947 15.2057 5.60582C15.0188 5.78218 14.8719 5.99657 14.7749 6.23453L14.7385 6.33155L14.3765 7.39201C14.1079 8.17803 13.0219 8.20184 12.7039 7.46387L12.676 7.39201L12.314 6.332C12.231 6.08881 12.0968 5.86627 11.9204 5.67938C11.744 5.49249 11.5297 5.3456 11.2917 5.24863L11.1947 5.21225L10.1347 4.85022C9.34817 4.58163 9.32437 3.49557 10.0628 3.17756L10.1347 3.14971L11.1947 2.78769C11.4378 2.70462 11.6602 2.57039 11.847 2.39404C12.0339 2.21769 12.1807 2.00333 12.2776 1.76541L12.314 1.66839L12.676 0.607931Z" fill="currentColor"/></g></svg>',Ir='<svg viewBox="0 0 11.6122 12.7248" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:12px;height:12px"><path d="M4.09055 2.01133C4.43939 0.9905 5.84989 0.959583 6.26347 1.91858L6.29847 2.01192L6.76922 3.38858C6.8771 3.7043 7.05144 3.99321 7.28047 4.23583C7.5095 4.47845 7.7879 4.66912 8.09689 4.795L8.22347 4.84225L9.60014 5.31242C10.621 5.66125 10.6519 7.07175 9.69347 7.48533L9.60014 7.52033L8.22347 7.99108C7.90764 8.09889 7.61862 8.2732 7.3759 8.50223C7.13318 8.73127 6.94241 9.0097 6.81647 9.31875L6.76922 9.44475L6.29905 10.822C5.95022 11.8428 4.53972 11.8737 4.12672 10.9153L4.09055 10.822L3.62039 9.44533C3.51258 9.12951 3.33827 8.84048 3.10924 8.59776C2.8802 8.35504 2.60177 8.16427 2.29272 8.03833L2.16672 7.99108L0.790054 7.52092C-0.231363 7.17208 -0.26228 5.76158 0.69672 5.34858L0.790054 5.31242L2.16672 4.84225C2.48244 4.73437 2.77135 4.56003 3.01397 4.331C3.25658 4.10197 3.44726 3.82357 3.57314 3.51458L3.62039 3.38858L4.09055 2.01133ZM9.86147 0C9.9706 0 10.0775 0.0306123 10.1701 0.0883584C10.2627 0.146104 10.3373 0.228668 10.3853 0.326667L10.4133 0.394917L10.6175 0.993417L11.2166 1.19758C11.3259 1.23474 11.4218 1.30353 11.492 1.39523C11.5623 1.48693 11.6037 1.59741 11.611 1.71268C11.6184 1.82795 11.5914 1.94281 11.5334 2.04271C11.4755 2.14261 11.3891 2.22305 11.2854 2.27383L11.2166 2.30183L10.6181 2.506L10.4139 3.10508C10.3767 3.21442 10.3078 3.31024 10.2161 3.38041C10.1244 3.45058 10.0139 3.49194 9.89859 3.49925C9.78333 3.50656 9.66849 3.47949 9.56863 3.42147C9.46876 3.36345 9.38837 3.27709 9.33764 3.17333L9.30964 3.10508L9.10547 2.50658L8.50639 2.30242C8.39702 2.26526 8.30115 2.19647 8.23092 2.10477C8.16069 2.01307 8.11926 1.90259 8.11189 1.78732C8.10452 1.67205 8.13153 1.55719 8.18951 1.45729C8.24749 1.35739 8.33381 1.27695 8.43755 1.22617L8.50639 1.19817L9.10489 0.994L9.30905 0.394917C9.34839 0.279665 9.42281 0.179613 9.52187 0.108791C9.62094 0.0379686 9.73969 -0.0000730808 9.86147 0Z" fill="currentColor"/></svg>';function x(t,e={}){let r=document.createElement(t);if(e.style&&(r.style.cssText=e.style),e.text!=null&&(r.textContent=e.text),e.html!=null&&(r.innerHTML=e.html),e.attrs)for(let n in e.attrs)r.setAttribute(n,e.attrs[n]);if(e.on)for(let n in e.on)r.addEventListener(n,e.on[n]);if(e.children)for(let n of e.children)n&&r.appendChild(n);return r}function Rr(t){return x("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:Ir})}var kt=t=>'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%">'+t+"</svg>",Lr={camera:Vo,sparkle:Ir.replace("width:12px;height:12px","width:100%;height:100%"),shirt:kt('<path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z"/>'),face:kt('<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>'),glasses:kt('<circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2"/><path d="M2.5 13 5 7c.7-1.3 1.4-2 3-2"/><path d="M21.5 13 19 7c-.7-1.3-1.5-2-3-2"/>'),wand:kt('<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/>')};function K(t,e,r){let n=Number(r)>0?Number(r):24;return x("span",{style:`width:${n}px;height:${n}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${e};flex-shrink:0;`,html:Lr[t]||Lr.camera})}function H(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function St(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(x("link",{attrs:{id:"mk-jakarta-font",rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap"}}))}catch(t){}}function Jo(t){return t.subtext?x("span",{style:`display:flex;align-items:center;justify-content:center;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,text:t.subtext}):null}function Pr(t,e){St();let r=x("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[K(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px;width:100%;max-width:238px;box-sizing:border-box;background:${t.bgColor};border:${H(t)};border-radius:${t.borderRadiusPx};font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,Jo(t)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}function Go(t){return t.subtext?x("span",{style:`display:flex;align-items:center;gap:4px;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:600;font-size:10px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,children:[Rr(t.badgeTextColor),x("span",{text:t.subtext})]}):null}function Xo(t,e){return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px 8px 8px;width:100%;margin-top:auto;box-sizing:border-box;background:${t.bgColor};border:${H(t)};border-radius:${t.borderRadiusPx};filter:drop-shadow(0 0 6px rgba(0,0,0,0.08));font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[K(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;color:${t.textColor};white-space:nowrap;line-height:1;`})],on:{mouseenter:r=>{r.currentTarget.style.opacity="0.85"},mouseleave:r=>{r.currentTarget.style.opacity="1"},click:r=>{try{r.preventDefault(),r.stopPropagation()}catch(n){}try{e&&e()}catch(n){}}}})}function Mr(t,e){St();let r=x("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&x("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;letter-spacing:1px;text-transform:uppercase;color:${t.cardTitleColor};line-height:1.2;`}),t.cardDescription&&x("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:12px;max-width:177px;line-height:1.2;color:${t.cardTextColor};`})]}),n=x("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&x("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=x("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[Go(t),Xo(t,e)]}),i=x("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return x("div",{style:`display:flex;flex-direction:column;align-items:flex-start;padding:12px;width:100%;max-width:402px;min-height:140px;box-sizing:border-box;background:${t.cardBgColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};`,children:[i]})}function jr(t,e){let r=Number(t.iconSize)>0?Number(t.iconSize):24;return x("button",{attrs:{type:"button","aria-label":t.text||"Provar virtualmente"},style:`display:inline-flex;align-items:center;justify-content:center;padding:8px;box-sizing:border-box;background:${t.bgColor};border:${H(t)};border-radius:${t.borderRadiusPx};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[K(t.icon,t.textColor,r)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}var Qo={style:"gregory-black",icon:"camera",text:"Provar Virtualmente",fontSize:14,iconSize:24,subtext:"",bgColor:"#1E1E1E",textColor:"#FFFFFF",badgeBgColor:"#C51A1B",badgeTextColor:"#FFFFFF",borderRadius:"md",borderColor:"#1E1E1E",borderWidth:0,cardTitle:"",cardDescription:"",cardFooter:"",cardBgColor:"#F6F6F6",cardTitleColor:"#1E1E1E",cardTextColor:"#717171",cardBorderRadius:"md"};function de(t){if(!t)return null;let e=Array.isArray(t.anchors)?t.anchors:[];if(t.version===2||t.main)return{version:2,main:t.main||{},anchors:e,cards:t.cards||null};let r=t.desktop||t.tablet||t.mobile||{},n=t.anchor||{};return{version:2,main:Object.assign({},r,{desktop:n.desktop,tablet:n.tablet,mobile:n.mobile,bpMobile:n.bpMobile,bpTablet:n.bpTablet}),anchors:e,cards:t.cards||null}}function rt(t,e){let r={...Qo,...t||{}};return r.style==="gregory-card"&&e&&(r.style="gregory-black"),r.borderRadiusPx=se[r.borderRadius]!=null?se[r.borderRadius]:"0",r.cardBorderRadiusPx=ue[r.cardBorderRadius]!=null?ue[r.cardBorderRadius]:"0",r.fontSize=Number(r.fontSize)||14,r.iconSize=Number(r.iconSize)||24,r.borderWidth=Number(r.borderWidth)||0,r}var pe={"gregory-black":Pr,"gregory-card":Mr,"gregory-icon":jr},ac=Object.keys(pe);function Or(t,e){return(pe[t.style]||pe["gregory-black"])(t,e)}function ti(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var ct=null,O=[];function Ar(){return[ct].concat(O).filter(Boolean)}function ei(t,e){let r;try{r=document.createElement("iframe"),r.setAttribute("aria-hidden","true"),r.style.cssText="display:none!important;width:0;height:0;border:0;position:absolute;left:-9999px;",(document.body||document.documentElement).appendChild(r);let n=r.contentWindow&&r.contentWindow.Element&&r.contentWindow.Element.prototype&&r.contentWindow.Element.prototype.attachShadow;if(typeof n=="function"){let o=n.call(t,e);return r.remove(),o}}catch(n){}try{r&&r.remove()}catch(n){}return t.attachShadow(e)}var ri=/^(transform|transform-origin|margin|margin-(top|right|bottom|left)|position|inset|top|right|bottom|left|z-index|width|min-width|max-width|height|min-height|max-height)$/i;function ni(t){return!t||typeof t!="string"?"":t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>ri.test(e.split(":")[0].trim().toLowerCase())).join(";")}var Tt=null,fe=!1,V={},Br=!1,me=null;function I(){return me||(me=F().then(t=>de(t&&t.template&&t.template.tryOnButton||null)).catch(()=>null)),me}function oi(){if(Br)return;Br=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{Tt&&R("pdp")},200)})}catch(e){}}function ye(t){if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}}function ge(){ye(ct),O.forEach(ye),ct=null,O=[],Tt=null}var ii={IMG:1,INPUT:1,VIDEO:1,CANVAS:1,EMBED:1,OBJECT:1,IFRAME:1,BR:1,HR:1,SELECT:1,TEXTAREA:1,SVG:1};function ci(t){switch(t){case"top-center":return"top:0;left:50%;transform:translateX(-50%);";case"top-right":return"top:0;right:0;";case"middle-left":return"top:50%;left:0;transform:translateY(-50%);";case"center":return"top:50%;left:50%;transform:translate(-50%,-50%);";case"middle-right":return"top:50%;right:0;transform:translateY(-50%);";case"bottom-left":return"bottom:0;left:0;";case"bottom-center":return"bottom:0;left:50%;transform:translateX(-50%);";case"bottom-right":return"bottom:0;right:0;";case"top-left":default:return"top:0;left:0;"}}function ai(t,e,r){let o=!ii[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(u){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+ci(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let u=t.getBoundingClientRect(),w=o.getBoundingClientRect(),d=e.offsetWidth,h=e.offsetHeight,y=u.top-w.top+o.scrollTop,b=u.left-w.left+o.scrollLeft,f=r||"top-left",T=y,J=b;f.indexOf("bottom")===0?T=y+u.height-h:(f.indexOf("middle")===0||f==="center")&&(T=y+(u.height-h)/2),f.indexOf("right")>=0?J=b+u.width-d:f.indexOf("center")>=0&&(J=b+(u.width-d)/2),e.style.top=T+"px",e.style.left=J+"px"}catch(u){}};i();let c=()=>i();window.addEventListener("resize",c);let a=setTimeout(i,600),s=setTimeout(i,1500),l=null;try{if(t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",i,{once:!0}),typeof ResizeObserver=="function"){l=new ResizeObserver(()=>i());try{l.observe(t)}catch(u){}try{l.observe(o)}catch(u){}}}catch(u){}e.__mkCleanup=()=>{window.removeEventListener("resize",c),clearTimeout(a),clearTimeout(s);try{t.removeEventListener("load",i)}catch(u){}try{l&&l.disconnect()}catch(u){}}}function li(t,e,r){try{return t.insertAdjacentElement(r||"afterend",e),!0}catch(n){try{return t.parentNode.insertBefore(e,t.nextSibling),!0}catch(o){return!1}}}async function R(t){let e=m();if(t!=="pdp"){ge();return}if(!e.projectId)return;if(!e._anchorFromPicker){let l=await I();l&&l.main&&(e.anchor=l.main),l&&l.anchors&&(e.anchors=l.anchors),l&&l.cards&&(e.cards=l.cards)}if(fe)return;let r=$(),n=r&&r.value,o=!!e.forceButton,i=l=>l?[l.selector,l.position,l.mode,l.align,l.style].join("~"):"heuristic",c=Array.isArray(e.anchors)?e.anchors:[],a=[n||"demo",i(Ct(e.anchor))].concat(c.map(l=>i(Ct(l)))).join("|"),s=ct;if(!(s&&Tt===a)){if(s&&ge(),!n&&!o){g("auto-mount: SKU n\xE3o resolvido na PDP");return}fe=!0;try{let l=o;o||(V[n]||(V[n]=j(e.projectId,n).then(b=>!!(b&&b.available)).catch(()=>!1)),l=await V[n]);try{Re(l?"available":"unavailable")}catch(b){}if(!l){g("auto-mount: produto sem try-on",n);return}let u=await I(),w=window.matchMedia("(max-width: 767px)").matches,d=rt(u&&u.main||{},w),h=()=>{let b=$(),f=b&&b.value||n||"";jt(),p("button_clicked",{sku:f,style:d.style}),et({projectId:e.projectId,identifier:f})},y=Er();ct=we(y,d,h),O=[];for(let b=0;b<c.length;b++){let f=c[b],T=le(f);if(!T)continue;let J=u&&u.anchors&&u.anchors[b]||f;O.push(we(T,rt(J,w),h))}Tt=a,oi(),g("auto-mount: bot\xE3o injetado",{style:d.style,sku:n,anchorFound:!!y,mode:y&&y.mode,extras:O.length,forced:o}),p("button_rendered",{style:d.style,sku:n||null,skuSource:r&&r.source,anchorFound:!!y,position:y?y.position:null,mode:y?y.mode:null,extras:O.length,forced:o})}finally{fe=!1}}}function we(t,e,r){let n=t&&t.mode||"flow",o=Or(e,r),i=document.createElement("div");i.id=ti(),ei(i,{mode:"closed"}).appendChild(o),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(s=>{try{i.addEventListener(s,l=>{l.stopPropagation()},!1)}catch(l){}});let a=!1;if(t&&t.el&&t.el.parentNode&&(n==="overlay"?(ai(t.el,i,t.align),a=!0):(i.style.cssText="display:contents;",a=li(t.el,i,t.position))),a||(i.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(i)),t&&t.style){let s=ni(t.style);if(s)try{o.style.cssText+=";"+s}catch(l){}}return i}function Nr(){try{let t=m(),e={anchor:t.anchor,anchors:t.anchors,cards:t.cards,forceButton:t.forceButton},r={},n=i=>({desktop:i,tablet:i,mobile:i}),o=(i,c,a)=>{i=i||{};let s=d=>c===d?a:r[d];t.anchor=s("primary")?n(s("primary")):i.main||null;let l=Array.isArray(i.anchors)?i.anchors:[],u=l.length;Object.keys(r).concat(c?[c]:[]).forEach(d=>{d&&d.indexOf("extra-")===0&&(u=Math.max(u,(parseInt(d.slice(6),10)||0)+1))});let w=[];for(let d=0;d<u;d++){let h=s("extra-"+d);w[d]=h?n(h):l[d]||null}t.anchors=w,t._anchorFromPicker=!0,t.forceButton=!0};window.addEventListener("message",i=>{if(i.source!==window)return;let c=i.data;if(!(!c||!c.__mkCmd)){if(c.__mkCmd==="getButtons"){I().then(a=>{let s=a&&Array.isArray(a.anchors)?a.anchors.length:0;try{window.postMessage({__mkButtons:{extras:s,hasMain:!!(a&&a.main)}},"*")}catch(l){}});return}if(c.__mkCmd==="previewSlot"){I().then(a=>{o(a,c.slot||"primary",c.live),R("pdp")});return}if(c.__mkCmd==="saveSlot"){c.slot&&c.live&&(r[c.slot]=c.live),I().then(a=>{o(a),R("pdp")});return}if(c.__mkCmd==="galleryPreview"){t.cards=c.cards||null,t._anchorFromPicker=!0,t.forceButton=!0,it(),At("category");return}if(c.__mkCmd==="applyRecipe"){I().then(a=>{o(a),c.cards!==void 0&&(t.cards=c.cards||null),R("pdp"),t.cards&&(it(),At("category"))});return}if(c.__mkCmd==="cancelPreview"){Object.keys(r).length?I().then(a=>{o(a),R("pdp")}):(t.anchor=e.anchor,t.anchors=e.anchors,t.cards=e.cards,t._anchorFromPicker=!1,t.forceButton=e.forceButton,ge(),it(),R("pdp"));return}}})}catch(t){}}var B=null,nt=null,xe=null,ot=new Map;function si(t,e){try{if(e.skuAttr){let o=e.skuSelector?t.querySelector(e.skuSelector):t,i=o&&o.getAttribute(e.skuAttr);if(i)return String(i).trim()}if(e.skuSelector&&!e.skuAttr){let o=t.querySelector(e.skuSelector),i=o&&(o.getAttribute("content")||o.textContent||"").trim();if(i)return i}let r=t.querySelector(e.linkSelector||"a[href]"),n=r&&r.getAttribute("href");if(n){let o=n.match(/-p(\d+)|[?&]variant=(\d+)|\/produtos?\/([\w-]+)|\/products?\/([\w-]+)|-(\d+)(?:[/?#]|$)/);if(o)return o[1]||o[2]||o[3]||o[4]||o[5]}}catch(r){}return null}async function ui(t,e,r){if(ot.has(t))return;let n=!!m().forceButton,o=si(t,e);if(!o&&!n)return;let i=n;if(i||(V[o]||(V[o]=j(m().projectId,o).then(u=>!!(u&&u.available)).catch(()=>!1)),i=await V[o]),!i||ot.has(t)||!t.isConnected)return;let a={el:e.anchorWithin&&t.querySelector(e.anchorWithin)||t,mode:e.mode||"overlay",align:e.align||"top-left",position:e.position||"afterbegin",style:e.style||""},l=we(a,r,()=>{jt(),p("button_clicked",{sku:o,gallery:!0,style:r.style}),et({projectId:m().projectId,identifier:o})});ot.set(t,l),p("button_rendered",{gallery:!0,sku:o,style:r.style})}function he(t){try{document.querySelectorAll(t.cardSelector).forEach(e=>{e.__mkCard||(e.__mkCard=!0,B.observe(e))})}catch(e){}}function it(){if(B){try{B.disconnect()}catch(t){}B=null}if(nt){try{nt.disconnect()}catch(t){}nt=null}clearTimeout(xe),ot.forEach(t=>ye(t)),ot.clear()}async function At(t){let e=m();if(t==="pdp"||t==="cart"||t==="checkout"||t==="purchase"){it();return}if(!e.projectId)return;let r=await I(),n=e.cards||r&&r.cards||null;if(!n||!n.cardSelector){it();return}if(B){he(n);return}if(typeof IntersectionObserver!="function")return;let o=rt(n,window.matchMedia("(max-width: 767px)").matches);B=new IntersectionObserver(i=>{for(let c of i)c.isIntersecting&&(B.unobserve(c.target),ui(c.target,n,o))},{rootMargin:"300px"}),he(n);try{nt=new MutationObserver(()=>{clearTimeout(xe),xe=setTimeout(()=>he(n),250)}),nt.observe(document.body,{childList:!0,subtree:!0})}catch(i){}g("auto-mount galeria ativa",{cardSelector:n.cardSelector})}(function(){"use strict";try{let r=function(){try{je(),Nr(),gr(),e.autoTrack!==!1&&(rr((o,i)=>{ur(o,i),R(o),At(o)}),dr()),g("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=Lt();if(e.projectId){let o=qe(e.projectId);o&&Ot(o),F().then(i=>{let c=Be(i);Ot(c),De(e.projectId,c),g("escopo de coleta",c)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:et,close:ce,isAvailable:hr,getAvailability:j,onReady:br,onClose:_r,onAddToCart:vr,onProductLoaded:Cr,onError:kr,onInteraction:Sr,onGenerationComplete:Tr,testCart:Xe,_version:"0.1.0",_isMkSdk:!0};typeof window!="undefined"&&(window.mk=n)}catch(e){typeof console!="undefined"&&console.error("[mk-sdk] boot fatal",e)}})();})();
package/dist/mk-sdk.js CHANGED
@@ -1 +1 @@
1
- (()=>{(function(){try{let a=function(){try{var t=JSON.parse(localStorage.getItem(o));return t&&d.test(t.v)&&t.exp>Date.now()?t.v:null}catch(u){return null}};var m=a;if(window.__mkBooted)return;window.__mkBooted=!0;var o="mk_sdk_v",i=10*60*1e3,d=/^\d+\.\d+\.\d+$/,e=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),s=a()||"1.1.51",n=document.createElement("script");if(n.src="https://cdn.jsdelivr.net/npm/mk-sdk-git@"+s+"/dist/mk-core.js",n.async=!0,e&&e.attributes)for(var r=0;r<e.attributes.length;r++){var c=e.attributes[r];c.name.indexOf("data-")===0&&n.setAttribute(c.name,c.value)}(document.head||document.documentElement).appendChild(n),fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var u=t&&t.version;d.test(u)&&localStorage.setItem(o,JSON.stringify({v:u,exp:Date.now()+i}))}).catch(function(){})}catch(a){}})();})();
1
+ (()=>{(function(){try{let a=function(){try{var t=JSON.parse(localStorage.getItem(o));return t&&d.test(t.v)&&t.exp>Date.now()?t.v:null}catch(u){return null}};var m=a;if(window.__mkBooted)return;window.__mkBooted=!0;var o="mk_sdk_v",i=10*60*1e3,d=/^\d+\.\d+\.\d+$/,e=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),s=a()||"1.1.53",n=document.createElement("script");if(n.src="https://cdn.jsdelivr.net/npm/mk-sdk-git@"+s+"/dist/mk-core.js",n.async=!0,e&&e.attributes)for(var r=0;r<e.attributes.length;r++){var c=e.attributes[r];c.name.indexOf("data-")===0&&n.setAttribute(c.name,c.value)}(document.head||document.documentElement).appendChild(n),fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var u=t&&t.version;d.test(u)&&localStorage.setItem(o,JSON.stringify({v:u,exp:Date.now()+i}))}).catch(function(){})}catch(a){}})();})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mk-sdk-git",
3
- "version": "1.1.51",
3
+ "version": "1.1.53",
4
4
  "description": "SDK de tracking de e-commerce + try-on da MetaKosmos (core tracker, roda em todas as páginas)",
5
5
  "main": "dist/mk-sdk.js",
6
6
  "files": [
@@ -340,6 +340,27 @@ export function initPickerBridge() {
340
340
  try {
341
341
  const cfg = getConfig();
342
342
  const original = { anchor: cfg.anchor, anchors: cfg.anchors, cards: cfg.cards, forceButton: cfg.forceButton };
343
+ const pickerSlots = {}; // slots COMMITADOS pelo picker (no save) → sobrepõem o recipe
344
+ const liveAll = (pos) => ({ desktop: pos, tablet: pos, mobile: pos });
345
+ // Monta cfg.anchor/anchors a partir do RECIPE + slots commitados (+ 1 slot em
346
+ // preview temporário). Estrutura e ESTILOS vêm do recipe (tpl.main / tpl.anchors[i]);
347
+ // só as POSIÇÕES do picker sobrepõem, por slot. Não usa o storage local inteiro
348
+ // → o principal não se move e não surgem botões fantasma.
349
+ const applyOverrides = (tpl, tempSlot, tempLive) => {
350
+ tpl = tpl || {};
351
+ const getPos = (slot) => (tempSlot === slot ? tempLive : pickerSlots[slot]);
352
+ cfg.anchor = getPos('primary') ? liveAll(getPos('primary')) : (tpl.main || null);
353
+ const rec = Array.isArray(tpl.anchors) ? tpl.anchors : [];
354
+ let maxE = rec.length;
355
+ Object.keys(pickerSlots).concat(tempSlot ? [tempSlot] : []).forEach((k) => {
356
+ if (k && k.indexOf('extra-') === 0) maxE = Math.max(maxE, (parseInt(k.slice(6), 10) || 0) + 1);
357
+ });
358
+ const extras = [];
359
+ for (let i = 0; i < maxE; i++) { const ov = getPos('extra-' + i); extras[i] = ov ? liveAll(ov) : (rec[i] || null); }
360
+ cfg.anchors = extras;
361
+ cfg._anchorFromPicker = true;
362
+ cfg.forceButton = true;
363
+ };
343
364
  window.addEventListener('message', (e) => {
344
365
  if (e.source !== window) return;
345
366
  const d = e.data;
@@ -354,65 +375,50 @@ export function initPickerBridge() {
354
375
  return;
355
376
  }
356
377
  if (d.__mkCmd === 'previewSlot') {
357
- // preview por SLOT: mantém o RECIPE (estilos + posições) e sobrepõe a
358
- // posição do slot editado. Principal não se move ao mexer num extra; cada
359
- // botão mantém o CSS dele (vem do recipe via tpl.main / tpl.anchors[i]).
360
- getTemplateCached().then((tpl) => {
361
- const slot = d.slot || 'primary';
362
- const liveAll = { desktop: d.live, tablet: d.live, mobile: d.live };
363
- cfg.anchor = (slot === 'primary') ? liveAll : ((tpl && tpl.main) || null);
364
- const extras = (tpl && Array.isArray(tpl.anchors)) ? tpl.anchors.slice() : [];
365
- if (slot.indexOf('extra-') === 0) extras[parseInt(slot.slice(6), 10) || 0] = liveAll;
366
- cfg.anchors = extras;
367
- cfg._anchorFromPicker = true;
368
- cfg.forceButton = true;
369
- maybeMountButton('pdp');
370
- });
378
+ // preview TEMPORÁRIO do slot em edição (não commita) sobre recipe + slots já salvos.
379
+ getTemplateCached().then((tpl) => { applyOverrides(tpl, d.slot || 'primary', d.live); maybeMountButton('pdp'); });
371
380
  return;
372
- } else if (d.__mkCmd === 'remount') {
373
- cfg.anchor = d.anchor || null; // preview da variante sendo editada (plano)
374
- cfg.anchors = d.anchors || null; // extras (se houver) preview com todos os botões
375
- cfg._anchorFromPicker = true; // picker vence a dashboard durante o preview
376
- cfg.forceButton = true; // preview sempre mostra o botão
377
- maybeMountButton('pdp'); // re-monta só se a config (key) mudou
378
- } else if (d.__mkCmd === 'galleryPreview') {
381
+ }
382
+ if (d.__mkCmd === 'saveSlot') {
383
+ // SAVE: commita a posição do slot e re-aplica (recipe + slots commitados).
384
+ if (d.slot && d.live) pickerSlots[d.slot] = d.live;
385
+ getTemplateCached().then((tpl) => { applyOverrides(tpl); maybeMountButton('pdp'); });
386
+ return;
387
+ }
388
+ if (d.__mkCmd === 'galleryPreview') {
379
389
  // preview da GALERIA: força (ignora disponibilidade) p/ mostrar em TODOS os cards
380
390
  cfg.cards = d.cards || null;
381
391
  cfg._anchorFromPicker = true;
382
392
  cfg.forceButton = true;
383
393
  removeGallery();
384
394
  maybeMountGallery('category');
385
- } else if (d.__mkCmd === 'applyRecipe') {
386
- // pós-save: MESCLA com o recipe (igual ao previewSlot) — a estrutura e os
387
- // estilos vêm do recipe; as POSIÇÕES salvas no picker sobrepõem por slot.
388
- // (Sem isto, usava o storage local sem o principal → ia pra heurística
389
- // e "criava outros botões".)
395
+ return;
396
+ }
397
+ if (d.__mkCmd === 'applyRecipe') {
398
+ // save da GALERIA (cards). Botões: re-aplica os slots commitados (recipe + picker).
390
399
  getTemplateCached().then((tpl) => {
391
- tpl = tpl || {};
392
- const hasPos = (o) => !!(o && (o.desktop || o.mobile || o.tablet || o.selector));
393
- cfg.anchor = hasPos(d.anchor) ? d.anchor : (tpl.main || null); // principal: posição salva senão recipe
394
- const rec = Array.isArray(tpl.anchors) ? tpl.anchors : [];
395
- const sav = Array.isArray(d.anchors) ? d.anchors : [];
396
- const n = Math.max(rec.length, sav.length);
397
- const extras = [];
398
- for (let i = 0; i < n; i++) extras.push(hasPos(sav[i]) ? sav[i] : (rec[i] || null)); // posição salva senão recipe; estilo vem de tpl.anchors[i]
399
- cfg.anchors = extras;
400
+ applyOverrides(tpl);
400
401
  if (d.cards !== undefined) cfg.cards = d.cards || null;
401
- cfg._anchorFromPicker = true;
402
- cfg.forceButton = true;
403
402
  maybeMountButton('pdp');
404
403
  if (cfg.cards) { removeGallery(); maybeMountGallery('category'); }
405
404
  });
406
405
  return;
407
- } else if (d.__mkCmd === 'cancelPreview') {
408
- cfg.anchor = original.anchor; // restaura o estado anterior ao picker
409
- cfg.anchors = original.anchors;
410
- cfg.cards = original.cards;
411
- cfg._anchorFromPicker = false; // volta a deixar a dashboard mandar
412
- cfg.forceButton = original.forceButton;
413
- removeButton();
414
- removeGallery();
415
- maybeMountButton('pdp');
406
+ }
407
+ if (d.__mkCmd === 'cancelPreview') {
408
+ // descarta a edição em curso; mantém o que foi SALVO (slots commitados).
409
+ if (Object.keys(pickerSlots).length) {
410
+ getTemplateCached().then((tpl) => { applyOverrides(tpl); maybeMountButton('pdp'); });
411
+ } else {
412
+ cfg.anchor = original.anchor;
413
+ cfg.anchors = original.anchors;
414
+ cfg.cards = original.cards;
415
+ cfg._anchorFromPicker = false;
416
+ cfg.forceButton = original.forceButton;
417
+ removeButton();
418
+ removeGallery();
419
+ maybeMountButton('pdp');
420
+ }
421
+ return;
416
422
  }
417
423
  });
418
424
  } catch (_) {}
@@ -5,6 +5,7 @@ import { BUTTON_RADIUS, CARD_RADIUS } from './helpers.js';
5
5
 
6
6
  export const BUTTON_DEFAULTS = {
7
7
  style: 'gregory-black',
8
+ icon: 'camera',
8
9
  text: 'Provar Virtualmente',
9
10
  fontSize: 14,
10
11
  iconSize: 24,
@@ -1,7 +1,7 @@
1
1
  // gregory-black.js — preset de botão simples (ícone + texto + badge opcional).
2
2
  // Portado de _renderSimpleButton / _renderBlackBadge da mkfashion-sdk.
3
3
 
4
- import { el, cameraIcon, borderFrom, ensureJakartaFont, FONT_STACK } from './helpers.js';
4
+ import { el, renderIcon, borderFrom, ensureJakartaFont, FONT_STACK } from './helpers.js';
5
5
 
6
6
  function renderBadge(c) {
7
7
  if (!c.subtext) return null;
@@ -17,7 +17,7 @@ export function render(c, onClick) {
17
17
  const content = el('span', {
18
18
  style: 'display:inline-flex;align-items:center;gap:4px;',
19
19
  children: [
20
- cameraIcon(c.textColor, c.iconSize),
20
+ renderIcon(c.icon, c.textColor, c.iconSize),
21
21
  el('span', {
22
22
  text: c.text,
23
23
  style: `font-family:${FONT_STACK};font-weight:700;font-size:${c.fontSize}px;text-transform:uppercase;letter-spacing:2px;color:${c.textColor};white-space:nowrap;text-align:center;line-height:1;`
@@ -1,7 +1,7 @@
1
1
  // gregory-card.js — preset de card (título + descrição + CTA + badge).
2
2
  // Portado de _renderCardButton / _renderCardBadge / _renderCardCta da mkfashion-sdk.
3
3
 
4
- import { el, cameraIcon, sparkleIcon, borderFrom, ensureJakartaFont, FONT_STACK } from './helpers.js';
4
+ import { el, renderIcon, sparkleIcon, borderFrom, ensureJakartaFont, FONT_STACK } from './helpers.js';
5
5
 
6
6
  function renderBadge(c) {
7
7
  if (!c.subtext) return null;
@@ -16,7 +16,7 @@ function renderCta(c, onClick) {
16
16
  attrs: { type: 'button' },
17
17
  style: `display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px 8px 8px;width:100%;margin-top:auto;box-sizing:border-box;background:${c.bgColor};border:${borderFrom(c)};border-radius:${c.borderRadiusPx};filter:drop-shadow(0 0 6px rgba(0,0,0,0.08));font-family:${FONT_STACK};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,
18
18
  children: [
19
- cameraIcon(c.textColor, c.iconSize),
19
+ renderIcon(c.icon, c.textColor, c.iconSize),
20
20
  el('span', {
21
21
  text: c.text,
22
22
  style: `font-family:${FONT_STACK};font-weight:700;font-size:${c.fontSize}px;color:${c.textColor};white-space:nowrap;line-height:1;`
@@ -0,0 +1,20 @@
1
+ // gregory-icon.js — botão compacto SÓ com o ícone (sem texto/badge).
2
+ // Usa bgColor (fundo), textColor (cor do ícone), iconSize e borda. Spec v2.
3
+
4
+ import { el, renderIcon, borderFrom } from './helpers.js';
5
+
6
+ /** render(config, onClick) → HTMLButtonElement (só ícone) */
7
+ export function render(c, onClick) {
8
+ const s = Number(c.iconSize) > 0 ? Number(c.iconSize) : 24;
9
+ return el('button', {
10
+ attrs: { type: 'button', 'aria-label': c.text || 'Provar virtualmente' },
11
+ style: `display:inline-flex;align-items:center;justify-content:center;padding:8px;box-sizing:border-box;background:${c.bgColor};border:${borderFrom(c)};border-radius:${c.borderRadiusPx};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,
12
+ children: [renderIcon(c.icon, c.textColor, s)],
13
+ on: {
14
+ mouseenter: (e) => { e.currentTarget.style.opacity = '0.85'; },
15
+ mouseleave: (e) => { e.currentTarget.style.opacity = '1'; },
16
+ // sobreposto à imagem do produto — impede o clique de propagar pro zoom/galeria
17
+ click: (e) => { try { e.preventDefault(); e.stopPropagation(); } catch (_) {} try { onClick && onClick(); } catch (_) {} }
18
+ }
19
+ });
20
+ }
@@ -36,6 +36,28 @@ export function sparkleIcon(color) {
36
36
  });
37
37
  }
38
38
 
39
+ // Conjunto curado de ícones (key → SVG). camera/sparkle são os SVGs custom de
40
+ // hoje; shirt/face/glasses/wand são equivalentes do Lucide (shirt, scan-face,
41
+ // glasses, wand-2). Todos com currentColor + preenchem 100% do span (tamanho via iconSize).
42
+ const LUCIDE = (p) => '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%">' + p + '</svg>';
43
+ const ICON_SVGS = {
44
+ camera: CAMERA_ICON_SVG,
45
+ sparkle: SPARKLE_ICON_SVG.replace('width:12px;height:12px', 'width:100%;height:100%'),
46
+ shirt: LUCIDE('<path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z"/>'),
47
+ face: LUCIDE('<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>'),
48
+ glasses: LUCIDE('<circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2"/><path d="M2.5 13 5 7c.7-1.3 1.4-2 3-2"/><path d="M21.5 13 19 7c-.7-1.3-1.5-2-3-2"/>'),
49
+ wand: LUCIDE('<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/>')
50
+ };
51
+
52
+ /** Ícone configurável pela key do conjunto curado (default: camera). */
53
+ export function renderIcon(key, color, size) {
54
+ const s = Number(size) > 0 ? Number(size) : 24;
55
+ return el('span', {
56
+ style: `width:${s}px;height:${s}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${color};flex-shrink:0;`,
57
+ html: ICON_SVGS[key] || ICON_SVGS.camera
58
+ });
59
+ }
60
+
39
61
  export function borderFrom(c) {
40
62
  return c.borderWidth > 0 && c.borderColor ? `${c.borderWidth}px solid ${c.borderColor}` : 'none';
41
63
  }
@@ -3,11 +3,13 @@
3
3
 
4
4
  import * as gregoryBlack from './gregory-black.js';
5
5
  import * as gregoryCard from './gregory-card.js';
6
+ import * as gregoryIcon from './gregory-icon.js';
6
7
  import { fetchButtonTemplate, normalizeButtonConfig, readTryOnButton } from './config.js';
7
8
 
8
9
  const RENDERERS = {
9
10
  'gregory-black': gregoryBlack.render,
10
- 'gregory-card': gregoryCard.render
11
+ 'gregory-card': gregoryCard.render,
12
+ 'gregory-icon': gregoryIcon.render
11
13
  };
12
14
 
13
15
  export const AVAILABLE_STYLES = Object.keys(RENDERERS);