/*! For license information please see index.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("magentoStorefrontEvents",[],e):"object"==typeof exports?exports.magentoStorefrontEvents=e():t.magentoStorefrontEvents=e()}(self,(()=>(()=>{"use strict";var t={525:(t,e,n)=>{function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=i(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,s=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function i(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n>>0,r>>>=0,o=Array(s);++id.length-1?[]:d.slice(0,t.index).map((function(t){return c(t)}))}t.valid?{data:function(t){g(t),e.triggerListeners(t)},fctn:function(t){t.config.call(d,d)},event:function(t){t.data&&g(t),e.triggerListeners(t)},listenerOn:function(t){var r=u(t);switch(r.scope){case l.listenerScope.PAST:var i,s=o(n(t));try{for(s.s();!(i=s.n()).done;){var a=i.value;e.triggerListener(r,a)}}catch(t){s.e(t)}finally{s.f()}break;case l.listenerScope.FUTURE:e.register(r);break;case l.listenerScope.ALL:if(e.register(r)){var c,f=o(n(t));try{for(f.s();!(c=f.n()).done;){var h=c.value;e.triggerListener(r,h)}}catch(t){f.e(t)}finally{f.f()}}}},listenerOff:function(t){e.unregister(u(t))}}[t.type](t):b(t)}function b(t){var e="The following item cannot be handled by the data layer because it does not have a valid format: "+JSON.stringify(t.config);console.error(e)}return Array.isArray(r.dataLayer)||(r.dataLayer=[]),n=r.dataLayer.splice(0,r.dataLayer.length),(d=r.dataLayer).version=i,p={},e=f(v),d.push=function(t){var e=arguments,n=arguments;if(Object.keys(e).forEach((function(t){var r=c(e[t]);switch(r.valid||(b(r),delete n[t]),r.type){case l.itemType.DATA:case l.itemType.EVENT:y(r);break;case l.itemType.FCTN:delete n[t],y(r);break;case l.itemType.LISTENER_ON:case l.itemType.LISTENER_OFF:delete n[t]}})),n[0])return Array.prototype.push.apply(this,n)},d.getState=function(t){return t?a(s(p),t):s(p)},d.addEventListener=function(t,e,n){y(c({on:t,handler:e,scope:n&&n.scope,path:n&&n.path}))},d.removeEventListener=function(t,e){y(c({off:t,handler:e}))},function(){for(var t=0;t{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};return(()=>{n.d(r,{default:()=>gt}),n(525);class t{setContext(t,e){window.adobeDataLayer.push({[t]:null}),window.adobeDataLayer.push({[t]:e})}getContext(t){return window.adobeDataLayer.getState?window.adobeDataLayer.getState(t):{}}addEventListener(t,e,n){window.adobeDataLayer.push((r=>{r.addEventListener(t,e,n)}))}removeEventListener(t,e){window.adobeDataLayer.push((n=>{n.removeEventListener(t,e)}))}pushEvent(t,e={}){e&&void 0===e.customContext&&delete e.customContext,window.adobeDataLayer.push((n=>{n.push({event:t,eventInfo:Object.assign(Object.assign({},this.getContext()),e)})}))}}const e="aepContext",o="accountContext",i="changedProductsContext",s="channelContext",a="categoryContext",c="customContext",u="customUrlContext",f="dataServicesExtensionContext",l="debugContext",h="eventForwardingContext",d="experiencePlatformConnectorExtensionContext",p="magentoExtensionContext",v="orderContext",g="orderPageContext",y="pageContext",b="productContext",m="recommendationsContext",E="recommendationsExtensionContext",C="referrerUrlContext",x="requisitionListContext",j="requisitionListItemsContext",L="searchExtensionContext",_="searchInputContext",w="searchResultsContext",A="shopperContext",O="shoppingCartContext",S="storefrontInstanceContext";class R extends t{getAEP(){return this.getContext(e)}setAEP(t){this.setContext(e,t)}getAccount(){return this.getContext(o)}setAccount(t){this.setContext(o,t)}getChangedProducts(){return this.getContext(i)}setChangedProducts(t){this.setContext(i,t)}getCategory(){return this.getContext(a)}setCategory(t){this.setContext(a,t)}getChannel(){return this.getContext(s)}setChannel(t){this.setContext(s,t)}getDebug(){return this.getContext(l)}setDebug(t){this.setContext(l,t)}getEventForwarding(){return this.getContext(h)}setEventForwarding(t){this.setContext(h,t)}getExperiencePlatformConnectorExtension(){return this.getContext(d)}setExperiencePlatformConnectorExtension(t){this.setContext(d,t)}getCustom(){return this.getContext(c)}setCustom(t){this.setContext(c,t)}getCustomUrl(){return this.getContext(u)}setCustomUrl(t){this.setContext(u,t)}getDataServicesExtension(){return this.getContext(f)}setDataServicesExtension(t){this.setContext(f,t)}getMagentoExtension(){return this.getContext(p)}setMagentoExtension(t){this.setContext(p,t)}getOrder(){return this.getContext(v)}setOrder(t){this.setContext(v,t)}getOrderPage(){return this.getContext(g)}setOrderPage(t){this.setContext(g,t)}getPage(){return this.getContext(y)}setPage(t){this.setContext(y,t)}getProduct(){return this.getContext(b)}setProduct(t){this.setContext(b,t)}getRecommendations(){return this.getContext(m)}setRecommendations(t){this.setContext(m,t)}getRecommendationsExtension(){return this.getContext(E)}setRecommendationsExtension(t){this.setContext(E,t)}getReferrerUrl(){return this.getContext(C)}setReferrerUrl(t){this.setContext(C,t)}getRequisitionList(){return this.getContext(x)}setRequisitionList(t){this.setContext(x,t)}getRequisitionListItems(){return this.getContext(j)}setRequisitionListItems(t){this.setContext(j,t)}getSearchExtension(){return this.getContext(L)}setSearchExtension(t){this.setContext(L,t)}getSearchInput(){return this.getContext(_)}setSearchInput(t){this.setContext(_,t)}getSearchResults(){return this.getContext(w)}setSearchResults(t){this.setContext(w,t)}getShopper(){return this.getContext(A)}setShopper(t){this.setContext(A,t)}getShoppingCart(){return this.getContext(O)}setShoppingCart(t){this.setContext(O,t)}getStorefrontInstance(){return this.getContext(S)}setStorefrontInstance(t){this.setContext(S,t)}getContext(t){return super.getContext(t)}setContext(t,e){super.setContext(t,e)}}const k="add-to-cart",I="add-to-requisition-list",T="create-account",D="create-requisition-list",U="delete-requisition-list",P="commerce-custom",F="custom-url",N="adobeDataLayer:change",M="adobeDataLayer:event",q="edit-account",V="initiate-checkout",z="open-cart",$="page-activity-summary",B="page-view",W="place-order",G="product-page-view",H="recs-item-click",J="recs-item-add-to-cart-click",Y="recs-api-request-sent",K="recs-api-response-received",Q="recs-unit-impression-render",X="recs-unit-view",Z="referrer-url",tt="remove-from-cart",et="remove-from-requisition-list",nt="search-category-click",rt="search-product-click",ot="search-request-sent",it="search-response-received",st="search-results-view",at="category-results-view",ct="search-suggestion-click",ut="shopping-cart-view",ft="sign-in",lt="sign-out",ht="update-cart";class dt extends t{addToCart(t){this.pushEvent(k,{customContext:t})}addToRequisitionList(t){this.pushEvent(I,{customContext:t})}createAccount(t){this.pushEvent(T,{customContext:t})}createRequisitionList(t){this.pushEvent(D,{customContext:t})}deleteRequisitionList(t){this.pushEvent(U,{customContext:t})}custom(t){this.pushEvent(P,{customContext:t})}customUrl(t){this.pushEvent(F,{customContext:t})}editAccount(t){this.pushEvent(q,{customContext:t})}initiateCheckout(t){this.pushEvent(V,{customContext:t})}openCart(t){this.pushEvent(z,{customContext:t})}pageActivitySummary(t){this.pushEvent($,{customContext:t})}pageView(t){this.pushEvent(B,{customContext:t})}placeOrder(t){this.pushEvent(W,{customContext:t})}productPageView(t){this.pushEvent(G,{customContext:t})}recsItemAddToCartClick(t,e,n){this.pushEvent(J,{unitId:t,productId:e,customContext:n})}recsItemClick(t,e,n){this.pushEvent(H,{unitId:t,productId:e,customContext:n})}recsRequestSent(t){this.pushEvent(Y,{customContext:t})}recsResponseReceived(t){this.pushEvent(K,{customContext:t})}recsUnitRender(t,e){this.pushEvent(Q,{unitId:t,customContext:e})}recsUnitView(t,e){this.pushEvent(X,{unitId:t,customContext:e})}referrerUrl(t){this.pushEvent(Z,{customContext:t})}removeFromCart(t){this.pushEvent(tt,{customContext:t})}removeFromRequisitionList(t){this.pushEvent(et,{customContext:t})}searchCategoryClick(t,e,n){this.pushEvent(nt,{searchUnitId:t,name:e,customContext:n})}searchProductClick(t,e,n){this.pushEvent(rt,{searchUnitId:t,sku:e,customContext:n})}searchRequestSent(t,e){this.pushEvent(ot,{searchUnitId:t,customContext:e})}searchResponseReceived(t,e){this.pushEvent(it,{searchUnitId:t,customContext:e})}searchResultsView(t,e){this.pushEvent(st,{searchUnitId:t,customContext:e})}categoryResultsView(t,e){this.pushEvent(at,{searchUnitId:t,customContext:e})}searchSuggestionClick(t,e,n){this.pushEvent(ct,{searchUnitId:t,suggestion:e,customContext:n})}shoppingCartView(t){this.pushEvent(ut,{customContext:t})}signIn(t){this.pushEvent(ft,{customContext:t})}signOut(t){this.pushEvent(lt,{customContext:t})}updateCart(t){this.pushEvent(ht,{customContext:t})}}class pt extends t{addToCart(t,e){this.addEventListener(k,t,e)}addToRequisitionList(t,e){this.addEventListener(I,t,e)}createAccount(t,e){this.addEventListener(T,t,e)}createRequisitionList(t,e){this.addEventListener(D,t,e)}deleteRequisitionList(t,e){this.addEventListener(U,t,e)}custom(t,e){this.addEventListener(P,t,e)}customUrl(t,e){this.addEventListener(F,t,e)}editAccount(t,e){this.addEventListener(q,t,e)}dataLayerChange(t,e){this.addEventListener(N,t,e)}dataLayerEvent(t,e){this.addEventListener(M,t,e)}initiateCheckout(t,e){this.addEventListener(V,t,e)}openCart(t,e){this.addEventListener(z,t,e)}pageActivitySummary(t,e){this.addEventListener($,t,e)}pageView(t,e){this.addEventListener(B,t,e)}placeOrder(t,e){this.addEventListener(W,t,e)}productPageView(t,e){this.addEventListener(G,t,e)}recsItemAddToCartClick(t,e){this.addEventListener(J,t,e)}recsItemClick(t,e){this.addEventListener(H,t,e)}recsRequestSent(t,e){this.addEventListener(Y,t,e)}recsResponseReceived(t,e){this.addEventListener(K,t,e)}recsUnitRender(t,e){this.addEventListener(Q,t,e)}recsUnitView(t,e){this.addEventListener(X,t,e)}referrerUrl(t,e){this.addEventListener(Z,t,e)}removeFromCart(t,e){this.addEventListener(tt,t,e)}removeFromRequisitionList(t,e){this.addEventListener(et,t,e)}searchCategoryClick(t){this.addEventListener(nt,t)}searchProductClick(t){this.addEventListener(rt,t)}searchRequestSent(t){this.addEventListener(ot,t)}searchResponseReceived(t){this.addEventListener(it,t)}searchResultsView(t){this.addEventListener(st,t)}categoryResultsView(t){this.addEventListener(at,t)}searchSuggestionClick(t){this.addEventListener(ct,t)}shoppingCartView(t){this.addEventListener(ut,t)}signIn(t,e){this.addEventListener(ft,t,e)}signOut(t,e){this.addEventListener(lt,t,e)}updateCart(t){this.addEventListener(ht,t)}}class vt extends t{addToCart(t){this.removeEventListener(k,t)}addToRequisitionList(t){this.removeEventListener(I,t)}createAccount(t){this.removeEventListener(T,t)}createRequisitionList(t){this.removeEventListener(D,t)}deleteRequisitionList(t){this.removeEventListener(U,t)}custom(t){this.removeEventListener(P,t)}customUrl(t){this.removeEventListener(F,t)}editAccount(t){this.removeEventListener(q,t)}dataLayerChange(t){this.removeEventListener(N,t)}dataLayerEvent(t){this.removeEventListener(M,t)}initiateCheckout(t){this.removeEventListener(V,t)}openCart(t){this.removeEventListener(z,t)}pageActivitySummary(t){this.removeEventListener($,t)}pageView(t){this.removeEventListener(B,t)}placeOrder(t){this.removeEventListener(W,t)}productPageView(t){this.removeEventListener(G,t)}recsItemAddToCartClick(t){this.removeEventListener(J,t)}recsItemClick(t){this.removeEventListener(H,t)}recsRequestSent(t){this.removeEventListener(Y,t)}recsResponseReceived(t){this.removeEventListener(K,t)}recsUnitRender(t){this.removeEventListener(Q,t)}recsUnitView(t){this.removeEventListener(X,t)}referrerUrl(t){this.removeEventListener(Z,t)}removeFromCart(t){this.removeEventListener(tt,t)}removeFromRequisitionList(t){this.removeEventListener(et,t)}searchCategoryClick(t){this.removeEventListener(nt,t)}searchProductClick(t){this.removeEventListener(rt,t)}searchRequestSent(t){this.removeEventListener(ot,t)}searchResponseReceived(t){this.removeEventListener(it,t)}searchResultsView(t){this.removeEventListener(st,t)}categoryResultsView(t){this.removeEventListener(at,t)}searchSuggestionClick(t){this.removeEventListener(ct,t)}shoppingCartView(t){this.removeEventListener(ut,t)}signIn(t){this.removeEventListener(ft,t)}signOut(t){this.removeEventListener(lt,t)}updateCart(t){this.removeEventListener(ht,t)}}const gt=new class{constructor(){this.context=new R,this.publish=new dt,this.subscribe=new pt,this.unsubscribe=new vt,window.adobeDataLayer=window.adobeDataLayer||[],window.postMessage("magento-storefront-events-sdk","*")}}})(),r.default})()));