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MAAM,GAAG,GAC9B,IAAKe,EAAK,OACVA,EAAMA,EAAIsN,OAEV,IAAIrN,EAAQoN,EAAWpO,MAAM,GAAG,GAChC,IAAKgB,EAAO,OACZA,EAAQA,EAAMqN,OACdN,EAAQhN,GAAOC,CACjB,CA1ByC,CA2B3C,KAEeiL,IAAQ+B,EAAgBD,GAC1B,CACXvP,OAAOC,YAAsC,yBAAIsP,EAEjD,IAAIO,EAAQ,IAAIZ,YAAY,wBAAyB,CAACC,OAAQI,IAC9D/P,SAASyP,cAAca,EACzB,CACF,GAAG,IA9CsD,CA+C3D,IAGAtQ,SAAS4P,iBAAiB,yBAAyB,SAACE,GAClD,IAAIS,EAAQvQ,SAASC,cAAc,wDACnC,GAAIsQ,EAAO,CACT,IACIrG,EADgBqG,EAAMvG,cACKA,cAEhBE,EAAWgB,iBAAiB,WAClC1H,SAAQ,SAACzD,GAChBmK,EAAWvB,YAAY5I,EACzB,GACF,CACF,GACF,CAGO,SAASyQ,EAAU1B,GACxBtK,IACAzD,IACA2B,IACAmM,EAAoBC,GACpBe,IACAjM,IACA6K,GACF,C","sources":["webpack://assemble/./apps/common/wix-utils/index.js"],"sourcesContent":["import get from 'lodash/get';\nimport isEqual from 'lodash/isEqual';\nimport * as utils from './Utils';\n\nfunction extractViewerModel() {\n let el = document.querySelector(\"#wix-viewer-model\");\n if (!el) return;\n\n let innerText = el.innerText;\n let payload = {};\n try {\n payload = JSON.parse(innerText);\n } catch(e) {\n return;\n }\n\n return payload;\n}\n\nfunction isWixStore() {\n if (window.OnVoardData['is_wix_store']) return true;\n\n let payload = extractViewerModel();\n if (payload) {\n let payloadRoutes = get(payload, 'siteFeaturesConfigs.router.routes') || {};\n if (payloadRoutes['./checkout']) {\n window.OnVoardData['is_wix_store'] = true;\n return true;\n }\n }\n\n return false;\n}\n\nexport function getCurrency() {\n const urlParams = new URLSearchParams(window.location.search);\n let currency = urlParams.get('currency');\n return currency;\n}\n\n\nexport function initPageType(identifier='') {\n let pageId = wixEmbedsAPI.getCurrentPageInfo().id;\n\n if (identifier) {\n if (identifier === 'product_page') {\n window.OnVoardData['page_type'] = 'product';\n return;\n }\n\n if (identifier === 'shopping_cart') {\n window.OnVoardData['page_type'] = 'cart';\n return;\n }\n\n if (identifier === 'checkout') {\n window.OnVoardData['page_type'] = 'checkout';\n return;\n }\n }\n\n let currentUrl = location.protocol + '//' + location.host;\n if (location.pathname && location.pathname !== '/') currentUrl += location.pathname;\n\n if (wixEmbedsAPI.getExternalBaseUrl() === currentUrl) {\n window.OnVoardData['page_type'] = 'home';\n return;\n }\n\n let paths = location.pathname.split(\"/\");\n if (document.querySelector(\"[data-hook='product-page']\")) {\n window.OnVoardData['page_type'] = 'product';\n return;\n }\n\n if (document.querySelector(`#SITE_PAGES #${pageId} [data-hook='CartAppDataHook.root']`)) {\n window.OnVoardData['page_type'] = 'cart';\n return;\n }\n\n if (document.querySelector(`#SITE_PAGES #${pageId} [data-hook='ThankYouPageAppDataHook.root']`)) {\n window.OnVoardData['page_type'] = 'thank-you';\n return;\n }\n\n if (document.querySelector(`#SITE_PAGES #${pageId} [data-hook='product-list']`)) {\n window.OnVoardData['page_type'] = 'collection';\n return;\n }\n\n if (paths.length > 0 && paths.slice(-1)[0] === 'checkout') {\n window.OnVoardData['page_type'] = 'checkout';\n return;\n }\n}\n\nexport function getCheckoutUrl() {\n let cart = window.OnVoardData.cart;\n if (!cart || !cart.cartId) return;\n\n let params = {\n \"a11y\": true,\n \"cartId\": cart.cartId,\n \"storeUrl\": wixEmbedsAPI.getExternalBaseUrl(),\n \"isFastFlow\": false,\n \"isPickupFlow\": false,\n \"cashierPaymentId\": \"\",\n \"origin\": \"shopping cart\",\n \"originType\": \"addToCart\"\n };\n\n let appSectionParams = encodeURIComponent(JSON.stringify(params));\n return `/checkout?appSectionParams=${appSectionParams}`;\n}\n\nexport function updateCheckoutRoute() {\n let checkoutUrl = getCheckoutUrl();\n if (!checkoutUrl) return;\n if (!window.OnVoardData['routes']) return;\n window.OnVoardData['routes']['checkout'] = checkoutUrl;\n}\n\nexport function initRoutes() {\n let routes = window.OnVoardData.routes || {};\n routes['cart'] = '/cart';\n\n let payload = extractViewerModel();\n if (payload) {\n let payloadRoutes = get(payload, 'siteFeaturesConfigs.router.routes') || {};\n\n // cartUrl\n let cartUrl = '';\n if (payloadRoutes['./cart']) cartUrl = '/cart';\n if (!cartUrl && payloadRoutes['./cart-page']) cartUrl = '/cart-page';\n if (!cartUrl && payloadRoutes['./shopping-cart']) cartUrl = '/shopping-cart';\n\n // find route with \"cart\"\n if (!cartUrl) {\n utils.loopObject(payloadRoutes, (key, value) => {\n if (cartUrl) return;\n if (key.includes(\"cart\")) cartUrl = key.slice(1);\n })\n }\n\n if (cartUrl) routes['cart'] = cartUrl;\n }\n\n let checkoutUrl = getCheckoutUrl();\n if (checkoutUrl) routes['checkout'] = checkoutUrl;\n\n window.OnVoardData['routes'] = routes;\n}\n\n// only works for initial pageload\nexport function initProductData() {\n if (window.OnVoardData['page_type'] !== \"product\") return;\n let el = document.querySelector(\"#wix-warmup-data\");\n if (!el) return;\n\n let innerText = el.innerText;\n let payload = {};\n try {\n payload = JSON.parse(innerText);\n } catch(e) {\n return;\n }\n\n if (!payload) return;\n let appsWarmupData = payload.appsWarmupData;\n if (!appsWarmupData) return;\n\n let storeData = appsWarmupData['1380b703-ce81-ff05-f115-39571d94dfcd'];\n if (!storeData) return;\n\n let productPage = null;\n Object.keys(storeData).forEach((key) => {\n if (key.startsWith(\"productPage\")) {\n productPage = storeData[key];\n }\n });\n\n if (!productPage) return;\n window.OnVoardData['product'] = productPage['catalog']['product'];\n}\n\nexport function getMemberApiParameters() {\n let payload = extractViewerModel();\n if (!payload) return;\n\n let smToken = get(payload, 'siteFeaturesConfigs.siteMembers.smToken', '');\n\n let params = {};\n params['smToken'] = smToken;\n params['collectionId'] = get(payload, 'siteFeaturesConfigs.siteMembers.smcollectionId', '');\n params['metaSiteId'] = get(payload, 'site.metaSiteId', '');\n return params;\n}\n\nexport function fetchMemberData(callback) {\n let params = getMemberApiParameters();\n\n if (!params) return;\n if (!params['smToken'] || !params['collectionId']) return;\n\n let smToken = params['smToken'];\n let collectionId = params['collectionId'];\n let metaSiteId = params['metaSiteId'];\n\n let path = `/_api/wix-sm-webapp/member/${smToken}?collectionId=${collectionId}&metaSiteId=${metaSiteId}`;\n fetch(wixEmbedsAPI.getExternalBaseUrl() + path, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n .then(res => res.json())\n .then(json => {\n const memberData = json.payload;\n if (!memberData) return;\n window.OnVoardData['member'] = memberData;\n if (callback) callback();\n });\n}\n\nexport function loadAccessTokens(callback) {\n const successCallback = (response) => {\n window.OnVoardData['authorization'] = response.auth;\n if (callback) callback();\n };\n\n const errorCallback = (err) => {\n console.error(err);\n };\n\n let data = {};\n data['base_url'] = wixEmbedsAPI.getExternalBaseUrl();\n\n utils.postRq({\n \"url\": utils.buildUrl(`wix-credentials`),\n \"successCallback\": successCallback,\n \"errorCallback\": errorCallback,\n \"data\": data\n });\n}\n\nexport function getCartAuthorization() {\n if (!window.OnVoardData['authorization']) {\n return;\n }\n\n return window.OnVoardData['authorization'];\n}\n\nfunction waitUntilCartAuthorizationReady(callback) {\n let interval = 0;\n let authorization = null;\n let handle = window.setInterval(() => {\n if (interval > 1000*15) {\n clearInterval(handle);\n return;\n }\n\n authorization = getCartAuthorization();\n if (authorization) {\n clearInterval(handle);\n callback();\n return;\n }\n\n interval += 200;\n }, 200);\n}\n\nexport function fetchProductData(params) {\n if (!isWixStore()) return;\n\n let callback = params['callback'];\n let currency = params['currency'];\n\n // get product slug\n let paths = decodeURI(window.location.pathname).split(\"/\");\n let slug = paths.slice(-1)[0];\n if (!slug) return;\n\n let xsfrToken = utils.getCookie('XSRF-TOKEN');\n if (!xsfrToken) return;\n\n waitUntilCartAuthorizationReady(() => {\n let authorization = getCartAuthorization();\n if (!authorization) return;\n\n let path = wixEmbedsAPI.getExternalBaseUrl() + `/_api/wix-ecommerce-storefront-web/api?o=getProductBySlug&s=WixStoresWebClient&q=query,getProductBySlug($externalId:String!,$slug:String!,$withPriceRange:Boolean,=,false){appSettings(externalId:$externalId){widgetSettings}catalog{product(slug:$slug,onlyVisible:true){id,description,isVisible,sku,ribbon,brand,price,comparePrice,discountedPrice,formattedPrice,formattedComparePrice,formattedDiscountedPrice,pricePerUnit,formattedPricePerUnit,pricePerUnitData{baseQuantity,baseMeasurementUnit}seoTitle,seoDescription,createVersion,digitalProductFileItems{fileId,fileType,fileName}productItems(withDefaultVariant:true){id,price,comparePrice,formattedPrice,formattedComparePrice,pricePerUnit,formattedPricePerUnit,optionsSelections,isVisible,availableForPreOrder,inventory{status,quantity}sku,weight,surcharge,subscriptionPlans{list{id,price,formattedPrice,pricePerUnit,formattedPricePerUnit}}}name,isTrackingInventory,inventory{status,quantity,availableForPreOrder,preOrderInfoView{message,preOrder,limit}}isVisible,isManageProductItems,productItemsPreOrderAvailability,isInStock,media{id,url,fullUrl,altText,thumbnailFullUrl:fullUrl(width:50,height:50),mediaType,videoType,videoFiles{url,width,height,format,quality}width,height,index,title}customTextFields{key,title,isMandatory,inputLimit}nextOptionsSelectionId,options{id,title,optionType,key,selections{id,value,description,key,linkedMediaItems{altText,url,fullUrl,thumbnailFullUrl:fullUrl(width:50,height:50),mediaType,width,height,index,title,videoFiles{url,width,height,format,quality}}}}productType,urlPart,additionalInfo{id,title,description,index}subscriptionPlans{list(onlyVisible:true){id,name,tagline,frequency,interval,duration,price,formattedPrice,pricePerUnit,formattedPricePerUnit}oneTimePurchase{index}}priceRange(withSubscriptionPriceRange:true),@include(if:$withPriceRange){fromPriceFormatted}discount{mode,value}currency,weight,seoJson}}}&v=`;\n\n let v = {\"slug\":slug,\"externalId\":\"\",\"withPriceRange\":false};\n path += encodeURIComponent(JSON.stringify(v));\n\n let headers = {};\n headers['Content-Type'] = 'application/json';\n headers['Authorization'] = authorization;\n headers['X-XSRF-TOKEN'] = xsfrToken;\n if (currency) headers['x-wix-currency'] = currency;\n\n fetch(path, {\n method: 'GET',\n headers: headers,\n })\n .then(res => res.json())\n .then(json => {\n const productData = get(json, 'data.catalog.product', {}) || {};\n window.OnVoardData['product'] = productData;\n callback();\n });\n });\n}\n\nexport function fetchProductBySlug(params) {\n if (!isWixStore()) return;\n\n let slug = params['slug'];\n let callback = params['callback'];\n let currency = params['currency'];\n\n let xsfrToken = utils.getCookie('XSRF-TOKEN');\n if (!xsfrToken) return;\n\n waitUntilCartAuthorizationReady(() => {\n let authorization = getCartAuthorization();\n if (!authorization) return;\n\n let path = wixEmbedsAPI.getExternalBaseUrl() + `/_api/wix-ecommerce-storefront-web/api?o=getProductBySlug&s=WixStoresWebClient&q=query,getProductBySlug($externalId:String!,$slug:String!,$withPriceRange:Boolean,=,false){appSettings(externalId:$externalId){widgetSettings}catalog{product(slug:$slug,onlyVisible:true){id,description,isVisible,sku,ribbon,brand,price,comparePrice,discountedPrice,formattedPrice,formattedComparePrice,formattedDiscountedPrice,pricePerUnit,formattedPricePerUnit,pricePerUnitData{baseQuantity,baseMeasurementUnit}seoTitle,seoDescription,createVersion,digitalProductFileItems{fileId,fileType,fileName}productItems(withDefaultVariant:true){id,price,comparePrice,formattedPrice,formattedComparePrice,pricePerUnit,formattedPricePerUnit,optionsSelections,isVisible,inventory{status,quantity}sku,weight,surcharge,subscriptionPlans{list{id,price,formattedPrice,pricePerUnit,formattedPricePerUnit}}}name,isTrackingInventory,inventory{status,quantity}isVisible,isManageProductItems,isInStock,media{id,url,fullUrl,altText,thumbnailFullUrl:fullUrl(width:50,height:50),mediaType,videoType,videoFiles{url,width,height,format,quality}width,height,index,title}customTextFields{key,title,isMandatory,inputLimit}nextOptionsSelectionId,options{id,title,optionType,key,selections{id,value,description,key,linkedMediaItems{altText,url,fullUrl,thumbnailFullUrl:fullUrl(width:50,height:50),mediaType,width,height,index,title,videoFiles{url,width,height,format,quality}}}}productType,urlPart,additionalInfo{id,title,description,index}subscriptionPlans{list(onlyVisible:true){id,name,tagline,frequency,duration,price,formattedPrice,pricePerUnit,formattedPricePerUnit}oneTimePurchase{index}}priceRange(withSubscriptionPriceRange:true),@include(if:$withPriceRange){fromPriceFormatted}discount{mode,value}currency,weight,seoJson}}}&v=`;\n\n let v = {\"slug\":slug,\"externalId\":\"\",\"withPriceRange\":false};\n path += encodeURIComponent(JSON.stringify(v));\n\n let headers = {};\n headers['Content-Type'] = 'application/json';\n headers['Authorization'] = authorization;\n headers['X-XSRF-TOKEN'] = xsfrToken;\n if (currency) headers['x-wix-currency'] = currency;\n\n fetch(path, {\n method: 'GET',\n headers: headers,\n })\n .then(res => res.json())\n .then(json => {\n const productData = get(json, 'data.catalog.product', {}) || {};\n callback(productData);\n });\n });\n}\n\n\nexport function fetchProductById(params) {\n if (!isWixStore()) return;\n\n let productId = params['productId'];\n let callback = params['callback'];\n let currency = params['currency'];\n\n let xsfrToken = utils.getCookie('XSRF-TOKEN');\n if (!xsfrToken) return;\n\n waitUntilCartAuthorizationReady(() => {\n let authorization = getCartAuthorization();\n if (!authorization) return;\n\n let query = `query getData(\n $externalId: String!\n $productId: String!\n ) {\n appSettings(externalId: $externalId) {\n widgetSettings\n }\n catalog {\n product(productId: $productId) {\n id\n description\n isVisible\n sku\n ribbon\n brand\n price\n comparePrice\n discountedPrice\n formattedPrice\n formattedComparePrice\n formattedDiscountedPrice\n pricePerUnit\n formattedPricePerUnit\n digitalProductFileItems {\n fileId\n fileType\n fileName\n }\n productItems(withDefaultVariant: true) {\n id\n price\n comparePrice\n formattedPrice\n formattedComparePrice\n pricePerUnit\n formattedPricePerUnit\n optionsSelections\n isVisible\n inventory {\n status\n quantity\n }\n sku\n weight\n surcharge\n }\n name\n isTrackingInventory\n inventory {\n status\n quantity\n }\n isVisible\n isManageProductItems\n isInStock\n media {\n id\n url\n fullUrl\n altText\n thumbnailFullUrl: fullUrl(width: 50, height: 50)\n width\n height\n index\n title\n }\n options {\n id\n title\n optionType\n key\n }\n productType\n urlPart\n }\n }\n }\n `;\n\n let headers = {};\n headers['Content-Type'] = 'application/json';\n headers['Authorization'] = authorization;\n headers['X-XSRF-TOKEN'] = xsfrToken;\n if (currency) headers['x-wix-currency'] = currency;\n\n fetch(wixEmbedsAPI.getExternalBaseUrl() + '/_api/wix-ecommerce-graphql-web/api', {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({\n operationName: \"getData\",\n query: query,\n source: \"WixStoresWebClient\",\n variables: {\"externalId\":\"\",\"productId\": productId},\n }),\n })\n .then(res => res.json())\n .then(json => {\n const productData = get(json, 'data.catalog.product', {}) || {};\n callback(productData);\n });\n });\n}\n\nexport function fetchCartData(params) {\n if (!isWixStore()) return;\n\n let callback = params['callback'];\n let currency = params['currency'];\n\n let xsfrToken = utils.getCookie('XSRF-TOKEN');\n if (!xsfrToken) return;\n\n waitUntilCartAuthorizationReady(() => {\n let authorization = getCartAuthorization();\n if (!authorization) return;\n\n let query = `\n query getCart($locale: String!, $withTax: Boolean, $withShipping: Boolean) {\n cart {\n cartId\n storeId\n buyerNote\n items {\n cartItemId\n product {\n id\n productType\n urlPart\n weight\n name\n price\n comparePrice\n customTextFields {\n title\n value\n }\n media(limit: 1) {\n altText\n mediaType\n url\n height\n width\n }\n digitalProductFileItems {\n fileType\n }\n }\n optionsSelectionsValues {\n id\n title\n value\n }\n freeText {\n title\n value\n }\n sku\n quantity\n inventoryQuantity\n convertedPrices {\n formattedComparePrice\n formattedPrice\n formattedTotalPrice\n totalPrice\n formattedPriceBeforeDiscount\n price\n }\n formattedPriceBeforeDiscount\n discountRules {\n name\n }\n }\n appliedCoupon {\n discountValue\n convertedDiscountValue\n code\n couponId\n couponType\n name\n }\n currencyFormat {\n code\n }\n convertedCurrencyFormat {\n code\n }\n additionalFees {\n code\n name\n totalPrice\n formattedTotalPrice\n convertedFormattedTotalPrice\n }\n totals(withTax: $withTax, withShipping: $withShipping) {\n subTotal\n total\n shipping\n discount\n itemsTotal\n tax\n additionalFeesTotal\n formattedItemsTotal\n formattedSubTotal\n formattedShipping\n formattedDiscount\n formattedTax\n formattedAdditionalFeesTotal\n formattedTotal\n }\n convertedTotals(withTax: $withTax, withShipping: $withShipping) {\n subTotal\n total\n shipping\n discount\n itemsTotal\n tax\n additionalFeesTotal\n formattedItemsTotal\n formattedSubTotal\n formattedShipping\n formattedDiscount\n formattedTax\n formattedAdditionalFeesTotal\n formattedTotal\n }\n destination {\n country\n countryName(translateTo: $locale)\n subdivision\n subdivisionName(translateTo: $locale)\n zipCode\n }\n selectedShippingOption {\n id\n }\n shippingRuleInfo {\n status\n canShipToDestination\n shippingRule {\n id\n options {\n id\n title\n rate: convertedRate\n formattedRate: convertedFormattedRate\n deliveryTime\n pickupInfo {\n address {\n countryName(translateTo: $locale)\n subdivisionName(translateTo: $locale)\n addressLine\n city\n }\n pickupMethod\n }\n }\n }\n }\n destinationCompleteness\n minimumOrderAmount {\n reached\n diff\n value\n convertedDiff\n convertedValue\n formattedConvertedDiff\n formattedConvertedValue\n }\n }\n }\n `;\n\n let headers = {};\n headers['Content-Type'] = 'application/json';\n headers['Authorization'] = authorization;\n headers['X-XSRF-TOKEN'] = xsfrToken;\n if (currency) headers['x-wix-currency'] = currency;\n\n fetch(wixEmbedsAPI.getExternalBaseUrl() + '/_api/wixstores-graphql-server/graphql', {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({\n operationName: \"getCart\",\n query: query,\n source: \"Init\",\n variables: {locale: \"en\", withShipping: false, withTax: false},\n }),\n })\n .then(res => res.json())\n .then(json => {\n const cartData = get(json, 'data.cart', {}) || {};\n window.OnVoardData['cart'] = cartData;\n updateCheckoutRoute();\n callback(cartData);\n });\n });\n}\n\nexport function addCartItem(param, successCallback, errorCallback) {\n if (!isWixStore()) return;\n\n let xsfrToken = utils.getCookie('XSRF-TOKEN');\n if (!xsfrToken) return;\n\n waitUntilCartAuthorizationReady(() => {\n let authorization = getCartAuthorization();\n if (!authorization) return;\n\n let query = `mutation addToCart($params: [AddToCartInput!]) {\n cart {\n addToCart(params: $params) {\n\n errors {\n code\n commandName\n message\n field\n }\n cart {\n cartId\n storeId\n buyerNote\n items {\n cartItemId\n convertedFormattedComparePrice\n convertedFormattedPrice\n convertedFormattedTotalPrice\n convertedPrices {\n comparePrice\n formattedComparePrice\n formattedPrice\n formattedTotalPrice\n price\n totalPrice\n }\n product {\n comparePrice\n convertedComparePrice\n convertedPrice\n customTextFields {\n title\n value\n }\n id\n productType\n urlPart\n name\n pageUrl\n price\n sku\n weight\n media(limit: 1) {\n altText\n mediaType\n url\n height\n width\n }\n digitalProductFileItems {\n fileType\n }\n }\n optionsSelectionsValues {\n id\n title\n value\n }\n convertedTotalPrice\n sku\n quantity\n inventoryQuantity\n formattedComparePrice\n formattedPrice\n formattedTotalPrice\n totalPrice\n }\n }\n }\n }\n }`;\n\n fetch(wixEmbedsAPI.getExternalBaseUrl() + '/_api/wixstores-graphql-server/graphql', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': authorization,\n 'X-XSRF-TOKEN': xsfrToken\n },\n body: JSON.stringify({\n operationName: \"addToCart\",\n query: query,\n source: \"WixStoresWebClient\",\n variables: {\n \"params\": [param]\n },\n }),\n })\n .then(res => res.json())\n .then(json => {\n successCallback(json);\n })\n .catch((error) => {\n errorCallback(error);\n });\n });\n}\n\nfunction htmlDecode(input) {\n var doc = new DOMParser().parseFromString(input, \"text/html\");\n return doc.documentElement.textContent;\n}\n\nfunction decodeAppScripts(input) {\n let output = null;\n\n try {\n let decodedValue = htmlDecode(input).replaceAll(`\\\\`, ``);\n output = JSON.parse(decodedValue);\n } catch (error) {\n console.error(error);\n }\n\n return output;\n}\n\nfunction shouldReplaceAppScripts(curAppScripts, newAppScripts) {\n if (!curAppScripts || !curAppScripts.ts) return true;\n if (curAppScripts.ts && newAppScripts.ts) {\n if (newAppScripts.ts > curAppScripts.ts) return true;\n }\n\n return false;\n}\n\nfunction mergeAppScripts(curAppScripts, newAppScripts) {\n utils.loopObject(newAppScripts, (key, value) => {\n if (key in curAppScripts) return;\n curAppScripts[key] = value;\n })\n\n return curAppScripts;\n}\n\nfunction getAppScripts() {\n let appScripts = {};\n\n if (window.OnVoardData[\"app_scripts\"]) {\n appScripts = decodeAppScripts(window.OnVoardData[\"app_scripts\"]);\n }\n\n if (window.OV_MARKETING_PLATFORM_APP_SCRIPTS) {\n let mpScripts = decodeAppScripts(window.OV_MARKETING_PLATFORM_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, mpScripts);\n }\n\n if (window.OV_AOV_PROGRESS_BAR_APP_SCRIPTS) {\n let aovProgressBarScripts = decodeAppScripts(window.OV_AOV_PROGRESS_BAR_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, aovProgressBarScripts);\n }\n\n if (window.OV_BACK_IN_STOCK_APP_SCRIPTS) {\n let backInStockScripts = decodeAppScripts(window.OV_BACK_IN_STOCK_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, backInStockScripts);\n }\n\n if (window.OV_REVIEWS_APP_SCRIPTS) {\n let reviewsScripts = decodeAppScripts(window.OV_REVIEWS_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, reviewsScripts);\n }\n\n if (window.OV_PROMPT_APP_SCRIPTS) {\n let promptScripts = decodeAppScripts(window.OV_PROMPT_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, promptScripts);\n }\n\n if (window.OV_RECOMMENDER_APP_SCRIPTS) {\n let recommenderScripts = decodeAppScripts(window.OV_RECOMMENDER_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, recommenderScripts);\n }\n\n if (window.OV_REPERKS_APP_SCRIPTS) {\n let reperksScripts = decodeAppScripts(window.OV_REPERKS_APP_SCRIPTS);\n appScripts = mergeAppScripts(appScripts, reperksScripts);\n }\n\n return appScripts;\n}\n\nexport function provisionAppScripts() {\n let appScripts = getAppScripts();\n if (!appScripts) return;\n let pageId = wixEmbedsAPI.getCurrentPageInfo().id;\n\n // webtracking\n let wt = appScripts.web_tracking;\n if (wt && wt.token) {\n let ovWtDiv = document.querySelector('.ov-app-web-tracking');\n if (!ovWtDiv) {\n ovWtDiv = document.createElement(\"div\");\n ovWtDiv.setAttribute(\"class\", \"ov-app ov-app-web-tracking\");\n ovWtDiv.setAttribute(\"data-app\", \"web-tracking\");\n ovWtDiv.setAttribute(\"data-token\", wt.token);\n document.body.appendChild(ovWtDiv);\n }\n\n if (wt.auto_track) {\n ovWtDiv = document.querySelector('.ov-app-web-tracking-wix');\n if (!ovWtDiv) {\n ovWtDiv = document.createElement(\"div\");\n ovWtDiv.setAttribute(\"class\", \"ov-app ov-app-web-tracking-wix\");\n ovWtDiv.setAttribute(\"data-app\", \"web-tracking-wix\");\n document.body.appendChild(ovWtDiv);\n }\n\n OnVoard(\"web_tracking_wix\", \"identify\", window.OnVoardData);\n\n if (wt.track_checkout_started) {\n OnVoard(\"web_tracking_wix\", \"trackCheckoutStarted\", window.OnVoardData);\n }\n\n if (wt.track_product_viewed) {\n OnVoard(\"web_tracking_wix\", \"trackProductViewed\", window.OnVoardData);\n }\n\n if (wt.track_cart_item_added) {\n OnVoard(\"web_tracking_wix\", \"trackCartItemAdded\", window.OnVoardData);\n }\n }\n }\n\n // prompt\n let prompt = appScripts.prompt;\n if (prompt && prompt.footer) {\n let promptEl = document.querySelector('.ov-app-prompt');\n if (!promptEl) {\n promptEl = document.createElement(\"div\");\n promptEl.setAttribute(\"class\", \"ov-app ov-app-prompt\");\n promptEl.setAttribute(\"data-app\", \"prompt\");\n promptEl.setAttribute(\"data-account-id\", prompt.footer.account_id);\n document.body.appendChild(promptEl);\n }\n }\n\n // reperks widget\n let reperksWidget = appScripts.reperks_widget;\n if (reperksWidget && reperksWidget.global) {\n let reperksWidgetEl = document.querySelector('.ov-app-reperks-widget');\n if (!reperksWidgetEl) {\n reperksWidgetEl = document.createElement(\"div\");\n reperksWidgetEl.setAttribute(\"class\", \"ov-app ov-app-reperks-widget\");\n reperksWidgetEl.setAttribute(\"data-app\", \"reperks-widget\");\n reperksWidgetEl.setAttribute(\"data-app-id\", reperksWidget.global.id);\n document.body.appendChild(reperksWidgetEl);\n }\n }\n\n // aov progress bar\n let aov = appScripts.aov_progress_bar;\n let aovEl = null;\n\n if (aov) {\n aov.product_button.forEach((row) => {\n aovEl = document.querySelector(`ov-app-aov-progress-bar[data-app-id=\"${row.id}\"]`);\n if (aovEl) return;\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n let btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='buy-now-button']\");\n if (!btnEl) {\n btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='add-to-cart']\");\n }\n\n if (!btnEl) return;\n let referenceNode = btnEl.parentElement;\n\n aovEl = document.createElement(\"div\");\n aovEl.setAttribute(\"class\", \"ov-app ov-app-aov-progress-bar\");\n aovEl.setAttribute(\"data-app\", \"aov-progress-bar\");\n aovEl.setAttribute(\"data-app-id\", row.id);\n aovEl.setAttribute(\"data-placement-mode\", row.placement);\n referenceNode.parentNode.insertBefore(aovEl, referenceNode.nextSibling);\n })\n\n aov.product_bottom.forEach((row) => {\n aovEl = document.querySelector(`ov-app-aov-progress-bar[data-app-id=\"${row.id}\"]`);\n if (aovEl) return;\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n aovEl = document.createElement(\"div\");\n aovEl.setAttribute(\"class\", \"ov-app ov-app-aov-progress-bar\");\n aovEl.setAttribute(\"data-app\", \"aov-progress-bar\");\n aovEl.setAttribute(\"data-app-id\", row.id);\n aovEl.setAttribute(\"data-placement-mode\", row.placement);\n document.body.appendChild(aovEl);\n })\n }\n\n // reviews widget\n let rw = appScripts.reviews_widget;\n let rwEl = null;\n\n if (rw) {\n rw.product_bottom.forEach((row) => {\n rwEl = document.querySelector(`ov-app-reviews-widget[data-app-id=\"${row.id}\"]`);\n if (rwEl) return;\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n let productEl = document.querySelector(\"[data-hook='product-page']\");\n if (!productEl) return;\n\n rwEl = document.createElement(\"div\");\n rwEl.setAttribute(\"class\", \"ov-app ov-app-reviews-widget\");\n rwEl.setAttribute(\"data-app\", \"reviews-widget\");\n rwEl.setAttribute(\"data-app-id\", row.id);\n rwEl.setAttribute(\"data-product-external-id\", window.OnVoardData.product.id);\n rwEl.setAttribute(\"data-placement-mode\", row.placement);\n productEl.appendChild(rwEl);\n })\n }\n\n\n // star rating\n let sr = appScripts.star_rating;\n let srEl = null;\n\n if (sr) {\n sr.product_title.forEach((row) => {\n srEl = document.querySelector(`ov-app-star-rating[data-app-id=\"${row.id}\"]`);\n if (srEl) return;\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n let titleEl = document.querySelector(\"[data-hook='product-page'] [data-hook='product-title']\");\n if (!titleEl) return;\n let referenceNode = titleEl.parentElement;\n\n srEl = document.createElement(\"div\");\n srEl.setAttribute(\"class\", \"ov-app ov-app-star-rating\");\n srEl.setAttribute(\"data-app\", \"star-rating\");\n srEl.setAttribute(\"data-app-id\", row.id);\n srEl.setAttribute(\"data-product-external-id\", window.OnVoardData.product.id);\n srEl.setAttribute(\"data-placement-mode\", row.placement);\n referenceNode.parentNode.insertBefore(srEl, referenceNode.nextSibling);\n })\n\n sr.product_bottom.forEach((row) => {\n srEl = document.querySelector(`ov-app-star-rating[data-app-id=\"${row.id}\"]`);\n if (srEl) return;\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n srEl = document.createElement(\"div\");\n srEl.setAttribute(\"class\", \"ov-app ov-app-star-rating\");\n srEl.setAttribute(\"data-app\", \"star-rating\");\n srEl.setAttribute(\"data-app-id\", row.id);\n srEl.setAttribute(\"data-product-external-id\", window.OnVoardData.product.id);\n srEl.setAttribute(\"data-placement-mode\", row.placement);\n document.body.appendChild(srEl);\n })\n\n let attachStarRatingToProduct = (productsMapper, row) => {\n if (!productsMapper) return;\n\n let nodeList = document.querySelectorAll(`#SITE_PAGES #${pageId} [data-hook='product-list'] [data-hook='product-list-grid-item']`);\n nodeList.forEach((el) => {\n const ahrefEl = el.querySelector(`a[data-hook='product-item-container']`);\n if (!ahrefEl) return;\n\n let href = ahrefEl.getAttribute('href');\n let paths = href.split(\"/\");\n let slug = paths.slice(-1)[0];\n if (!slug) return;\n\n let product = productsMapper[slug];\n if (!product) return;\n\n const titleEl = el.querySelector(`[data-hook='product-item-name']`);\n if (!titleEl) return;\n\n // exclude duplicates\n srEl = el.querySelector(`.ov-app-star-rating`);\n if (srEl) return;\n\n srEl = document.createElement(\"div\");\n srEl.setAttribute(\"class\", \"ov-app ov-app-star-rating\");\n srEl.setAttribute(\"data-app\", \"star-rating\");\n srEl.setAttribute(\"data-app-id\", row.id);\n srEl.setAttribute(\"data-product-external-id\", product.id);\n srEl.setAttribute(\"data-placement-mode\", row.placement);\n titleEl.parentNode.insertBefore(srEl, titleEl.nextSibling);\n })\n };\n\n if (sr.collection_product) {\n sr.collection_product.forEach((row) => {\n attachStarRatingToProduct(window.OnVoardData['collection_products'], row);\n });\n }\n\n if (sr.home_product) {\n sr.home_product.forEach((row) => {\n attachStarRatingToProduct(window.OnVoardData['home_products'], row);\n });\n }\n }\n\n // back-in-stock\n let bis = appScripts.back_in_stock;\n let bisEl = null;\n\n if (bis) {\n let bisFloatingBtn = bis.floating_button;\n let bisInlineBtn = bis.inline_button;\n let bisInlineText = bis.inline_text;\n let bisInlineForm = bis.inline_form;\n\n if (bis.global) {\n bisEl = document.querySelector('.ov-app-back-in-stock');\n if (!bisEl) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock\");\n bisEl.setAttribute(\"data-app-id\", bis.global.id);\n document.body.appendChild(bisEl);\n }\n }\n\n if (bisFloatingBtn && bisFloatingBtn.product_bottom) {\n bisEl = document.querySelector('.ov-app-back-in-stock-floating-button');\n if (!bisEl) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-floating-button\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-floating-button\");\n bisEl.setAttribute(\"data-app-id\", bisFloatingBtn.product_bottom.id);\n bisEl.setAttribute(\"data-placement-mode\", bisFloatingBtn.product_bottom.placement);\n document.body.appendChild(bisEl);\n }\n }\n\n if (bisInlineBtn) {\n if (bisInlineBtn.product_button) {\n bisEl = document.querySelector('.ov-app-back-in-stock-inline-button');\n if (!bisEl) {\n let referenceNode = null;\n let btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='buy-now-button']\");\n if (!btnEl) btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='add-to-cart']\");\n if (btnEl) referenceNode = btnEl.parentElement;\n\n if (!referenceNode) referenceNode = document.querySelector(\"[data-hook='product-page'] [data-hook='product-options']\");\n if (referenceNode) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-inline-button\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-inline-button\");\n bisEl.setAttribute(\"data-app-id\", bisInlineBtn.product_button.id);\n bisEl.setAttribute(\"data-placement-mode\", bisInlineBtn.product_button.placement);\n referenceNode.parentNode.insertBefore(bisEl, referenceNode.nextSibling);\n }\n }\n }\n\n if (bisInlineBtn.product_bottom) {\n bisEl = document.querySelector('.ov-app-back-in-stock-inline-button');\n if (!bisEl) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-inline-button\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-inline-button\");\n bisEl.setAttribute(\"data-app-id\", bisInlineBtn.product_bottom.id);\n bisEl.setAttribute(\"data-placement-mode\", bisInlineBtn.product_bottom.placement);\n document.body.appendChild(bisEl);\n }\n }\n }\n\n if (bisInlineText) {\n if (bisInlineText.product_button) {\n bisEl = document.querySelector('.ov-app-back-in-stock-inline-text');\n if (!bisEl) {\n let referenceNode = null;\n let btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='buy-now-button']\");\n if (!btnEl) btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='add-to-cart']\");\n if (btnEl) referenceNode = btnEl.parentElement;\n\n if (!referenceNode) referenceNode = document.querySelector(\"[data-hook='product-page'] [data-hook='product-options']\");\n if (referenceNode) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-inline-text\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-inline-text\");\n bisEl.setAttribute(\"data-app-id\", bisInlineText.product_button.id);\n bisEl.setAttribute(\"data-placement-mode\", bisInlineText.product_button.placement);\n referenceNode.parentNode.insertBefore(bisEl, referenceNode.nextSibling);\n }\n }\n }\n\n if (bisInlineText.product_bottom) {\n bisEl = document.querySelector('.ov-app-back-in-stock-inline-text');\n if (!bisEl) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-inline-text\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-inline-text\");\n bisEl.setAttribute(\"data-app-id\", bisInlineText.product_bottom.id);\n bisEl.setAttribute(\"data-placement-mode\", bisInlineText.product_bottom.placement);\n document.body.appendChild(bisEl);\n }\n }\n }\n\n if (bisInlineForm) {\n if (bisInlineForm.product_button) {\n bisEl = document.querySelector('.ov-app-back-in-stock-inline-form');\n if (!bisEl) {\n let referenceNode = null;\n let btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='buy-now-button']\");\n if (!btnEl) btnEl = document.querySelector(\"[data-hook='product-page'] [data-hook='add-to-cart']\");\n if (btnEl) referenceNode = btnEl.parentElement;\n\n if (!referenceNode) referenceNode = document.querySelector(\"[data-hook='product-page'] [data-hook='product-options']\");\n if (referenceNode) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-inline-form\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-inline-form\");\n bisEl.setAttribute(\"data-app-id\", bisInlineForm.product_button.id);\n bisEl.setAttribute(\"data-placement-mode\", bisInlineForm.product_button.placement);\n referenceNode.parentNode.insertBefore(bisEl, referenceNode.nextSibling);\n }\n }\n }\n\n if (bisInlineForm.product_bottom) {\n bisEl = document.querySelector('.ov-app-back-in-stock-inline-form');\n if (!bisEl) {\n bisEl = document.createElement(\"div\");\n bisEl.setAttribute(\"class\", \"ov-app ov-app-back-in-stock-inline-form\");\n bisEl.setAttribute(\"data-app\", \"back-in-stock-inline-form\");\n bisEl.setAttribute(\"data-app-id\", bisInlineForm.product_bottom.id);\n bisEl.setAttribute(\"data-placement-mode\", bisInlineForm.product_bottom.placement);\n document.body.appendChild(bisEl);\n }\n }\n }\n\n }\n\n // recommender\n let recommender = appScripts.recommender;\n let recommenderEl = null;\n\n if (recommender) {\n if (recommender.tracking) {\n recommenderEl = document.querySelector('.ov-app-recommender-tracking');\n if (!recommenderEl) {\n recommenderEl = document.createElement(\"div\");\n recommenderEl.setAttribute(\"class\", \"ov-app ov-app-recommender-tracking\");\n recommenderEl.setAttribute(\"data-app\", \"recommender-tracking\");\n recommenderEl.setAttribute(\"data-account-id\", recommender.tracking.account_id);\n document.body.appendChild(recommenderEl);\n }\n }\n\n recommender.home_bottom.forEach((row) => {\n recommenderEl = document.querySelector(`ov-app-recommender[data-app-id=\"${row.id}\"]`);\n if (recommenderEl) return;\n if (window.OnVoardData['page_type'] !== 'home') return;\n\n let pageEl = document.querySelector(\"#SITE_PAGES\");\n if (!pageEl) return;\n\n recommenderEl = document.createElement(\"div\");\n recommenderEl.setAttribute(\"class\", \"ov-app ov-app-recommender\");\n recommenderEl.setAttribute(\"data-app\", \"recommender\");\n recommenderEl.setAttribute(\"data-app-id\", row.id);\n recommenderEl.setAttribute(\"data-placement-mode\", row.placement);\n pageEl.appendChild(recommenderEl);\n })\n\n recommender.cart_bottom.forEach((row) => {\n recommenderEl = document.querySelector(`ov-app-recommender[data-app-id=\"${row.id}\"]`);\n if (recommenderEl) return;\n if (window.OnVoardData['page_type'] !== 'cart') return;\n\n let cartEl = document.querySelector(\"[data-hook='CartAppDataHook.root']\");\n if (!cartEl) return;\n\n recommenderEl = document.createElement(\"div\");\n recommenderEl.setAttribute(\"class\", \"ov-app ov-app-recommender\");\n recommenderEl.setAttribute(\"data-app\", \"recommender\");\n recommenderEl.setAttribute(\"data-app-id\", row.id);\n recommenderEl.setAttribute(\"data-placement-mode\", row.placement);\n document.body.appendChild(recommenderEl);\n cartEl.appendChild(recommenderEl);\n })\n\n recommender.collection_bottom.forEach((row) => {\n recommenderEl = document.querySelector(`ov-app-recommender[data-app-id=\"${row.id}\"]`);\n if (recommenderEl) return;\n if (window.OnVoardData['page_type'] !== 'collection') return;\n\n let pageEl = document.querySelector(\"#SITE_PAGES\");\n if (!pageEl) return;\n\n recommenderEl = document.createElement(\"div\");\n recommenderEl.setAttribute(\"class\", \"ov-app ov-app-recommender\");\n recommenderEl.setAttribute(\"data-app\", \"recommender\");\n recommenderEl.setAttribute(\"data-app-id\", row.id);\n recommenderEl.setAttribute(\"data-placement-mode\", row.placement);\n pageEl.appendChild(recommenderEl);\n })\n\n recommender.product_bottom.forEach((row) => {\n recommenderEl = document.querySelector(`ov-app-recommender[data-app-id=\"${row.id}\"]`);\n if (recommenderEl) return;\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n let productEl = document.querySelector(\"[data-hook='product-page']\");\n if (!productEl) return;\n\n recommenderEl = document.createElement(\"div\");\n recommenderEl.setAttribute(\"class\", \"ov-app ov-app-recommender\");\n recommenderEl.setAttribute(\"data-app\", \"recommender\");\n recommenderEl.setAttribute(\"data-app-id\", row.id);\n recommenderEl.setAttribute(\"data-placement-mode\", row.placement);\n productEl.appendChild(recommenderEl);\n })\n }\n}\n\nexport function fetchProductsForGrid(params) {\n let callback = params['callback'];\n let pageId = wixEmbedsAPI.getCurrentPageInfo().id;\n let nodeList = document.querySelectorAll(`#SITE_PAGES #${pageId} [data-hook='product-list'] [data-hook='product-list-grid-item']`);\n let mapper = {};\n let numRequests = 0;\n let pageType = window.OnVoardData['page_type'];\n\n nodeList.forEach((el) => {\n const ahrefEl = el.querySelector(`a[data-hook='product-item-container']`);\n if (!ahrefEl) return;\n\n let href = ahrefEl.getAttribute('href');\n let paths = href.split(\"/\");\n let slug = paths.slice(-1)[0];\n if (!slug) return;\n\n let fetchCallback = (productData) => {\n mapper[slug] = productData;\n };\n\n fetchProductBySlug({\n slug: slug,\n callback: fetchCallback,\n });\n\n numRequests += 1;\n })\n\n // wait until requests complete\n let interval = 0;\n let handle = window.setInterval(() => {\n if (interval > 1000*10) {\n clearInterval(handle);\n return;\n }\n\n if (Object.keys(mapper).length >= numRequests) {\n clearInterval(handle);\n\n if (pageType === 'collection') window.OnVoardData['collection_products'] = mapper;\n if (pageType === 'home') window.OnVoardData['home_products'] = mapper;\n callback()\n return;\n }\n\n interval += 100;\n }, 100);\n}\n\nfunction shouldLoadProducts() {\n if (window.OnVoardData['load_collection_products']) return true;\n\n let appScripts = getAppScripts();\n if (appScripts) {\n let sr = appScripts.star_rating;\n if (sr && sr.collection_product && sr.collection_product.length > 0) return true;\n if (sr && sr.home_product && sr.home_product.length > 0) return true;\n }\n\n return false;\n}\n\nexport function onVariantChange(showWidgetsCallback) {\n let product = window.OnVoardData['product'];\n if (!product.isManageProductItems) return;\n\n let selectedChoices = window.OnVoardData['selected_product_choices'];\n if (!selectedChoices) return;\n\n let optionsSelections = [];\n product.options.forEach((option) => {\n option.selections.forEach((selection) => {\n selection['optionKey'] = option.key;\n optionsSelections.push(selection);\n })\n })\n\n product.productItems.forEach((item) => {\n let itemChoices = {}\n item.optionsSelections.forEach((selectionId, idx) => {\n let selection = optionsSelections.filter((row) => row.id === selectionId)[0];\n if (!selection) return;\n itemChoices[selection.optionKey] = selection.key;\n })\n\n if (!isEqual(selectedChoices, itemChoices)) return;\n if (0 >= item.inventory.quantity) {\n showWidgetsCallback(item);\n }\n })\n}\n\n\nexport function refreshBuiltInBackInStock() {\n // hide wix default back-in-stock\n let el = document.querySelector(\"[data-hook='product-page'] [data-hook='BackInStockButton.Root']\");\n if (el) {\n el.style.display = 'none';\n\n let cellEl = el.closest('.cell');\n if (cellEl) {\n cellEl.style.display = 'none';\n }\n\n return;\n }\n\n // has add cart\n el = document.querySelector(\"[data-hook='product-page'] [data-hook='add-to-cart']\");\n if (el) {\n let cellEl = el.closest('.cell');\n if (cellEl) {\n cellEl.style.display = 'flex';\n }\n }\n}\n\n\nfunction pageReset() {\n // remove OnVoard elements\n document.querySelectorAll(\".ov-app\").forEach((el) => el.remove());\n document.querySelectorAll(\".ov-modals\").forEach((el) => el.remove());\n\n window.OnVoardData['page_type'] = null;\n window.OnVoardData['product'] = null;\n window.OnVoardData['collection_products'] = null;\n window.OnVoardData['home_products'] = null;\n window.OnVoardData['selected_product_choices'] = null;\n}\n\nfunction cartReload() {\n if (!isWixStore()) return;\n\n import('common/cart-utils')\n .then((cartUtils) => {\n cartUtils.setupCartUpdateEvent();\n cartUtils.loadCart();\n });\n}\n\n\nexport function registerWixListener(loadScriptsCallback) {\n let refreshCallback = () => {\n provisionAppScripts();\n loadScriptsCallback();\n };\n\n let handlePageView = (data) => {\n let pageTypeIdentifier = data.pageTypeIdentifier;\n initPageType(pageTypeIdentifier);\n\n let pageType = window.OnVoardData['page_type'];\n if (pageType === 'product') {\n fetchProductData({callback: refreshCallback});\n return;\n }\n\n if (shouldLoadProducts()) {\n fetchProductsForGrid({callback: refreshCallback});\n return;\n }\n\n if ([\"cart\", \"checkout\"].includes(pageType)) {\n cartReload();\n }\n\n // load if cart is missing\n if (!window.OnVoardData['cart']) {\n cartReload();\n }\n\n refreshCallback();\n };\n\n\n let registerListener = () => {\n window.wixDevelopersAnalytics.register('552d8274-b6ec-4a52-abd2-ba974b5ed307', (eventName, data) => {\n if ([\"PageView\", \"productPageLoaded\"].includes(eventName)) {\n\n // `PageView` event won't be fired when hyperlinking from product A to product B (used in Recommender)\n // Hence, we are using `productPageLoaded` event to detect loading of product page\n if (eventName === \"PageView\" && data.pageTypeIdentifier === \"product_page\") return;\n if (eventName === \"productPageLoaded\") data.pageTypeIdentifier = \"product_page\";\n\n pageReset();\n handlePageView(data);\n }\n\n if ([\"AddProductImpression\"].includes(eventName)) {\n let pageType = window.OnVoardData['page_type'];\n\n if (shouldLoadProducts()) {\n fetchProductsForGrid({callback: refreshCallback});\n return;\n }\n }\n\n if ([\"AddToCart\", \"RemoveFromCart\"].includes(eventName)) {\n setTimeout(() => {\n cartReload();\n }, 500);\n }\n\n if (eventName === 'Purchase') {\n window.OnVoardData['purchase'] = data;\n }\n\n if (eventName === 'CustomEvent') {\n if (data.eventAction === 'Log in Success') {\n loadAccessTokens(() => {\n fetchMemberData(() => {\n document.dispatchEvent(new CustomEvent(\"ov_wix_login_success\", {detail: data}));\n });\n })\n }\n\n if (data.eventAction === 'Sign up Success') {\n loadAccessTokens(() => {\n fetchMemberData(() => {\n document.dispatchEvent(new CustomEvent(\"ov_wix_signup_success\", {detail: data}));\n });\n })\n }\n }\n })\n };\n\n window.wixDevelopersAnalytics ? registerListener() : window.addEventListener('wixDevelopersAnalyticsReady', registerListener);\n}\n\nexport function registerVariantChangeEvent() {\n document.addEventListener('click', (evt) => {\n let pageType = window.OnVoardData['page_type'];\n if (window.OnVoardData['page_type'] !== 'product') return;\n\n let choices = {};\n setTimeout(() => {\n let initialChoices = window.OnVoardData['selected_product_choices'];\n let nodeList = document.querySelectorAll(\"[data-hook='product-options-inputs'] > .cell\");\n nodeList.forEach((el) => {\n let isDropdown = el.querySelector(\"[data-hook='options-dropdown']\") ? true : false;\n let isColorPicker = el.querySelector(\"[data-hook='color-picker-item']\") ? true : false;\n\n if (!isDropdown && !isColorPicker) return;\n if (isDropdown) {\n let titleEl = el.querySelector(\"[data-hook='options-dropdown-title']\");\n if (!titleEl) return;\n let key = titleEl.innerText;\n\n let selectedEl = el.querySelector(\"[data-hook='dropdown-base-text']\");\n if (!selectedEl) return;\n let value = selectedEl.innerText;\n choices[key] = value;\n }\n\n if (isColorPicker) {\n let titleEl = el.querySelector(\"[data-hook='product-colors-title']\");\n if (!titleEl) return;\n let title = titleEl.innerText.trim();\n let titleGroup = title.split(\":\");\n\n let key = titleGroup.slice(0)[0];\n if (!key) return;\n key = key.trim();\n\n let value = titleGroup.slice(1)[0];\n if (!value) return;\n value = value.trim();\n choices[key] = value;\n }\n })\n\n let changed = !isEqual(initialChoices, choices);\n if (changed) {\n window.OnVoardData['selected_product_choices'] = choices;\n\n let event = new CustomEvent(\"ov_wix_variant_change\", {detail: choices});\n document.dispatchEvent(event);\n }\n }, 100);\n });\n\n // on variant change, re-attach scripts since wix may dynamically inject elements\n document.addEventListener('ov_wix_variant_change', (evt) => {\n let addEl = document.querySelector(\"[data-hook='product-page'] [data-hook='add-to-cart']\");\n if (addEl) {\n let referenceNode = addEl.parentElement;\n let parentNode = referenceNode.parentElement;\n\n let nodeList = parentNode.querySelectorAll(\".ov-app\");\n nodeList.forEach((el) => {\n parentNode.appendChild(el);\n })\n }\n });\n}\n\n\nexport function provision(loadScriptsCallback) {\n loadAccessTokens();\n initPageType();\n initRoutes();\n registerWixListener(loadScriptsCallback);\n registerVariantChangeEvent();\n fetchMemberData();\n cartReload();\n}\n"],"names":["extractViewerModel","el","document","querySelector","innerText","payload","JSON","parse","e","isWixStore","window","OnVoardData","get","getCurrency","URLSearchParams","location","search","initPageType","identifier","arguments","length","undefined","pageId","wixEmbedsAPI","getCurrentPageInfo","id","currentUrl","protocol","host","pathname","getExternalBaseUrl","paths","split","concat","slice","getCheckoutUrl","cart","cartId","params","appSectionParams","encodeURIComponent","stringify","updateCheckoutRoute","checkoutUrl","initRoutes","routes","payloadRoutes","cartUrl","utils","key","value","includes","initProductData","appsWarmupData","storeData","productPage","Object","keys","forEach","startsWith","getMemberApiParameters","smToken","fetchMemberData","callback","collectionId","metaSiteId","path","fetch","method","headers","then","res","json","memberData","loadAccessTokens","data","response","auth","err","console","error","getCartAuthorization","waitUntilCartAuthorizationReady","interval","handle","setInterval","clearInterval","fetchProductData","currency","slug","decodeURI","xsfrToken","authorization","v","productData","fetchProductBySlug","fetchProductById","productId","body","operationName","query","source","variables","fetchCartData","locale","withShipping","withTax","cartData","addCartItem","param","successCallback","errorCallback","decodeAppScripts","input","output","decodedValue","DOMParser","parseFromString","documentElement","textContent","htmlDecode","replaceAll","mergeAppScripts","curAppScripts","newAppScripts","getAppScripts","appScripts","OV_MARKETING_PLATFORM_APP_SCRIPTS","OV_AOV_PROGRESS_BAR_APP_SCRIPTS","OV_BACK_IN_STOCK_APP_SCRIPTS","OV_REVIEWS_APP_SCRIPTS","OV_PROMPT_APP_SCRIPTS","OV_RECOMMENDER_APP_SCRIPTS","OV_REPERKS_APP_SCRIPTS","provisionAppScripts","wt","web_tracking","token","ovWtDiv","createElement","setAttribute","appendChild","auto_track","OnVoard","track_checkout_started","track_product_viewed","track_cart_item_added","prompt","footer","promptEl","account_id","reperksWidget","reperks_widget","global","reperksWidgetEl","aov","aov_progress_bar","aovEl","product_button","row","btnEl","referenceNode","parentElement","placement","parentNode","insertBefore","nextSibling","product_bottom","rw","reviews_widget","rwEl","productEl","product","sr","star_rating","srEl","product_title","titleEl","attachStarRatingToProduct","productsMapper","querySelectorAll","ahrefEl","getAttribute","collection_product","home_product","bis","back_in_stock","bisEl","bisFloatingBtn","floating_button","bisInlineBtn","inline_button","bisInlineText","inline_text","bisInlineForm","inline_form","recommender","recommenderEl","tracking","home_bottom","pageEl","cart_bottom","cartEl","collection_bottom","fetchProductsForGrid","nodeList","mapper","numRequests","pageType","shouldLoadProducts","onVariantChange","showWidgetsCallback","isManageProductItems","selectedChoices","optionsSelections","options","option","selections","selection","push","productItems","item","itemChoices","selectionId","idx","filter","optionKey","isEqual","inventory","quantity","refreshBuiltInBackInStock","style","display","cellEl","closest","cartReload","cartUtils","setupCartUpdateEvent","loadCart","registerWixListener","loadScriptsCallback","refreshCallback","registerListener","wixDevelopersAnalytics","register","eventName","pageTypeIdentifier","remove","handlePageView","setTimeout","eventAction","dispatchEvent","CustomEvent","detail","addEventListener","registerVariantChangeEvent","evt","choices","initialChoices","isDropdown","isColorPicker","selectedEl","titleGroup","trim","event","addEl","provision"],"sourceRoot":""}