diff --git a/dist/addsearch-js-client.min.js b/dist/addsearch-js-client.min.js index c18c954..328e1bb 100644 --- a/dist/addsearch-js-client.min.js +++ b/dist/addsearch-js-client.min.js @@ -1 +1 @@ -/*! addsearch-js-client 0.8.6 */(()=>{var t={9669:(t,e,n)=>{t.exports=n(1609)},5448:(t,e,n)=>{"use strict";var r=n(4867),i=n(6026),s=n(4372),o=n(5327),a=n(4097),u=n(4109),c=n(7985),f=n(7874),h=n(2648),l=n(644),p=n(205);t.exports=function(t){return new Promise((function(e,n){var d,g=t.data,y=t.headers,m=t.responseType;function v(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}r.isFormData(g)&&r.isStandardBrowserEnv()&&delete y["Content-Type"];var w=new XMLHttpRequest;if(t.auth){var b=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";y.Authorization="Basic "+btoa(b+":"+E)}var A=a(t.baseURL,t.url);function O(){if(w){var r="getAllResponseHeaders"in w?u(w.getAllResponseHeaders()):null,s={data:m&&"text"!==m&&"json"!==m?w.response:w.responseText,status:w.status,statusText:w.statusText,headers:r,config:t,request:w};i((function(t){e(t),v()}),(function(t){n(t),v()}),s),w=null}}if(w.open(t.method.toUpperCase(),o(A,t.params,t.paramsSerializer),!0),w.timeout=t.timeout,"onloadend"in w?w.onloadend=O:w.onreadystatechange=function(){w&&4===w.readyState&&(0!==w.status||w.responseURL&&0===w.responseURL.indexOf("file:"))&&setTimeout(O)},w.onabort=function(){w&&(n(new h("Request aborted",h.ECONNABORTED,t,w)),w=null)},w.onerror=function(){n(new h("Network Error",h.ERR_NETWORK,t,w,w)),w=null},w.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||f;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new h(e,r.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,t,w)),w=null},r.isStandardBrowserEnv()){var S=(t.withCredentials||c(A))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;S&&(y[t.xsrfHeaderName]=S)}"setRequestHeader"in w&&r.forEach(y,(function(t,e){void 0===g&&"content-type"===e.toLowerCase()?delete y[e]:w.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(w.withCredentials=!!t.withCredentials),m&&"json"!==m&&(w.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&w.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&w.upload&&w.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(d=function(t){w&&(n(!t||t&&t.type?new l:t),w.abort(),w=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d))),g||(g=null);var _=p(A);_&&-1===["http","https","file"].indexOf(_)?n(new h("Unsupported protocol "+_+":",h.ERR_BAD_REQUEST,t)):w.send(g)}))}},1609:(t,e,n)=>{"use strict";var r=n(4867),i=n(1849),s=n(321),o=n(7185);var a=function t(e){var n=new s(e),a=i(s.prototype.request,n);return r.extend(a,s.prototype,n),r.extend(a,n),a.create=function(n){return t(o(e,n))},a}(n(5546));a.Axios=s,a.CanceledError=n(644),a.CancelToken=n(4972),a.isCancel=n(6502),a.VERSION=n(7288).version,a.toFormData=n(7675),a.AxiosError=n(2648),a.Cancel=a.CanceledError,a.all=function(t){return Promise.all(t)},a.spread=n(8713),a.isAxiosError=n(6268),t.exports=a,t.exports.default=a},4972:(t,e,n)=>{"use strict";var r=n(644);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e{"use strict";var r=n(2648);function i(t){r.call(this,null==t?"canceled":t,r.ERR_CANCELED),this.name="CanceledError"}n(4867).inherits(i,r,{__CANCEL__:!0}),t.exports=i},6502:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:(t,e,n)=>{"use strict";var r=n(4867),i=n(5327),s=n(782),o=n(3572),a=n(7185),u=n(4097),c=n(4875),f=c.validators;function h(t){this.defaults=t,this.interceptors={request:new s,response:new s}}h.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var s,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var h=[o,void 0];for(Array.prototype.unshift.apply(h,r),h=h.concat(u),s=Promise.resolve(e);h.length;)s=s.then(h.shift(),h.shift());return s}for(var l=e;r.length;){var p=r.shift(),d=r.shift();try{l=p(l)}catch(t){d(t);break}}try{s=o(l)}catch(t){return Promise.reject(t)}for(;u.length;)s=s.then(u.shift(),u.shift());return s},h.prototype.getUri=function(t){t=a(this.defaults,t);var e=u(t.baseURL,t.url);return i(e,t.params,t.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(t){h.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(a(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}h.prototype[t]=e(),h.prototype[t+"Form"]=e(!0)})),t.exports=h},2648:(t,e,n)=>{"use strict";var r=n(4867);function i(t,e,n,r,i){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var s=i.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){o[t]={value:t}})),Object.defineProperties(i,o),Object.defineProperty(s,"isAxiosError",{value:!0}),i.from=function(t,e,n,o,a,u){var c=Object.create(s);return r.toFlatObject(t,c,(function(t){return t!==Error.prototype})),i.call(c,t.message,e,n,o,a),c.name=t.name,u&&Object.assign(c,u),c},t.exports=i},782:(t,e,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},4097:(t,e,n)=>{"use strict";var r=n(1793),i=n(7303);t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},3572:(t,e,n)=>{"use strict";var r=n(4867),i=n(8527),s=n(6502),o=n(5546),a=n(644);function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return u(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(u(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},7185:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function s(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function o(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function a(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function u(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||s,i=e(t);r.isUndefined(i)&&e!==u||(n[t]=i)})),n}},6026:(t,e,n)=>{"use strict";var r=n(2648);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}},8527:(t,e,n)=>{"use strict";var r=n(4867),i=n(5546);t.exports=function(t,e,n){var s=this||i;return r.forEach(n,(function(n){t=n.call(s,t,e)})),t}},5546:(t,e,n)=>{"use strict";var r=n(4867),i=n(6016),s=n(2648),o=n(7874),a=n(7675),u={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var f,h={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(f=n(5448)),f),transformRequest:[function(t,e){if(i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t))return t;if(r.isArrayBufferView(t))return t.buffer;if(r.isURLSearchParams(t))return c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n,s=r.isObject(t),o=e&&e["Content-Type"];if((n=r.isFileList(t))||s&&"multipart/form-data"===o){var u=this.env&&this.env.FormData;return a(n?{"files[]":t}:t,u&&new u)}return s||"application/json"===o?(c(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||h.transitional,n=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||i&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw s.from(t,s.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:n(1623)},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){h.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){h.headers[t]=r.merge(u)})),t.exports=h},7874:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:t=>{t.exports={version:"0.27.2"}},1849:t=>{"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var s;if(n)s=n(e);else if(r.isURLSearchParams(e))s=e.toString();else{var o=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),o.push(i(e)+"="+i(t))})))})),s=o.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},7303:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},4372:(t,e,n)=>{"use strict";var r=n(4867);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,s,o){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},6268:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t){return r.isObject(t)&&!0===t.isAxiosError}},7985:(t,e,n)=>{"use strict";var r=n(4867);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},6016:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},1623:t=>{t.exports=null},4109:(t,e,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,s,o={};return t?(r.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=r.trim(t.substr(0,s)).toLowerCase(),n=r.trim(t.substr(s+1)),e){if(o[e]&&i.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}},205:t=>{"use strict";t.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},8713:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},7675:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){e=e||new FormData;var n=[];function i(t){return null===t?"":r.isDate(t)?t.toISOString():r.isArrayBuffer(t)||r.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(s,o){if(r.isPlainObject(s)||r.isArray(s)){if(-1!==n.indexOf(s))throw Error("Circular reference detected in "+o);n.push(s),r.forEach(s,(function(n,s){if(!r.isUndefined(n)){var a,u=o?o+"."+s:s;if(n&&!o&&"object"==typeof n)if(r.endsWith(s,"{}"))n=JSON.stringify(n);else if(r.endsWith(s,"[]")&&(a=r.toArray(n)))return void a.forEach((function(t){!r.isUndefined(t)&&e.append(u,i(t))}));t(n,u)}})),n.pop()}else e.append(o,i(s))}(t),e}},4875:(t,e,n)=>{"use strict";var r=n(7288).version,i=n(2648),s={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){s[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var o={};s.transitional=function(t,e,n){function s(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,a){if(!1===t)throw new i(s(r," has been removed"+(e?" in "+e:"")),i.ERR_DEPRECATED);return e&&!o[r]&&(o[r]=!0,console.warn(s(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,a)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),s=r.length;s-- >0;){var o=r[s],a=e[o];if(a){var u=t[o],c=void 0===u||a(u,o,t);if(!0!==c)throw new i("option "+o+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+o,i.ERR_BAD_OPTION)}},validators:s}},4867:(t,e,n)=>{"use strict";var r,i=n(1849),s=Object.prototype.toString,o=(r=Object.create(null),function(t){var e=s.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function u(t){return Array.isArray(t)}function c(t){return void 0===t}var f=a("ArrayBuffer");function h(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==o(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var p=a("Date"),d=a("File"),g=a("Blob"),y=a("FileList");function m(t){return"[object Function]"===s.call(t)}var v=a("URLSearchParams");function w(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n0;)o[s=r[i]]||(e[s]=t[s],o[s]=!0);t=Object.getPrototypeOf(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:o,kindOfTest:a,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;var e=t.length;if(c(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},isTypedArray:E,isFileList:y}},2381:(t,e,n)=>{"use strict";n(2702).polyfill();var r=n(9669).default;t.exports=function t(e,n,i,s,o,a,u,c){var f=function(t,e){return t||!1===t?"&"+e+"="+t:""};if("search"===i||"suggest"===i||"autocomplete"===i||"recommend"===i){var h,l="",p="",d=null;if("search"===i){d=i,l=s.keyword,l=s.enableLogicalOperators?l.replace(/ and /g," AND ").replace(/ or /g," OR ").replace(/ not /g," NOT "):l.replace(/ AND /g," and ").replace(/ OR /g," or ").replace(/ NOT /g," not "),l=encodeURIComponent(l);var g=s.fuzzy;if("retry"===g&&(g=!0===a),"search"===i){if(p=f(s.lang,"lang")+f(g,"fuzzy")+f(s.collectAnalytics,"collectAnalytics")+f(s.postfixWildcard,"postfixWildcard")+f(s.categories,"categories")+f(s.priceFromCents,"priceFromCents")+f(s.priceToCents,"priceToCents")+f(s.dateFrom,"dateFrom")+f(s.dateTo,"dateTo")+f(s.paging.page,"page")+f(s.paging.pageSize,"limit")+f(s.shuffleAndLimitTo,"shuffleAndLimitTo")+f(s.jwt,"jwt")+f(s.resultType,"resultType")+f(s.userToken,"userToken")+f(s.numFacets,"numFacets")+f(s.cacheResponseTime,"cacheResponseWithTtlSeconds")+f(s.searchOperator,"defaultOperator")+f(s.analyticsTag,"analyticsTag"),Array.isArray(s.paging.sortBy)?s.paging.sortBy.forEach((function(t,e){p=p+f(t,"sort")+f(s.paging.sortOrder[e],"order")})):p=p+f(s.paging.sortBy,"sort")+f(s.paging.sortOrder,"order"),s.customFieldFilters)for(var y=0;y=c&&(u.total_hits=c)}o(u)}})).catch((function(t){console.log(t),o({error:{response:500,message:"invalid server response"}})}))}else o({error:{response:400,message:"invalid query type"}})}},4410:t=>{t.exports={setCookie:function(t,e,n){if(document){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3);var i="expires="+r.toUTCString();document.cookie=t+"="+e+";"+i+";path=/"}},getCookie:function(t){if(document)for(var e=t+"=",n=decodeURIComponent(document.cookie).split(";"),r=0;r{"use strict";var r=n(2381),i=n(7788),s=n(3336),o=n(8719),a=n(4420),u=n(6293),c=n(4410),f="addsearchUserToken";t.exports=function(t,e){this.sitekey=t,this.privatekey=e,this.apiHostname="api.addsearch.com",this.settings=new o,this.sessionId=("a-"+1e8*Math.random()).substring(0,10),this.userTokenInPersonalization=c.getCookie(f)||a.generateUUID(),this.search=function(t,e){var n=null,i=null;if(t&&a.isFunction(e))n=t,i=e;else if(!e&&a.isFunction(t))n=this.settings.getSettings().keyword,i=t;else{if(!this.settings.getSettings().callback)throw"Illegal search parameters. Should be (keyword, callbackFunction) or (callbackFunction)";n=this.settings.getSettings().keyword,i=this.settings.getSettings().callback}this.settings.setCallback(i),this.settings.setKeyword(n),this.throttledSearchFetch||(this.throttledSearchFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledSearchFetch(this.apiHostname,this.sitekey,"search",this.settings.getSettings(),i)},this.suggestions=function(t,e){if(!t||!e||!a.isFunction(e))throw"Illegal suggestions parameters. Should be (prefix, callbackFunction)";this.settings.setSuggestionsPrefix(t),this.throttledSuggestionsFetch||(this.throttledSuggestionsFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledSuggestionsFetch(this.apiHostname,this.sitekey,"suggest",this.settings.getSettings(),e)},this.autocomplete=function(t,e,n){if(!(t&&e&&n&&a.isFunction(n)))throw"Illegal autocomplete parameters. Should be (field, prefix, callbackFunction)";this.settings.setAutocompleteParams(t,e),this.throttledAutocompleteFetch||(this.throttledAutocompleteFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledAutocompleteFetch(this.apiHostname,this.sitekey,"autocomplete",this.settings.getSettings(),n)},this.fetchCustomApi=function(t,e,n){var i=Object.assign({},this.settings.getSettings());i.facetFields=i.facetFields.filter((function(e){return t===e})),r(this.apiHostname,this.sitekey,"search",i,n,null,e)},this.fetchRangeFacets=function(t,e,n){var i=Object.assign({},this.settings.getSettings());i.rangeFacets||(i.rangeFacets=[]),i.rangeFacets.push({field:t.field,ranges:t.ranges}),r(this.apiHostname,this.sitekey,"search",i,n,null,e)},this.recommendations=function(t,e){if(!t||!e||!a.isFunction(e))throw"Illegal recommendations parameters. Should be (options, callbackFunction)";this.throttledSuggestionsFetch||(this.throttledSuggestionsFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledSuggestionsFetch(this.apiHostname,this.sitekey,"recommend",null,e,!1,null,t)},this.getDocument=function(t){return i.getDocument(this.apiHostname,this.sitekey,this.privatekey,t)},this.saveDocument=function(t){return i.saveDocument(this.apiHostname,this.sitekey,this.privatekey,t)},this.saveDocumentsBatch=function(t){if(!t||!t.documents||!Array.isArray(t.documents))throw"Please provide an array of documents: {documents: []}";return i.saveDocumentsBatch(this.apiHostname,this.sitekey,this.privatekey,t)},this.deleteDocument=function(t){return i.deleteDocument(this.apiHostname,this.sitekey,this.privatekey,t)},this.deleteDocumentsBatch=function(t){if(!t||!t.documents||!Array.isArray(t.documents))throw"Please provide an array of document ids: {documents: []}";return i.deleteDocumentsBatch(this.apiHostname,this.sitekey,this.privatekey,t)},this.setApiHostname=function(t){this.apiHostname=t},this.getSettings=function(){return this.settings.getSettings()},this.setLanguage=function(t){this.settings.setLanguage(t)},this.setCategoryFilters=function(t){this.settings.setCategoryFilters(t)},this.addCustomFieldFilter=function(t,e){this.settings.addCustomFieldFilter(t,e)},this.removeCustomFieldFilter=function(t,e){this.settings.removeCustomFieldFilter(t,e)},this.setPriceRangeFilter=function(t,e){this.settings.setPriceRangeFilter(t,e)},this.setDateFilter=function(t,e){this.settings.setDateFilter(t,e)},this.setJWT=function(t){this.settings.setJWT(t)},this.setUserToken=function(t){this.settings.setUserToken(t)},this.setPaging=function(t,e,n,r){this.settings.setPaging(t,e,n,r)},this.nextPage=function(){this.settings.nextPage()},this.previousPage=function(){this.settings.previousPage()},this.setSuggestionsSize=function(t){this.settings.setSuggestionsSize(t)},this.setAutocompleteSize=function(t){this.settings.setAutocompleteSize(t)},this.addFacetField=function(t){this.settings.addFacetField(t)},this.addHierarchicalFacetSetting=function(t){this.settings.addHierarchicalFacetSetting(t)},this.addRangeFacet=function(t,e){this.settings.addRangeFacet(t,e)},this.addStatsField=function(t){this.settings.addStatsField(t)},this.setNumberOfFacets=function(t){this.settings.setNumberOfFacets(t)},this.setResultType=function(t){this.settings.setResultType(t)},this.setPersonalizationEvents=function(t){this.settings.setPersonalizationEvents(t)},this.setFilterObject=function(t){this.settings.setFilterObject(t)},this.setShuffleAndLimitTo=function(t){this.settings.setShuffleAndLimitTo(t)},this.setFuzzyMatch=function(t){this.settings.setFuzzyMatch(t)},this.setPostfixWildcard=function(t){this.settings.setPostfixWildcard(t)},this.setCacheResponseTime=function(t){this.settings.setCacheResponseTime(t)},this.setCollectAnalytics=function(t){this.settings.setCollectAnalytics(t)},this.setAnalyticsTag=function(t){this.settings.setAnalyticsTag(t)},this.setThrottleTime=function(t){this.settings.setThrottleTime(t)},this.setStatsSessionId=function(t){this.sessionId=t,this.userTokenInPersonalization=null},this.getStatsSessionId=function(){return this.sessionId},this.enableLogicalOperators=function(t){this.settings.enableLogicalOperators(t)},this.setSearchOperator=function(t){this.settings.setSearchOperator(t)},this.sendStatsEvent=function(t,e,r){var i=this.userTokenInPersonalization&&n&&h;if(i&&!c.getCookie(f)&&c.setCookie(f,this.userTokenInPersonalization,l),"search"===t){var o={action:"search",session:i?this.userTokenInPersonalization:this.sessionId,keyword:e,numberOfResults:r.numberOfResults,tag:this.getSettings().analyticsTag};s(this.apiHostname,this.sitekey,o)}else{if("click"!==t)throw"Illegal sendStatsEvent type parameters. Should be search or click)";var a={action:"click",session:i?this.userTokenInPersonalization:this.sessionId,keyword:e,docid:r.documentId,position:r.position,tag:this.getSettings().analyticsTag};s(this.apiHostname,this.sitekey,a)}};var n=!1,h=!0,l=180;this.getUserTokenInPersonalization=function(){return this.userTokenInPersonalization},this.enablePersonalizationTracking=function(t,e){n=!!t,e&&(l=e)},this.consentAddSearchCookie=function(t){h=!!t},this.searchResultClicked=function(t,e){this.sendStatsEvent("click",this.settings.getSettings().keyword,{documentId:t,position:e})}}},7788:(t,e,n)=>{"use strict";var r=n(4420),i=n(2702).Promise,s=n(9669).default,o=function(t,e){return{Authorization:"Basic "+r.base64(t+":"+e),"Content-Type":"application/json"}};t.exports={getDocument:function(t,e,n,r){return new i((function(i,a){s.get("https://"+t+"/v2/indices/"+e+"/documents/"+r,{headers:o(e,n)}).then((function(t){200==t.status?i(t.data):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))},saveDocument:function(t,e,n,r){var a=r.id||r.url;return new i((function(i,u){s({url:"https://"+t+"/v2/indices/"+e+"/documents/",method:a?"put":"post",headers:o(e,n),data:r}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):u({status:t.status,text:t.statusText})})).catch((function(t){u({status:400,text:t})}))}))},saveDocumentsBatch:function(t,e,n,r){return new i((function(i,a){s({method:"put",url:"https://"+t+"/v2/indices/"+e+"/documents:batch",headers:o(e,n),data:r}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))},deleteDocument:function(t,e,n,r){return new i((function(i,a){s.delete("https://"+t+"/v2/indices/"+e+"/documents/"+r,{headers:o(e,n)}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))},deleteDocumentsBatch:function(t,e,n,r){return new i((function(i,a){s.delete("https://"+t+"/v2/indices/"+e+"/documents:batch",{headers:o(e,n),data:r}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))}}},8719:(t,e,n)=>{"use strict";var r=n(4420);t.exports=function(){this.settings={keyword:"*",callback:null,throttleTimeMs:200,fuzzy:"auto",paging:{page:1,pageSize:10,sortBy:"relevance",sortOrder:"desc"},customFieldFilters:[],userToken:null,suggestionsSize:10,facetFields:[],autocomplete:{size:10},searchOperator:null,enableLogicalOperators:!1,cacheResponseTime:null},this.getSettings=function(){return this.settings},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setCallback=function(t){this.settings.callback=t},this.setThrottleTime=function(t){this.settings.throttleTimeMs=t},this.setSuggestionsPrefix=function(t){this.settings.suggestionsPrefix=t},this.setSuggestionsSize=function(t){this.settings.suggestionsSize=t},this.setAutocompleteSize=function(t){this.settings.autocomplete.size=t},this.setAutocompleteParams=function(t,e){this.settings.autocomplete.field=t,this.settings.autocomplete.prefix=e},this.setLanguage=function(t){var e;if(Intl&&Intl.Locale)try{e=new Intl.Locale(t).language}catch(t){throw'use accepted language code provided by ECMAScript Internationalization API (e.g. "en", "en-GB")'}else e=t;if(e&&2!==e.length)throw'use 2-char/4-char language code (e.g. "en", "en-GB")';this.settings.lang=e},this.setFuzzyMatch=function(t){if(!0!==t&&!1!==t&&"auto"!==t&&"retry"!==t)throw"fuzzy matching can be true, false, 'auto', or 'retry'";this.settings.fuzzy=t},this.enableLogicalOperators=function(t){this.settings.enableLogicalOperators=t},this.setCacheResponseTime=function(t){this.settings.cacheResponseTime=t},this.setPostfixWildcard=function(t){this.settings.postfixWildcard=t},this.setCollectAnalytics=function(t){this.settings.collectAnalytics=t},this.setAnalyticsTag=function(t){this.settings.analyticsTag=t},this.setCategoryFilters=function(t){this.settings.categories=t},this.setFilterObject=function(t){this.settings.filterObject=t},this.setPriceRangeFilter=function(t,e){this.settings.priceFromCents=t,this.settings.priceToCents=e},this.addCustomFieldFilter=function(t,e){var n=encodeURIComponent(t+"="+e);-1===this.settings.customFieldFilters.indexOf(n)&&this.settings.customFieldFilters.push(n)},this.removeCustomFieldFilter=function(t,e){var n=!1,r=encodeURIComponent(t+"="+e);e||(n=!0,r=encodeURIComponent(t+"="));for(var i=this.settings.customFieldFilters.length;i>0;i--){var s=this.settings.customFieldFilters[i-1];(n&&0===s.indexOf(r)||s===r)&&this.settings.customFieldFilters.splice(i-1,1)}},this.setDateFilter=function(t,e){this.settings.dateFrom=t,this.settings.dateTo=e},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setJWT=function(t){this.settings.jwt=t},this.setUserToken=function(t){this.settings.userToken=t},this.setPersonalizationEvents=function(t){this.settings.personalizationEvents=t},this.setResultType=function(t){this.settings.resultType=t},this.addFacetField=function(t){-1===this.settings.facetFields.indexOf(t)&&this.settings.facetFields.push(t)},this.addHierarchicalFacetSetting=function(t){this.settings.hierarchicalFacetSetting=t},this.addRangeFacet=function(t,e){this.settings.rangeFacets||(this.settings.rangeFacets=[]),this.settings.rangeFacets.push({field:t,ranges:e})},this.addStatsField=function(t){this.settings.statsFields||(this.settings.statsFields=[]),-1===this.settings.statsFields.indexOf(t)&&this.settings.statsFields.push(t)},this.setNumberOfFacets=function(t){this.settings.numFacets=t},this.setPaging=function(t,e,n,i){r.validateSetPagingParams(t,e,n,i),this.settings.paging.page=t,this.settings.paging.pageSize=e,this.settings.paging.sortBy=n,this.settings.paging.sortOrder=i},this.setShuffleAndLimitTo=function(t){this.settings.shuffleAndLimitTo=t},this.nextPage=function(){this.settings.paging.page=this.settings.paging.page+1},this.previousPage=function(){this.settings.paging.page>0&&(this.settings.paging.page=this.settings.paging.page-1)},this.setSearchOperator=function(t){if("and"!==t&&"or"!==t)throw"operator must be 'and' || 'or'";this.settings.searchOperator=t}}},3336:(t,e,n)=>{"use strict";n(2702).polyfill();var r=n(9669).default;t.exports=function(t,e,n){"undefined"!=typeof window&&window.navigator&&window.navigator.sendBeacon?navigator.sendBeacon("https://"+t+"/v1/stats/"+e+"/",JSON.stringify(n)):r.post("https://"+t+"/v1/stats/"+e+"/",n,{headers:{"Content-Type":"text/plain"}})}},6293:t=>{t.exports=function(t,e){var n,r=0;function i(){n&&clearTimeout(n)}return function(){var s=this,o=Date.now()-r,a=arguments;function u(){r=Date.now(),e.apply(s,a)}i(),o>t?u():n=setTimeout(u,t-o)}}},4420:(t,e,n)=>{var r=n(8764).lW,i=n(7429).v4;t.exports={isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)},base64:function(t){return n.g.window={},window&&window.btoa?window.btoa(t):r?r.from(t).toString("base64"):void 0},validateSetPagingParams:function(t,e,n,r){if(t<1)throw"page must be 1 or bigger";if(e<1||e>300)throw"pageSize must be 1-300";if(!n||!r)throw"invalid values for sortBy or sortOrder: "+n+", "+r;if(!("string"==typeof n&&"string"==typeof r||Array.isArray(n)&&Array.isArray(r)))throw"sortBy and sortOrder must have the same type: string or Array";if(Array.isArray(n)&&n.length!==r.length)throw"sortBy and sortOrder must have the same size";if("string"==typeof r&&"asc"!==r&&"desc"!==r)throw"sortOrder must be asc or desc";if(Array.isArray(r)&&r.filter((function(t){return"desc"!==t&&"asc"!==t})).length>0)throw"all values of sortOrder array must be asc or desc"},generateUUID:function(){return i().replace(/-/g,"")}}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,s=u(t),o=s[0],a=s[1],c=new i(function(t,e,n){return 3*(e+n)/4-n}(0,o,a)),f=0,h=a>0?o-4:o;for(n=0;n>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,c[f++]=255&e);1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=16383,a=0,u=r-i;au?u:a+o));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,r){for(var i,s,o=[],a=e;a>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(t,e,n)=>{"use strict";const r=n(9742),i=n(645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=u,e.h2=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|g(t,e);let r=a(n);const i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return p(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return p(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return u.from(r,e,n);const i=function(t){if(u.isBuffer(t)){const e=0|d(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?a(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),a(t<0?0:0|d(t))}function l(t){const e=t.length<0?0:0|d(t.length),n=a(e);for(let r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(i)return r?-1:J(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return x(this,e,n);case"base64":return _(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){let s,o=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let r=-1;for(s=n;sa&&(n=a-u),s=n;s>=0;s--){let n=!0;for(let r=0;ri&&(r=i):r=i;const s=e.length;let o;for(r>s/2&&(r=s/2),o=0;o>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function _(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function T(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+o<=n){let n,r,a,u;switch(o){case 1:e<128&&(s=e);break;case 2:n=t[i+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(s=u));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(u=(15&e)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:n=t[i+1],r=t[i+2],a=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(u=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&a,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=o}return function(t){const e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;en&&(t+=" ... "),""},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(t,e,n,r,i){if(K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0);const a=Math.min(s,o),c=this.slice(r,i),f=t.slice(e,n);for(let t=0;t>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return A(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function B(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;ir)&&(n=r);let i="";for(let r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,n,r,i){$(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,n}function k(t,e,n,r,i){$(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n+7]=s,s>>=8,t[n+6]=s,s>>=8,t[n+5]=s,s>>=8,t[n+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=o,o>>=8,t[n+2]=o,o>>=8,t[n+1]=o,o>>=8,t[n]=o,n+8}function j(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,s){return e=+e,n>>>=0,s||j(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function N(t,e,n,r,s){return e=+e,n>>>=0,s||j(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,s=0;for(;++s>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,s=0;for(;++s=i&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=e,i=1,s=this[t+--r];for(;r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<>>=0,e||I(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){C(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,!r){C(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);C(this,t,e,n,r-1,-r)}let i=0,s=1,o=0;for(this[e]=255&t;++i>0)-o&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);C(this,t,e,n,r-1,-r)}let i=n-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Q((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function $(t,e,n,r,i,s){if(t>n||t3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new D.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||H(e,t.length-(n+1))}(r,i,s)}function q(t,e){if("number"!=typeof t)throw new D.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,n){if(Math.floor(t)!==t)throw q(t,n),new D.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=z(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function J(t,e){let n;e=e||1/0;const r=t.length;let i=null;const s=[];for(let o=0;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},2702:function(t,e,n){t.exports=function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,s=void 0,o=void 0,a=function(t,e){b[i]=t,b[i+1]=e,2===(i+=2)&&(o?o(E):O())};function u(t){o=t}function c(t){a=t}var f="undefined"!=typeof window?window:void 0,h=f||{},l=h.MutationObserver||h.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function g(){return function(){return process.nextTick(E)}}function y(){return void 0!==s?function(){s(E)}:w()}function m(){var t=0,e=new l(E),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function v(){var t=new MessageChannel;return t.port1.onmessage=E,function(){return t.port2.postMessage(0)}}function w(){var t=setTimeout;return function(){return t(E,1)}}var b=new Array(1e3);function E(){for(var t=0;t{e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,u=(1<>1,f=-7,h=n?i-1:0,l=n?-1:1,p=t[e+h];for(h+=l,s=p&(1<<-f)-1,p>>=-f,f+=a;f>0;s=256*s+t[e+h],h+=l,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=256*o+t[e+h],h+=l,f-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),s-=c}return(p?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var o,a,u,c=8*s-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+h>=1?l/u:l*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=f?(a=0,o=f):o+h>=1?(a=(e*u-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(o=o<0;t[n+p]=255&o,p+=d,o/=256,c-=8);t[n+p-d]|=128*g}},7429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return u.default}});var r=l(n(3990)),i=l(n(8237)),s=l(n(5355)),o=l(n(3764)),a=l(n(6314)),u=l(n(8464)),c=l(n(6435)),f=l(n(4008)),h=l(n(8222));function l(t){return t&&t.__esModule?t:{default:t}}},4163:(t,e)=>{"use strict";function n(t){return 14+(t+64>>>9<<4)+1}function r(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function i(t,e,n,i,s,o){return r((a=r(r(e,t),r(i,o)))<<(u=s)|a>>>32-u,n);var a,u}function s(t,e,n,r,s,o,a){return i(e&n|~e&r,t,e,s,o,a)}function o(t,e,n,r,s,o,a){return i(e&r|n&~r,t,e,s,o,a)}function a(t,e,n,r,s,o,a){return i(e^n^r,t,e,s,o,a)}function u(t,e,n,r,s,o,a){return i(n^(e|~r),t,e,s,o,a)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n>5]>>>i%32&255,s=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[n/8])<{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};e.default=n},6314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default="00000000-0000-0000-0000-000000000000"},8222:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};var s=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};e.default=s},58:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},3319:(t,e)=>{"use strict";let n;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},3757:(t,e)=>{"use strict";function n(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function r(t,e){return t<>>32-e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){const e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n>>0;h=f,f=c,c=r(u,30)>>>0,u=o,o=a}i[0]=i[0]+o>>>0,i[1]=i[1]+u>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+h>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]};e.default=i},4008:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.unsafeStringify=o;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};const s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function o(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}var a=function(t,e=0){const n=o(t,e);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n};e.default=a},3990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(3319))&&r.__esModule?r:{default:r},s=n(4008);let o,a,u=0,c=0;var f=function(t,e,n){let r=e&&n||0;const f=e||new Array(16);let h=(t=t||{}).node||o,l=void 0!==t.clockseq?t.clockseq:a;if(null==h||null==l){const e=t.random||(t.rng||i.default)();null==h&&(h=o=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==l&&(l=a=16383&(e[6]<<8|e[7]))}let p=void 0!==t.msecs?t.msecs:Date.now(),d=void 0!==t.nsecs?t.nsecs:c+1;const g=p-u+(d-c)/1e4;if(g<0&&void 0===t.clockseq&&(l=l+1&16383),(g<0||p>u)&&void 0===t.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=p,c=d,a=l,p+=122192928e5;const y=(1e4*(268435455&p)+d)%4294967296;f[r++]=y>>>24&255,f[r++]=y>>>16&255,f[r++]=y>>>8&255,f[r++]=255&y;const m=p/4294967296*1e4&268435455;f[r++]=m>>>8&255,f[r++]=255&m,f[r++]=m>>>24&15|16,f[r++]=m>>>16&255,f[r++]=l>>>8|128,f[r++]=255&l;for(let t=0;t<6;++t)f[r+t]=h[t];return e||(0,s.unsafeStringify)(f)};e.default=f},8237:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(n(7925)),i=s(n(4163));function s(t){return t&&t.__esModule?t:{default:t}}var o=(0,r.default)("v3",48,i.default);e.default=o},7925:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0,e.default=function(t,e,n){function r(t,r,o,a){var u;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(4790)),i=o(n(3319)),s=n(4008);function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t,e,n){if(r.default.randomUUID&&!e&&!t)return r.default.randomUUID();const o=(t=t||{}).random||(t.rng||i.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=o[t];return e}return(0,s.unsafeStringify)(o)};e.default=a},3764:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(n(7925)),i=s(n(3757));function s(t){return t&&t.__esModule?t:{default:t}}var o=(0,r.default)("v5",80,i.default);e.default=o},6435:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(58))&&r.__esModule?r:{default:r};var s=function(t){return"string"==typeof t&&i.default.test(t)};e.default=s},8464:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};var s=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)};e.default=s}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var r=n(2352);self.AddSearchClient=r})(); \ No newline at end of file +/*! addsearch-js-client 0.8.7 */(()=>{var t={9669:(t,e,n)=>{t.exports=n(1609)},5448:(t,e,n)=>{"use strict";var r=n(4867),i=n(6026),s=n(4372),o=n(5327),a=n(4097),u=n(4109),c=n(7985),f=n(7874),h=n(2648),l=n(644),p=n(205);t.exports=function(t){return new Promise((function(e,n){var d,g=t.data,y=t.headers,m=t.responseType;function v(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}r.isFormData(g)&&r.isStandardBrowserEnv()&&delete y["Content-Type"];var w=new XMLHttpRequest;if(t.auth){var b=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";y.Authorization="Basic "+btoa(b+":"+E)}var A=a(t.baseURL,t.url);function O(){if(w){var r="getAllResponseHeaders"in w?u(w.getAllResponseHeaders()):null,s={data:m&&"text"!==m&&"json"!==m?w.response:w.responseText,status:w.status,statusText:w.statusText,headers:r,config:t,request:w};i((function(t){e(t),v()}),(function(t){n(t),v()}),s),w=null}}if(w.open(t.method.toUpperCase(),o(A,t.params,t.paramsSerializer),!0),w.timeout=t.timeout,"onloadend"in w?w.onloadend=O:w.onreadystatechange=function(){w&&4===w.readyState&&(0!==w.status||w.responseURL&&0===w.responseURL.indexOf("file:"))&&setTimeout(O)},w.onabort=function(){w&&(n(new h("Request aborted",h.ECONNABORTED,t,w)),w=null)},w.onerror=function(){n(new h("Network Error",h.ERR_NETWORK,t,w,w)),w=null},w.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||f;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new h(e,r.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,t,w)),w=null},r.isStandardBrowserEnv()){var S=(t.withCredentials||c(A))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;S&&(y[t.xsrfHeaderName]=S)}"setRequestHeader"in w&&r.forEach(y,(function(t,e){void 0===g&&"content-type"===e.toLowerCase()?delete y[e]:w.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(w.withCredentials=!!t.withCredentials),m&&"json"!==m&&(w.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&w.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&w.upload&&w.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(d=function(t){w&&(n(!t||t&&t.type?new l:t),w.abort(),w=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d))),g||(g=null);var _=p(A);_&&-1===["http","https","file"].indexOf(_)?n(new h("Unsupported protocol "+_+":",h.ERR_BAD_REQUEST,t)):w.send(g)}))}},1609:(t,e,n)=>{"use strict";var r=n(4867),i=n(1849),s=n(321),o=n(7185);var a=function t(e){var n=new s(e),a=i(s.prototype.request,n);return r.extend(a,s.prototype,n),r.extend(a,n),a.create=function(n){return t(o(e,n))},a}(n(5546));a.Axios=s,a.CanceledError=n(644),a.CancelToken=n(4972),a.isCancel=n(6502),a.VERSION=n(7288).version,a.toFormData=n(7675),a.AxiosError=n(2648),a.Cancel=a.CanceledError,a.all=function(t){return Promise.all(t)},a.spread=n(8713),a.isAxiosError=n(6268),t.exports=a,t.exports.default=a},4972:(t,e,n)=>{"use strict";var r=n(644);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e{"use strict";var r=n(2648);function i(t){r.call(this,null==t?"canceled":t,r.ERR_CANCELED),this.name="CanceledError"}n(4867).inherits(i,r,{__CANCEL__:!0}),t.exports=i},6502:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:(t,e,n)=>{"use strict";var r=n(4867),i=n(5327),s=n(782),o=n(3572),a=n(7185),u=n(4097),c=n(4875),f=c.validators;function h(t){this.defaults=t,this.interceptors={request:new s,response:new s}}h.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var s,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var h=[o,void 0];for(Array.prototype.unshift.apply(h,r),h=h.concat(u),s=Promise.resolve(e);h.length;)s=s.then(h.shift(),h.shift());return s}for(var l=e;r.length;){var p=r.shift(),d=r.shift();try{l=p(l)}catch(t){d(t);break}}try{s=o(l)}catch(t){return Promise.reject(t)}for(;u.length;)s=s.then(u.shift(),u.shift());return s},h.prototype.getUri=function(t){t=a(this.defaults,t);var e=u(t.baseURL,t.url);return i(e,t.params,t.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(t){h.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(a(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}h.prototype[t]=e(),h.prototype[t+"Form"]=e(!0)})),t.exports=h},2648:(t,e,n)=>{"use strict";var r=n(4867);function i(t,e,n,r,i){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var s=i.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){o[t]={value:t}})),Object.defineProperties(i,o),Object.defineProperty(s,"isAxiosError",{value:!0}),i.from=function(t,e,n,o,a,u){var c=Object.create(s);return r.toFlatObject(t,c,(function(t){return t!==Error.prototype})),i.call(c,t.message,e,n,o,a),c.name=t.name,u&&Object.assign(c,u),c},t.exports=i},782:(t,e,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},4097:(t,e,n)=>{"use strict";var r=n(1793),i=n(7303);t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},3572:(t,e,n)=>{"use strict";var r=n(4867),i=n(8527),s=n(6502),o=n(5546),a=n(644);function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return u(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(u(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},7185:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function s(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function o(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function a(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function u(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||s,i=e(t);r.isUndefined(i)&&e!==u||(n[t]=i)})),n}},6026:(t,e,n)=>{"use strict";var r=n(2648);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}},8527:(t,e,n)=>{"use strict";var r=n(4867),i=n(5546);t.exports=function(t,e,n){var s=this||i;return r.forEach(n,(function(n){t=n.call(s,t,e)})),t}},5546:(t,e,n)=>{"use strict";var r=n(4867),i=n(6016),s=n(2648),o=n(7874),a=n(7675),u={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var f,h={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(f=n(5448)),f),transformRequest:[function(t,e){if(i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t))return t;if(r.isArrayBufferView(t))return t.buffer;if(r.isURLSearchParams(t))return c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n,s=r.isObject(t),o=e&&e["Content-Type"];if((n=r.isFileList(t))||s&&"multipart/form-data"===o){var u=this.env&&this.env.FormData;return a(n?{"files[]":t}:t,u&&new u)}return s||"application/json"===o?(c(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||h.transitional,n=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||i&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw s.from(t,s.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:n(1623)},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){h.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){h.headers[t]=r.merge(u)})),t.exports=h},7874:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:t=>{t.exports={version:"0.27.2"}},1849:t=>{"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var s;if(n)s=n(e);else if(r.isURLSearchParams(e))s=e.toString();else{var o=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),o.push(i(e)+"="+i(t))})))})),s=o.join("&")}if(s){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},7303:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},4372:(t,e,n)=>{"use strict";var r=n(4867);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,s,o){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},6268:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t){return r.isObject(t)&&!0===t.isAxiosError}},7985:(t,e,n)=>{"use strict";var r=n(4867);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},6016:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},1623:t=>{t.exports=null},4109:(t,e,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,s,o={};return t?(r.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=r.trim(t.substr(0,s)).toLowerCase(),n=r.trim(t.substr(s+1)),e){if(o[e]&&i.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}},205:t=>{"use strict";t.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},8713:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},7675:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){e=e||new FormData;var n=[];function i(t){return null===t?"":r.isDate(t)?t.toISOString():r.isArrayBuffer(t)||r.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(s,o){if(r.isPlainObject(s)||r.isArray(s)){if(-1!==n.indexOf(s))throw Error("Circular reference detected in "+o);n.push(s),r.forEach(s,(function(n,s){if(!r.isUndefined(n)){var a,u=o?o+"."+s:s;if(n&&!o&&"object"==typeof n)if(r.endsWith(s,"{}"))n=JSON.stringify(n);else if(r.endsWith(s,"[]")&&(a=r.toArray(n)))return void a.forEach((function(t){!r.isUndefined(t)&&e.append(u,i(t))}));t(n,u)}})),n.pop()}else e.append(o,i(s))}(t),e}},4875:(t,e,n)=>{"use strict";var r=n(7288).version,i=n(2648),s={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){s[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var o={};s.transitional=function(t,e,n){function s(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,a){if(!1===t)throw new i(s(r," has been removed"+(e?" in "+e:"")),i.ERR_DEPRECATED);return e&&!o[r]&&(o[r]=!0,console.warn(s(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,a)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),s=r.length;s-- >0;){var o=r[s],a=e[o];if(a){var u=t[o],c=void 0===u||a(u,o,t);if(!0!==c)throw new i("option "+o+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+o,i.ERR_BAD_OPTION)}},validators:s}},4867:(t,e,n)=>{"use strict";var r,i=n(1849),s=Object.prototype.toString,o=(r=Object.create(null),function(t){var e=s.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function u(t){return Array.isArray(t)}function c(t){return void 0===t}var f=a("ArrayBuffer");function h(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==o(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var p=a("Date"),d=a("File"),g=a("Blob"),y=a("FileList");function m(t){return"[object Function]"===s.call(t)}var v=a("URLSearchParams");function w(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n0;)o[s=r[i]]||(e[s]=t[s],o[s]=!0);t=Object.getPrototypeOf(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:o,kindOfTest:a,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;var e=t.length;if(c(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},isTypedArray:E,isFileList:y}},2381:(t,e,n)=>{"use strict";n(2702).polyfill();var r=n(9669).default;t.exports=function t(e,n,i,s,o,a,u,c){var f=function(t,e){return t||!1===t?"&"+e+"="+t:""};if("search"===i||"suggest"===i||"autocomplete"===i||"recommend"===i){var h,l="",p="",d=null;if("search"===i){d=i,l=s.keyword,l=s.enableLogicalOperators?l.replace(/ and /g," AND ").replace(/ or /g," OR ").replace(/ not /g," NOT "):l.replace(/ AND /g," and ").replace(/ OR /g," or ").replace(/ NOT /g," not "),l=encodeURIComponent(l);var g=s.fuzzy;if("retry"===g&&(g=!0===a),"search"===i){if(p=f(s.lang,"lang")+f(g,"fuzzy")+f(s.collectAnalytics,"collectAnalytics")+f(s.postfixWildcard,"postfixWildcard")+f(s.categories,"categories")+f(s.priceFromCents,"priceFromCents")+f(s.priceToCents,"priceToCents")+f(s.dateFrom,"dateFrom")+f(s.dateTo,"dateTo")+f(s.paging.page,"page")+f(s.paging.pageSize,"limit")+f(s.shuffleAndLimitTo,"shuffleAndLimitTo")+f(s.jwt,"jwt")+f(s.resultType,"resultType")+f(s.userToken,"userToken")+f(s.numFacets,"numFacets")+f(s.cacheResponseTime,"cacheResponseWithTtlSeconds")+f(s.searchOperator,"defaultOperator")+f(s.analyticsTag,"analyticsTag"),Array.isArray(s.paging.sortBy)?s.paging.sortBy.forEach((function(t,e){p=p+f(t,"sort")+f(s.paging.sortOrder[e],"order")})):p=p+f(s.paging.sortBy,"sort")+f(s.paging.sortOrder,"order"),s.customFieldFilters)for(var y=0;y=c&&(u.total_hits=c)}o(u)}})).catch((function(t){console.log(t),o({error:{response:500,message:"invalid server response"}})}))}else o({error:{response:400,message:"invalid query type"}})}},4410:t=>{t.exports={setCookie:function(t,e,n){if("undefined"!=typeof document){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3);var i="expires="+r.toUTCString();document.cookie=t+"="+e+";"+i+";path=/"}},getCookie:function(t){if("undefined"!=typeof document)for(var e=t+"=",n=decodeURIComponent(document.cookie).split(";"),r=0;r{"use strict";var r=n(2381),i=n(7788),s=n(3336),o=n(8719),a=n(4420),u=n(6293),c=n(4410),f="addsearchUserToken";t.exports=function(t,e){this.sitekey=t,this.privatekey=e,this.apiHostname="api.addsearch.com",this.settings=new o,this.sessionId=("a-"+1e8*Math.random()).substring(0,10),this.userTokenInPersonalization=c.getCookie(f)||a.generateUUID(),this.search=function(t,e){var n=null,i=null;if(t&&a.isFunction(e))n=t,i=e;else if(!e&&a.isFunction(t))n=this.settings.getSettings().keyword,i=t;else{if(!this.settings.getSettings().callback)throw"Illegal search parameters. Should be (keyword, callbackFunction) or (callbackFunction)";n=this.settings.getSettings().keyword,i=this.settings.getSettings().callback}this.settings.setCallback(i),this.settings.setKeyword(n),this.throttledSearchFetch||(this.throttledSearchFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledSearchFetch(this.apiHostname,this.sitekey,"search",this.settings.getSettings(),i)},this.suggestions=function(t,e){if(!t||!e||!a.isFunction(e))throw"Illegal suggestions parameters. Should be (prefix, callbackFunction)";this.settings.setSuggestionsPrefix(t),this.throttledSuggestionsFetch||(this.throttledSuggestionsFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledSuggestionsFetch(this.apiHostname,this.sitekey,"suggest",this.settings.getSettings(),e)},this.autocomplete=function(t,e,n){if(!(t&&e&&n&&a.isFunction(n)))throw"Illegal autocomplete parameters. Should be (field, prefix, callbackFunction)";this.settings.setAutocompleteParams(t,e),this.throttledAutocompleteFetch||(this.throttledAutocompleteFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledAutocompleteFetch(this.apiHostname,this.sitekey,"autocomplete",this.settings.getSettings(),n)},this.fetchCustomApi=function(t,e,n){var i=Object.assign({},this.settings.getSettings());i.facetFields=i.facetFields.filter((function(e){return t===e})),r(this.apiHostname,this.sitekey,"search",i,n,null,e)},this.fetchRangeFacets=function(t,e,n){var i=Object.assign({},this.settings.getSettings());i.rangeFacets||(i.rangeFacets=[]),i.rangeFacets.push({field:t.field,ranges:t.ranges}),r(this.apiHostname,this.sitekey,"search",i,n,null,e)},this.recommendations=function(t,e){if(!t||!e||!a.isFunction(e))throw"Illegal recommendations parameters. Should be (options, callbackFunction)";this.throttledSuggestionsFetch||(this.throttledSuggestionsFetch=u(this.settings.getSettings().throttleTimeMs,r)),this.throttledSuggestionsFetch(this.apiHostname,this.sitekey,"recommend",null,e,!1,null,t)},this.getDocument=function(t){return i.getDocument(this.apiHostname,this.sitekey,this.privatekey,t)},this.saveDocument=function(t){return i.saveDocument(this.apiHostname,this.sitekey,this.privatekey,t)},this.saveDocumentsBatch=function(t){if(!t||!t.documents||!Array.isArray(t.documents))throw"Please provide an array of documents: {documents: []}";return i.saveDocumentsBatch(this.apiHostname,this.sitekey,this.privatekey,t)},this.deleteDocument=function(t){return i.deleteDocument(this.apiHostname,this.sitekey,this.privatekey,t)},this.deleteDocumentsBatch=function(t){if(!t||!t.documents||!Array.isArray(t.documents))throw"Please provide an array of document ids: {documents: []}";return i.deleteDocumentsBatch(this.apiHostname,this.sitekey,this.privatekey,t)},this.setApiHostname=function(t){this.apiHostname=t},this.getSettings=function(){return this.settings.getSettings()},this.setLanguage=function(t){this.settings.setLanguage(t)},this.setCategoryFilters=function(t){this.settings.setCategoryFilters(t)},this.addCustomFieldFilter=function(t,e){this.settings.addCustomFieldFilter(t,e)},this.removeCustomFieldFilter=function(t,e){this.settings.removeCustomFieldFilter(t,e)},this.setPriceRangeFilter=function(t,e){this.settings.setPriceRangeFilter(t,e)},this.setDateFilter=function(t,e){this.settings.setDateFilter(t,e)},this.setJWT=function(t){this.settings.setJWT(t)},this.setUserToken=function(t){this.settings.setUserToken(t)},this.setPaging=function(t,e,n,r){this.settings.setPaging(t,e,n,r)},this.nextPage=function(){this.settings.nextPage()},this.previousPage=function(){this.settings.previousPage()},this.setSuggestionsSize=function(t){this.settings.setSuggestionsSize(t)},this.setAutocompleteSize=function(t){this.settings.setAutocompleteSize(t)},this.addFacetField=function(t){this.settings.addFacetField(t)},this.addHierarchicalFacetSetting=function(t){this.settings.addHierarchicalFacetSetting(t)},this.addRangeFacet=function(t,e){this.settings.addRangeFacet(t,e)},this.addStatsField=function(t){this.settings.addStatsField(t)},this.setNumberOfFacets=function(t){this.settings.setNumberOfFacets(t)},this.setResultType=function(t){this.settings.setResultType(t)},this.setPersonalizationEvents=function(t){this.settings.setPersonalizationEvents(t)},this.setFilterObject=function(t){this.settings.setFilterObject(t)},this.setShuffleAndLimitTo=function(t){this.settings.setShuffleAndLimitTo(t)},this.setFuzzyMatch=function(t){this.settings.setFuzzyMatch(t)},this.setPostfixWildcard=function(t){this.settings.setPostfixWildcard(t)},this.setCacheResponseTime=function(t){this.settings.setCacheResponseTime(t)},this.setCollectAnalytics=function(t){this.settings.setCollectAnalytics(t)},this.setAnalyticsTag=function(t){this.settings.setAnalyticsTag(t)},this.setThrottleTime=function(t){this.settings.setThrottleTime(t)},this.setStatsSessionId=function(t){this.sessionId=t,this.userTokenInPersonalization=null},this.getStatsSessionId=function(){return this.sessionId},this.enableLogicalOperators=function(t){this.settings.enableLogicalOperators(t)},this.setSearchOperator=function(t){this.settings.setSearchOperator(t)},this.sendStatsEvent=function(t,e,r){var i=this.userTokenInPersonalization&&n&&h;if(i&&!c.getCookie(f)&&c.setCookie(f,this.userTokenInPersonalization,l),"search"===t){var o={action:"search",session:i?this.userTokenInPersonalization:this.sessionId,keyword:e,numberOfResults:r.numberOfResults,tag:this.getSettings().analyticsTag};s(this.apiHostname,this.sitekey,o)}else{if("click"!==t)throw"Illegal sendStatsEvent type parameters. Should be search or click)";var a={action:"click",session:i?this.userTokenInPersonalization:this.sessionId,keyword:e,docid:r.documentId,position:r.position,tag:this.getSettings().analyticsTag};s(this.apiHostname,this.sitekey,a)}};var n=!1,h=!0,l=180;this.getUserTokenInPersonalization=function(){return this.userTokenInPersonalization},this.enablePersonalizationTracking=function(t,e){n=!!t,e&&(l=e)},this.consentAddSearchCookie=function(t){h=!!t},this.searchResultClicked=function(t,e){this.sendStatsEvent("click",this.settings.getSettings().keyword,{documentId:t,position:e})}}},7788:(t,e,n)=>{"use strict";var r=n(4420),i=n(2702).Promise,s=n(9669).default,o=function(t,e){return{Authorization:"Basic "+r.base64(t+":"+e),"Content-Type":"application/json"}};t.exports={getDocument:function(t,e,n,r){return new i((function(i,a){s.get("https://"+t+"/v2/indices/"+e+"/documents/"+r,{headers:o(e,n)}).then((function(t){200==t.status?i(t.data):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))},saveDocument:function(t,e,n,r){var a=r.id||r.url;return new i((function(i,u){s({url:"https://"+t+"/v2/indices/"+e+"/documents/",method:a?"put":"post",headers:o(e,n),data:r}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):u({status:t.status,text:t.statusText})})).catch((function(t){u({status:400,text:t})}))}))},saveDocumentsBatch:function(t,e,n,r){return new i((function(i,a){s({method:"put",url:"https://"+t+"/v2/indices/"+e+"/documents:batch",headers:o(e,n),data:r}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))},deleteDocument:function(t,e,n,r){return new i((function(i,a){s.delete("https://"+t+"/v2/indices/"+e+"/documents/"+r,{headers:o(e,n)}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))},deleteDocumentsBatch:function(t,e,n,r){return new i((function(i,a){s.delete("https://"+t+"/v2/indices/"+e+"/documents:batch",{headers:o(e,n),data:r}).then((function(t){202==t.status?i({status:t.status,text:t.statusText}):a({status:t.status,text:t.statusText})})).catch((function(t){a({status:400,text:t})}))}))}}},8719:(t,e,n)=>{"use strict";var r=n(4420);t.exports=function(){this.settings={keyword:"*",callback:null,throttleTimeMs:200,fuzzy:"auto",paging:{page:1,pageSize:10,sortBy:"relevance",sortOrder:"desc"},customFieldFilters:[],userToken:null,suggestionsSize:10,facetFields:[],autocomplete:{size:10},searchOperator:null,enableLogicalOperators:!1,cacheResponseTime:null},this.getSettings=function(){return this.settings},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setCallback=function(t){this.settings.callback=t},this.setThrottleTime=function(t){this.settings.throttleTimeMs=t},this.setSuggestionsPrefix=function(t){this.settings.suggestionsPrefix=t},this.setSuggestionsSize=function(t){this.settings.suggestionsSize=t},this.setAutocompleteSize=function(t){this.settings.autocomplete.size=t},this.setAutocompleteParams=function(t,e){this.settings.autocomplete.field=t,this.settings.autocomplete.prefix=e},this.setLanguage=function(t){var e;if(Intl&&Intl.Locale)try{e=new Intl.Locale(t).language}catch(t){throw'use accepted language code provided by ECMAScript Internationalization API (e.g. "en", "en-GB")'}else e=t;if(e&&2!==e.length)throw'use 2-char/4-char language code (e.g. "en", "en-GB")';this.settings.lang=e},this.setFuzzyMatch=function(t){if(!0!==t&&!1!==t&&"auto"!==t&&"retry"!==t)throw"fuzzy matching can be true, false, 'auto', or 'retry'";this.settings.fuzzy=t},this.enableLogicalOperators=function(t){this.settings.enableLogicalOperators=t},this.setCacheResponseTime=function(t){this.settings.cacheResponseTime=t},this.setPostfixWildcard=function(t){this.settings.postfixWildcard=t},this.setCollectAnalytics=function(t){this.settings.collectAnalytics=t},this.setAnalyticsTag=function(t){this.settings.analyticsTag=t},this.setCategoryFilters=function(t){this.settings.categories=t},this.setFilterObject=function(t){this.settings.filterObject=t},this.setPriceRangeFilter=function(t,e){this.settings.priceFromCents=t,this.settings.priceToCents=e},this.addCustomFieldFilter=function(t,e){var n=encodeURIComponent(t+"="+e);-1===this.settings.customFieldFilters.indexOf(n)&&this.settings.customFieldFilters.push(n)},this.removeCustomFieldFilter=function(t,e){var n=!1,r=encodeURIComponent(t+"="+e);e||(n=!0,r=encodeURIComponent(t+"="));for(var i=this.settings.customFieldFilters.length;i>0;i--){var s=this.settings.customFieldFilters[i-1];(n&&0===s.indexOf(r)||s===r)&&this.settings.customFieldFilters.splice(i-1,1)}},this.setDateFilter=function(t,e){this.settings.dateFrom=t,this.settings.dateTo=e},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setJWT=function(t){this.settings.jwt=t},this.setUserToken=function(t){this.settings.userToken=t},this.setPersonalizationEvents=function(t){this.settings.personalizationEvents=t},this.setResultType=function(t){this.settings.resultType=t},this.addFacetField=function(t){-1===this.settings.facetFields.indexOf(t)&&this.settings.facetFields.push(t)},this.addHierarchicalFacetSetting=function(t){this.settings.hierarchicalFacetSetting=t},this.addRangeFacet=function(t,e){this.settings.rangeFacets||(this.settings.rangeFacets=[]),this.settings.rangeFacets.push({field:t,ranges:e})},this.addStatsField=function(t){this.settings.statsFields||(this.settings.statsFields=[]),-1===this.settings.statsFields.indexOf(t)&&this.settings.statsFields.push(t)},this.setNumberOfFacets=function(t){this.settings.numFacets=t},this.setPaging=function(t,e,n,i){r.validateSetPagingParams(t,e,n,i),this.settings.paging.page=t,this.settings.paging.pageSize=e,this.settings.paging.sortBy=n,this.settings.paging.sortOrder=i},this.setShuffleAndLimitTo=function(t){this.settings.shuffleAndLimitTo=t},this.nextPage=function(){this.settings.paging.page=this.settings.paging.page+1},this.previousPage=function(){this.settings.paging.page>0&&(this.settings.paging.page=this.settings.paging.page-1)},this.setSearchOperator=function(t){if("and"!==t&&"or"!==t)throw"operator must be 'and' || 'or'";this.settings.searchOperator=t}}},3336:(t,e,n)=>{"use strict";n(2702).polyfill();var r=n(9669).default;t.exports=function(t,e,n){"undefined"!=typeof window&&window.navigator&&window.navigator.sendBeacon?navigator.sendBeacon("https://"+t+"/v1/stats/"+e+"/",JSON.stringify(n)):r.post("https://"+t+"/v1/stats/"+e+"/",n,{headers:{"Content-Type":"text/plain"}})}},6293:t=>{t.exports=function(t,e){var n,r=0;function i(){n&&clearTimeout(n)}return function(){var s=this,o=Date.now()-r,a=arguments;function u(){r=Date.now(),e.apply(s,a)}i(),o>t?u():n=setTimeout(u,t-o)}}},4420:(t,e,n)=>{var r=n(8764).lW,i=n(7429).v4;t.exports={isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)},base64:function(t){return n.g.window={},window&&window.btoa?window.btoa(t):r?r.from(t).toString("base64"):void 0},validateSetPagingParams:function(t,e,n,r){if(t<1)throw"page must be 1 or bigger";if(e<1||e>300)throw"pageSize must be 1-300";if(!n||!r)throw"invalid values for sortBy or sortOrder: "+n+", "+r;if(!("string"==typeof n&&"string"==typeof r||Array.isArray(n)&&Array.isArray(r)))throw"sortBy and sortOrder must have the same type: string or Array";if(Array.isArray(n)&&n.length!==r.length)throw"sortBy and sortOrder must have the same size";if("string"==typeof r&&"asc"!==r&&"desc"!==r)throw"sortOrder must be asc or desc";if(Array.isArray(r)&&r.filter((function(t){return"desc"!==t&&"asc"!==t})).length>0)throw"all values of sortOrder array must be asc or desc"},generateUUID:function(){return i().replace(/-/g,"")}}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,s=u(t),o=s[0],a=s[1],c=new i(function(t,e,n){return 3*(e+n)/4-n}(0,o,a)),f=0,h=a>0?o-4:o;for(n=0;n>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,c[f++]=255&e);1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=16383,a=0,u=r-i;au?u:a+o));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,r){for(var i,s,o=[],a=e;a>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(t,e,n)=>{"use strict";const r=n(9742),i=n(645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=u,e.h2=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|g(t,e);let r=a(n);const i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return p(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return p(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return u.from(r,e,n);const i=function(t){if(u.isBuffer(t)){const e=0|d(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?a(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),a(t<0?0:0|d(t))}function l(t){const e=t.length<0?0:0|d(t.length),n=a(e);for(let r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(i)return r?-1:J(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return x(this,e,n);case"base64":return _(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){let s,o=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let r=-1;for(s=n;sa&&(n=a-u),s=n;s>=0;s--){let n=!0;for(let r=0;ri&&(r=i):r=i;const s=e.length;let o;for(r>s/2&&(r=s/2),o=0;o>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function _(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function T(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+o<=n){let n,r,a,u;switch(o){case 1:e<128&&(s=e);break;case 2:n=t[i+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(s=u));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(u=(15&e)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:n=t[i+1],r=t[i+2],a=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(u=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&a,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=o}return function(t){const e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;en&&(t+=" ... "),""},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(t,e,n,r,i){if(K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0);const a=Math.min(s,o),c=this.slice(r,i),f=t.slice(e,n);for(let t=0;t>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return A(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function B(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;ir)&&(n=r);let i="";for(let r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,n,r,i){$(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,n}function k(t,e,n,r,i){$(e,r,i,t,n,7);let s=Number(e&BigInt(4294967295));t[n+7]=s,s>>=8,t[n+6]=s,s>>=8,t[n+5]=s,s>>=8,t[n+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=o,o>>=8,t[n+2]=o,o>>=8,t[n+1]=o,o>>=8,t[n]=o,n+8}function j(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,s){return e=+e,n>>>=0,s||j(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function N(t,e,n,r,s){return e=+e,n>>>=0,s||j(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,s=0;for(;++s>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<>>=0,e>>>=0,n||I(t,e,this.length);let r=this[t],i=1,s=0;for(;++s=i&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||I(t,e,this.length);let r=e,i=1,s=this[t+--r];for(;r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<>>=0,e||I(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){C(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,!r){C(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);C(this,t,e,n,r-1,-r)}let i=0,s=1,o=0;for(this[e]=255&t;++i>0)-o&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);C(this,t,e,n,r-1,-r)}let i=n-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Q((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function $(t,e,n,r,i,s){if(t>n||t3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new D.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||H(e,t.length-(n+1))}(r,i,s)}function q(t,e){if("number"!=typeof t)throw new D.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,n){if(Math.floor(t)!==t)throw q(t,n),new D.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=z(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function J(t,e){let n;e=e||1/0;const r=t.length;let i=null;const s=[];for(let o=0;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},2702:function(t,e,n){t.exports=function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,s=void 0,o=void 0,a=function(t,e){b[i]=t,b[i+1]=e,2===(i+=2)&&(o?o(E):O())};function u(t){o=t}function c(t){a=t}var f="undefined"!=typeof window?window:void 0,h=f||{},l=h.MutationObserver||h.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function g(){return function(){return process.nextTick(E)}}function y(){return void 0!==s?function(){s(E)}:w()}function m(){var t=0,e=new l(E),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function v(){var t=new MessageChannel;return t.port1.onmessage=E,function(){return t.port2.postMessage(0)}}function w(){var t=setTimeout;return function(){return t(E,1)}}var b=new Array(1e3);function E(){for(var t=0;t{e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,u=(1<>1,f=-7,h=n?i-1:0,l=n?-1:1,p=t[e+h];for(h+=l,s=p&(1<<-f)-1,p>>=-f,f+=a;f>0;s=256*s+t[e+h],h+=l,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=256*o+t[e+h],h+=l,f-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),s-=c}return(p?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var o,a,u,c=8*s-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+h>=1?l/u:l*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=f?(a=0,o=f):o+h>=1?(a=(e*u-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(o=o<0;t[n+p]=255&o,p+=d,o/=256,c-=8);t[n+p-d]|=128*g}},7429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return u.default}});var r=l(n(3990)),i=l(n(8237)),s=l(n(5355)),o=l(n(3764)),a=l(n(6314)),u=l(n(8464)),c=l(n(6435)),f=l(n(4008)),h=l(n(8222));function l(t){return t&&t.__esModule?t:{default:t}}},4163:(t,e)=>{"use strict";function n(t){return 14+(t+64>>>9<<4)+1}function r(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function i(t,e,n,i,s,o){return r((a=r(r(e,t),r(i,o)))<<(u=s)|a>>>32-u,n);var a,u}function s(t,e,n,r,s,o,a){return i(e&n|~e&r,t,e,s,o,a)}function o(t,e,n,r,s,o,a){return i(e&r|n&~r,t,e,s,o,a)}function a(t,e,n,r,s,o,a){return i(e^n^r,t,e,s,o,a)}function u(t,e,n,r,s,o,a){return i(n^(e|~r),t,e,s,o,a)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n>5]>>>i%32&255,s=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[n/8])<{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};e.default=n},6314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default="00000000-0000-0000-0000-000000000000"},8222:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};var s=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};e.default=s},58:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},3319:(t,e)=>{"use strict";let n;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},3757:(t,e)=>{"use strict";function n(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function r(t,e){return t<>>32-e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){const e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n>>0;h=f,f=c,c=r(u,30)>>>0,u=o,o=a}i[0]=i[0]+o>>>0,i[1]=i[1]+u>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+h>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]};e.default=i},4008:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.unsafeStringify=o;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};const s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function o(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}var a=function(t,e=0){const n=o(t,e);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n};e.default=a},3990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(3319))&&r.__esModule?r:{default:r},s=n(4008);let o,a,u=0,c=0;var f=function(t,e,n){let r=e&&n||0;const f=e||new Array(16);let h=(t=t||{}).node||o,l=void 0!==t.clockseq?t.clockseq:a;if(null==h||null==l){const e=t.random||(t.rng||i.default)();null==h&&(h=o=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==l&&(l=a=16383&(e[6]<<8|e[7]))}let p=void 0!==t.msecs?t.msecs:Date.now(),d=void 0!==t.nsecs?t.nsecs:c+1;const g=p-u+(d-c)/1e4;if(g<0&&void 0===t.clockseq&&(l=l+1&16383),(g<0||p>u)&&void 0===t.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=p,c=d,a=l,p+=122192928e5;const y=(1e4*(268435455&p)+d)%4294967296;f[r++]=y>>>24&255,f[r++]=y>>>16&255,f[r++]=y>>>8&255,f[r++]=255&y;const m=p/4294967296*1e4&268435455;f[r++]=m>>>8&255,f[r++]=255&m,f[r++]=m>>>24&15|16,f[r++]=m>>>16&255,f[r++]=l>>>8|128,f[r++]=255&l;for(let t=0;t<6;++t)f[r+t]=h[t];return e||(0,s.unsafeStringify)(f)};e.default=f},8237:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(n(7925)),i=s(n(4163));function s(t){return t&&t.__esModule?t:{default:t}}var o=(0,r.default)("v3",48,i.default);e.default=o},7925:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.URL=e.DNS=void 0,e.default=function(t,e,n){function r(t,r,o,a){var u;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(4790)),i=o(n(3319)),s=n(4008);function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t,e,n){if(r.default.randomUUID&&!e&&!t)return r.default.randomUUID();const o=(t=t||{}).random||(t.rng||i.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=o[t];return e}return(0,s.unsafeStringify)(o)};e.default=a},3764:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(n(7925)),i=s(n(3757));function s(t){return t&&t.__esModule?t:{default:t}}var o=(0,r.default)("v5",80,i.default);e.default=o},6435:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(58))&&r.__esModule?r:{default:r};var s=function(t){return"string"==typeof t&&i.default.test(t)};e.default=s},8464:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(6435))&&r.__esModule?r:{default:r};var s=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)};e.default=s}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var r=n(2352);self.AddSearchClient=r})(); \ No newline at end of file diff --git a/package.json b/package.json index f2fd59d..68d8344 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "addsearch-js-client", - "version": "0.8.6", + "version": "0.8.7", "description": "AddSearch API JavaScript client", "main": "index.js", "jsdelivr": "./dist/addsearch-js-client.min.js", diff --git a/src/cookie.js b/src/cookie.js index 75d3ed4..2ad518b 100644 --- a/src/cookie.js +++ b/src/cookie.js @@ -1,5 +1,5 @@ const setCookie = function(cookieName, cookieValue, expireDays) { - if (!document) { + if (typeof document === 'undefined') { return; } const date = new Date(); @@ -9,7 +9,7 @@ const setCookie = function(cookieName, cookieValue, expireDays) { } const getCookie = function(cookieName) { - if (!document) { + if (typeof document === 'undefined') { return; } let name = cookieName + "="; @@ -28,7 +28,7 @@ const getCookie = function(cookieName) { } const deleteCookie = function(name) { - if (!document) { + if (typeof document === 'undefined') { return; } document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 2000 00:00:01 GMT;';