PageSourceSearch

https://www.motilalbanarsidass.com/cdn/shop/t/36/assets/island-pro…?v=79211808285818554351748984045

js motilalbanarsidass.com collected 2026-10-02 05:51:14 UTC 7,601 bytes, 2 lines download raw bytes

1import{deferrableData}from"data-island";var product_default=({product,variant,featuredMediaID,template,thumbnailsPosition,showThumbnailsOnMobile})=>({productRoot:null,product,currentVariant:variant,currentMediaId:featuredMediaID,loading:!1,quantity:"1",options:[],optionHandles:[],addedToCart:!1,stickyAddToCartShown:!1,variantChanged:!1,template,thumbnailsPosition,showThumbnailsOnMobile,hasGiftCardRecipientForm:!1,cartAddErrorMessage:null,isMaxLgBreakpoint:window.isMaxLgBreakpoint(),maxLgBreakpointMQL:window.maxLgBreakpointMQL(),get addToCartText(){if(this.currentVariant){if(this.loading)return window.theme.strings.loading;if(!this.loading&&this.currentVariant.available)return this.template==="product.preorder"?window.theme.strings.preOrder:window.theme.strings.addToCart;if(!this.loading&&!this.currentVariant.available)return window.theme.strings.soldOut}else return window.theme.strings.unavailable},get currentVariantId(){return this.currentVariant?this.currentVariant.id:null},get currentVariantAvailable(){return this.currentVariant?this.currentVariant.available:null},get currentVariantTitle(){return this.currentVariant&&this.currentVariant.title&&!this.currentVariant.title.includes("Default")?this.currentVariant.title:""},get currentPrice(){return this.currentVariant.price},get isUsingSlideshowToDisplayMedia(){const splideEl=this.productRoot.querySelector(".splide--product");return!!(window.Splide&&this.productRoot&&splideEl&&window.slideshows&&window.slideshows[`${splideEl.id}`]&&!window.slideshows[`${splideEl.id}`].state.is(window.Splide.STATES.DESTROYED))},get currentVariantHasCompareAtPrice(){return this.currentVariant&&this.product.compare_at_price_max&&this.currentVariant.compare_at_price>this.currentVariant.price},variantFromOptions(options=this.options){return this.product.variants.find(variant2=>variant2.options.every((value,index)=>value===options[index]))||null},getVariantById(id){return this.product.variants.find(variant2=>variant2.id===id)||null},formatMoney(price){return formatMoney(price,theme.moneyFormat)},init(){this.productRoot=this.$root,this.isMaxLgBreakpoint=this.maxLgBreakpointMQL.matches,this.maxLgBreakpointMQL.addEventListener("change",e=>{this.isMaxLgBreakpoint=e.matches}),this.$root.querySelector('[x-data="GiftCardRecipient"]')&&(this.hasGiftCardRecipientForm=!0),this.$refs.productForm&&this.$refs.productForm.addEventListener("submit",this.submitForm.bind(this)),this.getOptions(),this.$watch("currentMediaId",(value,oldValue)=>{showThumbnailsOnMobile&&this.$root.dispatchEvent(new CustomEvent("shapes:product:mediachange",{bubbles:!0,detail:{mediaId:this.currentMediaId,slideshowId:this.productRoot.querySelector(".splide--product")?.id}})),!this.isUsingSlideshowToDisplayMedia&&(this.$root.querySelector(`[data-
1product-single-media-wrapper="${oldValue}"]`).dispatchEvent(new CustomEvent("mediaHidden")),this.$root.querySelector(`[data-product-single-media-wrapper="${value}"]`).dispatchEvent(new CustomEvent("mediaVisible")))}),this.$watch("currentVariant",(value,oldValue)=>{document.dispatchEvent(new CustomEvent("theme:variant:change",{detail:{productRootEl:this.productRoot,formEl:this.productRoot.querySelector("form.shopify-product-form"),variant:value,previousVariant:oldValue,product:this.product}}))}),this.productRoot.addEventListener("theme:change:variant",event=>{if(!event.detail||!event.detail.variantId){console.error("theme:change:variant requires a variant ID");return}const variant2=this.getVariantById(event.detail.variantId);variant2||console.error("theme:change:variant: variant not found");const allPositions=Array.from({length:this.product.options.length},(_,index)=>index);for(const position of allPositions)this.productRoot.querySelectorAll(`[data-single-option-selector][data-position="${position+1}"]`).forEach(optionEl=>{optionEl.tagName==="SELECT"?optionEl.value=variant2.options[position]:optionEl.checked=optionEl.value===variant2.options[position],optionEl.dispatchEvent(new Event("change"))})})},optionChange(){this.getOptions();const matchedVariant=this.variantFromOptions(this.options);if(this.currentVariant=matchedVariant,this.currentVariant){variantLiveRegion(this.currentVariant),this.currentVariant.featured_media&&(this.currentMediaId=this.currentVariant.featured_media.id);const url=currentURLWithParams([["variant",this.currentVariantId]]).toString();window.history.replaceState({path:url},"",url),this.$refs.singleVariantSelector.dispatchEvent(new Event("change",{bubbles:!0})),this.$root.dispatchEvent(new CustomEvent("shapes:product:variantchange",{bubbles:!0,detail:{variant:this.currentVariant}}))}this.variantChanged=!0},getOptions(){this.options=[],this.optionHandles=[],this.$root.querySelectorAll("[data-single-option-selector]").forEach(selector=>{if(selector.nodeName==="SELECT"){const value=selector.value;this.options.push(value),this.optionHandles.push(selector.options[selector.selectedIndex].dataset.handle)}else if(selector.checked){const value=selector.value;this.options.push(value),this.optionHandles.push(selector.dataset.handle)}})},changeMedia(direction){if(this.$root.dispatchEvent(new CustomEvent("shapes:product:arrow-change",{bubbles:!0,detail:{direction}})),this.thumbnailsPosition=="under"){const currentThumbnail=this.$root.querySelector(".product-thumbnail-list-item--active"),nextElement=direction=="prev"?currentThumbnail.previousElementSibling:currentThumbnail.nextElementSibling;nextElement!==null&&nextElement.querySelector(".media-thumbnail").click()}},submitForm(evt){evt.preventDefault(),this.loading=!0,this.addedToCart=!1,liveRegion(window.theme.strings.loading);const formData=new FormData(this.$refs.productForm),formId=this.$refs.productForm.getAttribute("id");let modalCart=theme.settings.cartType==="modal";const config=fetchConfigDefaults("application/javascript");modalCart&&(formData.append("sections","cart-items,cart-footer,cart-item-count"),formData.append("sections_url",window.location.pathname)),config.body=formData,config.headers["X-Requested-With"]="XMLHttpRequest",delete config.headers["Content-Type"],fetch(`${theme.routes.cart_add_url}`,config).then(res=>res.json()).then(data=>{if(data.status){this.loading=!1;const errors=data.errors||data.description,message=data.description||data.message;this.hasGiftCardRecipientForm||(this.cartAddErrorMessage=message||window.theme.strings.cartError);const errorDetail={sourceId:formId,variantId:Number(formData.get("id")),errors,message};document.body.dispatchEvent(new CustomEvent("shapes:cart:adderror",{detail:{source:"product-form",...errorDetail}})),document.dispatchEvent(new CustomEvent("theme:product:error:add-to-cart",{detail:{productRootEl:Alpine.raw(this.productRoot),formEl:Alpine.raw(this.$refs.productForm),...errorDetail}}));return}this.loading=!1,this.cartAddErrorMessage=null,this.addedToCart=!0,modalCart&&document.body.dispatchEvent(new CustomEvent("shapes:cart:afteradditem",{bubbles:!0,detail:{response:data,sourceId:formId}})),document.querySelector('[data-show-on-add="true"]')||this.$refs.added&&this.$nextTick(()=>this.$refs.added.focus())}).catch(error=>{console.error(error)})},openZoom(id){const imageZoomDataEl=this.productRoot.querySelector("[data-photoswipe-images]");if(!imageZoomDataEl)return;const imageZoomData=JSON.parse(imageZoomDataEl.innerHTML),index=Object.keys(imageZoomData).indexOf(id);this.$refs.photoSwipeComponent.dispatchEvent(new CustomEvent("shapes:photoswipe:open",{detail:{index}}))}});deferrableData("Product",product_default);
2//# sourceMappingURL=/cdn/shop/t/36/assets/island-product.bundle.js.map?v=79211808285818554351748984045

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.