/*! @docsearch/react 3.6.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self)["@docsearch/react"]={},e.React,e.ReactDOM)}(this,(function(e,t,r){"use strict";var n="default"in t?t.default:t;function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:20,r=[],n=0;n=3||2===r&&n>=4||1===r&&n>=10);function i(t,r,n){if(o&&void 0!==n){var i=n[0].__autocomplete_algoliaCredentials,a={"X-Algolia-Application-Id":i.appId,"X-Algolia-API-Key":i.apiKey};e.apply(void 0,[t].concat(x(r),[{headers:a}]))}else e.apply(void 0,[t].concat(x(r)))}return{init:function(t,r){e("init",{appId:t,apiKey:r})},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("clickedObjectIDsAfterSearch",B(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("clickedObjectIDs",B(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["clickedFilters"].concat(r))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("convertedObjectIDsAfterSearch",B(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&i("convertedObjectIDs",B(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["convertedFilters"].concat(r))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&t.reduce((function(e,t){var r=t.items,n=R(t,N);return[].concat(x(e),x(H(L(L({},n),{},{objectIDs:(null==r?void 0:r.map((function(e){return e.objectID})))||n.objectIDs})).map((function(e){return{items:r,payload:e}}))))}),[]).forEach((function(e){var t=e.items;return i("viewedObjectIDs",[e.payload],t)}))},viewedFilters:function(){for(var t=arguments.length,r=new Array(t),n=0;n0&&e.apply(void 0,["viewedFilters"].concat(r))}}}function U(e){var t=e.items.reduce((function(e,t){var r;return e[t.__autocomplete_indexName]=(null!==(r=e[t.__autocomplete_indexName])&&void 0!==r?r:[]).concat(t),e}),{});return Object.keys(t).map((function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}}))}function V(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}function J(e){return function(e){if(Array.isArray(e))return $(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&X({onItemsChange:n,items:r,insights:c,state:t}))}}),0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,r=e.onSelect,n=e.onActive;a("addAlgoliaAgent","insights-plugin"),t({algoliaInsightsPlugin:{__algoliaSearchParameters:{clickAnalytics:!0},insights:c}}),r((function(e){var t=e.item,r=e.state,n=e.event;V(t)&&o({state:r,event:n,insights:c,item:t,insightsEvents:[Q({eventName:"Item Selected"},D({item:t,items:l.current}))]})})),n((function(e){var t=e.item,r=e.state,n=e.event;V(t)&&i({state:r,event:n,insights:c,item:t,insightsEvents:[Q({eventName:"Item Active"},D({item:t,items:l.current}))]})}))},onStateChange:function(e){var t=e.state;u({state:t})},__autocomplete_pluginOptions:e}}function ee(e,t){var r=t;return{then:function(t,n){return ee(e.then(re(t,r,e),re(n,r,e)),r)},catch:function(t){return ee(e.catch(re(t,r,e)),r)},finally:function(t){return t&&r.onCancelList.push(t),ee(e.finally(re(t&&function(){return r.onCancelList=[],t()},r,e)),r)},cancel:function(){r.isCanceled=!0;var e=r.onCancelList;r.onCancelList=[],e.forEach((function(e){e()}))},isCanceled:function(){return!0===r.isCanceled}}}function te(e){return ee(e,{isCanceled:!1,onCancelList:[]})}function re(e,t,r){return e?function(r){return t.isCanceled?r:e(r)}:r}function ne(e,t,r,n){if(!r)return null;if(e<0&&(null===t||null!==n&&0===t))return r+e;var o=(null===t?-1:t)+e;return o<=-1||o>=r?null===n?null:0:o}function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0},reshape:function(e){return e.sources}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(O++),plugins:o,initialState:Ee({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(ge(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){var r=[];return Promise.resolve(e(t)).then((function(e){return Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,r.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));r.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:I,onResolve:I};Object.keys(t).forEach((function(e){t[e].__default=!0}));var n=ie(ie({},t),e);return Promise.resolve(n)})))}))}(e,r)}))).then((function(e){return S(e)})).then((function(e){return e.map((function(e){return Ee(Ee({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onActive:function(r){e.onActive(r),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,r)}))},onResolve:function(r){e.onResolve(r),t.forEach((function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:Ee({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function De(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Je,$e,ze,Qe=null,We=(Je=-1,$e=-1,ze=void 0,function(e){var t=++Je;return Promise.resolve(e).then((function(e){return ze&&t<$e?ze:($e=t,ze=e,e)}))});function Ze(e){var t=e.event,r=e.nextState,n=void 0===r?{}:r,o=e.props,i=e.query,a=e.refresh,c=e.store,l=Ke(e,Be);Qe&&o.environment.clearTimeout(Qe);var u=l.setCollections,s=l.setIsOpen,f=l.setQuery,m=l.setActiveItemId,p=l.setStatus;if(f(i),m(o.defaultActiveItemId),!i&&!1===o.openOnFocus){var d,v=c.getState().collections.map((function(e){return Ue(Ue({},e),{},{items:[]})}));p("idle"),u(v),s(null!==(d=n.isOpen)&&void 0!==d?d:o.shouldPanelOpen({state:c.getState()}));var h=te(We(v).then((function(){return Promise.resolve()})));return c.pendingRequests.add(h)}p("loading"),Qe=o.environment.setTimeout((function(){p("stalled")}),o.stallThreshold);var y=te(We(o.getSources(Ue({query:i,refresh:a,state:c.getState()},l)).then((function(e){return Promise.all(e.map((function(e){return Promise.resolve(e.getItems(Ue({query:i,refresh:a,state:c.getState()},l))).then((function(t){return qe(t,e.sourceId,c.getState())}))}))).then(Le).then((function(t){return Me(t,e,c)})).then((function(e){return function(e){var t=e.collections,r=e.props,n=e.state,o=t.reduce((function(e,t){return De(De({},e),{},Ae({},t.source.sourceId,De(De({},t.source),{},{getItems:function(){return S(t.items)}})))}),{}),i=r.plugins.reduce((function(e,t){return t.reshape?t.reshape(e):e}),{sourcesBySourceId:o,state:n}).sourcesBySourceId;return S(r.reshape({sourcesBySourceId:i,sources:Object.values(i),state:n})).filter(Boolean).map((function(e){return{source:e,items:e.getItems()}}))}({collections:e,props:o,state:c.getState()})}))})))).then((function(e){var r;p("idle"),u(e);var f=o.shouldPanelOpen({state:c.getState()});s(null!==(r=n.isOpen)&&void 0!==r?r:o.openOnFocus&&!i&&f||f);var m=le(c.getState());if(null!==c.getState().activeItemId&&m){var d=m.item,v=m.itemInputValue,h=m.itemUrl,y=m.source;y.onActive(Ue({event:t,item:d,itemInputValue:v,itemUrl:h,refresh:a,source:y,state:c.getState()},l))}})).finally((function(){p("idle"),Qe&&o.environment.clearTimeout(Qe)}));return c.pendingRequests.add(y)}function Ye(e){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}var Xe=["event","props","refresh","store"];function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function nt(e){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nt(e)}var ot=["props","refresh","store"],it=["inputElement","formElement","panelElement"],at=["inputElement"],ct=["inputElement","maxLength"],lt=["sourceIndex"],ut=["sourceIndex"],st=["item","source","sourceIndex"];function ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function vt(e){var t=e.props,r=e.refresh,n=e.store,o=dt(e,ot),i=function(e,t){return void 0!==t?"".concat(e,"-").concat(t):e};return{getEnvironmentProps:function(e){var r=e.inputElement,o=e.formElement,i=e.panelElement;function a(e){!n.getState().isOpen&&n.pendingRequests.isEmpty()||e.target===r||!1===[o,i].some((function(t){return r=t,n=e.target,r===n||r.contains(n);var r,n}))&&(n.dispatch("blur",null),t.debug||n.pendingRequests.cancelAll())}return mt({onTouchStart:a,onMouseDown:a,onTouchMove:function(e){!1!==n.getState().isOpen&&r===t.environment.document.activeElement&&e.target!==r&&r.blur()}},dt(e,it))},getRootProps:function(e){return mt({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return mt({action:"",noValidate:!0,role:"search",onSubmit:function(i){var a;i.preventDefault(),t.onSubmit(mt({event:i,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(a=e.inputElement)||void 0===a||a.blur()},onReset:function(i){var a;i.preventDefault(),t.onReset(mt({event:i,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(a=e.inputElement)||void 0===a||a.focus()}},dt(e,at))},getLabelProps:function(e){var r=e||{},n=r.sourceIndex,o=dt(r,lt);return mt({htmlFor:"".concat(i(t.id,n),"-input"),id:"".concat(i(t.id,n),"-label")},o)},getInputProps:function(e){var i;function a(e){(t.openOnFocus||Boolean(n.getState().query))&&Ze(mt({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var c=e||{},l=(c.inputElement,c.maxLength),u=void 0===l?512:l,s=dt(c,ct),f=le(n.getState()),m=function(e){return Boolean(e&&e.match(ue))}((null===(i=t.environment.navigator)||void 0===i?void 0:i.userAgent)||""),p=null!=f&&f.itemUrl&&!m?"go":"search";return mt({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().activeItemId?"".concat(t.id,"-item-").concat(n.getState().activeItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:p,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:u,type:"search",onChange:function(e){Ze(mt({event:e,props:t,query:e.currentTarget.value.slice(0,u),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,i=rt(e,Xe);if("ArrowUp"===t.key||"ArrowDown"===t.key){var a=function(){var e=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().activeItemId));e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView(!1))},c=function(){var e=le(o.getState());if(null!==o.getState().activeItemId&&e){var r=e.item,a=e.itemInputValue,c=e.itemUrl,l=e.source;l.onActive(et({event:t,item:r,itemInputValue:a,itemUrl:c,refresh:n,source:l,state:o.getState()},i))}};t.preventDefault(),!1===o.getState().isOpen&&(r.openOnFocus||Boolean(o.getState().query))?Ze(et({event:t,props:r,query:o.getState().query,refresh:n,store:o},i)).then((function(){o.dispatch(t.key,{nextActiveItemId:r.defaultActiveItemId}),c(),setTimeout(a,0)})):(o.dispatch(t.key,{}),c(),a())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Tab"===t.key)o.dispatch("blur",null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return void(r.debug||o.pendingRequests.cancelAll());t.preventDefault();var l=le(o.getState()),u=l.item,s=l.itemInputValue,f=l.itemUrl,m=l.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(m.onSelect(et({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),r.navigator.navigateNewTab({itemUrl:f,item:u,state:o.getState()}));else if(t.shiftKey)void 0!==f&&(m.onSelect(et({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),r.navigator.navigateNewWindow({itemUrl:f,item:u,state:o.getState()}));else if(t.altKey);else{if(void 0!==f)return m.onSelect(et({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i)),void r.navigator.navigate({itemUrl:f,item:u,state:o.getState()});Ze(et({event:t,nextState:{isOpen:!1},props:r,query:s,refresh:n,store:o},i)).then((function(){m.onSelect(et({event:t,item:u,itemInputValue:s,itemUrl:f,refresh:n,source:m,state:o.getState()},i))}))}}}(mt({event:e,props:t,refresh:r,store:n},o))},onFocus:a,onBlur:I,onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||a(r)}},s)},getPanelProps:function(e){return mt({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){var r=e||{},n=r.sourceIndex,o=dt(r,ut);return mt({role:"listbox","aria-labelledby":"".concat(i(t.id,n),"-label"),id:"".concat(i(t.id,n),"-list")},o)},getItemProps:function(e){var a=e.item,c=e.source,l=e.sourceIndex,u=dt(e,st);return mt({id:"".concat(i(t.id,l),"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().activeItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=le(n.getState());if(null!==n.getState().activeItemId&&t){var i=t.item,c=t.itemInputValue,l=t.itemUrl,u=t.source;u.onActive(mt({event:e,item:i,itemInputValue:c,itemUrl:l,refresh:r,source:u,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():Ze(mt({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(mt({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},u)}}}function ht(e){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ht(e)}function yt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bt(e){for(var t=1;t0&&n.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},n.createElement("p",{className:"DocSearch-Help"},u,":"),n.createElement("ul",null,v.slice(0,3).reduce((function(e,t){return[].concat(s(e),[n.createElement("li",{key:t},n.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){o.setQuery(t.toLowerCase()+" "),o.refresh(),o.inputRef.current.focus()}},t))])}),[]))),o.getMissingResultsUrl&&n.createElement("p",{className:"DocSearch-Help"},"".concat(m," "),n.createElement("a",{href:o.getMissingResultsUrl({query:o.state.query}),target:"_blank",rel:"noopener noreferrer"},d)))}var Zt=["hit","attribute","tagName"];function Yt(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function Xt(e){var r=e.hit,n=e.attribute,o=e.tagName,a=void 0===o?"span":o,c=l(e,Zt);return t.createElement(a,i(i({},c),{},{dangerouslySetInnerHTML:{__html:Yt(r,"_snippetResult.".concat(n,".value"))||Yt(r,n)}}))}function Gt(e){return e.collection&&0!==e.collection.items.length?n.createElement("section",{className:"DocSearch-Hits"},n.createElement("div",{className:"DocSearch-Hit-source"},e.title),n.createElement("ul",e.getListProps(),e.collection.items.map((function(t,r){return n.createElement(er,c({key:[e.title,t.objectID].join(":"),item:t,index:r},e))})))):null}function er(e){var t=e.item,r=e.index,o=e.renderIcon,i=e.renderAction,a=e.getItemProps,l=e.onItemClick,s=e.collection,f=e.hitComponent,m=u(n.useState(!1),2),p=m[0],d=m[1],v=u(n.useState(!1),2),h=v[0],y=v[1],b=n.useRef(null),g=f;return n.createElement("li",c({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child",p&&"DocSearch-Hit--deleting",h&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){b.current&&b.current()}},a({item:t,source:s.source,onClick:function(e){l(t,e)}})),n.createElement(g,{hit:t},n.createElement("div",{className:"DocSearch-Hit-Container"},o({item:t,index:r}),t.hierarchy[t.type]&&"lvl1"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(Xt,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&n.createElement(Xt,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(Xt,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),n.createElement(Xt,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(Xt,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),n.createElement(Xt,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),i({item:t,runDeleteTransition:function(e){d(!0),b.current=e},runFavoriteTransition:function(e){y(!0),b.current=e}}))))}function tr(e,t,r){return e.reduce((function(e,n){var o=t(n);return e.hasOwnProperty(o)||(e[o]=[]),e[o].length<(r||5)&&e[o].push(n),e}),{})}function rr(e){return e}function nr(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function or(){}var ir=/(|<\/mark>)/g,ar=RegExp(ir.source);function cr(e){var t,r,n=e;if(!n.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var o=((n.__docsearch_parent?null===(t=n.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(r=e._highlightResult)||void 0===r||null===(r=r.hierarchy)||void 0===r?void 0:r.lvl0)||{}).value;return o&&ar.test(o)?o.replace(ir,""):o}function lr(e){return n.createElement("div",{className:"DocSearch-Dropdown-Container"},e.state.collections.map((function(t){if(0===t.items.length)return null;var r=cr(t.items[0]);return n.createElement(Gt,c({},e,{key:t.source.sourceId,title:r,collection:t,renderIcon:function(e){var r,o=e.item,i=e.index;return n.createElement(n.Fragment,null,o.__docsearch_parent&&n.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},o.__docsearch_parent!==(null===(r=t.items[i+1])||void 0===r?void 0:r.__docsearch_parent)?n.createElement("path",{d:"M8 6v21M20 27H8.3"}):n.createElement("path",{d:"M8 6v42M20 27H8.3"}))),n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Ft,{type:o.type})))},renderAction:function(){return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement(Ht,null))}}))})),e.resultsFooterComponent&&n.createElement("section",{className:"DocSearch-HitsFooter"},n.createElement(e.resultsFooterComponent,{state:e.state})))}var ur=["translations"];function sr(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,ur),i=r.recentSearchesTitle,a=void 0===i?"Recent":i,u=r.noRecentSearchesText,s=void 0===u?"No recent searches":u,f=r.saveRecentSearchButtonTitle,m=void 0===f?"Save this search":f,p=r.removeRecentSearchButtonTitle,d=void 0===p?"Remove this search from history":p,v=r.favoriteSearchesTitle,h=void 0===v?"Favorite":v,y=r.removeFavoriteSearchButtonTitle,b=void 0===y?"Remove this search from favorites":y;return"idle"===o.state.status&&!1===o.hasCollections?o.disableUserPersonalization?null:n.createElement("div",{className:"DocSearch-StartScreen"},n.createElement("p",{className:"DocSearch-Help"},s)):!1===o.hasCollections?null:n.createElement("div",{className:"DocSearch-Dropdown-Container"},n.createElement(Gt,c({},o,{title:a,collection:o.state.collections[0],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Lt,null))},renderAction:function(e){var t=e.item,r=e.runFavoriteTransition,i=e.runDeleteTransition;return n.createElement(n.Fragment,null,n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:m,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){o.favoriteSearches.add(t),o.recentSearches.remove(t),o.refresh()}))}},n.createElement(Kt,null))),n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:d,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),i((function(){o.recentSearches.remove(t),o.refresh()}))}},n.createElement(Mt,null))))}})),n.createElement(Gt,c({},o,{title:h,collection:o.state.collections[1],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Kt,null))},renderAction:function(e){var t=e.item,r=e.runDeleteTransition;return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:b,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){o.favoriteSearches.remove(t),o.refresh()}))}},n.createElement(Mt,null)))}})))}var fr=["translations"],mr=n.memo((function(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,fr);if("error"===o.state.status)return n.createElement(zt,{translations:null==r?void 0:r.errorScreen});var i=o.state.collections.some((function(e){return e.items.length>0}));return o.state.query?!1===i?n.createElement(Wt,c({},o,{translations:null==r?void 0:r.noResultsScreen})):n.createElement(lr,o):n.createElement(sr,c({},o,{hasCollections:i,translations:null==r?void 0:r.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status})),pr=["translations"];function dr(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,pr),i=r.resetButtonTitle,a=void 0===i?"Clear the query":i,u=r.resetButtonAriaLabel,s=void 0===u?"Clear the query":u,f=r.cancelButtonText,m=void 0===f?"Cancel":f,p=r.cancelButtonAriaLabel,v=void 0===p?"Cancel":p,h=r.searchInputLabel,y=void 0===h?"Search":h,b=o.getFormProps({inputElement:o.inputRef.current}).onReset;return n.useEffect((function(){o.autoFocus&&o.inputRef.current&&o.inputRef.current.focus()}),[o.autoFocus,o.inputRef]),n.useEffect((function(){o.isFromSelection&&o.inputRef.current&&o.inputRef.current.select()}),[o.isFromSelection,o.inputRef]),n.createElement(n.Fragment,null,n.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:b},n.createElement("label",c({className:"DocSearch-MagnifierLabel"},o.getLabelProps()),n.createElement(d,null),n.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},y)),n.createElement("div",{className:"DocSearch-LoadingIndicator"},n.createElement(qt,null)),n.createElement("input",c({className:"DocSearch-Input",ref:o.inputRef},o.getInputProps({inputElement:o.inputRef.current,autoFocus:o.autoFocus,maxLength:64}))),n.createElement("button",{type:"reset",title:a,className:"DocSearch-Reset","aria-label":s,hidden:!o.state.query},n.createElement(Mt,null))),n.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":v,onClick:o.onClose},m))}var vr=["_highlightResult","_snippetResult"];function hr(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function yr(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=hr(t),i=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,l(t,vr)),a=i.findIndex((function(e){return e.objectID===r.objectID}));a>-1&&i.splice(a,1),i.unshift(r),i=i.slice(0,n),o.setItem(i)},remove:function(e){i=i.filter((function(t){return t.objectID!==e.objectID})),o.setItem(i)},getAll:function(){return i}}}function br(e){const t=`algoliasearch-client-js-${e.key}`;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}"),i=e=>{n().setItem(t,JSON.stringify(e))};return{get:(t,r,n={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{(()=>{const t=e.timeToLive?1e3*e.timeToLive:null,r=o(),n=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(i(n),!t)return;const a=Object.fromEntries(Object.entries(n).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+tPromise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||n.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const i=o();return i[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},n().setItem(t,JSON.stringify(i)),r})),delete:e=>Promise.resolve().then((()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(t)}))}}function gr(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch((()=>gr({caches:t}).get(e,n,o))),set:(e,n)=>r.set(e,n).catch((()=>gr({caches:t}).set(e,n))),delete:e=>r.delete(e).catch((()=>gr({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>gr({caches:t}).clear()))}}function Sr(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const i=JSON.stringify(r);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);const a=n(),c=o&&o.miss||(()=>Promise.resolve());return a.then((e=>c(e))).then((()=>a))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function Or(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function Er(e,t){return t?(Object.keys(t).forEach((r=>{e[r]=t[r](e)})),e):e}function wr(e,...t){let r=0;return e.replace(/%s/g,(()=>encodeURIComponent(t[r++])))}const jr="4.19.1",Ir={WithinQueryParameters:0,WithinHeaders:1};function Pr(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach((e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Dr={Read:1,Write:2,Any:3},Ar=1,kr=2,Cr=3,Nr=12e4;function _r(e,t=Ar){return{...e,status:t,lastUpdate:Date.now()}}function xr(e){return"string"==typeof e?{protocol:"https",url:e,accept:Dr.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Dr.Any}}const Tr="GET",Rr="POST";function qr(e,t){return Promise.all(t.map((t=>e.get(t,(()=>Promise.resolve(_r(t))))))).then((e=>{const r=e.filter((e=>function(e){return e.status===Ar||Date.now()-e.lastUpdate>Nr}(e))),n=e.filter((e=>function(e){return e.status===Cr&&Date.now()-e.lastUpdate<=Nr}(e))),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map((e=>xr(e))):t}}))}function Lr(e,t,r,n){const o=[],i=function(e,t){if(e.method===Tr||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),a=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach((e=>{const t=r[e];n[e.toLowerCase()]=t})),n}(e,n),c=r.method,l=r.method!==Tr?{}:{...r.data,...n.data},u={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let s=0;const f=(t,l)=>{const m=t.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Fr(o)};const p={data:i,headers:a,method:c,url:Hr(m,r.path,u),connectTimeout:l(s,e.timeouts.connect),responseTimeout:l(s,n.timeout)},d=e=>{const r={request:p,response:e,host:m,triesLeft:t.length};return o.push(r),r},v={onSuccess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=d(r);return r.isTimedOut&&s++,Promise.all([e.logger.info("Retryable failure",Ur(n)),e.hostsCache.set(m,_r(m,r.isTimedOut?Cr:kr))]).then((()=>f(t,l)))},onFail(e){throw d(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,Fr(o))}};return e.requester.send(p).then((e=>((e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSuccess(e):t.onFail(e))(e,v)))};return qr(e.hostsCache,t).then((e=>f([...e.statelessHosts].reverse(),e.getTimeout)))}function Mr(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function Hr(e,t,r){const n=Br(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+=`?${n}`),o}function Br(e){return Object.keys(e).map((t=>{return wr("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function Fr(e){return e.map((e=>Ur(e)))}function Ur(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const Vr=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===Ir.WithinHeaders?n:{},queryParameters:()=>e===Ir.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:Ir.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:a,userAgent:c,hosts:l,queryParameters:u,headers:s}=e,f={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:i,timeouts:a,userAgent:c,headers:s,queryParameters:u,hosts:l.map((e=>xr(e))),read(e,t){const r=Pr(t,f.timeouts.read),n=()=>Lr(f,f.hosts.filter((e=>0!=(e.accept&Dr.Read))),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(()=>f.requestsCache.get(o,(()=>f.requestsCache.set(o,n()).then((e=>Promise.all([f.requestsCache.delete(o),e])),(e=>Promise.all([f.requestsCache.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>f.responsesCache.set(o,e)})},write:(e,t)=>Lr(f,f.hosts.filter((e=>0!=(e.accept&Dr.Write))),e,Pr(t,f.timeouts.write))};return f}({hosts:[{url:`${t}-dsn.algolia.net`,accept:Dr.Read},{url:`${t}.algolia.net`,accept:Dr.Write}].concat(Or([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}}),o={transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{}))};return Er(o,e.methods)},Kr=e=>(t,r)=>t.method===Tr?e.transporter.read(t,r):e.transporter.write(t,r),Jr=e=>(t,r={})=>Er({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),$r=e=>(t,r)=>{const n=t.map((e=>({...e,params:Br(e.params||{})})));return e.transporter.read({method:Rr,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},zr=e=>(t,r)=>Promise.all(t.map((t=>{const{facetName:n,facetQuery:o,...i}=t.params;return Jr(e)(t.indexName,{methods:{searchForFacetValues:Zr}}).searchForFacetValues(n,o,{...r,...i})}))),Qr=e=>(t,r,n)=>e.transporter.read({method:Rr,path:wr("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n),Wr=e=>(t,r)=>e.transporter.read({method:Rr,path:wr("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),Zr=e=>(t,r,n)=>e.transporter.read({method:Rr,path:wr("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),Yr=1,Xr=2,Gr=3;function en(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e),o=n(e.connectTimeout,"Connection timeout");let i;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===i&&(clearTimeout(o),i=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(i),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(i),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))},logger:(o=Gr,{debug:(e,t)=>(Yr>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(Xr>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Sr(),requestsCache:Sr({serializable:!1}),hostsCache:gr({caches:[br({key:`4.19.1-${e}`}),Sr()]}),userAgent:Mr(jr).add({segment:"Browser",version:"lite"}),authMode:Ir.WithinQueryParameters};var o;return Vr({...n,...r,methods:{search:$r,searchForFacetValues:zr,multipleQueries:$r,multipleSearchForFacetValues:zr,customRequest:Kr,initIndex:e=>t=>Jr(e)(t,{methods:{search:Wr,searchForFacetValues:Zr,findAnswers:Qr}})}})}en.version=jr;var tn="3.6.0";var rn=["footer","searchBox"];function nn(e){var t=e.appId,r=e.apiKey,o=e.indexName,a=e.placeholder,s=void 0===a?"Search docs":a,f=e.searchParameters,m=e.maxResultsPerGroup,p=e.onClose,d=void 0===p?or:p,v=e.transformItems,h=void 0===v?rr:v,y=e.hitComponent,b=void 0===y?Rt:y,g=e.resultsFooterComponent,S=void 0===g?function(){return null}:g,O=e.navigator,E=e.initialScrollY,w=void 0===E?0:E,j=e.transformSearchClient,I=void 0===j?rr:j,P=e.disableUserPersonalization,D=void 0!==P&&P,A=e.initialQuery,k=void 0===A?"":A,C=e.translations,N=void 0===C?{}:C,_=e.getMissingResultsUrl,x=e.insights,T=void 0!==x&&x,R=N.footer,q=N.searchBox,L=l(N,rn),M=u(n.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),H=M[0],B=M[1],F=n.useRef(null),U=n.useRef(null),V=n.useRef(null),K=n.useRef(null),J=n.useRef(null),$=n.useRef(10),z=n.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,Q=n.useRef(k||z).current,W=function(e,t,r){return n.useMemo((function(){var n=en(e,t);return n.addAlgoliaAgent("docsearch",tn),!1===/docsearch.js \(.*\)/.test(n.transporter.userAgent.value)&&n.addAlgoliaAgent("docsearch-react",tn),r(n)}),[e,t,r])}(t,r,I),Z=n.useRef(yr({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(o),limit:10})).current,Y=n.useRef(yr({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(o),limit:0===Z.getAll().length?7:4})).current,X=n.useCallback((function(e){if(!D){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===Z.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&Y.add(t)}}),[Z,Y,D]),G=n.useCallback((function(e){if(H.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,r={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};H.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(r)}}),[H.context.algoliaInsightsPlugin]),ee=n.useMemo((function(){return Nt({id:"docsearch",defaultActiveItemId:0,placeholder:s,openOnFocus:!0,initialState:{query:Q,context:{searchSuggestions:[]}},insights:T,navigator:O,onStateChange:function(e){B(e.state)},getSources:function(e){var n=e.query,a=e.state,c=e.setContext,l=e.setStatus;if(!n)return D?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,r=e.event;X(t),nr(r)||d()},getItemUrl:function(e){return e.item.url},getItems:function(){return Y.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,r=e.event;X(t),nr(r)||d()},getItemUrl:function(e){return e.item.url},getItems:function(){return Z.getAll()}}];var u=Boolean(T);return W.search([{query:n,indexName:o,params:i({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat($.current),"hierarchy.lvl2:".concat($.current),"hierarchy.lvl3:".concat($.current),"hierarchy.lvl4:".concat($.current),"hierarchy.lvl5:".concat($.current),"hierarchy.lvl6:".concat($.current),"content:".concat($.current)],snippetEllipsisText:"…",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:u},f)}]).catch((function(e){throw"RetryError"===e.name&&l("error"),e})).then((function(e){var n=e.results[0],l=n.hits,s=n.nbHits,f=tr(l,(function(e){return cr(e)}),m);a.context.searchSuggestions.length0&&(ne(),J.current&&J.current.focus())}),[Q,ne]),n.useEffect((function(){function e(){if(U.current){var e=.01*window.innerHeight;U.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),n.createElement("div",c({ref:F},re({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===H.status&&"DocSearch-Container--Stalled","error"===H.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&d()}}),n.createElement("div",{className:"DocSearch-Modal",ref:U},n.createElement("header",{className:"DocSearch-SearchBar",ref:V},n.createElement(dr,c({},ee,{state:H,autoFocus:0===Q.length,inputRef:J,isFromSelection:Boolean(Q)&&Q===z,translations:q,onClose:d}))),n.createElement("div",{className:"DocSearch-Dropdown",ref:K},n.createElement(mr,c({},ee,{indexName:o,state:H,hitComponent:b,resultsFooterComponent:S,disableUserPersonalization:D,recentSearches:Y,favoriteSearches:Z,inputRef:J,translations:L,getMissingResultsUrl:_,onItemClick:function(e,t){G(e),X(e),nr(t)||d()}}))),n.createElement("footer",{className:"DocSearch-Footer"},n.createElement(Tt,{translations:R}))))}function on(e){var t=e.isOpen,r=e.onOpen,o=e.onClose,i=e.onInput,a=e.searchButtonRef;n.useEffect((function(){function e(e){var n;(27===e.keyCode&&t||"k"===(null===(n=e.key)||void 0===n?void 0:n.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,r=t.tagName;return t.isContentEditable||"INPUT"===r||"SELECT"===r||"TEXTAREA"===r}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?o():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||r()),a&&a.current===document.activeElement&&i&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&i(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,r,o,i,a])}e.DocSearch=function(e){var t,o,i=n.useRef(null),a=u(n.useState(!1),2),l=a[0],s=a[1],f=u(n.useState((null==e?void 0:e.initialQuery)||void 0),2),m=f[0],p=f[1],d=n.useCallback((function(){s(!0)}),[s]),v=n.useCallback((function(){s(!1)}),[s]);return on({isOpen:l,onOpen:d,onClose:v,onInput:n.useCallback((function(e){s(!0),p(e.key)}),[s,p]),searchButtonRef:i}),n.createElement(n.Fragment,null,n.createElement(y,{ref:i,translations:null==e||null===(t=e.translations)||void 0===t?void 0:t.button,onClick:d}),l&&r.createPortal(n.createElement(nn,c({},e,{initialScrollY:window.scrollY,initialQuery:m,translations:null==e||null===(o=e.translations)||void 0===o?void 0:o.modal,onClose:v})),document.body))},e.DocSearchButton=y,e.DocSearchModal=nn,e.useDocSearchKeyboardEvents=on,e.version=tn,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=index.js.map