"use strict";var largeImageModalViewModel=function(){var e={carouselId:"large-image-carousel"};return document.getElementById("large-image-modal").addEventListener("shown.bs.modal",(function(){setTimeout((function(){window.lazyImages()}),0)})),e.title=ko.observable(),e.carousel=ko.observable(),e.images=ko.observableArray([]),e.modal=bootstrap.Modal.getOrCreateInstance(document.getElementById("large-image-modal")),e.showModal=function(){e.modal.show()},e.hideModal=function(){e.modal.hide()},e.load=function(o,t){if(o.hasOwnProperty("Definition")&&o.Definition.heading)e.title(o.Definition.heading);else if(o.hasOwnProperty("MainProduct"))e.title("".concat(o.MainProduct.Product.name," - ").concat(o.MainProduct.Product.code));else if(o.hasOwnProperty("Product"))e.title("".concat(o.Product.name," - ").concat(o.Product.code));else if(console.trace(t),"IMG"===t.target.nodeName){var a=imageViewModel(null);a.htmlSectionImage=t.target.outerHTML.replace(/data-bind="[^"]*"/,"").replace(/srcset="[^"]*"/,"").replace(/sizes="[^"]*"/,""),a.htmlSectionImage=a.htmlSectionImage.replace("thumb","").replace(/image\/\d*\//,"image/1024/"),a.htmlSectionImage=a.htmlSectionImage.replace("thumb","").replace(/image-nonwebp\/\d*\//,"image-nonwebp/1024/"),e.title(t.target.alt),e.images([a])}o.hasOwnProperty("Carousel")&&(e.carousel(o.Carousel),e.images(o.Carousel.Images.map((function(e){var t=o.images().filter((function(o){return o.ImageID==e.ImageID}))[0].data.DOMElement.parentElement,a=imageViewModel(null);return a=Object.assign(a,e),window.isMobileSite()||(a.hotspots(o.Hotspots.flatMap((function(o){return o.ImageID==e.ImageID?o.Hotspots:[]}))),a.hotspots().forEach((function(e){var o=orderFormGroupViewModel(),r=e.Product.Product,d=[],i=productViewModel(r.productId,1);if(r.controls.allowSample){var l=productViewModel(r.productId,1);l.data(r.sample),l.orderFormTypeId=0,l.quantity(l.stockMessage.quantityMinimum),d.push(l)}if(r.controls.allowLargeSample){var n=productViewModel(r.productId,1);n.data(r.largeSample),n.orderFormTypeId=1,n.quantity(n.stockMessage.quantityMinimum),d.push(n)}if(r.controls.allowOrder){var c=productViewModel(r.productId,1);c.data(r),c.orderFormTypeId=2,c.quantity(c.stockMessage.quantityMinimum),d.push(c)}if(r.controls.allowReserve){var u=productViewModel(r.productId,2);u.data(r),u.orderFormTypeId=3,u.quantity(u.stockMessage.quantityMinimum),d.push(u)}if(r.controls.allowReserveWithBatchSample){var s=productViewModel(r.productId,3);s.data(r),s.orderFormTypeId=4,s.quantity(s.stockMessage.quantityMinimum),d.push(s)}i.data(r),i.products(d),o.products([i]),o.markup=t.querySelector(".hotspot-marker #product-".concat(r.productId)).closest(".hotspot-marker").outerHTML,o.markup=o.markup.replace("product-".concat(r.productId),"product-hotspot-".concat(r.productId)),a.orderFormGroups.push(o)}))),a})))),e.showModal(),window.setTimeout((function(){window.lazyImages()}),100)},e};window.largeImageModal=largeImageModalViewModel(),document.querySelector("#large-image-modal")&&ko.applyBindings(window.largeImageModal,document.querySelector("#large-image-modal"));
///*# sourceMappingURL=https://www.designersguild.com/js/dist/models/common/modals/large-image-modal.min.js.map */
;
