PageSourceSearch

https://www.smart.com.kh/_next/static/chunks/8586282e-33716dd4596a5e99.js

js smart.com.kh collected 2026-09-24 17:40:11 UTC 92,598 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9007],{24645:function(t,e,r){!function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function n(t){var e={exports:{}};return t(e,e.exports),e.exports}var i=n(function(t){var r;r="undefined"!=typeof self?self:e,function(t){var e={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(e.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(t){this.map={},t instanceof u?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function c(t){if(t.bodyUsed)return Promise.reject(TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function h(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t){if("string"==typeof t)this._bodyText=t;else if(e.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(e.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else{var r;e.arrayBuffer&&e.blob&&(r=t)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t,e,r,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=d(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},e.formData&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=s(t),e=a(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[s(t)]},u.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},u.prototype.set=function(t,e){this.map[s(t)]=a(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},u.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},u.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},e.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var l=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r,n,i=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new u(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),l.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function y(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})}
1,p.call(v.prototype),p.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var g=[301,302,303,307,308];y.redirect=function(t,e){if(-1===g.indexOf(e))throw RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function m(r,n){return new Promise(function(i,s){var a=new v(r,n);if(a.signal&&a.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function c(){o.abort()}o.onload=function(){var t,e,r={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}}),e)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL"),i(new y("response"in o?o.response:o.responseText,r))},o.onerror=function(){s(TypeError("Network request failed"))},o.ontimeout=function(){s(TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(a.method,a.url,!0),"include"===a.credentials?o.withCredentials=!0:"omit"===a.credentials&&(o.withCredentials=!1),"responseType"in o&&e.blob&&(o.responseType="blob"),a.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),a.signal&&(a.signal.addEventListener("abort",c),o.onreadystatechange=function(){4===o.readyState&&a.signal.removeEventListener("abort",c)}),o.send(void 0===a._bodyInit?null:a._bodyInit)})}m.polyfill=!0,r.fetch||(r.fetch=m,r.Headers=u,r.Request=v,r.Response=y),t.Headers=u,t.Request=v,t.Response=y,t.fetch=m,Object.defineProperty(t,"__esModule",{value:!0})}({})}),s=n(function(t,r){!function(t){var r,n,i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e,r,n){return new(r||(r=Promise))(function(i,s){function a(t){try{u(n.next(t))}catch(t){s(t)}}function o(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,o)}u((n=n.apply(t,e||[])).next())})}function a(t,e){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}"function"==typeof SuppressedError&&SuppressedError,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var o=(r=n={exports:{}},function(t){var e={TASK_SUCCEEDED:"succeeded",TASK_PROCESSING:"processing",TASK_FAILED:"failed",TASK_ENQUEUED:"enqueued",TASK_CANCELED:"canceled"},r={INDEX_CREATION_FAILED:"index_creation_failed",MISSING_INDEX_UID:"missing_index_uid",INDEX_ALREADY_EXISTS:"index_already_exists",INDEX_NOT_FOUND:"index_not_found",INVALID_INDEX_UID:"invalid_index_uid",INDEX_NOT_ACCESSIBLE:"index_not_accessible",INVALID_INDEX_OFFSET:"invalid_index_offset",INVALID_INDEX_LIMIT:"invalid_index_limit",INVA
1LID_STATE:"invalid_state",PRIMARY_KEY_INFERENCE_FAILED:"primary_key_inference_failed",INDEX_PRIMARY_KEY_ALREADY_EXISTS:"index_primary_key_already_exists",INVALID_INDEX_PRIMARY_KEY:"invalid_index_primary_key",DOCUMENTS_FIELDS_LIMIT_REACHED:"document_fields_limit_reached",MISSING_DOCUMENT_ID:"missing_document_id",INVALID_DOCUMENT_ID:"invalid_document_id",INVALID_CONTENT_TYPE:"invalid_content_type",MISSING_CONTENT_TYPE:"missing_content_type",INVALID_DOCUMENT_FIELDS:"invalid_document_fields",INVALID_DOCUMENT_LIMIT:"invalid_document_limit",INVALID_DOCUMENT_OFFSET:"invalid_document_offset",INVALID_DOCUMENT_FILTER:"invalid_document_filter",MISSING_DOCUMENT_FILTER:"missing_document_filter",INVALID_DOCUMENT_VECTORS_FIELD:"invalid_document_vectors_field",PAYLOAD_TOO_LARGE:"payload_too_large",MISSING_PAYLOAD:"missing_payload",MALFORMED_PAYLOAD:"malformed_payload",NO_SPACE_LEFT_ON_DEVICE:"no_space_left_on_device",INVALID_STORE_FILE:"invalid_store_file",INVALID_RANKING_RULES:"missing_document_id",INVALID_REQUEST:"invalid_request",INVALID_DOCUMENT_GEO_FIELD:"invalid_document_geo_field",INVALID_SEARCH_Q:"invalid_search_q",INVALID_SEARCH_OFFSET:"invalid_search_offset",INVALID_SEARCH_LIMIT:"invalid_search_limit",INVA
1LID_SEARCH_PAGE:"invalid_search_page",INVALID_SEARCH_HITS_PER_PAGE:"invalid_search_hits_per_page",INVALID_SEARCH_ATTRIBUTES_TO_RETRIEVE:"invalid_search_attributes_to_retrieve",INVALID_SEARCH_ATTRIBUTES_TO_CROP:"invalid_search_attributes_to_crop",INVALID_SEARCH_CROP_LENGTH:"invalid_search_crop_length",INVALID_SEARCH_ATTRIBUTES_TO_HIGHLIGHT:"invalid_search_attributes_to_highlight",INVALID_SEARCH_SHOW_MATCHES_POSITION:"invalid_search_show_matches_position",INVALID_SEARCH_FILTER:"invalid_search_filter",INVALID_SEARCH_SORT:"invalid_search_sort",INVALID_SEARCH_FACETS:"invalid_search_facets",INVALID_SEARCH_HIGHLIGHT_PRE_TAG:"invalid_search_highlight_pre_tag",INVALID_SEARCH_HIGHLIGHT_POST_TAG:"invalid_search_highlight_post_tag",INVALID_SEARCH_CROP_MARKER:"invalid_search_crop_marker",INVALID_SEARCH_MATCHING_STRATEGY:"invalid_search_matching_strategy",INVALID_SEARCH_VECTOR:"invalid_search_vector",INVALID_SEARCH_ATTRIBUTES_TO_SEARCH_ON:"invalid_search_attributes_to_search_on",BAD_REQUEST:"bad_request",DOCUMENT_NOT_FOUND:"document_not_found",INTERNAL:"internal",INVALID_API_KEY:"invalid_api_key",INVALID_API_KEY_DESCRIPTION:"invalid_api_key_description",INVALID_API_KEY_ACTIONS:"invalid_api_key_actions",INVALID_API_KEY_INDEXES:"invalid_api_key_indexes",INVALID_API_KEY_EXPIRES_AT:"invalid_api_key_expires_at",API_KEY_NOT_FOUND:"api_key_not_found",IMMUTABLE_API_KEY_UID:"immutable_api_key_uid",IMMUTABLE_API_KEY_ACTIONS:"immutable_api_key_actions",IMMUTABLE_API_KEY_INDEXES:"immutable_api_key_indexes",IMMUTABLE_API_KEY_EXPIRES_AT:"immutable_api_key_expires_at",IMMUTABLE_API_KEY_CREATED_AT:"immutable_api_key_created_at",IMMUTABLE_API_KEY_UPDATED_AT:"immutable_api_key_updated_at",MISSING_AUTHORIZATION_HEADER:"missing_authorization_header",UNRETRIEVABLE_DOCUMENT:"unretrievable_document",MAX_DATABASE_SIZE_LIMIT_REACHED:"database_size_limit_reached",TASK_NOT_FOUND:"task_not_found",DUMP_PROCESS_FAILED:"dump_process_failed",DUMP_NOT_FOUND:"dump_not_found",INVALID_SWAP_DUPLICATE_INDEX_FOUND:"invalid_swap_duplicate_index_found",INVALID_SWAP_INDEXES:"invalid_swap_indexes",MISSING_SWAP_INDEXES:"missing_swap_indexes",MISSING_MASTER_KEY:"missing_master_key",INVALID_TASK_TYPES:"invalid_task_types",INVALID_TASK_UIDS:"invalid_task_uids",INVALID_TASK_STATUSES:"invalid_task_statuses",INVALID_TASK_LIMIT:"invalid_task_limit",INVA
1LID_TASK_FROM:"invalid_task_from",INVALID_TASK_CANCELED_BY:"invalid_task_canceled_by",MISSING_TASK_FILTERS:"missing_task_filters",TOO_MANY_OPEN_FILES:"too_many_open_files",IO_ERROR:"io_error",INVALID_TASK_INDEX_UIDS:"invalid_task_index_uids",IMMUTABLE_INDEX_UID:"immutable_index_uid",IMMUTABLE_INDEX_CREATED_AT:"immutable_index_created_at",IMMUTABLE_INDEX_UPDATED_AT:"immutable_index_updated_at",INVALID_SETTINGS_DISPLAYED_ATTRIBUTES:"invalid_settings_displayed_attributes",INVALID_SETTINGS_SEARCHABLE_ATTRIBUTES:"invalid_settings_searchable_attributes",INVALID_SETTINGS_FILTERABLE_ATTRIBUTES:"invalid_settings_filterable_attributes",INVALID_SETTINGS_SORTABLE_ATTRIBUTES:"invalid_settings_sortable_attributes",INVALID_SETTINGS_RANKING_RULES:"invalid_settings_ranking_rules",INVALID_SETTINGS_STOP_WORDS:"invalid_settings_stop_words",INVALID_SETTINGS_SYNONYMS:"invalid_settings_synonyms",INVALID_SETTINGS_DISTINCT_ATTRIBUTE:"invalid_settings_distinct_attribute",INVALID_SETTINGS_TYPO_TOLERANCE:"invalid_settings_typo_tolerance",INVALID_SETTINGS_FACETING:"invalid_settings_faceting",INVALID_SETTINGS_PAGINATION:"invalid_settings_pagination",INVALID_TASK_BEFORE_ENQUEUED_AT:"invalid_task_before_enqueued_at",INVALID_TASK_AFTER_ENQUEUED_AT:"invalid_task_after_enqueued_at",INVALID_TASK_BEFORE_STARTED_AT:"invalid_task_before_started_at",INVALID_TASK_AFTER_STARTED_AT:"invalid_task_after_started_at",INVALID_TASK_BEFORE_FINISHED_AT:"invalid_task_before_finished_at",INVALID_TASK_AFTER_FINISHED_AT:"invalid_task_after_finished_at",MISSING_API_KEY_ACTIONS:"missing_api_key_actions",MISSING_API_KEY_INDEXES:"missing_api_key_indexes",MISSING_API_KEY_EXPIRES_AT:"missing_api_key_expires_at",INVALID_API_KEY_LIMIT:"invalid_api_key_limit",INVA
1LID_API_KEY_OFFSET:"invalid_api_key_offset",INVALID_FACET_SEARCH_FACET_NAME:"invalid_facet_search_facet_name",MISSING_FACET_SEARCH_FACET_NAME:"missing_facet_search_facet_name",INVALID_FACET_SEARCH_FACET_QUERY:"invalid_facet_search_facet_query"};function n(){n=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,r){return t[e]=r}}function h(e,r,n,i){var a,o,u=Object.create((r&&r.prototype instanceof y?r:y).prototype);return s(u,"_invoke",{value:(a=new S(i||[]),o=p,function(r,i){if(o===l)throw Error("Generator is already running");if(o===v){if("throw"===r)throw i;return{value:t,done:!0}}for(a.method=r,a.arg=i;;){var s=a.delegate;if(s){var u=function e(r,n){var i=n.method,s=r.iterator[i];if(s===t)return n.delegate=null,"throw"===i&&r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+i+"' method")),_;var a=f(s,r.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,_;var o=a.arg;return o?o.done?(n[r.resultName]=o.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,_):o:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,_)}(s,a);if(u){if(u===_)continue;return u}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(o===p)throw o=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o=l;var c=f(e,n,a);if("normal"===c.type){if(o=a.done?v:"suspendedYield",c.arg===_)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(o=v,a.method="throw",a.arg=c.arg)}})}),u}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var p="suspendedStart",l="executing",v="completed",_={};function y(){}function g(){}function m(){}var b={};d(b,o,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(D([])));x&&x!==r&&i.call(x,o)&&(b=x);var A=m.prototype=y.prototype=Object.create(b);function k(t){["next","throw","return"].forEach(function(e){d(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){var r;s(this,"_invoke",{value:function(n,s){function a(){return new e(function(r,a){!function r(n,s,a,o){var u=f(t[n],t,s);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&i.call(d,"__await")?e.resolve(d.__await).then(function(t){r("next",t,a,o)},function(t){r("throw",t,a,o)}):e.resolve(d).then(function(t){c.value=t,a(c)},function(t){return r("throw",t,a,o)})}o(u.arg)}(n,s,r,a)})}return r=r?r.then(a,a):a()}})}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw TypeError(typeof e+" is not iterable")}return g.prototype=m,s(A,"constructor",{value:m,configurable:!0}),s(m,"constructor",{value:g,configurable:!0}),g.displayName=d(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,d(t,c,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},k(E.prototype),d(E.prototype,u,function(){return this}),e.AsyncIterator=E,e.async=function(t,r,n,i,s){void 0===s&&(s=Prom
1ise);var a=new E(h(t,r,n,i),s);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},k(A),d(A,c,"Generator"),d(A,o,function(){return this}),d(A,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,S.prototype={constructor:S,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(I),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return o.type="throw",o.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=t,a.arg=e,s?(this.method="next",this.next=s.finallyLoc,_):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}function i(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function u(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function p(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function l(t,e,r){return(l=p()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&f(i,r.prototype),i}).apply(null,arguments)}function v(t){var e="function"==typeof Map?new Map:void 0;return(v=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return l(t,arguments,h(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,t)})(t)}function _(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t){var e=p();return function(){var r,n=h(t);return r=e?Reflect.construct(n,arguments,h(this).constructor):n.apply(this,arguments),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return _(t)}(this,r)}}function g(t,e){if(t){if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function b(t,e,r,n){return new(r||(r=Promise))(function(i,s){function a(t){try{u(n.next(t))}catch(t){s(t)}}function o(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,o)}u((n=n.apply(t,e||[])).next())})}var w=function(t){d(r,t);var e=y(r);function r(t){var n;return a(this,r),Object.setPrototypeOf(_(n=e.call(this,t)),r.prototype),n.name="MeiliSearchError",Error.captureStackTrace&&Error.captureStackTrace(_(n),r),n}return u(r)}(v(Error)),x=function(t){d(r,t);var e=y(r);function r(t,n,i,s){var o,u,c,d;return a(this,r),Object.setPrototypeOf(_(o=e.call(this,t)),r.prototype),o.name="MeiliSearchCommunicationError",n instanceof Response&&(o.message=n.statusText,o.statusCode=n.status),n instanceof Error&&(o.errno=n.errno,o.code=n.code),s?(o.stack=s,o.stack=null===(u=o.stack)||void 0===u?void 0:u.replace(/(TypeError|FetchError)/,o.name),o.stack=null===(c=o.stack)||void 0===c?void 0:c.replace("Failed to fetch","request to ".concat(i," failed, reason: connect ECONNREFUSED")),o.stack=null===(d=o.stack)||void 0===d?void 0:d.replace("Not Found","Not Found: ".concat(i))):Error.captureStackTrace&&Error.captureStackTrace(_(o),r),o}return u(r)}(w),A=function(t){d(r,t);var e=y(r);function r(t,n){var i;return a(this,r),Object.setPrototypeOf(_(i=e.call(this,t.message)),r.prototype),i.name="MeiliSearchApiError",i.code=t.code,i.type=t.type,i.link=t.link,i.message=t.message,i.httpStatus=n,Error.captureStackTrace&&Error.captureStackTrace(_(i),r),i}return u(r)}(w);function k(t){return b(this,void 0,void 0,n().mark(function e(){var r;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:r=e.sent,e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(1),new x(t.statusText,t,t.url);case 10:throw new A(r,t.status);case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}},e,null,[[1,7]])}))}function E(t,e,r){if("MeiliSearchApiError"!==t.name)throw new x(t.message,t,r,e);throw t}var T=function(t){d(r,t);var e=y(r);function r(t){var n;return a(this,r),Object.setPrototypeOf(_(n=e.call(this,t)),r.prototype),n.name="MeiliSearchTimeOutError",Error.captureStackTrace&&Error.captureStackTrace(_(n),r),n}return u(r)}(w);function I(t,e){return"".concat(t,"\nHint: It might not be working because maybe you're not up to date with the Meilisearch version that ").concat(e," call requires.")}function S(t){return Object.entries(t).reduce(function(t,e){var r=function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,s,a,o=[],u=!0,c=!1;try{for(s=(r=r.call(t)).next;!(u=(n=s.call(r)).done)&&(o.push(n.value),2!==o.length);u=!0);}catch(t){c=!0,i=t}
1finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(e,2)||g(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],i=r[1];return void 0!==i&&(t[n]=i),t},{})}function D(t){return Object.keys(t).reduce(function(e,r){var n=t[r];return void 0===n?e:Array.isArray(n)?Object.assign(Object.assign({},e),c({},r,n.join(","))):n instanceof Date?Object.assign(Object.assign({},e),c({},r,n.toISOString())):Object.assign(Object.assign({},e),c({},r,n))},{})}var R=function(){function t(e){a(this,t),this.headers=function(t){var e,r,n="X-Meilisearch-Client",i="Meilisearch JavaScript (v".concat("0.37.0",")"),s="Authorization",a=function(t){if(Array.isArray(t))return t.reduce(function(t,e){return t[e[0]]=e[1],t},{});if(!("has"in t))return Object.assign({},t);var e={};return t.forEach(function(t,r){return e[r]=t}),e}(null!==(r=null===(e=t.requestConfig)||void 0===e?void 0:e.headers)&&void 0!==r?r:{});if(t.apiKey&&!a[s]&&(a[s]="Bearer ".concat(t.apiKey)),a["Content-Type"]||(a["Content-Type"]="application/json"),t.clientAgents&&Array.isArray(t.clientAgents)){var o=t.clientAgents.concat(i);a[n]=o.join(" ; ")}else if(t.clientAgents&&!Array.isArray(t.clientAgents))throw new w('Meilisearch: The header "'.concat(n,'" should be an array of string(s).\n'));else a[n]=i;return a}(e),this.requestConfig=e.requestConfig,this.httpClient=e.httpClient,this.requestTimeout=e.timeout;try{var r=function(t){try{var e,r;return(r=t=(e=t).startsWith("https://")||e.startsWith("http://")?e:"http://".concat(e)).endsWith("/")||(r+="/"),t=r}catch(t){throw new w("The provided host is not valid.")}}(e.host);this.url=new URL(r)}catch(t){throw new w("The provided host is not valid.")}}return u(t,[{key:"request",value:function(t){var e,r=t.method,i=t.url,s=t.params,a=t.body,o=t.config,u=void 0===o?{}:o;return b(this,void 0,void 0,n().mark(function t(){var o,c,d,h,f,p,l;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=new URL(i,this.url),s&&(c=new URLSearchParams,Object.keys(s).filter(function(t){return null!==s[t]}).map(function(t){return c.set(t,s[t])}),o.search=c.toString()),(null===(e=u.headers)||void 0===e?void 0:e["Content-Type"])||(a=JSON.stringify(a)),d=Object.assign(Object.assign({},this.headers),u.headers),t.prev=5,h=this.fetchWithTimeout(o.toString(),Object.assign(Object.assign(Object.assign({},u),this.requestConfig),{method:r,body:a,headers:d}),this.requestTimeout),!this.httpClient){t.next=11;break}return t.next=10,h;case 10:return t.abrupt("return",t.sent);case 11:return t.next=13,h.then(function(t){return k(t)});case 13:return f=t.sent,t.next=16,f.json().catch(function(){});case 16:return p=t.sent,t.abrupt("return",p);case 20:t.prev=20,t.t0=t.catch(5),l=t.t0.stack,E(t.t0,l,o.toString());case 24:case"end":return t.stop()}},t,this,[[5,20]])}))}},{key:"fetchWithTimeout",value:function(t,e,r){return b(this,void 0,void 0,n().mark(function i(){var s=this;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(n,i){var a,o=[(s.httpClient?s.httpClient:fetch)(t,e)];if(r){var u=new Promise(function(t,e){a=setTimeout(function(){e(Error("Error: Request Timed Out"))},r)});o.push(u)}Promise.race(o).then(n).catch(i).finally(function(){clearTimeout(a)})}));case 1:case"end":return n.stop()}},i)}))}},{key:"get",value:function(t,e,r){return b(this,void 0,void 0,n().mark(function i(){return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.request({method:"GET",url:t,params:e,config:r});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},i,this)}))}},{key:"post",value:function(t,e,r,i){return b(this,void 0,void 0,n().mark(function s(){return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.request({method:"POST",url:t,body:e,params:r,config:i});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},s,this)}))}},{key:"put",value:function(t,e,r,i){return b(this,void 0,void 0,n().mark(function s(){return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.request({method:"PUT",url:t,body:e,params:r,config:i});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},s,this)}))}},{key:"patch",value:function(t,e,r,i){return b(this,void 0,void 0,n().mark(function s(){return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.request({method:"PATCH",url:t,body:e,params:r,config:i});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},s,this)}))}},{key:"delete",value:function(t,e,r,i){return b(this,void 0,void 0,n().mark(function s(){return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.request({method:"DELETE",url:t,body:e,params:r,config:i});case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}},s,this)}))}}]),t}(),O=u(function t(e){a(this,t),this.taskUid=e.taskUid,this.indexUid=e.indexUid,this.status=e.status,this.type=e.type,this.enqueuedAt=new Date(e.enqueuedAt)}),N=u(function t(e){a(this,t),this.indexUid=e.indexUid,this.status=e.status,this.type=e.type,this.uid=e.uid,this.details=e.details,this.canceledBy=e.canceledBy,this.error=e.error,this.duration=e.duration,this.startedAt=new Date(e.startedAt),this.enqueuedAt=new Date(e.enqueuedAt),this.finishedAt=new Date(e.finishedAt)}),P=function(){function t(e){a(this,t),this.httpRequest=new R(e)}return u(t,[{key:"getTask",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="tasks/".concat(t),e.next=3,this.httpRequest.get(r);case 3:return i=e.sent,e.abrupt("return",new N(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"getTasks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;
1)switch(e.prev=e.next){case 0:return r="tasks",e.next=3,this.httpRequest.get(r,D(t));case 3:return i=e.sent,e.abrupt("return",Object.assign(Object.assign({},i),{results:i.results.map(function(t){return new N(t)})}));case 5:case"end":return e.stop()}},e,this)}))}},{key:"waitForTask",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.timeOutMs,s=void 0===i?5e3:i,a=r.intervalMs,o=void 0===a?50:a;return b(this,void 0,void 0,n().mark(function r(){var i,a;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=Date.now();case 1:if(!(Date.now()-i<s)){r.next=11;break}return r.next=4,this.getTask(t);case 4:if(a=r.sent,[e.TASK_ENQUEUED,e.TASK_PROCESSING].includes(a.status)){r.next=7;break}return r.abrupt("return",a);case 7:return r.next=9,function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise(function(e){return setTimeout(e,t)});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))}(o);case 9:r.next=1;break;case 11:throw new T("timeout of ".concat(s,"ms has exceeded on process ").concat(t," when waiting a task to be resolved."));case 12:case"end":return r.stop()}},r,this)}))}},{key:"waitForTasks",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.timeOutMs,i=void 0===r?5e3:r,s=e.intervalMs,a=void 0===s?50:s;return b(this,void 0,void 0,n().mark(function e(){var r,s,o,u,c;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=[],s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=g(t))){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){o=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw s}}}}(t),e.prev=2,s.s();case 4:if((o=s.n()).done){e.next=12;break}return u=o.value,e.next=8,this.waitForTask(u,{timeOutMs:i,intervalMs:a});case 8:c=e.sent,r.push(c);case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),s.e(e.t0);case 17:return e.prev=17,s.f(),e.finish(17);case 20:return e.abrupt("return",r);case 21:case"end":return e.stop()}},e,this,[[2,14,17,20]])}))}},{key:"cancelTasks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="tasks/cancel",e.next=3,this.httpRequest.post(r,{},D(t));case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"deleteTasks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="tasks",e.next=3,this.httpRequest.delete(r,{},D(t));case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}}]),t}(),q=function(){function t(e,r,n){a(this,t),this.uid=r,this.primaryKey=n,this.httpRequest=new R(e),this.tasks=new P(e)}return u(t,[{key:"search",value:function(t,e,r){return b(this,void 0,void 0,n().mark(function i(){var s;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return s="indexes/".concat(this.uid,"/search"),n.next=3,this.httpRequest.post(s,S(Object.assign({q:t},e)),void 0,r);case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}},i,this)}))}},{key:"searchGet",value:function(t,e,r){var i,s,a,o,u,c,d;return b(this,void 0,void 0,n().mark(function h(){var f,p,l;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return f="indexes/".concat(this.uid,"/search"),p=function(t){if("string"==typeof t)return t;if(Array.isArray(t))throw new w("The filter query parameter should be in string format when using searchGet")},l=Object.assign(Object.assign({q:t},e),{filter:p(null==e?void 0:e.filter),sort:null===(i=null==e?void 0:e.sort)||void 0===i?void 0:i.join(","),facets:null===(s=null==e?void 0:e.facets)||void 0===s?void 0:s.join(","),attributesToRetrieve:null===(a=null==e?void 0:e.attributesToRetrieve)||void 0===a?void 0:a.join(","),attributesToCrop:null===(o=null==e?void 0:e.attributesToCrop)||void 0===o?void 0:o.join(","),attributesToHighlight:null===(u=null==e?void 0:e.attributesToHighlight)||void 0===u?void 0:u.join(","),vector:null===(c=null==e?void 0:e.vector)||void 0===c?void 0:c.join(","),attributesToSearchOn:null===(d=null==e?void 0:e.attributesToSearchOn)||void 0===d?void 0:d.join(",")}),n.next=5,this.httpRequest.get(f,S(l),r);case 5:return n.abrupt("return",n.sent);case 6:case"end":return n.stop()}},h,this)}))}},{key:"searchForFacetValues",value:function(t,e){return b(this,void 0,void 0,n().mark(function r(){var i;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i="indexes/".concat(this.uid,"/facet-search"),r.next=3,this.httpRequest.post(i,S(t),void 0,e);case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}},r,this)}))}},{key:"getRawInfo",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid),t.next=3,this.httpRequest.get(e);case 3:return r=t.sent,this.primaryKey=r.primaryKey,this.updatedAt=new Date(r.updatedAt),this.createdAt=new Date(r.createdAt),t.abrupt("return",r);case 8:case"end":return t.stop()}},t,this)}))}},{key:"fetchInfo",value:function(){return b(this,void 0,void 0,n().mark(function t(){return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRawInfo();case 2:return t.abrupt("return",this);case 3:case"end":return t.stop()}},t,this)}))}},{key:"fetchPrimaryKey",value:function(){return b(this,void 0,void 0,n().mark(function t(){return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getRawInfo();case 2:return this.primaryKey=t.sent.primaryKey,t.abrupt("return",this.primaryKey);case 4:case"end":return t.stop()}},t,this)}))}},{key:"update",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid),e.next=3,this.httpRequest.patch(r,t);case 3:return(i=e.sent).enqueuedAt=new Date(i.enqueuedAt),e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}))}},{key:"delete",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid),t.next=3,this.httpRequest.delete(e);case 3:return r=t.sent,t.abrupt("return",new O(r));case 5:case"end":return t.stop()}},t,this)}))}},{key:"getTasks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.getTasks(Object.assign(Object.assign({},t),{indexUids:[this.uid]}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"getTask",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.getTask(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"waitForTasks",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.timeOutMs,i=void 0===r?5e3:r,s=e.intervalMs,a=void 0===s?50:s;return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.waitForTasks(t,{timeOutMs:i,intervalMs:a});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"waitForTask",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.timeOutMs,i=void 0===r?5e3:r,s=e.intervalMs,a=void 0===s?50:s;return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.waitForTask(t,{timeOutMs:i,intervalMs:a});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"getStats",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/stats"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"getDocuments",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function r(){var i,s,a;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(void 0!==(e=S(e)).filter)){r.next=15;break}return r.prev=2,i="indexes/".concat(this.uid,"/documents/fetch"),r.next=6,this.httpRequest.post(i,e);case 6:case 19:return r.abrupt("return",r.sent);case 9:throw r.prev=9,r.t0=r.catch(2),r.t0 instanceof x?r.t0.message=I(r.t0.message,"getDocuments"):r.t0 instanceof A&&(r.t0.message=I(r.t0.message,"getDocuments")),r.t0;case 13:r.next=20;break;case 15:return s="indexes/".concat(this.uid,"/documents"),a=Array.isArray(null==e?void 0:e.fields)?{fields:null===(t=null==e?void 0:e.fields)||void 0===t?void 0:t.join(",")}:{},r.next=19,this.httpRequest.get(s,Object.assign(Object.assign({},e),a));case 20:case"end":return r.stop()}},r,this,[[2,9]])}
1))}},{key:"getDocument",value:function(t,e){return b(this,void 0,void 0,n().mark(function r(){var i,s;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i="indexes/".concat(this.uid,"/documents/").concat(t),s=function(){var t;if(Array.isArray(null==e?void 0:e.fields))return null===(t=null==e?void 0:e.fields)||void 0===t?void 0:t.join(",")}(),r.next=4,this.httpRequest.get(i,S(Object.assign(Object.assign({},e),{fields:s})));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}},r,this)}))}},{key:"addDocuments",value:function(t,e){return b(this,void 0,void 0,n().mark(function r(){var i,s;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i="indexes/".concat(this.uid,"/documents"),r.next=3,this.httpRequest.post(i,t,e);case 3:return s=r.sent,r.abrupt("return",new O(s));case 5:case"end":return r.stop()}},r,this)}))}},{key:"addDocumentsFromString",value:function(t,e,r){return b(this,void 0,void 0,n().mark(function i(){var s,a;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return s="indexes/".concat(this.uid,"/documents"),n.next=3,this.httpRequest.post(s,t,r,{headers:{"Content-Type":e}});case 3:return a=n.sent,n.abrupt("return",new O(a));case 5:case"end":return n.stop()}},i,this)}))}},{key:"addDocumentsInBatches",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=arguments.length>2?arguments[2]:void 0;return b(this,void 0,void 0,n().mark(function i(){var s,a;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:s=[],a=0;case 2:if(!(a<t.length)){n.next=11;break}return n.t0=s,n.next=6,this.addDocuments(t.slice(a,a+e),r);case 6:n.t1=n.sent,n.t0.push.call(n.t0,n.t1);case 8:a+=e,n.next=2;break;case 11:return n.abrupt("return",s);case 12:case"end":return n.stop()}},i,this)}))}},{key:"updateDocuments",value:function(t,e){return b(this,void 0,void 0,n().mark(function r(){var i,s;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i="indexes/".concat(this.uid,"/documents"),r.next=3,this.httpRequest.put(i,t,e);case 3:return s=r.sent,r.abrupt("return",new O(s));case 5:case"end":return r.stop()}},r,this)}))}},{key:"updateDocumentsInBatches",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=arguments.length>2?arguments[2]:void 0;return b(this,void 0,void 0,n().mark(function i(){var s,a;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:s=[],a=0;case 2:if(!(a<t.length)){n.next=11;break}return n.t0=s,n.next=6,this.updateDocuments(t.slice(a,a+e),r);case 6:n.t1=n.sent,n.t0.push.call(n.t0,n.t1);case 8:a+=e,n.next=2;break;case 11:return n.abrupt("return",s);case 12:case"end":return n.stop()}},i,this)}))}},{key:"updateDocumentsFromString",value:function(t,e,r){return b(this,void 0,void 0,n().mark(function i(){var s,a;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return s="indexes/".concat(this.uid,"/documents"),n.next=3,this.httpRequest.put(s,t,r,{headers:{"Content-Type":e}});case 3:return a=n.sent,n.abrupt("return",new O(a));case 5:case"end":return n.stop()}},i,this)}))}},{key:"deleteDocument",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/documents/").concat(t),e.next=3,this.httpRequest.delete(r);case 3:return(i=e.sent).enqueuedAt=new Date(i.enqueuedAt),e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}))}},{key:"deleteDocuments",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i,a,o;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=(r=!Array.isArray(t)&&"object"===s(t))?"documents/delete":"documents/delete-batch",a="indexes/".concat(this.uid,"/").concat(i),e.prev=3,e.next=6,this.httpRequest.post(a,t);case 6:return o=e.sent,e.abrupt("return",new O(o));case 10:throw e.prev=10,e.t0=e.catch(3),e.t0 instanceof x&&r?e.t0.message=I(e.t0.message,"deleteDocuments"):e.t0 instanceof A&&(e.t0.message=I(e.t0.message,"deleteDocuments")),e.t0;case 14:case"end":return e.stop()}},e,this,[[3,10]])}))}},{key:"deleteAllDocuments",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/documents"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getSettings",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateSettings",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings"),e.next=3,this.httpRequest.patch(r,t);case 3:return(i=e.sent).enqueued=new Date(i.enqueuedAt),e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}))}},{key:"resetSettings",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getPagination",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/pagination"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updatePagination",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/pagination"),e.next=3,this.httpRequest.patch(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetPagination",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/pagination"),t.next=3,this.httpRequest.delete(e);case 3:return r=t.sent,t.abrupt("return",new O(r));case 5:case"end":return t.stop()}},t,this)}))}},{key:"getSynonyms",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/synonyms"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateSynonyms",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/synonyms"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetSynonyms",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/synonyms"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getStopWords",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/stop-words"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateStopWords",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/stop-words"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetStopWords",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/stop-words"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getRankingRules",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/ranking-rules"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateRankingRules",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/ranking-rules"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetRankingRules",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/ranking-rules"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getDistinctAttribute",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/distinct-attribute"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateDistinctAttribute",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/distinct-attribute"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetDistinctAttribute",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/distinct-attribute"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getFilterableAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/filterable-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateFilterableAttributes",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/filterable-attributes"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetFilterableAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/filterable-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getSortableAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/sortable-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateSortableAttributes",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/sortable-attributes"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetSortableAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/sortable-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getSearchableAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/searchable-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateSearchableAttributes",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/searchable-attributes"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetSearchableAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/searchable-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getDisplayedAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/displayed-attributes"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateDisplayedAttributes",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/displayed-attributes"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetDisplayedAttributes",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/displayed-attributes"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getTypoTolerance",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/typo-tolerance"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateTypoTolerance",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/typo-tolerance"),e.next=3,this.httpRequest.patch(r,t);case 3:return(i=e.sent).enqueuedAt=new Date(i.enqueuedAt),e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}))}},{key:"resetTypoTolerance",value:function(){return b(this,void 0,void 0,n().
1mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/typo-tolerance"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getFaceting",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/faceting"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateFaceting",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/faceting"),e.next=3,this.httpRequest.patch(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetFaceting",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/faceting"),t.next=3,this.httpRequest.delete(e);case 3:return r=t.sent,t.abrupt("return",new O(r));case 5:case"end":return t.stop()}},t,this)}))}},{key:"getSeparatorTokens",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/separator-tokens"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateSeparatorTokens",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/separator-tokens"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetSeparatorTokens",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/separator-tokens"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getNonSeparatorTokens",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/non-separator-tokens"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateNonSeparatorTokens",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/non-separator-tokens"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetNonSeparatorTokens",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/non-separator-tokens"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getDictionary",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/dictionary"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateDictionary",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/dictionary"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetDictionary",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/dictionary"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getProximityPrecision",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/proximity-precision"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateProximityPrecision",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/proximity-precision"),e.next=3,this.httpRequest.put(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetProximityPrecision",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/proximity-precision"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getEmbedders",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/embedders"),t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"updateEmbedders",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes/".concat(this.uid,"/settings/embedders"),e.next=3,this.httpRequest.patch(r,t);case 3:return i=e.sent,e.abrupt("return",new O(i));case 5:case"end":return e.stop()}},e,this)}))}},{key:"resetEmbedders",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="indexes/".concat(this.uid,"/settings/embedders"),t.next=3,this.httpRequest.delete(e);case 3:return(r=t.sent).enqueuedAt=new Date(r.enqueuedAt),t.abrupt("return",r);case 6:case"end":return t.stop()}},t,this)}))}}],[{key:"create",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return b(this,void 0,void 0,n().mark(function i(){var s,a,o;return n().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return s="indexes",a=new R(r),n.next=4,a.post(s,Object.assign(Object.assign({},e),{uid:t}));case 4:return o=n.sent,n.abrupt("return",new O(o));case 6:case"end":return n.stop()}},i)}))}}]),t}(),L=function(t){d(r,t);var e=y(r);function r(t){return a(this,r),e.call(this,t)}return u(r)}(function(){function t(e){a(this,t),this.config=e,this.httpRequest=new R(e),this.tasks=new P(e)}return u(t,[{key:"index",value:function(t){return new q(this.config,t)}},{key:"getIndex",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new q(this.config,t).fetchInfo());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getRawIndex",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new q(this.config,t).getRawInfo());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getIndexes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){var r,i,s=this;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRawIndexes(t);case 2:return i=(r=e.sent).results.map(function(t){return new q(s.config,t.uid,t.primaryKey)}),e.abrupt("return",Object.assign(Object.assign({},r),{results:i}));case 5:case"end":return e.stop()}},e,this)}))}},{key:"getRawIndexes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){var r;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="indexes",e.next=3,this.httpRequest.get(r,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}))}},{key:"createIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,void 0,void 0,n().mark(function r(){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,q.create(t,e,this.config);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}},r,this)}))}},{key:"updateIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,void 0,void 0,n().mark(function r(){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,new q(this.config,t).update(e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}},r,this)}))}},{key:"deleteIndex",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new q(this.config,t).delete();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"deleteIndexIfExists",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.deleteIndex(t);case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0.code!==r.INDEX_NOT_FOUND){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}},e,this,[[0,6]])}))}},{key:"swapIndexes",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r;return n().wrap(function(e){for(;;
1)switch(e.prev=e.next){case 0:return r="/swap-indexes",e.next=3,this.httpRequest.post(r,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}))}},{key:"multiSearch",value:function(t,e){return b(this,void 0,void 0,n().mark(function r(){var i;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i="multi-search",r.next=3,this.httpRequest.post(i,t,void 0,e);case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}},r,this)}))}},{key:"getTasks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.getTasks(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"getTask",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.getTask(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"waitForTasks",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.timeOutMs,i=void 0===r?5e3:r,s=e.intervalMs,a=void 0===s?50:s;return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.waitForTasks(t,{timeOutMs:i,intervalMs:a});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"waitForTask",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.timeOutMs,i=void 0===r?5e3:r,s=e.intervalMs,a=void 0===s?50:s;return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.waitForTask(t,{timeOutMs:i,intervalMs:a});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"cancelTasks",value:function(t){return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.cancelTasks(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"deleteTasks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.tasks.deleteTasks(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"getKeys",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(this,void 0,void 0,n().mark(function e(){var r,i;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="keys",e.next=3,this.httpRequest.get(r,t);case 3:return(i=e.sent).results=i.results.map(function(t){return Object.assign(Object.assign({},t),{createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)})}),e.abrupt("return",i);case 6:case"end":return e.stop()}},e,this)}))}},{key:"getKey",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="keys/".concat(t),e.next=3,this.httpRequest.get(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}))}},{key:"createKey",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="keys",e.next=3,this.httpRequest.post(r,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}))}},{key:"updateKey",value:function(t,e){return b(this,void 0,void 0,n().mark(function r(){var i;return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i="keys/".concat(t),r.next=3,this.httpRequest.patch(i,e);case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop()}},r,this)}))}},{key:"deleteKey",value:function(t){return b(this,void 0,void 0,n().mark(function e(){var r;return n().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="keys/".concat(t),e.next=3,this.httpRequest.delete(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}))}},{key:"health",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="health",t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"isHealthy",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e="health",t.next=4,this.httpRequest.get(e);case 4:return t.abrupt("return",!0);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",!1);case 10:case"end":return t.stop()}},t,this,[[0,7]])}))}},{key:"getStats",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="stats",t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"getVersion",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="version",t.next=3,this.httpRequest.get(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}},{key:"createDump",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="dumps",t.next=3,this.httpRequest.post(e);case 3:return r=t.sent,t.abrupt("return",new O(r));case 5:case"end":return t.stop()}},t,this)}))}},{key:"createSnapshot",value:function(){return b(this,void 0,void 0,n().mark(function t(){var e,r;return n().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e="snapshots",t.next=3,this.httpRequest.post(e);case 3:return r=t.sent,t.abrupt("return",new O(r));case 5:case"end":return t.stop()}},t,this)}))}},{key:"generateTenantToken",value:function(t,e,r){var n=Error();throw Error("Meilisearch: failed to generate a tenant token. Generation of a token only w
1orks in a node environment \n ".concat(n.stack,"."))}}]),t}());t.ContentTypeEnum={JSON:"application/json",CSV:"text/csv",NDJSON:"application/x-ndjson"},t.ErrorStatusCode=r,t.Index=q,t.MatchingStrategies={ALL:"all",LAST:"last"},t.MeiliSearch=L,t.MeiliSearchApiError=A,t.MeiliSearchCommunicationError=x,t.MeiliSearchError=w,t.MeiliSearchTimeOutError=T,t.Meilisearch=L,t.TaskStatus=e,t.TaskTypes={DOCUMENTS_ADDITION_OR_UPDATE:"documentAdditionOrUpdate",DOCUMENT_DELETION:"documentDeletion",DUMP_CREATION:"dumpCreation",INDEX_CREATION:"indexCreation",INDEX_DELETION:"indexDeletion",INDEXES_SWAP:"indexSwap",INDEX_UPDATE:"indexUpdate",SETTINGS_UPDATE:"settingsUpdate",SNAPSHOT_CREATION:"snapshotCreation",TASK_CANCELATION:"taskCancelation",TASK_DELETION:"taskDeletion"},t.default=L,t.httpErrorHandler=E,t.httpResponseErrorHandler=k,t.versionErrorHintMessage=I,Object.defineProperty(t,"__esModule",{value:!0})}(n.exports),n.exports);function u(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}var c=/([\\"])/g;function d(t){return t.replace(c,"\\$1")}function h(t){var e=d(t),r=e.indexOf(":"),n=e.slice(0,r),i=e.slice(r+1);return'"'.concat(n,'"="').concat(i,'"')}function f(t){var e=function(){var e=t.match(/^([^<!>:=]*)([<!>:=]+)(.*)$/);if(e){var r=e.slice(1),n=r[0],i=r[1],s=r[2],a=(i.match(/^([<!>]?=|<|>|:){1}(.*)/)||["",""]).slice(1);return[n,a[0],a[1]+s]}return[t,"",""]}(),r=e[0],n=e[1],i=e[2],s=d(r);return'"'.concat(s.trim(),'"').concat(":"===n?" ":n).concat(i.trim())}function p(t,e){return"string"==typeof e?t(e):e.map(function(e){return"string"==typeof e?t(e):e.map(function(e){return t(e)})})}function l(t){return"string"==typeof t?[t]:t}function v(t){var e,r,n,i,s,a=t.query,o=t.indexUid,u=t.facets,c=t.attributesToSnippet,d=t.snippetEllipsisText,v=t.filters,_=t.numericFilters,y=t.facetFilters,g=t.attributesToRetrieve,m=t.attributesToHighlight,b=t.highlightPreTag,w=t.highlightPostTag,x=t.placeholderSearch,A=t.pagination,k=t.sort,E=t.restrictSearchableAttributes,T=t.meiliSearchParams,I={indexUid:o},S=(e=void 0!==_?p(f,_):_,r=void 0!==y?p(h,y):y,n=l(e),i=l(r),s=[],void 0!==v&&s.push(v),void 0!==n&&s.push.apply(s,n),void 0!==i&&s.push.apply(s,i),s);return{getParams:function(){return I},addQuery:function(){I.q=a},addFacets:function(){void 0!==u&&(I.facets="string"==typeof u?[u]:u)},addAttributesToCrop:function(){var t,e=null!==(t=null==T?void 0:T.attributesToCrop)&&void 0!==t?t:c;void 0!==e&&(I.attributesToCrop=e)},addCropLength:function(){var t=null==T?void 0:T.cropLength;void 0!==t&&(I.cropLength=t)},addCropMarker:function(){var t,e=null!==(t=null==T?void 0:T.cropMarker)&&void 0!==t?t:d;void 0!==e&&(I.cropMarker=e)},addFilters:function(){S.length&&(I.filter=S)},addAttributesToRetrieve:function(){var t,e=null!==(t=null==T?void 0:T.attributesToRetrieve)&&void 0!==t?t:g;void 0!==e&&(I.attributesToRetrieve=e)},addAttributesToHighlight:function(){var t,e;I.attributesToHighlight=null!==(e=null!==(t=null==T?void 0:T.attributesToHighlight)&&void 0!==t?t:m)&&void 0!==e?e:["*"]},addPreTag:function(){var t,e;I.highlightPreTag=null!==(e=null!==(t=null==T?void 0:T.highlightPreTag)&&void 0!==t?t:b)&&void 0!==e?e:"__ais-highlight__"},addPostTag:function(){var t,e;I.highlightPostTag=null!==(e=null!==(t=null==T?void 0:T.highlightPostTag)&&void 0!==t?t:w)&&void 0!==e?e:"__/ais-highlight__"},addPagination:function(){var t=!(!x&&!a&&(!S||0===S.length));if(A.finite){var e,r,n=(e=A.page,r=A.hitsPerPage,t?{hitsPerPage:r,page:e+1}:{hitsPerPage:0,page:e+1}),i=n.hitsPerPage,s=n.page;I.hitsPerPage=i,I.page=s}else{var o,u,c=(o=A.page,u=A.hitsPerPage,t?{limit:u+1,offset:o*u}:{limit:0,offset:0}),d=c.limit,h=c.offset;I.limit=d,I.offset=h}},addSort:function(){(null==k?void 0:k.length)&&(I.sort=Array.isArray(k)?k:[k])},addGeoSearchFilter:function(){var e=function(t){var e,r,n,i=t.insideBoundingBox,s=t.aroundLatLng,a=t.aroundRadius,o=t.minimumAroundRadius;if(s){var u=s.split(",").map(function(t){return Number.parseFloat(t).toFixed(5)}),c=u[0],d=u[1];e=[c,d]}if((null!=a||null!=o)&&("all"===a?console.warn("instant-meilisearch is not compatible with the `all` value on the aroundRadius parameter"):r=null!=a?a:o),i&&"string"==typeof i){var h=i.split(",").map(function(t){return parseFloat(t)}),f=h[0],p=h[1],l=h[2],v=h[3];
1n="_geoBoundingBox([".concat(f,", ").concat(p,"], [").concat(l,", ").concat(v,"])")}else if(null!=e&&null!=r){var c=e[0],d=e[1];n="_geoRadius(".concat(c,", ").concat(d,", ").concat(r,")")}return n}({insideBoundingBox:t.insideBoundingBox,aroundLatLng:t.aroundLatLng,aroundRadius:t.aroundRadius,minimumAroundRadius:t.minimumAroundRadius});void 0!==e&&(Array.isArray(I.filter)?I.filter.unshift(e):I.filter=[e])},addShowMatchesPosition:function(){var t=null==T?void 0:T.showMatchesPosition;void 0!==t&&(I.showMatchesPosition=t)},addMatchingStrategy:function(){var t=null==T?void 0:T.matchingStrategy;void 0!==t&&(I.matchingStrategy=t)},addShowRankingScore:function(){var t=null==T?void 0:T.showRankingScore;void 0!==t&&(I.showRankingScore=t)},addAttributesToSearchOn:function(){var t=(null==T?void 0:T.attributesToSearchOn)!==void 0?T.attributesToSearchOn:E;void 0!==t&&(I.attributesToSearchOn=t)},addHybridSearch:function(){var t=null==T?void 0:T.hybrid;void 0!==t&&(I.hybrid=t)}}}function _(t){var e=v(t);return e.addQuery(),e.addFacets(),e.addAttributesToCrop(),e.addCropLength(),e.addCropMarker(),e.addFilters(),e.addAttributesToRetrieve(),e.addAttributesToHighlight(),e.addPreTag(),e.addPostTag(),e.addPagination(),e.addSort(),e.addGeoSearchFilter(),e.addShowMatchesPosition(),e.addMatchingStrategy(),e.addShowRankingScore(),e.addAttributesToSearchOn(),e.addHybridSearch(),e.getParams()}function y(t){if(!t)return[];for(var e,r=/[^:]+:(?:asc|desc)/g,n=[];null!==(e=r.exec(t));)n.push(e[0]);return n.map(function(t){return t.replace(/^,+|,+$/,"")})}function g(t,e,r){return{hitsPerPage:void 0===e?20:e,page:r||0,finite:!!t}}function m(t){var e=t.indexOf(":");return -1===e?{indexUid:t,sortBy:""}:{indexUid:t.substring(0,e),sortBy:t.substring(e+1)}}t.instantMeiliSearch=function(t,e,r){void 0===e&&(e=""),void 0===r&&(r={}),function(t,e,r){var n=r.requestConfig,i=r.httpClient;if("string"!=typeof t)throw TypeError("Provided hostUrl value (1st parameter) is not a string, expected string");if("string"!=typeof e&&"function"!=typeof e)throw TypeError("Provided apiKey value (2nd parameter) is not a string or a function, expected string or function");if(void 0!==n&&!u(n))throw TypeError("Provided requestConfig should be an object");if(i&&"function"!=typeof i)throw TypeError("Provided custom httpClient should be a function")}(t,e,r);var n,c,d,h,f={host:t,apiKey:e=function(t){if("function"==typeof t){var e=t();if("string"!=typeof e)throw TypeError("Provided apiKey function (2nd parameter) did not return a string, expected string");return e}return t}(e),clientAgents:(void 0===(n=r.clientAgents)&&(n=[]),n.concat("Meilisearch instant-meilisearch (v".concat("0.16.0",")")))};void 0!==r.httpClient&&(f.httpClient=r.httpClient),void 0!==r.requestConfig&&(f.requestConfig=r.requestConfig);var p=new o.MeiliSearch(f),l=(void 0===c&&(c={}),d=c,{getEntry:function(t){if(d[t])try{return JSON.parse(d[t])}catch(t){}},formatKey:function(t){return t.reduce(function(t,e){return t+JSON.stringify(e)},"")},setEntry:function(t,e){d[t]=JSON.stringify(e)},clearCache:function(){d={}}}),b={multiSearch:function(t,e){return s(this,void 0,void 0,function(){var r,n,s;return a(this,function(a){switch(a.label){case 0:if(r=l.formatKey([t]),n=l.getEntry(r))return[2,n];return[4,p.multiSearch({queries:t})];case 1:return s=a.sent().results.map(function(t,r){return i(i({},t),{pagination:e[r]||{}})}),l.setEntry(r,s),[2,s]}})})}},w={},x=(h=r,i(i({},{placeholderSearch:!0,keepZeroFacets:!1,clientAgents:[],finitePagination:!1}),h));return{setMeiliSearchParams:function(t){var e=r.meiliSearchParams;r.meiliSearchParams=void 0===e?t:i(i({},e),t)},searchClient:{clearCache:function(){return l.clearCache()},search:function(t){return s(this,void 0,void 0,function(){var e,n,o,c,d,h,f,p,l,A;return a(this,function(k){switch(k.label){case 0:for(k.trys.push([0,3,,4]),e=[],n=[],o=[],c=0,d=t;c<d.length;c++)f=_(h=function(t,e){var r=t.query,n=t.indexName,s=t.params,a=m(n),o=a.indexUid,u=a.sortBy,c=g(e.finitePagination,null==s?void 0:s.hitsPerPage,null==s?void 0:s.page);return i(i(i(i({},e),{query:r}),s),{sort:y(u),indexUid:o,pagination:c,placeholderSearch:!1!==e.placeholderSearch,keepZeroFacets:!!e.keepZeroFacets})}(d[c],r)),e.push(f),p=function(t){var e=v(i(i({},t),{placeholderSearch:!0,query:""}));return e.addFacets(),e.addPagination(),e.getParams()}(h),o.push(p),n.push(h.pagination);return[4,function(t,e,r){return s(this,void 0,void 0,function(){var n,i,s,o,u;return a(this,function(a){switch(a.label){case 0:var c,d;if(c="indexUid",d=[],n=function(t){return!d.includes(t[c])&&(d.push(t[c]),!0)},0===(i=e.filter(n).filter(function(t){var e=t.indexUid;return!Object.keys(r).includes(e)})).length)return[2,r];return[4,t.multiSearch(i,[])];case 1:for(s=0,o=a.sent();s<o.length;s++)r[(u=o[s]).indexUid]=u.facetDistribution||{};return[2,r]}})})}(b,o,w)];case 1:return w=k.sent(),[4,b.multiSearch(e,n)];case 2:var E;return l=k.sent(),E=w=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t[n.indexUid]=i(i({},n.facetDistribution||{}),t[n.indexUid]||{})}return t}(w,l),[2,{results:l.map(function(t){var e,r,n,s,a,o,c,d,h,f,p,l,v,_,y,g,m,b,w,A,k,T,I,S,D,R,O,N,P;return e=t,r=E[t.indexUid],n=x,m=e.processingTimeMs,b=e.query,w=e.indexUid,k=void 0===(A=e.facetDistribution)?{}:A,T=e.facetStats,I=Object.keys(k),D=(S=(a=(s=e.pagination).hitsPerPage,{page:s.page,nbPages:function(t,e){if(null!=t.totalPages)return t.totalPages;if(0===e)return 0;var r=t.limit,n=t.offset;return(void 0===n?0:n)/e+1+(t.hits.length>=(void 0===r?20:r)?1:0)}(e,a),hitsPerPage:a})).hitsPerPage,R=S.page,O=S.nbPages,N=(o=e.hits,c=e.pagination.hitsPerPage,d=n.finitePagination,h=n.primaryKey,!d&&o.length>c&&o.splice(o.length-1,1),function(t){for(var e,r=0;r<t.length;r++){var n="".concat(r+1e6*Math.random());t[r]._geo&&(t[r]._geoloc=t[r]._geo,t[r].objectID=n),(null===(e=t[r]._formatted)||void 0===e?void 0:e._geo)&&(t[r]._formatted._geoloc=t[r]._formatted._geo,t[r]._formatted.objectID=n)}return t}(o.map(function(t){if(Object.keys(t).length>0){var e=t._formatted;t._matchesPosition;var r=Object.assign(function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)0>e.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}(t,["_formatted","_matchesPosition"]),function(t){if(!t)return{};var e=function t(e){return Array.isArray(e)?e.map(function(e){return t(e)}):u(e)?Object.keys(e).reduce(function(r,n){return r[n]=t(e[n]),r},{}):{value:"string"==typeof e?e:void 0===e?JSON.stringify(null):JSON.stringify(e)}}(t);return{_highlightResult:e,_snippetResult:e}}
1(e));return h&&(r.objectID=t[h]),r}return t}))),P=(f=e.hitsPerPage,p=e.totalPages,l=e.estimatedTotalHits,v=e.totalHits,null!=l?l:null!=v?v:(void 0===f?0:f)*(void 0===p?0:p)),{index:w,hitsPerPage:D,page:R,facets:(_=n.keepZeroFacets,y=k,_?function(t,e,r){for(var n=t?"string"==typeof t?[t]:t:[],i={},s=0;s<n.length;s++){var a=n[s];for(var o in e[a])i[a]||(i[a]=r[a]||{}),i[a][o]?i[a][o]=r[a][o]:i[a][o]=0}return i}(I,r,y=y||{}):y),nbPages:O,nbHits:P,processingTimeMS:m,query:b,hits:N,params:"",exhaustiveNbHits:!1,facets_stats:Object.keys(g=void 0===T?{}:T).reduce(function(t,e){return t[e]=i(i({},g[e]),{avg:0,sum:0}),t},{})}})}];case 3:throw console.error(A=k.sent()),Error(A);case 4:return[2]}})})},searchForFacetValues:function(t){return s(this,void 0,void 0,function(){var e,n,s,o,u,c,d,h,f;return a(this,function(a){switch(a.label){case 0:e=[],n=0,s=t,a.label=1;case 1:var l,v,b,w,x,A,k;if(!(n<s.length))return[3,4];return l=o=s[n],v=r,w=(b=m(l.indexName)).indexUid,x=b.sortBy,A=l.params,k=g(v.finitePagination,null==A?void 0:A.hitsPerPage,null==A?void 0:A.page),c=_(u=i(i(i({},v),A),{sort:y(x),indexUid:w,pagination:k,placeholderSearch:!1!==v.placeholderSearch,keepZeroFacets:!!v.keepZeroFacets})),d=i(i({},c),{facetQuery:o.params.facetQuery,facetName:o.params.facetName}),delete d.indexUid,[4,p.index(u.indexUid).searchForFacetValues(d)];case 2:f={facetHits:(h=a.sent()).facetHits.map(function(t){return i(i({},t),{highlighted:t.value})}),exhaustiveFacetsCount:!1,processingTimeMS:h.processingTimeMs},e.push(f),a.label=3;case 3:return n++,[3,1];case 4:return[2,e]}})})}}}},Object.defineProperty(t,"__esModule",{value:!0})}(r,i)}),a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var o=function(t){return t.concat(t.filter(function(t){return t}))};function u(t){var e=t.userAgent;return function(t){var r=t.url,n=t.apiKey,i=t.options,u=void 0===i?{clientAgents:[]}:i,c=u.clientAgents||[],d=s.instantMeiliSearch(r,n,a(a({},u),{clientAgents:o(function(t,e,r){if(r||2==arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([e],c,!0))})).searchClient;return a({},d)}}var c=u({userAgent:"Meilisearch autocomplete-client (v".concat("0.3.0",")")});function d(t){var e=t.searchClient,r=t.queries;return e.search(r.map(function(t){var e=t.params,r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)0>e.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}(t,["params"]);return a(a({},r),{params:a({hitsPerPage:5,highlightPreTag:"__aa-highlight__",highlightPostTag:"__/aa-highlight__"},e)})})).then(function(t){return t.results})}function h(t,e){function r(e){return t({searchClient:e.searchClient,queries:e.requests.map(function(t){return t.query})}).then(function(t){return t.map(function(t,r){var n=e.requests[r];return{items:t,sourceId:n.sourceId,transformResponse:n.transformResponse}})})}return function(t){return function(n){return a(a({requesterId:e,execute:r},t),n)}}}var f=h(function(t){return d(t)},"meilisearch"),p=f({transformResponse:function(t){return t.hits}});t.__moduleExports=s,t.concatUserAgents=o,t.createMeilisearchRequester=f,t.createRequester=h,t.createSearchClient=u,t.fetchMeilisearchResults=d,t.getMeilisearchResults=p,t.meilisearchAutocompleteClient=c,Object.defineProperty(t,"__esModule",{value:!0})}(e)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.