diff --git a/build/index.asset.php b/build/index.asset.php
index 2e68272..74e8883 100644
--- a/build/index.asset.php
+++ b/build/index.asset.php
@@ -1 +1 @@
- array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'df55f6ced101179f1862');
+ array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '9f695924420aef9082a5');
diff --git a/build/index.css b/build/index.css
index a33db3e..8acd1b6 100644
--- a/build/index.css
+++ b/build/index.css
@@ -1 +1 @@
-#nfd-help-center .modal{padding-bottom:32px}#nfd-help-center .modal h3,#nfd-help-center .modal h4{margin:0}#nfd-help-center .modal .modal-header{display:flex;justify-content:space-between;padding:16px}#nfd-help-center .modal .modal-header .heading{align-items:center;color:#394150;display:flex;font-size:20px;font-weight:400;line-height:24px}#nfd-help-center .modal .modal-header .heading .icon{margin-right:10px;padding-top:3px}#nfd-help-center .modal .modal-header .close-button{background:none;border:0}.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-button{padding-left:6px;padding-right:6px}.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-question{padding-top:8px}.nfd-help-center{padding:0 16px;z-index:10}.nfd-help-center p{font-size:14px}.nfd-help-center p br{content:"";display:block;margin-bottom:5px}.nfd-help-center h3,.nfd-help-center h4{margin:0}.nfd-help-center .launch-help-center{text-align:center}.nfd-help-center .launch-help-center .launch-description{margin:24px 0}.nfd-help-center .launch-help-center .launch-action{align-items:center;display:flex;justify-content:center}.nfd-help-center .launch-help-center button{background-color:#196bde;border:1px solid #196bde;color:#fff;cursor:grab;height:36px;width:146px}.nfd-help-center .launch-help-center p{font-size:18px}.nfd-help-center .launch-help-center a{cursor:grab;display:block;margin-top:16px}.nfd-help-center .suggestions-container .section-header{margin-bottom:8px!important}.nfd-help-center .suggestions-container .article .description,.nfd-help-center .suggestions-container .video .description{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;line-height:1.2em;margin:8px 0;overflow:hidden;text-overflow:ellipsis}.nfd-help-center .suggestions-container .article:hover,.nfd-help-center .suggestions-container .video:hover{background:rgba(57,172,229,.1)}.nfd-help-center .suggestion[data-variant=video] iframe{height:146px;width:248px}.nfd-help-center .search-container{background-color:#f0f3f5;border-radius:8px;display:flex;height:42px;margin:16px 0 0;padding-right:5px}.nfd-help-center .search-container input{background-color:#f0f3f5;border:none;color:#1d1d1f;font-size:15px;padding-left:0}.nfd-help-center .search-container input:focus{box-shadow:none;outline:none}.nfd-help-center .search-container button{background-color:#f0f3f5;background:transparent;border:none;box-shadow:none;cursor:text;padding-top:3px}.nfd-help-center .attribute{color:#394150;display:flex;justify-content:flex-end;margin-top:0;padding-left:2px;padding-right:2px}.nfd-help-center .attribute span{color:#394150;font-size:12px;font-weight:500;line-height:14px;text-align:right}.nfd-help-center .algoliaResult{border-radius:24px;box-shadow:0 0 0 1px #dddfe0;box-sizing:border-box;color:#394150;cursor:pointer;display:flex;justify-content:space-between;margin-bottom:8px;padding:12px 16px;position:relative;transition:box-shadow .2s ease}.nfd-help-center .algoliaResult p{margin:0}.nfd-help-center .algoliaResult .svg{align-items:center;display:flex;justify-content:center;transform:translateX(0);transition:transform .2s ease}.nfd-help-center .algoliaResult:hover{box-shadow:0 0 0 2px #3575d3}.nfd-help-center .algoliaResult:hover .svg{transform:translateX(2px)}.nfd-help-center .feedback-container{background-color:#f0f3f5;border-radius:4px;display:flex;justify-content:space-between;margin-bottom:8%;margin-top:6%;padding-left:4%;padding-right:4%}.nfd-help-center .feedback-container button{border-color:#b2bcc2;border-radius:20px;border-width:1px;box-shadow:none;cursor:pointer;padding-bottom:5%;padding-top:5%}.nfd-help-center .feedback-container .feedback-button{flex-shrink:0;padding:6px 13px;white-space:nowrap}.nfd-help-center .feedback-container .button-icon{height:20px;margin-right:4px;width:20px}.nfd-help-center .feedback-container .yes{border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.nfd-help-center .feedback-container .no{border-bottom-left-radius:0;border-top-left-radius:0}.nfd-help-center .feedback-container .selected-yes{background:#e6fff4;padding-bottom:4.4px;padding-top:5.8px}.nfd-help-center .feedback-container .selected-no{background-color:#ffdcdc;padding-bottom:4.4px;padding-top:5.8px}.nfd-help-center .feedback-container .icon{align-items:center;cursor:pointer;display:flex}.help-container{background:#fff;border:1px solid #dcdcdc;box-shadow:-5px 0 36px rgba(0,0,0,.25);display:block!important;height:100vh;overflow:auto;position:fixed;right:0;width:350px;z-index:100}.wpcontent-container{display:flex}@media screen and (min-width:1814px){.toplevel_page_bluehost .wpcontent-container{display:flex}.toplevel_page_bluehost .wpcontent-container #wpbody{flex:1}.toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app{margin-left:20px!important}.toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app #bluehost-logo-wrap{padding:14px 0 0 12px}}body:is(.page,.post-php,.post-new-php) #wp-admin-bar-help-center{display:none}.mobile #wpadminbar ul#wp-admin-bar-root-default li{width:40px!important}.mobile #wpadminbar li#wp-admin-bar-help-center{display:block}.icon-button{cursor:pointer}
+#nfd-help-center .modal{padding-bottom:32px}#nfd-help-center .modal h3,#nfd-help-center .modal h4{margin:0}#nfd-help-center .modal .modal-header{display:flex;justify-content:space-between;padding:16px}#nfd-help-center .modal .modal-header .heading{align-items:center;color:#394150;display:flex;font-size:20px;font-weight:400;line-height:24px}#nfd-help-center .modal .modal-header .heading .icon{margin-right:10px;padding-top:3px}#nfd-help-center .modal .modal-header .close-button{background:none;border:0}.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-button{padding-left:6px;padding-right:6px}.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-question{padding-top:8px}.nfd-help-center{padding:0 16px;z-index:10}.nfd-help-center p{font-size:14px}.nfd-help-center p br{content:"";display:block;margin-bottom:5px}.nfd-help-center h3,.nfd-help-center h4{margin:0}.nfd-help-center .launch-help-center{text-align:center}.nfd-help-center .launch-help-center .launch-description{margin:24px 0}.nfd-help-center .launch-help-center .launch-action{align-items:center;display:flex;justify-content:center}.nfd-help-center .launch-help-center button{background-color:#196bde;border:1px solid #196bde;color:#fff;cursor:grab;height:36px;width:146px}.nfd-help-center .launch-help-center p{font-size:18px}.nfd-help-center .launch-help-center a{cursor:grab;display:block;margin-top:16px}.nfd-help-center .suggestions-container .section-header{margin-bottom:8px!important}.nfd-help-center .suggestions-container .article .description,.nfd-help-center .suggestions-container .video .description{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;line-height:1.2em;margin:8px 0;overflow:hidden;text-overflow:ellipsis}.nfd-help-center .suggestions-container .article:hover,.nfd-help-center .suggestions-container .video:hover{background:rgba(57,172,229,.1)}.nfd-help-center .suggestion[data-variant=video] iframe{height:146px;width:248px}.nfd-help-center .search-container{background-color:#f0f3f5;border-radius:8px;display:flex;height:42px;margin:16px 0 0;padding-right:5px}.nfd-help-center .search-container input{background-color:#f0f3f5;border:none;color:#1d1d1f;font-size:15px;padding-left:0}.nfd-help-center .search-container input:focus{box-shadow:none;outline:none}.nfd-help-center .search-container button{background-color:#f0f3f5;background:transparent;border:none;box-shadow:none;cursor:text;padding-top:3px}.nfd-help-center .attribute{color:#394150;display:flex;justify-content:flex-end;margin-top:0;padding-left:2px;padding-right:2px}.nfd-help-center .attribute span{color:#394150;font-size:12px;font-weight:500;line-height:14px;text-align:right}.nfd-help-center .algoliaResult{border-radius:24px;box-shadow:0 0 0 1px #dddfe0;box-sizing:border-box;color:#394150;cursor:pointer;display:flex;justify-content:space-between;margin-bottom:8px;padding:12px 16px;position:relative;transition:box-shadow .2s ease}.nfd-help-center .algoliaResult p{margin:0}.nfd-help-center .algoliaResult .svg{align-items:center;display:flex;justify-content:center;transform:translateX(0);transition:transform .2s ease}.nfd-help-center .algoliaResult:hover{box-shadow:0 0 0 2px #3575d3}.nfd-help-center .algoliaResult:hover .svg{transform:translateX(2px)}.nfd-help-center .feedback-container{background-color:#f0f3f5;border-radius:4px;display:flex;justify-content:space-between;margin-bottom:8%;margin-top:6%;padding-left:4%;padding-right:4%}.nfd-help-center .feedback-container button{border-color:#b2bcc2;border-radius:20px;border-width:1px;box-shadow:none;cursor:pointer;padding-bottom:5%;padding-top:5%}.nfd-help-center .feedback-container .feedback-button{flex-shrink:0;padding:6px 13px;white-space:nowrap}.nfd-help-center .feedback-container .feedback-button .feedback-button-emoji{margin-right:5px}.nfd-help-center .feedback-container .button-icon{height:20px;margin-right:4px;width:20px}.nfd-help-center .feedback-container .yes{border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.nfd-help-center .feedback-container .no{border-bottom-left-radius:0;border-top-left-radius:0}.nfd-help-center .feedback-container .selected-yes{background:#e6fff4;padding-bottom:4.4px;padding-top:5.8px}.nfd-help-center .feedback-container .selected-no{background-color:#ffdcdc;padding-bottom:4.4px;padding-top:5.8px}.nfd-help-center .feedback-container .icon{align-items:center;cursor:pointer;display:flex}.help-container{background:#fff;border:1px solid #dcdcdc;box-shadow:-5px 0 36px rgba(0,0,0,.25);display:block!important;height:100vh;overflow:auto;position:fixed;right:0;width:350px;z-index:100}.wpcontent-container{display:flex}@media screen and (min-width:1814px){.toplevel_page_bluehost .wpcontent-container{display:flex}.toplevel_page_bluehost .wpcontent-container #wpbody{flex:1}.toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app{margin-left:20px!important}.toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app #bluehost-logo-wrap{padding:14px 0 0 12px}}body:is(.page,.post-php,.post-new-php) #wp-admin-bar-help-center{display:none}.mobile #wpadminbar ul#wp-admin-bar-root-default li{width:40px!important}.mobile #wpadminbar li#wp-admin-bar-help-center{display:block}.icon-button{cursor:pointer}
diff --git a/build/index.js b/build/index.js
index 1ee56ab..0042a36 100644
--- a/build/index.js
+++ b/build/index.js
@@ -1 +1,83 @@
-(()=>{var e={7331:e=>{function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function r(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,a,o,s,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(i(a=this._events[e]))return!1;if(n(a))switch(arguments.length){case 1:a.call(this);break;case 2:a.call(this,arguments[1]);break;case 3:a.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),a.apply(this,s)}else if(r(a))for(s=Array.prototype.slice.call(arguments,1),o=(u=a.slice()).length,c=0;c0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,a,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(i=this._events[e]).length,a=-1,i===t||n(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(r(i)){for(s=o;s-- >0;)if(i[s]===t||i[s].listener&&i[s].listener===t){a=s;break}if(a<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},8131:(e,t,n)=>{"use strict";var r=n(9374),i=n(7775),a=n(3076);function o(e,t,n){return new r(e,t,n)}o.version=n(4336),o.AlgoliaSearchHelper=r,o.SearchParameters=i,o.SearchResults=a,e.exports=o},8078:(e,t,n)=>{"use strict";var r=n(7331);function i(e,t){this.main=e,this.fn=t,this.lastResults=null}n(4853)(i,r),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},e.exports=i},2437:(e,t,n)=>{"use strict";var r=n(2344),i=n(116),a=n(9803),o={addRefinement:function(e,t,n){if(o.isRefined(e,t,n))return e;var i=""+n,a=e[t]?e[t].concat(i):[i],s={};return s[t]=a,r({},s,e)},removeRefinement:function(e,t,n){if(void 0===n)return o.clearRefinement(e,(function(e,n){return t===n}));var r=""+n;return o.clearRefinement(e,(function(e,n){return t===n&&r===e}))},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return o.isRefined(e,t,n)?o.removeRefinement(e,t,n):o.addRefinement(e,t,n)},clearRefinement:function(e,t,n){if(void 0===t)return i(e)?{}:e;if("string"==typeof t)return a(e,[t]);if("function"==typeof t){var r=!1,o=Object.keys(e).reduce((function(i,a){var o=e[a]||[],s=o.filter((function(e){return!t(e,a,n)}));return s.length!==o.length&&(r=!0),i[a]=s,i}),{});return r?o:e}},isRefined:function(e,t,n){var r=Boolean(e[t])&&e[t].length>0;if(void 0===n||!r)return r;var i=""+n;return-1!==e[t].indexOf(i)}};e.exports=o},7775:(e,t,n)=>{"use strict";var r=n(2344),i=n(7888),a=n(2686),o=n(185),s=n(116),c=n(9803),u=n(8023),l=n(6801),f=n(2437);function h(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,n){return h(t[n],e)})):e===t}function p(e){var t=e?p._parseNumbers(e):{};void 0===t.userToken||l(t.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var n=this;Object.keys(t).forEach((function(e){var r=-1!==p.PARAMETERS.indexOf(e),i=void 0!==t[e];!r&&i&&(n[e]=t[e])}))}p.PARAMETERS=Object.keys(new p),p._parseNumbers=function(e){if(e instanceof p)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(n){var r=e[n];if("string"==typeof r){var i=parseFloat(r);t[n]=isNaN(i)?r:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var n={};Object.keys(e.numericRefinements).forEach((function(t){var r=e.numericRefinements[t]||{};n[t]={},Object.keys(r).forEach((function(e){var i=r[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));n[t][e]=i}))})),t.numericRefinements=n}return o({},e,t)},p.make=function(e){var t=new p(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var n=t.getHierarchicalRefinement(e.name);n.length>0&&0!==n[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(n=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},p.validate=function(e,t){var n=t||{};return e.tagFilters&&n.tagRefinements&&n.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&n.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&n.numericRefinements&&s(n.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):s(e.numericRefinements)&&n.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},p.prototype={constructor:p,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r=u(n);if(this.isNumericRefined(e,t,r))return this;var i=o({},this.numericRefinements);return i[e]=o({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(r)):i[e][t]=[r],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,n){var r=n;return void 0!==r?this.isNumericRefined(e,t,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,i){return i===e&&n.op===t&&h(n.val,u(r))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,r){return r===e&&n.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,n){return n===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return s(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return c(this.numericRefinements,[e]);if("function"==typeof e){var t=!1,n=this.numericRefinements,r=Object.keys(n).reduce((function(r,i){var a=n[i],o={};return a=a||{},Object.keys(a).forEach((function(n){var r=a[n]||[],s=[];r.forEach((function(t){e({val:t,op:n},i,"numeric")||s.push(t)})),s.length!==r.length&&(t=!0),o[n]=s})),r[i]=o,r}),{});return t?r:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),i={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?i[e]=[]:i[e]=[t.slice(0,t.lastIndexOf(n))]:i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:r({},i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var n={};return n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:r({},n,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:r({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var n=this.getHierarchicalRefinement(e);return t?-1!==n.indexOf(t):n.length>0},isNumericRefined:function(e,t,n){if(void 0===n&&void 0===t)return Boolean(this.numericRefinements[e]);var r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===n||!r)return r;var a,o,s=u(n),c=void 0!==(a=this.numericRefinements[e][t],o=s,i(a,(function(e){return h(e,o)})));return r&&c},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0}))).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},n=this;return Object.keys(this).forEach((function(r){var i=n[r];-1===e.indexOf(r)&&void 0!==i&&(t[r]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){if(!e)return this;var t=p.validate(this,e);if(t)throw t;var n=this,r=p._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=n[t],e}),{}),a=Object.keys(r).reduce((function(e,t){var n=void 0!==e[t],i=void 0!==r[t];return n&&!i?c(e,[t]):(i&&(e[t]=r[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return i(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(n).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=p},210:(e,t,n)=>{"use strict";e.exports=function(e){return function(t,n){var r=e.hierarchicalFacets[n],u=e.hierarchicalFacetsRefinements[r.name]&&e.hierarchicalFacetsRefinements[r.name][0]||"",l=e._getHierarchicalFacetSeparator(r),f=e._getHierarchicalRootPath(r),h=e._getHierarchicalShowParentLevel(r),p=a(e._getHierarchicalFacetSortBy(r)),d=t.every((function(e){return e.exhaustive})),m=function(e,t,n,r,a){return function(u,l,f){var h=u;if(f>0){var p=0;for(h=u;p{"use strict";var r=n(4587),i=n(2344),a=n(4039),o=n(7888),s=n(9725),c=n(2293),u=n(185),l=n(2148),f=a.escapeFacetValue,h=a.unescapeFacetValue,p=n(210);function d(e){var t={};return e.forEach((function(e,n){t[e]=n})),t}function m(e,t,n){t&&t[n]&&(e.stats=t[n])}function y(e,t,n){var a=t[0];this._rawResults=t;var c=this;Object.keys(a).forEach((function(e){c[e]=a[e]})),Object.keys(n||{}).forEach((function(e){c[e]=n[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var l=e.getRefinedDisjunctiveFacets(),f=d(e.facets),y=d(e.disjunctiveFacets),v=1,g=a.facets||{};Object.keys(g).forEach((function(t){var n,r,i=g[t],u=(n=e.hierarchicalFacets,r=t,o(n,(function(e){return(e.attributes||[]).indexOf(r)>-1})));if(u){var l=u.attributes.indexOf(t),h=s(e.hierarchicalFacets,(function(e){return e.name===u.name}));c.hierarchicalFacets[h][l]={attribute:t,data:i,exhaustive:a.exhaustiveFacetsCount}}else{var p,d=-1!==e.disjunctiveFacets.indexOf(t),v=-1!==e.facets.indexOf(t);d&&(p=y[t],c.disjunctiveFacets[p]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},m(c.disjunctiveFacets[p],a.facets_stats,t)),v&&(p=f[t],c.facets[p]={name:t,data:i,exhaustive:a.exhaustiveFacetsCount},m(c.facets[p],a.facets_stats,t))}})),this.hierarchicalFacets=r(this.hierarchicalFacets),l.forEach((function(n){var r=t[v],o=r&&r.facets?r.facets:{},l=e.getHierarchicalFacetByName(n);Object.keys(o).forEach((function(t){var n,f=o[t];if(l){n=s(e.hierarchicalFacets,(function(e){return e.name===l.name}));var p=s(c.hierarchicalFacets[n],(function(e){return e.attribute===t}));if(-1===p)return;c.hierarchicalFacets[n][p].data=u({},c.hierarchicalFacets[n][p].data,f)}else{n=y[t];var d=a.facets&&a.facets[t]||{};c.disjunctiveFacets[n]={name:t,data:i({},f,d),exhaustive:r.exhaustiveFacetsCount},m(c.disjunctiveFacets[n],r.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(r){!c.disjunctiveFacets[n].data[r]&&e.disjunctiveFacetsRefinements[t].indexOf(h(r))>-1&&(c.disjunctiveFacets[n].data[r]=0)}))}})),v++})),e.getRefinedHierarchicalFacets().forEach((function(n){var r=e.getHierarchicalFacetByName(n),a=e._getHierarchicalFacetSeparator(r),o=e.getHierarchicalRefinement(n);0===o.length||o[0].split(a).length<2||t.slice(v).forEach((function(t){var n=t&&t.facets?t.facets:{};Object.keys(n).forEach((function(t){var u=n[t],l=s(e.hierarchicalFacets,(function(e){return e.name===r.name})),f=s(c.hierarchicalFacets[l],(function(e){return e.attribute===t}));if(-1!==f){var h={};if(o.length>0){var p=o[0].split(a)[0];h[p]=c.hierarchicalFacets[l][f].data[p]}c.hierarchicalFacets[l][f].data=i(h,u,c.hierarchicalFacets[l][f].data)}})),v++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var n=e.facetsExcludes[t],r=f[t];c.facets[r]={name:t,data:g[t],exhaustive:a.exhaustiveFacetsCount},n.forEach((function(e){c.facets[r]=c.facets[r]||{name:t},c.facets[r].data=c.facets[r].data||{},c.facets[r].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(p(e)),this.facets=r(this.facets),this.disjunctiveFacets=r(this.disjunctiveFacets),this._state=e}function v(e,t){function n(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var r=o(e.facets,n);return r?Object.keys(r.data).map((function(n){var i=f(n);return{name:n,escapedValue:i,count:r.data[n],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,n)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=o(e.disjunctiveFacets,n);return i?Object.keys(i.data).map((function(n){var r=f(n);return{name:n,escapedValue:r,count:i.data[n],isRefined:e._state.isDisjunctiveFacetRefined(t,r)}})):[]}if(e._state.isHierarchicalFacet(t)){var a=o(e.hierarchicalFacets,n);if(!a)return a;var s=e._state.getHierarchicalFacetByName(t),c=e._state._getHierarchicalFacetSeparator(s),u=h(e._state.getHierarchicalRefinement(t)[0]||"");0===u.indexOf(s.rootPath)&&(u=u.replace(s.rootPath+c,""));var l=u.split(c);return l.unshift(t),g(a,l,0),a}}function g(e,t,n){e.isRefined=e.name===t[n],e.data&&e.data.forEach((function(e){g(e,t,n+1)}))}function b(e,t,n,r){if(r=r||0,Array.isArray(t))return e(t,n[r]);if(!t.data||0===t.data.length)return t;var a=t.data.map((function(t){return b(e,t,n,r+1)})),o=e(a,n[r]);return i({data:o},t)}function A(e,t){var n=o(e,(function(e){return e.name===t}));return n&&n.stats}function w(e,t,n,r,i){var a=o(i,(function(e){return e.name===n})),s=a&&a.data&&a.data[r]?a.data[r]:0,c=a&&a.exhaustive||!1;return{type:t,attributeName:n,name:r,count:s,exhaustive:c}}y.prototype.getFacetByName=function(e){function t(t){return t.name===e}return o(this.facets,t)||o(this.disjunctiveFacets,t)||o(this.hierarchicalFacets,t)},y.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],y.prototype.getFacetValues=function(e,t){var n=v(this,e);if(n){var r=i({},t,{sortBy:y.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),a=this;return b((function(e,t){if(r.facetOrdering){var n=function(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}(a,t);if(n)return function(e,t){var n=[],r=[],i=(t.order||[]).reduce((function(e,t,n){return e[t]=n,e}),{});e.forEach((function(e){var t=e.path||e.name;void 0!==i[t]?n[i[t]]=e:r.push(e)})),n=n.filter((function(e){return e}));var a,o=t.sortRemainingBy;return"hidden"===o?n:(a="alpha"===o?[["path","name"],["asc","asc"]]:[["count"],["desc"]],n.concat(l(r,a[0],a[1])))}(e,n)}if(Array.isArray(r.sortBy)){var i=c(r.sortBy,y.DEFAULT_SORT);return l(e,i[0],i[1])}if("function"==typeof r.sortBy)return function(e,t){return t.sort(e)}(r.sortBy,e);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),n,Array.isArray(n)?[e]:a._state.getHierarchicalFacetByName(n.name).attributes)}},y.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?A(this.facets,e):this._state.isDisjunctiveFacet(e)?A(this.disjunctiveFacets,e):void 0},y.prototype.getRefinements=function(){var e=this._state,t=this,n=[];return Object.keys(e.facetsRefinements).forEach((function(r){e.facetsRefinements[r].forEach((function(e){n.push(w(0,"facet",r,e,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(r){e.facetsExcludes[r].forEach((function(e){n.push(w(0,"exclude",r,e,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(r){e.disjunctiveFacetsRefinements[r].forEach((function(e){n.push(w(0,"disjunctive",r,e,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(r){e.hierarchicalFacetsRefinements[r].forEach((function(i){n.push(function(e,t,n,r){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),s=n.split(a),c=o(r,(function(e){return e.name===t})),u=s.reduce((function(e,t){var n=e&&o(e.data,(function(e){return e.name===t}));return void 0!==n?n:e}),c),l=u&&u.count||0,f=u&&u.exhaustive||!1,h=u&&u.path||"";return{type:"hierarchical",attributeName:t,name:h,count:l,exhaustive:f}}(e,r,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var r=e.numericRefinements[t];Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.push({type:"numeric",attributeName:t,name:r,numericValue:r,operator:e})}))}))})),e.tagRefinements.forEach((function(e){n.push({type:"tag",attributeName:"_tags",name:e})})),n},e.exports=y},9374:(e,t,n)=>{"use strict";var r=n(7331),i=n(8078),a=n(4039).escapeFacetValue,o=n(4853),s=n(185),c=n(116),u=n(9803),l=n(6394),f=n(7775),h=n(3076),p=n(4336);function d(e,t,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+p+")"),this.setClient(e);var r=n||{};r.index=t,this.state=f.make(r),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function m(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function y(){return this.state.page}o(d,r),d.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},d.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},d.prototype.getQuery=function(){var e=this.state;return l._getHitsSearchParams(e)},d.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,r=l._getQueries(n.index,n),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(r).then((function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new h(n,e.results),state:n,_originalResponse:e}}),(function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e}));this.client.search(r).then((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new h(n,e.results),n)})).catch((function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,n)}))},d.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,n=this.derivedHelpers[0];if(!n)return Promise.resolve([]);var r=n.getModifiedState(t),i=s({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:u(l._getHitsSearchParams(r),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var o=this.client.initIndex(r.index);if("function"!=typeof o.findAnswers)throw new Error(a);return o.findAnswers(r.query,e.queryLanguages,i)},d.prototype.searchForFacetValues=function(e,t,n,r){var i="function"==typeof this.client.searchForFacetValues,o="function"==typeof this.client.initIndex;if(!i&&!o&&"function"!=typeof this.client.search)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var s=this.state.setQueryParameters(r||{}),c=s.isDisjunctiveFacet(e),u=l.getSearchForFacetQuery(e,t,n,s);this._currentNbQueries++;var f,h=this;return i?f=this.client.searchForFacetValues([{indexName:s.index,params:u}]):o?f=this.client.initIndex(s.index).searchForFacetValues(u):(delete u.facetName,f=this.client.search([{type:"facet",facet:e,indexName:s.index,params:u}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:s,facet:e,query:t}),f.then((function(t){return h._currentNbQueries--,0===h._currentNbQueries&&h.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=a(t.value),t.isRefined=c?s.isDisjunctiveFacetRefined(e,t.escapedValue):s.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw h._currentNbQueries--,0===h._currentNbQueries&&h.emit("searchQueueEmpty"),e}))},d.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},d.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},d.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},d.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},d.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},d.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},d.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},d.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},d.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},d.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},d.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},d.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},d.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},d.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},d.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},d.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},d.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},d.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},d.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},d.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},d.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},d.prototype.setCurrentPage=m,d.prototype.setPage=m,d.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},d.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},d.prototype.setState=function(e){return this._change({state:f.make(e),isPageReset:!1}),this},d.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new f(e),this},d.prototype.hasRefinements=function(e){return!!c(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},d.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},d.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},d.prototype.hasTag=function(e){return this.state.isTagRefined(e)},d.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},d.prototype.getIndex=function(){return this.state.index},d.prototype.getCurrentPage=y,d.prototype.getPage=y,d.prototype.getTags=function(){return this.state.tagRefinements},d.prototype.getRefinements=function(e){var t=[];this.state.isConjunctiveFacet(e)?(this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}))):this.state.isDisjunctiveFacet(e)&&this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}));var n=this.state.getNumericRefinements(e);return Object.keys(n).forEach((function(e){var r=n[e];t.push({value:r,operator:e,type:"numeric"})})),t},d.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},d.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},d.prototype._search=function(e){var t=this.state,n=[],r=[];e.onlyWithDerivedHelpers||(r=l._getQueries(t.index,t),n.push({state:t,queriesCount:r.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var r=e.getModifiedState(t),i=r.index?l._getQueries(r.index,r):[];return n.push({state:r,queriesCount:i.length,helper:e}),e.emit("search",{state:r,results:e.lastResults}),i})),a=Array.prototype.concat.apply(r,i),o=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,n,o));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,n,o)).catch(this._dispatchAlgoliaError.bind(this,o))}catch(e){this.emit("error",{error:e})}},d.prototype._dispatchAlgoliaResponse=function(e,t,n){if(!(t0},d.prototype._change=function(e){var t=e.state,n=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:n}))},d.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},d.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+p+")"),this.client=e),this},d.prototype.getClient=function(){return this.client},d.prototype.derive=function(e){var t=new i(this,e);return this.derivedHelpers.push(t),t},d.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},d.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=d},4587:e=>{"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},2344:e=>{"use strict";e.exports=function(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(n){void 0!==t[n]&&(void 0!==e[n]&&delete e[n],e[n]=t[n])})),e}),{})}},4039:e=>{"use strict";e.exports={escapeFacetValue:function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},unescapeFacetValue:function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")}}},7888:e=>{"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var n=0;n{"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var n=0;n{"use strict";var r=n(7888);e.exports=function(e,t){var n=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=r(n,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},4853:e=>{"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},2686:e=>{"use strict";e.exports=function(e,t){return e.filter((function(n,r){return t.indexOf(n)>-1&&e.indexOf(n)===r}))}},185:e=>{"use strict";function t(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function n(e,r){if(e===r)return e;for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&"__proto__"!==i&&"constructor"!==i){var a=r[i],o=e[i];void 0!==o&&void 0===a||(t(o)&&t(a)?e[i]=n(o,a):e[i]="object"==typeof(s=a)&&null!==s?n(Array.isArray(s)?[]:{},s):s)}var s;return e}e.exports=function(e){t(e)||(e={});for(var r=1,i=arguments.length;r{"use strict";e.exports=function(e){return e&&Object.keys(e).length>0}},9803:e=>{"use strict";e.exports=function(e,t){if(null===e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}},2148:e=>{"use strict";function t(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||r&&i||!n)return 1;if(!r&&e=r.length?a:"desc"===r[i]?-a:a}return e.index-n.index})),i.map((function(e){return e.value}))}},8023:e=>{"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},6394:(e,t,n)=>{"use strict";var r=n(185);function i(e){return Object.keys(e).sort().reduce((function(t,n){return t[n]=e[n],t}),{})}var a={_getQueries:function(e,t){var n=[];return n.push({indexName:e,params:a._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(r){n.push({indexName:e,params:a._getDisjunctiveFacetSearchParams(t,r)})})),t.getRefinedHierarchicalFacets().forEach((function(r){var i=t.getHierarchicalFacetByName(r),o=t.getHierarchicalRefinement(r),s=t._getHierarchicalFacetSeparator(i);if(o.length>0&&o[0].split(s).length>1){var c=o[0].split(s).slice(0,-1).reduce((function(e,t,n){return e.concat({attribute:i.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(s)})}),[]);c.forEach((function(r,o){var s=a._getDisjunctiveFacetSearchParams(t,r.attribute,0===o);function u(e){return i.attributes.some((function(t){return t===e.split(":")[0]}))}var l=(s.facetFilters||[]).reduce((function(e,t){if(Array.isArray(t)){var n=t.filter((function(e){return!u(e)}));n.length>0&&e.push(n)}return"string"!=typeof t||u(t)||e.push(t),e}),[]),f=c[o-1];s.facetFilters=o>0?l.concat(f.attribute+":"+f.value):l.length>0?l:void 0,n.push({indexName:e,params:s})}))}})),n},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(a._getHitsHierarchicalFacetsAttributes(e)).sort(),n=a._getFacetFilters(e),o=a._getNumericFilters(e),s=a._getTagFilters(e),c={facets:t.indexOf("*")>-1?["*"]:t,tagFilters:s};return n.length>0&&(c.facetFilters=n),o.length>0&&(c.numericFilters=o),i(r({},e.getQueryParams(),c))},_getDisjunctiveFacetSearchParams:function(e,t,n){var o=a._getFacetFilters(e,t,n),s=a._getNumericFilters(e,t),c=a._getTagFilters(e),u={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};c.length>0&&(u.tagFilters=c);var l=e.getHierarchicalFacetByName(t);return u.facets=l?a._getDisjunctiveHierarchicalFacetAttribute(e,l,n):t,s.length>0&&(u.numericFilters=s),o.length>0&&(u.facetFilters=o),i(r({},e.getQueryParams(),u))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var n=[];return Object.keys(e.numericRefinements).forEach((function(r){var i=e.numericRefinements[r]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==r&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return r+e+t}));n.push(i)}else n.push(r+e+t)}))}))})),n},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,n){var r=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach((function(e){(i[e]||[]).sort().forEach((function(t){r.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).sort().forEach((function(e){(a[e]||[]).sort().forEach((function(t){r.push(e+":-"+t)}))}));var o=e.disjunctiveFacetsRefinements||{};Object.keys(o).sort().forEach((function(e){var n=o[e]||[];if(e!==t&&n&&0!==n.length){var i=[];n.sort().forEach((function(t){i.push(e+":"+t)})),r.push(i)}}));var s=e.hierarchicalFacetsRefinements||{};return Object.keys(s).sort().forEach((function(i){var a=(s[i]||[])[0];if(void 0!==a){var o,c,u=e.getHierarchicalFacetByName(i),l=e._getHierarchicalFacetSeparator(u),f=e._getHierarchicalRootPath(u);if(t===i){if(-1===a.indexOf(l)||!f&&!0===n||f&&f.split(l).length===a.split(l).length)return;f?(c=f.split(l).length-1,a=f):(c=a.split(l).length-2,a=a.slice(0,a.lastIndexOf(l))),o=u.attributes[c]}else c=a.split(l).length-1,o=u.attributes[c];o&&r.push([o+":"+a])}})),r},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,n){var r=e.getHierarchicalRefinement(n.name)[0];if(!r)return t.push(n.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(n),a=r.split(i).length,o=n.attributes.slice(0,a+1);return t.concat(o)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(!0===n){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(r).length),[t.attributes[a]]}var o=(e.getHierarchicalRefinement(t.name)[0]||"").split(r).length-1;return t.attributes.slice(0,o+1)},getSearchForFacetQuery:function(e,t,n,o){var s=o.isDisjunctiveFacet(e)?o.clearRefinements(e):o,c={facetQuery:t,facetName:e};return"number"==typeof n&&(c.maxFacetHits=n),i(r({},a._getHitsSearchParams(s),c))}};e.exports=a},6801:e=>{"use strict";e.exports=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)}},4336:e=>{"use strict";e.exports="3.14.2"},9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),a=n(4372),o=n(5327),s=n(4097),c=n(4109),u=n(7985),l=n(5061),f=n(7874),h=n(5263);e.exports=function(e){return new Promise((function(t,n){var p,d=e.data,m=e.headers,y=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(d)&&delete m["Content-Type"];var g=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",A=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+A)}var w=s(e.baseURL,e.url);function I(){if(g){var r="getAllResponseHeaders"in g?c(g.getAllResponseHeaders()):null,a={data:y&&"text"!==y&&"json"!==y?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g};i((function(e){t(e),v()}),(function(e){n(e),v()}),a),g=null}}if(g.open(e.method.toUpperCase(),o(w,e.params,e.paramsSerializer),!0),g.timeout=e.timeout,"onloadend"in g?g.onloadend=I:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(I)},g.onabort=function(){g&&(n(l("Request aborted",e,"ECONNABORTED",g)),g=null)},g.onerror=function(){n(l("Network Error",e,null,g)),g=null},g.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},r.isStandardBrowserEnv()){var S=(e.withCredentials||u(w))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in g&&r.forEach(m,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete m[t]:g.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),y&&"json"!==y&&(g.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&g.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&g.upload&&g.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){g&&(n(!e||e&&e.type?new h("canceled"):e),g.abort(),g=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),d||(d=null),g.send(d)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),i=n(1849),a=n(321),o=n(7185),s=function e(t){var n=new a(t),s=i(a.prototype.request,n);return r.extend(s,a.prototype,n),r.extend(s,n),s.create=function(n){return e(o(t,n))},s}(n(5546));s.Axios=a,s.Cancel=n(5263),s.CancelToken=n(4972),s.isCancel=n(6502),s.VERSION=n(7288).version,s.all=function(e){return Promise.all(e)},s.spread=n(8713),s.isAxiosError=n(6268),e.exports=s,e.exports.default=s},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),i=n(5327),a=n(782),o=n(3572),s=n(7185),c=n(4875),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new a,response:new a}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var f=[o,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(l),a=Promise.resolve(t);f.length;)a=a.then(f.shift(),f.shift());return a}for(var h=t;r.length;){var p=r.shift(),d=r.shift();try{h=p(h)}catch(e){d(e);break}}try{a=o(h)}catch(e){return Promise.reject(e)}for(;l.length;)a=a.then(l.shift(),l.shift());return a},l.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=l},782:(e,t,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,n)=>{"use strict";var r=n(1793),i=n(7303);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,i,a){var o=new Error(e);return r(o,t,n,i,a)}},3572:(e,t,n)=>{"use strict";var r=n(4867),i=n(8527),a=n(6502),o=n(5546),s=n(5263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function c(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||a,i=t(e);r.isUndefined(i)&&t!==c||(n[e]=i)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),i=n(5546);e.exports=function(e,t,n){var a=this||i;return r.forEach(n,(function(n){e=n.call(a,e,t)})),e}},5546:(e,t,n)=>{"use strict";var r=n(4867),i=n(6016),a=n(481),o=n(7874),s={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,l={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(5448)),u),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(c(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw a(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(s)})),e.exports=l},7874:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:e=>{e.exports={version:"0.26.1"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(t);else if(r.isURLSearchParams(t))a=t.toString();else{var o=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),a=o.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,o={};return e?(r.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=r.trim(e.substr(0,a)).toLowerCase(),n=r.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var a={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new Error(i(r," has been removed"+(t?" in "+t:"")));return t&&!a[r]&&(a[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],c=void 0===s||o(s,a,e);if(!0!==c)throw new TypeError("option "+a+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:i}},4867:(e,t,n)=>{"use strict";var r=n(1849),i=Object.prototype.toString;function a(e){return Array.isArray(e)}function o(e){return void 0===e}function s(e){return"[object ArrayBuffer]"===i.call(e)}function c(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(a=n,!1!==i&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&u){try{return void(window.localStorage[u]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(u)+"="+n+";"}catch(e){}}}(n),o.call(s,n,e),typeof console===t&&n{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},129:(e,t,n)=>{"use strict";var r=n(8261),i=n(5235),a=n(5798);e.exports={formats:a,parse:i,stringify:r}},5235:(e,t,n)=>{"use strict";var r=n(2769),i=Object.prototype.hasOwnProperty,a=Array.isArray,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u=function(e,t,n,r){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(a),u=s?a.slice(0,s.index):a,l=[];if(u){if(!n.plainObjects&&i.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var f=0;n.depth>0&&null!==(s=o.exec(a))&&f=0;--a){var o,s=e[a];if("[]"===s&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var u="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(u,10);n.parseArrays||""!==u?!isNaN(l)&&s!==u&&String(l)===u&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[])[l]=i:"__proto__"!==u&&(o[u]=i):o={0:i}}i=o}return i}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return o;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?o.charset:e.charset;return{allowDots:void 0===e.allowDots?o.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:o.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:o.comma,decoder:"function"==typeof e.decoder?e.decoder:o.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:o.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:o.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:o.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:o.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:o.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var n,u={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,h=l.split(t.delimiter,f),p=-1,d=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(y=a(y)?[y]:y),i.call(u,m)?u[m]=r.combine(u[m],y):u[m]=y}return u}(e,n):e,f=n.plainObjects?Object.create(null):{},h=Object.keys(l),p=0;p{"use strict";var r=n(2769),i=n(5798),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=String.prototype.split,u=Array.prototype.push,l=function(e,t){u.apply(e,s(t)?t:[t])},f=Date.prototype.toISOString,h=i.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},d=function e(t,n,i,a,o,u,f,h,d,m,y,v,g,b){var A,w=t;if("function"==typeof f?w=f(n,w):w instanceof Date?w=m(w):"comma"===i&&s(w)&&(w=r.maybeMap(w,(function(e){return e instanceof Date?m(e):e}))),null===w){if(a)return u&&!g?u(n,p.encoder,b,"key",y):n;w=""}if("string"==typeof(A=w)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||r.isBuffer(w)){if(u){var I=g?n:u(n,p.encoder,b,"key",y);if("comma"===i&&g){for(var S=c.call(String(w),","),R="",P=0;P0?w.join(",")||null:void 0}];else if(s(f))j=f;else{var O=Object.keys(w);j=h?O.sort(h):O}for(var T=0;T0?g+v:""}},2769:(e,t,n)=>{"use strict";var r=n(5798),i=Object.prototype.hasOwnProperty,a=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],i=0;i=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===r.RFC1738&&(40===l||41===l)?c+=s.charAt(u):l<128?c+=o[l]:l<2048?c+=o[192|l>>6]+o[128|63&l]:l<55296||l>=57344?c+=o[224|l>>12]+o[128|l>>6&63]+o[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(u)),c+=o[240|l>>18]+o[128|l>>12&63]+o[128|l>>6&63]+o[128|63&l])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var n=[],r=0;r{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),s=new x(r||[]);return i(o,"_invoke",{value:j(e,n,s)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",y={};function v(){}function g(){}function b(){}var A={};u(A,o,(function(){return this}));var w=Object.getPrototypeOf,I=w&&w(w(H([])));I&&I!==n&&r.call(I,o)&&(A=I);var S=b.prototype=v.prototype=Object.create(A);function R(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,a,o,s){var c=f(e[i],e,a);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(l).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(c.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function j(e,n,r){var i=h;return function(a,o){if(i===d)throw new Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var c=E(s,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?m:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function H(e){if(null!=e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:H(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},7325:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Configuration=void 0;var i=r(n(6690)),a=r(n(9728)),o=function(){function e(){var t,n,r,a,o,s,c,u,l,f,h,p,d,m,y=this,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,e),this.server=v.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(t=this.server.cacheSearchResultsForSeconds)&&void 0!==t?t:120,this.additionalSearchParameters=null!==(n=v.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(a=this.additionalSearchParameters.queryBy)&&void 0!==a?a:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(o=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==o?o:"",this.additionalSearchParameters.sort_by=null!==(c=null!==(u=this.additionalSearchParameters.sortBy)&&void 0!==u?u:this.additionalSearchParameters.sort_by)&&void 0!==c?c:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(f=this.additionalSearchParameters.highlightFullFields)&&void 0!==f?f:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(h=v.geoLocationField)&&void 0!==h?h:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(p=v.facetableFieldsWithSpecialCharacters)&&void 0!==p?p:[],this.collectionSpecificSearchParameters=null!==(d=v.collectionSpecificSearchParameters)&&void 0!==d?d:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(e){var t,n,r,i,a,o,s=y.collectionSpecificSearchParameters[e];s.query_by=null!==(t=s.queryBy)&&void 0!==t?t:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(i=null!==(a=null!==(o=s.highlightFullFields)&&void 0!==o?o:s.highlight_full_fields)&&void 0!==a?a:y.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:s.query_by,Object.keys(s).forEach((function(e){return void 0===s[e]?delete s[e]:{}}))})),this.renderingContent=v.renderingContent,this.flattenGroupedHits=null===(m=v.flattenGroupedHits)||void 0===m||m}return(0,a.default)(e,[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(e){return e.queryBy})))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}]),e}();t.Configuration=o},3599:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.FacetSearchResponseAdapter=void 0;var i=r(n(6690)),a=r(n(9728)),o=n(8399),s=function(){function e(t,n){(0,i.default)(this,e),this.typesenseResponse=t,this.instantsearchRequest=n}return(0,a.default)(e,[{key:"_adaptFacetHits",value:function(e){var t=this;return e.find((function(e){return e.field_name===t.instantsearchRequest.params.facetName})).counts.map((function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}}))}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}]),e}();t.FacetSearchResponseAdapter=s,Object.assign(s.prototype,o.utils)},4002:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SearchRequestAdapter=void 0;var i=r(n(1284)),a=r(n(7156)),o=r(n(7424)),s=r(n(6690)),c=r(n(9728)),u=function(){function e(t,n,r){(0,s.default)(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}var t;return(0,c.default)(e,[{key:"_adaptFacetFilters",value:function(e){var t=this,n="";return e?n=e.map((function(e){if(Array.isArray(e)){var n={};e.forEach((function(e){var r=t._parseFacetFilter(e),i=r.fieldName,a=r.fieldValue;n[i]=n[i]||[],n[i].push(a)})),Object.keys(n).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(n).join(",")));var r=Object.keys(n)[0],i=n[r].reduce((function(e,n){return n.startsWith("-")&&!t._isNumber(n)?e[0].push(n.substring(1)):e[1].push(n),e}),[[],[]]),a=(0,o.default)(i,2),s=a[0],c=a[1],u=[];return c.length>0&&u.push("".concat(r,":=[").concat(c.map((function(e){return t._escapeFacetValue(e)})).join(","),"]")),s.length>0&&u.push("".concat(r,":!=[").concat(s.map((function(e){return t._escapeFacetValue(e)})).join(","),"]")),u.filter((function(e){return e})).join(" && ")}var l=t._parseFacetFilter(e),f=l.fieldName,h=l.fieldValue;return h.startsWith("-")&&!t._isNumber(h)?"".concat(f,":!=[").concat(t._escapeFacetValue(h.substring(1)),"]"):"".concat(f,":=[").concat(t._escapeFacetValue(h),"]")})).join(" && "):n}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var o=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(o.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:a="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(i="".concat(r[1]).concat(r[2]),a="".concat(r[3])),{fieldName:i,fieldValue:a}}},{key:"_escapeFacetValue",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this,n="";if(!e)return n;var r={};e.forEach((function(e){var n=t._parseNumericFilter(e),i=n.fieldName,a=n.operator,o=n.fieldValue;r[i]=r[i]||{},r[i][a]=o}));var i=[];return Object.keys(r).forEach((function(e){null!=r[e]["<="]&&null!=r[e][">="]?i.push("".concat(e,":=[").concat(r[e][">="],"..").concat(r[e]["<="],"]")):null!=r[e]["<="]?i.push("".concat(e,":<=").concat(r[e]["<="])):null!=r[e][">="]?i.push("".concat(e,":>=").concat(r[e][">="])):null!=r[e]["="]?i.push("".concat(e,":=").concat(r[e]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[e])))})),i.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,r,i,a,s;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var c=this.configuration.facetableFieldsWithSpecialCharacters.map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(c.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=e.match(n))){var u=r,l=(0,o.default)(u,4);return{fieldName:i=l[1],operator:a=l[2],fieldValue:s=l[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(e,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var f=r,h=(0,o.default)(f,4);i=h[1],a=h[2],s=h[3]}return{fieldName:i,operator:a,fieldValue:s}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,r=e.aroundLatLng,i=e.insidePolygon;if(t){var a,s,c,u;if(Array.isArray(t)){var l=t.flat(),f=(0,o.default)(l,4);a=f[0],s=f[1],c=f[2],u=f[3]}else{var h=t.split(","),p=(0,o.default)(h,4);a=p[0],s=p[1],c=p[2],u=p[3]}return"".concat(this.configuration.geoLocationField,":(").concat(a,", ").concat(s,", ").concat(a,", ").concat(u,", ").concat(c,", ").concat(u,", ").concat(c,", ").concat(s,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var d="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(d,")")}if(i){var m=i;return Array.isArray(i)&&(m=i.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(m,")")}}},{key:"_adaptFilters",value:function(e){var t=[];return e.filters&&t.push(e.filters),t.push(this._adaptFacetFilters(e.facetFilters)),t.push(this._adaptNumericFilters(e.numericFilters)),t.push(this._adaptGeoFilter(e)),t.filter((function(e){return e&&""!==e})).join(" && ")}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_buildSearchParameters",value:function(e){for(var t=e.params,n=e.indexName,r=this._adaptIndexName(n),i={},a=0,s=Object.entries(this.additionalSearchParameters);a=|>|<|=)(.*)")}}]),e}();t.SearchRequestAdapter=u},2559:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.SearchResponseAdapter=void 0;var i=r(n(8698)),a=r(n(7424)),o=r(n(861)),s=r(n(8416)),c=r(n(6690)),u=r(n(9728)),l=n(8399);function f(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 h(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:[];(0,c.default)(this,e),this.typesenseResponse=t,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResponses=i}return(0,u.default)(e,[{key:"_adaptGroupedHits",value:function(e){var t=this,n=[];return n=e.map((function(e){var n=t._adaptHits(e.hits);return n.forEach((function(t){t.group_key=t._group_key=e.group_key,e.found&&(t._group_found=e.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(e){return h(h({},e[0]),{},{_grouped_hits:e})}))}},{key:"_adaptHits",value:function(e){var t=this;return e.map((function(e){var n=h({},e.document);n.objectID=e.document.id,n._snippetResult=t._adaptHighlightResult(e,"snippet"),n._highlightResult=t._adaptHighlightResult(e,"value"),n._rawTypesenseHit=e,["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance"].forEach((function(t){Object.keys(e).includes(t)&&!Object.keys(n).includes(t)&&(n[t]=e[t])}));var r=n[t.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(e,t){var n={};return null!=e.highlight&&this.isHighlightPost0240RCN32Format(e.highlight)?this.adaptHighlightObject(e,n,t):this.adaptHighlightsArray(e,n,t),n}},{key:"isHighlightPost0240RCN32Format",value:function(e){return null==e.full&&null==e.snippet}},{key:"adaptHighlightsArray",value:function(e,t,n){var r=this;Object.assign.apply(Object,[t].concat((0,o.default)(Object.entries(e.document).map((function(e){var t=(0,a.default)(e,2),n=t[0],r=t[1];return(0,s.default)({},n,{value:r,matchLevel:"none",matchedWords:[]})}))))),e.highlights.forEach((function(e){t[e.field]={value:e[n]||e["".concat(n,"s")],matchLevel:"full",matchedWords:e.matched_tokens},e.indices&&(t[e.field].matchedIndices=e.indices)})),Object.entries(t).forEach((function(o){var s=(0,a.default)(o,2),c=s[0],u=s[1],l=c,f=u.value,h=u.matchLevel,p=u.matchedWords,d=u.matchedIndices;null==f?t[l]=r._adaptHighlightNullValue():Array.isArray(f)?(t[l]=[],e.document[l].forEach((function(e,a){d&&d.includes(a)?t[l].push({value:r._adaptHighlightTag("".concat(f[d.indexOf(a)]),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag),matchLevel:h,matchedWords:p[a]}):"object"===(0,i.default)(e)?t[l].push(r._adaptHighlightInObjectValue(e,{},n)):t[l].push({value:"".concat(e),matchLevel:"none",matchedWords:[]})}))):"object"===(0,i.default)(f)?t[l]=r._adaptHighlightInObjectValue(f,{},n):t[l].value=r._adaptHighlightTag("".concat(f),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(e,t,n){Object.assign(t,this._adaptHighlightInObjectValue(e.document,e.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(e,t,n){var r=this;return Object.assign.apply(Object,[{}].concat((0,o.default)(Object.entries(e).map((function(e){var o,c=(0,a.default)(e,2),u=c[0],l=c[1];if(null==l)o=r._adaptHighlightNullValue();else if(Array.isArray(l)){var f;o=r._adaptHighlightInArrayValue(l,null!==(f=null==t?void 0:t[u])&&void 0!==f?f:[],n)}else if("object"===(0,i.default)(l)){var h;o=r._adaptHighlightInObjectValue(l,null!==(h=null==t?void 0:t[u])&&void 0!==h?h:{},n)}else o=r._adaptHighlightInPrimitiveValue(l,null==t?void 0:t[u],n);return(0,s.default)({},u,o)})))))}},{key:"_adaptHighlightInArrayValue",value:function(e,t,n){var r=this;return e.map((function(e,a){var o;if(null==e)o=r._adaptHighlightNullValue();else if(Array.isArray(e)){var s;o=r._adaptHighlightInArrayValue(e,null!==(s=null==t?void 0:t[a])&&void 0!==s?s:[],n)}else if("object"===(0,i.default)(e)){var c;o=r._adaptHighlightInObjectValue(e,null!==(c=null==t?void 0:t[a])&&void 0!==c?c:{},n)}else o=r._adaptHighlightInPrimitiveValue(e,null==t?void 0:t[a],n);return o}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(e,t,n){var r,i;return null!=t?{value:this._adaptHighlightTag("".concat(null!==(r=null!==(i=t[n])&&void 0!==i?i:t.highlight)&&void 0!==r?r:t.snippet),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(t.matched_tokens||[]).length>0?"full":"none",matchedWords:t.matched_tokens||[]}:{value:this._adaptHighlightTag("".concat(e),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(e){var t={};return e.forEach((function(e){Object.assign(t,(0,s.default)({},e.field_name,Object.assign.apply(Object,[{}].concat((0,o.default)(e.counts.map((function(e){return(0,s.default)({},e.value,e.count)})))))))})),t}},{key:"_adaptFacetStats",value:function(e){var t={};return e.forEach((function(e){Object.keys(e.stats).length>0&&Object.assign(t,(0,s.default)({},e.field_name,e.stats))})),t}},{key:"_adaptRenderingContent",value:function(e){var t,n=Object.assign({},this.configuration.renderingContent);return null==(null===(t=n.facetOrdering)||void 0===t||null===(t=t.facets)||void 0===t?void 0:t.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=(0,o.default)(new Set(e.map((function(e){return e.field_name})).concat(this.allTypesenseResponses.map((function(e){return e.facet_counts||[]})).flat().map((function(e){return e.field_name})).filter((function(e){return e})))))),n}},{key:"adapt",value:function(){var e=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]);return h({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:this.typesenseResponse.request_params.per_page,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||{}),query:this.typesenseResponse.request_params.q,processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(e).length>0?{renderingContent:e}:null)}}]),e}();t.SearchResponseAdapter=p,Object.assign(p.prototype,l.utils)},8499:(e,t,n)=>{"use strict";var r=n(4836);t.Z=void 0;var i=r(n(1284)),a=r(n(7156)),o=r(n(6690)),s=r(n(9728)),c=n(7325),u=n(8871),l=n(4002),f=n(2559),h=n(3599),p=function(){function e(t){var n=this;(0,o.default)(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}}var t,n,r;return(0,s.default)(e,[{key:"searchTypesenseAndAdapt",value:(r=(0,a.default)(i.default.mark((function e(t){var n,r,a=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map((function(e,r){return a._validateTypesenseResult(e),new f.SearchResponseAdapter(e,t[r],a.configuration,n.results).adapt()})),e.abrupt("return",{results:r});case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(_x){return r.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(n=(0,a.default)(i.default.mark((function e(t){var n,r,a=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,r=n.results.map((function(e,n){return a._validateTypesenseResult(e),new h.FacetSearchResponseAdapter(e,t[n],a.configuration).adapt()})),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return n.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(t=(0,a.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new l.SearchRequestAdapter(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new u.SearchClient(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new c.Configuration(e),this.configuration.validate(),this.typesenseClient=new u.SearchClient(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]),e}();t.Z=p},8399:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utils=void 0;var n={_adaptHighlightTag:function(e,t,n){return e.replace(new RegExp("","g"),t||"").replace(new RegExp(" ","g"),n||" ")},_adaptNumberOfPages:function(){var e=this.typesenseResponse.found/this.typesenseResponse.request_params.per_page;return Number.isFinite(e)?Math.ceil(e):1}};t.utils=n},8871:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Errors=t.SearchClient=t.Client=void 0;var s=o(n(4339));t.Client=s.default;var c=o(n(8834));t.SearchClient=c.default;var u=a(n(6718));t.Errors=u,t.default={Client:s.default,SearchClient:c.default,Errors:u}},8480:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]},!0!==w&&(g.timeout=1e3*h.connectionTimeoutSeconds),f&&0!==Object.keys(f).length&&(g.params=f),h.sendApiKeyAsQueryParam&&(g.params=g.params||{},g.params["x-typesense-api-key"]=h.apiKey),p&&("string"==typeof p&&0!==p.length||"object"==typeof p&&0!==Object.keys(p).length)&&(g.data=p),v&&(A=o.default.CancelToken,I=A.source(),y=function(){return I.cancel()},v.addEventListener("abort",y),g.cancelToken=I.token),[4,(0,o.default)(g)];case 2:if((S=i.sent()).status>=1&&S.status<=499&&h.setNodeHealthcheck(d,u),h.logger.debug("Request #".concat(n,": Request to Node ").concat(d.index," was made. Response Code was ").concat(S.status,".")),S.status>=200&&S.status<300)return[2,{value:Promise.resolve(S.data)}];if(S.status<500)return[2,{value:Promise.reject(h.customErrorForResponse(S,null===(a=S.data)||void 0===a?void 0:a.message))}];throw h.customErrorForResponse(S,null===(s=S.data)||void 0===s?void 0:s.message);case 3:return R=i.sent(),h.setNodeHealthcheck(d,!1),r=R,h.logger.warn("Request #".concat(n,": Request to Node ").concat(d.index,' failed due to "').concat(R.code," ").concat(R.message).concat(null==R.response?"":" - "+JSON.stringify(null===(c=R.response)||void 0===c?void 0:c.data),'"')),h.logger.warn("Request #".concat(n,": Sleeping for ").concat(h.retryIntervalSeconds,"s and then retrying request...")),[4,h.timer(h.retryIntervalSeconds)];case 4:return i.sent(),[3,6];case 5:return v&&y&&v.removeEventListener("abort",y),[7];case 6:return[2]}}))},h=this,d=1,g.label=1;case 1:return d<=this.numRetriesPerRequest+1?[5,l(d)]:[3,4];case 2:if("object"==typeof(y=g.sent()))return[2,y.value];g.label=3;case 3:return d++,[3,1];case 4:return this.logger.debug("Request #".concat(n,": No retries left. Raising last error")),[2,Promise.reject(r)]}}))}))},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,u)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,u)}))},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*e)}))]}))}))},e.prototype.customErrorForResponse=function(e,t){var n="Request failed with HTTP code ".concat(e.status);"string"==typeof t&&""!==t.trim()&&(n+=" | Server said: ".concat(t));var r=new c.default(n);return(r=400===e.status?new s.RequestMalformed(n):401===e.status?new s.RequestUnauthorized(n):404===e.status?new s.ObjectNotFound(n):409===e.status?new s.ObjectAlreadyExists(n):422===e.status?new s.ObjectUnprocessable(n):e.status>=500&&e.status<=599?new s.ServerError(n):new s.HTTPError(n)).httpStatus=e.status,r},e}();t.default=l},4339:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(2554)),a=r(n(9777)),o=r(n(6581)),s=r(n(8243)),c=r(n(5346)),u=r(n(8480)),l=r(n(2708)),f=r(n(7309)),h=r(n(7634)),p=r(n(6029)),d=r(n(1930)),m=r(n(3095)),y=r(n(9092)),v=r(n(1036)),g=r(n(1040)),b=r(n(6845)),A=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new i.default(e),this.apiCall=new a.default(this.configuration),this.debug=new h.default(this.apiCall),this.metrics=new p.default(this.apiCall),this.health=new d.default(this.apiCall),this.operations=new m.default(this.apiCall),this.multiSearch=new y.default(this.apiCall,this.configuration),this._collections=new o.default(this.apiCall),this.individualCollections={},this._aliases=new c.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new v.default(this.apiCall),this.individualPresets={},this.analytics=new b.default(this.apiCall)}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new u.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new f.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new g.default(e,this.apiCall)),this.individualPresets[e])},e}();t.default=A},8243:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();t.default=u},7634:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0)throw new s.ImportError("".concat(i.length-a.length," documents imported successfully, ").concat(a.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i);return[2,i]}return[2,r]}}))}))},t.prototype.export=function(e){return void 0===e&&(e={}),a(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]}))}))},t.prototype.exportStream=function(e){return void 0===e&&(e={}),a(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]}))}))},t}(n(5586).SearchOnlyDocuments);t.default=c},7117:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},9229:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,n){var r=e.call(this,t)||this;return r.importResults=n,r}return i(t,e),t}(a(n(4492)).default);t.default=o},1254:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},4105:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},3836:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},220:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},4913:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},9976:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},4959:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(a(n(4492)).default);t.default=o},4492:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.name=n.name,Object.setPrototypeOf(r,n.prototype),r}return r(t,e),t}(Error);t.default=i},6718:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImportError=t.TypesenseError=t.ServerError=t.RequestUnauthorized=t.RequestMalformed=t.ObjectUnprocessable=t.ObjectNotFound=t.ObjectAlreadyExists=t.MissingConfigurationError=t.HTTPError=void 0;var i=r(n(7117));t.HTTPError=i.default;var a=r(n(1254));t.MissingConfigurationError=a.default;var o=r(n(4105));t.ObjectAlreadyExists=o.default;var s=r(n(3836));t.ObjectNotFound=s.default;var c=r(n(220));t.ObjectUnprocessable=c.default;var u=r(n(4913));t.RequestMalformed=u.default;var l=r(n(9976));t.RequestUnauthorized=l.default;var f=r(n(4959));t.ServerError=f.default;var h=r(n(9229));t.ImportError=h.default;var p=r(n(4492));t.TypesenseError=p.default},1930:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]u&&(y=this.responseCache.keys().next().value,this.responseCache.delete(y)),this.responsePromiseCache.size>u&&(y=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(y)),[2,m]}}))}))},e}();t.default=a},8834:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(2554)),a=r(n(9777)),o=r(n(9092)),s=n(3320),c=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),e.sendApiKeyAsQueryParam=!1),this.configuration=new i.default(e),this.apiCall=new a.default(this.configuration),this.multiSearch=new o.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){e[0],e[1].documents().clearCache()}))},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new s.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},e}();t.default=c},3320:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchOnlyCollection=void 0;var r=n(5586),i=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return e.prototype.documents=function(){return this._documents},e}();t.SearchOnlyCollection=i},5586:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]{"use strict";var r=n(9196),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s((function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})}),[e,n,t]),o((function(){return u(i)&&l({inst:i}),e((function(){u(i)&&l({inst:i})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},1688:(e,t,n)=>{"use strict";e.exports=n(3250)},9196:e=>{"use strict";e.exports=window.React},1284:e=>{"use strict";e.exports=window.regeneratorRuntime},9964:()=>{},3897:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:(e,t,n)=>{var r=n(3897);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7156:e=>{function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,"next",e)}function c(e){t(o,i,a,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},9728:(e,t,n)=>{var r=n(4062);function i(e,t){for(var n=0;n{var r=n(4062);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},9498:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:e=>{e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:e=>{e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},2281:e=>{e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},7424:(e,t,n)=>{var r=n(5372),i=n(8872),a=n(6116),o=n(2218);e.exports=function(e,t){return r(e)||i(e,t)||a(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},861:(e,t,n)=>{var r=n(3405),i=n(9498),a=n(6116),o=n(2281);e.exports=function(e){return r(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:(e,t,n)=>{var r=n(8698).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:(e,t,n)=>{var r=n(8698).default,i=n(5036);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:(e,t,n)=>{var r=n(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.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),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.d(r,{z:()=>ur});var e={};n.r(e),n.d(e,{initializeNamespace:()=>f,updateHiiveDebounceInstance:()=>y,updateHiiveDebounceTime:()=>m,updateHiiveEventsQueue:()=>p,updateHiiveEventsQueueThreshold:()=>d,updateHiiveUrls:()=>h});var t={};n.r(t),n.d(t,{getHiiveBatchUrl:()=>A,getHiiveDebounce:()=>w,getHiiveEventsQueue:()=>v,getHiiveEventsQueueThreshold:()=>g,getHiiveSingleUrl:()=>b});var i=n(9196);n(5666);const a=window.wp.element,o=window.wp.data,s=window.wp.domReady;var c=n.n(s);class u{constructor(e,t,n,r){this.category=e,this.action=t,this.data=n,this.namespace=r}}const l={urls:{single:void 0,batch:void 0},queue:{events:[],threshold:100},debounce:{time:void 0,instance:void 0}};function f(e){return{type:"INITIALIZE_NAMESPACE",namespace:e}}function h(e,t){return{type:"UPDATE_HIIVE_URLS",urls:e,namespace:t}}function p(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE",events:e,namespace:t}}function d(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD",threshold:e,namespace:t}}function m(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_TIME",debounceTime:e,namespace:t}}function y(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_INSTANCE",instance:e,namespace:t}}function v(e,t){return e.hiive[t]?.queue.events}function g(e,t){return e.hiive[t]?.queue.threshold}function b(e,t){return e.hiive[t]?.urls.single}function A(e,t){return e.hiive[t]?.urls.batch}function w(e,t){return e.hiive[t]?.debounce}const I={reducer:(0,o.combineReducers)({hiive:(e,t)=>{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:l};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:e,selectors:t},S=(0,o.createReduxStore)("newfold/ui-analytics",I);(0,o.register)(S);const R=window.wp.apiFetch;var P=n.n(R);const j=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,E=async e=>{if(!(e=>e instanceof u)(e)||!j(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,o.select)(S).getHiiveSingleUrl(t);if(!n)return!1;try{await P()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}},O=window.wp.i18n;var T,x;function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{fallback:function(){}}).fallback;return"undefined"==typeof window?t():e({window})}function z(){}function W(e){return W="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},W(e)}function Q(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 X(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=3||2===n&&r>=6||1===n&&r>=10}function $(e,t,n){var r=t.getHelper();return{uiState:n,helper:r,parent:t,instantSearchInstance:e,state:r.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,scopedResults:[],searchMetadata:{isSearchStalled:"stalled"===e.status},status:e.status,error:e.error}}function ee(e,t){var n=t.getResults();return{helper:t.getHelper(),parent:t,instantSearchInstance:e,results:n,scopedResults:t.getScopedResults(),state:n._state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,searchMetadata:{isSearchStalled:"stalled"===e.status},status:e.status,error:e.error}}function te(e,t,n){var r=$(t,t.mainIndex,t._initialUiState);e.forEach((function(e){var i={};if(e.getWidgetRenderState){var a=e.getWidgetRenderState(r);a&&a.widgetParams&&(i=a.widgetParams)}var o=Object.keys(i).filter((function(e){return void 0!==i[e]}));n.widgets.push({type:e.$$type,widgetType:e.$$widgetType,params:o}),"ais.index"===e.$$type&&te(e.getWidgets(),t,n)}))}function ne(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).$$internal,t=void 0!==e&&e;return function(e){var n=e.instantSearchInstance,r={widgets:[]},i=document.createElement("meta"),a=document.querySelector("head");return i.name="instantsearch:widgets",{$$type:"ais.metadata",$$internal:t,onStateChange:function(){},subscribe:function(){setTimeout((function(){var e=n.client;r.ua=e.transporter&&e.transporter.userAgent?e.transporter.userAgent.value:e._ua,te(n.mainIndex.getWidgets(),n,r),n.middleware.forEach((function(e){return r.widgets.push({middleware:!0,type:e.instance.$$type,internal:e.instance.$$internal})})),i.content=JSON.stringify(r),a.appendChild(i)}),0)},started:function(){},unsubscribe:function(){i.remove()}}}}var re=n(129);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 ae(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,fe)}function ye(e){return e!==Object(e)}function ve(e,t){if(e===t)return!0;if(ye(e)||ye(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.router,n=void 0===t?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.createURL,n=void 0===t?function(e){var t=e.qsModule,n=e.routeState,r=e.location,i=r.protocol,a=r.hostname,o=r.port,s=void 0===o?"":o,c=r.pathname,u=r.hash,l=t.stringify(n),f=""===s?"":":".concat(s);return l?"".concat(i,"//").concat(a).concat(f).concat(c,"?").concat(l).concat(u):"".concat(i,"//").concat(a).concat(f).concat(c).concat(u)}:t,r=e.parseURL,i=void 0===r?function(e){var t=e.qsModule,n=e.location;return t.parse(n.search.slice(1),{arrayLimit:99})}:r,a=e.writeDelay,o=void 0===a?400:a,s=e.windowTitle,c=e.getLocation,u=void 0===c?function(){return G((function(e){return e.window.location}),{fallback:function(){throw new Error("You need to provide `getLocation` to the `history` router in environments where `window` does not exist.")}})}:c,l=e.start,f=e.dispose,h=e.push;return new ue({createURL:n,parseURL:i,writeDelay:o,windowTitle:s,getLocation:u,start:l,dispose:f,push:h})}():t,r=e.stateMapping,i=void 0===r?{$$type:"ais.simple",stateToRoute:function(e){return Object.keys(e).reduce((function(t,n){return pe(pe({},t),{},de({},n,me(e[n])))}),{})},routeToState:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){return pe(pe({},t),{},de({},n,me(e[n])))}),{})}}:r,a=e.$$internal,o=void 0!==a&&a;return function(e){var t=e.instantSearchInstance;t._createURL=function(e){var r=Object.keys(e).reduce((function(t,n){return Ae(Ae({},t),{},we({},n,e[n]))}),t.mainIndex.getWidgetUiState({})),a=i.stateToRoute(r);return n.createURL(a)};var r=void 0,a=t._initialUiState;return{$$type:"ais.router({router:".concat(n.$$type||"__unknown__",", stateMapping:").concat(i.$$type||"__unknown__","})"),$$internal:o,onStateChange:function(e){var t=e.uiState,a=i.stateToRoute(t);void 0!==r&&ve(r,a)||(n.write(a),r=a)},subscribe:function(){t._initialUiState=Ae(Ae({},a),i.routeToState(n.read())),n.onUpdate((function(e){t.setUiState(i.routeToState(e))}))},started:function(){var e;null===(e=n.start)||void 0===e||e.call(n)},unsubscribe:function(){n.dispose()}}}};function Se(){for(var e=arguments.length,t=new Array(e),n=0;n0?e.setQueryParameters({ruleContexts:n}):e}(c,t),l=function(e,t){return t.facets.reduce((function(e,t){return e.addFacet(t)}),e)}(u,t);return function(e,t){t.facets,t.disjunctiveFacets,t.facetsRefinements,t.facetsExcludes,t.disjunctiveFacetsRefinements,t.numericRefinements,t.tagRefinements,t.hierarchicalFacets,t.hierarchicalFacetsRefinements,t.ruleContexts;var n=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,je);return e.setQueryParameters(n)}(l,t)}))};function He(e){return He="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},He(e)}var ke=["initialSearchParameters"];function Me(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 Ne(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce((function(e,n){return Re(n)?e:n.getWidgetUiState||n.getWidgetState?n.getWidgetUiState?n.getWidgetUiState(e,t):n.getWidgetState(e,t):e}),n)}function Ge(e,t){var n=t.initialSearchParameters,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,ke);return e.filter((function(e){return!Re(e)})).reduce((function(e,t){return t.getWidgetSearchParameters?t.getWidgetSearchParameters(e,r):e}),n)}function ze(e){var t=e.filter(Re);0!==t.length&&t.forEach((function(e){var t=e.getHelper();Fe(t,{state:t.state.resetPage(),isPageReset:!0}),ze(e.getWidgets())}))}function We(e){return e.filter(Re).reduce((function(e,t){return e.concat.apply(e,[{indexId:t.getIndexId(),results:t.getResults(),helper:t.getHelper()}].concat(Ue(We(t.getWidgets()))))}),[])}const Qe=function(e){if(void 0===e||void 0===e.indexName)throw new Error(De("The `indexName` option is required."));var t=e.indexName,n=e.indexId,r=void 0===n?t:n,i=[],a={},o=null,s=null,c=null,u=null,l=null;return{$$type:"ais.index",$$widgetType:"ais.index",getIndexName:function(){return t},getIndexId:function(){return r},getHelper:function(){return c},getResults:function(){var e;return null!==(e=u)&&void 0!==e&&e.lastResults?(u.lastResults._state=c.state,u.lastResults):null},getPreviousState:function(){return l},getScopedResults:function(){var e=this.getParent();return We(e?e.getWidgets():[this])},getParent:function(){return s},createURL:function(e){return o._createURL(Ce({},r,Be(i,{searchParameters:e,helper:c})))},getWidgets:function(){return i},addWidgets:function(e){var t=this;if(!Array.isArray(e))throw new Error(De("The `addWidgets` method expects an array of widgets."));if(e.some((function(e){return"function"!=typeof e.init&&"function"!=typeof e.render})))throw new Error(De("The widget definition expects a `render` and/or an `init` method."));return i=i.concat(e),o&&Boolean(e.length)&&(Fe(c,{state:Ge(i,{uiState:a,initialSearchParameters:c.state}),_uiState:a}),e.forEach((function(e){e.getRenderState&&Xe({renderState:e.getRenderState(o.renderState[t.getIndexId()]||{},$(o,t,o._initialUiState)),instantSearchInstance:o,parent:t})})),e.forEach((function(e){e.init&&e.init($(o,t,o._initialUiState))})),o.scheduleSearch()),this},removeWidgets:function(e){var t=this;if(!Array.isArray(e))throw new Error(De("The `removeWidgets` method expects an array of widgets."));if(e.some((function(e){return"function"!=typeof e.dispose})))throw new Error(De("The widget definition expects a `dispose` method."));if(i=i.filter((function(t){return-1===e.indexOf(t)})),o&&Boolean(e.length)){var n=e.reduce((function(e,n){return n.dispose({helper:c,state:e,parent:t})||e}),c.state);a=Be(i,{searchParameters:n,helper:c}),c.setState(Ge(i,{uiState:a,initialSearchParameters:n})),i.length&&o.scheduleSearch()}return this},init:function(e){var n,f=this,h=e.instantSearchInstance,p=e.parent,d=e.uiState;if(null===c){o=h,s=p,a=d[r]||{};var m=h.mainHelper,y=Ge(i,{uiState:a,initialSearchParameters:new F.SearchParameters({index:t})});(c=F({},y.index,y)).search=function(){return h.onStateChange?(h.onStateChange({uiState:h.mainIndex.getWidgetUiState({}),setUiState:function(e){return h.setUiState(e,!1)}}),m):m.search()},c.searchWithoutTriggeringOnStateChange=function(){return m.search()},c.searchForFacetValues=function(e,t,n,r){var i=c.state.setQueryParameters(r);return m.searchForFacetValues(e,t,n,i)},u=m.derive((function(){return xe.apply(void 0,Ue(function(e){for(var t=e.getParent(),n=[e.getHelper().state];null!==t;)n=[t.getHelper().state].concat(n),t=t.getParent();return n}(f)))}));var v=null===(n=h._initialResults)||void 0===n?void 0:n[this.getIndexId()];if(v){var g=new F.SearchResults(new F.SearchParameters(v.state),v.results);u.lastResults=g,c.lastResults=g}c.on("change",(function(e){e.isPageReset&&ze(i)})),u.on("search",(function(){h.scheduleStalledRender()})),u.on("result",(function(e){var t=e.results;h.scheduleRender(),c.lastResults=t,l=t._state})),i.forEach((function(e){e.getRenderState&&Xe({renderState:e.getRenderState(h.renderState[f.getIndexId()]||{},$(h,f,d)),instantSearchInstance:h,parent:f})})),i.forEach((function(e){e.init&&e.init($(h,f,d))})),c.on("change",(function(e){var t=e.state,n=e._uiState;a=Be(i,{searchParameters:t,helper:c},n||{}),h.onStateChange||h.onInternalStateChange()})),v&&h.scheduleRender()}},render:function(e){var t=this,n=e.instantSearchInstance;this.getResults()&&("error"!==n.status||n.mainHelper.hasPendingRequests()||c.setState(l),i.forEach((function(e){e.getRenderState&&Xe({renderState:e.getRenderState(n.renderState[t.getIndexId()]||{},ee(n,t)),instantSearchInstance:n,parent:t})})),i.forEach((function(e){e.render&&e.render(ee(n,t))})))},dispose:function(){var e,t,n=this;i.forEach((function(e){e.dispose&&e.dispose({helper:c,state:c.state,parent:n})})),o=null,s=null,null===(e=c)||void 0===e||e.removeAllListeners(),c=null,null===(t=u)||void 0===t||t.detach(),u=null},getWidgetUiState:function(e){return i.filter(Re).reduce((function(e,t){return t.getWidgetUiState(e)}),Ne(Ne({},e),{},Ce({},r,Ne(Ne({},e[r]),a))))},getWidgetState:function(e){return this.getWidgetUiState(e)},getWidgetSearchParameters:function(e,t){var n=t.uiState;return Ge(i,{uiState:n,initialSearchParameters:e})},refreshUiState:function(){a=Be(i,{searchParameters:this.getHelper().state,helper:this.getHelper()},a)},setIndexUiState:function(e){var t="function"==typeof e?e(a):e;o.setUiState((function(e){return Ne(Ne({},e),{},Ce({},r,t))}))}}};function Xe(e){var t=e.renderState,n=e.instantSearchInstance,r=e.parent,i=r?r.getIndexId():n.mainIndex.getIndexId();n.renderState=Ne(Ne({},n.renderState),{},Ce({},i,Ne(Ne({},n.renderState[i]),t)))}var Je=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.descendantName,r=t.modifierName,i=n?"-".concat(n):"",a=r?"--".concat(r):"";return"".concat("ais","-").concat(e).concat(i).concat(a)}};function Le(e,t){return(Array.isArray(t)?t:t.split(".")).reduce((function(e,t){return e&&e[t]}),e)}var Ve={highlightPreTag:"",highlightPostTag:" "},Ye=Je("Highlight");function qe(e){var t=Ve.highlightPreTag,n=Ve.highlightPostTag;return e.map((function(e){return e.isHighlighted?t+e.value+n:e.value})).join("")}RegExp(/[&<>"']/g.source);var Ke={"&":"&","<":"<",">":">",""":'"',"'":"'"},_e=/&(amp|quot|lt|gt|#39);/g,$e=RegExp(_e.source),et=new RegExp(/\w/i);function tt(e,t){var n,r,i,a=e[t],o=(null===(n=e[t+1])||void 0===n?void 0:n.isHighlighted)||!0,s=(null===(r=e[t-1])||void 0===r?void 0:r.isHighlighted)||!0;return et.test((i=a.value)&&$e.test(i)?i.replace(_e,(function(e){return Ke[e]})):i)||s!==o?a.isHighlighted:s}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)}function rt(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 it(e){for(var t=1;t')).replace(new RegExp(Ve.highlightPostTag,"g"),"".concat(r,">"))}(dt(dt({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\nThe highlight helper expects a JSON object of the format:\n{ "attribute": "name", "highlightedTagName": "mark" }')}},reverseHighlight:function(e,t){try{return t(function(e){var t=e.attribute,n=e.highlightedTagName,r=void 0===n?"mark":n,i=e.hit,a=e.cssClasses,o=void 0===a?{}:a,s=(Le(i._highlightResult,t)||{}).value,c=void 0===s?"":s,u=ct({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return qe(ot(st(c))).replace(new RegExp(Ve.highlightPreTag,"g"),"<".concat(r,' class="').concat(u,'">')).replace(new RegExp(Ve.highlightPostTag,"g"),"".concat(r,">"))}(dt(dt({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\n The reverseHighlight helper expects a JSON object of the format:\n { "attribute": "name", "highlightedTagName": "mark" }')}},snippet:function(e,t){try{return t(function(e){var t=e.attribute,n=e.highlightedTagName,r=void 0===n?"mark":n,i=e.hit,a=e.cssClasses,o=void 0===a?{}:a,s=(Le(i._snippetResult,t)||{}).value,c=void 0===s?"":s,u=ut({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return c.replace(new RegExp(Ve.highlightPreTag,"g"),"<".concat(r,' class="').concat(u,'">')).replace(new RegExp(Ve.highlightPostTag,"g"),"".concat(r,">"))}(dt(dt({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\nThe snippet helper expects a JSON object of the format:\n{ "attribute": "name", "highlightedTagName": "mark" }')}},reverseSnippet:function(e,t){try{return t(function(e){var t=e.attribute,n=e.highlightedTagName,r=void 0===n?"mark":n,i=e.hit,a=e.cssClasses,o=void 0===a?{}:a,s=(Le(i._snippetResult,t)||{}).value,c=void 0===s?"":s,u=lt({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return qe(ot(st(c))).replace(new RegExp(Ve.highlightPreTag,"g"),"<".concat(r,' class="').concat(u,'">')).replace(new RegExp(Ve.highlightPostTag,"g"),"".concat(r,">"))}(dt(dt({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\n The reverseSnippet helper expects a JSON object of the format:\n { "attribute": "name", "highlightedTagName": "mark" }')}},insights:function(e,t){try{var n=JSON.parse(e),r=n.method,i=n.payload;return t(function(e,t){return function(e){var t,n=e.method,r=e.payload;if("object"!==ft(r))throw new Error("The insights helper expects the payload to be an object.");try{t=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))}(r)}catch(e){throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(n,'" data-insights-payload="').concat(t,'"')}({method:e,payload:t})}(r,dt({objectIDs:[this.objectID]},i)))}catch(e){throw new Error('\nThe insights helper expects a JSON object of the format:\n{ "method": "method-name", "payload": { "eventName": "name of the event" } }')}}}}var vt=Promise.resolve();function gt(e){var t=null,n=!1,r=function(){for(var r=arguments.length,i=new Array(r),a=0;a0&&void 0!==arguments[0])||arguments[0];null!==(e=t.mainHelper)&&void 0!==e&&e.hasPendingRequests()||(clearTimeout(t._searchStalledTimer),t._searchStalledTimer=null,n&&(t.status="idle",t.error=void 0)),t.mainIndex.render({instantSearchInstance:Rt(t)}),t.emit("render")}))),jt(Rt(t),"onInternalStateChange",gt((function(){var e=t.mainIndex.getWidgetUiState({});t.middleware.forEach((function(t){t.instance.onStateChange({uiState:e})}))}))),t.setMaxListeners(100);var n=e.indexName,r=void 0===n?null:n,i=e.numberLocale,s=e.initialUiState,c=void 0===s?{}:s,u=e.routing,l=void 0===u?null:u,f=e.insights,h=void 0!==f&&f,p=e.searchFunction,d=e.stalledSearchDelay,m=void 0===d?200:d,y=e.searchClient,v=void 0===y?null:y,g=e.insightsClient,b=void 0===g?null:g,A=e.onStateChange,w=void 0===A?null:A;if(null===r)throw new Error(Ot("The `indexName` option is required."));if(null===v)throw new Error(Ot("The `searchClient` option is required."));if("function"!=typeof v.search)throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");if("function"==typeof v.addAlgoliaAgent&&v.addAlgoliaAgent("instantsearch.js (".concat("4.55.0",")")),b&&"function"!=typeof b)throw new Error(Ot("The `insightsClient` option should be a function."));if(t.client=v,t.insightsClient=b,t.indexName=r,t.helper=null,t.mainHelper=null,t.mainIndex=Qe({indexName:r}),t.onStateChange=w,t.started=!1,t.templatesConfig={helpers:yt({numberLocale:i}),compileOptions:{}},t._stalledSearchDelay=m,t._searchStalledTimer=null,t._createURL=Tt,t._initialUiState=c,t._initialResults=null,p&&(t._searchFunction=p),t.sendEventToInsights=z,l){var I="boolean"==typeof l?{}:l;I.$$internal=!0,t.use(Ie(I))}if(h){var S="boolean"==typeof h?{}:h;S.$$internal=!0,t.use(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.insightsClient,n=e.insightsInitParams,r=e.onEvent,i=e.$$internal,a=void 0!==i&&i,o=t;t||null===t||G((function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||"aa";"string"==typeof n&&(o=t[n]),o||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);for(var e=arguments.length,r=new Array(e),i=0;i-1}),{fallback:function(){return!1}})&&t.use(ne({$$internal:!0})),t}return t=o,n=[{key:"_isSearchStalled",get:function(){return"stalled"===this.status}},{key:"use",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&this.scheduleSearch();this.helper=this.mainIndex.getHelper(),this.started=!0,this.middleware.forEach((function(e){e.instance.started()}))}},{key:"dispose",value:function(){var e;this.scheduleSearch.cancel(),this.scheduleRender.cancel(),clearTimeout(this._searchStalledTimer),this.removeWidgets(this.mainIndex.getWidgets()),this.mainIndex.dispose(),this.started=!1,this.removeAllListeners(),null===(e=this.mainHelper)||void 0===e||e.removeAllListeners(),this.mainHelper=null,this.helper=null,this.middleware.forEach((function(e){e.instance.unsubscribe()}))}},{key:"scheduleStalledRender",value:function(){var e=this;this._searchStalledTimer||(this._searchStalledTimer=setTimeout((function(){e.status="stalled",e.scheduleRender()}),this._stalledSearchDelay))}},{key:"setUiState",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.mainHelper)throw new Error(Ot("The `start` method needs to be called before `setUiState`."));this.mainIndex.refreshUiState();var r="function"==typeof e?e(this.mainIndex.getWidgetUiState({})):e;this.onStateChange&&n?this.onStateChange({uiState:r,setUiState:function(e){bt("function"==typeof e?e(r):e,t.mainIndex),t.scheduleSearch(),t.onInternalStateChange()}}):(bt(r,this.mainIndex),this.scheduleSearch(),this.onInternalStateChange())}},{key:"getUiState",value:function(){return this.started&&this.mainIndex.refreshUiState(),this.mainIndex.getWidgetUiState({})}},{key:"createURL",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.started)throw new Error(Ot("The `start` method needs to be called before `createURL`."));return this._createURL(e)}},{key:"refresh",value:function(){if(!this.mainHelper)throw new Error(Ot("The `start` method needs to be called before `refresh`."));this.mainHelper.clearCache().search()}}],n&&It(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(D);var Ht=n(1688),kt=(0,i.createContext)(null);function Mt(){return(0,i.useContext)(kt)}var Nt=(0,i.createContext)(null);const Ct="6.38.1";function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Gt));return n.started?i.createElement(Z.Provider,{value:n},i.createElement(U.Provider,{value:n.mainIndex},t)):null}var Wt=n(8499);const Qt=window.lodash;function Xt(e){return Xt="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},Xt(e)}function Jt(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 Lt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:z;return function(e,t){if(void 0===e||"function"!=typeof e)throw new Error("The render function is not valid (received type ".concat((n=e,Object.prototype.toString.call(n).slice(8,-1)),").\n\n").concat(t));var n}(e,Yt()),function(n){var r,i,a=(n||{}).queryHook,o=void 0===a?qt:a;return{$$type:"ais.searchBox",init:function(t){var n=t.instantSearchInstance;e(Lt(Lt({},this.getWidgetRenderState(t)),{},{instantSearchInstance:n}),!0)},render:function(t){var n=t.instantSearchInstance;e(Lt(Lt({},this.getWidgetRenderState(t)),{},{instantSearchInstance:n}),!1)},dispose:function(e){var n=e.state;return t(),n.setQueryParameter("query",void 0)},getRenderState:function(e,t){return Lt(Lt({},e),{},{searchBox:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.helper,a=e.searchMetadata,s=e.state;return r||(r=function(e){o(e,(function(e){return t.setQuery(e).search()}))},i=function(){t.setQuery("").search()}),{query:s.query||"",refine:r,clear:i,widgetParams:n,isSearchStalled:a.isSearchStalled}},getWidgetUiState:function(e,t){var n=t.searchParameters.query||"";return""===n||e&&e.query===n?e:Lt(Lt({},e),{},{query:n})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return e.setQueryParameter("query",n.query||"")}}}};function _t(e){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_t(e)}var $t=Object.prototype.hasOwnProperty;function en(e,t,n){if(null!=n&&n(e,t))return!0;var r,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((i=e.length)===t.length)for(;i--&&en(e[i],t[i],n););return-1===i}if(!r||"object"===_t(e)){for(r in i=0,e){if($t.call(e,r)&&++i&&!$t.call(t,r))return!1;if(!(r in t)||!en(e[r],t[r],n))return!1}return Object.keys(t).length===i}}return e!=e&&t!=t}function tn(e){var t,n,r;return new F.SearchResults(e,[{query:null!==(t=e.query)&&void 0!==t?t:"",page:null!==(n=e.page)&&void 0!==n?n:0,hitsPerPage:null!==(r=e.hitsPerPage)&&void 0!==r?r:20,hits:[],nbHits:0,nbPages:0,params:"",exhaustiveNbHits:!0,exhaustiveFacetsCount:!0,processingTimeMS:0,index:e.index}],{__isArtificial:!0})}function nn(e){return nn="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},nn(e)}function rn(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 an(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function In(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Mt(),s=ln(),c=un(),u=hn(r),l=hn(a),f=(0,i.useRef)(!0),h=(0,i.useRef)(null),p=(0,i.useMemo)((function(){return bn(bn({},e((function(e,t){if(t)f.current=!0;else if(f.current){e.instantSearchInstance,e.widgetParams;var n=wn(e,mn);en(n,h.current,(function(e,t){return(null==e?void 0:e.constructor)===Function&&(null==t?void 0:t.constructor)===Function}))||(y(n),h.current=n)}}),(function(){f.current=!1}))(u)),l)}),[e,u,l]),d=(t=(0,i.useState)((function(){if(p.getWidgetRenderState){var e,t=c.getHelper(),n=c.getWidgetUiState({})[c.getIndexId()];t.state=(null===(e=p.getWidgetSearchParameters)||void 0===e?void 0:e.call(p,t.state,{uiState:n}))||t.state;var r=sn(c),i=r.results,a=r.scopedResults,o=p.getWidgetRenderState({helper:t,parent:c,instantSearchInstance:s,results:i,scopedResults:a,state:t.state,renderState:s.renderState,templatesConfig:s.templatesConfig,createURL:c.createURL,searchMetadata:{isSearchStalled:"stalled"===s.status},status:s.status,error:s.error});return o.widgetParams,wn(o,yn)}return{}})),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,_x,a,o=[],_n=!0,s=!1;try{if(_x=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(o.push(r.value),o.length!==t);_n=!0);}catch(e){s=!0,i=e}finally{try{if(!_n&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return o}}(t,n)||function(e,t){if(e){if("string"==typeof e)return vn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(e,t):void 0}}(t,n)||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.")}()),m=d[0],y=d[1];return function(e){var t=e.widget,n=e.parentIndex,r=e.props,a=e.shouldSsr,o=(0,i.useRef)(r);(0,i.useEffect)((function(){o.current=r}),[r]);var s=(0,i.useRef)(t);(0,i.useEffect)((function(){s.current=t}),[t]);var c=(0,i.useRef)(null),u=a&&!n.getWidgets().includes(t),l=ln();pn((function(){var e=s.current;return c.current?(clearTimeout(c.current),en(r,o.current)||(n.removeWidgets([e]),n.addWidgets([t]))):u||n.addWidgets([t]),function(){c.current=setTimeout((function(){l._schedule((function(){l._preventWidgetCleanup||n.removeWidgets([e])}))}))}}),[n,t,u,l,r]),u&&n.addWidgets([t])}({widget:p,parentIndex:c,props:u,shouldSsr:Boolean(o)}),m}function Sn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{}).catchError,t=ln(),n=function(){var e,t,n=ln(),r=un(),a=r.getIndexId(),o=(e=(0,i.useState)((function(){return n.getUiState()})),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,_x,a,o=[],_n=!0,s=!1;try{if(_x=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(o.push(r.value),o.length!==t);_n=!0);}catch(e){s=!0,i=e}finally{try{if(!_n&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rn(e,t):void 0}}(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.")}()),s=o[0],c=o[1],u=s[a],l=(0,i.useCallback)((function(e){n.setUiState(e)}),[n]),f=(0,i.useCallback)((function(e){r.setIndexUiState(e)}),[r]);return(0,i.useEffect)((function(){function e(){c(n.getUiState())}return n.addListener("render",e),function(){n.removeListener("render",e)}}),[n]),{uiState:s,setUiState:l,indexUiState:u,setIndexUiState:f}}(),r=n.uiState,a=n.setUiState,o=n.indexUiState,s=n.setIndexUiState,c=function(){var e,t,n=ln(),r=un(),a=(e=(0,i.useState)((function(){return sn(r)})),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,_x,a,o=[],_n=!0,s=!1;try{if(_x=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(o.push(r.value),o.length!==t);_n=!0);}catch(e){s=!0,i=e}finally{try{if(!_n&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Sn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sn(e,t):void 0}}(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.")}()),o=a[0],s=a[1];return(0,i.useEffect)((function(){function e(){var e=r.getResults();null!==e&&s({results:e,scopedResults:r.getScopedResults()})}return n.addListener("render",e),function(){n.removeListener("render",e)}}),[n,r]),o}(),u=c.results,l=c.scopedResults,f=(0,i.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;rP()({path:jn+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>P()({path:jn+"/search/default",method:"POST"})};var On,Tn;function xn(){return xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"algoliaResult",onClick:t},(0,i.createElement)("p",null,e),(0,i.createElement)("div",{className:"svg"},(0,i.createElement)(Mn,null)))),Cn="nfd-help-center/v1",Un={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t)=>{localStorage.setItem("helpResultContent",e),localStorage.setItem("helpPostId",t)},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>({content:localStorage.getItem("helpResultContent"),postId:localStorage.getItem("helpPostId")}),getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag:e=>localStorage.getItem(e),setFeatureFlag(e,t){localStorage.setItem(e,t)}},Zn=(e,t)=>{const n=new u("wonder_help",e,t,"wonder_help");E(n)},Dn=({postId:e,source:t})=>{const[n,r]=(0,a.useState)(""),o=(0,a.useRef)(null),s=(0,a.useRef)(null);return(0,a.useEffect)((()=>{r(""),s.current.className="feedback-button no",o.current.className="feedback-button yes"}),[e]),(0,a.useEffect)((()=>{(async()=>{"helpful"!==n&&"notHelpful"!==n||(((e,t)=>{P()({path:Cn+"/feedback",method:"POST",data:{post_id:e,status:t}})})(e,n),Zn("help_feedback_submitted",{label_key:"type",type:"helpful"===n?"positive":"negative",source:t,post_id:e,page:window.location.href.toString()}))})(),"helpful"===n&&(o.current.className="feedback-button yes selected-yes",s.current.className="feedback-button no"),"notHelpful"===n&&(s.current.className="feedback-button no selected-no",o.current.className="feedback-button yes")}),[n]),(0,i.createElement)("div",{className:"feedback-container"},(0,i.createElement)("div",{className:"feedback-question"},(0,i.createElement)("p",null,(0,i.createElement)("b",null,(0,O.__)("Did this result help you?","wp-module-help-center")))),(0,i.createElement)("div",{className:"icon"},(0,i.createElement)("button",{ref:o,onClick:()=>{r("helpful")},className:"feedback-button yes"},"helpful"===n&&(0,i.createElement)(i.Fragment,null,"🥳")," ",(0,O.__)("Yes","wp-module-help-center")),(0,i.createElement)("button",{onClick:()=>{r("notHelpful")},ref:s,className:"feedback-button no"},"notHelpful"===n&&(0,i.createElement)(i.Fragment,null,"😭")," ",(0,O.__)("No","wp-module-help-center"))))};var Fn,Bn;function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(window?.nfdHelpCenter?.resourceLink)return(0,i.createElement)("p",null,(0,O.__)("In the meantime, try searching our","wp-module-help-center")," ",(0,i.createElement)("a",{href:window?.nfdHelpCenter?.resourceLink},(0,O.__)("Resource center.","wp-module-help-center")))},Qn=()=>(0,i.createElement)("div",null,(0,i.createElement)("p",null,(0,O.__)("Result based on your search:","wp-module-help-center")),(0,i.createElement)("h4",null,(0,O.__)("Sorry, we don't have any content for that yet.","wp-module-help-center")),(0,i.createElement)("hr",null),(0,i.createElement)(zn,null),(0,i.createElement)("p",null,(0,O.__)("This tool is being built and doesn't always have a match.","wp-module-help-center")),(0,i.createElement)(Wn,null),(0,i.createElement)("hr",null)),Xn=({content:e,noResult:t,postId:n,source:r,showFeedbackSection:a})=>t?(0,i.createElement)(Qn,null):e&&e.length>0?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h4",null,(0,O.__)("Follow these steps:","wp-module-help-center")),(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:e}}),a&&e&&e.length>0&&(0,i.createElement)(Dn,{postId:n,source:r})):(0,i.createElement)(i.Fragment,null);var Jn,Ln,Vn,Yn,qn,Kn;function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)(er,null)," ",(0,i.createElement)(er,null)," ",(0,i.createElement)(er,null)),nr=e=>{const[t,n]=(0,a.useState)(!1),[r,o]=(0,a.useState)(!1),[s,c]=(0,a.useState)(""),[u,l]=(0,a.useState)(""),[f,h]=(0,a.useState)(),[p,d]=(0,a.useState)("kb"),{refine:m,clear:y}=In(Kt,void 0,void 0),{results:v}=Pn(),g=(e,t,n)=>{const r=e.replace(/\n/g," ");l(r),h(t),Un.persistResult(r,t),Un.persistSearchInput(n),t&&Zn("help_search",{label_key:"term",term:n,page:window.location.href.toString()})};(0,a.useEffect)((()=>{c(""),l(""),m("")}),[e.refresh]),(0,a.useEffect)((()=>{const{content:e,postId:t}=Un.getResultInfo();e&&l(e),t&&h(t);const n=Un.getSearchInput();n&&(c(n),m(n))}),[]);const b=(0,a.useMemo)((()=>(0,Qt.debounce)((function(e){e&&0===e.length&&y(),m(e)}),300)),[]);return(0,a.useEffect)((()=>{b.cancel()}),[]),t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(tr,null)):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"search-container"},(0,i.createElement)("button",{onClick:()=>{document.getElementById("search-input-box").focus()}},(0,i.createElement)(Hn,null)),(0,i.createElement)("input",{type:"text",id:"search-input-box",style:{flexGrow:2},value:s,maxLength:"144",placeholder:(0,O.__)("Ask me anything…","wp-module-help-center"),onChange:e=>{c(e.target.value),g("",void 0,e.target.value),o(!1),b(e.target.value)},onKeyDown:async e=>{"Enter"===e.key&&await(async()=>{n(!0);try{const e=v.hits;if(e.length>0&&((e,t,n)=>{const r=t/e.split(/\s+/).length;return n>=1&&r>=.99})(s,e[0].text_match_info?.tokens_matched,e[0].text_match_info?.fields_matched))return void g(e[0].post_content,e[0].post_id,s);d("ai");const t=await En.getSearchResult(s,"helpcenter");g(t.result[0].text,t.post_id,s)}catch(e){o(!0)}finally{n(!1)}})()}})),(0,i.createElement)("div",{className:"attribute"},(0,i.createElement)("p",null,(0,i.createElement)("span",null,s?s.length:0,"/144"))),(0,i.createElement)(Xn,{content:u,noResult:r,postId:f,source:p,showFeedbackSection:!u.includes("do not possess the answer")}),v.hits.length>0&&(0,i.createElement)("p",null,(0,i.createElement)("b",null,u.length>0?(0,O.__)("Other Resources","wp-module-help-center"):(0,O.__)("Search Suggestions","wp-module-help-center"))),v.hits.map(((e,t)=>{const n=document.createElement("span");n.setAttribute("display","none"),n.innerHTML=e.post_title;const r=n.textContent||n.innerText;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Nn,{key:t,searchTitle:r,onGo:()=>{c(r),g(e.post_content,e.post_id,r)}}))})))},rr=e=>{const t=new Wt.Z({server:{apiKey:"B9wvYIokTPPgXEM3isTqsxbDOva21igT",nodes:[{host:"search.hiive.cloud",port:443,protocol:"https"}]},additionalSearchParameters:{facet_by:"post_title",group_by:"post_title",group_limit:1,query_by:"post_title,post_content",sort_by:"_text_match:desc,post_likes:desc",filter_by:`post_category:=${e.brand}`,prioritize_token_position:!0,limit_hits:3,per_page:3}}).searchClient,[n,r]=(0,a.useState)(!1),[o,s]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{(async()=>{try{const e=await P()({path:Cn+"/capability",method:"GET"});s(e)}catch(e){s(!1)}})()}),[]),(0,a.useEffect)((()=>{const e=()=>{r(Un.getHelpVisible())};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}),[]),o&&n?(0,i.createElement)("div",{className:"nfd-help-center"},(0,i.createElement)(zt,{searchClient:t,indexName:"nfd_help_articles"},(0,i.createElement)(nr,{refresh:e.refresh}))):(0,i.createElement)(i.Fragment,null)},ir=({onClose:e})=>{const[t,n]=(0,a.useState)("");(0,a.useEffect)((()=>{const e=Un.getHelpVisible();ur(e),(async()=>{const e=await P()({path:Cn+"/capability/brand",method:"GET"});n(e.toLowerCase())})()}),[]);const[r,o]=(0,a.useState)(!1);return(0,i.createElement)("div",{className:"modal"},(0,i.createElement)("div",{className:"modal-header"},(0,i.createElement)("h3",{className:"heading"},(0,i.createElement)("span",{className:"icon"},(0,i.createElement)(C,null)),(0,O.__)("Help Center","wp-module-help-center")),(0,i.createElement)("button",{className:"close-button",onClick:()=>{e(),o(!r)}},(0,i.createElement)("div",{className:"icon-button"},(0,i.createElement)(M,null)))),(0,i.createElement)(rr,{closeHelp:()=>{e(),o(!r)},refresh:r,brand:t}))};var ar;function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&(async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:i=100}={}}={}})=>{!e||!j(e)&&(!t&&!n||((0,o.dispatch)(S).initializeNamespace(e),(0,o.dispatch)(S).updateHiiveUrls({single:t,batch:n},e),(0,o.dispatch)(S).updateHiiveDebounceTime(r,e),(0,o.dispatch)(S).updateHiiveEventsQueueThreshold(i,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}}))})({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"}})}));const cr=document.getElementById("wpcontent"),ur=e=>{cr.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),Un.updateHelpVisible(e),window.dispatchEvent(new Event("storage"))};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=Un.getHelpVisible();if(Object.is(e,void 0))return ur(!0),void Zn("help_sidebar_opened",{page:window.location.href.toString()});e||Zn("help_sidebar_opened",{page:window.location.href.toString()}),ur(!e)})()},renderEmbeddedHelp:()=>{const e=document.createElement("div");e.id="nfd-help-center",e.style.display="none",cr.appendChild(e);const t=document.getElementById("nfd-help-center");null!==t&&("undefined"!==a.createRoot?(0,a.createRoot)(t).render((0,i.createElement)(ir,{onClose:()=>{ur(!1),Un.clear()}})):"undefined"!==a.render&&(0,a.render)((0,i.createElement)(ir,{onClose:()=>{ur(!1),Un.clear()}}),t))}};const lr=(0,o.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?lr():c()((()=>{const e=document.querySelector(".edit-post-header__settings");if(!e)return;const t=document.createElement("div");t.id="nfd-help-menu-button-wrapper",t.classList.add("nfd-help-menu-button-wrapper");const n=e.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");n?e.insertBefore(t,n):e.appendChild(t);const r=(0,i.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,i.createElement)(sr,null));(0,a.render)(r,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=Un.getHelpVisible();Un.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),ur(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),i=document.getElementById("nfd-help-center");let a=0;const o=setInterval((()=>{if(a++,i&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(i)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(o)}else a>=5&&clearInterval(o)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))})()})();
\ No newline at end of file
+!function(){var e={251:function(e,t,n){"use strict";var r=n(196),i=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,n){var r,a={},o=null,p=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(p=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:o,ref:p,props:a,_owner:l.current}}t.jsx=a,t.jsxs=a},893:function(e,t,n){"use strict";e.exports=n(251)},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var s=t&&t.prototype instanceof g?t:g,l=Object.create(s.prototype),c=new H(r||[]);return i(l,"_invoke",{value:E(e,n,c)}),l}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=p;var h="suspendedStart",A="suspendedYield",d="executing",I="completed",m={};function g(){}function b(){}function f(){}var w={};o(w,l,(function(){return this}));var k=Object.getPrototypeOf,y=k&&k(k(z([])));y&&y!==n&&r.call(y,l)&&(w=y);var S=f.prototype=g.prototype=Object.create(w);function v(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(i,s,l,c){var a=u(e[i],e,s);if("throw"!==a.type){var o=a.arg,p=o.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,l,c)}),(function(e){n("throw",e,l,c)})):t.resolve(p).then((function(e){o.value=e,l(o)}),(function(e){return n("throw",e,l,c)}))}c(a.arg)}var s;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return s=s?s.then(i,i):i()}})}function E(e,n,r){var i=h;return function(s,l){if(i===d)throw new Error("Generator is already running");if(i===I){if("throw"===s)throw l;return{value:t,done:!0}}for(r.method=s,r.arg=l;;){var c=r.delegate;if(c){var a=x(c,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=I,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var o=u(e,n,r);if("normal"===o.type){if(i=r.done?I:A,o.arg===m)continue;return{value:o.arg,done:r.done}}"throw"===o.type&&(i=I,r.method="throw",r.arg=o.arg)}}}function x(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var s=u(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,m;var l=s.arg;return l?l.done?(n[e.resultName]=l.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):l:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function H(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function z(e){if(null!=e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i=0;--s){var l=this.tryEntries[s],c=l.completion;if("root"===l.tryLoc)return i("end");if(l.tryLoc<=this.prev){var a=r.call(l,"catchLoc"),o=r.call(l,"finallyLoc");if(a&&o){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Z(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;Z(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},774:function(e){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),a=0;a{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:u};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:e,selectors:t},v=(0,c.createReduxStore)("newfold/ui-analytics",S);(0,c.register)(v);var T=window.wp.apiFetch,E=n.n(T);const x=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,M=async e=>{if(!(e=>e instanceof p)(e)||!x(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,c.select)(v).getHiiveSingleUrl(t);if(!n)return!1;try{await E()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}};var Z,H,z=window.wp.i18n;function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;tE()({path:O+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>E()({path:O+"/search/default",method:"POST"})};var N,X,W=D;function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"algoliaResult",onClick:t},(0,i.createElement)("p",null,e),(0,i.createElement)("div",{className:"svg"},(0,i.createElement)(V,null)))),L="nfd-help-center/v1",F=()=>E()({path:L+"/capability/brand",method:"GET"}),q={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t)=>{localStorage.setItem("helpResultContent",e),localStorage.setItem("helpPostId",t)},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>({content:localStorage.getItem("helpResultContent"),postId:localStorage.getItem("helpPostId")}),getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag(e){return localStorage.getItem(e)},setFeatureFlag(e,t){localStorage.setItem(e,t)}},K=(e,t)=>{const n=new p("wonder_help",e,t,"wonder_help");M(n)};var _,$,ee=({postId:e,source:t})=>{const[n,r]=(0,l.useState)(""),s=(0,l.useRef)(null),c=(0,l.useRef)(null);return(0,l.useEffect)((()=>{r(""),c.current.className="feedback-button no",s.current.className="feedback-button yes"}),[e]),(0,l.useEffect)((()=>{(async()=>{"helpful"!==n&&"notHelpful"!==n||(((e,t)=>{E()({path:L+"/feedback",method:"POST",data:{post_id:e,status:t}})})(e,n),K("help_feedback_submitted",{label_key:"type",type:"helpful"===n?"positive":"negative",source:t,post_id:e,page:window.location.href.toString()}))})(),"helpful"===n&&(s.current.className="feedback-button yes selected-yes",c.current.className="feedback-button no"),"notHelpful"===n&&(c.current.className="feedback-button no selected-no",s.current.className="feedback-button yes")}),[n]),(0,i.createElement)("div",{className:"feedback-container"},(0,i.createElement)("div",{className:"feedback-question"},(0,i.createElement)("p",null,(0,i.createElement)("b",null,(0,z.__)("Did this result help you?","wp-module-help-center")))),(0,i.createElement)("div",{className:"icon"},(0,i.createElement)("button",{ref:s,onClick:()=>{r("helpful")},className:"feedback-button yes"},"helpful"===n&&(0,i.createElement)("span",{className:"feedback-button-emoji",role:"img","aria-label":"helpful"},"🥳"),(0,z.__)("Yes","wp-module-help-center")),(0,i.createElement)("button",{onClick:()=>{r("notHelpful")},ref:c,className:"feedback-button no"},"notHelpful"===n&&(0,i.createElement)("span",{className:"feedback-button-emoji",role:"img","aria-label":"not helpful"},"😭"),(0,z.__)("No","wp-module-help-center"))))};function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(window?.nfdHelpCenter?.resourceLink)return(0,i.createElement)("p",null,(0,z.__)("In the meantime, try searching our","wp-module-help-center")," ",(0,i.createElement)("a",{href:window?.nfdHelpCenter?.resourceLink},(0,z.__)("Resource center.","wp-module-help-center")))},ie=()=>(0,i.createElement)("div",null,(0,i.createElement)("p",null,(0,z.__)("Result based on your search:","wp-module-help-center")),(0,i.createElement)("h4",null,(0,z.__)("Sorry, we don't have any content for that yet.","wp-module-help-center")),(0,i.createElement)("hr",null),(0,i.createElement)(ne,null),(0,i.createElement)("p",null,(0,z.__)("This tool is being built and doesn't always have a match.","wp-module-help-center")),(0,i.createElement)(re,null),(0,i.createElement)("hr",null));let se={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function le(e){se=e}const ce=/[&<>"']/,ae=new RegExp(ce.source,"g"),oe=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,pe=new RegExp(oe.source,"g"),ue={"&":"&","<":"<",">":">",'"':""","'":"'"},he=e=>ue[e];function Ae(e,t){if(t){if(ce.test(e))return e.replace(ae,he)}else if(oe.test(e))return e.replace(pe,he);return e}const de=/(^|[^\[])\^/g;function Ie(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(de,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function me(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const ge={exec:()=>null};function be(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:fe(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=fe(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:fe(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=fe(t[0],"\n").split("\n"),n="",r="";const i=[];for(;e.length>0;){let t=!1;const s=[];let l;for(l=0;l/.test(e[l]))s.push(e[l]),t=!0;else{if(t)break;s.push(e[l])}e=e.slice(l);const c=s.join("\n"),a=c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${c}`:c,r=r?`${r}\n${a}`:a;const o=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,i,!0),this.lexer.state.top=o,0===e.length)break;const p=i[i.length-1];if("code"===p?.type)break;if("blockquote"===p?.type){const t=p,s=t.raw+"\n"+e.join("\n"),l=this.blockquote(s);i[i.length-1]=l,n=n.substring(0,n.length-t.raw.length)+l.raw,r=r.substring(0,r.length-t.text.length)+l.text;break}if("list"!==p?.type);else{const t=p,s=t.raw+"\n"+e.join("\n"),l=this.list(s);i[i.length-1]=l,n=n.substring(0,n.length-p.raw.length)+l.raw,r=r.substring(0,r.length-t.raw.length)+l.raw,e=s.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;e;){let n=!1,r="",c="";if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),o=e.split("\n",1)[0],p=!a.trim(),u=0;if(this.options.pedantic?(u=2,c=a.trimStart()):p?u=t[1].length+1:(u=t[2].search(/[^ ]/),u=u>4?1:u,c=a.slice(u),u+=t[1].length),p&&/^ *$/.test(o)&&(r+=o+"\n",e=e.substring(o.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(o=l,this.options.pedantic&&(o=o.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(o))break;if(s.test(o))break;if(t.test(o))break;if(n.test(e))break;if(o.search(/[^ ]/)>=u||!o.trim())c+="\n"+o.slice(u);else{if(p)break;if(a.search(/[^ ]/)>=4)break;if(i.test(a))break;if(s.test(a))break;if(n.test(a))break;c+="\n"+o}p||o.trim()||(p=!0),r+=l+"\n",e=e.substring(l.length+1),a=o.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(r)&&(l=!0));let h,A=null;this.options.gfm&&(A=/^\[[ xX]\] /.exec(c),A&&(h="[ ] "!==A[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:r,task:!!A,checked:h,loose:!1,text:c,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=be(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ae(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=fe(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),we(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return we(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,s,l=n,c=0;const a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(s=[...i].length,r[3]||r[4]){l+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+c);const t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const o=a.slice(2,-2);return{type:"strong",raw:a,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Ae(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Ae(t[1]),n="mailto:"+e):(e=Ae(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=Ae(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=Ae(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Ae(t[0]),{type:"text",raw:t[0],text:e}}}}const ye=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Se=/(?:[*+-]|\d{1,9}[.)])/,ve=Ie(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Se).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Te=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ee=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xe=Ie(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Me=Ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Se).getRegex(),Ze="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",He=/|$))/,ze=Ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",He).replace("tag",Ze).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Re=Ie(Te).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ze).getRegex(),Pe={blockquote:Ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Re).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:xe,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ye,html:ze,lheading:ve,list:Me,newline:/^(?: *(?:\n|$))+/,paragraph:Re,table:ge,text:/^[^\n]+/},Be=Ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ze).getRegex(),Ge={...Pe,table:Be,paragraph:Ie(Te).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Be).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ze).getRegex()},je={...Pe,html:Ie("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",He).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ge,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ie(Te).replace("hr",ye).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ve).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ue=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Oe=/^( {2,}|\\)\n(?!\s*$)/,De="\\p{P}\\p{S}",Ne=Ie(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,De).getRegex(),Xe=Ie(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,De).getRegex(),We=Ie("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,De).getRegex(),Qe=Ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,De).getRegex(),Je=Ie(/\\([punct])/,"gu").replace(/punct/g,De).getRegex(),Ce=Ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ve=Ie(He).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ye=Ie("^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ve).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Le=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fe=Ie(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Le).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qe=Ie(/^!?\[(label)\]\[(ref)\]/).replace("label",Le).replace("ref",Ee).getRegex(),Ke=Ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ee).getRegex(),_e={_backpedal:ge,anyPunctuation:Je,autolink:Ce,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Oe,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ge,emStrongLDelim:Xe,emStrongRDelimAst:We,emStrongRDelimUnd:Qe,escape:Ue,link:Fe,nolink:Ke,punctuation:Ne,reflink:qe,reflinkSearch:Ie("reflink|nolink(?!\\()","g").replace("reflink",qe).replace("nolink",Ke).getRegex(),tag:Ye,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?t.push(r):(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(i.raw+="\n"+r.raw,i.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s)))i=t[t.length-1],n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=s.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,s,l,c,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,c))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(c=n.raw.slice(-1)),l=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class st{options;parser;constructor(e){this.options=e||se}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],i=e.replace(/\n$/,"")+"\n";return r?''+(n?i:Ae(i,!0))+"
\n":""+(n?i:Ae(i,!0))+"
\n"}blockquote({tokens:e}){return`\n${this.parser.parse(e)} \n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} \n`}hr(e){return" \n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+""+i+">\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`${t} \n`}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`${this.parser.parseInline(e)}
\n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n"}tablerow({text:e}){return`\n${e} \n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`${n}>\n`}strong({tokens:e}){return`${this.parser.parseInline(e)} `}em({tokens:e}){return`${this.parser.parseInline(e)} `}codespan({text:e}){return`${e}
`}br(e){return" "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=me(e);if(null===i)return r;let s='"+r+" ",s}image({href:e,title:t,text:n}){const r=me(e);if(null===r)return n;let i=` ",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class lt{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class ct{options;renderer;textRenderer;constructor(e){this.options=e||se,this.options.renderer=this.options.renderer||new st,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new lt}static parse(e,t){return new ct(t).parse(e)}static parseInline(e,t){return new ct(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r{const i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new st(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ke(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new at;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],s=t[r];at.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));const n=i.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return it.lex(e,t??this.defaults)}parser(e,t){return ct.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{const i={...r},s={...this.defaults,...i},l=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(l);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let i=t(r,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(e){return l(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="An error occurred:
"+Ae(n.message+"",!0)+" ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function pt(e,t){return ot.parse(e,t)}pt.options=pt.setOptions=function(e){return ot.setOptions(e),pt.defaults=ot.defaults,le(pt.defaults),pt},pt.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},pt.defaults=se,pt.use=function(...e){return ot.use(...e),pt.defaults=ot.defaults,le(pt.defaults),pt},pt.walkTokens=function(e,t){return ot.walkTokens(e,t)},pt.parseInline=ot.parseInline,pt.Parser=ct,pt.parser=ct.parse,pt.Renderer=st,pt.TextRenderer=lt,pt.Lexer=it,pt.lexer=it.lex,pt.Tokenizer=ke,pt.Hooks=at,pt.parse=pt,pt.options,pt.setOptions,pt.use,pt.walkTokens,pt.parseInline,ct.parse,it.lex;const ut=({content:e,noResult:t,postId:n,source:r,showFeedbackSection:s})=>{if(t)return(0,i.createElement)(ie,null);return e&&e.length>0?(0,i.createElement)(i.Fragment,null,(0,i.createElement)((({markdownText:e})=>{const[t,n]=(0,i.useState)("");return(0,i.useEffect)((()=>{const t=pt(e);n(t)}),[e]),(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:t}})}),{markdownText:e}),s&&e&&e.length>0&&(0,i.createElement)(ee,{postId:n,source:r})):(0,i.createElement)(i.Fragment,null)};var ht,At,dt,It,mt,gt;function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ft,null)," ",(0,i.createElement)(ft,null)," ",(0,i.createElement)(ft,null)),kt=n(893),yt=function(){return yt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?Wt($t,--Kt):0,Ft--,10===_t&&(Ft=1,Lt--),_t}function sn(){return _t=Kt2||on(_t)>3?"":" "}function hn(e,t){for(;--t&&sn()&&!(_t<48||_t>102||_t>57&&_t<65||_t>70&&_t<97););return an(e,cn()+(t<6&&32==ln()&&32==sn()))}function An(e){for(;sn();)switch(_t){case e:return Kt;case 34:case 39:34!==e&&39!==e&&An(_t);break;case 40:41===e&&An(e);break;case 92:sn()}return Kt}function dn(e,t){for(;sn()&&e+_t!==57&&(e+_t!==84||47!==ln()););return"/*"+an(t,Kt-1)+"*"+jt(47===e?e:sn())}function In(e){for(;!on(ln());)sn();return an(e,Kt)}function mn(e,t){for(var n="",r=0;r6)switch(Wt(e,t+1)){case 109:if(45!==Wt(e,t+4))break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Mt+"$2-$3$1"+xt+(108==Wt(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Xt(e,"stretch",0)?bn(Nt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Nt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,s,l,c){return Et+n+":"+r+c+(i?Et+n+"-span:"+(s?l:+l-+r)+c:"")+e}));case 4949:if(121===Wt(e,t+6))return Nt(e,":",":"+Mt)+e;break;case 6444:switch(Wt(e,45===Wt(e,14)?18:11)){case 120:return Nt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Mt+(45===Wt(e,14)?"inline-":"")+"box$3$1"+Mt+"$2$3$1"+Et+"$2box$3")+e;case 100:return Nt(e,":",":"+Et)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Nt(e,"scroll-","scroll-snap-")+e}return e}function fn(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case zt:return void(e.return=bn(e.value,e.length,n));case Pt:return mn([tn(e,{value:Nt(e.value,"@","@"+Mt)})],r);case Ht:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(Dt(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":nn(tn(e,{props:[Nt(t,/:(read-\w+)/,":"+xt+"$1")]})),nn(tn(e,{props:[t]})),Ut(e,{props:Yt(n,r)});break;case"::placeholder":nn(tn(e,{props:[Nt(t,/:(plac\w+)/,":"+Mt+"input-$1")]})),nn(tn(e,{props:[Nt(t,/:(plac\w+)/,":"+xt+"$1")]})),nn(tn(e,{props:[Nt(t,/:(plac\w+)/,Et+"input-$1")]})),nn(tn(e,{props:[t]})),Ut(e,{props:Yt(n,r)})}return""}))}}function wn(e){return function(e){return $t="",e}(kn("",null,null,null,[""],e=function(e){return Lt=Ft=1,qt=Jt($t=e),Kt=0,[]}(e),0,[0],e))}function kn(e,t,n,r,i,s,l,c,a){for(var o=0,p=0,u=l,h=0,A=0,d=0,I=1,m=1,g=1,b=0,f="",w=i,k=s,y=r,S=f;m;)switch(d=b,b=sn()){case 40:if(108!=d&&58==Wt(S,u-1)){-1!=Xt(S+=Nt(pn(b),"&","&\f"),"&\f",Gt(o?c[o-1]:0))&&(g=-1);break}case 34:case 39:case 91:S+=pn(b);break;case 9:case 10:case 13:case 32:S+=un(d);break;case 92:S+=hn(cn()-1,7);continue;case 47:switch(ln()){case 42:case 47:Vt(Sn(dn(sn(),cn()),t,n,a),a);break;default:S+="/"}break;case 123*I:c[o++]=Jt(S)*g;case 125*I:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+p:-1==g&&(S=Nt(S,/\f/g,"")),A>0&&Jt(S)-u&&Vt(A>32?vn(S+";",r,n,u-1,a):vn(Nt(S," ","")+";",r,n,u-2,a),a);break;case 59:S+=";";default:if(Vt(y=yn(S,t,n,o,p,i,c,f,w=[],k=[],u,s),s),123===b)if(0===p)kn(S,t,y,y,w,s,u,c,k);else switch(99===h&&110===Wt(S,3)?100:h){case 100:case 108:case 109:case 115:kn(e,y,y,r&&Vt(yn(e,y,y,0,0,i,c,f,i,w=[],u,k),k),i,k,u,c,r?w:k);break;default:kn(S,y,y,y,[""],k,0,c,k)}}o=p=A=0,I=g=1,f=S="",u=l;break;case 58:u=1+Jt(S),A=d;default:if(I<1)if(123==b)--I;else if(125==b&&0==I++&&125==rn())continue;switch(S+=jt(b),b*I){case 38:g=p>0?1:(S+="\f",-1);break;case 44:c[o++]=(Jt(S)-1)*g,g=1;break;case 64:45===ln()&&(S+=pn(sn())),h=ln(),p=u=Jt(f=S+=In(cn())),b++;break;case 45:45===d&&2==Jt(S)&&(I=0)}}return s}function yn(e,t,n,r,i,s,l,c,a,o,p,u){for(var h=i-1,A=0===i?s:[""],d=Ct(A),I=0,m=0,g=0;I0?A[b]+" "+f:Nt(f,/&\f/g,A[b])))&&(a[g++]=w);return en(e,t,n,0===i?Ht:c,a,o,p,u)}function Sn(e,t,n,r){return en(e,t,n,Zt,jt(_t),Qt(e,2,-2),0,r)}function vn(e,t,n,r,i){return en(e,t,n,zt,Qt(e,0,r),Qt(e,r+1,-1),r,i)}var Tn={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},En="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",xn="active",Mn="data-styled-version",Zn="6.1.12",Hn="/*!sc*/\n",zn="undefined"!=typeof window&&"HTMLElement"in window,Rn=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),Pn=(new Set,Object.freeze([])),Bn=Object.freeze({});var Gn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),jn=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Un=/(^-|-$)/g;function On(e){return e.replace(jn,"-").replace(Un,"")}var Dn=/(a)(d)/gi,Nn=52,Xn=function(e){return String.fromCharCode(e+(e>25?39:97))};function Wn(e){var t,n="";for(t=Math.abs(e);t>Nn;t=t/Nn|0)n=Xn(t%Nn)+n;return(Xn(t%Nn)+n).replace(Dn,"$1-$2")}var Qn,Jn=5381,Cn=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Vn=function(e){return Cn(Jn,e)};function Yn(e){return Wn(Vn(e)>>>0)}function Ln(e){return"string"==typeof e&&!0}var Fn="function"==typeof Symbol&&Symbol.for,qn=Fn?Symbol.for("react.memo"):60115,Kn=Fn?Symbol.for("react.forward_ref"):60112,$n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},er={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},tr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nr=((Qn={})[Kn]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Qn[qn]=tr,Qn);function rr(e){return("type"in(t=e)&&t.type.$$typeof)===qn?tr:"$$typeof"in e?nr[e.$$typeof]:$n;var t}var ir=Object.defineProperty,sr=Object.getOwnPropertyNames,lr=Object.getOwnPropertySymbols,cr=Object.getOwnPropertyDescriptor,ar=Object.getPrototypeOf,or=Object.prototype;function pr(e,t,n){if("string"!=typeof t){if(or){var r=ar(t);r&&r!==or&&pr(e,r,n)}var i=sr(t);lr&&(i=i.concat(lr(t)));for(var s=rr(e),l=rr(t),c=0;c0?" Args: ".concat(t.join(", ")):""))}var fr=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw br(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,s=r;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(a+="".concat(e,","))})),r+="".concat(l).concat(c,'{content:"').concat(a,'"}').concat(Hn)},s=0;s0?".".concat(t):e},p=a.slice();p.push((function(e){e.type===Ht&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Or,n).replace(r,o))})),l.prefix&&p.push(fn),p.push(gn);var u=function(e,i,s,c){void 0===i&&(i=""),void 0===s&&(s=""),void 0===c&&(c="&"),t=c,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var a=e.replace(Dr,""),o=wn(s||i?"".concat(s," ").concat(i," { ").concat(a," }"):a);l.namespace&&(o=Nr(o,l.namespace));var u,h,A,d=[];return mn(o,(u=p.concat((A=function(e){return d.push(e)},function(e){e.root||(e=e.return)&&A(e)})),h=Ct(u),function(e,t,n,r){for(var i="",s=0;s="A"&&e<="Z"};function qr(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var l=n(i,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,l)}r=Ar(r,s),this.staticRulesId=s}else{for(var c=Cn(this.baseHash,n.hash),a="",o=0;o>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(a,".".concat(h),void 0,this.componentId)),r=Ar(r,h)}}return r},e}(),ri=s().createContext(void 0);ri.Consumer;var ii={};function si(e,t,n){var r=hr(e),l=e,c=!Ln(e),a=t.attrs,o=void 0===a?Pn:a,p=t.componentId,u=void 0===p?function(e,t){var n="string"!=typeof e?"sc":On(e);ii[n]=(ii[n]||0)+1;var r="".concat(n,"-").concat(Yn(Zn+n+ii[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):p,h=t.displayName,A=void 0===h?function(e){return Ln(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e):h,d=t.displayName&&t.componentId?"".concat(On(t.displayName),"-").concat(t.componentId):t.componentId||u,I=r&&l.attrs?l.attrs.concat(o).filter(Boolean):o,m=t.shouldForwardProp;if(r&&l.shouldForwardProp){var g=l.shouldForwardProp;if(t.shouldForwardProp){var b=t.shouldForwardProp;m=function(e,t){return g(e,t)&&b(e,t)}}else m=g}var f=new ni(n,d,r?l.componentStyle:void 0);function w(e,t){return function(e,t,n){var r=e.attrs,l=e.componentStyle,c=e.defaultProps,a=e.foldedComponentIds,o=e.styledComponentId,p=e.target,u=s().useContext(ri),h=Vr(),A=e.shouldForwardProp||h.shouldForwardProp,d=function(e,t,n){return void 0===n&&(n=Bn),e.theme!==n.theme&&e.theme||t||n.theme}(t,u,c)||Bn,I=function(e,t,n){for(var r,i=yt(yt({},t),{className:void 0,theme:n}),s=0;s2&&Ur.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=Hr(),r=dr([n&&'nonce="'.concat(n,'"'),"".concat(En,'="true"'),"".concat(Mn,'="').concat(Zn,'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw br(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw br(2);var n=e.instance.toString();if(!n)return[];var r=((t={})[En]="",t[Mn]=Zn,t.dangerouslySetInnerHTML={__html:n},t),i=Hr();return i&&(r.nonce=i),[s().createElement("style",yt({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ur({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw br(2);return s().createElement(Yr,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw br(3)}}(),"__sc-".concat(En,"__");const Ai={"aria-busy":!0,role:"progressbar"},di=ui.div`
+ display: ${e=>e.$visible?"flex":"none"};
+`,Ii=242.776657104492,mi=hi`
+12.5% {
+ stroke-dasharray: ${33.98873199462888}px, ${Ii}px;
+ stroke-dashoffset: -${26.70543228149412}px;
+}
+43.75% {
+ stroke-dasharray: ${84.97182998657219}px, ${Ii}px;
+ stroke-dashoffset: -${84.97182998657219}px;
+}
+100% {
+ stroke-dasharray: ${2.42776657104492}px, ${Ii}px;
+ stroke-dashoffset: -${240.34889053344708}px;
+}
+`,gi=(ui.path`
+ stroke-dasharray: ${2.42776657104492}px, ${Ii};
+ stroke-dashoffset: 0;
+ animation: ${mi} ${1.6}s linear infinite;
+`,hi`
+to {
+ transform: rotate(360deg);
+ }
+`),bi=(ui.svg`
+ animation: ${gi} 0.75s steps(12, end) infinite;
+ animation-duration: 0.75s;
+`,ui.polyline`
+ stroke-width: ${e=>e.width}px;
+ stroke-linecap: round;
+
+ &:nth-child(12n + 0) {
+ stroke-opacity: 0.08;
+ }
+
+ &:nth-child(12n + 1) {
+ stroke-opacity: 0.17;
+ }
+
+ &:nth-child(12n + 2) {
+ stroke-opacity: 0.25;
+ }
+
+ &:nth-child(12n + 3) {
+ stroke-opacity: 0.33;
+ }
+
+ &:nth-child(12n + 4) {
+ stroke-opacity: 0.42;
+ }
+
+ &:nth-child(12n + 5) {
+ stroke-opacity: 0.5;
+ }
+
+ &:nth-child(12n + 6) {
+ stroke-opacity: 0.58;
+ }
+
+ &:nth-child(12n + 7) {
+ stroke-opacity: 0.66;
+ }
+
+ &:nth-child(12n + 8) {
+ stroke-opacity: 0.75;
+ }
+
+ &:nth-child(12n + 9) {
+ stroke-opacity: 0.83;
+ }
+
+ &:nth-child(12n + 11) {
+ stroke-opacity: 0.92;
+ }
+`,({height:e=80,width:t=80,radius:n=9,color:r="#4fa94d",ariaLabel:i="three-dots-loading",wrapperStyle:s,wrapperClass:l,visible:c=!0})=>(0,kt.jsx)(di,{style:s,$visible:c,className:l,"data-testid":"three-dots-loading","aria-label":i,...Ai,children:(0,kt.jsxs)("svg",{width:t,height:e,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,"data-testid":"three-dots-svg",children:[(0,kt.jsxs)("circle",{cx:"15",cy:"15",r:Number(n)+6,children:[(0,kt.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,kt.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]}),(0,kt.jsxs)("circle",{cx:"60",cy:"15",r:n,attributeName:"fill-opacity",from:"1",to:"0.3",children:[(0,kt.jsx)("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),(0,kt.jsx)("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})]}),(0,kt.jsxs)("circle",{cx:"105",cy:"15",r:Number(n)+6,children:[(0,kt.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,kt.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]})]})})),fi=hi`
+to {
+ stroke-dashoffset: 136;
+ }
+`;ui.polygon`
+ stroke-dasharray: 17;
+ animation: ${fi} 2.5s cubic-bezier(0.35, 0.04, 0.63, 0.95) infinite;
+`,ui.svg`
+ transform-origin: 50% 65%;
+`;var wi,ki=e=>{const[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(!1),[c,a]=(0,l.useState)(""),[o,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(),[A,d]=(0,l.useState)("kb"),[I,m]=(0,l.useState)({}),[g,b]=(0,l.useState)(!1),f=(e,t,n)=>{const r=e.replace(/\n/g," ");p(r),h(t),q.persistResult(r,t),q.persistSearchInput(n),t&&K("help_search",{label_key:"term",term:n,page:window.location.href.toString()})},w=async(e,t)=>{try{return await E()({path:"/newfold-multi-search/v1/multi_search",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,brand:t})})}catch(e){return console.error("Error fetching multi-search results:",e),{}}};(0,l.useEffect)((()=>{a(""),p("")}),[e.refresh]),(0,l.useEffect)((()=>{(async()=>{try{const{content:e,postId:t}=q.getResultInfo();e&&p(e),t&&h(t);const n=q.getSearchInput()||"";a(n);const r=await F(),i=await w(n,r);m({hits:i?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching initial data:",e)}})()}),[]);const k=(0,l.useMemo)((()=>(0,U.debounce)((async e=>{if(e&&0!==e.length){b(!0);try{const t=await F(),n=await w(e,t);n?.results?.[0]?.grouped_hits&&m({hits:n?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching debounced results:",e)}finally{b(!1)}}else m({})}),500)),[]);return(0,l.useEffect)((()=>{k.cancel()}),[]),t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(wt,null)):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"search-container"},(0,i.createElement)("button",{onClick:()=>{document.getElementById("search-input-box").focus()}},(0,i.createElement)(J,null)),(0,i.createElement)("input",{type:"text",id:"search-input-box",style:{flexGrow:2},value:c,maxLength:"144",placeholder:(0,z.__)("Ask me anything…","wp-module-help-center"),onChange:e=>{a(e.target.value),f("",void 0,e.target.value),s(!1),k(e.target.value)},onKeyDown:async e=>{"Enter"===e.key&&await(async()=>{n(!0);try{const e=I.hits[0].hits;if(e.length>0&&((e,t,n)=>{const r=t/e.split(/\s+/).length;return n>=1&&r>=.99})(c,e[0].text_match_info?.tokens_matched,e[0].text_match_info?.fields_matched))return void f(e[0].document.post_content,e[0].document.post_id,c);d("ai");const t=await W.getSearchResult(c,"helpcenter");f(t.result[0].text,t.post_id,c)}catch(e){s(!0)}finally{n(!1)}})()}})),(0,i.createElement)("div",{className:"attribute"},(0,i.createElement)("p",null,(0,i.createElement)("span",null,c?c.length:0,"/144"))),g?(0,i.createElement)(bi,{height:"40",width:"40",radius:"4",color:"#196BDE",ariaLabel:"three-dots-loading",wrapperStyle:{},visible:!0}):(0,i.createElement)(ut,{content:o,noResult:r,postId:u,source:A,showFeedbackSection:!o.includes("do not possess the answer")}),I?.hits?.length>0&&(0,i.createElement)("p",null,(0,i.createElement)("b",null,o?.length>0?(0,z.__)("Other Resources","wp-module-help-center"):(0,z.__)("Search Suggestions","wp-module-help-center"))),I?.hits?.map(((e,t)=>{const n=document.createElement("span");n.setAttribute("display","none"),n.innerHTML=e?.group_key;const r=n.textContent||n.innerText;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Y,{key:t,searchTitle:r,onGo:()=>{a(r),f(e?.hits[0]?.document?.post_content,e?.hits[0]?.document?.id,r)}}))})))},yi=e=>{const[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{(async()=>{try{const e=await E()({path:L+"/capability",method:"GET"});s(e)}catch(e){s(!1)}})()}),[]),(0,l.useEffect)((()=>{const e=()=>{n(q.getHelpVisible())};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}),[]),r&&t?(0,i.createElement)("div",{className:"nfd-help-center"},(0,i.createElement)(ki,{refresh:e.refresh})):(0,i.createElement)(i.Fragment,null)},Si=({onClose:e})=>{const[t,n]=(0,l.useState)("");(0,l.useEffect)((()=>{const e=q.getHelpVisible();xi(e),(async()=>{const e=await F();n(e.toLowerCase())})()}),[]);const[r,s]=(0,l.useState)(!1);return(0,i.createElement)("div",{className:"modal"},(0,i.createElement)("div",{className:"modal-header"},(0,i.createElement)("h3",{className:"heading"},(0,i.createElement)("span",{className:"icon"},(0,i.createElement)(j,null)),(0,z.__)("Help Center","wp-module-help-center")),(0,i.createElement)("button",{className:"close-button",onClick:()=>{e(),s(!r)}},(0,i.createElement)("div",{className:"icon-button"},(0,i.createElement)(B,null)))),(0,i.createElement)(yi,{closeHelp:()=>{e(),s(!r)},refresh:r,brand:t}))};function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&(async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:i=100}={}}={}})=>{!e||!x(e)&&(!t&&!n||((0,c.dispatch)(v).initializeNamespace(e),(0,c.dispatch)(v).updateHiiveUrls({single:t,batch:n},e),(0,c.dispatch)(v).updateHiiveDebounceTime(r,e),(0,c.dispatch)(v).updateHiiveEventsQueueThreshold(i,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}}))})({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"}})}));const Ei=document.getElementById("wpcontent"),xi=e=>{Ei.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),q.updateHelpVisible(e),window.dispatchEvent(new Event("storage"))};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=q.getHelpVisible();if(Object.is(e,void 0))return xi(!0),void K("help_sidebar_opened",{page:window.location.href.toString()});e||K("help_sidebar_opened",{page:window.location.href.toString()}),xi(!e)})()},renderEmbeddedHelp:()=>{const e=document.createElement("div");e.id="nfd-help-center",e.style.display="none",Ei.appendChild(e);const t=document.getElementById("nfd-help-center");null!==t&&("undefined"!==l.createRoot?(0,l.createRoot)(t).render((0,i.createElement)(Si,{onClose:()=>{xi(!1),q.clear()}})):"undefined"!==l.render&&(0,l.render)((0,i.createElement)(Si,{onClose:()=>{xi(!1),q.clear()}}),t))}};const Mi=(0,c.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?Mi():o()((()=>{const e=document.querySelector(".edit-post-header__settings");if(!e)return;const t=document.createElement("div");t.id="nfd-help-menu-button-wrapper",t.classList.add("nfd-help-menu-button-wrapper");const n=e.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");n?e.insertBefore(t,n):e.appendChild(t);const r=(0,i.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,i.createElement)(Ti,null));(0,l.render)(r,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=q.getHelpVisible();q.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),xi(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),i=document.getElementById("nfd-help-center");let s=0;const l=setInterval((()=>{if(s++,i&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(i)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(l)}else s>=5&&clearInterval(l)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))}()}();
\ No newline at end of file
diff --git a/composer.lock b/composer.lock
index d58cb90..2df4e1a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -512,16 +512,16 @@
},
{
"name": "newfold-labs/wp-module-data",
- "version": "2.6.1",
+ "version": "2.6.2",
"source": {
"type": "git",
"url": "https://github.com/newfold-labs/wp-module-data.git",
- "reference": "49dc91eec8053872354db9cddd355e45f2de49e4"
+ "reference": "91d1b03162f23b7b8bd3a41d9496eb8017df0051"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/49dc91eec8053872354db9cddd355e45f2de49e4",
- "reference": "49dc91eec8053872354db9cddd355e45f2de49e4",
+ "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/91d1b03162f23b7b8bd3a41d9496eb8017df0051",
+ "reference": "91d1b03162f23b7b8bd3a41d9496eb8017df0051",
"shasum": ""
},
"require": {
@@ -603,10 +603,10 @@
],
"description": "Newfold Data Module",
"support": {
- "source": "https://github.com/newfold-labs/wp-module-data/tree/2.6.1",
+ "source": "https://github.com/newfold-labs/wp-module-data/tree/2.6.2",
"issues": "https://github.com/newfold-labs/wp-module-data/issues"
},
- "time": "2024-07-25T16:37:25+00:00"
+ "time": "2024-08-16T14:18:26+00:00"
},
{
"name": "newfold-labs/wp-module-features",
diff --git a/includes/MultiSearchController.php b/includes/MultiSearchController.php
index e706f7b..c579fcf 100644
--- a/includes/MultiSearchController.php
+++ b/includes/MultiSearchController.php
@@ -14,7 +14,7 @@ class MultiSearchController extends \WP_REST_Controller {
*/
protected $namespace = 'newfold-multi-search/v1';
- /**
+ /**
* The base of this controller's route
*
* @var string
@@ -22,28 +22,28 @@ class MultiSearchController extends \WP_REST_Controller {
protected $rest_base = 'multi_search';
/**
- * The API key for the multi-search service
- *
- * @var string
- */
- protected $apiKey;
+ * The API key for the multi-search service
+ *
+ * @var string
+ */
+ protected $api_key;
- /**
- * The endpoint for the multi-search service
- *
- * @var string
- */
- protected $endpoint;
+ /**
+ * The endpoint for the multi-search service
+ *
+ * @var string
+ */
+ protected $endpoint;
/**
- * Constructor to initialize the API key and endpoint
- */
- public function __construct() {
- $this->apiKey = 'B9wvYIokTPPgXEM3isTqsxbDOva21igT';
- $this->endpoint = 'https://search.hiive.cloud/multi_search?x-typesense-api-key=' . $this->apiKey;
- }
+ * Constructor to initialize the API key and endpoint
+ */
+ public function __construct() {
+ $this->api_key = 'B9wvYIokTPPgXEM3isTqsxbDOva21igT';
+ $this->endpoint = 'https://search.hiive.cloud/multi_search?x-typesense-api-key=' . $this->api_key;
+ }
- /**
+ /**
* Register the routes for this objects of the controller
*/
public function register_routes() {
@@ -64,57 +64,62 @@ public function register_routes() {
),
)
);
- }
+ }
- public function get_multi_search_result( \WP_REST_Request $request ) {
+ /**
+ * Fetch the result from typesense
+ *
+ * @param \WP_REST_Request $request the REST request object
+ */
+ public function get_multi_search_result( \WP_REST_Request $request ) {
$brand = sanitize_text_field( $request->get_param( 'brand' ) );
$query = sanitize_text_field( $request->get_param( 'query' ) );
-
- $params = [
- 'searches' => [
- [
- 'q' => $query,
- 'query_by' => 'post_title,post_content',
- 'group_by' => 'post_title',
- 'group_limit' => 1,
- 'sort_by' => '_text_match:desc,post_likes:desc',
- 'filter_by' => 'post_category:=' . $brand,
+
+ $params = array(
+ 'searches' => array(
+ array(
+ 'q' => $query,
+ 'query_by' => 'post_title,post_content',
+ 'group_by' => 'post_title',
+ 'group_limit' => 1,
+ 'sort_by' => '_text_match:desc,post_likes:desc',
+ 'filter_by' => 'post_category:=' . $brand,
'prioritize_token_position' => true,
- 'limit_hits' => 3,
- 'per_page' => 3,
- 'highlight_full_fields' => 'post_title,post_content',
- 'collection' => 'nfd_help_articles',
- 'page' => 1,
- ]
- ]
- ];
-
- $args = [
- 'body' => json_encode( $params ),
- 'headers' => [
- 'Content-Type' => 'application/json',
- 'X-TYPESENSE-API-KEY' => $this->apiKey,
- ],
- ];
-
+ 'limit_hits' => 3,
+ 'per_page' => 3,
+ 'highlight_full_fields' => 'post_title,post_content',
+ 'collection' => 'nfd_help_articles',
+ 'page' => 1,
+ ),
+ ),
+ );
+
+ $args = array(
+ 'body' => wp_json_encode( $params ),
+ 'headers' => array(
+ 'Content-Type' => 'application/json',
+ 'X-TYPESENSE-API-KEY' => $this->api_key,
+ ),
+ );
+
$response = wp_remote_post( $this->endpoint, $args );
if ( is_wp_error( $response ) ) {
- return new WP_Error( 'request_failed', 'The request failed', array( 'status' => 500 ) );
+ return new \WP_Error( 'request_failed', 'The request failed', array( 'status' => 500 ) );
}
-
+
$body = wp_remote_retrieve_body( $response );
- $data = json_decode( $body, true );
+ $data = json_decode( $body, true );
if ( empty( $data ) ) {
- return new WP_Error( 'no_data', 'No data found', array( 'status' => 404 ) );
+ return new \WP_Error( 'no_data', 'No data found', array( 'status' => 404 ) );
}
-
+
return rest_ensure_response( $data );
- }
+ }
- /**
+ /**
* Check permissions for routes.
*
- * @return \WP_Error
+ * @return \WP_Error|boolean
*/
public function check_permission() {
if ( ! current_user_can( 'manage_options' ) ) {
@@ -126,5 +131,4 @@ public function check_permission() {
}
return true;
}
-
-}
\ No newline at end of file
+}
diff --git a/package-lock.json b/package-lock.json
index 1263b34..1b7229e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,6 +18,7 @@
"algoliasearch": "4.20.0",
"lodash": "4.17.21",
"lodash.debounce": "4.0.8",
+ "marked": "14.0.0",
"react-instantsearch-hooks-web": "6.43.0",
"react-loader-spinner": "6.1.6",
"react-router-dom": "6.6.2",
@@ -15123,6 +15124,18 @@
"integrity": "sha512-oEacRUVeTJ5D5hW1UYd2qExYI0oELdYK72k1TKGvIeYJIbqQWAz476NAc7LNixSySUhcNl++d02DvX0ccDk9/w==",
"dev": true
},
+ "node_modules/marked": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz",
+ "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==",
+ "license": "MIT",
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
"node_modules/mathml-tag-names": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
@@ -32651,6 +32664,11 @@
"integrity": "sha512-oEacRUVeTJ5D5hW1UYd2qExYI0oELdYK72k1TKGvIeYJIbqQWAz476NAc7LNixSySUhcNl++d02DvX0ccDk9/w==",
"dev": true
},
+ "marked": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz",
+ "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ=="
+ },
"mathml-tag-names": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
diff --git a/package.json b/package.json
index cbfb924..20deb70 100644
--- a/package.json
+++ b/package.json
@@ -28,6 +28,7 @@
"algoliasearch": "4.20.0",
"lodash": "4.17.21",
"lodash.debounce": "4.0.8",
+ "marked": "14.0.0",
"react-instantsearch-hooks-web": "6.43.0",
"react-loader-spinner": "6.1.6",
"react-router-dom": "6.6.2",
diff --git a/src/components/ResultContent.js b/src/components/ResultContent.js
index 894e0ca..2bb9aab 100644
--- a/src/components/ResultContent.js
+++ b/src/components/ResultContent.js
@@ -1,6 +1,8 @@
//
import Feedback from './Feedback';
import NoResults from './NoResults';
+import { useEffect, useState } from 'react';
+import { marked } from 'marked';
export const ResultContent = ( {
content,
@@ -13,10 +15,22 @@ export const ResultContent = ( {
return ;
}
+ const MarkdownRenderer = ( { markdownText } ) => {
+ const [ htmlContent, setHtmlContent ] = useState( '' );
+
+ useEffect( () => {
+ // Convert Markdown to HTML whenever markdownText changes
+ const convertedHTML = marked( markdownText );
+ setHtmlContent( convertedHTML );
+ }, [ markdownText ] ); // Dependency array ensures this runs on markdownText change
+
+ return
;
+ };
+
if ( content && content.length > 0 ) {
return (
<>
-
+
{ showFeedbackSection && content && content.length > 0 && (
) }
diff --git a/src/components/SearchResults.js b/src/components/SearchResults.js
index 5a31678..d433c03 100644
--- a/src/components/SearchResults.js
+++ b/src/components/SearchResults.js
@@ -1,10 +1,8 @@
/* eslint-disable no-shadow */
import { debounce } from 'lodash';
-import { useEffect, useState, useMemo, useRef } from '@wordpress/element';
+import { useEffect, useState, useMemo } from '@wordpress/element';
import moduleAI from '@newfold-labs/wp-module-ai';
-//
import { ReactComponent as SearchIcon } from '../icons/search.svg';
-//
import { SearchResult } from './SearchResult';
import { ResultContent } from './ResultContent';
import { Analytics, LocalStorageUtils, CapabilityAPI } from '../utils';
@@ -40,17 +38,18 @@ const SearchResults = ( props ) => {
const fetchMultiSearchResults = async ( query, brand ) => {
try {
- const response = await apiFetch({
+ const response = await apiFetch( {
path: '/newfold-multi-search/v1/multi_search',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
- body: JSON.stringify({ query, brand }),
- });
-
- return response;
+ body: JSON.stringify( { query, brand } ),
+ } );
+
+ return response;
} catch ( error ) {
+ // eslint-disable-next-line no-console
console.error( 'Error fetching multi-search results:', error );
return {};
}
@@ -70,7 +69,7 @@ const SearchResults = ( props ) => {
setPostId( currentResultPostId );
}
const savedInput = LocalStorageUtils.getSearchInput();
- const input = savedInput || ' ';
+ const input = savedInput || '';
setSearchInput( input );
const brand = await CapabilityAPI.getBrand();
const multiSearchResults = await fetchMultiSearchResults(
@@ -78,10 +77,10 @@ const SearchResults = ( props ) => {
brand
);
setMultiResults( {
- ...multiSearchResults,
hits: multiSearchResults?.results?.[ 0 ]?.grouped_hits,
} );
} catch ( error ) {
+ // eslint-disable-next-line no-console
console.error( 'Error fetching initial data:', error );
}
};
@@ -106,7 +105,7 @@ const SearchResults = ( props ) => {
setIsLoading( true );
try {
// Check if the algolia results are close enough
- const hits = multiResults.hits;
+ const hits = multiResults.hits[ 0 ].hits;
const resultMatches =
hits.length > 0
? getResultMatches(
@@ -117,8 +116,8 @@ const SearchResults = ( props ) => {
: false;
if ( resultMatches ) {
populateSearchResult(
- hits[ 0 ].post_content,
- hits[ 0 ].post_id,
+ hits[ 0 ].document.post_content,
+ hits[ 0 ].document.post_id,
searchInput
);
return;
@@ -155,16 +154,16 @@ const SearchResults = ( props ) => {
);
if ( multiSearchResults?.results?.[ 0 ]?.grouped_hits ) {
setMultiResults( {
- ...multiSearchResults,
hits: multiSearchResults?.results?.[ 0 ]?.grouped_hits,
} );
}
} catch ( error ) {
+ // eslint-disable-next-line no-console
console.error( 'Error fetching debounced results:', error );
} finally {
setLoading( false );
}
- }, 300 );
+ }, 500 );
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [] );
@@ -223,14 +222,14 @@ const SearchResults = ( props ) => {
{ loading ? (
- // show loader when loading is true
) : (
{
onGo={ () => {
setSearchInput( postTitle );
populateSearchResult(
- result?.hits[0]?.document?.post_content,
- result?.hits[0]?.document?.id,
+ result?.hits[ 0 ]?.document?.post_content,
+ result?.hits[ 0 ]?.document?.id,
postTitle
);
} }