PageSourceSearch

https://www.jmvillegas.mx/cdn/shop/t/133/assets/js-product.js?v=51979870678895706471762809191

js jmvillegas.mx collected 2026-10-08 10:39:22 UTC 49,202 bytes, 1,332 lines download raw bytes

1(()=>{var __webpack_modules__={
1"./zrc/scripts/product.js":((__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval(`__webpack_require__.r(__webpack_exports__);
2/* harmony import */ var _shopify_theme_sections__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @shopify/theme-sections */ "./node_modules/@shopify/theme-sections/theme-sections.js");
3/* harmony import */ var _templates_product_product__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/product/product */ "./zrc/scripts/templates/product/product.js");
4/* harmony import */ var _templates_product_use_examples__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/product/use-examples */ "./zrc/scripts/templates/product/use-examples.js");
5/* harmony import */ var _templates_product_recommendations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/product/recommendations */ "./zrc/scripts/templates/product/recommendations.js");
6/* harmony import */ var _templates_product_recommendations__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_templates_product_recommendations__WEBPACK_IMPORTED_MODULE_3__);
7/**
8* \u{1F3F7} Info about theme sections
9* @package: @shopify/theme-sections
10* @url: https://yarnpkg.com/en/package/@shopify/theme-sections
11*/
12
13
14
15
16document.addEventListener('DOMContentLoaded', () => {
17  (0,_shopify_theme_sections__WEBPACK_IMPORTED_MODULE_0__.load)('*');
18});
19
20//# sourceURL=webpack://getmore-workflow/./zrc/scripts/product.js?`)}),
20"./zrc/scripts/templates/product/product-linking.js":((__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval(`__webpack_require__.r(__webpack_exports__);
21/* harmony export */ __webpack_require__.d(__webpack_exports__, {
22/* harmony export */   "default": () => (/* binding */ ProductLinking)
23/* harmony export */ });
24/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
25
26
27/* eslint-disable id-length */
28
29/* eslint-disable radix */
30class ProductLinking extends window.HTMLElement {
31  connectedCallback() {
32    this.siblingsJSON = this.querySelector("#product-linking-siblings");
33    this.siblings = JSON.parse(this.siblingsJSON.innerHTML.trim());
34    this.$siblings = this.querySelectorAll(".product-linking-option-input");
35    this.$siblingsOptionLabel = this.querySelector(".product-linking-option-title");
36    this.$siblingsGrid = this.querySelector(".product-linking-options");
37    this.updateContentAttribute = "data-product-linking-update"; // Si no hay productos "hermanos" entonces ya no hacemos nada
38
39    if (this.siblings.length < 1) {
40      return;
41    }
42
43    this.initProductLinkingOptions();
44  }
45
46  attachListeners() {
47    // funcion para agregar los escuchas a las opciones de PL y saber cuando se ah cambiado de producto
48    this.$siblings.forEach(productOption => {
49      productOption.addEventListener("change", () => {
50        if (productOption.checked === false) {
51          return;
52        }
53
54        this.onProductLinkingOptionClicked(productOption.value);
55      });
56    });
57  }
58
59  initProductLinkingOptions() {
60    // mandamos a llamar el contenido de todos los productos hermanos.
61    this.getProductsContentPromise(this.siblings).then(productsContent => {
62      // Aqui ya tenemos el contenido de los productos
63      // ponemos el contenido dentro del arreglo de los productos filtrados
64      productsContent.forEach((productContent, index) => {
65        this.siblings[index].content = productContent;
66      });
67      this.attachListeners();
68      this.classList.remove("disabled");
69    }).catch(error => {
70      window.console.log(error);
71    });
72  }
73
74  getProductsContentPromise(products) {
75    return (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__.default)(function* () {
76      try {
77        var urls = [];
78        products.forEach(product => {
79          urls.push(product.url);
80        }); // Realizar las llamadas Fetch y obtener un array de promesas
81
82        var promisesFetch = urls.map(url => window.fetch(url)); // Esperar a que se resuelvan todas las promesas
83
84        var responses = yield Promise.all(promisesFetch); // Obtener los resultados de todas las respuestas, y se obtienen por p\xE1gina
85
86        var results = yield Promise.all(responses.map(response => response.text()));
87        results.forEach((result, index) => {
88          results[index] = new window.DOMParser().parseFromString(result, "text/html");
89        });
90        return results;
91      } catch (error) {
92        // Manejo de errores
93        window.console.error(error);
94        return [];
95      }
96    })();
97  }
98
99  onProductLinkingOptionClicked(inputValue) {
100    // window.console.log(inputValue);
101    // funcion para realizar las acciones al momento de cambiar de producto.
102    // obtenemos el producto seleccionado para empezar a remplazar todas las partes necesarias de la page
103    var productID = parseInt(inputValue, 10);
104    var selectedProduct = this.siblings.find(product => {
105      if (productID === product.id) {
106        return product;
107      }
108
109      return false;
110    }); // update url
111
112    window.history.replaceState({}, "", selectedProduct.url); // update title tab
113
114    document.title = selectedProduct.title; // obtenemos todos los elementos con el attributo espacial para actualizar y tambien el orden
115
116    this.updateContent(selectedProduct).then(() => {
117      this.$siblingsOptionLabel.innerHTML = selectedProduct.color; // Set Event of change product linking option
118
119      window.console.log(selectedProduct.color);
120      this.updateApps();
121    }).catch(error => {
122      window.console.log(error);
123    });
124  }
125
126  updateContent(selectedProduct) {
127    return new Promise(resolve => {
128      var elementsUpdateNames = [];
129      var $elementsToUpdate = Array.from(document.querySelectorAll("[data-product-linking-update]"));
130      var $elementsToUpdateWithOrder = $elementsToUpdate.filter(item => item.hasAttribute("data-update-order"));
131      var $elementsToUpdateWithoutOrder = $elementsToUpdate.filter(item => !item.hasAttribute("data-update-order"));
132      $elementsToUpdateWithOrder.sort((a, b) => parseInt(a.getAttribute("data-update-order")) - parseInt(b.getAttribute("data-update-order")));
133      var $finalElementsOrderToUpdate = [...$elementsToUpdateWithoutOrder, ...$elementsToUpdateWithOrder];
134      $finalElementsOrderToUpdate.forEach($element => {
135        var $elementName = $element.dataset.productLinkingUpdate;
136        var $newElement = selectedProduct.content.querySelector("[data-product-linking-update=\\"".concat($elementName, "\\"]"));
137
138        if ($newElement == null) {
139          $element.classList.add("hidden");
140          return;
141        }
142
143        elementsUpdateNames.push($elementName); // IMPORTANTE: Forzar la desconexi\xF3n del custom element antes de reemplazar
144
145        if ($element.tagName === 'PRODUCT-USE-EXAMPLES') {
146          // Dar tiempo para que se ejecute disconnectedCallback
147          window.console.log('Reemplazando product-use-examples...');
148        }
149
150        $element.replaceWith($newElement.cloneNode(true));
151      }); // Usar requestAnimationFrame para asegurar que el DOM se actualice
152
153      window.requestAnimationFrame(() => {
154        resolve(elementsUpdateNames);
155      });
156    });
157  }
158
159  updateApps() {
160    if (window.Rebuy != null && typeof window.Rebuy.init === "function") {
161      window.Rebuy.init();
162      window.Rebuy.SmartCart.bindEvents();
163      window.console.log("window.Rebuy.SmartCart.bindEvents() se ejecuto");
164    }
165
166    reinitializeJudgeMe(); // Dar un peque\xF1o delay antes de disparar el evento
167
168    window.setTimeout(() => {
169      window.console.log('Disparando evento update::product_linking');
170      document.dispatchEvent(new window.Event("update::product_linking"));
171    }, 50);
172  }
173
174}
175
176function reinitializeJudgeMe() {
177  if (window.jdgm == null) {
178    return;
179  }
180
181  if (window.jdgm.initializeWidgets == null) {
182    return;
183  }
184
185  var $reviewsWidget = document.querySelector("#judgeme_product_reviews");
186
187  if ($reviewsWidget != null && $reviewsWidget.parentNode) {
188    var $reviewsWidgetClone = $reviewsWidget.cloneNode(true);
189    $reviewsWidget.parentNode.replaceChild($reviewsWidgetClone, $reviewsWidget);
190  }
191
192  var initialize = () => {
193    window.jdgm.initializeWidgets();
194  };
195
196  if (window.__jdgmScriptLoaded === true) {
197    initialize();
198    return;
199  }
200
201  if (typeof window.jdgm.loadScript === "function" && window.jdgm.CDN_HOST) {
202    window.jdgm.loadScript("".concat(window.jdgm.CDN_HOST, "shopify_v2.js"), () => {
203      window.__jdgmScriptLoaded = true;
204      initialize();
205    }, true);
206    return;
207  }
208
209  window.__jdgmScriptLoaded = true;
210  initialize();
211}
212
213//# sourceURL=webpack://getmore-workflow/./zrc/scripts/templates/product/product-linking.js?`)}),
213"./zrc/scripts/templates/product/product.js":((__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval(`__webpack_require__.r(__webpack_exports__);
214/* harmony import */ var _shopify_theme_sections__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @shopify/theme-sections */ "./node_modules/@shopify/theme-sections/theme-sections.js");
215/* harmony import */ var _product_linking_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./product-linking.js */ "./zrc/scripts/templates/product/product-linking.js");
216/* eslint-disable shopify/prefer-early-return */
217
218/* eslint-disable shopify/binary-assignment-parens */
219
220/* eslint-disable babel/object-curly-spacing */
221
222
223(0,_shopify_theme_sections__WEBPACK_IMPORTED_MODULE_0__.register)("product-section", {
224  initMainCarousel() {
225    var $mainCarousel = this.container.querySelector(".product-carousel");
226    var $arrowPrev = this.container.querySelector(".carousel-arrow.prev");
227    var $arrowNext = this.container.querySelector(".carousel-arrow.next");
228    var $thumbnailsCarousel = this.container.querySelector(".product-thumbnails-carousel");
229
230    if ($mainCarousel === null || $thumbnailsCarousel === null) {
231      return;
232    }
233
234    var slides = Number($mainCarousel.getAttribute("data-slides"));
235    var mainOptions = {
236      slidesToShow: 1,
237      slidesToScroll: 1,
238      arrows: slides > 1,
239      nextArrow: $arrowNext,
240      prevArrow: $arrowPrev,
241      asNavFor: $thumbnailsCarousel,
242      adaptiveHeight: true
243    };
244    var thumbsOptions = {
245      arrows: false,
246      asNavFor: $mainCarousel,
247      slidesToShow: 4,
248      slidesToScroll: 1,
249      focusOnSelect: true,
250      touchThreshold: 18,
251      edgeFriction: 0.01
252    };
253
254    if ($($mainCarousel).hasClass("slick-initialized")) {
255      $($mainCarousel).slick("unslick");
256    }
257
258    if ($($thumbnailsCarousel).hasClass("slick-initialized")) {
259      $($thumbnailsCarousel).slick("unslick");
260    }
261
262    this.mainCarousel = $($mainCarousel).slick(mainOptions);
263    $($thumbnailsCarousel).slick(thumbsOptions);
264    this.loadYoutubeVideos(); // Manejo de videos al cambiar de slide
265
266    this.mainCarousel.on("beforeChange", (event, slick, currentSlide) => {
267      var $currentSlideNode = slick.$slides[currentSlide];
268      var $iframe = $currentSlideNode.querySelector("iframe");
269      var $video = $currentSlideNode.querySelector("video");
270
271      if ($video !== null) {
272        $video.pause();
273      }
274
275      try {
276        if ($iframe !== null) {
277          var player = $($iframe).data("youtubePlayer");
278          player.pauseVideo();
279        }
280      } catch (error) {
281        window.console.log(error);
282      }
283    });
284    this.mainCarousel.on("afterChange", (event, slick, currentSlide) => {
285      var $currentSlideNode = slick.$slides[currentSlide];
286      var $iframe = $currentSlideNode.querySelector("iframe");
287      var $video = $currentSlideNode.querySelector("video");
288
289      if ($video !== null) {
290        $video.muted = true;
291        $video.play();
292      }
293
294      try {
295        if ($iframe !== null) {
296          var player = $($iframe).data("youtubePlayer");
297          player.mute();
298          player.playVideo();
299        }
300      } catch (error) {
301        window.console.log(error);
302      }
303    }); // se checa si ya hay una variable seleccionada desde que se carga la p\xE1gina
304
305    var $selectedVariant = this.container.querySelector("#selectedVariant");
306
307    if ($selectedVariant === null) {
308      return;
309    }
310
311    var selectedVariantData = JSON.parse($selectedVariant.textContent);
312
313    if (selectedVariantData.featured_media === undefined) {
314      return;
315    }
316
317    var variantSlide = this.container.querySelector(".main-slide[data-media-id=\\"".concat(selectedVariantData.featured_media.id, "\\"]"));
318
319    if (variantSlide === null) {
320      return;
321    }
322
323    var slideIndex = parseInt(variantSlide.getAttribute("data-slick-index"), 10);
324    this.mainCarousel.slick("slickGoTo", slideIndex);
325  },
326
327  initZoom() {
328    var $mainImagesSlide = this.container.querySelectorAll(".main-slide-image");
329    var zoomInitialized = false;
330
331    function createZooms() {
332      if (window.matchMedia("(max-width: 700px)").matches) {
333        return;
334      }
335
336      $mainImagesSlide.forEach($imageSlide => {
337        var zoomUrl = $imageSlide.querySelector("img").getAttribute("src");
338        $($imageSlide).zoom({
339          url: zoomUrl
340        });
341      });
342      zoomInitialized = true;
343    }
344
345    createZooms();
346    window.addEventListener("resize", () => {
347      if (window.matchMedia("(max-width: 700px)").matches && zoomInitialized) {
348        // destroy zooms
349        $mainImagesSlide.forEach($imageSlide => {
350          $($imageSlide).trigger("zoom.destroy");
351        });
352        zoomInitialized = false;
353        return;
354      }
355
356      if (zoomInitialized === false) {
357        createZooms();
358      }
359    });
360  },
361
362  loadYoutubeVideos() {
363    if (window.YT === undefined) {
364      return;
365    }
366
367    window.addEventListener("load", () => {
368      // your code here
369      window.YT.ready(() => {
370        var $externalVideos = this.mainCarousel.find(".iframe-video-replace-tag");
371        $externalVideos.each((idx, element) => {
372          var videoID = $(element).attr("data-id");
373          var $parent = $(element).parent();
374          var player = new window.YT.Player(element, {
375            videoId: videoID,
376            playerVars: {
377              loop: 1,
378              origin: window.location.origin
379            }
380          }); // se guarda el player en el objeto del iframe
381
382          $parent.children().data("youtubePlayer", player);
383        });
384      });
385    });
386  },
387
388  starsJudgemeClick() {
389    function attachNewListeners() {
390      var _$header$clientHeight;
391
392      var $stars = this.container.querySelector(".product-judgme-badge-click-wrapper");
393
394      if ($stars === null) {
395        return;
396      }
397
398      var $header = document.querySelector(".header-main-wrapper");
399      var headerHeight = (_$header$clientHeight = $header === null || $header === void 0 ? void 0 : $header.clientHeight) !== null && _$header$clientHeight !== void 0 ? _$header$clientHeight : 0;
400      $stars.addEventListener("click", () => {
401        var $reviewsRow = document.querySelector(".shopify-section.product-reviews-row");
402
403        if ($reviewsRow === null) {
404          return;
405        }
406
407        var scrollTo = $reviewsRow.offsetTop;
408        scrollTo -= headerHeight;
409        window.scroll({
410          top: scrollTo,
411          behavior: "smooth"
412        });
413      });
414    }
415
416    attachNewListeners.apply(this);
417  },
418
419  initCollapses() {
420    window.console.log('initCollapses - iniciando');
421    window.console.log('initCollapses - usando container:', this.container);
422    var $collapsesTitles = this.container.querySelectorAll(".product-collapse-item-title");
423    window.console.log('initCollapses - encontrados', $collapsesTitles.length, 'elementos collapse');
424
425    if ($collapsesTitles.length <= 0) {
426      window.console.log('initCollapses - no hay elementos collapse, saliendo');
427      return;
428    }
429
430    $collapsesTitles.forEach($title => {
431      $title.addEventListener("click", () => {
432        var isOpen = $title.parentNode.classList.contains("open");
433        $collapsesTitles.forEach($item => $item.parentNode.classList.remove("open"));
434
435        if (isOpen === false) {
436          $title.parentNode.classList.add("open");
437        }
438      });
439    });
440    window.console.log('initCollapses - listeners agregados correctamente');
441  },
442
443  updateInfoOnVariantChange() {
444    var $variantsWrapper = this.container.querySelector("variant-radios");
445
446    if ($variantsWrapper === null) {
447      return;
448    }
449
450    function updateStock(variant) {
451      var available = variant.available;
452      var stock = variant.inventory_quantity;
453      var isTracked = variant.inventory_management === "shopify";
454      var continueSellingOutStock = variant.inventory_policy === "continue";
455      var classStock = "";
456      var textStock = "";
457
458      if (available) {
459        if (continueSellingOutStock || !isTracked) {
460          classStock = "continue-selling";
461          textStock = "Disponible";
462        } else if (stock < 2) {
463          classStock = "low-stock";
464          textStock = "Solo queda ".concat(stock, " unidad");
465        } else if (stock > 1 && stock < 20) {
466          classStock = "low-stock";
467          textStock = "Solo quedan ".concat(stock, " unidades");
468        } else {
469          classStock = "with-stock";
470          textStock = "Disponibles ".concat(stock, " unidades");
471        }
472      } else {
473        classStock = "out-stock";
474        textStock = "0 unidades";
475      }
476
477      var $stockWrapper = this.container.querySelector(".product-stock");
478      var $stockText = $stockWrapper === null || $stockWrapper === void 0 ? void 0 : $stockWrapper.querySelector(".product-stock-text");
479
480      if ($stockWrapper && $stockText) {
481        $stockWrapper.classList.remove("continue-selling", "low-stock", "with-stock", "out-stock");
482        $stockWrapper.classList.add(classStock);
483        $stockText.textContent = " ".concat(textStock);
484      }
485    }
486
487    function updateSKU(variant) {
488      var $skuWrapper = this.container.querySelector(".product-sku-wrapper");
489
490      if ($skuWrapper === null || $skuWrapper === undefined) {
491        return;
492      }
493
494      if (variant.sku === undefined || variant.sku === null || variant.sku === "") {
495        variant.sku = "";
496        $skuWrapper.classList.add("hidden");
497        return;
498      }
499
500      $skuWrapper.classList.remove("hidden");
501      $skuWrapper.textContent = "SKU: ".concat(variant.sku);
502    }
503
504    function updateCarousel(variant) {
505      if (variant.featured_media === undefined) {
506        return;
507      }
508
509      var featuredMediaId = variant.featured_media.id;
510      var variantSlide = this.container.querySelector(".main-slide[data-media-id=\\"".concat(featuredMediaId, "\\"]"));
511
512      if (variantSlide === null) {
513        return;
514      } // Verificar si estamos usando Flickity o Slick
515
516
517      var flickityCarousel = this.container.querySelector("flickity-carousel");
518
519      if (flickityCarousel && flickityCarousel.flickityInstance) {
520        // Usar Flickity
521        flickityCarousel.flickityInstance.then(flickityInstance => {
522          var slideIndex = Array.from(flickityCarousel.children).indexOf(variantSlide);
523
524          if (slideIndex !== -1) {
525            flickityInstance.selectCell(slideIndex);
526          }
527        }).catch(() => {// Error al obtener la instancia de Flickity
528        });
529      } else if (this.mainCarousel && this.mainCarousel.slick) {
530        // Usar Slick (c\xF3digo original)
531        var slideIndex = parseInt(variantSlide.getAttribute("data-slick-index"), 10);
532        this.mainCarousel.slick("slickGoTo", slideIndex);
533      }
534    }
535
536    function updateDataIDOnButton(variant) {
537      var $buttonAddToCart = this.container.querySelector(".product-form__submit.button");
538      $buttonAddToCart.setAttribute("data-id", variant.id);
539    }
540
541    function updateTag(variant) {
542      function setNewBanner(color, text) {
543        var $carouselWrapper = this.container.querySelector(".product-carousels-wrapper");
544        $carouselWrapper.removeAttribute("style");
545        $carouselWrapper.removeAttribute("data-banner");
546        $carouselWrapper.setAttribute("style", "--banner-color: ".concat(color, ";"));
547        $carouselWrapper.setAttribute("data-banner", text);
548      } // cuando el price es menor que el compare price, quiere decir que la variante esta "on Sale"
549
550
551      if (variant.price < variant.compare_at_price) {
552        var percentage = variant.price * 100 / variant.compare_at_price;
553        percentage = 100 - percentage;
554        percentage = Math.round(percentage);
555        setNewBanner.call(this, "rgb(235, 57, 57)", "Ahorras ".concat(percentage, "%"));
556        return false;
557      }
558
559      var productTags = JSON.parse(this.container.querySelector("#productTags").innerText);
560
561      function ShopifyHandleize(string) {
562        return string.toLowerCase().normalize("NFD").replace(/[\\u0300-\\u036f]/g, "").replace(/[^a-z\xC0-\xFA0-9]+/g, "-").replace(/-$/, "").replace(/^-/, "");
563      }
564
565      productTags.forEach((tag, index) => {
566        productTags[index] = ShopifyHandleize(tag);
567      });
568
569      if (productTags.includes("sobre-pedido")) {
570        setNewBanner.call(this, "rgb(68, 165, 34)", "Sobre pedido");
571        return false;
572      }
573
574      if (productTags.includes("proximamente")) {
575        setNewBanner.call(this, "rgb(81, 184, 215)", "Pr\xF3ximamente");
576        return false;
577      }
578
579      if (productTags.includes("entrega-10-dias-habiles")) {
580        setNewBanner.call(this, "rgb(43, 57, 144)", "Entrega 10 d\xEDas h\xE1biles");
581        return false;
582      }
583
584      if (productTags.includes("entrega-15-dias-habiles")) {
585        setNewBanner.call(this, "rgb(43, 57, 144)", "Entrega 15 d\xEDas h\xE1biles");
586        return false;
587      }
588
589      if (productTags.includes("preventa")) {
590        setNewBanner.call(this, "rgb(81, 184, 215)", "Preventa");
591        return false;
592      }
593
594      if (productTags.includes("ultimas-piezas")) {
595        setNewBanner.call(this, "rgb(235, 57, 57)", "\xDAltimas piezas");
596        return false;
597      }
598
599      if (productTags.includes("hasta-agotar-existencias")) {
600        setNewBanner.call(this, "rgb(235, 57, 57)", "Hasta agotar existencias");
601        return false;
602      }
603
604      if (productTags.includes("envio-gratis")) {
605        setNewBanner.call(this, "rgb(43, 57, 144)", "Env\xEDo gratis");
606        return false;
607      }
608
609      if (productTags.includes("envio-gratis-cdmx")) {
610        setNewBanner.call(this, "rgb(43, 57, 144)", "Env\xEDo gratis CDMX");
611        return false;
612      }
613
614      setNewBanner.call(this, "", "");
615      return false;
616    }
617
618    function updateQuantityInputAvailability(variant) {
619      var $quantityInputWrapper = this.container.querySelector(".product-form__input.product-form__quantity");
620
621      if (variant.available === false) {
622        $quantityInputWrapper.classList.add("disabled");
623        return;
624      }
625
626      $quantityInputWrapper.classList.remove("disabled");
627    }
628
629    function updateVariantsAvailability($variantWrapper) {
630      // Las opciones de un producto pueden tener m\xE1ximo 3 opciones
631      // Las opciones actualmente seleccionadas del producto
632      var currentOptions = $variantWrapper.options; // Info de todas las variantes del producto
633
634      var allVariants = $variantWrapper.variantData; // vamos a poner todas las opciones deshabilitadas y despues conforme se encuentren coincidencias se habilitaran denuevo
635
636      var $htmlOptions = $variantWrapper.querySelectorAll("input");
637      $htmlOptions.forEach($htmlOption => {
638        $htmlOption.classList.add("disabled");
639      }); // vamos a filtar todas las variantes del producto por opcion para poder determinar cuales combinaciones son posibles
640
641      var filteredVariantsOption1 = null;
642      var filteredVariantsOption2 = null;
643      var filteredVariantsOption3 = null;
644
645      function enableHTMLOptionsByPosition(variantsArray, positionToCheck) {
646        if (variantsArray.length === 0) {
647          return;
648        } // funcion que nos ayuda a vovler a habilitar las opciones en HTML
649
650
651        variantsArray.forEach(variant => {
652          var htmlOption = $variantWrapper.querySelector("fieldset[data-option-position='".concat(positionToCheck, "'] input[value='").concat(variant["option".concat(positionToCheck)], "']"));
653
654          if (htmlOption == null || variant.available === false) {
655            return;
656          }
657
658          htmlOption.classList.remove("disabled");
659        });
660      }
661
662      if (currentOptions.length === 1) {
663        enableHTMLOptionsByPosition(allVariants, 1);
664      }
665
666      if (currentOptions.length === 2) {
667        filteredVariantsOption1 = allVariants.filter(variant => variant.option2 === currentOptions[1]);
668        enableHTMLOptionsByPosition(filteredVariantsOption1, 1);
669        filteredVariantsOption2 = allVariants.filter(variant => variant.option1 === currentOptions[0]);
670        enableHTMLOptionsByPosition(filteredVariantsOption2, 2);
671      }
672
673      if (currentOptions.length === 3) {
674        filteredVariantsOption1 = allVariants.filter(variant => variant.option2 === currentOptions[1] && variant.option3 === currentOptions[2]);
675        enableHTMLOptionsByPosition(filteredVariantsOption1, 1);
676        filteredVariantsOption2 = allVariants.filter(variant => variant.option1 === currentOptions[0] && variant.option3 === currentOptions[2]);
677        enableHTMLOptionsByPosition(filteredVariantsOption2, 2);
678        filteredVariantsOption3 = allVariants.filter(variant => variant.option1 === currentOptions[0] && variant.option2 === currentOptions[1]);
679        enableHTMLOptionsByPosition(filteredVariantsOption3, 3);
680      }
681    }
682
683    $variantsWrapper.addEventListener("variant::changed", () => {
684      var currentVariantInfo = $variantsWrapper.currentVariant;
685
686      if (currentVariantInfo === undefined) {
687        currentVariantInfo = {
688          available: false
689        };
690      }
691
692      updateStock.call(this, currentVariantInfo);
693      updateSKU.call(this, currentVariantInfo);
694      updateCarousel.call(this, currentVariantInfo);
695      updateDataIDOnButton.call(this, currentVariantInfo);
696      updateTag.call(this, currentVariantInfo);
697      updateQuantityInputAvailability.call(this, currentVariantInfo);
698      updateVariantsAvailability.call(this, $variantsWrapper);
699    });
700    updateVariantsAvailability.call(this, $variantsWrapper);
701  },
702
703  getAndUpdateVariantColor() {
704    var $variantsWrapper = this.container.querySelector("variant-radios");
705
706    if ($variantsWrapper === null) {
707      return;
708    }
709
710    var $colorSelection = $variantsWrapper.querySelector(".product-form-option-selector-color");
711
712    if ($colorSelection === null) {
713      return;
714    }
715
716    function updateColorLabel() {
717      var $inputCurrentColor = $colorSelection.querySelector("input:checked");
718
719      if ($inputCurrentColor === null) {
720        return;
721      }
722
723      $colorSelection.querySelector(".product-option-color-label span").textContent = $inputCurrentColor.value;
724    }
725
726    updateColorLabel();
727    $variantsWrapper.addEventListener("variant::changed", () => {
728      updateColorLabel();
729    });
730  },
731
732  initPopUpPosteTag() {
733    // Si el producto contiene el tag de "poste" siginifica que aparecera un pop-up
734    var isShowedPopup = false; // al momento de dar clic en el boton "agregar al carrito", con un producto de sugerencia.
735    // El boton de "agregar al carrito" se le agrega el attributo 'data-poste-tag' solo cuando tiene el producto el tag mediante liquid.
736
737    var $popup = this.container.querySelector(".product-popup-poste-wrapper");
738    var $buttonAddToCart = this.container.querySelector("button[data-poste-tag].product-form__submit.button");
739    var $popupCloseButton = this.container.querySelector(".product-popup-poste-wrapper .product-popup-button-decline"); // si no se encuentra, no hacemos nada
740
741    if ($buttonAddToCart === null || $popup === null) {
742      return;
743    }
744
745    $buttonAddToCart.addEventListener("click", event => {
746      if (!isShowedPopup) {
747        event.preventDefault();
748        $popup.classList.remove("hidden");
749        isShowedPopup = true;
750      } // if (!window.customerIsWholesaler) {
751      //   const SmartCart = window.Rebuy.SmartCart;
752      //   SmartCart.skip_open = true;
753      // }
754      // const currentVariantId = parseInt($buttonAddToCart.dataset.id, 10);
755      // let totalQuantity = 0;
756      // const quantity = parseInt(this.container.querySelector('.quantity__input').value, 10);
757      // totalQuantity = window.apiCart.getQuantityProductInCart(currentVariantId) + quantity;
758      // window.apiCart
759      //   .updateItems({[currentVariantId]: totalQuantity})
760      //   .then(async () => {
761      //     await window.apiCart.getCart();
762      //     $popup.classList.remove('hidden');
763      //   })
764      //   .catch(() => {
765      //     $buttonAddToCart.querySelector('span').textContent = window.variantStrings.soldOut;
766      //     $buttonAddToCart.classList.add('button-disable');
767      //   });
768
769    });
770    $popupCloseButton.addEventListener("click", () => {
771      // if (window.customerIsWholesaler) {
772      //   window.location.href = '/cart';
773      // }
774      $popup.classList.add("hidden");
775      $buttonAddToCart.click();
776      isShowedPopup = false; // const SmartCart = window.Rebuy.SmartCart;
777      // SmartCart.show();
778      // SmartCart.skip_open = false;
779      // return false;
780    }); // return false;
781  },
782
783  initProductLinking() {
784    if (window.customElements.get("product-linking") === undefined) {
785      window.customElements.define("product-linking", _product_linking_js__WEBPACK_IMPORTED_MODULE_1__.default);
786    }
787
788    document.addEventListener("update::product_linking", () => {
789      // window.console.log('update::product_linking - reinitializing product');
790      window.setTimeout(() => {
791        this.reInitProduct();
792      }, 100);
793    });
794  },
795
796  reInitProduct() {
797    var $nextContainer = document.querySelector("[data-section-id=\\"".concat(this.id, "\\"]"));
798
799    if ($nextContainer !== null) {
800      this.container = $nextContainer;
801    }
802
803    if (typeof window.initButtonAjax === "function") {
804      window.initButtonAjax(this.container);
805    }
806
807    this.initCollapses();
808    this.starsJudgemeClick();
809    this.updateInfoOnVariantChange();
810    this.getAndUpdateVariantColor();
811    this.initPopUpPosteTag();
812    this.initProductUseExamples();
813    this.formatJudgeMePreviewBadge();
814  },
815
816  initProductUseExamples() {
817    // window.console.log('initProductUseExamples - iniciando inicializaci\xF3n del carousel de ejemplos de uso');
818    var $productUseExamples = document.querySelector('product-use-examples');
819
820    if ($productUseExamples) {
821      $productUseExamples.initCarousel();
822    }
823  },
824
825  formatJudgeMePreviewBadge() {
826    var $badgeWrapper = this.container.querySelector(".jdgm-preview-badge");
827
828    if ($badgeWrapper === null) {
829      return;
830    }
831
832    var $badge = $badgeWrapper.querySelector(".jdgm-prev-badge");
833
834    if ($badge === null) {
835      return;
836    }
837
838    var $badgeText = $badge.querySelector(".jdgm-prev-badge__text");
839
840    if ($badgeText === null) {
841      return;
842    }
843
844    var reviewsCount = $badge.getAttribute("data-number-of-reviews");
845
846    if (reviewsCount === null || reviewsCount === undefined) {
847      return;
848    }
849
850    $badgeText.textContent = "(".concat(reviewsCount, ")");
851  },
852
853  onLoad() {
854    window.initButtonAjax(this.container); // this.initMainCarousel();
855    // this.initZoom();
856
857    this.initCollapses();
858    this.updateInfoOnVariantChange();
859    this.getAndUpdateVariantColor();
860    this.starsJudgemeClick();
861    this.initPopUpPosteTag();
862    this.initProductLinking();
863    this.formatJudgeMePreviewBadge();
864  }
865
866});
867
868//# sourceURL=webpack://getmore-workflow/./zrc/scripts/templates/product/product.js?`)}),
868"./zrc/scripts/templates/product/recommendations.js":(()=>{eval(`/* eslint-disable newline-per-chained-call */
869
870/* eslint-disable consistent-return */
871
872/* eslint-disable no-undef */
873// import {register} from '@shopify/theme-sections';
874// register('product-recommendations-section', {
875//   onLoad() {
876//   },
877// });
878// En cada producto, agregar la clase que funciona como sem\xE1foro para el texto del Stock
879window.setCheckStockClass = (currentVariant, available) => {
880  var inventoryManagement = currentVariant.inventory_management;
881  var inventoryPolicy = currentVariant.inventory_policy;
882  var stock = currentVariant.inventory_quantity;
883  var isTracked = inventoryManagement === "shopify";
884  var continueSelling = inventoryPolicy === "continue";
885
886  if (available) {
887    if (continueSelling || isTracked === false) {
888      return "continue-selling";
889    } else if (stock < 20) {
890      return "low-stock";
891    } else if (stock >= 20) {
892      return "with-stock";
893    }
894  }
895
896  return 'out-stock';
897}; // En cada producto, definir qu\xE9 va a decir el texto del Stock
898
899
900window.setStockContent = (currentVariant, available) => {
901  var inventoryManagement = currentVariant.inventory_management;
902  var inventoryPolicy = currentVariant.inventory_policy;
903  var stock = currentVariant.inventory_quantity;
904  var isTracked = inventoryManagement === "shopify";
905  var continueSelling = inventoryPolicy === "continue";
906  var content = "";
907
908  if (available) {
909    if (continueSelling || isTracked === false) {
910      content = "Disponible";
911    } else if (stock < 2) {
912      content = "Solo queda 1 unidad";
913    } else if (stock < 20 && stock > 1) {
914      content = "Quedan ".concat(stock, " unidades");
915    } else if (stock >= 20) {
916      content = "Disponibles ".concat(stock, " unidades");
917    }
918  }
919
920  return content;
921};
922
923window.setProductCardBanner = (attributeToReturn, product, isOnSale, variantPrice, variantCompareAtPrice) => {
924  var ShopifyHandleize = str => {
925    return str.toLowerCase().normalize("NFD").replace(/[\\u0300-\\u036f]/g, "").replace(/[^a-z\xC0-\xFA0-9]+/g, "-").replace(/-$/, "").replace(/^-/, "");
926  };
927
928  if (isOnSale && !window.customerIsWholesaler) {
929    var percentage = variantPrice * 100 / variantCompareAtPrice;
930    percentage = 100 - percentage;
931    percentage = Math.round(percentage);
932
933    if (attributeToReturn === 'style') {
934      return "--banner-color:rgb(235, 57, 57);";
935    }
936
937    return "Ahorras ".concat(percentage, "%");
938  }
939
940  if (!product.tags) {
941    return;
942  }
943
944  var productTags = product.tags.split(',').map(tag => {
945    return ShopifyHandleize(tag);
946  });
947
948  if (productTags.includes('sobre-pedido')) {
949    if (attributeToReturn === 'style') {
950      return "--banner-color:rgb(68, 165, 34);";
951    }
952
953    return "Sobre pedido";
954  }
955
956  if (productTags.includes('proximamente')) {
957    if (attributeToReturn === 'style') {
958      return "--banner-color:rgb(81, 184, 215);";
959    }
960
961    return "Pr\\xF3ximamente";
962  }
963
964  if (productTags.includes('entrega-10-dias-habiles')) {
965    if (attributeToReturn === 'style') {
966      return "--banner-color:rgb(43, 57, 144);";
967    }
968
969    return "Entrega 10 d\\xEDas h\\xE1biles";
970  }
971
972  if (productTags.includes('entrega-15-dias-habiles')) {
973    if (attributeToReturn === 'style') {
974      return "--banner-color:rgb(43, 57, 144);";
975    }
976
977    return "Entrega 15 d\\xEDas h\\xE1biles";
978  }
979
980  if (productTags.includes('preventa')) {
981    if (attributeToReturn === 'style') {
982      return "--banner-color:rgb(81, 184, 215);";
983    }
984
985    return "Preventa";
986  }
987
988  if (productTags.includes('ultimas-piezas')) {
989    if (attributeToReturn === 'style') {
990      return "--banner-color:rgb(235, 57, 57);";
991    }
992
993    return "\\xDAltimas piezas";
994  }
995
996  if (productTags.includes('hasta-agotar-existencias')) {
997    if (attributeToReturn === 'style') {
998      return "--banner-color:rgb(235, 57, 57);";
999    }
1000
1001    return "Hasta agotar existencias";
1002  }
1003
1004  if (productTags.includes('envio-gratis')) {
1005    if (attributeToReturn === 'style') {
1006      return "--banner-color:rgb(43, 57, 144);";
1007    }
1008
1009    return "Env\\xEDo gratis";
1010  }
1011
1012  if (productTags.includes('envio-gratis-cdmx')) {
1013    if (attributeToReturn === 'style') {
1014      return "--banner-color:rgb(43, 57, 144);";
1015    }
1016
1017    return "Env\\xEDo gratis CDMX";
1018  }
1019
1020  return '';
1021};
1022
1023document.addEventListener('rebuy.init', event => {
1024  var widgetId = event.detail.widget.id;
1025  /*
1026  * --------------------------------------------
1027  * Productos relacionados
1028  * --------------------------------------------
1029  */
1030
1031  var relatedProductsWidgetId = '124959';
1032
1033  if (widgetId !== relatedProductsWidgetId) {
1034    return;
1035  }
1036
1037  function setHeights() {
1038    var $container = document.querySelector('.product-recommendations-grid-wrapper');
1039    var $arrayTitles = $container === null || $container === void 0 ? void 0 : $container.querySelectorAll('.product-card-title-wrapper');
1040    var $arrayPrices = $container === null || $container === void 0 ? void 0 : $container.querySelectorAll('.product-card-price-wrapper');
1041    var $arrayStocks = $container === null || $container === void 0 ? void 0 : $container.querySelectorAll('.product-card-stock-wrapper');
1042    var $arrayReviews = $container === null || $container === void 0 ? void 0 : $container.querySelectorAll('.product-card-reviews-wrapper');
1043
1044    function buildFunctionParams(cssVariableCustom) {
1045      var options = {
1046        cssVariable: cssVariableCustom,
1047        gridOptions: [{
1048          breakpoint: 99999,
1049          columns: 4
1050        }, {
1051          breakpoint: 1023,
1052          columns: 3
1053        }, {
1054          breakpoint: 680,
1055          columns: 2
1056        }]
1057      };
1058      return options;
1059    }
1060
1061    window.setHeight($arrayTitles, buildFunctionParams('--height-title'));
1062    window.setHeight($arrayPrices, buildFunctionParams('--height-price'));
1063    window.setHeight($arrayStocks, buildFunctionParams('--height-stock'));
1064    window.setHeight($arrayReviews, buildFunctionParams('--height-reviews'));
1065  }
1066
1067  window.setTimeout(() => {
1068    setHeights(); // Setting up Wishlist Hero
1069
1070    document.arrive(".rebuy-wishlist-hero-custom-button", wishlistButton => {
1071      var ev = new CustomEvent("wishlist-hero-add-to-custom-element", {
1072        detail: wishlistButton
1073      });
1074      document.dispatchEvent(ev);
1075    });
1076    window.setTimeout(() => {
1077      document.querySelectorAll(".rebuy-wishlist-hero-custom-button").forEach(wishlistButton => {
1078        var ev = new CustomEvent("wishlist-hero-add-to-custom-element", {
1079          detail: wishlistButton
1080        });
1081        document.dispatchEvent(ev);
1082      });
1083    }, 3000);
1084  }, 1000);
1085  window.console.log('rebuy.init event', event.detail, widgetId);
1086});
1087
1088//# sourceURL=webpack://getmore-workflow/./zrc/scripts/templates/product/recommendations.js?`)}),
1088"./zrc/scripts/templates/product/use-examples.js":((__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval(`__webpack_require__.r(__webpack_exports__);
1089/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1090/* harmony export */   "default": () => (/* binding */ ProductUseExamples)
1091/* harmony export */ });
1092class ProductUseExamples extends window.HTMLElement {
1093  connectedCallback() {
1094    this.mainCarousel = null; // Verificar si jQuery y Slick est\xE1n disponibles
1095
1096    if (typeof window.$ === "undefined" || typeof window.$.fn.slick === "undefined") {
1097      window.console.error("jQuery o Slick no est\xE1n disponibles");
1098      return;
1099    } // Usar requestAnimationFrame para asegurar que el DOM est\xE9 completamente renderizado
1100
1101
1102    window.requestAnimationFrame(() => {
1103      this.initCarousel();
1104    });
1105  }
1106
1107  disconnectedCallback() {
1108    this.destroyCarousel();
1109  }
1110
1111  destroyCarousel() {
1112    if (this.mainCarousel) {
1113      try {
1114        // Verificar si el carousel est\xE1 inicializado
1115        if (this.mainCarousel.hasClass('slick-initialized')) {
1116          this.mainCarousel.slick('unslick');
1117          window.console.log('Carousel destruido correctamente');
1118        }
1119      } catch (error) {
1120        window.console.error('Error al destruir carousel:', error);
1121      }
1122    } // Limpiar event listeners de YouTube
1123
1124
1125    if (this.youtubeLoadHandler) {
1126      window.removeEventListener('load', this.youtubeLoadHandler);
1127    }
1128
1129    this.mainCarousel = null;
1130  }
1131
1132  initCarousel() {
1133    if (typeof window.$.fn.slick === "undefined") {
1134      this.loadSlick(() => {
1135        this.initCarousel();
1136      });
1137      return;
1138    }
1139
1140    var $mainCarousel = this.querySelector(".product-use-examples-carousel");
1141    var $arrowPrev = this.querySelector(".carousel-arrow.prev");
1142    var $arrowNext = this.querySelector(".carousel-arrow.next");
1143
1144    if ($mainCarousel === null) {
1145      // window.console.warn('No se encontr\xF3 el carousel en el DOM');
1146      return;
1147    } // Verificar si ya est\xE1 inicializado
1148
1149
1150    if ($($mainCarousel).hasClass("slick-initialized")) {
1151      // window.console.warn('El carousel ya est\xE1 inicializado, destruyendo primero...');
1152      $($mainCarousel).slick("unslick");
1153    }
1154
1155    var slides = parseInt($mainCarousel.getAttribute("data-slides"), 10) || 0; // window.console.log(\`Inicializando carousel con \${slides} slides\`);
1156
1157    var mainOptions = {
1158      slidesToShow: 1,
1159      slidesToScroll: 1,
1160      arrows: slides > 1,
1161      nextArrow: $arrowNext,
1162      prevArrow: $arrowPrev,
1163      infinite: true,
1164      adaptiveHeight: false
1165    };
1166
1167    try {
1168      // Guardar referencia con jQuery
1169      this.mainCarousel = $($mainCarousel); // Inicializar Slick
1170
1171      this.mainCarousel.slick(mainOptions); // window.console.log('Carousel inicializado correctamente');
1172      // Cargar videos y agregar listeners
1173
1174      this.loadYoutubeVideos();
1175      this.attachCarouselListeners();
1176    } catch (error) {
1177      window.console.error("Error al inicializar el carousel:", error);
1178    }
1179  }
1180
1181  loadSlick(callback) {
1182    var _window$themeAssets;
1183
1184    if ((_window$themeAssets = window.themeAssets) !== null && _window$themeAssets !== void 0 && _window$themeAssets.slick) {
1185      var $script = document.createElement("script");
1186      $script.src = window.themeAssets.slick;
1187      $script.onload = callback;
1188
1189      $script.onerror = () => window.console.error("Error al cargar slick.js");
1190
1191      document.head.appendChild($script);
1192    } else {
1193      window.console.error("No se encontr\xF3 window.themeAssets.slick");
1194    }
1195  }
1196
1197  attachCarouselListeners() {
1198    if (this.mainCarousel === null || this.mainCarousel === undefined) {
1199      return;
1200    } // Pausar videos al cambiar de slide
1201
1202
1203    this.mainCarousel.on("beforeChange", (event, slick, currentSlide) => {
1204      var $currentSlideNode = slick.$slides[currentSlide];
1205
1206      if ($currentSlideNode === null || $currentSlideNode === undefined) {
1207        return;
1208      }
1209
1210      var $iframe = $currentSlideNode.querySelector("iframe");
1211      var $video = $currentSlideNode.querySelector("video");
1212
1213      if ($video !== null) {
1214        $video.pause();
1215      }
1216
1217      try {
1218        if ($iframe !== null) {
1219          var player = $($iframe).data("youtubePlayer");
1220
1221          if (player && typeof player.pauseVideo === "function") {
1222            player.pauseVideo();
1223          }
1224        }
1225      } catch (error) {
1226        window.console.log("Error pausando video:", error);
1227      }
1228    }); // Reproducir videos en el slide actual
1229
1230    this.mainCarousel.on("afterChange", (event, slick, currentSlide) => {
1231      var $currentSlideNode = slick.$slides[currentSlide];
1232
1233      if ($currentSlideNode === null || $currentSlideNode === undefined) {
1234        return;
1235      }
1236
1237      var $iframe = $currentSlideNode.querySelector("iframe");
1238      var $video = $currentSlideNo
1238de.querySelector("video");
1239
1240      if ($video !== null) {
1241        $video.muted = true;
1242        $video.play().catch(() => {// Ignorar errores de autoplay
1243        });
1244      }
1245
1246      try {
1247        if ($iframe !== null) {
1248          var player = $($iframe).data("youtubePlayer");
1249
1250          if (player && typeof player.playVideo === "function") {
1251            player.mute();
1252            player.playVideo();
1253          }
1254        }
1255      } catch (error) {
1256        window.console.log("Error reproduciendo video:", error);
1257      }
1258    });
1259    window.console.log("Listeners del carousel agregados");
1260  }
1261
1262  loadYoutubeVideos() {
1263    if (typeof window.YT === "undefined") {
1264      window.console.log("YouTube API no est\xE1 cargada");
1265      return;
1266    }
1267
1268    var loadVideos = () => {
1269      if (!window.YT || typeof window.YT.ready !== "function") {
1270        window.console.log("YouTube API no est\xE1 lista");
1271        return;
1272      }
1273
1274      window.YT.ready(() => {
1275        window.console.log("YouTube API lista, inicializando videos");
1276
1277        if (this.mainCarousel === null) {
1278          window.console.warn("mainCarousel no est\xE1 disponible para cargar videos");
1279          return;
1280        }
1281
1282        var $externalVideos = this.mainCarousel.find(".iframe-video-replace-tag");
1283        window.console.log("Encontrados ".concat($externalVideos.length, " videos de YouTube"));
1284        $externalVideos.each((idx, element) => {
1285          // Verificar si ya tiene un player inicializado
1286          var $element = $(element);
1287
1288          if ($element.data("youtubePlayer")) {
1289            window.console.log("Video ".concat(idx, " ya tiene player inicializado"));
1290            return;
1291          }
1292
1293          var videoID = $element.attr("data-id");
1294          var $parent = $element.parent();
1295
1296          try {
1297            var player = new window.YT.Player(element, {
1298              videoId: videoID,
1299              playerVars: {
1300                loop: 1,
1301                origin: window.location.origin
1302              }
1303            }); // Guardar referencia del player
1304
1305            $parent.children().data("youtubePlayer", player);
1306            window.console.log("Video ".concat(idx, " inicializado correctamente"));
1307          } catch (error) {
1308            window.console.error("Error inicializando video ".concat(idx, ":"), error);
1309          }
1310        });
1311      });
1312    };
1313
1314    if (document.readyState === "complete") {
1315      loadVideos();
1316    } else {
1317      // Guardar referencia para poder limpiar el listener
1318      this.youtubeLoadHandler = loadVideos;
1319      window.addEventListener("load", this.youtubeLoadHandler, {
1320        once: true
1321      });
1322    }
1323  }
1324
1325}
1326
1327if (window.customElements.get("product-use-examples") === undefined) {
1328  window.customElements.define("product-use-examples", ProductUseExamples);
1329}
1330
1331//# sourceURL=webpack://getmore-workflow/./zrc/scripts/templates/product/use-examples.js?`)})
1331},__webpack_module_cache__={};function __webpack_require__(moduleId){if(__webpack_module_cache__[moduleId])return __webpack_module_cache__[moduleId].exports;var module=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module,module.exports,__webpack_require__),module.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.x=x=>{},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},(()=>{var installedChunks={product:0},deferredModules=[["./zrc/scripts/product.js","commons"]],checkDeferredModules=x=>{},webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{for(var[chunkIds,moreModules,runtime,executeModules]=data,moduleId,chunkId,i=0,resolves=[];i<chunkIds.length;i++)chunkId=chunkIds[i],__webpack_require__.o(installedChunks,chunkId)&&installedChunks[chunkId]&&resolves.push(installedChunks[chunkId][0]),installedChunks[chunkId]=0;for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);for(runtime&&runtime(__webpack_require__),parentChunkLoadingFunction&&parentChunkLoadingFunction(data);resolves.length;)resolves.shift()();return executeModules&&deferredModules.push.apply(deferredModules,executeModules),checkDeferredModules()},chunkLoadingGlobal=self.webpackChunkgetmore_workflow=self.webpackChunkgetmore_workflow||[];chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null,0)),chunkLoadingGlobal.push=webpackJsonpCallback.bind(null,chunkLoadingGlobal.push.bind(chunkLoadingGlobal));function checkDeferredModulesImpl(){for(var result,i=0;i<deferredModules.length;i++){for(var deferredModule=deferredModules[i],fulfilled=!0,j=1;j<deferredModule.length;j++){var depId=deferredModule[j];installedChunks[depId]!==0&&(fulfilled=!1)}fulfilled&&(deferredModules.splice(i--,1),result=__webpack_require__(__webpack_require__.s=deferredModule[0]))}return deferredModules.length===0&&(__webpack_require__.x(),__webpack_require__.x=x=>{}),result}var startup=__webpack_require__.x;__webpack_require__.x=()=>(__webpack_require__.x=startup||(x=>{}),(checkDeferredModules=checkDeferredModulesImpl)())})(),__webpack_require__.x()})();
1332//# sourceMappingURL=/cdn/shop/t/133/assets/js-product.js.map?v=51979870678895706471762809191

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.