blog-hexo/themes/hexo-theme-cosy/source/js/b9c2be9c.js
2023-11-10 13:55:02 +08:00

2 lines
60 KiB
JavaScript

/*! For license information please see b9c2be9c.js.LICENSE.txt */
(()=>{var e={886:function(e){e.exports=function(){"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function a(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},i=function(){return JSON.parse(r().getItem(n)||"{}")},a=function(e){r().setItem(n,JSON.stringify(e))},s=function(){var t=e.timeToLive?1e3*e.timeToLive:null,n=i(),r=Object.fromEntries(Object.entries(n).filter((function(e){return void 0!==o(e,2)[1].timestamp})));if(a(r),t){var s=Object.fromEntries(Object.entries(r).filter((function(e){var n=o(e,2)[1],r=(new Date).getTime();return!(n.timestamp+t<r)})));a(s)}};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){s();var t=JSON.stringify(e);return i()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=o(e,2),r=t[0],i=t[1];return Promise.all([r,i||n.miss(r)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=i();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},r().setItem(n,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function s(e){var t=i(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return s({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return s({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return s({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return s({caches:t}).clear()}))}}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},i=JSON.stringify(n);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var a=r(),s=o&&o.miss||function(){return Promise.resolve()};return a.then((function(e){return s(e)})).then((function(){return a}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function u(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===h.WithinHeaders?r:{}},queryParameters:function(){return e===h.WithinQueryParameters?r:{}}}}function l(e){var t=0;return e((function n(){return t++,new Promise((function(r){setTimeout((function(){r(e(n))}),Math.min(100*t,1e3))}))}))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(n){return d(e.then((function(e){return Promise.all([t(e,n),e])})).then((function(e){return e[1]})))}})}function f(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function p(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function m(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(n[o++])}))}var h={WithinQueryParameters:0,WithinHeaders:1};function g(e,t){var n=e||{},r=n.data||{};return Object.keys(n).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])})),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var y={Read:1,Write:2,Any:3},v=1,b=2,x=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return n(n({},e),{},{status:t,lastUpdate:Date.now()})}function E(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var T="DELETE",S="GET",D="POST",I="PUT";function k(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===v||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return e.status===x&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(i(n),i(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return E(e)})):t}}))}function O(e,t,r,o){var a=[],s=function(e,t){if(e.method!==S&&(void 0!==e.data||void 0!==t.data)){var r=Array.isArray(e.data)?e.data:n(n({},e.data),t.data);return JSON.stringify(r)}}(r,o),c=function(e,t){var r=n(n({},e.headers),t.headers),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}(e,o),u=r.method,l=r.method!==S?{}:n(n({},r.data),o.data),d=n(n(n({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),f=0,p=function t(n,i){var l=n.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:C(a)};var p={data:s,headers:c,method:u,url:R(l,r.path,d),connectTimeout:i(f,e.timeouts.connect),responseTimeout:i(f,o.timeout)},m=function(e){var t={request:p,response:e,host:l,triesLeft:n.length};return a.push(t),t},h={onSuccess:function(e){return 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:function(r){var o=m(r);return r.isTimedOut&&f++,Promise.all([e.logger.info("Retryable failure",_(o)),e.hostsCache.set(l,w(l,r.isTimedOut?x:b))]).then((function(){return t(n,i)}))},onFail:function(e){throw m(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,C(a))}};return e.requester.send(p).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,h)}))};return k(e.hostsCache,t).then((function(e){return p(i(e.statelessHosts).reverse(),e.getTimeout)}))}function A(e){var t=e.hostsCache,n=e.logger,r=e.requester,i=e.requestsCache,a=e.responsesCache,s=e.timeouts,c=e.userAgent,u=e.hosts,l=e.queryParameters,d={hostsCache:t,logger:n,requester:r,requestsCache:i,responsesCache:a,timeouts:s,userAgent:c,headers:e.headers,queryParameters:l,hosts:u.map((function(e){return E(e)})),read:function(e,t){var n=g(t,d.timeouts.read),r=function(){return O(d,d.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var i={request:e,mappedRequestOptions:n,transporter:{queryParameters:d.queryParameters,headers:d.headers}};return d.responsesCache.get(i,(function(){return d.requestsCache.get(i,(function(){return d.requestsCache.set(i,r()).then((function(e){return Promise.all([d.requestsCache.delete(i),e])}),(function(e){return Promise.all([d.requestsCache.delete(i),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return d.responsesCache.set(i,e)}})},write:function(e,t){return O(d,d.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,g(t,d.timeouts.write))}};return d}function N(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function R(e,t,n){var r=P(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function P(e){return Object.keys(e).map((function(t){return m("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function C(e){return e.map((function(e){return _(e)}))}function _(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return n(n({},e),{},{request:n(n({},e.request),{},{headers:n(n({},e.request.headers),t)})})}var L=function(e){return function(t,n){return e.transporter.write({method:D,path:"2/abtests",data:t},n)}},j=function(e){return function(t,n){return e.transporter.write({method:T,path:m("2/abtests/%s",t)},n)}},q=function(e){return function(t,n){return e.transporter.read({method:S,path:m("2/abtests/%s",t)},n)}},M=function(e){return function(t){return e.transporter.read({method:S,path:"2/abtests"},t)}},U=function(e){return function(t,n){return e.transporter.write({method:D,path:m("2/abtests/%s/stop",t)},n)}},z=function(e){return function(t){return e.transporter.read({method:S,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,n){return e.transporter.write({method:D,path:"1/strategies/personalization",data:t},n)}};function H(e){return function t(n){return e.request(n).then((function(r){if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})}))}({})}var W=function(e){return function(t,o){var i=o||{},a=i.queryParameters,s=r(i,["queryParameters"]),c=n({acl:t},void 0!==a?{queryParameters:a}:{});return d(e.transporter.write({method:D,path:"1/keys",data:c},s),(function(t,n){return l((function(r){return ee(e)(t.key,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},B=function(e){return function(t,n,r){var o=g(r);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:D,path:"1/clusters/mapping",data:{cluster:n}},o)}},K=function(e){return function(t,n,r){return e.transporter.write({method:D,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r)}},G=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},n),(function(t,n){return De(e)(t.taskID,n)}))}},Y=function(e){return function(t,n,r){return d(e.transporter.write({method:D,path:m("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},r),(function(n,r){return se(e)(t,{methods:{waitTask:dt}}).waitTask(n.taskID,r)}))}},J=function(e){return function(t,r,o){return Y(e)(t,r,n(n({},o),{},{scope:[pt.Rules]}))}},V=function(e){return function(t,r,o){return Y(e)(t,r,n(n({},o),{},{scope:[pt.Settings]}))}},X=function(e){return function(t,r,o){return Y(e)(t,r,n(n({},o),{},{scope:[pt.Synonyms]}))}},Q=function(e){return function(t,n){return t.method===S?e.transporter.read(t,n):e.transporter.write(t,n)}},$=function(e){return function(t,n){return d(e.transporter.write({method:T,path:m("1/keys/%s",t)},n),(function(n,r){return l((function(n){return ee(e)(t,r).then(n).catch((function(e){if(404!==e.status)throw e}))}))}))}},Z=function(e){return function(t,n,r){var o=n.map((function(e){return{action:"deleteEntry",body:{objectID:e}}}));return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},r),(function(t,n){return De(e)(t.taskID,n)}))}},ee=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/keys/%s",t)},n)}},te=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/task/%s",t.toString())},n)}},ne=function(e){return function(t){return e.transporter.read({method:S,path:"/1/dictionaries/*/settings"},t)}},re=function(e){return function(t){return e.transporter.read({method:S,path:"1/logs"},t)}},oe=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping/top"},t)}},ie=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/clusters/mapping/%s",t)},n)}},ae=function(e){return function(t){var n=t||{},o=n.retrieveMappings,i=r(n,["retrieveMappings"]);return!0===o&&(i.getClusters=!0),e.transporter.read({method:S,path:"1/clusters/mapping/pending"},i)}},se=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},ce=function(e){return function(t){return e.transporter.read({method:S,path:"1/keys"},t)}},ue=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters"},t)}},le=function(e){return function(t){return e.transporter.read({method:S,path:"1/indexes"},t)}},de=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping"},t)}},fe=function(e){return function(t,n,r){return d(e.transporter.write({method:D,path:m("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},r),(function(n,r){return se(e)(t,{methods:{waitTask:dt}}).waitTask(n.taskID,r)}))}},pe=function(e){return function(t,n){return d(e.transporter.write({method:D,path:"1/indexes/*/batch",data:{requests:t}},n),(function(t,n){return Promise.all(Object.keys(t.taskID).map((function(r){return se(e)(r,{methods:{waitTask:dt}}).waitTask(t.taskID[r],n)})))}))}},me=function(e){return function(t,n){return e.transporter.read({method:D,path:"1/indexes/*/objects",data:{requests:t}},n)}},he=function(e){return function(t,r){var o=t.map((function(e){return n(n({},e),{},{params:P(e.params||{})})}));return e.transporter.read({method:D,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)}},ge=function(e){return function(t,o){return Promise.all(t.map((function(t){var i=t.params,a=i.facetName,s=i.facetQuery,c=r(i,["facetName","facetQuery"]);return se(e)(t.indexName,{methods:{searchForFacetValues:st}}).searchForFacetValues(a,s,n(n({},o),c))})))}},ye=function(e){return function(t,n){var r=g(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},r)}},ve=function(e){return function(t,n,r){var o=n.map((function(e){return{action:"addEntry",body:e}}));return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:o}},r),(function(t,n){return De(e)(t.taskID,n)}))}},be=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("1/keys/%s/restore",t)},n),(function(n,r){return l((function(n){return ee(e)(t,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},xe=function(e){return function(t,n,r){var o=n.map((function(e){return{action:"addEntry",body:e}}));return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},r),(function(t,n){return De(e)(t.taskID,n)}))}},we=function(e){return function(t,n,r){return e.transporter.read({method:D,path:m("/1/dictionaries/%s/search",t),data:{query:n},cacheable:!0},r)}},Ee=function(e){return function(t,n){return e.transporter.read({method:D,path:"1/clusters/mapping/search",data:{query:t}},n)}},Te=function(e){return function(t,n){return d(e.transporter.write({method:I,path:"/1/dictionaries/*/settings",data:t},n),(function(t,n){return De(e)(t.taskID,n)}))}},Se=function(e){return function(t,n){var o=Object.assign({},n),i=n||{},a=i.queryParameters,s=r(i,["queryParameters"]),c=a?{queryParameters:a}:{},u=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return d(e.transporter.write({method:I,path:m("1/keys/%s",t),data:c},s),(function(n,r){return l((function(n){return ee(e)(t,r).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==u.indexOf(e)})).every((function(t){if(Array.isArray(e[t])&&Array.isArray(o[t])){var n=e[t];return n.length===o[t].length&&n.every((function(e,n){return e===o[t][n]}))}return e[t]===o[t]}))}(e)?Promise.resolve():n()}))}))}))}},De=function(e){return function(t,n){return l((function(r){return te(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},Ie=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(function(t,n){return dt(e)(t.taskID,n)}))}},ke=function(e){return function(t){return H(n(n({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(n){return e.transporter.read({method:D,path:m("1/indexes/%s/browse",e.indexName),data:n},t)}}))}},Oe=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return ct(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},Ae=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return ut(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},Ne=function(e){return function(t,n,o){var i=o||{},a=i.batchSize,s=r(i,["batchSize"]),c={taskIDs:[],objectIDs:[]};return d(function r(){var o,i=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(i.push(t[o]),i.length!==(a||1e3));o++);return 0===i.length?Promise.resolve(c):Ie(e)(i.map((function(e){return{action:n,body:e}})),s).then((function(e){return c.objectIDs=c.objectIDs.concat(e.objectIDs),c.taskIDs.push(e.taskID),o++,r(o)}))}(),(function(t,n){return Promise.all(t.taskIDs.map((function(t){return dt(e)(t,n)})))}))}},Re=function(e){return function(t){return d(e.transporter.write({method:D,path:m("1/indexes/%s/clear",e.indexName)},t),(function(t,n){return dt(e)(t.taskID,n)}))}},Pe=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,i=g(r(n,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/rules/clear",e.indexName)},i),(function(t,n){return dt(e)(t.taskID,n)}))}},Ce=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,i=g(r(n,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/synonyms/clear",e.indexName)},i),(function(t,n){return dt(e)(t.taskID,n)}))}},_e=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(function(t,n){return dt(e)(t.taskID,n)}))}},Le=function(e){return function(t){return d(e.transporter.write({method:T,path:m("1/indexes/%s",e.indexName)},t),(function(t,n){return dt(e)(t.taskID,n)}))}},je=function(e){return function(t,n){return d(qe(e)([t],n).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,n){return dt(e)(t.taskID,n)}))}},qe=function(e){return function(t,n){var r=t.map((function(e){return{objectID:e}}));return Ne(e)(r,ft.DeleteObject,n)}},Me=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=g(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:T,path:m("1/indexes/%s/rules/%s",e.indexName,t)},a),(function(t,n){return dt(e)(t.taskID,n)}))}},Ue=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=g(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:T,path:m("1/indexes/%s/synonyms/%s",e.indexName,t)},a),(function(t,n){return dt(e)(t.taskID,n)}))}},ze=function(e){return function(t){return Ye(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Fe=function(e){return function(t,n,r){return e.transporter.read({method:D,path:m("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},He=function(e){return function(t,i){var a=i||{},s=a.query,c=a.paginate,u=r(a,["query","paginate"]),l=0;return function r(){return at(e)(s||"",n(n({},u),{},{page:l})).then((function(e){for(var n=0,i=Object.entries(e.hits);n<i.length;n++){var a=o(i[n],2),s=a[0],u=a[1];if(t(u))return{object:u,position:parseInt(s,10),page:l}}if(l++,!1===c||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return r()}))}()}},We=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/%s",e.indexName,t)},n)}},Be=function(){return function(e,t){for(var n=0,r=Object.entries(e.hits);n<r.length;n++){var i=o(r[n],2),a=i[0];if(i[1].objectID===t)return parseInt(a,10)}return-1}},Ke=function(e){return function(t,o){var i=o||{},a=i.attributesToRetrieve,s=r(i,["attributesToRetrieve"]),c=t.map((function(t){return n({indexName:e.indexName,objectID:t},a?{attributesToRetrieve:a}:{})}));return e.transporter.read({method:D,path:"1/indexes/*/objects",data:{requests:c}},s)}},Ge=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/rules/%s",e.indexName,t)},n)}},Ye=function(e){return function(t){return e.transporter.read({method:S,path:m("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Je=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/synonyms/%s",e.indexName,t)},n)}},Ve=function(e){return function(t,n){return d(Xe(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return dt(e)(t.taskID,n)}))}},Xe=function(e){return function(t,n){var o=n||{},i=o.createIfNotExists,a=r(o,["createIfNotExists"]),s=i?ft.PartialUpdateObject:ft.PartialUpdateObjectNoCreate;return Ne(e)(t,s,a)}},Qe=function(e){return function(t,a){var s=a||{},c=s.safe,u=s.autoGenerateObjectIDIfNotExist,l=s.batchSize,f=r(s,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),p=function(t,n,r,o){return d(e.transporter.write({method:D,path:m("1/indexes/%s/operation",t),data:{operation:r,destination:n}},o),(function(t,n){return dt(e)(t.taskID,n)}))},h=Math.random().toString(36).substring(7),g="".concat(e.indexName,"_tmp_").concat(h),y=tt({appId:e.appId,transporter:e.transporter,indexName:g}),v=[],b=p(e.indexName,g,"copy",n(n({},f),{},{scope:["settings","synonyms","rules"]}));return v.push(b),d((c?b.wait(f):b).then((function(){var e=y(t,n(n({},f),{},{autoGenerateObjectIDIfNotExist:u,batchSize:l}));return v.push(e),c?e.wait(f):e})).then((function(){var t=p(g,e.indexName,"move",f);return v.push(t),c?t.wait(f):t})).then((function(){return Promise.all(v)})).then((function(e){var t=o(e,3),n=t[0],r=t[1],a=t[2];return{objectIDs:r.objectIDs,taskIDs:[n.taskID].concat(i(r.taskIDs),[a.taskID])}})),(function(e,t){return Promise.all(v.map((function(e){return e.wait(t)})))}))}},$e=function(e){return function(t,r){return rt(e)(t,n(n({},r),{},{clearExistingRules:!0}))}},Ze=function(e){return function(t,r){return it(e)(t,n(n({},r),{},{clearExistingSynonyms:!0}))}},et=function(e){return function(t,n){return d(tt(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return dt(e)(t.taskID,n)}))}},tt=function(e){return function(t,n){var o=n||{},i=o.autoGenerateObjectIDIfNotExist,a=r(o,["autoGenerateObjectIDIfNotExist"]),s=i?ft.AddObject:ft.UpdateObject;if(s===ft.UpdateObject){var c=!0,u=!1,l=void 0;try{for(var f,p=t[Symbol.iterator]();!(c=(f=p.next()).done);c=!0)if(void 0===f.value.objectID)return d(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){u=!0,l=e}finally{try{c||null==p.return||p.return()}finally{if(u)throw l}}}return Ne(e)(t,s,a)}},nt=function(e){return function(t,n){return rt(e)([t],n)}},rt=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=o.clearExistingRules,s=g(r(o,["forwardToReplicas","clearExistingRules"]));return i&&(s.queryParameters.forwardToReplicas=1),a&&(s.queryParameters.clearExistingRules=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/rules/batch",e.indexName),data:t},s),(function(t,n){return dt(e)(t.taskID,n)}))}},ot=function(e){return function(t,n){return it(e)([t],n)}},it=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=o.clearExistingSynonyms,s=o.replaceExistingSynonyms,c=g(r(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return i&&(c.queryParameters.forwardToReplicas=1),(s||a)&&(c.queryParameters.replaceExistingSynonyms=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/synonyms/batch",e.indexName),data:t},c),(function(t,n){return dt(e)(t.taskID,n)}))}},at=function(e){return function(t,n){return e.transporter.read({method:D,path:m("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},st=function(e){return function(t,n,r){return e.transporter.read({method:D,path:m("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},ct=function(e){return function(t,n){return e.transporter.read({method:D,path:m("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n)}},ut=function(e){return function(t,n){return e.transporter.read({method:D,path:m("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n)}},lt=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=g(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:I,path:m("1/indexes/%s/settings",e.indexName),data:t},a),(function(t,n){return dt(e)(t.taskID,n)}))}},dt=function(e){return function(t,n){return l((function(r){return function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/task/%s",e.indexName,t.toString())},n)}}(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},ft={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},pt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"};function mt(e,t,r){var o={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},i=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(i),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(i),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(i),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},responsesCache:c(),requestsCache:c({serializable:!1}),hostsCache:s({caches:[a({key:"".concat("4.20.0","-").concat(e)}),c()]}),userAgent:N("4.20.0").add({segment:"Browser"})},i=n(n({},o),r),l=function(){return function(e){return function(e){var t=e.region||"us",r=u(h.WithinHeaders,e.appId,e.apiKey),o=A(n(n({hosts:[{url:"personalization.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({appId:e.appId,transporter:o},e.methods)}(n(n(n({},o),e),{},{methods:{getPersonalizationStrategy:z,setPersonalizationStrategy:F}}))}};return function(e){var t=e.appId,r=u(void 0!==e.authMode?e.authMode:h.WithinHeaders,t,e.apiKey),o=A(n(n({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.Write}].concat(f([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(n(n({},i),{},{methods:{search:he,searchForFacetValues:ge,multipleBatch:pe,multipleGetObjects:me,multipleQueries:he,copyIndex:Y,copySettings:V,copySynonyms:X,copyRules:J,moveIndex:fe,listIndices:le,getLogs:re,listClusters:ue,multipleSearchForFacetValues:ge,getApiKey:ee,addApiKey:W,listApiKeys:ce,updateApiKey:Se,deleteApiKey:$,restoreApiKey:be,assignUserID:B,assignUserIDs:K,getUserID:ie,searchUserIDs:Ee,listUserIDs:de,getTopUserIDs:oe,removeUserID:ye,hasPendingMappings:ae,clearDictionaryEntries:G,deleteDictionaryEntries:Z,getDictionarySettings:ne,getAppTask:te,replaceDictionaryEntries:ve,saveDictionaryEntries:xe,searchDictionaryEntries:we,setDictionarySettings:Te,waitAppTask:De,customRequest:Q,initIndex:function(e){return function(t){return se(e)(t,{methods:{batch:Ie,delete:Le,findAnswers:Fe,getObject:We,getObjects:Ke,saveObject:et,saveObjects:tt,search:at,searchForFacetValues:st,waitTask:dt,setSettings:lt,getSettings:Ye,partialUpdateObject:Ve,partialUpdateObjects:Xe,deleteObject:je,deleteObjects:qe,deleteBy:_e,clearObjects:Re,browseObjects:ke,getObjectPosition:Be,findObject:He,exists:ze,saveSynonym:ot,saveSynonyms:it,getSynonym:Je,searchSynonyms:ut,browseSynonyms:Ae,deleteSynonym:Ue,clearSynonyms:Ce,replaceAllObjects:Qe,replaceAllSynonyms:Ze,searchRules:ct,getRule:Ge,deleteRule:Me,saveRule:nt,saveRules:rt,replaceAllRules:$e,browseRules:Oe,clearRules:Pe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",r=u(h.WithinHeaders,e.appId,e.apiKey),o=A(n(n({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({appId:e.appId,transporter:o},e.methods)}(n(n(n({},o),e),{},{methods:{addABTest:L,getABTest:q,getABTests:M,stopABTest:U,deleteABTest:j}}))}},initPersonalization:l,initRecommendation:function(){return function(e){return i.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),l()(e)}}}}))}return mt.version="4.20.0",mt}()},76:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:s}=Object,{apply:c,construct:u}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),u||(u=function(e,t){return new e(...t)});const l=w(Array.prototype.forEach),d=w(Array.prototype.pop),f=w(Array.prototype.push),p=w(String.prototype.toLowerCase),m=w(String.prototype.toString),h=w(String.prototype.match),g=w(String.prototype.replace),y=w(String.prototype.indexOf),v=w(String.prototype.trim),b=w(RegExp.prototype.test),x=E(TypeError);function w(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return c(e,t,r)}}function E(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return u(e,n)}}function T(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function S(t){const n=s(null);for(const[r,i]of e(t))void 0!==o(t,r)&&(n[r]=i);return n}function D(e,t){for(;null!==e;){const n=o(e,t);if(n){if(n.get)return w(n.get);if("function"==typeof n.value)return w(n.value)}e=r(e)}function n(e){return null}return n}const I=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),k=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),O=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),A=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),R=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=i(["#text"]),C=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),_=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),j=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M=a(/<%[\w\W]*|[\w\W]*%>/gm),U=a(/\${[\w\W]*}/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),F=a(/^aria-[\-\w]+$/),H=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=a(/^(?:\w+script|data):/i),B=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:q,ERB_EXPR:M,TMPLIT_EXPR:U,DATA_ATTR:z,ARIA_ATTR:F,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:B,DOCTYPE_NAME:K});const Y=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return null}};function V(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y();const n=e=>V(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:u,Node:w,Element:E,NodeFilter:q,NamedNodeMap:M=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:U,DOMParser:z,trustedTypes:F}=t,W=E.prototype,B=D(W,"cloneNode"),X=D(W,"nextSibling"),Q=D(W,"childNodes"),$=D(W,"parentNode");if("function"==typeof u){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof $&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:se,ERB_EXPR:ce,TMPLIT_EXPR:ue,DATA_ATTR:le,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:pe}=G;let{IS_ALLOWED_URI:me}=G,he=null;const ge=T({},[...I,...k,...O,...N,...P]);let ye=null;const ve=T({},[...C,..._,...L,...j]);let be=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,we=null,Ee=!0,Te=!0,Se=!1,De=!0,Ie=!1,ke=!1,Oe=!1,Ae=!1,Ne=!1,Re=!1,Pe=!1,Ce=!0,_e=!1;const Le="user-content-";let je=!0,qe=!1,Me={},Ue=null;const ze=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Fe=null;const He=T({},["audio","video","img","source","image","track"]);let We=null;const Be=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Ge="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml";let Je=Ye,Ve=!1,Xe=null;const Qe=T({},[Ke,Ge,Ye],m);let $e=null;const Ze=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=S(e),$e=$e=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===$e?m:p,he="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS,tt):ge,ye="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR,tt):ve,Xe="ALLOWED_NAMESPACES"in e?T({},e.ALLOWED_NAMESPACES,m):Qe,We="ADD_URI_SAFE_ATTR"in e?T(S(Be),e.ADD_URI_SAFE_ATTR,tt):Be,Fe="ADD_DATA_URI_TAGS"in e?T(S(He),e.ADD_DATA_URI_TAGS,tt):He,Ue="FORBID_CONTENTS"in e?T({},e.FORBID_CONTENTS,tt):ze,xe="FORBID_TAGS"in e?T({},e.FORBID_TAGS,tt):{},we="FORBID_ATTR"in e?T({},e.FORBID_ATTR,tt):{},Me="USE_PROFILES"in e&&e.USE_PROFILES,Ee=!1!==e.ALLOW_ARIA_ATTR,Te=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Ce=!1!==e.SANITIZE_DOM,_e=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ye,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Te=!1),Re&&(Ne=!0),Me&&(he=T({},[...P]),ye=[],!0===Me.html&&(T(he,I),T(ye,C)),!0===Me.svg&&(T(he,k),T(ye,_),T(ye,j)),!0===Me.svgFilters&&(T(he,O),T(ye,_),T(ye,j)),!0===Me.mathMl&&(T(he,N),T(ye,L),T(ye,j))),e.ADD_TAGS&&(he===ge&&(he=S(he)),T(he,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ye===ve&&(ye=S(ye)),T(ye,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&T(We,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Ue===ze&&(Ue=S(Ue)),T(Ue,e.FORBID_CONTENTS,tt)),je&&(he["#text"]=!0),ke&&T(he,["html","head","body"]),he.table&&(T(he,["tbody"]),delete xe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=J(F,a)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));i&&i(e),nt=e}},at=T({},["mi","mo","mn","ms","mtext"]),st=T({},["foreignobject","desc","title","annotation-xml"]),ct=T({},["title","style","font","a","script"]),ut=T({},k);T(ut,O),T(ut,A);const lt=T({},N);T(lt,R);const dt=function(e){let t=$(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!Xe[e.namespaceURI]&&(e.namespaceURI===Ge?t.namespaceURI===Ye?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(ut[n]):e.namespaceURI===Ke?t.namespaceURI===Ye?"math"===n:t.namespaceURI===Ge?"math"===n&&st[r]:Boolean(lt[n]):e.namespaceURI===Ye?!(t.namespaceURI===Ge&&!st[r])&&!(t.namespaceURI===Ke&&!at[r])&&!lt[n]&&(ct[n]||!ut[n]):!("application/xhtml+xml"!==$e||!Xe[e.namespaceURI]))},ft=function(e){f(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{f(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ye[e])if(Ne||Re)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){let t=null,n=null;if(Ae)e="<remove></remove>"+e;else{const t=h(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===$e&&Je===Ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=Z?Z.createHTML(e):e;if(Je===Ye)try{t=(new z).parseFromString(o,$e)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Ve?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Je===Ye?oe.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},ht=function(e){return ne.call(e.ownerDocument||e,e,q.SHOW_ELEMENT|q.SHOW_COMMENT|q.SHOW_TEXT,null)},gt=function(e){return e instanceof U&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof M)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},yt=function(e){return"function"==typeof w&&e instanceof w},vt=function(e,t,r){ae[e]&&l(ae[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(vt("beforeSanitizeElements",e,null),gt(e))return ft(e),!0;const r=tt(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:he}),e.hasChildNodes()&&!yt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ft(e),!0;if(!he[r]||xe[r]){if(!xe[r]&&wt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(je&&!Ue[r]){const t=$(e)||e.parentNode,n=Q(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(B(n[r],!0),X(e))}return ft(e),!0}return e instanceof E&&!dt(e)?(ft(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&3===e.nodeType&&(t=e.textContent,l([se,ce,ue],(e=>{t=g(t,e," ")})),e.textContent!==t&&(f(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(ft(e),!0)},xt=function(e,t,n){if(Ce&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Te&&!we[t]&&b(le,t));else if(Ee&&b(de,t));else if(!ye[t]||we[t]){if(!(wt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(We[t]);else if(b(me,g(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Fe[e])if(Se&&!b(fe,g(n,pe,"")));else if(n)return!1;return!0},wt=function(e){return e.indexOf("-")>0},Et=function(e){vt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ye};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:c}=i,u=tt(a);let f="value"===a?c:v(c);if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,r),f=r.attrValue,r.forceKeepAttr)continue;if(pt(a,e),!r.keepAttr)continue;if(!De&&b(/\/>/i,f)){pt(a,e);continue}Ie&&l([se,ce,ue],(e=>{f=g(f,e," ")}));const p=tt(e.nodeName);if(xt(p,u,f)){if(!_e||"id"!==u&&"name"!==u||(pt(a,e),f=Le+f),Z&&"object"==typeof F&&"function"==typeof F.getAttributeType)if(s);else switch(F.getAttributeType(p,u)){case"TrustedHTML":f=Z.createHTML(f);break;case"TrustedScriptURL":f=Z.createScriptURL(f)}try{s?e.setAttributeNS(s,a,f):e.setAttribute(a,f),d(n.removed)}catch(e){}}}vt("afterSanitizeAttributes",e,null)},Tt=function e(t){let n=null;const r=ht(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof c&&e(n.content),Et(n));vt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,s=null;if(Ve=!e,Ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!yt(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Oe||it(t),n.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=tt(e.nodeName);if(!he[t]||xe[t])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof w)r=mt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Ne&&!Ie&&!ke&&-1===e.indexOf("<"))return Z&&Pe?Z.createHTML(e):e;if(r=mt(e),!r)return Ne?null:Pe?ee:""}r&&Ae&&ft(r.firstChild);const u=ht(qe?e:r);for(;a=u.nextNode();)bt(a)||(a.content instanceof c&&Tt(a.content),Et(a));if(qe)return e;if(Ne){if(Re)for(s=re.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(ye.shadowroot||ye.shadowrootmode)&&(s=ie.call(o,s,!0)),s}let d=ke?r.outerHTML:r.innerHTML;return ke&&he["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(K,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Ie&&l([se,ce,ue],(e=>{d=g(d,e," ")})),Z&&Pe?Z.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Oe=!0},n.clearConfig=function(){nt=null,Oe=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return xt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],f(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}return V()}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(886),t=n.n(e),r=n(76),o=n.n(r);class i{constructor({appId:e,SearchOnlyAPIKey:t}){this.currentSelectedIndex=-1,this.resultLinks=[],this.initAlgolia(e,t),this.initElements(),this.bindEvents()}initAlgolia(e,n){this.client=t()(e,n),this.index=this.client.initIndex("hex-blog")}initElements(){this.maskElement=this.createElement("div",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgb(255 255 255 / 10%)",zIndex:"1000",display:"none",backdropFilter:"blur(2px) saturate(190%) contrast(50%) brightness(130%)","-webkit-backdrop-filter":"blur(2px) saturate(190%) contrast(50%) brightness(130%)"}),this.maskElement.classList.add("blur-behind","search-mask"),this.parentDiv=this.createElement("div",{position:"absolute",display:"flex",flexDirection:"column",top:"57px",left:"50%",transform:"translateX(-50%)",borderRadius:"8px",boxShadow:"var(--shadow-box)",width:"50%",maxHeight:"60%",border:"1px solid var(--color-border)",background:"var(--color-bg-2)"}),this.searchWrapper=this.createElement("div",{}),this.searchInputElement=this.createElement("input",{outline:"none",border:"0",borderBottom:"1px solid var(--color-border)",width:"100%",fontSize:"18px",color:"var(--color-font)",borderRadius:"8px 8px 0 0",background:"transparent",fontFamily:"var(--font-regular)",padding:"1.2rem",type:"text",placeholder:"搜索关键词"}),this.searchInputElement.setAttribute("placeholder",window.i18n["text-search"]),this.searchResultsDiv=this.createElement("div",{flex:"1",overflowY:"auto",borderRadius:"0 0 8px 8px"}),this.bottomKeycapsDiv=this.createElement("div",{display:"flex",alignItems:"center",padding:"1rem 1.2rem"}),this.bottomKeycapsDiv=this.createStyledElement("div",{display:"flex",alignItems:"center",padding:"1rem 1.2rem"}),this.bottomKeycapsDiv.appendChild(this.createKeyElement("↵")),this.bottomKeycapsDiv.appendChild(this.createTipElement(window.i18n["text-select"])),this.bottomKeycapsDiv.appendChild(this.createKeyElement("↑")),this.bottomKeycapsDiv.appendChild(this.createKeyElement("↓")),this.bottomKeycapsDiv.appendChild(this.createTipElement(window.i18n["text-move"])),this.bottomKeycapsDiv.appendChild(this.createKeyElement("esc")),this.bottomKeycapsDiv.appendChild(this.createTipElement(window.i18n["text-esc"])),this.searchResultsDiv.classList.add("scrollbar-obtrusive"),this.searchWrapper.appendChild(this.searchInputElement),this.parentDiv.append(this.searchWrapper,this.searchResultsDiv,this.bottomKeycapsDiv),this.maskElement.appendChild(this.parentDiv),document.body.appendChild(this.maskElement)}createStyledElement(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t))n.style[e]=r;return n}createKeyElement(e){const t=this.createStyledElement("kbd",{});t.className="key-cap";const n=document.createElement("span");return n.textContent=e,t.appendChild(n),t}createTipElement(e){const t=this.createStyledElement("em",{fontWeight:"300",fontStyle:"initial",fontSize:"12px",color:"var(--color-font-2)",margin:"0 20px 0 6px"});return t.textContent=e,t}createArrowRightSVG(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 20 20"),e.setAttribute("width","12px"),e.setAttribute("height","12px");const t=document.createElementNS("http://www.w3.org/2000/svg","g");t.setAttribute("fill","none");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M7.646 4.147a.5.5 0 0 1 .707-.001l5.484 5.465a.55.55 0 0 1 0 .779l-5.484 5.465a.5.5 0 0 1-.706-.708L12.812 10L7.647 4.854a.5.5 0 0 1-.001-.707z"),n.setAttribute("fill","currentColor"),t.appendChild(n),e.appendChild(t),e}createElement(e,t){const n=document.createElement(e);return Object.assign(n.style,t),n}show(){this.maskElement.style.display="block",this.searchInputElement.focus()}hide(){this.maskElement.style.display="none"}bindEvents(){this.maskElement.addEventListener("click",(e=>{e.target===this.maskElement?this.hide():this.searchInputElement.focus()})),this.searchInputElement.addEventListener("input",(()=>this.performSearch())),document.addEventListener("keydown",(e=>{"block"===this.maskElement.style.display&&this.handleKeydown(e),"Escape"===e.key&&this.hide()}))}performSearch(){const e=this.searchInputElement.value;e?this.index.search(e).then((({hits:t})=>{if(this.searchResultsDiv.innerHTML="",this.currentSelectedIndex=-1,this.resultLinks=[],0===t.length)return this.searchResultsDiv.style.display="none";t.forEach(((t,n)=>{const r=this.createResultLink(t,e,n);this.searchResultsDiv.appendChild(r),this.resultLinks.push(r)})),this.searchResultsDiv.style.display="block"})):this.searchResultsDiv.style.display="none"}createResultLink(e,t,n){var r,o;const i=this.createElement("a",{margin:"10px 0 0 0",display:"block",padding:"0 10px",textDecoration:"none"});i.href=e.permalink;const a=this.createElement("div",{fontFamily:"var(--font-regular)",padding:"8px",borderRadius:"var(--radius)",transition:"all .25s ease"}),s=this.createElement("span",{display:"flex",alignItems:"center",fontSize:"12px",color:"var(--color-font-2)"}),c=this.createElement("span",{padding:"0 0 0 5px",fontSize:"13px",letterSpacing:"1px",fontWeight:"300",color:"var(--color-font)"});c.textContent=e.title,s.append(e.categories[0],this.createArrowRightSVG(),c);const u=this.createElement("div",{paddingTop:"6px",fontFamily:"var(--font-regular)",color:"var(--color-font-2)",whiteSpace:"nowrap",lineHeight:"1.2",overflow:"hidden",textOverflow:"ellipsis",fontSize:"12px"});return u.innerHTML=this.highlightKeyword(null!==(o=null!==(r=e.content)&&void 0!==r?r:e.contentStrip)&&void 0!==o?o:e.contentStripTruncate,t),a.append(s,u),i.append(a),i.addEventListener("mouseenter",(()=>{this.updateCurrentSelectedIndex(n)})),i.addEventListener("mouseleave",(()=>{i.children[0].style.backgroundColor="transparent"})),i}highlightKeyword(e,t){return o().sanitize(e,{ALLOWED_TAGS:["em","strong","b","i"]}).replace(new RegExp(t,"g"),`<mark style="margin:0 3px;background:transparent;color:var(--color-primary);text-decoration:underline">${t}</mark>`)}updateCurrentSelectedIndex(e){if(-1!==this.currentSelectedIndex){this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="transparent"}this.currentSelectedIndex=e;this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="var(--color-primary-2)"}handleKeydown(e){switch(e.key){case"ArrowUp":this.moveSelection(-1),e.preventDefault();break;case"ArrowDown":this.moveSelection(1),e.preventDefault();break;case"Enter":-1!==this.currentSelectedIndex&&(window.location.href=this.resultLinks[this.currentSelectedIndex].href)}}ensureActiveLinkVisible(){const e=this.resultLinks[this.currentSelectedIndex];if(!e)return;if(0===this.currentSelectedIndex)return void(this.searchResultsDiv.scrollTop=0);const t=e.offsetTop,n=e.offsetHeight,r=this.searchResultsDiv.scrollTop,o=this.searchResultsDiv.offsetHeight;t<r?this.searchResultsDiv.scrollTop=t:t+n>r+o&&(this.searchResultsDiv.scrollTop=t+n-o)}moveSelection(e){if(-1!==this.currentSelectedIndex){this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="transparent"}this.currentSelectedIndex=Math.max(0,Math.min(this.currentSelectedIndex+e,this.resultLinks.length-1));this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="var(--color-primary-2)",this.ensureActiveLinkVisible()}}document.addEventListener("DOMContentLoaded",(()=>{var e;if("true"===window.search.enable){const t=new i({appId:window.algolia.appId,SearchOnlyAPIKey:window.algolia.SearchOnlyAPIKey});document.addEventListener("keydown",(e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),t.show())})),null===(e=document.querySelector(".search-group"))||void 0===e||e.addEventListener("click",(function(){t.show()}))}}))})()})();