var xo=function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var i=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Post="POST",e.Get="GET",e.Put="PUT",e.Patch="PATCH",e.Delete="DELETE"}(t.Method||(t.Method={}))}));r(i);i.Method;var s=a((function(e,r){var a,i=t&&t.__extends||(a=function(e,t){return(a=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)},function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=function(e){function t(r){var a=e.call(this,r)||this;return a.name="TimeoutError",Object.setPrototypeOf(a,t.prototype),a}return i(t,e),t}(Error);r.TimeoutError=s}));r(s);s.TimeoutError;var o=a((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(i),r(s)}));r(o);var n=a((function(e,r){var a=t&&t.__awaiter||function(e,t,r,a){return new(r||(r=Promise))((function(i,s){function o(e){try{p(a.next(e))}catch(e){s(e)}}function n(e){try{p(a.throw(e))}catch(e){s(e)}}function p(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,n)}p((a=a.apply(e,t||[])).next())}))},i=t&&t.__generator||function(e,t){var r,a,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function n(s){return function(n){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]>16)+(t>>16)+(r>>16)<<16|65535&r}function P(e,t,r,a,i,s){return b((o=b(b(t,e),b(a,s)))<<(n=i)|o>>>32-n,r);var o,n}function w(e,t,r,a,i,s,o){return P(t&r|~t&a,e,t,i,s,o)}function A(e,t,r,a,i,s,o){return P(t&a|r&~a,e,t,i,s,o)}function S(e,t,r,a,i,s,o){return P(t^r^a,e,t,i,s,o)}function k(e,t,r,a,i,s,o){return P(r^(t|~a),e,t,i,s,o)}var O=g("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Array(t.length);for(var r=0;r>5]>>>t%32&255,a=parseInt("0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r),16),i.push(a);return i}(function(e,t){var r,a,i,s,o;e[t>>5]|=128<>>9<<4)]=t;var n=1732584193,p=-271733879,c=-1732584194,u=271733878;for(r=0;r>2)-1]=void 0,t=0;t>5]|=(255&e[t/8])<>>32-t}var j=g("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var a=unescape(encodeURIComponent(e));e=new Array(a.length);for(var i=0;i>>0;f=m,m=y,y=C(h,30)>>>0,h=d,d=v}r[0]=r[0]+d>>>0,r[1]=r[1]+h>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+f>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]})),_=Object.freeze({__proto__:null,v1:function(e,t,r){var a=t&&r||0,i=t||[],s=(e=e||{}).node||d,o=void 0!==e.clockseq?e.clockseq:h;if(null==s||null==o){var n=e.random||(e.rng||u)();null==s&&(s=d=[1|n[0],n[1],n[2],n[3],n[4],n[5]]),null==o&&(o=h=16383&(n[6]<<8|n[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:v+1,y=p-l+(c-v)/1e4;if(y<0&&void 0===e.clockseq&&(o=o+1&16383),(y<0||p>l)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,v=c,h=o;var m=(1e4*(268435455&(p+=122192928e5))+c)%4294967296;i[a++]=m>>>24&255,i[a++]=m>>>16&255,i[a++]=m>>>8&255,i[a++]=255&m;var g=p/4294967296*1e4&268435455;i[a++]=g>>>8&255,i[a++]=255&g,i[a++]=g>>>24&15|16,i[a++]=g>>>16&255,i[a++]=o>>>8|128,i[a++]=255&o;for(var b=0;b<6;++b)i[a+b]=s[b];return t||f(i)},v3:O,v4:function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||u)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[a+s]=i[s];return t||f(i)},v5:j}),I=E,T=E,B={$schema:"http://json-schema.org/draft-07/schema#",definitions:{User:{properties:{identities:{additionalProperties:{type:"string"},type:"object"},segments:{items:{type:"string"},type:"array"},traits:{additionalProperties:{},type:"object"}},required:["identities"],type:"object"}},properties:{action:{type:"string"},metadata:{additionalProperties:{anyOf:[{items:{},type:"array"},{type:["string","number","boolean"]}]},properties:{currency:{type:"string"},market:{type:"string"},orderId:{type:"string"},price:{type:"number"},quantity:{type:"number"}},type:"object"},opposite:{type:"boolean"},segments:{items:{type:"string"},type:"array"},sourceId:{type:"string"},target:{additionalProperties:{type:"string"},type:"object"},timestamp:{type:"string"},user:{$ref:"#/definitions/User"}},required:["action","target"],type:"object"},M={properties:{identities:{additionalProperties:{type:"string"},type:"object"},segments:{items:{type:"string"},type:"array"},traits:{additionalProperties:{},type:"object"}},required:["identities"],type:"object"};function E(e,t){if(t){var r=t.instancePath;t.parentData,t.parentDataProperty,t.rootData}else r="";var a=null,i=0;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.action){var s={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"action"},message:"must have required property 'action'",schema:B.required,parentSchema:B,data:e};null===a?a=[s]:a.push(s),i++}if(void 0===e.target){var o={instancePath:r,schemaPath:"#/required",keyword:"required",params:{missingProperty:"target"},message:"must have required property 'target'",schema:B.required,parentSchema:B,data:e};null===a?a=[o]:a.push(o),i++}if(void 0!==e.action){var n=e.action;if("string"!=typeof n){var p={instancePath:r+"/action",schemaPath:"#/properties/action/type",keyword:"type",params:{type:"string"},message:"must be string",schema:B.properties.action.type,parentSchema:B.properties.action,data:n};null===a?a=[p]:a.push(p),i++}}if(void 0!==e.metadata){var c=e.metadata;if(c&&"object"==typeof c&&!Array.isArray(c)){for(var u in c)if("currency"!==u&&"market"!==u&&"orderId"!==u&&"price"!==u&&"quantity"!==u){var d=c[u],h=i,y=!1,m=i;if(!Array.isArray(d)){var f={instancePath:r+"/metadata/"+u.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/metadata/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"array"},message:"must be array",schema:B.properties.metadata.additionalProperties.anyOf[0].type,parentSchema:B.properties.metadata.additionalProperties.anyOf[0],data:d};null===a?a=[f]:a.push(f),i++}var l=m===i;if(!(y=y||l)){var v=i;if("string"!=typeof d&&("number"!=typeof d||!isFinite(d))&&"boolean"!=typeof d){var g={instancePath:r+"/metadata/"+u.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/metadata/additionalProperties/anyOf/1/type",keyword:"type",params:{type:B.properties.metadata.additionalProperties.anyOf[1].type},message:"must be string,number,boolean",schema:B.properties.metadata.additionalProperties.anyOf[1].type,parentSchema:B.properties.metadata.additionalProperties.anyOf[1],data:d};null===a?a=[g]:a.push(g),i++}l=v===i;y=y||l}if(y)i=h,null!==a&&(h?a.length=h:a=null);else{var b={instancePath:r+"/metadata/"+u.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/metadata/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:B.properties.metadata.additionalProperties.anyOf,parentSchema:B.properties.metadata.additionalProperties,data:d};null===a?a=[b]:a.push(b),i++}}if(void 0!==c.currency){var P=c.currency;if("string"!=typeof P){var w={instancePath:r+"/metadata/currency",schemaPath:"#/properties/metadata/properties/currency/type",keyword:"type",params:{type:"string"},message:"must be string",schema:B.properties.metadata.properties.currency.type,parentSchema:B.properties.metadata.properties.currency,data:P};null===a?a=[w]:a.push(w),i++}}if(void 0!==c.market){var A=c.market;if("string"!=typeof A){var S={instancePath:r+"/metadata/market",schemaPath:"#/properties/metadata/properties/market/type",keyword:"type",params:{type:"string"},message:"must be string",schema:B.properties.metadata.properties.market.type,parentSchema:B.properties.metadata.properties.market,data:A};null===a?a=[S]:a.push(S),i++}}if(void 0!==c.orderId){var k=c.orderId;if("string"!=typeof k){var O={instancePath:r+"/metadata/orderId",schemaPath:"#/properties/metadata/properties/orderId/type",keyword:"type",params:{type:"string"},message:"must be string",schema:B.properties.metadata.properties.orderId.type,parentSchema:B.properties.metadata.properties.orderId,data:k};null===a?a=[O]:a.push(O),i++}}if(void 0!==c.price){var q=c.price;if("number"!=typeof q||!isFinite(q)){var C={instancePath:r+"/metadata/price",schemaPath:"#/properties/metadata/properties/price/type",keyword:"type",params:{type:"number"},message:"must be number",schema:B.properties.metadata.properties.price.type,parentSchema:B.properties.metadata.properties.price,data:q};null===a?a=[C]:a.push(C),i++}}if(void 0!==c.quantity){var j=c.quantity;if("number"!=typeof j||!isFinite(j)){var _={instancePath:r+"/metadata/quantity",schemaPath:"#/properties/metadata/properties/quantity/type",keyword:"type",params:{type:"number"},message:"must be number",schema:B.properties.metadata.properties.quantity.type,parentSchema:B.properties.metadata.properties.quantity,data:j};null===a?a=[_]:a.push(_),i++}}}else{var I={instancePath:r+"/metadata",schemaPath:"#/properties/metadata/type",keyword:"type",params:{type:"object"},message:"must be object",schema:B.properties.metadata.type,parentSchema:B.properties.metadata,data:c};null===a?a=[I]:a.push(I),i++}}if(void 0!==e.opposite){var T=e.opposite;if("boolean"!=typeof T){var U={instancePath:r+"/opposite",schemaPath:"#/properties/opposite/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:B.properties.opposite.type,parentSchema:B.properties.opposite,data:T};null===a?a=[U]:a.push(U),i++}}if(void 0!==e.segments){var R=e.segments;if(Array.isArray(R))for(var x=R.length,z=0;z>>16)*t&65535)<<16)}function o(e,t){return e<>>32-t}function n(e){return e=s(e^=e>>>16,2246822507),e=s(e^=e>>>13,3266489909),e^=e>>>16}function p(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function c(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function u(e,t){return 32===(t%=64)?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function d(e,t){return 0===(t%=64)?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=h(e=c(e,[4283543511,3981806797]),[0,e[0]>>>1]),e=h(e=c(e,[3301882366,444984403]),[0,e[0]>>>1])}i.x86.hash32=function(e,t){t=t||0;for(var r=(e=e||"").length%4,a=e.length-r,i=t,p=0,c=3432918353,u=461845907,d=0;d>>0},i.x86.hash128=function(e,t){t=t||0;for(var r=(e=e||"").length%16,a=e.length-r,i=t,p=t,c=t,u=t,d=0,h=0,y=0,m=0,f=597399067,l=2869860233,v=951274213,g=2716044179,b=0;b>>0).toString(16)).slice(-8)+("00000000"+(p>>>0).toString(16)).slice(-8)+("00000000"+(c>>>0).toString(16)).slice(-8)+("00000000"+(u>>>0).toString(16)).slice(-8)},i.x64.hash128=function(e,t){t=t||0;for(var r=(e=e||"").length%16,a=e.length-r,i=[0,t],s=[0,t],o=[0,0],n=[0,0],m=[2277735313,289559509],f=[1291169091,658871167],l=0;l>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)},e.exports&&(t=e.exports=i),t.murmurHash3=i}()})),z=(x.murmurHash3,x),D=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.drawAbTestVariationForUser=function(e,t){var r=z.x86.hash32(e+"#"+t.id)%100+1,a=0;return{bucket:r,variationId:t.variations.find((function(e){return(a+=e.weight)>=r})).id}}}));r(D);D.drawAbTestVariationForUser;var G=H,F=H,N={$schema:"http://json-schema.org/draft-07/schema#",additionalProperties:!1,definitions:{DisableOptions:{additionalProperties:!1,properties:{name:{description:'Feature to disable in the query\nExample: "facet"',type:"string"}},required:["name"],type:"object"},SortOptions:{additionalProperties:!1,properties:{attribute:{description:"Attribute to sort by",type:"string"},order:{description:'Order of the sort.\nMust be either "asc" or "desc"',type:"string"}},required:["attribute","order"],type:"object"}},properties:{aiSearch:{type:"boolean"},customResponseMask:{description:"Response mask to return only specific attributes of items",type:"string"},disable:{description:"Disable rules\nIf specified, disable specific functionalities",items:{$ref:"#/definitions/DisableOptions"},type:"array"},facets:{items:{additionalProperties:!1,properties:{attribute:{description:"Selected facet to filter by\nTODO: Should be removed after migration to ids",type:"string"},id:{description:"Selected facet to filter by",type:"string"},values:{description:"Values of the facet used for filtering the results",items:{type:"string"},type:"array"}},required:["values"],type:"object"},type:"array"},filter:{description:"Filter string",type:"string"},limit:{description:"Pagination: size of the page",type:"number"},offset:{description:"Pagination: index of the first item to return",type:"number"},sortBy:{description:"List of sorting rules\n(applied in order)",items:{$ref:"#/definitions/SortOptions"},type:"array"}},type:"object"},V={additionalProperties:!1,properties:{name:{description:'Feature to disable in the query\nExample: "facet"',type:"string"}},required:["name"],type:"object"},L={additionalProperties:!1,properties:{attribute:{description:"Attribute to sort by",type:"string"},order:{description:'Order of the sort.\nMust be either "asc" or "desc"',type:"string"}},required:["attribute","order"],type:"object"};function H(e,t){if(t){var r=t.instancePath;t.parentData,t.parentDataProperty,t.rootData}else r="";var a=null,i=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(var s in e)if("aiSearch"!==s&&"customResponseMask"!==s&&"disable"!==s&&"facets"!==s&&"filter"!==s&&"limit"!==s&&"offset"!==s&&"sortBy"!==s){var o={instancePath:r,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:s},message:"must NOT have additional properties",schema:!1,parentSchema:N,data:e};null===a?a=[o]:a.push(o),i++}if(void 0!==e.aiSearch){var n=e.aiSearch;if("boolean"!=typeof n){var p={instancePath:r+"/aiSearch",schemaPath:"#/properties/aiSearch/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:N.properties.aiSearch.type,parentSchema:N.properties.aiSearch,data:n};null===a?a=[p]:a.push(p),i++}}if(void 0!==e.customResponseMask){var c=e.customResponseMask;if("string"!=typeof c){var u={instancePath:r+"/customResponseMask",schemaPath:"#/properties/customResponseMask/type",keyword:"type",params:{type:"string"},message:"must be string",schema:N.properties.customResponseMask.type,parentSchema:N.properties.customResponseMask,data:c};null===a?a=[u]:a.push(u),i++}}if(void 0!==e.disable){var d=e.disable;if(Array.isArray(d))for(var h=d.length,y=0;y0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]