Files
Last update 2 months 4 days
by
Arnaud-Apu-Fanovard
latest.js.téléchargement!function(){"use strict";var e,t,r;!function(e){e[e.ERROR=0]="ERROR",e[e.WARN=1]="WARN",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG"}(e||(e={})),function(e){e.EventEmpty="Empty Event",e.EventUnexpected="Unexpected Event",e.MonitorCallError="Monitor Call Error",e.MonitorCreateError="Monitor Creation Error",e.MonitorDuplicateProp="Monitor Duplicate Property",e.MonitorEmitError="Monitor Emit Error",e.MonitorRemoveError="Monitor Removal Error",e.OperatorError="Operator Error",e.ObserverMultipleLoad="Duplicate Observer",e.ObserverReadError="Read Error",e.ObserverRulesNone="No Rules Defined",e.RuleInvalid="Invalid Rule",e.RuleRegistrationError="Rule Registration Error",e.ObserverInitializationError="Observer Initialization Error"}(t||(t={})),function(e){e.DataLayerMissing="Data layer not found",e.DuplicateValue="Value $0 already used",e.ShimFail="Shim not allowed because object is $0",e.SelectorInvalidIndex="Selector index $0 is not a number in $1",e.SelectorIncorrectTokenCount="Selector has incorrect number ($0) of tokens in $1",e.SelectorMalformed="Selector $0 is malformed",e.SelectorMissingToken="Selector is missing $0 in $1",e.SelectorNoProps="Selector is missing properties",e.SelectorSyntaxUnsupported="Selector syntax $0 is unsupported",e.TargetSubjectObject="Target subject must be an object",e.TargetPropertyMissing="Target property is missing",e.TargetPathMissing="Target path is missing",e.UnknownValue="Unknown value $0",e.UnsupportedType="Unsupported type $0"}(r||(r={}));var n=function(){function t(){}return t.prototype.log=function(t){var r=t.context,n=t.level,o=t.message+(r?" "+JSON.stringify(r):"");switch(n){case e.ERROR:return console.error(o);case e.WARN:return console.warn(o);case e.INFO:return console.info(o);case e.DEBUG:default:return console.debug(o)}},t}(),o=function(){function e(){this.timeoutId=null}return e.prototype.log=function(t){var r=this,n=window[window._fs_namespace];if(n){var o=t.context,i=t.level,a=t.message,s=o?{level_int:i,message:a,context:o}:{level_int:i,message:a};this.isDuplicate(t)?("number"==typeof this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){r.timeoutId=null,n.event("Data Layer Observer",s,"dlo-log")}),e.debounceTime)):n.event("Data Layer Observer",s,"dlo-log"),this.prevEvent=t}},e.prototype.isDuplicate=function(e){var t=e.context,r=e.message;if(!this.prevEvent||!t||!this.prevEvent.context)return!1;var n=t.source,o=t.reason,i=this.prevEvent,a=i.message,s=i.context,u=s.source,p=s.reason;return r===a&&n===u&&o===p},e.debounceTime=250,e}(),i=function(){function t(e){switch(void 0===e&&(e="console"),this.level=1,e){case"fullstory":this.appender=new o;break;case"console":default:this.appender=new n}}return t.format=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=e,o=0;o<t.length;o+=1)n=n.replace("$"+o,t[o]);return n.trim()},t.getInstance=function(e){return t.instance||(t.instance=new t(e)),t.instance},t.prototype.log=function(e,t,r){e<=this.level&&this.appender.log({level:e,message:t,context:r})},t.prototype.error=function(t,r){this.log(e.ERROR,t,r)},t.prototype.warn=function(t,r){this.log(e.WARN,t,r)},t.prototype.info=function(t,r){this.log(e.INFO,t,r)},t.prototype.debug=function(t,r){this.log(e.DEBUG,t,r)},t}();function a(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}function s(e,t,r){var n=0;return r&&r>0&&(n=r),e.indexOf(t,n)===n}function u(e,t,r){var n;return n=void 0===r||isNaN(r)?e.length:r<0?0:Math.min(r,e.length),e.slice(Math.max(0,n-t.length),n)===t} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var l,f=function(){function e(e){if(this.options=e,!e.name)throw new Error("Operator options "+JSON.stringify(e)+" has no name")}return e.prototype.checkRequired=function(e){void 0===this.options[e]&&this.throwError(e,"is required")},e.prototype.checkType=function(e,t){-1===t.toString().toLowerCase().indexOf(typeof this.options[e])&&this.throwError(e,"is a "+typeof this.options[e]+" but should be "+t)},e.prototype.checkDependencies=function(e,t){var r=this;t.forEach((function(t){void 0===r.options[t]&&r.throwError(e,"requires option "+t)}))},e.prototype.throwError=function(e,t){throw new Error("Operator '"+this.options.name+"' option '"+e+"' "+t)},e.isReservedProperty=function(e){return"name"===e||"index"===e||"maxDepth"===e},e.prototype.validate=function(t){var r=this,n=this.options.name;Object.getOwnPropertyNames(t).forEach((function(e){var n=t[e],o=n.required,i=n.type,a=n.dependencies,s=void 0===a?[]:a;o&&r.checkRequired(e),r.options[e]&&(r.checkType(e,i),r.checkDependencies(e,s))})),Object.getOwnPropertyNames(this.options).filter((function(t){return!e.isReservedProperty(t)})).forEach((function(e){if(!t[e])throw Error("Operator '"+n+"' has unknown option "+e)}))},e}();function h(e,t,r){var n=e.slice();return n.splice(t,1,r),n}!function(e){e.Bool="_bool",e.Bools="_bools",e.Date="_date",e.Dates="_dates",e.Int="_int",e.Ints="_ints",e.Obj="_obj",e.Objs="_objs",e.String="_str",e.Strings="_strs",e.Real="_real",e.Reals="_reals"}(l||(l={}));var d=new Set;Object.keys(l).forEach((function(e){var t=l[e];d.add(t)}));var v,y=function(){function e(t){this.options=t;var r=t.index,n=void 0===r?-1:r,o=t.maxDepth,i=void 0===o?10:o,a=t.maxProps,s=void 0===a?e.DefaultMaxProps:a;this.index=n,this.maxDepth=i,this.maxProps=s,this.maxProps>=e.MaxPropsCeiling&&this.validate()}return e.coerceNumSuffix=function(){return l.Real},e.coerceSuffix=function(t){if(void 0===t)return null;if(Array.isArray(t))return t.every((function(e){return"string"==typeof e}))?l.Strings:t.every((function(e){return"boolean"==typeof e}))?l.Bools:t.every((function(e){return"number"==typeof e}))?l.Reals:t.every((function(e){return e instanceof Date}))?l.Dates:t.every((function(e){return"object"==typeof e}))?l.Objs:null;if(t instanceof Date)return l.Date;switch(typeof t){case"string":return l.String;case"boolean":return l.Bool;case"number":return e.coerceNumSuffix();case"object":return l.Obj;default:return null}},e.isAlreadySuffixed=function(e){if(null==e)return!1;var t=e.lastIndexOf("_");if(t<0)return!1;var r=e.substring(t);return d.has(r)},e.prototype.mapToSuffix=function(t,r,n){var o=this;void 0===r&&(r=0),void 0===n&&(n=0);var i={};if(null==t)return i;var a=n+Object.getOwnPropertyNames(t).reduce((function(e,r){return void 0!==t[r]?e+1:e}),0);if(a>this.maxProps)throw Error("Number of object properties exceeds the limit ("+this.maxProps+"); increase maxProps to "+a);return Object.getOwnPropertyNames(t).forEach((function(n){var s=t[n],u=0===r&&("pageName"===n||"displayName"===n||"email"===n)||e.isAlreadySuffixed(n)?"":e.coerceSuffix(s),p=""+n+u;if(null!==u)switch(u){case l.Obj:r<o.maxDepth&&(i[p]=o.mapToSuffix(s,r+1,a));break;case l.Objs:r<o.maxDepth&&(i[p]=s.map((function(e){return o.mapToSuffix(e,r+1,a)})));break;default:i[p]=s}})),i},e.prototype.handleData=function(e){var t=this.index>=0?this.index:e.length+this.index;return"string"==typeof e[t]&&(t-=1),"object"!=typeof e[t]?null:h(e,t,this.mapToSuffix(e[t]))},e.prototype.validate=function(){var t=new f(this.options);t.validate(e.specification);var r=this.options.maxProps;void 0!==r&&r>=e.MaxPropsCeiling&&t.throwError("maxProps","exceeds the FullStory limit ("+e.MaxPropsCeiling+"), use a lower value")},e.specification={index:{required:!1,type:["number"]},maxDepth:{required:!1,type:["number"]},maxProps:{required:!1,type:["number"]}},e.DefaultMaxProps=100,e.MaxPropsCeiling=5e3,e}(),g=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t;this.index=r}return e.convert=function(t,r){switch(t){case"bool":return"true"===r||"TRUE"===r||"True"===r;case"date":return new Date(r);case"int":case"real":return r?e.enumerate(r):0;case"string":switch(typeof r){case"boolean":return Boolean(r).toString();case"number":return r.toString();case"undefined":return"";default:return null===r?"":r}default:return r}},e.enumerate=function(e){var t=parseFloat(e);return isNaN(e)||Number.isNaN(t)?NaN:t},e.enumerableProperties=function(e){return Object.getOwnPropertyNames(e).filter((function(t){return"string"==typeof e[t]||Array.isArray(e[t])&&"string"==typeof e[t][0]}))},e.prototype.handleData=function(t){var r=this.index>=0?this.index:t.length+this.index,n=this.options,o=n.properties,i=n.ignore,a=this.options,s=a.enumerate,u=a.force,p=a.preserveArray,l=a.type,f=a.ignoreSuffixed,d=void 0===f||f;"string"==typeof o&&(o=o.split(",").map((function(e){return e.trim()}))),"string"==typeof i&&(i=i.split(",").map((function(e){return e.trim()})));var v=c({},t[r]);if(s){var g=e.enumerableProperties(t[r]);if(i){var m=function(e){return!(null==i?void 0:i.includes(e))};g=g.filter(m)}if(d){m=function(e){return!y.isAlreadySuffixed(e)};g=g.filter(m)}g.forEach((function(n){if("string"==typeof t[r][n])""!==t[r][n]&&(v[n]=e.convert("real",t[r][n]),e.verifyConversion("real",n,v,t[r]));else{v[n]=[];for(var o=0;o<t[r][n].length;o+=1)v[n].push(e.convert("real",t[r][n][o]));e.verifyConversion("real",n,v,t[r])}}))}o&&l&&("*"===o[0]?Object.getOwnPropertyNames(t[r]):o).forEach((function(n){var o=t[r][n];if(null!=o||u)if(Array.isArray(o)){v[n]=[];for(var i=0;i<o.length;i+=1){var a=o[i];v[n].push(e.convert(l,a))}e.verifyConversion(l,n,v,t[r])}else v[n]=e.convert(l,o),e.verifyConversion(l,n,v,t[r])}));return p||Object.getOwnPropertyNames(v).forEach((function(e){if(Array.isArray(v[e])&&1===v[e].length){var t=v[e][0];v[e]=t}})),h(t,r,v)},e.prototype.validate=function(){var t=new f(this.options);t.validate(e.specification);var r=this.options,n=r.enumerate,o=r.force,i=r.properties,a=r.type;if(void 0===n&&void 0===i)throw t.throwError("properties","must be specified if 'enumerate' is undefined and vice versa");if(void 0!==n&&"boolean"!=typeof n)throw t.throwError("enumerate","should be a boolean");if(void 0!==o&&"boolean"!=typeof o)throw t.throwError("force","should be a boolean");if(void 0!==o&&o&&"date"===a)throw t.throwError("force","can not forcibly convert dates");if(void 0!==i&&!a)throw t.throwError("type","must be declared when using 'properties'");if(a&&"bool"!==a&&"int"!==a&&"real"!==a&&"string"!==a&&"date"!==a)throw t.throwError("type","unknown type '"+a+"' used")},e.verifyConversion=function(e,r,n,o){var a=n[r],s=o[r],u=!0;"int"!==e&&"real"!==e||(u=Array.isArray(a)?a.every((function(e){return!Number.isNaN(e)})):!Number.isNaN(a)),"date"===e&&(u=Array.isArray(a)?a.every((function(e){return!Number.isNaN(e.getTime())})):!Number.isNaN(a.getTime())),u||(n[r]=s,i.getInstance().debug(t.OperatorError,{operator:"convert",property:r.toString(),reason:"Failed to convert to "+e+" for value "+s}))},e.specification={enumerate:{required:!1,type:["boolean"]},force:{required:!1,type:["boolean"]},index:{required:!1,type:["number"]},preserveArray:{required:!1,type:["boolean"]},properties:{required:!1,type:["string,object"]},type:{required:!1,type:["string"]},ignore:{required:!1,type:["string,object"]},ignoreSuffixed:{required:!1,type:["boolean"]}},e}(),m=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t,n=e.maxDepth,o=void 0===n?10:n;this.index=r,this.maxDepth=o}return e.prototype.flattenHelper=function(e,t,r){var n=this;void 0===r&&(r=0),Object.getOwnPropertyNames(t).forEach((function(o){"object"==typeof t[o]&&null!=t[o]&&!Array.isArray(t[o])&&r<n.maxDepth+1?n.flattenHelper(e,t[o],r+1):e[o]=t[o]}))},e.prototype.handleData=function(e){var t={},r=e[this.index];return this.flattenHelper(t,r),h(e,this.index,t)},e.prototype.validate=function(){new f(this.options).validate(e.specification)},e.specification={index:{required:!1,type:["number"]},maxDepth:{required:!1,type:["number"]}},e}(),w={};!function(e){e.Pluck="pluck",e.Index="index",e.Pick="pick",e.Omit="omit",e.Prefix="prefix",e.Suffix="suffix",e.Filter="filter"}(v||(v={}));var b,E={pluck:function(e){return!1===e.includes("[")&&!1===e.includes("(")},index:function(e){return/.+\[-?\d+\]$/.test(e)},pick:function(e){return/.+\[\(.*\)\]$/.test(e)},omit:function(e){return/.+\[!\(.*\)\]$/.test(e)},prefix:function(e){return/.+\[\^\(.*\)\]$/.test(e)},suffix:function(e){return/.+\[\$\(.*\)\]$/.test(e)},filter:function(e){return/.+\[\?\(.*\)\]$/.test(e)}};!function(e){e.Pick="",e.Omit="!",e.Prefix="^",e.Suffix="$",e.Filter="?",e.Index="index"}(b||(b={}));var x=function(e){this.raw=e,this.raw=e.trim();for(var t=0,n=0,o=0;o<e.length;o+=1){var a=e.charCodeAt(o);if(33===a||a>=60&&a<=62||94===a||36===a)0===t&&(t=o);else if(t>0){n=o;break}}var s=e.substring(t,n);if(0!==s.length){var u=this.raw.split(s);if(u.length>2)throw new Error(i.format(r.SelectorIncorrectTokenCount,u.length.toString(),e));if(2!==u.length)throw new Error(i.format(r.SelectorIncorrectTokenCount,u.length.toString(),e));this.name=u[0],this.value=u[1],this.operator="="===s||"==="===s?"==":s}else this.name=this.raw,this.value=null,this.operator=null},O=function(){function e(e){switch(this.raw=e,this.index=0,this.props=[],this.raw=e.trim(),this.raw[0]){case"(":if(")"!==this.raw[this.raw.length-1])throw new Error(i.format(r.SelectorMissingToken,")",e));this.kind=b.Pick,this.parseProps(this.raw.substring(1,this.raw.length-1));break;case"!":if("("!==this.raw[1])throw new Error(i.format(r.SelectorMissingToken,"(",e));if(")"!==this.raw[this.raw.length-1])throw new Error(i.format(r.SelectorMissingToken,")",e));this.kind=b.Omit,this.parseProps(this.raw.substring(2,this.raw.length-1));break;case"^":if("("!==this.raw[1])throw new Error(i.format(r.SelectorMissingToken,"(",e));if(")"!==this.raw[this.raw.length-1])throw new Error(i.format(r.SelectorMissingToken,")",e));this.kind=b.Prefix,this.parseProps(this.raw.substring(2,this.raw.length-1));break;case"$":if("("!==this.raw[1])throw new Error(i.format(r.SelectorMissingToken,"(",e));if(")"!==this.raw[this.raw.length-1])throw new Error(i.format(r.SelectorMissingToken,")",e));this.kind=b.Suffix,this.parseProps(this.raw.substring(2,this.raw.length-1));break;case"?":if("("!==this.raw[1])throw new Error(i.format(r.SelectorMissingToken,"(",e));if(")"!==this.raw[this.raw.length-1])throw new Error(i.format(r.SelectorMissingToken,")",e));this.kind=b.Filter,this.parseProps(this.raw.substring(2,this.raw.length-1));break;default:if(this.index=Number.parseInt(this.raw,10),Number.isNaN(this.index))throw new Error(i.format(r.SelectorInvalidIndex,this.index.toString(),e));this.kind=b.Index}this.propNames=this.props.map((function(e){return e.name}))}return e.prototype.parseProps=function(e){var t=this,n=e.trim();if(0===n.length)throw new Error(r.SelectorNoProps);n.split(",").forEach((function(e){t.props.push(new x(e))}))},e}(),k=function(e){if(this.raw=e,this.raw=this.raw.trim(),!1===this.raw.includes("["))throw new Error(i.format(r.SelectorMissingToken,"[",e));if(!1===this.raw.endsWith("]"))throw new Error(i.format(r.SelectorMissingToken,"]",e));var t=this.raw.split("[");if(2!==t.length)throw new Error(i.format(r.SelectorIncorrectTokenCount,t.length.toString(),e));this.prop=t[0],this.op=new O(t[1].substring(0,t[1].length-1))},S=function(){function e(t){this.raw=t,this.parsedInfo={},this.kind=e.sniffKind(t),this.parse()}return e.prototype.select=function(e){if(null!=e)switch(this.kind){case v.Pluck:return this.selectPluck(e);case v.Index:return this.selectIndex(e);case v.Pick:return this.selectPick(e);case v.Omit:return this.selectOmit(e);case v.Prefix:return this.selectPrefix(e);case v.Suffix:return this.selectSuffix(e);case v.Filter:return this.selectFilter(e);default:throw new Error(i.format(r.SelectorSyntaxUnsupported,this.kind))}},e.prototype.parse=function(){switch(this.kind){case v.Pluck:break;case v.Index:case v.Pick:case v.Omit:case v.Prefix:case v.Suffix:case v.Filter:this.brackets=new k(this.raw);break;default:throw new Error(i.format(r.SelectorSyntaxUnsupported,this.kind))}},e.prototype.selectPluck=function(e){return null===e?void 0:e[this.raw]},e.prototype.selectIndex=function(e){if(!this.brackets||this.brackets.op.kind!==b.Index)throw new Error(i.format(r.SelectorMissingToken,"[i]",this.raw));var t=e[this.brackets.prop];if(null!=t){var n=this.brackets.op.index;if(!(n>=t.length||(n<0&&(n=t.length+n),n<0)))try{return t[n]}catch(e){return}}},e.prototype.selectPick=function(e){if(!this.brackets||this.brackets.op.kind!==b.Pick)throw new Error(i.format(r.SelectorMissingToken,"[()]",this.raw));var t=e[this.brackets.prop];if(null!=t){var n={},o=!1;if(this.brackets.op.props.forEach((function(e){void 0!==t[e.name]&&(n[e.name]=t[e.name],o=!0)})),!1!==o)return n}},e.prototype.selectOmit=function(e){if(!this.brackets||this.brackets.op.kind!==b.Omit)throw new Error(i.format(r.SelectorMissingToken,"![()",this.raw));var t=e[this.brackets.prop];if(null!=t){for(var n={},o=!1,a=Object.getOwnPropertyNames(t),s=0;s<a.length;s+=1){var u=a[s];this.brackets.op.propNames.includes(u)||(n[u]=t[u],o=!0)}if(!1!==o)return n}},e.prototype.selectPrefix=function(e){if(!this.brackets||this.brackets.op.kind!==b.Prefix)throw new Error(i.format(r.SelectorMissingToken,"^[()]",this.raw));var t=e[this.brackets.prop];if(null!=t){for(var n={},o=!1,a=Object.getOwnPropertyNames(t),u=0;u<a.length;u+=1)for(var p=a[u],c=0;c<this.brackets.op.propNames.length;c+=1)if(s(p,this.brackets.op.propNames[c])){n[p]=t[p],o=!0;break}if(!1!==o)return n}},e.prototype.selectSuffix=function(e){if(!this.brackets||this.brackets.op.kind!==b.Suffix)throw new Error(i.format(r.SelectorMissingToken,"$[()]",this.raw));var t=e[this.brackets.prop];if(null!=t){for(var n={},o=!1,a=Object.getOwnPropertyNames(t),s=0;s<a.length;s+=1)for(var u=a[s],p=0;p<this.brackets.op.propNames.length;p+=1)if(u.endsWith(this.brackets.op.propNames[p])){n[u]=t[u],o=!0;break}if(!1!==o)return n}},e.prototype.selectFilter=function(e){if(!this.brackets||this.brackets.op.kind!==b.Filter)throw new Error(i.format(r.SelectorMissingToken,"?[()]",this.raw));var t=e[this.brackets.prop];if(null!=t){for(var n=0;n<this.brackets.op.props.length;n+=1){var o=this.brackets.op.props[n];if(void 0===t[o.name]&&"undefined"!==o.value)return;if(null!==o.value)switch(typeof t[o.name]){case"boolean":if(t[o.name]!==("true"===o.value.toLowerCase()))return;break;case"string":var a=o.value;if(o.value){var p=a.charAt(0),c=a.charAt(a.length-1);('"'===p&&'"'===c||"'"===p&&"'"===c)&&(a=a.substring(1,a.length-1))}if("=="===o.operator&&t[o.name]!=a)return;if("!="==o.operator&&t[o.name]==a)return;if("=^"===o.operator&&!s(t[o.name],a))return;if("!^"===o.operator&&s(t[o.name],a))return;if("=$"===o.operator&&!u(t[o.name],a))return;if("!$"===o.operator&&u(t[o.name],a))return;break;case"number":if("=="===o.operator&&t[o.name]!=o.value)return;if("!="===o.operator&&t[o.name]==o.value)return;if(">="===o.operator&&t[o.name]<o.value)return;if("<="===o.operator&&t[o.name]>o.value)return;if(">"===o.operator&&t[o.name]<=o.value)return;if("<"===o.operator&&t[o.name]>=o.value)return;break;case"undefined":case"object":if("=="===o.operator&&null!=t[o.name])return;if("!="===o.operator&&null==t[o.name])return;break;default:throw new Error(i.format(r.SelectorSyntaxUnsupported,o.raw))}}return t}},e.sniffKind=function(e){if(0===e.length)throw new Error(i.format(r.SelectorMalformed,e));for(var t=Object.keys(E),n=0;n<t.length;n+=1){var o=t[n];if(E[o](e))return o}throw new Error(i.format(r.SelectorMalformed,e))},e}(),D=function(){function e(e){this.path=e,this.tokens=[],this.elements=[],this.path=e.trim();for(var t=!1,r="",n=0;n<this.path.length;n+=1)"."!==this.path[n]||t?(r+=this.path[n],"["===this.path[n]&&(t=!0),"]"===this.path[n]&&(t=!1)):(this.tokens.push(r),this.elements.push(new S(r)),r="");this.tokens.push(r),this.elements.push(new S(r))}return e.prototype.select=function(e){for(var t=e,r=0;r<this.elements.length;r+=1)if(void 0===(t=this.elements[r].select(t)))return;return t},e}();function P(e){if(void 0===w[e])try{w[e]=new D(e)}catch(t){w[e]=!1}return w[e]}function j(e,t){var r=P(e);if(!1!==r)return r.select(t||a())}var _=function(){function e(e){this.options=e}return e.prototype.handleData=function(e){var t=this.options,r=t.func,n=t.thisArg,o=a();if(n)switch(typeof n){case"object":o=n;break;case"string":o=j(n);break;default:throw new Error("Unsupported this context used")}if(!o)throw new Error("No this context set");var i=null;switch(typeof r){case"function":return null==(i=r.apply(o,e))?null:[i];case"string":return null==(i=j(r).apply(o,e))?null:[i];default:return null}},e.prototype.validate=function(){new f(this.options).validate(e.specification)},e.specification={func:{required:!0,type:["string","function"]},thisArg:{required:!1,type:["string","object"]}},e}(),I=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t,n=e.properties,o=void 0===n?[]:n;this.index=r,this.properties="string"==typeof o?o.split(",").map((function(e){return e.trim()})):o}return e.prototype.handleData=function(e){var t=e[this.index];if("object"!=typeof t&&!1===Array.isArray(t))throw new Error("Can only fan out arrays or properties on objects");var r=[];if(0===this.properties.length)return Array.isArray(t)?r.push.apply(r,t):Object.keys(t).forEach((function(e){var n=t[e];Array.isArray(n)?r.push.apply(r,n):"object"==typeof n&&r.push(n)})),r;for(var n=0;n<this.properties.length;n+=1){var o=t[this.properties[n]];Array.isArray(o)?r.push.apply(r,o):r.push(o)}return r},e.prototype.validate=function(){new f(this.options).validate(e.specification)},e.specification={index:{required:!1,type:["number"]},properties:{required:!1,type:["string"]}},e}(),N=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t,n=e.position,o=void 0===n?0:n;this.index=r,this.position=o}return e.prototype.handleData=function(e){var t=this.options,r=t.defaultValue,n=t.select,o=t.value;if(n&&void 0!==o)throw new Error("Both 'select' and 'value' options set");var i=o||j(n,e[this.index]);if(void 0===i&&void 0!==r&&(i=r),void 0===i)throw new Error("Failed to find a value to insert");var a=e.slice();return a.splice(this.position>=0?this.position:a.length-this.position,0,i),a},e.prototype.validate=function(){var t=new f(this.options);t.validate(e.specification);var r=this.options,n=r.select,o=r.value;n||void 0!==o||t.throwError("selection"," and 'value' are missing - at least one is required"),n&&void 0!==o&&t.throwError("selection"," and 'value' are both defined - use only one option")},e.specification={defaultValue:{required:!1,type:["boolean,string,number,object"]},index:{required:!1,type:["number"]},select:{required:!1,type:["string"]},value:{required:!1,type:["boolean,string,number,object"]},position:{required:!1,type:["number"]}},e}(),T=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t,n=e.properties,o=void 0===n?{}:n;this.index=r,this.properties=o}return e.prototype.handleRename=function(e){for(var t=Object.getOwnPropertyNames(this.properties),r=0;r<t.length;r+=1){var n=t[r],o=this.properties[n],i=e[n];delete e[n],e[o]=i}},e.prototype.handleData=function(e){if("object"!=typeof e[this.index])throw new Error("Can only convert property names on objects");var t=c({},e[this.index]);return this.handleRename(t),h(e,this.index,t)},e.prototype.validate=function(){var t=new f(this.options);t.validate(e.specification);var r=this.options.properties;0===Object.getOwnPropertyNames(r).length&&t.throwError("properties","at least one property must be renamed");for(var n=Object.getOwnPropertyNames(r),o=0;o<n.length;o+=1)"string"!=typeof r[n[o]]&&t.throwError("properties","can only rename to string values")},e.specification={index:{required:!1,type:["number"]},properties:{required:!0,type:["object"]}},e}(),A=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t;this.index=r}return e.prototype.handleData=function(e){var t=j(this.options.select,{$:e[this.index]});return null==t?null:[t]},e.prototype.validate=function(){var t=new f(this.options);t.validate(e.specification),"$"!==this.options.select.charAt(0)&&t.throwError("select","must begin with $")},e.specification={index:{required:!1,type:["number"]},select:{required:!0,type:["string"]}},e}(),M=/^[a-zA-Z][a-zA-Z0-9_]*$/,R=function(){function e(e){this.options=e;var t=e.index,r=void 0===t?0:t,n=e.propertyDelimiters,o=e.property;this.index=r,this.propertyDelimiters=n,this.property=o}return e.isValidProperty=function(e){return M.test(e)},e.prototype.parseHelper=function(t,r){for(var n=this,o=this.propertyDelimiters,i=r.split(o[0]),a=function(e){var t=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}(i);i=[],t.forEach((function(t){i.push.apply(i,t.split(o[e]))}))},s=1;s<o.length;s+=1)a(s);var u=this.options,p=u.keyValueDelimiter,c=u.output,l=void 0===c?"keyValue":c;"array"===l?t[this.property]=i:"keyValue"===l&&i.forEach((function(r){var o=r,i=null;if(p){var a=r.split(p);a.length>1&&(o=a[0],i=a[1])}e.isValidProperty(o)?t[o]=i:(t[n.property]||(t[n.property]=[]),t[n.property].push(r))}))},e.prototype.handleData=function(e){var t={},r=e[this.index][this.property];return"string"!=typeof r?null:(this.parseHelper(t,r),h(e,this.index,t))},e.prototype.validate=function(){var t=new f(this.options);t.validate(e.specification);var r=this.options,n=r.propertyDelimiters,o=r.keyValueDelimiter,i=r.output,a=void 0===i?"keyValue":i;Array.isArray(n)?Array.isArray(n)&&!n.every((function(e){return"string"==typeof e}))&&t.throwError("propertyDelimiters","has to be an array of strings"):t.throwError("propertyDelimiters","has to be an array of strings"),"keyValue"!==a&&"array"!==a&&t.throwError("output","can only be keyValue or array"),"array"===a&&o&&t.throwError("output","you cannot specify keyValueDelimeter with output=array")},e.specification={propertyDelimiters:{required:!0,type:["object"]},property:{required:!0,type:["string"]},keyValueDelimiter:{required:!1,type:["string"]},output:{required:!1,type:["string"]},index:{required:!1,type:["number"]}},e}(),q=function(){function e(){}return e.create=function(t,n){if(!e.hasOperator(t))throw new Error(i.format(r.UnknownValue,t));return new this.operators[t](n)},e.hasOperator=function(e){return void 0!==this.operators[e]},e.operators={convert:g,flatten:m,function:_,insert:N,suffix:y,query:A,rename:T,"fan-out":I,parse:R},e}(),C=function(e,t,r){this.path=e,this.property=t,this.args=r},$=function(e,t,r){this.path=e,this.property=t,this.value=r};function V(e,t){return"datalayerobserver/"+e+"/"+t}var U="dlo_init_span",F="dlo_rule_collection_span",L="dlo_rule_registration_span",z="dlo_handle_event_span",B="dlo_client_error",W="dlo_operator_error",H="dlo_monitor_removal_error",J="dlo_monitor_call_error",G="dlo_monitor_emit_error",K="dlo_observer_read_error",Z="dlo_invalid_rule_error",Q="dlo_rule_registration_error",X="dlo_observer_init_error",Y={version:"4.0.4"},ee=function(){function e(t,r,n){this.name=t,this.sendSpan=r,this.attributes=n,this.startTime=e.getCurrentTime()}return e.prototype.end=function(){try{var t=e.getCurrentTime()-this.startTime;if(t<0||Number.isNaN(t))return void i.getInstance().debug("ignoring span, calculated an invalid duration: "+t);this.sendSpan({name:this.name,timestamp:(new Date).toISOString(),attributes:this.attributes,duration:t})}catch(e){i.getInstance().debug("Error sending telemetry span: "+e.message)}},e.getCurrentTime=function(){return window.performance&&window.performance.now()||(new Date).getTime()},e}(),te=function(){function e(e){this.exporter=e,this.defaultAttributes={}}return e.prototype.startSpan=function(e,t){try{return new ee(e,this.exporter.sendSpan,this.mergeWithDefaultAttributes(t))}catch(e){return i.getInstance().debug("Error starting telemetry span: "+e.message),{end:function(){}}}},e.prototype.count=function(e,t,r){try{this.exporter.sendCount({name:e,timestamp:(new Date).toISOString(),attributes:this.mergeWithDefaultAttributes(r),value:t})}catch(e){i.getInstance().debug("Error sending telemetry count: "+e.message)}},e.prototype.withDefaultAttributes=function(e){return this.defaultAttributes=e,this},e.prototype.mergeWithDefaultAttributes=function(e){return c(c({},this.defaultAttributes),e)},e}(),re={sendSpan:function(e){console.debug("Telemetry Span",e)},sendCount:function(e){console.debug("Telemetry Count",e)}},ne={sendSpan:function(){},sendCount:function(){}},oe=function(){function e(){}return e.setProvider=function(t){e.instance=t},e.withExporter=function(e){return new te("console"===e?re:e&&"string"!=typeof e?e:ne)},e.getInstance=function(){return e.instance||(e.instance=e.withExporter(ne)),e.instance},e.startSpan=function(t,r){return e.getInstance().startSpan(t,r)},e.count=function(t,r,n){e.getInstance().count(t,r,n)},e.error=function(t){e.count(B,1,{errorType:t})},e}(),ie=function(){function e(t,n,o,i){if(void 0===o&&(o=!1),void 0===i&&(i=e.DefaultDebounceTime),this.source=t,this.target=n,this.debug=o,this.debounce=i,this.listener=null,this.operators=[],this.timeoutId=null,this.debugger=function(e,t,r){return console.debug(t?""+r+e+"\n"+r+JSON.stringify(t):""+r+e)},!n||!n.value)throw new Error(r.DataLayerMissing);this.start()}return e.prototype.fireEvent=function(e){void 0===e&&(e=this.target.query()),e&&this.handleData([e])},e.prototype.handleEvent=function(e){var r=this,n=e.detail,o=n.args,a=n.value,s=e.type,u=this.target.path;if(void 0===a&&void 0===o)i.getInstance().debug(t.EventEmpty,{path:u});else if(s===V(this.source,u))if(void 0!==a){"number"==typeof this.timeoutId&&window.clearTimeout(this.timeoutId);var p=this.target.query();p&&(this.timeoutId=window.setTimeout((function(){r.timeoutId=null,r.handleData([p])}),this.debounce))}else this.handleData(o||[]);else i.getInstance().warn(t.EventUnexpected,{path:u})},e.prototype.handleData=function(r,n){void 0===n&&(n=0);var o=oe.startSpan(z,{operatorCount:this.operators.length,operatorNames:this.operators.map((function(e){return e.options.name})).join(",")}),a=this.target.path;this.runDebugger(a+" handleData entry",r);for(var s=r,u=n;u<this.operators.length;u+=1){var p=this.operators[u].options.name;try{if(null===s||e.isEmptyData(s))return this.runDebugger("["+u+"] "+p+" halted",s," "),null;if(null!==(s=this.operators[u].handleData(s))&&this.operators[u]instanceof I){for(var c=0;c<s.length;c+=1)this.handleData([s[c]],u+1);break}var l="";if(this.debug&&null!==s&&null!==s[0]&&"object"==typeof s[0]){var f=s[0];l="(numKeys="+e.numProperties(f)+" sizeOfValues="+e.sizeOfValues(f)+" sizeOfPayload="+e.sizeOfPayload(f)+")"}this.runDebugger("["+u+"] "+p+" output "+l,s," ")}catch(e){return i.getInstance().error(t.OperatorError,{operator:p,path:a,reason:e.message}),oe.error(W),null}}return this.runDebugger(a+" handleData exit",s),o.end(),s},e.isEmptyData=function(e){for(var t=function(t){var r=e[t];return"object"!=typeof r||null!==r&&Object.keys(r).some((function(e){return void 0!==r[e]}))?{value:!1}:void 0},r=0;r<e.length;r+=1){var n=t(r);if("object"==typeof n)return n.value}return!0},e.sizeOfPayload=function(e,t){return void 0===t&&(t=2),JSON.stringify(e).length*t},e.sizeOfValues=function(e,t){var r=this;void 0===t&&(t=2);var n=0;return"object"==typeof e&&Object.getOwnPropertyNames(e).forEach((function(o){switch(typeof e[o]){case"object":null==e[o]||Array.isArray(e[o])||(n+=r.sizeOfValues(e[o]));break;case"string":n+=e[o].length*t;break;case"number":n+=8;break;case"boolean":n+=2}})),n},e.numProperties=function(e){var t=this,r=0;return"object"==typeof e&&Object.getOwnPropertyNames(e).forEach((function(n){"object"!=typeof e[n]||null==e[n]||Array.isArray(e[n])?r+=1:r+=t.numProperties(e[n])})),r},e.prototype.runDebugger=function(e,t,r){void 0===r&&(r=""),this.debug&&this.debugger(e,t,r)},e.prototype.push=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.forEach((function(t){return e.operators.push(t)}))},e.prototype.start=function(){var e=this;this.listener||(this.listener=function(t){return e.handleEvent(t)},window.addEventListener(V(this.source,this.target.path),this.listener))},e.prototype.stop=function(){window.removeEventListener(V(this.source,this.target.path),this.listener),this.listener=null},e.DefaultDebounceTime=250,e}(),ae=function(){function e(e,t,n,o){if(void 0===o&&(o=""),this.subject=e,this.property=t,this.path=n,this.selector=o,"object"!=typeof e)throw new Error(r.TargetSubjectObject);if(!t)throw new Error(r.TargetPropertyMissing);if(!n)throw new Error(r.TargetPathMissing);var a=typeof(this.selector?j(this.path):this.subject[this.property]);switch(a){case"object":case"function":this.type=a;break;default:i.getInstance().warn(r.UnsupportedType,{path:n,property:t,selector:o})}}return Object.defineProperty(e.prototype,"subjectPath",{get:function(){return this.path.substring(0,this.path.lastIndexOf("."))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return j(this.path)||this.subject[this.property]},enumerable:!1,configurable:!0}),e.prototype.query=function(){return this.selector?j(this.selector):this.value},e.find=function(t){var n=P(t);if(!n)throw new Error(i.format(r.SelectorMalformed,t));for(var o="",s="",u="",p=n.elements,c=0;c<p.length;c+=1){var l=p[c],f=l.kind,h=l.raw,d=l.brackets;if(f!==v.Pluck&&f!==v.Index){if(d){s=t.substring(0,t.indexOf("["+d.op.raw+"]")),u=d.prop;break}throw new Error("Brackets expected in "+h+" but not found")}o+=o?"."+h:h,s+=s?"."+h:h,u=d?d.prop:h}return o===s&&(o=o.substring(0,o.lastIndexOf("."))),new e(o?j(o):a(),u,s,t)},e}(),se=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.configurable=!0,t.enumerable=!0,t.writable=!0,t}return function(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(n,e),n.checkShimAllowed=function(e){if(Object.isFrozen(e))throw new Error(i.format(r.ShimFail,"frozen"));if(Object.isSealed(e))throw new Error(i.format(r.ShimFail,"sealed"))},n.prototype.addPropertyMonitor=function(){var e=this;n.checkShimAllowed(this.object);var t=Object.getOwnPropertyDescriptor(this.object,this.property);if(t){var r=t.configurable,o=t.enumerable,i=t.writable;this.configurable=r,this.enumerable=o,this.writable=i}Object.defineProperty(this.object,this.property,{configurable:this.configurable,enumerable:this.enumerable,get:function(){return e.state},set:function(t){var r=e.state!==t;e.state=t,r&&e.emit(t)}})},n.prototype.remove=function(){try{Object.defineProperty(this.object,this.property,{enumerable:this.enumerable,configurable:this.configurable,value:this.state,writable:this.writable}),this.sources.clear()}catch(e){i.getInstance().error(t.MonitorRemoveError,{path:this.path,property:this.property,reason:e.message}),oe.error(H)}},n.prototype.addFunctionMonitor=function(){var e=this;n.checkShimAllowed(this.object),this.object[this.property]=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return e.emit(r),e.state.apply(e.object,r)}catch(r){return i.getInstance().error(t.MonitorCallError,{path:e.property,property:e.property,reason:r.message}),oe.error(J),null}}},n}(function(){function e(e,n,o,a){if(this.object=n,this.property=o,this.path=a,this.sources=new Set,!n)throw new Error(r.DataLayerMissing);if(a.endsWith(o)&&"function"!=typeof n[o]&&i.getInstance().warn(t.MonitorDuplicateProp,{path:a,property:o}),this.copy(),"object"!=typeof n&&"function"!=typeof n[o])throw new Error(i.format(r.UnsupportedType,typeof n));"function"==typeof n[o]?this.addFunctionMonitor():this.addPropertyMonitor(),this.sources.add(e)}return e.prototype.addSource=function(e){this.sources.add(e)},e.prototype.copy=function(){this.state=this.object[this.property]},e.prototype.emit=function(e){var r=this;try{this.sources.forEach((function(t){window.dispatchEvent(function(e,t,r,n,o){return new CustomEvent(V(e,o),{detail:"function"==typeof t[r]?new C(o,r,n):new $(o,r,n)})}(t,r.object,r.property,e,r.path))}))}catch(e){i.getInstance().error(t.MonitorEmitError,{path:this.path,property:this.property,reason:e.message}),oe.error(G)}},e}()),ue=function(){function e(){this.monitors={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.create=function(e,t,r,n){var o="function"==typeof t[r]?n:n+"."+r;if(this.monitors[o])this.monitors[o].addSource(e);else{var i=Object.getOwnPropertyDescriptor(t,r)||null;(null===i||i.configurable)&&(this.monitors[o]=new se(e,t,r,n))}return this.monitors[o]},e.prototype.remove=function(e,t){var r=this;void 0===t&&(t=!1),(t?Object.getOwnPropertyNames(this.monitors).filter((function(t){return s(t,e)})):[e]).forEach((function(e){var t=r.monitors[e];t&&(t.remove(),delete r.monitors[e])}))},e}(),pe=function(){function e(e){var t=this;void 0===e&&(e={rules:[],previewMode:!1,previewDestination:"console.log",readOnLoad:!1,validateRules:!0}),this.config=e,this.customOperators={},this.handlers=[],this.listeners={};var r=e.appender,n=e.logLevel,o=e.rules;if(r&&("string"==typeof r?i.getInstance(r):i.getInstance().appender=r),void 0!==n&&(i.getInstance().level=n),o&&o.length>0){var a=oe.startSpan(L,{ruleCount:o.length});o.forEach((function(e){return t.registerRule(e)})),a.end()}}return e.prototype.addHandler=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=ie.DefaultDebounceTime);var o=new ie(e,t,r,n);return this.handlers.push(o),o},e.prototype.addMonitor=function(e,t){var r=t.subject,n=t.property,o=t.subjectPath,i=t.path,a=t.selector;if("function"===t.type)ue.getInstance().create(e,r,n,i);else{a&&ue.getInstance().create(e,r,n,o);var s=t.value;Object.getOwnPropertyNames(t.query()).forEach((function(t){ue.getInstance().create(e,s,t,i)}))}},e.prototype.addOperators=function(e,r,n){var o=this,a=this.config,s=a.beforeDestination,u=a.previewDestination,p=void 0===u?"console.log":u,c=a.previewMode;try{if(r.forEach((function(t){e.push(o.getOperator(t))})),s)(Array.isArray(s)?s:[s]).forEach((function(t){return e.push(o.getOperator(t))}));var l=c?p:n;e.push(new _({name:"function",func:l}))}catch(n){throw this.removeHandler(e),i.getInstance().error(t.OperatorError,{operator:JSON.stringify(r)}),oe.error(W),n}},e.prototype.getOperator=function(e){try{var r=e.name,n=this.customOperators[r]?this.customOperators[r]:q.create(r,e);return this.config.validateRules&&n.validate(),n}catch(r){throw i.getInstance().error(t.OperatorError,{operator:JSON.stringify(e)}),oe.error(W),r}},e.prototype.isUrlValid=function(e){var t=this.config.urlValidator;return t?t(e):!e||RegExp(e).test(window.location.href)},e.prototype.registerTarget=function(e,r,n,o,a,s,u,p){void 0===a&&(a=!1),void 0===s&&(s=!0),void 0===u&&(u=!1),void 0===p&&(p=ie.DefaultDebounceTime);var c=r,l=c.value;s&&Array.isArray(l)&&(l.push&&l.unshift?(this.registerTarget(e,ae.find(r.path+".unshift"),n,o,!1,!0,u,p),c=ae.find(r.path+".push")):i.getInstance().warn(t.MonitorCreateError,{path:c.path,property:c.property,selector:c.selector,reason:"Browser does not support push and unshift"}));var f=this.addHandler(e,c,!!u,p);if(this.addOperators(f,n,o),a)if(Array.isArray(l))for(var h=0;h<l.length;h+=1)try{f.fireEvent(l[h])}catch(e){i.getInstance().error(t.ObserverReadError,{path:c.path,property:c.property,selector:c.selector,reason:e.message}),oe.error(K)}else if("object"===c.type)try{f.fireEvent()}catch(e){i.getInstance().error(t.ObserverReadError,{path:c.path,property:c.property,selector:c.selector,reason:e.message}),oe.error(K)}if(s||"function"===c.type)try{this.addMonitor(e,c)}catch(e){i.getInstance().warn(t.MonitorCreateError,{path:c.path,property:c.property,selector:c.selector,reason:e.message})}return f},e.prototype.sleep=function(e,t,r,n,o,i){var a=this;if(void 0===n&&(n=5),void 0===o&&(o=1),void 0===i&&(i=250),o>n)r();else if(e())t();else{var s=Math.pow(2,o-1)*i+Math.random();setTimeout((function(){a.sleep(e,t,r,n,o+1,i)}),s)}},e.prototype.registerRule=function(n){var o=this,a=this.config.readOnLoad,s=n.id,u=void 0===s?"":s,p=n.debounce,c=n.debug,l=n.source,f=n.operators,h=void 0===f?[]:f,d=n.destination,v=n.readOnLoad,y=n.url,g=n.monitor,m=void 0===g||g,w=n.waitUntil,b=void 0===w?e.DefaultWaitUntil:w,E=void 0===v?a:v;if(!l||!d)return i.getInstance().error(t.RuleInvalid,{rule:u,source:l,reason:"Missing "+(l?"destination":"source")}),void oe.error(Z);if(this.isUrlValid(y))try{var x=function(){var e=ae.find(l);o.registerTarget(l,e,h,d,E,m,c,p)},O=n.maxRetry,k=void 0===O?5:O;switch(typeof b){case"number":setTimeout((function(){x()}),b>-1?b:0);break;case"function":this.sleep((function(){return b(ae.find(l))}),x,(function(){return i.getInstance().warn(t.RuleRegistrationError,{rule:u,source:l,reason:"Max Retries Attempted"})}),k);break;default:i.getInstance().warn(i.format(r.UnsupportedType,typeof b))}}catch(e){i.getInstance().warn(t.RuleRegistrationError,{rule:u,source:l,reason:e.message})}},e.prototype.registerOperator=function(e,t){if(q.hasOperator(e)||this.customOperators[e])throw new Error(i.format(r.DuplicateValue,e));this.customOperators[e]=t},e.prototype.removeHandler=function(e){e.stop();var t=this.handlers.indexOf(e);t>-1&&this.handlers.splice(t,1)},e.DefaultWaitUntil=function(e){var t=e.value;if(void 0===t&&("object"!=typeof t||"function"!=typeof t))return!1;if("object"==typeof t){var r=e.query();return void 0!==r&&Object.getOwnPropertyNames(r).length>0}return!0},e}();!function(){try{var e=window;i.getInstance(e._dlo_appender),e._dlo_telemetryProvider?oe.setProvider(e._dlo_telemetryProvider):oe.setProvider(oe.withExporter(e._dlo_telemetryExporter).withDefaultAttributes(Y));var r=oe.startSpan(U);if(e._dlo_observer)return void i.getInstance().warn(t.ObserverMultipleLoad);var n=function(){try{var e=oe.startSpan(F),r=[];return Object.getOwnPropertyNames(window).forEach((function(e){if(!1!==s(e,"_dlo_rules")){var n=window[e];!1!==Array.isArray(n)?n.forEach((function(e){r.push(e)})):i.getInstance().warn(t.RuleInvalid,{property:n,reason:"Rules list must be an array"})}})),e.end(),r}catch(e){return i.getInstance().error(t.RuleRegistrationError,{reason:"Error: "+e}),oe.error(Q),[]}}();0===n.length&&i.getInstance().warn(t.ObserverRulesNone),e._dlo_observer=new pe({appender:e._dlo_appender||void 0,beforeDestination:e._dlo_beforeDestination||void 0,logLevel:e._dlo_logLevel,previewMode:!0===e._dlo_previewMode,previewDestination:e._dlo_previewDestination||void 0,readOnLoad:!0===e._dlo_readOnLoad,validateRules:!0===e._dlo_validateRules,urlValidator:e._dlo_urlValidator||void 0,rules:n}),r.end()}catch(e){i.getInstance().error(t.ObserverInitializationError,{reason:"Error: "+e}),oe.error(X)}}()}();