(()=>{var e={},t={};t={get:function(e,t,n){let r=Array.isArray(t)?t:t.split("."),a=e;for(let e of r)if(void 0===(a=a[e]))return n;return a},has:function(e,t){let n=Array.isArray(t)?t:t.split("."),r=e;for(let e of n){if(!r?.hasOwnProperty(e))return!1;r=r[e]}return!0}};var n=JSON.parse('{"version":"2.0.2"}').version,r={},a={};a=function(e,t){let n=Object.keys(t).find(n=>{let r=t[n].type,a=n&&t[n].values,i=!t[n].optional,o=e[n],l=typeof o,c=r&&l!==r,f=a&&!a.includes(o);return i?!o||c||f:o&&(c||f)});return void 0===n};var i={};i={event:{event:{type:"string"},eventInfo:{optional:!0}},listenerOn:{on:{type:"string"},handler:{type:"function"},scope:{type:"string",values:["past","future","all"],optional:!0},path:{type:"string",optional:!0}},listenerOff:{off:{type:"string"},handler:{type:"function",optional:!0},scope:{type:"string",values:["past","future","all"],optional:!0},path:{type:"string",optional:!0}}};var o={};o={itemType:{DATA:"data",FCTN:"fctn",EVENT:"event",LISTENER_ON:"listenerOn",LISTENER_OFF:"listenerOff"},dataLayerEvent:{CHANGE:"adobeDataLayer:change",EVENT:"adobeDataLayer:event"},listenerScope:{PAST:"past",FUTURE:"future",ALL:"all"}};let l=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;r=function(e,t){let n=Object.keys(i).find(t=>a(e,i[t]))||"function"==typeof e&&o.itemType.FCTN||function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e)&&o.itemType.DATA,r=function(){let t=Object.keys(e).filter(e=>!Object.keys(i.event).includes(e)).reduce((t,n)=>(t[n]=e[n],t),{});if(!l(t))return t}();return{config:e,type:n,data:r,valid:!!n,index:t}};var c={};c=function(e){let t=e.config.on||e.config.off,n=e.config.handler||null,r=e.config.scope||e.config.on&&o.listenerScope.ALL||null,a=e.config.path||null;return{event:t,handler:n,scope:r,path:a}};var f={},s={};s={mergeWith:function e(t,n,r){if(n&&t)return Object.keys(n).forEach(a=>{let i=r?r(t[a],n[a],a,t):void 0;void 0===i&&(i=n[a]===Object(n[a])&&a in t&&!Array.isArray(n[a])?e(t[a],n[a],r):n[a]),t[a]=i}),t},cloneDeepWith:function e(t,n){let r=n?n(t):void 0;if(void 0===r){if(t===Object(t)&&!Array.isArray(t)){r={};let a=Object.keys(t);for(let i=0;i<a.length;i++){let o=a[i];r[o]=e(t[o],n)}}r=structuredClone(t)}return r}};var u={},p={};function y(e,n){return!n.data||!e.path||(0,t.has)(n.data,e.path)||p(n.data,e.path)}p=function(e,n){let r=n.substring(0,n.lastIndexOf("."));for(;r;){if((0,t.has)(e,r)){let n=(0,t.get)(e,r);if(null==n)return!0}r=r.substring(0,r.lastIndexOf("."))}return!1},u=function(e,t){let n=e.event,r=t.config,a=!1;return t.type===o.itemType.DATA?n===o.dataLayerEvent.CHANGE&&(a=y(e,t)):t.type===o.itemType.EVENT&&((n===o.dataLayerEvent.EVENT||n===r.event)&&(a=y(e,t)),t.data&&n===o.dataLayerEvent.CHANGE&&(a=y(e,t))),a};var d={};d=function(e,t){let n=t.event;if(Object.prototype.hasOwnProperty.call(e,n)){for(let[r,a]of e[n].entries())if(a.handler===t.handler)return r}return -1},f=function(e){let t={},n=d.bind(null,t);function r(t,n){if(u(t,n)){let r=[(0,s.cloneDeepWith)(n.config)];t.handler.apply(e.getDataLayer(),r)}}return{register:function(e){let r=e.event;return Object.prototype.hasOwnProperty.call(t,r)?-1===n(e)&&(t[e.event].push(e),!0):(t[e.event]=[e],!0)},unregister:function(e){let r=e.event;if(Object.prototype.hasOwnProperty.call(t,r)){if(e.handler||e.scope||e.path){let a=n(e);a>-1&&t[r].splice(a,1)}else t[r]=[]}},triggerListeners:function(e){let n=function(e){let t=[];switch(e.type){case o.itemType.DATA:t.push(o.dataLayerEvent.CHANGE);break;case o.itemType.EVENT:t.push(o.dataLayerEvent.EVENT),e.data&&t.push(o.dataLayerEvent.CHANGE),e.config.event!==o.dataLayerEvent.CHANGE&&t.push(e.config.event)}return t}(e);n.forEach(function(n){if(Object.prototype.hasOwnProperty.call(t,n))for(let a of t[n])r(a,e)})},triggerListener:function(e,t){r(e,t)}}};var g={},h=s.cloneDeepWith,v=s.mergeWith;g=function(e,t){return v(e,t,function(e,t){if(null==t)return null}),e=function(e,t=e=>!e){return h(e,function e(n){if(n===Object(n)){if(Array.isArray(n))return n.filter(e=>!t(e)).map(t=>h(t,e));let r={};for(let a of Object.keys(n))t(n[a])||(r[a]=h(n[a],e));return r}})}(e,e=>null==e)},e=function(e){let a;let i=e||{},l=[],s=[],u={},p={getState:function(){return u},getDataLayer:function(){return l}};function y(e){u=g(u,e.data)}function d(e){if(!e.valid){h(e);return}function t(e){return 0===l.length||e.index>l.length-1?[]:l.slice(0,e.index).map(e=>r(e))}({data:function(e){y(e),a.triggerListeners(e)},fctn:function(e){e.config.call(l,l)},event:function(e){e.data&&y(e),a.triggerListeners(e)},listenerOn:function(e){let n=c(e);switch(n.scope){case o.listenerScope.PAST:for(let r of t(e))a.triggerListener(n,r);break;case o.listenerScope.FUTURE:a.register(n);break;case o.listenerScope.ALL:{let r=a.register(n);if(r)for(let r of t(e))a.triggerListener(n,r)}}},listenerOff:function(e){a.unregister(c(e))}})[e.type](e)}function h(e){let t="The following item cannot be handled by the data layer because it does not have a valid format: "+JSON.stringify(e.config);console.error(t)}return Array.isArray(i.dataLayer)||(i.dataLayer=[]),s=i.dataLayer.splice(0,i.dataLayer.length),(l=i.dataLayer).version=n,u={},a=f(p),l.push=function(...e){if(Object.keys(e).forEach(function(t){let n=e[t],a=r(n);switch(a.valid||(h(a),delete e[t]),a.type){case o.itemType.DATA:case o.itemType.EVENT:d(a);break;case o.itemType.FCTN:delete e[t],d(a);break;case o.itemType.LISTENER_ON:case o.itemType.LISTENER_OFF:delete e[t]}}),e[0])return Array.prototype.push.apply(this,e)},l.getState=function(e){return e?(0,t.get)(structuredClone(u),e):structuredClone(u)},l.addEventListener=function(e,t,n){let a=r({on:e,handler:t,scope:n&&n.scope,path:n&&n.path});d(a)},l.removeEventListener=function(e,t){let n=r({off:e,handler:t});d(n)},function(){for(let e=0;e<s.length;e++)l.push(s[e])}(),p};let E={Manager:e};window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer.version?console.warn(`Adobe Client Data Layer v${window.adobeDataLayer.version} has already been imported/initialized on this page. You may be erroneously loading it a second time.`):E.Manager({dataLayer:window.adobeDataLayer})})();
