@magicpages/ghost-typesense-search-ui 1.5.1 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,6 +13,11 @@ A beautiful, accessible search interface for Ghost blogs using Typesense. This p
13
13
  - 📱 Responsive design for all devices
14
14
  - 🎯 Configurable common searches suggestions
15
15
  - ⚡ Lightweight and performant
16
+ - 🔎 Smart context-aware search result highlighting
17
+ - 📝 Plaintext content search for improved relevance
18
+ - 💡 Exact phrase matching support
19
+ - 🔍 Contextual excerpts that show search term in context
20
+ - 🧩 Support for nested fields
16
21
 
17
22
  ## Installation
18
23
 
@@ -61,6 +66,7 @@ window.__MP_SEARCH_CONFIG__ = {
61
66
  typesenseApiKey: 'your-search-only-api-key', // Under no circumstances use an admin API key here. These values are stored client-side and are therefore accessible to the end user.
62
67
  collectionName: 'your-collection-name',
63
68
  theme: 'system', // 'light', 'dark', or 'system'
69
+ enableHighlighting: true, // highlight search terms in results
64
70
  commonSearches: ['Getting Started', 'Tutorials', 'API'] // can also be empty
65
71
  };
66
72
  </script>
@@ -74,6 +80,7 @@ window.__MP_SEARCH_CONFIG__ = {
74
80
  | `typesenseApiKey` | `String` | Yes | Search-only API key from Typesense |
75
81
  | `collectionName` | `String` | Yes | Name of your Typesense collection |
76
82
  | `theme` | `String` | No | UI theme: 'light', 'dark', or 'system' (default) |
83
+ | `enableHighlighting` | `Boolean` | No | Whether to highlight search terms in results (default: true) |
77
84
  | `commonSearches` | `Array` | No | Array of suggested search terms |
78
85
  | `searchFields` | `Object` | No | Customize field weights and highlighting |
79
86
 
@@ -83,20 +90,41 @@ Customize search relevance with field weights and highlighting:
83
90
 
84
91
  ```javascript
85
92
  searchFields: {
86
- title: { weight: 4, highlight: true },
87
- excerpt: { weight: 2, highlight: true },
93
+ title: { weight: 5, highlight: true },
94
+ plaintext: { weight: 4, highlight: true },
95
+ excerpt: { weight: 3, highlight: true },
88
96
  html: { weight: 1, highlight: true }
89
97
  }
90
98
  ```
91
99
 
100
+ The default weights are optimized to provide the most relevant results, prioritizing title matches, then plaintext content, followed by excerpt and HTML content.
101
+
92
102
  ## Usage
93
103
 
94
104
  The search interface can be triggered in multiple ways:
95
105
  - Click the search icon in your Ghost theme
96
106
  - Press `/` on your keyboard
97
107
  - Navigate to `/#/search` URL
108
+ - Use URL query parameters: `/?s=your search term` or `/?q=your search term`
98
109
  - Programmatically via `window.magicPagesSearch.openModal()`
99
110
 
111
+ ### URL-Based Search
112
+
113
+ You can trigger searches directly from URLs using two formats:
114
+
115
+ #### 1. Query Parameter Format
116
+ ```
117
+ https://yourblog.com/?s=getting+started
118
+ https://yourblog.com/?q=tutorials
119
+ ```
120
+
121
+ Both `s` and `q` query parameters are supported for maximum compatibility with legacy links.
122
+
123
+ #### 2. Clean Hash Path Format
124
+ ```
125
+ https://yourblog.com/#/search/getting+started
126
+ ```
127
+
100
128
  ### Keyboard Shortcuts
101
129
 
102
130
  - `/`: Open search
@@ -1 +1 @@
1
- !function(){var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(n){if(n.t)return n;var t=n.default;if("function"==typeof t){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"t",{value:!0}),Object.keys(n).forEach((function(t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})})),e}var e,r,i,o={},u={},s={},c={exports:{}};r=n,i=function(){var n=function(){},t="undefined",e=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function u(n,t){var e=n[t];if("function"==typeof e.bind)return e.bind(n);try{return Function.prototype.bind.call(e,n)}catch(t){return function(){return Function.prototype.apply.call(e,n,arguments)}}}function s(){console.log&&(console.log.apply||Function.prototype.apply.call(console.log,console,arguments))}function c(){for(var e=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<e?n:this.methodFactory(o,e,this.name)}if(this.log=this.debug,typeof console===t&&e<this.levels.SILENT)return"No console available for logging"}function a(n){return function(){typeof console!==t&&(c.call(this),this[n].apply(this,arguments))}}function f(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&e?s:void 0!==console[r]?u(console,r):void 0!==console.log?u(console,"log"):n)}(r)||a.apply(this,arguments)}function h(n,e){var u,s,a,h=this,l="loglevel";function d(){var n;if(typeof window!==t&&l){try{n=window.localStorage[l]}catch(n){}if(typeof n===t)try{var e=window.document.cookie,r=encodeURIComponent(l),i=e.indexOf(r+"=");-1!==i&&(n=/^([^;]+)/.exec(e.slice(i+r.length+1))[1])}catch(n){}return void 0===h.levels[n]&&(n=void 0),n}}function v(n){var t=n;if("string"==typeof t&&void 0!==h.levels[t.toUpperCase()]&&(t=h.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=h.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+n)}"string"==typeof n?l+=":"+n:"symbol"==typeof n&&(l=void 0),h.name=n,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=e||f,h.getLevel=function(){return null!=a?a:null!=s?s:u},h.setLevel=function(n,e){return a=v(n),!1!==e&&function(n){var e=(r[n]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=e)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"="+e+";"}catch(n){}}}(a),c.call(h)},h.setDefaultLevel=function(n){s=v(n),d()||h.setLevel(n,!1)},h.resetLevel=function(){a=null,function(){if(typeof window!==t&&l){try{window.localStorage.removeItem(l)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(n){}}}(),c.call(h)},h.enableAll=function(n){h.setLevel(h.levels.TRACE,n)},h.disableAll=function(n){h.setLevel(h.levels.SILENT,n)},h.rebuild=function(){if(o!==h&&(u=v(o.getLevel())),c.call(h),o===h)for(var n in i)i[n].rebuild()},u=v(o?o.getLevel():"WARN");var p=d();null!=p&&(a=v(p)),c.call(h)}(o=new h).getLogger=function(n){if("symbol"!=typeof n&&"string"!=typeof n||""===n)throw new TypeError("You must supply a name when creating a logger.");var t=i[n];return t||(t=i[n]=new h(n,o.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=l),o},o.getLoggers=function(){return i},o.default=o,o},(e=c).exports?e.exports=i():r.log=i();var a,f=c.exports,h={},l={},d={},v=n&&n.i||(a=function(n,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},a(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function e(){this.constructor=n}a(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(d,"t",{value:!0});var p=function(n){function t(t){var e=this.constructor,r=n.call(this,t)||this;return r.name=e.name,Object.setPrototypeOf(r,e.prototype),r}return v(t,n),t}(Error);d.default=p;var m=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),b=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(l,"t",{value:!0});var w=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return m(t,n),t}(b(d).default);l.default=w;var y={},g=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),k=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(y,"t",{value:!0});var x=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return g(t,n),t}(k(d).default);y.default=x;var O={},S=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),_=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(O,"t",{value:!0});var j=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return S(t,n),t}(_(d).default);O.default=j;var E={},R=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),T=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(E,"t",{value:!0});var P=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return R(t,n),t}(T(d).default);E.default=P;var A={},N=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),C=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(A,"t",{value:!0});var M=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return N(t,n),t}(C(d).default);A.default=M;var U={},q=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),D=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(U,"t",{value:!0});var F=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return q(t,n),t}(D(d).default);U.default=F;var B={},L=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),z=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(B,"t",{value:!0});var H=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return L(t,n),t}(z(d).default);B.default=H;var I={},G=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),J=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(I,"t",{value:!0});var $=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return G(t,n),t}(J(d).default);I.default=$;var K={},W=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),X=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(K,"t",{value:!0});var V=function(n){function t(t,e){var r=n.call(this,t)||this;return r.importResults=e,r}return W(t,n),t}(X(d).default);K.default=V;var Y=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(h,"t",{value:!0}),h.ImportError=h.TypesenseError=h.ServerError=h.RequestUnauthorized=h.RequestMalformed=h.ObjectUnprocessable=h.ObjectNotFound=h.ObjectAlreadyExists=h.MissingConfigurationError=h.HTTPError=void 0;var Z=Y(l);h.HTTPError=Z.default;var Q=Y(y);h.MissingConfigurationError=Q.default;var nn=Y(O);h.ObjectAlreadyExists=nn.default;var tn=Y(E);h.ObjectNotFound=tn.default;var en=Y(A);h.ObjectUnprocessable=en.default;var rn=Y(U);h.RequestMalformed=rn.default;var on=Y(B);h.RequestUnauthorized=on.default;var un=Y(I);h.ServerError=un.default;var sn=Y(K);h.ImportError=sn.default;var cn=Y(d);h.TypesenseError=cn.default;var an=n&&n.u||function(){return an=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n},an.apply(this,arguments)},fn=n&&n.h||(Object.create?function(n,t,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.t:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,r,i)}:function(n,t,e,r){void 0===r&&(r=e),n[r]=t[e]}),hn=n&&n.l||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),ln=n&&n.v||function(n){if(n&&n.t)return n;var t={};if(null!=n)for(var e in n)"default"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&fn(t,n,e);return hn(t,n),t};Object.defineProperty(s,"t",{value:!0});var dn=ln(f),vn=h,pn=function(){function n(n){var t=this;this.nodes=n.nodes||[],this.nodes=this.nodes.map((function(n){return t.setDefaultPathInNode(n)})).map((function(n){return t.setDefaultPortInNode(n)})).map((function(n){return an({},n)})),null==n.randomizeNodes&&(n.randomizeNodes=!0),!0===n.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=n.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=n.connectionTimeoutSeconds||n.timeoutSeconds||5,this.healthcheckIntervalSeconds=n.healthcheckIntervalSeconds||60,this.numRetries=n.numRetries||this.nodes.length+(null==this.nearestNode?0:1)||3,this.retryIntervalSeconds=n.retryIntervalSeconds||.1,this.apiKey=n.apiKey,this.sendApiKeyAsQueryParam=n.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=n.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=n.useServerSideSearchCache||!1,this.logger=n.logger||dn,this.logLevel=n.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=n.additionalHeaders,this.httpAgent=n.httpAgent,this.httpsAgent=n.httpsAgent,this.showDeprecationWarnings(n),this.validate()}return n.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new vn.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new vn.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new vn.MissingConfigurationError("Ensure that apiKey is set");return!0},n.prototype.validateNodes=function(){var n=this;return this.nodes.some((function(t){return n.isNodeMissingAnyParameters(t)}))},n.prototype.isNodeMissingAnyParameters=function(n){return!["protocol","host","port","path"].every((function(t){return n.hasOwnProperty(t)}))&&null==n.url},n.prototype.setDefaultPathInNode=function(n){return null==n||n.hasOwnProperty("path")||(n.path=""),n},n.prototype.setDefaultPortInNode=function(n){if(null!=n&&!n.hasOwnProperty("port")&&n.hasOwnProperty("protocol"))switch(n.protocol){case"https":n.port=443;break;case"http":n.port=80}return n},n.prototype.showDeprecationWarnings=function(n){n.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),n.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),n.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},n.prototype.shuffleArray=function(n){for(var t,e=n.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1));t=[n[r],n[e]],n[e]=t[0],n[r]=t[1]}},n}();s.default=pn;var mn={};function bn(n,t){return function(){return n.apply(t,arguments)}}const{toString:wn}=Object.prototype,{getPrototypeOf:yn}=Object,gn=(kn=Object.create(null),n=>{const t=wn.call(n);return kn[t]||(kn[t]=t.slice(8,-1).toLowerCase())});var kn;const xn=n=>(n=n.toLowerCase(),t=>gn(t)===n),On=n=>t=>typeof t===n,{isArray:Sn}=Array,_n=On("undefined"),jn=xn("ArrayBuffer"),En=On("string"),Rn=On("function"),Tn=On("number"),Pn=n=>null!==n&&"object"==typeof n,An=n=>{if("object"!==gn(n))return!1;const t=yn(n);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in n||Symbol.iterator in n)},Nn=xn("Date"),Cn=xn("File"),Mn=xn("Blob"),Un=xn("FileList"),qn=xn("URLSearchParams"),[Dn,Fn,Bn,Ln]=["ReadableStream","Request","Response","Headers"].map(xn);function zn(n,t,{allOwnKeys:e=!1}={}){if(null==n)return;let r,i;if("object"!=typeof n&&(n=[n]),Sn(n))for(r=0,i=n.length;r<i;r++)t.call(null,n[r],r,n);else{const i=e?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let u;for(r=0;r<o;r++)u=i[r],t.call(null,n[u],u,n)}}function Hn(n,t){t=t.toLowerCase();const e=Object.keys(n);let r,i=e.length;for(;i-- >0;)if(r=e[i],t===r.toLowerCase())return r;return null}const In="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n,Gn=n=>!_n(n)&&n!==In,Jn=($n="undefined"!=typeof Uint8Array&&yn(Uint8Array),n=>$n&&n instanceof $n);var $n;const Kn=xn("HTMLFormElement"),Wn=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Xn=xn("RegExp"),Vn=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),r={};zn(e,((e,i)=>{let o;!1!==(o=t(e,i,n))&&(r[i]=o||e)})),Object.defineProperties(n,r)},Yn="abcdefghijklmnopqrstuvwxyz",Zn="0123456789",Qn={DIGIT:Zn,ALPHA:Yn,ALPHA_DIGIT:Yn+Yn.toUpperCase()+Zn},nt=xn("AsyncFunction"),tt=(et="function"==typeof setImmediate,rt=Rn(In.postMessage),et?setImmediate:rt?(it="axios@"+Math.random(),ot=[],In.addEventListener("message",(({source:n,data:t})=>{n===In&&t===it&&ot.length&&ot.shift()()}),!1),n=>{ot.push(n),In.postMessage(it,"*")}):n=>setTimeout(n));var et,rt,it,ot;const ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind(In):"undefined"!=typeof process&&process.nextTick||tt;var st={isArray:Sn,isArrayBuffer:jn,isBuffer:function(n){return null!==n&&!_n(n)&&null!==n.constructor&&!_n(n.constructor)&&Rn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)},isFormData:n=>{let t;return n&&("function"==typeof FormData&&n instanceof FormData||Rn(n.append)&&("formdata"===(t=gn(n))||"object"===t&&Rn(n.toString)&&"[object FormData]"===n.toString()))},isArrayBufferView:function(n){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer&&jn(n.buffer),t},isString:En,isNumber:Tn,isBoolean:n=>!0===n||!1===n,isObject:Pn,isPlainObject:An,isReadableStream:Dn,isRequest:Fn,isResponse:Bn,isHeaders:Ln,isUndefined:_n,isDate:Nn,isFile:Cn,isBlob:Mn,isRegExp:Xn,isFunction:Rn,isStream:n=>Pn(n)&&Rn(n.pipe),isURLSearchParams:qn,isTypedArray:Jn,isFileList:Un,forEach:zn,merge:function n(){const{caseless:t}=Gn(this)&&this||{},e={},r=(r,i)=>{const o=t&&Hn(e,i)||i;An(e[o])&&An(r)?e[o]=n(e[o],r):An(r)?e[o]=n({},r):Sn(r)?e[o]=r.slice():e[o]=r};for(let n=0,t=arguments.length;n<t;n++)arguments[n]&&zn(arguments[n],r);return e},extend:(n,t,e,{allOwnKeys:r}={})=>(zn(t,((t,r)=>{e&&Rn(t)?n[r]=bn(t,e):n[r]=t}),{allOwnKeys:r}),n),trim:n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:n=>(65279===n.charCodeAt(0)&&(n=n.slice(1)),n),inherits:(n,t,e,r)=>{n.prototype=Object.create(t.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},toFlatObject:(n,t,e,r)=>{let i,o,u;const s={};if(t=t||{},null==n)return t;do{for(i=Object.getOwnPropertyNames(n),o=i.length;o-- >0;)u=i[o],r&&!r(u,n,t)||s[u]||(t[u]=n[u],s[u]=!0);n=!1!==e&&yn(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},kindOf:gn,kindOfTest:xn,endsWith:(n,t,e)=>{n+="",(void 0===e||e>n.length)&&(e=n.length),e-=t.length;const r=n.indexOf(t,e);return-1!==r&&r===e},toArray:n=>{if(!n)return null;if(Sn(n))return n;let t=n.length;if(!Tn(t))return null;const e=Array(t);for(;t-- >0;)e[t]=n[t];return e},forEachEntry:(n,t)=>{const e=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=e.next())&&!r.done;){const e=r.value;t.call(n,e[0],e[1])}},matchAll:(n,t)=>{let e;const r=[];for(;null!==(e=n.exec(t));)r.push(e);return r},isHTMLForm:Kn,hasOwnProperty:Wn,hasOwnProp:Wn,reduceDescriptors:Vn,freezeMethods:n=>{Vn(n,((t,e)=>{if(Rn(n)&&-1!==["arguments","caller","callee"].indexOf(e))return!1;const r=n[e];Rn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")}))}))},toObjectSet:(n,t)=>{const e={},r=n=>{n.forEach((n=>{e[n]=!0}))};return Sn(n)?r(n):r((n+"").split(t)),e},toCamelCase:n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(n,t,e){return t.toUpperCase()+e})),noop:()=>{},toFiniteNumber:(n,t)=>null!=n&&Number.isFinite(n=+n)?n:t,findKey:Hn,global:In,isContextDefined:Gn,ALPHABET:Qn,generateString:(n=16,t=Qn.ALPHA_DIGIT)=>{let e="";const{length:r}=t;for(;n--;)e+=t[Math.random()*r|0];return e},isSpecCompliantForm:function(n){return!!(n&&Rn(n.append)&&"FormData"===n[Symbol.toStringTag]&&n[Symbol.iterator])},toJSONObject:n=>{const t=[,,,,,,,,,,],e=(n,r)=>{if(Pn(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const i=Sn(n)?[]:{};return zn(n,((n,t)=>{const o=e(n,r+1);!_n(o)&&(i[t]=o)})),t[r]=void 0,i}}return n};return e(n,0)},isAsyncFn:nt,isThenable:n=>n&&(Pn(n)||Rn(n))&&Rn(n.then)&&Rn(n.catch),setImmediate:tt,asap:ut};function ct(n,t,e,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}st.inherits(ct,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:st.toJSONObject(this.config),code:this.code,status:this.status}}});const at=ct.prototype,ft={};function ht(n){return st.isPlainObject(n)||st.isArray(n)}function lt(n){return st.endsWith(n,"[]")?n.slice(0,-2):n}function dt(n,t,e){return n?n.concat(t).map((function(n,t){return n=lt(n),!e&&t?"["+n+"]":n})).join(e?".":""):t}["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((n=>{ft[n]={value:n}})),Object.defineProperties(ct,ft),Object.defineProperty(at,"isAxiosError",{value:!0}),ct.from=(n,t,e,r,i,o)=>{const u=Object.create(at);return st.toFlatObject(n,u,(function(n){return n!==Error.prototype}),(n=>"isAxiosError"!==n)),ct.call(u,n.message,t,e,r,i),u.cause=n,u.name=n.name,o&&Object.assign(u,o),u};const vt=st.toFlatObject(st,{},null,(function(n){return/^is[A-Z]/.test(n)}));function pt(n,t,e){if(!st.isObject(n))throw new TypeError("target must be an object");t=t||new FormData;const r=(e=st.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(n,t){return!st.isUndefined(t[n])}))).metaTokens,i=e.visitor||a,o=e.dots,u=e.indexes,s=(e.Blob||"undefined"!=typeof Blob&&Blob)&&st.isSpecCompliantForm(t);if(!st.isFunction(i))throw new TypeError("visitor must be a function");function c(n){if(null===n)return"";if(st.isDate(n))return n.toISOString();if(!s&&st.isBlob(n))throw new ct("Blob is not supported. Use a Buffer instead.");return st.isArrayBuffer(n)||st.isTypedArray(n)?s&&"function"==typeof Blob?new Blob([n]):Buffer.from(n):n}function a(n,e,i){let s=n;if(n&&!i&&"object"==typeof n)if(st.endsWith(e,"{}"))e=r?e:e.slice(0,-2),n=JSON.stringify(n);else if(st.isArray(n)&&function(n){return st.isArray(n)&&!n.some(ht)}(n)||(st.isFileList(n)||st.endsWith(e,"[]"))&&(s=st.toArray(n)))return e=lt(e),s.forEach((function(n,r){!st.isUndefined(n)&&null!==n&&t.append(!0===u?dt([e],r,o):null===u?e:e+"[]",c(n))})),!1;return!!ht(n)||(t.append(dt(i,e,o),c(n)),!1)}const f=[],h=Object.assign(vt,{defaultVisitor:a,convertValue:c,isVisitable:ht});if(!st.isObject(n))throw new TypeError("data must be an object");return function n(e,r){if(!st.isUndefined(e)){if(-1!==f.indexOf(e))throw Error("Circular reference detected in "+r.join("."));f.push(e),st.forEach(e,(function(e,o){!0===(!(st.isUndefined(e)||null===e)&&i.call(t,e,st.isString(o)?o.trim():o,r,h))&&n(e,r?r.concat(o):[o])})),f.pop()}}(n),t}function mt(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,(function(n){return t[n]}))}function bt(n,t){this.p=[],n&&pt(n,this,t)}const wt=bt.prototype;function yt(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function gt(n,t,e){if(!t)return n;const r=e&&e.encode||yt;st.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let o;if(o=i?i(t,e):st.isURLSearchParams(t)?t.toString():new bt(t,e).toString(r),o){const t=n.indexOf("#");-1!==t&&(n=n.slice(0,t)),n+=(-1===n.indexOf("?")?"?":"&")+o}return n}wt.append=function(n,t){this.p.push([n,t])},wt.toString=function(n){const t=n?function(t){return n.call(this,t,mt)}:mt;return this.p.map((function(n){return t(n[0])+"="+t(n[1])}),"").join("&")};var kt=class{constructor(){this.handlers=[]}use(n,t,e){return this.handlers.push({fulfilled:n,rejected:t,synchronous:!!e&&e.synchronous,runWhen:e?e.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){st.forEach(this.handlers,(function(t){null!==t&&n(t)}))}},xt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ot={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:bt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const St="undefined"!=typeof window&&"undefined"!=typeof document,_t="object"==typeof navigator&&navigator||void 0,jt=St&&(!_t||["ReactNative","NativeScript","NS"].indexOf(_t.product)<0),Et="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Rt=St&&window.location.href||"http://localhost";var Tt={...Object.freeze({__proto__:null,hasBrowserEnv:St,hasStandardBrowserWebWorkerEnv:Et,hasStandardBrowserEnv:jt,navigator:_t,origin:Rt}),...Ot};function Pt(n){function t(n,e,r,i){let o=n[i++];if("__proto__"===o)return!0;const u=Number.isFinite(+o),s=i>=n.length;return o=!o&&st.isArray(r)?r.length:o,s?(st.hasOwnProp(r,o)?r[o]=[r[o],e]:r[o]=e,!u):(r[o]&&st.isObject(r[o])||(r[o]=[]),t(n,e,r[o],i)&&st.isArray(r[o])&&(r[o]=function(n){const t={},e=Object.keys(n);let r;const i=e.length;let o;for(r=0;r<i;r++)o=e[r],t[o]=n[o];return t}(r[o])),!u)}if(st.isFormData(n)&&st.isFunction(n.entries)){const e={};return st.forEachEntry(n,((n,r)=>{t(function(n){return st.matchAll(/\w+|\[(\w*)]/g,n).map((n=>"[]"===n[0]?"":n[1]||n[0]))}(n),r,e,0)})),e}return null}const At={transitional:xt,adapter:["xhr","http","fetch"],transformRequest:[function(n,t){const e=t.getContentType()||"",r=e.indexOf("application/json")>-1,i=st.isObject(n);if(i&&st.isHTMLForm(n)&&(n=new FormData(n)),st.isFormData(n))return r?JSON.stringify(Pt(n)):n;if(st.isArrayBuffer(n)||st.isBuffer(n)||st.isStream(n)||st.isFile(n)||st.isBlob(n)||st.isReadableStream(n))return n;if(st.isArrayBufferView(n))return n.buffer;if(st.isURLSearchParams(n))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let o;if(i){if(e.indexOf("application/x-www-form-urlencoded")>-1)return function(n,t){return pt(n,new Tt.classes.URLSearchParams,Object.assign({visitor:function(n,t,e,r){return Tt.isNode&&st.isBuffer(n)?(this.append(t,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(n,this.formSerializer).toString();if((o=st.isFileList(n))||e.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return pt(o?{"files[]":n}:n,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(n){if(st.isString(n))try{return(0,JSON.parse)(n),st.trim(n)}catch(n){if("SyntaxError"!==n.name)throw n}return(0,JSON.stringify)(n)}(n)):n}],transformResponse:[function(n){const t=this.transitional||At.transitional,e=t&&t.forcedJSONParsing,r="json"===this.responseType;if(st.isResponse(n)||st.isReadableStream(n))return n;if(n&&st.isString(n)&&(e&&!this.responseType||r)){const e=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(n)}catch(n){if(e){if("SyntaxError"===n.name)throw ct.from(n,ct.ERR_BAD_RESPONSE,this,null,this.response);throw n}}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};st.forEach(["delete","get","head","post","put","patch"],(n=>{At.headers[n]={}}));var Nt=At;const Ct=st.toObjectSet(["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"]),Mt=Symbol("internals");function Ut(n){return n&&(n+"").trim().toLowerCase()}function qt(n){return!1===n||null==n?n:st.isArray(n)?n.map(qt):n+""}function Dt(n,t,e,r,i){return st.isFunction(r)?r.call(this,t,e):(i&&(t=e),st.isString(t)?st.isString(r)?-1!==t.indexOf(r):st.isRegExp(r)?r.test(t):void 0:void 0)}class Ft{constructor(n){n&&this.set(n)}set(n,t,e){const r=this;function i(n,t,e){const i=Ut(t);if(!i)throw Error("header name must be a non-empty string");const o=st.findKey(r,i);(!o||void 0===r[o]||!0===e||void 0===e&&!1!==r[o])&&(r[o||t]=qt(n))}const o=(n,t)=>st.forEach(n,((n,e)=>i(n,e,t)));if(st.isPlainObject(n)||n instanceof this.constructor)o(n,t);else if(st.isString(n)&&(n=n.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))o((n=>{const t={};let e,r,i;return n&&n.split("\n").forEach((function(n){i=n.indexOf(":"),e=n.substring(0,i).trim().toLowerCase(),r=n.substring(i+1).trim(),!e||t[e]&&Ct[e]||("set-cookie"===e?t[e]?t[e].push(r):t[e]=[r]:t[e]=t[e]?t[e]+", "+r:r)})),t})(n),t);else if(st.isHeaders(n))for(const[t,r]of n.entries())i(r,t,e);else null!=n&&i(t,n,e);return this}get(n,t){if(n=Ut(n)){const e=st.findKey(this,n);if(e){const n=this[e];if(!t)return n;if(!0===t)return function(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=e.exec(n);)t[r[1]]=r[2];return t}(n);if(st.isFunction(t))return t.call(this,n,e);if(st.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,t){if(n=Ut(n)){const e=st.findKey(this,n);return!(!e||void 0===this[e]||t&&!Dt(0,this[e],e,t))}return!1}delete(n,t){const e=this;let r=!1;function i(n){if(n=Ut(n)){const i=st.findKey(e,n);!i||t&&!Dt(0,e[i],i,t)||(delete e[i],r=!0)}}return st.isArray(n)?n.forEach(i):i(n),r}clear(n){const t=Object.keys(this);let e=t.length,r=!1;for(;e--;){const i=t[e];n&&!Dt(0,this[i],i,n,!0)||(delete this[i],r=!0)}return r}normalize(n){const t=this,e={};return st.forEach(this,((r,i)=>{const o=st.findKey(e,i);if(o)return t[o]=qt(r),void delete t[i];const u=n?function(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((n,t,e)=>t.toUpperCase()+e))}(i):(i+"").trim();u!==i&&delete t[i],t[u]=qt(r),e[u]=!0})),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const t=Object.create(null);return st.forEach(this,((e,r)=>{null!=e&&!1!==e&&(t[r]=n&&st.isArray(e)?e.join(", "):e)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([n,t])=>n+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...t){const e=new this(n);return t.forEach((n=>e.set(n))),e}static accessor(n){const t=(this[Mt]=this[Mt]={accessors:{}}).accessors,e=this.prototype;function r(n){const r=Ut(n);t[r]||(function(n,t){const e=st.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(n,r+e,{value:function(n,e,i){return this[r].call(this,t,n,e,i)},configurable:!0})}))}(e,n),t[r]=!0)}return st.isArray(n)?n.forEach(r):r(n),this}}Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),st.reduceDescriptors(Ft.prototype,(({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(n){this[e]=n}}})),st.freezeMethods(Ft);var Bt=Ft;function Lt(n,t){const e=this||Nt,r=t||e,i=Bt.from(r.headers);let o=r.data;return st.forEach(n,(function(n){o=n.call(e,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function zt(n){return!(!n||!n.m)}function Ht(n,t,e){ct.call(this,n??"canceled",ct.ERR_CANCELED,t,e),this.name="CanceledError"}function It(n,t,e){const r=e.config.validateStatus;e.status&&r&&!r(e.status)?t(new ct("Request failed with status code "+e.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e)):n(e)}st.inherits(Ht,ct,{m:!0});const Gt=(n,t,e=3)=>{let r=0;const i=function(n,t){const e=Array(n=n||10),r=Array(n);let i,o=0,u=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),a=r[u];i||(i=c),e[o]=s,r[o]=c;let f=u,h=0;for(;f!==o;)h+=e[f++],f%=n;if(o=(o+1)%n,o===u&&(u=(u+1)%n),c-i<t)return;const l=a&&c-a;return l?Math.round(1e3*h/l):void 0}}(50,250);return function(n,t){let e,r,i=0,o=1e3/t;const u=(t,o=Date.now())=>{i=o,e=null,r&&(clearTimeout(r),r=null),n.apply(null,t)};return[(...n)=>{const t=Date.now(),s=t-i;s>=o?u(n,t):(e=n,r||(r=setTimeout((()=>{r=null,u(e)}),o-s)))},()=>e&&u(e)]}((e=>{const o=e.loaded,u=e.lengthComputable?e.total:void 0,s=o-r,c=i(s);r=o,n({loaded:o,total:u,progress:u?o/u:void 0,bytes:s,rate:c||void 0,estimated:c&&u&&o<=u?(u-o)/c:void 0,event:e,lengthComputable:null!=u,[t?"download":"upload"]:!0})}),e)},Jt=(n,t)=>{const e=null!=n;return[r=>t[0]({lengthComputable:e,total:n,loaded:r}),t[1]]},$t=n=>(...t)=>st.asap((()=>n(...t)));var Kt=Tt.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,Tt.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,Wt=Tt.hasStandardBrowserEnv?{write(n,t,e,r,i,o){const u=[n+"="+encodeURIComponent(t)];st.isNumber(e)&&u.push("expires="+new Date(e).toGMTString()),st.isString(r)&&u.push("path="+r),st.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read(n){const t=document.cookie.match(RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Xt(n,t){return n&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}(n,t):t}const Vt=n=>n instanceof Bt?{...n}:n;function Yt(n,t){t=t||{};const e={};function r(n,t,e,r){return st.isPlainObject(n)&&st.isPlainObject(t)?st.merge.call({caseless:r},n,t):st.isPlainObject(t)?st.merge({},t):st.isArray(t)?t.slice():t}function i(n,t,e,i){return st.isUndefined(t)?st.isUndefined(n)?void 0:r(void 0,n,0,i):r(n,t,0,i)}function o(n,t){if(!st.isUndefined(t))return r(void 0,t)}function u(n,t){return st.isUndefined(t)?st.isUndefined(n)?void 0:r(void 0,n):r(void 0,t)}function s(e,i,o){return o in t?r(e,i):o in n?r(void 0,e):void 0}const c={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:s,headers:(n,t,e)=>i(Vt(n),Vt(t),0,!0)};return st.forEach(Object.keys(Object.assign({},n,t)),(function(r){const o=c[r]||i,u=o(n[r],t[r],r);st.isUndefined(u)&&o!==s||(e[r]=u)})),e}var Zt=n=>{const t=Yt({},n);let e,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:u,headers:s,auth:c}=t;if(t.headers=s=Bt.from(s),t.url=gt(Xt(t.baseURL,t.url),n.params,n.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),st.isFormData(r))if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(e=s.getContentType())){const[n,...t]=e?e.split(";").map((n=>n.trim())).filter(Boolean):[];s.setContentType([n||"multipart/form-data",...t].join("; "))}if(Tt.hasStandardBrowserEnv&&(i&&st.isFunction(i)&&(i=i(t)),i||!1!==i&&Kt(t.url))){const n=o&&u&&Wt.read(u);n&&s.set(o,n)}return t},Qt="undefined"!=typeof XMLHttpRequest&&function(n){return new Promise((function(t,e){const r=Zt(n);let i=r.data;const o=Bt.from(r.headers).normalize();let u,s,c,a,f,{responseType:h,onUploadProgress:l,onDownloadProgress:d}=r;function v(){a&&a(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;function m(){if(!p)return;const r=Bt.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());It((function(n){t(n),v()}),(function(n){e(n),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:n,request:p}),p=null}p.open(r.method.toUpperCase(),r.url,!0),p.timeout=r.timeout,"onloadend"in p?p.onloadend=m:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(m)},p.onabort=function(){p&&(e(new ct("Request aborted",ct.ECONNABORTED,n,p)),p=null)},p.onerror=function(){e(new ct("Network Error",ct.ERR_NETWORK,n,p)),p=null},p.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||xt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),e(new ct(t,i.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,n,p)),p=null},void 0===i&&o.setContentType(null),"setRequestHeader"in p&&st.forEach(o.toJSON(),(function(n,t){p.setRequestHeader(t,n)})),st.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),h&&"json"!==h&&(p.responseType=r.responseType),d&&([c,f]=Gt(d,!0),p.addEventListener("progress",c)),l&&p.upload&&([s,a]=Gt(l),p.upload.addEventListener("progress",s),p.upload.addEventListener("loadend",a)),(r.cancelToken||r.signal)&&(u=t=>{p&&(e(!t||t.type?new Ht(null,n,p):t),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const b=function(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}(r.url);b&&-1===Tt.protocols.indexOf(b)?e(new ct("Unsupported protocol "+b+":",ct.ERR_BAD_REQUEST,n)):p.send(i||null)}))},ne=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let e,r=new AbortController;const i=function(n){if(!e){e=!0,u();const t=n instanceof Error?n:this.reason;r.abort(t instanceof ct?t:new Ht(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new ct(`timeout ${t} of ms exceeded`,ct.ETIMEDOUT))}),t);const u=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach((n=>{n.unsubscribe?n.unsubscribe(i):n.removeEventListener("abort",i)})),n=null)};n.forEach((n=>n.addEventListener("abort",i)));const{signal:s}=r;return s.unsubscribe=()=>st.asap(u),s}};const te=function*(n,t){let e=n.byteLength;if(e<t)return void(yield n);let r,i=0;for(;i<e;)r=i+t,yield n.slice(i,r),i=r},ee=(n,t,e,r)=>{const i=async function*(n,t){for await(const e of async function*(n){if(n[Symbol.asyncIterator])return void(yield*n);const t=n.getReader();try{for(;;){const{done:n,value:e}=await t.read();if(n)break;yield e}}finally{await t.cancel()}}(n))yield*te(e,t)}(n,t);let o,u=0,s=n=>{o||(o=!0,r&&r(n))};return new ReadableStream({async pull(n){try{const{done:t,value:r}=await i.next();if(t)return s(),void n.close();let o=r.byteLength;if(e){let n=u+=o;e(n)}n.enqueue(new Uint8Array(r))}catch(n){throw s(n),n}},cancel:n=>(s(n),i.return())},{highWaterMark:2})},re="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,ie=re&&"function"==typeof ReadableStream,oe=re&&("function"==typeof TextEncoder?(ue=new TextEncoder,n=>ue.encode(n)):async n=>new Uint8Array(await new Response(n).arrayBuffer()));var ue;const se=(n,...t)=>{try{return!!n(...t)}catch(n){return!1}},ce=ie&&se((()=>{let n=!1;const t=new Request(Tt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t})),ae=ie&&se((()=>st.isReadableStream(new Response("").body))),fe={stream:ae&&(n=>n.body)};var he;re&&(he=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((n=>{!fe[n]&&(fe[n]=st.isFunction(he[n])?t=>t[n]():(t,e)=>{throw new ct(`Response type '${n}' is not supported`,ct.ERR_NOT_SUPPORT,e)})})));const le={http:null,xhr:Qt,fetch:re&&(async n=>{let{url:t,method:e,data:r,signal:i,cancelToken:o,timeout:u,onDownloadProgress:s,onUploadProgress:c,responseType:a,headers:f,withCredentials:h="same-origin",fetchOptions:l}=Zt(n);a=a?(a+"").toLowerCase():"text";let d,v=ne([i,o&&o.toAbortSignal()],u);const p=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let m;try{if(c&&ce&&"get"!==e&&"head"!==e&&0!==(m=await(async(n,t)=>st.toFiniteNumber(n.getContentLength())??(async n=>{if(null==n)return 0;if(st.isBlob(n))return n.size;if(st.isSpecCompliantForm(n)){const t=new Request(Tt.origin,{method:"POST",body:n});return(await t.arrayBuffer()).byteLength}return st.isArrayBufferView(n)||st.isArrayBuffer(n)?n.byteLength:(st.isURLSearchParams(n)&&(n+=""),st.isString(n)?(await oe(n)).byteLength:void 0)})(t))(f,r))){let n,e=new Request(t,{method:"POST",body:r,duplex:"half"});if(st.isFormData(r)&&(n=e.headers.get("content-type"))&&f.setContentType(n),e.body){const[n,t]=Jt(m,Gt($t(c)));r=ee(e.body,65536,n,t)}}st.isString(h)||(h=h?"include":"omit");const i="credentials"in Request.prototype;d=new Request(t,{...l,signal:v,method:e.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:i?h:void 0});let o=await fetch(d);const u=ae&&("stream"===a||"response"===a);if(ae&&(s||u&&p)){const n={};["status","statusText","headers"].forEach((t=>{n[t]=o[t]}));const t=st.toFiniteNumber(o.headers.get("content-length")),[e,r]=s&&Jt(t,Gt($t(s),!0))||[];o=new Response(ee(o.body,65536,e,(()=>{r&&r(),p&&p()})),n)}a=a||"text";let b=await fe[st.findKey(fe,a)||"text"](o,n);return!u&&p&&p(),await new Promise(((t,e)=>{It(t,e,{data:b,headers:Bt.from(o.headers),status:o.status,statusText:o.statusText,config:n,request:d})}))}catch(t){if(p&&p(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new ct("Network Error",ct.ERR_NETWORK,n,d),{cause:t.cause||t});throw ct.from(t,t&&t.code,n,d)}})};st.forEach(le,((n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch(n){}Object.defineProperty(n,"adapterName",{value:t})}}));const de=n=>"- "+n,ve=n=>st.isFunction(n)||null===n||!1===n;var pe=n=>{n=st.isArray(n)?n:[n];const{length:t}=n;let e,r;const i={};for(let o=0;o<t;o++){let t;if(e=n[o],r=e,!ve(e)&&(r=le[(t=e+"").toLowerCase()],void 0===r))throw new ct(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+o]=r}if(!r){const n=Object.entries(i).map((([n,t])=>`adapter ${n} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new ct("There is no suitable adapter to dispatch the request "+(t?n.length>1?"since :\n"+n.map(de).join("\n"):" "+de(n[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function me(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ht(null,n)}function be(n){return me(n),n.headers=Bt.from(n.headers),n.data=Lt.call(n,n.transformRequest),-1!==["post","put","patch"].indexOf(n.method)&&n.headers.setContentType("application/x-www-form-urlencoded",!1),pe(n.adapter||Nt.adapter)(n).then((function(t){return me(n),t.data=Lt.call(n,n.transformResponse,t),t.headers=Bt.from(t.headers),t}),(function(t){return zt(t)||(me(n),t&&t.response&&(t.response.data=Lt.call(n,n.transformResponse,t.response),t.response.headers=Bt.from(t.response.headers))),Promise.reject(t)}))}const we={};["object","boolean","number","function","string","symbol"].forEach(((n,t)=>{we[n]=function(e){return typeof e===n||"a"+(t<1?"n ":" ")+n}}));const ye={};we.transitional=function(n,t,e){return(r,i,o)=>{if(!1===n)throw new ct(function(n,t){return"[Axios v1.7.9] Transitional option '"+n+"'"+t+(e?". "+e:"")}(i," has been removed"+(t?" in "+t:"")),ct.ERR_DEPRECATED);return t&&!ye[i]&&(ye[i]=!0),!n||n(r,i,o)}},we.spelling=function(n){return(n,t)=>!0};var ge={assertOptions:function(n,t,e){if("object"!=typeof n)throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let i=r.length;for(;i-- >0;){const o=r[i],u=t[o];if(u){const t=n[o],e=void 0===t||u(t,o,n);if(!0!==e)throw new ct("option "+o+" must be "+e,ct.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new ct("Unknown option "+o,ct.ERR_BAD_OPTION)}},validators:we};const ke=ge.validators;class xe{constructor(n){this.defaults=n,this.interceptors={request:new kt,response:new kt}}async request(n,t){try{return await this.k(n,t)}catch(n){if(n instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();const e=t.stack?t.stack.replace(/^.+\n/,""):"";try{n.stack?e&&!(n.stack+"").endsWith(e.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+e):n.stack=e}catch(n){}}throw n}}k(n,t){"string"==typeof n?(t=t||{}).url=n:t=n||{},t=Yt(this.defaults,t);const{transitional:e,paramsSerializer:r,headers:i}=t;void 0!==e&&ge.assertOptions(e,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=r&&(st.isFunction(r)?t.paramsSerializer={serialize:r}:ge.assertOptions(r,{encode:ke.function,serialize:ke.function},!0)),ge.assertOptions(t,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&st.merge(i.common,i[t.method]);i&&st.forEach(["delete","get","head","post","put","patch","common"],(n=>{delete i[n]})),t.headers=Bt.concat(o,i);const u=[];let s=!0;this.interceptors.request.forEach((function(n){"function"==typeof n.runWhen&&!1===n.runWhen(t)||(s=s&&n.synchronous,u.unshift(n.fulfilled,n.rejected))}));const c=[];let a;this.interceptors.response.forEach((function(n){c.push(n.fulfilled,n.rejected)}));let f,h=0;if(!s){const n=[be.bind(this),void 0];for(n.unshift.apply(n,u),n.push.apply(n,c),f=n.length,a=Promise.resolve(t);h<f;)a=a.then(n[h++],n[h++]);return a}f=u.length;let l=t;for(h=0;h<f;){const n=u[h++],t=u[h++];try{l=n(l)}catch(n){t.call(this,n);break}}try{a=be(l)}catch(n){return Promise.reject(n)}for(h=0,f=c.length;h<f;)a=a.then(c[h++],c[h++]);return a}getUri(n){return gt(Xt((n=Yt(this.defaults,n)).baseURL,n.url),n.params,n.paramsSerializer)}}st.forEach(["delete","get","head","options"],(function(n){xe.prototype[n]=function(t,e){return this.request(Yt(e||{},{method:n,url:t,data:(e||{}).data}))}})),st.forEach(["post","put","patch"],(function(n){function t(t){return function(e,r,i){return this.request(Yt(i||{},{method:n,headers:t?{"Content-Type":"multipart/form-data"}:{},url:e,data:r}))}}xe.prototype[n]=t(),xe.prototype[n+"Form"]=t(!0)}));var Oe=xe;class Se{constructor(n){if("function"!=typeof n)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(n){t=n}));const e=this;this.promise.then((n=>{if(!e.O)return;let t=e.O.length;for(;t-- >0;)e.O[t](n);e.O=null})),this.promise.then=n=>{let t;const r=new Promise((n=>{e.subscribe(n),t=n})).then(n);return r.cancel=function(){e.unsubscribe(t)},r},n((function(n,r,i){e.reason||(e.reason=new Ht(n,r,i),t(e.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){this.reason?n(this.reason):this.O?this.O.push(n):this.O=[n]}unsubscribe(n){if(!this.O)return;const t=this.O.indexOf(n);-1!==t&&this.O.splice(t,1)}toAbortSignal(){const n=new AbortController,t=t=>{n.abort(t)};return this.subscribe(t),n.signal.unsubscribe=()=>this.unsubscribe(t),n.signal}static source(){let n;return{token:new Se((function(t){n=t})),cancel:n}}}var _e=Se;const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach((([n,t])=>{je[t]=n}));var Ee=je;const Re=function n(t){const e=new Oe(t),r=bn(Oe.prototype.request,e);return st.extend(r,Oe.prototype,e,{allOwnKeys:!0}),st.extend(r,e,null,{allOwnKeys:!0}),r.create=function(e){return n(Yt(t,e))},r}(Nt);Re.Axios=Oe,Re.CanceledError=Ht,Re.CancelToken=_e,Re.isCancel=zt,Re.VERSION="1.7.9",Re.toFormData=pt,Re.AxiosError=ct,Re.Cancel=Re.CanceledError,Re.all=function(n){return Promise.all(n)},Re.spread=function(n){return function(t){return n.apply(null,t)}},Re.isAxiosError=function(n){return st.isObject(n)&&!0===n.isAxiosError},Re.mergeConfig=Yt,Re.AxiosHeaders=Bt,Re.formToJSON=n=>Pt(st.isHTMLForm(n)?new FormData(n):n),Re.getAdapter=pe,Re.HttpStatusCode=Ee,Re.default=Re;var Te=Re,Pe=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ae=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ne=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(mn,"t",{value:!0});var Ce=Ne(Te),Me=h,Ue=Ne(d),qe=!0,De=function(){function n(n){this.configuration=n,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return n.prototype.get=function(n,t,e){void 0===t&&(t={});var r=void 0===e?{}:e,i=r.abortSignal,o=void 0===i?null:i,u=r.responseType,s=void 0===u?void 0:u;return Pe(this,void 0,void 0,(function(){return Ae(this,(function(e){return[2,this.performRequest("get",n,{queryParameters:t,abortSignal:o,responseType:s})]}))}))},n.prototype.delete=function(n,t){return void 0===t&&(t={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(e){return[2,this.performRequest("delete",n,{queryParameters:t})]}))}))},n.prototype.post=function(n,t,e,r){return void 0===t&&(t={}),void 0===e&&(e={}),void 0===r&&(r={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(i){return[2,this.performRequest("post",n,{queryParameters:e,bodyParameters:t,additionalHeaders:r})]}))}))},n.prototype.put=function(n,t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(r){return[2,this.performRequest("put",n,{queryParameters:e,bodyParameters:t})]}))}))},n.prototype.patch=function(n,t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(r){return[2,this.performRequest("patch",n,{queryParameters:e,bodyParameters:t})]}))}))},n.prototype.performRequest=function(n,t,e){var r,i,o,u=e.queryParameters,s=void 0===u?null:u,c=e.bodyParameters,a=void 0===c?null:c,f=e.additionalHeaders,h=void 0===f?{}:f,l=e.abortSignal,d=void 0===l?null:l,v=e.responseType,p=void 0===v?void 0:v,m=e.skipConnectionTimeout,b=void 0!==m&&m;return Pe(this,void 0,void 0,(function(){var e,u,c,f,l,v;return Ae(this,(function(m){switch(m.label){case 0:this.configuration.validate(),e=Date.now(),this.logger.debug("Request #".concat(e,": Performing ").concat(n.toUpperCase()," request: ").concat(t)),c=function(c){var l,v,m,w,y,g,k;return Ae(this,(function(x){switch(x.label){case 0:if(l=f.getNextNode(e),f.logger.debug("Request #".concat(e,": Attempting ").concat(n.toUpperCase()," request Try #").concat(c," to Node ").concat(l.index)),d&&d.aborted)return[2,{value:Promise.reject(Error("Request aborted by caller."))}];v=void 0,x.label=1;case 1:return x.trys.push([1,3,5,6]),m={method:n,url:f.uriFor(t,l),headers:Object.assign({},f.defaultHeaders(),h,f.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:p,validateStatus:function(n){return n>0},transformResponse:[function(n,t){var e=n;return void 0!==t&&"string"==typeof n&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(e=JSON.parse(n)),e}]},!0!==b&&(m.timeout=1e3*f.connectionTimeoutSeconds),s&&0!==Object.keys(s).length&&(m.params=s),f.sendApiKeyAsQueryParam&&(m.params=m.params||{},m.params["x-typesense-api-key"]=f.apiKey),f.configuration.httpAgent&&(f.logger.debug("Request #".concat(e,": Using custom httpAgent")),m.httpAgent=f.configuration.httpAgent),f.configuration.httpsAgent&&(f.logger.debug("Request #".concat(e,": Using custom httpsAgent")),m.httpsAgent=f.configuration.httpsAgent),a&&("string"==typeof a&&0!==a.length||"object"==typeof a&&0!==Object.keys(a).length)&&(m.data=a),d&&(w=Ce.default.CancelToken,y=w.source(),v=function(){return y.cancel()},d.addEventListener("abort",v),m.cancelToken=y.token),[4,(0,Ce.default)(m)];case 2:if((g=x.sent()).status>=1&&g.status<=499&&f.setNodeHealthcheck(l,qe),f.logger.debug("Request #".concat(e,": Request to Node ").concat(l.index," was made. Response Code was ").concat(g.status,".")),g.status>=200&&g.status<300)return[2,{value:Promise.resolve(g.data)}];if(g.status<500)return[2,{value:Promise.reject(f.customErrorForResponse(g,null===(r=g.data)||void 0===r?void 0:r.message))}];throw f.customErrorForResponse(g,null===(i=g.data)||void 0===i?void 0:i.message);case 3:return k=x.sent(),f.setNodeHealthcheck(l,!1),u=k,f.logger.warn("Request #".concat(e,": Request to Node ").concat(l.index,' failed due to "').concat(k.code," ").concat(k.message).concat(null==k.response?"":" - "+JSON.stringify(null===(o=k.response)||void 0===o?void 0:o.data),'"')),f.logger.warn("Request #".concat(e,": Sleeping for ").concat(f.retryIntervalSeconds,"s and then retrying request...")),[4,f.timer(f.retryIntervalSeconds)];case 4:return x.sent(),[3,6];case 5:return d&&v&&d.removeEventListener("abort",v),[7];case 6:return[2]}}))},f=this,l=1,m.label=1;case 1:return l<=this.numRetriesPerRequest+1?[5,c(l)]:[3,4];case 2:if("object"==typeof(v=m.sent()))return[2,v.value];m.label=3;case 3:return l++,[3,1];case 4:return this.logger.debug("Request #".concat(e,": No retries left. Raising last error")),[2,Promise.reject(u)]}}))}))},n.prototype.getNextNode=function(n){if(void 0===n&&(n=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(n,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,n))return this.logger.debug("Request #".concat(n,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(n,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(n,": Nodes Health: ").concat(this.nodes.map((function(n){return"Node ".concat(n.index," is ").concat(!0===n.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],e=0;e<=this.nodes.length;e++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,n))return this.logger.debug("Request #".concat(n,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(n,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},n.prototype.nodeDueForHealthcheck=function(n,t){void 0===t&&(t=0);var e=Date.now()-n.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return e&&this.logger.debug("Request #".concat(t,": Node ").concat(n.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),e},n.prototype.initializeMetadataForNodes=function(){var n=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,qe)),this.nodes.forEach((function(t,e){t.index=e,n.setNodeHealthcheck(t,qe)}))},n.prototype.setNodeHealthcheck=function(n,t){n.isHealthy=t,n.lastAccessTimestamp=Date.now()},n.prototype.uriFor=function(n,t){return null!=t.url?"".concat(t.url).concat(n):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(n)},n.prototype.defaultHeaders=function(){var n={};return this.sendApiKeyAsQueryParam||(n["X-TYPESENSE-API-KEY"]=this.apiKey),n["Content-Type"]="application/json",n},n.prototype.timer=function(n){return Pe(this,void 0,void 0,(function(){return Ae(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*n)}))]}))}))},n.prototype.customErrorForResponse=function(n,t){var e="Request failed with HTTP code ".concat(n.status);"string"==typeof t&&""!==t.trim()&&(e+=" | Server said: ".concat(t));var r=new Ue.default(e);return(r=400===n.status?new Me.RequestMalformed(e):401===n.status?new Me.RequestUnauthorized(e):404===n.status?new Me.ObjectNotFound(e):409===n.status?new Me.ObjectAlreadyExists(e):422===n.status?new Me.ObjectUnprocessable(e):n.status>=500&&n.status<=599?new Me.ServerError(e):new Me.HTTPError(e)).httpStatus=n.status,r},n}();mn.default=De;var Fe={},Be=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Le=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Fe,"t",{value:!0});var ze="/collections",He=function(){function n(n){this.apiCall=n}return n.prototype.create=function(n,t){return void 0===t&&(t={}),Be(this,void 0,void 0,(function(){return Le(this,(function(e){return[2,this.apiCall.post(ze,n,t)]}))}))},n.prototype.retrieve=function(){return Be(this,void 0,void 0,(function(){return Le(this,(function(n){return[2,this.apiCall.get(ze)]}))}))},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return ze},enumerable:!1,configurable:!0}),n}();Fe.default=He;var Ie={},Ge={},Je={},$e={},Ke=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},We=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Xe=n&&n.j||function(n,t,e){if(e||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return n.concat(r||Array.prototype.slice.call(t))};Object.defineProperty($e,"t",{value:!0});var Ve=function(){function n(){this.responseCache=new Map,this.responsePromiseCache=new Map}return n.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},n.prototype.perform=function(n,t,e,r){return Ke(this,void 0,void 0,(function(){var i,o,u,s,c,a,f,h,l,d,v;return We(this,(function(p){switch(p.label){case 0:if(i=r.cacheResponseForSeconds,o=void 0===i?120:i,u=r.maxSize,s=void 0===u?100:u,o<=0||s<=0)return[2,t.call.apply(t,Xe([n],e,!1))];if(c=JSON.stringify(e),a=this.responseCache.get(c),f=Date.now(),a){if(f-a.requestTimestamp<1e3*o)return this.responseCache.delete(c),this.responseCache.set(c,a),[2,Promise.resolve(a.response)];this.responseCache.delete(c)}if(h=this.responsePromiseCache.get(c)){if(f-h.requestTimestamp<1e3*o)return this.responsePromiseCache.delete(c),this.responsePromiseCache.set(c,h),[2,h.responsePromise];this.responsePromiseCache.delete(c)}return l=t.call.apply(t,Xe([n],e,!1)),this.responsePromiseCache.set(c,{requestTimestamp:f,responsePromise:l}),[4,l];case 1:return d=p.sent(),this.responseCache.set(c,{requestTimestamp:f,response:d}),this.responseCache.size>s&&(v=this.responseCache.keys().next().value,this.responseCache.delete(v)),this.responsePromiseCache.size>s&&(v=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(v)),[2,d]}}))}))},n}();$e.default=Ve;var Ye=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ze=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Qe=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Je,"t",{value:!0}),Je.SearchOnlyDocuments=void 0;var nr=Qe($e),tr=Qe(Fe),er="/documents",rr=function(){function n(n,t,e){this.collectionName=n,this.apiCall=t,this.configuration=e,this.requestWithCache=new nr.default}return n.prototype.clearCache=function(){this.requestWithCache.clearCache()},n.prototype.search=function(n,t){var e=void 0===t?{}:t,r=e.cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,o=e.abortSignal,u=void 0===o?null:o;return Ye(this,void 0,void 0,(function(){var t,e,r;return Ze(this,(function(o){for(e in t={},!0===this.configuration.useServerSideSearchCache&&(t.use_cache=!0),n)Array.isArray(n[e])&&(t[e]=n[e].join(","));return r=Object.assign({},n,t),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),r,{abortSignal:u}],{cacheResponseForSeconds:i})]}))}))},n.prototype.endpointPath=function(n){return"".concat(tr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(er).concat(void 0===n?"":"/"+n)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return er},enumerable:!1,configurable:!0}),n}();Je.SearchOnlyDocuments=rr;var ir=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),or=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ur=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ge,"t",{value:!0});var sr=h,cr=function(n){function t(t,e,r){return n.call(this,t,e,r)||this}return ir(t,n),t.prototype.create=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){if(!n)throw Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),n,t)]}))}))},t.prototype.upsert=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){if(!n)throw Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),n,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){if(!n)throw Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),n,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),n,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return ur(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),n)]}))}))},t.prototype.createMany=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(n,t)]}))}))},t.prototype.import=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){var e,r,i,o;return ur(this,(function(u){switch(u.label){case 0:if(Array.isArray(n))try{e=n.map((function(n){return JSON.stringify(n)})).join("\n")}catch(n){if(RangeError instanceof n&&(null==n?void 0:n.includes("Too many properties to enumerate")))throw Error("".concat(n,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw Error(n)}else e=n;return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:t,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:if(r=u.sent(),Array.isArray(n)){if(i=r.split("\n").map((function(n){return JSON.parse(n)})),(o=i.filter((function(n){return!1===n.success}))).length>0)throw new sr.ImportError("".concat(i.length-o.length," documents imported successfully, ").concat(o.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i);return[2,i]}return[2,r]}}))}))},t.prototype.export=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return ur(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),n)]}))}))},t.prototype.exportStream=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return ur(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),n,{responseType:"stream"})]}))}))},t}(Je.SearchOnlyDocuments);Ge.default=cr;var ar={},fr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},hr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},lr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(ar,"t",{value:!0});var dr=lr(Fe),vr=function(){function n(n,t){this.collectionName=n,this.apiCall=t}return n.prototype.upsert=function(n,t){return fr(this,void 0,void 0,(function(){return hr(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return fr(this,void 0,void 0,(function(){return hr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(dr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),n}();ar.default=vr;var pr={},mr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},br=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},wr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(pr,"t",{value:!0});var yr=wr(Fe),gr=wr(ar),kr=function(){function n(n,t,e){this.collectionName=n,this.overrideId=t,this.apiCall=e}return n.prototype.retrieve=function(){return mr(this,void 0,void 0,(function(){return br(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return mr(this,void 0,void 0,(function(){return br(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(yr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(gr.default.RESOURCEPATH,"/").concat(this.overrideId)},n}();pr.default=kr;var xr={},Or=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Sr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},_r=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(xr,"t",{value:!0});var jr=_r(Fe),Er=function(){function n(n,t){this.collectionName=n,this.apiCall=t}return n.prototype.upsert=function(n,t){return Or(this,void 0,void 0,(function(){return Sr(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return Or(this,void 0,void 0,(function(){return Sr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(jr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),n}();xr.default=Er;var Rr={},Tr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Pr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ar=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Rr,"t",{value:!0});var Nr=Ar(Fe),Cr=Ar(xr),Mr=function(){function n(n,t,e){this.collectionName=n,this.synonymId=t,this.apiCall=e}return n.prototype.retrieve=function(){return Tr(this,void 0,void 0,(function(){return Pr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Tr(this,void 0,void 0,(function(){return Pr(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Nr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(Cr.default.RESOURCEPATH,"/").concat(this.synonymId)},n}();Rr.default=Mr;var Ur={},qr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Dr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Fr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ur,"t",{value:!0}),Ur.Document=void 0;var Br=Fr(Fe),Lr=Fr(Ge),zr=function(){function n(n,t,e){this.collectionName=n,this.documentId=t,this.apiCall=e}return n.prototype.retrieve=function(){return qr(this,void 0,void 0,(function(){return Dr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return qr(this,void 0,void 0,(function(){return Dr(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.update=function(n,t){return void 0===t&&(t={}),qr(this,void 0,void 0,(function(){return Dr(this,(function(e){return[2,this.apiCall.patch(this.endpointPath(),n,t)]}))}))},n.prototype.endpointPath=function(){return"".concat(Br.default.RESOURCEPATH,"/").concat(this.collectionName).concat(Lr.default.RESOURCEPATH,"/").concat(this.documentId)},n}();Ur.Document=zr;var Hr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ir=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Gr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ie,"t",{value:!0});var Jr=Gr(Fe),$r=Gr(Ge),Kr=h,Wr=Gr(ar),Xr=Gr(pr),Vr=Gr(xr),Yr=Gr(Rr),Zr=Ur,Qr=function(){function n(n,t,e){this.name=n,this.apiCall=t,this.configuration=e,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=n,this.apiCall=t,this.configuration=e,this.R=new $r.default(this.name,this.apiCall,this.configuration),this.T=new Wr.default(this.name,this.apiCall),this.P=new Vr.default(this.name,this.apiCall)}return n.prototype.retrieve=function(){return Hr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.update=function(n){return Hr(this,void 0,void 0,(function(){return Ir(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),n)]}))}))},n.prototype.delete=function(){return Hr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.exists=function(){return Hr(this,void 0,void 0,(function(){var n;return Ir(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((n=t.sent())instanceof Kr.ObjectNotFound)return[2,!1];throw n;case 3:return[2]}}))}))},n.prototype.documents=function(n){return n?(void 0===this.individualDocuments[n]&&(this.individualDocuments[n]=new Zr.Document(this.name,n,this.apiCall)),this.individualDocuments[n]):this.R},n.prototype.overrides=function(n){return void 0===n?this.T:(void 0===this.individualOverrides[n]&&(this.individualOverrides[n]=new Xr.default(this.name,n,this.apiCall)),this.individualOverrides[n])},n.prototype.synonyms=function(n){return void 0===n?this.P:(void 0===this.individualSynonyms[n]&&(this.individualSynonyms[n]=new Yr.default(this.name,n,this.apiCall)),this.individualSynonyms[n])},n.prototype.endpointPath=function(){return"".concat(Jr.default.RESOURCEPATH,"/").concat(this.name)},n}();Ie.default=Qr;var ni={},ti=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ei=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(ni,"t",{value:!0});var ri="/aliases",ii=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return ti(this,void 0,void 0,(function(){return ei(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return ti(this,void 0,void 0,(function(){return ei(this,(function(n){return[2,this.apiCall.get(ri)]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH,"/").concat(t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return ri},enumerable:!1,configurable:!0}),n}();ni.default=ii;var oi={},ui=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},si=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ci=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(oi,"t",{value:!0});var ai=ci(ni),fi=function(){function n(n,t){this.name=n,this.apiCall=t}return n.prototype.retrieve=function(){return ui(this,void 0,void 0,(function(){return si(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return ui(this,void 0,void 0,(function(){return si(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(ai.default.RESOURCEPATH,"/").concat(this.name)},n}();oi.default=fi;var hi={};const li=t(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var di=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},vi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(hi,"t",{value:!0});var pi=li,mi="/keys",bi=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.create=function(t){return di(this,void 0,void 0,(function(){return vi(this,(function(e){return[2,this.apiCall.post(n.RESOURCEPATH,t)]}))}))},n.prototype.retrieve=function(){return di(this,void 0,void 0,(function(){return vi(this,(function(n){return[2,this.apiCall.get(mi)]}))}))},n.prototype.generateScopedSearchKey=function(n,t){var e=JSON.stringify(t),r=Buffer.from((0,pi.createHmac)("sha256",n).update(e).digest("base64")),i=n.substr(0,4),o="".concat(r).concat(i).concat(e);return Buffer.from(o).toString("base64")},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return mi},enumerable:!1,configurable:!0}),n}();hi.default=bi;var wi={},yi=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},gi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ki=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(wi,"t",{value:!0});var xi=ki(hi),Oi=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.retrieve=function(){return yi(this,void 0,void 0,(function(){return gi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return yi(this,void 0,void 0,(function(){return gi(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(xi.default.RESOURCEPATH,"/").concat(this.id)},n}();wi.default=Oi;var Si={},_i=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ji=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Si,"t",{value:!0});var Ei=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return _i(this,void 0,void 0,(function(){return ji(this,(function(n){return[2,this.apiCall.get("/debug")]}))}))},n}();Si.default=Ei;var Ri={},Ti=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Pi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ri,"t",{value:!0});var Ai=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Ti(this,void 0,void 0,(function(){return Pi(this,(function(n){return[2,this.apiCall.get("/metrics.json")]}))}))},n}();Ri.default=Ai;var Ni={},Ci=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Mi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ni,"t",{value:!0});var Ui=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Ci(this,void 0,void 0,(function(){return Mi(this,(function(n){return[2,this.apiCall.get("/health")]}))}))},n}();Ni.default=Ui;var qi={},Di=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Fi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(qi,"t",{value:!0});var Bi=function(){function n(n){this.apiCall=n}return n.prototype.perform=function(n,t){return void 0===t&&(t={}),Di(this,void 0,void 0,(function(){return Fi(this,(function(e){return[2,this.apiCall.post("".concat("/operations","/").concat(n),{},t)]}))}))},n}();qi.default=Bi;var Li={},zi=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Hi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ii=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Li,"t",{value:!0});var Gi=Ii($e),Ji=function(){function n(n,t,e){void 0===e&&(e=!1),this.apiCall=n,this.configuration=t,this.useTextContentType=e,this.requestWithCache=new Gi.default}return n.prototype.clearCache=function(){this.requestWithCache.clearCache()},n.prototype.perform=function(n,t,e){void 0===t&&(t={});var r=(void 0===e?{}:e).cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r;return zi(this,void 0,void 0,(function(){var e,r,o;return Hi(this,(function(u){return e={},this.useTextContentType&&(e["content-type"]="text/plain"),r={},!0===this.configuration.useServerSideSearchCache&&(r.use_cache=!0),o=Object.assign({},t,r),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",n,o,e],{cacheResponseForSeconds:i})]}))}))},n}();Li.default=Ji;var $i={},Ki=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Wi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty($i,"t",{value:!0});var Xi=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return Ki(this,void 0,void 0,(function(){return Wi(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return Ki(this,void 0,void 0,(function(){return Wi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),n}();$i.default=Xi;var Vi={},Yi=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Zi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Qi=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Vi,"t",{value:!0});var no=Qi($i),to=function(){function n(n,t){this.presetId=n,this.apiCall=t}return n.prototype.retrieve=function(){return Yi(this,void 0,void 0,(function(){return Zi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Yi(this,void 0,void 0,(function(){return Zi(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(no.default.RESOURCEPATH,"/").concat(this.presetId)},n}();Vi.default=to;var eo={},ro={},io=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},oo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(ro,"t",{value:!0});var uo=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.upsert=function(n,t){return io(this,void 0,void 0,(function(){return oo(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return io(this,void 0,void 0,(function(){return oo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),n}();ro.default=uo;var so={},co=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ao=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},fo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(so,"t",{value:!0});var ho=fo(ro),lo=function(){function n(n,t){this.name=n,this.apiCall=t}return n.prototype.retrieve=function(){return co(this,void 0,void 0,(function(){return ao(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return co(this,void 0,void 0,(function(){return ao(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(ho.default.RESOURCEPATH,"/").concat(this.name)},n}();so.default=lo;var vo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(eo,"t",{value:!0});var po=vo(ro),mo=vo(so),bo=function(){function n(n){this.apiCall=n,this.individualAnalyticsRules={},this.apiCall=n,this.A=new po.default(this.apiCall)}return n.prototype.rules=function(n){return void 0===n?this.A:(void 0===this.individualAnalyticsRules[n]&&(this.individualAnalyticsRules[n]=new mo.default(n,this.apiCall)),this.individualAnalyticsRules[n])},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),n}();eo.default=bo;var wo={},yo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},go=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(wo,"t",{value:!0});var ko=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return yo(this,void 0,void 0,(function(){return go(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return yo(this,void 0,void 0,(function(){return go(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),n}();wo.default=ko;var xo={},Oo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},So=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},_o=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(xo,"t",{value:!0});var jo=_o(wo),Eo=function(){function n(n,t){this.stopwordId=n,this.apiCall=t}return n.prototype.retrieve=function(){return Oo(this,void 0,void 0,(function(){return So(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Oo(this,void 0,void 0,(function(){return So(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(jo.default.RESOURCEPATH,"/").concat(this.stopwordId)},n}();xo.default=Eo;var Ro={},To={},Po=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ao=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(To,"t",{value:!0});var No=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.create=function(n){return Po(this,void 0,void 0,(function(){return Ao(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),n)]}))}))},n.prototype.retrieve=function(){return Po(this,void 0,void 0,(function(){return Ao(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),n}();To.default=No;var Co={},Mo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Uo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},qo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Co,"t",{value:!0});var Do=qo(To),Fo=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.update=function(n){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),n)]}))}))},n.prototype.retrieve=function(){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Do.default.RESOURCEPATH,"/").concat(this.id)},n}();Co.default=Fo;var Bo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Lo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},zo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ro,"t",{value:!0});var Ho=zo(To),Io=zo(Co),Go="/conversations",Jo=function(){function n(n){this.apiCall=n,this.individualConversationModels={},this.apiCall=n,this.N=new Ho.default(this.apiCall)}return n.prototype.retrieve=function(){return Bo(this,void 0,void 0,(function(){return Lo(this,(function(n){return[2,this.apiCall.get(Go)]}))}))},n.prototype.models=function(n){return void 0===n?this.N:(void 0===this.individualConversationModels[n]&&(this.individualConversationModels[n]=new Io.default(n,this.apiCall)),this.individualConversationModels[n])},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return Go},enumerable:!1,configurable:!0}),n}();Ro.default=Jo;var $o={},Ko=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Wo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Xo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty($o,"t",{value:!0});var Vo=Xo(Ro),Yo=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.retrieve=function(){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.update=function(n){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),n)]}))}))},n.prototype.delete=function(){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Vo.default.RESOURCEPATH,"/").concat(this.id)},n}();$o.default=Yo;var Zo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(u,"t",{value:!0});var Qo=Zo(s),nu=Zo(mn),tu=Zo(Fe),eu=Zo(Ie),ru=Zo(ni),iu=Zo(oi),ou=Zo(hi),uu=Zo(wi),su=Zo(Si),cu=Zo(Ri),au=Zo(Ni),fu=Zo(qi),hu=Zo(Li),lu=Zo($i),du=Zo(Vi),vu=Zo(eo),pu=Zo(wo),mu=Zo(xo),bu=Zo(Ro),wu=Zo($o),yu=function(){function n(n){var t;n.sendApiKeyAsQueryParam=null!==(t=n.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new Qo.default(n),this.apiCall=new nu.default(this.configuration),this.debug=new su.default(this.apiCall),this.metrics=new cu.default(this.apiCall),this.health=new au.default(this.apiCall),this.operations=new fu.default(this.apiCall),this.multiSearch=new hu.default(this.apiCall,this.configuration),this.C=new tu.default(this.apiCall),this.individualCollections={},this.M=new ru.default(this.apiCall),this.individualAliases={},this.U=new ou.default(this.apiCall),this.individualKeys={},this.D=new lu.default(this.apiCall),this.individualPresets={},this.F=new pu.default(this.apiCall),this.individualStopwords={},this.analytics=new vu.default(this.apiCall),this.B=new bu.default(this.apiCall),this.individualConversations={}}return n.prototype.collections=function(n){return void 0===n?this.C:(void 0===this.individualCollections[n]&&(this.individualCollections[n]=new eu.default(n,this.apiCall,this.configuration)),this.individualCollections[n])},n.prototype.aliases=function(n){return void 0===n?this.M:(void 0===this.individualAliases[n]&&(this.individualAliases[n]=new iu.default(n,this.apiCall)),this.individualAliases[n])},n.prototype.keys=function(n){return void 0===n?this.U:(void 0===this.individualKeys[n]&&(this.individualKeys[n]=new uu.default(n,this.apiCall)),this.individualKeys[n])},n.prototype.presets=function(n){return void 0===n?this.D:(void 0===this.individualPresets[n]&&(this.individualPresets[n]=new du.default(n,this.apiCall)),this.individualPresets[n])},n.prototype.stopwords=function(n){return void 0===n?this.F:(void 0===this.individualStopwords[n]&&(this.individualStopwords[n]=new mu.default(n,this.apiCall)),this.individualStopwords[n])},n.prototype.conversations=function(n){return void 0===n?this.B:(void 0===this.individualConversations[n]&&(this.individualConversations[n]=new wu.default(n,this.apiCall)),this.individualConversations[n])},n}();u.default=yu;var gu={},ku={};Object.defineProperty(ku,"t",{value:!0}),ku.SearchOnlyCollection=void 0;var xu=Je,Ou=function(){function n(n,t,e){this.name=n,this.apiCall=t,this.configuration=e,this.R=new xu.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return n.prototype.documents=function(){return this.R},n}();ku.SearchOnlyCollection=Ou;var Su=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(gu,"t",{value:!0});var _u=Su(s),ju=Su(mn),Eu=Su(Li),Ru=ku,Tu=function(){function n(n){var t;n.sendApiKeyAsQueryParam=null===(t=n.sendApiKeyAsQueryParam)||void 0===t||t,!0===n.sendApiKeyAsQueryParam&&(n.apiKey||"").length>2e3&&(n.sendApiKeyAsQueryParam=!1),this.configuration=new _u.default(n),this.apiCall=new ju.default(this.configuration),this.multiSearch=new Eu.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return n.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(n){n[0],n[1].documents().clearCache()}))},n.prototype.collections=function(n){if(n)return void 0===this.individualCollections[n]&&(this.individualCollections[n]=new Ru.SearchOnlyCollection(n,this.apiCall,this.configuration)),this.individualCollections[n];throw Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},n}();gu.default=Tu;var Pu=n&&n.h||(Object.create?function(n,t,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.t:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,r,i)}:function(n,t,e,r){void 0===r&&(r=e),n[r]=t[e]}),Au=n&&n.l||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),Nu=n&&n.v||function(n){if(n&&n.t)return n;var t={};if(null!=n)for(var e in n)"default"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&Pu(t,n,e);return Au(t,n),t},Cu=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(o,"t",{value:!0}),o.Errors=o.SearchClient=o.Client=void 0;var Mu=Cu(u);o.Client=Mu.default;var Uu=Cu(gu);o.SearchClient=Uu.default;var qu=Nu(h);o.Errors=qu;var Du=o.default={Client:Mu.default,SearchClient:Uu.default,Errors:qu};!function(){let n=!1,t=null;function e(){if(!n)return;const t=document.querySelector("script[data-sodo-search]");t&&t.remove();const e=document.getElementById("sodo-search-root");e&&e.remove()}class r{constructor(t={}){if(n)return window.magicPagesSearch;this.isModalOpen=!1;const e=window.__MP_SEARCH_CONFIG__||{typesenseNodes:[{host:"localhost",port:"8108",protocol:"http"}],typesenseApiKey:null,collectionName:null,commonSearches:[],theme:"system",searchFields:{title:{weight:4,highlight:!0},excerpt:{weight:2,highlight:!0},html:{weight:1,highlight:!0}}};if(this.config={commonSearches:[],...t,...e,commonSearches:t.commonSearches||e.commonSearches||[]},!this.config.typesenseNodes||!this.config.typesenseApiKey||!this.config.collectionName)throw Error("MagicPagesSearch: Missing required Typesense configuration");this.selectedIndex=-1,this.searchDebounceTimeout=null,this.cachedElements={},this.init(),n=!0}getParentAccentColor(){try{return window.getComputedStyle(document.documentElement).getPropertyValue("--ghost-accent-color").trim()||null}catch(n){return null}}updateDarkMode(){const n=window.matchMedia("(prefers-color-scheme: dark)").matches;this.doc&&this.doc.documentElement.classList.toggle("dark",n)}async createIframe(){this.iframe=document.createElement("iframe");const n=window.innerWidth<640?3999999:3999997;this.iframe.style.cssText=`\n border: none;\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${n};\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);\n `,window.addEventListener("resize",(()=>{const n=window.innerWidth<640;this.iframe.style.zIndex=n?3999999:3999997})),document.body||await new Promise((n=>{const t=new MutationObserver((()=>{document.body&&(t.disconnect(),n())}));t.observe(document.documentElement,{childList:!0})})),document.body.appendChild(this.iframe),this.doc=this.iframe.contentDocument||this.iframe.contentWindow.document;const t=this.getParentAccentColor(),e=t?`\n :root {\n --ghost-accent-color: ${t};\n }`:"";this.doc.open(),this.doc.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <style>${e}</style>\n <style>/* Base document styles for iframe */\n:root {\n /* Color system */\n --color-base-50: 255 255 255;\n --color-base-100: 250 250 250;\n --color-base-200: 229 231 235;\n --color-base-300: 209 213 219;\n --color-base-700: 55 65 81;\n --color-base-800: 31 41 55;\n --color-base-900: 17 24 39;\n --color-base-950: 3 7 18;\n\n /* Animation configs */\n --transition-base: 80ms cubic-bezier(0.4, 0, 0.2, 1);\n --transition-smooth: 120ms cubic-bezier(0.4, 0, 0.2, 1);\n --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* System/Default theme (light) */\n#mp-search-wrapper {\n --color-surface: rgb(252, 252, 252);\n --color-surface-elevated: rgb(255, 255, 255);\n --color-surface-hover: rgba(0, 0, 0, 0.04);\n --color-text: rgb(23, 23, 23);\n --color-text-secondary: rgb(82, 82, 82);\n --color-border: rgba(0, 0, 0, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.15);\n --accent-color: var(--ghost-accent-color, #6366f1);\n --accent-color-hover: color-mix(in srgb, black 15%, var(--accent-color));\n --color-result-bg: rgb(252, 252, 252);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n}\n\n/* Dark theme based on system preference */\n#mp-search-wrapper[data-theme="dark"] {\n --color-surface: rgb(32, 32, 32);\n --color-surface-elevated: rgb(45, 45, 45);\n --color-surface-hover: rgba(255, 255, 255, 0.04);\n --color-text: rgb(250, 250, 250);\n --color-text-secondary: rgb(161, 161, 161);\n --color-border: rgba(255, 255, 255, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.4);\n --accent-color: var(--ghost-accent-color, #818cf8);\n --accent-color-hover: color-mix(in srgb, white 15%, var(--accent-color));\n --color-result-bg: rgb(38, 38, 38);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n}\n\n/* Base resets for iframe document */\nhtml,\nbody {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.5;\n}\n\n/* Utility classes */\n.hidden {\n display: none !important;\n}\n\n/* List reset */\n.list-none {\n list-style: none !important;\n padding-left: 0;\n}\n\n/* Reset InstantSearch cancel button */\n.ais-SearchBox-input[type="search"]::-webkit-search-cancel-button {\n display: none;\n}\n\n/* Modal structure */\n#mp-search-wrapper {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n background-color: var(--color-backdrop);\n backdrop-filter: blur(4px);\n align-items: flex-start;\n justify-content: center;\n -webkit-tap-highlight-color: transparent;\n padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);\n /* Above subscribe button on mobile */\n z-index: 3999999;\n}\n\n@media (min-width: 640px) {\n #mp-search-wrapper {\n /* Below subscribe button on desktop */\n z-index: 3999997;\n }\n}\n\n#mp-search-modal {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 0;\n}\n\n@media (min-width: 640px) {\n #mp-search-modal {\n padding-top: 10vh;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n}\n\n#mp-search-modal.hidden {\n display: none;\n}\n\n/* Backdrop with glass effect */\n.mp-backdrop {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n backdrop-filter: blur(8px);\n background: var(--color-backdrop);\n transition: opacity var(--transition-smooth);\n}\n\n/* Modal container and content */\n.mp-modal-container {\n position: relative;\n z-index: 1;\n width: 100%;\n max-width: 42rem;\n margin: 0 auto;\n padding: 0;\n height: 100vh;\n display: flex;\n flex-direction: column;\n transition: transform 0.1s ease-out;\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n height: auto;\n max-height: 60vh;\n min-height: 20vh;\n }\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n }\n}\n\n.mp-modal-content {\n background: var(--color-surface);\n border: none;\n border-radius: 0;\n box-shadow: none;\n overflow: hidden;\n width: 100%;\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n /* Ensure content doesn't overflow viewport */\n max-height: 100%;\n}\n\n@media (min-width: 640px) {\n .mp-modal-content {\n border: 1px solid var(--color-border);\n border-radius: 0.75rem;\n box-shadow: var(--shadow-lg);\n }\n}\n\n\n\n.mp-results-container {\n overflow-y: auto;\n overscroll-behavior: contain;\n position: relative;\n scroll-behavior: smooth;\n padding: 0.5rem 0;\n -webkit-overflow-scrolling: touch;\n flex: 1;\n min-height: 0;\n background: var(--color-surface);\n}\n\n@media (min-width: 640px) {\n .mp-results-container {\n height: auto;\n max-height: calc(60vh - 4rem);\n padding-bottom: 1rem;\n }\n}\n\n/* Loading state */\n.mp-loading-state {\n display: none;\n padding: 2rem 1.25rem;\n text-align: center;\n color: var(--color-text-secondary);\n}\n\n.mp-loading-state.active {\n display: block;\n}\n\n.mp-loading-spinner {\n display: inline-block;\n width: 2rem;\n height: 2rem;\n margin-bottom: 1rem;\n border: 2px solid var(--color-border);\n border-top-color: var(--accent-color);\n border-radius: 50%;\n animation: mp-spin 0.8s linear infinite;\n}\n\n@keyframes mp-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Search header */\n.mp-search-header {\n align-items: center;\n border-bottom: 1px solid var(--color-border);\n padding: 0.75rem 1.25rem;\n position: relative;\n background: var(--color-surface-elevated);\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 1rem;\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding: 0.875rem 1.5rem;\n }\n}\n\n.mp-search-input {\n -webkit-appearance: none;\n background: transparent;\n border-radius: 0.75rem;\n border: 1px solid var(--color-border);\n box-shadow: var(--shadow-sm);\n color: var(--color-text);\n font-size: 1rem;\n height: 2.75rem;\n outline: none;\n padding: 0.75rem 0.75rem 0.75rem 2.75rem;\n width: 100%;\n transition: all var(--transition-smooth);\n background: var(--color-surface);\n letter-spacing: -0.011em;\n}\n\n/* Hide the search clear button */\n.mp-search-input::-webkit-search-cancel-button {\n -webkit-appearance: none;\n display: none;\n}\n\n@media (min-width: 640px) {\n .mp-search-input {\n font-size: 1.125rem;\n height: 3rem;\n padding: 0.875rem 0.875rem 0.875rem 3rem;\n }\n}\n\n.mp-search-input:focus,\n.mp-search-input:focus-visible {\n background: var(--color-surface);\n outline: none;\n border-color: var(--accent-color);\n box-shadow: 0 0 0 1px var(--accent-color);\n}\n\n.mp-search-input::placeholder {\n color: var(--color-text-secondary);\n opacity: 0.7;\n}\n\n.mp-search-header {\n position: relative;\n padding-right: 4.25rem;\n}\n\n.mp-search-header:before {\n content: "";\n background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(55, 65, 81)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");\n height: 1.125rem;\n width: 1.125rem;\n position: absolute;\n left: 2rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0.7;\n color: var(--color-text);\n pointer-events: none;\n z-index: 1;\n transition: opacity var(--transition-base);\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding-right: 0;\n }\n\n .mp-search-header:before {\n left: 2.4rem;\n top: 50%;\n }\n}\n\n#mp-search-wrapper[data-theme="dark"] .mp-search-header:before {\n background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(209, 213, 219)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");\n}\n\n/* Results container */\n.mp-results-container {\n flex: 1;\n overflow-y: auto;\n padding: 0.75rem calc(1.5rem - 6px) 0.75rem 1.5rem;\n scroll-behavior: smooth;\n min-height: 0;\n}\n\n.mp-results-container::-webkit-scrollbar {\n width: 6px;\n}\n\n.mp-results-container::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.mp-results-container::-webkit-scrollbar-thumb {\n background: var(--color-border);\n border-radius: 3px;\n}\n\n.mp-results-container> :last-child {\n margin-bottom: 0.75rem;\n}\n\n/* Common searches */\n.mp-common-searches {\n padding: 0.75rem 0;\n padding-right: 6px;\n margin: 0;\n}\n\n.mp-common-searches.hidden {\n display: none;\n}\n\n.mp-common-searches-title {\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.05em;\n margin: 0 0 0.75rem;\n text-transform: uppercase;\n}\n\n.mp-common-search-btn {\n background: transparent;\n border: none;\n color: var(--color-text);\n border-radius: 0.5rem;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: 100%;\n padding: 0.75rem 1rem;\n text-decoration: none;\n transition: all var(--transition-base);\n font-size: 0.875rem;\n text-align: left;\n border: 1px solid transparent;\n}\n\n.mp-common-search-btn:hover,\n.mp-common-search-btn.mp-selected {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n}\n\n.mp-hits-list {\n margin-block-start: 0.5rem;\n margin-block-end: 0.5rem;\n}\n\n/* Search result link wrapper */\n.mp-result-link {\n text-decoration: none;\n color: inherit;\n display: block;\n}\n\n/* Search results */\n.mp-result-item {\n border-radius: 0.75rem;\n display: block;\n margin: 0.5rem 0;\n padding: 1.25rem;\n text-decoration: none;\n transition: background-color var(--transition-base), transform var(--transition-base);\n border: 1px solid transparent;\n word-break: break-word;\n background: var(--color-result-bg);\n}\n\n.mp-result-link:hover .mp-result-item,\n.mp-result-link.mp-selected .mp-result-item,\n.mp-result-link:focus .mp-result-item {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n transform: translateX(2px);\n}\n\n.mp-result-title {\n color: var(--accent-color);\n font-size: 1.125rem;\n font-weight: 600;\n line-height: 1.4;\n margin-top: 0;\n margin-bottom: 0.5rem;\n word-break: break-word;\n transition: color var(--transition-base);\n}\n\n.mp-result-excerpt {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.6;\n margin: 0;\n word-break: break-word;\n}\n\n/* Keyboard hints */\n.mp-keyboard-hints {\n display: flex;\n align-items: center;\n font-size: 0.75rem;\n gap: 1rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n user-select: none;\n margin-right: 0.5rem;\n}\n\n.mp-kbd {\n background: var(--color-surface-elevated);\n border: 1px solid var(--color-border);\n border-radius: 0.375rem;\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n padding: 0.25rem 0.375rem;\n box-shadow: var(--shadow-sm);\n font-size: 0.75rem;\n font-weight: 500;\n padding: 0.25rem 0.5rem;\n box-shadow: var(--shadow-sm);\n margin: 0 0.25rem;\n}\n\n/* Empty state */\n.mp-empty-message {\n color: var(--color-text-secondary);\n font-size: 1rem;\n padding: 2.5rem 1.5rem;\n text-align: center;\n}\n\n/* Close button */\n.mp-close-button {\n position: fixed;\n top: 1.25rem;\n right: 1.5rem;\n width: 2rem;\n height: 2rem;\n border-radius: 9999px;\n border: 1px solid var(--color-border);\n background: var(--color-surface-elevated);\n color: var(--color-text-secondary);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all var(--transition-base);\n font-size: 1.25rem;\n line-height: 1;\n z-index: 50;\n padding: 0;\n}\n\n.mp-close-button:hover {\n background: var(--color-surface-hover);\n color: var(--color-text);\n border-color: var(--accent-color);\n}\n\n.mp-close-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--accent-color);\n border-color: var(--accent-color);\n}\n\n/* Highlight styles */\n.ais-Highlight-highlighted,\n.ais-Snippet-highlighted {\n background: none;\n background: color-mix(in srgb, var(--accent-color) 15%, transparent);\n color: color-mix(in srgb, var(--accent-color) 85%, var(--color-text));\n font-weight: 600;\n}\n\n/* Mobile optimizations */\n@media (max-width: 640px) {\n .mp-keyboard-hints {\n display: none;\n }\n\n .mp-modal-content {\n margin-top: 0;\n border-radius: 0;\n height: 100vh;\n }\n\n .mp-modal-container {\n padding: 0;\n margin: 0;\n }\n\n .mp-results-container {\n padding-bottom: 1.5rem;\n max-height: calc(100vh - 4rem);\n }\n}</style>\n </head>\n <body>\n <div id="mp-search-wrapper" data-theme="${this.config.theme}">\n <div id="mp-search-modal" class="hidden" role="dialog" aria-modal="true" aria-label="Search">\n <div class="mp-backdrop"></div>\n <div class="mp-modal-container">\n <button class="mp-close-button" aria-label="Close search">\n <span aria-hidden="true">×</span>\n </button>\n <div class="mp-modal-content">\n <div class="mp-search-header">\n <div id="mp-searchbox" role="search"></div>\n <div class="mp-keyboard-hints">\n <span>\n <kbd class="mp-kbd">↑↓</kbd>\n to navigate\n </span>\n <span>\n <kbd class="mp-kbd">esc</kbd>\n to close\n </span>\n </div>\n </div>\n <div class="mp-results-container">\n ${this.getCommonSearchesHtml()}\n <div id="mp-hits" role="region" aria-label="Search results"></div>\n <div id="mp-loading-state" class="mp-loading-state" role="status" aria-live="polite">\n <div class="mp-loading-spinner" aria-hidden="true"></div>\n <div>Searching...</div>\n </div>\n <div id="mp-empty-state" class="hidden" role="status" aria-live="polite">\n <div class="mp-empty-message">\n <p>No results found for your search</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </body>\n </html>\n `),this.doc.close(),this.modal=this.doc.getElementById("mp-search-modal"),this.wrapper=this.doc.getElementById("mp-search-wrapper"),this.cachedElements={modal:this.modal,wrapper:this.wrapper},this.updateDarkMode(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{this.updateDarkMode()})),new MutationObserver((()=>{this.updateDarkMode()})).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.visualViewport&&window.visualViewport.addEventListener("resize",(()=>{if(this.modal&&this.modal.classList.contains("hidden"))return;const n=this.doc.querySelector(".mp-modal-container");n&&(n.style.height=window.visualViewport.height+"px",n.style.transform=`translateY(${window.visualViewport.offsetTop}px)`)}))}getCommonSearchesHtml(){return this.config.commonSearches?.length?`\n <div class="mp-common-searches">\n <div class="mp-common-searches-title" role="heading" aria-level="2">\n Common searches\n </div>\n <div id="mp-common-searches-container" role="list">\n ${this.config.commonSearches.map((n=>`\n <button type="button" \n class="mp-common-search-btn" \n data-search="${n}"\n role="listitem">\n ${n}\n </button>\n `)).join("")}\n </div>\n </div>\n `:'\n <div class="mp-common-searches">\n <div class="mp-empty-message">Start typing to search...</div>\n </div>\n '}getSearchParameters(){const n=Object.keys(this.config.searchFields||{}).length>0?this.config.searchFields:{title:{weight:4,highlight:!0},excerpt:{weight:2,highlight:!0},html:{weight:1,highlight:!0}},t=[],e=[],r=[];return Object.entries(n).forEach((([n,i])=>{t.push(n),e.push(i.weight||1),i.highlight&&r.push(n)})),{query_by:t.join(","),query_by_weights:e.join(","),highlight_full_fields:r.join(","),highlight_affix_num_tokens:20,include_fields:"title,url,excerpt,html",typo_tolerance:!0,num_typos:2,prefix:!0,per_page:10}}async init(){await this.setupUI(),await this.setupSearch(),this.initEventListeners(),this.setupHashHandling(),await this.handleInitialState()}async setupUI(){this.createIframe(),this.handleThemeChange()}async setupSearch(){await this.initSearch()}setupHashHandling(){window.addEventListener("hashchange",(()=>this.syncWithHash()))}async handleInitialState(){await this.syncWithHash()}async syncWithHash(){const n="#/search"===window.location.hash;n!==this.isModalOpen&&await this.setModalState(n)}initSearch(){this.initWidgets(),this.searchInput&&(this.cachedElements.commonSearches=this.doc.querySelector(".mp-common-searches"),this.cachedElements.loadingState=this.doc.getElementById("mp-loading-state"))}async handleSearch(n){const{commonSearches:t,emptyState:e,loadingState:r}=this.cachedElements;if(n=n?.trim(),!n)return this.selectedIndex=-1,this.hitsList&&this.hitsList.classList.add("hidden"),t&&t.classList.remove("hidden"),e&&e.classList.add("hidden"),void(r&&r.classList.remove("active"));t&&t.classList.add("hidden"),this.hitsList&&this.hitsList.classList.remove("hidden"),r&&r.classList.add("active");try{this.typesenseClient||(this.typesenseClient=new Du.Client({nodes:this.config.typesenseNodes,apiKey:this.config.typesenseApiKey,connectionTimeoutSeconds:2}));const t=this.getSearchParameters(),i={q:n,query_by:t.query_by,query_by_weights:t.query_by_weights,highlight_full_fields:t.highlight_full_fields,highlight_affix_num_tokens:t.highlight_affix_num_tokens,include_fields:t.include_fields,typo_tolerance:t.typo_tolerance,num_typos:t.num_typos,prefix:t.prefix,per_page:t.per_page},o=await this.typesenseClient.collections(this.config.collectionName).documents().search(i);if(r&&r.classList.remove("active"),0===o.hits.length)return e&&e.classList.remove("hidden"),void(this.hitsList&&(this.hitsList.innerHTML="",this.hitsList.classList.add("hidden")));e&&e.classList.add("hidden"),this.hitsList&&(this.hitsList.innerHTML=o.hits.map((n=>{const t=document.createElement("div");t.innerHTML=n.document.excerpt||n.document.html||"";const e=(t.textContent||t.innerText||"").trim().substring(0,120).replace(/\s+[^\s]*$/,"..."),r=n.document.title||"Untitled";return`\n <a href="${n.document.url||"#"}" \n class="mp-result-link"\n aria-label="${r.replace(/<[^>]*>/g,"")}">\n <article class="mp-result-item" role="article">\n <h3 class="mp-result-title" role="heading" aria-level="3">${r}</h3>\n <p class="mp-result-excerpt" aria-label="Article excerpt">${e}</p>\n </article>\n </a>\n `})).join(""),this.hitsList.classList.remove("hidden"))}catch(n){r&&r.classList.remove("active"),e&&e.classList.remove("hidden"),this.hitsList&&(this.hitsList.innerHTML="",this.hitsList.classList.add("hidden"))}}initWidgets(){const n=this.doc.querySelector("#mp-searchbox");if(!n)return;n.innerHTML="";const t=this.doc.createElement("form");t.className="",t.setAttribute("novalidate",""),t.setAttribute("role","search");const e=this.doc.createElement("input");e.type="search",e.placeholder="Search for anything",e.className="mp-search-input",e.setAttribute("autocomplete","off"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false"),e.setAttribute("maxlength","512"),e.setAttribute("aria-label","Search"),t.appendChild(e),n.appendChild(t),this.searchInput=e,setTimeout((()=>e.focus()),0),t.addEventListener("submit",(n=>{n.preventDefault()})),e.addEventListener("input",(n=>{const t=n.target.value;this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout((()=>{this.handleSearch(t)}),80)})),this.searchInput=e,this.searchForm=t;const r=this.doc.querySelector("#mp-hits");if(!r)return;const i=this.doc.createElement("div");i.className="mp-hits-list list-none",r.appendChild(i),this.hitsList=i}initEventListeners(){const n=this.doc.querySelector(".mp-close-button");n&&n.addEventListener("click",(()=>this.closeModal())),this.modal.addEventListener("click",(n=>{(n.target===this.modal||n.target.classList.contains("mp-backdrop"))&&this.closeModal()}));const t=this.modal.querySelector(".mp-modal-content");t&&t.addEventListener("click",(n=>n.stopPropagation())),this.attachCommonSearchListeners(),document.addEventListener("keydown",(n=>{(n.metaKey||n.ctrlKey)&&"k"===n.key&&(n.preventDefault(),this.openModal()),"/"!==n.key||n.ctrlKey||n.metaKey||"INPUT"===n.target.tagName||"TEXTAREA"===n.target.tagName||(n.preventDefault(),this.openModal())})),this.doc.addEventListener("keydown",(n=>this.handleKeydown(n))),document.querySelectorAll("[data-ghost-search]").forEach((n=>{n.addEventListener("click",(n=>{n.preventDefault(),n.stopPropagation(),this.openModal()}))}));const e=this.doc.querySelector("#mp-hits");e&&e.addEventListener("click",(n=>{const t=n.target.closest(".mp-result-link");t&&(n.preventDefault(),window.location.href=t.href)}))}attachCommonSearchListeners(){const n=this.doc.getElementById("mp-common-searches-container");if(!n)return;const t=n=>{const t=n.target.closest(".mp-common-search-btn");if(!t)return;n.preventDefault();const e=t.dataset.search,r=this.doc.querySelector(".mp-search-input");r&&(this.selectedIndex=-1,r.value=e,r.dispatchEvent(new Event("input",{bubbles:!0})),this.search.helper.setQuery(e).search(),setTimeout((()=>{r.focus(),r.setSelectionRange(e.length,e.length)}),0))};n.addEventListener("click",t),n.addEventListener("touchend",t)}async setModalState(n,t={}){const{skipUrlUpdate:e=!1}=t;if(n&&!this.searchUI&&await this.initSearch(),n&&(await new Promise((n=>{const t=()=>{this.iframe&&this.doc&&"complete"===this.doc.readyState?n():setTimeout(t,10)};t()})),await new Promise((n=>setTimeout(n,50)))),this.iframe.style.pointerEvents=n?"auto":"none",this.iframe.style.opacity=n?"1":"0",this.modal.classList.toggle("hidden",!n),n){const n=this.doc.querySelector(".mp-search-input");n&&n.focus()}else this.selectedIndex=-1,this.searchInput&&(this.searchInput.value=""),this.handleSearch("");if(!e){const t=n?"#/search":"";window.location.hash!==t&&history.replaceState(null,null,t||window.location.pathname)}}async openModal(){await this.setModalState(!0)}closeModal(){this.setModalState(!1)}handleKeydown(n){if("Escape"===n.key)return n.preventDefault(),void this.closeModal();if(n.target===this.searchInput&&!(window.innerWidth<640))switch(n.key){case"ArrowDown":n.preventDefault(),this.navigateResults("next");break;case"ArrowUp":n.preventDefault(),this.navigateResults("prev");break;case"Enter":-1!==this.selectedIndex&&(n.preventDefault(),this.handleEnterKey())}}navigateResults(n){const t=[...this.doc.querySelectorAll(".mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((n=>null!==n.offsetParent&&!n.closest(".hidden")));if(0===t.length)return;-1===this.selectedIndex?this.selectedIndex="next"===n?0:t.length-1:this.selectedIndex="next"===n?(this.selectedIndex+1)%t.length:(this.selectedIndex-1+t.length)%t.length,t.forEach((n=>n.classList.remove("mp-selected")));const e=t[this.selectedIndex];e.classList.add("mp-selected"),e.scrollIntoView({block:"nearest",behavior:"auto"})}handleEnterKey(){const n=[...this.doc.querySelectorAll(".mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((n=>null!==n.offsetParent&&!n.closest(".hidden")));if(this.selectedIndex>=0&&this.selectedIndex<n.length){const t=n[this.selectedIndex];t.classList.contains("mp-result-link")?window.location.href=t.href:(this.searchInput.value=t.textContent.trim(),this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}}handleThemeChange(){if(this.wrapper&&(this.wrapper.classList.remove("dark"),this.wrapper.setAttribute("data-theme",this.config.theme),"system"===this.config.theme)){const n=window.matchMedia("(prefers-color-scheme: dark)"),t=n=>{this.wrapper.setAttribute("data-theme",n.matches?"dark":"light")};t(n),n.addEventListener("change",t)}}}function i(){!window.magicPagesSearch&&(window.__MP_SEARCH_CONFIG__||"#/search"===window.location.hash||document.querySelectorAll("[data-ghost-search]").length>0)&&(window.magicPagesSearch=new r,function(){t=new MutationObserver((t=>{if(n)for(const n of t)for(const t of n.addedNodes)1===t.nodeType&&("SCRIPT"===t.tagName&&t.hasAttribute("data-sodo-search")||"sodo-search-root"===t.id)&&t.remove()})),t.observe(document.documentElement,{childList:!0,subtree:!0});const r=setInterval(e,100);setTimeout((()=>{clearInterval(r),t&&(t.disconnect(),t=null)}),5e3)}())}window.MagicPagesSearch=r,new Promise((n=>{if(document.body)n();else{const t=new MutationObserver((()=>{document.body&&(t.disconnect(),n())}));t.observe(document.documentElement,{childList:!0})}})).then(i),"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",i)}()}();
1
+ !function(){var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(n){if(n.t)return n;var t=n.default;if("function"==typeof t){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"t",{value:!0}),Object.keys(n).forEach((function(t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})})),e}var e,r,i,o={},s={},u={},c={exports:{}};r=n,i=function(){var n=function(){},t="undefined",e=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function s(n,t){var e=n[t];if("function"==typeof e.bind)return e.bind(n);try{return Function.prototype.bind.call(e,n)}catch(t){return function(){return Function.prototype.apply.call(e,n,arguments)}}}function u(){console.log&&(console.log.apply||Function.prototype.apply.call(console.log,console,arguments))}function c(){for(var e=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<e?n:this.methodFactory(o,e,this.name)}if(this.log=this.debug,typeof console===t&&e<this.levels.SILENT)return"No console available for logging"}function a(n){return function(){typeof console!==t&&(c.call(this),this[n].apply(this,arguments))}}function f(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&e?u:void 0!==console[r]?s(console,r):void 0!==console.log?s(console,"log"):n)}(r)||a.apply(this,arguments)}function h(n,e){var s,u,a,h=this,l="loglevel";function d(){var n;if(typeof window!==t&&l){try{n=window.localStorage[l]}catch(n){}if(typeof n===t)try{var e=window.document.cookie,r=encodeURIComponent(l),i=e.indexOf(r+"=");-1!==i&&(n=/^([^;]+)/.exec(e.slice(i+r.length+1))[1])}catch(n){}return void 0===h.levels[n]&&(n=void 0),n}}function v(n){var t=n;if("string"==typeof t&&void 0!==h.levels[t.toUpperCase()]&&(t=h.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=h.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+n)}"string"==typeof n?l+=":"+n:"symbol"==typeof n&&(l=void 0),h.name=n,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=e||f,h.getLevel=function(){return null!=a?a:null!=u?u:s},h.setLevel=function(n,e){return a=v(n),!1!==e&&function(n){var e=(r[n]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=e)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"="+e+";"}catch(n){}}}(a),c.call(h)},h.setDefaultLevel=function(n){u=v(n),d()||h.setLevel(n,!1)},h.resetLevel=function(){a=null,function(){if(typeof window!==t&&l){try{window.localStorage.removeItem(l)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(n){}}}(),c.call(h)},h.enableAll=function(n){h.setLevel(h.levels.TRACE,n)},h.disableAll=function(n){h.setLevel(h.levels.SILENT,n)},h.rebuild=function(){if(o!==h&&(s=v(o.getLevel())),c.call(h),o===h)for(var n in i)i[n].rebuild()},s=v(o?o.getLevel():"WARN");var p=d();null!=p&&(a=v(p)),c.call(h)}(o=new h).getLogger=function(n){if("symbol"!=typeof n&&"string"!=typeof n||""===n)throw new TypeError("You must supply a name when creating a logger.");var t=i[n];return t||(t=i[n]=new h(n,o.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=l),o},o.getLoggers=function(){return i},o.default=o,o},(e=c).exports?e.exports=i():r.log=i();var a,f=c.exports,h={},l={},d={},v=n&&n.i||(a=function(n,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},a(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function e(){this.constructor=n}a(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(d,"t",{value:!0});var p=function(n){function t(t){var e=this.constructor,r=n.call(this,t)||this;return r.name=e.name,Object.setPrototypeOf(r,e.prototype),r}return v(t,n),t}(Error);d.default=p;var m=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),b=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(l,"t",{value:!0});var w=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return m(t,n),t}(b(d).default);l.default=w;var y={},g=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),k=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(y,"t",{value:!0});var x=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return g(t,n),t}(k(d).default);y.default=x;var _={},O=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),S=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(_,"t",{value:!0});var j=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return O(t,n),t}(S(d).default);_.default=j;var E={},R=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),T=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(E,"t",{value:!0});var P=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return R(t,n),t}(T(d).default);E.default=P;var A={},C=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),N=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(A,"t",{value:!0});var M=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return C(t,n),t}(N(d).default);A.default=M;var U={},q=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),D=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(U,"t",{value:!0});var F=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return q(t,n),t}(D(d).default);U.default=F;var $={},B=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),L=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty($,"t",{value:!0});var z=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return B(t,n),t}(L(d).default);$.default=z;var I={},H=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),G=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(I,"t",{value:!0});var J=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return H(t,n),t}(G(d).default);I.default=J;var K={},W=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),X=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(K,"t",{value:!0});var V=function(n){function t(t,e){var r=n.call(this,t)||this;return r.importResults=e,r}return W(t,n),t}(X(d).default);K.default=V;var Y=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(h,"t",{value:!0}),h.ImportError=h.TypesenseError=h.ServerError=h.RequestUnauthorized=h.RequestMalformed=h.ObjectUnprocessable=h.ObjectNotFound=h.ObjectAlreadyExists=h.MissingConfigurationError=h.HTTPError=void 0;var Q=Y(l);h.HTTPError=Q.default;var Z=Y(y);h.MissingConfigurationError=Z.default;var nn=Y(_);h.ObjectAlreadyExists=nn.default;var tn=Y(E);h.ObjectNotFound=tn.default;var en=Y(A);h.ObjectUnprocessable=en.default;var rn=Y(U);h.RequestMalformed=rn.default;var on=Y($);h.RequestUnauthorized=on.default;var sn=Y(I);h.ServerError=sn.default;var un=Y(K);h.ImportError=un.default;var cn=Y(d);h.TypesenseError=cn.default;var an=n&&n.u||function(){return an=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n},an.apply(this,arguments)},fn=n&&n.h||(Object.create?function(n,t,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.t:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,r,i)}:function(n,t,e,r){void 0===r&&(r=e),n[r]=t[e]}),hn=n&&n.l||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),ln=n&&n.v||function(n){if(n&&n.t)return n;var t={};if(null!=n)for(var e in n)"default"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&fn(t,n,e);return hn(t,n),t};Object.defineProperty(u,"t",{value:!0});var dn=ln(f),vn=h,pn=function(){function n(n){var t=this;this.nodes=n.nodes||[],this.nodes=this.nodes.map((function(n){return t.setDefaultPathInNode(n)})).map((function(n){return t.setDefaultPortInNode(n)})).map((function(n){return an({},n)})),null==n.randomizeNodes&&(n.randomizeNodes=!0),!0===n.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=n.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=n.connectionTimeoutSeconds||n.timeoutSeconds||5,this.healthcheckIntervalSeconds=n.healthcheckIntervalSeconds||60,this.numRetries=n.numRetries||this.nodes.length+(null==this.nearestNode?0:1)||3,this.retryIntervalSeconds=n.retryIntervalSeconds||.1,this.apiKey=n.apiKey,this.sendApiKeyAsQueryParam=n.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=n.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=n.useServerSideSearchCache||!1,this.logger=n.logger||dn,this.logLevel=n.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=n.additionalHeaders,this.httpAgent=n.httpAgent,this.httpsAgent=n.httpsAgent,this.showDeprecationWarnings(n),this.validate()}return n.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new vn.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new vn.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new vn.MissingConfigurationError("Ensure that apiKey is set");return!0},n.prototype.validateNodes=function(){var n=this;return this.nodes.some((function(t){return n.isNodeMissingAnyParameters(t)}))},n.prototype.isNodeMissingAnyParameters=function(n){return!["protocol","host","port","path"].every((function(t){return n.hasOwnProperty(t)}))&&null==n.url},n.prototype.setDefaultPathInNode=function(n){return null==n||n.hasOwnProperty("path")||(n.path=""),n},n.prototype.setDefaultPortInNode=function(n){if(null!=n&&!n.hasOwnProperty("port")&&n.hasOwnProperty("protocol"))switch(n.protocol){case"https":n.port=443;break;case"http":n.port=80}return n},n.prototype.showDeprecationWarnings=function(n){n.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),n.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),n.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},n.prototype.shuffleArray=function(n){for(var t,e=n.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1));t=[n[r],n[e]],n[e]=t[0],n[r]=t[1]}},n}();u.default=pn;var mn={};function bn(n,t){return function(){return n.apply(t,arguments)}}const{toString:wn}=Object.prototype,{getPrototypeOf:yn}=Object,gn=(kn=Object.create(null),n=>{const t=wn.call(n);return kn[t]||(kn[t]=t.slice(8,-1).toLowerCase())});var kn;const xn=n=>(n=n.toLowerCase(),t=>gn(t)===n),_n=n=>t=>typeof t===n,{isArray:On}=Array,Sn=_n("undefined"),jn=xn("ArrayBuffer"),En=_n("string"),Rn=_n("function"),Tn=_n("number"),Pn=n=>null!==n&&"object"==typeof n,An=n=>{if("object"!==gn(n))return!1;const t=yn(n);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in n||Symbol.iterator in n)},Cn=xn("Date"),Nn=xn("File"),Mn=xn("Blob"),Un=xn("FileList"),qn=xn("URLSearchParams"),[Dn,Fn,$n,Bn]=["ReadableStream","Request","Response","Headers"].map(xn);function Ln(n,t,{allOwnKeys:e=!1}={}){if(null==n)return;let r,i;if("object"!=typeof n&&(n=[n]),On(n))for(r=0,i=n.length;r<i;r++)t.call(null,n[r],r,n);else{const i=e?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,n[s],s,n)}}function zn(n,t){t=t.toLowerCase();const e=Object.keys(n);let r,i=e.length;for(;i-- >0;)if(r=e[i],t===r.toLowerCase())return r;return null}const In="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n,Hn=n=>!Sn(n)&&n!==In,Gn=(Jn="undefined"!=typeof Uint8Array&&yn(Uint8Array),n=>Jn&&n instanceof Jn);var Jn;const Kn=xn("HTMLFormElement"),Wn=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Xn=xn("RegExp"),Vn=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),r={};Ln(e,((e,i)=>{let o;!1!==(o=t(e,i,n))&&(r[i]=o||e)})),Object.defineProperties(n,r)},Yn="abcdefghijklmnopqrstuvwxyz",Qn="0123456789",Zn={DIGIT:Qn,ALPHA:Yn,ALPHA_DIGIT:Yn+Yn.toUpperCase()+Qn},nt=xn("AsyncFunction"),tt=(et="function"==typeof setImmediate,rt=Rn(In.postMessage),et?setImmediate:rt?(it="axios@"+Math.random(),ot=[],In.addEventListener("message",(({source:n,data:t})=>{n===In&&t===it&&ot.length&&ot.shift()()}),!1),n=>{ot.push(n),In.postMessage(it,"*")}):n=>setTimeout(n));var et,rt,it,ot;const st="undefined"!=typeof queueMicrotask?queueMicrotask.bind(In):"undefined"!=typeof process&&process.nextTick||tt;var ut={isArray:On,isArrayBuffer:jn,isBuffer:function(n){return null!==n&&!Sn(n)&&null!==n.constructor&&!Sn(n.constructor)&&Rn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)},isFormData:n=>{let t;return n&&("function"==typeof FormData&&n instanceof FormData||Rn(n.append)&&("formdata"===(t=gn(n))||"object"===t&&Rn(n.toString)&&"[object FormData]"===n.toString()))},isArrayBufferView:function(n){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer&&jn(n.buffer),t},isString:En,isNumber:Tn,isBoolean:n=>!0===n||!1===n,isObject:Pn,isPlainObject:An,isReadableStream:Dn,isRequest:Fn,isResponse:$n,isHeaders:Bn,isUndefined:Sn,isDate:Cn,isFile:Nn,isBlob:Mn,isRegExp:Xn,isFunction:Rn,isStream:n=>Pn(n)&&Rn(n.pipe),isURLSearchParams:qn,isTypedArray:Gn,isFileList:Un,forEach:Ln,merge:function n(){const{caseless:t}=Hn(this)&&this||{},e={},r=(r,i)=>{const o=t&&zn(e,i)||i;An(e[o])&&An(r)?e[o]=n(e[o],r):An(r)?e[o]=n({},r):On(r)?e[o]=r.slice():e[o]=r};for(let n=0,t=arguments.length;n<t;n++)arguments[n]&&Ln(arguments[n],r);return e},extend:(n,t,e,{allOwnKeys:r}={})=>(Ln(t,((t,r)=>{e&&Rn(t)?n[r]=bn(t,e):n[r]=t}),{allOwnKeys:r}),n),trim:n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:n=>(65279===n.charCodeAt(0)&&(n=n.slice(1)),n),inherits:(n,t,e,r)=>{n.prototype=Object.create(t.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},toFlatObject:(n,t,e,r)=>{let i,o,s;const u={};if(t=t||{},null==n)return t;do{for(i=Object.getOwnPropertyNames(n),o=i.length;o-- >0;)s=i[o],r&&!r(s,n,t)||u[s]||(t[s]=n[s],u[s]=!0);n=!1!==e&&yn(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},kindOf:gn,kindOfTest:xn,endsWith:(n,t,e)=>{n+="",(void 0===e||e>n.length)&&(e=n.length),e-=t.length;const r=n.indexOf(t,e);return-1!==r&&r===e},toArray:n=>{if(!n)return null;if(On(n))return n;let t=n.length;if(!Tn(t))return null;const e=Array(t);for(;t-- >0;)e[t]=n[t];return e},forEachEntry:(n,t)=>{const e=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=e.next())&&!r.done;){const e=r.value;t.call(n,e[0],e[1])}},matchAll:(n,t)=>{let e;const r=[];for(;null!==(e=n.exec(t));)r.push(e);return r},isHTMLForm:Kn,hasOwnProperty:Wn,hasOwnProp:Wn,reduceDescriptors:Vn,freezeMethods:n=>{Vn(n,((t,e)=>{if(Rn(n)&&-1!==["arguments","caller","callee"].indexOf(e))return!1;const r=n[e];Rn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")}))}))},toObjectSet:(n,t)=>{const e={},r=n=>{n.forEach((n=>{e[n]=!0}))};return On(n)?r(n):r((n+"").split(t)),e},toCamelCase:n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(n,t,e){return t.toUpperCase()+e})),noop:()=>{},toFiniteNumber:(n,t)=>null!=n&&Number.isFinite(n=+n)?n:t,findKey:zn,global:In,isContextDefined:Hn,ALPHABET:Zn,generateString:(n=16,t=Zn.ALPHA_DIGIT)=>{let e="";const{length:r}=t;for(;n--;)e+=t[Math.random()*r|0];return e},isSpecCompliantForm:function(n){return!!(n&&Rn(n.append)&&"FormData"===n[Symbol.toStringTag]&&n[Symbol.iterator])},toJSONObject:n=>{const t=[,,,,,,,,,,],e=(n,r)=>{if(Pn(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const i=On(n)?[]:{};return Ln(n,((n,t)=>{const o=e(n,r+1);!Sn(o)&&(i[t]=o)})),t[r]=void 0,i}}return n};return e(n,0)},isAsyncFn:nt,isThenable:n=>n&&(Pn(n)||Rn(n))&&Rn(n.then)&&Rn(n.catch),setImmediate:tt,asap:st};function ct(n,t,e,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}ut.inherits(ct,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:ut.toJSONObject(this.config),code:this.code,status:this.status}}});const at=ct.prototype,ft={};function ht(n){return ut.isPlainObject(n)||ut.isArray(n)}function lt(n){return ut.endsWith(n,"[]")?n.slice(0,-2):n}function dt(n,t,e){return n?n.concat(t).map((function(n,t){return n=lt(n),!e&&t?"["+n+"]":n})).join(e?".":""):t}["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((n=>{ft[n]={value:n}})),Object.defineProperties(ct,ft),Object.defineProperty(at,"isAxiosError",{value:!0}),ct.from=(n,t,e,r,i,o)=>{const s=Object.create(at);return ut.toFlatObject(n,s,(function(n){return n!==Error.prototype}),(n=>"isAxiosError"!==n)),ct.call(s,n.message,t,e,r,i),s.cause=n,s.name=n.name,o&&Object.assign(s,o),s};const vt=ut.toFlatObject(ut,{},null,(function(n){return/^is[A-Z]/.test(n)}));function pt(n,t,e){if(!ut.isObject(n))throw new TypeError("target must be an object");t=t||new FormData;const r=(e=ut.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(n,t){return!ut.isUndefined(t[n])}))).metaTokens,i=e.visitor||a,o=e.dots,s=e.indexes,u=(e.Blob||"undefined"!=typeof Blob&&Blob)&&ut.isSpecCompliantForm(t);if(!ut.isFunction(i))throw new TypeError("visitor must be a function");function c(n){if(null===n)return"";if(ut.isDate(n))return n.toISOString();if(!u&&ut.isBlob(n))throw new ct("Blob is not supported. Use a Buffer instead.");return ut.isArrayBuffer(n)||ut.isTypedArray(n)?u&&"function"==typeof Blob?new Blob([n]):Buffer.from(n):n}function a(n,e,i){let u=n;if(n&&!i&&"object"==typeof n)if(ut.endsWith(e,"{}"))e=r?e:e.slice(0,-2),n=JSON.stringify(n);else if(ut.isArray(n)&&function(n){return ut.isArray(n)&&!n.some(ht)}(n)||(ut.isFileList(n)||ut.endsWith(e,"[]"))&&(u=ut.toArray(n)))return e=lt(e),u.forEach((function(n,r){!ut.isUndefined(n)&&null!==n&&t.append(!0===s?dt([e],r,o):null===s?e:e+"[]",c(n))})),!1;return!!ht(n)||(t.append(dt(i,e,o),c(n)),!1)}const f=[],h=Object.assign(vt,{defaultVisitor:a,convertValue:c,isVisitable:ht});if(!ut.isObject(n))throw new TypeError("data must be an object");return function n(e,r){if(!ut.isUndefined(e)){if(-1!==f.indexOf(e))throw Error("Circular reference detected in "+r.join("."));f.push(e),ut.forEach(e,(function(e,o){!0===(!(ut.isUndefined(e)||null===e)&&i.call(t,e,ut.isString(o)?o.trim():o,r,h))&&n(e,r?r.concat(o):[o])})),f.pop()}}(n),t}function mt(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,(function(n){return t[n]}))}function bt(n,t){this.p=[],n&&pt(n,this,t)}const wt=bt.prototype;function yt(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function gt(n,t,e){if(!t)return n;const r=e&&e.encode||yt;ut.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let o;if(o=i?i(t,e):ut.isURLSearchParams(t)?t.toString():new bt(t,e).toString(r),o){const t=n.indexOf("#");-1!==t&&(n=n.slice(0,t)),n+=(-1===n.indexOf("?")?"?":"&")+o}return n}wt.append=function(n,t){this.p.push([n,t])},wt.toString=function(n){const t=n?function(t){return n.call(this,t,mt)}:mt;return this.p.map((function(n){return t(n[0])+"="+t(n[1])}),"").join("&")};var kt=class{constructor(){this.handlers=[]}use(n,t,e){return this.handlers.push({fulfilled:n,rejected:t,synchronous:!!e&&e.synchronous,runWhen:e?e.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){ut.forEach(this.handlers,(function(t){null!==t&&n(t)}))}},xt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_t={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:bt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ot="undefined"!=typeof window&&"undefined"!=typeof document,St="object"==typeof navigator&&navigator||void 0,jt=Ot&&(!St||["ReactNative","NativeScript","NS"].indexOf(St.product)<0),Et="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Rt=Ot&&window.location.href||"http://localhost";var Tt={...Object.freeze({__proto__:null,hasBrowserEnv:Ot,hasStandardBrowserWebWorkerEnv:Et,hasStandardBrowserEnv:jt,navigator:St,origin:Rt}),..._t};function Pt(n){function t(n,e,r,i){let o=n[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),u=i>=n.length;return o=!o&&ut.isArray(r)?r.length:o,u?(ut.hasOwnProp(r,o)?r[o]=[r[o],e]:r[o]=e,!s):(r[o]&&ut.isObject(r[o])||(r[o]=[]),t(n,e,r[o],i)&&ut.isArray(r[o])&&(r[o]=function(n){const t={},e=Object.keys(n);let r;const i=e.length;let o;for(r=0;r<i;r++)o=e[r],t[o]=n[o];return t}(r[o])),!s)}if(ut.isFormData(n)&&ut.isFunction(n.entries)){const e={};return ut.forEachEntry(n,((n,r)=>{t(function(n){return ut.matchAll(/\w+|\[(\w*)]/g,n).map((n=>"[]"===n[0]?"":n[1]||n[0]))}(n),r,e,0)})),e}return null}const At={transitional:xt,adapter:["xhr","http","fetch"],transformRequest:[function(n,t){const e=t.getContentType()||"",r=e.indexOf("application/json")>-1,i=ut.isObject(n);if(i&&ut.isHTMLForm(n)&&(n=new FormData(n)),ut.isFormData(n))return r?JSON.stringify(Pt(n)):n;if(ut.isArrayBuffer(n)||ut.isBuffer(n)||ut.isStream(n)||ut.isFile(n)||ut.isBlob(n)||ut.isReadableStream(n))return n;if(ut.isArrayBufferView(n))return n.buffer;if(ut.isURLSearchParams(n))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let o;if(i){if(e.indexOf("application/x-www-form-urlencoded")>-1)return function(n,t){return pt(n,new Tt.classes.URLSearchParams,Object.assign({visitor:function(n,t,e,r){return Tt.isNode&&ut.isBuffer(n)?(this.append(t,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(n,this.formSerializer).toString();if((o=ut.isFileList(n))||e.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return pt(o?{"files[]":n}:n,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(n){if(ut.isString(n))try{return(0,JSON.parse)(n),ut.trim(n)}catch(n){if("SyntaxError"!==n.name)throw n}return(0,JSON.stringify)(n)}(n)):n}],transformResponse:[function(n){const t=this.transitional||At.transitional,e=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ut.isResponse(n)||ut.isReadableStream(n))return n;if(n&&ut.isString(n)&&(e&&!this.responseType||r)){const e=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(n)}catch(n){if(e){if("SyntaxError"===n.name)throw ct.from(n,ct.ERR_BAD_RESPONSE,this,null,this.response);throw n}}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ut.forEach(["delete","get","head","post","put","patch"],(n=>{At.headers[n]={}}));var Ct=At;const Nt=ut.toObjectSet(["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"]),Mt=Symbol("internals");function Ut(n){return n&&(n+"").trim().toLowerCase()}function qt(n){return!1===n||null==n?n:ut.isArray(n)?n.map(qt):n+""}function Dt(n,t,e,r,i){return ut.isFunction(r)?r.call(this,t,e):(i&&(t=e),ut.isString(t)?ut.isString(r)?-1!==t.indexOf(r):ut.isRegExp(r)?r.test(t):void 0:void 0)}class Ft{constructor(n){n&&this.set(n)}set(n,t,e){const r=this;function i(n,t,e){const i=Ut(t);if(!i)throw Error("header name must be a non-empty string");const o=ut.findKey(r,i);(!o||void 0===r[o]||!0===e||void 0===e&&!1!==r[o])&&(r[o||t]=qt(n))}const o=(n,t)=>ut.forEach(n,((n,e)=>i(n,e,t)));if(ut.isPlainObject(n)||n instanceof this.constructor)o(n,t);else if(ut.isString(n)&&(n=n.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))o((n=>{const t={};let e,r,i;return n&&n.split("\n").forEach((function(n){i=n.indexOf(":"),e=n.substring(0,i).trim().toLowerCase(),r=n.substring(i+1).trim(),!e||t[e]&&Nt[e]||("set-cookie"===e?t[e]?t[e].push(r):t[e]=[r]:t[e]=t[e]?t[e]+", "+r:r)})),t})(n),t);else if(ut.isHeaders(n))for(const[t,r]of n.entries())i(r,t,e);else null!=n&&i(t,n,e);return this}get(n,t){if(n=Ut(n)){const e=ut.findKey(this,n);if(e){const n=this[e];if(!t)return n;if(!0===t)return function(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=e.exec(n);)t[r[1]]=r[2];return t}(n);if(ut.isFunction(t))return t.call(this,n,e);if(ut.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,t){if(n=Ut(n)){const e=ut.findKey(this,n);return!(!e||void 0===this[e]||t&&!Dt(0,this[e],e,t))}return!1}delete(n,t){const e=this;let r=!1;function i(n){if(n=Ut(n)){const i=ut.findKey(e,n);!i||t&&!Dt(0,e[i],i,t)||(delete e[i],r=!0)}}return ut.isArray(n)?n.forEach(i):i(n),r}clear(n){const t=Object.keys(this);let e=t.length,r=!1;for(;e--;){const i=t[e];n&&!Dt(0,this[i],i,n,!0)||(delete this[i],r=!0)}return r}normalize(n){const t=this,e={};return ut.forEach(this,((r,i)=>{const o=ut.findKey(e,i);if(o)return t[o]=qt(r),void delete t[i];const s=n?function(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((n,t,e)=>t.toUpperCase()+e))}(i):(i+"").trim();s!==i&&delete t[i],t[s]=qt(r),e[s]=!0})),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const t=Object.create(null);return ut.forEach(this,((e,r)=>{null!=e&&!1!==e&&(t[r]=n&&ut.isArray(e)?e.join(", "):e)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([n,t])=>n+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...t){const e=new this(n);return t.forEach((n=>e.set(n))),e}static accessor(n){const t=(this[Mt]=this[Mt]={accessors:{}}).accessors,e=this.prototype;function r(n){const r=Ut(n);t[r]||(function(n,t){const e=ut.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(n,r+e,{value:function(n,e,i){return this[r].call(this,t,n,e,i)},configurable:!0})}))}(e,n),t[r]=!0)}return ut.isArray(n)?n.forEach(r):r(n),this}}Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ut.reduceDescriptors(Ft.prototype,(({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(n){this[e]=n}}})),ut.freezeMethods(Ft);var $t=Ft;function Bt(n,t){const e=this||Ct,r=t||e,i=$t.from(r.headers);let o=r.data;return ut.forEach(n,(function(n){o=n.call(e,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Lt(n){return!(!n||!n.m)}function zt(n,t,e){ct.call(this,n??"canceled",ct.ERR_CANCELED,t,e),this.name="CanceledError"}function It(n,t,e){const r=e.config.validateStatus;e.status&&r&&!r(e.status)?t(new ct("Request failed with status code "+e.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e)):n(e)}ut.inherits(zt,ct,{m:!0});const Ht=(n,t,e=3)=>{let r=0;const i=function(n,t){const e=Array(n=n||10),r=Array(n);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(u){const c=Date.now(),a=r[s];i||(i=c),e[o]=u,r[o]=c;let f=s,h=0;for(;f!==o;)h+=e[f++],f%=n;if(o=(o+1)%n,o===s&&(s=(s+1)%n),c-i<t)return;const l=a&&c-a;return l?Math.round(1e3*h/l):void 0}}(50,250);return function(n,t){let e,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,e=null,r&&(clearTimeout(r),r=null),n.apply(null,t)};return[(...n)=>{const t=Date.now(),u=t-i;u>=o?s(n,t):(e=n,r||(r=setTimeout((()=>{r=null,s(e)}),o-u)))},()=>e&&s(e)]}((e=>{const o=e.loaded,s=e.lengthComputable?e.total:void 0,u=o-r,c=i(u);r=o,n({loaded:o,total:s,progress:s?o/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:e,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),e)},Gt=(n,t)=>{const e=null!=n;return[r=>t[0]({lengthComputable:e,total:n,loaded:r}),t[1]]},Jt=n=>(...t)=>ut.asap((()=>n(...t)));var Kt=Tt.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,Tt.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,Wt=Tt.hasStandardBrowserEnv?{write(n,t,e,r,i,o){const s=[n+"="+encodeURIComponent(t)];ut.isNumber(e)&&s.push("expires="+new Date(e).toGMTString()),ut.isString(r)&&s.push("path="+r),ut.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(n){const t=document.cookie.match(RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Xt(n,t){return n&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}(n,t):t}const Vt=n=>n instanceof $t?{...n}:n;function Yt(n,t){t=t||{};const e={};function r(n,t,e,r){return ut.isPlainObject(n)&&ut.isPlainObject(t)?ut.merge.call({caseless:r},n,t):ut.isPlainObject(t)?ut.merge({},t):ut.isArray(t)?t.slice():t}function i(n,t,e,i){return ut.isUndefined(t)?ut.isUndefined(n)?void 0:r(void 0,n,0,i):r(n,t,0,i)}function o(n,t){if(!ut.isUndefined(t))return r(void 0,t)}function s(n,t){return ut.isUndefined(t)?ut.isUndefined(n)?void 0:r(void 0,n):r(void 0,t)}function u(e,i,o){return o in t?r(e,i):o in n?r(void 0,e):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(n,t,e)=>i(Vt(n),Vt(t),0,!0)};return ut.forEach(Object.keys(Object.assign({},n,t)),(function(r){const o=c[r]||i,s=o(n[r],t[r],r);ut.isUndefined(s)&&o!==u||(e[r]=s)})),e}var Qt=n=>{const t=Yt({},n);let e,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:s,headers:u,auth:c}=t;if(t.headers=u=$t.from(u),t.url=gt(Xt(t.baseURL,t.url),n.params,n.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ut.isFormData(r))if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(!1!==(e=u.getContentType())){const[n,...t]=e?e.split(";").map((n=>n.trim())).filter(Boolean):[];u.setContentType([n||"multipart/form-data",...t].join("; "))}if(Tt.hasStandardBrowserEnv&&(i&&ut.isFunction(i)&&(i=i(t)),i||!1!==i&&Kt(t.url))){const n=o&&s&&Wt.read(s);n&&u.set(o,n)}return t},Zt="undefined"!=typeof XMLHttpRequest&&function(n){return new Promise((function(t,e){const r=Qt(n);let i=r.data;const o=$t.from(r.headers).normalize();let s,u,c,a,f,{responseType:h,onUploadProgress:l,onDownloadProgress:d}=r;function v(){a&&a(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let p=new XMLHttpRequest;function m(){if(!p)return;const r=$t.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());It((function(n){t(n),v()}),(function(n){e(n),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:n,request:p}),p=null}p.open(r.method.toUpperCase(),r.url,!0),p.timeout=r.timeout,"onloadend"in p?p.onloadend=m:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(m)},p.onabort=function(){p&&(e(new ct("Request aborted",ct.ECONNABORTED,n,p)),p=null)},p.onerror=function(){e(new ct("Network Error",ct.ERR_NETWORK,n,p)),p=null},p.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||xt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),e(new ct(t,i.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,n,p)),p=null},void 0===i&&o.setContentType(null),"setRequestHeader"in p&&ut.forEach(o.toJSON(),(function(n,t){p.setRequestHeader(t,n)})),ut.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),h&&"json"!==h&&(p.responseType=r.responseType),d&&([c,f]=Ht(d,!0),p.addEventListener("progress",c)),l&&p.upload&&([u,a]=Ht(l),p.upload.addEventListener("progress",u),p.upload.addEventListener("loadend",a)),(r.cancelToken||r.signal)&&(s=t=>{p&&(e(!t||t.type?new zt(null,n,p):t),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const b=function(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}(r.url);b&&-1===Tt.protocols.indexOf(b)?e(new ct("Unsupported protocol "+b+":",ct.ERR_BAD_REQUEST,n)):p.send(i||null)}))},ne=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let e,r=new AbortController;const i=function(n){if(!e){e=!0,s();const t=n instanceof Error?n:this.reason;r.abort(t instanceof ct?t:new zt(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new ct(`timeout ${t} of ms exceeded`,ct.ETIMEDOUT))}),t);const s=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach((n=>{n.unsubscribe?n.unsubscribe(i):n.removeEventListener("abort",i)})),n=null)};n.forEach((n=>n.addEventListener("abort",i)));const{signal:u}=r;return u.unsubscribe=()=>ut.asap(s),u}};const te=function*(n,t){let e=n.byteLength;if(e<t)return void(yield n);let r,i=0;for(;i<e;)r=i+t,yield n.slice(i,r),i=r},ee=(n,t,e,r)=>{const i=async function*(n,t){for await(const e of async function*(n){if(n[Symbol.asyncIterator])return void(yield*n);const t=n.getReader();try{for(;;){const{done:n,value:e}=await t.read();if(n)break;yield e}}finally{await t.cancel()}}(n))yield*te(e,t)}(n,t);let o,s=0,u=n=>{o||(o=!0,r&&r(n))};return new ReadableStream({async pull(n){try{const{done:t,value:r}=await i.next();if(t)return u(),void n.close();let o=r.byteLength;if(e){let n=s+=o;e(n)}n.enqueue(new Uint8Array(r))}catch(n){throw u(n),n}},cancel:n=>(u(n),i.return())},{highWaterMark:2})},re="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,ie=re&&"function"==typeof ReadableStream,oe=re&&("function"==typeof TextEncoder?(se=new TextEncoder,n=>se.encode(n)):async n=>new Uint8Array(await new Response(n).arrayBuffer()));var se;const ue=(n,...t)=>{try{return!!n(...t)}catch(n){return!1}},ce=ie&&ue((()=>{let n=!1;const t=new Request(Tt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t})),ae=ie&&ue((()=>ut.isReadableStream(new Response("").body))),fe={stream:ae&&(n=>n.body)};var he;re&&(he=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((n=>{!fe[n]&&(fe[n]=ut.isFunction(he[n])?t=>t[n]():(t,e)=>{throw new ct(`Response type '${n}' is not supported`,ct.ERR_NOT_SUPPORT,e)})})));const le={http:null,xhr:Zt,fetch:re&&(async n=>{let{url:t,method:e,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:u,onUploadProgress:c,responseType:a,headers:f,withCredentials:h="same-origin",fetchOptions:l}=Qt(n);a=a?(a+"").toLowerCase():"text";let d,v=ne([i,o&&o.toAbortSignal()],s);const p=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let m;try{if(c&&ce&&"get"!==e&&"head"!==e&&0!==(m=await(async(n,t)=>ut.toFiniteNumber(n.getContentLength())??(async n=>{if(null==n)return 0;if(ut.isBlob(n))return n.size;if(ut.isSpecCompliantForm(n)){const t=new Request(Tt.origin,{method:"POST",body:n});return(await t.arrayBuffer()).byteLength}return ut.isArrayBufferView(n)||ut.isArrayBuffer(n)?n.byteLength:(ut.isURLSearchParams(n)&&(n+=""),ut.isString(n)?(await oe(n)).byteLength:void 0)})(t))(f,r))){let n,e=new Request(t,{method:"POST",body:r,duplex:"half"});if(ut.isFormData(r)&&(n=e.headers.get("content-type"))&&f.setContentType(n),e.body){const[n,t]=Gt(m,Ht(Jt(c)));r=ee(e.body,65536,n,t)}}ut.isString(h)||(h=h?"include":"omit");const i="credentials"in Request.prototype;d=new Request(t,{...l,signal:v,method:e.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:i?h:void 0});let o=await fetch(d);const s=ae&&("stream"===a||"response"===a);if(ae&&(u||s&&p)){const n={};["status","statusText","headers"].forEach((t=>{n[t]=o[t]}));const t=ut.toFiniteNumber(o.headers.get("content-length")),[e,r]=u&&Gt(t,Ht(Jt(u),!0))||[];o=new Response(ee(o.body,65536,e,(()=>{r&&r(),p&&p()})),n)}a=a||"text";let b=await fe[ut.findKey(fe,a)||"text"](o,n);return!s&&p&&p(),await new Promise(((t,e)=>{It(t,e,{data:b,headers:$t.from(o.headers),status:o.status,statusText:o.statusText,config:n,request:d})}))}catch(t){if(p&&p(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new ct("Network Error",ct.ERR_NETWORK,n,d),{cause:t.cause||t});throw ct.from(t,t&&t.code,n,d)}})};ut.forEach(le,((n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch(n){}Object.defineProperty(n,"adapterName",{value:t})}}));const de=n=>"- "+n,ve=n=>ut.isFunction(n)||null===n||!1===n;var pe=n=>{n=ut.isArray(n)?n:[n];const{length:t}=n;let e,r;const i={};for(let o=0;o<t;o++){let t;if(e=n[o],r=e,!ve(e)&&(r=le[(t=e+"").toLowerCase()],void 0===r))throw new ct(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+o]=r}if(!r){const n=Object.entries(i).map((([n,t])=>`adapter ${n} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new ct("There is no suitable adapter to dispatch the request "+(t?n.length>1?"since :\n"+n.map(de).join("\n"):" "+de(n[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function me(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new zt(null,n)}function be(n){return me(n),n.headers=$t.from(n.headers),n.data=Bt.call(n,n.transformRequest),-1!==["post","put","patch"].indexOf(n.method)&&n.headers.setContentType("application/x-www-form-urlencoded",!1),pe(n.adapter||Ct.adapter)(n).then((function(t){return me(n),t.data=Bt.call(n,n.transformResponse,t),t.headers=$t.from(t.headers),t}),(function(t){return Lt(t)||(me(n),t&&t.response&&(t.response.data=Bt.call(n,n.transformResponse,t.response),t.response.headers=$t.from(t.response.headers))),Promise.reject(t)}))}const we={};["object","boolean","number","function","string","symbol"].forEach(((n,t)=>{we[n]=function(e){return typeof e===n||"a"+(t<1?"n ":" ")+n}}));const ye={};we.transitional=function(n,t,e){return(r,i,o)=>{if(!1===n)throw new ct(function(n,t){return"[Axios v1.7.9] Transitional option '"+n+"'"+t+(e?". "+e:"")}(i," has been removed"+(t?" in "+t:"")),ct.ERR_DEPRECATED);return t&&!ye[i]&&(ye[i]=!0),!n||n(r,i,o)}},we.spelling=function(n){return(n,t)=>!0};var ge={assertOptions:function(n,t,e){if("object"!=typeof n)throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=n[o],e=void 0===t||s(t,o,n);if(!0!==e)throw new ct("option "+o+" must be "+e,ct.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new ct("Unknown option "+o,ct.ERR_BAD_OPTION)}},validators:we};const ke=ge.validators;class xe{constructor(n){this.defaults=n,this.interceptors={request:new kt,response:new kt}}async request(n,t){try{return await this.k(n,t)}catch(n){if(n instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();const e=t.stack?t.stack.replace(/^.+\n/,""):"";try{n.stack?e&&!(n.stack+"").endsWith(e.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+e):n.stack=e}catch(n){}}throw n}}k(n,t){"string"==typeof n?(t=t||{}).url=n:t=n||{},t=Yt(this.defaults,t);const{transitional:e,paramsSerializer:r,headers:i}=t;void 0!==e&&ge.assertOptions(e,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=r&&(ut.isFunction(r)?t.paramsSerializer={serialize:r}:ge.assertOptions(r,{encode:ke.function,serialize:ke.function},!0)),ge.assertOptions(t,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&ut.merge(i.common,i[t.method]);i&&ut.forEach(["delete","get","head","post","put","patch","common"],(n=>{delete i[n]})),t.headers=$t.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach((function(n){"function"==typeof n.runWhen&&!1===n.runWhen(t)||(u=u&&n.synchronous,s.unshift(n.fulfilled,n.rejected))}));const c=[];let a;this.interceptors.response.forEach((function(n){c.push(n.fulfilled,n.rejected)}));let f,h=0;if(!u){const n=[be.bind(this),void 0];for(n.unshift.apply(n,s),n.push.apply(n,c),f=n.length,a=Promise.resolve(t);h<f;)a=a.then(n[h++],n[h++]);return a}f=s.length;let l=t;for(h=0;h<f;){const n=s[h++],t=s[h++];try{l=n(l)}catch(n){t.call(this,n);break}}try{a=be(l)}catch(n){return Promise.reject(n)}for(h=0,f=c.length;h<f;)a=a.then(c[h++],c[h++]);return a}getUri(n){return gt(Xt((n=Yt(this.defaults,n)).baseURL,n.url),n.params,n.paramsSerializer)}}ut.forEach(["delete","get","head","options"],(function(n){xe.prototype[n]=function(t,e){return this.request(Yt(e||{},{method:n,url:t,data:(e||{}).data}))}})),ut.forEach(["post","put","patch"],(function(n){function t(t){return function(e,r,i){return this.request(Yt(i||{},{method:n,headers:t?{"Content-Type":"multipart/form-data"}:{},url:e,data:r}))}}xe.prototype[n]=t(),xe.prototype[n+"Form"]=t(!0)}));var _e=xe;class Oe{constructor(n){if("function"!=typeof n)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(n){t=n}));const e=this;this.promise.then((n=>{if(!e._)return;let t=e._.length;for(;t-- >0;)e._[t](n);e._=null})),this.promise.then=n=>{let t;const r=new Promise((n=>{e.subscribe(n),t=n})).then(n);return r.cancel=function(){e.unsubscribe(t)},r},n((function(n,r,i){e.reason||(e.reason=new zt(n,r,i),t(e.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){this.reason?n(this.reason):this._?this._.push(n):this._=[n]}unsubscribe(n){if(!this._)return;const t=this._.indexOf(n);-1!==t&&this._.splice(t,1)}toAbortSignal(){const n=new AbortController,t=t=>{n.abort(t)};return this.subscribe(t),n.signal.unsubscribe=()=>this.unsubscribe(t),n.signal}static source(){let n;return{token:new Oe((function(t){n=t})),cancel:n}}}var Se=Oe;const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach((([n,t])=>{je[t]=n}));var Ee=je;const Re=function n(t){const e=new _e(t),r=bn(_e.prototype.request,e);return ut.extend(r,_e.prototype,e,{allOwnKeys:!0}),ut.extend(r,e,null,{allOwnKeys:!0}),r.create=function(e){return n(Yt(t,e))},r}(Ct);Re.Axios=_e,Re.CanceledError=zt,Re.CancelToken=Se,Re.isCancel=Lt,Re.VERSION="1.7.9",Re.toFormData=pt,Re.AxiosError=ct,Re.Cancel=Re.CanceledError,Re.all=function(n){return Promise.all(n)},Re.spread=function(n){return function(t){return n.apply(null,t)}},Re.isAxiosError=function(n){return ut.isObject(n)&&!0===n.isAxiosError},Re.mergeConfig=Yt,Re.AxiosHeaders=$t,Re.formToJSON=n=>Pt(ut.isHTMLForm(n)?new FormData(n):n),Re.getAdapter=pe,Re.HttpStatusCode=Ee,Re.default=Re;var Te=Re,Pe=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Ae=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Ce=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(mn,"t",{value:!0});var Ne=Ce(Te),Me=h,Ue=Ce(d),qe=!0,De=function(){function n(n){this.configuration=n,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return n.prototype.get=function(n,t,e){void 0===t&&(t={});var r=void 0===e?{}:e,i=r.abortSignal,o=void 0===i?null:i,s=r.responseType,u=void 0===s?void 0:s;return Pe(this,void 0,void 0,(function(){return Ae(this,(function(e){return[2,this.performRequest("get",n,{queryParameters:t,abortSignal:o,responseType:u})]}))}))},n.prototype.delete=function(n,t){return void 0===t&&(t={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(e){return[2,this.performRequest("delete",n,{queryParameters:t})]}))}))},n.prototype.post=function(n,t,e,r){return void 0===t&&(t={}),void 0===e&&(e={}),void 0===r&&(r={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(i){return[2,this.performRequest("post",n,{queryParameters:e,bodyParameters:t,additionalHeaders:r})]}))}))},n.prototype.put=function(n,t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(r){return[2,this.performRequest("put",n,{queryParameters:e,bodyParameters:t})]}))}))},n.prototype.patch=function(n,t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(r){return[2,this.performRequest("patch",n,{queryParameters:e,bodyParameters:t})]}))}))},n.prototype.performRequest=function(n,t,e){var r,i,o,s=e.queryParameters,u=void 0===s?null:s,c=e.bodyParameters,a=void 0===c?null:c,f=e.additionalHeaders,h=void 0===f?{}:f,l=e.abortSignal,d=void 0===l?null:l,v=e.responseType,p=void 0===v?void 0:v,m=e.skipConnectionTimeout,b=void 0!==m&&m;return Pe(this,void 0,void 0,(function(){var e,s,c,f,l,v;return Ae(this,(function(m){switch(m.label){case 0:this.configuration.validate(),e=Date.now(),this.logger.debug("Request #".concat(e,": Performing ").concat(n.toUpperCase()," request: ").concat(t)),c=function(c){var l,v,m,w,y,g,k;return Ae(this,(function(x){switch(x.label){case 0:if(l=f.getNextNode(e),f.logger.debug("Request #".concat(e,": Attempting ").concat(n.toUpperCase()," request Try #").concat(c," to Node ").concat(l.index)),d&&d.aborted)return[2,{value:Promise.reject(Error("Request aborted by caller."))}];v=void 0,x.label=1;case 1:return x.trys.push([1,3,5,6]),m={method:n,url:f.uriFor(t,l),headers:Object.assign({},f.defaultHeaders(),h,f.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:p,validateStatus:function(n){return n>0},transformResponse:[function(n,t){var e=n;return void 0!==t&&"string"==typeof n&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(e=JSON.parse(n)),e}]},!0!==b&&(m.timeout=1e3*f.connectionTimeoutSeconds),u&&0!==Object.keys(u).length&&(m.params=u),f.sendApiKeyAsQueryParam&&(m.params=m.params||{},m.params["x-typesense-api-key"]=f.apiKey),f.configuration.httpAgent&&(f.logger.debug("Request #".concat(e,": Using custom httpAgent")),m.httpAgent=f.configuration.httpAgent),f.configuration.httpsAgent&&(f.logger.debug("Request #".concat(e,": Using custom httpsAgent")),m.httpsAgent=f.configuration.httpsAgent),a&&("string"==typeof a&&0!==a.length||"object"==typeof a&&0!==Object.keys(a).length)&&(m.data=a),d&&(w=Ne.default.CancelToken,y=w.source(),v=function(){return y.cancel()},d.addEventListener("abort",v),m.cancelToken=y.token),[4,(0,Ne.default)(m)];case 2:if((g=x.sent()).status>=1&&g.status<=499&&f.setNodeHealthcheck(l,qe),f.logger.debug("Request #".concat(e,": Request to Node ").concat(l.index," was made. Response Code was ").concat(g.status,".")),g.status>=200&&g.status<300)return[2,{value:Promise.resolve(g.data)}];if(g.status<500)return[2,{value:Promise.reject(f.customErrorForResponse(g,null===(r=g.data)||void 0===r?void 0:r.message))}];throw f.customErrorForResponse(g,null===(i=g.data)||void 0===i?void 0:i.message);case 3:return k=x.sent(),f.setNodeHealthcheck(l,!1),s=k,f.logger.warn("Request #".concat(e,": Request to Node ").concat(l.index,' failed due to "').concat(k.code," ").concat(k.message).concat(null==k.response?"":" - "+JSON.stringify(null===(o=k.response)||void 0===o?void 0:o.data),'"')),f.logger.warn("Request #".concat(e,": Sleeping for ").concat(f.retryIntervalSeconds,"s and then retrying request...")),[4,f.timer(f.retryIntervalSeconds)];case 4:return x.sent(),[3,6];case 5:return d&&v&&d.removeEventListener("abort",v),[7];case 6:return[2]}}))},f=this,l=1,m.label=1;case 1:return l<=this.numRetriesPerRequest+1?[5,c(l)]:[3,4];case 2:if("object"==typeof(v=m.sent()))return[2,v.value];m.label=3;case 3:return l++,[3,1];case 4:return this.logger.debug("Request #".concat(e,": No retries left. Raising last error")),[2,Promise.reject(s)]}}))}))},n.prototype.getNextNode=function(n){if(void 0===n&&(n=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(n,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,n))return this.logger.debug("Request #".concat(n,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(n,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(n,": Nodes Health: ").concat(this.nodes.map((function(n){return"Node ".concat(n.index," is ").concat(!0===n.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],e=0;e<=this.nodes.length;e++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,n))return this.logger.debug("Request #".concat(n,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(n,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},n.prototype.nodeDueForHealthcheck=function(n,t){void 0===t&&(t=0);var e=Date.now()-n.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return e&&this.logger.debug("Request #".concat(t,": Node ").concat(n.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),e},n.prototype.initializeMetadataForNodes=function(){var n=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,qe)),this.nodes.forEach((function(t,e){t.index=e,n.setNodeHealthcheck(t,qe)}))},n.prototype.setNodeHealthcheck=function(n,t){n.isHealthy=t,n.lastAccessTimestamp=Date.now()},n.prototype.uriFor=function(n,t){return null!=t.url?"".concat(t.url).concat(n):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(n)},n.prototype.defaultHeaders=function(){var n={};return this.sendApiKeyAsQueryParam||(n["X-TYPESENSE-API-KEY"]=this.apiKey),n["Content-Type"]="application/json",n},n.prototype.timer=function(n){return Pe(this,void 0,void 0,(function(){return Ae(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*n)}))]}))}))},n.prototype.customErrorForResponse=function(n,t){var e="Request failed with HTTP code ".concat(n.status);"string"==typeof t&&""!==t.trim()&&(e+=" | Server said: ".concat(t));var r=new Ue.default(e);return(r=400===n.status?new Me.RequestMalformed(e):401===n.status?new Me.RequestUnauthorized(e):404===n.status?new Me.ObjectNotFound(e):409===n.status?new Me.ObjectAlreadyExists(e):422===n.status?new Me.ObjectUnprocessable(e):n.status>=500&&n.status<=599?new Me.ServerError(e):new Me.HTTPError(e)).httpStatus=n.status,r},n}();mn.default=De;var Fe={},$e=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Be=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(Fe,"t",{value:!0});var Le="/collections",ze=function(){function n(n){this.apiCall=n}return n.prototype.create=function(n,t){return void 0===t&&(t={}),$e(this,void 0,void 0,(function(){return Be(this,(function(e){return[2,this.apiCall.post(Le,n,t)]}))}))},n.prototype.retrieve=function(){return $e(this,void 0,void 0,(function(){return Be(this,(function(n){return[2,this.apiCall.get(Le)]}))}))},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return Le},enumerable:!1,configurable:!0}),n}();Fe.default=ze;var Ie={},He={},Ge={},Je={},Ke=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},We=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Xe=n&&n.j||function(n,t,e){if(e||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return n.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(Je,"t",{value:!0});var Ve=function(){function n(){this.responseCache=new Map,this.responsePromiseCache=new Map}return n.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},n.prototype.perform=function(n,t,e,r){return Ke(this,void 0,void 0,(function(){var i,o,s,u,c,a,f,h,l,d,v;return We(this,(function(p){switch(p.label){case 0:if(i=r.cacheResponseForSeconds,o=void 0===i?120:i,s=r.maxSize,u=void 0===s?100:s,o<=0||u<=0)return[2,t.call.apply(t,Xe([n],e,!1))];if(c=JSON.stringify(e),a=this.responseCache.get(c),f=Date.now(),a){if(f-a.requestTimestamp<1e3*o)return this.responseCache.delete(c),this.responseCache.set(c,a),[2,Promise.resolve(a.response)];this.responseCache.delete(c)}if(h=this.responsePromiseCache.get(c)){if(f-h.requestTimestamp<1e3*o)return this.responsePromiseCache.delete(c),this.responsePromiseCache.set(c,h),[2,h.responsePromise];this.responsePromiseCache.delete(c)}return l=t.call.apply(t,Xe([n],e,!1)),this.responsePromiseCache.set(c,{requestTimestamp:f,responsePromise:l}),[4,l];case 1:return d=p.sent(),this.responseCache.set(c,{requestTimestamp:f,response:d}),this.responseCache.size>u&&(v=this.responseCache.keys().next().value,this.responseCache.delete(v)),this.responsePromiseCache.size>u&&(v=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(v)),[2,d]}}))}))},n}();Je.default=Ve;var Ye=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Qe=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Ze=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ge,"t",{value:!0}),Ge.SearchOnlyDocuments=void 0;var nr=Ze(Je),tr=Ze(Fe),er="/documents",rr=function(){function n(n,t,e){this.collectionName=n,this.apiCall=t,this.configuration=e,this.requestWithCache=new nr.default}return n.prototype.clearCache=function(){this.requestWithCache.clearCache()},n.prototype.search=function(n,t){var e=void 0===t?{}:t,r=e.cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,o=e.abortSignal,s=void 0===o?null:o;return Ye(this,void 0,void 0,(function(){var t,e,r;return Qe(this,(function(o){for(e in t={},!0===this.configuration.useServerSideSearchCache&&(t.use_cache=!0),n)Array.isArray(n[e])&&(t[e]=n[e].join(","));return r=Object.assign({},n,t),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),r,{abortSignal:s}],{cacheResponseForSeconds:i})]}))}))},n.prototype.endpointPath=function(n){return"".concat(tr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(er).concat(void 0===n?"":"/"+n)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return er},enumerable:!1,configurable:!0}),n}();Ge.SearchOnlyDocuments=rr;var ir=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),or=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},sr=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(He,"t",{value:!0});var ur=h,cr=function(n){function t(t,e,r){return n.call(this,t,e,r)||this}return ir(t,n),t.prototype.create=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return sr(this,(function(e){if(!n)throw Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),n,t)]}))}))},t.prototype.upsert=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return sr(this,(function(e){if(!n)throw Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),n,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return sr(this,(function(e){if(!n)throw Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),n,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),n,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return sr(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),n)]}))}))},t.prototype.createMany=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return sr(this,(function(e){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(n,t)]}))}))},t.prototype.import=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){var e,r,i,o;return sr(this,(function(s){switch(s.label){case 0:if(Array.isArray(n))try{e=n.map((function(n){return JSON.stringify(n)})).join("\n")}catch(n){if(RangeError instanceof n&&(null==n?void 0:n.includes("Too many properties to enumerate")))throw Error("".concat(n,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw Error(n)}else e=n;return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:t,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:if(r=s.sent(),Array.isArray(n)){if(i=r.split("\n").map((function(n){return JSON.parse(n)})),(o=i.filter((function(n){return!1===n.success}))).length>0)throw new ur.ImportError("".concat(i.length-o.length," documents imported successfully, ").concat(o.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i);return[2,i]}return[2,r]}}))}))},t.prototype.export=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return sr(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),n)]}))}))},t.prototype.exportStream=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return sr(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),n,{responseType:"stream"})]}))}))},t}(Ge.SearchOnlyDocuments);He.default=cr;var ar={},fr=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},hr=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},lr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(ar,"t",{value:!0});var dr=lr(Fe),vr=function(){function n(n,t){this.collectionName=n,this.apiCall=t}return n.prototype.upsert=function(n,t){return fr(this,void 0,void 0,(function(){return hr(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return fr(this,void 0,void 0,(function(){return hr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(dr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),n}();ar.default=vr;var pr={},mr=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},br=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},wr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(pr,"t",{value:!0});var yr=wr(Fe),gr=wr(ar),kr=function(){function n(n,t,e){this.collectionName=n,this.overrideId=t,this.apiCall=e}return n.prototype.retrieve=function(){return mr(this,void 0,void 0,(function(){return br(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return mr(this,void 0,void 0,(function(){return br(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(yr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(gr.default.RESOURCEPATH,"/").concat(this.overrideId)},n}();pr.default=kr;var xr={},_r=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Or=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Sr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(xr,"t",{value:!0});var jr=Sr(Fe),Er=function(){function n(n,t){this.collectionName=n,this.apiCall=t}return n.prototype.upsert=function(n,t){return _r(this,void 0,void 0,(function(){return Or(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return _r(this,void 0,void 0,(function(){return Or(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(jr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),n}();xr.default=Er;var Rr={},Tr=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Pr=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Ar=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Rr,"t",{value:!0});var Cr=Ar(Fe),Nr=Ar(xr),Mr=function(){function n(n,t,e){this.collectionName=n,this.synonymId=t,this.apiCall=e}return n.prototype.retrieve=function(){return Tr(this,void 0,void 0,(function(){return Pr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Tr(this,void 0,void 0,(function(){return Pr(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Cr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(Nr.default.RESOURCEPATH,"/").concat(this.synonymId)},n}();Rr.default=Mr;var Ur={},qr=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Dr=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Fr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ur,"t",{value:!0}),Ur.Document=void 0;var $r=Fr(Fe),Br=Fr(He),Lr=function(){function n(n,t,e){this.collectionName=n,this.documentId=t,this.apiCall=e}return n.prototype.retrieve=function(){return qr(this,void 0,void 0,(function(){return Dr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return qr(this,void 0,void 0,(function(){return Dr(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.update=function(n,t){return void 0===t&&(t={}),qr(this,void 0,void 0,(function(){return Dr(this,(function(e){return[2,this.apiCall.patch(this.endpointPath(),n,t)]}))}))},n.prototype.endpointPath=function(){return"".concat($r.default.RESOURCEPATH,"/").concat(this.collectionName).concat(Br.default.RESOURCEPATH,"/").concat(this.documentId)},n}();Ur.Document=Lr;var zr=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Ir=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Hr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ie,"t",{value:!0});var Gr=Hr(Fe),Jr=Hr(He),Kr=h,Wr=Hr(ar),Xr=Hr(pr),Vr=Hr(xr),Yr=Hr(Rr),Qr=Ur,Zr=function(){function n(n,t,e){this.name=n,this.apiCall=t,this.configuration=e,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=n,this.apiCall=t,this.configuration=e,this.R=new Jr.default(this.name,this.apiCall,this.configuration),this.T=new Wr.default(this.name,this.apiCall),this.P=new Vr.default(this.name,this.apiCall)}return n.prototype.retrieve=function(){return zr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.update=function(n){return zr(this,void 0,void 0,(function(){return Ir(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),n)]}))}))},n.prototype.delete=function(){return zr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.exists=function(){return zr(this,void 0,void 0,(function(){var n;return Ir(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((n=t.sent())instanceof Kr.ObjectNotFound)return[2,!1];throw n;case 3:return[2]}}))}))},n.prototype.documents=function(n){return n?(void 0===this.individualDocuments[n]&&(this.individualDocuments[n]=new Qr.Document(this.name,n,this.apiCall)),this.individualDocuments[n]):this.R},n.prototype.overrides=function(n){return void 0===n?this.T:(void 0===this.individualOverrides[n]&&(this.individualOverrides[n]=new Xr.default(this.name,n,this.apiCall)),this.individualOverrides[n])},n.prototype.synonyms=function(n){return void 0===n?this.P:(void 0===this.individualSynonyms[n]&&(this.individualSynonyms[n]=new Yr.default(this.name,n,this.apiCall)),this.individualSynonyms[n])},n.prototype.endpointPath=function(){return"".concat(Gr.default.RESOURCEPATH,"/").concat(this.name)},n}();Ie.default=Zr;var ni={},ti=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},ei=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(ni,"t",{value:!0});var ri="/aliases",ii=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return ti(this,void 0,void 0,(function(){return ei(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return ti(this,void 0,void 0,(function(){return ei(this,(function(n){return[2,this.apiCall.get(ri)]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH,"/").concat(t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return ri},enumerable:!1,configurable:!0}),n}();ni.default=ii;var oi={},si=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},ui=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},ci=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(oi,"t",{value:!0});var ai=ci(ni),fi=function(){function n(n,t){this.name=n,this.apiCall=t}return n.prototype.retrieve=function(){return si(this,void 0,void 0,(function(){return ui(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return si(this,void 0,void 0,(function(){return ui(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(ai.default.RESOURCEPATH,"/").concat(this.name)},n}();oi.default=fi;var hi={};const li=t(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var di=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},vi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(hi,"t",{value:!0});var pi=li,mi="/keys",bi=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.create=function(t){return di(this,void 0,void 0,(function(){return vi(this,(function(e){return[2,this.apiCall.post(n.RESOURCEPATH,t)]}))}))},n.prototype.retrieve=function(){return di(this,void 0,void 0,(function(){return vi(this,(function(n){return[2,this.apiCall.get(mi)]}))}))},n.prototype.generateScopedSearchKey=function(n,t){var e=JSON.stringify(t),r=Buffer.from((0,pi.createHmac)("sha256",n).update(e).digest("base64")),i=n.substr(0,4),o="".concat(r).concat(i).concat(e);return Buffer.from(o).toString("base64")},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return mi},enumerable:!1,configurable:!0}),n}();hi.default=bi;var wi={},yi=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},gi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},ki=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(wi,"t",{value:!0});var xi=ki(hi),_i=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.retrieve=function(){return yi(this,void 0,void 0,(function(){return gi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return yi(this,void 0,void 0,(function(){return gi(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(xi.default.RESOURCEPATH,"/").concat(this.id)},n}();wi.default=_i;var Oi={},Si=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},ji=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(Oi,"t",{value:!0});var Ei=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Si(this,void 0,void 0,(function(){return ji(this,(function(n){return[2,this.apiCall.get("/debug")]}))}))},n}();Oi.default=Ei;var Ri={},Ti=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Pi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(Ri,"t",{value:!0});var Ai=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Ti(this,void 0,void 0,(function(){return Pi(this,(function(n){return[2,this.apiCall.get("/metrics.json")]}))}))},n}();Ri.default=Ai;var Ci={},Ni=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Mi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(Ci,"t",{value:!0});var Ui=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Ni(this,void 0,void 0,(function(){return Mi(this,(function(n){return[2,this.apiCall.get("/health")]}))}))},n}();Ci.default=Ui;var qi={},Di=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Fi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(qi,"t",{value:!0});var $i=function(){function n(n){this.apiCall=n}return n.prototype.perform=function(n,t){return void 0===t&&(t={}),Di(this,void 0,void 0,(function(){return Fi(this,(function(e){return[2,this.apiCall.post("".concat("/operations","/").concat(n),{},t)]}))}))},n}();qi.default=$i;var Bi={},Li=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},zi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Ii=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Bi,"t",{value:!0});var Hi=Ii(Je),Gi=function(){function n(n,t,e){void 0===e&&(e=!1),this.apiCall=n,this.configuration=t,this.useTextContentType=e,this.requestWithCache=new Hi.default}return n.prototype.clearCache=function(){this.requestWithCache.clearCache()},n.prototype.perform=function(n,t,e){void 0===t&&(t={});var r=(void 0===e?{}:e).cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r;return Li(this,void 0,void 0,(function(){var e,r,o;return zi(this,(function(s){return e={},this.useTextContentType&&(e["content-type"]="text/plain"),r={},!0===this.configuration.useServerSideSearchCache&&(r.use_cache=!0),o=Object.assign({},t,r),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",n,o,e],{cacheResponseForSeconds:i})]}))}))},n}();Bi.default=Gi;var Ji={},Ki=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Wi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(Ji,"t",{value:!0});var Xi=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return Ki(this,void 0,void 0,(function(){return Wi(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return Ki(this,void 0,void 0,(function(){return Wi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),n}();Ji.default=Xi;var Vi={},Yi=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Qi=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Zi=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Vi,"t",{value:!0});var no=Zi(Ji),to=function(){function n(n,t){this.presetId=n,this.apiCall=t}return n.prototype.retrieve=function(){return Yi(this,void 0,void 0,(function(){return Qi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Yi(this,void 0,void 0,(function(){return Qi(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(no.default.RESOURCEPATH,"/").concat(this.presetId)},n}();Vi.default=to;var eo={},ro={},io=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},oo=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(ro,"t",{value:!0});var so=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.upsert=function(n,t){return io(this,void 0,void 0,(function(){return oo(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return io(this,void 0,void 0,(function(){return oo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),n}();ro.default=so;var uo={},co=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},ao=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},fo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(uo,"t",{value:!0});var ho=fo(ro),lo=function(){function n(n,t){this.name=n,this.apiCall=t}return n.prototype.retrieve=function(){return co(this,void 0,void 0,(function(){return ao(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return co(this,void 0,void 0,(function(){return ao(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(ho.default.RESOURCEPATH,"/").concat(this.name)},n}();uo.default=lo;var vo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(eo,"t",{value:!0});var po=vo(ro),mo=vo(uo),bo=function(){function n(n){this.apiCall=n,this.individualAnalyticsRules={},this.apiCall=n,this.A=new po.default(this.apiCall)}return n.prototype.rules=function(n){return void 0===n?this.A:(void 0===this.individualAnalyticsRules[n]&&(this.individualAnalyticsRules[n]=new mo.default(n,this.apiCall)),this.individualAnalyticsRules[n])},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),n}();eo.default=bo;var wo={},yo=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},go=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(wo,"t",{value:!0});var ko=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return yo(this,void 0,void 0,(function(){return go(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return yo(this,void 0,void 0,(function(){return go(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),n}();wo.default=ko;var xo={},_o=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Oo=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},So=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(xo,"t",{value:!0});var jo=So(wo),Eo=function(){function n(n,t){this.stopwordId=n,this.apiCall=t}return n.prototype.retrieve=function(){return _o(this,void 0,void 0,(function(){return Oo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return _o(this,void 0,void 0,(function(){return Oo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(jo.default.RESOURCEPATH,"/").concat(this.stopwordId)},n}();xo.default=Eo;var Ro={},To={},Po=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Ao=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(To,"t",{value:!0});var Co=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.create=function(n){return Po(this,void 0,void 0,(function(){return Ao(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),n)]}))}))},n.prototype.retrieve=function(){return Po(this,void 0,void 0,(function(){return Ao(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),n}();To.default=Co;var No={},Mo=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Uo=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},qo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(No,"t",{value:!0});var Do=qo(To),Fo=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.update=function(n){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),n)]}))}))},n.prototype.retrieve=function(){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Do.default.RESOURCEPATH,"/").concat(this.id)},n}();No.default=Fo;var $o=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Bo=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Lo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ro,"t",{value:!0});var zo=Lo(To),Io=Lo(No),Ho="/conversations",Go=function(){function n(n){this.apiCall=n,this.individualConversationModels={},this.apiCall=n,this.C=new zo.default(this.apiCall)}return n.prototype.retrieve=function(){return $o(this,void 0,void 0,(function(){return Bo(this,(function(n){return[2,this.apiCall.get(Ho)]}))}))},n.prototype.models=function(n){return void 0===n?this.C:(void 0===this.individualConversationModels[n]&&(this.individualConversationModels[n]=new Io.default(n,this.apiCall)),this.individualConversationModels[n])},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return Ho},enumerable:!1,configurable:!0}),n}();Ro.default=Go;var Jo={},Ko=n&&n.O||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function s(n){try{c(r.next(n))}catch(n){o(n)}}function u(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,u)}c((r=r.apply(n,t||[])).next())}))},Wo=n&&n.S||function(n,t){var e,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(e=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(n,s)}catch(n){u=[6,n],r=0}finally{e=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},Xo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Jo,"t",{value:!0});var Vo=Xo(Ro),Yo=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.retrieve=function(){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.update=function(n){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),n)]}))}))},n.prototype.delete=function(){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Vo.default.RESOURCEPATH,"/").concat(this.id)},n}();Jo.default=Yo;var Qo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(s,"t",{value:!0});var Zo=Qo(u),ns=Qo(mn),ts=Qo(Fe),es=Qo(Ie),rs=Qo(ni),is=Qo(oi),os=Qo(hi),ss=Qo(wi),us=Qo(Oi),cs=Qo(Ri),as=Qo(Ci),fs=Qo(qi),hs=Qo(Bi),ls=Qo(Ji),ds=Qo(Vi),vs=Qo(eo),ps=Qo(wo),ms=Qo(xo),bs=Qo(Ro),ws=Qo(Jo),ys=function(){function n(n){var t;n.sendApiKeyAsQueryParam=null!==(t=n.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new Zo.default(n),this.apiCall=new ns.default(this.configuration),this.debug=new us.default(this.apiCall),this.metrics=new cs.default(this.apiCall),this.health=new as.default(this.apiCall),this.operations=new fs.default(this.apiCall),this.multiSearch=new hs.default(this.apiCall,this.configuration),this.N=new ts.default(this.apiCall),this.individualCollections={},this.M=new rs.default(this.apiCall),this.individualAliases={},this.U=new os.default(this.apiCall),this.individualKeys={},this.D=new ls.default(this.apiCall),this.individualPresets={},this.F=new ps.default(this.apiCall),this.individualStopwords={},this.analytics=new vs.default(this.apiCall),this.$=new bs.default(this.apiCall),this.individualConversations={}}return n.prototype.collections=function(n){return void 0===n?this.N:(void 0===this.individualCollections[n]&&(this.individualCollections[n]=new es.default(n,this.apiCall,this.configuration)),this.individualCollections[n])},n.prototype.aliases=function(n){return void 0===n?this.M:(void 0===this.individualAliases[n]&&(this.individualAliases[n]=new is.default(n,this.apiCall)),this.individualAliases[n])},n.prototype.keys=function(n){return void 0===n?this.U:(void 0===this.individualKeys[n]&&(this.individualKeys[n]=new ss.default(n,this.apiCall)),this.individualKeys[n])},n.prototype.presets=function(n){return void 0===n?this.D:(void 0===this.individualPresets[n]&&(this.individualPresets[n]=new ds.default(n,this.apiCall)),this.individualPresets[n])},n.prototype.stopwords=function(n){return void 0===n?this.F:(void 0===this.individualStopwords[n]&&(this.individualStopwords[n]=new ms.default(n,this.apiCall)),this.individualStopwords[n])},n.prototype.conversations=function(n){return void 0===n?this.$:(void 0===this.individualConversations[n]&&(this.individualConversations[n]=new ws.default(n,this.apiCall)),this.individualConversations[n])},n}();s.default=ys;var gs={},ks={};Object.defineProperty(ks,"t",{value:!0}),ks.SearchOnlyCollection=void 0;var xs=Ge,_s=function(){function n(n,t,e){this.name=n,this.apiCall=t,this.configuration=e,this.R=new xs.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return n.prototype.documents=function(){return this.R},n}();ks.SearchOnlyCollection=_s;var Os=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(gs,"t",{value:!0});var Ss=Os(u),js=Os(mn),Es=Os(Bi),Rs=ks,Ts=function(){function n(n){var t;n.sendApiKeyAsQueryParam=null===(t=n.sendApiKeyAsQueryParam)||void 0===t||t,!0===n.sendApiKeyAsQueryParam&&(n.apiKey||"").length>2e3&&(n.sendApiKeyAsQueryParam=!1),this.configuration=new Ss.default(n),this.apiCall=new js.default(this.configuration),this.multiSearch=new Es.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return n.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(n){n[0],n[1].documents().clearCache()}))},n.prototype.collections=function(n){if(n)return void 0===this.individualCollections[n]&&(this.individualCollections[n]=new Rs.SearchOnlyCollection(n,this.apiCall,this.configuration)),this.individualCollections[n];throw Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},n}();gs.default=Ts;var Ps=n&&n.h||(Object.create?function(n,t,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.t:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,r,i)}:function(n,t,e,r){void 0===r&&(r=e),n[r]=t[e]}),As=n&&n.l||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),Cs=n&&n.v||function(n){if(n&&n.t)return n;var t={};if(null!=n)for(var e in n)"default"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&Ps(t,n,e);return As(t,n),t},Ns=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(o,"t",{value:!0}),o.Errors=o.SearchClient=o.Client=void 0;var Ms=Ns(s);o.Client=Ms.default;var Us=Ns(gs);o.SearchClient=Us.default;var qs=Cs(h);o.Errors=qs;var Ds=o.default={Client:Ms.default,SearchClient:Us.default,Errors:qs};!function(){let n=!1,t=null;function e(){if(!n)return;const t=document.querySelector("script[data-sodo-search]");t&&t.remove();const e=document.getElementById("sodo-search-root");e&&e.remove()}class r{constructor(t={}){if(n)return window.magicPagesSearch;this.isModalOpen=!1;const e=window.__MP_SEARCH_CONFIG__||{typesenseNodes:[{host:"localhost",port:"8108",protocol:"http"}],typesenseApiKey:null,collectionName:null,commonSearches:[],theme:"system",enableHighlighting:!0,enableDidYouMean:!0,searchFields:{title:{weight:5,highlight:!0},excerpt:{weight:3,highlight:!0},plaintext:{weight:4,highlight:!0},"tags.name":{weight:4,highlight:!0},"tags.slug":{weight:3,highlight:!0}}};if(this.config={commonSearches:[],...t,...e,commonSearches:t.commonSearches||e.commonSearches||[]},!this.config.typesenseNodes||!this.config.typesenseApiKey||!this.config.collectionName)throw Error("MagicPagesSearch: Missing required Typesense configuration");this.selectedIndex=-1,this.searchDebounceTimeout=null,this.cachedElements={},this.init(),n=!0}getParentAccentColor(){try{return window.getComputedStyle(document.documentElement).getPropertyValue("--ghost-accent-color").trim()||null}catch(n){return null}}updateDarkMode(){const n=window.matchMedia("(prefers-color-scheme: dark)").matches;this.doc&&this.doc.documentElement.classList.toggle("dark",n)}async createIframe(){this.iframe=document.createElement("iframe");const n=window.innerWidth<640?3999999:3999997;this.iframe.style.cssText=`\n border: none;\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${n};\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);\n `,window.addEventListener("resize",(()=>{const n=window.innerWidth<640;this.iframe.style.zIndex=n?3999999:3999997})),document.body||await new Promise((n=>{const t=new MutationObserver((()=>{document.body&&(t.disconnect(),n())}));t.observe(document.documentElement,{childList:!0})})),document.body.appendChild(this.iframe),this.doc=this.iframe.contentDocument||this.iframe.contentWindow.document;const t=this.getParentAccentColor(),e=t?`\n :root {\n --ghost-accent-color: ${t};\n }`:"";this.doc.open(),this.doc.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <style>${e}</style>\n <style>/* Base document styles for iframe */\n:root {\n /* Color system */\n --color-base-50: 255 255 255;\n --color-base-100: 250 250 250;\n --color-base-200: 229 231 235;\n --color-base-300: 209 213 219;\n --color-base-700: 55 65 81;\n --color-base-800: 31 41 55;\n --color-base-900: 17 24 39;\n --color-base-950: 3 7 18;\n\n /* Animation configs */\n --transition-base: 80ms cubic-bezier(0.4, 0, 0.2, 1);\n --transition-smooth: 120ms cubic-bezier(0.4, 0, 0.2, 1);\n --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* System/Default theme (light) */\n#mp-search-wrapper {\n --color-surface: rgb(252, 252, 252);\n --color-surface-elevated: rgb(255, 255, 255);\n --color-surface-hover: rgba(0, 0, 0, 0.04);\n --color-text: rgb(23, 23, 23);\n --color-text-secondary: rgb(82, 82, 82);\n --color-border: rgba(0, 0, 0, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.15);\n --accent-color: var(--ghost-accent-color, #6366f1);\n --accent-color-hover: color-mix(in srgb, black 15%, var(--accent-color));\n --color-result-bg: rgb(252, 252, 252);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n}\n\n/* Dark theme based on system preference */\n#mp-search-wrapper[data-theme="dark"] {\n --color-surface: rgb(32, 32, 32);\n --color-surface-elevated: rgb(45, 45, 45);\n --color-surface-hover: rgba(255, 255, 255, 0.04);\n --color-text: rgb(250, 250, 250);\n --color-text-secondary: rgb(161, 161, 161);\n --color-border: rgba(255, 255, 255, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.4);\n --accent-color: var(--ghost-accent-color, #818cf8);\n --accent-color-hover: color-mix(in srgb, white 15%, var(--accent-color));\n --color-result-bg: rgb(38, 38, 38);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n}\n\n/* Base resets for iframe document */\nhtml,\nbody {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.5;\n}\n\n/* Utility classes */\n.hidden {\n display: none !important;\n}\n\n/* List reset */\n.list-none {\n list-style: none !important;\n padding-left: 0;\n}\n\n/* Reset InstantSearch cancel button */\n.ais-SearchBox-input[type="search"]::-webkit-search-cancel-button {\n display: none;\n}\n\n/* Modal structure */\n#mp-search-wrapper {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n background-color: var(--color-backdrop);\n backdrop-filter: blur(4px);\n align-items: flex-start;\n justify-content: center;\n -webkit-tap-highlight-color: transparent;\n padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);\n /* Above subscribe button on mobile */\n z-index: 3999999;\n}\n\n@media (min-width: 640px) {\n #mp-search-wrapper {\n /* Below subscribe button on desktop */\n z-index: 3999997;\n }\n}\n\n#mp-search-modal {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 0;\n}\n\n@media (min-width: 640px) {\n #mp-search-modal {\n padding-top: 10vh;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n}\n\n#mp-search-modal.hidden {\n display: none;\n}\n\n/* Backdrop with glass effect */\n.mp-backdrop {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n backdrop-filter: blur(8px);\n background: var(--color-backdrop);\n transition: opacity var(--transition-smooth);\n}\n\n/* Modal container and content */\n.mp-modal-container {\n position: relative;\n z-index: 1;\n width: 100%;\n max-width: 42rem;\n margin: 0 auto;\n padding: 0;\n height: 100vh;\n display: flex;\n flex-direction: column;\n transition: transform 0.1s ease-out;\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n height: auto;\n max-height: 60vh;\n min-height: 20vh;\n }\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n }\n}\n\n.mp-modal-content {\n background: var(--color-surface);\n border: none;\n border-radius: 0;\n box-shadow: none;\n overflow: hidden;\n width: 100%;\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n /* Ensure content doesn't overflow viewport */\n max-height: 100%;\n}\n\n@media (min-width: 640px) {\n .mp-modal-content {\n border: 1px solid var(--color-border);\n border-radius: 0.75rem;\n box-shadow: var(--shadow-lg);\n }\n}\n\n\n\n.mp-results-container {\n overflow-y: auto;\n overscroll-behavior: contain;\n position: relative;\n scroll-behavior: smooth;\n padding: 0.5rem 0;\n -webkit-overflow-scrolling: touch;\n flex: 1;\n min-height: 0;\n background: var(--color-surface);\n}\n\n@media (min-width: 640px) {\n .mp-results-container {\n height: auto;\n max-height: calc(60vh - 4rem);\n padding-bottom: 1rem;\n }\n}\n\n/* Loading state */\n.mp-loading-state {\n display: none;\n padding: 2rem 1.25rem;\n text-align: center;\n color: var(--color-text-secondary);\n}\n\n.mp-loading-state.active {\n display: block;\n}\n\n.mp-loading-spinner {\n display: inline-block;\n width: 2rem;\n height: 2rem;\n margin-bottom: 1rem;\n border: 2px solid var(--color-border);\n border-top-color: var(--accent-color);\n border-radius: 50%;\n animation: mp-spin 0.8s linear infinite;\n}\n\n@keyframes mp-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Search header */\n.mp-search-header {\n align-items: center;\n border-bottom: 1px solid var(--color-border);\n padding: 0.75rem 1.25rem;\n position: relative;\n background: var(--color-surface-elevated);\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 1rem;\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding: 0.875rem 1.5rem;\n }\n}\n\n.mp-search-input {\n -webkit-appearance: none;\n background: transparent;\n border-radius: 0.75rem;\n border: 1px solid var(--color-border);\n box-shadow: var(--shadow-sm);\n color: var(--color-text);\n font-size: 1rem;\n height: 2.75rem;\n outline: none;\n padding: 0.75rem 0.75rem 0.75rem 2.75rem;\n width: 100%;\n transition: all var(--transition-smooth);\n background: var(--color-surface);\n letter-spacing: -0.011em;\n}\n\n/* Hide the search clear button */\n.mp-search-input::-webkit-search-cancel-button {\n -webkit-appearance: none;\n display: none;\n}\n\n@media (min-width: 640px) {\n .mp-search-input {\n font-size: 1.125rem;\n height: 3rem;\n padding: 0.875rem 0.875rem 0.875rem 3rem;\n }\n}\n\n.mp-search-input:focus,\n.mp-search-input:focus-visible {\n background: var(--color-surface);\n outline: none;\n border-color: var(--accent-color);\n box-shadow: 0 0 0 1px var(--accent-color);\n}\n\n.mp-search-input::placeholder {\n color: var(--color-text-secondary);\n opacity: 0.7;\n}\n\n.mp-search-header {\n position: relative;\n padding-right: 4.25rem;\n}\n\n.mp-search-header:before {\n content: "";\n background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(55, 65, 81)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");\n height: 1.125rem;\n width: 1.125rem;\n position: absolute;\n left: 2rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0.7;\n color: var(--color-text);\n pointer-events: none;\n z-index: 1;\n transition: opacity var(--transition-base);\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding-right: 0;\n }\n\n .mp-search-header:before {\n left: 2.4rem;\n top: 50%;\n }\n}\n\n#mp-search-wrapper[data-theme="dark"] .mp-search-header:before {\n background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(209, 213, 219)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");\n}\n\n/* Results container */\n.mp-results-container {\n flex: 1;\n overflow-y: auto;\n padding: 0.75rem calc(1.5rem - 6px) 0.75rem 1.5rem;\n scroll-behavior: smooth;\n min-height: 0;\n}\n\n.mp-results-container::-webkit-scrollbar {\n width: 6px;\n}\n\n.mp-results-container::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.mp-results-container::-webkit-scrollbar-thumb {\n background: var(--color-border);\n border-radius: 3px;\n}\n\n.mp-results-container> :last-child {\n margin-bottom: 0.75rem;\n}\n\n/* Common searches */\n.mp-common-searches {\n padding: 0.75rem 0;\n padding-right: 6px;\n margin: 0;\n}\n\n.mp-common-searches.hidden {\n display: none;\n}\n\n.mp-common-searches-title {\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.05em;\n margin: 0 0 0.75rem;\n text-transform: uppercase;\n}\n\n.mp-common-search-btn {\n background: transparent;\n border: none;\n color: var(--color-text);\n border-radius: 0.5rem;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: 100%;\n padding: 0.75rem 1rem;\n text-decoration: none;\n transition: all var(--transition-base);\n font-size: 0.875rem;\n text-align: left;\n border: 1px solid transparent;\n}\n\n.mp-common-search-btn:hover,\n.mp-common-search-btn.mp-selected {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n}\n\n.mp-hits-list {\n margin-block-start: 0.5rem;\n margin-block-end: 0.5rem;\n}\n\n/* Search result link wrapper */\n.mp-result-link {\n text-decoration: none;\n color: inherit;\n display: block;\n}\n\n/* Search results */\n.mp-result-item {\n border-radius: 0.75rem;\n display: block;\n margin: 0.5rem 0;\n padding: 1.25rem;\n text-decoration: none;\n transition: background-color var(--transition-base), transform var(--transition-base);\n border: 1px solid transparent;\n word-break: break-word;\n background: var(--color-result-bg);\n}\n\n.mp-result-link:hover .mp-result-item,\n.mp-result-link.mp-selected .mp-result-item,\n.mp-result-link:focus .mp-result-item {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n transform: translateX(2px);\n}\n\n.mp-result-title {\n color: var(--accent-color);\n font-size: 1.125rem;\n font-weight: 600;\n line-height: 1.4;\n margin-top: 0;\n margin-bottom: 0.5rem;\n word-break: break-word;\n transition: color var(--transition-base);\n}\n\n.mp-result-excerpt {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.6;\n margin: 0;\n word-break: break-word;\n}\n\n/* Keyboard hints */\n.mp-keyboard-hints {\n display: flex;\n align-items: center;\n font-size: 0.75rem;\n gap: 1rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n user-select: none;\n margin-right: 0.5rem;\n}\n\n.mp-kbd {\n background: var(--color-surface-elevated);\n border: 1px solid var(--color-border);\n border-radius: 0.375rem;\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n padding: 0.25rem 0.375rem;\n box-shadow: var(--shadow-sm);\n font-size: 0.75rem;\n font-weight: 500;\n padding: 0.25rem 0.5rem;\n box-shadow: var(--shadow-sm);\n margin: 0 0.25rem;\n}\n\n/* Empty state */\n.mp-empty-message {\n color: var(--color-text-secondary);\n font-size: 1rem;\n padding: 2.5rem 1.5rem;\n text-align: center;\n}\n\n/* Close button */\n.mp-close-button {\n position: fixed;\n top: 1.25rem;\n right: 1.5rem;\n width: 2rem;\n height: 2rem;\n border-radius: 9999px;\n border: 1px solid var(--color-border);\n background: var(--color-surface-elevated);\n color: var(--color-text-secondary);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all var(--transition-base);\n font-size: 1.25rem;\n line-height: 1;\n z-index: 50;\n padding: 0;\n}\n\n.mp-close-button:hover {\n background: var(--color-surface-hover);\n color: var(--color-text);\n border-color: var(--accent-color);\n}\n\n.mp-close-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--accent-color);\n border-color: var(--accent-color);\n}\n\n/* Highlight styles */\n.ais-Highlight-highlighted,\n.ais-Snippet-highlighted,\n.mp-highlight {\n background: none;\n background: color-mix(in srgb, var(--accent-color) 15%, transparent);\n color: color-mix(in srgb, var(--accent-color) 85%, var(--color-text));\n font-weight: 600;\n border-radius: 2px;\n padding: 0 1px;\n}\n\n/* Mobile optimizations */\n@media (max-width: 640px) {\n .mp-keyboard-hints {\n display: none;\n }\n\n .mp-modal-content {\n margin-top: 0;\n border-radius: 0;\n height: 100vh;\n }\n\n .mp-modal-container {\n padding: 0;\n margin: 0;\n }\n\n .mp-results-container {\n padding-bottom: 1.5rem;\n max-height: calc(100vh - 4rem);\n }\n}</style>\n </head>\n <body>\n <div id="mp-search-wrapper" data-theme="${this.config.theme}">\n <div id="mp-search-modal" class="hidden" role="dialog" aria-modal="true" aria-label="Search">\n <div class="mp-backdrop"></div>\n <div class="mp-modal-container">\n <button class="mp-close-button" aria-label="Close search">\n <span aria-hidden="true">×</span>\n </button>\n <div class="mp-modal-content">\n <div class="mp-search-header">\n <div id="mp-searchbox" role="search"></div>\n <div class="mp-keyboard-hints">\n <span>\n <kbd class="mp-kbd">↑↓</kbd>\n to navigate\n </span>\n <span>\n <kbd class="mp-kbd">esc</kbd>\n to close\n </span>\n </div>\n </div>\n <div class="mp-results-container">\n ${this.getCommonSearchesHtml()}\n <div id="mp-hits" role="region" aria-label="Search results"></div>\n <div id="mp-loading-state" class="mp-loading-state" role="status" aria-live="polite">\n <div class="mp-loading-spinner" aria-hidden="true"></div>\n <div>Searching...</div>\n </div>\n <div id="mp-empty-state" class="hidden" role="status" aria-live="polite">\n <div class="mp-empty-message">\n <p>No results found for your search</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </body>\n </html>\n `),this.doc.close(),this.modal=this.doc.getElementById("mp-search-modal"),this.wrapper=this.doc.getElementById("mp-search-wrapper"),this.cachedElements={modal:this.modal,wrapper:this.wrapper},this.updateDarkMode(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{this.updateDarkMode()})),new MutationObserver((()=>{this.updateDarkMode()})).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.visualViewport&&window.visualViewport.addEventListener("resize",(()=>{if(this.modal&&this.modal.classList.contains("hidden"))return;const n=this.doc.querySelector(".mp-modal-container");n&&(n.style.height=window.visualViewport.height+"px",n.style.transform=`translateY(${window.visualViewport.offsetTop}px)`)}))}getCommonSearchesHtml(){return this.config.commonSearches?.length?`\n <div class="mp-common-searches">\n <div class="mp-common-searches-title" role="heading" aria-level="2">\n Common searches\n </div>\n <div id="mp-common-searches-container" role="list">\n ${this.config.commonSearches.map((n=>`\n <button type="button" \n class="mp-common-search-btn" \n data-search="${n}"\n role="listitem">\n ${n}\n </button>\n `)).join("")}\n </div>\n </div>\n `:'\n <div class="mp-common-searches">\n <div class="mp-empty-message">Start typing to search...</div>\n </div>\n '}getSearchParameters(){const n=Object.keys(this.config.searchFields||{}).length>0?this.config.searchFields:{title:{weight:5,highlight:!0},excerpt:{weight:3,highlight:!0},plaintext:{weight:4,highlight:!0},"tags.name":{weight:4,highlight:!0},"tags.slug":{weight:3,highlight:!0}},t=[],e=[],r=[];return Object.entries(n).forEach((([n,i])=>{t.push(n),e.push(i.weight||1),i.highlight&&r.push(n)})),{query_by:t.join(","),query_by_weights:e.join(","),highlight_full_fields:r.join(","),highlight_affix_num_tokens:30,include_fields:"title,url,excerpt,plaintext,published_at,tags",typo_tolerance:!1,num_typos:0,prefix:!0,per_page:20,drop_tokens_threshold:0,enable_nested_fields:!0,token_separators:" -+/.&",split_join_tokens:!0,tokenize_on_special_chars:!0,max_extra_prefix:5,max_extra_suffix:5,infix:"off,off,off,off,off",prioritize_exact_match:!0,sort_by:"_text_match:desc,published_at:desc"}}async init(){await this.setupUI(),await this.setupSearch(),this.initEventListeners(),this.setupHashHandling(),await this.handleInitialState()}async setupUI(){this.createIframe(),this.handleThemeChange()}async setupSearch(){await this.initSearch()}setupHashHandling(){window.addEventListener("hashchange",(()=>this.syncWithHash()))}async handleInitialState(){const n=new URLSearchParams(window.location.search),t=n.get("s")||n.get("q"),e=window.location.hash.split("/");let r=null;e.length>2&&"search"===e[1]&&(r=decodeURIComponent(e[2])),r?(await this.setModalState(!0,{skipUrlUpdate:!0}),this.searchInput&&(this.searchInput.value=r,this.handleSearch(r))):t?(await this.setModalState(!0),this.searchInput&&(this.searchInput.value=t,this.handleSearch(t))):"#/search"===window.location.hash&&await this.setModalState(!0)}async syncWithHash(){const n=window.location.hash.startsWith("#/search"),t=window.location.hash.split("/");let e=null;t.length>2&&"search"===t[1]&&(e=decodeURIComponent(t[2])),n!==this.isModalOpen?(await this.setModalState(n),n&&e&&this.searchInput&&(this.searchInput.value=e,this.handleSearch(e))):n&&e&&this.searchInput&&(this.searchInput.value=e,this.handleSearch(e))}extractTextBetweenQuotes(n){if(!n)return null;const t=n.replace(/%22/g,'"'),e=t.indexOf('"'),r=t.lastIndexOf('"');return-1!==e&&-1!==r&&e!==r?t.substring(e+1,r):null}initSearch(){if(this.initWidgets(),this.searchInput&&(this.cachedElements.commonSearches=this.doc.querySelector(".mp-common-searches"),this.cachedElements.loadingState=this.doc.getElementById("mp-loading-state"),this.cachedElements.emptyState=this.doc.getElementById("mp-empty-state"),!this.doc.querySelector("#mp-highlight-style"))){const n=this.doc.createElement("style");n.id="mp-highlight-style",n.textContent="\n /* Special styling for exact phrase matches */\n .mp-highlight.mp-exact-match {\n background-color: rgba(255, 165, 0, 0.3); /* Orange background */\n color: inherit;\n font-weight: 600;\n border-bottom: 1px dashed rgba(255, 165, 0, 0.7);\n position: relative;\n }\n .dark .mp-highlight.mp-exact-match {\n background-color: rgba(255, 140, 0, 0.2); /* Darker orange for dark mode */\n border-bottom-color: rgba(255, 140, 0, 0.6);\n }\n ",this.doc.head.appendChild(n)}}async handleSearch(n){const{commonSearches:t,emptyState:e,loadingState:r}=this.cachedElements,i=n;if(n=n?.trim(),!n)return this.selectedIndex=-1,this.hitsList&&this.hitsList.classList.add("hidden"),t&&t.classList.remove("hidden"),e&&e.classList.add("hidden"),void(r&&r.classList.remove("active"));t&&t.classList.add("hidden"),this.hitsList&&this.hitsList.classList.remove("hidden"),r&&r.classList.add("active");try{this.typesenseClient||(this.typesenseClient=new Ds.Client({nodes:this.config.typesenseNodes,apiKey:this.config.typesenseApiKey,connectionTimeoutSeconds:2}));const t=this.getSearchParameters();let o={q:n,query_by:t.query_by,query_by_weights:t.query_by_weights,highlight_full_fields:t.highlight_full_fields,highlight_affix_num_tokens:t.highlight_affix_num_tokens,highlight_start_tag:"<mark>",highlight_end_tag:"</mark>",include_fields:t.include_fields,typo_tolerance:t.typo_tolerance,num_typos:t.num_typos,prefix:t.prefix,per_page:t.per_page,drop_tokens_threshold:t.drop_tokens_threshold||0,enable_nested_fields:t.enable_nested_fields||!0,token_separators:t.token_separators||" -+/.",split_join_tokens:t.split_join_tokens||!0,tokenize_on_special_chars:t.tokenize_on_special_chars||!0,infix:"off,off,off,off,off"};const s=n.match(/^tag:([\w-]+)$/i);let u=!1;if(s){u=!0;const n=s[1];o={...o,q:"",filter_by:"tags.slug:="+n,sort_by:"published_at:desc",infix:"off"}}else if(n.includes("-"))try{const t=n.split(/\s+/);if(n.trim().endsWith("-"));else if(!v){const n=t.filter((n=>n.includes("-")&&/^[\w-]+$/.test(n)));if(n.length>0){u=!0;const t=n.map((n=>"tags.slug:="+n)).join(" || ");o={...o,filter_by:t,enable_nested_fields:!0,prioritize_exact_match:!0}}}}catch(n){}const c=n.includes('"')||n.includes("%22")||i?.includes('"')||i?.includes("%22"),a=n.lastIndexOf('"')>0&&n.lastIndexOf('"')!==n.indexOf('"')||i?.lastIndexOf('"')>0&&i?.lastIndexOf('"')!==i?.indexOf('"'),f=n.includes('"')&&n.split('"').length>2||n.includes("%22")&&n.split("%22").length>2,h=i?.includes('"')&&i?.split('"').length>2||i?.includes("%22")&&i?.split("%22").length>2,l=new URLSearchParams(window.location.search).get("q"),d=l&&(l.includes('"')||l.includes("%22")),v=f||h||d||c&&a;if(n.includes("/")&&!u){o.tokenize_on_special_chars=!0,o.prefix=!0,o.drop_tokens_threshold=0;const t=n.split(" ").filter((n=>n.includes("/")));t.length>0&&t.forEach((n=>{n.split("/").length}))}let p,m=!1,b=null;if(v){m=!0;let t=n;if(b=this.extractTextBetweenQuotes(n),!b){const t=this.extractTextBetweenQuotes(i),e=this.extractTextBetweenQuotes(l);b=t||e||n.replace(/"/g,"").replace(/%22/g,"")}t=b;const{infix:e,...r}=o;if(o={...r,q:t,prefix:!1,split_join_tokens:!1,exhaustive_search:!0,highlight_affix_num_tokens:30,highlight_start_tag:"<mark>",highlight_end_tag:"</mark>",drop_tokens_threshold:0,max_candidates:1e4,sort_by:"_text_match:desc",num_typos:0,typo_tokens_threshold:1,prioritize_exact_match:!0,prioritize_token_position:!0,enable_nested_fields:!0},t.includes(" ")){o.strict_mode=!0;const n=o.query_by.split(","),e=t.trim().split(/\s+/);if(e.length>1){const t=[];n.forEach((n=>{const r=e.map((t=>`${n}:${t}`));t.push(`(${r.join(" && ")})`)})),o.filter_by||(o.filter_by=t.join(" || ")),o.rank_tokens_by_key=o.query_by,o.prioritize_exact_match=!0,o.prioritize_token_position=!0,o.sort_by="_text_match:desc"}}}try{p=await this.typesenseClient.collections(this.config.collectionName).documents().search(o),p.hits}catch(n){p={hits:[]}}if(r&&r.classList.remove("active"),0===p.hits.length)return e&&e.classList.remove("hidden"),void(this.hitsList&&(this.hitsList.innerHTML="",this.hitsList.classList.add("hidden")));e&&e.classList.add("hidden");const w=this.doc.querySelector("#mp-hits");if(!w)return;w.innerHTML="";const y=this.doc.createElement("div");if(y.className="mp-hits-list list-none",w.appendChild(y),this.hitsList=y,m&&b&&p.hits.length>0){const n=document.createElement("div");n.className="mp-search-banner",n.innerHTML=`\n <div class="mp-quote-search-info">\n <span class="mp-quote-icon">"</span>\n Showing exact matches for <strong>${b}</strong>\n <span class="mp-quote-icon">"</span>\n </div>\n `,this.hitsList.appendChild(n)}const g=p.hits.map((n=>{let t=n.document.plaintext||"";t||(t=n.document.excerpt||"");let e="",r=this.searchInput?.value?.trim().toLowerCase()||"",o=m?b:null;if(o||(r.startsWith('"')&&r.endsWith('"')||r.startsWith("%22")&&r.endsWith("%22")?o=this.extractTextBetweenQuotes(r):(r.includes('"')||r.includes("%22"))&&(o=this.extractTextBetweenQuotes(r),o||(o=this.extractTextBetweenQuotes(i)))),o&&(r=o.toLowerCase()),r&&t.toLowerCase().includes(r)){const n=t.toLowerCase().indexOf(r),i=Math.max(0,n-60),s=Math.min(t.length,n+r.length+60),u=t.substring(i,s),c=r.split(/\s+/);let a=u;if(!1!==this.config.enableHighlighting){if(c.sort(((n,t)=>t.length-n.length)),o&&o.length>2)try{const n=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=RegExp(`(${n})`,"gi");a=a.replace(t,'<mark class="mp-highlight">$1</mark>')}catch(n){}for(const n of c)if(!(n.length<2))try{const t=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e=RegExp(`(${t})`,"gi");a=a.replace(e,(function(n){return/<mark[^>]*>[^<]*$/i.test(a.substring(0,a.indexOf(n)))&&/^[^<]*<\/mark>/i.test(a.substring(a.indexOf(n)+n.length))?n:'<mark class="mp-highlight">'+n+"</mark>"}))}catch(n){}}e=a,i>0&&(e="..."+e),s<t.length&&(e+="...")}else e=t.trim().substring(0,160).replace(/\s+[^\s]*$/,"...");let s=n.document.title||"Untitled";if(r&&!1!==this.config.enableHighlighting){if(o&&o.length>2)try{const n=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=RegExp(`(${n})`,"gi");s=s.replace(t,'<mark class="mp-highlight">$1</mark>')}catch(n){}const n=r.split(/\s+/);n.sort(((n,t)=>t.length-n.length));for(const t of n)if(!(t.length<2))try{const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e=RegExp(`(${n})`,"gi");s=s.replace(e,(function(n){return/<mark[^>]*>[^<]*$/i.test(s.substring(0,s.indexOf(n)))&&/^[^<]*<\/mark>/i.test(s.substring(s.indexOf(n)+n.length))?n:'<mark class="mp-highlight">'+n+"</mark>"}))}catch(n){}}return`\n <a href="${n.document.url||"#"}" \n class="mp-result-link"\n aria-label="${s.replace(/<[^>]*>/g,"")}">\n <article class="mp-result-item" role="article">\n <h3 class="mp-result-title" role="heading" aria-level="3">${s}</h3>\n <p class="mp-result-excerpt" aria-label="Article excerpt">${e}</p>\n </article>\n </a>\n `})).join("");this.hitsList.innerHTML+=g,this.hitsList.classList.remove("hidden")}catch(n){r&&r.classList.remove("active"),e&&e.classList.remove("hidden"),this.hitsList&&(this.hitsList.innerHTML="",this.hitsList.classList.add("hidden"))}}initWidgets(){const n=this.doc.querySelector("#mp-searchbox");if(!n)return;n.innerHTML="";const t=this.doc.createElement("form");t.className="",t.setAttribute("novalidate",""),t.setAttribute("role","search");const e=this.doc.createElement("input");e.type="search",e.placeholder="Search for anything",e.className="mp-search-input",e.setAttribute("autocomplete","off"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false"),e.setAttribute("maxlength","512"),e.setAttribute("aria-label","Search"),t.appendChild(e),n.appendChild(t),this.searchInput=e,setTimeout((()=>e.focus()),0),t.addEventListener("submit",(n=>{n.preventDefault()})),e.addEventListener("input",(n=>{const t=n.target.value;this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout((()=>{this.handleSearch(t)}),80)})),this.searchInput=e,this.searchForm=t;const r=this.doc.querySelector("#mp-hits");if(!r)return;const i=this.doc.createElement("div");i.className="mp-hits-list list-none",r.appendChild(i),this.hitsList=i}initEventListeners(){const n=this.doc.querySelector(".mp-close-button");n&&n.addEventListener("click",(()=>this.closeModal())),this.modal.addEventListener("click",(n=>{(n.target===this.modal||n.target.classList.contains("mp-backdrop"))&&this.closeModal()}));const t=this.modal.querySelector(".mp-modal-content");t&&t.addEventListener("click",(n=>n.stopPropagation())),this.attachCommonSearchListeners(),document.addEventListener("keydown",(n=>{(n.metaKey||n.ctrlKey)&&"k"===n.key&&(n.preventDefault(),this.openModal()),"/"!==n.key||n.ctrlKey||n.metaKey||"INPUT"===n.target.tagName||"TEXTAREA"===n.target.tagName||(n.preventDefault(),this.openModal())})),this.doc.addEventListener("keydown",(n=>this.handleKeydown(n))),document.querySelectorAll("[data-ghost-search]").forEach((n=>{n.addEventListener("click",(n=>{n.preventDefault(),n.stopPropagation(),this.openModal()}))}));const e=this.doc.querySelector("#mp-hits");e&&e.addEventListener("click",(n=>{const t=n.target.closest(".mp-result-link");t&&(n.preventDefault(),window.location.href=t.href)}))}attachCommonSearchListeners(){const n=this.doc.getElementById("mp-common-searches-container");if(!n)return;const t=n=>{const t=n.target.closest(".mp-common-search-btn");if(!t)return;n.preventDefault();const e=t.dataset.search,r=this.doc.querySelector(".mp-search-input");r&&(this.selectedIndex=-1,r.value=e,r.dispatchEvent(new Event("input",{bubbles:!0})),this.search.helper.setQuery(e).search(),setTimeout((()=>{r.focus(),r.setSelectionRange(e.length,e.length)}),0))};n.addEventListener("click",t),n.addEventListener("touchend",t)}async setModalState(n,t={}){const{skipUrlUpdate:e=!1}=t;if(n&&!this.searchUI&&await this.initSearch(),n&&(await new Promise((n=>{const t=()=>{this.iframe&&this.doc&&"complete"===this.doc.readyState?n():setTimeout(t,10)};t()})),await new Promise((n=>setTimeout(n,50)))),this.iframe.style.pointerEvents=n?"auto":"none",this.iframe.style.opacity=n?"1":"0",this.modal.classList.toggle("hidden",!n),n){const n=this.doc.querySelector(".mp-search-input");n&&n.focus()}else this.selectedIndex=-1,this.searchInput&&(this.searchInput.value=""),this.handleSearch("");if(!e){const t=new URL(window.location.href),e=t.pathname,r=t.searchParams;if(n){const n=r.get("s")||r.get("q");if(n){const t="#/search/"+encodeURIComponent(n).replace(/%20/g,"+");r.delete("s"),r.delete("q");const i=r.toString(),o=`${e}${i?"?"+i:""}`;history.replaceState(null,null,`${o}${t}`)}else"#/search"!==window.location.hash&&history.replaceState(null,null,`${e}${window.location.search}#/search`)}else{const n=window.location.hash.split("/"),t=n.length>2?decodeURIComponent(n[2]):null;t?(r.set("q",t),history.replaceState(null,null,`${e}?${r.toString()}`)):history.replaceState(null,null,`${e}${window.location.search}`)}}}async openModal(){await this.setModalState(!0);const n=new URLSearchParams(window.location.search),t=n.get("s")||n.get("q");t&&this.searchInput&&(this.searchInput.value=t,this.handleSearch(t))}closeModal(){this.setModalState(!1)}handleKeydown(n){if("Escape"===n.key)return n.preventDefault(),void this.closeModal();if(n.target===this.searchInput&&!(window.innerWidth<640))switch(n.key){case"ArrowDown":n.preventDefault(),this.navigateResults("next");break;case"ArrowUp":n.preventDefault(),this.navigateResults("prev");break;case"Enter":-1!==this.selectedIndex&&(n.preventDefault(),this.handleEnterKey())}}navigateResults(n){const t=[...this.doc.querySelectorAll(".mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((n=>null!==n.offsetParent&&!n.closest(".hidden")));if(0===t.length)return;-1===this.selectedIndex?this.selectedIndex="next"===n?0:t.length-1:this.selectedIndex="next"===n?(this.selectedIndex+1)%t.length:(this.selectedIndex-1+t.length)%t.length,t.forEach((n=>n.classList.remove("mp-selected")));const e=t[this.selectedIndex];e.classList.add("mp-selected"),e.scrollIntoView({block:"nearest",behavior:"auto"})}handleEnterKey(){const n=[...this.doc.querySelectorAll(".mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((n=>null!==n.offsetParent&&!n.closest(".hidden")));if(this.selectedIndex>=0&&this.selectedIndex<n.length){const t=n[this.selectedIndex];t.classList.contains("mp-result-link")?window.location.href=t.href:(this.searchInput.value=t.textContent.trim(),this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}}handleThemeChange(){if(this.wrapper&&(this.wrapper.classList.remove("dark"),this.wrapper.setAttribute("data-theme",this.config.theme),"system"===this.config.theme)){const n=window.matchMedia("(prefers-color-scheme: dark)"),t=n=>{this.wrapper.setAttribute("data-theme",n.matches?"dark":"light")};t(n),n.addEventListener("change",t)}}}function i(){const i=new URLSearchParams(window.location.search),o=i.has("s")||i.has("q");!window.magicPagesSearch&&(window.__MP_SEARCH_CONFIG__||"#/search"===window.location.hash||o||document.querySelectorAll("[data-ghost-search]").length>0)&&(window.magicPagesSearch=new r,function(){t=new MutationObserver((t=>{if(n)for(const n of t)for(const t of n.addedNodes)1===t.nodeType&&("SCRIPT"===t.tagName&&t.hasAttribute("data-sodo-search")||"sodo-search-root"===t.id)&&t.remove()})),t.observe(document.documentElement,{childList:!0,subtree:!0});const r=setInterval(e,100);setTimeout((()=>{clearInterval(r),t&&(t.disconnect(),t=null)}),5e3)}())}window.MagicPagesSearch=r,new Promise((n=>{if(document.body)n();else{const t=new MutationObserver((()=>{document.body&&(t.disconnect(),n())}));t.observe(document.documentElement,{childList:!0})}})).then(i),"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",i)}()}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicpages/ghost-typesense-search-ui",
3
- "version": "1.5.1",
3
+ "version": "1.6.1",
4
4
  "description": "A vanilla JavaScript search UI for Ghost + Typesense integration",
5
5
  "type": "module",
6
6
  "main": "dist/search.min.js",