typesense-instantsearch-adapter 3.0.2 → 3.0.3-2
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/dist/typesense-instantsearch-adapter.js +8619 -7726
- package/dist/typesense-instantsearch-adapter.js.map +1 -1
- package/dist/typesense-instantsearch-adapter.min.js +1 -1
- package/dist/typesense-instantsearch-adapter.min.js.LICENSE.txt +1 -1
- package/dist/typesense-instantsearch-adapter.min.js.map +1 -1
- package/index.d.ts +31 -19
- package/lib/FacetSearchResponseAdapter.js +1 -1
- package/lib/FacetSearchResponseAdapter.js.map +1 -1
- package/lib/SearchResponseAdapter.js +1 -1
- package/lib/SearchResponseAdapter.js.map +1 -1
- package/lib/TypesenseInstantsearchAdapter.js +4 -4
- package/lib/TypesenseInstantsearchAdapter.js.map +1 -1
- package/package.json +6 -5
- package/src/FacetSearchResponseAdapter.js +1 -1
- package/src/SearchResponseAdapter.js +1 -1
- package/src/TypesenseInstantsearchAdapter.js +4 -4
- /package/scripts/{postinstall.js → postinstall.cjs} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see typesense-instantsearch-adapter.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TypesenseInstantSearchAdapter=t():e.TypesenseInstantSearchAdapter=t()}(self,(()=>(()=>{var e={3065:function(e,t,n){var r,i;!function(o,a){"use strict";r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?e:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(u.call(this),this[e].apply(this,arguments))}}function l(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||c.apply(this,arguments)}function d(e,n){var a,s,c,d=this,p="loglevel";function h(){var e;if(typeof window!==t&&p){try{e=window.localStorage[p]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(p),i=n.indexOf(r+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function f(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?p+=":"+e:"symbol"==typeof e&&(p=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=n||l,d.getLevel=function(){return null!=c?c:null!=s?s:a},d.setLevel=function(e,n){return c=f(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&p){try{return void(window.localStorage[p]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(p)+"="+n+";"}catch(e){}}}(c),u.call(d)},d.setDefaultLevel=function(e){s=f(e),h()||d.setLevel(e,!1)},d.resetLevel=function(){c=null,function(){if(typeof window!==t&&p){try{window.localStorage.removeItem(p)}catch(e){}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(o!==d&&(a=f(o.getLevel())),u.call(d),o===d)for(var e in i)i[e].rebuild()},a=f(o?o.getLevel():"WARN");var y=h();null!=y&&(c=f(y)),u.call(d)}(o=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new d(e,o.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=p),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(t,n,t,e))||(e.exports=i)}()},8567:(e,t,n)=>{"use strict";t._t=void 0;var r=n(3301),i=r.__importDefault(n(5641));i.default;var o=r.__importDefault(n(8557));t._t=o.default;r.__importStar(n(4410));i.default,o.default},5300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(612)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},612:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/aliases",o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(i)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=r.__importDefault(n(3614)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new o.default(e,this.apiCall)),this.individualAnalyticsRules[e])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e}();t.default=s},4145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath(),e)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/events"},enumerable:!1,configurable:!0}),e}();t.default=i},3614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},4695:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},9813:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e,{},{})]}))}))},e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){return t={},e&&(t.rule_tag=e),[2,this.apiCall.get(this.endpointPath(),t)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},5276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},3421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=r.__importDefault(n(4695)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'analyticsV1' is deprecated starting with Typesense Server v30 and will be removed in a future release. Please use 'analytics' instead."),e.hasWarnedDeprecation=!0),void 0===t?this._analyticsRules:(void 0===this.individualAnalyticsRules[t]&&(this.individualAnalyticsRules[t]=new o.default(t,this.apiCall)),this.individualAnalyticsRules[t])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=s},5996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(6425)),o=n(5978),a=n(7205),s=n(4410),u=r.__importDefault(n(7796)),c=n(7353),l=!0,d="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node&&"undefined"==typeof window,p=function(){function e(e){this.configuration=e,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 e.prototype.get=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){void 0===t&&(t={});var i=void 0===n?{}:n,o=i.abortSignal,a=void 0===o?null:o,s=i.responseType,u=void 0===s?void 0:s,c=i.streamConfig,l=void 0===c?void 0:c,d=i.isStreamingRequest;return r.__generator(this,(function(n){return[2,this.performRequest("get",e,{queryParameters:t,abortSignal:a,responseType:u,streamConfig:l,isStreamingRequest:d})]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.performRequest("delete",e,{queryParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.post=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n,i,o){void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={});var a=void 0===o?{}:o,s=a.abortSignal,u=void 0===s?null:s,c=a.responseType,l=void 0===c?void 0:c,d=a.streamConfig,p=void 0===d?void 0:d,h=a.isStreamingRequest;return r.__generator(this,(function(r){return[2,this.performRequest("post",e,{queryParameters:n,bodyParameters:t,additionalHeaders:i,abortSignal:u,responseType:l,streamConfig:p,isStreamingRequest:h})]}))}))},e.prototype.put=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("put",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.patch=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("patch",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.getAdapter=function(){if(this.configuration.axiosAdapter)return"function"==typeof this.configuration.axiosAdapter?this.configuration.axiosAdapter:"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent?i.default.getAdapter(this.configuration.axiosAdapter).bind(globalThis):i.default.getAdapter(this.configuration.axiosAdapter)},e.prototype.performRequest=function(e,t,n){return r.__awaiter(this,arguments,void 0,(function(e,t,n){var s,u,c,p,h,f,y,v,m,_,g,b=n.queryParameters,w=void 0===b?null:b,C=n.bodyParameters,S=void 0===C?null:C,R=n.additionalHeaders,O=void 0===R?{}:R,P=n.abortSignal,E=void 0===P?null:P,A=n.responseType,T=void 0===A?void 0:A,j=n.skipConnectionTimeout,N=void 0!==j&&j,x=n.enableKeepAlive,k=void 0===x?void 0:x,D=n.streamConfig,U=void 0===D?void 0:D,I=n.isStreamingRequest;return r.__generator(this,(function(n){switch(n.label){case 0:this.configuration.validate(),I&&(this.logger.debug("Request: Performing streaming request to ".concat(t)),d||"undefined"==typeof fetch||(this.logger.debug("Using fetch adapter for browser streaming"),T="stream")),s=Date.now(),c=!1,this.logger.debug("Request #".concat(s,": Performing ").concat(e.toUpperCase()," request: ").concat(t)),p=function(n){var p,f,y,b,C,R,P;return r.__generator(this,(function(A){switch(A.label){case 0:if(p=h.getNextNode(s),h.logger.debug("Request #".concat(s,": Attempting ").concat(e.toUpperCase()," request Try #").concat(n," to Node ").concat(p.index)),E&&E.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];f=void 0,A.label=1;case 1:return A.trys.push([1,3,5,6]),(y={method:e,url:h.uriFor(t,p),headers:Object.assign({},h.defaultHeaders(),O,h.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,validateStatus:function(e){return e>0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]}).adapter=I&&!d?"fetch":h.getAdapter(),!0!==N&&(y.timeout=1e3*h.connectionTimeoutSeconds),w&&0!==Object.keys(w).length&&(y.params=w),h.sendApiKeyAsQueryParam&&(y.params=y.params||{},y.params["x-typesense-api-key"]=h.apiKey),h.configuration.httpAgent?(h.logger.debug("Request #".concat(s,": Using custom httpAgent")),y.httpAgent=h.configuration.httpAgent):!0===k&&(d?(h.logger.debug("Request #".concat(s,": Enabling KeepAlive")),y.httpAgent=new o.Agent({keepAlive:!0})):h.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),h.configuration.httpsAgent?(h.logger.debug("Request #".concat(s,": Using custom httpsAgent")),y.httpsAgent=h.configuration.httpsAgent):!0===k&&(d?(h.logger.debug("Request #".concat(s,": Enabling keepAlive")),y.httpsAgent=new a.Agent({keepAlive:!0})):h.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),h.configuration.paramsSerializer&&(h.logger.debug("Request #".concat(s,": Using custom paramsSerializer")),y.paramsSerializer=h.configuration.paramsSerializer),S&&("string"==typeof S&&0!==S.length||"object"==typeof S&&0!==Object.keys(S).length)&&(y.data=S),E&&(b=i.default.CancelToken,C=b.source(),f=function(){c=!0,C.cancel()},E.addEventListener("abort",f),y.cancelToken=C.token),I?(y.responseType="stream",d||(y.headers=r.__assign(r.__assign({},y.headers),{Accept:"text/event-stream"}))):T&&(y.responseType=T),[4,(0,i.default)(y)];case 2:if((R=A.sent()).status>=1&&R.status<=499&&h.setNodeHealthcheck(p,l),h.logger.debug("Request #".concat(s,": Request to Node ").concat(p.index," was made. Response Code was ").concat(R.status,".")),R.status>=200&&R.status<300)return I?[2,{value:h.handleStreamingResponse(R,U)}]:[2,{value:Promise.resolve(R.data)}];if(R.status<500)return[2,{value:Promise.reject(h.customErrorForResponse(R,null===(v=R.data)||void 0===v?void 0:v.message,y.data))}];throw h.customErrorForResponse(R,null===(m=R.data)||void 0===m?void 0:m.message,y.data);case 3:return P=A.sent(),c||h.setNodeHealthcheck(p,!1),u=P,h.logger.warn("Request #".concat(s,": Request to Node ").concat(p.index,' failed due to "').concat(null!==(_=null==P?void 0:P.code)&&void 0!==_?_:""," ").concat(P.message).concat(null==P.response?"":" - "+JSON.stringify(null===(g=P.response)||void 0===g?void 0:g.data),'"')),c?[2,{value:Promise.reject(new Error("Request aborted by caller."))}]:(I&&h.invokeOnErrorCallback(P,U),n<h.numRetriesPerRequest+1?(h.logger.warn("Request #".concat(s,": Sleeping for ").concat(h.retryIntervalSeconds,"s and then retrying request...")),[4,h.timer(h.retryIntervalSeconds)]):(h.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,{value:Promise.reject(u)}]));case 4:return A.sent(),[3,6];case 5:return E&&f&&E.removeEventListener("abort",f),[7];case 6:return[2]}}))},h=this,f=1,n.label=1;case 1:return f<=this.numRetriesPerRequest+1?[5,p(f)]:[3,4];case 2:if("object"==typeof(y=n.sent()))return[2,y.value];n.label=3;case 3:return f++,[3,1];case 4:return this.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,Promise.reject(u)]}}))}))},e.prototype.processStreamingLine=function(e){if(!e.trim()||"data: [DONE]"===e)return null;if(e.startsWith("data: "))return this.processDataLine(e.slice(6).trim());if(e.trim().startsWith("{"))try{var t=JSON.parse(e.trim());return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e.trim()}}return{conversation_id:"unknown",message:e.trim()}},e.prototype.processDataLine=function(e){if(!e)return null;if(e.startsWith("{"))try{var t=JSON.parse(e);return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e}}return{conversation_id:"unknown",message:e}},e.prototype.handleStreamingResponse=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return this.logger.debug("Handling streaming response. Environment: ".concat(d?"Node.js":"Browser")),d&&e.data?[2,this.handleNodeStreaming(e,t)]:d?(this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(e.data,t),[2,Promise.resolve(e.data)]):[2,this.handleBrowserStreaming(e,t)]}))}))},e.prototype.handleNodeStreaming=function(e,t){var n=this;return this.logger.debug("Processing Node.js stream"),new Promise((function(r,i){var o=e.data,a=[],s="";o.on("data",(function(e){var r;try{var o=e.toString(),u=(s+=o).split("\n");s=null!==(r=u.pop())&&void 0!==r?r:"",n.processStreamLines(u,a,t)}catch(e){i(e)}})),o.on("end",(function(){if(s.trim().length>0){var i=s.split("\n");n.processStreamLines(i,a,t)}n.finalizeStreamResult(a,r,e,t)})),o.on("error",(function(e){n.logger.error("Stream error: ".concat(e)),n.invokeOnErrorCallback(e,t),i(e)}))}))},e.prototype.handleBrowserStreaming=function(e,t){var n=this;return this.logger.debug("Processing browser stream"),new Promise((function(i,o){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){try{return e.data&&"function"==typeof e.data.getReader?[2,this.handleBrowserReadableStream(e.data,i,o,e,t)]:"string"==typeof e.data?[2,this.handleBrowserStringResponse(e.data,i,e,t)]:"object"==typeof e.data&&null!==e.data?(this.logger.debug("No stream found, but data object is available"),this.invokeOnCompleteCallback(e.data,t),[2,i(e.data)]):(this.logger.error("No usable data found in response"),[2,o(new Error("No usable data found in response"))])}catch(e){this.logger.error("Error processing streaming response: ".concat(e)),this.invokeOnErrorCallback(e,t),o(e)}return[2]}))}))}))},e.prototype.handleBrowserReadableStream=function(e,t,n,i,o){return r.__awaiter(this,void 0,void 0,(function(){var a,s,u,c,l,d,p,h,f,y;return r.__generator(this,(function(r){switch(r.label){case 0:this.logger.debug("Found ReadableStream in response.data"),a=e.getReader(),s=[],u="",r.label=1;case 1:r.trys.push([1,5,,6]),r.label=2;case 2:return[4,a.read()];case 3:return c=r.sent(),l=c.done,d=c.value,l?(this.logger.debug("Stream reading complete"),u.trim()&&(p=u.split("\n"),this.processStreamLines(p,s,o)),[3,4]):(h=(new TextDecoder).decode(d),this.logger.debug("Received chunk: ".concat(h.length," bytes")),f=(u+=h).split("\n"),u=f.pop()||"",this.processStreamLines(f,s,o),[3,2]);case 4:return this.finalizeStreamResult(s,t,i,o),[3,6];case 5:return y=r.sent(),this.logger.error("Stream error: ".concat(y)),this.invokeOnErrorCallback(y,o),n(y),[3,6];case 6:return[2]}}))}))},e.prototype.handleBrowserStringResponse=function(e,t,n,r){this.logger.debug("Processing text response as stream data");var i=[],o=e.split("\n");if(this.processStreamLines(o,i,r),i.length>0){var a=this.combineStreamingChunks(i);this.invokeOnCompleteCallback(a,r),t(a)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.processStreamLines=function(e,t,n){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.trim()&&"data: [DONE]"!==o){var a=this.processStreamingLine(o);null!==a&&(this.invokeOnChunkCallback(a,n),t.push(a))}}},e.prototype.finalizeStreamResult=function(e,t,n,r){if(e.length>0){var i=this.combineStreamingChunks(e);this.logger.debug("Stream processing complete"),this.invokeOnCompleteCallback(i,r),t(i)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.combineStreamingChunks=function(e){if(0===e.length)return{};if(1===e.length)return e[0];var t=this.getMessageChunks(e);if(t.length>0)return this.combineMessageChunks(e,t);var n=e[e.length-1];if(!this.isCompleteSearchResponse(n))throw new Error("Last chunk is not a complete search response");return n},e.prototype.getMessageChunks=function(e){return e.filter(this.isChunkMessage)},e.prototype.isChunkMessage=function(e){return"object"==typeof e&&null!==e&&"message"in e&&"conversation_id"in e},e.prototype.combineMessageChunks=function(e,t){this.logger.debug("Found ".concat(t.length," message chunks to combine"));var n=e[e.length-1];if(this.isCompleteSearchResponse(n))return n;var r=e.find(this.isCompleteSearchResponse);if(!r)throw new Error("No metadata chunk found");return r},e.prototype.isCompleteSearchResponse=function(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0&&("results"in e||"found"in e||"hits"in e||"page"in e||"search_time_ms"in e)},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,l)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,l)}))},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*e)}))]}))}))},e.prototype.customErrorForResponse=function(e,t,n){var r="Request failed with HTTP code ".concat(e.status);return"string"==typeof t&&""!==t.trim()&&(r+=" | Server said: ".concat(t)),new u.default(r,n,e.status),400===e.status?new s.RequestMalformed(r,n,e.status):401===e.status?new s.RequestUnauthorized(r,n,e.status):404===e.status?new s.ObjectNotFound(r,n,e.status):409===e.status?new s.ObjectAlreadyExists(r,n,e.status):422===e.status?new s.ObjectUnprocessable(r,n,e.status):e.status>=500&&e.status<=599?new s.ServerError(r,n,e.status):new s.HTTPError(r,n,e.status)},e.prototype.invokeOnChunkCallback=function(e,t){if(null==t?void 0:t.onChunk)try{t.onChunk(e)}catch(e){this.logger.warn("Error in onChunk callback: ".concat(e))}},e.prototype.invokeOnCompleteCallback=function(e,t){if(null==t?void 0:t.onComplete)try{t.onComplete(e)}catch(e){this.logger.warn("Error in onComplete callback: ".concat(e))}},e.prototype.invokeOnErrorCallback=function(e,t){if(null==t?void 0:t.onError){var n=(0,c.toErrorWithMessage)(e);try{t.onError(n)}catch(e){this.logger.warn("Error in onError callback: ".concat(e))}}},e}();t.default=p},5641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(7361)),s=r.__importDefault(n(2626)),u=r.__importDefault(n(612)),c=r.__importDefault(n(5300)),l=r.__importDefault(n(326)),d=r.__importDefault(n(2275)),p=r.__importDefault(n(3343)),h=r.__importDefault(n(657)),f=r.__importDefault(n(4955)),y=r.__importDefault(n(8231)),v=r.__importDefault(n(3684)),m=r.__importDefault(n(8621)),_=r.__importDefault(n(5156)),g=r.__importDefault(n(3777)),b=r.__importDefault(n(3421)),w=r.__importDefault(n(800)),C=r.__importDefault(n(3533)),S=r.__importDefault(n(4646)),R=r.__importDefault(n(8700)),O=r.__importDefault(n(8313)),P=r.__importDefault(n(2786)),E=r.__importDefault(n(5350)),A=r.__importDefault(n(7187)),T=r.__importDefault(n(4200)),j=r.__importDefault(n(2077)),N=r.__importDefault(n(476)),x=r.__importDefault(n(1049)),k=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.debug=new p.default(this.apiCall),this.metrics=new h.default(this.apiCall),this.stats=new f.default(this.apiCall),this.health=new y.default(this.apiCall),this.operations=new v.default(this.apiCall),this.multiSearch=new m.default(this.apiCall,this.configuration),this._collections=new a.default(this.apiCall),this.individualCollections={},this._aliases=new u.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new _.default(this.apiCall),this.individualPresets={},this._stopwords=new C.default(this.apiCall),this.individualStopwords={},this.analytics=new w.default(this.apiCall),this.analyticsV1=new b.default(this.apiCall),this.stemming=new P.default(this.apiCall),this._conversations=new R.default(this.apiCall),this.individualConversations={},this._nlSearchModels=new E.default(this.apiCall),this.individualNLSearchModels={},this._synonymSets=new T.default(this.apiCall),this.individualSynonymSets={},this._curationSets=new N.default(this.apiCall),this.individualCurationSets={}}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new c.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new d.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new g.default(e,this.apiCall)),this.individualPresets[e])},e.prototype.stopwords=function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new S.default(e,this.apiCall)),this.individualStopwords[e])},e.prototype.conversations=function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new O.default(e,this.apiCall)),this.individualConversations[e])},e.prototype.nlSearchModels=function(e){return void 0===e?this._nlSearchModels:(void 0===this.individualNLSearchModels[e]&&(this.individualNLSearchModels[e]=new A.default(e,this.apiCall)),this.individualNLSearchModels[e])},e.prototype.synonymSets=function(e){return void 0===e?this._synonymSets:(void 0===this.individualSynonymSets[e]&&(this.individualSynonymSets[e]=new j.default(e,this.apiCall)),this.individualSynonymSets[e])},e.prototype.curationSets=function(e){return void 0===e?this._curationSets:(void 0===this.individualCurationSets[e]&&(this.individualCurationSets[e]=new x.default(e,this.apiCall)),this.individualCurationSets[e])},e}();t.default=k},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=n(4410),s=r.__importDefault(n(3629)),u=r.__importDefault(n(6582)),c=r.__importDefault(n(1104)),l=r.__importDefault(n(6821)),d=n(9459),p=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=e,this.apiCall=t,this.configuration=n,this._documents=new o.default(this.name,this.apiCall,this.configuration),this._overrides=new s.default(this.name,this.apiCall),this._synonyms=new c.default(this.name,this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.exists=function(){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(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((e=t.sent())instanceof a.ObjectNotFound)return[2,!1];throw e;case 3:return[2]}}))}))},e.prototype.documents=function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new d.Document(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents},e.prototype.overrides=function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new u.default(this.name,e,this.apiCall)),this.individualOverrides[e])},e.prototype.synonyms=function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new l.default(this.name,e,this.apiCall)),this.individualSynonyms[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=p},7361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/collections",o=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(i,e,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(i,e)]}))}))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},5706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importStar(n(3065)),o=n(4410),a=function(){function e(e){var t=this;this.nodes=e.nodes||[],this.nodes=this.nodes.map((function(e){return t.setDefaultPathInNode(e)})).map((function(e){return t.setDefaultPortInNode(e)})).map((function(e){return r.__assign({},e)})),null==e.randomizeNodes&&(e.randomizeNodes=!0),!0===e.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=e.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=e.connectionTimeoutSeconds||e.timeoutSeconds||5,this.healthcheckIntervalSeconds=e.healthcheckIntervalSeconds||60,this.numRetries=(void 0!==e.numRetries&&e.numRetries>=0?e.numRetries:this.nodes.length+(null==this.nearestNode?0:1))||3,this.retryIntervalSeconds=e.retryIntervalSeconds||.1,this.apiKey=e.apiKey,this.sendApiKeyAsQueryParam=e.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=e.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=e.useServerSideSearchCache||!1,this.axiosAdapter=e.axiosAdapter,this.logger=e.logger||i,this.logLevel=e.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=e.additionalHeaders,this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.paramsSerializer=e.paramsSerializer,this.showDeprecationWarnings(e),this.validate()}return e.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new o.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new o.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new o.MissingConfigurationError("Ensure that apiKey is set");return!0},e.prototype.validateNodes=function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))},e.prototype.isNodeMissingAnyParameters=function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url},e.prototype.setDefaultPathInNode=function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e},e.prototype.setDefaultPortInNode=function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e},e.prototype.showDeprecationWarnings=function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},e.prototype.shuffleArray=function(e){for(var t,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();t.default=a},8313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(8700)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5168:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},2783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),e}();t.default=i},8700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=r.__importDefault(n(5168)),a="/conversations",s=function(){function e(e){this.apiCall=e,this.individualConversationModels={},this.apiCall=e,this._conversationsModels=new i.default(this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.models=function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new o.default(e,this.apiCall)),this.individualConversationModels[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},1049:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=r.__importDefault(n(285)),a=r.__importDefault(n(4326)),s=function(){function e(e,t){this.name=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.name,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.name,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=s},4326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t,n){this.name=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/curation_sets",e}();t.default=i},3343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/debug")]}))}))},e}();t.default=i},9459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Document=void 0;var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=function(){function e(e,t,n){this.collectionName=e,this.documentId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.patch(this.endpointPath(),e,t)]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))},e}();t.Document=a},9078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(4410),o=n(6124),a="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,s=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return r.__extends(t,e),t.prototype.create=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,t)]}))}))},t.prototype.upsert=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},t.prototype.createMany=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){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(e,t)]}))}))},t.prototype.import=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,o,s,u,c;return void 0===t&&(t={}),r.__generator(this,(function(l){switch(l.label){case 0:if(n=r.__assign({throwOnFail:!0},t),Array.isArray(e)){if(0===e.length)throw new i.RequestMalformed("No documents provided");try{o=e.map((function(e){return JSON.stringify(e)})).join("\n")}catch(e){if(e instanceof RangeError&&e.message.includes("Too many properties to enumerate"))throw new Error("".concat(e,"\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 new Error(e)}}else if(null==(d=o=e)||""===d||0===d.length)throw new i.RequestMalformed("No documents provided");return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:o,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(s=l.sent(),Array.isArray(e)){if(u=s.split("\n").map((function(e){return JSON.parse(e)})),(c=u.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)throw new i.ImportError("".concat(u.length-c.length," documents imported successfully, ").concat(c.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),u,{documentsInJSONLFormat:o,options:n,failedItems:c,successCount:u.length-c.length});return[2,u]}return[2,s]}var d}))}))},t.prototype.importStream=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,o,s,u;return void 0===t&&(t={}),r.__generator(this,(function(c){switch(c.label){case 0:return n=r.__assign({throwOnFail:!0},t),[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(o=c.sent(),s=o.split("\n").map((function(e){return JSON.parse(e)})),(u=s.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)throw new i.ImportError("".concat(s.length-u.length," documents imported successfully, ").concat(u.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),s,{documentsInJSONLFormat:e,options:n,failedItems:u,successCount:s.length-u.length});return[2,s]}}))}))},t.prototype.export=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]}))}))},t.prototype.exportStream=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]}))}))},t}(o.SearchOnlyDocuments);t.default=s},2144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8331:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.importResults=n,i.payload=r,i}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},1081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},7796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=this.constructor,o=e.call(this,t)||this;return o.name=i.name,o.httpBody=n,o.httpStatus=r,Object.setPrototypeOf(o,i.prototype),o}return r.__extends(t,e),t}(Error);t.default=i},4410:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportError=t.TypesenseError=t.ServerError=t.RequestUnauthorized=t.RequestMalformed=t.ObjectUnprocessable=t.ObjectNotFound=t.ObjectAlreadyExists=t.MissingConfigurationError=t.HTTPError=void 0;var r=n(3301),i=r.__importDefault(n(2144));t.HTTPError=i.default;var o=r.__importDefault(n(2426));t.MissingConfigurationError=o.default;var a=r.__importDefault(n(6731));t.ObjectAlreadyExists=a.default;var s=r.__importDefault(n(8280));t.ObjectNotFound=s.default;var u=r.__importDefault(n(2703));t.ObjectUnprocessable=u.default;var c=r.__importDefault(n(8274));t.RequestMalformed=c.default;var l=r.__importDefault(n(6909));t.RequestUnauthorized=l.default;var d=r.__importDefault(n(1081));t.ServerError=d.default;var p=r.__importDefault(n(8331));t.ImportError=p.default;var h=r.__importDefault(n(7796));t.TypesenseError=h.default},8231:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/health")]}))}))},e}();t.default=i},2275:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(326)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(3529),o=n(7353),a="/keys",s=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(e.RESOURCEPATH,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.generateScopedSearchKey=function(e,t){var n=(0,o.normalizeArrayableParams)(t),r=JSON.stringify(n),a=Buffer.from((0,i.createHmac)("sha256",e).update(r).digest("base64")),s=e.substr(0,4),u="".concat(a).concat(s).concat(r);return Buffer.from(u).toString("base64")},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},657:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/metrics.json")]}))}))},e}();t.default=i},8621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(875)),o=n(7353),a=function(){function e(e,t,n){void 0===n&&(n=!1),this.apiCall=e,this.configuration=t,this.useTextContentType=n,this.requestWithCache=new i.default,this.logger=this.apiCall.logger}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.perform=function(e,t,n){return r.__awaiter(this,void 0,void 0,(function(){var i,a,s,u,c,l,d;return r.__generator(this,(function(p){return i=t?r.__assign({},t):{},a=null!==(d=null==n?void 0:n.cacheSearchResultsForSeconds)&&void 0!==d?d:this.configuration.cacheSearchResultsForSeconds,!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),!0===e.union&&this.hasAnySearchObjectPagination(e)&&this.logger.warn("Individual `searches` pagination parameters are ignored when `union: true` is set. Use a top-level pagination parameter instead. See https://typesense.org/docs/29.0/api/federated-multi-search.html#union-search"),s={union:e.union,searches:e.searches.map(o.normalizeArrayableParams)},u=i.streamConfig,c=r.__rest(i,["streamConfig"]),l=(0,o.normalizeArrayableParams)(c),[2,this.requestWithCache.perform(this.apiCall,"post",{path:"/multi_search",body:s,queryParams:l,headers:this.useTextContentType?{"content-type":"text/plain"}:{},streamConfig:u,abortSignal:null==n?void 0:n.abortSignal,isStreamingRequest:this.isStreamingRequest(i)},void 0!==a?{cacheResponseForSeconds:a}:void 0)]}))}))},e.prototype.isStreamingRequest=function(e){return void 0!==e.streamConfig},e.prototype.hasAnySearchObjectPagination=function(e){return e.searches.some((function(e){return void 0!==e.page||void 0!==e.per_page||void 0!==e.offset||void 0!==e.limit||void 0!==e.limit_hits}))},e}();t.default=a},7187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5350)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.RESOURCEPATH},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/nl_search_models"},enumerable:!1,configurable:!0}),e}();t.default=i},3684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/operations",o=function(){function e(e){this.apiCall=e}return e.prototype.perform=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.post("".concat(i,"/").concat(e),{},t)]}))}))},e.prototype.getSchemaChanges=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("".concat(i,"/schema_changes"))]}))}))},e}();t.default=o},6582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(3629)),a=function(){function e(e,t,n){this.collectionName=e,this.overrideId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))},e}();t.default=a},3629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),e}();t.default=o},3777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5156)),o=function(){function e(e,t){this.presetId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))},e}();t.default=o},5156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(7353),o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,o;return r.__generator(this,(function(r){return"object"==typeof t.value&&"searches"in t.value?(n=t.value.searches.map((function(e){return(0,i.normalizeArrayableParams)(e)})),[2,this.apiCall.put(this.endpointPath(e),{value:{searches:n}})]):(o=(0,i.normalizeArrayableParams)(t.value),[2,this.apiCall.put(this.endpointPath(e),{value:o})])}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),e}();t.default=o},875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(){this.responseCache=new Map,this.responsePromiseCache=new Map}return e.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},e.prototype.perform=function(e,t,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,p,h,f,y,v,m,_,g,b,w,C,S,R,O;return r.__generator(this,(function(r){switch(r.label){case 0:if(a=(o=i||{}).cacheResponseForSeconds,s=void 0===a?120:a,u=o.maxSize,c=void 0===u?100:u,l=void 0===i||s<=0||c<=0,d=n.path,p=n.queryParams,h=n.body,f=n.headers,y=n.streamConfig,v=n.abortSignal,m=n.responseType,_=n.isStreamingRequest,l)return[2,this.executeRequest(e,t,d,p,h,f,{abortSignal:v,responseType:m,streamConfig:y,isStreamingRequest:_})];if(g=JSON.stringify(n),b=this.responseCache.get(g),w=Date.now(),b){if(w-b.requestTimestamp<1e3*s)return this.responseCache.delete(g),this.responseCache.set(g,b),[2,b.response];this.responseCache.delete(g)}if(C=this.responsePromiseCache.get(g)){if(w-C.requestTimestamp<1e3*s)return this.responsePromiseCache.delete(g),this.responsePromiseCache.set(g,C),[2,C.responsePromise];this.responsePromiseCache.delete(g)}return S=this.executeRequest(e,t,d,p,h,f,{abortSignal:v,responseType:m,streamConfig:y,isStreamingRequest:_}),this.responsePromiseCache.set(g,{requestTimestamp:w,responsePromise:S}),[4,S];case 1:return R=r.sent(),this.responseCache.set(g,{requestTimestamp:w,response:R}),this.responseCache.size>c&&(O=this.responseCache.keys().next().value)&&this.responseCache.delete(O),this.responsePromiseCache.size>c&&(O=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(O),[2,R]}}))}))},e.prototype.executeRequest=function(e,t,n,r,i,o,a){void 0===r&&(r={});var s=e[t];switch(t){case"get":return s.call(e,n,r,{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"delete":return s.call(e,n,r);case"post":return s.call(e,n,i,r,o||{},{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"put":case"patch":return s.call(e,n,i,r);default:throw new Error("Unsupported method: ".concat(String(t)))}},e}();t.default=i},8557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(8621)),s=n(7112),u=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.multiSearch=new a.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){e[0],e[1].documents().clearCache()}))},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new 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.")},e}();t.default=u},7112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyCollection=void 0;var r=n(6124),i=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return e.prototype.documents=function(){return this._documents},e}();t.SearchOnlyCollection=i},6124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyDocuments=void 0;var r=n(3301),i=r.__importDefault(n(875)),o=r.__importDefault(n(7361)),a=n(7353),s="/documents",u=function(){function e(e,t,n){this.collectionName=e,this.apiCall=t,this.configuration=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.search=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,i,o,s,u,c,l=void 0===t?{}:t,d=l.cacheSearchResultsForSeconds,p=void 0===d?this.configuration.cacheSearchResultsForSeconds:d,h=l.abortSignal,f=void 0===h?null:h;return r.__generator(this,(function(t){return n={},!0===this.configuration.useServerSideSearchCache&&(n.use_cache=!0),i=(0,a.normalizeArrayableParams)(e),o=i.streamConfig,s=r.__rest(i,["streamConfig"]),u=r.__assign(r.__assign({},n),s),c=!0===u.conversation_stream,[2,this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:u,streamConfig:o,abortSignal:f,isStreamingRequest:c},{cacheResponseForSeconds:p})]}))}))},e.prototype.endpointPath=function(e){return"".concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(s).concat(void 0===e?"":"/"+e)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return s},enumerable:!1,configurable:!0}),e}();t.SearchOnlyDocuments=u},4955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/stats.json")]}))}))},e}();t.default=i},2786:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=r.__importDefault(n(5426)),a=function(){function e(e){this.apiCall=e,this.individualStemmingDictionaries={},this.apiCall=e,this._stemmingDictionaries=new i.default(this.apiCall)}return e.prototype.dictionaries=function(e){return void 0===e?this._stemmingDictionaries:(void 0===this.individualStemmingDictionaries[e]&&(this.individualStemmingDictionaries[e]=new o.default(e,this.apiCall)),this.individualStemmingDictionaries[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming"},enumerable:!1,configurable:!0}),e}();t.default=a},5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return n=Array.isArray(t)?t.map((function(e){return JSON.stringify(e)})).join("\n"):t,[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:e},bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:return i=r.sent(),[2,Array.isArray(t)?i.split("\n").map((function(e){return JSON.parse(e)})):i]}}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return void 0===t?"".concat(e.RESOURCEPATH):"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming/dictionaries"},enumerable:!1,configurable:!0}),e}();t.default=i},5426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},4646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(3533)),o=function(){function e(e,t){this.stopwordId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))},e}();t.default=o},3533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),e}();t.default=i},6821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(1104)),a=function(){function e(e,t,n){this.collectionName=e,this.synonymId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonym' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets 'synonym_sets'."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))},e.hasWarnedDeprecation=!1,e}();t.default=a},2077:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=r.__importDefault(n(3905)),a=r.__importDefault(n(7394)),s=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.synonymSetName,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.synonymSetName,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName))},e}();t.default=s},7394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t,n){this.synonymSetName=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},3905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},4200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/synonym_sets",e}();t.default=i},1104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonyms' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets ('synonym_sets')."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=o},7765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayableParams=void 0,t.arrayableParams={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",synonym_sets:"synonym_sets",sort_by:"sort_by"}},7353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeArrayableParams=function(e){var t=r.__assign({},e);if(!Object.keys(i.arrayableParams).filter((function(e){return Array.isArray(t[e])})).map((function(e){return t[e]=t[e].join(","),e})).length&&o(t))return t;if(!o(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t},t.toErrorWithMessage=function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return"string"==typeof e?new Error(e):new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}};var r=n(3301),i=n(7765);function o(e){return Object.keys(i.arrayableParams).filter((function(t){return void 0!==e[t]})).every((function(t){return n=e[t],!Array.isArray(n);var n}))}},3529:()=>{},5978:()=>{},7205:()=>{},4633:(e,t,n)=>{var r=n(3738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),a=new k(r||[]);return s(o,"_invoke",{value:T(e,n,a)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",_="completed",g={};function b(){}function w(){}function C(){}var S={};p(S,c,(function(){return this}));var R=Object.getPrototypeOf,O=R&&R(R(D([])));O&&O!==o&&a.call(O,c)&&(S=O);var P=C.prototype=b.prototype=Object.create(S);function E(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,o,s,u){var c=f(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var i=y;return function(o,a){if(i===m)throw Error("Generator is already running");if(i===_){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=j(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===y)throw i=_,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=f(e,n,r);if("normal"===c.type){if(i=r.done?_:v,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=_,r.method="throw",r.arg=c.arg)}}}function j(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=C,s(P,"constructor",{value:C,configurable:!0}),s(C,"constructor",{value:w,configurable:!0}),w.displayName=p(C,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,p(e,d,"GeneratorFunction")),e.prototype=Object.create(P),e},n.awrap=function(e){return{__await:e}},E(A.prototype),p(A.prototype,l,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new A(h(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(P),p(P,d,"Generator"),p(P,c,(function(){return this})),p(P,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=D,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6425:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:a,toStringTag:s}=Symbol,u=(c=Object.create(null),e=>{const t=i.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const l=e=>(e=e.toLowerCase(),t=>u(t)===e),d=e=>t=>typeof t===e,{isArray:p}=Array,h=d("undefined");function f(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=l("ArrayBuffer"),v=d("string"),m=d("function"),_=d("number"),g=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==u(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||s in e||a in e)},w=l("Date"),C=l("File"),S=l("Blob"),R=l("FileList"),O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},P=void 0!==O.FormData?O.FormData:void 0,E=l("URLSearchParams"),[A,T,j,N]=["ReadableStream","Request","Response","Headers"].map(l);function x(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(f(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function k(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,U=e=>!h(e)&&e!==D,I=(F="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>F&&e instanceof F);var F;const q=l("HTMLFormElement"),L=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=l("RegExp"),H=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};x(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)},B=l("AsyncFunction"),W=(z="function"==typeof setImmediate,V=m(D.postMessage),z?setImmediate:V?(K=`axios@${Math.random()}`,J=[],D.addEventListener("message",(({source:e,data:t})=>{e===D&&t===K&&J.length&&J.shift()()}),!1),e=>{J.push(e),D.postMessage(K,"*")}):e=>setTimeout(e));var z,V,K,J;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(D):"undefined"!=typeof process&&process.nextTick||W;var $={isArray:p,isArrayBuffer:y,isBuffer:f,isFormData:e=>{let t;return e&&(P&&e instanceof P||m(e.append)&&("formdata"===(t=u(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:v,isNumber:_,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:b,isEmptyObject:e=>{if(!g(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:T,isResponse:j,isHeaders:N,isUndefined:h,isDate:w,isFile:C,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:S,isRegExp:M,isFunction:m,isStream:e=>g(e)&&m(e.pipe),isURLSearchParams:E,isTypedArray:I,isFileList:R,forEach:x,merge:function e(){const{caseless:t,skipUndefined:n}=U(this)&&this||{},r={},i=(i,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=t&&k(r,o)||o;b(r[a])&&b(i)?r[a]=e(r[a],i):b(i)?r[a]=e({},i):p(i)?r[a]=i.slice():n&&h(i)||(r[a]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&x(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:i}={})=>(x(t,((t,i)=>{n&&m(t)?Object.defineProperty(e,i,{value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:q,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:H,freezeMethods:e=>{H(e,((t,n)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];m(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:k,global:D,isContextDefined:U,isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[s]&&e[a])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[r]=e;const i=p(e)?[]:{};return x(e,((e,t)=>{const o=n(e,r+1);!h(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(g(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:W,asap:G,isIterable:e=>null!=e&&m(e[a])};class Q extends Error{static from(e,t,n,r,i,o){const a=new Q(e.message,t||e.code,n,r,i);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),o&&Object.assign(a,o),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){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:$.toJSONObject(this.config),code:this.code,status:this.status}}}Q.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Q.ERR_BAD_OPTION="ERR_BAD_OPTION",Q.ECONNABORTED="ECONNABORTED",Q.ETIMEDOUT="ETIMEDOUT",Q.ERR_NETWORK="ERR_NETWORK",Q.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Q.ERR_DEPRECATED="ERR_DEPRECATED",Q.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Q.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Q.ERR_CANCELED="ERR_CANCELED",Q.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Q.ERR_INVALID_URL="ERR_INVALID_URL";var X=Q;function Y(e){return $.isPlainObject(e)||$.isArray(e)}function Z(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function ee(e,t,n){return e?e.concat(t).map((function(e,t){return e=Z(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const te=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)}));function ne(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if($.isBoolean(e))return e.toString();if(!s&&$.isBlob(e))throw new X("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if($.isReactNative(t)&&$.isReactNativeBlob(e))return t.append(ee(i,n,o),u(e)),!1;if(e&&!i&&"object"==typeof e)if($.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(Y)}(e)||($.isFileList(e)||$.endsWith(n,"[]"))&&(s=$.toArray(e)))return n=Z(n),s.forEach((function(e,r){!$.isUndefined(e)&&null!==e&&t.append(!0===a?ee([n],r,o):null===a?n:n+"[]",u(e))})),!1;return!!Y(e)||(t.append(ee(i,n,o),u(e)),!1)}const l=[],d=Object.assign(te,{defaultVisitor:c,convertValue:u,isVisitable:Y});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!$.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),$.forEach(n,(function(n,o){!0===(!($.isUndefined(n)||null===n)&&i.call(t,n,$.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])})),l.pop()}}(e),t}function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ie(e,t){this._pairs=[],e&&ne(e,this,t)}const oe=ie.prototype;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ae,i=$.isFunction(n)?{serialize:n}:n,o=i&&i.serialize;let a;if(a=o?o(t,i):$.isURLSearchParams(t)?t.toString():new ie(t,i).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ue=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const de="undefined"!=typeof window&&"undefined"!=typeof document,pe="object"==typeof navigator&&navigator||void 0,he=de&&(!pe||["ReactNative","NativeScript","NS"].indexOf(pe.product)<0),fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ye=de&&window.location.href||"http://localhost";var ve={...Object.freeze({__proto__:null,hasBrowserEnv:de,hasStandardBrowserWebWorkerEnv:fe,hasStandardBrowserEnv:he,navigator:pe,origin:ye}),...le};function me(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&$.isArray(r)?r.length:o,s?($.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&$.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&$.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,((e,r)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const _e={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=$.isObject(e);if(i&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return r?JSON.stringify(me(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e)||$.isReadableStream(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ne(e,new ve.classes.URLSearchParams,{visitor:function(e,t,n,r){return ve.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=$.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ne(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if($.isString(e))try{return(0,JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_e.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if($.isResponse(e)||$.isReadableStream(e))return e;if(e&&$.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw X.from(e,X.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ve.classes.FormData,Blob:ve.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],(e=>{_e.headers[e]={}}));var ge=_e;const be=$.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"]),we=Symbol("internals");function Ce(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:$.isArray(e)?e.map(Se):String(e)}function Re(e,t,n,r,i){return $.isFunction(r)?r.call(this,t,n):(i&&(t=n),$.isString(t)?$.isString(r)?-1!==t.indexOf(r):$.isRegExp(r)?r.test(t):void 0:void 0)}class Oe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Ce(t);if(!i)throw new Error("header name must be a non-empty string");const o=$.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Se(e))}const o=(e,t)=>$.forEach(e,((e,n)=>i(e,n,t)));if($.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if($.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&be[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if($.isObject(e)&&$.isIterable(e)){let n,r,i={};for(const t of e){if(!$.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?$.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Ce(e)){const n=$.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if($.isFunction(t))return t.call(this,e,n);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ce(e)){const n=$.findKey(this,e);return!(!n||void 0===this[n]||t&&!Re(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Ce(e)){const i=$.findKey(n,e);!i||t&&!Re(0,n[i],i,t)||(delete n[i],r=!0)}}return $.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Re(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return $.forEach(this,((r,i)=>{const o=$.findKey(n,i);if(o)return t[o]=Se(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=Se(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&$.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[we]=this[we]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ce(e);t[r]||(function(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.reduceDescriptors(Oe.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),$.freezeMethods(Oe);var Pe=Oe;function Ee(e,t){const n=this||ge,r=t||n,i=Pe.from(r.headers);let o=r.data;return $.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Ae(e){return!(!e||!e.__CANCEL__)}var Te=class extends X{constructor(e,t,n){super(null==e?"canceled":e,X.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ne=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];i||(i=u),n[o]=s,r[o]=u;let l=a,d=0;for(;l!==o;)d+=n[l++],l%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i<t)return;const p=c&&u-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(n,o){let a,s,u=0,c=1e3/o;const l=(n,o=Date.now())=>{u=o,a=null,s&&(clearTimeout(s),s=null),(n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o,e({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-u;n>=c?l(e,t):(a=e,s||(s=setTimeout((()=>{s=null,l(a)}),c-n)))},()=>a&&l(a)]}(0,n)},xe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ke=e=>(...t)=>$.asap((()=>e(...t)));var De=ve.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ve.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,Ue=ve.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];$.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),$.isString(r)&&s.push(`path=${r}`),$.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),$.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Ie(e,t,n){let r=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Fe=e=>e instanceof Pe?{...e}:e;function qe(e,t){t=t||{};const n={};function r(e,t,n,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function i(e,t,n,i){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!$.isUndefined(t))return r(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(Fe(e),Fe(t),0,!0)};return $.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=$.hasOwnProp(u,r)?u[r]:i,a=o(e[r],t[r],r);$.isUndefined(a)&&o!==s||(n[r]=a)})),n}var Le=e=>{const t=qe({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=t;if(t.headers=a=Pe.from(a),t.url=se(Ie(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),$.isFormData(n))if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if($.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)}))}if(ve.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||!1!==r&&De(t.url))){const e=i&&o&&Ue.read(o);e&&a.set(i,e)}return t},Me="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Le(e);let i=r.data;const o=Pe.from(r.headers).normalize();let a,s,u,c,l,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function v(){if(!y)return;const r=Pe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());je((function(e){t(e),f()}),(function(e){n(e),f()}),{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new X("Request aborted",X.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new X(r,X.ERR_NETWORK,e,y);i.event=t||null,n(i),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new X(t,i.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,y)),y=null},void 0===i&&o.setContentType(null),"setRequestHeader"in y&&$.forEach(o.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),$.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),h&&([u,l]=Ne(h,!0),y.addEventListener("progress",u)),p&&y.upload&&([s,c]=Ne(p),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Te(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===ve.protocols.indexOf(m)?n(new X("Unsupported protocol "+m+":",X.ERR_BAD_REQUEST,e)):y.send(i||null)}))},He=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof X?t:new Te(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new X(`timeout of ${t}ms exceeded`,X.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:s}=r;return s.unsubscribe=()=>$.asap(a),s}};const Be=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},We=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*Be(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},{isFunction:ze}=$,Ve=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:Ke,TextEncoder:Je}=$.global,Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},$e=e=>{e=$.merge.call({skipUndefined:!0},Ve,e);const{fetch:t,Request:n,Response:r}=e,i=t?ze(t):"function"==typeof fetch,o=ze(n),a=ze(r);if(!i)return!1;const s=i&&ze(Ke),u=i&&("function"==typeof Je?(c=new Je,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const l=o&&s&&Ge((()=>{let e=!1;const t=new n(ve.origin,{body:new Ke,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),d=a&&s&&Ge((()=>$.isReadableStream(new r("").body))),p={stream:d&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new X(`Response type '${e}' is not supported`,X.ERR_NOT_SUPPORT,n)})}));return async e=>{let{url:i,method:a,data:s,signal:c,cancelToken:h,timeout:f,onDownloadProgress:y,onUploadProgress:v,responseType:m,headers:_,withCredentials:g="same-origin",fetchOptions:b}=Le(e),w=t||fetch;m=m?(m+"").toLowerCase():"text";let C=He([c,h&&h.toAbortSignal()],f),S=null;const R=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let O;try{if(v&&l&&"get"!==a&&"head"!==a&&0!==(O=await(async(e,t)=>{const r=$.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e)){const t=new n(ve.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $.isArrayBufferView(e)||$.isArrayBuffer(e)?e.byteLength:($.isURLSearchParams(e)&&(e+=""),$.isString(e)?(await u(e)).byteLength:void 0)})(t):r})(_,s))){let e,t=new n(i,{method:"POST",body:s,duplex:"half"});if($.isFormData(s)&&(e=t.headers.get("content-type"))&&_.setContentType(e),t.body){const[e,n]=xe(O,Ne(ke(v)));s=We(t.body,65536,e,n)}}$.isString(g)||(g=g?"include":"omit");const t=o&&"credentials"in n.prototype,c={...b,signal:C,method:a.toUpperCase(),headers:_.normalize().toJSON(),body:s,duplex:"half",credentials:t?g:void 0};S=o&&new n(i,c);let h=await(o?w(S,b):w(i,c));const f=d&&("stream"===m||"response"===m);if(d&&(y||f&&R)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=h[t]}));const t=$.toFiniteNumber(h.headers.get("content-length")),[n,i]=y&&xe(t,Ne(ke(y),!0))||[];h=new r(We(h.body,65536,n,(()=>{i&&i(),R&&R()})),e)}m=m||"text";let P=await p[$.findKey(p,m)||"text"](h,e);return!f&&R&&R(),await new Promise(((t,n)=>{je(t,n,{data:P,headers:Pe.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:S})}))}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new X("Network Error",X.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw X.from(t,t&&t.code,e,S,t&&t.response)}}},Qe=new Map,Xe=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a,s,u=o.length,c=Qe;for(;u--;)a=o[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:$e(t)),c=s;return s};Xe();const Ye={http:null,xhr:Me,fetch:{get:Xe}};$.forEach(Ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>$.isFunction(e)||null===e||!1===e;var tt=function(e,t){e=$.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){let n;if(r=e[a],i=r,!et(r)&&(i=Ye[(n=String(r)).toLowerCase()],void 0===i))throw new X(`Unknown adapter '${n}'`);if(i&&($.isFunction(i)||(i=i.get(t))))break;o[n||"#"+a]=i}if(!i){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function rt(e){return nt(e),e.headers=Pe.from(e.headers),e.data=Ee.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||ge.adapter,e)(e).then((function(t){return nt(e),t.data=Ee.call(e,e.transformResponse,t),t.headers=Pe.from(t.headers),t}),(function(t){return Ae(t)||(nt(e),t&&t.response&&(t.response.data=Ee.call(e,e.transformResponse,t.response),t.response.headers=Pe.from(t.response.headers))),Promise.reject(t)}))}const it="1.13.6",ot={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ot[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const at={};ot.transitional=function(e,t,n){function r(e,t){return"[Axios v"+it+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new X(r(i," has been removed"+(t?" in "+t:"")),X.ERR_DEPRECATED);return t&&!at[i]&&(at[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},ot.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var st={assertOptions:function(e,t,n){if("object"!=typeof e)throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new X("option "+o+" must be "+n,X.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new X("Unknown option "+o,X.ERR_BAD_OPTION)}},validators:ot};const ut=st.validators;class ct{constructor(e){this.defaults=e||{},this.interceptors={request:new ue,response:new ue}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=qe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&st.assertOptions(n,{silentJSONParsing:ut.transitional(ut.boolean),forcedJSONParsing:ut.transitional(ut.boolean),clarifyTimeoutError:ut.transitional(ut.boolean),legacyInterceptorReqResOrdering:ut.transitional(ut.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:st.assertOptions(r,{encode:ut.function,serialize:ut.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),st.assertOptions(t,{baseUrl:ut.spelling("baseURL"),withXsrfToken:ut.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&$.merge(i.common,i[t.method]);i&&$.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Pe.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||ce;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,d=0;if(!s){const e=[rt.bind(this),void 0];for(e.unshift(...a),e.push(...u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let p=t;for(;d<l;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=rt.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return se(Ie((e=qe(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(e){ct.prototype[e]=function(t,n){return this.request(qe(n||{},{method:e,url:t,data:(n||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(qe(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ct.prototype[e]=t(),ct.prototype[e+"Form"]=t(!0)}));var lt=ct;class dt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Te(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new dt((function(t){e=t})),cancel:e}}}var pt=dt;const ht={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ht).forEach((([e,t])=>{ht[t]=e}));var ft=ht;const yt=function e(t){const n=new lt(t),i=r(lt.prototype.request,n);return $.extend(i,lt.prototype,n,{allOwnKeys:!0}),$.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(qe(t,n))},i}(ge);yt.Axios=lt,yt.CanceledError=Te,yt.CancelToken=pt,yt.isCancel=Ae,yt.VERSION=it,yt.toFormData=ne,yt.AxiosError=X,yt.Cancel=yt.CanceledError,yt.all=function(e){return Promise.all(e)},yt.spread=function(e){return function(t){return e.apply(null,t)}},yt.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},yt.mergeConfig=qe,yt.AxiosHeaders=Pe,yt.formToJSON=e=>me($.isHTMLForm(e)?new FormData(e):e),yt.getAdapter=tt,yt.HttpStatusCode=ft,yt.default=yt,e.exports=yt},3301:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>U,__assign:()=>o,__asyncDelegator:()=>O,__asyncGenerator:()=>R,__asyncValues:()=>P,__await:()=>S,__awaiter:()=>f,__classPrivateFieldGet:()=>x,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>k,__createBinding:()=>v,__decorate:()=>s,__disposeResources:()=>F,__esDecorate:()=>c,__exportStar:()=>m,__extends:()=>i,__generator:()=>y,__importDefault:()=>N,__importStar:()=>j,__makeTemplateObject:()=>E,__metadata:()=>h,__param:()=>u,__propKey:()=>d,__read:()=>g,__rest:()=>a,__rewriteRelativeImportExtension:()=>q,__runInitializers:()=>l,__setFunctionName:()=>p,__spread:()=>b,__spreadArray:()=>C,__spreadArrays:()=>w,__values:()=>_,default:()=>L});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=r.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?r.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var y in r)f[y]="access"===y?{}:r[y];for(var y in r.access)f.access[y]=r.access[y];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,n[h])("accessor"===u?{get:d.get,set:d.set}:d[c],f);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(d.get=s),(s=a(v.set))&&(d.set=s),(s=a(v.init))&&i.unshift(s)}else(s=a(v))&&("field"===u?i.unshift(s):d[c]=s)}l&&Object.defineProperty(l,r.name,d),p=!0}function l(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function y(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=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 o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var v=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function m(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||v(t,e,n)}function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function w(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function C(e,t,n){if(n||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 e.concat(r||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function R(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof S?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function O(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:S(e[r](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=_(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},T=function(e){return T=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},T(e)};function j(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=T(e),r=0;r<n.length;r++)"default"!==n[r]&&v(t,e,n[r]);return A(t,e),t}function N(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function k(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function U(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var I="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function F(e){function t(t){e.error=e.hasError?new I(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function i(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,(function(e){return t(e),i()}))}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function q(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,r,i,o){return n?t?".jsx":".js":!r||i&&o?r+i+"."+o.toLowerCase()+"js":e})):e}const L={__extends:i,__assign:o,__rest:a,__decorate:s,__param:u,__esDecorate:c,__runInitializers:l,__propKey:d,__setFunctionName:p,__metadata:h,__awaiter:f,__generator:y,__createBinding:v,__exportStar:m,__values:_,__read:g,__spread:b,__spreadArrays:w,__spreadArray:C,__await:S,__asyncGenerator:R,__asyncDelegator:O,__asyncValues:P,__makeTemplateObject:E,__importStar:j,__importDefault:N,__classPrivateFieldGet:x,__classPrivateFieldSet:k,__classPrivateFieldIn:D,__addDisposableResource:U,__disposeResources:F,__rewriteRelativeImportExtension:q}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(r,{default:()=>P});var c=n(4756),l=n.n(c),d=function(){return u((function e(){var t,n,r,o,a,s,u,c,l,d,p,h,f,y,v,m,_,g,b,w,C,S,R,O=this,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.server=P.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(t=this.server.cacheSearchResultsForSeconds)&&void 0!==t?t:120,this.additionalSearchParameters=null!==(n=P.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(o=this.additionalSearchParameters.queryBy)&&void 0!==o?o:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(a=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==a?a:"",this.additionalSearchParameters.sort_by=null!==(u=null!==(c=this.additionalSearchParameters.sortBy)&&void 0!==c?c:this.additionalSearchParameters.sort_by)&&void 0!==u?u:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(d=this.additionalSearchParameters.highlightFullFields)&&void 0!==d?d:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(p=P.geoLocationField)&&void 0!==p?p:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(h=P.facetableFieldsWithSpecialCharacters)&&void 0!==h?h:[],this.collectionSpecificSearchParameters=null!==(f=P.collectionSpecificSearchParameters)&&void 0!==f?f:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(e){var t,n,r,i,o,a,s=O.collectionSpecificSearchParameters[e];s.query_by=null!==(t=s.queryBy)&&void 0!==t?t:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(i=null!==(o=null!==(a=s.highlightFullFields)&&void 0!==a?a:s.highlight_full_fields)&&void 0!==o?o:O.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:s.query_by,Object.keys(s).forEach((function(e){return void 0===s[e]?delete s[e]:{}}))})),this.renderingContent=P.renderingContent,this.flattenGroupedHits=null===(y=P.flattenGroupedHits)||void 0===y||y,this.facetByOptions=null!==(v=P.facetByOptions)&&void 0!==v?v:{},this.filterByOptions=null!==(m=P.filterByOptions)&&void 0!==m?m:{},this.sortByOptions=null!==(_=P.sortByOptions)&&void 0!==_?_:{},this.collectionSpecificFacetByOptions=null!==(g=P.collectionSpecificFacetByOptions)&&void 0!==g?g:{},this.collectionSpecificFilterByOptions=null!==(b=P.collectionSpecificFilterByOptions)&&void 0!==b?b:{},this.collectionSpecificSortByOptions=null!==(w=P.collectionSpecificSortByOptions)&&void 0!==w?w:{},this.union=null!==(C=P.union)&&void 0!==C&&C,this.useOverrideTags=null!==(S=P.useOverrideTags)&&void 0!==S&&S,this.flipNegativeRefinementOperator=null!==(R=P.flipNegativeRefinementOperator)&&void 0!==R&&R}),[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(e){return e.queryBy})))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}])}(),p=n(8567);function h(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=["q","conversation","conversation_id","conversation_model_id"],_=function(){return u((function e(t,n,r){i(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}),[{key:"_shouldUseExactMatchForField",value:function(e,t){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n[e])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(e,t){var n=this,r="";return e?r=e.map((function(e){if(Array.isArray(e)){var r={};e.forEach((function(e){var t=n._parseFacetFilter(e),i=t.fieldName,o=t.fieldValue;r[i]=r[i]||[],r[i].push(o)})),Object.keys(r).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(r).join(",")));var i=Object.keys(r)[0],o=r[i].reduce((function(e,t){return t.startsWith("-")&&!n._isNumber(t)?e[0].push(t.substring(1)):e[1].push(t),e}),[[],[]]),a=v(o,2),s=a[0],u=a[1],c=[];if(u.length>0){var l=n._shouldUseExactMatchForField(i,t)?":=":":";c.push("".concat(i).concat(l,"[").concat(u.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}if(s.length>0){var d=n._shouldUseExactMatchForField(i,t)?":!=":":!";n.configuration.flipNegativeRefinementOperator?c.push("(".concat(s.map((function(e){return"".concat(i).concat(d).concat(n._escapeFacetValue(e))})).join(" || "),")")):c.push("".concat(i).concat(d,"[").concat(s.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}return c.filter((function(e){return e})).join(" && ")}var p,h=n._parseFacetFilter(e),f=h.fieldName,y=h.fieldValue;if(y.startsWith("-")&&!n._isNumber(y)){var m=n._shouldUseExactMatchForField(f,t)?":!=":":!";p="".concat(f).concat(m,"[").concat(n._escapeFacetValue(y.substring(1)),"]")}else{var _=n._shouldUseExactMatchForField(f,t)?":=":":";p="".concat(f).concat(_,"[").concat(n._escapeFacetValue(y),"]")}return p})).join(" && "):r}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,o;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var a=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(a.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:o="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(i="".concat(r[1]).concat(r[2]),o="".concat(r[3])),{fieldName:i,fieldValue:o}}},{key:"_escapeFacetValue",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this,n="";if(!e)return n;var r={};e.forEach((function(e){var n=t._parseNumericFilter(e),i=n.fieldName,o=n.operator,a=n.fieldValue;r[i]=r[i]||{},r[i][o]=a}));var i=[];return Object.keys(r).forEach((function(e){null!=r[e]["<="]&&null!=r[e][">="]?i.push("".concat(e,":=[").concat(r[e][">="],"..").concat(r[e]["<="],"]")):null!=r[e]["<="]?i.push("".concat(e,":<=").concat(r[e]["<="])):null!=r[e][">="]?i.push("".concat(e,":>=").concat(r[e][">="])):null!=r[e]["="]?i.push("".concat(e,":=").concat(r[e]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[e])))})),i.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,r,i,o,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var s=this.configuration.facetableFieldsWithSpecialCharacters.map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(s.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=e.match(n))){var u=v(r,4);return{fieldName:i=u[1],operator:o=u[2],fieldValue:a=u[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var c=v(r,4);i=c[1],o=c[2],a=c[3]}return{fieldName:i,operator:o,fieldValue:a}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,r=e.aroundLatLng,i=e.insidePolygon;if(t){var o,a,s,u;if(Array.isArray(t)){var c=v(t.flat(),4);o=c[0],a=c[1],s=c[2],u=c[3]}else{var l=v(t.split(","),4);o=l[0],a=l[1],s=l[2],u=l[3]}return"".concat(this.configuration.geoLocationField,":(").concat(o,", ").concat(a,", ").concat(o,", ").concat(u,", ").concat(s,", ").concat(u,", ").concat(s,", ").concat(a,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var d="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(d,")")}if(i){var p=i;return Array.isArray(i)&&(p=i.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(p,")")}}},{key:"_splitByTopLevelAnd",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i],a=e[i+1];"`"===o&&(r=!r),r||"&"!==o||"&"!==a?n+=o:(""!==n.trim()&&t.push(n.trim()),n="",i+=1)}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_splitListValues",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i];"`"===o&&(r=!r),r||","!==o?n+=o:(""!==n.trim()&&t.push(n.trim()),n="")}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_parseListClause",value:function(e){var t=e.trim(),n=t.indexOf("["),r=t.lastIndexOf("]");if(-1===n||-1===r||r!==t.length-1)return null;var i=t.slice(0,n).trim(),o=t.slice(n+1,r),a=[":!=",":=",":!",":"].find((function(e){return i.endsWith(e)}));if(!a)return null;var s=i.slice(0,i.length-a.length).trim();return s?{fieldName:s,operator:a,values:this._splitListValues(o)}:null}},{key:"_mergeSameFieldExclusionListClauses",value:function(e){var t=this;if(!e)return e;var n=this._splitByTopLevelAnd(e),r={},i=[];return n.forEach((function(e,n){var o=t._parseListClause(e);if(o){var a=":!"===o.operator||":!="===o.operator?"exclude":null;if(null!=a){var s="".concat(o.fieldName,"|").concat(a);r[s]||(r[s]={clauseIndex:n,fieldName:o.fieldName,operator:o.operator,normalizedOperator:a,values:[]}),o.values.forEach((function(e){r[s].values.includes(e)||r[s].values.push(e)}))}else i.push({clauseIndex:n,clause:e})}else i.push({clauseIndex:n,clause:e})})),Object.values(r).forEach((function(e){i.push({clauseIndex:e.clauseIndex,clause:"".concat(e.fieldName).concat(e.operator,"[").concat(e.values.join(","),"]")})})),i.sort((function(e,t){return e.clauseIndex-t.clauseIndex})).map((function(e){return e.clause})).join(" && ")}},{key:"_adaptFilters",value:function(e,t){var n=[];e.filters&&n.push(e.filters),n.push(this._adaptFacetFilters(e.facetFilters,t)),n.push(this._adaptNumericFilters(e.numericFilters)),n.push(this._adaptGeoFilter(e));var r=n.filter((function(e){return e&&""!==e})).join(" && ");return this.configuration.flipNegativeRefinementOperator?this._mergeSameFieldExclusionListClauses(r):r}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(e,t){var n=this;return[e].flat().map((function(e){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[t])&&void 0!==r&&r[e]?"".concat(e).concat(n.configuration.collectionSpecificFacetByOptions[t][e]):n.configuration.facetByOptions[e]?"".concat(e).concat(n.configuration.facetByOptions[e]):e})).join(",")}},{key:"_adaptRulesContextsToOverrideTags",value:function(e){return e.join(",")}},{key:"_buildSearchParameters",value:function(e){for(var t,n,r=e.params,i=e.indexName,o=this._adaptIndexName(i),a={},s=0,u=Object.entries(this.additionalSearchParameters);s<u.length;s++){var c=v(u[s],2),l=c[0],d=c[1];a[this._camelToSnakeCase(l)]=d}if(this.collectionSpecificSearchParameters[o])for(var p=0,h=Object.entries(this.collectionSpecificSearchParameters[o]);p<h.length;p++){var f=v(h[p],2),y=f[0],m=f[1];a[this._camelToSnakeCase(y)]=m}var _=Object.assign({},a),g=this._adaptSortBy(i);Object.assign(_,{collection:o,q:""===r.query||void 0===r.query?"*":r.query,facet_by:a.facet_by||this._adaptFacetBy(r.facets,o),filter_by:this._adaptFilters(r,o)||a.filter_by,sort_by:g||a.sort_by,max_facet_values:r.maxValuesPerFacet,page:(r.page||0)+1}),null!=r.hitsPerPage&&(_.per_page=r.hitsPerPage),r.facetQuery&&(_.facet_query="".concat(r.facetName,":").concat(r.facetQuery),_.per_page=0),r.ruleContexts&&r.ruleContexts.length>0&&(_[this.configuration.useOverrideTags?"override_tags":"curation_tags"]=this._adaptRulesContextsToOverrideTags(r.ruleContexts)),r.typesenseVectorQuery&&(_.vector_query=r.typesenseVectorQuery);var b=(null===(t=this.configuration.collectionSpecificSortByOptions)||void 0===t||null===(t=t[o])||void 0===t?void 0:t[_.sort_by])||(null===(n=this.configuration.sortByOptions)||void 0===n?void 0:n[_.sort_by]);return null!=(null==b?void 0:b.enable_overrides)&&(_.enable_overrides=b.enable_overrides),Object.fromEntries(Object.entries(_).filter((function(e){var t=v(e,2),n=(t[0],t[1]);return null!=n&&""!==n})))}},{key:"_camelToSnakeCase",value:function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(e=t(l().mark((function e(){var t,n,r,i,o,a,s,u,c,d,p=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.instantsearchRequests.map((function(e){return p._buildSearchParameters(e)})),i={},!0!==(null===(t=r[0])||void 0===t?void 0:t.conversation)&&"true"!==(null===(n=r[0])||void 0===n?void 0:n.conversation)||(o=r[0],a=o.q,s=o.conversation,u=o.conversation_id,c=o.conversation_model_id,i={q:a,conversation:s,conversation_id:u,conversation_model_id:c},r=r.map((function(e){return e.q,e.conversation,e.conversation_id,e.conversation_model_id,h(e,m)}))),d={searches:r},this.configuration.union&&(d.union=this.configuration.union,["page","per_page","offset","limit","limit_hits"].forEach((function(e){null!=r[0][e]&&(i[e]=r[0][e])}))),e.abrupt("return",this.typesenseClient.multiSearch.perform(d,i));case 6:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]);var e}();function g(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={_adaptHighlightTag:function(e,t,n){return e.replace(new RegExp("<mark>","g"),t||"<mark>").replace(new RegExp("</mark>","g"),n||"</mark>")},_adaptNumberOfPages:function(){var e=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,t=(null==e?void 0:e.per_page)||10,n=this.typesenseResponse.found/t;return Number.isFinite(n)?Math.ceil(n):1}};function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(){return u((function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResults=o,this.fullTypesenseResponse=a}),[{key:"_adaptGroupedHits",value:function(e){var t=this,n=[];return n=e.map((function(e){var n=t._adaptHits(e.hits);return n.forEach((function(t){t.group_key=t._group_key=e.group_key,e.found&&(t._group_found=e.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(e){return S(S({},e[0]),{},{_grouped_hits:e})}))}},{key:"_adaptHits",value:function(e){var t=this;return e.map((function(e){var n=S({},e.document);n.objectID=e.document.id,n._snippetResult=t._adaptHighlightResult(e,"snippet"),n._highlightResult=t._adaptHighlightResult(e,"value"),n._rawTypesenseHit=e,t.fullTypesenseResponse.conversation&&(n._rawTypesenseConversation=t.fullTypesenseResponse.conversation),["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance","collection","search_index"].forEach((function(t){Object.keys(e).includes(t)&&!Object.keys(n).includes(t)&&(n[t]=e[t])}));var r=n[t.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(e,t){var n={};return null!=e.highlight&&this.isHighlightPost0240RCN32Format(e.highlight)?this.adaptHighlightObject(e,n,t):this.adaptHighlightsArray(e,n,t),n}},{key:"isHighlightPost0240RCN32Format",value:function(e){return null==e.full&&null==e.snippet}},{key:"adaptHighlightsArray",value:function(e,t,n){var r=this;Object.assign.apply(Object,[t].concat(g(Object.entries(e.document).map((function(e){var t=v(e,2);return b({},t[0],{value:t[1],matchLevel:"none",matchedWords:[]})}))))),e.highlights.forEach((function(e){t[e.field]={value:e[n]||e["".concat(n,"s")],matchLevel:"full",matchedWords:e.matched_tokens},e.indices&&(t[e.field].matchedIndices=e.indices)})),Object.entries(t).forEach((function(i){var a=v(i,2),s=a[0],u=a[1],c=s,l=u.value,d=u.matchLevel,p=u.matchedWords,h=u.matchedIndices;null==l?t[c]=r._adaptHighlightNullValue():Array.isArray(l)?(t[c]=[],e.document[c].forEach((function(e,i){h&&h.includes(i)?t[c].push({value:r._adaptHighlightTag("".concat(l[h.indexOf(i)]),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag),matchLevel:d,matchedWords:p[i]}):"object"===o(e)?t[c].push(r._adaptHighlightInObjectValue(e,{},n)):t[c].push({value:"".concat(e),matchLevel:"none",matchedWords:[]})}))):"object"===o(l)?t[c]=r._adaptHighlightInObjectValue(l,{},n):t[c].value=r._adaptHighlightTag("".concat(l),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(e,t,n){Object.assign(t,this._adaptHighlightInObjectValue(e.document,e.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(e,t,n){var r=this;return Object.assign.apply(Object,[{}].concat(g(Object.entries(e).map((function(e){var i,a=v(e,2),s=a[0],u=a[1];if(null==u)i=r._adaptHighlightNullValue();else if(Array.isArray(u)){var c;i=r._adaptHighlightInArrayValue(u,null!==(c=null==t?void 0:t[s])&&void 0!==c?c:[],n)}else if("object"===o(u)){var l;i=r._adaptHighlightInObjectValue(u,null!==(l=null==t?void 0:t[s])&&void 0!==l?l:{},n)}else i=r._adaptHighlightInPrimitiveValue(u,null==t?void 0:t[s],n);return b({},s,i)})))))}},{key:"_adaptHighlightInArrayValue",value:function(e,t,n){var r=this;return e.map((function(e,i){var a;if(null==e)a=r._adaptHighlightNullValue();else if(Array.isArray(e)){var s;a=r._adaptHighlightInArrayValue(e,null!==(s=null==t?void 0:t[i])&&void 0!==s?s:[],n)}else if("object"===o(e)){var u;a=r._adaptHighlightInObjectValue(e,null!==(u=null==t?void 0:t[i])&&void 0!==u?u:{},n)}else a=r._adaptHighlightInPrimitiveValue(e,null==t?void 0:t[i],n);return a}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(e,t,n){if(null!=t){var r,i,o,a=null!==(r=null!==(i=null!==(o=t[n])&&void 0!==o?o:t.highlight)&&void 0!==i?i:t.snippet)&&void 0!==r?r:e;return{value:this._adaptHighlightTag("".concat(a),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(t.matched_tokens||[]).length>0?"full":"none",matchedWords:t.matched_tokens||[]}}return{value:this._adaptHighlightTag("".concat(e),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){Object.assign(t,b({},e.field_name,Object.assign.apply(Object,[{}].concat(g(e.counts.map((function(e){return b({},e.value,e.count)})))))))})),t}},{key:"_adaptFacetStats",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){e.stats&&Object.keys(e.stats).length>0&&Object.assign(t,b({},e.field_name,e.stats))})),t}},{key:"_adaptRenderingContent",value:function(e){var t,n=Object.assign({},this.configuration.renderingContent);return null==(null===(t=n.facetOrdering)||void 0===t||null===(t=t.facets)||void 0===t?void 0:t.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=g(new Set((Array.isArray(e)?e:[]).map((function(e){return e.field_name})).concat(this.allTypesenseResults.map((function(e){return e.facet_counts||[]})).flat().map((function(e){return e.field_name})).filter((function(e){return e})))))),n}},{key:"_adaptUserData",value:function(e){return e?Array.isArray(e)?e:[e]:[]}},{key:"adapt",value:function(){var e=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]),t=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,n=S({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.union_request_params?this.typesenseResponse.page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:(null==t?void 0:t.per_page)||10,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||[]),query:(null==t?void 0:t.q)||"",processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(e).length>0?{renderingContent:e}:null);return this.typesenseResponse.metadata&&(n.appliedRules=["typesense-override"],n.userData=this._adaptUserData(this.typesenseResponse.metadata)),this.typesenseResponse.parsed_nl_query&&(n.parsed_nl_query=this.typesenseResponse.parsed_nl_query),this.fullTypesenseResponse.conversation&&0===n.hits.length&&(n.hits=[{_rawTypesenseConversation:this.fullTypesenseResponse.conversation}]),n}}])}();Object.assign(R.prototype,w);var O=function(){return u((function e(t,n){i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n}),[{key:"_adaptFacetHits",value:function(e){var t=this,n=[],r=e.find((function(e){return e.field_name===t.instantsearchRequest.params.facetName}));return void 0!==r&&(n=r.counts.map((function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}}))),n}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}])}();Object.assign(O.prototype,w);var P=function(){return u((function e(t){var n=this;i(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}}),[{key:"searchTypesenseAndAdapt",value:(r=t(l().mark((function e(t){var n,r,i,o,a,s=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:if(!(n=e.sent).union_request_params){e.next=12;break}return this._validateTypesenseResult(n),r=new R(n,t[0],this.configuration,[n],n),i=r.adapt(),o=t.map((function(){return i})),e.abrupt("return",{results:o});case 12:return a=n.results.map((function(e,r){return s._validateTypesenseResult(e),new R(e,t[r],s.configuration,n.results,n).adapt()})),e.abrupt("return",{results:a});case 14:e.next=20;break;case 16:throw e.prev=16,e.t0=e.catch(0),console.error(e.t0),e.t0;case 20:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return r.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(n=t(l().mark((function e(t){var n,r,i=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map((function(e,n){return i._validateTypesenseResult(e),new O(e,t[n],i.configuration).adapt()})),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return n.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(e=t(l().mark((function e(t){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new _(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new p._t(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new d(e),this.configuration.validate(),this.typesenseClient=new p._t(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]);var e,n,r}()})(),r.default})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TypesenseInstantSearchAdapter=t():e.TypesenseInstantSearchAdapter=t()}(self,(()=>(()=>{var e={3065:function(e,t,n){var r,i;!function(o,a){"use strict";r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var n=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<n?e:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function c(e){return function(){typeof console!==t&&(u.call(this),this[e].apply(this,arguments))}}function l(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||c.apply(this,arguments)}function d(e,n){var a,s,c,d=this,f="loglevel";function p(){var e;if(typeof window!==t&&f){try{e=window.localStorage[f]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function h(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?f+=":"+e:"symbol"==typeof e&&(f=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=n||l,d.getLevel=function(){return null!=c?c:null!=s?s:a},d.setLevel=function(e,n){return c=h(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(f)+"="+n+";"}catch(e){}}}(c),u.call(d)},d.setDefaultLevel=function(e){s=h(e),p()||d.setLevel(e,!1)},d.resetLevel=function(){c=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch(e){}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(o!==d&&(a=h(o.getLevel())),u.call(d),o===d)for(var e in i)i[e].rebuild()},a=h(o?o.getLevel():"WARN");var y=p();null!=y&&(c=h(y)),u.call(d)}(o=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new d(e,o.methodFactory)),t};var f=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=f),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=r.call(t,n,t,e))||(e.exports=i)}()},8567:(e,t,n)=>{"use strict";t._t=void 0;var r=n(3301),i=r.__importDefault(n(5641));i.default;var o=r.__importDefault(n(8557));t._t=o.default;r.__importStar(n(4410));i.default,o.default},5300:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(612)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},612:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/aliases",o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(i)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=r.__importDefault(n(3614)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new o.default(e,this.apiCall)),this.individualAnalyticsRules[e])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e}();t.default=s},4145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath(),e)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/events"},enumerable:!1,configurable:!0}),e}();t.default=i},3614:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(9813)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},4695:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=o},9813:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e,{},{})]}))}))},e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){return t={},e&&(t.rule_tag=e),[2,this.apiCall.get(this.endpointPath(),t)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},5276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();t.default=i},3421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5276)),o=r.__importDefault(n(4695)),a=r.__importDefault(n(4145)),s=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new i.default(this.apiCall),this._analyticsEvents=new a.default(this.apiCall)}return e.prototype.rules=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'analyticsV1' is deprecated starting with Typesense Server v30 and will be removed in a future release. Please use 'analytics' instead."),e.hasWarnedDeprecation=!0),void 0===t?this._analyticsRules:(void 0===this.individualAnalyticsRules[t]&&(this.individualAnalyticsRules[t]=new o.default(t,this.apiCall)),this.individualAnalyticsRules[t])},e.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=s},5996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(6425)),o=n(5978),a=n(7205),s=n(4410),u=r.__importDefault(n(7796)),c=n(7353),l=!0,d="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node&&"undefined"==typeof window,f=function(){function e(e){this.configuration=e,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 e.prototype.get=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){void 0===t&&(t={});var i=void 0===n?{}:n,o=i.abortSignal,a=void 0===o?null:o,s=i.responseType,u=void 0===s?void 0:s,c=i.streamConfig,l=void 0===c?void 0:c,d=i.isStreamingRequest;return r.__generator(this,(function(n){return[2,this.performRequest("get",e,{queryParameters:t,abortSignal:a,responseType:u,streamConfig:l,isStreamingRequest:d})]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.performRequest("delete",e,{queryParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.post=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n,i,o){void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={});var a=void 0===o?{}:o,s=a.abortSignal,u=void 0===s?null:s,c=a.responseType,l=void 0===c?void 0:c,d=a.streamConfig,f=void 0===d?void 0:d,p=a.isStreamingRequest;return r.__generator(this,(function(r){return[2,this.performRequest("post",e,{queryParameters:n,bodyParameters:t,additionalHeaders:i,abortSignal:u,responseType:l,streamConfig:f,isStreamingRequest:p})]}))}))},e.prototype.put=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("put",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.patch=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),r.__generator(this,(function(r){return[2,this.performRequest("patch",e,{queryParameters:n,bodyParameters:t,isStreamingRequest:!1})]}))}))},e.prototype.getAdapter=function(){if(this.configuration.axiosAdapter)return"function"==typeof this.configuration.axiosAdapter?this.configuration.axiosAdapter:"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent?i.default.getAdapter(this.configuration.axiosAdapter).bind(globalThis):i.default.getAdapter(this.configuration.axiosAdapter)},e.prototype.performRequest=function(e,t,n){return r.__awaiter(this,arguments,void 0,(function(e,t,n){var s,u,c,f,p,h,y,v,_,g,m,b=n.queryParameters,w=void 0===b?null:b,C=n.bodyParameters,R=void 0===C?null:C,O=n.additionalHeaders,S=void 0===O?{}:O,P=n.abortSignal,E=void 0===P?null:P,A=n.responseType,j=void 0===A?void 0:A,T=n.skipConnectionTimeout,N=void 0!==T&&T,x=n.enableKeepAlive,D=void 0===x?void 0:x,k=n.streamConfig,U=void 0===k?void 0:k,I=n.isStreamingRequest;return r.__generator(this,(function(n){switch(n.label){case 0:this.configuration.validate(),I&&(this.logger.debug("Request: Performing streaming request to ".concat(t)),d||"undefined"==typeof fetch||(this.logger.debug("Using fetch adapter for browser streaming"),j="stream")),s=Date.now(),c=!1,this.logger.debug("Request #".concat(s,": Performing ").concat(e.toUpperCase()," request: ").concat(t)),f=function(n){var f,h,y,b,C,O,P;return r.__generator(this,(function(A){switch(A.label){case 0:if(f=p.getNextNode(s),p.logger.debug("Request #".concat(s,": Attempting ").concat(e.toUpperCase()," request Try #").concat(n," to Node ").concat(f.index)),E&&E.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];h=void 0,A.label=1;case 1:return A.trys.push([1,3,5,6]),(y={method:e,url:p.uriFor(t,f),headers:Object.assign({},p.defaultHeaders(),S,p.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,validateStatus:function(e){return e>0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]}).adapter=I&&!d?"fetch":p.getAdapter(),!0!==N&&(y.timeout=1e3*p.connectionTimeoutSeconds),w&&0!==Object.keys(w).length&&(y.params=w),p.sendApiKeyAsQueryParam&&(y.params=y.params||{},y.params["x-typesense-api-key"]=p.apiKey),p.configuration.httpAgent?(p.logger.debug("Request #".concat(s,": Using custom httpAgent")),y.httpAgent=p.configuration.httpAgent):!0===D&&(d?(p.logger.debug("Request #".concat(s,": Enabling KeepAlive")),y.httpAgent=new o.Agent({keepAlive:!0})):p.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),p.configuration.httpsAgent?(p.logger.debug("Request #".concat(s,": Using custom httpsAgent")),y.httpsAgent=p.configuration.httpsAgent):!0===D&&(d?(p.logger.debug("Request #".concat(s,": Enabling keepAlive")),y.httpsAgent=new a.Agent({keepAlive:!0})):p.logger.warn("Request #".concat(s,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),p.configuration.paramsSerializer&&(p.logger.debug("Request #".concat(s,": Using custom paramsSerializer")),y.paramsSerializer=p.configuration.paramsSerializer),R&&("string"==typeof R&&0!==R.length||"object"==typeof R&&0!==Object.keys(R).length)&&(y.data=R),E&&(b=i.default.CancelToken,C=b.source(),h=function(){c=!0,C.cancel()},E.addEventListener("abort",h),y.cancelToken=C.token),I?(y.responseType="stream",d||(y.headers=r.__assign(r.__assign({},y.headers),{Accept:"text/event-stream"}))):j&&(y.responseType=j),[4,(0,i.default)(y)];case 2:if((O=A.sent()).status>=1&&O.status<=499&&p.setNodeHealthcheck(f,l),p.logger.debug("Request #".concat(s,": Request to Node ").concat(f.index," was made. Response Code was ").concat(O.status,".")),O.status>=200&&O.status<300)return I?[2,{value:p.handleStreamingResponse(O,U)}]:[2,{value:Promise.resolve(O.data)}];if(O.status<500)return[2,{value:Promise.reject(p.customErrorForResponse(O,null===(v=O.data)||void 0===v?void 0:v.message,y.data))}];throw p.customErrorForResponse(O,null===(_=O.data)||void 0===_?void 0:_.message,y.data);case 3:return P=A.sent(),c||p.setNodeHealthcheck(f,!1),u=P,p.logger.warn("Request #".concat(s,": Request to Node ").concat(f.index,' failed due to "').concat(null!==(g=null==P?void 0:P.code)&&void 0!==g?g:""," ").concat(P.message).concat(null==P.response?"":" - "+JSON.stringify(null===(m=P.response)||void 0===m?void 0:m.data),'"')),c?[2,{value:Promise.reject(new Error("Request aborted by caller."))}]:(I&&p.invokeOnErrorCallback(P,U),n<p.numRetriesPerRequest+1?(p.logger.warn("Request #".concat(s,": Sleeping for ").concat(p.retryIntervalSeconds,"s and then retrying request...")),[4,p.timer(p.retryIntervalSeconds)]):(p.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,{value:Promise.reject(u)}]));case 4:return A.sent(),[3,6];case 5:return E&&h&&E.removeEventListener("abort",h),[7];case 6:return[2]}}))},p=this,h=1,n.label=1;case 1:return h<=this.numRetriesPerRequest+1?[5,f(h)]:[3,4];case 2:if("object"==typeof(y=n.sent()))return[2,y.value];n.label=3;case 3:return h++,[3,1];case 4:return this.logger.debug("Request #".concat(s,": No retries left. Raising last error")),[2,Promise.reject(u)]}}))}))},e.prototype.processStreamingLine=function(e){if(!e.trim()||"data: [DONE]"===e)return null;if(e.startsWith("data: "))return this.processDataLine(e.slice(6).trim());if(e.trim().startsWith("{"))try{var t=JSON.parse(e.trim());return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e.trim()}}return{conversation_id:"unknown",message:e.trim()}},e.prototype.processDataLine=function(e){if(!e)return null;if(e.startsWith("{"))try{var t=JSON.parse(e);return t&&"object"==typeof t?(t.conversation_id||(t.conversation_id="unknown"),t.message||""===t.message||(t.message=""),t):{conversation_id:"unknown",message:JSON.stringify(t)}}catch(t){return{conversation_id:"unknown",message:e}}return{conversation_id:"unknown",message:e}},e.prototype.handleStreamingResponse=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return this.logger.debug("Handling streaming response. Environment: ".concat(d?"Node.js":"Browser")),d&&e.data?[2,this.handleNodeStreaming(e,t)]:d?(this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(e.data,t),[2,Promise.resolve(e.data)]):[2,this.handleBrowserStreaming(e,t)]}))}))},e.prototype.handleNodeStreaming=function(e,t){var n=this;return this.logger.debug("Processing Node.js stream"),new Promise((function(r,i){var o=e.data,a=[],s="";o.on("data",(function(e){var r;try{var o=e.toString(),u=(s+=o).split("\n");s=null!==(r=u.pop())&&void 0!==r?r:"",n.processStreamLines(u,a,t)}catch(e){i(e)}})),o.on("end",(function(){if(s.trim().length>0){var i=s.split("\n");n.processStreamLines(i,a,t)}n.finalizeStreamResult(a,r,e,t)})),o.on("error",(function(e){n.logger.error("Stream error: ".concat(e)),n.invokeOnErrorCallback(e,t),i(e)}))}))},e.prototype.handleBrowserStreaming=function(e,t){var n=this;return this.logger.debug("Processing browser stream"),new Promise((function(i,o){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){try{return e.data&&"function"==typeof e.data.getReader?[2,this.handleBrowserReadableStream(e.data,i,o,e,t)]:"string"==typeof e.data?[2,this.handleBrowserStringResponse(e.data,i,e,t)]:"object"==typeof e.data&&null!==e.data?(this.logger.debug("No stream found, but data object is available"),this.invokeOnCompleteCallback(e.data,t),[2,i(e.data)]):(this.logger.error("No usable data found in response"),[2,o(new Error("No usable data found in response"))])}catch(e){this.logger.error("Error processing streaming response: ".concat(e)),this.invokeOnErrorCallback(e,t),o(e)}return[2]}))}))}))},e.prototype.handleBrowserReadableStream=function(e,t,n,i,o){return r.__awaiter(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,p,h,y;return r.__generator(this,(function(r){switch(r.label){case 0:this.logger.debug("Found ReadableStream in response.data"),a=e.getReader(),s=[],u="",r.label=1;case 1:r.trys.push([1,5,,6]),r.label=2;case 2:return[4,a.read()];case 3:return c=r.sent(),l=c.done,d=c.value,l?(this.logger.debug("Stream reading complete"),u.trim()&&(f=u.split("\n"),this.processStreamLines(f,s,o)),[3,4]):(p=(new TextDecoder).decode(d),this.logger.debug("Received chunk: ".concat(p.length," bytes")),h=(u+=p).split("\n"),u=h.pop()||"",this.processStreamLines(h,s,o),[3,2]);case 4:return this.finalizeStreamResult(s,t,i,o),[3,6];case 5:return y=r.sent(),this.logger.error("Stream error: ".concat(y)),this.invokeOnErrorCallback(y,o),n(y),[3,6];case 6:return[2]}}))}))},e.prototype.handleBrowserStringResponse=function(e,t,n,r){this.logger.debug("Processing text response as stream data");var i=[],o=e.split("\n");if(this.processStreamLines(o,i,r),i.length>0){var a=this.combineStreamingChunks(i);this.invokeOnCompleteCallback(a,r),t(a)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.processStreamLines=function(e,t,n){for(var r=0,i=e;r<i.length;r++){var o=i[r];if(o.trim()&&"data: [DONE]"!==o){var a=this.processStreamingLine(o);null!==a&&(this.invokeOnChunkCallback(a,n),t.push(a))}}},e.prototype.finalizeStreamResult=function(e,t,n,r){if(e.length>0){var i=this.combineStreamingChunks(e);this.logger.debug("Stream processing complete"),this.invokeOnCompleteCallback(i,r),t(i)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(n.data,r),t(n.data)},e.prototype.combineStreamingChunks=function(e){if(0===e.length)return{};if(1===e.length)return e[0];var t=this.getMessageChunks(e);if(t.length>0)return this.combineMessageChunks(e,t);var n=e[e.length-1];if(!this.isCompleteSearchResponse(n))throw new Error("Last chunk is not a complete search response");return n},e.prototype.getMessageChunks=function(e){return e.filter(this.isChunkMessage)},e.prototype.isChunkMessage=function(e){return"object"==typeof e&&null!==e&&"message"in e&&"conversation_id"in e},e.prototype.combineMessageChunks=function(e,t){this.logger.debug("Found ".concat(t.length," message chunks to combine"));var n=e[e.length-1];if(this.isCompleteSearchResponse(n))return n;var r=e.find(this.isCompleteSearchResponse);if(!r)throw new Error("No metadata chunk found");return r},e.prototype.isCompleteSearchResponse=function(e){return"object"==typeof e&&null!==e&&Object.keys(e).length>0&&("results"in e||"found"in e||"hits"in e||"page"in e||"search_time_ms"in e)},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,l)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,l)}))},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*e)}))]}))}))},e.prototype.customErrorForResponse=function(e,t,n){var r="Request failed with HTTP code ".concat(e.status);return"string"==typeof t&&""!==t.trim()&&(r+=" | Server said: ".concat(t)),new u.default(r,n,e.status),400===e.status?new s.RequestMalformed(r,n,e.status):401===e.status?new s.RequestUnauthorized(r,n,e.status):404===e.status?new s.ObjectNotFound(r,n,e.status):409===e.status?new s.ObjectAlreadyExists(r,n,e.status):422===e.status?new s.ObjectUnprocessable(r,n,e.status):e.status>=500&&e.status<=599?new s.ServerError(r,n,e.status):new s.HTTPError(r,n,e.status)},e.prototype.invokeOnChunkCallback=function(e,t){if(null==t?void 0:t.onChunk)try{t.onChunk(e)}catch(e){this.logger.warn("Error in onChunk callback: ".concat(e))}},e.prototype.invokeOnCompleteCallback=function(e,t){if(null==t?void 0:t.onComplete)try{t.onComplete(e)}catch(e){this.logger.warn("Error in onComplete callback: ".concat(e))}},e.prototype.invokeOnErrorCallback=function(e,t){if(null==t?void 0:t.onError){var n=(0,c.toErrorWithMessage)(e);try{t.onError(n)}catch(e){this.logger.warn("Error in onError callback: ".concat(e))}}},e}();t.default=f},5641:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(7361)),s=r.__importDefault(n(2626)),u=r.__importDefault(n(612)),c=r.__importDefault(n(5300)),l=r.__importDefault(n(326)),d=r.__importDefault(n(2275)),f=r.__importDefault(n(3343)),p=r.__importDefault(n(657)),h=r.__importDefault(n(4955)),y=r.__importDefault(n(8231)),v=r.__importDefault(n(3684)),_=r.__importDefault(n(8621)),g=r.__importDefault(n(5156)),m=r.__importDefault(n(3777)),b=r.__importDefault(n(3421)),w=r.__importDefault(n(800)),C=r.__importDefault(n(3533)),R=r.__importDefault(n(4646)),O=r.__importDefault(n(8700)),S=r.__importDefault(n(8313)),P=r.__importDefault(n(2786)),E=r.__importDefault(n(5350)),A=r.__importDefault(n(7187)),j=r.__importDefault(n(4200)),T=r.__importDefault(n(2077)),N=r.__importDefault(n(476)),x=r.__importDefault(n(1049)),D=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.debug=new f.default(this.apiCall),this.metrics=new p.default(this.apiCall),this.stats=new h.default(this.apiCall),this.health=new y.default(this.apiCall),this.operations=new v.default(this.apiCall),this.multiSearch=new _.default(this.apiCall,this.configuration),this._collections=new a.default(this.apiCall),this.individualCollections={},this._aliases=new u.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new g.default(this.apiCall),this.individualPresets={},this._stopwords=new C.default(this.apiCall),this.individualStopwords={},this.analytics=new w.default(this.apiCall),this.analyticsV1=new b.default(this.apiCall),this.stemming=new P.default(this.apiCall),this._conversations=new O.default(this.apiCall),this.individualConversations={},this._nlSearchModels=new E.default(this.apiCall),this.individualNLSearchModels={},this._synonymSets=new j.default(this.apiCall),this.individualSynonymSets={},this._curationSets=new N.default(this.apiCall),this.individualCurationSets={}}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new c.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new d.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new m.default(e,this.apiCall)),this.individualPresets[e])},e.prototype.stopwords=function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new R.default(e,this.apiCall)),this.individualStopwords[e])},e.prototype.conversations=function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new S.default(e,this.apiCall)),this.individualConversations[e])},e.prototype.nlSearchModels=function(e){return void 0===e?this._nlSearchModels:(void 0===this.individualNLSearchModels[e]&&(this.individualNLSearchModels[e]=new A.default(e,this.apiCall)),this.individualNLSearchModels[e])},e.prototype.synonymSets=function(e){return void 0===e?this._synonymSets:(void 0===this.individualSynonymSets[e]&&(this.individualSynonymSets[e]=new T.default(e,this.apiCall)),this.individualSynonymSets[e])},e.prototype.curationSets=function(e){return void 0===e?this._curationSets:(void 0===this.individualCurationSets[e]&&(this.individualCurationSets[e]=new x.default(e,this.apiCall)),this.individualCurationSets[e])},e}();t.default=D},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=n(4410),s=r.__importDefault(n(3629)),u=r.__importDefault(n(6582)),c=r.__importDefault(n(1104)),l=r.__importDefault(n(6821)),d=n(9459),f=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=e,this.apiCall=t,this.configuration=n,this._documents=new o.default(this.name,this.apiCall,this.configuration),this._overrides=new s.default(this.name,this.apiCall),this._synonyms=new c.default(this.name,this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.exists=function(){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(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((e=t.sent())instanceof a.ObjectNotFound)return[2,!1];throw e;case 3:return[2]}}))}))},e.prototype.documents=function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new d.Document(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents},e.prototype.overrides=function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new u.default(this.name,e,this.apiCall)),this.individualOverrides[e])},e.prototype.synonyms=function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new l.default(this.name,e,this.apiCall)),this.individualSynonyms[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=f},7361:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/collections",o=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(i,e,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(i,e)]}))}))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();t.default=o},5706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importStar(n(3065)),o=n(4410),a=function(){function e(e){var t=this;this.nodes=e.nodes||[],this.nodes=this.nodes.map((function(e){return t.setDefaultPathInNode(e)})).map((function(e){return t.setDefaultPortInNode(e)})).map((function(e){return r.__assign({},e)})),null==e.randomizeNodes&&(e.randomizeNodes=!0),!0===e.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=e.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=e.connectionTimeoutSeconds||e.timeoutSeconds||5,this.healthcheckIntervalSeconds=e.healthcheckIntervalSeconds||60,this.numRetries=(void 0!==e.numRetries&&e.numRetries>=0?e.numRetries:this.nodes.length+(null==this.nearestNode?0:1))||3,this.retryIntervalSeconds=e.retryIntervalSeconds||.1,this.apiKey=e.apiKey,this.sendApiKeyAsQueryParam=e.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=e.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=e.useServerSideSearchCache||!1,this.axiosAdapter=e.axiosAdapter,this.logger=e.logger||i,this.logLevel=e.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=e.additionalHeaders,this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.paramsSerializer=e.paramsSerializer,this.showDeprecationWarnings(e),this.validate()}return e.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new o.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new o.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new o.MissingConfigurationError("Ensure that apiKey is set");return!0},e.prototype.validateNodes=function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))},e.prototype.isNodeMissingAnyParameters=function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url},e.prototype.setDefaultPathInNode=function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e},e.prototype.setDefaultPortInNode=function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e},e.prototype.showDeprecationWarnings=function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},e.prototype.shuffleArray=function(e){for(var t,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();t.default=a},8313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(8700)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5168:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},2783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),e}();t.default=i},8700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(2783)),o=r.__importDefault(n(5168)),a="/conversations",s=function(){function e(e){this.apiCall=e,this.individualConversationModels={},this.apiCall=e,this._conversationsModels=new i.default(this.apiCall)}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.models=function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new o.default(e,this.apiCall)),this.individualConversationModels[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},1049:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=r.__importDefault(n(285)),a=r.__importDefault(n(4326)),s=function(){function e(e,t){this.name=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.name,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.name,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},e}();t.default=s},4326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t,n){this.name=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(476)),o=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/curation_sets",e}();t.default=i},3343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/debug")]}))}))},e}();t.default=i},9459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Document=void 0;var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(9078)),a=function(){function e(e,t,n){this.collectionName=e,this.documentId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},e.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.patch(this.endpointPath(),e,t)]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))},e}();t.Document=a},9078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(4410),o=n(6124),a="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,s=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return r.__extends(t,e),t.prototype.create=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,t)]}))}))},t.prototype.upsert=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},t.prototype.createMany=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){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(e,t)]}))}))},t.prototype.import=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,o,s,u,c;return void 0===t&&(t={}),r.__generator(this,(function(l){switch(l.label){case 0:if(n=r.__assign({throwOnFail:!0},t),Array.isArray(e)){if(0===e.length)throw new i.RequestMalformed("No documents provided");try{o=e.map((function(e){return JSON.stringify(e)})).join("\n")}catch(e){if(e instanceof RangeError&&e.message.includes("Too many properties to enumerate"))throw new Error("".concat(e,"\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 new Error(e)}}else if(null==(d=o=e)||""===d||0===d.length)throw new i.RequestMalformed("No documents provided");return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:o,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(s=l.sent(),Array.isArray(e)){if(u=s.split("\n").map((function(e){return JSON.parse(e)})),(c=u.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)throw new i.ImportError("".concat(u.length-c.length," documents imported successfully, ").concat(c.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),u,{documentsInJSONLFormat:o,options:n,failedItems:c,successCount:u.length-c.length});return[2,u]}return[2,s]}var d}))}))},t.prototype.importStream=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,o,s,u;return void 0===t&&(t={}),r.__generator(this,(function(c){switch(c.label){case 0:return n=r.__assign({throwOnFail:!0},t),[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!a})];case 1:if(o=c.sent(),s=o.split("\n").map((function(e){return JSON.parse(e)})),(u=s.filter((function(e){return!1===e.success}))).length>0&&n.throwOnFail)throw new i.ImportError("".concat(s.length-u.length," documents imported successfully, ").concat(u.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),s,{documentsInJSONLFormat:e,options:n,failedItems:u,successCount:s.length-u.length});return[2,s]}}))}))},t.prototype.export=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]}))}))},t.prototype.exportStream=function(){return r.__awaiter(this,arguments,void 0,(function(e){return void 0===e&&(e={}),r.__generator(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]}))}))},t}(o.SearchOnlyDocuments);t.default=s},2144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8331:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.importResults=n,i.payload=r,i}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},2703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},8274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},6909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},1081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(r.__importDefault(n(7796)).default);t.default=i},7796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(e){function t(t,n,r){var i=this.constructor,o=e.call(this,t)||this;return o.name=i.name,o.httpBody=n,o.httpStatus=r,Object.setPrototypeOf(o,i.prototype),o}return r.__extends(t,e),t}(Error);t.default=i},4410:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportError=t.TypesenseError=t.ServerError=t.RequestUnauthorized=t.RequestMalformed=t.ObjectUnprocessable=t.ObjectNotFound=t.ObjectAlreadyExists=t.MissingConfigurationError=t.HTTPError=void 0;var r=n(3301),i=r.__importDefault(n(2144));t.HTTPError=i.default;var o=r.__importDefault(n(2426));t.MissingConfigurationError=o.default;var a=r.__importDefault(n(6731));t.ObjectAlreadyExists=a.default;var s=r.__importDefault(n(8280));t.ObjectNotFound=s.default;var u=r.__importDefault(n(2703));t.ObjectUnprocessable=u.default;var c=r.__importDefault(n(8274));t.RequestMalformed=c.default;var l=r.__importDefault(n(6909));t.RequestUnauthorized=l.default;var d=r.__importDefault(n(1081));t.ServerError=d.default;var f=r.__importDefault(n(8331));t.ImportError=f.default;var p=r.__importDefault(n(7796));t.TypesenseError=p.default},8231:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/health")]}))}))},e}();t.default=i},2275:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(326)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(3529),o=n(7353),a="/keys",s=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.post(e.RESOURCEPATH,t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(a)]}))}))},e.prototype.generateScopedSearchKey=function(e,t){var n=(0,o.normalizeArrayableParams)(t),r=JSON.stringify(n),a=Buffer.from((0,i.createHmac)("sha256",e).update(r).digest("base64")),s=e.substr(0,4),u="".concat(a).concat(s).concat(r);return Buffer.from(u).toString("base64")},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),e}();t.default=s},657:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/metrics.json")]}))}))},e}();t.default=i},8621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(875)),o=n(7353),a=function(){function e(e,t,n){void 0===n&&(n=!1),this.apiCall=e,this.configuration=t,this.useTextContentType=n,this.requestWithCache=new i.default,this.logger=this.apiCall.logger}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.perform=function(e,t,n){return r.__awaiter(this,void 0,void 0,(function(){var i,a,s,u,c,l,d;return r.__generator(this,(function(f){return i=t?r.__assign({},t):{},a=null!==(d=null==n?void 0:n.cacheSearchResultsForSeconds)&&void 0!==d?d:this.configuration.cacheSearchResultsForSeconds,!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),!0===e.union&&this.hasAnySearchObjectPagination(e)&&this.logger.warn("Individual `searches` pagination parameters are ignored when `union: true` is set. Use a top-level pagination parameter instead. See https://typesense.org/docs/29.0/api/federated-multi-search.html#union-search"),s={union:e.union,searches:e.searches.map(o.normalizeArrayableParams)},u=i.streamConfig,c=r.__rest(i,["streamConfig"]),l=(0,o.normalizeArrayableParams)(c),[2,this.requestWithCache.perform(this.apiCall,"post",{path:"/multi_search",body:s,queryParams:l,headers:this.useTextContentType?{"content-type":"text/plain"}:{},streamConfig:u,abortSignal:null==n?void 0:n.abortSignal,isStreamingRequest:this.isStreamingRequest(i)},void 0!==a?{cacheResponseForSeconds:a}:void 0)]}))}))},e.prototype.isStreamingRequest=function(e){return void 0!==e.streamConfig},e.prototype.hasAnySearchObjectPagination=function(e){return e.searches.some((function(e){return void 0!==e.page||void 0!==e.per_page||void 0!==e.offset||void 0!==e.limit||void 0!==e.limit_hits}))},e}();t.default=a},7187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5350)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},5350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.RESOURCEPATH},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/nl_search_models"},enumerable:!1,configurable:!0}),e}();t.default=i},3684:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i="/operations",o=function(){function e(e){this.apiCall=e}return e.prototype.perform=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={}),r.__generator(this,(function(n){return[2,this.apiCall.post("".concat(i,"/").concat(e),{},t)]}))}))},e.prototype.getSchemaChanges=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("".concat(i,"/schema_changes"))]}))}))},e}();t.default=o},6582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(3629)),a=function(){function e(e,t,n){this.collectionName=e,this.overrideId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))},e}();t.default=a},3629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),e}();t.default=o},3777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5156)),o=function(){function e(e,t){this.presetId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))},e}();t.default=o},5156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=n(7353),o=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,o;return r.__generator(this,(function(r){return"object"==typeof t.value&&"searches"in t.value?(n=t.value.searches.map((function(e){return(0,i.normalizeArrayableParams)(e)})),[2,this.apiCall.put(this.endpointPath(e),{value:{searches:n}})]):(o=(0,i.normalizeArrayableParams)(t.value),[2,this.apiCall.put(this.endpointPath(e),{value:o})])}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),e}();t.default=o},875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(){this.responseCache=new Map,this.responsePromiseCache=new Map}return e.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},e.prototype.perform=function(e,t,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,p,h,y,v,_,g,m,b,w,C,R,O,S;return r.__generator(this,(function(r){switch(r.label){case 0:if(a=(o=i||{}).cacheResponseForSeconds,s=void 0===a?120:a,u=o.maxSize,c=void 0===u?100:u,l=void 0===i||s<=0||c<=0,d=n.path,f=n.queryParams,p=n.body,h=n.headers,y=n.streamConfig,v=n.abortSignal,_=n.responseType,g=n.isStreamingRequest,l)return[2,this.executeRequest(e,t,d,f,p,h,{abortSignal:v,responseType:_,streamConfig:y,isStreamingRequest:g})];if(m=JSON.stringify(n),b=this.responseCache.get(m),w=Date.now(),b){if(w-b.requestTimestamp<1e3*s)return this.responseCache.delete(m),this.responseCache.set(m,b),[2,b.response];this.responseCache.delete(m)}if(C=this.responsePromiseCache.get(m)){if(w-C.requestTimestamp<1e3*s)return this.responsePromiseCache.delete(m),this.responsePromiseCache.set(m,C),[2,C.responsePromise];this.responsePromiseCache.delete(m)}return R=this.executeRequest(e,t,d,f,p,h,{abortSignal:v,responseType:_,streamConfig:y,isStreamingRequest:g}),this.responsePromiseCache.set(m,{requestTimestamp:w,responsePromise:R}),[4,R];case 1:return O=r.sent(),this.responseCache.set(m,{requestTimestamp:w,response:O}),this.responseCache.size>c&&(S=this.responseCache.keys().next().value)&&this.responseCache.delete(S),this.responsePromiseCache.size>c&&(S=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(S),[2,O]}}))}))},e.prototype.executeRequest=function(e,t,n,r,i,o,a){void 0===r&&(r={});var s=e[t];switch(t){case"get":return s.call(e,n,r,{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"delete":return s.call(e,n,r);case"post":return s.call(e,n,i,r,o||{},{abortSignal:null==a?void 0:a.abortSignal,responseType:null==a?void 0:a.responseType,streamConfig:null==a?void 0:a.streamConfig,isStreamingRequest:null==a?void 0:a.isStreamingRequest});case"put":case"patch":return s.call(e,n,i,r);default:throw new Error("Unsupported method: ".concat(String(t)))}},e}();t.default=i},8557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5706)),o=r.__importDefault(n(5996)),a=r.__importDefault(n(8621)),s=n(7112),u=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new i.default(e),this.apiCall=new o.default(this.configuration),this.multiSearch=new a.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){e[0],e[1].documents().clearCache()}))},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new 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.")},e}();t.default=u},7112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyCollection=void 0;var r=n(6124),i=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return e.prototype.documents=function(){return this._documents},e}();t.SearchOnlyCollection=i},6124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyDocuments=void 0;var r=n(3301),i=r.__importDefault(n(875)),o=r.__importDefault(n(7361)),a=n(7353),s="/documents",u=function(){function e(e,t,n){this.collectionName=e,this.apiCall=t,this.configuration=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.search=function(e){return r.__awaiter(this,arguments,void 0,(function(e,t){var n,i,o,s,u,c,l=void 0===t?{}:t,d=l.cacheSearchResultsForSeconds,f=void 0===d?this.configuration.cacheSearchResultsForSeconds:d,p=l.abortSignal,h=void 0===p?null:p;return r.__generator(this,(function(t){return n={},!0===this.configuration.useServerSideSearchCache&&(n.use_cache=!0),i=(0,a.normalizeArrayableParams)(e),o=i.streamConfig,s=r.__rest(i,["streamConfig"]),u=r.__assign(r.__assign({},n),s),c=!0===u.conversation_stream,[2,this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:u,streamConfig:o,abortSignal:h,isStreamingRequest:c},{cacheResponseForSeconds:f})]}))}))},e.prototype.endpointPath=function(e){return"".concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(s).concat(void 0===e?"":"/"+e)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return s},enumerable:!1,configurable:!0}),e}();t.SearchOnlyDocuments=u},4955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get("/stats.json")]}))}))},e}();t.default=i},2786:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=r.__importDefault(n(5426)),a=function(){function e(e){this.apiCall=e,this.individualStemmingDictionaries={},this.apiCall=e,this._stemmingDictionaries=new i.default(this.apiCall)}return e.prototype.dictionaries=function(e){return void 0===e?this._stemmingDictionaries:(void 0===this.individualStemmingDictionaries[e]&&(this.individualStemmingDictionaries[e]=new o.default(e,this.apiCall)),this.individualStemmingDictionaries[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming"},enumerable:!1,configurable:!0}),e}();t.default=a},5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return n=Array.isArray(t)?t.map((function(e){return JSON.stringify(e)})).join("\n"):t,[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:e},bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:return i=r.sent(),[2,Array.isArray(t)?i.split("\n").map((function(e){return JSON.parse(e)})):i]}}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return void 0===t?"".concat(e.RESOURCEPATH):"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stemming/dictionaries"},enumerable:!1,configurable:!0}),e}();t.default=i},5426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(5214)),o=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},e}();t.default=o},4646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(3533)),o=function(){function e(e,t){this.stopwordId=e,this.apiCall=t}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))},e}();t.default=o},3533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),e}();t.default=i},6821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=r.__importDefault(n(1104)),a=function(){function e(e,t,n){this.collectionName=e,this.synonymId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonym' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets 'synonym_sets'."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(o.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))},e.hasWarnedDeprecation=!1,e}();t.default=a},2077:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=r.__importDefault(n(3905)),a=r.__importDefault(n(7394)),s=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t,this.individualItems={},this._items=new o.default(this.synonymSetName,t)}return e.prototype.upsert=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.items=function(e){return void 0===e?this._items:(void 0===this.individualItems[e]&&(this.individualItems[e]=new a.default(this.synonymSetName,e,this.apiCall)),this.individualItems[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName))},e}();t.default=s},7394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t,n){this.synonymSetName=e,this.itemId=t,this.apiCall=n}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items/").concat(encodeURIComponent(this.itemId))},e}();t.default=o},3905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(4200)),o=function(){function e(e,t){this.synonymSetName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(e){return"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymSetName),"/items").concat(void 0===e?"":"/"+encodeURIComponent(e))},e}();t.default=o},4200:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this.apiCall.get(e.RESOURCEPATH)]}))}))},e.RESOURCEPATH="/synonym_sets",e}();t.default=i},1104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3301),i=r.__importDefault(n(7361)),o=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return[2,this.apiCall.put(this.endpointPath(e),t)]}))}))},e.prototype.retrieve=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return e.hasWarnedDeprecation||(console.warn("[typesense] 'synonyms' APIs are deprecated starting with Typesense Server v30. Please migrate to synonym sets ('synonym_sets')."),e.hasWarnedDeprecation=!0),"".concat(i.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),e.hasWarnedDeprecation=!1,e}();t.default=o},7765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayableParams=void 0,t.arrayableParams={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",synonym_sets:"synonym_sets",sort_by:"sort_by"}},7353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeArrayableParams=function(e){var t=r.__assign({},e);if(!Object.keys(i.arrayableParams).filter((function(e){return Array.isArray(t[e])})).map((function(e){return t[e]=t[e].join(","),e})).length&&o(t))return t;if(!o(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t},t.toErrorWithMessage=function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return"string"==typeof e?new Error(e):new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}};var r=n(3301),i=n(7765);function o(e){return Object.keys(i.arrayableParams).filter((function(t){return void 0!==e[t]})).every((function(t){return n=e[t],!Array.isArray(n);var n}))}},3529:()=>{},5978:()=>{},7205:()=>{},4633:(e,t,n)=>{var r=n(3738).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),a=new D(r||[]);return s(o,"_invoke",{value:j(e,n,a)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var y="suspendedStart",v="suspendedYield",_="executing",g="completed",m={};function b(){}function w(){}function C(){}var R={};f(R,c,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(k([])));S&&S!==o&&a.call(S,c)&&(R=S);var P=C.prototype=b.prototype=Object.create(R);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,o,s,u){var c=h(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function j(e,n,r){var i=y;return function(o,a){if(i===_)throw Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===y)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=_;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?g:v,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function T(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=C,s(P,"constructor",{value:C,configurable:!0}),s(C,"constructor",{value:w,configurable:!0}),w.displayName=f(C,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,C):(e.__proto__=C,f(e,d,"GeneratorFunction")),e.prototype=Object.create(P),e},n.awrap=function(e){return{__await:e}},E(A.prototype),f(A.prototype,l,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,o){void 0===o&&(o=Promise);var a=new A(p(e,t,r,i),o);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(P),f(P,d,"Generator"),f(P,c,(function(){return this})),f(P,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=k,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6425:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:a,toStringTag:s}=Symbol,u=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=(e,t)=>{let n=e;const r=[];for(;null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),u(n,t))return!0;n=o(n)}return!1},l=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const f=e=>(e=e.toLowerCase(),t=>l(t)===e),p=e=>t=>typeof t===e,{isArray:h}=Array,y=p("undefined");function v(e){return null!==e&&!y(e)&&null!==e.constructor&&!y(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _=f("ArrayBuffer"),g=p("string"),m=p("function"),b=p("number"),w=e=>null!==e&&"object"==typeof e,C=e=>{if(!w(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==o(t)||c(e,s)||c(e,a))},R=f("Date"),O=f("File"),S=f("Blob"),P=f("FileList"),E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},A=void 0!==E.FormData?E.FormData:void 0,j=f("URLSearchParams"),[T,N,x,D]=["ReadableStream","Request","Response","Headers"].map(f);function k(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),h(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(v(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function U(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,F=e=>!y(e)&&e!==I,q=(L="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>L&&e instanceof L);var L;const M=f("HTMLFormElement"),{propertyIsEnumerable:H}=Object.prototype,B=f("RegExp"),W=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};k(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)},z=f("AsyncFunction"),V=(K="function"==typeof setImmediate,J=m(I.postMessage),K?setImmediate:J?(G=`axios@${Math.random()}`,$=[],I.addEventListener("message",(({source:e,data:t})=>{e===I&&t===G&&$.length&&$.shift()()}),!1),e=>{$.push(e),I.postMessage(G,"*")}):e=>setTimeout(e));var K,J,G,$;const X="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||V,Q=e=>null!=e&&m(e[a]);var Y={isArray:h,isArrayBuffer:_,isBuffer:v,isFormData:e=>{if(!e)return!1;if(A&&e instanceof A)return!0;const t=o(e);if(!t||t===Object.prototype)return!1;if(!m(e.append))return!1;const n=l(e);return"formdata"===n||"object"===n&&m(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&_(e.buffer),t},isString:g,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:C,isEmptyObject:e=>{if(!w(e)||v(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:N,isResponse:x,isHeaders:D,isUndefined:y,isDate:R,isFile:O,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:S,isRegExp:B,isFunction:m,isStream:e=>w(e)&&m(e.pipe),isURLSearchParams:j,isTypedArray:q,isFileList:P,forEach:k,merge:function e(...t){const{caseless:n,skipUndefined:r}=F(this)&&this||{},i={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=n&&"string"==typeof o&&U(i,o)||o,s=u(i,a)?i[a]:void 0;C(s)&&C(t)?i[a]=e(s,t):C(t)?i[a]=e({},t):h(t)?i[a]=t.slice():r&&y(t)||(i[a]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||v(n))continue;if(k(n,o),"object"!=typeof n||h(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];H.call(n,t)&&o(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:i}={})=>(k(t,((t,i)=>{n&&m(t)?Object.defineProperty(e,i,{__proto__:null,value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:M,hasOwnProperty:u,hasOwnProp:u,hasOwnInPrototypeChain:c,getSafeProp:(e,t)=>null!=e&&c(e,t)?e[t]:void 0,reduceDescriptors:W,freezeMethods:e=>{W(e,((t,n)=>{if(m(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];m(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return h(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:I,isContextDefined:F,isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[s]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(w(e)){if(t.has(e))return;if(v(e))return e;if(!("toJSON"in e)){t.add(e);const r=h(e)?[]:{};return k(e,((e,t)=>{const i=n(e);!y(i)&&(r[t]=i)})),t.delete(e),r}}return e};return n(e)},isAsyncFn:z,isThenable:e=>e&&(w(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:V,asap:X,isIterable:Q,isSafeIterable:e=>null!=e&&c(e,a)&&Q(e)};const Z=Y.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"]),ee=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),te=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ne(e,t){return Y.isArray(e)?e.map((e=>ne(e,t))):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function re(e){const t=Object.create(null);return Y.forEach(e.toJSON(),((e,n)=>{t[n]=(e=>ne(e,te))(e)})),t}const ie=Symbol("internals");function oe(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:Y.isArray(e)?e.map(ae):(e=>ne(e,ee))(String(e))}function se(e,t,n,r,i){return Y.isFunction(r)?r.call(this,t,n):(i&&(t=n),Y.isString(t)?Y.isString(r)?-1!==t.indexOf(r):Y.isRegExp(r)?r.test(t):void 0:void 0)}class ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=oe(t);if(!i)return;const o=Y.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ae(e))}const o=(e,t)=>Y.forEach(e,((e,n)=>i(e,n,t)));if(Y.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Y.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Z[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Y.isObject(e)&&Y.isSafeIterable(e)){let n,r,i=Object.create(null);for(const t of e){if(!Y.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],Y.hasOwnProp(i,r)?(n=i[r],i[r]=Y.isArray(n)?[...n,t[1]]:[n,t[1]]):i[r]=t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=oe(e)){const n=Y.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Y.isFunction(t))return t.call(this,e,n);if(Y.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oe(e)){const n=Y.findKey(this,e);return!(!n||void 0===this[n]||t&&!se(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=oe(e)){const i=Y.findKey(n,e);!i||t&&!se(0,n[i],i,t)||(delete n[i],r=!0)}}return Y.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!se(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return Y.forEach(this,((r,i)=>{const o=Y.findKey(n,i);if(o)return t[o]=ae(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ae(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Y.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Y.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=oe(e);t[r]||(function(e,t){const n=Y.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return Y.isArray(e)?e.forEach(r):r(e),this}}ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(ue.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Y.freezeMethods(ue);class ce extends Error{static from(e,t,n,r,i,o){const a=new ce(e.message,t||e.code,n,r,i);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),o&&Object.assign(a,o),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Y.hasOwnProp(e,"redact")?e.redact:void 0,n=Y.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Y.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ue&&(e=e.toJSON()),r.push(e),Y.isArray(e))t=[],e.forEach(((e,n)=>{const r=i(e);Y.isUndefined(r)||(t[n]=r)}));else{if(!Y.isPlainObject(e)&&function(e){if(Y.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Y.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,o]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":i(o);Y.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}(e,t):Y.toJSONObject(e);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:n,code:this.code,status:this.status}}}ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ce.ERR_BAD_OPTION="ERR_BAD_OPTION",ce.ECONNABORTED="ECONNABORTED",ce.ETIMEDOUT="ETIMEDOUT",ce.ECONNREFUSED="ECONNREFUSED",ce.ERR_NETWORK="ERR_NETWORK",ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ce.ERR_DEPRECATED="ERR_DEPRECATED",ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ce.ERR_CANCELED="ERR_CANCELED",ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ce.ERR_INVALID_URL="ERR_INVALID_URL",ce.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const le=100;function de(e){return Y.isPlainObject(e)||Y.isArray(e)}function fe(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function pe(e,t,n){return e?e.concat(t).map((function(e,t){return e=fe(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const he=Y.toFlatObject(Y,{},null,(function(e){return/^is[A-Z]/.test(e)}));function ye(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Y.isUndefined(t[e])}))).metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===n.maxDepth?le:n.maxDepth,c=s&&Y.isSpecCompliantForm(t),l=[];if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Y.isDate(e))return e.toISOString();if(Y.isBoolean(e))return e.toString();if(!c&&Y.isBlob(e))throw new ce("Blob is not supported. Use a Buffer instead.");if(Y.isArrayBuffer(e)||Y.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if("undefined"!=typeof Buffer)return Buffer.from(e);throw new ce("Blob is not supported. Use a Buffer instead.",ce.ERR_NOT_SUPPORT)}return e}function f(e){if(e>u)throw new ce("Object is too deeply nested ("+e+" levels). Max depth: "+u,ce.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,i){let s=e;if(Y.isReactNative(t)&&Y.isReactNativeBlob(e))return t.append(pe(i,n,o),d(e)),!1;if(e&&!i&&"object"==typeof e)if(Y.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(u===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,(function(e,t){if(!Y.isObject(t))return t;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(t),f(1+n.length-1),t}))}(e);else if(Y.isArray(e)&&function(e){return Y.isArray(e)&&!e.some(de)}(e)||(Y.isFileList(e)||Y.endsWith(n,"[]"))&&(s=Y.toArray(e)))return n=fe(n),s.forEach((function(e,r){!Y.isUndefined(e)&&null!==e&&t.append(!0===a?pe([n],r,o):null===a?n:n+"[]",d(e))})),!1;return!!de(e)||(t.append(pe(i,n,o),d(e)),!1)}const h=Object.assign(he,{defaultVisitor:p,convertValue:d,isVisitable:de});if(!Y.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!Y.isUndefined(n)){if(f(o),-1!==l.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));l.push(n),Y.forEach(n,(function(n,a){!0===(!(Y.isUndefined(n)||null===n)&&i.call(t,n,Y.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a],o+1)})),l.pop()}}(e),t}function ve(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function _e(e,t){this._pairs=[],e&&ye(e,this,t)}const ge=_e.prototype;function me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function be(e,t,n){if(!t)return e;e=e||"";const r=Y.isFunction(n)?{serialize:n}:n,i=Y.getSafeProp(r,"encode")||me,o=Y.getSafeProp(r,"serialize");let a;if(a=o?o(t,r):Y.isURLSearchParams(t)?t.toString():new _e(t,r).toString(i),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}ge.append=function(e,t){this._pairs.push([e,t])},ge.toString=function(e){const t=e?t=>e.call(this,t,ve):ve;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class we{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Oe="undefined"!=typeof window&&"undefined"!=typeof document,Se="object"==typeof navigator&&navigator||void 0,Pe=Oe&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),Ee="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ae=Oe&&window.location.href||"http://localhost";var je={...Object.freeze({__proto__:null,hasBrowserEnv:Oe,hasStandardBrowserEnv:Pe,hasStandardBrowserWebWorkerEnv:Ee,navigator:Se,origin:Ae}),...Re};const Te=le;function Ne(e){if(e>Te)throw new ce("FormData field is too deeply nested ("+e+" levels). Max depth: "+Te,ce.ERR_FORM_DATA_DEPTH_EXCEEDED)}function xe(e){function t(e,n,r,i){Ne(i);let o=e[i++];if("__proto__"===o)return!0;const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&Y.isArray(r)?r.length:o,s?(Y.hasOwnProp(r,o)?r[o]=Y.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!a):(Y.hasOwnProp(r,o)&&Y.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&Y.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!a)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,((e,r)=>{t(function(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;null!==(r=n.exec(e));)Ne(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)})),n}return null}const De=(e,t)=>null!=e&&Y.hasOwnProp(e,t)?e[t]:void 0,ke={transitional:Ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=Y.isObject(e);if(i&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return r?JSON.stringify(xe(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e)||Y.isReadableStream(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=De(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ye(e,new je.classes.URLSearchParams,{visitor:function(e,t,n,r){return je.isNode&&Y.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=De(this,"env"),r=n&&n.FormData;return ye(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(Y.isString(e))try{return(0,JSON.parse)(e),Y.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=De(this,"transitional")||ke.transitional,n=t&&t.forcedJSONParsing,r=De(this,"responseType"),i="json"===r;if(Y.isResponse(e)||Y.isReadableStream(e))return e;if(e&&Y.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,De(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw ce.from(e,ce.ERR_BAD_RESPONSE,this,null,De(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function Ue(e,t){const n=this||ke,r=t||n,i=ue.from(r.headers);let o=r.data;return Y.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Ie(e){return!(!e||!e.__CANCEL__)}Y.forEach(["delete","get","head","post","put","patch","query"],(e=>{ke.headers[e]={}}));class Fe extends ce{constructor(e,t,n){super(null==e?"canceled":e,ce.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}function qe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ce("Request failed with status code "+n.status,n.status>=400&&n.status<500?ce.ERR_BAD_REQUEST:ce.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Le=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];i||(i=u),n[o]=s,r[o]=u;let l=a,d=0;for(;l!==o;)d+=n[l++],l%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(n,o){let a,s,u=0,c=1e3/o;const l=(n,o=Date.now())=>{u=o,a=null,s&&(clearTimeout(s),s=null),(n=>{if(!n||"number"!=typeof n.loaded)return;const o=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(o,a):o,u=Math.max(0,s-r),c=i(u);r=Math.max(r,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-u;n>=c?l(e,t):(a=e,s||(s=setTimeout((()=>{s=null,l(a)}),c-n)))},()=>a&&l(a)]}(0,n)},Me=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},He=e=>(...t)=>Y.asap((()=>e(...t)));var Be=je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(je.origin),je.navigator&&/(msie|trident)/i.test(je.navigator.userAgent)):()=>!0,We=je.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Y.isString(r)&&s.push(`path=${r}`),Y.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),Y.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(-1!==i&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch(e){return r.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const ze=/^https?:(?!\/\/)/i,Ve=/[\t\n\r]/g;function Ke(e,t){if("string"==typeof e&&ze.test(function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Ve,"")}(e)))throw new ce('Invalid URL: missing "//" after protocol',ce.ERR_INVALID_URL,t)}function Je(e,t,n,r){Ke(t,r);let i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(i||!1===n)?(Ke(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}const Ge=e=>e instanceof ue?{...e}:e;function $e(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return Y.isPlainObject(e)&&Y.isPlainObject(t)?Y.merge.call({caseless:r},e,t):Y.isPlainObject(t)?Y.merge({},t):Y.isArray(t)?t.slice():t}function i(e,t,n,i){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!Y.isUndefined(t))return r(void 0,t)}function a(e,t){return Y.isUndefined(t)?Y.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return Y.hasOwnProp(t,o)?r(n,i):Y.hasOwnProp(e,o)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(Ge(e),Ge(t),0,!0)};return Y.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=Y.hasOwnProp(u,r)?u[r]:i,a=o(Y.hasOwnProp(e,r)?e[r]:void 0,Y.hasOwnProp(t,r)?t[r]:void 0,r);Y.isUndefined(a)&&o!==s||(n[r]=a)})),Y.hasOwnProp(t,"validateStatus")&&Y.isUndefined(t.validateStatus)&&!1===function(n){const r=Y.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Y.isUndefined(r)){if(!Y.isPlainObject(r))return;if(Y.hasOwnProp(r,n))return r[n]}const i=Y.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Y.isPlainObject(i)&&Y.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Y.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Xe=["content-type","content-length"];function Qe(e){const t=$e({},e),n=e=>Y.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const u=n("auth"),c=n("baseURL"),l=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=ue.from(s),t.url=be(Je(c,d,l,t),n("params"),n("paramsSerializer")),u){const t=Y.getSafeProp(u,"username")||"",n=Y.getSafeProp(u,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))):"")))}catch(t){throw ce.from(t,ce.ERR_BAD_OPTION_VALUE,e)}}if(Y.isFormData(r)&&(je.hasStandardBrowserEnv||je.hasStandardBrowserWebWorkerEnv||Y.isReactNative(r)?s.setContentType(void 0):Y.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((([t,n])=>{Xe.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),je.hasStandardBrowserEnv&&(Y.isFunction(i)&&(i=i(t)),!0===i||null==i&&Be(t.url))){const e=o&&a&&We.read(a);e&&s.set(o,e)}return t}var Ye="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Qe(e);let i=r.data;const o=ue.from(r.headers).normalize();let a,s,u,c,l,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function v(){if(!y)return;const r=ue.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());qe((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&y.responseURL.startsWith("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new ce("Request aborted",ce.ECONNABORTED,e,y)),h(),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new ce(r,ce.ERR_NETWORK,e,y);i.event=t||null,n(i),h(),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ce(t,i.clarifyTimeoutError?ce.ETIMEDOUT:ce.ECONNABORTED,e,y)),h(),y=null},void 0===i&&o.setContentType(null),"setRequestHeader"in y&&Y.forEach(re(o),(function(e,t){y.setRequestHeader(t,e)})),Y.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),p&&([u,l]=Le(p,!0),y.addEventListener("progress",u)),f&&y.upload&&([s,c]=Le(f),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Fe(null,e,y):t),y.abort(),h(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const _=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);if(_&&!je.protocols.includes(_))return n(new ce("Unsupported protocol "+_+":",ce.ERR_BAD_REQUEST,e)),void h();y.send(i||null)}))};const Ze=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ce?t:new Fe(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new ce(`timeout of ${t}ms exceeded`,ce.ETIMEDOUT))}),t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i,{once:!0})));const{signal:s}=n;return s.unsubscribe=()=>Y.asap(a),s},et=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},tt=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*et(n,t)}(e,t);let o,a=0,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let o=r.byteLength;if(n){let e=a+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},nt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,rt=(e,t,n)=>t+2<n&&nt(e.charCodeAt(t+1))&&nt(e.charCodeAt(t+2)),it="1.18.1",{isFunction:ot}=Y,at=e=>{if(!Y.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},st=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ut=e=>{const t=void 0!==Y.global&&null!==Y.global?Y.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Y.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:o,Response:a}=e,s=i?ot(i):"function"==typeof fetch,u=ot(o),c=ot(a);if(!s)return!1;const l=s&&ot(n),d=s&&("function"==typeof r?(f=new r,e=>f.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer()));var f;const p=u&&l&&st((()=>{let e=!1;const t=new o(je.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),h=c&&l&&st((()=>Y.isReadableStream(new a("").body))),y={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!y[e]&&(y[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ce(`Response type '${e}' is not supported`,ce.ERR_NOT_SUPPORT,n)})}));const v=async e=>{if(null==e)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e)){const t=new o(je.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Y.isArrayBufferView(e)||Y.isArrayBuffer(e)?e.byteLength:(Y.isURLSearchParams(e)&&(e+=""),Y.isString(e)?(await d(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:s,signal:c,cancelToken:d,timeout:f,onDownloadProgress:_,onUploadProgress:g,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:C,maxContentLength:R,maxBodyLength:O}=Qe(e);const S=Y.isNumber(R)&&R>-1,P=Y.isNumber(O)&&O>-1;let E=i||fetch;m=m?(m+"").toLowerCase():"text";let A=Ze([c,d&&d.toAbortSignal()],f),j=null;const T=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let N,x=null;const D=()=>new ce("Request body larger than maxBodyLength limit",ce.ERR_BAD_REQUEST,e,j);try{let i;const c=(U="auth",Y.hasOwnProp(e,U)?e[U]:void 0);if(c){i={username:Y.getSafeProp(c,"username")||"",password:Y.getSafeProp(c,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,je.origin);if(!i&&(e.username||e.password)){i={username:at(e.username),password:at(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(b.delete("authorization"),b.set("Authorization","Basic "+btoa((k=(i.username||"")+":"+(i.password||""),encodeURIComponent(k).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),S&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n<t;n++)if(37===r.charCodeAt(n)&&n+2<t){const t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);nt(t)&&nt(i)&&(e-=2,n+=2)}let n=0,i=t-1;const o=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));i>=0&&(61===r.charCodeAt(i)?(n++,i--):o(i)&&(n++,i-=3)),1===n&&i>=0&&(61===r.charCodeAt(i)||o(i))&&n++;const a=3*Math.floor(e/4)-(n||0);return a>0?a:0}let i=0;for(let e=0,t=r.length;e<t;e++){const n=r.charCodeAt(e);if(37===n&&rt(r,e,t))i+=1,e+=2;else if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(t);if(n>R)throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j)}if(P&&"get"!==n&&"head"!==n){const e=await v(s);if("number"==typeof e&&isFinite(e)&&(N=e,e>O))throw D()}const d=P&&(Y.isReadableStream(s)||Y.isStream(s)),f=(e,t,n)=>tt(e,65536,(e=>{if(P&&e>O)throw x=D();t&&t(e)}),n);if(p&&"get"!==n&&"head"!==n&&(g||d)){if(N=null==N?await(async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return null==n?v(t):n})(b,s):N,0!==N||d){let e,n=new o(t,{method:"POST",body:s,duplex:"half"});if(Y.isFormData(s)&&(e=n.headers.get("content-type"))&&b.setContentType(e),n.body){const[e,t]=g&&Me(N,Le(He(g)))||[];s=f(n.body,e,t)}}}else if(d&&!u&&l&&"get"!==n&&"head"!==n)s=f(s);else if(d&&u&&!p&&"get"!==n&&"head"!==n)throw new ce("Stream request bodies are not supported by the current fetch implementation",ce.ERR_NOT_SUPPORT,e,j);Y.isString(w)||(w=w?"include":"omit");const I=u&&"credentials"in o.prototype;if(Y.isFormData(s)){const e=b.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&b.delete("content-type")}b.set("User-Agent","axios/"+it,!1);const F={...C,signal:A,method:n.toUpperCase(),headers:re(b.normalize()),body:s,duplex:"half",credentials:I?w:void 0};j=u&&new o(t,F);let q=await(u?E(j,C):E(t,F));const L=ue.from(q.headers);if(S){const t=Y.toFiniteNumber(L.getContentLength());if(null!=t&&t>R)throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j)}const M=h&&("stream"===m||"response"===m);if(h&&q.body&&(_||S||M&&T)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=q[e]}));const n=Y.toFiniteNumber(L.getContentLength()),[r,i]=_&&Me(n,Le(He(_),!0))||[];let o=0;const s=t=>{if(S&&(o=t,o>R))throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j);r&&r(t)};q=new a(tt(q.body,65536,s,(()=>{i&&i(),T&&T()})),t)}m=m||"text";let H=await y[Y.findKey(y,m)||"text"](q,e);if(S&&!h&&!M){let t;if(null!=H&&("number"==typeof H.byteLength?t=H.byteLength:"number"==typeof H.size?t=H.size:"string"==typeof H&&(t="function"==typeof r?(new r).encode(H).byteLength:H.length)),"number"==typeof t&&t>R)throw new ce("maxContentLength size of "+R+" exceeded",ce.ERR_BAD_RESPONSE,e,j)}return!M&&T&&T(),await new Promise(((t,n)=>{qe(t,n,{data:H,headers:ue.from(q.headers),status:q.status,statusText:q.statusText,config:e,request:j})}))}catch(t){if(T&&T(),A&&A.aborted&&A.reason instanceof ce){const n=A.reason;throw n.config=e,j&&(n.request=j),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(x)throw j&&!x.request&&(x.request=j),x;if(t instanceof ce)throw j&&!t.request&&(t.request=j),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new ce("Network Error",ce.ERR_NETWORK,e,j,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw ce.from(t,t&&t.code,e,j,t&&t.response)}var k,U}},ct=new Map,lt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a,s,u=o.length,c=ct;for(;u--;)a=o[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:ut(t)),c=s;return s};lt();const dt={http:null,xhr:Ye,fetch:{get:lt}};Y.forEach(dt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const ft=e=>`- ${e}`,pt=e=>Y.isFunction(e)||null===e||!1===e;var ht=function(e,t){e=Y.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){let n;if(r=e[a],i=r,!pt(r)&&(i=dt[(n=String(r)).toLowerCase()],void 0===i))throw new ce(`Unknown adapter '${n}'`);if(i&&(Y.isFunction(i)||(i=i.get(t))))break;o[n||"#"+a]=i}if(!i){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(ft).join("\n"):" "+ft(e[0]):"as no adapter specified";throw new ce("There is no suitable adapter to dispatch the request "+t,ce.ERR_NOT_SUPPORT)}return i};function yt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fe(null,e)}function vt(e){return yt(e),e.headers=ue.from(e.headers),e.data=Ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ht(e.adapter||ke.adapter,e)(e).then((function(t){yt(e),e.response=t;try{t.data=Ue.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=ue.from(t.headers),t}),(function(t){if(!Ie(t)&&(yt(e),t&&t.response)){e.response=t.response;try{t.response.data=Ue.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=ue.from(t.response.headers)}return Promise.reject(t)}))}const _t={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{_t[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const gt={};_t.transitional=function(e,t,n){function r(e,t){return"[Axios v"+it+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new ce(r(i," has been removed"+(t?" in "+t:"")),ce.ERR_DEPRECATED);return t&&!gt[i]&&(gt[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},_t.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var mt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new ce("options must be an object",ce.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new ce("option "+o+" must be "+n,ce.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ce("Unknown option "+o,ce.ERR_BAD_OPTION)}},validators:_t};const bt=mt.validators;class wt{constructor(e){this.defaults=e||{},this.interceptors={request:new we,response:new we}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$e(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&mt.assertOptions(n,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean),legacyInterceptorReqResOrdering:bt.transitional(bt.boolean),advertiseZstdAcceptEncoding:bt.transitional(bt.boolean),validateStatusUndefinedResolves:bt.transitional(bt.boolean)},!1),null!=r&&(Y.isFunction(r)?t.paramsSerializer={serialize:r}:mt.assertOptions(r,{encode:bt.function,serialize:bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),mt.assertOptions(t,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Y.merge(i.common,i[t.method]);i&&Y.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete i[e]})),t.headers=ue.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||Ce;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,d=0;if(!s){const e=[vt.bind(this),void 0];for(e.unshift(...a),e.push(...u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let f=t;for(;d<l;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=vt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return be(Je((e=$e(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Y.forEach(["delete","get","head","options"],(function(e){wt.prototype[e]=function(t,n){return this.request($e(n||{},{method:e,url:t,data:n&&Y.hasOwnProp(n,"data")?n.data:void 0}))}})),Y.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,i){return this.request($e(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}wt.prototype[e]=t(),"query"!==e&&(wt.prototype[e+"Form"]=t(!0))}));class Ct{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Fe(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ct((function(t){e=t})),cancel:e}}}const Rt={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Rt).forEach((([e,t])=>{Rt[t]=e}));const Ot=function e(t){const n=new wt(t),i=r(wt.prototype.request,n);return Y.extend(i,wt.prototype,n,{allOwnKeys:!0}),Y.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e($e(t,n))},i}(ke);Ot.Axios=wt,Ot.CanceledError=Fe,Ot.CancelToken=Ct,Ot.isCancel=Ie,Ot.VERSION=it,Ot.toFormData=ye,Ot.AxiosError=ce,Ot.Cancel=Ot.CanceledError,Ot.all=function(e){return Promise.all(e)},Ot.spread=function(e){return function(t){return e.apply(null,t)}},Ot.isAxiosError=function(e){return Y.isObject(e)&&!0===e.isAxiosError},Ot.mergeConfig=$e,Ot.AxiosHeaders=ue,Ot.formToJSON=e=>xe(Y.isHTMLForm(e)?new FormData(e):e),Ot.getAdapter=ht,Ot.HttpStatusCode=Rt,Ot.default=Ot,e.exports=Ot},3301:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>U,__assign:()=>o,__asyncDelegator:()=>S,__asyncGenerator:()=>O,__asyncValues:()=>P,__await:()=>R,__awaiter:()=>h,__classPrivateFieldGet:()=>x,__classPrivateFieldIn:()=>k,__classPrivateFieldSet:()=>D,__createBinding:()=>v,__decorate:()=>s,__disposeResources:()=>F,__esDecorate:()=>c,__exportStar:()=>_,__extends:()=>i,__generator:()=>y,__importDefault:()=>N,__importStar:()=>T,__makeTemplateObject:()=>E,__metadata:()=>p,__param:()=>u,__propKey:()=>d,__read:()=>m,__rest:()=>a,__rewriteRelativeImportExtension:()=>q,__runInitializers:()=>l,__setFunctionName:()=>f,__spread:()=>b,__spreadArray:()=>C,__spreadArrays:()=>w,__values:()=>g,default:()=>L});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=r.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?r.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var h={};for(var y in r)h[y]="access"===y?{}:r[y];for(var y in r.access)h.access[y]=r.access[y];h.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,n[p])("accessor"===u?{get:d.get,set:d.set}:d[c],h);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(d.get=s),(s=a(v.set))&&(d.set=s),(s=a(v.init))&&i.unshift(s)}else(s=a(v))&&("field"===u?i.unshift(s):d[c]=s)}l&&Object.defineProperty(l,r.name,d),f=!0}function l(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function y(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=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 o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var v=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function _(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||v(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function w(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function C(e,t,n){if(n||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 e.concat(r||Array.prototype.slice.call(t))}function R(e){return this instanceof R?(this.v=e,this):new R(e)}function O(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof R?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function S(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:R(e[r](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},j=function(e){return j=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},j(e)};function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=j(e),r=0;r<n.length;r++)"default"!==n[r]&&v(t,e,n[r]);return A(t,e),t}function N(e){return e&&e.__esModule?e:{default:e}}function x(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function D(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function k(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function U(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var I="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function F(e){function t(t){e.error=e.hasError?new I(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function i(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,(function(e){return t(e),i()}))}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function q(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,r,i,o){return n?t?".jsx":".js":!r||i&&o?r+i+"."+o.toLowerCase()+"js":e})):e}const L={__extends:i,__assign:o,__rest:a,__decorate:s,__param:u,__esDecorate:c,__runInitializers:l,__propKey:d,__setFunctionName:f,__metadata:p,__awaiter:h,__generator:y,__createBinding:v,__exportStar:_,__values:g,__read:m,__spread:b,__spreadArrays:w,__spreadArray:C,__await:R,__asyncGenerator:O,__asyncDelegator:S,__asyncValues:P,__makeTemplateObject:E,__importStar:T,__importDefault:N,__classPrivateFieldGet:x,__classPrivateFieldSet:D,__classPrivateFieldIn:k,__addDisposableResource:U,__disposeResources:F,__rewriteRelativeImportExtension:q}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(r,{default:()=>S});var c=n(4756),l=function(){return u((function e(){var t,n,r,o,a,s,u,c,l,d,f,p,h,y,v,_,g,m,b,w,C,R,O,S=this,P=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.server=P.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(t=this.server.cacheSearchResultsForSeconds)&&void 0!==t?t:120,this.additionalSearchParameters=null!==(n=P.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(o=this.additionalSearchParameters.queryBy)&&void 0!==o?o:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(a=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==a?a:"",this.additionalSearchParameters.sort_by=null!==(u=null!==(c=this.additionalSearchParameters.sortBy)&&void 0!==c?c:this.additionalSearchParameters.sort_by)&&void 0!==u?u:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(d=this.additionalSearchParameters.highlightFullFields)&&void 0!==d?d:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(f=P.geoLocationField)&&void 0!==f?f:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(p=P.facetableFieldsWithSpecialCharacters)&&void 0!==p?p:[],this.collectionSpecificSearchParameters=null!==(h=P.collectionSpecificSearchParameters)&&void 0!==h?h:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(e){var t,n,r,i,o,a,s=S.collectionSpecificSearchParameters[e];s.query_by=null!==(t=s.queryBy)&&void 0!==t?t:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(i=null!==(o=null!==(a=s.highlightFullFields)&&void 0!==a?a:s.highlight_full_fields)&&void 0!==o?o:S.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:s.query_by,Object.keys(s).forEach((function(e){return void 0===s[e]?delete s[e]:{}}))})),this.renderingContent=P.renderingContent,this.flattenGroupedHits=null===(y=P.flattenGroupedHits)||void 0===y||y,this.facetByOptions=null!==(v=P.facetByOptions)&&void 0!==v?v:{},this.filterByOptions=null!==(_=P.filterByOptions)&&void 0!==_?_:{},this.sortByOptions=null!==(g=P.sortByOptions)&&void 0!==g?g:{},this.collectionSpecificFacetByOptions=null!==(m=P.collectionSpecificFacetByOptions)&&void 0!==m?m:{},this.collectionSpecificFilterByOptions=null!==(b=P.collectionSpecificFilterByOptions)&&void 0!==b?b:{},this.collectionSpecificSortByOptions=null!==(w=P.collectionSpecificSortByOptions)&&void 0!==w?w:{},this.union=null!==(C=P.union)&&void 0!==C&&C,this.useOverrideTags=null!==(R=P.useOverrideTags)&&void 0!==R&&R,this.flipNegativeRefinementOperator=null!==(O=P.flipNegativeRefinementOperator)&&void 0!==O&&O}),[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(e){return e.queryBy})))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}])}(),d=n(8567);function f(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=["q","conversation","conversation_id","conversation_model_id"],_=function(){return u((function e(t,n,r){i(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}),[{key:"_shouldUseExactMatchForField",value:function(e,t){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n[e])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(e,t){var n=this,r="";return e?r=e.map((function(e){if(Array.isArray(e)){var r={};e.forEach((function(e){var t=n._parseFacetFilter(e),i=t.fieldName,o=t.fieldValue;r[i]=r[i]||[],r[i].push(o)})),Object.keys(r).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(r).join(",")));var i=Object.keys(r)[0],o=r[i].reduce((function(e,t){return t.startsWith("-")&&!n._isNumber(t)?e[0].push(t.substring(1)):e[1].push(t),e}),[[],[]]),a=y(o,2),s=a[0],u=a[1],c=[];if(u.length>0){var l=n._shouldUseExactMatchForField(i,t)?":=":":";c.push("".concat(i).concat(l,"[").concat(u.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}if(s.length>0){var d=n._shouldUseExactMatchForField(i,t)?":!=":":!";n.configuration.flipNegativeRefinementOperator?c.push("(".concat(s.map((function(e){return"".concat(i).concat(d).concat(n._escapeFacetValue(e))})).join(" || "),")")):c.push("".concat(i).concat(d,"[").concat(s.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}return c.filter((function(e){return e})).join(" && ")}var f,p=n._parseFacetFilter(e),h=p.fieldName,v=p.fieldValue;if(v.startsWith("-")&&!n._isNumber(v)){var _=n._shouldUseExactMatchForField(h,t)?":!=":":!";f="".concat(h).concat(_,"[").concat(n._escapeFacetValue(v.substring(1)),"]")}else{var g=n._shouldUseExactMatchForField(h,t)?":=":":";f="".concat(h).concat(g,"[").concat(n._escapeFacetValue(v),"]")}return f})).join(" && "):r}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,o;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var a=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(a.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:o="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(i="".concat(r[1]).concat(r[2]),o="".concat(r[3])),{fieldName:i,fieldValue:o}}},{key:"_escapeFacetValue",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this,n="";if(!e)return n;var r={};e.forEach((function(e){var n=t._parseNumericFilter(e),i=n.fieldName,o=n.operator,a=n.fieldValue;r[i]=r[i]||{},r[i][o]=a}));var i=[];return Object.keys(r).forEach((function(e){null!=r[e]["<="]&&null!=r[e][">="]?i.push("".concat(e,":=[").concat(r[e][">="],"..").concat(r[e]["<="],"]")):null!=r[e]["<="]?i.push("".concat(e,":<=").concat(r[e]["<="])):null!=r[e][">="]?i.push("".concat(e,":>=").concat(r[e][">="])):null!=r[e]["="]?i.push("".concat(e,":=").concat(r[e]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[e])))})),i.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,r,i,o,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var s=this.configuration.facetableFieldsWithSpecialCharacters.map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(s.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=e.match(n))){var u=y(r,4);return{fieldName:i=u[1],operator:o=u[2],fieldValue:a=u[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var c=y(r,4);i=c[1],o=c[2],a=c[3]}return{fieldName:i,operator:o,fieldValue:a}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,r=e.aroundLatLng,i=e.insidePolygon;if(t){var o,a,s,u;if(Array.isArray(t)){var c=y(t.flat(),4);o=c[0],a=c[1],s=c[2],u=c[3]}else{var l=y(t.split(","),4);o=l[0],a=l[1],s=l[2],u=l[3]}return"".concat(this.configuration.geoLocationField,":(").concat(o,", ").concat(a,", ").concat(o,", ").concat(u,", ").concat(s,", ").concat(u,", ").concat(s,", ").concat(a,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var d="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(d,")")}if(i){var f=i;return Array.isArray(i)&&(f=i.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(f,")")}}},{key:"_splitByTopLevelAnd",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i],a=e[i+1];"`"===o&&(r=!r),r||"&"!==o||"&"!==a?n+=o:(""!==n.trim()&&t.push(n.trim()),n="",i+=1)}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_splitListValues",value:function(e){for(var t=[],n="",r=!1,i=0;i<e.length;i+=1){var o=e[i];"`"===o&&(r=!r),r||","!==o?n+=o:(""!==n.trim()&&t.push(n.trim()),n="")}return""!==n.trim()&&t.push(n.trim()),t}},{key:"_parseListClause",value:function(e){var t=e.trim(),n=t.indexOf("["),r=t.lastIndexOf("]");if(-1===n||-1===r||r!==t.length-1)return null;var i=t.slice(0,n).trim(),o=t.slice(n+1,r),a=[":!=",":=",":!",":"].find((function(e){return i.endsWith(e)}));if(!a)return null;var s=i.slice(0,i.length-a.length).trim();return s?{fieldName:s,operator:a,values:this._splitListValues(o)}:null}},{key:"_mergeSameFieldExclusionListClauses",value:function(e){var t=this;if(!e)return e;var n=this._splitByTopLevelAnd(e),r={},i=[];return n.forEach((function(e,n){var o=t._parseListClause(e);if(o){var a=":!"===o.operator||":!="===o.operator?"exclude":null;if(null!=a){var s="".concat(o.fieldName,"|").concat(a);r[s]||(r[s]={clauseIndex:n,fieldName:o.fieldName,operator:o.operator,normalizedOperator:a,values:[]}),o.values.forEach((function(e){r[s].values.includes(e)||r[s].values.push(e)}))}else i.push({clauseIndex:n,clause:e})}else i.push({clauseIndex:n,clause:e})})),Object.values(r).forEach((function(e){i.push({clauseIndex:e.clauseIndex,clause:"".concat(e.fieldName).concat(e.operator,"[").concat(e.values.join(","),"]")})})),i.sort((function(e,t){return e.clauseIndex-t.clauseIndex})).map((function(e){return e.clause})).join(" && ")}},{key:"_adaptFilters",value:function(e,t){var n=[];e.filters&&n.push(e.filters),n.push(this._adaptFacetFilters(e.facetFilters,t)),n.push(this._adaptNumericFilters(e.numericFilters)),n.push(this._adaptGeoFilter(e));var r=n.filter((function(e){return e&&""!==e})).join(" && ");return this.configuration.flipNegativeRefinementOperator?this._mergeSameFieldExclusionListClauses(r):r}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(e,t){var n=this;return[e].flat().map((function(e){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[t])&&void 0!==r&&r[e]?"".concat(e).concat(n.configuration.collectionSpecificFacetByOptions[t][e]):n.configuration.facetByOptions[e]?"".concat(e).concat(n.configuration.facetByOptions[e]):e})).join(",")}},{key:"_adaptRulesContextsToOverrideTags",value:function(e){return e.join(",")}},{key:"_buildSearchParameters",value:function(e){for(var t,n,r=e.params,i=e.indexName,o=this._adaptIndexName(i),a={},s=0,u=Object.entries(this.additionalSearchParameters);s<u.length;s++){var c=y(u[s],2),l=c[0],d=c[1];a[this._camelToSnakeCase(l)]=d}if(this.collectionSpecificSearchParameters[o])for(var f=0,p=Object.entries(this.collectionSpecificSearchParameters[o]);f<p.length;f++){var h=y(p[f],2),v=h[0],_=h[1];a[this._camelToSnakeCase(v)]=_}var g=Object.assign({},a),m=this._adaptSortBy(i);Object.assign(g,{collection:o,q:""===r.query||void 0===r.query?"*":r.query,facet_by:a.facet_by||this._adaptFacetBy(r.facets,o),filter_by:this._adaptFilters(r,o)||a.filter_by,sort_by:m||a.sort_by,max_facet_values:r.maxValuesPerFacet,page:(r.page||0)+1}),null!=r.hitsPerPage&&(g.per_page=r.hitsPerPage),r.facetQuery&&(g.facet_query="".concat(r.facetName,":").concat(r.facetQuery),g.per_page=0),r.ruleContexts&&r.ruleContexts.length>0&&(g[this.configuration.useOverrideTags?"override_tags":"curation_tags"]=this._adaptRulesContextsToOverrideTags(r.ruleContexts)),r.typesenseVectorQuery&&(g.vector_query=r.typesenseVectorQuery);var b=(null===(t=this.configuration.collectionSpecificSortByOptions)||void 0===t||null===(t=t[o])||void 0===t?void 0:t[g.sort_by])||(null===(n=this.configuration.sortByOptions)||void 0===n?void 0:n[g.sort_by]);return null!=(null==b?void 0:b.enable_overrides)&&(g.enable_overrides=b.enable_overrides),Object.fromEntries(Object.entries(g).filter((function(e){var t=y(e,2),n=(t[0],t[1]);return null!=n&&""!==n})))}},{key:"_camelToSnakeCase",value:function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(e=t(c.mark((function e(){var t,n,r,i,o,a,s,u,l,d,p=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.instantsearchRequests.map((function(e){return p._buildSearchParameters(e)})),i={},!0!==(null===(t=r[0])||void 0===t?void 0:t.conversation)&&"true"!==(null===(n=r[0])||void 0===n?void 0:n.conversation)||(o=r[0],a=o.q,s=o.conversation,u=o.conversation_id,l=o.conversation_model_id,i={q:a,conversation:s,conversation_id:u,conversation_model_id:l},r=r.map((function(e){return e.q,e.conversation,e.conversation_id,e.conversation_model_id,f(e,v)}))),d={searches:r},this.configuration.union&&(d.union=this.configuration.union,["page","per_page","offset","limit","limit_hits"].forEach((function(e){null!=r[0][e]&&(i[e]=r[0][e])}))),e.abrupt("return",this.typesenseClient.multiSearch.perform(d,i));case 6:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]);var e}();function g(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b={_adaptHighlightTag:function(e,t,n){return e.replace(new RegExp("<mark>","g"),t||"<mark>").replace(new RegExp("</mark>","g"),n||"</mark>")},_adaptNumberOfPages:function(){var e=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,t=(null==e?void 0:e.per_page)||10,n=this.typesenseResponse.found/t;return Number.isFinite(n)?Math.ceil(n):1}};function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(){return u((function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResults=o,this.fullTypesenseResponse=a}),[{key:"_adaptGroupedHits",value:function(e){var t=this,n=[];return n=e.map((function(e){var n=t._adaptHits(e.hits);return n.forEach((function(t){t.group_key=t._group_key=e.group_key,e.found&&(t._group_found=e.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(e){return C(C({},e[0]),{},{_grouped_hits:e})}))}},{key:"_adaptHits",value:function(e){var t=this;return e.map((function(e){var n=C({},e.document);n.objectID=e.document.id,n._snippetResult=t._adaptHighlightResult(e,"snippet"),n._highlightResult=t._adaptHighlightResult(e,"value"),n._rawTypesenseHit=e,t.fullTypesenseResponse.conversation&&(n._rawTypesenseConversation=t.fullTypesenseResponse.conversation),["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance","collection","search_index"].forEach((function(t){Object.keys(e).includes(t)&&!Object.keys(n).includes(t)&&(n[t]=e[t])}));var r=n[t.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(e,t){var n={};return null!=e.highlight&&this.isHighlightPost0240RCN32Format(e.highlight)?this.adaptHighlightObject(e,n,t):this.adaptHighlightsArray(e,n,t),n}},{key:"isHighlightPost0240RCN32Format",value:function(e){return null==e.full&&null==e.snippet}},{key:"adaptHighlightsArray",value:function(e,t,n){var r=this;Object.assign.apply(Object,[t].concat(g(Object.entries(e.document).map((function(e){var t=y(e,2);return m({},t[0],{value:t[1],matchLevel:"none",matchedWords:[]})}))))),e.highlights.forEach((function(e){t[e.field]={value:e[n]||e["".concat(n,"s")],matchLevel:"full",matchedWords:e.matched_tokens},e.indices&&(t[e.field].matchedIndices=e.indices)})),Object.entries(t).forEach((function(i){var a=y(i,2),s=a[0],u=a[1],c=s,l=u.value,d=u.matchLevel,f=u.matchedWords,p=u.matchedIndices;null==l?t[c]=r._adaptHighlightNullValue():Array.isArray(l)?(t[c]=[],e.document[c].forEach((function(e,i){p&&p.includes(i)?t[c].push({value:r._adaptHighlightTag("".concat(l[p.indexOf(i)]),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag),matchLevel:d,matchedWords:f[i]}):"object"===o(e)?t[c].push(r._adaptHighlightInObjectValue(e,{},n)):t[c].push({value:"".concat(e),matchLevel:"none",matchedWords:[]})}))):"object"===o(l)?t[c]=r._adaptHighlightInObjectValue(l,{},n):t[c].value=r._adaptHighlightTag("".concat(l),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(e,t,n){Object.assign(t,this._adaptHighlightInObjectValue(e.document,e.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(e,t,n){var r=this;return Object.assign.apply(Object,[{}].concat(g(Object.entries(e).map((function(e){var i,a=y(e,2),s=a[0],u=a[1];if(null==u)i=r._adaptHighlightNullValue();else if(Array.isArray(u)){var c;i=r._adaptHighlightInArrayValue(u,null!==(c=null==t?void 0:t[s])&&void 0!==c?c:[],n)}else if("object"===o(u)){var l;i=r._adaptHighlightInObjectValue(u,null!==(l=null==t?void 0:t[s])&&void 0!==l?l:{},n)}else i=r._adaptHighlightInPrimitiveValue(u,null==t?void 0:t[s],n);return m({},s,i)})))))}},{key:"_adaptHighlightInArrayValue",value:function(e,t,n){var r=this;return e.map((function(e,i){var a;if(null==e)a=r._adaptHighlightNullValue();else if(Array.isArray(e)){var s;a=r._adaptHighlightInArrayValue(e,null!==(s=null==t?void 0:t[i])&&void 0!==s?s:[],n)}else if("object"===o(e)){var u;a=r._adaptHighlightInObjectValue(e,null!==(u=null==t?void 0:t[i])&&void 0!==u?u:{},n)}else a=r._adaptHighlightInPrimitiveValue(e,null==t?void 0:t[i],n);return a}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(e,t,n){if(null!=t){var r,i,o,a=null!==(r=null!==(i=null!==(o=t[n])&&void 0!==o?o:t.highlight)&&void 0!==i?i:t.snippet)&&void 0!==r?r:e;return{value:this._adaptHighlightTag("".concat(a),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(t.matched_tokens||[]).length>0?"full":"none",matchedWords:t.matched_tokens||[]}}return{value:this._adaptHighlightTag("".concat(e),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){Object.assign(t,m({},e.field_name,Object.assign.apply(Object,[{}].concat(g(e.counts.map((function(e){return m({},e.value,e.count)})))))))})),t}},{key:"_adaptFacetStats",value:function(e){var t={};return Array.isArray(e)&&e.forEach((function(e){e.stats&&Object.keys(e.stats).length>0&&Object.assign(t,m({},e.field_name,e.stats))})),t}},{key:"_adaptRenderingContent",value:function(e){var t,n=Object.assign({},this.configuration.renderingContent);return null==(null===(t=n.facetOrdering)||void 0===t||null===(t=t.facets)||void 0===t?void 0:t.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=g(new Set((Array.isArray(e)?e:[]).map((function(e){return e.field_name})).concat(this.allTypesenseResults.map((function(e){return e.facet_counts||[]})).flat().map((function(e){return e.field_name})).filter((function(e){return e})))))),n}},{key:"_adaptUserData",value:function(e){return e?Array.isArray(e)?e:[e]:[]}},{key:"adapt",value:function(){var e=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]),t=this.typesenseResponse.union_request_params?this.typesenseResponse.union_request_params[0]:this.typesenseResponse.request_params,n=C({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.union_request_params?this.typesenseResponse.page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:(null==t?void 0:t.per_page)||10,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||[]),query:(null==t?void 0:t.q)||"",processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(e).length>0?{renderingContent:e}:null);return this.typesenseResponse.metadata&&(n.appliedRules=["typesense-override"],n.userData=this._adaptUserData(this.typesenseResponse.metadata)),this.typesenseResponse.parsed_nl_query&&(n.parsed_nl_query=this.typesenseResponse.parsed_nl_query),this.fullTypesenseResponse.conversation&&0===n.hits.length&&(n.hits=[{_rawTypesenseConversation:this.fullTypesenseResponse.conversation}]),n}}])}();Object.assign(R.prototype,b);var O=function(){return u((function e(t,n){i(this,e),this.typesenseResponse=t,this.instantsearchRequest=n}),[{key:"_adaptFacetHits",value:function(e){var t=this,n=[],r=e.find((function(e){return e.field_name===t.instantsearchRequest.params.facetName}));return void 0!==r&&(n=r.counts.map((function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}}))),n}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}])}();Object.assign(O.prototype,b);var S=function(){return u((function e(t){var n=this;i(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}}),[{key:"searchTypesenseAndAdapt",value:(r=t(c.mark((function e(t){var n,r,i,o,a,s=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:if(!(n=e.sent).union_request_params){e.next=12;break}return this._validateTypesenseResult(n),r=new R(n,t[0],this.configuration,[n],n),i=r.adapt(),o=t.map((function(){return i})),e.abrupt("return",{results:o});case 12:return a=n.results.map((function(e,r){return s._validateTypesenseResult(e),new R(e,t[r],s.configuration,n.results,n).adapt()})),e.abrupt("return",{results:a});case 14:e.next=20;break;case 16:throw e.prev=16,e.t0=e.catch(0),console.error(e.t0),e.t0;case 20:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return r.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(n=t(c.mark((function e(t){var n,r,i=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map((function(e,n){return i._validateTypesenseResult(e),new O(e,t[n],i.configuration).adapt()})),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return n.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(e=t(c.mark((function e(t){var n,r;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new _(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new d._t(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new l(e),this.configuration.validate(),this.typesenseClient=new d._t(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]);var e,n,r}()})(),r.default})()));
|
|
3
3
|
//# sourceMappingURL=typesense-instantsearch-adapter.min.js.map
|