PageSourceSearch

https://yodeyma.gr/cdn/shop/t/32/assets/yodeyma-metafield-tile-picker.js?v=13051046281802142291788180027

js yodeyma.gr collected 2026-10-05 17:43:21 UTC 6,070 bytes, 2 lines download raw bytes

1(function(){if(!window.themeVariables)return;var QUICK_BUY_POPOVER_ID="product-item-quick-buy-popover",VIEW_POPOVER="quick-buy-popover";function isPhoneQuickBuyViewport(){var bp=window.themeVariables.breakpoints&&window.themeVariables.breakpoints.phone;return bp?window.matchMedia(bp).matches:window.matchMedia("screen and (max-width: 740px)").matches}function buildQuickBuyProductUrl(productUrl,viewSuffix,variantId){if(!productUrl||typeof productUrl!="string")return null;try{var u=new URL(String(productUrl).trim(),window.location.origin);return u.searchParams.set("view",viewSuffix),variantId&&u.searchParams.set("variant",String(variantId)),u.pathname+u.search+u.hash}catch(e){return null}}function openGlobalQuickBuyPopover(productUrl,variantId){var href=buildQuickBuyProductUrl(productUrl,VIEW_POPOVER,variantId);if(!href)return!1;var el=document.getElementById(QUICK_BUY_POPOVER_ID);return!el||typeof el.setAttribute!="function"?!1:(el.setAttribute("href",href),el.open=!0,!0)}function setActiveTile(list,tile){list&&list.querySelectorAll(".oz-product-tiles__tile--selectable").forEach(function(btn){var on=btn===tile;btn.classList.toggle("is-active",on),btn.setAttribute("aria-pressed",on?"true":"false")})}function shopifyFormatMoney(cents,format){var s=window.themeVariables&&window.themeVariables.settings;if(format=format||(s&&s.currencyCodeEnabled?s.moneyWithCurrencyFormat:s.moneyFormat),typeof window.yodeymaMarketTaxFormatMoney=="function")try{return window.yodeymaMarketTaxFormatMoney(cents,format)}catch(e1){}if(typeof Shopify!="undefined"&&typeof Shopify.formatMoney=="function")return Shopify.formatMoney(cents,format);if(!format||!s){var code=s&&s.cartCurrency||"EUR";try{return new Intl.NumberFormat(document.documentElement.lang||void 0,{style:"currency",currency:code}).format(cents/100)}catch(e2){return(cents/100).toFixed(2)}}var placeholder=/\{\{\s*(\w+)\s*\}\}/,match=format.match(placeholder);if(!match)return String(cents/100);function formatWithDelimiters(number,precision,thousands,decimal){if(thousands=thousands||",",decimal=decimal||".",isNaN(number)||number==null)return"0";var str=(number/100).toFixed(precision),parts=str.split("."),dollars=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsPart=parts[1]?decimal+parts[1]:"";return dollars+centsPart}var value="";switch(match[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'");break;default:value=formatWithDelimiters(cents,2)}return format.replace(placeholder,value)}function updateCardPrice(card,priceCents,compareAtCents){var s=window.themeVariables.settings,format=s.currencyCodeEnabled?s.moneyWithCurrencyFormat:s.moneyFormat,priceList=card.querySelector("product-price-list[data-product-price-list]");if(priceList){var main=priceList.querySelector("span.price.price--large"),compareWrap=priceList.querySelector(".price-list__compare-container"),compareSpan=compareWrap&&compareWrap.querySelector(".price.price--compare"),onSale=compareAtCents>priceCents;main&&(main.textContent=shopifyFormatMoney(priceCents,format),main.classList.toggle("price--highlight",onSale)),onSale&&compareWrap&&compareSpan?(compareSpan.textContent=shopifyFormatMoney(compareAtCents,format),compareWrap.hidden=!1,compareWrap.style.removeProperty("display")):compareWrap&&(compareWrap.hidden=!0,compareWrap.style.display="none")}}function updateCardImage(card,tile){var src=tile.dataset.imageSrc;if(src){var anchor=card.querySelector("[data-yodeyma-image-anchor]");if(anchor){var flickityRoot=anchor.querySelector("flickity-carousel"),img;flickityRoot?img=flickityRoot.querySelector(".slide-media-content-wrapper.is-selected img")||flickityRoot.querySelector(".slide-media-content-wrapper:first-child img")||flickityRoot.querySelector(".flickity-slider > *:first-child img")||flickityRoot.querySelector("img"):img=anchor.querySelector("img.product-item__primary-image")||anchor.querySelector("img"),img&&(img.src=src,tile.dataset.imageSrcset?img.srcset=tile.dataset.imageSrcset:img.removeAttribute("srcset"),tile.dataset.imageSizes&&(img.sizes=tile.dataset.imageSizes))}}}function syncFormVariant(card,tile,variantId){var form=card.querySelector('form[is="product-form"]');if(form){var idInput=form.querySelector('input[name="id"]');idInput&&variantId&&(idInput.value=String(variantId));var pid=tile&&tile.dataset&&tile.dataset.productId;if(pid){var pidInput=form.querySelector('input[name="product-id"]');pidInput||(pidInput=document.createElement("input"),pidInput.type="hidden",pidInput.name="product-id",form.appendChild(pidInput)),pidInput.value=String(pid)}var h=tile&&tile.dataset&&tile.dataset.handle;h&&form.setAttribute("handle",String(h))}}document.addEventListener("click",function(e){var tile=e.target.closest(".oz-product-tiles__tile--selectable");if(!(!tile||tile.disabled)){var interactiveRoot=tile.closest("[data-yodeyma-tile-interactive]");if(interactiveRoot){var card=tile.closest("[data-yodeyma-tile-sync]")||tile.closest("product-item");if(card){e.preventDefault();var list=tile.closest(".oz-product-tiles__list");setActiveTile(list,tile);var priceCents=parseInt(tile.dataset.priceCents,10),compareAtCents=parseInt(tile.dataset.compareAtCents||"0",10);isNaN(priceCents)||updateCardPrice(card,priceCents,isNaN(compareAtCents)?0:compareAtCents),updateCardImage(card,tile);var vid=tile.dataset.variantId;vid&&syncFormVariant(card,tile,vid);var settings=window.themeVariables.settings||{}
1,openQuickBuyOnPhoneTap=settings.ozSwatchesTileTapOpensQuickBuyPhone!==!1;if(openQuickBuyOnPhoneTap&&isPhoneQuickBuyViewport()){var productUrl=tile.dataset.productUrl;productUrl&&openGlobalQuickBuyPopover(productUrl,vid)}}}}},!1)})();
2//# sourceMappingURL=/cdn/shop/t/32/assets/yodeyma-metafield-tile-picker.js.map?v=13051046281802142291788180027

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.