@absmartly/sdk-plugins 1.3.0 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ABsmartlyOverridesFull=t():e.ABsmartlyOverridesFull=t()}(this,()=>(()=>{"use strict";var e={44:function(e,t,i){var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var s=i(609),l=i(943),u=i(186),c=function(){function e(e){var t,i,r,n,o;if(this.initialized=!1,!e.context)throw new Error("[OverridesPluginLite] Context is required");this.config={context:e.context,cookieName:null!==(t=e.cookieName)&&void 0!==t?t:"absmartly_overrides",useQueryString:null===(i=e.useQueryString)||void 0===i||i,queryPrefix:null!==(r=e.queryPrefix)&&void 0!==r?r:"exp_",persistQueryToCookie:null!==(n=e.persistQueryToCookie)&&void 0!==n&&n,debug:null!==(o=e.debug)&&void 0!==o&&o},this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Initialized with config:",{cookieName:this.config.cookieName,useQueryString:this.config.useQueryString,queryPrefix:this.config.queryPrefix})}return e.prototype.ready=function(){return r(this,void 0,void 0,function(){var e,t,i,r,l,u,c,d,f,g,v;return n(this,function(n){if(this.initialized)return this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Already initialized"),[2];if(this.initialized=!0,this.registerWithContext(),this.registerGlobally(),e={},this.config.useQueryString&&"undefined"!=typeof window&&(e=this.getQueryStringOverrides(),this.config.persistQueryToCookie&&this.config.cookieName&&Object.keys(e).length>0&&this.persistOverridesToCookie(e)),0===Object.keys(e).length&&this.config.cookieName&&(e=this.getCookieOverrides()),0===Object.keys(e).length)return this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] No overrides found"),[2];try{for(t=o(Object.entries(e)),i=t.next();!i.done;i=t.next())r=a(i.value,2),l=r[0],u=r[1],c="number"==typeof u?u:u.variant,isNaN(c)?this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Skipping invalid variant for ".concat(l,": ").concat(c)):(null===(v=(g=this.config.context).override)||void 0===v||v.call(g,l,c),this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Override: ".concat(l," -> variant ").concat(c)))}catch(e){d={error:e}}finally{try{i&&!i.done&&(f=t.return)&&f.call(t)}finally{if(d)throw d.error}}return[2]})})},e.prototype.initialize=function(){return r(this,void 0,void 0,function(){return n(this,function(e){return[2,this.ready()]})})},e.prototype.getQueryStringOverrides=function(){if("undefined"==typeof window||!window.location)return{};var e=(0,u.getQueryStringOverrides)(this.config.queryPrefix);return this.config.debug&&Object.keys(e).length>0&&(0,s.logDebug)("[OverridesPluginLite] Query string overrides:",e),e},e.prototype.getCookieOverrides=function(){return"undefined"==typeof document?{}:(0,u.getCookieOverrides)(this.config.cookieName)},e.prototype.persistOverridesToCookie=function(e){if(this.config.cookieName&&"undefined"!=typeof document&&((0,u.persistOverridesToCookie)(e,{cookieName:this.config.cookieName}),this.config.debug)){var t=(0,u.serializeOverrides)(e);(0,s.logDebug)("[OverridesPluginLite] Persisted to cookie:",t)}},e.prototype.registerWithContext=function(){this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.overridesPlugin={name:"OverridesPluginLite",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides"],instance:this,timestamp:Date.now()},this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Registered with context at __plugins.overridesPlugin"))},e.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.config.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.config.context.__plugins.overridesPlugin,this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Unregistered from context"))},e.prototype.destroy=function(){this.initialized=!1,this.unregisterFromContext(),this.unregisterGlobally()},e.prototype.registerGlobally=function(){(0,l.registerPlugin)("overrides",{name:"OverridesPluginLite",version:"1.0.0",initialized:!0,timestamp:Date.now(),capabilities:["cookie-overrides","query-overrides"],instance:this}),this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Registered in global window.__ABSMARTLY_PLUGINS__")},e.prototype.unregisterGlobally=function(){(0,l.unregisterPlugin)("overrides"),this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Unregistered from global registry")},e}();t.OverridesPluginLite=c},91:function(e,t,i){var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},o=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a},a=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiePlugin=void 0;var l=i(609),u=i(319),c=function(){function e(e){void 0===e&&(e={}),this.context=e.context,this.debug=e.debug||!1,this.cookieDomain=e.cookieDomain||".absmartly.com",this.cookiePath=e.cookiePath||"/",this.sameSite=e.sameSite||"Lax",this.secure=e.secure||!1,this.cookieExpiryDays=e.cookieExpiryDays||730,this.unitIdCookieName=e.unitIdCookieName||"abs",this.publicIdCookieName=e.publicIdCookieName||"abs_public",this.expiryCookieName=e.expiryCookieName||"abs_expiry",this.utmCookieName=e.utmCookieName||"abs_utm_params",this.utmParams=e.utmParamsList||["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],this.autoUpdateExpiry=!1!==e.autoUpdateExpiry,this.expiryCheckInterval=e.expiryCheckInterval||30}return e.prototype.debugLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&l.logDebug.apply(void 0,a(["[CookiePlugin]"],o(e),!1))},e.prototype.setCookie=function(e,t,i){var r=void 0!==i?i:this.cookieExpiryDays,n=(0,u.setCookie)(e,t,r,{domain:this.cookieDomain,path:this.cookiePath,sameSite:this.sameSite,secure:this.secure});return n&&this.debugLog("Set cookie ".concat(e,":"),t),n},e.prototype.deleteCookie=function(e){(0,u.deleteCookie)(e,{domain:this.cookieDomain,path:this.cookiePath})},e.prototype.getUnitId=function(){if(this.unitId)return this.unitId;var e=navigator.cookieEnabled,t=(0,u.isLocalStorageAvailable)(),i=null;return e&&(i=(0,u.getCookie)(this.unitIdCookieName)||(0,u.getCookie)(this.publicIdCookieName)),!i&&t&&(i=localStorage.getItem("abs_id")),i&&(this.unitId=i),i},e.prototype.setUnitId=function(e){this.unitId=e;var t=navigator.cookieEnabled,i=(0,u.isLocalStorageAvailable)();t&&(this.setCookie(this.unitIdCookieName,e),this.setCookie(this.publicIdCookieName,e),this.autoUpdateExpiry&&this.updateExpiryTimestamp()),i&&localStorage.setItem("abs_id",e),this.debugLog("Unit ID set:",e)},e.prototype.generateAndSetUnitId=function(){var e=(0,u.generateUniqueId)();return this.setUnitId(e),e},e.prototype.updateExpiryTimestamp=function(){if(navigator.cookieEnabled){var e=Date.now();this.setCookie(this.expiryCookieName,e.toString()),this.debugLog("Updated expiry timestamp:",e)}},e.prototype.isExpiryFresh=function(){if(!navigator.cookieEnabled)return!1;var e=(0,u.getCookie)(this.expiryCookieName);if(!e)return!1;try{var t=parseInt(e,10),i=(Date.now()-t)/864e5,r=i<=this.expiryCheckInterval;return this.debugLog("Expiry check:",{daysSinceSet:i,isFresh:r}),r}catch(e){return this.debugLog("Error parsing expiry cookie:",e),!1}},e.prototype.getUtmParams=function(){var e,t,i,r,n={},o=new URLSearchParams(window.location.search);try{for(var a=s(this.utmParams),l=a.next();!l.done;l=a.next()){var u=l.value;(g=o.get(u))&&(n[u]=g)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(0===Object.keys(n).length&&document.referrer)try{var c=new URL(document.referrer);try{for(var d=s(this.utmParams),f=d.next();!f.done;f=d.next()){var g;u=f.value;(g=c.searchParams.get(u))&&(n[u]=g)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}}catch(e){this.debugLog("Error parsing referrer URL:",e)}if(0===Object.keys(n).length){var v=this.getStoredUtmParams();if(v)return v}return n},e.prototype.storeUtmParams=function(e){if(0!==Object.keys(e).length){var t={params:e,timestamp:Date.now()},i=navigator.cookieEnabled;if((0,u.isLocalStorageAvailable)())try{localStorage.setItem(this.utmCookieName,JSON.stringify(t)),this.debugLog("Stored UTM params in localStorage:",e)}catch(e){this.debugLog("Failed to store UTM params in localStorage:",e)}i&&(this.setCookie(this.utmCookieName,JSON.stringify(t),30),this.debugLog("Stored UTM params in cookie:",e))}},e.prototype.getStoredUtmParams=function(){var e=null,t=(0,u.isLocalStorageAvailable)(),i=navigator.cookieEnabled;if(t)try{e=localStorage.getItem(this.utmCookieName)}catch(e){this.debugLog("Failed to get UTM params from localStorage:",e)}if(!e&&i&&(e=(0,u.getCookie)(this.utmCookieName)),e)try{var r=JSON.parse(e);if(Date.now()-r.timestamp<2592e6)return r.params}catch(e){this.debugLog("Failed to parse stored UTM params:",e)}return null},e.prototype.applyUtmAttributesToContext=function(e){var t,i,r=e||this.context;if(r){var n=this.getUtmParams();Object.keys(n).length>0&&this.storeUtmParams(n);try{for(var a=s(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=o(u.value,2),d=c[0],f=c[1],g=d.slice(4);r.attribute(g,f),this.debugLog("Set attribute ".concat(g,":"),f)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}}else(0,l.logDebug)("[CookiePlugin] No context available to apply UTM attributes")},e.prototype.clearAllCookies=function(){this.deleteCookie(this.unitIdCookieName),this.deleteCookie(this.publicIdCookieName),this.deleteCookie(this.expiryCookieName),this.deleteCookie(this.utmCookieName),(0,u.isLocalStorageAvailable)()&&(localStorage.removeItem("abs_id"),localStorage.removeItem(this.utmCookieName)),this.unitId=void 0,this.debugLog("All cookies and storage cleared")},e.prototype.ready=function(){return r(this,void 0,void 0,function(){var e;return n(this,function(t){return this.debugLog("Initializing CookiePlugin"),(e=this.getUnitId())?(this.debugLog("Using existing unit ID:",e),this.autoUpdateExpiry&&!this.isExpiryFresh()&&this.updateExpiryTimestamp()):(e=this.generateAndSetUnitId(),this.debugLog("Generated new unit ID:",e)),this.context&&this.applyUtmAttributesToContext(),this.debugLog("CookiePlugin initialized successfully"),[2]})})},e.prototype.initialize=function(){return r(this,void 0,void 0,function(){return n(this,function(e){return[2,this.ready()]})})},e.prototype.setContext=function(e){this.context=e,this.debugLog("Context set for CookiePlugin")},e.prototype.needsServerSideCookie=function(){var e=this.getUnitId(),t=navigator.cookieEnabled,i=(0,u.isLocalStorageAvailable)();if(e){if(t&&!this.isExpiryFresh())return this.debugLog("Existing ID present but expiry not fresh - need worker call"),!0}else if(t||i){var r=(0,u.getCookie)(this.expiryCookieName);return this.debugLog(r?"No existing ID but expiry cookie exists - need worker call":"No existing ID and no expiry cookie - need worker call"),!0}return!1},e.prototype.trackLanding=function(e){var t=e||this.context;if(t){var i=new URLSearchParams(window.location.search),r=this.utmParams.some(function(e){return i.get(e)}),n=document.referrer,o=n&&!n.includes(this.cookieDomain.replace(".","")),a=navigator.cookieEnabled||(0,u.isLocalStorageAvailable)(),s=!!((0,u.getCookie)(this.unitIdCookieName)||(0,u.getCookie)(this.publicIdCookieName)||(0,u.getCookie)(this.expiryCookieName)||(0,u.isLocalStorageAvailable)()&&localStorage.getItem("abs_id"));if(r||o||a&&!s){var c={referrer_url:n||"",landing_url:window.location.href,accepts_cookies:navigator.cookieEnabled,accepts_storage:(0,u.isLocalStorageAvailable)(),has_utm:r};this.debugLog("Tracking landing:",c),t.track("landing",c)}}else(0,l.logDebug)("[CookiePlugin] No context available for tracking landing")},e}();t.CookiePlugin=c},186:function(e,t){var i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a};function n(e,n){var o,a;if(void 0===e&&(e=t.DEFAULT_OVERRIDE_QUERY_PREFIX),"undefined"==typeof window&&!n)return{};var s=n||new URLSearchParams(window.location.search),l={};try{for(var u=i(s.entries()),c=u.next();!c.done;c=u.next()){var d=r(c.value,2),f=d[0],g=d[1];if(f.startsWith(e)){var v=f.substring(e.length);if(v){var p=g.split(","),h=parseInt(p[0],10);isNaN(h)||(1===p.length?l[v]=h:l[v]={variant:h,env:p[1]?parseInt(p[1],10):void 0,id:p[2]?parseInt(p[2],10):void 0})}}}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return l}function o(e){var t,n;if(!e)return{};var o={},a=e;e.includes("|")&&(a=(p=e.split("|"))[p.length-1]);if(!a)return{};var s=a.split(",");try{for(var l=i(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=r(c.split(":"),2),f=d[0],g=d[1];if(f&&g){var v=decodeURIComponent(f),p=g.split("."),h=parseInt(p[0],10);isNaN(h)||(1===p.length?o[v]=h:o[v]={variant:h,env:p[1]?parseInt(p[1],10):void 0,id:p[2]?parseInt(p[2],10):void 0})}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o}function a(e,r){var n,a;void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);var s=null!=r?r:"undefined"!=typeof document?document.cookie:"";if(!s)return{};var l=e+"=",u=s.split(";");try{for(var c=i(u),d=c.next();!d.done;d=c.next()){var f=d.value;if(0===(f=f.trim()).indexOf(l))return o(decodeURIComponent(f.substring(l.length)))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}return{}}function s(e){var t,n,o=[];try{for(var a=i(Object.entries(e)),s=a.next();!s.done;s=a.next()){var l=r(s.value,2),u=l[0],c=l[1],d=encodeURIComponent(u);if("number"==typeof c)o.push("".concat(d,":").concat(c));else{var f="".concat(d,":").concat(c.variant);void 0!==c.env&&(f+=".".concat(c.env)),void 0!==c.id&&(f+=".".concat(c.id)),o.push(f)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o.join(",")}function l(e,i){if(void 0===i&&(i={}),"undefined"!=typeof document){var r=i.cookieName||t.DEFAULT_OVERRIDE_COOKIE_NAME,n=i.maxAge||86400,o=s(e);document.cookie="".concat(r,"=").concat(encodeURIComponent(o),";path=/;max-age=").concat(n)}}function u(e){var t,n,o={};try{for(var a=i(Object.entries(e)),s=a.next();!s.done;s=a.next()){var l=r(s.value,2),u=l[0],c=l[1];o[u]="number"==typeof c?c:c.variant}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERRIDE_QUERY_PREFIX=t.DEFAULT_OVERRIDE_COOKIE_NAME=void 0,t.getQueryStringOverrides=n,t.parseOverrideCookie=o,t.getCookieOverrides=a,t.serializeOverrides=s,t.persistOverridesToCookie=l,t.getOverrides=function(e,i,r,o){void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);void 0===i&&(i=t.DEFAULT_OVERRIDE_QUERY_PREFIX);var s=n(i,r);if(Object.keys(s).length>0)return"undefined"!=typeof document&&l(s,{cookieName:e,maxAge:86400}),u(s);return u(a(e,o))},t.DEFAULT_OVERRIDE_COOKIE_NAME="absmartly_overrides",t.DEFAULT_OVERRIDE_QUERY_PREFIX="exp_"},241:function(e,t,i){var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||r(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiePlugin=t.BrowserCookieAdapter=t.OverridesPlugin=t.OverridesPluginFull=void 0;var o=i(977);Object.defineProperty(t,"OverridesPluginFull",{enumerable:!0,get:function(){return o.OverridesPluginFull}}),Object.defineProperty(t,"OverridesPlugin",{enumerable:!0,get:function(){return o.OverridesPluginFull}});var a=i(637);Object.defineProperty(t,"BrowserCookieAdapter",{enumerable:!0,get:function(){return a.BrowserCookieAdapter}});var s=i(91);Object.defineProperty(t,"CookiePlugin",{enumerable:!0,get:function(){return s.CookiePlugin}}),n(i(639),t),t.default=o.OverridesPluginFull},248:function(e,t,i){var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},l=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPlugin=void 0;var c=i(44),d=i(609),f=i(186),g=function(e){function t(t){var i,r,n,o,a,s,l,u,c,f,g,v,p,h,y,m,b,x,_,k,C,O=e.call(this,{context:t.context,cookieName:t.cookieName,useQueryString:null!==(i=t.useQueryString)&&void 0!==i?i:"undefined"!=typeof window,queryPrefix:null!==(r=t.queryPrefix)&&void 0!==r?r:"exp_",persistQueryToCookie:null!==(n=t.persistQueryToCookie)&&void 0!==n&&n,debug:null!==(o=t.debug)&&void 0!==o&&o})||this;if(O.onExperimentsAddedCallbacks=[],!t.context)throw new Error("[OverridesPlugin] Context is required");O.isServerSide="undefined"==typeof window;var P,w=t.sdkEndpoint;w||((P=t.context)._endpoint?w=P._endpoint:(null===(a=P._config)||void 0===a?void 0:a.endpoint)?w=P._config.endpoint:(null===(s=P._dataProvider)||void 0===s?void 0:s._endpoint)?w=P._dataProvider._endpoint:(null===(l=P._options)||void 0===l?void 0:l.endpoint)&&(w=P._options.endpoint.replace("/v1","")));if(!w&&!t.absmartlyEndpoint&&!((P=t.context)._endpoint||(null===(u=P._config)||void 0===u?void 0:u.endpoint)||(null===(c=P._dataProvider)||void 0===c?void 0:c._endpoint)||(null===(f=P._options)||void 0===f?void 0:f.endpoint)))throw new Error("[OverridesPlugin] SDK endpoint must be provided if not available from context");return O.fullConfig={context:t.context,cookieName:t.cookieName,cookieAdapter:t.cookieAdapter,cookieOptions:null!==(g=t.cookieOptions)&&void 0!==g?g:{path:"/"},useQueryString:null!==(v=t.useQueryString)&&void 0!==v?v:!O.isServerSide,queryPrefix:null!==(p=t.queryPrefix)&&void 0!==p?p:"exp_",envParam:null!==(h=t.envParam)&&void 0!==h?h:"env",persistQueryToCookie:null!==(y=t.persistQueryToCookie)&&void 0!==y&&y,url:t.url,absmartlyEndpoint:null!==(m=t.absmartlyEndpoint)&&void 0!==m?m:"",sdkEndpoint:w||"",domChangesFieldName:null!==(b=t.domChangesFieldName)&&void 0!==b?b:"__dom_changes",sdkApiKey:null!==(x=t.sdkApiKey)&&void 0!==x?x:"",application:null!==(_=t.application)&&void 0!==_?_:"",environment:null!==(k=t.environment)&&void 0!==k?k:"",debug:null!==(C=t.debug)&&void 0!==C&&C},O.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Initialized with config:",{isServerSide:O.isServerSide,cookieName:O.fullConfig.cookieName,useQueryString:O.fullConfig.useQueryString,queryPrefix:O.fullConfig.queryPrefix,envParam:O.fullConfig.envParam,persistQueryToCookie:O.fullConfig.persistQueryToCookie,sdkEndpoint:O.fullConfig.sdkEndpoint,absmartlyEndpoint:O.fullConfig.absmartlyEndpoint}),O}return n(t,e),t.prototype.ready=function(){return a(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return this.initialized?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Already initialized, skipping re-initialization"),[2]):(this.initialized=!0,this.registerWithContext(),e=this.getOverrides(),0===Object.keys(e.overrides).length?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No overrides found"),[2]):[4,this.applyOverridesWithFetching(e.overrides,e.devEnv)]);case 1:return t.sent(),[2]}})})},t.prototype.initialize=function(){return a(this,void 0,void 0,function(){return s(this,function(e){return[2,this.ready()]})})},t.prototype.getOverrides=function(){var e={overrides:{},devEnv:null};if(this.fullConfig.cookieName){var t=this.getEnhancedCookieOverrides();e.overrides=o({},t.overrides),e.devEnv=t.devEnv}if(this.fullConfig.useQueryString){var i=this.getEnhancedQueryStringOverrides();Object.keys(i.overrides).length>0&&(e.overrides=o(o({},e.overrides),i.overrides),null!==i.devEnv&&(e.devEnv=i.devEnv),this.fullConfig.persistQueryToCookie&&this.fullConfig.cookieName&&this.persistEnhancedOverridesToCookie(e))}return e},t.prototype.getEnhancedQueryStringOverrides=function(){try{var e=void 0;if(this.isServerSide){if(!this.fullConfig.url)return{overrides:{},devEnv:null};var t="string"==typeof this.fullConfig.url?new URL(this.fullConfig.url):this.fullConfig.url;e=new URLSearchParams(t.search)}else e=new URLSearchParams(window.location.search);var i=(0,f.getQueryStringOverrides)(this.fullConfig.queryPrefix,e),r=null;if(this.fullConfig.envParam){var n=e.get(this.fullConfig.envParam);n&&(r=n)}return this.fullConfig.debug&&Object.keys(i).length>0&&(0,d.logDebug)("[OverridesPlugin] Query string overrides:",i,"env:",r),{overrides:i,devEnv:r}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing query string:",e),{overrides:{},devEnv:null}}},t.prototype.getEnhancedCookieOverrides=function(){var e,t;if(!this.fullConfig.cookieName)return{overrides:{},devEnv:null};var i=null;if(this.fullConfig.cookieAdapter)i=this.fullConfig.cookieAdapter.get(this.fullConfig.cookieName);else if("undefined"!=typeof document){var r=this.fullConfig.cookieName+"=",n=document.cookie.split(";");try{for(var o=l(n),a=o.next();!a.done;a=o.next()){var s=a.value;if(0===(s=s.trim()).indexOf(r)){i=decodeURIComponent(s.substring(r.length));break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}this.fullConfig.debug&&i&&(0,d.logDebug)("[OverridesPlugin] Raw cookie value:",i);var u=this.parseEnhancedCookieValue(i);return this.fullConfig.debug&&Object.keys(u.overrides).length>0&&(0,d.logDebug)("[OverridesPlugin] Parsed cookie overrides:",u),u},t.prototype.parseEnhancedCookieValue=function(e){if(!e)return{overrides:{},devEnv:null};try{var t=null,i=e;if(e.startsWith("devEnv=")){var r=e.split("|");t=decodeURIComponent(r[0].substring(7)),i=r[1]||""}return{overrides:i?(0,f.parseOverrideCookie)(i):{},devEnv:t}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing overrides:",e),{overrides:{},devEnv:null}}},t.prototype.persistEnhancedOverridesToCookie=function(e){var t,i;if(this.fullConfig.cookieName){var r=[];e.devEnv&&r.push("devEnv=".concat(encodeURIComponent(e.devEnv)));var n=[];try{for(var a=l(Object.entries(e.overrides)),s=a.next();!s.done;s=a.next()){var c=u(s.value,2),f=c[0],g=c[1],v=encodeURIComponent(f);if("number"==typeof g)n.push("".concat(v,":").concat(g));else{var p=g,h="".concat(v,":").concat(p.variant);void 0!==p.env&&(h+=".".concat(p.env)),void 0!==p.id&&(h+=".".concat(p.id)),n.push(h)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}var y=r.length>0?"".concat(r.join("|"),"|").concat(n.join(",")):n.join(",");if(this.fullConfig.cookieAdapter){var m=o({},this.fullConfig.cookieOptions);this.isServerSide&&(void 0===m.httpOnly&&(m.httpOnly=!0),void 0===m.secure&&(m.secure=!0),void 0===m.sameSite&&(m.sameSite="lax")),this.fullConfig.cookieAdapter.set(this.fullConfig.cookieName,y,m)}else if("undefined"!=typeof document){m=this.fullConfig.cookieOptions||{};var b="".concat(this.fullConfig.cookieName,"=").concat(encodeURIComponent(y));m.path&&(b+=";path=".concat(m.path)),m.maxAge&&(b+=";max-age=".concat(m.maxAge));var x=m;if(x.expires){var _=x.expires instanceof Date?x.expires.toUTCString():x.expires;b+=";expires=".concat(_)}m.domain&&(b+=";domain=".concat(m.domain)),m.secure&&(b+=";secure"),m.sameSite&&(b+=";samesite=".concat(m.sameSite)),document.cookie=b}this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Persisted to cookie:",y)}},t.prototype.applyOverridesWithFetching=function(e,t){return a(this,void 0,void 0,function(){var i,r,n,o,a,c,f,g,v,p,h,y,m,b,x,_,k,C;return s(this,function(s){switch(s.label){case 0:(0,d.logDebug)("[OverridesPlugin] Initializing with overrides:",e),(0,d.logDebug)("[OverridesPlugin] Dev environment:",t),i=[],r=new Set;try{for(n=l(Object.entries(e)),o=n.next();!o.done;o=n.next())a=u(o.value,2),c=a[0],m=a[1],1===(f="number"==typeof m?{variant:m}:m).env?((0,d.logDebug)("[OverridesPlugin] ".concat(c," categorized as DEV experiment (env=1)")),i.push([c,f])):2===f.env&&f.id?((0,d.logDebug)("[OverridesPlugin] ".concat(c," categorized as DRAFT experiment (env=2, id=").concat(f.id,")")),r.add(f.id)):(0,d.logDebug)("[OverridesPlugin] ".concat(c," categorized as RUNNING experiment (env=").concat(f.env||0,")"))}catch(e){x={error:e}}finally{try{o&&!o.done&&(_=n.return)&&_.call(n)}finally{if(x)throw x.error}}return(0,d.logDebug)("[OverridesPlugin] Categorization summary:",{total_overrides:Object.keys(e).length,dev_experiments:i.length,draft_experiments:r.size,running_experiments:Object.keys(e).length-i.length-r.size,dev_environment:t}),r.size>0?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(r.size," DRAFT experiments from API")),[4,this.fetchFromAPI(Array.from(r))]):[3,2];case 1:s.sent(),s.label=2;case 2:return g=t||this.fullConfig.environment||null,i.length>0&&g?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(i.length," DEV experiments for environment: ").concat(g)),[4,this.fetchFromDevSDK(i,g)]):[3,4];case 3:return s.sent(),[3,5];case 4:i.length>0&&(0,d.logDebug)("[OverridesPlugin] Have ".concat(i.length," DEV experiments but NO devEnv specified - NOT fetching")),s.label=5;case 5:try{for(v=l(Object.entries(e)),p=v.next();!p.done;p=v.next())h=u(p.value,2),y=h[0],m=h[1],b="number"==typeof m?m:m.variant,this.fullConfig.context.override(y,b),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Override: ".concat(y," -> variant ").concat(b))}catch(e){k={error:e}}finally{try{p&&!p.done&&(C=v.return)&&C.call(v)}finally{if(k)throw k.error}}return[2]}})})},t.prototype.fetchFromAPI=function(e){return a(this,void 0,void 0,function(){var t,i,r,n,o,a;return s(this,function(s){switch(s.label){case 0:if(0===e.length)return this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No experiment IDs to fetch from API"),[2];(t=this.fullConfig.absmartlyEndpoint)||(t=this.fullConfig.sdkEndpoint.replace(".absmartly.io",".absmartly.com")),t.endsWith("/v1")&&(t=t.slice(0,-3)),t.startsWith("http")||(t="https://".concat(t)),i="".concat(t,"/v1/experiments?ids=").concat(e.join(",")),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching non-running experiments from API:",i),s.label=1;case 1:return s.trys.push([1,4,,5]),r={"Content-Type":"application/json"},this.fullConfig.sdkApiKey&&(r.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(i,{method:"GET",credentials:"include",headers:r,mode:"cors"})];case 2:return n=s.sent(),(0,d.logDebug)("[OverridesPlugin] API Response status:",n.status,n.statusText),n.ok?[4,n.json()]:((0,d.logDebug)("[OverridesPlugin] API request failed with status ".concat(n.status)),401===n.status&&(0,d.logDebug)("[OverridesPlugin] Check if you need to log in to the ABsmartly console first"),[2]);case 3:return(o=s.sent()).experiments&&(this.injectExperimentsIntoContext(o.experiments),this.notifyExperimentsAdded()),[3,5];case 4:return a=s.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from API:",a),[3,5];case 5:return[2]}})})},t.prototype.fetchFromDevSDK=function(e,t){return a(this,void 0,void 0,function(){var e,i,r,n,a,l,c;return s(this,function(s){switch(s.label){case 0:(e=this.fullConfig.sdkEndpoint).startsWith("http")||(e="https://".concat(e)),e.endsWith("/v1")&&(e=e.slice(0,-3)),i="".concat(e,"/v1/context?environment=").concat(encodeURIComponent(t)),this.fullConfig.application&&(i+="&application=".concat(encodeURIComponent(this.fullConfig.application))),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching development experiments from SDK:",i),s.label=1;case 1:return s.trys.push([1,4,,5]),r={},this.fullConfig.sdkApiKey&&(r.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(i,{method:"GET",headers:r})];case 2:return n=s.sent(),(0,d.logDebug)("[OverridesPlugin] DEV Response status:",n.status,n.statusText),n.ok?[4,n.json()]:((0,d.logDebug)("[OverridesPlugin] DEV SDK request failed with status ".concat(n.status)),[2]);case 3:return(a=s.sent()).experiments&&(l=Object.entries(a.experiments).map(function(e){var t=u(e,2),i=t[0],r=t[1];return o(o({},r),{name:i})}),this.injectExperimentsIntoContext(l),this.notifyExperimentsAdded()),[3,5];case 4:return c=s.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from dev SDK:",c),[3,5];case 5:return[2]}})})},t.prototype.injectExperimentsIntoContext=function(e){var t,i,r,n,a,s=this.fullConfig.context.data.bind(this.fullConfig.context),c=new Map;try{for(var f=l(e),g=f.next();!g.done;g=f.next()){var v=g.value,p={id:v.id,name:v.name,unitType:(null===(n=v.unit_type)||void 0===n?void 0:n.name)||"user_id",iteration:v.iteration||1,seedHi:0,seedLo:0,split:v.split||[],trafficSeedHi:0,trafficSeedLo:0,trafficSplit:[0,1],fullOnVariant:0,applications:(null===(a=v.applications)||void 0===a?void 0:a.map(function(e){var t;return{name:(null===(t=e.application)||void 0===t?void 0:t.name)||e.name}}))||[],variants:[],audience:v.audience||"",audienceStrict:v.audience_strict||!1};if(v.variants&&Array.isArray(v.variants))for(var h=0;h<v.variants.length;h++){var y=v.variants[h],m={name:y.name||"Variant ".concat(h),config:"string"==typeof y.config?y.config:JSON.stringify(y.config||{})};if(y.variables)m.variables=y.variables;else if(y.config)try{var b="string"==typeof y.config?JSON.parse(y.config):y.config,x=this.fullConfig.domChangesFieldName;b[x]&&(m.variables=((r={})[x]=b[x],r),(0,d.logDebug)("[OverridesPlugin] Variant ".concat(h," has DOM changes field '").concat(x,"'")))}catch(e){(0,d.logDebug)("[OverridesPlugin] Failed to parse variant config:",e)}p.variants[h]=m}c.set(v.name,p)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}this.fullConfig.context.data=function(){var e,t,i=s();if(!i)return i;var r=i.experiments||[],n=new Set(r.map(function(e){return e.name})),a=function(e,t){if(n.has(e)){var i=r.findIndex(function(t){return t.name===e});i>=0&&(r[i]=t)}else r.push(t)};try{for(var d=l(c),f=d.next();!f.done;f=d.next()){var g=u(f.value,2);a(g[0],g[1])}}catch(t){e={error:t}}finally{try{f&&!f.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}return o(o({},i),{experiments:r})},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Injected ".concat(e.length," experiments into context"))},t.prototype.onExperimentsAdded=function(e){this.onExperimentsAddedCallbacks.push(e)},t.prototype.notifyExperimentsAdded=function(){var e,t;this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Notifying ".concat(this.onExperimentsAddedCallbacks.length," listeners about new experiments"));try{for(var i=l(this.onExperimentsAddedCallbacks),r=i.next();!r.done;r=i.next()){var n=r.value;try{n()}catch(e){(0,d.logDebug)("[OverridesPlugin] Error in experiments added callback:",e)}}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},t.prototype.registerWithContext=function(){this.fullConfig.context&&(this.fullConfig.context.__plugins||(this.fullConfig.context.__plugins={}),this.fullConfig.context.__plugins.overridesPlugin={name:"OverridesPlugin",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides","api-fetch","dev-environments"],instance:this,timestamp:Date.now()},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Registered with context at __plugins.overridesPlugin"))},t.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.fullConfig.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.fullConfig.context.__plugins.overridesPlugin,this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Unregistered from context"))},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.unregisterFromContext(),this.onExperimentsAddedCallbacks=[]},t}(c.OverridesPluginLite);t.OverridesPlugin=g},319:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCookie=function(e){var t,i="; ".concat(document.cookie).split("; ".concat(e,"="));if(2===i.length){return(null===(t=i.pop())||void 0===t?void 0:t.split(";").shift())||null}return null},t.setCookie=n,t.deleteCookie=function(e,t){void 0===t&&(t={});n(e,"",-1,t)},t.generateUniqueId=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2)},t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.isLocalStorageAvailable=function(){try{var e="__localStorage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}};var r=i(609);function n(e,t,i,n){void 0===n&&(n={});try{var o=new Date;o.setTime(o.getTime()+24*i*60*60*1e3);var a="expires=".concat(o.toUTCString()),s=n.path||"/",l="".concat(e,"=").concat(t,";").concat(a,";path=").concat(s);n.domain&&"localhost"!==n.domain&&(l+=";domain=".concat(n.domain));var u=n.sameSite||"Lax";return l+=";SameSite=".concat(u),n.secure&&(l+=";Secure"),document.cookie=l,!0}catch(t){return(0,r.logDebug)("Unable to set cookie ".concat(e,":"),t),!1}}},609:function(e,t,i){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},n=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a},o=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.logDebug=s,t.logChangeApplication=function(e,i,r,n,o){if(t.DEBUG){s("".concat(o?"✓":"✗"," Applied ").concat(r," change to ").concat(n," element(s)"),{experimentName:e,selector:i,changeType:r,elementsCount:n,success:o})}},t.logChangeRemoval=function(e,i,r,n){if(t.DEBUG){s("Restored ".concat(n," element(s) to original state"),{experimentName:e,selector:i,changeType:r,elementsCount:n,action:"restore"})}},t.logExperimentSummary=function(e,i,r,n){if(t.DEBUG){s('Experiment "'.concat(e,'" summary'),{experimentName:e,totalChanges:i,successfulChanges:r,pendingChanges:n,successRate:i>0?"".concat(Math.round(r/i*100),"%"):"N/A"})}},t.logStateOperation=function(e,i,r,n){if(t.DEBUG){s("State ".concat(e," operation"),{operation:e,selector:i,changeType:r,experimentName:n})}},t.logVisibilityEvent=function(e,i,r){if(t.DEBUG){s(r?"Element became visible - experiment triggered":"Element visibility changed",{experimentName:e,selector:i.className||i.id||i.tagName,triggered:r,action:"visibility"})}},t.logMessage=function(e,i,r){if(t.DEBUG){s("Message ".concat(e,": ").concat(i),{direction:e,messageType:i,payload:r,bridge:"extension"})}},t.logPerformance=function(e,i,n){if(t.DEBUG){s("Performance: ".concat(e," took ").concat(i,"ms"),r({operation:e,duration:i,performance:!0},n))}},t.logProductionWarn=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.warn.apply(console,o([e],n(t),!1))};var a=i(834);function s(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];if(t.DEBUG)if(2===e.length&&"string"==typeof e[0]&&"object"==typeof e[1]){var r=n(e,2),a=r[0],s=r[1];if(a.includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Performance:")&&(null==s?void 0:s.duration)&&s.duration<5)return;if(a.includes("Message sent:")||a.includes("Message received:"))return;var l=(new Date).toISOString(),u="[ABsmartly Debug]";console.log("".concat(u," [").concat(l,"] ").concat(a),s)}else if(1===e.length&&"string"==typeof e[0]){if((a=e[0]).includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Message sent:")||a.includes("Message received:"))return;l=(new Date).toISOString(),u="[ABsmartly Debug]";console.log("".concat(u," [").concat(l,"] ").concat(a))}else console.log.apply(console,o([],n(e),!1))}t.DEBUG=a.BUILD_DEBUG},637:function(e,t,i){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserCookieAdapter=void 0;var n=i(319),o=function(){function e(){}return e.prototype.get=function(e){var t=(0,n.getCookie)(e);return t?decodeURIComponent(t):null},e.prototype.set=function(e,t,i){var r="".concat(e,"=").concat(encodeURIComponent(t));i&&(i.path&&(r+="; path=".concat(i.path)),i.domain&&(r+="; domain=".concat(i.domain)),void 0!==i.maxAge&&(r+="; max-age=".concat(i.maxAge)),i.secure&&(r+="; secure"),i.sameSite&&(r+="; samesite=".concat(i.sameSite))),document.cookie=r},e.prototype.delete=function(e,t){this.set(e,"",r(r({},t),{maxAge:0}))},e}();t.BrowserCookieAdapter=o},639:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BUILD_DEBUG=t.BUILD_VERSION=void 0,t.BUILD_VERSION="1.3.0",t.BUILD_DEBUG=!1},943:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=function(e,t){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__||(window.__ABSMARTLY_PLUGINS__={});window.__ABSMARTLY_PLUGINS__[e]=t},t.unregisterPlugin=function(e){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__&&delete window.__ABSMARTLY_PLUGINS__[e]},t.isPluginRegistered=function(e){var t;if("undefined"==typeof window)return!1;return!(!window.__ABSMARTLY_PLUGINS__||!(null===(t=window.__ABSMARTLY_PLUGINS__[e])||void 0===t?void 0:t.initialized))},t.getRegisteredPlugins=function(){if("undefined"==typeof window)return{};return window.__ABSMARTLY_PLUGINS__||{}}},977:function(e,t,i){var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginFull=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i(248).OverridesPlugin);t.OverridesPluginFull=o}},t={};var i=function i(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,i),o.exports}(241);return i})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ABsmartlyOverridesFull=t():e.ABsmartlyOverridesFull=t()}(this,()=>(()=>{"use strict";var e={44:function(e,t,i){var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var s=i(609),l=i(943),u=i(186),c=function(){function e(e){var t,i,r,n,o;if(this.initialized=!1,!e.context)throw new Error("[OverridesPluginLite] Context is required");this.config={context:e.context,cookieName:null!==(t=e.cookieName)&&void 0!==t?t:"absmartly_overrides",useQueryString:null===(i=e.useQueryString)||void 0===i||i,queryPrefix:null!==(r=e.queryPrefix)&&void 0!==r?r:"exp_",persistQueryToCookie:null!==(n=e.persistQueryToCookie)&&void 0!==n&&n,debug:null!==(o=e.debug)&&void 0!==o&&o},this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Initialized with config:",{cookieName:this.config.cookieName,useQueryString:this.config.useQueryString,queryPrefix:this.config.queryPrefix})}return e.prototype.ready=function(){return r(this,void 0,void 0,function(){var e,t,i,r,l,u,c,d,f,g,v;return n(this,function(n){if(this.initialized)return this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Already initialized"),[2];if(this.initialized=!0,this.registerWithContext(),this.registerGlobally(),e={},this.config.useQueryString&&"undefined"!=typeof window&&(e=this.getQueryStringOverrides(),this.config.persistQueryToCookie&&this.config.cookieName&&Object.keys(e).length>0&&this.persistOverridesToCookie(e)),0===Object.keys(e).length&&this.config.cookieName&&(e=this.getCookieOverrides()),0===Object.keys(e).length)return this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] No overrides found"),[2];try{for(t=o(Object.entries(e)),i=t.next();!i.done;i=t.next())r=a(i.value,2),l=r[0],u=r[1],c="number"==typeof u?u:u.variant,isNaN(c)?this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Skipping invalid variant for ".concat(l,": ").concat(c)):(null===(v=(g=this.config.context).override)||void 0===v||v.call(g,l,c),this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Override: ".concat(l," -> variant ").concat(c)))}catch(e){d={error:e}}finally{try{i&&!i.done&&(f=t.return)&&f.call(t)}finally{if(d)throw d.error}}return[2]})})},e.prototype.initialize=function(){return r(this,void 0,void 0,function(){return n(this,function(e){return[2,this.ready()]})})},e.prototype.getQueryStringOverrides=function(){if("undefined"==typeof window||!window.location)return{};var e=(0,u.getQueryStringOverrides)(this.config.queryPrefix);return this.config.debug&&Object.keys(e).length>0&&(0,s.logDebug)("[OverridesPluginLite] Query string overrides:",e),e},e.prototype.getCookieOverrides=function(){return"undefined"==typeof document?{}:(0,u.getCookieOverrides)(this.config.cookieName)},e.prototype.persistOverridesToCookie=function(e){if(this.config.cookieName&&"undefined"!=typeof document&&((0,u.persistOverridesToCookie)(e,{cookieName:this.config.cookieName}),this.config.debug)){var t=(0,u.serializeOverrides)(e);(0,s.logDebug)("[OverridesPluginLite] Persisted to cookie:",t)}},e.prototype.registerWithContext=function(){this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.overridesPlugin={name:"OverridesPluginLite",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides"],instance:this,timestamp:Date.now()},this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Registered with context at __plugins.overridesPlugin"))},e.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.config.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.config.context.__plugins.overridesPlugin,this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Unregistered from context"))},e.prototype.destroy=function(){this.initialized=!1,this.unregisterFromContext(),this.unregisterGlobally()},e.prototype.registerGlobally=function(){(0,l.registerPlugin)("overrides",{name:"OverridesPluginLite",version:"1.0.0",initialized:!0,timestamp:Date.now(),capabilities:["cookie-overrides","query-overrides"],instance:this}),this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Registered in global window.__ABSMARTLY_PLUGINS__")},e.prototype.unregisterGlobally=function(){(0,l.unregisterPlugin)("overrides"),this.config.debug&&(0,s.logDebug)("[OverridesPluginLite] Unregistered from global registry")},e}();t.OverridesPluginLite=c},91:function(e,t,i){var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},o=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a},a=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiePlugin=void 0;var l=i(609),u=i(319),c=function(){function e(e){void 0===e&&(e={}),this.context=e.context,this.debug=e.debug||!1,this.cookieDomain=e.cookieDomain||".absmartly.com",this.cookiePath=e.cookiePath||"/",this.sameSite=e.sameSite||"Lax",this.secure=e.secure||!1,this.cookieExpiryDays=e.cookieExpiryDays||730,this.unitIdCookieName=e.unitIdCookieName||"abs",this.publicIdCookieName=e.publicIdCookieName||"abs_public",this.expiryCookieName=e.expiryCookieName||"abs_expiry",this.utmCookieName=e.utmCookieName||"abs_utm_params",this.utmParams=e.utmParamsList||["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],this.autoUpdateExpiry=!1!==e.autoUpdateExpiry,this.expiryCheckInterval=e.expiryCheckInterval||30}return e.prototype.debugLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&l.logDebug.apply(void 0,a(["[CookiePlugin]"],o(e),!1))},e.prototype.setCookie=function(e,t,i){var r=void 0!==i?i:this.cookieExpiryDays,n=(0,u.setCookie)(e,t,r,{domain:this.cookieDomain,path:this.cookiePath,sameSite:this.sameSite,secure:this.secure});return n&&this.debugLog("Set cookie ".concat(e,":"),t),n},e.prototype.deleteCookie=function(e){(0,u.deleteCookie)(e,{domain:this.cookieDomain,path:this.cookiePath})},e.prototype.getUnitId=function(){if(this.unitId)return this.unitId;var e=navigator.cookieEnabled,t=(0,u.isLocalStorageAvailable)(),i=null;return e&&(i=(0,u.getCookie)(this.unitIdCookieName)||(0,u.getCookie)(this.publicIdCookieName)),!i&&t&&(i=localStorage.getItem("abs_id")),i&&(this.unitId=i),i},e.prototype.setUnitId=function(e){this.unitId=e;var t=navigator.cookieEnabled,i=(0,u.isLocalStorageAvailable)();t&&(this.setCookie(this.unitIdCookieName,e),this.setCookie(this.publicIdCookieName,e),this.autoUpdateExpiry&&this.updateExpiryTimestamp()),i&&localStorage.setItem("abs_id",e),this.debugLog("Unit ID set:",e)},e.prototype.generateAndSetUnitId=function(){var e=(0,u.generateUniqueId)();return this.setUnitId(e),e},e.prototype.updateExpiryTimestamp=function(){if(navigator.cookieEnabled){var e=Date.now();this.setCookie(this.expiryCookieName,e.toString()),this.debugLog("Updated expiry timestamp:",e)}},e.prototype.isExpiryFresh=function(){if(!navigator.cookieEnabled)return!1;var e=(0,u.getCookie)(this.expiryCookieName);if(!e)return!1;try{var t=parseInt(e,10),i=(Date.now()-t)/864e5,r=i<=this.expiryCheckInterval;return this.debugLog("Expiry check:",{daysSinceSet:i,isFresh:r}),r}catch(e){return this.debugLog("Error parsing expiry cookie:",e),!1}},e.prototype.getUtmParams=function(){var e,t,i,r,n={},o=new URLSearchParams(window.location.search);try{for(var a=s(this.utmParams),l=a.next();!l.done;l=a.next()){var u=l.value;(g=o.get(u))&&(n[u]=g)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(0===Object.keys(n).length&&document.referrer)try{var c=new URL(document.referrer);try{for(var d=s(this.utmParams),f=d.next();!f.done;f=d.next()){var g;u=f.value;(g=c.searchParams.get(u))&&(n[u]=g)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}}catch(e){this.debugLog("Error parsing referrer URL:",e)}if(0===Object.keys(n).length){var v=this.getStoredUtmParams();if(v)return v}return n},e.prototype.storeUtmParams=function(e){if(0!==Object.keys(e).length){var t={params:e,timestamp:Date.now()},i=navigator.cookieEnabled;if((0,u.isLocalStorageAvailable)())try{localStorage.setItem(this.utmCookieName,JSON.stringify(t)),this.debugLog("Stored UTM params in localStorage:",e)}catch(e){this.debugLog("Failed to store UTM params in localStorage:",e)}i&&(this.setCookie(this.utmCookieName,JSON.stringify(t),30),this.debugLog("Stored UTM params in cookie:",e))}},e.prototype.getStoredUtmParams=function(){var e=null,t=(0,u.isLocalStorageAvailable)(),i=navigator.cookieEnabled;if(t)try{e=localStorage.getItem(this.utmCookieName)}catch(e){this.debugLog("Failed to get UTM params from localStorage:",e)}if(!e&&i&&(e=(0,u.getCookie)(this.utmCookieName)),e)try{var r=JSON.parse(e);if(Date.now()-r.timestamp<2592e6)return r.params}catch(e){this.debugLog("Failed to parse stored UTM params:",e)}return null},e.prototype.applyUtmAttributesToContext=function(e){var t,i,r=e||this.context;if(r){var n=this.getUtmParams();Object.keys(n).length>0&&this.storeUtmParams(n);try{for(var a=s(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=o(u.value,2),d=c[0],f=c[1],g=d.slice(4);r.attribute(g,f),this.debugLog("Set attribute ".concat(g,":"),f)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}}else(0,l.logDebug)("[CookiePlugin] No context available to apply UTM attributes")},e.prototype.clearAllCookies=function(){this.deleteCookie(this.unitIdCookieName),this.deleteCookie(this.publicIdCookieName),this.deleteCookie(this.expiryCookieName),this.deleteCookie(this.utmCookieName),(0,u.isLocalStorageAvailable)()&&(localStorage.removeItem("abs_id"),localStorage.removeItem(this.utmCookieName)),this.unitId=void 0,this.debugLog("All cookies and storage cleared")},e.prototype.ready=function(){return r(this,void 0,void 0,function(){var e;return n(this,function(t){return this.debugLog("Initializing CookiePlugin"),(e=this.getUnitId())?(this.debugLog("Using existing unit ID:",e),this.autoUpdateExpiry&&!this.isExpiryFresh()&&this.updateExpiryTimestamp()):(e=this.generateAndSetUnitId(),this.debugLog("Generated new unit ID:",e)),this.context&&this.applyUtmAttributesToContext(),this.debugLog("CookiePlugin initialized successfully"),[2]})})},e.prototype.initialize=function(){return r(this,void 0,void 0,function(){return n(this,function(e){return[2,this.ready()]})})},e.prototype.setContext=function(e){this.context=e,this.debugLog("Context set for CookiePlugin")},e.prototype.needsServerSideCookie=function(){var e=this.getUnitId(),t=navigator.cookieEnabled,i=(0,u.isLocalStorageAvailable)();if(e){if(t&&!this.isExpiryFresh())return this.debugLog("Existing ID present but expiry not fresh - need worker call"),!0}else if(t||i){var r=(0,u.getCookie)(this.expiryCookieName);return this.debugLog(r?"No existing ID but expiry cookie exists - need worker call":"No existing ID and no expiry cookie - need worker call"),!0}return!1},e.prototype.trackLanding=function(e){var t=e||this.context;if(t){var i=new URLSearchParams(window.location.search),r=this.utmParams.some(function(e){return i.get(e)}),n=document.referrer,o=n&&!n.includes(this.cookieDomain.replace(".","")),a=navigator.cookieEnabled||(0,u.isLocalStorageAvailable)(),s=!!((0,u.getCookie)(this.unitIdCookieName)||(0,u.getCookie)(this.publicIdCookieName)||(0,u.getCookie)(this.expiryCookieName)||(0,u.isLocalStorageAvailable)()&&localStorage.getItem("abs_id"));if(r||o||a&&!s){var c={referrer_url:n||"",landing_url:window.location.href,accepts_cookies:navigator.cookieEnabled,accepts_storage:(0,u.isLocalStorageAvailable)(),has_utm:r};this.debugLog("Tracking landing:",c),t.track("landing",c)}}else(0,l.logDebug)("[CookiePlugin] No context available for tracking landing")},e}();t.CookiePlugin=c},186:function(e,t){var i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a};function n(e,n){var o,a;if(void 0===e&&(e=t.DEFAULT_OVERRIDE_QUERY_PREFIX),"undefined"==typeof window&&!n)return{};var s=n||new URLSearchParams(window.location.search),l={};try{for(var u=i(s.entries()),c=u.next();!c.done;c=u.next()){var d=r(c.value,2),f=d[0],g=d[1];if(f.startsWith(e)){var v=f.substring(e.length);if(v){var p=g.split(","),h=parseInt(p[0],10);isNaN(h)||(1===p.length?l[v]=h:l[v]={variant:h,env:p[1]?parseInt(p[1],10):void 0,id:p[2]?parseInt(p[2],10):void 0})}}}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}return l}function o(e){var t,n;if(!e)return{};var o={},a=e;e.includes("|")&&(a=(p=e.split("|"))[p.length-1]);if(!a)return{};var s=a.split(",");try{for(var l=i(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=r(c.split(":"),2),f=d[0],g=d[1];if(f&&g){var v=decodeURIComponent(f),p=g.split("."),h=parseInt(p[0],10);isNaN(h)||(1===p.length?o[v]=h:o[v]={variant:h,env:p[1]?parseInt(p[1],10):void 0,id:p[2]?parseInt(p[2],10):void 0})}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o}function a(e,r){var n,a;void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);var s=null!=r?r:"undefined"!=typeof document?document.cookie:"";if(!s)return{};var l=e+"=",u=s.split(";");try{for(var c=i(u),d=c.next();!d.done;d=c.next()){var f=d.value;if(0===(f=f.trim()).indexOf(l))return o(decodeURIComponent(f.substring(l.length)))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}return{}}function s(e){var t,n,o=[];try{for(var a=i(Object.entries(e)),s=a.next();!s.done;s=a.next()){var l=r(s.value,2),u=l[0],c=l[1],d=encodeURIComponent(u);if("number"==typeof c)o.push("".concat(d,":").concat(c));else{var f="".concat(d,":").concat(c.variant);void 0!==c.env&&(f+=".".concat(c.env)),void 0!==c.id&&(f+=".".concat(c.id)),o.push(f)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o.join(",")}function l(e,i){if(void 0===i&&(i={}),"undefined"!=typeof document){var r=i.cookieName||t.DEFAULT_OVERRIDE_COOKIE_NAME,n=i.maxAge||86400,o=s(e);document.cookie="".concat(r,"=").concat(encodeURIComponent(o),";path=/;max-age=").concat(n)}}function u(e){var t,n,o={};try{for(var a=i(Object.entries(e)),s=a.next();!s.done;s=a.next()){var l=r(s.value,2),u=l[0],c=l[1];o[u]="number"==typeof c?c:c.variant}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERRIDE_QUERY_PREFIX=t.DEFAULT_OVERRIDE_COOKIE_NAME=void 0,t.getQueryStringOverrides=n,t.parseOverrideCookie=o,t.getCookieOverrides=a,t.serializeOverrides=s,t.persistOverridesToCookie=l,t.getOverrides=function(e,i,r,o){void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);void 0===i&&(i=t.DEFAULT_OVERRIDE_QUERY_PREFIX);var s=n(i,r);if(Object.keys(s).length>0)return"undefined"!=typeof document&&l(s,{cookieName:e,maxAge:86400}),u(s);return u(a(e,o))},t.DEFAULT_OVERRIDE_COOKIE_NAME="absmartly_overrides",t.DEFAULT_OVERRIDE_QUERY_PREFIX="exp_"},241:function(e,t,i){var r=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||r(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiePlugin=t.BrowserCookieAdapter=t.OverridesPlugin=t.OverridesPluginFull=void 0;var o=i(977);Object.defineProperty(t,"OverridesPluginFull",{enumerable:!0,get:function(){return o.OverridesPluginFull}}),Object.defineProperty(t,"OverridesPlugin",{enumerable:!0,get:function(){return o.OverridesPluginFull}});var a=i(637);Object.defineProperty(t,"BrowserCookieAdapter",{enumerable:!0,get:function(){return a.BrowserCookieAdapter}});var s=i(91);Object.defineProperty(t,"CookiePlugin",{enumerable:!0,get:function(){return s.CookiePlugin}}),n(i(639),t),t.default=o.OverridesPluginFull},248:function(e,t,i){var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},l=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPlugin=void 0;var c=i(44),d=i(609),f=i(186),g=function(e){function t(t){var i,r,n,o,a,s,l,u,c,f,g,v,p,h,y,m,b,x,_,k,C,O=e.call(this,{context:t.context,cookieName:t.cookieName,useQueryString:null!==(i=t.useQueryString)&&void 0!==i?i:"undefined"!=typeof window,queryPrefix:null!==(r=t.queryPrefix)&&void 0!==r?r:"exp_",persistQueryToCookie:null!==(n=t.persistQueryToCookie)&&void 0!==n&&n,debug:null!==(o=t.debug)&&void 0!==o&&o})||this;if(O.onExperimentsAddedCallbacks=[],!t.context)throw new Error("[OverridesPlugin] Context is required");O.isServerSide="undefined"==typeof window;var P,w=t.sdkEndpoint;w||((P=t.context)._endpoint?w=P._endpoint:(null===(a=P._config)||void 0===a?void 0:a.endpoint)?w=P._config.endpoint:(null===(s=P._dataProvider)||void 0===s?void 0:s._endpoint)?w=P._dataProvider._endpoint:(null===(l=P._options)||void 0===l?void 0:l.endpoint)&&(w=P._options.endpoint.replace("/v1","")));if(!w&&!t.absmartlyEndpoint&&!((P=t.context)._endpoint||(null===(u=P._config)||void 0===u?void 0:u.endpoint)||(null===(c=P._dataProvider)||void 0===c?void 0:c._endpoint)||(null===(f=P._options)||void 0===f?void 0:f.endpoint)))throw new Error("[OverridesPlugin] SDK endpoint must be provided if not available from context");return O.fullConfig={context:t.context,cookieName:t.cookieName,cookieAdapter:t.cookieAdapter,cookieOptions:null!==(g=t.cookieOptions)&&void 0!==g?g:{path:"/"},useQueryString:null!==(v=t.useQueryString)&&void 0!==v?v:!O.isServerSide,queryPrefix:null!==(p=t.queryPrefix)&&void 0!==p?p:"exp_",envParam:null!==(h=t.envParam)&&void 0!==h?h:"env",persistQueryToCookie:null!==(y=t.persistQueryToCookie)&&void 0!==y&&y,url:t.url,absmartlyEndpoint:null!==(m=t.absmartlyEndpoint)&&void 0!==m?m:"",sdkEndpoint:w||"",domChangesFieldName:null!==(b=t.domChangesFieldName)&&void 0!==b?b:"__dom_changes",sdkApiKey:null!==(x=t.sdkApiKey)&&void 0!==x?x:"",application:null!==(_=t.application)&&void 0!==_?_:"",environment:null!==(k=t.environment)&&void 0!==k?k:"",debug:null!==(C=t.debug)&&void 0!==C&&C},O.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Initialized with config:",{isServerSide:O.isServerSide,cookieName:O.fullConfig.cookieName,useQueryString:O.fullConfig.useQueryString,queryPrefix:O.fullConfig.queryPrefix,envParam:O.fullConfig.envParam,persistQueryToCookie:O.fullConfig.persistQueryToCookie,sdkEndpoint:O.fullConfig.sdkEndpoint,absmartlyEndpoint:O.fullConfig.absmartlyEndpoint}),O}return n(t,e),t.prototype.ready=function(){return a(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return this.initialized?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Already initialized, skipping re-initialization"),[2]):(this.initialized=!0,this.registerWithContext(),e=this.getOverrides(),0===Object.keys(e.overrides).length?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No overrides found"),[2]):[4,this.applyOverridesWithFetching(e.overrides,e.devEnv)]);case 1:return t.sent(),[2]}})})},t.prototype.initialize=function(){return a(this,void 0,void 0,function(){return s(this,function(e){return[2,this.ready()]})})},t.prototype.getOverrides=function(){var e={overrides:{},devEnv:null};if(this.fullConfig.cookieName){var t=this.getEnhancedCookieOverrides();e.overrides=o({},t.overrides),e.devEnv=t.devEnv}if(this.fullConfig.useQueryString){var i=this.getEnhancedQueryStringOverrides();Object.keys(i.overrides).length>0&&(e.overrides=o(o({},e.overrides),i.overrides),null!==i.devEnv&&(e.devEnv=i.devEnv),this.fullConfig.persistQueryToCookie&&this.fullConfig.cookieName&&this.persistEnhancedOverridesToCookie(e))}return e},t.prototype.getEnhancedQueryStringOverrides=function(){try{var e=void 0;if(this.isServerSide){if(!this.fullConfig.url)return{overrides:{},devEnv:null};var t="string"==typeof this.fullConfig.url?new URL(this.fullConfig.url):this.fullConfig.url;e=new URLSearchParams(t.search)}else e=new URLSearchParams(window.location.search);var i=(0,f.getQueryStringOverrides)(this.fullConfig.queryPrefix,e),r=null;if(this.fullConfig.envParam){var n=e.get(this.fullConfig.envParam);n&&(r=n)}return this.fullConfig.debug&&Object.keys(i).length>0&&(0,d.logDebug)("[OverridesPlugin] Query string overrides:",i,"env:",r),{overrides:i,devEnv:r}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing query string:",e),{overrides:{},devEnv:null}}},t.prototype.getEnhancedCookieOverrides=function(){var e,t;if(!this.fullConfig.cookieName)return{overrides:{},devEnv:null};var i=null;if(this.fullConfig.cookieAdapter)i=this.fullConfig.cookieAdapter.get(this.fullConfig.cookieName);else if("undefined"!=typeof document){var r=this.fullConfig.cookieName+"=",n=document.cookie.split(";");try{for(var o=l(n),a=o.next();!a.done;a=o.next()){var s=a.value;if(0===(s=s.trim()).indexOf(r)){i=decodeURIComponent(s.substring(r.length));break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}this.fullConfig.debug&&i&&(0,d.logDebug)("[OverridesPlugin] Raw cookie value:",i);var u=this.parseEnhancedCookieValue(i);return this.fullConfig.debug&&Object.keys(u.overrides).length>0&&(0,d.logDebug)("[OverridesPlugin] Parsed cookie overrides:",u),u},t.prototype.parseEnhancedCookieValue=function(e){if(!e)return{overrides:{},devEnv:null};try{var t=null,i=e;if(e.startsWith("devEnv=")){var r=e.split("|");t=decodeURIComponent(r[0].substring(7)),i=r[1]||""}return{overrides:i?(0,f.parseOverrideCookie)(i):{},devEnv:t}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing overrides:",e),{overrides:{},devEnv:null}}},t.prototype.persistEnhancedOverridesToCookie=function(e){var t,i;if(this.fullConfig.cookieName){var r=[];e.devEnv&&r.push("devEnv=".concat(encodeURIComponent(e.devEnv)));var n=[];try{for(var a=l(Object.entries(e.overrides)),s=a.next();!s.done;s=a.next()){var c=u(s.value,2),f=c[0],g=c[1],v=encodeURIComponent(f);if("number"==typeof g)n.push("".concat(v,":").concat(g));else{var p=g,h="".concat(v,":").concat(p.variant);void 0!==p.env&&(h+=".".concat(p.env)),void 0!==p.id&&(h+=".".concat(p.id)),n.push(h)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}var y=r.length>0?"".concat(r.join("|"),"|").concat(n.join(",")):n.join(",");if(this.fullConfig.cookieAdapter){var m=o({},this.fullConfig.cookieOptions);this.isServerSide&&(void 0===m.httpOnly&&(m.httpOnly=!0),void 0===m.secure&&(m.secure=!0),void 0===m.sameSite&&(m.sameSite="lax")),this.fullConfig.cookieAdapter.set(this.fullConfig.cookieName,y,m)}else if("undefined"!=typeof document){m=this.fullConfig.cookieOptions||{};var b="".concat(this.fullConfig.cookieName,"=").concat(encodeURIComponent(y));m.path&&(b+=";path=".concat(m.path)),m.maxAge&&(b+=";max-age=".concat(m.maxAge));var x=m;if(x.expires){var _=x.expires instanceof Date?x.expires.toUTCString():x.expires;b+=";expires=".concat(_)}m.domain&&(b+=";domain=".concat(m.domain)),m.secure&&(b+=";secure"),m.sameSite&&(b+=";samesite=".concat(m.sameSite)),document.cookie=b}this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Persisted to cookie:",y)}},t.prototype.applyOverridesWithFetching=function(e,t){return a(this,void 0,void 0,function(){var i,r,n,o,a,c,f,g,v,p,h,y,m,b,x,_,k,C;return s(this,function(s){switch(s.label){case 0:(0,d.logDebug)("[OverridesPlugin] Initializing with overrides:",e),(0,d.logDebug)("[OverridesPlugin] Dev environment:",t),i=[],r=new Set;try{for(n=l(Object.entries(e)),o=n.next();!o.done;o=n.next())a=u(o.value,2),c=a[0],m=a[1],1===(f="number"==typeof m?{variant:m}:m).env?((0,d.logDebug)("[OverridesPlugin] ".concat(c," categorized as DEV experiment (env=1)")),i.push([c,f])):2===f.env&&f.id?((0,d.logDebug)("[OverridesPlugin] ".concat(c," categorized as DRAFT experiment (env=2, id=").concat(f.id,")")),r.add(f.id)):(0,d.logDebug)("[OverridesPlugin] ".concat(c," categorized as RUNNING experiment (env=").concat(f.env||0,")"))}catch(e){x={error:e}}finally{try{o&&!o.done&&(_=n.return)&&_.call(n)}finally{if(x)throw x.error}}return(0,d.logDebug)("[OverridesPlugin] Categorization summary:",{total_overrides:Object.keys(e).length,dev_experiments:i.length,draft_experiments:r.size,running_experiments:Object.keys(e).length-i.length-r.size,dev_environment:t}),r.size>0?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(r.size," DRAFT experiments from API")),[4,this.fetchFromAPI(Array.from(r))]):[3,2];case 1:s.sent(),s.label=2;case 2:return g=t||this.fullConfig.environment||null,i.length>0&&g?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(i.length," DEV experiments for environment: ").concat(g)),[4,this.fetchFromDevSDK(i,g)]):[3,4];case 3:return s.sent(),[3,5];case 4:i.length>0&&(0,d.logDebug)("[OverridesPlugin] Have ".concat(i.length," DEV experiments but NO devEnv specified - NOT fetching")),s.label=5;case 5:try{for(v=l(Object.entries(e)),p=v.next();!p.done;p=v.next())h=u(p.value,2),y=h[0],m=h[1],b="number"==typeof m?m:m.variant,this.fullConfig.context.override(y,b),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Override: ".concat(y," -> variant ").concat(b))}catch(e){k={error:e}}finally{try{p&&!p.done&&(C=v.return)&&C.call(v)}finally{if(k)throw k.error}}return[2]}})})},t.prototype.fetchFromAPI=function(e){return a(this,void 0,void 0,function(){var t,i,r,n,o,a;return s(this,function(s){switch(s.label){case 0:if(0===e.length)return this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No experiment IDs to fetch from API"),[2];(t=this.fullConfig.absmartlyEndpoint)||(t=this.fullConfig.sdkEndpoint.replace(".absmartly.io",".absmartly.com")),t.endsWith("/v1")&&(t=t.slice(0,-3)),t.startsWith("http")||(t="https://".concat(t)),i="".concat(t,"/v1/experiments?ids=").concat(e.join(",")),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching non-running experiments from API:",i),s.label=1;case 1:return s.trys.push([1,4,,5]),r={"Content-Type":"application/json"},this.fullConfig.sdkApiKey&&(r.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(i,{method:"GET",credentials:"include",headers:r,mode:"cors"})];case 2:return n=s.sent(),(0,d.logDebug)("[OverridesPlugin] API Response status:",n.status,n.statusText),n.ok?[4,n.json()]:((0,d.logDebug)("[OverridesPlugin] API request failed with status ".concat(n.status)),401===n.status&&(0,d.logDebug)("[OverridesPlugin] Check if you need to log in to the ABsmartly console first"),[2]);case 3:return(o=s.sent()).experiments&&(this.injectExperimentsIntoContext(o.experiments),this.notifyExperimentsAdded()),[3,5];case 4:return a=s.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from API:",a),[3,5];case 5:return[2]}})})},t.prototype.fetchFromDevSDK=function(e,t){return a(this,void 0,void 0,function(){var e,i,r,n,a,l,c;return s(this,function(s){switch(s.label){case 0:(e=this.fullConfig.sdkEndpoint).startsWith("http")||(e="https://".concat(e)),e.endsWith("/v1")&&(e=e.slice(0,-3)),i="".concat(e,"/v1/context?environment=").concat(encodeURIComponent(t)),this.fullConfig.application&&(i+="&application=".concat(encodeURIComponent(this.fullConfig.application))),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching development experiments from SDK:",i),s.label=1;case 1:return s.trys.push([1,4,,5]),r={},this.fullConfig.sdkApiKey&&(r.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(i,{method:"GET",headers:r})];case 2:return n=s.sent(),(0,d.logDebug)("[OverridesPlugin] DEV Response status:",n.status,n.statusText),n.ok?[4,n.json()]:((0,d.logDebug)("[OverridesPlugin] DEV SDK request failed with status ".concat(n.status)),[2]);case 3:return(a=s.sent()).experiments&&(l=Object.entries(a.experiments).map(function(e){var t=u(e,2),i=t[0],r=t[1];return o(o({},r),{name:i})}),this.injectExperimentsIntoContext(l),this.notifyExperimentsAdded()),[3,5];case 4:return c=s.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from dev SDK:",c),[3,5];case 5:return[2]}})})},t.prototype.injectExperimentsIntoContext=function(e){var t,i,r,n,a,s=this.fullConfig.context.data.bind(this.fullConfig.context),c=new Map;try{for(var f=l(e),g=f.next();!g.done;g=f.next()){var v=g.value,p={id:v.id,name:v.name,unitType:(null===(n=v.unit_type)||void 0===n?void 0:n.name)||"user_id",iteration:v.iteration||1,seedHi:0,seedLo:0,split:v.split||[],trafficSeedHi:0,trafficSeedLo:0,trafficSplit:[0,1],fullOnVariant:0,applications:(null===(a=v.applications)||void 0===a?void 0:a.map(function(e){var t;return{name:(null===(t=e.application)||void 0===t?void 0:t.name)||e.name}}))||[],variants:[],audience:v.audience||"",audienceStrict:v.audience_strict||!1};if(v.variants&&Array.isArray(v.variants))for(var h=0;h<v.variants.length;h++){var y=v.variants[h],m={name:y.name||"Variant ".concat(h),config:"string"==typeof y.config?y.config:JSON.stringify(y.config||{})};if(y.variables)m.variables=y.variables;else if(y.config)try{var b="string"==typeof y.config?JSON.parse(y.config):y.config,x=this.fullConfig.domChangesFieldName;b[x]&&(m.variables=((r={})[x]=b[x],r),(0,d.logDebug)("[OverridesPlugin] Variant ".concat(h," has DOM changes field '").concat(x,"'")))}catch(e){(0,d.logDebug)("[OverridesPlugin] Failed to parse variant config:",e)}p.variants[h]=m}c.set(v.name,p)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}this.fullConfig.context.data=function(){var e,t,i=s();if(!i)return i;var r=i.experiments||[],n=new Set(r.map(function(e){return e.name})),a=function(e,t){if(n.has(e)){var i=r.findIndex(function(t){return t.name===e});i>=0&&(r[i]=t)}else r.push(t)};try{for(var d=l(c),f=d.next();!f.done;f=d.next()){var g=u(f.value,2);a(g[0],g[1])}}catch(t){e={error:t}}finally{try{f&&!f.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}return o(o({},i),{experiments:r})},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Injected ".concat(e.length," experiments into context"))},t.prototype.onExperimentsAdded=function(e){this.onExperimentsAddedCallbacks.push(e)},t.prototype.notifyExperimentsAdded=function(){var e,t;this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Notifying ".concat(this.onExperimentsAddedCallbacks.length," listeners about new experiments"));try{for(var i=l(this.onExperimentsAddedCallbacks),r=i.next();!r.done;r=i.next()){var n=r.value;try{n()}catch(e){(0,d.logDebug)("[OverridesPlugin] Error in experiments added callback:",e)}}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},t.prototype.registerWithContext=function(){this.fullConfig.context&&(this.fullConfig.context.__plugins||(this.fullConfig.context.__plugins={}),this.fullConfig.context.__plugins.overridesPlugin={name:"OverridesPlugin",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides","api-fetch","dev-environments"],instance:this,timestamp:Date.now()},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Registered with context at __plugins.overridesPlugin"))},t.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.fullConfig.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.fullConfig.context.__plugins.overridesPlugin,this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Unregistered from context"))},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.unregisterFromContext(),this.onExperimentsAddedCallbacks=[]},t}(c.OverridesPluginLite);t.OverridesPlugin=g},319:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCookie=function(e){var t,i="; ".concat(document.cookie).split("; ".concat(e,"="));if(2===i.length){return(null===(t=i.pop())||void 0===t?void 0:t.split(";").shift())||null}return null},t.setCookie=n,t.deleteCookie=function(e,t){void 0===t&&(t={});n(e,"",-1,t)},t.generateUniqueId=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2)},t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.isLocalStorageAvailable=function(){try{var e="__localStorage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}};var r=i(609);function n(e,t,i,n){void 0===n&&(n={});try{var o=new Date;o.setTime(o.getTime()+24*i*60*60*1e3);var a="expires=".concat(o.toUTCString()),s=n.path||"/",l="".concat(e,"=").concat(t,";").concat(a,";path=").concat(s);n.domain&&"localhost"!==n.domain&&(l+=";domain=".concat(n.domain));var u=n.sameSite||"Lax";return l+=";SameSite=".concat(u),n.secure&&(l+=";Secure"),document.cookie=l,!0}catch(t){return(0,r.logDebug)("Unable to set cookie ".concat(e,":"),t),!1}}},609:function(e,t,i){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)},n=this&&this.__read||function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a},o=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var r,n=0,o=t.length;n<o;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.logDebug=s,t.logChangeApplication=function(e,i,r,n,o){if(t.DEBUG){s("".concat(o?"✓":"✗"," Applied ").concat(r," change to ").concat(n," element(s)"),{experimentName:e,selector:i,changeType:r,elementsCount:n,success:o})}},t.logChangeRemoval=function(e,i,r,n){if(t.DEBUG){s("Restored ".concat(n," element(s) to original state"),{experimentName:e,selector:i,changeType:r,elementsCount:n,action:"restore"})}},t.logExperimentSummary=function(e,i,r,n){if(t.DEBUG){s('Experiment "'.concat(e,'" summary'),{experimentName:e,totalChanges:i,successfulChanges:r,pendingChanges:n,successRate:i>0?"".concat(Math.round(r/i*100),"%"):"N/A"})}},t.logStateOperation=function(e,i,r,n){if(t.DEBUG){s("State ".concat(e," operation"),{operation:e,selector:i,changeType:r,experimentName:n})}},t.logVisibilityEvent=function(e,i,r){if(t.DEBUG){s(r?"Element became visible - experiment triggered":"Element visibility changed",{experimentName:e,selector:i.className||i.id||i.tagName,triggered:r,action:"visibility"})}},t.logMessage=function(e,i,r){if(t.DEBUG){s("Message ".concat(e,": ").concat(i),{direction:e,messageType:i,payload:r,bridge:"extension"})}},t.logPerformance=function(e,i,n){if(t.DEBUG){s("Performance: ".concat(e," took ").concat(i,"ms"),r({operation:e,duration:i,performance:!0},n))}},t.logProductionWarn=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.warn.apply(console,o([e],n(t),!1))};var a=i(834);function s(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];if(t.DEBUG)if(2===e.length&&"string"==typeof e[0]&&"object"==typeof e[1]){var r=n(e,2),a=r[0],s=r[1];if(a.includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Performance:")&&(null==s?void 0:s.duration)&&s.duration<5)return;if(a.includes("Message sent:")||a.includes("Message received:"))return;var l=(new Date).toISOString(),u="[ABsmartly Debug]";console.log("".concat(u," [").concat(l,"] ").concat(a),s)}else if(1===e.length&&"string"==typeof e[0]){if((a=e[0]).includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Message sent:")||a.includes("Message received:"))return;l=(new Date).toISOString(),u="[ABsmartly Debug]";console.log("".concat(u," [").concat(l,"] ").concat(a))}else console.log.apply(console,o([],n(e),!1))}t.DEBUG=a.BUILD_DEBUG},637:function(e,t,i){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserCookieAdapter=void 0;var n=i(319),o=function(){function e(){}return e.prototype.get=function(e){var t=(0,n.getCookie)(e);return t?decodeURIComponent(t):null},e.prototype.set=function(e,t,i){var r="".concat(e,"=").concat(encodeURIComponent(t));i&&(i.path&&(r+="; path=".concat(i.path)),i.domain&&(r+="; domain=".concat(i.domain)),void 0!==i.maxAge&&(r+="; max-age=".concat(i.maxAge)),i.secure&&(r+="; secure"),i.sameSite&&(r+="; samesite=".concat(i.sameSite))),document.cookie=r},e.prototype.delete=function(e,t){this.set(e,"",r(r({},t),{maxAge:0}))},e}();t.BrowserCookieAdapter=o},639:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BUILD_DEBUG=t.BUILD_VERSION=void 0,t.BUILD_VERSION="1.3.4",t.BUILD_DEBUG=!1},943:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=function(e,t){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__||(window.__ABSMARTLY_PLUGINS__={});window.__ABSMARTLY_PLUGINS__[e]=t},t.unregisterPlugin=function(e){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__&&delete window.__ABSMARTLY_PLUGINS__[e]},t.isPluginRegistered=function(e){var t;if("undefined"==typeof window)return!1;return!(!window.__ABSMARTLY_PLUGINS__||!(null===(t=window.__ABSMARTLY_PLUGINS__[e])||void 0===t?void 0:t.initialized))},t.getRegisteredPlugins=function(){if("undefined"==typeof window)return{};return window.__ABSMARTLY_PLUGINS__||{}}},977:function(e,t,i){var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginFull=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(i(248).OverridesPlugin);t.OverridesPluginFull=o}},t={};var i=function i(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,i),o.exports}(241);return i})());
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ABsmartlyOverridesLite=t():e.ABsmartlyOverridesLite=t()}(this,()=>(()=>{"use strict";var e={44:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function u(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,u)}l((i=i.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,i,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&u[0]?i.return:u[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,u[1])).done)return n;switch(i=0,n&&(u=[2&u[0],n.value]),u[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,i=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3])){o.label=u[1];break}if(6===u[0]&&o.label<n[1]){o.label=n[1],n=u;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(u);break}n[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],i=0}finally{r=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var u=r(609),l=r(943),c=r(186),s=function(){function e(e){var t,r,i,n,o;if(this.initialized=!1,!e.context)throw new Error("[OverridesPluginLite] Context is required");this.config={context:e.context,cookieName:null!==(t=e.cookieName)&&void 0!==t?t:"absmartly_overrides",useQueryString:null===(r=e.useQueryString)||void 0===r||r,queryPrefix:null!==(i=e.queryPrefix)&&void 0!==i?i:"exp_",persistQueryToCookie:null!==(n=e.persistQueryToCookie)&&void 0!==n&&n,debug:null!==(o=e.debug)&&void 0!==o&&o},this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Initialized with config:",{cookieName:this.config.cookieName,useQueryString:this.config.useQueryString,queryPrefix:this.config.queryPrefix})}return e.prototype.ready=function(){return i(this,void 0,void 0,function(){var e,t,r,i,l,c,s,d,f,g,v;return n(this,function(n){if(this.initialized)return this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Already initialized"),[2];if(this.initialized=!0,this.registerWithContext(),this.registerGlobally(),e={},this.config.useQueryString&&"undefined"!=typeof window&&(e=this.getQueryStringOverrides(),this.config.persistQueryToCookie&&this.config.cookieName&&Object.keys(e).length>0&&this.persistOverridesToCookie(e)),0===Object.keys(e).length&&this.config.cookieName&&(e=this.getCookieOverrides()),0===Object.keys(e).length)return this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] No overrides found"),[2];try{for(t=o(Object.entries(e)),r=t.next();!r.done;r=t.next())i=a(r.value,2),l=i[0],c=i[1],s="number"==typeof c?c:c.variant,isNaN(s)?this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Skipping invalid variant for ".concat(l,": ").concat(s)):(null===(v=(g=this.config.context).override)||void 0===v||v.call(g,l,s),this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Override: ".concat(l," -> variant ").concat(s)))}catch(e){d={error:e}}finally{try{r&&!r.done&&(f=t.return)&&f.call(t)}finally{if(d)throw d.error}}return[2]})})},e.prototype.initialize=function(){return i(this,void 0,void 0,function(){return n(this,function(e){return[2,this.ready()]})})},e.prototype.getQueryStringOverrides=function(){if("undefined"==typeof window||!window.location)return{};var e=(0,c.getQueryStringOverrides)(this.config.queryPrefix);return this.config.debug&&Object.keys(e).length>0&&(0,u.logDebug)("[OverridesPluginLite] Query string overrides:",e),e},e.prototype.getCookieOverrides=function(){return"undefined"==typeof document?{}:(0,c.getCookieOverrides)(this.config.cookieName)},e.prototype.persistOverridesToCookie=function(e){if(this.config.cookieName&&"undefined"!=typeof document&&((0,c.persistOverridesToCookie)(e,{cookieName:this.config.cookieName}),this.config.debug)){var t=(0,c.serializeOverrides)(e);(0,u.logDebug)("[OverridesPluginLite] Persisted to cookie:",t)}},e.prototype.registerWithContext=function(){this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.overridesPlugin={name:"OverridesPluginLite",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides"],instance:this,timestamp:Date.now()},this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Registered with context at __plugins.overridesPlugin"))},e.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.config.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.config.context.__plugins.overridesPlugin,this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Unregistered from context"))},e.prototype.destroy=function(){this.initialized=!1,this.unregisterFromContext(),this.unregisterGlobally()},e.prototype.registerGlobally=function(){(0,l.registerPlugin)("overrides",{name:"OverridesPluginLite",version:"1.0.0",initialized:!0,timestamp:Date.now(),capabilities:["cookie-overrides","query-overrides"],instance:this}),this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Registered in global window.__ABSMARTLY_PLUGINS__")},e.prototype.unregisterGlobally=function(){(0,l.unregisterPlugin)("overrides"),this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Unregistered from global registry")},e}();t.OverridesPluginLite=s},186:function(e,t){var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a};function n(e,n){var o,a;if(void 0===e&&(e=t.DEFAULT_OVERRIDE_QUERY_PREFIX),"undefined"==typeof window&&!n)return{};var u=n||new URLSearchParams(window.location.search),l={};try{for(var c=r(u.entries()),s=c.next();!s.done;s=c.next()){var d=i(s.value,2),f=d[0],g=d[1];if(f.startsWith(e)){var v=f.substring(e.length);if(v){var y=g.split(","),p=parseInt(y[0],10);isNaN(p)||(1===y.length?l[v]=p:l[v]={variant:p,env:y[1]?parseInt(y[1],10):void 0,id:y[2]?parseInt(y[2],10):void 0})}}}}catch(e){o={error:e}}finally{try{s&&!s.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return l}function o(e){var t,n;if(!e)return{};var o={},a=e;e.includes("|")&&(a=(y=e.split("|"))[y.length-1]);if(!a)return{};var u=a.split(",");try{for(var l=r(u),c=l.next();!c.done;c=l.next()){var s=c.value,d=i(s.split(":"),2),f=d[0],g=d[1];if(f&&g){var v=decodeURIComponent(f),y=g.split("."),p=parseInt(y[0],10);isNaN(p)||(1===y.length?o[v]=p:o[v]={variant:p,env:y[1]?parseInt(y[1],10):void 0,id:y[2]?parseInt(y[2],10):void 0})}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o}function a(e,i){var n,a;void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);var u=null!=i?i:"undefined"!=typeof document?document.cookie:"";if(!u)return{};var l=e+"=",c=u.split(";");try{for(var s=r(c),d=s.next();!d.done;d=s.next()){var f=d.value;if(0===(f=f.trim()).indexOf(l))return o(decodeURIComponent(f.substring(l.length)))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(a=s.return)&&a.call(s)}finally{if(n)throw n.error}}return{}}function u(e){var t,n,o=[];try{for(var a=r(Object.entries(e)),u=a.next();!u.done;u=a.next()){var l=i(u.value,2),c=l[0],s=l[1],d=encodeURIComponent(c);if("number"==typeof s)o.push("".concat(d,":").concat(s));else{var f="".concat(d,":").concat(s.variant);void 0!==s.env&&(f+=".".concat(s.env)),void 0!==s.id&&(f+=".".concat(s.id)),o.push(f)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o.join(",")}function l(e,r){if(void 0===r&&(r={}),"undefined"!=typeof document){var i=r.cookieName||t.DEFAULT_OVERRIDE_COOKIE_NAME,n=r.maxAge||86400,o=u(e);document.cookie="".concat(i,"=").concat(encodeURIComponent(o),";path=/;max-age=").concat(n)}}function c(e){var t,n,o={};try{for(var a=r(Object.entries(e)),u=a.next();!u.done;u=a.next()){var l=i(u.value,2),c=l[0],s=l[1];o[c]="number"==typeof s?s:s.variant}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERRIDE_QUERY_PREFIX=t.DEFAULT_OVERRIDE_COOKIE_NAME=void 0,t.getQueryStringOverrides=n,t.parseOverrideCookie=o,t.getCookieOverrides=a,t.serializeOverrides=u,t.persistOverridesToCookie=l,t.getOverrides=function(e,r,i,o){void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);void 0===r&&(r=t.DEFAULT_OVERRIDE_QUERY_PREFIX);var u=n(r,i);if(Object.keys(u).length>0)return"undefined"!=typeof document&&l(u,{cookieName:e,maxAge:86400}),c(u);return c(a(e,o))},t.DEFAULT_OVERRIDE_COOKIE_NAME="absmartly_overrides",t.DEFAULT_OVERRIDE_QUERY_PREFIX="exp_"},609:function(e,t,r){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.logDebug=u,t.logChangeApplication=function(e,r,i,n,o){if(t.DEBUG){u("".concat(o?"✓":"✗"," Applied ").concat(i," change to ").concat(n," element(s)"),{experimentName:e,selector:r,changeType:i,elementsCount:n,success:o})}},t.logChangeRemoval=function(e,r,i,n){if(t.DEBUG){u("Restored ".concat(n," element(s) to original state"),{experimentName:e,selector:r,changeType:i,elementsCount:n,action:"restore"})}},t.logExperimentSummary=function(e,r,i,n){if(t.DEBUG){u('Experiment "'.concat(e,'" summary'),{experimentName:e,totalChanges:r,successfulChanges:i,pendingChanges:n,successRate:r>0?"".concat(Math.round(i/r*100),"%"):"N/A"})}},t.logStateOperation=function(e,r,i,n){if(t.DEBUG){u("State ".concat(e," operation"),{operation:e,selector:r,changeType:i,experimentName:n})}},t.logVisibilityEvent=function(e,r,i){if(t.DEBUG){u(i?"Element became visible - experiment triggered":"Element visibility changed",{experimentName:e,selector:r.className||r.id||r.tagName,triggered:i,action:"visibility"})}},t.logMessage=function(e,r,i){if(t.DEBUG){u("Message ".concat(e,": ").concat(r),{direction:e,messageType:r,payload:i,bridge:"extension"})}},t.logPerformance=function(e,r,n){if(t.DEBUG){u("Performance: ".concat(e," took ").concat(r,"ms"),i({operation:e,duration:r,performance:!0},n))}},t.logProductionWarn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,o([e],n(t),!1))};var a=r(834);function u(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t.DEBUG)if(2===e.length&&"string"==typeof e[0]&&"object"==typeof e[1]){var i=n(e,2),a=i[0],u=i[1];if(a.includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Performance:")&&(null==u?void 0:u.duration)&&u.duration<5)return;if(a.includes("Message sent:")||a.includes("Message received:"))return;var l=(new Date).toISOString(),c="[ABsmartly Debug]";console.log("".concat(c," [").concat(l,"] ").concat(a),u)}else if(1===e.length&&"string"==typeof e[0]){if((a=e[0]).includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Message sent:")||a.includes("Message received:"))return;l=(new Date).toISOString(),c="[ABsmartly Debug]";console.log("".concat(c," [").concat(l,"] ").concat(a))}else console.log.apply(console,o([],n(e),!1))}t.DEBUG=a.BUILD_DEBUG},639:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var o=r(44);Object.defineProperty(t,"OverridesPluginLite",{enumerable:!0,get:function(){return o.OverridesPluginLite}}),n(r(639),t),t.default=o.OverridesPluginLite},834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BUILD_DEBUG=t.BUILD_VERSION=void 0,t.BUILD_VERSION="1.3.0",t.BUILD_DEBUG=!1},943:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=function(e,t){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__||(window.__ABSMARTLY_PLUGINS__={});window.__ABSMARTLY_PLUGINS__[e]=t},t.unregisterPlugin=function(e){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__&&delete window.__ABSMARTLY_PLUGINS__[e]},t.isPluginRegistered=function(e){var t;if("undefined"==typeof window)return!1;return!(!window.__ABSMARTLY_PLUGINS__||!(null===(t=window.__ABSMARTLY_PLUGINS__[e])||void 0===t?void 0:t.initialized))},t.getRegisteredPlugins=function(){if("undefined"==typeof window)return{};return window.__ABSMARTLY_PLUGINS__||{}}}},t={};var r=function r(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,r),o.exports}(790);return r})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ABsmartlyOverridesLite=t():e.ABsmartlyOverridesLite=t()}(this,()=>(()=>{"use strict";var e={44:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function u(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,u)}l((i=i.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,i,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&u[0]?i.return:u[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,u[1])).done)return n;switch(i=0,n&&(u=[2&u[0],n.value]),u[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,i=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3])){o.label=u[1];break}if(6===u[0]&&o.label<n[1]){o.label=n[1],n=u;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(u);break}n[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],i=0}finally{r=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var u=r(609),l=r(943),c=r(186),s=function(){function e(e){var t,r,i,n,o;if(this.initialized=!1,!e.context)throw new Error("[OverridesPluginLite] Context is required");this.config={context:e.context,cookieName:null!==(t=e.cookieName)&&void 0!==t?t:"absmartly_overrides",useQueryString:null===(r=e.useQueryString)||void 0===r||r,queryPrefix:null!==(i=e.queryPrefix)&&void 0!==i?i:"exp_",persistQueryToCookie:null!==(n=e.persistQueryToCookie)&&void 0!==n&&n,debug:null!==(o=e.debug)&&void 0!==o&&o},this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Initialized with config:",{cookieName:this.config.cookieName,useQueryString:this.config.useQueryString,queryPrefix:this.config.queryPrefix})}return e.prototype.ready=function(){return i(this,void 0,void 0,function(){var e,t,r,i,l,c,s,d,f,g,v;return n(this,function(n){if(this.initialized)return this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Already initialized"),[2];if(this.initialized=!0,this.registerWithContext(),this.registerGlobally(),e={},this.config.useQueryString&&"undefined"!=typeof window&&(e=this.getQueryStringOverrides(),this.config.persistQueryToCookie&&this.config.cookieName&&Object.keys(e).length>0&&this.persistOverridesToCookie(e)),0===Object.keys(e).length&&this.config.cookieName&&(e=this.getCookieOverrides()),0===Object.keys(e).length)return this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] No overrides found"),[2];try{for(t=o(Object.entries(e)),r=t.next();!r.done;r=t.next())i=a(r.value,2),l=i[0],c=i[1],s="number"==typeof c?c:c.variant,isNaN(s)?this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Skipping invalid variant for ".concat(l,": ").concat(s)):(null===(v=(g=this.config.context).override)||void 0===v||v.call(g,l,s),this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Override: ".concat(l," -> variant ").concat(s)))}catch(e){d={error:e}}finally{try{r&&!r.done&&(f=t.return)&&f.call(t)}finally{if(d)throw d.error}}return[2]})})},e.prototype.initialize=function(){return i(this,void 0,void 0,function(){return n(this,function(e){return[2,this.ready()]})})},e.prototype.getQueryStringOverrides=function(){if("undefined"==typeof window||!window.location)return{};var e=(0,c.getQueryStringOverrides)(this.config.queryPrefix);return this.config.debug&&Object.keys(e).length>0&&(0,u.logDebug)("[OverridesPluginLite] Query string overrides:",e),e},e.prototype.getCookieOverrides=function(){return"undefined"==typeof document?{}:(0,c.getCookieOverrides)(this.config.cookieName)},e.prototype.persistOverridesToCookie=function(e){if(this.config.cookieName&&"undefined"!=typeof document&&((0,c.persistOverridesToCookie)(e,{cookieName:this.config.cookieName}),this.config.debug)){var t=(0,c.serializeOverrides)(e);(0,u.logDebug)("[OverridesPluginLite] Persisted to cookie:",t)}},e.prototype.registerWithContext=function(){this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.overridesPlugin={name:"OverridesPluginLite",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides"],instance:this,timestamp:Date.now()},this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Registered with context at __plugins.overridesPlugin"))},e.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.config.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.config.context.__plugins.overridesPlugin,this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Unregistered from context"))},e.prototype.destroy=function(){this.initialized=!1,this.unregisterFromContext(),this.unregisterGlobally()},e.prototype.registerGlobally=function(){(0,l.registerPlugin)("overrides",{name:"OverridesPluginLite",version:"1.0.0",initialized:!0,timestamp:Date.now(),capabilities:["cookie-overrides","query-overrides"],instance:this}),this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Registered in global window.__ABSMARTLY_PLUGINS__")},e.prototype.unregisterGlobally=function(){(0,l.unregisterPlugin)("overrides"),this.config.debug&&(0,u.logDebug)("[OverridesPluginLite] Unregistered from global registry")},e}();t.OverridesPluginLite=s},186:function(e,t){var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a};function n(e,n){var o,a;if(void 0===e&&(e=t.DEFAULT_OVERRIDE_QUERY_PREFIX),"undefined"==typeof window&&!n)return{};var u=n||new URLSearchParams(window.location.search),l={};try{for(var c=r(u.entries()),s=c.next();!s.done;s=c.next()){var d=i(s.value,2),f=d[0],g=d[1];if(f.startsWith(e)){var v=f.substring(e.length);if(v){var y=g.split(","),p=parseInt(y[0],10);isNaN(p)||(1===y.length?l[v]=p:l[v]={variant:p,env:y[1]?parseInt(y[1],10):void 0,id:y[2]?parseInt(y[2],10):void 0})}}}}catch(e){o={error:e}}finally{try{s&&!s.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return l}function o(e){var t,n;if(!e)return{};var o={},a=e;e.includes("|")&&(a=(y=e.split("|"))[y.length-1]);if(!a)return{};var u=a.split(",");try{for(var l=r(u),c=l.next();!c.done;c=l.next()){var s=c.value,d=i(s.split(":"),2),f=d[0],g=d[1];if(f&&g){var v=decodeURIComponent(f),y=g.split("."),p=parseInt(y[0],10);isNaN(p)||(1===y.length?o[v]=p:o[v]={variant:p,env:y[1]?parseInt(y[1],10):void 0,id:y[2]?parseInt(y[2],10):void 0})}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o}function a(e,i){var n,a;void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);var u=null!=i?i:"undefined"!=typeof document?document.cookie:"";if(!u)return{};var l=e+"=",c=u.split(";");try{for(var s=r(c),d=s.next();!d.done;d=s.next()){var f=d.value;if(0===(f=f.trim()).indexOf(l))return o(decodeURIComponent(f.substring(l.length)))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(a=s.return)&&a.call(s)}finally{if(n)throw n.error}}return{}}function u(e){var t,n,o=[];try{for(var a=r(Object.entries(e)),u=a.next();!u.done;u=a.next()){var l=i(u.value,2),c=l[0],s=l[1],d=encodeURIComponent(c);if("number"==typeof s)o.push("".concat(d,":").concat(s));else{var f="".concat(d,":").concat(s.variant);void 0!==s.env&&(f+=".".concat(s.env)),void 0!==s.id&&(f+=".".concat(s.id)),o.push(f)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o.join(",")}function l(e,r){if(void 0===r&&(r={}),"undefined"!=typeof document){var i=r.cookieName||t.DEFAULT_OVERRIDE_COOKIE_NAME,n=r.maxAge||86400,o=u(e);document.cookie="".concat(i,"=").concat(encodeURIComponent(o),";path=/;max-age=").concat(n)}}function c(e){var t,n,o={};try{for(var a=r(Object.entries(e)),u=a.next();!u.done;u=a.next()){var l=i(u.value,2),c=l[0],s=l[1];o[c]="number"==typeof s?s:s.variant}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERRIDE_QUERY_PREFIX=t.DEFAULT_OVERRIDE_COOKIE_NAME=void 0,t.getQueryStringOverrides=n,t.parseOverrideCookie=o,t.getCookieOverrides=a,t.serializeOverrides=u,t.persistOverridesToCookie=l,t.getOverrides=function(e,r,i,o){void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);void 0===r&&(r=t.DEFAULT_OVERRIDE_QUERY_PREFIX);var u=n(r,i);if(Object.keys(u).length>0)return"undefined"!=typeof document&&l(u,{cookieName:e,maxAge:86400}),c(u);return c(a(e,o))},t.DEFAULT_OVERRIDE_COOKIE_NAME="absmartly_overrides",t.DEFAULT_OVERRIDE_QUERY_PREFIX="exp_"},609:function(e,t,r){var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.logDebug=u,t.logChangeApplication=function(e,r,i,n,o){if(t.DEBUG){u("".concat(o?"✓":"✗"," Applied ").concat(i," change to ").concat(n," element(s)"),{experimentName:e,selector:r,changeType:i,elementsCount:n,success:o})}},t.logChangeRemoval=function(e,r,i,n){if(t.DEBUG){u("Restored ".concat(n," element(s) to original state"),{experimentName:e,selector:r,changeType:i,elementsCount:n,action:"restore"})}},t.logExperimentSummary=function(e,r,i,n){if(t.DEBUG){u('Experiment "'.concat(e,'" summary'),{experimentName:e,totalChanges:r,successfulChanges:i,pendingChanges:n,successRate:r>0?"".concat(Math.round(i/r*100),"%"):"N/A"})}},t.logStateOperation=function(e,r,i,n){if(t.DEBUG){u("State ".concat(e," operation"),{operation:e,selector:r,changeType:i,experimentName:n})}},t.logVisibilityEvent=function(e,r,i){if(t.DEBUG){u(i?"Element became visible - experiment triggered":"Element visibility changed",{experimentName:e,selector:r.className||r.id||r.tagName,triggered:i,action:"visibility"})}},t.logMessage=function(e,r,i){if(t.DEBUG){u("Message ".concat(e,": ").concat(r),{direction:e,messageType:r,payload:i,bridge:"extension"})}},t.logPerformance=function(e,r,n){if(t.DEBUG){u("Performance: ".concat(e," took ").concat(r,"ms"),i({operation:e,duration:r,performance:!0},n))}},t.logProductionWarn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,o([e],n(t),!1))};var a=r(834);function u(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t.DEBUG)if(2===e.length&&"string"==typeof e[0]&&"object"==typeof e[1]){var i=n(e,2),a=i[0],u=i[1];if(a.includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Performance:")&&(null==u?void 0:u.duration)&&u.duration<5)return;if(a.includes("Message sent:")||a.includes("Message received:"))return;var l=(new Date).toISOString(),c="[ABsmartly Debug]";console.log("".concat(c," [").concat(l,"] ").concat(a),u)}else if(1===e.length&&"string"==typeof e[0]){if((a=e[0]).includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Message sent:")||a.includes("Message received:"))return;l=(new Date).toISOString(),c="[ABsmartly Debug]";console.log("".concat(c," [").concat(l,"] ").concat(a))}else console.log.apply(console,o([],n(e),!1))}t.DEBUG=a.BUILD_DEBUG},639:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var o=r(44);Object.defineProperty(t,"OverridesPluginLite",{enumerable:!0,get:function(){return o.OverridesPluginLite}}),n(r(639),t),t.default=o.OverridesPluginLite},834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BUILD_DEBUG=t.BUILD_VERSION=void 0,t.BUILD_VERSION="1.3.4",t.BUILD_DEBUG=!1},943:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=function(e,t){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__||(window.__ABSMARTLY_PLUGINS__={});window.__ABSMARTLY_PLUGINS__[e]=t},t.unregisterPlugin=function(e){if("undefined"==typeof window)return;window.__ABSMARTLY_PLUGINS__&&delete window.__ABSMARTLY_PLUGINS__[e]},t.isPluginRegistered=function(e){var t;if("undefined"==typeof window)return!1;return!(!window.__ABSMARTLY_PLUGINS__||!(null===(t=window.__ABSMARTLY_PLUGINS__[e])||void 0===t?void 0:t.initialized))},t.getRegisteredPlugins=function(){if("undefined"==typeof window)return{};return window.__ABSMARTLY_PLUGINS__||{}}}},t={};var r=function r(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,r),o.exports}(790);return r})());