@coveo/quantic 3.36.8 → 3.36.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +14 -14
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/search-engine/search-engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +35 -36
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/headless-core-commerce-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recent-queries-list/headless-recent-queries-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/did-you-mean/headless-did-you-mean.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search-box/headless-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/context/headless-context.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/search-box/headless-core-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/did-you-mean/headless-did-you-mean.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facet-manager/headless-facet-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/date-facet/headless-date-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/date-facet/headless-date-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/numeric-facet/headless-numeric-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/numeric-facet/headless-numeric-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/folded-result-list/headless-folded-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/breadcrumb-manager/headless-insight-breadcrumb-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/did-you-mean/headless-insight-did-you-mean.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-manager/headless-insight-facet-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/category-facet/headless-insight-category-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/facet/headless-insight-facet-options.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/facet/headless-insight-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/date-facet/headless-insight-date-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/date-facet/headless-insight-date-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/numeric-facet/headless-insight-numeric-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/numeric-facet/headless-insight-numeric-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/folded-result-list/headless-insight-folded-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-generated-answer.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/pager/headless-insight-pager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/recent-queries-list/headless-insight-recent-queries-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/search-box/headless-insight-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/search-parameter-manager/headless-insight-search-parameter-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/sort/headless-insight-sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/tab/headless-insight-tab.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-queries-list/headless-recent-queries-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-box/headless-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-parameter-manager/headless-search-parameter-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-status/headless-search-status.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet/headless-smart-snippet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/tab/headless-tab.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/generic-analytics-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/insight-analytics-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/search-analytics-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/date-facet/date-facet-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/numeric-facet/numeric-facet-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/pagination/pagination-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/sort/sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/triggers/triggers-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facet-options/facet-options-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +10 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +10 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/sse-generated-answer-errors.d.ts +22 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/instant-results/instant-results-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search-parameters/search-parameter-actions.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/standalone-search-box-set/standalone-search-box-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +25 -25
- package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +5 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/product-enrichment/headless-product-enrichment.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/product-list/headless-product-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/summary/headless-core-summary.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-enrichment/headless-product-enrichment.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-list/headless-product-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/summary/headless-core-summary.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-inference.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/controller-definition.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/query-expression/query-expression.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +13 -13
- package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
- package/package.json +17 -18
|
@@ -14,35 +14,35 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessInsight",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessInsight"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){p=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(p)throw i}}}}function Om(){return Om=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=XT(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Om.apply(null,arguments)}function Ei(e){return Ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ei(e)}function KT(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_m(e,t)}function MS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MS=function(){return!!e})()}function JT(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WT(e)}function _m(e,t){return _m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},_m(e,t)}function XT(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ei(e))!==null;);return e}function ZT(e,t,r,n){var o=Om(Ei(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function eP(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tP(e){var t=eP(e,"string");return typeof t=="symbol"?t:t+""}function rP(e,t){if(e){if(typeof e=="string")return _S(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_S(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function nP(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function oP(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var DS=function(){function e(){Nm(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return qm(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[p];try{h.callback.call(n,r)}catch(v){Promise.resolve().then(function(){throw v})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},p=0,f=i.length;p<f;p++)a();return!r.defaultPrevented}}}])}(),Dm=function(e){function t(){var r;return Nm(this,t),r=YT(this,t),r.listeners||DS.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return KT(t,e),qm(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),ZT(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new cu;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new cu;function i(){o.abort(this.reason),a()}function a(){var h=qS(n),v;try{for(h.s();!(v=h.n()).done;){var C=v.value;C.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var p=qS(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",i)}}catch(h){p.e(h)}finally{p.f()}return o.signal}}])}(DS),cu=function(){function e(){Nm(this,e),Object.defineProperty(this,"signal",{value:new Dm,writable:!0,configurable:!0})}return qm(e,[{key:"abort",value:function(r){var n=oP(r),o=nP(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(cu.prototype[Symbol.toStringTag]="AbortController",Dm.prototype[Symbol.toStringTag]="AbortSignal");function iP(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function aP(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=a===void 0?!1:a;if(!iP({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(C,g){var S;g&&g.signal&&(S=g.signal,delete g.signal);var x=new o(C,g);return S&&Object.defineProperty(x,"signal",{writable:!1,enumerable:!1,configurable:!0,value:S}),x},f.prototype=o.prototype);var m=r,h=function(C,g){var S=f&&f.prototype.isPrototypeOf(C)?C.signal:g?g.signal:void 0;if(S){var x;try{x=new DOMException("Aborted","AbortError")}catch{x=new Error("Aborted"),x.name="AbortError"}if(S.aborted)return Promise.reject(x);var w=new Promise(function(R,I){S.addEventListener("abort",function(){return I(x)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([w,m(C,g)])}return m(C,g)};return{fetch:h,Request:f}}js.AbortController=cu;js.AbortSignal=Dm;js.abortableFetch=aP});var jS,s,A,l=Ds(()=>{"use strict";jS=Cr(Mm(),1),s=Cr(Mm(),1),{fetch:A}=(0,jS.abortableFetch)({fetch})});function Vs(e){if(hP.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function jm(e){return e.replace(yP,"")}function Ls(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!SP(r))return!1}return!0}function SP(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function LS(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var sP,$S,cP,HS,uP,lP,dP,pP,fP,mP,gP,hP,VS,yP,Fi,Vm,US,QS,BS,GS,b,WS=Ds(()=>{"use strict";d();c();l();u();sP=Object.create,$S=Object.defineProperty,cP=Object.getOwnPropertyDescriptor,HS=Object.getOwnPropertyNames,uP=Object.getPrototypeOf,lP=Object.prototype.hasOwnProperty,dP=(e,t)=>function(){return t||(0,e[HS(e)[0]])((t={exports:{}}).exports,t),t.exports},pP=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of HS(t))!lP.call(e,o)&&o!==r&&$S(e,o,{get:()=>t[o],enumerable:!(n=cP(t,o))||n.enumerable});return e},fP=(e,t,r)=>(r=e!=null?sP(uP(e)):{},pP(t||!e||!e.__esModule?$S(r,"default",{value:e,enumerable:!0}):r,e)),mP=dP({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,m){var h=f.split(";").filter(n),v=h.shift(),C=i(v),g=C.name,S=C.value;m=m?Object.assign({},r,m):r;try{S=m.decodeValues?decodeURIComponent(S):S}catch(w){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+S+"'. Set options.decodeValues to false to disable this feature.",w)}var x={name:g,value:S};return h.forEach(function(w){var R=w.split("="),I=R.shift().trimLeft().toLowerCase(),E=R.join("=");I==="expires"?x.expires=new Date(E):I==="max-age"?x.maxAge=parseInt(E,10):I==="secure"?x.secure=!0:I==="httponly"?x.httpOnly=!0:I==="samesite"?x.sameSite=E:x[I]=E}),x}function i(f){var m="",h="",v=f.split("=");return v.length>1?(m=v.shift(),h=v.join("=")):h=f,{name:m,value:h}}function a(f,m){if(m=m?Object.assign({},r,m):r,!f)return m.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var h=f.headers[Object.keys(f.headers).find(function(C){return C.toLowerCase()==="set-cookie"})];!h&&f.headers.cookie&&!m.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=h}if(Array.isArray(f)||(f=[f]),m=m?Object.assign({},r,m):r,m.map){var v={};return f.filter(n).reduce(function(C,g){var S=o(g,m);return C[S.name]=S,C},v)}else return f.filter(n).map(function(C){return o(C,m)})}function p(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var m=[],h=0,v,C,g,S,x;function w(){for(;h<f.length&&/\s/.test(f.charAt(h));)h+=1;return h<f.length}function R(){return C=f.charAt(h),C!=="="&&C!==";"&&C!==","}for(;h<f.length;){for(v=h,x=!1;w();)if(C=f.charAt(h),C===","){for(g=h,h+=1,w(),S=h;h<f.length&&R();)h+=1;h<f.length&&f.charAt(h)==="="?(x=!0,h=S,m.push(f.substring(v,g)),v=h):h=g+1}else h+=1;(!x||h>=f.length)&&m.push(f.substring(v,f.length))}return m}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=p}}),gP=fP(mP()),hP=/[^a-z0-9\-#$%&'*+.^_`|~]/i;VS=[`
|
|
19
|
-
`,"\r","\t"," "],yP=new RegExp(`(^[${VS.join("")}]|$[${VS.join("")}])`,"g");Fi=Symbol("normalizedHeaders"),Vm=Symbol("rawHeaderNames"),US=", ",b=class zS{constructor(t){this[QS]={},this[BS]=new Map,this[GS]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof zS||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(US):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(US):n)})}[(QS=Fi,BS=Vm,GS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Fi]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Ls(t))throw new TypeError(`Invalid header name "${t}"`);return this[Fi].hasOwnProperty(Vs(t))}get(t){if(!Ls(t))throw TypeError(`Invalid header name "${t}"`);return this[Fi][Vs(t)]??null}set(t,r){if(!Ls(t)||!LS(r))return;let n=Vs(t),o=jm(r);this[Fi][n]=jm(o),this[Vm].set(n,t)}append(t,r){if(!Ls(t)||!LS(r))return;let n=Vs(t),o=jm(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Ls(t)||!this.has(t))return;let r=Vs(t);delete this[Fi][r],this[Vm].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,gP.splitCookiesString)(t)}}});var d=Ds(()=>{"use strict";WS()});var cv=bt(Gs=>{"use strict";d();c();l();u();var Su=Gs&&Gs.__assign||function(){return Su=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Su.apply(this,arguments)};Object.defineProperty(Gs,"__esModule",{value:!0});var NP={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function qP(e){var t=Su(Su({},NP),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Gs.getSanitizedOptions=qP});var uv=bt(zm=>{"use strict";d();c();l();u();Object.defineProperty(zm,"__esModule",{value:!0});function DP(e){var t=Math.random()*e;return Math.round(t)}zm.fullJitter=DP});var lv=bt(Wm=>{"use strict";d();c();l();u();Object.defineProperty(Wm,"__esModule",{value:!0});function MP(e){return e}Wm.noJitter=MP});var dv=bt(Ym=>{"use strict";d();c();l();u();Object.defineProperty(Ym,"__esModule",{value:!0});var jP=uv(),VP=lv();function LP(e){switch(e.jitter){case"full":return jP.fullJitter;case"none":default:return VP.noJitter}}Ym.JitterFactory=LP});var Jm=bt(Km=>{"use strict";d();c();l();u();Object.defineProperty(Km,"__esModule",{value:!0});var UP=dv(),QP=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=UP.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Km.Delay=QP});var pv=bt(hn=>{"use strict";d();c();l();u();var BP=hn&&hn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),GP=hn&&hn.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(h){try{m(n.next(h))}catch(v){a(v)}}function f(h){try{m(n.throw(h))}catch(v){a(v)}}function m(h){h.done?i(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},$P=hn&&hn.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=m[0]&2?o.return:m[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,m[1])).done)return i;switch(o=0,i&&(m=[m[0]&2,i.value]),m[0]){case 0:case 1:i=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){r.label=m[1];break}if(m[0]===6&&r.label<i[1]){r.label=i[1],i=m;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(m);break}i[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=i=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(hn,"__esModule",{value:!0});var HP=Jm(),zP=function(e){BP(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return GP(this,void 0,void 0,function(){return $P(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(HP.Delay);hn.SkipFirstDelay=zP});var fv=bt($s=>{"use strict";d();c();l();u();var WP=$s&&$s.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($s,"__esModule",{value:!0});var YP=Jm(),KP=function(e){WP(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(YP.Delay);$s.AlwaysDelay=KP});var mv=bt(Xm=>{"use strict";d();c();l();u();Object.defineProperty(Xm,"__esModule",{value:!0});var JP=pv(),XP=fv();function ZP(e,t){var r=ek(e);return r.setAttemptNumber(t),r}Xm.DelayFactory=ZP;function ek(e){return e.delayFirstAttempt?new XP.AlwaysDelay(e):new JP.SkipFirstDelay(e)}});var gv=bt(Ro=>{"use strict";d();c();l();u();var Zm=Ro&&Ro.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(h){try{m(n.next(h))}catch(v){a(v)}}function f(h){try{m(n.throw(h))}catch(v){a(v)}}function m(h){h.done?i(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},eg=Ro&&Ro.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=m[0]&2?o.return:m[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,m[1])).done)return i;switch(o=0,i&&(m=[m[0]&2,i.value]),m[0]){case 0:case 1:i=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){r.label=m[1];break}if(m[0]===6&&r.label<i[1]){r.label=i[1],i=m;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(m);break}i[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=i=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Ro,"__esModule",{value:!0});var tk=cv(),rk=mv();function nk(e,t){return t===void 0&&(t={}),Zm(this,void 0,void 0,function(){var r,n;return eg(this,function(o){switch(o.label){case 0:return r=tk.getSanitizedOptions(t),n=new ok(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Ro.backOff=nk;var ok=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Zm(this,void 0,void 0,function(){var t,r;return eg(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Zm(this,void 0,void 0,function(){var t;return eg(this,function(r){switch(r.label){case 0:return t=rk.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var hl=bt((gh,hh)=>{"use strict";d();c();l();u();(function(e,t){typeof gh=="object"&&typeof hh<"u"?hh.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(gh,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",p="day",f="week",m="month",h="quarter",v="year",C="date",g="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var B=["th","st","nd","rd"],Q=H%100;return"["+H+(B[(Q-20)%10]||B[Q]||B[0])+"]"}},R=function(H,B,Q){var z=String(H);return!z||z.length>=B?H:""+Array(B+1-z.length).join(Q)+H},I={s:R,z:function(H){var B=-H.utcOffset(),Q=Math.abs(B),z=Math.floor(Q/60),$=Q%60;return(B<=0?"+":"-")+R(z,2,"0")+":"+R($,2,"0")},m:function H(B,Q){if(B.date()<Q.date())return-H(Q,B);var z=12*(Q.year()-B.year())+(Q.month()-B.month()),$=B.clone().add(z,m),X=Q-$<0,ee=B.clone().add(z+(X?-1:1),m);return+(-(z+(Q-$)/(X?$-ee:ee-$))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:m,y:v,w:f,d:p,D:C,h:a,m:i,s:o,ms:n,Q:h}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},E="en",P={};P[E]=w;var V="$isDayjsObject",q=function(H){return H instanceof U||!(!H||!H[V])},O=function H(B,Q,z){var $;if(!B)return E;if(typeof B=="string"){var X=B.toLowerCase();P[X]&&($=X),Q&&(P[X]=Q,$=X);var ee=B.split("-");if(!$&&ee.length>1)return H(ee[0])}else{var pe=B.name;P[pe]=B,$=pe}return!z&&$&&(E=$),$||!z&&E},N=function(H,B){if(q(H))return H.clone();var Q=typeof B=="object"?B:{};return Q.date=H,Q.args=arguments,new U(Q)},M=I;M.l=O,M.i=q,M.w=function(H,B){return N(H,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var U=function(){function H(Q){this.$L=O(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[V]=!0}var B=H.prototype;return B.parse=function(Q){this.$d=function(z){var $=z.date,X=z.utc;if($===null)return new Date(NaN);if(M.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var ee=$.match(S);if(ee){var pe=ee[2]-1||0,Re=(ee[7]||"0").substring(0,3);return X?new Date(Date.UTC(ee[1],pe,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,Re)):new Date(ee[1],pe,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,Re)}}return new Date($)}(Q),this.init()},B.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},B.$utils=function(){return M},B.isValid=function(){return this.$d.toString()!==g},B.isSame=function(Q,z){var $=N(Q);return this.startOf(z)<=$&&$<=this.endOf(z)},B.isAfter=function(Q,z){return N(Q)<this.startOf(z)},B.isBefore=function(Q,z){return this.endOf(z)<N(Q)},B.$g=function(Q,z,$){return M.u(Q)?this[z]:this.set($,Q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(Q,z){var $=this,X=!!M.u(z)||z,ee=M.p(Q),pe=function(je,it){var ft=M.w($.$u?Date.UTC($.$y,it,je):new Date($.$y,it,je),$);return X?ft:ft.endOf(p)},Re=function(je,it){return M.w($.toDate()[je].apply($.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(it)),$)},_e=this.$W,be=this.$M,we=this.$D,Ce="set"+(this.$u?"UTC":"");switch(ee){case v:return X?pe(1,0):pe(31,11);case m:return X?pe(1,be):pe(0,be+1);case f:var Te=this.$locale().weekStart||0,ut=(_e<Te?_e+7:_e)-Te;return pe(X?we-ut:we+(6-ut),be);case p:case C:return Re(Ce+"Hours",0);case a:return Re(Ce+"Minutes",1);case i:return Re(Ce+"Seconds",2);case o:return Re(Ce+"Milliseconds",3);default:return this.clone()}},B.endOf=function(Q){return this.startOf(Q,!1)},B.$set=function(Q,z){var $,X=M.p(Q),ee="set"+(this.$u?"UTC":""),pe=($={},$[p]=ee+"Date",$[C]=ee+"Date",$[m]=ee+"Month",$[v]=ee+"FullYear",$[a]=ee+"Hours",$[i]=ee+"Minutes",$[o]=ee+"Seconds",$[n]=ee+"Milliseconds",$)[X],Re=X===p?this.$D+(z-this.$W):z;if(X===m||X===v){var _e=this.clone().set(C,1);_e.$d[pe](Re),_e.init(),this.$d=_e.set(C,Math.min(this.$D,_e.daysInMonth())).$d}else pe&&this.$d[pe](Re);return this.init(),this},B.set=function(Q,z){return this.clone().$set(Q,z)},B.get=function(Q){return this[M.p(Q)]()},B.add=function(Q,z){var $,X=this;Q=Number(Q);var ee=M.p(z),pe=function(be){var we=N(X);return M.w(we.date(we.date()+Math.round(be*Q)),X)};if(ee===m)return this.set(m,this.$M+Q);if(ee===v)return this.set(v,this.$y+Q);if(ee===p)return pe(1);if(ee===f)return pe(7);var Re=($={},$[i]=t,$[a]=r,$[o]=e,$)[ee]||1,_e=this.$d.getTime()+Q*Re;return M.w(_e,this)},B.subtract=function(Q,z){return this.add(-1*Q,z)},B.format=function(Q){var z=this,$=this.$locale();if(!this.isValid())return $.invalidDate||g;var X=Q||"YYYY-MM-DDTHH:mm:ssZ",ee=M.z(this),pe=this.$H,Re=this.$m,_e=this.$M,be=$.weekdays,we=$.months,Ce=$.meridiem,Te=function(it,ft,Gt,cr){return it&&(it[ft]||it(z,X))||Gt[ft].slice(0,cr)},ut=function(it){return M.s(pe%12||12,it,"0")},je=Ce||function(it,ft,Gt){var cr=it<12?"AM":"PM";return Gt?cr.toLowerCase():cr};return X.replace(x,function(it,ft){return ft||function(Gt){switch(Gt){case"YY":return String(z.$y).slice(-2);case"YYYY":return M.s(z.$y,4,"0");case"M":return _e+1;case"MM":return M.s(_e+1,2,"0");case"MMM":return Te($.monthsShort,_e,we,3);case"MMMM":return Te(we,_e);case"D":return z.$D;case"DD":return M.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Te($.weekdaysMin,z.$W,be,2);case"ddd":return Te($.weekdaysShort,z.$W,be,3);case"dddd":return be[z.$W];case"H":return String(pe);case"HH":return M.s(pe,2,"0");case"h":return ut(1);case"hh":return ut(2);case"a":return je(pe,Re,!0);case"A":return je(pe,Re,!1);case"m":return String(Re);case"mm":return M.s(Re,2,"0");case"s":return String(z.$s);case"ss":return M.s(z.$s,2,"0");case"SSS":return M.s(z.$ms,3,"0");case"Z":return ee}return null}(it)||ee.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(Q,z,$){var X,ee=this,pe=M.p(z),Re=N(Q),_e=(Re.utcOffset()-this.utcOffset())*t,be=this-Re,we=function(){return M.m(ee,Re)};switch(pe){case v:X=we()/12;break;case m:X=we();break;case h:X=we()/3;break;case f:X=(be-_e)/6048e5;break;case p:X=(be-_e)/864e5;break;case a:X=be/r;break;case i:X=be/t;break;case o:X=be/e;break;default:X=be}return $?X:M.a(X)},B.daysInMonth=function(){return this.endOf(m).$D},B.$locale=function(){return P[this.$L]},B.locale=function(Q,z){if(!Q)return this.$L;var $=this.clone(),X=O(Q,z,!0);return X&&($.$L=X),$},B.clone=function(){return M.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},H}(),Y=U.prototype;return N.prototype=Y,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",p],["$M",m],["$y",v],["$D",C]].forEach(function(H){Y[H[1]]=function(B){return this.$g(B,H[0],H[1])}}),N.extend=function(H,B){return H.$i||(H(B,U,N),H.$i=!0),N},N.locale=O,N.isDayjs=q,N.unix=function(H){return N(1e3*H)},N.en=P[E],N.Ls=P,N.p={},N})});var $C=bt((yh,Sh)=>{"use strict";d();c();l();u();(function(e,t){typeof yh=="object"&&typeof Sh<"u"?Sh.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(yh,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var i=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):i.bind(this)(p,f)};var a=o.startOf;o.startOf=function(p,f){var m=this.$utils(),h=!!m.u(f)||f;if(m.p(p)===t){var v=this.quarter()-1;return h?this.month(3*v).startOf(e).startOf("day"):this.month(3*v+2).endOf(e).endOf("day")}return a.bind(this)(p,f)}}})});var HC=bt((vh,Ah)=>{"use strict";d();c();l();u();(function(e,t){typeof vh=="object"&&typeof Ah<"u"?Ah.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(vh,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},p=function(S){return(S=+S)+(S>68?1900:2e3)},f=function(S){return function(x){this[S]=+x}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(S){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var w=x.match(/([+-]|\d\d)/g),R=60*w[1]+(+w[2]||0);return R===0?0:w[0]==="+"?-R:R}(S)}],h=function(S){var x=a[S];return x&&(x.indexOf?x:x.s.concat(x.f))},v=function(S,x){var w,R=a.meridiem;if(R){for(var I=1;I<=24;I+=1)if(S.indexOf(R(I,0,x))>-1){w=I>12;break}}else w=S===(x?"pm":"PM");return w},C={A:[i,function(S){this.afternoon=v(S,!1)}],a:[i,function(S){this.afternoon=v(S,!0)}],Q:[r,function(S){this.month=3*(S-1)+1}],S:[r,function(S){this.milliseconds=100*+S}],SS:[n,function(S){this.milliseconds=10*+S}],SSS:[/\d{3}/,function(S){this.milliseconds=+S}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[i,function(S){var x=a.ordinal,w=S.match(/\d+/);if(this.day=w[0],x)for(var R=1;R<=31;R+=1)x(R).replace(/\[|\]/g,"")===S&&(this.day=R)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[i,function(S){var x=h("months"),w=(h("monthsShort")||x.map(function(R){return R.slice(0,3)})).indexOf(S)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[i,function(S){var x=h("months").indexOf(S)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(S){this.year=p(S)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function g(S){var x,w;x=S,w=a&&a.formats;for(var R=(S=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,M,U){var Y=U&&U.toUpperCase();return M||w[U]||e[U]||w[Y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,B,Q){return B||Q.slice(1)})})).match(t),I=R.length,E=0;E<I;E+=1){var P=R[E],V=C[P],q=V&&V[0],O=V&&V[1];R[E]=O?{regex:q,parser:O}:P.replace(/^\[|\]$/g,"")}return function(N){for(var M={},U=0,Y=0;U<I;U+=1){var H=R[U];if(typeof H=="string")Y+=H.length;else{var B=H.regex,Q=H.parser,z=N.slice(Y),$=B.exec(z)[0];Q.call(M,$),N=N.replace($,"")}}return function(X){var ee=X.afternoon;if(ee!==void 0){var pe=X.hours;ee?pe<12&&(X.hours+=12):pe===12&&(X.hours=0),delete X.afternoon}}(M),M}}return function(S,x,w){w.p.customParseFormat=!0,S&&S.parseTwoDigitYear&&(p=S.parseTwoDigitYear);var R=x.prototype,I=R.parse;R.parse=function(E){var P=E.date,V=E.utc,q=E.args;this.$u=V;var O=q[1];if(typeof O=="string"){var N=q[2]===!0,M=q[3]===!0,U=N||M,Y=q[2];M&&(Y=q[2]),a=this.$locale(),!N&&Y&&(a=w.Ls[Y]),this.$d=function(z,$,X,ee){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*z);var pe=g($)(z),Re=pe.year,_e=pe.month,be=pe.day,we=pe.hours,Ce=pe.minutes,Te=pe.seconds,ut=pe.milliseconds,je=pe.zone,it=pe.week,ft=new Date,Gt=be||(Re||_e?1:ft.getDate()),cr=Re||ft.getFullYear(),On=0;Re&&!_e||(On=_e>0?_e-1:ft.getMonth());var wi,Ii=we||0,Ns=Ce||0,Pm=Te||0,km=ut||0;return je?new Date(Date.UTC(cr,On,Gt,Ii,Ns,Pm,km+60*je.offset*1e3)):X?new Date(Date.UTC(cr,On,Gt,Ii,Ns,Pm,km)):(wi=new Date(cr,On,Gt,Ii,Ns,Pm,km),it&&(wi=ee(wi).week(it).toDate()),wi)}catch{return new Date("")}}(P,O,V,w),this.init(),Y&&Y!==!0&&(this.$L=this.locale(Y).$L),U&&P!=this.format(O)&&(this.$d=new Date("")),a={}}else if(O instanceof Array)for(var H=O.length,B=1;B<=H;B+=1){q[1]=O[B-1];var Q=w.apply(this,q);if(Q.isValid()){this.$d=Q.$d,this.$L=Q.$L,this.init();break}B===H&&(this.$d=new Date(""))}else I.call(this,E)}}})});var Px=bt((cy,uy)=>{"use strict";d();c();l();u();(function(e,t){typeof cy=="object"&&typeof uy<"u"?uy.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(cy,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,v,C){C===void 0&&(C={});var g=new Date(h),S=function(x,w){w===void 0&&(w={});var R=w.timeZoneName||"short",I=x+"|"+R,E=t[I];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:x,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:R}),t[I]=E),E}(v,C);return S.formatToParts(g)},p=function(h,v){for(var C=a(h,v),g=[],S=0;S<C.length;S+=1){var x=C[S],w=x.type,R=x.value,I=e[w];I>=0&&(g[I]=parseInt(R,10))}var E=g[3],P=E===24?0:E,V=g[0]+"-"+g[1]+"-"+g[2]+" "+P+":"+g[4]+":"+g[5]+":000",q=+h;return(o.utc(V).valueOf()-(q-=q%1e3))/6e4},f=n.prototype;f.tz=function(h,v){h===void 0&&(h=i);var C,g=this.utcOffset(),S=this.toDate(),x=S.toLocaleString("en-US",{timeZone:h}),w=Math.round((S-new Date(x))/1e3/60),R=15*-Math.round(S.getTimezoneOffset()/15)-w;if(!Number(R))C=this.utcOffset(0,v);else if(C=o(x,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(R,!0),v){var I=C.utcOffset();C=C.add(g-I,"minute")}return C.$x.$timezone=h,C},f.offsetName=function(h){var v=this.$x.$timezone||o.tz.guess(),C=a(this.valueOf(),v,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return C&&C.value};var m=f.startOf;f.startOf=function(h,v){if(!this.$x||!this.$x.$timezone)return m.call(this,h,v);var C=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(C,h,v).tz(this.$x.$timezone,!0)},o.tz=function(h,v,C){var g=C&&v,S=C||v||i,x=p(+o(),S);if(typeof h!="string")return o(h).tz(S);var w=function(P,V,q){var O=P-60*V*1e3,N=p(O,q);if(V===N)return[O,V];var M=p(O-=60*(N-V)*1e3,q);return N===M?[O,N]:[P-60*Math.min(N,M)*1e3,Math.max(N,M)]}(o.utc(h,g).valueOf(),x,S),R=w[0],I=w[1],E=o(R).utcOffset(I);return E.$x.$timezone=S,E},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var kx=bt((ly,dy)=>{"use strict";d();c();l();u();(function(e,t){typeof ly=="object"&&typeof dy<"u"?dy.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(ly,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var S={date:g,utc:!0,args:arguments};return new o(S)},a.utc=function(g){var S=i(this.toDate(),{locale:this.$L,utc:!0});return g?S.add(this.utcOffset(),e):S},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var p=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),p.call(this,g)};var f=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else f.call(this)};var m=a.utcOffset;a.utcOffset=function(g,S){var x=this.$utils().u;if(x(g))return this.$u?0:x(this.$offset)?m.call(this):this.$offset;if(typeof g=="string"&&(g=function(E){E===void 0&&(E="");var P=E.match(t);if(!P)return null;var V=(""+P[0]).match(r)||["-",0,0],q=V[0],O=60*+V[1]+ +V[2];return O===0?0:q==="+"?O:-O}(g),g===null))return this;var w=Math.abs(g)<=16?60*g:g,R=this;if(S)return R.$offset=w,R.$u=g===0,R;if(g!==0){var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(R=this.local().add(w+I,e)).$offset=w,R.$x.$localOffset=I}else R=this.utc();return R};var h=a.format;a.format=function(g){var S=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,S)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var v=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var C=a.diff;a.diff=function(g,S,x){if(g&&this.$u===g.$u)return C.call(this,g,S,x);var w=this.local(),R=i(g).local();return C.call(w,R,S,x)}}})});var Ow=bt((HCe,kw)=>{"use strict";d();c();l();u();function aV(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}kw.exports=sV;function sV(e,t,r){var n=r&&r.stringify||aV,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var p=1;p<i;p++)a[p]=n(t[p]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",h=1-o,v=-1,C=e&&e.length||0,g=0;g<C;){if(e.charCodeAt(g)===37&&g+1<C){switch(v=v>-1?v:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=f||t[h]==null)break;v<g&&(m+=e.slice(v,g)),m+=Number(t[h]),v=g+2,g++;break;case 105:if(h>=f||t[h]==null)break;v<g&&(m+=e.slice(v,g)),m+=Math.floor(Number(t[h])),v=g+2,g++;break;case 79:case 111:case 106:if(h>=f||t[h]===void 0)break;v<g&&(m+=e.slice(v,g));var S=typeof t[h];if(S==="string"){m+="'"+t[h]+"'",v=g+2,g++;break}if(S==="function"){m+=t[h].name||"<anonymous>",v=g+2,g++;break}m+=n(t[h]),v=g+2,g++;break;case 115:if(h>=f)break;v<g&&(m+=e.slice(v,g)),m+=String(t[h]),v=g+2,g++;break;case 37:v<g&&(m+=e.slice(v,g)),m+="%",v=g+2,g++,h--;break}++h}++g}return v===-1?e:(v<C&&(m+=e.slice(v)),m)}});var jw=bt((JCe,_p)=>{"use strict";d();c();l();u();var _w=Ow();_p.exports=En;var Uc=bV().console||{},cV={mapHttpRequest:Op,mapHttpResponse:Op,wrapRequestSerializer:eS,wrapResponseSerializer:eS,wrapErrorSerializer:eS,req:Op,res:Op,err:qw,errWithCause:qw};function io(e,t){return e==="silent"?1/0:t.levels.values[e]}var nS=Symbol("pino.logFuncs"),tS=Symbol("pino.hierarchy"),uV={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Nw(e,t){let r={logger:t,parent:e[tS]};t[tS]=r}function lV(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Uc[o]||Uc[uV[o]||"log"]||Wa}),e[nS]=n}function dV(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function En(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Uc;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=dV(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&p.forEach(function(x){r[x]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=Wa),lV(m,p,r),Nw({},m),Object.defineProperty(m,"levelVal",{get:v}),Object.defineProperty(m,"level",{get:C,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:vV(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Wa};m.levels=pV(e),m.level=f,m.isLevelEnabled=function(x){return this.levels.values[x]?this.levels.values[x]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=Wa,m.serializers=n,m._serialize=o,m._stdErrSerialize=i,m.child=function(...x){return S.call(this,h,...x)},t&&(m._logEvent=rS());function v(){return io(this.level,this)}function C(){return this._level}function g(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,yi(this,h,m,"error"),yi(this,h,m,"fatal"),yi(this,h,m,"warn"),yi(this,h,m,"info"),yi(this,h,m,"debug"),yi(this,h,m,"trace"),a.forEach(w=>{yi(this,h,m,w)})}function S(x,w,R){if(!w)throw new Error("missing bindings for child Pino");R=R||{},o&&w.serializers&&(R.serializers=w.serializers);let I=R.serializers;if(o&&I){var E=Object.assign({},n,I),P=e.browser.serialize===!0?Object.keys(E):o;delete w.serializers,oS([w],P,E,this._stdErrSerialize)}function V(O){this._childLevel=(O._childLevel|0)+1,this.bindings=w,E&&(this.serializers=E,this._serialize=P),t&&(this._logEvent=rS([].concat(O._logEvent.bindings,w)))}V.prototype=this;let q=new V(this);return Nw(this,q),q.child=function(...O){return S.call(this,x,...O)},q.level=R.level||this.level,x.onChild(q),q}return m}function pV(e){let t=e.customLevels||{},r=Object.assign({},En.levels.values,t),n=Object.assign({},En.levels.labels,fV(t));return{values:r,labels:n}}function fV(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}En.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};En.stdSerializers=cV;En.stdTimeFunctions=Object.assign({},{nullTime:Dw,epochTime:Mw,unixTime:AV,isoTime:CV});function mV(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[tS];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function yi(e,t,r,n){if(Object.defineProperty(e,n,{value:io(e.level,r)>io(n,r)?Wa:r[nS][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Wa){if(!t.transmit)return;let i=t.transmit.level||e.level,a=io(i,r);if(io(n,r)<a)return}e[n]=hV(e,t,r,n);let o=mV(e);o.length!==0&&(e[n]=gV(o,e[n]))}function gV(e,t){return function(){return t.apply(this,[...e,...arguments])}}function hV(e,t,r,n){return function(o){return function(){let a=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Uc?Uc:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var h=!1;if(t.serialize&&(oS(p,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(f,...yV(this,n,p,a,t)):o.apply(f,p),t.transmit){let v=t.transmit.level||e._level,C=io(v,r),g=io(n,r);if(g<C)return;SV(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:v,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:io(e._level,r)},p,h)}}}(e[nS][n])}function yV(e,t,r,n,o){let{level:i,log:a=v=>v}=o.formatters||{},p=r.slice(),f=p[0],m={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(m.time=n),i){let v=i(t,e.levels.values[t]);Object.assign(m,v)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;h--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[a(m),...p]}else{if(f!==null&&typeof f=="object"){for(;h--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?_w(p.shift(),p):void 0}else typeof f=="string"&&(f=_w(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[a(m)]}}function oS(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=En.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function SV(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||oS(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return m.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=p,o(a,e._logEvent,f),e._logEvent=rS(m)}function rS(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function qw(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function vV(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Dw:Mw}function Op(){return{}}function eS(e){return e}function Wa(){}function Dw(){return!1}function Mw(){return Date.now()}function AV(){return Math.round(Date.now()/1e3)}function CV(){return new Date(Date.now()).toISOString()}function bV(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}_p.exports.default=En;_p.exports.pino=En});var GB={};Ms(GB,{HighlightUtils:()=>Qm,ResultTemplatesHelpers:()=>Vb,SortOrder:()=>rl,VERSION:()=>qn,buildAttachToCase:()=>Yw,buildAttachedResults:()=>Kw,buildBreadcrumbManager:()=>wI,buildCategoryFacet:()=>KI,buildController:()=>fe,buildCriterionExpression:()=>Mr,buildDateFacet:()=>hE,buildDateFilter:()=>SE,buildDateRange:()=>us,buildDateSortCriterion:()=>bC,buildDidYouMean:()=>_I,buildFacet:()=>lE,buildFacetConditionsManager:()=>MI,buildFacetManager:()=>VI,buildFoldedResultList:()=>NE,buildGeneratedAnswer:()=>jE,buildInsightEngine:()=>$w,buildInsightInterface:()=>IT,buildInteractiveCitation:()=>LE,buildInteractiveResult:()=>sF,buildNotifyTrigger:()=>yT,buildNumericFacet:()=>bE,buildNumericFilter:()=>RE,buildNumericRange:()=>Uf,buildPager:()=>$E,buildQueryError:()=>zE,buildQuerySummary:()=>YE,buildQuickview:()=>ZE,buildRecentQueriesList:()=>iF,buildRelevanceSortCriterion:()=>ol,buildResultList:()=>cF,buildResultTemplatesManager:()=>DT,buildResultsPerPage:()=>lF,buildSearchBox:()=>xF,buildSearchParameterManager:()=>$F,buildSearchStatus:()=>aT,buildSmartSnippet:()=>JF,buildSmartSnippetQuestionsList:()=>eT,buildSort:()=>iT,buildTab:()=>cT,buildUserActions:()=>wT,deserializeRelativeDate:()=>nb,getAnalyticsNextApiBaseUrl:()=>vu,getOrganizationEndpoint:()=>We,getSampleInsightEngineConfiguration:()=>iS,loadAttachedResultsActions:()=>RB,loadAttachedResultsAnalyticsActions:()=>wB,loadCaseContextActions:()=>IB,loadContextActions:()=>FB,loadDateFacetSetActions:()=>TB,loadFieldActions:()=>kB,loadFoldingActions:()=>OB,loadGeneratedAnswerActions:()=>_B,loadGenericAnalyticsActions:()=>bB,loadInsightAnalyticsActions:()=>xB,loadInsightInterfaceActions:()=>NB,loadInsightSearchActions:()=>DB,loadInsightSearchAnalyticsActions:()=>MB,loadInsightUserActionsActions:()=>jB,loadNumericFacetSetActions:()=>PB,loadQuerySetActions:()=>qB,loadQuerySuggestActions:()=>VB,loadQuestionAnsweringActions:()=>LB,loadRecentResultsActions:()=>UB});module.exports=BT(GB);d();c();l();u();var Qm={};Ms(Qm,{escapeHtml:()=>_i,getHighlightedSuggestion:()=>Um,highlightString:()=>IP});d();c();l();u();d();c();l();u();function vP(e,t){let r=`
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessInsight",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessInsight"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var BT=Object.create;var Ns=Object.defineProperty;var GT=Object.getOwnPropertyDescriptor;var $T=Object.getOwnPropertyNames;var HT=Object.getPrototypeOf,zT=Object.prototype.hasOwnProperty;var WT=(e,t,r)=>t in e?Ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var qs=(e,t)=>()=>(e&&(t=e(e=0)),t);var bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ds=(e,t)=>{for(var r in t)Ns(e,r,{get:t[r],enumerable:!0})},DS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $T(t))!zT.call(e,o)&&o!==r&&Ns(e,o,{get:()=>t[o],enumerable:!(n=GT(t,o))||n.enumerable});return e};var Cr=(e,t,r)=>(r=e!=null?BT(HT(e)):{},DS(t||!e||!e.__esModule?Ns(r,"default",{value:e,enumerable:!0}):r,e)),YT=e=>DS(Ns({},"__esModule",{value:!0}),e);var qe=(e,t,r)=>WT(e,typeof t!="symbol"?t+"":t,r);var y,c=qs(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function au(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?au=function(t){return typeof t}:au=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},au(e)}function XT(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=ZT.bind(this))}function ZT(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),KT(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):JT(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var KT,JT,u=qs(()=>{"use strict";KT=function(t){return typeof t=="string"},JT=function(t){return t instanceof Blob};XT.call((typeof window>"u"?"undefined":au(window))==="object"?window:{})});var Lm=bt(Ms=>{"use strict";d();c();l();u();Object.defineProperty(Ms,"__esModule",{value:!0});function MS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tP(e,t,r){return t=Ei(t),nP(e,US()?Reflect.construct(t,r||[],Ei(e).constructor):t.apply(e,r))}function Mm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sP(n.key),n)}}function jm(e,t,r){return t&&jS(e.prototype,t),r&&jS(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function VS(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=cP(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return a=f.done,f},e:function(f){p=!0,i=f},f:function(){try{a||r.return==null||r.return()}finally{if(p)throw i}}}}function qm(){return qm=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=oP(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},qm.apply(null,arguments)}function Ei(e){return Ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ei(e)}function rP(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dm(e,t)}function US(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(US=function(){return!!e})()}function nP(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eP(e)}function Dm(e,t){return Dm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Dm(e,t)}function oP(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ei(e))!==null;);return e}function iP(e,t,r,n){var o=qm(Ei(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function aP(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sP(e){var t=aP(e,"string");return typeof t=="symbol"?t:t+""}function cP(e,t){if(e){if(typeof e=="string")return MS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?MS(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function uP(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function lP(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var LS=function(){function e(){Mm(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return jm(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var g=i[p];try{g.callback.call(n,r)}catch(S){Promise.resolve().then(function(){throw S})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=i.length;p<f;p++)a();return!r.defaultPrevented}}}])}(),Vm=function(e){function t(){var r;return Mm(this,t),r=tP(this,t),r.listeners||LS.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return rP(t,e),jm(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),iP(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new su;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new su;function i(){o.abort(this.reason),a()}function a(){var g=VS(n),S;try{for(g.s();!(S=g.n()).done;){var b=S.value;b.removeEventListener("abort",i)}}catch(h){g.e(h)}finally{g.f()}}var p=VS(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",i)}}catch(g){p.e(g)}finally{p.f()}return o.signal}}])}(LS),su=function(){function e(){Mm(this,e),Object.defineProperty(this,"signal",{value:new Vm,writable:!0,configurable:!0})}return jm(e,[{key:"abort",value:function(r){var n=lP(r),o=uP(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(su.prototype[Symbol.toStringTag]="AbortController",Vm.prototype[Symbol.toStringTag]="AbortSignal");function dP(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function pP(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=a===void 0?!1:a;if(!dP({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(b,h){var A;h&&h.signal&&(A=h.signal,delete h.signal);var w=new o(b,h);return A&&Object.defineProperty(w,"signal",{writable:!1,enumerable:!1,configurable:!0,value:A}),w},f.prototype=o.prototype);var m=r,g=function(b,h){var A=f&&f.prototype.isPrototypeOf(b)?b.signal:h?h.signal:void 0;if(A){var w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(A.aborted)return Promise.reject(w);var R=new Promise(function(x,I){A.addEventListener("abort",function(){return I(w)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([R,m(b,h)])}return m(b,h)};return{fetch:g,Request:f}}Ms.AbortController=su;Ms.AbortSignal=Vm;Ms.abortableFetch=pP});var QS,s,v,l=qs(()=>{"use strict";QS=Cr(Lm(),1),s=Cr(Lm(),1),{fetch:v}=(0,QS.abortableFetch)({fetch})});function js(e){if(bP.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Um(e){return e.replace(xP,"")}function Vs(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!RP(r))return!1}return!0}function RP(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function GS(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var fP,YS,mP,KS,gP,hP,yP,SP,vP,AP,CP,bP,BS,xP,Fi,Qm,$S,HS,zS,WS,C,XS=qs(()=>{"use strict";d();c();l();u();fP=Object.create,YS=Object.defineProperty,mP=Object.getOwnPropertyDescriptor,KS=Object.getOwnPropertyNames,gP=Object.getPrototypeOf,hP=Object.prototype.hasOwnProperty,yP=(e,t)=>function(){return t||(0,e[KS(e)[0]])((t={exports:{}}).exports,t),t.exports},SP=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of KS(t))!hP.call(e,o)&&o!==r&&YS(e,o,{get:()=>t[o],enumerable:!(n=mP(t,o))||n.enumerable});return e},vP=(e,t,r)=>(r=e!=null?fP(gP(e)):{},SP(t||!e||!e.__esModule?YS(r,"default",{value:e,enumerable:!0}):r,e)),AP=yP({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,m){var g=f.split(";").filter(n),S=g.shift(),b=i(S),h=b.name,A=b.value;m=m?Object.assign({},r,m):r;try{A=m.decodeValues?decodeURIComponent(A):A}catch(R){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+A+"'. Set options.decodeValues to false to disable this feature.",R)}var w={name:h,value:A};return g.forEach(function(R){var x=R.split("="),I=x.shift().trimLeft().toLowerCase(),F=x.join("=");I==="expires"?w.expires=new Date(F):I==="max-age"?w.maxAge=parseInt(F,10):I==="secure"?w.secure=!0:I==="httponly"?w.httpOnly=!0:I==="samesite"?w.sameSite=F:w[I]=F}),w}function i(f){var m="",g="",S=f.split("=");return S.length>1?(m=S.shift(),g=S.join("=")):g=f,{name:m,value:g}}function a(f,m){if(m=m?Object.assign({},r,m):r,!f)return m.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(b){return b.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!m.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),m=m?Object.assign({},r,m):r,m.map){var S={};return f.filter(n).reduce(function(b,h){var A=o(h,m);return b[A.name]=A,b},S)}else return f.filter(n).map(function(b){return o(b,m)})}function p(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var m=[],g=0,S,b,h,A,w;function R(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function x(){return b=f.charAt(g),b!=="="&&b!==";"&&b!==","}for(;g<f.length;){for(S=g,w=!1;R();)if(b=f.charAt(g),b===","){for(h=g,g+=1,R(),A=g;g<f.length&&x();)g+=1;g<f.length&&f.charAt(g)==="="?(w=!0,g=A,m.push(f.substring(S,h)),S=g):g=h+1}else g+=1;(!w||g>=f.length)&&m.push(f.substring(S,f.length))}return m}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=p}}),CP=vP(AP()),bP=/[^a-z0-9\-#$%&'*+.^_`|~]/i;BS=[`
|
|
19
|
+
`,"\r","\t"," "],xP=new RegExp(`(^[${BS.join("")}]|$[${BS.join("")}])`,"g");Fi=Symbol("normalizedHeaders"),Qm=Symbol("rawHeaderNames"),$S=", ",C=class JS{constructor(t){this[HS]={},this[zS]=new Map,this[WS]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof JS||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join($S):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join($S):n)})}[(HS=Fi,zS=Qm,WS=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Fi]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Vs(t))throw new TypeError(`Invalid header name "${t}"`);return this[Fi].hasOwnProperty(js(t))}get(t){if(!Vs(t))throw TypeError(`Invalid header name "${t}"`);return this[Fi][js(t)]??null}set(t,r){if(!Vs(t)||!GS(r))return;let n=js(t),o=Um(r);this[Fi][n]=Um(o),this[Qm].set(n,t)}append(t,r){if(!Vs(t)||!GS(r))return;let n=js(t),o=Um(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Vs(t)||!this.has(t))return;let r=js(t);delete this[Fi][r],this[Qm].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,CP.splitCookiesString)(t)}}});var d=qs(()=>{"use strict";XS()});var iv=bt(Qs=>{"use strict";d();c();l();u();var mu=Qs&&Qs.__assign||function(){return mu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},mu.apply(this,arguments)};Object.defineProperty(Qs,"__esModule",{value:!0});var _P={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function NP(e){var t=mu(mu({},_P),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Qs.getSanitizedOptions=NP});var av=bt(Hm=>{"use strict";d();c();l();u();Object.defineProperty(Hm,"__esModule",{value:!0});function qP(e){var t=Math.random()*e;return Math.round(t)}Hm.fullJitter=qP});var sv=bt(zm=>{"use strict";d();c();l();u();Object.defineProperty(zm,"__esModule",{value:!0});function DP(e){return e}zm.noJitter=DP});var cv=bt(Wm=>{"use strict";d();c();l();u();Object.defineProperty(Wm,"__esModule",{value:!0});var MP=av(),jP=sv();function VP(e){return e.jitter==="full"?MP.fullJitter:jP.noJitter}Wm.JitterFactory=VP});var Km=bt(Ym=>{"use strict";d();c();l();u();Object.defineProperty(Ym,"__esModule",{value:!0});var LP=cv(),UP=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=LP.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Ym.Delay=UP});var uv=bt(hn=>{"use strict";d();c();l();u();var QP=hn&&hn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),BP=hn&&hn.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(g){try{m(n.next(g))}catch(S){a(S)}}function f(g){try{m(n.throw(g))}catch(S){a(S)}}function m(g){g.done?i(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},GP=hn&&hn.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=m[0]&2?o.return:m[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,m[1])).done)return i;switch(o=0,i&&(m=[m[0]&2,i.value]),m[0]){case 0:case 1:i=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){r.label=m[1];break}if(m[0]===6&&r.label<i[1]){r.label=i[1],i=m;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(m);break}i[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=i=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(hn,"__esModule",{value:!0});var $P=Km(),HP=function(e){QP(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return BP(this,void 0,void 0,function(){return GP(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}($P.Delay);hn.SkipFirstDelay=HP});var lv=bt(Bs=>{"use strict";d();c();l();u();var zP=Bs&&Bs.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Bs,"__esModule",{value:!0});var WP=Km(),YP=function(e){zP(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(WP.Delay);Bs.AlwaysDelay=YP});var dv=bt(Jm=>{"use strict";d();c();l();u();Object.defineProperty(Jm,"__esModule",{value:!0});var KP=uv(),JP=lv();function XP(e,t){var r=ZP(e);return r.setAttemptNumber(t),r}Jm.DelayFactory=XP;function ZP(e){return e.delayFirstAttempt?new JP.AlwaysDelay(e):new KP.SkipFirstDelay(e)}});var pv=bt(Ro=>{"use strict";d();c();l();u();var Xm=Ro&&Ro.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(g){try{m(n.next(g))}catch(S){a(S)}}function f(g){try{m(n.throw(g))}catch(S){a(S)}}function m(g){g.done?i(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},Zm=Ro&&Ro.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=m[0]&2?o.return:m[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,m[1])).done)return i;switch(o=0,i&&(m=[m[0]&2,i.value]),m[0]){case 0:case 1:i=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){r.label=m[1];break}if(m[0]===6&&r.label<i[1]){r.label=i[1],i=m;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(m);break}i[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=i=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Ro,"__esModule",{value:!0});var ek=iv(),tk=dv();function rk(e,t){return t===void 0&&(t={}),Xm(this,void 0,void 0,function(){var r,n;return Zm(this,function(o){switch(o.label){case 0:return r=ek.getSanitizedOptions(t),n=new nk(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Ro.backOff=rk;var nk=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Xm(this,void 0,void 0,function(){var t,r;return Zm(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Xm(this,void 0,void 0,function(){var t;return Zm(this,function(r){switch(r.label){case 0:return t=tk.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var hu=bt((eg,tg)=>{"use strict";d();c();l();u();(function(e,t){typeof eg=="object"&&typeof tg<"u"?tg.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(eg,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",p="day",f="week",m="month",g="quarter",S="year",b="date",h="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var B=["th","st","nd","rd"],Q=H%100;return"["+H+(B[(Q-20)%10]||B[Q]||B[0])+"]"}},x=function(H,B,Q){var z=String(H);return!z||z.length>=B?H:""+Array(B+1-z.length).join(Q)+H},I={s:x,z:function(H){var B=-H.utcOffset(),Q=Math.abs(B),z=Math.floor(Q/60),$=Q%60;return(B<=0?"+":"-")+x(z,2,"0")+":"+x($,2,"0")},m:function H(B,Q){if(B.date()<Q.date())return-H(Q,B);var z=12*(Q.year()-B.year())+(Q.month()-B.month()),$=B.clone().add(z,m),X=Q-$<0,ee=B.clone().add(z+(X?-1:1),m);return+(-(z+(Q-$)/(X?$-ee:ee-$))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:m,y:S,w:f,d:p,D:b,h:a,m:i,s:o,ms:n,Q:g}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},F="en",P={};P[F]=R;var j="$isDayjsObject",q=function(H){return H instanceof U||!(!H||!H[j])},k=function H(B,Q,z){var $;if(!B)return F;if(typeof B=="string"){var X=B.toLowerCase();P[X]&&($=X),Q&&(P[X]=Q,$=X);var ee=B.split("-");if(!$&&ee.length>1)return H(ee[0])}else{var pe=B.name;P[pe]=B,$=pe}return!z&&$&&(F=$),$||!z&&F},N=function(H,B){if(q(H))return H.clone();var Q=typeof B=="object"?B:{};return Q.date=H,Q.args=arguments,new U(Q)},M=I;M.l=k,M.i=q,M.w=function(H,B){return N(H,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var U=function(){function H(Q){this.$L=k(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[j]=!0}var B=H.prototype;return B.parse=function(Q){this.$d=function(z){var $=z.date,X=z.utc;if($===null)return new Date(NaN);if(M.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var ee=$.match(A);if(ee){var pe=ee[2]-1||0,Re=(ee[7]||"0").substring(0,3);return X?new Date(Date.UTC(ee[1],pe,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,Re)):new Date(ee[1],pe,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,Re)}}return new Date($)}(Q),this.init()},B.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},B.$utils=function(){return M},B.isValid=function(){return this.$d.toString()!==h},B.isSame=function(Q,z){var $=N(Q);return this.startOf(z)<=$&&$<=this.endOf(z)},B.isAfter=function(Q,z){return N(Q)<this.startOf(z)},B.isBefore=function(Q,z){return this.endOf(z)<N(Q)},B.$g=function(Q,z,$){return M.u(Q)?this[z]:this.set($,Q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(Q,z){var $=this,X=!!M.u(z)||z,ee=M.p(Q),pe=function(je,it){var ft=M.w($.$u?Date.UTC($.$y,it,je):new Date($.$y,it,je),$);return X?ft:ft.endOf(p)},Re=function(je,it){return M.w($.toDate()[je].apply($.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(it)),$)},_e=this.$W,be=this.$M,we=this.$D,Ce="set"+(this.$u?"UTC":"");switch(ee){case S:return X?pe(1,0):pe(31,11);case m:return X?pe(1,be):pe(0,be+1);case f:var Te=this.$locale().weekStart||0,ut=(_e<Te?_e+7:_e)-Te;return pe(X?we-ut:we+(6-ut),be);case p:case b:return Re(Ce+"Hours",0);case a:return Re(Ce+"Minutes",1);case i:return Re(Ce+"Seconds",2);case o:return Re(Ce+"Milliseconds",3);default:return this.clone()}},B.endOf=function(Q){return this.startOf(Q,!1)},B.$set=function(Q,z){var $,X=M.p(Q),ee="set"+(this.$u?"UTC":""),pe=($={},$[p]=ee+"Date",$[b]=ee+"Date",$[m]=ee+"Month",$[S]=ee+"FullYear",$[a]=ee+"Hours",$[i]=ee+"Minutes",$[o]=ee+"Seconds",$[n]=ee+"Milliseconds",$)[X],Re=X===p?this.$D+(z-this.$W):z;if(X===m||X===S){var _e=this.clone().set(b,1);_e.$d[pe](Re),_e.init(),this.$d=_e.set(b,Math.min(this.$D,_e.daysInMonth())).$d}else pe&&this.$d[pe](Re);return this.init(),this},B.set=function(Q,z){return this.clone().$set(Q,z)},B.get=function(Q){return this[M.p(Q)]()},B.add=function(Q,z){var $,X=this;Q=Number(Q);var ee=M.p(z),pe=function(be){var we=N(X);return M.w(we.date(we.date()+Math.round(be*Q)),X)};if(ee===m)return this.set(m,this.$M+Q);if(ee===S)return this.set(S,this.$y+Q);if(ee===p)return pe(1);if(ee===f)return pe(7);var Re=($={},$[i]=t,$[a]=r,$[o]=e,$)[ee]||1,_e=this.$d.getTime()+Q*Re;return M.w(_e,this)},B.subtract=function(Q,z){return this.add(-1*Q,z)},B.format=function(Q){var z=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var X=Q||"YYYY-MM-DDTHH:mm:ssZ",ee=M.z(this),pe=this.$H,Re=this.$m,_e=this.$M,be=$.weekdays,we=$.months,Ce=$.meridiem,Te=function(it,ft,Gt,cr){return it&&(it[ft]||it(z,X))||Gt[ft].slice(0,cr)},ut=function(it){return M.s(pe%12||12,it,"0")},je=Ce||function(it,ft,Gt){var cr=it<12?"AM":"PM";return Gt?cr.toLowerCase():cr};return X.replace(w,function(it,ft){return ft||function(Gt){switch(Gt){case"YY":return String(z.$y).slice(-2);case"YYYY":return M.s(z.$y,4,"0");case"M":return _e+1;case"MM":return M.s(_e+1,2,"0");case"MMM":return Te($.monthsShort,_e,we,3);case"MMMM":return Te(we,_e);case"D":return z.$D;case"DD":return M.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Te($.weekdaysMin,z.$W,be,2);case"ddd":return Te($.weekdaysShort,z.$W,be,3);case"dddd":return be[z.$W];case"H":return String(pe);case"HH":return M.s(pe,2,"0");case"h":return ut(1);case"hh":return ut(2);case"a":return je(pe,Re,!0);case"A":return je(pe,Re,!1);case"m":return String(Re);case"mm":return M.s(Re,2,"0");case"s":return String(z.$s);case"ss":return M.s(z.$s,2,"0");case"SSS":return M.s(z.$ms,3,"0");case"Z":return ee}return null}(it)||ee.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(Q,z,$){var X,ee=this,pe=M.p(z),Re=N(Q),_e=(Re.utcOffset()-this.utcOffset())*t,be=this-Re,we=function(){return M.m(ee,Re)};switch(pe){case S:X=we()/12;break;case m:X=we();break;case g:X=we()/3;break;case f:X=(be-_e)/6048e5;break;case p:X=(be-_e)/864e5;break;case a:X=be/r;break;case i:X=be/t;break;case o:X=be/e;break;default:X=be}return $?X:M.a(X)},B.daysInMonth=function(){return this.endOf(m).$D},B.$locale=function(){return P[this.$L]},B.locale=function(Q,z){if(!Q)return this.$L;var $=this.clone(),X=k(Q,z,!0);return X&&($.$L=X),$},B.clone=function(){return M.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},H}(),Y=U.prototype;return N.prototype=Y,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",p],["$M",m],["$y",S],["$D",b]].forEach(function(H){Y[H[1]]=function(B){return this.$g(B,H[0],H[1])}}),N.extend=function(H,B){return H.$i||(H(B,U,N),H.$i=!0),N},N.locale=k,N.isDayjs=q,N.unix=function(H){return N(1e3*H)},N.en=P[F],N.Ls=P,N.p={},N})});var yv=bt((rg,ng)=>{"use strict";d();c();l();u();(function(e,t){typeof rg=="object"&&typeof ng<"u"?ng.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(rg,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var i=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):i.bind(this)(p,f)};var a=o.startOf;o.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var S=this.quarter()-1;return g?this.month(3*S).startOf(e).startOf("day"):this.month(3*S+2).endOf(e).endOf("day")}return a.bind(this)(p,f)}}})});var Sv=bt((og,ig)=>{"use strict";d();c();l();u();(function(e,t){typeof og=="object"&&typeof ig<"u"?ig.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(og,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},p=function(A){return(A=+A)+(A>68?1900:2e3)},f=function(A){return function(w){this[A]=+w}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(A){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var R=w.match(/([+-]|\d\d)/g),x=60*R[1]+(+R[2]||0);return x===0?0:R[0]==="+"?-x:x}(A)}],g=function(A){var w=a[A];return w&&(w.indexOf?w:w.s.concat(w.f))},S=function(A,w){var R,x=a.meridiem;if(x){for(var I=1;I<=24;I+=1)if(A.indexOf(x(I,0,w))>-1){R=I>12;break}}else R=A===(w?"pm":"PM");return R},b={A:[i,function(A){this.afternoon=S(A,!1)}],a:[i,function(A){this.afternoon=S(A,!0)}],Q:[r,function(A){this.month=3*(A-1)+1}],S:[r,function(A){this.milliseconds=100*+A}],SS:[n,function(A){this.milliseconds=10*+A}],SSS:[/\d{3}/,function(A){this.milliseconds=+A}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[i,function(A){var w=a.ordinal,R=A.match(/\d+/);if(this.day=R[0],w)for(var x=1;x<=31;x+=1)w(x).replace(/\[|\]/g,"")===A&&(this.day=x)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[i,function(A){var w=g("months"),R=(g("monthsShort")||w.map(function(x){return x.slice(0,3)})).indexOf(A)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[i,function(A){var w=g("months").indexOf(A)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(A){this.year=p(A)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(A){var w,R;w=A,R=a&&a.formats;for(var x=(A=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,M,U){var Y=U&&U.toUpperCase();return M||R[U]||e[U]||R[Y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,B,Q){return B||Q.slice(1)})})).match(t),I=x.length,F=0;F<I;F+=1){var P=x[F],j=b[P],q=j&&j[0],k=j&&j[1];x[F]=k?{regex:q,parser:k}:P.replace(/^\[|\]$/g,"")}return function(N){for(var M={},U=0,Y=0;U<I;U+=1){var H=x[U];if(typeof H=="string")Y+=H.length;else{var B=H.regex,Q=H.parser,z=N.slice(Y),$=B.exec(z)[0];Q.call(M,$),N=N.replace($,"")}}return function(X){var ee=X.afternoon;if(ee!==void 0){var pe=X.hours;ee?pe<12&&(X.hours+=12):pe===12&&(X.hours=0),delete X.afternoon}}(M),M}}return function(A,w,R){R.p.customParseFormat=!0,A&&A.parseTwoDigitYear&&(p=A.parseTwoDigitYear);var x=w.prototype,I=x.parse;x.parse=function(F){var P=F.date,j=F.utc,q=F.args;this.$u=j;var k=q[1];if(typeof k=="string"){var N=q[2]===!0,M=q[3]===!0,U=N||M,Y=q[2];M&&(Y=q[2]),a=this.$locale(),!N&&Y&&(a=R.Ls[Y]),this.$d=function(z,$,X,ee){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*z);var pe=h($)(z),Re=pe.year,_e=pe.month,be=pe.day,we=pe.hours,Ce=pe.minutes,Te=pe.seconds,ut=pe.milliseconds,je=pe.zone,it=pe.week,ft=new Date,Gt=be||(Re||_e?1:ft.getDate()),cr=Re||ft.getFullYear(),On=0;Re&&!_e||(On=_e>0?_e-1:ft.getMonth());var wi,Ii=we||0,_s=Ce||0,_m=Te||0,Nm=ut||0;return je?new Date(Date.UTC(cr,On,Gt,Ii,_s,_m,Nm+60*je.offset*1e3)):X?new Date(Date.UTC(cr,On,Gt,Ii,_s,_m,Nm)):(wi=new Date(cr,On,Gt,Ii,_s,_m,Nm),it&&(wi=ee(wi).week(it).toDate()),wi)}catch{return new Date("")}}(P,k,j,R),this.init(),Y&&Y!==!0&&(this.$L=this.locale(Y).$L),U&&P!=this.format(k)&&(this.$d=new Date("")),a={}}else if(k instanceof Array)for(var H=k.length,B=1;B<=H;B+=1){q[1]=k[B-1];var Q=R.apply(this,q);if(Q.isValid()){this.$d=Q.$d,this.$L=Q.$L,this.init();break}B===H&&(this.$d=new Date(""))}else I.call(this,F)}}})});var Dx=bt((dy,py)=>{"use strict";d();c();l();u();(function(e,t){typeof dy=="object"&&typeof py<"u"?py.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(dy,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(g,S,b){b===void 0&&(b={});var h=new Date(g),A=function(w,R){R===void 0&&(R={});var x=R.timeZoneName||"short",I=w+"|"+x,F=t[I];return F||(F=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[I]=F),F}(S,b);return A.formatToParts(h)},p=function(g,S){for(var b=a(g,S),h=[],A=0;A<b.length;A+=1){var w=b[A],R=w.type,x=w.value,I=e[R];I>=0&&(h[I]=parseInt(x,10))}var F=h[3],P=F===24?0:F,j=h[0]+"-"+h[1]+"-"+h[2]+" "+P+":"+h[4]+":"+h[5]+":000",q=+g;return(o.utc(j).valueOf()-(q-=q%1e3))/6e4},f=n.prototype;f.tz=function(g,S){g===void 0&&(g=i);var b,h=this.utcOffset(),A=this.toDate(),w=A.toLocaleString("en-US",{timeZone:g}),R=Math.round((A-new Date(w))/1e3/60),x=15*-Math.round(A.getTimezoneOffset()/15)-R;if(!Number(x))b=this.utcOffset(0,S);else if(b=o(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),S){var I=b.utcOffset();b=b.add(h-I,"minute")}return b.$x.$timezone=g,b},f.offsetName=function(g){var S=this.$x.$timezone||o.tz.guess(),b=a(this.valueOf(),S,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return b&&b.value};var m=f.startOf;f.startOf=function(g,S){if(!this.$x||!this.$x.$timezone)return m.call(this,g,S);var b=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(b,g,S).tz(this.$x.$timezone,!0)},o.tz=function(g,S,b){var h=b&&S,A=b||S||i,w=p(+o(),A);if(typeof g!="string")return o(g).tz(A);var R=function(P,j,q){var k=P-60*j*1e3,N=p(k,q);if(j===N)return[k,j];var M=p(k-=60*(N-j)*1e3,q);return N===M?[k,N]:[P-60*Math.min(N,M)*1e3,Math.max(N,M)]}(o.utc(g,h).valueOf(),w,A),x=R[0],I=R[1],F=o(x).utcOffset(I);return F.$x.$timezone=A,F},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){i=g}}})});var Mx=bt((fy,my)=>{"use strict";d();c();l();u();(function(e,t){typeof fy=="object"&&typeof my<"u"?my.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(fy,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(h){var A={date:h,utc:!0,args:arguments};return new o(A)},a.utc=function(h){var A=i(this.toDate(),{locale:this.$L,utc:!0});return h?A.add(this.utcOffset(),e):A},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var p=a.parse;a.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),p.call(this,h)};var f=a.init;a.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else f.call(this)};var m=a.utcOffset;a.utcOffset=function(h,A){var w=this.$utils().u;if(w(h))return this.$u?0:w(this.$offset)?m.call(this):this.$offset;if(typeof h=="string"&&(h=function(F){F===void 0&&(F="");var P=F.match(t);if(!P)return null;var j=(""+P[0]).match(r)||["-",0,0],q=j[0],k=60*+j[1]+ +j[2];return k===0?0:q==="+"?k:-k}(h),h===null))return this;var R=Math.abs(h)<=16?60*h:h;if(R===0)return this.utc(A);var x=this.clone();if(A)return x.$offset=R,x.$u=!1,x;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(x=this.local().add(R+I,e)).$offset=R,x.$x.$localOffset=I,x};var g=a.format;a.format=function(h){var A=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,A)},a.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var S=a.toDate;a.toDate=function(h){return h==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var b=a.diff;a.diff=function(h,A,w){if(h&&this.$u===h.$u)return b.call(this,h,A,w);var R=this.local(),x=i(h).local();return b.call(R,x,A,w)}}})});var Lw=bt((ZCe,Vw)=>{"use strict";d();c();l();u();function dV(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Vw.exports=pV;function pV(e,t,r){var n=r&&r.stringify||dV,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var p=1;p<i;p++)a[p]=n(t[p]);return a.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-o,S=-1,b=e&&e.length||0,h=0;h<b;){if(e.charCodeAt(h)===37&&h+1<b){switch(S=S>-1?S:0,e.charCodeAt(h+1)){case 100:case 102:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Number(t[g]),S=h+2,h++;break;case 105:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Math.floor(Number(t[g])),S=h+2,h++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;S<h&&(m+=e.slice(S,h));var A=typeof t[g];if(A==="string"){m+="'"+t[g]+"'",S=h+2,h++;break}if(A==="function"){m+=t[g].name||"<anonymous>",S=h+2,h++;break}m+=n(t[g]),S=h+2,h++;break;case 115:if(g>=f)break;S<h&&(m+=e.slice(S,h)),m+=String(t[g]),S=h+2,h++;break;case 37:S<h&&(m+=e.slice(S,h)),m+="%",S=h+2,h++,g--;break}++g}++h}return S===-1?e:(S<b&&(m+=e.slice(S)),m)}});var Hw=bt((obe,qp)=>{"use strict";d();c();l();u();var Uw=Lw();qp.exports=En;var Lc=EV().console||{},fV={mapHttpRequest:Np,mapHttpResponse:Np,wrapRequestSerializer:nS,wrapResponseSerializer:nS,wrapErrorSerializer:nS,req:Np,res:Np,err:Bw,errWithCause:Bw};function io(e,t){return e==="silent"?1/0:t.levels.values[e]}var aS=Symbol("pino.logFuncs"),oS=Symbol("pino.hierarchy"),mV={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Qw(e,t){let r={logger:t,parent:e[oS]};t[oS]=r}function gV(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Lc[o]||Lc[mV[o]||"log"]||za}),e[aS]=n}function hV(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function En(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Lc;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=hV(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&p.forEach(function(w){r[w]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=za),gV(m,p,r),Qw({},m),Object.defineProperty(m,"levelVal",{get:S}),Object.defineProperty(m,"level",{get:b,set:h});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:RV(e),messageKey:e.messageKey||"msg",onChild:e.onChild||za};m.levels=yV(e),m.level=f,m.isLevelEnabled=function(w){return this.levels.values[w]?this.levels.values[w]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=za,m.serializers=n,m._serialize=o,m._stdErrSerialize=i,m.child=function(...w){return A.call(this,g,...w)},t&&(m._logEvent=iS());function S(){return io(this.level,this)}function b(){return this._level}function h(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,yi(this,g,m,"error"),yi(this,g,m,"fatal"),yi(this,g,m,"warn"),yi(this,g,m,"info"),yi(this,g,m,"debug"),yi(this,g,m,"trace"),a.forEach(R=>{yi(this,g,m,R)})}function A(w,R,x){if(!R)throw new Error("missing bindings for child Pino");x=x||{},o&&R.serializers&&(x.serializers=R.serializers);let I=x.serializers;if(o&&I){var F=Object.assign({},n,I),P=e.browser.serialize===!0?Object.keys(F):o;delete R.serializers,sS([R],P,F,this._stdErrSerialize)}function j(k){this._childLevel=(k._childLevel|0)+1,this.bindings=R,F&&(this.serializers=F,this._serialize=P),t&&(this._logEvent=iS([].concat(k._logEvent.bindings,R)))}j.prototype=this;let q=new j(this);return Qw(this,q),q.child=function(...k){return A.call(this,w,...k)},q.level=x.level||this.level,w.onChild(q),q}return m}function yV(e){let t=e.customLevels||{},r=Object.assign({},En.levels.values,t),n=Object.assign({},En.levels.labels,SV(t));return{values:r,labels:n}}function SV(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}En.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};En.stdSerializers=fV;En.stdTimeFunctions=Object.assign({},{nullTime:Gw,epochTime:$w,unixTime:wV,isoTime:IV});function vV(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[oS];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function yi(e,t,r,n){if(Object.defineProperty(e,n,{value:io(e.level,r)>io(n,r)?za:r[aS][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===za){if(!t.transmit)return;let i=t.transmit.level||e.level,a=io(i,r);if(io(n,r)<a)return}e[n]=CV(e,t,r,n);let o=vV(e);o.length!==0&&(e[n]=AV(o,e[n]))}function AV(e,t){return function(){return t.apply(this,[...e,...arguments])}}function CV(e,t,r,n){return function(o){return function(){let a=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Lc?Lc:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(sS(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...bV(this,n,p,a,t)):o.apply(f,p),t.transmit){let S=t.transmit.level||e._level,b=io(S,r),h=io(n,r);if(h<b)return;xV(this,{ts:a,methodLevel:n,methodValue:h,transmitLevel:S,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:io(e._level,r)},p,g)}}}(e[aS][n])}function bV(e,t,r,n,o){let{level:i,log:a=S=>S}=o.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),i){let S=i(t,e.levels.values[t]);Object.assign(m,S)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[a(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?Uw(p.shift(),p):void 0}else typeof f=="string"&&(f=Uw(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[a(m)]}}function sS(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=En.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function xV(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||sS(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=p,o(a,e._logEvent,f),e._logEvent=iS(m)}function iS(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Bw(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function RV(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Gw:$w}function Np(){return{}}function nS(e){return e}function za(){}function Gw(){return!1}function $w(){return Date.now()}function wV(){return Math.round(Date.now()/1e3)}function IV(){return new Date(Date.now()).toISOString()}function EV(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}qp.exports.default=En;qp.exports.pino=En});var ZB={};Ds(ZB,{HighlightUtils:()=>$m,ResultTemplatesHelpers:()=>Bb,SortOrder:()=>il,VERSION:()=>Dn,buildAttachToCase:()=>nI,buildAttachedResults:()=>oI,buildBreadcrumbManager:()=>_I,buildCategoryFacet:()=>oE,buildController:()=>fe,buildCriterionExpression:()=>Mr,buildDateFacet:()=>RE,buildDateFilter:()=>IE,buildDateRange:()=>cs,buildDateSortCriterion:()=>VC,buildDidYouMean:()=>UI,buildFacet:()=>SE,buildFacetConditionsManager:()=>$I,buildFacetManager:()=>zI,buildFoldedResultList:()=>QE,buildGeneratedAnswer:()=>HE,buildInsightEngine:()=>Zw,buildInsightInterface:()=>OT,buildInteractiveCitation:()=>WE,buildInteractiveResult:()=>gF,buildNotifyTrigger:()=>xT,buildNumericFacet:()=>PE,buildNumericFilter:()=>OE,buildNumericRange:()=>Bf,buildPager:()=>ZE,buildQueryError:()=>tF,buildQuerySummary:()=>nF,buildQuickview:()=>sF,buildRecentQueriesList:()=>fF,buildRelevanceSortCriterion:()=>sl,buildResultList:()=>hF,buildResultTemplatesManager:()=>QT,buildResultsPerPage:()=>SF,buildSearchBox:()=>kF,buildSearchParameterManager:()=>JF,buildSearchStatus:()=>pT,buildSmartSnippet:()=>nT,buildSmartSnippetQuestionsList:()=>aT,buildSort:()=>dT,buildTab:()=>mT,buildUserActions:()=>kT,deserializeRelativeDate:()=>Tv,getAnalyticsNextApiBaseUrl:()=>gu,getOrganizationEndpoint:()=>We,getSampleInsightEngineConfiguration:()=>cS,loadAttachedResultsActions:()=>_B,loadAttachedResultsAnalyticsActions:()=>NB,loadCaseContextActions:()=>qB,loadContextActions:()=>MB,loadDateFacetSetActions:()=>jB,loadFieldActions:()=>LB,loadFoldingActions:()=>UB,loadGeneratedAnswerActions:()=>QB,loadGenericAnalyticsActions:()=>kB,loadInsightAnalyticsActions:()=>OB,loadInsightInterfaceActions:()=>BB,loadInsightSearchActions:()=>$B,loadInsightSearchAnalyticsActions:()=>HB,loadInsightUserActionsActions:()=>zB,loadNumericFacetSetActions:()=>VB,loadQuerySetActions:()=>GB,loadQuerySuggestActions:()=>WB,loadQuestionAnsweringActions:()=>YB,loadRecentResultsActions:()=>KB});module.exports=YT(ZB);d();c();l();u();var $m={};Ds($m,{escapeHtml:()=>_i,getHighlightedSuggestion:()=>Gm,highlightString:()=>OP});d();c();l();u();d();c();l();u();function wP(e,t){let r=`
|
|
20
20
|
The following properties are invalid:
|
|
21
21
|
|
|
22
22
|
${e.join(`
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new xo(r)}var xo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Ee=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw vP(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Be=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&te(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Ti(e){return e===void 0}function AP(e){return e===null}function te(e){return Ti(e)||AP(e)}var ue=class{constructor(e={}){qe(this,"value");this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(CP(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function CP(e){return Ti(e)||uu(e)}function uu(e){return typeof e=="boolean"}var ne=class{constructor(e={}){qe(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(bP(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function bP(e){return Ti(e)||YS(e)}function YS(e){return typeof e=="number"&&!Number.isNaN(e)}var xP=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,L=class{constructor(e={}){qe(this,"value");qe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Be(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Ti(e))return null;if(!Pi(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(xP.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Pi(e){return Object.prototype.toString.call(e)==="[object String]"}var W=class{constructor(e={}){qe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ti(e))return this.config.options.required?"value is required and is currently undefined":null;if(!KS(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&te(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function KS(e){return e!==void 0&&typeof e=="object"}var re=class{constructor(e={}){qe(this,"value");this.config=e,this.value=new Be(this.config)}validate(e){if(!te(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(te(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&te(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return uu(e)||Pi(e)||YS(e)||KS(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function ki(e){return Array.isArray(e)}var Us=class{constructor(e){qe(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ti(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var lu=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function du(e){return Array.isArray(e)}function pu(e){return e.trim()===""}function JS(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function RP(e){return btoa(encodeURI(e))}function fu(e,t){let{[e]:r,...n}=t;return n}function Oi(e){return RP(JSON.stringify(e))}var wP=new Set(["1",1,"yes",!0]);function XS(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>wP.has(r))}function ZS(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ev(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Qs(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function mu(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function IP(e){if(pu(e.openingDelimiter)||pu(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(te(e.content)||pu(e.content))return e.content;if(e.highlights.length===0)return _i(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,p=a+i.length;if(p>t)break;r+=_i(e.content.slice(n,a)),r+=e.openingDelimiter,r+=_i(e.content.slice(a,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=_i(e.content.slice(n))),r}function Um(e,t){return e=_i(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Lm(n,t.notMatchDelimiters):o?Lm(o,t.exactMatchDelimiters):i?Lm(i,t.correctionDelimiters):r)}function Lm(e,t){return t?t.open+e+t.close:e}function _i(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function rv(_x2,_x3){return _rv.apply(this,arguments)}function _rv(){_rv=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _rv.apply(this,arguments)}function nv(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=FP(t,a);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function ov(e,t,r){let n=tv(),o=new TextDecoder;return function(a,p){if(a.length===0)r?.(n),n=tv();else if(p>0){let f=o.decode(a.subarray(0,p)),m=p+(a[p+1]===32?2:1),h=o.decode(a.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
|
|
27
|
-
${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":EP(h,n,t);break}}}}function EP(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function FP(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function tv(){return{data:"",event:"",id:"",retry:void 0}}var Bm="text/event-stream",TP=1e3,iv="last-event-id";function av(){return typeof window<"u"}function gu(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:p,fetch:f,...m}){return new Promise((h,v)=>{let C={...r};C.accept||(C.accept=Bm);let g;function S(){g?.abort(),document.hidden||P()}!p&&av()&&document.addEventListener("visibilitychange",S);let x=TP,w;function R(){av()&&document.removeEventListener("visibilitychange",S),clearTimeout(w),g?.abort()}t?.addEventListener("abort",()=>{R(),h()});let I=f??A,E=n??PP;function P(){return _P2.apply(this,arguments)}function _P2(){_P2=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let V=yield I(e,{...m,headers:C,signal:g?.signal});yield E(V),yield rv(V.body,nv(ov(q=>{q?C[iv]=q:delete C[iv]},q=>{x=q},o))),i?.(),R(),h()}catch(V){if(!g?.signal?.aborted)try{let q=a?.(V)??x;clearTimeout(w),w=setTimeout(P,q)}catch(q){R(),v(q)}}});return _P2.apply(this,arguments)}P()})}function PP(e){let t=e.headers.get("content-type");if(!t?.startsWith(Bm))throw new Error(`Expected content-type to be ${Bm}, Actual: ${t}`)}d();c();l();u();var _n=class{constructor(t){qe(this,"_basePath");qe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var kP=(e,t,r)=>new _n(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,sv=3,OP=5e3,_P="text/event-stream",Hm=1,Gm=class extends Error{},Bs=class extends Error{constructor(r){super(r.message);this.payload=r}},$m=class{constructor(){qe(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},hu=class{constructor(t){qe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:a}=t,{write:p,abort:f,close:m,resetAnswer:h}=r,v=new $m;if(!i){this.logger.error("No stream ID found");return}let C=0,g,S=()=>{g&&!v.isActive(g)&&(w?.abort(),h(),R())},x=()=>{v.remove(g),g=ev(S,g,OP),v.add(g)},w=new s.AbortController,R=()=>gu(kP(n,o,i),{method:"GET",fetch:A,headers:{Authorization:`Bearer ${a}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(I){return _asyncToGenerator(function*(){if(I.ok&&I.headers.get("content-type")===_P)return;throw I.status>=400&&I.status<500&&I.status!==429?new Bs({message:"Error opening stream",code:I.status}):new Gm})()},onmessage:I=>{if(w?.signal.aborted)return;let E=JSON.parse(I.data);if(E.finishReason==="ERROR"){v.remove(g),w?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),C=0,E.finishReason==="COMPLETED"?(v.remove(g),m()):x()},onerror:I=>{if(!w?.signal.aborted){if(v.remove(g),I instanceof Bs)throw w?.abort(),f(I),I;if(++C>sv){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Hm};throw w?.abort(),f(E),new Bs(E)}this.logger.info(`Retrying...(${C}/${sv})`),h()}}});return R(),w}};d();c();l();u();var yu=e=>e;d();c();l();u();d();c();l();u();var vv=Cr(gv(),1);d();c();l();u();var oe=new Error("Failed to load reducers."),Ni=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},wo=class extends Error{constructor(r,n){super();qe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function hv(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function yv(e){return typeof e!="object"||!e?!1:Object.values(e).every(ik)}function ik(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Sv(e){return e===429}var kr=class e{static call(t){return _asyncToGenerator(function*(){let r=ak(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield A(i,a);if(Sv(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,vv.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let h=m&&Sv(m.status);return h&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),h});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Ni;case 404:throw new wo(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new wo(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:p,...f}=t,m=Qs(f);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function We(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function $t(e,t="prod"){return`${We(e,t)}/rest/search/v2`}function vu(e,t="prod"){return`${We(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function ak(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,p=e.method==="POST"||e.method==="PUT",f=sk(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(p&&{body:f}),signal:a}}function sk(e,t){return t==="application/x-www-form-urlencoded"?yv(e)?hv(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();function Hs(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var tg=e=>{let{response:t}=e;return t.body?ck(e):uk(t)},ck=e=>dk(e)?pk(e):lk(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},uk=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function lk(e){return e.body.statusCode!==void 0}function dk(e){return e.body.exception!==void 0}var pk=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function Av(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rg=(e,t,r,n)=>{let o=new _n(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Cv=(e,t)=>{let r=new _n(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},ng=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield kr.call({...rg(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Hs(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Av(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return fk(a)?{success:a}:{error:tg({response:r,body:a})}});return function ng(_x5,_x6){return _ref3.apply(this,arguments)}}();function fk(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function qi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function yt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:qi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:qi(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function mk(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function gk(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Di(e,t){if(t&&e.name==="AbortError")return{error:gk(e)};if(e instanceof wo)return{error:mk(e)};throw e}var Nn=e=>e.success!==void 0,Ge=e=>e.error!==void 0;function bv(e){return e.results!==void 0}function xv(e){let t=qi();return te(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var og=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,hk=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,zs=(e,t,r,n)=>{yk(e);let o=og(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},Rv=(e,t,r)=>{Sk(e);let n=hk(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},ig=e=>{let{insightId:t,...r}=Hs(e);return r},wv=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},yk=e=>{if(wv(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},Sk=e=>{if(wv(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var Iv=e=>({...zs(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var Ev=e=>({...zs(e,"POST","application/json","/search"),requestParams:ig(e)}),Fv=e=>({...zs(e,"POST","application/json","/querysuggest"),requestParams:ig(e)});d();c();l();u();var Tv=e=>({...Rv(e,"POST","application/json"),requestParams:{objectId:e.userId}});var Au=class{constructor(t){this.options=t}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield kr.call({...Iv(t),..._this.options});if(r instanceof Error)return Di(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield kr.call({...Ev(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return Di(n);let o=yield n.json();return bv(o)&&(o=xv(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield kr.call({...Fv(t),..._this3.options});if(r instanceof Error)return Di(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield kr.call({...Tv(t),..._this4.options});if(r instanceof Error)return Di(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return ng(t,{..._this5.options})})()}};d();c();l();u();d();c();l();u();var G=new L({required:!0,emptyAllowed:!1}),He=new L({required:!1,emptyAllowed:!1}),Ye=new L({required:!0,emptyAllowed:!0}),sH=new L({required:!1,emptyAllowed:!0}),Cu=new re({each:G,required:!0}),Pv=new L({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),kv=new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),cH=new L({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),br=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),ur=(e,t)=>{if("required"in t)return{payload:new Ee({value:t}).validate({value:e}).value};let o=new W({options:{required:!0},values:t}).validate(e);if(o)throw new xo(o);return{payload:e}},_=(e,t)=>{try{return ur(e,t)}catch(r){return{payload:e,error:br(r)}}},lr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Ov(e,t,r,o,"Controller initialization error")},mt=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Ov(e,t,r,o,"Controller initialization error")},Ov=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();d();c();l();u();d();c();l();u();function xt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var vk=typeof Symbol=="function"&&Symbol.observable||"@@observable",_v=vk,ag=()=>Math.random().toString(36).substring(7).split("").join("."),Ak={INIT:`@@redux/INIT${ag()}`,REPLACE:`@@redux/REPLACE${ag()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ag()}`},bu=Ak;function Or(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function sg(e,t,r){if(typeof e!="function")throw new Error(xt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(xt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(xt(1));return r(sg)(e,t)}let n=e,o=t,i=new Map,a=i,p=0,f=!1;function m(){a===i&&(a=new Map,i.forEach((w,R)=>{a.set(R,w)}))}function h(){if(f)throw new Error(xt(3));return o}function v(w){if(typeof w!="function")throw new Error(xt(4));if(f)throw new Error(xt(5));let R=!0;m();let I=p++;return a.set(I,w),function(){if(R){if(f)throw new Error(xt(6));R=!1,m(),a.delete(I),i=null}}}function C(w){if(!Or(w))throw new Error(xt(7));if(typeof w.type>"u")throw new Error(xt(8));if(typeof w.type!="string")throw new Error(xt(17));if(f)throw new Error(xt(9));try{f=!0,o=n(o,w)}finally{f=!1}return(i=a).forEach(I=>{I()}),w}function g(w){if(typeof w!="function")throw new Error(xt(10));n=w,C({type:bu.REPLACE})}function S(){let w=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(xt(11));function I(){let P=R;P.next&&P.next(h())}return I(),{unsubscribe:w(I)}},[_v](){return this}}}return C({type:bu.INIT}),{dispatch:C,subscribe:v,getState:h,replaceReducer:g,[_v]:S}}function Ck(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:bu.INIT})>"u")throw new Error(xt(12));if(typeof r(void 0,{type:bu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(xt(13))})}function Mi(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let p=t[a];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{Ck(r)}catch(a){i=a}return function(p={},f){if(i)throw i;let m=!1,h={};for(let v=0;v<n.length;v++){let C=n[v],g=r[C],S=p[C],x=g(S,f);if(typeof x>"u"){let w=f&&f.type;throw new Error(xt(14))}h[C]=x,m=m||x!==S}return m=m||n.length!==Object.keys(p).length,m?h:p}}function ji(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Nv(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(xt(15))},a={getState:o.getState,dispatch:(f,...m)=>i(f,...m)},p=e.map(f=>f(a));return i=ji(...p)(o.dispatch),{...o,dispatch:i}}}function Vi(e){return Or(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var yg=Symbol.for("immer-nothing"),Ws=Symbol.for("immer-draftable"),Ht=Symbol.for("immer-state");function Rt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Li=Object.getPrototypeOf;function nr(e){return!!e&&!!e[Ht]}function zt(e){return e?Lv(e)||Array.isArray(e)||!!e[Ws]||!!e.constructor?.[Ws]||Ui(e)||ec(e):!1}var bk=Object.prototype.constructor.toString(),qv=new WeakMap;function Lv(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=qv.get(r);return n===void 0&&(n=Function.toString.call(r),qv.set(r,n)),n===bk}function Sg(e){return nr(e)||Rt(15,e),e[Ht].base_}function Ys(e,t,r=!0){Eo(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Eo(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:Ui(e)?2:ec(e)?3:0}function Ks(e,t){return Eo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function cg(e,t){return Eo(e)===2?e.get(t):e[t]}function Uv(e,t,r){let n=Eo(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function xk(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ui(e){return e instanceof Map}function ec(e){return e instanceof Set}function Io(e){return e.copy_||e.base_}function dg(e,t){if(Ui(e))return new Map(e);if(ec(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Lv(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ht];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],p=n[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Li(e),n)}else{let n=Li(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Iu(e,t=!1){return Eu(e)||nr(e)||!zt(e)||(Eo(e)>1&&Object.defineProperties(e,{set:xu,add:xu,clear:xu,delete:xu}),Object.freeze(e),t&&Object.values(e).forEach(r=>Iu(r,!0))),e}function Rk(){Rt(2)}var xu={value:Rk};function Eu(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var pg={};function Fo(e){let t=pg[e];return t||Rt(0,e),t}function wk(e,t){pg[e]||(pg[e]=t)}var Js;function Qv(){return Js}function Ik(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Dv(e,t){t&&(Fo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fg(e){mg(e),e.drafts_.forEach(Ek),e.drafts_=null}function mg(e){e===Js&&(Js=e.parent_)}function Mv(e){return Js=Ik(Js,e)}function Ek(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jv(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ht].modified_&&(fg(t),Rt(4)),zt(e)&&(e=Ru(t,e),t.parent_||wu(t,e)),t.patches_&&Fo("Patches").generateReplacementPatches_(r[Ht].base_,e,t.patches_,t.inversePatches_)):e=Ru(t,r,[]),fg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yg?e:void 0}function Ru(e,t,r){if(Eu(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Ht];if(!o)return Ys(t,(i,a)=>Vv(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return wu(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,p=!1;o.type_===3&&(a=new Set(i),i.clear(),p=!0),Ys(a,(f,m)=>Vv(e,o,i,f,m,r,p),n),wu(e,i,!1),r&&e.patches_&&Fo("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Vv(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let p=Eu(o);if(!(p&&!a)){if(nr(o)){let f=i&&t&&t.type_!==3&&!Ks(t.assigned_,n)?i.concat(n):void 0,m=Ru(e,o,f);if(Uv(r,n,m),nr(m))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(zt(o)&&!p){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&p)return;Ru(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Ui(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&wu(e,o)}}}function wu(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Iu(t,r)}function Fk(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Qv(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=vg;r&&(o=[n],i=Xs);let{revoke:a,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=a,p}var vg={get(e,t){if(t===Ht)return e;let r=Io(e);if(!Ks(r,t))return Tk(e,r,t);let n=r[t];return e.finalized_||!zt(n)?n:n===ug(e.base_,t)?(lg(e),e.copy_[t]=hg(n,e)):n},has(e,t){return t in Io(e)},ownKeys(e){return Reflect.ownKeys(Io(e))},set(e,t,r){let n=Bv(Io(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ug(Io(e),t),i=o?.[Ht];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(xk(r,o)&&(r!==void 0||Ks(e.base_,t)))return!0;lg(e),gg(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ug(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,lg(e),gg(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Io(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Rt(11)},getPrototypeOf(e){return Li(e.base_)},setPrototypeOf(){Rt(12)}},Xs={};Ys(vg,(e,t)=>{Xs[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xs.deleteProperty=function(e,t){return Xs.set.call(this,e,t,void 0)};Xs.set=function(e,t,r){return vg.set.call(this,e[0],t,r,e[0])};function ug(e,t){let r=e[Ht];return(r?Io(r):e)[t]}function Tk(e,t,r){let n=Bv(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Bv(e,t){if(!(t in e))return;let r=Li(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Li(r)}}function gg(e){e.modified_||(e.modified_=!0,e.parent_&&gg(e.parent_))}function lg(e){e.copy_||(e.copy_=dg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Pk=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...m){return a.produce(f,h=>r.call(this,h,...m))}}typeof r!="function"&&Rt(6),n!==void 0&&typeof n!="function"&&Rt(7);let o;if(zt(t)){let i=Mv(this),a=hg(t,void 0),p=!0;try{o=r(a),p=!1}finally{p?fg(i):mg(i)}return Dv(i,n),jv(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===yg&&(o=void 0),this.autoFreeze_&&Iu(o,!0),n){let i=[],a=[];Fo("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Rt(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...p)=>this.produceWithPatches(a,f=>t(f,...p));let n,o;return[this.produce(t,r,(a,p)=>{n=a,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zt(e)||Rt(8),nr(e)&&(e=Gv(e));let t=Mv(this),r=hg(e,void 0);return r[Ht].isManual_=!0,mg(t),r}finishDraft(e,t){let r=e&&e[Ht];(!r||!r.isManual_)&&Rt(9);let{scope_:n}=r;return Dv(n,t),jv(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Fo("Patches").applyPatches_;return nr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function hg(e,t){let r=Ui(e)?Fo("MapSet").proxyMap_(e,t):ec(e)?Fo("MapSet").proxySet_(e,t):Fk(e,t);return(t?t.scope_:Qv()).drafts_.push(r),r}function Gv(e){return nr(e)||Rt(10,e),$v(e)}function $v(e){if(!zt(e)||Eu(e))return e;let t=e[Ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=dg(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=dg(e,!0);return Ys(r,(o,i)=>{Uv(r,o,$v(i))},n),t&&(t.finalized_=!1),r}function Hv(){let t="replace",r="add",n="remove";function o(C,g,S,x){switch(C.type_){case 0:case 2:return a(C,g,S,x);case 1:return i(C,g,S,x);case 3:return p(C,g,S,x)}}function i(C,g,S,x){let{base_:w,assigned_:R}=C,I=C.copy_;I.length<w.length&&([w,I]=[I,w],[S,x]=[x,S]);for(let E=0;E<w.length;E++)if(R[E]&&I[E]!==w[E]){let P=g.concat([E]);S.push({op:t,path:P,value:v(I[E])}),x.push({op:t,path:P,value:v(w[E])})}for(let E=w.length;E<I.length;E++){let P=g.concat([E]);S.push({op:r,path:P,value:v(I[E])})}for(let E=I.length-1;w.length<=E;--E){let P=g.concat([E]);x.push({op:n,path:P})}}function a(C,g,S,x){let{base_:w,copy_:R}=C;Ys(C.assigned_,(I,E)=>{let P=cg(w,I),V=cg(R,I),q=E?Ks(w,I)?t:r:n;if(P===V&&q===t)return;let O=g.concat(I);S.push(q===n?{op:q,path:O}:{op:q,path:O,value:V}),x.push(q===r?{op:n,path:O}:q===n?{op:r,path:O,value:v(P)}:{op:t,path:O,value:v(P)})})}function p(C,g,S,x){let{base_:w,copy_:R}=C,I=0;w.forEach(E=>{if(!R.has(E)){let P=g.concat([I]);S.push({op:n,path:P,value:E}),x.unshift({op:r,path:P,value:E})}I++}),I=0,R.forEach(E=>{if(!w.has(E)){let P=g.concat([I]);S.push({op:r,path:P,value:E}),x.unshift({op:n,path:P,value:E})}I++})}function f(C,g,S,x){S.push({op:t,path:[],value:g===yg?void 0:g}),x.push({op:t,path:[],value:C})}function m(C,g){return g.forEach(S=>{let{path:x,op:w}=S,R=C;for(let V=0;V<x.length-1;V++){let q=Eo(R),O=x[V];typeof O!="string"&&typeof O!="number"&&(O=""+O),(q===0||q===1)&&(O==="__proto__"||O==="constructor")&&Rt(19),typeof R=="function"&&O==="prototype"&&Rt(19),R=cg(R,O),typeof R!="object"&&Rt(18,x.join("/"))}let I=Eo(R),E=h(S.value),P=x[x.length-1];switch(w){case t:switch(I){case 2:return R.set(P,E);case 3:Rt(16);default:return R[P]=E}case r:switch(I){case 1:return P==="-"?R.push(E):R.splice(P,0,E);case 2:return R.set(P,E);case 3:return R.add(E);default:return R[P]=E}case n:switch(I){case 1:return R.splice(P,1);case 2:return R.delete(P);case 3:return R.delete(S.value);default:return delete R[P]}default:Rt(17,w)}}),C}function h(C){if(!zt(C))return C;if(Array.isArray(C))return C.map(h);if(Ui(C))return new Map(Array.from(C.entries()).map(([S,x])=>[S,h(x)]));if(ec(C))return new Set(Array.from(C).map(h));let g=Object.create(Li(C));for(let S in C)g[S]=h(C[S]);return Ks(C,Ws)&&(g[Ws]=C[Ws]),g}function v(C){return nr(C)?h(C):C}wk("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:f})}var Zs=new Pk,yn=Zs.produce,Fu=Zs.produceWithPatches.bind(Zs);var Ag=Zs.applyPatches.bind(Zs);d();c();l();u();function kk(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ok(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _k(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var zv=e=>Array.isArray(e)?e:[e];function Nk(e){let t=Array.isArray(e[0])?e[0]:e;return _k(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function qk(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var wH=Symbol();var IH=Object.getPrototypeOf({});var Dk=class{constructor(e){this.value=e}deref(){return this.value}},Mk=typeof WeakRef<"u"?WeakRef:Dk,jk=0,Wv=1;function Tu(){return{s:jk,v:void 0,o:null,p:null}}function Qi(e,t={}){let r=Tu(),{resultEqualityCheck:n}=t,o,i=0;function a(){let p=r,{length:f}=arguments;for(let v=0,C=f;v<C;v++){let g=arguments[v];if(typeof g=="function"||typeof g=="object"&&g!==null){let S=p.o;S===null&&(p.o=S=new WeakMap);let x=S.get(g);x===void 0?(p=Tu(),S.set(g,p)):p=x}else{let S=p.p;S===null&&(p.p=S=new Map);let x=S.get(g);x===void 0?(p=Tu(),S.set(g,p)):p=x}}let m=p,h;if(p.s===Wv)h=p.v;else if(h=e.apply(null,arguments),i++,n){let v=o?.deref?.()??o;v!=null&&n(v,h)&&(h=v,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Mk(h):h}return m.s=Wv,m.v=h,h}return a.clearCache=()=>{r=Tu(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Yv(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),kk(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let h={...r,...f},{memoize:v,memoizeOptions:C=[],argsMemoize:g=Qi,argsMemoizeOptions:S=[],devModeChecks:x={}}=h,w=zv(C),R=zv(S),I=Nk(o),E=v(function(){return i++,m.apply(null,arguments)},...w),P=!0,V=g(function(){a++;let O=qk(I,arguments);return p=E.apply(null,O),p},...R);return Object.assign(V,{resultFunc:m,memoizedResultFunc:E,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var ot=Yv(Qi),Vk=Object.assign((e,t=ot)=>{Ok(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,p,f)=>(a[r[f]]=p,a),{}))},{withTypes:()=>Vk});d();c();l();u();function Kv(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Jv=Kv(),Xv=Kv;var Lk=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ji:ji.apply(null,arguments)},GH=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Uk=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Lt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Vi(n)&&n.type===e,r}var aA=class tc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,tc.prototype)}static get[Symbol.species](){return tc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new tc(...t[0].concat(this)):new tc(...t.concat(this))}};function Zv(e){return zt(e)?yn(e,()=>{}):e}function eA(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Qk(e){return typeof e=="boolean"}var Bk=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new aA;return r&&(Qk(r)?a.push(Jv):a.push(Xv(r.extraArgument))),a},rc="RTK_autoBatch",$i=()=>e=>({payload:e,meta:{[rc]:!0}}),tA=e=>t=>{setTimeout(t,e)},Gk=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tA(10):e.type==="callback"?e.queueNotification:tA(e.timeout),m=()=>{a=!1,i&&(i=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let v=()=>o&&h(),C=n.subscribe(v);return p.add(h),()=>{C(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[rc],i=!o,i&&(a||(a=!0,f(m))),n.dispatch(h)}finally{o=!0}}})},$k=e=>function(r){let{autoBatch:n=!0}=r??{},o=new aA(e);return n&&o.push(Gk(typeof n=="object"?n:void 0)),o};function sA(e){let t=Bk(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Or(r))p=Mi(r);else throw new Error(Lt(1));let f;typeof n=="function"?f=n(t):f=t();let m=ji;o&&(m=Lk({trace:!1,...(typeof o=="object"&&o)}));let h=Nv(...f),v=$k(h),C=typeof a=="function"?a(v):v(),g=m(...C);return sg(p,i,g)}function cA(e){let t={},r=[],n,o={addCase(i,a){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Lt(28));if(p in t)throw new Error(Lt(29));return t[p]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Hk(e){return typeof e=="function"}function ce(e,t){let[r,n,o]=cA(t),i;if(Hk(e))i=()=>Zv(e());else{let p=Zv(e);i=()=>p}function a(p=i(),f){let m=[r[f.type],...n.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[o]),m.reduce((h,v)=>{if(v)if(nr(h)){let g=v(h,f);return g===void 0?h:g}else{if(zt(h))return yn(h,C=>v(C,f));{let C=v(h,f);if(C===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return h},p)}return a.getInitialState=i,a}var uA=(e,t)=>Uk(e)?e.match(t):e(t);function _r(...e){return t=>e.some(r=>uA(r,t))}function Gi(...e){return t=>e.every(r=>uA(r,t))}function _u(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function nc(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Nu(...e){return e.length===0?t=>_u(t,["pending"]):nc(e)?_r(...e.map(t=>t.pending)):Nu()(e[0])}function ko(...e){return e.length===0?t=>_u(t,["rejected"]):nc(e)?_r(...e.map(t=>t.rejected)):ko()(e[0])}function oc(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Gi(ko(...e),t):nc(e)?Gi(ko(...e),t):oc()(e[0])}function Sn(...e){return e.length===0?t=>_u(t,["fulfilled"]):nc(e)?_r(...e.map(t=>t.fulfilled)):Sn()(e[0])}function qu(...e){return e.length===0?t=>_u(t,["pending","fulfilled","rejected"]):nc(e)?_r(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):qu()(e[0])}var zk="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ic=(e=21)=>{let t="",r=e;for(;r--;)t+=zk[Math.random()*64|0];return t},Wk=["name","message","stack","code"],Cg=class{constructor(e,t){qe(this,"_type");this.payload=e,this.meta=t}},rA=class{constructor(e,t){qe(this,"_type");this.payload=e,this.meta=t}},Yk=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Wk)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},le=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,h,v)=>({payload:f,meta:{...(v||{}),arg:h,requestId:m,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...(h||{}),arg:m,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,m,h,v,C)=>({payload:v,error:(n&&n.serializeError||Yk)(f||"Rejected"),meta:{...(C||{}),arg:h,requestId:m,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(m,h,v)=>{let C=n?.idGenerator?n.idGenerator(f):ic(),g=new s.AbortController,S,x;function w(I){x=I,g.abort()}let R=_asyncToGenerator(function*(){let I;try{let P=n?.condition?.(f,{getState:h,extra:v});if(Jk(P)&&(P=yield P),P===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let V=new Promise((q,O)=>{S=()=>{O({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",S)});m(i(C,f,n?.getPendingMeta?.({requestId:C,arg:f},{getState:h,extra:v}))),I=yield Promise.race([V,Promise.resolve(r(f,{dispatch:m,getState:h,extra:v,requestId:C,signal:g.signal,abort:w,rejectWithValue:(q,O)=>new Cg(q,O),fulfillWithValue:(q,O)=>new rA(q,O)})).then(q=>{if(q instanceof Cg)throw q;return q instanceof rA?o(q.payload,C,f,q.meta):o(q,C,f)})])}catch(P){I=P instanceof Cg?a(null,C,f,P.payload,P.meta):a(P,C,f)}finally{S&&g.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||m(I),I})();return Object.assign(R,{abort:w,requestId:C,arg:f,unwrap(){return R.then(Kk)}})}}return Object.assign(p,{pending:i,rejected:a,fulfilled:o,settled:_r(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Kk(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Jk(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var lA=Symbol.for("rtk-slice-createasyncthunk"),YH={[lA]:le};function Xk(e,t){return`${e}/${t}`}function Zk({creators:e}={}){let t=e?.asyncThunk?.[lA];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Lt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(tO()):n.reducers)||{},p=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(I,E){let P=typeof I=="string"?I:I.type;if(!P)throw new Error(Lt(12));if(P in f.sliceCaseReducersByType)throw new Error(Lt(13));return f.sliceCaseReducersByType[P]=E,m},addMatcher(I,E){return f.sliceMatchers.push({matcher:I,reducer:E}),m},exposeAction(I,E){return f.actionCreators[I]=E,m},exposeCaseReducer(I,E){return f.sliceCaseReducersByName[I]=E,m}};p.forEach(I=>{let E=a[I],P={reducerName:I,type:Xk(o,I),createNotation:typeof n.reducers=="function"};nO(E)?iO(P,E,m,t):rO(P,E,m)});function h(){let[I={},E=[],P=void 0]=typeof n.extraReducers=="function"?cA(n.extraReducers):[n.extraReducers],V={...I,...f.sliceCaseReducersByType};return ce(n.initialState,q=>{for(let O in V)q.addCase(O,V[O]);for(let O of f.sliceMatchers)q.addMatcher(O.matcher,O.reducer);for(let O of E)q.addMatcher(O.matcher,O.reducer);P&&q.addDefaultCase(P)})}let v=I=>I,C=new Map,g;function S(I,E){return g||(g=h()),g(I,E)}function x(){return g||(g=h()),g.getInitialState()}function w(I,E=!1){function P(q){let O=q[I];return typeof O>"u"&&E&&(O=x()),O}function V(q=v){let O=eA(C,E,()=>new WeakMap);return eA(O,q,()=>{let N={};for(let[M,U]of Object.entries(n.selectors??{}))N[M]=eO(U,q,x,E);return N})}return{reducerPath:I,getSelectors:V,get selectors(){return V(P)},selectSlice:P}}let R={name:o,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:x,...w(i),injectInto(I,{reducerPath:E,...P}={}){let V=E??i;return I.inject({reducerPath:V,reducer:S},P),{...R,...w(V,!0)}}};return R}}function eO(e,t,r,n){function o(i,...a){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...a)}return o.unwrapped=e,o}var Oo=Zk();function tO(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function rO({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!oO(n))throw new Error(Lt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function nO(e){return e._reducerDefinitionType==="asyncThunk"}function oO(e){return e._reducerDefinitionType==="reducerWithPrepare"}function iO({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Lt(18));let{payloadCreator:i,fulfilled:a,pending:p,rejected:f,settled:m,options:h}=r,v=o(e,i,h);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),p&&n.addCase(v.pending,p),f&&n.addCase(v.rejected,f),m&&n.addMatcher(v.settled,m),n.exposeCaseReducer(t,{fulfilled:a||Pu,pending:p||Pu,rejected:f||Pu,settled:m||Pu})}function Pu(){}var aO="task",dA="listener",pA="completed",Rg="cancelled",sO=`task-${Rg}`,cO=`task-${pA}`,bg=`${dA}-${Rg}`,uO=`${dA}-${pA}`,Du=class{constructor(e){qe(this,"name","TaskAbortError");qe(this,"message");this.code=e,this.message=`${aO} ${Rg} (reason: ${e})`}},wg=(e,t)=>{if(typeof e!="function")throw new TypeError(Lt(32))},ku=()=>{},fA=(e,t=ku)=>(e.catch(t),e),mA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),To=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Po=e=>{if(e.aborted){let{reason:t}=e;throw new Du(t)}};function gA(e,t){let r=ku;return new Promise((n,o)=>{let i=()=>o(new Du(e.reason));if(e.aborted){i();return}r=mA(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=ku})}var lO=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Du?"cancelled":"rejected",error:r}}finally{t?.()}});return function lO(_x7,_x8){return _ref5.apply(this,arguments)}}(),Ou=e=>t=>fA(gA(e,t).then(r=>(Po(e),r))),hA=e=>{let t=Ou(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Bi}=Object,nA={},Mu="listenerMiddleware",dO=(e,t)=>{let r=n=>mA(e,()=>To(n,e.reason));return(n,o)=>{wg(n,"taskExecutor");let i=new s.AbortController;r(i);let a=lO(/*#__PURE__*/_asyncToGenerator(function*(){Po(e),Po(i.signal);let p=yield n({pause:Ou(i.signal),delay:hA(i.signal),signal:i.signal});return Po(i.signal),p}),()=>To(i,cO));return o?.autoJoin&&t.push(a.catch(ku)),{result:Ou(e)(a),cancel(){To(i,sO)}}}},pO=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Po(t);let i=()=>{},p=[new Promise((f,m)=>{let h=e({predicate:n,effect:(v,C)=>{C.unsubscribe(),f([v,C.getState(),C.getOriginalState()])}});i=()=>{h(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield gA(t,Promise.race(p));return Po(t),f}finally{i()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>fA(r(n,o))},yA=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Lt(21));return wg(i,"options.listener"),{predicate:o,type:t,effect:i}},SA=Bi(e=>{let{type:t,predicate:r,effect:n}=yA(e);return{id:ic(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Lt(22))}}},{withTypes:()=>SA}),oA=(e,t)=>{let{type:r,effect:n,predicate:o}=yA(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},xg=e=>{e.pending.forEach(t=>{To(t,bg)})},fO=e=>()=>{e.forEach(xg),e.clear()},iA=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},vA=Bi(T(`${Mu}/add`),{withTypes:()=>vA}),mO=T(`${Mu}/removeAll`),AA=Bi(T(`${Mu}/remove`),{withTypes:()=>AA}),gO=(...e)=>{console.error(`${Mu}/error`,...e)},CA=(e={})=>{let t=new Map,{extra:r,onError:n=gO}=e;wg(n,"onError");let o=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),v=>{h.unsubscribe(),v?.cancelActive&&xg(h)}),i=h=>{let v=oA(t,h)??SA(h);return o(v)};Bi(i,{withTypes:()=>i});let a=h=>{let v=oA(t,h);return v&&(v.unsubscribe(),h.cancelActive&&xg(v)),!!v};Bi(a,{withTypes:()=>a});let p=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,v,C,g){let S=new s.AbortController,x=pO(i,S.signal),w=[];try{h.pending.add(S),yield Promise.resolve(h.effect(v,Bi({},C,{getOriginalState:g,condition:(R,I)=>x(R,I).then(Boolean),take:x,delay:hA(S.signal),pause:Ou(S.signal),extra:r,signal:S.signal,fork:dO(S.signal,w),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((R,I,E)=>{R!==S&&(To(R,bg),E.delete(R))})},cancel:()=>{To(S,bg),h.pending.delete(S)},throwIfCancelled:()=>{Po(S.signal)}})))}catch(R){R instanceof Du||iA(n,R,{raisedBy:"effect"})}finally{yield Promise.all(w),To(S,uO),h.pending.delete(S)}});return function p(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),f=fO(t);return{middleware:h=>v=>C=>{if(!Vi(C))return v(C);if(vA.match(C))return i(C.payload);if(mO.match(C)){f();return}if(AA.match(C))return a(C.payload);let g=h.getState(),S=()=>{if(g===nA)throw new Error(Lt(23));return g},x;try{if(x=v(C),t.size>0){let w=h.getState(),R=Array.from(t.values());for(let I of R){let E=!1;try{E=I.predicate(C,w,g)}catch(P){E=!1,iA(n,P,{raisedBy:"predicate"})}E&&p(I,C,h,S)}}}finally{g=nA}return x},startListening:i,stopListening:a,clearListeners:f}};var JH=Symbol.for("rtk-state-proxy-original");function Lt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var bA=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function hO(e){return typeof e=="string"&&bA.test(e)}var Ig=hO;d();c();l();u();var wt=[];for(let e=0;e<256;++e)wt.push((e+256).toString(16).slice(1));function xA(e,t=0){return(wt[e[t+0]]+wt[e[t+1]]+wt[e[t+2]]+wt[e[t+3]]+"-"+wt[e[t+4]]+wt[e[t+5]]+"-"+wt[e[t+6]]+wt[e[t+7]]+"-"+wt[e[t+8]]+wt[e[t+9]]+"-"+wt[e[t+10]]+wt[e[t+11]]+wt[e[t+12]]+wt[e[t+13]]+wt[e[t+14]]+wt[e[t+15]]).toLowerCase()}d();c();l();u();var Eg,yO=new Uint8Array(16);function Fg(){if(!Eg){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Eg=crypto.getRandomValues.bind(crypto)}return Eg(yO)}d();c();l();u();d();c();l();u();var SO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Tg={randomUUID:SO};function vO(e,t,r){e=e||{};let n=e.random??e.rng?.()??Fg();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return xA(n)}function AO(e,t,r){return Tg.randomUUID&&!t&&!e?Tg.randomUUID():vO(e,t,r)}var Pg=AO;d();c();l();u();function RA(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function CO({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var wA="visitorId";function bO(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(wA),o=n&&Ig(n)?n:t.generateUUID();return r.setItem(wA,o),o}}}var PA="1.2.15",kg=128,kA=192,IA=224,EA=240,xO=248;function RO(e){return(e&xO)===EA?4:(e&EA)===IA?3:(e&IA)===kA?2:1}function wO(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&kg)!=kg)break;if(r-=3,(n&kA)!=kg){t-r>=RO(n)*3&&(r=t);break}}return e.substring(0,r)}function IO(e){let{trackingId:t}=e;return{trackingId:t}}function EO(e){return(e.source||[]).concat([`relay@${PA}`])}function OA(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,p=IO(t),f=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:EO(t),clientId:f,userAgent:a(),referrer:FA(o()),location:FA(i())})}function FA(e){return e!==null?wO(e,1024):null}function FO(e,t,r,n,o){return{...t,meta:OA(e,r,n,o)}}var TO="*";function PO(){let e=[];function t({type:f,callback:m}){return e.findIndex(h=>h.type===f&&h.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(h){console.error(h)}})}function i(f){if(f===TO)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function a(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?a({type:f,callback:m}):i(f)}return{add:n,call:o,remove:p}}function TA({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function kO(e){let t=TA(e);return{get:()=>t,update:r=>{t=TA({...t,...r})}}}var Og=OO();function OO(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function _O(){return{getItem(e){return Og.getItem(e)||localStorage.getItem(e)},removeItem(e){Og.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Og.setItem(e,t,31556952e3)}}}function NO(){let e=document.referrer;return e===""?null:e}function _g(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(RA().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>NO(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Pg(),storage:_O()}}function qO(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function DO(){return{getItem(){return null},removeItem(){},setItem(){}}}function MO(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:DO()}}function jO(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=MO();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&VO()&&qO()?_g():n}function VO(){try{return typeof window=="object"}catch{return!1}}function LO(e){return{get:()=>Object.freeze(jO(e))}}function _A(e){let t=kO(e),r=PO(),n=LO(t),o=bO(n);return{emit:(i,a)=>{let p=t.get(),f=n.get(),m=FO(i,a,p,f,o);return CO({config:p,environment:f,event:m,listenerManager:r})},getMeta:i=>OA(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:PA}}d();c();l();u();function NA(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var qn="3.47.0",qA=["@coveo/atomic","@coveo/quantic"];var Hi=ot(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${qn}`));var ac=ot(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Hi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,p)=>{let f=QO(p);return _A({mode:i?"emit":"disabled",url:o??vu(e,t),token:r,trackingId:n??null,source:a,environment:f})}),UO={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},QO=e=>{if(!e)return;let t=e();return{...(NA()?_g():UO),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Nr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function j(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(h){try{m(n.next(h))}catch(v){a(v)}}function f(h){try{m(n.throw(h))}catch(v){a(v)}}function m(h){h.done?i(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var ke;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ke||(ke={}));function Dg(){return typeof window<"u"}function Kg(){return typeof navigator<"u"}function zi(){return typeof document<"u"}function Mg(){try{return typeof localStorage<"u"}catch{return!1}}function BO(){try{return typeof sessionStorage<"u"}catch{return!1}}function WA(){return Kg()&&navigator.cookieEnabled}var GO=[ke.click,ke.custom,ke.search,ke.view],$O=(e,t)=>GO.indexOf(e)!==-1?Object.assign({language:zi()?document.documentElement.lang:"unknown",userAgent:Kg()?navigator.userAgent:"unknown"},t):t,cc=class e{static set(t,r,n){var o,i,a,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?DA(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],DA(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function DA(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function HO(){return Mg()?localStorage:WA()?new uc:BO()?sessionStorage:new Yi}var uc=class e{getItem(t){return cc.get(`${e.prefix}${t}`)}removeItem(t){cc.erase(`${e.prefix}${t}`)}setItem(t,r,n){cc.set(`${e.prefix}${t}`,r,n)}};uc.prefix="coveo_";var jg=class{constructor(){this.cookieStorage=new uc}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Yi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},ju="__coveo.analytics.history",zO=20,WO=1e3*60,YO=75,Uu=class{constructor(t){this.store=t||HO()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return j(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return j(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(ju);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return j(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(ju);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(ju,JSON.stringify(t.slice(0,zO)))}catch{}}clear(){try{this.store.removeItem(ju)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,YO)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>WO:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var KO=(e,t)=>j(void 0,void 0,void 0,function*(){return e===ke.view?(yield JO(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),JO=e=>j(void 0,void 0,void 0,function*(){let t=new Uu,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Vu,XO=new Uint8Array(16);function ZO(){if(!Vu&&(Vu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vu(XO)}var e_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Qu(e){return typeof e=="string"&&e_.test(e)}var It=[];for(let e=0;e<256;++e)It.push((e+256).toString(16).slice(1));function YA(e,t=0){return It[e[t+0]]+It[e[t+1]]+It[e[t+2]]+It[e[t+3]]+"-"+It[e[t+4]]+It[e[t+5]]+"-"+It[e[t+6]]+It[e[t+7]]+"-"+It[e[t+8]]+It[e[t+9]]+"-"+It[e[t+10]]+It[e[t+11]]+It[e[t+12]]+It[e[t+13]]+It[e[t+14]]+It[e[t+15]]}function t_(e){if(!Qu(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function r_(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var n_="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o_="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function i_(e,t,r){function n(o,i,a,p){var f;if(typeof o=="string"&&(o=r_(o)),typeof i=="string"&&(i=t_(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(i),m.set(o,i.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,a){p=p||0;for(let h=0;h<16;++h)a[p+h]=m[h];return a}return YA(m)}try{n.name=e}catch{}return n.DNS=n_,n.URL=o_,n}var a_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MA={randomUUID:a_};function _o(e,t,r){if(MA.randomUUID&&!t&&!e)return MA.randomUUID();e=e||{};let n=e.random||(e.rng||ZO)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return YA(n)}function s_(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Ng(e,t){return e<<t|e>>>32-t}function c_(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let p=0;p<a.length;++p)e.push(a.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=p}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let p=new Uint32Array(80);for(let g=0;g<16;++g)p[g]=i[a][g];for(let g=16;g<80;++g)p[g]=Ng(p[g-3]^p[g-8]^p[g-14]^p[g-16],1);let f=r[0],m=r[1],h=r[2],v=r[3],C=r[4];for(let g=0;g<80;++g){let S=Math.floor(g/20),x=Ng(f,5)+s_(S,m,h,v)+C+t[S]+p[g]>>>0;C=v,v=h,h=Ng(m,30)>>>0,m=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+C>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var u_=i_("v5",80,c_),jA=u_,KA="2.30.52",VA=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,sc={pageview:"pageview",event:"event"},Bu=class{constructor({client:t,uuidGenerator:r=_o}){this.client=t,this.uuidGenerator=r}},Vg=class extends Bu{constructor({client:t,uuidGenerator:r=_o}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=VA(window.location),this.lastReferrer=zi()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:zi()?document.title:"",encoding:zi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===sc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===sc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===sc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===sc.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return VA(window.location)}},Dn=class e{constructor(t,r){if(!Qu(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Qu(i)?new e(i,Number.parseInt(o)*1e3):null}};Dn.cvo_cid="cvo_cid";Dn.expirationTime=120;var Lg=class extends Bu{constructor({client:t,uuidGenerator:r=_o}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return j(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Dn.cvo_cid,new Dn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Lg.Id="link";var pr=Object.keys;function Lu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qg=128,JA=192,LA=224,UA=240;function l_(e){return(e&248)===UA?4:(e&UA)===LA?3:(e&LA)===JA?2:1}function d_(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&qg)!=qg)break;if(r-=3,(n&JA)!=qg){t-r>=l_(n)*3&&(r=t);break}}return e.substring(0,r)}var Ug={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},p_=pr(Ug).map(e=>Ug[e]),f_=[...p_].join("|"),m_=new RegExp(`^(${f_}$)`),g_={svcAction:"svc_action",svcActionData:"svc_action_data"},h_=e=>pr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ug[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),y_=e=>m_.test(e),S_=[y_],QA={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},BA={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},_t={action:"pa",list:"pal",listSource:"pls"},Gu={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},v_=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Qg={id:"quoteId",affiliation:"quoteAffiliation"},Bg={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},A_={add:_t,bookmark_add:_t,bookmark_remove:_t,click:_t,checkout:_t,checkout_option:_t,detail:_t,impression:_t,remove:_t,refund:Object.assign(Object.assign({},_t),Gu),purchase:Object.assign(Object.assign({},_t),Gu),quickview:_t,quote:Object.assign(Object.assign({},_t),Qg),review:Object.assign(Object.assign({},_t),Bg)},C_=pr(QA).map(e=>QA[e]),b_=pr(BA).map(e=>BA[e]),x_=pr(_t).map(e=>_t[e]),R_=pr(Gu).map(e=>Gu[e]),w_=pr(Bg).map(e=>Bg[e]),I_=pr(Qg).map(e=>Qg[e]),E_=[...C_,"custom"].join("|"),F_=[...b_,"custom"].join("|"),XA="(pr[0-9]+)",ZA="(il[0-9]+pi[0-9]+)",T_=new RegExp(`^${XA}(${E_})$`),P_=new RegExp(`^(${ZA}(${F_}))|(il[0-9]+nm)$`),k_=new RegExp(`^(${x_.join("|")})$`),O_=new RegExp(`^(${R_.join("|")})$`),__=new RegExp(`^${XA}custom$`),N_=new RegExp(`^${ZA}custom$`),q_=new RegExp(`^(${[...v_,...w_,...I_].join("|")})$`),D_=e=>T_.test(e),M_=e=>P_.test(e),j_=e=>k_.test(e),V_=e=>O_.test(e),L_=e=>q_.test(e),U_=[M_,D_,j_,V_,L_],Q_=[__,N_],B_={anonymizeIp:"aip"},G_={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},$_={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},H_=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],z_=Object.assign(Object.assign(Object.assign(Object.assign({},B_),G_),$_),H_.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Gg=Object.assign(Object.assign({},z_),g_),W_=e=>{let t=!!e.action&&A_[e.action]||{};return pr(e).reduce((r,n)=>{let o=t[n]||Gg[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Y_=pr(Gg).map(e=>Gg[e]),K_=e=>Y_.indexOf(e)!==-1,J_=e=>e==="custom",X_=e=>[...U_,...S_,K_,J_].some(t=>t(e)),Z_=e=>pr(e).reduce((t,r)=>{let n=eN(r);return n?Object.assign(Object.assign({},t),tN(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),eN=e=>{let t;return[...Q_].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},tN=(e,t)=>pr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),$g=class{constructor(t){this.opts=t}sendEvent(t,r){return j(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return j(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=a;o=p||t;try{i=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return j(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ke.click,ke.custom,ke.search,ke.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Hg=class{sendEvent(t,r){return j(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return j(this,void 0,void 0,function*(){return Promise.resolve()})}},GA=y.fetch,$u=class{constructor(t){this.opts=t}sendEvent(t,r){return j(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),i?yield i(p,"analyticsFetch"):{}),{url:m}=f,h=Nr(f,["url"]),v;try{v=yield GA(m,h)}catch(C){console.error("An error has occured when sending the event.",C);return}if(v.ok){let C=yield v.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return j(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield GA(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ke.click,ke.custom,ke.search,ke.view].indexOf(t)!==-1}getVisitorIdParam(){return j(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},zg=class{constructor(t,r){Mg()&&WA()?this.storage=new jg:Mg()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Yi),this.client=new $u(t),this.beaconClient=new $g(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Wg=class{constructor(t,r){this.storage=r||new Yi,this.client=new $u(t)}getClientDependingOnEventType(t){return this.client}},Hu=class{constructor(){this.storage=new Yi,this.client=new Hg}getClientDependingOnEventType(t){return this.client}},rN="xx",nN=e=>e?.startsWith(rN)||!1,oN=`
|
|
26
|
+
`;return new xo(r)}var xo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Ee=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw wP(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Be=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&te(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Ti(e){return e===void 0}function IP(e){return e===null}function te(e){return Ti(e)||IP(e)}var ue=class{constructor(e={}){qe(this,"value");this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(EP(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function EP(e){return Ti(e)||cu(e)}function cu(e){return typeof e=="boolean"}var ne=class{constructor(e={}){qe(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(FP(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function FP(e){return Ti(e)||ZS(e)}function ZS(e){return typeof e=="number"&&!Number.isNaN(e)}var TP=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,L=class{constructor(e={}){qe(this,"value");qe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Be(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Ti(e))return null;if(!Pi(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(TP.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Pi(e){return Object.prototype.toString.call(e)==="[object String]"}var W=class{constructor(e={}){qe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ti(e))return this.config.options.required?"value is required and is currently undefined":null;if(!ev(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&te(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function ev(e){return e!==void 0&&typeof e=="object"}var re=class{constructor(e={}){qe(this,"value");this.config=e,this.value=new Be(this.config)}validate(e){if(!te(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(te(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&te(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return cu(e)||Pi(e)||ZS(e)||ev(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function ki(e){return Array.isArray(e)}var Ls=class{constructor(e){qe(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ti(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var uu=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function lu(e){return Array.isArray(e)}function du(e){return e.trim()===""}function tv(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function PP(e){return btoa(encodeURI(e))}function pu(e,t){let{[e]:r,...n}=t;return n}function Oi(e){return PP(JSON.stringify(e))}var kP=new Set(["1",1,"yes",!0]);function rv(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>kP.has(r))}function nv(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ov(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Us(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function fu(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function OP(e){if(du(e.openingDelimiter)||du(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(te(e.content)||du(e.content))return e.content;if(e.highlights.length===0)return _i(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,p=a+i.length;if(p>t)break;r+=_i(e.content.slice(n,a)),r+=e.openingDelimiter,r+=_i(e.content.slice(a,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=_i(e.content.slice(n))),r}function Gm(e,t){return e=_i(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Bm(n,t.notMatchDelimiters):o?Bm(o,t.exactMatchDelimiters):i?Bm(i,t.correctionDelimiters):r)}function Bm(e,t){return t?t.open+e+t.close:e}function _i(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var hv=Cr(pv(),1);d();c();l();u();var oe=new Error("Failed to load reducers."),Ni=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},wo=class extends Error{constructor(r,n){super();qe(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function fv(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function mv(e){return typeof e!="object"||!e?!1:Object.values(e).every(ok)}function ok(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function gv(e){return e===429}var kr=class e{static call(t){return _asyncToGenerator(function*(){let r=ik(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(i,a);if(gv(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,hv.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&gv(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Ni;case 404:throw new wo(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new wo(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:p,...f}=t,m=Us(f);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function We(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function $t(e,t="prod"){return`${We(e,t)}/rest/search/v2`}function gu(e,t="prod"){return`${We(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function ik(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,p=e.method==="POST"||e.method==="PUT",f=ak(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(p&&{body:f}),signal:a}}function ak(e,t){return t==="application/x-www-form-urlencoded"?mv(e)?fv(e):"":JSON.stringify(e)}d();c();l();u();var Gs=Cr(hu(),1),bv=Cr(yv(),1);d();c();l();u();var yu=Cr(hu(),1),vv=Cr(Sv(),1);yu.default.extend(vv.default);var Av="YYYY/MM/DD@HH:mm:ss",sk="1401-01-01";function qi(e,t){let r=(0,yu.default)(e,t);return!r.isValid()&&!t?(0,yu.default)(e,Av):r}function Su(e){return e.format(Av)}function Cv(e,t){let r=qi(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}ag(r)}function ag(e){if(e.isBefore(sk))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Gs.default.extend(bv.default);var xv=["past","now","next"],Rv=["minute","hour","day","week","month","quarter","year"],ck=e=>{let t=e==="now";return{amount:new ne({required:!t,min:1}),unit:new L({required:!t,constrainTo:Rv}),period:new L({required:!0,constrainTo:xv})}};function vu(e){if(typeof e=="string"&&!_n(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?sg(e):e;new Ee(ck(t.period)).validate(t);let r=Iv(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);ag(r)}function wv(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Iv(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Gs.default)().subtract(r,n);case"next":return(0,Gs.default)().add(r,n);case"now":return(0,Gs.default)()}}function $s(e){return Su(Iv(sg(e)))}function Ev(e){return e.toLocaleLowerCase().split("-")}function _n(e){let[t,r,n]=Ev(e);if(t==="now")return!0;if(!xv.includes(t)||!Rv.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Fv(e){return!!e&&typeof e=="object"&&"period"in e}function sg(e){let[t,r,n]=Ev(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function Tv(e){return vu(e),sg(e)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function kv(_x3,_x4){return _kv.apply(this,arguments)}function _kv(){_kv=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _kv.apply(this,arguments)}function Ov(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=lk(t,a);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function _v(e,t,r){let n=Pv(),o=new TextDecoder;return function(a,p){if(a.length===0)r?.(n),n=Pv();else if(p>0){let f=o.decode(a.subarray(0,p)),m=p+(a[p+1]===32?2:1),g=o.decode(a.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
|
|
27
|
+
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":uk(g,n,t);break}}}}function uk(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function lk(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Pv(){return{data:"",event:"",id:"",retry:void 0}}var cg="text/event-stream",dk=1e3,Nv="last-event-id";function qv(){return typeof window<"u"}function Au(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:p,fetch:f,...m}){return new Promise((g,S)=>{let b={...r};b.accept||(b.accept=cg);let h;function A(){h?.abort(),document.hidden||P()}!p&&qv()&&document.addEventListener("visibilitychange",A);let w=dk,R;function x(){qv()&&document.removeEventListener("visibilitychange",A),clearTimeout(R),h?.abort()}t?.addEventListener("abort",()=>{x(),g()});let I=f??v,F=n??pk;function P(){return _P2.apply(this,arguments)}function _P2(){_P2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let j=yield I(e,{...m,headers:b,signal:h?.signal});yield F(j),yield kv(j.body,Ov(_v(q=>{q?b[Nv]=q:delete b[Nv]},q=>{w=q},o))),i?.(),x(),g()}catch(j){if(!h?.signal?.aborted)try{let q=a?.(j)??w;clearTimeout(R),R=setTimeout(P,q)}catch(q){x(),S(q)}}});return _P2.apply(this,arguments)}P()})}function pk(e){let t=e.headers.get("content-type");if(!t?.startsWith(cg))throw new Error(`Expected content-type to be ${cg}, Actual: ${t}`)}d();c();l();u();var Nn=class{constructor(t){qe(this,"_basePath");qe(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var fk=(e,t,r)=>new Nn(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Dv=3,mk=5e3,gk="text/event-stream",dg=1,ug=class extends Error{},Hs=class extends Error{constructor(r){super(r.message);this.payload=r}},lg=class{constructor(){qe(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Cu=class{constructor(t){qe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:a}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,S=new lg;if(!i){this.logger.error("No stream ID found");return}let b=0,h,A=()=>{h&&!S.isActive(h)&&(R?.abort(),g(),x())},w=()=>{S.remove(h),h=ov(A,h,mk),S.add(h)},R=new s.AbortController,x=()=>Au(fk(n,o,i),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${a}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,onopen(I){return _asyncToGenerator(function*(){if(I.ok&&I.headers.get("content-type")===gk)return;throw I.status>=400&&I.status<500&&I.status!==429?new Hs({message:"Error opening stream",code:I.status}):new ug})()},onmessage:I=>{if(R?.signal.aborted)return;let F=JSON.parse(I.data);if(F.finishReason==="ERROR"){S.remove(h),R?.abort(),f({message:F.errorMessage,code:F.statusCode});return}p(F),b=0,F.finishReason==="COMPLETED"?(S.remove(h),m()):w()},onerror:I=>{if(!R?.signal.aborted){if(S.remove(h),I instanceof Hs)throw R?.abort(),f(I),I;if(++b>Dv){this.logger.info("Maximum retry exceeded.");let F={message:"Failed to complete stream.",code:dg};throw R?.abort(),f(F),new Hs(F)}this.logger.info(`Retrying...(${b}/${Dv})`),g()}}});return x(),R}};d();c();l();u();var bu=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function zs(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var pg=e=>{let{response:t}=e;return t.body?hk(e):yk(t)},hk=e=>vk(e)?Ak(e):Sk(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},yk=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Sk(e){return e.body.statusCode!==void 0}function vk(e){return e.body.exception!==void 0}var Ak=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();function Mv(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var fg=(e,t,r,n)=>{let o=new Nn(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var jv=(e,t)=>{let r=new Nn(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},mg=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield kr.call({...fg(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:zs(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Mv(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Ck(a)?{success:a}:{error:pg({response:r,body:a})}});return function mg(_x5,_x6){return _ref3.apply(this,arguments)}}();function Ck(e){return typeof e=="string"}d();c();l();u();d();c();l();u();function Di(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function yt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Di(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Di(),extendedResults:{},searchAction:void 0}}d();c();l();u();d();c();l();u();function bk(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function xk(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Mi(e,t){if(t&&e.name==="AbortError")return{error:xk(e)};if(e instanceof wo)return{error:bk(e)};throw e}var qn=e=>e.success!==void 0,Ge=e=>e.error!==void 0;function Vv(e){return e.results!==void 0}function Lv(e){let t=Di();return te(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}d();c();l();u();d();c();l();u();var gg=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,Rk=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,Ws=(e,t,r,n)=>{wk(e);let o=gg(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},Uv=(e,t,r)=>{Ik(e);let n=Rk(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},hg=e=>{let{insightId:t,...r}=zs(e);return r},Qv=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},wk=e=>{if(Qv(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},Ik=e=>{if(Qv(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var Bv=e=>({...Ws(e,"GET","application/json","/interface"),requestParams:{}});d();c();l();u();var Gv=e=>({...Ws(e,"POST","application/json","/search"),requestParams:hg(e)}),$v=e=>({...Ws(e,"POST","application/json","/querysuggest"),requestParams:hg(e)});d();c();l();u();var Hv=e=>({...Uv(e,"POST","application/json"),requestParams:{objectId:e.userId}});var xu=class{constructor(t){this.options=t}getInterface(t){var _this=this;return _asyncToGenerator(function*(){let r=yield kr.call({...Bv(t),..._this.options});if(r instanceof Error)return Mi(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}query(t,r){var _this2=this;return _asyncToGenerator(function*(){let n=yield kr.call({...Gv(t),requestMetadata:{method:"search",origin:r?.origin},..._this2.options});if(n instanceof Error)return Mi(n);let o=yield n.json();return Vv(o)&&(o=Lv(o)),n.ok?{success:o}:{error:o}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield kr.call({...$v(t),..._this3.options});if(r instanceof Error)return Mi(r);let n=yield r.json();return n.completions?{success:n}:{error:n}})()}userActions(t){var _this4=this;return _asyncToGenerator(function*(){let r=yield kr.call({...Hv(t),..._this4.options});if(r instanceof Error)return Mi(r);let n=yield r.json();return r.ok?{success:n}:{error:n}})()}html(t){var _this5=this;return _asyncToGenerator(function*(){return mg(t,{..._this5.options})})()}};d();c();l();u();d();c();l();u();var G=new L({required:!0,emptyAllowed:!1}),He=new L({required:!1,emptyAllowed:!1}),Ye=new L({required:!0,emptyAllowed:!0}),LH=new L({required:!1,emptyAllowed:!0}),Ru=new re({each:G,required:!0}),zv=new L({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Wv=new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),UH=new L({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),br=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),ur=(e,t)=>{if("required"in t)return{payload:new Ee({value:t}).validate({value:e}).value};let o=new W({options:{required:!0},values:t}).validate(e);if(o)throw new xo(o);return{payload:e}},_=(e,t)=>{try{return ur(e,t)}catch(r){return{payload:e,error:br(r)}}},lr=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Yv(e,t,r,o,"Controller initialization error")},mt=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Yv(e,t,r,o,"Controller initialization error")},Yv=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();d();c();l();u();d();c();l();u();function xt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ek=typeof Symbol=="function"&&Symbol.observable||"@@observable",Kv=Ek,yg=()=>Math.random().toString(36).substring(7).split("").join("."),Fk={INIT:`@@redux/INIT${yg()}`,REPLACE:`@@redux/REPLACE${yg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${yg()}`},wu=Fk;function Or(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Sg(e,t,r){if(typeof e!="function")throw new Error(xt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(xt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(xt(1));return r(Sg)(e,t)}let n=e,o=t,i=new Map,a=i,p=0,f=!1;function m(){a===i&&(a=new Map,i.forEach((R,x)=>{a.set(x,R)}))}function g(){if(f)throw new Error(xt(3));return o}function S(R){if(typeof R!="function")throw new Error(xt(4));if(f)throw new Error(xt(5));let x=!0;m();let I=p++;return a.set(I,R),function(){if(x){if(f)throw new Error(xt(6));x=!1,m(),a.delete(I),i=null}}}function b(R){if(!Or(R))throw new Error(xt(7));if(typeof R.type>"u")throw new Error(xt(8));if(typeof R.type!="string")throw new Error(xt(17));if(f)throw new Error(xt(9));try{f=!0,o=n(o,R)}finally{f=!1}return(i=a).forEach(I=>{I()}),R}function h(R){if(typeof R!="function")throw new Error(xt(10));n=R,b({type:wu.REPLACE})}function A(){let R=S;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(xt(11));function I(){let P=x;P.next&&P.next(g())}return I(),{unsubscribe:R(I)}},[Kv](){return this}}}return b({type:wu.INIT}),{dispatch:b,subscribe:S,getState:g,replaceReducer:h,[Kv]:A}}function Tk(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:wu.INIT})>"u")throw new Error(xt(12));if(typeof r(void 0,{type:wu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(xt(13))})}function ji(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let p=t[a];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{Tk(r)}catch(a){i=a}return function(p={},f){if(i)throw i;let m=!1,g={};for(let S=0;S<n.length;S++){let b=n[S],h=r[b],A=p[b],w=h(A,f);if(typeof w>"u"){let R=f&&f.type;throw new Error(xt(14))}g[b]=w,m=m||w!==A}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Vi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Jv(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(xt(15))},a={getState:o.getState,dispatch:(f,...m)=>i(f,...m)},p=e.map(f=>f(a));return i=Vi(...p)(o.dispatch),{...o,dispatch:i}}}function Li(e){return Or(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var Fg=Symbol.for("immer-nothing"),Ys=Symbol.for("immer-draftable"),Ht=Symbol.for("immer-state");function Rt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ui=Object.getPrototypeOf;function nr(e){return!!e&&!!e[Ht]}function zt(e){return e?nA(e)||Array.isArray(e)||!!e[Ys]||!!e.constructor?.[Ys]||Qi(e)||tc(e):!1}var Pk=Object.prototype.constructor.toString(),Xv=new WeakMap;function nA(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Xv.get(r);return n===void 0&&(n=Function.toString.call(r),Xv.set(r,n)),n===Pk}function Tg(e){return nr(e)||Rt(15,e),e[Ht].base_}function Ks(e,t,r=!0){Eo(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Eo(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:Qi(e)?2:tc(e)?3:0}function Js(e,t){return Eo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vg(e,t){return Eo(e)===2?e.get(t):e[t]}function oA(e,t,r){let n=Eo(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kk(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qi(e){return e instanceof Map}function tc(e){return e instanceof Set}function Io(e){return e.copy_||e.base_}function bg(e,t){if(Qi(e))return new Map(e);if(tc(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=nA(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ht];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],p=n[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Ui(e),n)}else{let n=Ui(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Tu(e,t=!1){return Pu(e)||nr(e)||!zt(e)||(Eo(e)>1&&Object.defineProperties(e,{set:Iu,add:Iu,clear:Iu,delete:Iu}),Object.freeze(e),t&&Object.values(e).forEach(r=>Tu(r,!0))),e}function Ok(){Rt(2)}var Iu={value:Ok};function Pu(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var xg={};function Fo(e){let t=xg[e];return t||Rt(0,e),t}function _k(e,t){xg[e]||(xg[e]=t)}var Xs;function iA(){return Xs}function Nk(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zv(e,t){t&&(Fo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Rg(e){wg(e),e.drafts_.forEach(qk),e.drafts_=null}function wg(e){e===Xs&&(Xs=e.parent_)}function eA(e){return Xs=Nk(Xs,e)}function qk(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tA(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ht].modified_&&(Rg(t),Rt(4)),zt(e)&&(e=Eu(t,e),t.parent_||Fu(t,e)),t.patches_&&Fo("Patches").generateReplacementPatches_(r[Ht].base_,e,t.patches_,t.inversePatches_)):e=Eu(t,r,[]),Rg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Fg?e:void 0}function Eu(e,t,r){if(Pu(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Ht];if(!o)return Ks(t,(i,a)=>rA(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return Fu(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,p=!1;o.type_===3&&(a=new Set(i),i.clear(),p=!0),Ks(a,(f,m)=>rA(e,o,i,f,m,r,p),n),Fu(e,i,!1),r&&e.patches_&&Fo("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function rA(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let p=Pu(o);if(!(p&&!a)){if(nr(o)){let f=i&&t&&t.type_!==3&&!Js(t.assigned_,n)?i.concat(n):void 0,m=Eu(e,o,f);if(oA(r,n,m),nr(m))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(zt(o)&&!p){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&p)return;Eu(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Qi(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Fu(e,o)}}}function Fu(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tu(t,r)}function Dk(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:iA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=Pg;r&&(o=[n],i=Zs);let{revoke:a,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=a,p}var Pg={get(e,t){if(t===Ht)return e;let r=Io(e);if(!Js(r,t))return Mk(e,r,t);let n=r[t];return e.finalized_||!zt(n)?n:n===Ag(e.base_,t)?(Cg(e),e.copy_[t]=Eg(n,e)):n},has(e,t){return t in Io(e)},ownKeys(e){return Reflect.ownKeys(Io(e))},set(e,t,r){let n=aA(Io(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Ag(Io(e),t),i=o?.[Ht];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kk(r,o)&&(r!==void 0||Js(e.base_,t)))return!0;Cg(e),Ig(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ag(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Cg(e),Ig(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Io(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Rt(11)},getPrototypeOf(e){return Ui(e.base_)},setPrototypeOf(){Rt(12)}},Zs={};Ks(Pg,(e,t)=>{Zs[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Zs.deleteProperty=function(e,t){return Zs.set.call(this,e,t,void 0)};Zs.set=function(e,t,r){return Pg.set.call(this,e[0],t,r,e[0])};function Ag(e,t){let r=e[Ht];return(r?Io(r):e)[t]}function Mk(e,t,r){let n=aA(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function aA(e,t){if(!(t in e))return;let r=Ui(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ui(r)}}function Ig(e){e.modified_||(e.modified_=!0,e.parent_&&Ig(e.parent_))}function Cg(e){e.copy_||(e.copy_=bg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var jk=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(f=i,...m){return a.produce(f,g=>r.call(this,g,...m))}}typeof r!="function"&&Rt(6),n!==void 0&&typeof n!="function"&&Rt(7);let o;if(zt(t)){let i=eA(this),a=Eg(t,void 0),p=!0;try{o=r(a),p=!1}finally{p?Rg(i):wg(i)}return Zv(i,n),tA(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Fg&&(o=void 0),this.autoFreeze_&&Tu(o,!0),n){let i=[],a=[];Fo("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Rt(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...p)=>this.produceWithPatches(a,f=>t(f,...p));let n,o;return[this.produce(t,r,(a,p)=>{n=a,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zt(e)||Rt(8),nr(e)&&(e=sA(e));let t=eA(this),r=Eg(e,void 0);return r[Ht].isManual_=!0,wg(t),r}finishDraft(e,t){let r=e&&e[Ht];(!r||!r.isManual_)&&Rt(9);let{scope_:n}=r;return Zv(n,t),tA(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Fo("Patches").applyPatches_;return nr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Eg(e,t){let r=Qi(e)?Fo("MapSet").proxyMap_(e,t):tc(e)?Fo("MapSet").proxySet_(e,t):Dk(e,t);return(t?t.scope_:iA()).drafts_.push(r),r}function sA(e){return nr(e)||Rt(10,e),cA(e)}function cA(e){if(!zt(e)||Pu(e))return e;let t=e[Ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=bg(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=bg(e,!0);return Ks(r,(o,i)=>{oA(r,o,cA(i))},n),t&&(t.finalized_=!1),r}function uA(){let t="replace",r="add",n="remove";function o(b,h,A,w){switch(b.type_){case 0:case 2:return a(b,h,A,w);case 1:return i(b,h,A,w);case 3:return p(b,h,A,w)}}function i(b,h,A,w){let{base_:R,assigned_:x}=b,I=b.copy_;I.length<R.length&&([R,I]=[I,R],[A,w]=[w,A]);for(let F=0;F<R.length;F++)if(x[F]&&I[F]!==R[F]){let P=h.concat([F]);A.push({op:t,path:P,value:S(I[F])}),w.push({op:t,path:P,value:S(R[F])})}for(let F=R.length;F<I.length;F++){let P=h.concat([F]);A.push({op:r,path:P,value:S(I[F])})}for(let F=I.length-1;R.length<=F;--F){let P=h.concat([F]);w.push({op:n,path:P})}}function a(b,h,A,w){let{base_:R,copy_:x}=b;Ks(b.assigned_,(I,F)=>{let P=vg(R,I),j=vg(x,I),q=F?Js(R,I)?t:r:n;if(P===j&&q===t)return;let k=h.concat(I);A.push(q===n?{op:q,path:k}:{op:q,path:k,value:j}),w.push(q===r?{op:n,path:k}:q===n?{op:r,path:k,value:S(P)}:{op:t,path:k,value:S(P)})})}function p(b,h,A,w){let{base_:R,copy_:x}=b,I=0;R.forEach(F=>{if(!x.has(F)){let P=h.concat([I]);A.push({op:n,path:P,value:F}),w.unshift({op:r,path:P,value:F})}I++}),I=0,x.forEach(F=>{if(!R.has(F)){let P=h.concat([I]);A.push({op:r,path:P,value:F}),w.unshift({op:n,path:P,value:F})}I++})}function f(b,h,A,w){A.push({op:t,path:[],value:h===Fg?void 0:h}),w.push({op:t,path:[],value:b})}function m(b,h){return h.forEach(A=>{let{path:w,op:R}=A,x=b;for(let j=0;j<w.length-1;j++){let q=Eo(x),k=w[j];typeof k!="string"&&typeof k!="number"&&(k=""+k),(q===0||q===1)&&(k==="__proto__"||k==="constructor")&&Rt(19),typeof x=="function"&&k==="prototype"&&Rt(19),x=vg(x,k),typeof x!="object"&&Rt(18,w.join("/"))}let I=Eo(x),F=g(A.value),P=w[w.length-1];switch(R){case t:switch(I){case 2:return x.set(P,F);case 3:Rt(16);default:return x[P]=F}case r:switch(I){case 1:return P==="-"?x.push(F):x.splice(P,0,F);case 2:return x.set(P,F);case 3:return x.add(F);default:return x[P]=F}case n:switch(I){case 1:return x.splice(P,1);case 2:return x.delete(P);case 3:return x.delete(A.value);default:return delete x[P]}default:Rt(17,R)}}),b}function g(b){if(!zt(b))return b;if(Array.isArray(b))return b.map(g);if(Qi(b))return new Map(Array.from(b.entries()).map(([A,w])=>[A,g(w)]));if(tc(b))return new Set(Array.from(b).map(g));let h=Object.create(Ui(b));for(let A in b)h[A]=g(b[A]);return Js(b,Ys)&&(h[Ys]=b[Ys]),h}function S(b){return nr(b)?g(b):b}_k("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:f})}var ec=new jk,yn=ec.produce,ku=ec.produceWithPatches.bind(ec);var kg=ec.applyPatches.bind(ec);d();c();l();u();function Vk(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Lk(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Uk(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var lA=e=>Array.isArray(e)?e:[e];function Qk(e){let t=Array.isArray(e[0])?e[0]:e;return Uk(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Bk(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var o3=Object.getPrototypeOf({});var Gk=class{constructor(e){this.value=e}deref(){return this.value}},$k=typeof WeakRef<"u"?WeakRef:Gk,Hk=0,dA=1;function Ou(){return{s:Hk,v:void 0,o:null,p:null}}function Bi(e,t={}){let r=Ou(),{resultEqualityCheck:n}=t,o,i=0;function a(){let p=r,{length:f}=arguments;for(let S=0,b=f;S<b;S++){let h=arguments[S];if(typeof h=="function"||typeof h=="object"&&h!==null){let A=p.o;A===null&&(p.o=A=new WeakMap);let w=A.get(h);w===void 0?(p=Ou(),A.set(h,p)):p=w}else{let A=p.p;A===null&&(p.p=A=new Map);let w=A.get(h);w===void 0?(p=Ou(),A.set(h,p)):p=w}}let m=p,g;if(p.s===dA)g=p.v;else if(g=e.apply(null,arguments),i++,n){let S=o?.deref?.()??o;S!=null&&n(S,g)&&(g=S,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new $k(g):g}return m.s=dA,m.v=g,g}return a.clearCache=()=>{r=Ou(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function pA(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),Vk(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:S,memoizeOptions:b=[],argsMemoize:h=Bi,argsMemoizeOptions:A=[],devModeChecks:w={}}=g,R=lA(b),x=lA(A),I=Qk(o),F=S(function(){return i++,m.apply(null,arguments)},...R),P=!0,j=h(function(){a++;let k=Bk(I,arguments);return p=F.apply(null,k),p},...x);return Object.assign(j,{resultFunc:m,memoizedResultFunc:F,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:S,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var ot=pA(Bi),zk=Object.assign((e,t=ot)=>{Lk(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,p,f)=>(a[r[f]]=p,a),{}))},{withTypes:()=>zk});d();c();l();u();function fA(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var mA=fA(),gA=fA;var Wk=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Vi:Vi.apply(null,arguments)},b3=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Yk=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Lt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Li(n)&&n.type===e,r}var xA=class rc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,rc.prototype)}static get[Symbol.species](){return rc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new rc(...t[0].concat(this)):new rc(...t.concat(this))}};function hA(e){return zt(e)?yn(e,()=>{}):e}function yA(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Kk(e){return typeof e=="boolean"}var Jk=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new xA;return r&&(Kk(r)?a.push(mA):a.push(gA(r.extraArgument))),a},nc="RTK_autoBatch",Hi=()=>e=>({payload:e,meta:{[nc]:!0}}),SA=e=>t=>{setTimeout(t,e)},Xk=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:SA(10):e.type==="callback"?e.queueNotification:SA(e.timeout),m=()=>{a=!1,i&&(i=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let S=()=>o&&g(),b=n.subscribe(S);return p.add(g),()=>{b(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[nc],i=!o,i&&(a||(a=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},Zk=e=>function(r){let{autoBatch:n=!0}=r??{},o=new xA(e);return n&&o.push(Xk(typeof n=="object"?n:void 0)),o};function RA(e){let t=Jk(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Or(r))p=ji(r);else throw new Error(Lt(1));let f;typeof n=="function"?f=n(t):f=t();let m=Vi;o&&(m=Wk({trace:!1,...(typeof o=="object"&&o)}));let g=Jv(...f),S=Zk(g),b=typeof a=="function"?a(S):S(),h=m(...b);return Sg(p,i,h)}function wA(e){let t={},r=[],n,o={addCase(i,a){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Lt(28));if(p in t)throw new Error(Lt(29));return t[p]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function eO(e){return typeof e=="function"}function ce(e,t){let[r,n,o]=wA(t),i;if(eO(e))i=()=>hA(e());else{let p=hA(e);i=()=>p}function a(p=i(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,S)=>{if(S)if(nr(g)){let h=S(g,f);return h===void 0?g:h}else{if(zt(g))return yn(g,b=>S(b,f));{let b=S(g,f);if(b===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return g},p)}return a.getInitialState=i,a}var IA=(e,t)=>Yk(e)?e.match(t):e(t);function _r(...e){return t=>e.some(r=>IA(r,t))}function $i(...e){return t=>e.every(r=>IA(r,t))}function Du(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function oc(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Mu(...e){return e.length===0?t=>Du(t,["pending"]):oc(e)?_r(...e.map(t=>t.pending)):Mu()(e[0])}function ko(...e){return e.length===0?t=>Du(t,["rejected"]):oc(e)?_r(...e.map(t=>t.rejected)):ko()(e[0])}function ic(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?$i(ko(...e),t):oc(e)?$i(ko(...e),t):ic()(e[0])}function Sn(...e){return e.length===0?t=>Du(t,["fulfilled"]):oc(e)?_r(...e.map(t=>t.fulfilled)):Sn()(e[0])}function ju(...e){return e.length===0?t=>Du(t,["pending","fulfilled","rejected"]):oc(e)?_r(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ju()(e[0])}var tO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ac=(e=21)=>{let t="",r=e;for(;r--;)t+=tO[Math.random()*64|0];return t},rO=["name","message","stack","code"],Og=class{constructor(e,t){qe(this,"_type");this.payload=e,this.meta=t}},vA=class{constructor(e,t){qe(this,"_type");this.payload=e,this.meta=t}},nO=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of rO)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},le=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,g,S)=>({payload:f,meta:{...(S||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,m,g,S,b)=>({payload:S,error:(n&&n.serializeError||nO)(f||"Rejected"),meta:{...(b||{}),arg:g,requestId:m,rejectedWithValue:!!S,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(m,g,S)=>{let b=n?.idGenerator?n.idGenerator(f):ac(),h=new s.AbortController,A,w;function R(I){w=I,h.abort()}let x=_asyncToGenerator(function*(){let I;try{let P=n?.condition?.(f,{getState:g,extra:S});if(iO(P)&&(P=yield P),P===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let j=new Promise((q,k)=>{A=()=>{k({name:"AbortError",message:w||"Aborted"})},h.signal.addEventListener("abort",A)});m(i(b,f,n?.getPendingMeta?.({requestId:b,arg:f},{getState:g,extra:S}))),I=yield Promise.race([j,Promise.resolve(r(f,{dispatch:m,getState:g,extra:S,requestId:b,signal:h.signal,abort:R,rejectWithValue:(q,k)=>new Og(q,k),fulfillWithValue:(q,k)=>new vA(q,k)})).then(q=>{if(q instanceof Og)throw q;return q instanceof vA?o(q.payload,b,f,q.meta):o(q,b,f)})])}catch(P){I=P instanceof Og?a(null,b,f,P.payload,P.meta):a(P,b,f)}finally{A&&h.signal.removeEventListener("abort",A)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||m(I),I})();return Object.assign(x,{abort:R,requestId:b,arg:f,unwrap(){return x.then(oO)}})}}return Object.assign(p,{pending:i,rejected:a,fulfilled:o,settled:_r(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function oO(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function iO(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var EA=Symbol.for("rtk-slice-createasyncthunk"),E3={[EA]:le};function aO(e,t){return`${e}/${t}`}function sO({creators:e}={}){let t=e?.asyncThunk?.[EA];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Lt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(uO()):n.reducers)||{},p=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(I,F){let P=typeof I=="string"?I:I.type;if(!P)throw new Error(Lt(12));if(P in f.sliceCaseReducersByType)throw new Error(Lt(13));return f.sliceCaseReducersByType[P]=F,m},addMatcher(I,F){return f.sliceMatchers.push({matcher:I,reducer:F}),m},exposeAction(I,F){return f.actionCreators[I]=F,m},exposeCaseReducer(I,F){return f.sliceCaseReducersByName[I]=F,m}};p.forEach(I=>{let F=a[I],P={reducerName:I,type:aO(o,I),createNotation:typeof n.reducers=="function"};dO(F)?fO(P,F,m,t):lO(P,F,m)});function g(){let[I={},F=[],P=void 0]=typeof n.extraReducers=="function"?wA(n.extraReducers):[n.extraReducers],j={...I,...f.sliceCaseReducersByType};return ce(n.initialState,q=>{for(let k in j)q.addCase(k,j[k]);for(let k of f.sliceMatchers)q.addMatcher(k.matcher,k.reducer);for(let k of F)q.addMatcher(k.matcher,k.reducer);P&&q.addDefaultCase(P)})}let S=I=>I,b=new Map,h;function A(I,F){return h||(h=g()),h(I,F)}function w(){return h||(h=g()),h.getInitialState()}function R(I,F=!1){function P(q){let k=q[I];return typeof k>"u"&&F&&(k=w()),k}function j(q=S){let k=yA(b,F,()=>new WeakMap);return yA(k,q,()=>{let N={};for(let[M,U]of Object.entries(n.selectors??{}))N[M]=cO(U,q,w,F);return N})}return{reducerPath:I,getSelectors:j,get selectors(){return j(P)},selectSlice:P}}let x={name:o,reducer:A,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(i),injectInto(I,{reducerPath:F,...P}={}){let j=F??i;return I.inject({reducerPath:j,reducer:A},P),{...x,...R(j,!0)}}};return x}}function cO(e,t,r,n){function o(i,...a){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...a)}return o.unwrapped=e,o}var Oo=sO();function uO(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function lO({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!pO(n))throw new Error(Lt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function dO(e){return e._reducerDefinitionType==="asyncThunk"}function pO(e){return e._reducerDefinitionType==="reducerWithPrepare"}function fO({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Lt(18));let{payloadCreator:i,fulfilled:a,pending:p,rejected:f,settled:m,options:g}=r,S=o(e,i,g);n.exposeAction(t,S),a&&n.addCase(S.fulfilled,a),p&&n.addCase(S.pending,p),f&&n.addCase(S.rejected,f),m&&n.addMatcher(S.settled,m),n.exposeCaseReducer(t,{fulfilled:a||_u,pending:p||_u,rejected:f||_u,settled:m||_u})}function _u(){}var mO="task",FA="listener",TA="completed",qg="cancelled",gO=`task-${qg}`,hO=`task-${TA}`,_g=`${FA}-${qg}`,yO=`${FA}-${TA}`,Vu=class{constructor(e){qe(this,"name","TaskAbortError");qe(this,"message");this.code=e,this.message=`${mO} ${qg} (reason: ${e})`}},Dg=(e,t)=>{if(typeof e!="function")throw new TypeError(Lt(32))},Nu=()=>{},PA=(e,t=Nu)=>(e.catch(t),e),kA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),To=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Po=e=>{if(e.aborted){let{reason:t}=e;throw new Vu(t)}};function OA(e,t){let r=Nu;return new Promise((n,o)=>{let i=()=>o(new Vu(e.reason));if(e.aborted){i();return}r=kA(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Nu})}var SO=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Vu?"cancelled":"rejected",error:r}}finally{t?.()}});return function SO(_x7,_x8){return _ref5.apply(this,arguments)}}(),qu=e=>t=>PA(OA(e,t).then(r=>(Po(e),r))),_A=e=>{let t=qu(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Gi}=Object,AA={},Lu="listenerMiddleware",vO=(e,t)=>{let r=n=>kA(e,()=>To(n,e.reason));return(n,o)=>{Dg(n,"taskExecutor");let i=new s.AbortController;r(i);let a=SO(/*#__PURE__*/_asyncToGenerator(function*(){Po(e),Po(i.signal);let p=yield n({pause:qu(i.signal),delay:_A(i.signal),signal:i.signal});return Po(i.signal),p}),()=>To(i,hO));return o?.autoJoin&&t.push(a.catch(Nu)),{result:qu(e)(a),cancel(){To(i,gO)}}}},AO=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){Po(t);let i=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(S,b)=>{b.unsubscribe(),f([S,b.getState(),b.getOriginalState()])}});i=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield OA(t,Promise.race(p));return Po(t),f}finally{i()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>PA(r(n,o))},NA=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Lt(21));return Dg(i,"options.listener"),{predicate:o,type:t,effect:i}},qA=Gi(e=>{let{type:t,predicate:r,effect:n}=NA(e);return{id:ac(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Lt(22))}}},{withTypes:()=>qA}),CA=(e,t)=>{let{type:r,effect:n,predicate:o}=NA(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Ng=e=>{e.pending.forEach(t=>{To(t,_g)})},CO=e=>()=>{e.forEach(Ng),e.clear()},bA=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},DA=Gi(T(`${Lu}/add`),{withTypes:()=>DA}),bO=T(`${Lu}/removeAll`),MA=Gi(T(`${Lu}/remove`),{withTypes:()=>MA}),xO=(...e)=>{console.error(`${Lu}/error`,...e)},jA=(e={})=>{let t=new Map,{extra:r,onError:n=xO}=e;Dg(n,"onError");let o=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),S=>{g.unsubscribe(),S?.cancelActive&&Ng(g)}),i=g=>{let S=CA(t,g)??qA(g);return o(S)};Gi(i,{withTypes:()=>i});let a=g=>{let S=CA(t,g);return S&&(S.unsubscribe(),g.cancelActive&&Ng(S)),!!S};Gi(a,{withTypes:()=>a});let p=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,S,b,h){let A=new s.AbortController,w=AO(i,A.signal),R=[];try{g.pending.add(A),yield Promise.resolve(g.effect(S,Gi({},b,{getOriginalState:h,condition:(x,I)=>w(x,I).then(Boolean),take:w,delay:_A(A.signal),pause:qu(A.signal),extra:r,signal:A.signal,fork:vO(A.signal,R),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((x,I,F)=>{x!==A&&(To(x,_g),F.delete(x))})},cancel:()=>{To(A,_g),g.pending.delete(A)},throwIfCancelled:()=>{Po(A.signal)}})))}catch(x){x instanceof Vu||bA(n,x,{raisedBy:"effect"})}finally{yield Promise.all(R),To(A,yO),g.pending.delete(A)}});return function p(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),f=CO(t);return{middleware:g=>S=>b=>{if(!Li(b))return S(b);if(DA.match(b))return i(b.payload);if(bO.match(b)){f();return}if(MA.match(b))return a(b.payload);let h=g.getState(),A=()=>{if(h===AA)throw new Error(Lt(23));return h},w;try{if(w=S(b),t.size>0){let R=g.getState(),x=Array.from(t.values());for(let I of x){let F=!1;try{F=I.predicate(b,R,h)}catch(P){F=!1,bA(n,P,{raisedBy:"predicate"})}F&&p(I,b,g,A)}}}finally{h=AA}return w},startListening:i,stopListening:a,clearListeners:f}};function Lt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();function VA(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var LA=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function RO(e){return typeof e=="string"&&LA.test(e)}var Mg=RO;d();c();l();u();var wt=[];for(let e=0;e<256;++e)wt.push((e+256).toString(16).slice(1));function UA(e,t=0){return(wt[e[t+0]]+wt[e[t+1]]+wt[e[t+2]]+wt[e[t+3]]+"-"+wt[e[t+4]]+wt[e[t+5]]+"-"+wt[e[t+6]]+wt[e[t+7]]+"-"+wt[e[t+8]]+wt[e[t+9]]+"-"+wt[e[t+10]]+wt[e[t+11]]+wt[e[t+12]]+wt[e[t+13]]+wt[e[t+14]]+wt[e[t+15]]).toLowerCase()}d();c();l();u();var jg,wO=new Uint8Array(16);function Vg(){if(!jg){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");jg=crypto.getRandomValues.bind(crypto)}return jg(wO)}d();c();l();u();d();c();l();u();var IO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Lg={randomUUID:IO};function EO(e,t,r){e=e||{};let n=e.random??e.rng?.()??Vg();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return UA(n)}function FO(e,t,r){return Lg.randomUUID&&!t&&!e?Lg.randomUUID():EO(e,t,r)}var Ug=FO;function TO(_x13){return _TO.apply(this,arguments)}function _TO(){_TO=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _TO.apply(this,arguments)}var zA="2.0.4",Qg=128,WA=192,QA=224,BA=240,PO=248;function kO(e){return(e&PO)===BA?4:(e&BA)===QA?3:(e&QA)===WA?2:1}function OO(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&Qg)!=Qg)break;if(r-=3,(n&WA)!=Qg){t-r>=kO(n)*3&&(r=t);break}}return e.substring(0,r)}function _O(e){let{trackingId:t}=e;return{trackingId:t}}function NO(e){return(e.source||[]).concat([`relay@${zA}`])}function YA(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=_O(t),p=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:NO(t),clientId:p,userAgent:i(),referrer:GA(n()),location:GA(o())})}function GA(e){return e!==null?OO(e,1024):null}function qO(e,t,r,n){return{...t,meta:YA(e,r,n)}}var DO="*";function MO(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function i(f){if(f===DO)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function a(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?a({type:f,callback:m}):i(f)}return{add:n,call:o,remove:p}}function $A({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function jO(e){let t=$A(e);return{get:()=>t,update:r=>{t=$A({...t,...r})}}}var Bg=VO();function VO(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function LO(){return{getItem(e){return Bg.getItem(e)||localStorage.getItem(e)},removeItem(e){Bg.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Bg.setItem(e,t,31556952e3)}}}var HA="visitorId";function UO(){let e=document.referrer;return e===""?null:e}function Gg(){let e=LO();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});VA().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let p;try{p=yield a.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>UO(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(HA);if(t&&Mg(t))return t;let r=Ug();return e.setItem(HA,r),r}}}function QO(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function BO(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function GO(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=BO();return t&&r?{...r,runtime:"custom"}:t&&$O()&&QO()?Gg():n}function $O(){try{return typeof window=="object"}catch{return!1}}function HO(e){return{get:()=>Object.freeze(GO(e))}}function KA(e){let t=jO(e),r=MO(),n=HO(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,i){let a=t.get(),p=n.get(),f=qO(o,i,a,p);return TO({config:a,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>YA(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:zA}}d();c();l();u();function JA(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Dn="3.47.1",XA=["@coveo/atomic","@coveo/quantic"];var zi=ot(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Dn}`));var sc=ot(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>zi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,p)=>{let f=WO(p);return KA({mode:i?"emit":"disabled",url:o??gu(e,t),token:r,trackingId:n??null,source:a,environment:f})}),zO={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},WO=e=>{if(!e)return;let t=e();return{...(JA()?Gg():zO),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Nr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function V(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(g){try{m(n.next(g))}catch(S){a(S)}}function f(g){try{m(n.throw(g))}catch(S){a(S)}}function m(g){g.done?i(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var ke;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ke||(ke={}));function zg(){return typeof window<"u"}function sh(){return typeof navigator<"u"}function Wi(){return typeof document<"u"}function Wg(){try{return typeof localStorage<"u"}catch{return!1}}function YO(){try{return typeof sessionStorage<"u"}catch{return!1}}function dC(){return sh()&&navigator.cookieEnabled}var KO=[ke.click,ke.custom,ke.search,ke.view],JO=(e,t)=>KO.indexOf(e)!==-1?Object.assign({language:Wi()?document.documentElement.lang:"unknown",userAgent:sh()?navigator.userAgent:"unknown"},t):t,uc=class e{static set(t,r,n){var o,i,a,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?ZA(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],ZA(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ZA(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function XO(){return Wg()?localStorage:dC()?new lc:YO()?sessionStorage:new Ki}var lc=class e{getItem(t){return uc.get(`${e.prefix}${t}`)}removeItem(t){uc.erase(`${e.prefix}${t}`)}setItem(t,r,n){uc.set(`${e.prefix}${t}`,r,n)}};lc.prefix="coveo_";var Yg=class{constructor(){this.cookieStorage=new lc}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Ki=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Uu="__coveo.analytics.history",ZO=20,e_=1e3*60,t_=75,Gu=class{constructor(t){this.store=t||XO()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Uu);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Uu);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Uu,JSON.stringify(t.slice(0,ZO)))}catch{}}clear(){try{this.store.removeItem(Uu)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,t_)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>e_:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var r_=(e,t)=>V(void 0,void 0,void 0,function*(){return e===ke.view?(yield n_(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),n_=e=>V(void 0,void 0,void 0,function*(){let t=new Gu,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Qu,o_=new Uint8Array(16);function i_(){if(!Qu&&(Qu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qu(o_)}var a_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function $u(e){return typeof e=="string"&&a_.test(e)}var It=[];for(let e=0;e<256;++e)It.push((e+256).toString(16).slice(1));function pC(e,t=0){return It[e[t+0]]+It[e[t+1]]+It[e[t+2]]+It[e[t+3]]+"-"+It[e[t+4]]+It[e[t+5]]+"-"+It[e[t+6]]+It[e[t+7]]+"-"+It[e[t+8]]+It[e[t+9]]+"-"+It[e[t+10]]+It[e[t+11]]+It[e[t+12]]+It[e[t+13]]+It[e[t+14]]+It[e[t+15]]}function s_(e){if(!$u(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function c_(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var u_="6ba7b810-9dad-11d1-80b4-00c04fd430c8",l_="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function d_(e,t,r){function n(o,i,a,p){var f;if(typeof o=="string"&&(o=c_(o)),typeof i=="string"&&(i=s_(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(i),m.set(o,i.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,a){p=p||0;for(let g=0;g<16;++g)a[p+g]=m[g];return a}return pC(m)}try{n.name=e}catch{}return n.DNS=u_,n.URL=l_,n}var p_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eC={randomUUID:p_};function _o(e,t,r){if(eC.randomUUID&&!t&&!e)return eC.randomUUID();e=e||{};let n=e.random||(e.rng||i_)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return pC(n)}function f_(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function $g(e,t){return e<<t|e>>>32-t}function m_(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let p=0;p<a.length;++p)e.push(a.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=p}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=i[a][h];for(let h=16;h<80;++h)p[h]=$g(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],S=r[3],b=r[4];for(let h=0;h<80;++h){let A=Math.floor(h/20),w=$g(f,5)+f_(A,m,g,S)+b+t[A]+p[h]>>>0;b=S,S=g,g=$g(m,30)>>>0,m=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+S>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var g_=d_("v5",80,m_),tC=g_,fC="2.30.52",rC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,cc={pageview:"pageview",event:"event"},Hu=class{constructor({client:t,uuidGenerator:r=_o}){this.client=t,this.uuidGenerator=r}},Kg=class extends Hu{constructor({client:t,uuidGenerator:r=_o}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=rC(window.location),this.lastReferrer=Wi()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction:null}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:Wi()?document.title:"",encoding:Wi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===cc.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===cc.pageview?this.nextPageViewId:this.pageViewId,referrer:t===cc.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===cc.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return rC(window.location)}},Mn=class e{constructor(t,r){if(!$u(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return $u(i)?new e(i,Number.parseInt(o)*1e3):null}};Mn.cvo_cid="cvo_cid";Mn.expirationTime=120;var Jg=class extends Hu{constructor({client:t,uuidGenerator:r=_o}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Mn.cvo_cid,new Mn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Jg.Id="link";var pr=Object.keys;function Bu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Hg=128,mC=192,nC=224,oC=240;function h_(e){return(e&248)===oC?4:(e&oC)===nC?3:(e&nC)===mC?2:1}function y_(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&Hg)!=Hg)break;if(r-=3,(n&mC)!=Hg){t-r>=h_(n)*3&&(r=t);break}}return e.substring(0,r)}var Xg={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},S_=pr(Xg).map(e=>Xg[e]),v_=[...S_].join("|"),A_=new RegExp(`^(${v_}$)`),C_={svcAction:"svc_action",svcActionData:"svc_action_data"},b_=e=>pr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Xg[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),x_=e=>A_.test(e),R_=[x_],iC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},aC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},_t={action:"pa",list:"pal",listSource:"pls"},zu={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},w_=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Zg={id:"quoteId",affiliation:"quoteAffiliation"},eh={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},I_={add:_t,bookmark_add:_t,bookmark_remove:_t,click:_t,checkout:_t,checkout_option:_t,detail:_t,impression:_t,remove:_t,refund:Object.assign(Object.assign({},_t),zu),purchase:Object.assign(Object.assign({},_t),zu),quickview:_t,quote:Object.assign(Object.assign({},_t),Zg),review:Object.assign(Object.assign({},_t),eh)},E_=pr(iC).map(e=>iC[e]),F_=pr(aC).map(e=>aC[e]),T_=pr(_t).map(e=>_t[e]),P_=pr(zu).map(e=>zu[e]),k_=pr(eh).map(e=>eh[e]),O_=pr(Zg).map(e=>Zg[e]),__=[...E_,"custom"].join("|"),N_=[...F_,"custom"].join("|"),gC="(pr[0-9]+)",hC="(il[0-9]+pi[0-9]+)",q_=new RegExp(`^${gC}(${__})$`),D_=new RegExp(`^(${hC}(${N_}))|(il[0-9]+nm)$`),M_=new RegExp(`^(${T_.join("|")})$`),j_=new RegExp(`^(${P_.join("|")})$`),V_=new RegExp(`^${gC}custom$`),L_=new RegExp(`^${hC}custom$`),U_=new RegExp(`^(${[...w_,...k_,...O_].join("|")})$`),Q_=e=>q_.test(e),B_=e=>D_.test(e),G_=e=>M_.test(e),$_=e=>j_.test(e),H_=e=>U_.test(e),z_=[B_,Q_,G_,$_,H_],W_=[V_,L_],Y_={anonymizeIp:"aip"},K_={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},J_={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},X_=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Z_=Object.assign(Object.assign(Object.assign(Object.assign({},Y_),K_),J_),X_.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),th=Object.assign(Object.assign({},Z_),C_),eN=e=>{let t=!!e.action&&I_[e.action]||{};return pr(e).reduce((r,n)=>{let o=t[n]||th[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},tN=pr(th).map(e=>th[e]),rN=e=>tN.indexOf(e)!==-1,nN=e=>e==="custom",oN=e=>[...z_,...R_,rN,nN].some(t=>t(e)),iN=e=>pr(e).reduce((t,r)=>{let n=aN(r);return n?Object.assign(Object.assign({},t),sN(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),aN=e=>{let t;return[...W_].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},sN=(e,t)=>pr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),rh=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=a;o=p||t;try{i=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ke.click,ke.custom,ke.search,ke.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},nh=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},sC=y.fetch,Wu=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),i?yield i(p,"analyticsFetch"):{}),{url:m}=f,g=Nr(f,["url"]),S;try{S=yield sC(m,g)}catch(b){console.error("An error has occured when sending the event.",b);return}if(S.ok){let b=yield S.json();return b.visitorId&&o.setCurrentVisitorId(b.visitorId),b}else{try{S.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield sC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ke.click,ke.custom,ke.search,ke.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},oh=class{constructor(t,r){Wg()&&dC()?this.storage=new Yg:Wg()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Ki),this.client=new Wu(t),this.beaconClient=new rh(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},ih=class{constructor(t,r){this.storage=r||new Ki,this.client=new Wu(t)}getClientDependingOnEventType(t){return this.client}},Yu=class{constructor(){this.storage=new Ki,this.client=new nh}getClientDependingOnEventType(t){return this.client}},cN="xx",uN=e=>e?.startsWith(cN)||!1,lN=`
|
|
28
28
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
29
29
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
30
30
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
31
|
-
`;function iN(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var aN=["1",1,"yes",!0];function lc(){let e=[];return Dg()&&e.push(window.doNotTrack),Kg()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>aN.indexOf(t)!==-1)}var eC="v15",tC={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function sN(e=tC.default,t=eC,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var cN="38824e1f-37f5-42d3-8372-a4b8fa9df946",or=class{get defaultOptions(){return{endpoint:tC.default,isCustomEndpoint:!1,token:"",version:eC,beforeSendHooks:[],afterSendHooks:[]}}get version(){return KA}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[KO,$O].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};lc()?this.runtime=new Hu:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ke.view,{newEventType:ke.view,addClientIdParameter:!0}),this.addEventTypeMapping(ke.click,{newEventType:ke.click,addClientIdParameter:!0}),this.addEventTypeMapping(ke.custom,{newEventType:ke.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ke.search,{newEventType:ke.search,addClientIdParameter:!0})}initRuntime(t){return Dg()&&zi()?new zg(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(iN()&&console.warn(oN),new Wg(t))}get storage(){return this.runtime.storage}determineVisitorId(){return j(this,void 0,void 0,function*(){try{return Dg()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||_o()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),_o()}})}getCurrentVisitorId(){return j(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return j(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return j(this,void 0,void 0,function*(){if(Qu(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(jA(t,jA(r,cN)))}})}getParameters(t,...r){return j(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return j(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(_o()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(lc())return null;try{let r=new URL(t).searchParams.get(Dn.cvo_cid);if(r==null)return null;let n=Dn.fromString(r);return!n||!zi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return j(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>j(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>j(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((S,x)=>j(this,void 0,void 0,function*(){let w=yield S;return yield x(t,w)}),g)].reduce((g,S)=>j(this,void 0,void 0,function*(){let x=yield g;return yield S(x)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return j(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?W_(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,C)=>j(this,void 0,void 0,function*(){let g=yield v;return yield C(g)}),Promise.resolve(r))})}makeEvent(t,...r){return j(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>j(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return j(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return j(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new Uu().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(ke.search,t)})}sendSearchEvent(t){return j(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Nr(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(ke.click,t)})}sendClickEvent(t){return j(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Nr(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(ke.custom,t)})}sendCustomEvent(t){return j(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Nr(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(ke.view,t)})}sendViewEvent(t){return j(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return j(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return j(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ke.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(X_(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=Nr(t,["custom"]),o={};r&&Lu(r)&&(o=this.lowercaseKeys(r));let i=Z_(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Nr(t,["custom"]);if(r&&Lu(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=Nr(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ke.view||r==ke.click||r==ke.search||r==ke.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ke.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=Nr(t,["userId"]);return nN(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Nr(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Lu(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Lu(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?d_(t,r):t}get baseUrl(){return sN(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Et;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(Et||(Et={}));var k;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(k||(k={}));var Yg={[k.triggerNotify]:"queryPipelineTriggers",[k.triggerExecute]:"queryPipelineTriggers",[k.triggerQuery]:"queryPipelineTriggers",[k.triggerRedirect]:"queryPipelineTriggers",[k.queryErrorBack]:"errors",[k.queryErrorClear]:"errors",[k.queryErrorRetry]:"errors",[k.pagerNext]:"getMoreResults",[k.pagerPrevious]:"getMoreResults",[k.pagerNumber]:"getMoreResults",[k.pagerResize]:"getMoreResults",[k.pagerScrolling]:"getMoreResults",[k.facetSearch]:"facet",[k.facetShowLess]:"facet",[k.facetShowMore]:"facet",[k.recommendation]:"recommendation",[k.likeSmartSnippet]:"smartSnippet",[k.dislikeSmartSnippet]:"smartSnippet",[k.expandSmartSnippet]:"smartSnippet",[k.collapseSmartSnippet]:"smartSnippet",[k.openSmartSnippetFeedbackModal]:"smartSnippet",[k.closeSmartSnippetFeedbackModal]:"smartSnippet",[k.sendSmartSnippetReason]:"smartSnippet",[k.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[k.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[k.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[k.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[k.clearRecentQueries]:"recentQueries",[k.recentResultClick]:"recentlyClickedDocuments",[k.clearRecentResults]:"recentlyClickedDocuments",[k.showLessFoldedResults]:"folding",[k.caseDetach]:"case",[k.likeGeneratedAnswer]:"generatedAnswer",[k.dislikeGeneratedAnswer]:"generatedAnswer",[k.openGeneratedAnswerSource]:"generatedAnswer",[k.generatedAnswerStreamEnd]:"generatedAnswer",[k.generatedAnswerSourceHover]:"generatedAnswer",[k.generatedAnswerCopyToClipboard]:"generatedAnswer",[k.generatedAnswerHideAnswers]:"generatedAnswer",[k.generatedAnswerShowAnswers]:"generatedAnswer",[k.generatedAnswerExpand]:"generatedAnswer",[k.generatedAnswerCollapse]:"generatedAnswer",[k.generatedAnswerFeedbackSubmit]:"generatedAnswer",[k.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Et.expandToFullUI]:"interface",[Et.openUserActions]:"User Actions",[Et.showPrecedingSessions]:"User Actions",[Et.showFollowingSessions]:"User Actions",[Et.clickViewedDocument]:"User Actions",[Et.clickPageView]:"User Actions",[Et.createArticle]:"createArticle"},Mn=class{constructor(){this.runtime=new Hu,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ke.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ke.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ke.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ke.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return KA}};function uN(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function lN(e){return e.map(t=>t.replace(/;/g,""))}function rC(e){let r=e.join(";");return r.length<=256?r:rC(e.slice(1))}var $A=e=>{let t=lN(e),r=uN(t);return rC(r)};function HA(e){let t=typeof e.partialQueries=="string"?e.partialQueries:$A(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:$A(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var zu=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||lc();this.coveoAnalyticsClient=n?new Mn:new or(t)}disable(){this.coveoAnalyticsClient=new Mn}enable(){this.coveoAnalyticsClient=new or(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(k.interfaceLoad)}logInterfaceLoad(){return j(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(k.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(k.recommendation)}logRecommendation(){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(k.recommendationOpen,t,r)}logRecommendationOpen(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(k.staticFilterClearAll,t)}logStaticFilterClearAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(k.staticFilterSelect,t)}logStaticFilterSelect(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(k.staticFilterDeselect,t)}logStaticFilterDeselect(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(k.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return j(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(k.interfaceChange,t)}logInterfaceChange(t){return j(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(k.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return j(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(k.didyoumeanClick)}logDidYouMeanClick(){return j(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(k.resultsSort,t)}logResultsSort(t){return j(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(k.searchboxSubmit)}logSearchboxSubmit(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(k.searchboxClear)}logSearchboxClear(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(k.searchboxAsYouType)}logSearchboxAsYouType(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(k.breadcrumbFacet,t)}logBreadcrumbFacet(t){return j(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(k.breadcrumbResetAll)}logBreadcrumbResetAll(){return j(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(k.documentQuickview,t,r)}logDocumentQuickview(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(k.documentOpen,t,r)}logDocumentOpen(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(k.omniboxAnalytics,HA(t))}logOmniboxAnalytics(t){return j(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(k.omniboxFromLink,HA(t))}logOmniboxFromLink(t){return j(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(k.searchFromLink)}logSearchFromLink(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(k.triggerNotify,t)}logTriggerNotify(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(k.triggerExecute,t)}logTriggerExecute(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(k.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(k.undoTriggerQuery,t)}logUndoTriggerQuery(t){return j(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(k.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(k.pagerResize,t)}logPagerResize(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(k.pagerNumber,t)}logPagerNumber(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(k.pagerNext,t)}logPagerNext(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(k.pagerPrevious,t)}logPagerPrevious(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(k.pagerScrolling)}logPagerScrolling(){return j(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(k.facetClearAll,t)}logFacetClearAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(k.facetSearch,t)}logFacetSearch(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(k.facetSelect,t)}logFacetSelect(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(k.facetDeselect,t)}logFacetDeselect(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(k.facetExclude,t)}logFacetExclude(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(k.facetUnexclude,t)}logFacetUnexclude(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(k.facetSelectAll,t)}logFacetSelectAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(k.facetUpdateSort,t)}logFacetUpdateSort(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(k.facetShowMore,t)}logFacetShowMore(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(k.facetShowLess,t)}logFacetShowLess(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(k.queryError,t)}logQueryError(t){return j(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(k.queryErrorBack);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(k.queryErrorBack)})}})}logQueryErrorBack(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(k.queryErrorRetry);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(k.queryErrorRetry)})}})}logQueryErrorRetry(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(k.queryErrorClear);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(k.queryErrorClear)})}})}logQueryErrorClear(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(k.likeSmartSnippet)}logLikeSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(k.dislikeSmartSnippet)}logDislikeSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(k.expandSmartSnippet)}logExpandSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(k.collapseSmartSnippet)}logCollapseSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(k.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(k.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return j(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(k.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(k.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(k.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(k.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(k.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(k.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(k.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(k.copyToClipboard,t,r)}logCopyToClipboard(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(k.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(k.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(k.recentQueryClick)}logRecentQueryClick(){return j(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(k.clearRecentQueries)}logClearRecentQueries(){return j(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(k.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(k.clearRecentResults)}logClearRecentResults(){return j(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(k.noResultsBack)}logNoResultsBack(){return j(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(k.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(k.showLessFoldedResults)}logShowLessFoldedResults(){return j(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return j(this,arguments,void 0,function*(n,o,i=Yg[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return j(this,arguments,void 0,function*(n,o,i=Yg[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return j(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:p})=>a.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return j(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return j(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:p})=>a.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return j(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return j(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof or?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(k.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(k.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(k.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return j(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(k.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(k.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(k.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(k.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(k.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(k.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(k.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(k.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(k.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(k.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(k.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return j(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(k.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Wu=Object.assign({},sc),zA=Object.keys(Wu).map(e=>Wu[e]),Wi=class extends Vg{constructor({client:t,uuidGenerator:r=_o}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>zA.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(zA.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Wu.pageview,{newEventType:ke.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Wu.event,{newEventType:ke.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return h_(this.ticket)}};Wi.Id="svc";var Yu;(function(e){e.click="click",e.flowStart="flowStart"})(Yu||(Yu={}));var dr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(dr||(dr={}));var Ku;(function(e){e.quit="Quit",e.solved="Solved"})(Ku||(Ku={}));var Ju=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!lc();this.coveoAnalyticsClient=o?new or(t):new Mn,this.svc=new Wi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Mn,this.svc=new Wi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new or(this.options),this.svc=new Wi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(dr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(dr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(dr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(dr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(dr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(dr.caseCancelled,{reason:Ku.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(dr.caseSolved,{reason:Ku.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(dr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Yu.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Yu.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return j(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof or?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){var i,a;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}},dN=e=>{let t={};return e.caseContext&&Object.keys(e.caseContext).forEach(r=>{var n;let o=(n=e.caseContext)===null||n===void 0?void 0:n[r];if(o){let i=`context_${r}`;t[i]=o}}),t},se=(e,t=!0)=>{let{caseContext:r,caseId:n,caseNumber:o}=e,i=Nr(e,["caseContext","caseId","caseNumber"]),a=dN(e);return Object.assign(Object.assign(Object.assign({CaseId:n,CaseNumber:o},i),!!a.context_Case_Subject&&{CaseSubject:a.context_Case_Subject}),t&&a)},Xu=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||lc();this.coveoAnalyticsClient=n?new Mn:new or(t)}disable(){this.coveoAnalyticsClient=new Mn}enable(){this.coveoAnalyticsClient=new or(this.opts)}logInterfaceLoad(t){if(t){let r=se(t);return this.logSearchEvent(k.interfaceLoad,r)}return this.logSearchEvent(k.interfaceLoad)}logRecentQueryClick(t){if(t){let r=se(t);return this.logSearchEvent(k.recentQueryClick,r)}return this.logSearchEvent(k.recentQueryClick)}logClearRecentQueries(t){if(t){let r=se(t);return this.logCustomEvent(k.clearRecentQueries,r)}return this.logCustomEvent(k.clearRecentQueries)}logInterfaceChange(t){let r=se(t);return this.logSearchEvent(k.interfaceChange,r)}logStaticFilterDeselect(t){let r=se(t);return this.logSearchEvent(k.staticFilterDeselect,r)}logFetchMoreResults(t){if(t){let r=se(t);return this.logCustomEvent(k.pagerScrolling,Object.assign(Object.assign({},r),{type:"getMoreResults"}))}return this.logCustomEvent(k.pagerScrolling,{type:"getMoreResults"})}logBreadcrumbFacet(t){let r=se(t);return this.logSearchEvent(k.breadcrumbFacet,r)}logBreadcrumbResetAll(t){if(t){let r=se(t);return this.logSearchEvent(k.breadcrumbResetAll,r)}return this.logSearchEvent(k.breadcrumbResetAll)}logFacetSelect(t){let r=se(t);return this.logSearchEvent(k.facetSelect,r)}logFacetExclude(t){let r=se(t);return this.logSearchEvent(k.facetExclude,r)}logFacetDeselect(t){let r=se(t);return this.logSearchEvent(k.facetDeselect,r)}logFacetUpdateSort(t){let r=se(t);return this.logSearchEvent(k.facetUpdateSort,r)}logFacetClearAll(t){let r=se(t);return this.logSearchEvent(k.facetClearAll,r)}logFacetShowMore(t){let r=se(t,!1);return this.logCustomEvent(k.facetShowMore,r)}logFacetShowLess(t){let r=se(t,!1);return this.logCustomEvent(k.facetShowLess,r)}logQueryError(t){let r=se(t,!1);return this.logCustomEvent(k.queryError,r)}logPagerNumber(t){let r=se(t,!1);return this.logCustomEvent(k.pagerNumber,r)}logPagerNext(t){let r=se(t,!1);return this.logCustomEvent(k.pagerNext,r)}logPagerPrevious(t){let r=se(t,!1);return this.logCustomEvent(k.pagerPrevious,r)}logDidYouMeanAutomatic(t){if(t){let r=se(t);return this.logSearchEvent(k.didyoumeanAutomatic,r)}return this.logSearchEvent(k.didyoumeanAutomatic)}logDidYouMeanClick(t){if(t){let r=se(t);return this.logSearchEvent(k.didyoumeanClick,r)}return this.logSearchEvent(k.didyoumeanClick)}logResultsSort(t){let r=se(t);return this.logSearchEvent(k.resultsSort,r)}logSearchboxSubmit(t){if(t){let r=se(t);return this.logSearchEvent(k.searchboxSubmit,r)}return this.logSearchEvent(k.searchboxSubmit)}logContextChanged(t){let r=se(t);return this.logSearchEvent(Et.contextChanged,r)}logExpandToFullUI(t){let r=se(t);return this.logCustomEvent(Et.expandToFullUI,r)}logOpenUserActions(t){let r=se(t,!1);return this.logCustomEvent(Et.openUserActions,r)}logShowPrecedingSessions(t){let r=se(t,!1);return this.logCustomEvent(Et.showPrecedingSessions,r)}logShowFollowingSessions(t){let r=se(t,!1);return this.logCustomEvent(Et.showFollowingSessions,r)}logViewedDocumentClick(t,r){return this.logCustomEvent(Et.clickViewedDocument,Object.assign(Object.assign({},se(r,!1)),{document:t}))}logPageViewClick(t,r){return this.logCustomEvent(Et.clickPageView,Object.assign(Object.assign({},se(r,!1)),{pageView:t}))}logCreateArticle(t,r){return this.logCustomEvent(Et.createArticle,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logDocumentOpen(t,r,n){return this.logClickEvent(k.documentOpen,t,r,n?se(n,!1):void 0)}logCopyToClipboard(t,r,n){return this.logClickEvent(k.copyToClipboard,t,r,n?se(n,!1):void 0)}logCaseSendEmail(t,r,n){return this.logClickEvent(k.caseSendEmail,t,r,n?se(n,!1):void 0)}logFeedItemTextPost(t,r,n){return this.logClickEvent(k.feedItemTextPost,t,r,n?se(n,!1):void 0)}logDocumentQuickview(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl};return this.logClickEvent(k.documentQuickview,t,r,n?Object.assign(Object.assign({},se(n,!1)),o):o)}logCaseAttach(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl,resultUriHash:t.documentUriHash};return this.logClickEvent(k.caseAttach,t,r,n?Object.assign(Object.assign({},se(n,!1)),o):o)}logCaseDetach(t,r,n){let o=Object.assign(Object.assign(Object.assign({},r&&se(r,!1)),n&&{permanentId:n}),{resultUriHash:t});return this.logCustomEvent(k.caseDetach,o)}logLikeSmartSnippet(t){return this.logCustomEvent(k.likeSmartSnippet,t?se(t,!1):void 0)}logDislikeSmartSnippet(t){return this.logCustomEvent(k.dislikeSmartSnippet,t?se(t,!1):void 0)}logExpandSmartSnippet(t){return this.logCustomEvent(k.expandSmartSnippet,t?se(t,!1):void 0)}logCollapseSmartSnippet(t){return this.logCustomEvent(k.collapseSmartSnippet,t?se(t,!1):void 0)}logOpenSmartSnippetFeedbackModal(t){return this.logCustomEvent(k.openSmartSnippetFeedbackModal,t?se(t,!1):void 0)}logCloseSmartSnippetFeedbackModal(t){return this.logCustomEvent(k.closeSmartSnippetFeedbackModal,t?se(t,!1):void 0)}logSmartSnippetFeedbackReason(t,r,n){return this.logCustomEvent(k.sendSmartSnippetReason,n?Object.assign(Object.assign({},se(n,!1)),{reason:t,details:r}):{reason:t,details:r})}logExpandSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(k.expandSmartSnippetSuggestion,r?Object.assign(Object.assign({},se(r,!1)),n):n)}logCollapseSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(k.collapseSmartSnippetSuggestion,r?Object.assign(Object.assign({},se(r,!1)),n):n)}logOpenSmartSnippetSource(t,r,n){return this.logClickEvent(k.openSmartSnippetSource,t,r,n?se(n,!1):void 0)}logOpenSmartSnippetSuggestionSource(t,r,n){return this.logClickEvent(k.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logOpenSmartSnippetInlineLink(t,r,n){return this.logClickEvent(k.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logOpenSmartSnippetSuggestionInlineLink(t,r,n){return this.logClickEvent(k.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logLikeGeneratedAnswer(t,r){return this.logCustomEvent(k.likeGeneratedAnswer,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logDislikeGeneratedAnswer(t,r){return this.logCustomEvent(k.dislikeGeneratedAnswer,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logOpenGeneratedAnswerSource(t,r){return this.logCustomEvent(k.openGeneratedAnswerSource,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCitationClick(t,r,n){return this.logClickEvent(k.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logGeneratedAnswerSourceHover(t,r){return this.logCustomEvent(k.generatedAnswerSourceHover,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCopyToClipboard(t,r){return this.logCustomEvent(k.generatedAnswerCopyToClipboard,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerHideAnswers(t,r){return this.logCustomEvent(k.generatedAnswerHideAnswers,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerShowAnswers(t,r){return this.logCustomEvent(k.generatedAnswerShowAnswers,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerExpand(t,r){return this.logCustomEvent(k.generatedAnswerExpand,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCollapse(t,r){return this.logCustomEvent(k.generatedAnswerCollapse,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmit(t,r){return this.logCustomEvent(k.generatedAnswerFeedbackSubmit,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmitV2(t,r){return this.logCustomEvent(k.generatedAnswerFeedbackSubmitV2,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logRephraseGeneratedAnswer(t,r){return this.logSearchEvent(k.rephraseGeneratedAnswer,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logRetryGeneratedAnswer(t){return this.logSearchEvent(k.retryGeneratedAnswer,t?Object.assign({},se(t,!1)):{})}logGeneratedAnswerStreamEnd(t,r){return this.logCustomEvent(k.generatedAnswerStreamEnd,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCitationDocumentAttach(t,r,n){return this.logClickEvent(k.generatedAnswerCitationDocumentAttach,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logCustomEvent(t,r){return j(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),o=Object.assign(Object.assign({},yield this.getBaseCustomEventRequest(n)),{eventType:Yg[t],eventValue:t});return this.coveoAnalyticsClient.sendCustomEvent(o)})}logSearchEvent(t,r){return j(this,void 0,void 0,function*(){return this.coveoAnalyticsClient.sendSearchEvent(yield this.getBaseSearchEventRequest(t,r))})}logClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(i)})}logShowMoreFoldedResults(t,r,n){return j(this,void 0,void 0,function*(){return this.logClickEvent(k.showMoreFoldedResults,t,r,n?se(n,!1):void 0)})}logShowLessFoldedResults(t){return j(this,void 0,void 0,function*(){return this.logCustomEvent(k.showLessFoldedResults,t?se(t,!1):void 0)})}logTriggerNotify(t,r){return this.logCustomEvent(k.triggerNotify,r?Object.assign(Object.assign({},se(r,!1)),t):t)}getBaseCustomEventRequest(t){return j(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield this.getBaseEventRequest(t)),{lastSearchQueryUid:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return j(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return j(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign({},this.getOrigins()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof or?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}};d();c();l();u();d();c();l();u();var Ki=()=>"default";var pN=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},jn=class{constructor(t){this.getState=t;qe(this,"state");this.state=t()}getLanguage(){return pN(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let p=`context_${i}`;o[p]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=qn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Ki()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var nC=e=>new or(e).getCurrentVisitorId(),Ji=(e,t)=>typeof t=="function"?(...r)=>{let n=Qs(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Xi=(e,t)=>(...r)=>{let n=Qs(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var dc=class extends jn{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},oC=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new dc(t)})=>{let i=t(),a=i.configuration.accessToken,p=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,m=i.configuration.analytics.enabled,h=new Ju({enableAnalytics:m,token:a,endpoint:p,runtimeEnvironment:f,preprocessRequest:Ji(e,n),beforeSendHooks:[Xi(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:a},"Analytics request"),C)]},o);return m||h.disable(),h};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Zu(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function fN(e,t){return!!t&&t.facetId in e.facetSet}var vn=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),iC=(e,t)=>e.facetSet[t]?.request,Zg=(e,t)=>{let r=vn(e,t);return fN(e,r)?r:void 0};var aC=(e,t)=>Zg(e,t)?.values.filter(r=>r.state!=="idle")||[],qr=e=>e.search.isLoading;d();c();l();u();function sC(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function Dr(e){let{activeValue:t,ancestryMap:r}=mN(e);return t?gN(t,r):[]}function mN(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function gN(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function hN(e,t){return!!t&&t.facetId in e.categoryFacetSet}var eh=(e,t)=>{let r=vn(e,t);if(hN(e,r))return r},th=(e,t)=>e.categoryFacetSet[t]?.request,cC=(e,t)=>{let r=eh(e,t);return Dr(r?.values??[])},rh=(e,t)=>{let r=th(e,t);return Dr(r?.currentValues??[])};d();c();l();u();function Zi(){return{}}d();c();l();u();function uC(e,t){return{request:e,tabs:t}}function ea(){return{}}d();c();l();u();function lC(e,t){return{request:e,tabs:t}}function ta(){return{}}d();c();l();u();function dC(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ra(){return{}}var No=(e,t)=>{let r=gC(t,e),n=r?r.field:"",o=nh(n,e);return{facetId:e,facetField:n,facetTitle:o}};function na(e,t){let{facetId:r,facetValue:n}=e,o=No(r,t),i=hC(t,r);return{...o,facetValue:i==="hierarchical"?mC(t,r):n}}function Wt(e){return{facetSet:e.facetSet??ra(),categoryFacetSet:e.categoryFacetSet??Zi(),dateFacetSet:e.dateFacetSet??ea(),numericFacetSet:e.numericFacetSet??ta(),automaticFacetSet:e.automaticFacetSet??Zu()}}var el=e=>{let t=[];return vN(e).forEach((r,n)=>{let o=hC(e,r.facetId),i=RN(r,n+1);if(SN(r)){if(!!!rh(e,r.facetId).length)return;t.push({...i,...bN(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,p)=>{if(a.state==="idle")return;let f=pC(a,p+1,o),m=yN(r)?fC(a):CN(a);t.push({...i,...f,...m})})}),AN(e).forEach((r,n)=>{let o=xN(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let p=pC(i,a+1,"specific"),f=fC(i);t.push({...o,...p,...f})})}),t},yN=e=>e.type==="specific",SN=e=>e.type==="hierarchical",vN=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),AN=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),pC=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),CN=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),fC=e=>({displayValue:e.value,value:e.value}),mC=(e,t)=>rh(e,t).map(n=>n.value).join(";"),bN=(e,t)=>{let n=mC(e,t);return{value:n,valuePosition:1,displayValue:n}},xN=(e,t)=>({title:nh(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),RN=(e,t)=>({title:nh(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),nh=(e,t)=>`${e}_${t}`,gC=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,hC=(e,t)=>{let r=gC(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var oh=e=>e.configuration.search.locale,yC=e=>e.configuration.search.timezone,SC=e=>e.configuration.accessToken,vC=e=>e.configuration.organizationId,AC=e=>e.configuration.environment,tl=e=>e.configuration?.knowledge?.agentId;var Ve=e=>{if(wN(e)||ih(e))return e.generatedAnswer?.answerId;if(IN(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},wN=e=>"answer"in e&&"generatedAnswer"in e&&!te(e.generatedAnswer?.answerConfigurationId),ih=e=>{let t=tl(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},IN=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",ah=e=>e.generatedAnswer?.fieldsToIncludeInCitations,oa=ot(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var at=()=>({q:"",enableQuerySyntax:!1});var pc=class extends jn{getSearchUID(){let t=this.getState();return t.search?.searchResponseId||t.search?.response.searchUid||yt().response.searchUid}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getFacetState(){return el(Wt(this.state))}getBaseMetadata(){let t=this.getState(),r=super.getBaseMetadata(),n=Ve(t);return n&&(r.generativeQuestionAnsweringId=n),r}getGeneratedAnswerMetadata(){let t=this.getState();return{...(t.generatedAnswer?.isVisible!==void 0&&{showGeneratedAnswer:t.generatedAnswer.isVisible})}}get queryText(){return this.state.query?.q||at().q}get responseTime(){return this.state.search?.duration||yt().duration}mapResultsToAnalyticsDocument(){return this.state.search?.response.results.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.search?.response.results.length||yt().response.results.length}},CC=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new pc(t)})=>{let i=t(),a=i.configuration.accessToken,p=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,m=i.configuration.analytics.enabled,h=new Xu({enableAnalytics:m,token:a,endpoint:p,runtimeEnvironment:f,preprocessRequest:Ji(e,n),beforeSendHooks:[Xi(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:a},"Analytics request"),C)]},o);return m||h.disable(),h};d();c();l();u();d();c();l();u();d();c();l();u();var rl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(rl||{}),nl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(nl||{}),Mr=e=>{if(ki(e))return e.map(t=>Mr(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},ol=()=>({by:"relevancy"}),bC=e=>({by:"date",order:e});var xC=new W({values:{by:new Us({enum:nl,required:!0}),order:new Us({enum:rl}),field:new L}});function ir(){return Mr(ol())}d();c();l();u();d();c();l();u();d();c();l();u();var ia=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?sh(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],sh(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function sh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function EN(){return typeof navigator<"u"}function RC(){try{return typeof localStorage<"u"}catch{return!1}}function wC(){try{return typeof sessionStorage<"u"}catch{return!1}}function IC(){return!!(EN()&&navigator.cookieEnabled)}var EC=null;function FC(){return EC||(RC()?localStorage:IC()?new ch:wC()?sessionStorage:new uh)}var aa=class aa{getItem(t){return ia.get(`${aa.prefix}${t}`)}removeItem(t){ia.erase(`${aa.prefix}${t}`)}setItem(t,r,n){ia.set(`${aa.prefix}${t}`,r,n)}};qe(aa,"prefix","coveo_");var ch=aa;var uh=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var il="__coveo.analytics.history",FN=20,TN=1e3*60,PN=75,qo=class qo{constructor(t){qe(this,"store");this.store=t||FC()}static getInstance(t){return qo.instance||(qo.instance=new qo(t)),qo.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this6=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this6.cropQueryElement(_this6.stripEmptyQuery(t));let r=yield _this6.getHistoryWithInternalTimeAsync();r!==null?_this6.isValidEntry(t)&&_this6.setHistory([t].concat(r)):_this6.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this7=this;return _asyncToGenerator(function*(){let t=yield _this7.getHistoryWithInternalTimeAsync();return _this7.stripEmptyQueries(_this7.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(il);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this8=this;return _asyncToGenerator(function*(){try{let t=yield _this8.store.getItem(il);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(il,JSON.stringify(t.slice(0,FN)))}catch{}}clear(){try{this.store.removeItem(il)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,PN)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>TN:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};qe(qo,"instance",null);var lh=qo,Nt=lh;var fc=class fc extends jn{constructor(){super(...arguments);qe(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return el(Wt(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||fc.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||yt().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||fc.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ve(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ir()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(m=>m.expression),a=o.partialQueries.length-1,p=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||at().q}get responseTime(){return this.state.search?.duration||yt().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||yt().response.totalCountFiltered}};qe(fc,"fallbackPipelineName","default");var Vn=fc,TC=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,p=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,m=i.configuration.analytics.enabled,h=new zu({token:a,endpoint:p,runtimeEnvironment:f,preprocessRequest:Ji(e,n),beforeSendHooks:[Xi(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:a},"Analytics request"),C)]},o);return m||h.disable(),h},dh=()=>{let t=Nt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function al(e){let t=PC(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return JS([e,...t,...r],o=>o.uniqueId)}function PC(e){return e.childResults?e.childResults.flatMap(t=>[t,...PC(t)]):[]}d();c();l();u();var mc=()=>"";function kC(e,t){return{...new Vn(t).getBaseMetadata(),actionCause:e,type:e}}function kN(e){return Object.assign(e,{instantlyCallable:!0})}function ON(e,t){let r=i=>kN(le(e,i)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(i,{getState:a,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:h}=p;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:m,logger:h})).log({state:a(),extra:p})});return function(_x13,_x14){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:p,logger:f}){let{description:m,log:h}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(v,{getState:C,extra:g}){return yield h({state:C(),extra:g})});return function(_x16,_x17){return _ref1.apply(this,arguments)}}())}});return function prepare(_x15){return _ref0.apply(this,arguments)}}()}),n}var ph=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return qN(i)}return n},_N=e=>e.configuration.analytics.analyticsMode==="legacy",NN=e=>e.configuration.analytics.analyticsMode==="next",qN=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=p=>new a(p)),ON(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:h}){let v=[],C={log:function(){var _ref11=_asyncToGenerator(function*({state:R}){for(let I of v)yield I(R)});return function log(_x19){return _ref11.apply(this,arguments)}}()},g=p(),S=i({getState:p,logger:h,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),x=yield t(S,p());C.description=x?.description,v.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(R){_N(R)&&(yield DN(x,r,R,h,S.coveoAnalyticsClient))});return function(_x20){return _ref12.apply(this,arguments)}}());let{emit:w}=ac(g);return v.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(R){if(NN(R)&&o&&n){let I=n(R);yield GN(w,o,I)}});return function(_x21){return _ref13.apply(this,arguments)}}()),C});return function(_x18){return _ref10.apply(this,arguments)}}()));function DN(_x22,_x23,_x24,_x25,_x26){return _DN.apply(this,arguments)}function _DN(){_DN=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _DN.apply(this,arguments)}var OC=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(i){r(n,o)});return function log(_x27){return _ref14.apply(this,arguments)}}()}),$e=ph(e=>TC({...e,provider:e.provider||new Vn(e.getState)}),e=>e,Vn),gK=ph(oC,OC("caseAssist"),dc),Z=e=>ph(CC,OC(e),pc),Ke=(e,t)=>{let r=i=>i+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=NC(e,o),n<0&&(n=BN(e,o)),n<0&&(n=0),jN(e,r(n),t)};var sl=(e,t)=>({sourceName:MN(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||mc()});function MN(e){let t=e.source;return te(t)?"unknown":t}var cl=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function jN(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:UN(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:QN(e),queryPipeline:r.pipeline||mc()}}var Je=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),_C={urihash:new L,sourcetype:new L,permanentid:new L},ul={uniqueId:G,raw:new W({values:_C}),title:G,uri:G,clickUri:G,rankingModifier:new L({required:!1,emptyAllowed:!0})};function VN(e){return Object.assign({},...Object.keys(_C).map(t=>({[t]:e[t]})))}function LN(e){return Object.assign({},...Object.keys(ul).map(t=>({[t]:e[t]})),{raw:VN(e.raw)})}function UN(e){let t=e.raw.author;return te(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function QN(e){let t=e.raw.source;return te(t)?"unknown":t}var Ft=e=>new Ee(ul).validate(LN(e));function BN(e,t){for(let[r,n]of t.entries()){let o=al(n);if(NC(e,o)!==-1)return r}return-1}function NC(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function GN(_x28,_x29,_x30){return _GN.apply(this,arguments)}function _GN(){_GN=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _GN.apply(this,arguments)}var xr=(e,t)=>{let r=Je(e),n=Ke(e,t);return{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:n.documentTitle,author:n.documentAuthor,url:n.documentUri}};d();c();l();u();var fh=e=>_(e,{evt:G,type:He}),qC=e=>$e("analytics/generic/search",t=>{fh(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),DC=e=>$e("analytics/generic/click",(t,r)=>(Ft(e.result),fh(e),t.makeClickEvent(e.evt,Ke(e.result,r),Je(e.result),e.meta))),MC=e=>$e("analytics/generic/custom",t=>(fh(e),t.makeCustomEventWithType(e.evt,e.type,e.meta)));var jC=()=>({actionCause:"interfaceLoad"}),sa=()=>({actionCause:"interfaceChange"});d();c();l();u();var mh=()=>He,VC=()=>G,ca=T("configuration/updateBasicConfiguration",e=>_(e,{accessToken:He,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:He})),ua=T("configuration/updateSearchConfiguration",e=>_(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:He,timezone:He,locale:He,authenticationProviders:new re({required:!1,each:G})})),$N={enabled:new ue({default:!0}),originContext:mh(),originLevel2:mh(),originLevel3:mh(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new ue({default:!1}),deviceId:He,userDisplayName:He,documentLocation:He,trackingId:kv,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new W({options:{required:!1},values:qA.reduce((e,t)=>(e[t]=Pv,e),{})})},ll=T("configuration/updateAnalyticsConfiguration",e=>_(e,$N)),dl=T("configuration/analytics/disable"),pl=T("configuration/analytics/enable"),LC=T("configuration/analytics/originlevel2",e=>_(e,{originLevel2:VC()})),UC=T("configuration/analytics/originlevel3",e=>_(e,{originLevel3:VC()})),QC=T("knowledge/setAgentId",e=>_(e,new L({required:!0})));d();c();l();u();var fl=T("insightConfiguration/set",e=>_(e,{insightId:G}));d();c();l();u();d();c();l();u();var BC=()=>({insightId:""});var ml=ce(BC(),e=>{e.addCase(fl,(t,r)=>{t.insightId=r.payload.insightId})});d();c();l();u();d();c();l();u();var gl=T("searchHub/set",e=>_(e,new L({required:!0,emptyAllowed:!0})));var jr=le("insight/interface/fetch",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{getState:t,dispatch:r,rejectWithValue:n,extra:{apiClient:o}}){let i=t(),a=yield o.getInterface(HN(i));return Ge(a)?n(a.error):(r(gl(a.success.searchHub)),{response:a.success})});return function(_x31,_x32){return _ref15.apply(this,arguments)}}()),HN=e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),insightId:e.insightConfiguration.insightId});d();c();l();u();d();c();l();u();var GC=()=>({loading:!1,config:void 0});var Ln=ce(GC(),e=>{e.addCase(jr.pending,t=>{t.loading=!0,t.error=void 0}).addCase(jr.rejected,(t,r)=>{t.loading=!1,t.error=r.payload}).addCase(jr.fulfilled,(t,r)=>{t.loading=!1,t.error=void 0;let{searchHub:n,...o}=r.payload.response;t.config=o})});d();c();l();u();d();c();l();u();d();c();l();u();var gc=Cr(hl(),1),KC=Cr($C(),1);d();c();l();u();var yl=Cr(hl(),1),zC=Cr(HC(),1);yl.default.extend(zC.default);var WC="YYYY/MM/DD@HH:mm:ss",zN="1401-01-01";function la(e,t){let r=(0,yl.default)(e,t);return!r.isValid()&&!t?(0,yl.default)(e,WC):r}function Sl(e){return e.format(WC)}function YC(e,t){let r=la(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}Ch(r)}function Ch(e){if(e.isBefore(zN))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}gc.default.extend(KC.default);var JC=["past","now","next"],XC=["minute","hour","day","week","month","quarter","year"],WN=e=>{let t=e==="now";return{amount:new ne({required:!t,min:1}),unit:new L({required:!t,constrainTo:XC}),period:new L({required:!0,constrainTo:JC})}};function vl(e){if(typeof e=="string"&&!Un(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?bh(e):e;new Ee(WN(t.period)).validate(t);let r=eb(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Ch(r)}function ZC(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function eb(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,gc.default)().subtract(r,n);case"next":return(0,gc.default)().add(r,n);case"now":return(0,gc.default)()}}function hc(e){return Sl(eb(bh(e)))}function tb(e){return e.toLocaleLowerCase().split("-")}function Un(e){let[t,r,n]=tb(e);if(t==="now")return!0;if(!JC.includes(t)||!XC.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function rb(e){return!!e&&typeof e=="object"&&"period"in e}function bh(e){let[t,r,n]=tb(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}function nb(e){return vl(e),bh(e)}d();c();l();u();function ob(e){return e.type==="dateRange"}function ib(e){return`start${e}`}function ab(e){return`end${e}`}var xh=()=>({dateFacetValueMap:{}});function YN(e,t,r){let n=e.start,o=e.end;return Un(n)&&(n=hc(n),r.dateFacetValueMap[t][ib(n)]=e.start),Un(o)&&(o=hc(o),r.dateFacetValueMap[t][ab(o)]=e.end),{...e,start:n,end:o}}function Rh(e,t){if(ob(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>YN(o,r,t))}}return e}function Vr(e){let t=xh();return{request:{...e,facets:e.facets?.map(n=>Rh(n,t))},mappings:t}}function KN(e,t,r){return{...e,start:r.dateFacetValueMap[t][ib(e.start)]||e.start,end:r.dateFacetValueMap[t][ab(e.end)]||e.end}}function JN(e,t){return e.facetId in t.dateFacetValueMap}function XN(e,t){return JN(e,t)?{...e,values:e.values.map(r=>KN(r,e.facetId,t))}:e}function Rr(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>XN(n,t))}}:e}d();c();l();u();d();c();l();u();var Qn=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield nC(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(dh()&&{pageId:dh()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Hi(e)})}}});return function Qn(_x33,_x34){return _ref16.apply(this,arguments)}}();var sb=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,t){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:We(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,insightId:t.insightConfiguration.insightId,q:t.querySet?.[e],timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Nt.getInstance().getHistory():[],...(t.insightCaseContext?.caseContext&&{context:t.insightCaseContext.caseContext}),...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&(yield Qn(t.configuration.analytics)))})}});return function sb(_x35,_x36){return _ref17.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Al=T("didYouMean/enable"),cb=T("didYouMean/disable"),Cl=T("didYouMean/automaticCorrections/disable"),ub=T("didYouMean/automaticCorrections/enable"),Yt=T("didYouMean/correction",e=>_(e,G)),yc=T("didYouMean/automaticCorrections/mode",e=>_(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var ZN=T("history/undo"),e0=T("history/redo"),St=T("history/snapshot"),H8=le("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(ZN()),yield t(Ze())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),z8=le("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(e0()),yield t(Ze())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),Ze=le("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var An=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});d();c();l();u();function bl(){return{contextValues:{}}}d();c();l();u();var xl=()=>!1;d();c();l();u();function lb(){return{contextValues:{}}}d();c();l();u();function wh(){return{enabled:!0,tabs:{}}}function Rl(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function db(){return[]}d();c();l();u();function Lr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function wl(){return{}}d();c();l();u();function pb(){return{}}d();c();l();u();function Il(){return{}}function vt(e){return{context:e.context||bl(),dictionaryFieldContext:e.dictionaryFieldContext||lb(),facetSet:e.facetSet||ra(),numericFacetSet:e.numericFacetSet||ta(),dateFacetSet:e.dateFacetSet||ea(),categoryFacetSet:e.categoryFacetSet||Zi(),automaticFacetSet:e.automaticFacetSet??Zu(),pagination:e.pagination||Lr(),query:e.query||at(),tabSet:e.tabSet||Il(),advancedSearchQueries:e.advancedSearchQueries||An(),staticFilterSet:e.staticFilterSet||pb(),querySet:e.querySet||wl(),sortCriteria:e.sortCriteria||ir(),pipeline:e.pipeline||mc(),searchHub:e.searchHub||Ki(),facetOptions:e.facetOptions||Rl(),facetOrder:e.facetOrder??db(),debug:e.debug??xl()}}d();c();l();u();var Ut=T("query/updateQuery",e=>_(e,{q:new L,enableQuerySyntax:new ue}));d();c();l();u();d();c();l();u();var fb=()=>({caseContext:{},caseId:"",caseNumber:""}),J=e=>({caseContext:e?.caseContext||{},caseId:e?.caseId,caseNumber:e?.caseNumber});var Ih=()=>Z("browseResults")("search/logFetchMoreResults",(e,t)=>e.logFetchMoreResults(J(t.insightCaseContext))),da=e=>Z("query")("search/queryError",(t,r)=>t.logQueryError({...J(r.insightCaseContext),query:r.query?.q||at().q,aq:"",cq:"",dq:"",errorType:e.type,errorMessage:e.message})),mb=(e,t)=>Z("contextChanged")("analytics/contextChanged",(r,n)=>{let o={caseId:e,caseNumber:t,caseContext:n.insightCaseContext?.caseContext||{}};r.logContextChanged(o)}),El=()=>Z("interfaceLoad")("analytics/interface/load",(e,t)=>e.logInterfaceLoad(J(t.insightCaseContext))),Bn=()=>Z("interfaceChange")("analytics/interface/change",(e,t)=>{e.logInterfaceChange({...J(t.insightCaseContext),interfaceChangeTo:t.configuration.analytics.originLevel2})});d();c();l();u();d();c();l();u();function Ur(e){return Object.values(e).map(t=>t.request)}d();c();l();u();var gb=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=r0(e),n=t0(e);return Vr({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??We(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,insightId:e.insightConfiguration.insightId,...(e.configuration.analytics.enabled&&(yield Qn(e.configuration.analytics,t))),q:e.query?.q,...(n.length&&{facets:n}),caseContext:e.insightCaseContext?.caseContext,...(r&&{cq:r}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),tab:e.configuration.analytics.originLevel2,...(e.folding&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.context&&{context:e.context.contextValues}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function gb(_x43,_x44){return _ref21.apply(this,arguments)}}(),fr=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){let r=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,n=yield gb(e,t);return{...n,request:{...n.request,...(e.pagination&&{firstResult:e.pagination.firstResult,numberOfResults:r()})}}});return function fr(_x45,_x46){return _ref22.apply(this,arguments)}}(),hb=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=yield gb(e);return{...r,request:{...r.request,filterFieldRange:100,cq:`@${e?.folding?.fields.collection}="${t}"`}}});return function hb(_x47,_x48){return _ref23.apply(this,arguments)}}(),Fl=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=yield fr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.pagination?.numberOfResults??0)},r});return function Fl(_x49,_x50){return _ref24.apply(this,arguments)}}(),Tl=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=yield fr(e,t);return r.request={...r.request,numberOfResults:0},r});return function Tl(_x51,_x52){return _ref25.apply(this,arguments)}}();function t0(e){return Ur({...e.facetSet,...e.numericFacetSet,...e.dateFacetSet,...e.categoryFacetSet})}function r0(e){return Object.values(e.tabSet||{}).find(n=>n.isActive)?.expression.trim()||""}var Do=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x53,_x54){var _this9=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),i=Rr(yield _this9.extra.apiClient.query(t,n),r),a=Date.now()-o,p=_this9.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t){var _this0=this;return _asyncToGenerator(function*(){return _this0.processQueryErrorOrContinue(t)??(yield _this0.processQueryCorrectionsOrContinue(t))??_this0.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(da(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this1=this;return _asyncToGenerator(function*(){let r=_this1.getState(),n=_this1.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:p,queryCorrection:f}=n;if(!o||!i)return null;let m=a.length===0&&p&&p.length!==0,h=!te(f)&&!te(f.correctedQuery);if(!m&&!h)return null;let C=m?yield _this1.processLegacyDidYouMeanAutoCorrection(t):_this1.processNextDidYouMeanAutoCorrection(t);return _this1.dispatch(St(vt(_this1.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this10=this;return _asyncToGenerator(function*(){let r=_this10.getCurrentQuery(),n=_this10.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this10.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this10.dispatch(da(i.response.error)),_this10.rejectWithValue(i.response.error)):(_this10.dispatch(St(vt(_this10.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}automaticallyRetryQueryWithCorrection(t){var _this11=this;return _asyncToGenerator(function*(){_this11.onUpdateQueryForCorrection(t);let r=_this11.getState(),n=yield _this11.fetchFromAPI(yield fr(r));return _this11.dispatch(Yt(t)),n})()}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Nn(t.response)?t.response.success:null}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}};d();c();l();u();d();c();l();u();d();c();l();u();var yb=()=>Z("didYouMeanClick")("analytics/didyoumean/click",(e,t)=>e.logDidYouMeanClick(J(t.insightCaseContext))),Eh=()=>Z("didYouMeanAutomatic")("analytics/didyoumean/automatic",(e,t)=>e.logDidYouMeanAutomatic(J(t.insightCaseContext)));var Mo=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x55,_x56){var _this12=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),i=Rr(yield _this12.extra.apiClient.query(t,n),r),a=Date.now()-o,p=_this12.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t,r){var _this13=this;return _asyncToGenerator(function*(){return _this13.processQueryErrorOrContinue(t)??(yield _this13.processQueryCorrectionsOrContinue(t,r))??_this13.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(da(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t,r){var _this14=this;return _asyncToGenerator(function*(){let n=_this14.getState(),o=_this14.getSuccessResponse(t);if(!o||!n.didYouMean)return null;let{enableDidYouMean:i,automaticallyCorrectQuery:a}=n.didYouMean,{results:p,queryCorrections:f,queryCorrection:m}=o;if(!i||!a)return null;let h=p.length===0&&f&&f.length!==0,v=!te(m)&&!te(m.correctedQuery);if(!h&&!v)return null;let g=h?yield _this14.processLegacyDidYouMeanAutoCorrection(t):_this14.processNextDidYouMeanAutoCorrection(t);return _this14.logOriginalAnalyticsQueryBeforeAutoCorrection(t,r),_this14.dispatch(St(vt(_this14.getState()))),g})()}processLegacyDidYouMeanAutoCorrection(t){var _this15=this;return _asyncToGenerator(function*(){let r=_this15.getCurrentQuery(),n=_this15.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this15.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this15.dispatch(da(i.response.error)),_this15.rejectWithValue(i.response.error)):(_this15.dispatch(St(vt(_this15.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Eh()})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Eh()}}automaticallyRetryQueryWithCorrection(t){var _this16=this;return _asyncToGenerator(function*(){_this16.dispatch(Ut({q:t}));let r=_this16.getState(),n=yield _this16.fetchFromAPI(yield fr(r));return _this16.dispatch(Yt(t)),n})()}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Nn(t.response)?t.response.success:null}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??at().enableQuerySyntax},search:{...yt(),duration:r,response:o,results:o.results}}}logOriginalAnalyticsQueryBeforeAutoCorrection(t,r){let n=this.getState(),o=Rr(t.response,r.mappings).success;this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,n,o),this.extra)}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get analyticsAction(){return this.config.analyticsAction}};function Fh(_x57,_x58,_x59){return _Fh.apply(this,arguments)}function _Fh(){_Fh=_asyncToGenerator(function*(e,t,r){Sc(e);let n=new Mo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:i,logger:a}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:i,logger:a}),f=yield fr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Fh.apply(this,arguments)}function Th(_x60,_x61,_x62){return _Th.apply(this,arguments)}function _Th(){_Th=_asyncToGenerator(function*(e,t,r){Sc(e);let n=new Mo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:i,logger:a}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:i,logger:a}),f=yield fr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Th.apply(this,arguments)}function Ph(_x63,_x64){return _Ph.apply(this,arguments)}function _Ph(){_Ph=_asyncToGenerator(function*(e,t){let r=new Mo({...t,analyticsAction:Ih}),{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield Ih().prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=yield Fl(e,a),f=yield r.fetchFromAPI(p);return yield r.process(f,p)});return _Ph.apply(this,arguments)}function kh(_x65,_x66,_x67){return _kh.apply(this,arguments)}function _kh(){_kh=_asyncToGenerator(function*(e,t,r){let n=new Mo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:i,logger:a}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:i,logger:a}),f=yield Tl(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _kh.apply(this,arguments)}var Sb=le("search/executeSearch",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Fh(r,t,e)});return function(_x68,_x69){return _ref26.apply(this,arguments)}}()),vb=le("search/fetchPage",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Th(r,t,e)});return function(_x70,_x71){return _ref27.apply(this,arguments)}}()),Ab=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ph(r,t)});return function(_x72,_x73){return _ref28.apply(this,arguments)}}()),Cb=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=t.getState();return yield kh(r,t,e)});return function(_x74,_x75){return _ref29.apply(this,arguments)}}());var bb=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,{request:r,mappings:n},o){let i=Date.now(),a=Rr(yield e.query(r,o),n),p=Date.now()-i,f=t.query?.q||"";return{response:a,duration:p,queryExecuted:f,requestExecuted:r}});return function bb(_x76,_x77,_x78,_x79){return _ref30.apply(this,arguments)}}(),Se=le("search/executeSearch",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Fh(r,t,e.legacy);Sc(r);let n=new Do({...t}),o=e.next?Oh(e.next):void 0,i=yield fr(r,o),a=yield n.fetchFromAPI(i);return yield n.process(a)});return function(_x80,_x81){return _ref31.apply(this,arguments)}}()),Pl=le("search/fetchPage",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Th(r,t,e.legacy);Sc(r);let n=new Do({...t}),o=e.next?Oh(e.next):void 0,i=yield fr(r,o),a=yield n.fetchFromAPI(i);return yield n.process(a)});return function(_x82,_x83){return _ref32.apply(this,arguments)}}()),kl=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ph(r,t);let n=new Do({...t}),o=Oh({actionCause:"browseResults"}),i=yield Fl(r,o),a=yield n.fetchFromAPI(i);return yield n.process(a)});return function(_x84,_x85){return _ref33.apply(this,arguments)}}()),pa=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return kh(r,t,e.legacy);let n=new Do({...t}),o=yield Tl(r),i=yield n.fetchFromAPI(o);return yield n.process(i)});return function(_x86,_x87){return _ref34.apply(this,arguments)}}()),Ol=le("querySuggest/fetch",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o}}){o(e,{id:G});let i=e.id,a=yield sb(i,t()),p=yield n.querySuggest(a);return Ge(p)?r(p.error):{id:i,q:a.q,...p.success}});return function(_x88,_x89){return _ref35.apply(this,arguments)}}()),Sc=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Oh=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();d();c();l();u();var Kt=T("breadcrumb/deselectAll"),_l=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var fa=T("facet/updateFacetAutoSelection",e=>_(e,{allow:new ue({required:!0})}));d();c();l();u();d();c();l();u();var Nl=class extends Vn{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??at().q}get responseTime(){return this.activeInstantResultCache?.duration??yt().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??yt().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var xb=()=>$e("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Nl(e)),Rb=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var _h={id:G},n0={..._h,q:Ye},YJ=T("instantResults/register",e=>_(e,_h)),ql=T("instantResults/updateQuery",e=>_(e,n0)),KJ=T("instantResults/clearExpired",e=>_(e,_h));d();c();l();u();var Dl=new ne({required:!0,min:0}),Ml=T("pagination/registerNumberOfResults",e=>_(e,Dl)),jl=T("pagination/updateNumberOfResults",e=>_(e,Dl)),Vl=T("pagination/registerPage",e=>_(e,Dl)),Gn=T("pagination/updatePage",e=>_(e,Dl)),Ll=T("pagination/nextPage"),Ul=T("pagination/previousPage");d();c();l();u();d();c();l();u();var jo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:Hi(e)}});var ma=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??$t(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&jo(e.configuration.analytics,t,r)),...(e.excerptLength&&!te(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var $n=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??$t(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Nt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Qn(e.configuration.analytics,t))),...(e.excerptLength&&!te(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function $n(_x90,_x91){return _ref36.apply(this,arguments)}}();d();c();l();u();var Nh=()=>$e("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Hn=e=>$e("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||at().q,aq:r.advancedSearchQueries?.aq||An().aq,cq:r.advancedSearchQueries?.cq||An().cq,dq:r.advancedSearchQueries?.dq||An().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var qh=()=>$e("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),wb=()=>({actionCause:"didYouMeanClick"}),Ib=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();var JX=new W({values:{undoneQuery:Ye},options:{required:!0}}),Eb=()=>$e("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var ga=T("trigger/query/ignore",e=>_(e,new L({emptyAllowed:!0,required:!0}))),ha=T("trigger/query/modification",e=>_(e,new W({values:{originalQuery:He,modification:He}})));d();c();l();u();d();c();l();u();function vc(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Fb(e){return Ur(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Dh={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function o0(e){return Ur(e).map(t=>{let r=Dh[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function i0(e){return[...o0(e.facetSet??{}),...Fb(e.numericFacetSet??{}),...Fb(e.dateFacetSet??{}),...Ur(e.categoryFacetSet??{})]}function a0(e){return i0(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ql(e){return vc(a0(e),e.facetOrder??[])}var zn=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=u0(e),n=Ql(e),o=s0(e),i=yield $n(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Vr({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function zn(_x92,_x93){return _ref37.apply(this,arguments)}}();function s0(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(c0).filter(r=>r.currentValues.length>0):void 0}function c0(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function u0(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=l0(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function l0(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Wn=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x94,_x95){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Rr(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,p=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(Hn(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:p,queryCorrection:f}=n;if(!o||!i)return null;let m=a.length===0&&p&&p.length!==0,h=!te(f)&&!te(f.correctedQuery);if(!m&&!h)return null;let C=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(St(vt(_this19.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this20.dispatch(Hn(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this20.dispatch(St(vt(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:qh()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:qh()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(ga("")),null;_this21.analyticsAction&&(yield _this21.dispatch(_this21.analyticsAction));let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Ge(a.response)?(_this21.dispatch(Hn(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(St(vt(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Eb()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??at().enableQuerySyntax},search:{...yt(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Nn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=yield _this22.fetchFromAPI(yield zn(_this22.getState()),{origin:"mainSearch"});return _this22.dispatch(Yt(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(ha({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield zn(_this23.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var ree=le("search/executeSearch",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Bl(r,t,e)});return function(_x96,_x97){return _ref38.apply(this,arguments)}}()),nee=le("search/fetchPage",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();return yield jh(r,t,e)});return function(_x98,_x99){return _ref39.apply(this,arguments)}}()),oee=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Vh(t,r)});return function(_x100,_x101){return _ref40.apply(this,arguments)}}()),iee=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();return yield m0(t,e,r)});return function(_x102,_x103){return _ref41.apply(this,arguments)}}()),aee=le("search/fetchInstantResults",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){return Mh(e,t)});return function(_x104,_x105){return _ref42.apply(this,arguments)}}()),d0=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=yield zn(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function d0(_x106,_x107){return _ref43.apply(this,arguments)}}(),p0=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t,r){let n=yield $n(e);return Vr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function p0(_x108,_x109,_x110){return _ref44.apply(this,arguments)}}(),f0=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){let r=yield zn(e,t);return r.request.numberOfResults=0,r});return function f0(_x111,_x112){return _ref45.apply(this,arguments)}}(),Tb=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Mh(_x113,_x114){return _Mh.apply(this,arguments)}function _Mh(){_Mh=_asyncToGenerator(function*(e,t){_(e,{id:G,q:G,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Wn({...t,analyticsAction:xb()},m=>{t.dispatch(ql({q:m,id:e.id}))}),a=yield p0(o,r,n),p=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Mh.apply(this,arguments)}function jh(_x115,_x116,_x117){return _jh.apply(this,arguments)}function _jh(){_jh=_asyncToGenerator(function*(e,t,r){Tb(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=new Wn({...t,analyticsAction:r}),f=yield zn(e,a),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _jh.apply(this,arguments)}function Vh(_x118,_x119){return _Vh.apply(this,arguments)}function _Vh(){_Vh=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Nh().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Wn({...e,analyticsAction:Nh()}),p=yield d0(t,i),f=yield a.fetchFromAPI(p,{origin:"mainSearch"});return yield a.process(f)});return _Vh.apply(this,arguments)}function m0(_x120,_x121,_x122){return _m2.apply(this,arguments)}function _m2(){_m2=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=new Wn({...e,analyticsAction:t}),f=yield f0(r,a),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _m2.apply(this,arguments)}function Bl(_x123,_x124,_x125){return _Bl.apply(this,arguments)}function _Bl(){_Bl=_asyncToGenerator(function*(e,t,r){Tb(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=yield zn(e,a),f=new Wn({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Bl.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Pb=ot(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var mr=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t,r){let n=Uh(e),o=g0(e),i=h0(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield $n(e,r):ma(e,t,r);return Vr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Lh(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function mr(_x126,_x127,_x128){return _ref46.apply(this,arguments)}}();function Lh(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function g0(e){return vc(S0(e),e.facetOrder??[])}function h0(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(y0).filter(r=>r.currentValues.length>0):void 0}function y0(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function S0(e){return v0(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function v0(e){return[...A0(e.facetSet??{}),...kb(e.numericFacetSet??{}),...kb(e.dateFacetSet??{}),...Ur(e.categoryFacetSet??{})]}function A0(e){return Ur(e).map(t=>{let r=Dh[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function kb(e){return Ur(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Uh(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Pb(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Yn=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x129,_x130){var _this24=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Rr(yield _this24.extra.apiClient.search(r,n),t),a=Date.now()-o,p=_this24.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this25=this;return _asyncToGenerator(function*(){return _this25.processQueryErrorOrContinue(t)??(yield _this25.processQueryCorrectionsOrContinue(t))??(yield _this25.processQueryTriggersOrContinue(t))??_this25.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(Hn(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getState(),n=_this26.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:p,queryCorrection:f}=n;if(!o||!i)return null;let m=a.length===0&&p&&p.length!==0,h=!te(f)&&!te(f.correctedQuery);if(!m&&!h)return null;let C=m?yield _this26.processLegacyDidYouMeanAutoCorrection(t):_this26.processModernDidYouMeanAutoCorrection(t);return _this26.dispatch(St(vt(_this26.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this27=this;return _asyncToGenerator(function*(){let r=_this27.getCurrentQuery(),n=_this27.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this27.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this27.dispatch(Hn(i.response.error)),_this27.rejectWithValue(i.response.error)):(_this27.dispatch(St(vt(_this27.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this28=this;return _asyncToGenerator(function*(){let r=_this28.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this28.getState().triggers?.queryModification.queryToIgnore===n)return _this28.dispatch(ga("")),null;let i=_this28.getCurrentQuery(),a=yield _this28.automaticallyRetryQueryWithTriggerModification(n);return Ge(a.response)?(_this28.dispatch(Hn(a.response.error)),_this28.rejectWithValue(a.response.error)):(_this28.dispatch(St(vt(_this28.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Nn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this29=this;return _asyncToGenerator(function*(){_this29.onUpdateQueryForCorrection(t);let r=_this29.getState(),{actionCause:n}=Ib(),o=yield _this29.fetchFromAPI(yield mr(r,_this29.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this29.dispatch(Yt(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this30=this;return _asyncToGenerator(function*(){return _this30.dispatch(ha({newQuery:t,originalQuery:_this30.getCurrentQuery()})),_this30.onUpdateQueryForCorrection(t),yield _this30.fetchFromAPI(yield mr(_this30.getState(),_this30.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var ya=le("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;_(e,{q:new L,enableQuerySyntax:new ue,clearFilters:new ue}),e.clearFilters&&(r(Kt()),r(_l())),r(fa({allow:!0})),r(Ut({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Gn(1))}),Ob=T("search/updateSearchAction"),Fe=le("search/executeSearch",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Bl(r,t,e.legacy);_b(r);let n=e.next?Nb(e.next):void 0,o=yield mr(r,t.extra.navigatorContext,n),i=new Yn({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x131,_x132){return _ref47.apply(this,arguments)}}()),Br=le("search/fetchPage",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=t.getState();if(_b(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return jh(r,t,e.legacy);let n=new Yn({...t,analyticsAction:e.next}),o=yield mr(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x133,_x134){return _ref48.apply(this,arguments)}}()),Kn=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Vh(t,r);let n=kC("browseResults",t.getState),o=new Yn({...t,analyticsAction:n}),i=yield C0(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x135,_x136){return _ref49.apply(this,arguments)}}()),Sa=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Bl(r,t,e.legacy);let n=new Yn({...t,analyticsAction:{}}),o=yield x0(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x137,_x138){return _ref50.apply(this,arguments)}}()),ute=le("search/fetchInstantResults",/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Mh(e,t);_(e,{id:G,q:G,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:n,maxResultsPerQuery:o}=e,i=Nb(Rb()),a=yield b0(r,t.extra.navigatorContext,n,o,i),p=new Yn({...t,analyticsAction:i},h=>{t.dispatch(ql({q:h,id:e.id}))}),f=yield p.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x139,_x140){return _ref51.apply(this,arguments)}}()),C0=/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t,r){let n=yield mr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function C0(_x141,_x142,_x143){return _ref52.apply(this,arguments)}}(),b0=/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t,r,n,o){let i=ma(e,t,o);return Vr({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function b0(_x144,_x145,_x146,_x147,_x148){return _ref53.apply(this,arguments)}}(),x0=/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t,r){let n=yield mr(e,t,r);return n.request.numberOfResults=0,n});return function x0(_x149,_x150,_x151){return _ref54.apply(this,arguments)}}(),_b=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Nb=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();function qb(_x152,_x153){return _qb.apply(this,arguments)}function _qb(){_qb=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,i=e.query?.q||"";return{url:r.apiBaseUrl??$t(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:i,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _qb.apply(this,arguments)}var Ac=le("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),i=yield qb(o,e),a=yield t.apiClient.html(i);return Ge(a)?n(a.error):{content:a.success,uniqueId:e.uniqueId}});return function(_x154,_x155){return _ref55.apply(this,arguments)}}()),Gl=T("resultPreview/next"),$l=T("resultPreview/previous"),Mb=T("resultPreview/prepare",e=>_(e,{results:new re({required:!0})})),Db=2048,Hl=le("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=Cv(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Db&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Db} characters.`),{contentURL:o}});return function(_x156,_x157){return _ref56.apply(this,arguments)}}());d();c();l();u();function Qh(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var Bh=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=Qh();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},Gh=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),va=ce(Qh(),e=>{e.addCase(Ac.pending,t=>{t.isLoading=!0}).addCase(Ac.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(Fe.fulfilled,(t,r)=>{Bh(t),t.resultsWithPreview=Gh(r.payload.response.results)}).addCase(Kn.fulfilled,(t,r)=>{Bh(t),t.resultsWithPreview=t.resultsWithPreview.concat(Gh(r.payload.response.results))}).addCase(Br.fulfilled,Bh).addCase(Mb,(t,r)=>{t.resultsWithPreview=Gh(r.payload.results)}).addCase(Gl,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase($l,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Hl.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});d();c();l();u();d();c();l();u();var Jn=(e,t)=>{let r=e;return te(r[t])?te(e.raw[t])?null:e.raw[t]:r[t]},R0=e=>t=>e.every(r=>!te(Jn(t,r))),w0=e=>t=>e.every(r=>te(Jn(t,r))),I0=(e,t)=>r=>{let n=jb(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},E0=(e,t)=>r=>{let n=jb(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},jb=(e,t)=>{let r=Jn(t,e);return du(r)?r:[r]},Vb={getResultProperty:Jn,fieldsMustBeDefined:R0,fieldsMustNotBeDefined:w0,fieldMustMatch:I0,fieldMustNotMatch:E0};function zl(e){return e.search.response.searchUid!==""}function Lb(e,t,r){return e.search.results.find(n=>Jn(n,t)===r)}var $h=ot(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Aa=T("app/setError");function Hh(e,t){let r=t.payload??null;r&&(e.response=yt().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function zh(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function F0(e,t){zh(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function Ub(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function T0(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var xe=ce(yt(),e=>{e.addCase(Fe.rejected,(t,r)=>Hh(t,r)),e.addCase(Kn.rejected,(t,r)=>Hh(t,r)),e.addCase(Br.rejected,(t,r)=>Hh(t,r)),e.addCase(Fe.fulfilled,(t,r)=>{F0(t,r)}),e.addCase(Kn.fulfilled,(t,r)=>{zh(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Br.fulfilled,(t,r)=>{zh(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Sa.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(Fe.pending,Ub),e.addCase(Kn.pending,T0),e.addCase(Br.pending,Ub),e.addCase(Ob,(t,r)=>{t.searchAction=r.payload}),e.addCase(Aa,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Wl=ce(Ki(),e=>{e.addCase(gl,(t,r)=>r.payload).addCase(Ze.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(ua,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function Qb(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Bb=Or;function tx(e,t){if(e===t||!(Bb(e)&&Bb(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=tx(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Ca(e){let t=0;for(let r in e)t++;return t}var Gb=e=>[].concat(...e);function P0(e){return new RegExp("(^|:)//").test(e)}function k0(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Jl(e){return e!=null}function O0(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var _0=e=>e.replace(/\/$/,""),N0=e=>e.replace(/^\//,"");function q0(e,t){if(!e)return t;if(!t)return e;if(P0(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=_0(e),t=N0(t),`${e}${r}${t}`}function D0(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var $b=(...e)=>A(...e),M0=e=>e.status>=200&&e.status<=299,j0=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Hb(e){if(!Or(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function rx({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=$b,paramsSerializer:n,isJsonContentType:o=j0,jsonContentType:i="application/json",jsonReplacer:a,timeout:p,responseHandler:f,validateStatus:m,...h}={}){return typeof A>"u"&&r===$b&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(C,g,S){let{getState:x,extra:w,endpoint:R,forced:I,type:E}=g,P,{url:V,headers:q=new b(h.headers),params:O=void 0,responseHandler:N=f??"json",validateStatus:M=m??M0,timeout:U=p,...Y}=typeof C=="string"?{url:C}:C,H,B=g.signal;U&&(H=new s.AbortController,g.signal.addEventListener("abort",H.abort),B=H.signal);let Q={...h,signal:B,...Y};q=new b(Hb(q)),Q.headers=(yield t(q,{getState:x,arg:C,extra:w,endpoint:R,forced:I,type:E,extraOptions:S}))||q;let z=Ce=>typeof Ce=="object"&&(Or(Ce)||Array.isArray(Ce)||typeof Ce.toJSON=="function");if(!Q.headers.has("content-type")&&z(Q.body)&&Q.headers.set("content-type",i),z(Q.body)&&o(Q.headers)&&(Q.body=JSON.stringify(Q.body,a)),O){let Ce=~V.indexOf("?")?"&":"?",Te=n?n(O):new URLSearchParams(Hb(O));V+=Ce+Te}V=q0(e,V);let $=new Request(V,Q);P={request:new Request(V,Q)};let ee,pe=!1,Re=H&&setTimeout(()=>{pe=!0,H.abort()},U);try{ee=yield r($)}catch(Ce){return{error:{status:pe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ce)},meta:P}}finally{Re&&clearTimeout(Re),H?.signal.removeEventListener("abort",H.abort)}let _e=ee.clone();P.response=_e;let be,we="";try{let Ce;if(yield Promise.all([v(ee,N).then(Te=>be=Te,Te=>Ce=Te),_e.text().then(Te=>we=Te,()=>{})]),Ce)throw Ce}catch(Ce){return{error:{status:"PARSING_ERROR",originalStatus:ee.status,data:we,error:String(Ce)},meta:P}}return M(ee,be)?{data:be,meta:P}:{error:{status:ee.status,data:be},meta:P}});return function(_x158,_x159,_x160){return _ref57.apply(this,arguments)}}());function v(_x161,_x162){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(C,g){if(typeof g=="function")return g(C);if(g==="content-type"&&(g=o(C.headers)?"json":"text"),g==="json"){let S=yield C.text();return S.length?JSON.parse(S):null}return C.text()});return _v2.apply(this,arguments)}}var ba=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function V0(){return _V2.apply(this,arguments)}function _V2(){_V2=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _V2.apply(this,arguments)}function L0(e,t){throw Object.assign(new ba({error:e,meta:t}),{throwImmediately:!0})}var zb={},U0=(e,t)=>(/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(r,n,o){let i=[5,(t||zb).maxRetries,(o||zb).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:V0,retryCondition:(h,v,{attempt:C})=>C<=a,...t,...o},m=0;for(;;)try{let h=yield e(r,n,o);if(h.error)throw new ba(h);return h}catch(h){if(m++,h.throwImmediately){if(h instanceof ba)return h.value;throw h}if(h instanceof ba&&!f.retryCondition(h.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return h.value;yield f.backoff(m,f.maxRetries)}});return function(_x163,_x164,_x165){return _ref58.apply(this,arguments)}}()),nx=Object.assign(U0,{fail:L0}),Jh=T("__rtkq/focused"),ox=T("__rtkq/unfocused"),Xh=T("__rtkq/online"),ix=T("__rtkq/offline");function Zh(e){return e.type==="query"}function Q0(e){return e.type==="mutation"}function ey(e){return e.type==="infinitequery"}function ty(e,t,r,n,o,i){return B0(e)?e(t,r,n,o).filter(Jl).map(Wh).map(i):Array.isArray(e)?e.map(Wh).map(i):[]}function B0(e){return typeof e=="function"}function Wh(e){return typeof e=="string"?{type:e}:e}function G0(e,t){return e.catch(t)}var bc=Symbol("forceQueryFn"),Yh=e=>typeof e[bc]=="function";function $0({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,p=new Map,{unsubscribeQueryResult:f,removeMutationResult:m,updateSubscriptionOptions:h}=o.internalActions;return{buildInitiateQuery:R,buildInitiateInfiniteQuery:I,buildInitiateMutation:E,getRunningQueryThunk:v,getRunningMutationThunk:C,getRunningQueriesThunk:g,getRunningMutationsThunk:S};function v(P,V){return q=>{let O=i.endpointDefinitions[P],N=e({queryArgs:V,endpointDefinition:O,endpointName:P});return a.get(q)?.[N]}}function C(P,V){return q=>p.get(q)?.[V]}function g(){return P=>Object.values(a.get(P)||{}).filter(Jl)}function S(){return P=>Object.values(p.get(P)||{}).filter(Jl)}function x(P){}function w(P,V){let q=(O,{subscribe:N=!0,forceRefetch:M,subscriptionOptions:U,[bc]:Y,...H}={})=>(B,Q)=>{let z=e({queryArgs:O,endpointDefinition:V,endpointName:P}),$,X={...H,type:"query",subscribe:N,forceRefetch:M,subscriptionOptions:U,endpointName:P,originalArgs:O,queryCacheKey:z,[bc]:Y};if(Zh(V))$=t(X);else{let{direction:je,initialPageParam:it}=H;$=r({...X,direction:je,initialPageParam:it})}let ee=o.endpoints[P].select(O),pe=B($),Re=ee(Q());let{requestId:_e,abort:be}=pe,we=Re.requestId!==_e,Ce=a.get(B)?.[z],Te=()=>ee(Q()),ut=Object.assign(Y?pe.then(Te):we&&!Ce?Promise.resolve(Re):Promise.all([Ce,pe]).then(Te),{arg:O,requestId:_e,subscriptionOptions:U,queryCacheKey:z,abort:be,unwrap(){return _asyncToGenerator(function*(){let je=yield ut;if(je.isError)throw je.error;return je.data})()},refetch:()=>B(q(O,{subscribe:!1,forceRefetch:!0})),unsubscribe(){N&&B(f({queryCacheKey:z,requestId:_e}))},updateSubscriptionOptions(je){ut.subscriptionOptions=je,B(h({endpointName:P,requestId:_e,queryCacheKey:z,options:je}))}});if(!Ce&&!we&&!Y){let je=D0(a,B,{});je[z]=ut,ut.then(()=>{delete je[z],Ca(je)||a.delete(B)})}return ut};return q}function R(P,V){return w(P,V)}function I(P,V){return w(P,V)}function E(P){return(V,{track:q=!0,fixedCacheKey:O}={})=>(N,M)=>{let U=n({type:"mutation",endpointName:P,originalArgs:V,track:q,fixedCacheKey:O}),Y=N(U);let{requestId:H,abort:B,unwrap:Q}=Y,z=G0(Y.unwrap().then(pe=>({data:pe})),pe=>({error:pe})),$=()=>{N(m({requestId:H,fixedCacheKey:O}))},X=Object.assign(z,{arg:Y.arg,requestId:H,abort:B,unwrap:Q,reset:$}),ee=p.get(N)||{};return p.set(N,ee),ee[H]=X,X.then(()=>{delete ee[H],Ca(ee)||p.delete(N)}),O&&(ee[O]=X,X.then(()=>{ee[O]===X&&(delete ee[O],Ca(ee)||p.delete(N))})),X}}}function H0(e){return e}var Yl=(e={})=>({...e,[rc]:!0});function z0({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let p=(N,M,U,Y)=>(H,B)=>{let Q=r[N],z=n({queryArgs:M,endpointDefinition:Q,endpointName:N});if(H(o.internalActions.queryResultPatched({queryCacheKey:z,patches:U})),!Y)return;let $=o.endpoints[N].select(M)(B()),X=ty(Q.providesTags,$.data,void 0,M,{},i);H(o.internalActions.updateProvidedBy({queryCacheKey:z,providedTags:X}))};function f(N,M,U=0){let Y=[M,...N];return U&&Y.length>U?Y.slice(0,-1):Y}function m(N,M,U=0){let Y=[...N,M];return U&&Y.length>U?Y.slice(1):Y}let h=(N,M,U,Y=!0)=>(H,B)=>{let z=o.endpoints[N].select(M)(B()),$={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(N,M,$.inversePatches,Y))};if(z.status==="uninitialized")return $;let X;if("data"in z)if(zt(z.data)){let[ee,pe,Re]=Fu(z.data,U);$.patches.push(...pe),$.inversePatches.push(...Re),X=ee}else X=U(z.data),$.patches.push({op:"replace",path:[],value:X}),$.inversePatches.push({op:"replace",path:[],value:z.data});return $.patches.length===0||H(o.util.patchQueryData(N,M,$.patches,Y)),$},v=(N,M,U)=>Y=>Y(o.endpoints[N].initiate(M,{subscribe:!1,forceRefetch:!0,[bc]:()=>({data:U})})),C=(N,M)=>N.query&&N[M]?N[M]:H0,g=/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(N,{signal:M,abort:U,rejectWithValue:Y,fulfillWithValue:H,dispatch:B,getState:Q,extra:z}){let $=r[N.endpointName];try{let X=C($,"transformResponse"),ee={signal:M,abort:U,dispatch:B,getState:Q,extra:z,endpoint:N.endpointName,type:N.type,forced:N.type==="query"?S(N,Q()):void 0,queryCacheKey:N.type==="query"?N.queryCacheKey:void 0},pe=N.type==="query"?N[bc]:void 0,Re,_e=/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(we,Ce,Te,ut){if(Ce==null&&we.pages.length)return Promise.resolve({data:we});let je={queryArg:N.originalArgs,pageParam:Ce},it=yield be(je),ft=ut?f:m;return{data:{pages:ft(we.pages,it.data,Te),pageParams:ft(we.pageParams,Ce,Te)}}});return function _e(_x168,_x169,_x170,_x171){return _ref60.apply(this,arguments)}}();function be(_x172){return _be.apply(this,arguments)}function _be(){_be=_asyncToGenerator(function*(we){let Ce,{extraOptions:Te}=$;if(pe?Ce=pe():$.query?Ce=yield t($.query(we),ee,Te):Ce=yield $.queryFn(we,ee,Te,je=>t(je,ee,Te)),typeof process<"u",Ce.error)throw new ba(Ce.error,Ce.meta);let ut=yield X(Ce.data,Ce.meta,we);return{...Ce,data:ut}});return _be.apply(this,arguments)}if(N.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:we}=$,{maxPages:Ce=1/0}=we,Te,ut={pages:[],pageParams:[]},je=a.selectQueryEntry(Q(),N.queryCacheKey)?.data,ft=S(N,Q())&&!N.direction||!je?ut:je;if("direction"in N&&N.direction&&ft.pages.length){let Gt=N.direction==="backward",On=(Gt?ax:Kh)(we,ft);Te=yield _e(ft,On,Ce,Gt)}else{let{initialPageParam:Gt=we.initialPageParam}=N,cr=je?.pageParams??[],On=cr[0]??Gt,wi=cr.length;Te=yield _e(ft,On,Ce),pe&&(Te={data:Te.data.pages[0]});for(let Ii=1;Ii<wi;Ii++){let Ns=Kh(we,Te.data);Te=yield _e(Te.data,Ns,Ce)}}Re=Te}else Re=yield be(N.originalArgs);return H(Re.data,Yl({fulfilledTimeStamp:Date.now(),baseQueryMeta:Re.meta}))}catch(X){let ee=X;if(ee instanceof ba){let pe=C($,"transformErrorResponse");try{return Y(yield pe(ee.value,ee.meta,N.originalArgs),Yl({baseQueryMeta:ee.meta}))}catch(Re){ee=Re}}throw typeof process<"u",console.error(ee),ee}});return function g(_x166,_x167){return _ref59.apply(this,arguments)}}();function S(N,M){let U=a.selectQueryEntry(M,N.queryCacheKey),Y=a.selectConfig(M).refetchOnMountOrArgChange,H=U?.fulfilledTimeStamp,B=N.forceRefetch??(N.subscribe&&Y);return B?B===!0||(Number(new Date)-Number(H))/1e3>=B:!1}let x=()=>le(`${e}/executeQuery`,g,{getPendingMeta({arg:M}){let U=r[M.endpointName];return Yl({startedTimeStamp:Date.now(),...(ey(U)?{direction:M.direction}:{})})},condition(M,{getState:U}){let Y=U(),H=a.selectQueryEntry(Y,M.queryCacheKey),B=H?.fulfilledTimeStamp,Q=M.originalArgs,z=H?.originalArgs,$=r[M.endpointName],X=M.direction;return Yh(M)?!0:H?.status==="pending"?!1:S(M,Y)||Zh($)&&$?.forceRefetch?.({currentArg:Q,previousArg:z,endpointState:H,state:Y})?!0:!(B&&!X)},dispatchConditionRejection:!0}),w=x(),R=x(),I=le(`${e}/executeMutation`,g,{getPendingMeta(){return Yl({startedTimeStamp:Date.now()})}}),E=N=>"force"in N,P=N=>"ifOlderThan"in N,V=(N,M,U)=>(Y,H)=>{let B=E(U)&&U.force,Q=P(U)&&U.ifOlderThan,z=(X=!0)=>{let ee={forceRefetch:X,isPrefetch:!0};return o.endpoints[N].initiate(M,ee)},$=o.endpoints[N].select(M)(H());if(B)Y(z());else if(Q){let X=$?.fulfilledTimeStamp;if(!X){Y(z());return}(Number(new Date)-Number(new Date(X)))/1e3>=Q&&Y(z())}else Y(z(!1))};function q(N){return M=>M?.meta?.arg?.endpointName===N}function O(N,M){return{matchPending:Gi(Nu(N),q(M)),matchFulfilled:Gi(Sn(N),q(M)),matchRejected:Gi(ko(N),q(M))}}return{queryThunk:w,mutationThunk:I,infiniteQueryThunk:R,prefetch:V,updateQueryData:h,upsertQueryData:v,patchQueryData:p,buildMatchThunkActions:O}}function Kh(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function ax(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function sx(e,t,r,n){return ty(r[e.meta.arg.endpointName][t],Sn(e)?e.payload:void 0,oc(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Kl(e,t,r){let n=e[t];n&&r(n)}function xc(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Wb(e,t,r){let n=e[xc(t)];n&&r(n)}var Cc={};function W0({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:p},assertTagType:f,config:m}){let h=T(`${e}/resetApiState`);function v(q,O,N,M){var U;q[U=O.queryCacheKey]??(q[U]={status:"uninitialized",endpointName:O.endpointName}),Kl(q,O.queryCacheKey,Y=>{Y.status="pending",Y.requestId=N&&Y.requestId?Y.requestId:M.requestId,O.originalArgs!==void 0&&(Y.originalArgs=O.originalArgs),Y.startedTimeStamp=M.startedTimeStamp;let H=o[M.arg.endpointName];ey(H)&&"direction"in O&&(Y.direction=O.direction)})}function C(q,O,N,M){Kl(q,O.arg.queryCacheKey,U=>{if(U.requestId!==O.requestId&&!M)return;let{merge:Y}=o[O.arg.endpointName];if(U.status="fulfilled",Y){if(U.data!==void 0){let{fulfilledTimeStamp:H,arg:B,baseQueryMeta:Q,requestId:z}=O,$=yn(U.data,X=>Y(X,N,{arg:B.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:H,requestId:z}));U.data=$}else U.data=N;}else U.data=o[O.arg.endpointName].structuralSharing??!0?tx(nr(U.data)?Sg(U.data):U.data,N):N;delete U.error,U.fulfilledTimeStamp=O.fulfilledTimeStamp})}let g=Oo({name:`${e}/queries`,initialState:Cc,reducers:{removeQueryResult:{reducer(q,{payload:{queryCacheKey:O}}){delete q[O]},prepare:$i()},cacheEntriesUpserted:{reducer(q,O){for(let N of O.payload){let{queryDescription:M,value:U}=N;v(q,M,!0,{arg:M,requestId:O.meta.requestId,startedTimeStamp:O.meta.timestamp}),C(q,{arg:M,requestId:O.meta.requestId,fulfilledTimeStamp:O.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:q=>({payload:q.map(M=>{let{endpointName:U,arg:Y,value:H}=M,B=o[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:M.arg,queryCacheKey:n({queryArgs:Y,endpointDefinition:B,endpointName:U})},value:H}}),meta:{[rc]:!0,requestId:ic(),timestamp:Date.now()}})},queryResultPatched:{reducer(q,{payload:{queryCacheKey:O,patches:N}}){Kl(q,O,M=>{M.data=Ag(M.data,N.concat())})},prepare:$i()}},extraReducers(q){q.addCase(t.pending,(O,{meta:N,meta:{arg:M}})=>{let U=Yh(M);v(O,M,U,N)}).addCase(t.fulfilled,(O,{meta:N,payload:M})=>{let U=Yh(N.arg);C(O,N,M,U)}).addCase(t.rejected,(O,{meta:{condition:N,arg:M,requestId:U},error:Y,payload:H})=>{Kl(O,M.queryCacheKey,B=>{if(!N){if(B.requestId!==U)return;B.status="rejected",B.error=H??Y}})}).addMatcher(p,(O,N)=>{let{queries:M}=a(N);for(let[U,Y]of Object.entries(M))(Y?.status==="fulfilled"||Y?.status==="rejected")&&(O[U]=Y)})}}),S=Oo({name:`${e}/mutations`,initialState:Cc,reducers:{removeMutationResult:{reducer(q,{payload:O}){let N=xc(O);N in q&&delete q[N]},prepare:$i()}},extraReducers(q){q.addCase(r.pending,(O,{meta:N,meta:{requestId:M,arg:U,startedTimeStamp:Y}})=>{U.track&&(O[xc(N)]={requestId:M,status:"pending",endpointName:U.endpointName,startedTimeStamp:Y})}).addCase(r.fulfilled,(O,{payload:N,meta:M})=>{M.arg.track&&Wb(O,M,U=>{U.requestId===M.requestId&&(U.status="fulfilled",U.data=N,U.fulfilledTimeStamp=M.fulfilledTimeStamp)})}).addCase(r.rejected,(O,{payload:N,error:M,meta:U})=>{U.arg.track&&Wb(O,U,Y=>{Y.requestId===U.requestId&&(Y.status="rejected",Y.error=N??M)})}).addMatcher(p,(O,N)=>{let{mutations:M}=a(N);for(let[U,Y]of Object.entries(M))(Y?.status==="fulfilled"||Y?.status==="rejected")&&U!==Y?.requestId&&(O[U]=Y)})}}),x=Oo({name:`${e}/invalidation`,initialState:Cc,reducers:{updateProvidedBy:{reducer(q,O){var U,Y;let{queryCacheKey:N,providedTags:M}=O.payload;for(let H of Object.values(q))for(let B of Object.values(H)){let Q=B.indexOf(N);Q!==-1&&B.splice(Q,1)}for(let{type:H,id:B}of M){let Q=(U=q[H]??(q[H]={}))[Y=B||"__internal_without_id"]??(U[Y]=[]);Q.includes(N)||Q.push(N)}},prepare:$i()}},extraReducers(q){q.addCase(g.actions.removeQueryResult,(O,{payload:{queryCacheKey:N}})=>{for(let M of Object.values(O))for(let U of Object.values(M)){let Y=U.indexOf(N);Y!==-1&&U.splice(Y,1)}}).addMatcher(p,(O,N)=>{var U,Y;let{provided:M}=a(N);for(let[H,B]of Object.entries(M))for(let[Q,z]of Object.entries(B)){let $=(U=O[H]??(O[H]={}))[Y=Q||"__internal_without_id"]??(U[Y]=[]);for(let X of z)$.includes(X)||$.push(X)}}).addMatcher(_r(Sn(t),oc(t)),(O,N)=>{let M=sx(N,"providesTags",o,f),{queryCacheKey:U}=N.meta.arg;x.caseReducers.updateProvidedBy(O,x.actions.updateProvidedBy({queryCacheKey:U,providedTags:M}))})}}),w=Oo({name:`${e}/subscriptions`,initialState:Cc,reducers:{updateSubscriptionOptions(q,O){},unsubscribeQueryResult(q,O){},internal_getRTKQSubscriptions(){}}}),R=Oo({name:`${e}/internalSubscriptions`,initialState:Cc,reducers:{subscriptionsUpdated:{reducer(q,O){return Ag(q,O.payload)},prepare:$i()}}}),I=Oo({name:`${e}/config`,initialState:{online:O0(),focused:k0(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(q,{payload:O}){q.middlewareRegistered=q.middlewareRegistered==="conflict"||i!==O?"conflict":!0}},extraReducers:q=>{q.addCase(Xh,O=>{O.online=!0}).addCase(ix,O=>{O.online=!1}).addCase(Jh,O=>{O.focused=!0}).addCase(ox,O=>{O.focused=!1}).addMatcher(p,O=>({...O}))}}),E=Mi({queries:g.reducer,mutations:S.reducer,provided:x.reducer,subscriptions:R.reducer,config:I.reducer}),P=(q,O)=>E(h.match(O)?void 0:q,O),V={...I.actions,...g.actions,...w.actions,...R.actions,...S.actions,...x.actions,resetApiState:h};return{reducer:P,actions:V}}var Vo=Symbol.for("RTKQ/skipToken"),cx={status:"uninitialized"},Yb=yn(cx,()=>{}),Kb=yn(cx,()=>{});function Y0({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>Yb,o=E=>Kb;return{buildQuerySelector:C,buildInfiniteQuerySelector:g,buildMutationSelector:S,selectInvalidatedBy:x,selectCachedArgsForQuery:w,selectApiState:a,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:h};function i(E){return{...E,...Qb(E.status)}}function a(E){return E[t]}function p(E){return a(E)?.queries}function f(E,P){return p(E)?.[P]}function m(E){return a(E)?.mutations}function h(E){return a(E)?.config}function v(E,P,V){return q=>{if(q===Vo)return r(n,V);let O=e({queryArgs:q,endpointDefinition:P,endpointName:E});return r(M=>f(M,O)??Yb,V)}}function C(E,P){return v(E,P,i)}function g(E,P){let{infiniteQueryOptions:V}=P;function q(O){let N={...O,...Qb(O.status)},{isLoading:M,isError:U,direction:Y}=N,H=Y==="forward",B=Y==="backward";return{...N,hasNextPage:R(V,N.data),hasPreviousPage:I(V,N.data),isFetchingNextPage:M&&H,isFetchingPreviousPage:M&&B,isFetchNextPageError:U&&H,isFetchPreviousPageError:U&&B}}return v(E,P,q)}function S(){return E=>{let P;return typeof E=="object"?P=xc(E)??Vo:P=E,r(P===Vo?o:O=>a(O)?.mutations?.[P]??Kb,i)}}function x(E,P){let V=E[t],q=new Set;for(let O of P.filter(Jl).map(Wh)){let N=V.provided[O.type];if(!N)continue;let M=(O.id!==void 0?N[O.id]:Gb(Object.values(N)))??[];for(let U of M)q.add(U)}return Gb(Array.from(q.values()).map(O=>{let N=V.queries[O];return N?[{queryCacheKey:O,endpointName:N.endpointName,originalArgs:N.originalArgs}]:[]}))}function w(E,P){return Object.values(p(E)).filter(V=>V?.endpointName===P&&V.status!=="uninitialized").map(V=>V.originalArgs)}function R(E,P){return P?Kh(E,P)!=null:!1}function I(E,P){return!P||!E.getPreviousPageParam?!1:ax(E,P)!=null}}var Jb=WeakMap?new WeakMap:void 0,Xb=({endpointName:e,queryArgs:t})=>{let r="",n=Jb?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Or(a)?Object.keys(a).sort().reduce((p,f)=>(p[f]=a[f],p),{}):a,a));Or(t)&&Jb?.set(t,o),r=o}return`${e}(${r})`};function K0(...e){return function(r){let n=Qi(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let h=Xb;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;h=C=>{let g=v(C);return typeof g=="string"?g:Xb({...C,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(m)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(m){m()},apiUid:ic(),extractRehydrationInfo:n,hasRehydrationInfo:Qi(m=>n(m)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:h}){if(m)for(let v of m)o.tagTypes.includes(v)||o.tagTypes.push(v);if(h)for(let[v,C]of Object.entries(h))typeof C=="function"?C(i.endpointDefinitions[v]):Object.assign(i.endpointDefinitions[v]||{},C);return a}},p=e.map(m=>m.init(a,o,i));function f(m){let h=m.endpoints({query:v=>({...v,type:"query"}),mutation:v=>({...v,type:"mutation"}),infiniteQuery:v=>({...v,type:"infinitequery"})});for(let[v,C]of Object.entries(h)){if(m.overrideExisting!==!0&&v in i.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Lt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=C;for(let g of p)g.injectEndpoint(v,C)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function Cn(e,...t){return Object.assign(e,...t)}var J0=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:p}=e.internalActions,f=(g,S)=>{var w,R;if(a.match(S)){let{queryCacheKey:I,requestId:E,options:P}=S.payload;return g?.[I]?.[E]&&(g[I][E]=P),!0}if(p.match(S)){let{queryCacheKey:I,requestId:E}=S.payload;return g[I]&&delete g[I][E],!0}if(e.internalActions.removeQueryResult.match(S))return delete g[S.payload.queryCacheKey],!0;if(t.pending.match(S)){let{meta:{arg:I,requestId:E}}=S,P=g[w=I.queryCacheKey]??(g[w]={});return P[`${E}_running`]={},I.subscribe&&(P[E]=I.subscriptionOptions??P[E]??{}),!0}let x=!1;if(t.fulfilled.match(S)||t.rejected.match(S)){let I=g[S.meta.arg.queryCacheKey]||{},E=`${S.meta.requestId}_running`;x||(x=!!I[E]),delete I[E]}if(t.rejected.match(S)){let{meta:{condition:I,arg:E,requestId:P}}=S;if(I&&E.subscribe){let V=g[R=E.queryCacheKey]??(g[R]={});V[P]=E.subscriptionOptions??V[P]??{},x=!0}}return x},m=()=>r.currentSubscriptions,C={getSubscriptions:m,getSubscriptionCount:g=>{let x=m()[g]??{};return Ca(x)},isRequestSubscribed:(g,S)=>!!m()?.[g]?.[S]};return(g,S)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,C];let x=f(r.currentSubscriptions,g),w=!0;if(x){i||(i=setTimeout(()=>{let E=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,P]=Fu(o,()=>E);S.next(e.internalActions.subscriptionsUpdated(P)),o=E,i=null},500));let R=typeof g.type=="string"&&!!g.type.startsWith(n),I=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;w=!R&&!I}return[w,!1]}};function X0(e){for(let t in e)return!1;return!0}var Z0=2147483647/1e3-1,eq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:p,unsubscribeQueryResult:f,cacheEntriesUpserted:m}=t.internalActions,h=_r(f.match,r.fulfilled,r.rejected,m.match);function v(w){let R=o.currentSubscriptions[w];return!!R&&!X0(R)}let C={},g=(w,R,I)=>{let E=R.getState(),P=a(E);if(h(w)){let V;if(m.match(w))V=w.payload.map(q=>q.queryDescription.queryCacheKey);else{let{queryCacheKey:q}=f.match(w)?w.payload:w.meta.arg;V=[q]}S(V,R,P)}if(t.util.resetApiState.match(w))for(let[V,q]of Object.entries(C))q&&clearTimeout(q),delete C[V];if(n.hasRehydrationInfo(w)){let{queries:V}=n.extractRehydrationInfo(w);S(Object.keys(V),R,P)}};function S(w,R,I){let E=R.getState();for(let P of w){let V=i(E,P);x(P,V?.endpointName,R,I)}}function x(w,R,I,E){let V=n.endpointDefinitions[R]?.keepUnusedDataFor??E.keepUnusedDataFor;if(V===1/0)return;let q=Math.max(0,Math.min(V,Z0));if(!v(w)){let O=C[w];O&&clearTimeout(O),C[w]=setTimeout(()=>{v(w)||I.dispatch(p({queryCacheKey:w})),delete C[w]},q*1e3)}}return g},Zb=new Error("Promise never resolved before cacheEntryRemoved."),tq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:p}})=>{let f=qu(n),m=qu(o),h=Sn(n,o),v={};function C(R,I,E){let P=v[R];P?.valueResolved&&(P.valueResolved({data:I,meta:E}),delete P.valueResolved)}function g(R){let I=v[R];I&&(delete v[R],I.cacheEntryRemoved())}let S=(R,I,E)=>{let P=x(R);function V(q,O,N,M){let U=a(E,O),Y=a(I.getState(),O);!U&&Y&&w(q,M,O,I,N)}if(n.pending.match(R))V(R.meta.arg.endpointName,P,R.meta.requestId,R.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(R))for(let{queryDescription:q,value:O}of R.payload){let{endpointName:N,originalArgs:M,queryCacheKey:U}=q;V(N,U,R.meta.requestId,M),C(U,O,{})}else if(o.pending.match(R))I.getState()[t].mutations[P]&&w(R.meta.arg.endpointName,R.meta.arg.originalArgs,P,I,R.meta.requestId);else if(h(R))C(P,R.payload,R.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(R)||e.internalActions.removeMutationResult.match(R))g(P);else if(e.util.resetApiState.match(R))for(let q of Object.keys(v))g(q)};function x(R){return f(R)?R.meta.arg.queryCacheKey:m(R)?R.meta.arg.fixedCacheKey??R.meta.requestId:e.internalActions.removeQueryResult.match(R)?R.payload.queryCacheKey:e.internalActions.removeMutationResult.match(R)?xc(R.payload):""}function w(R,I,E,P,V){let q=r.endpointDefinitions[R],O=q?.onCacheEntryAdded;if(!O)return;let N={},M=new Promise(z=>{N.cacheEntryRemoved=z}),U=Promise.race([new Promise(z=>{N.valueResolved=z}),M.then(()=>{throw Zb})]);U.catch(()=>{}),v[E]=N;let Y=e.endpoints[R].select(q.type==="query"?I:E),H=P.dispatch((z,$,X)=>X),B={...P,getCacheEntry:()=>Y(P.getState()),requestId:V,extra:H,updateCachedData:q.type==="query"?z=>P.dispatch(e.util.updateQueryData(R,I,z)):void 0,cacheDataLoaded:U,cacheEntryRemoved:M},Q=O(I,B);Promise.resolve(Q).catch(z=>{if(z!==Zb)throw z})}return S},rq=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},nq=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=i.internalActions,h=_r(Sn(n),oc(n)),v=_r(Sn(n,o),ko(n,o)),C=[],g=(w,R)=>{h(w)?x(sx(w,"invalidatesTags",r,a),R):v(w)?x([],R):i.util.invalidateTags.match(w)&&x(ty(w.payload,void 0,void 0,void 0,void 0,a),R)};function S(w){let{queries:R,mutations:I}=w;for(let E of[R,I])for(let P in E)if(E[P]?.status==="pending")return!0;return!1}function x(w,R){let I=R.getState(),E=I[e];if(C.push(...w),E.config.invalidationBehavior==="delayed"&&S(E))return;let P=C;if(C=[],P.length===0)return;let V=i.util.selectInvalidatedBy(I,P);t.batch(()=>{let q=Array.from(V.values());for(let{queryCacheKey:O}of q){let N=E.queries[O],M=f.currentSubscriptions[O]??{};N&&(Ca(M)===0?R.dispatch(m({queryCacheKey:O})):N.status!=="uninitialized"&&R.dispatch(p(N)))}})}return g},oq=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,S)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&m(g.payload,S),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&m(g.meta.arg,S),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&f(g.meta.arg,S),r.util.resetApiState.match(g)&&v()};function p(g,S){let w=S.getState()[e].queries[g],R=o.currentSubscriptions[g];if(!(!w||w.status==="uninitialized"))return R}function f({queryCacheKey:g},S){let x=S.getState()[e],w=x.queries[g],R=o.currentSubscriptions[g];if(!w||w.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:E}=C(R);if(!Number.isFinite(I))return;let P=i[g];P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);let V=Date.now()+I;i[g]={nextPollTimestamp:V,pollingInterval:I,timeout:setTimeout(()=>{(x.config.focused||!E)&&S.dispatch(n(w)),f({queryCacheKey:g},S)},I)}}function m({queryCacheKey:g},S){let w=S.getState()[e].queries[g],R=o.currentSubscriptions[g];if(!w||w.status==="uninitialized")return;let{lowestPollingInterval:I}=C(R);if(!Number.isFinite(I)){h(g);return}let E=i[g],P=Date.now()+I;(!E||P<E.nextPollTimestamp)&&f({queryCacheKey:g},S)}function h(g){let S=i[g];S?.timeout&&clearTimeout(S.timeout),delete i[g]}function v(){for(let g of Object.keys(i))h(g)}function C(g={}){let S=!1,x=Number.POSITIVE_INFINITY;for(let w in g)g[w].pollingInterval&&(x=Math.min(g[w].pollingInterval,x),S=g[w].skipPollingIfUnfocused||S);return{lowestPollingInterval:x,skipPollingIfUnfocused:S}}return a},iq=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Nu(r,n),i=ko(r,n),a=Sn(r,n),p={};return(m,h)=>{if(o(m)){let{requestId:v,arg:{endpointName:C,originalArgs:g}}=m.meta,S=t.endpointDefinitions[C],x=S?.onQueryStarted;if(x){let w={},R=new Promise((V,q)=>{w.resolve=V,w.reject=q});R.catch(()=>{}),p[v]=w;let I=e.endpoints[C].select(S.type==="query"?g:v),E=h.dispatch((V,q,O)=>O),P={...h,getCacheEntry:()=>I(h.getState()),requestId:v,extra:E,updateCachedData:S.type==="query"?V=>h.dispatch(e.util.updateQueryData(C,g,V)):void 0,queryFulfilled:R};x(g,P)}}else if(a(m)){let{requestId:v,baseQueryMeta:C}=m.meta;p[v]?.resolve({data:m.payload,meta:C}),delete p[v]}else if(i(m)){let{requestId:v,rejectedWithValue:C,baseQueryMeta:g}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!C,meta:g}),delete p[v]}}},aq=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,m)=>{Jh.match(f)&&p(m,"refetchOnFocus"),Xh.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let h=f.getState()[e],v=h.queries,C=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(C)){let S=v[g],x=C[g];if(!x||!S)continue;(Object.values(x).some(R=>R[m]===!0)||Object.values(x).every(R=>R[m]===void 0)&&h.config[m])&&(Ca(x)===0?f.dispatch(i({queryCacheKey:g})):S.status!=="uninitialized"&&f.dispatch(n(S)))}})}return a};function sq(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},p=v=>v.type.startsWith(`${t}/`),f=[rq,eq,nq,oq,tq,iq];return{middleware:v=>{let C=!1,S={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:p},x=f.map(I=>I(S)),w=J0(S),R=aq(S);return I=>E=>{if(!Vi(E))return I(E);C||(C=!0,v.dispatch(n.internalActions.middlewareRegistered(i)));let P={...v,next:I},V=v.getState(),[q,O]=w(E,P,V),N;if(q?N=I(E):N=O,v.getState()[t]&&(R(E,P,V),p(E)||o.hasRehydrationInfo(E)))for(let M of x)M(E,P,V);return N}},actions:a};function h(v){return e.api.endpoints[v.endpointName].initiate(v.originalArgs,{subscribe:!1,forceRefetch:!0})}}var ex=Symbol(),cq=({createSelector:e=ot}={})=>({name:ex,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:h},v){Hv();let C=be=>(typeof process<"u",be);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Xh,onOffline:ix,onFocus:Jh,onFocusLost:ox},util:{}});let g=Y0({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:S,selectCachedArgsForQuery:x,buildQuerySelector:w,buildInfiniteQuerySelector:R,buildMutationSelector:I}=g;Cn(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:x});let{queryThunk:E,infiniteQueryThunk:P,mutationThunk:V,patchQueryData:q,updateQueryData:O,upsertQueryData:N,prefetch:M,buildMatchThunkActions:U}=z0({baseQuery:r,reducerPath:o,context:v,api:t,serializeQueryArgs:i,assertTagType:C,selectors:g}),{reducer:Y,actions:H}=W0({context:v,queryThunk:E,infiniteQueryThunk:P,mutationThunk:V,serializeQueryArgs:i,reducerPath:o,assertTagType:C,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});Cn(t.util,{patchQueryData:q,updateQueryData:O,upsertQueryData:N,prefetch:M,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),Cn(t.internalActions,H);let{middleware:B,actions:Q}=sq({reducerPath:o,context:v,queryThunk:E,mutationThunk:V,infiniteQueryThunk:P,api:t,assertTagType:C,selectors:g});Cn(t.util,Q),Cn(t,{reducer:Y,middleware:B});let{buildInitiateQuery:z,buildInitiateInfiniteQuery:$,buildInitiateMutation:X,getRunningMutationThunk:ee,getRunningMutationsThunk:pe,getRunningQueriesThunk:Re,getRunningQueryThunk:_e}=$0({queryThunk:E,mutationThunk:V,infiniteQueryThunk:P,api:t,serializeQueryArgs:i,context:v});return Cn(t.util,{getRunningMutationThunk:ee,getRunningMutationsThunk:pe,getRunningQueryThunk:_e,getRunningQueriesThunk:Re}),{name:ex,injectEndpoint(be,we){var ut;let Te=(ut=t.endpoints)[be]??(ut[be]={});Zh(we)&&Cn(Te,{name:be,select:w(be,we),initiate:z(be,we)},U(E,be)),Q0(we)&&Cn(Te,{name:be,select:I(),initiate:X(be)},U(V,be)),ey(we)&&Cn(Te,{name:be,select:R(be,we),initiate:$(be,we)},U(E,be))}}}}),ux=K0(cq());d();c();l();u();d();c();l();u();var Lo=e=>e.query,lx=e=>e.query?.enableQuerySyntax;var dx=ot(e=>Lo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),Xl=ot(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var Rc=e=>{if(e==="yes")return!0;if(e==="no")return!1};var xa=e=>$e({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ve(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ve(t)??"",answerGenerated:e??!1})}),Ra=()=>$e({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});var px=()=>({actionCause:"retryGeneratedAnswer"});d();c();l();u();d();c();l();u();var fx=ot(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var mx=e=>e.context;d();c();l();u();var ry=e=>e.pipeline;d();c();l();u();var ny=e=>e.searchHub;d();c();l();u();var Qt=ot(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),Dne=ot(e=>e,e=>{let t=Qt(e);return t&&e?e[t].expression:""});d();c();l();u();var gx=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var hx=e=>e.excerptLength?.length;d();c();l();u();var Gr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,yx=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var Sx=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var vx=e=>e.sortCriteria;var Ax=/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Ax(_x173){return _ref61.apply(this,arguments)}}(),Cx=(e,t)=>{let r=Lo(e)?.q,{aq:n,cq:o,dq:i,lq:a}=lq(e),p=mx(e),f=jo(e.configuration.analytics,t,{actionCause:$h(e)}),m=ny(e),h=ry(e),v=ah(e)??[],C=xx(e),g=Qt(e.tabSet)||"default",S=oh(e),x=yC(e),w=t.referrer||"",R=yx(e),I=vx(e),E=uq(e),P=hx(e),V=Sx(e),q=gx(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:lx(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(h?.length&&{pipeline:h}),...(C.length&&{facets:C}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Lh(e),firstResult:e.pagination.firstResult}),tab:g,locale:S,timezone:x,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(V??{}),...(P&&{excerptLength:P}),...(q&&{dictionaryFieldContext:q}),sortCriteria:I,...(R&&{facetOptions:R}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},bx=(e,t)=>{let r=Lo(e)?.q,n=xx(e),o=jo(e.configuration.analytics,t,{actionCause:$h(e)}),i=oh(e),a=ny(e),p=ry(e),f=ah(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(a?.length&&{searchHub:a}),...(p?.length&&{pipeline:p}),...o,locale:i}},xx=e=>Ql(e)?.map(t=>Rh(t,xh())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),uq=e=>({actionsHistory:e.configuration.analytics.enabled?Nt.getInstance().getHistory():[]}),lq=e=>{let t=fx(e),r=Uh(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var wa=["searching","thinking","answering"];function oy(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var Rx=["text/plain","text/markdown"];var Ia=new L({required:!0}),wx=new L,Ea=new ue({required:!0}),iy={id:Ia,title:Ia,uri:Ia,permanentid:Ia,clickUri:wx},Zl=new L({required:!0,constrainTo:Rx}),Fa=T("generatedAnswer/setIsVisible",e=>_(e,Ea)),Ta=T("generatedAnswer/setAnswerId",e=>_(e,G)),ed=T("generatedAnswer/setAnswerGenerationMode",e=>_(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),wc=T("generatedAnswer/setIsEnabled",e=>_(e,Ea)),Qo=T("generatedAnswer/updateMessage",e=>_(e,{textDelta:Ia})),Bo=T("generatedAnswer/updateCitations",e=>_(e,{citations:new re({required:!0,each:new W({values:iy})})})),Go=T("generatedAnswer/updateError",e=>_(e,{message:wx,code:new ne({min:0})})),ar=T("generatedAnswer/resetAnswer"),td=T("generatedAnswer/like"),rd=T("generatedAnswer/dislike"),nd=T("generatedAnswer/feedbackModal/open"),Ic=T("generatedAnswer/expand"),od=T("generatedAnswer/collapse"),id=T("generatedAnswer/setId",e=>_(e,{id:new L({required:!0})})),ad=T("generatedAnswer/feedbackModal/close"),Pa=T("generatedAnswer/sendFeedback"),$r=T("generatedAnswer/setIsLoading",e=>_(e,Ea)),Uo=T("generatedAnswer/setIsStreaming",e=>_(e,Ea)),$o=T("generatedAnswer/setAnswerContentFormat",e=>_(e,Zl)),sd=T("generatedAnswer/updateResponseFormat",e=>_(e,{contentFormat:new re({each:Zl,default:["text/plain"]})})),cd=T("knowledge/updateAnswerConfigurationId",e=>_(e,Ia)),ud=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>_(e,Cu)),Ec=T("generatedAnswer/setIsAnswerGenerated",e=>_(e,Ea)),Ho=T("generatedAnswer/setCannotAnswer",e=>_(e,Ea)),ay=T("generatedAnswer/setAnswerApiQueryParams",e=>_(e,new W({}))),ld=T("generatedAnswer/startStep",e=>_(e,{name:new L({required:!0,constrainTo:wa}),startedAt:new ne({min:0,required:!0})})),dd=T("generatedAnswer/finishStep",e=>_(e,{name:new L({required:!0,constrainTo:wa}),finishedAt:new ne({min:0,required:!0})})),Ix=le("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:p}=a,{setAbortControllerRef:f}=e,m=yield Ax(r),h=(g,S)=>{switch(g){case"genqa.headerMessageType":{let x=JSON.parse(S);n($o(x.contentFormat));break}case"genqa.messageType":n(Qo(JSON.parse(S)));break;case"genqa.citationsType":n(Bo(JSON.parse(S)));break;case"genqa.endOfStreamType":{let x=JSON.parse(S).answerGenerated,w=p.length!==0&&!x;n(Ho(w)),n(Uo(!1)),n(Ec(x)),n(xa(x)),n(Ra());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n($r(!0));let v=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,C=o.streamingClient?.streamGeneratedAnswer(m,{write:g=>{v(m)&&(n($r(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{v(m)&&n(Go(g))},close:()=>{v(m)&&n(Uo(!1))},resetAnswer:()=>{v(m)&&n(ar())}});C?f(C):n($r(!1))});return function(_x174,_x175){return _ref62.apply(this,arguments)}}()),pd=le("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(ar());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=Cx(i,n);r(ay(a)),yield r(fd(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x176,_x177){return _ref63.apply(this,arguments)}}());d();c();l();u();var dq=/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=We(a,i);return{data:rx({baseUrl:`${m}/rest/organizations/${a}/answer/v1/configs/${p}`,fetchFn:function(){var _ref65=_asyncToGenerator(function*(v){if(v instanceof String)throw new Error("The provided 'request' must be a Request object.");let C=v.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(S=>{g[S]=v[S]}),g.duplex="half",g.body=yield v.text(),A(C,g)});return function fetchFn(_x181){return _ref65.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function dq(_x178,_x179,_x180){return _ref64.apply(this,arguments)}}(),md=ux({reducerPath:"answer",baseQuery:nx(dq,{maxRetries:3}),endpoints:()=>({})});var pq=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},fq=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},mq=(e,t)=>{e.citations=t.citations},gq=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},hq=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},yq=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&hq(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(pq(t,o),r($o(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(fq(t,o),r(Qo({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(mq(t,o),r(Bo({citations:o.citations})));break;case"genqa.endOfStreamType":gq(t,o),r(xa(o.answerGenerated??!1)),r(Ra());break}},Sq=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},zo=md.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x182,_x183){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:h,accessToken:v}=a,C=We(m,h),g=Sq(C,m,p.answerConfigurationId,f?.insightId);yield gu(g,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref66=_asyncToGenerator(function*(S){let x=S.headers.get("x-answer-id");x&&o(w=>{w.answerId=x,i(Ta(x))})});return function onopen(_x184){return _ref66.apply(this,arguments)}}(),onmessage:S=>{o(x=>{yq(S,x,i)})},onerror:S=>{throw S},onclose:()=>{o(S=>{i(Ho(!S.generated))})}})}).apply(this,arguments)}})})}),fd=e=>zo.endpoints.getAnswer.initiate(e),sy=e=>{let t=Xl(e);return zo.endpoints.getAnswer.select(t??Vo)(e)};d();c();l();u();var Ex=ce(qn,e=>e);d();c();l();u();function vq(e){let t=e.payload?.analyticsAction;return Fx(e)&&!te(t)}function Fx(e){return"type"in e}var Tx=e=>t=>r=>{let n;vq(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Fx(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var gd={q:new L,enableQuerySyntax:new ue,aq:new L,cq:new L,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new L,f:new W,fExcluded:new W,cf:new W,nf:new W,mnf:new W,df:new W,debug:new ue,sf:new W,tab:new L,af:new W};var tt=T("searchParameters/restore",e=>_(e,gd)),hd=T("searchParameters/restoreTab",e=>_(e,G));d();c();l();u();var yd=T("tab/register",e=>{let t=new W({values:{id:G,expression:Ye}});return _(e,t)}),Tt=T("tab/updateActiveTab",e=>_(e,G));d();c();l();u();var Sd=Cr(hl(),1),Ox=Cr(Px(),1),_x=Cr(kx(),1);Sd.default.extend(_x.default);Sd.default.extend(Ox.default);var vd=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Sd.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var Aq=/(^|; )Coveo-Pendragon=([^;]*)/;function py(){return typeof window>"u"?!1:Aq.exec(document.cookie)?.pop()||null}var Ad=ce(vd(),e=>e.addCase(ca,(t,r)=>{Cq(t,r.payload)}).addCase(ua,(t,r)=>{bq(t,r.payload)}).addCase(ll,(t,r)=>{xq(t,r.payload)}).addCase(dl,t=>{t.analytics.enabled=!1}).addCase(pl,t=>{t.analytics.enabled=!0}).addCase(LC,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(UC,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Tt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(hd,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(tt,(t,r)=>{te(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(QC,(t,{payload:r})=>{t.knowledge.agentId=r}));function Cq(e,t){te(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",te(t.organizationId)||(e.organizationId=t.organizationId)}function bq(e,t){te(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),te(t.locale)||(e.search.locale=t.locale),te(t.timezone)||(e.search.timezone=t.timezone),te(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function xq(e,t){te(t.enabled)||(e.analytics.enabled=t.enabled),te(t.originContext)||(e.analytics.originContext=t.originContext),te(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),te(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),te(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),te(t.trackingId)||(e.analytics.trackingId=t.trackingId),te(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),te(t.source)||(e.analytics.source=t.source);try{let r=py();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}te(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),te(t.anonymous)||(e.analytics.anonymous=t.anonymous),te(t.deviceId)||(e.analytics.deviceId=t.deviceId),te(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),te(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ve=Ad;d();c();l();u();function Rq(e){return e.instantlyCallable}var Nx=()=>e=>t=>e(Rq(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function qx(e,t=0){return(Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]).toLowerCase()}d();c();l();u();var fy,wq=new Uint8Array(16);function my(){if(!fy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");fy=crypto.getRandomValues.bind(crypto)}return fy(wq)}d();c();l();u();d();c();l();u();var Iq=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gy={randomUUID:Iq};function Eq(e,t,r){if(gy.randomUUID&&!t&&!e)return gy.randomUUID();e=e||{};let n=e.random??e.rng?.()??my();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return qx(n)}var Xn=Eq;d();c();l();u();d();c();l();u();var F={};Ms(F,{BRAND:()=>Zq,DIRTY:()=>Wo,EMPTY_PATH:()=>kq,INVALID:()=>ye,NEVER:()=>MD,OK:()=>qt,ParseStatus:()=>kt,Schema:()=>Pe,ZodAny:()=>to,ZodArray:()=>wn,ZodBigInt:()=>Ko,ZodBoolean:()=>Jo,ZodBranded:()=>Tc,ZodCatch:()=>ci,ZodDate:()=>Xo,ZodDefault:()=>si,ZodDiscriminatedUnion:()=>xd,ZodEffects:()=>yr,ZodEnum:()=>ii,ZodError:()=>Jt,ZodFirstPartyTypeKind:()=>Ae,ZodFunction:()=>wd,ZodIntersection:()=>ri,ZodIssueCode:()=>K,ZodLazy:()=>ni,ZodLiteral:()=>oi,ZodMap:()=>Da,ZodNaN:()=>ja,ZodNativeEnum:()=>ai,ZodNever:()=>wr,ZodNull:()=>ei,ZodNullable:()=>Wr,ZodNumber:()=>Yo,ZodObject:()=>Xt,ZodOptional:()=>gr,ZodParsedType:()=>ae,ZodPipeline:()=>Pc,ZodPromise:()=>ro,ZodReadonly:()=>ui,ZodRecord:()=>Rd,ZodSchema:()=>Pe,ZodSet:()=>Ma,ZodString:()=>eo,ZodSymbol:()=>Na,ZodTransformer:()=>yr,ZodTuple:()=>zr,ZodType:()=>Pe,ZodUndefined:()=>Zo,ZodUnion:()=>ti,ZodUnknown:()=>Rn,ZodVoid:()=>qa,addIssueToContext:()=>ie,any:()=>cD,array:()=>pD,bigint:()=>nD,boolean:()=>Hx,coerce:()=>DD,custom:()=>Bx,date:()=>oD,datetimeRegex:()=>Ux,defaultErrorMap:()=>bn,discriminatedUnion:()=>hD,effect:()=>FD,enum:()=>wD,function:()=>bD,getErrorMap:()=>ka,getParsedType:()=>Hr,instanceof:()=>tD,intersection:()=>yD,isAborted:()=>Cd,isAsync:()=>Oa,isDirty:()=>bd,isValid:()=>Zn,late:()=>eD,lazy:()=>xD,literal:()=>RD,makeIssue:()=>Fc,map:()=>AD,nan:()=>rD,nativeEnum:()=>ID,never:()=>lD,null:()=>sD,nullable:()=>PD,number:()=>$x,object:()=>fD,objectUtil:()=>hy,oboolean:()=>qD,onumber:()=>ND,optional:()=>TD,ostring:()=>_D,pipeline:()=>OD,preprocess:()=>kD,promise:()=>ED,quotelessJson:()=>Fq,record:()=>vD,set:()=>CD,setErrorMap:()=>Pq,strictObject:()=>mD,string:()=>Gx,symbol:()=>iD,transformer:()=>FD,tuple:()=>SD,undefined:()=>aD,union:()=>gD,unknown:()=>uD,util:()=>Ne,void:()=>dD});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ne;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),a={};for(let p of i)a[p]=o[p];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ne||(Ne={}));var hy;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(hy||(hy={}));var ae=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hr=e=>{switch(typeof e){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return Number.isNaN(e)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(e)?ae.array:e===null?ae.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ae.promise:typeof Map<"u"&&e instanceof Map?ae.map:typeof Set<"u"&&e instanceof Set?ae.set:typeof Date<"u"&&e instanceof Date?ae.date:ae.object;default:return ae.unknown}};var K=Ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Fq=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Jt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let p=n,f=0;for(;f<a.path.length;){let m=a.path[f];f===a.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(a))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Jt.create=e=>new Jt(e);var Tq=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===ae.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ne.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ne.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case K.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ne.assertNever(e)}return{message:r}},bn=Tq;var Dx=bn;function Pq(e){Dx=e}function ka(){return Dx}d();c();l();u();var Fc=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(a,{data:t,defaultError:p}).message;return{...o,path:i,message:p}},kq=[];function ie(e,t){let r=ka(),n=Fc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===bn?void 0:bn].filter(o=>!!o)});e.common.issues.push(n)}var kt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return ye;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return ye;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},ye=Object.freeze({status:"aborted"}),Wo=e=>({status:"dirty",value:e}),qt=e=>({status:"valid",value:e}),Cd=e=>e.status==="aborted",bd=e=>e.status==="dirty",Zn=e=>e.status==="valid",Oa=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var hr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Mx=(e,t)=>{if(Zn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Jt(e.common.issues);return this._error=r,this._error}}};function Ie(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,p)=>{let{message:f}=e;return a.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:a.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Pe=class{get description(){return this._def.description}_getType(t){return Hr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Hr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new kt,ctx:{common:t.parent.common,data:t.data,parsedType:Hr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Oa(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Mx(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Zn(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Zn(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this31=this;return _asyncToGenerator(function*(){let n=yield _this31.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this32=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this32._def.errorMap,parent:null,data:t,parsedType:Hr(t)},o=_this32._parse({data:t,path:n.path,parent:n}),i=yield Oa(o)?o:Promise.resolve(o);return Mx(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),p=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(f=>f?!0:(p(),!1)):a?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new yr({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return gr.create(this,this._def)}nullable(){return Wr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wn.create(this)}promise(){return ro.create(this,this._def)}or(t){return ti.create([this,t],this._def)}and(t){return ri.create(this,t,this._def)}transform(t){return new yr({...Ie(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new si({...Ie(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new Tc({typeName:Ae.ZodBranded,type:this,...Ie(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new ci({...Ie(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Pc.create(this,t)}readonly(){return ui.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Oq=/^c[^\s-]{8,}$/i,_q=/^[0-9a-z]+$/,Nq=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dq=/^[a-z0-9_-]{21}$/i,Mq=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jq=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Lq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yy,Uq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Bq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Gq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Hq=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vx="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zq=new RegExp(`^${Vx}$`);function Lx(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Wq(e){return new RegExp(`^${Lx(e)}$`)}function Ux(e){let t=`${Vx}T${Lx(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Yq(e,t){return!!((t==="v4"||!t)&&Uq.test(e)||(t==="v6"||!t)&&Bq.test(e))}function Kq(e,t){if(!Mq.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Jq(e,t){return!!((t==="v4"||!t)&&Qq.test(e)||(t==="v6"||!t)&&Gq.test(e))}var eo=class e extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ae.string){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_type,expected:ae.string,received:i.parsedType}),ye}let n=new kt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,p=t.data.length<i.value;(a||p)&&(o=this._getOrReturnCtx(t,o),a?ie(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):p&&ie(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Vq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")yy||(yy=new RegExp(Lq,"u")),yy.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")qq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Dq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Oq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")_q.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Nq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ie(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Ux(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?zq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Wq(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?jq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Yq(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Kq(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Jq(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?$q.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?Hq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):Ne.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...de.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...de.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...de.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};eo.create=e=>new eo({checks:[],typeName:Ae.ZodString,coerce:e?.coerce??!1,...Ie(e)});function Xq(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var Yo=class e extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ae.number){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_type,expected:ae.number,received:i.parsedType}),ye}let n,o=new kt;for(let i of this._def.checks)i.kind==="int"?Ne.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Xq(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:K.not_finite,message:i.message}),o.dirty()):Ne.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ne.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Yo.create=e=>new Yo({checks:[],typeName:Ae.ZodNumber,coerce:e?.coerce||!1,...Ie(e)});var Ko=class e extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ae.bigint)return this._getInvalidInput(t);let n,o=new kt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ne.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ie(r,{code:K.invalid_type,expected:ae.bigint,received:r.parsedType}),ye}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ko.create=e=>new Ko({checks:[],typeName:Ae.ZodBigInt,coerce:e?.coerce??!1,...Ie(e)});var Jo=class extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ae.boolean){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.boolean,received:n.parsedType}),ye}return qt(t.data)}};Jo.create=e=>new Jo({typeName:Ae.ZodBoolean,coerce:e?.coerce||!1,...Ie(e)});var Xo=class e extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ae.date){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_type,expected:ae.date,received:i.parsedType}),ye}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_date}),ye}let n=new kt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ne.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Xo.create=e=>new Xo({checks:[],coerce:e?.coerce||!1,typeName:Ae.ZodDate,...Ie(e)});var Na=class extends Pe{_parse(t){if(this._getType(t)!==ae.symbol){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.symbol,received:n.parsedType}),ye}return qt(t.data)}};Na.create=e=>new Na({typeName:Ae.ZodSymbol,...Ie(e)});var Zo=class extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.undefined,received:n.parsedType}),ye}return qt(t.data)}};Zo.create=e=>new Zo({typeName:Ae.ZodUndefined,...Ie(e)});var ei=class extends Pe{_parse(t){if(this._getType(t)!==ae.null){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.null,received:n.parsedType}),ye}return qt(t.data)}};ei.create=e=>new ei({typeName:Ae.ZodNull,...Ie(e)});var to=class extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return qt(t.data)}};to.create=e=>new to({typeName:Ae.ZodAny,...Ie(e)});var Rn=class extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qt(t.data)}};Rn.create=e=>new Rn({typeName:Ae.ZodUnknown,...Ie(e)});var wr=class extends Pe{_parse(t){let r=this._getOrReturnCtx(t);return ie(r,{code:K.invalid_type,expected:ae.never,received:r.parsedType}),ye}};wr.create=e=>new wr({typeName:Ae.ZodNever,...Ie(e)});var qa=class extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.void,received:n.parsedType}),ye}return qt(t.data)}};qa.create=e=>new qa({typeName:Ae.ZodVoid,...Ie(e)});var wn=class e extends Pe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ae.array)return ie(r,{code:K.invalid_type,expected:ae.array,received:r.parsedType}),ye;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(a||p)&&(ie(r,{code:a?K.too_big:K.too_small,minimum:p?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ie(r,{code:K.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ie(r,{code:K.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,p)=>o.type._parseAsync(new hr(r,a,r.path,p)))).then(a=>kt.mergeArray(n,a));let i=[...r.data].map((a,p)=>o.type._parseSync(new hr(r,a,r.path,p)));return kt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}};wn.create=(e,t)=>new wn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Ie(t)});function _a(e){if(e instanceof Xt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=gr.create(_a(n))}return new Xt({...e._def,shape:()=>t})}else return e instanceof wn?new wn({...e._def,type:_a(e.element)}):e instanceof gr?gr.create(_a(e.unwrap())):e instanceof Wr?Wr.create(_a(e.unwrap())):e instanceof zr?zr.create(e.items.map(t=>_a(t))):e}var Xt=class e extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ne.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ae.object){let m=this._getOrReturnCtx(t);return ie(m,{code:K.invalid_type,expected:ae.object,received:m.parsedType}),ye}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),p=[];if(!(this._def.catchall instanceof wr&&this._def.unknownKeys==="strip"))for(let m in o.data)a.includes(m)||p.push(m);let f=[];for(let m of a){let h=i[m],v=o.data[m];f.push({key:{status:"valid",value:m},value:h._parse(new hr(o,v,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof wr){let m=this._def.unknownKeys;if(m==="passthrough")for(let h of p)f.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(m==="strict")p.length>0&&(ie(o,{code:K.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let h of p){let v=o.data[h];f.push({key:{status:"valid",value:h},value:m._parse(new hr(o,v,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let h of f){let v=yield h.key,C=yield h.value;m.push({key:v,value:C,alwaysSet:h.alwaysSet})}return m})).then(m=>kt.mergeObjectSync(n,m)):kt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:de.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Ne.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Ne.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return _a(this)}partial(t){let r={};for(let n of Ne.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Ne.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof gr;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Qx(Ne.objectKeys(this.shape))}};Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:wr.create(),typeName:Ae.ZodObject,...Ie(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:wr.create(),typeName:Ae.ZodObject,...Ie(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:wr.create(),typeName:Ae.ZodObject,...Ie(t)});var ti=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let p of i)if(p.result.status==="valid")return p.result;for(let p of i)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let a=i.map(p=>new Jt(p.ctx.common.issues));return ie(r,{code:K.invalid_union,unionErrors:a}),ye}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x185){return _ref68.apply(this,arguments)}}())).then(o);{let i,a=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},h=f._parseSync({data:r.data,path:r.path,parent:m});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:m}),m.common.issues.length&&a.push(m.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let p=a.map(f=>new Jt(f));return ie(r,{code:K.invalid_union,unionErrors:p}),ye}}get options(){return this._def.options}};ti.create=(e,t)=>new ti({options:e,typeName:Ae.ZodUnion,...Ie(t)});var xn=e=>e instanceof ni?xn(e.schema):e instanceof yr?xn(e.innerType()):e instanceof oi?[e.value]:e instanceof ii?e.options:e instanceof ai?Ne.objectValues(e.enum):e instanceof si?xn(e._def.innerType):e instanceof Zo?[void 0]:e instanceof ei?[null]:e instanceof gr?[void 0,...xn(e.unwrap())]:e instanceof Wr?[null,...xn(e.unwrap())]:e instanceof Tc||e instanceof ui?xn(e.unwrap()):e instanceof ci?xn(e._def.innerType):[],xd=class e extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.object)return ie(r,{code:K.invalid_type,expected:ae.object,received:r.parsedType}),ye;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=xn(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of a){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,i)}}return new e({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Ie(n)})}};function Sy(e,t){let r=Hr(e),n=Hr(t);if(e===t)return{valid:!0,data:e};if(r===ae.object&&n===ae.object){let o=Ne.objectKeys(t),i=Ne.objectKeys(e).filter(p=>o.indexOf(p)!==-1),a={...e,...t};for(let p of i){let f=Sy(e[p],t[p]);if(!f.valid)return{valid:!1};a[p]=f.data}return{valid:!0,data:a}}else if(r===ae.array&&n===ae.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],p=t[i],f=Sy(a,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===ae.date&&n===ae.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ri=class extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(Cd(i)||Cd(a))return ye;let p=Sy(i.value,a.value);return p.valid?((bd(i)||bd(a))&&r.dirty(),{status:r.value,value:p.data}):(ie(n,{code:K.invalid_intersection_types}),ye)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ri.create=(e,t,r)=>new ri({left:e,right:t,typeName:Ae.ZodIntersection,...Ie(r)});var zr=class e extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.array)return ie(n,{code:K.invalid_type,expected:ae.array,received:n.parsedType}),ye;if(n.data.length<this._def.items.length)return ie(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&n.data.length>this._def.items.length&&(ie(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new hr(n,a,n.path,p)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>kt.mergeArray(r,a)):kt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};zr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zr({items:e,typeName:Ae.ZodTuple,rest:null,...Ie(t)})};var Rd=class e extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.object)return ie(n,{code:K.invalid_type,expected:ae.object,received:n.parsedType}),ye;let o=[],i=this._def.keyType,a=this._def.valueType;for(let p in n.data)o.push({key:i._parse(new hr(n,p,n.path,p)),value:a._parse(new hr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?kt.mergeObjectAsync(r,o):kt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Pe?new e({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Ie(n)}):new e({keyType:eo.create(),valueType:t,typeName:Ae.ZodRecord,...Ie(r)})}},Da=class extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.map)return ie(n,{code:K.invalid_type,expected:ae.map,received:n.parsedType}),ye;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new hr(n,p,n.path,[m,"key"])),value:i._parse(new hr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of a){let m=yield f.key,h=yield f.value;if(m.status==="aborted"||h.status==="aborted")return ye;(m.status==="dirty"||h.status==="dirty")&&r.dirty(),p.set(m.value,h.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of a){let m=f.key,h=f.value;if(m.status==="aborted"||h.status==="aborted")return ye;(m.status==="dirty"||h.status==="dirty")&&r.dirty(),p.set(m.value,h.value)}return{status:r.value,value:p}}}};Da.create=(e,t,r)=>new Da({valueType:t,keyType:e,typeName:Ae.ZodMap,...Ie(r)});var Ma=class e extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.set)return ie(n,{code:K.invalid_type,expected:ae.set,received:n.parsedType}),ye;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ie(n,{code:K.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ie(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(f){let m=new Set;for(let h of f){if(h.status==="aborted")return ye;h.status==="dirty"&&r.dirty(),m.add(h.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>i._parse(new hr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>a(f)):a(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ma.create=(e,t)=>new Ma({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Ie(t)});var wd=class e extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.function)return ie(r,{code:K.invalid_type,expected:ae.function,received:r.parsedType}),ye;function n(p,f){return Fc({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ka(),bn].filter(m=>!!m),issueData:{code:K.invalid_arguments,argumentsError:f}})}function o(p,f){return Fc({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ka(),bn].filter(m=>!!m),issueData:{code:K.invalid_return_type,returnTypeError:f}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof ro){let p=this;return qt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new Jt([]),h=yield p._def.args.parseAsync(f,i).catch(g=>{throw m.addIssue(n(f,g)),m}),v=yield Reflect.apply(a,this,h);return yield p._def.returns._def.type.parseAsync(v,i).catch(g=>{throw m.addIssue(o(v,g)),m})}))}else{let p=this;return qt(function(...f){let m=p._def.args.safeParse(f,i);if(!m.success)throw new Jt([n(f,m.error)]);let h=Reflect.apply(a,this,m.data),v=p._def.returns.safeParse(h,i);if(!v.success)throw new Jt([o(h,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:zr.create(t).rest(Rn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||zr.create([]).rest(Rn.create()),returns:r||Rn.create(),typeName:Ae.ZodFunction,...Ie(n)})}},ni=class extends Pe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ni.create=(e,t)=>new ni({getter:e,typeName:Ae.ZodLazy,...Ie(t)});var oi=class extends Pe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:t.data}}get value(){return this._def.value}};oi.create=(e,t)=>new oi({value:e,typeName:Ae.ZodLiteral,...Ie(t)});function Qx(e,t){return new ii({values:e,typeName:Ae.ZodEnum,...Ie(t)})}var ii=class e extends Pe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:Ne.joinValues(n),received:r.parsedType,code:K.invalid_type}),ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{received:r.data,code:K.invalid_enum_value,options:n}),ye}return qt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ii.create=Qx;var ai=class extends Pe{_parse(t){let r=Ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let o=Ne.objectValues(r);return ie(n,{expected:Ne.joinValues(o),received:n.parsedType,code:K.invalid_type}),ye}if(this._cache||(this._cache=new Set(Ne.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ne.objectValues(r);return ie(n,{received:n.data,code:K.invalid_enum_value,options:o}),ye}return qt(t.data)}get enum(){return this._def.values}};ai.create=(e,t)=>new ai({values:e,typeName:Ae.ZodNativeEnum,...Ie(t)});var ro=class extends Pe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.promise&&r.common.async===!1)return ie(r,{code:K.invalid_type,expected:ae.promise,received:r.parsedType}),ye;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return qt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ro.create=(e,t)=>new ro({type:e,typeName:Ae.ZodPromise,...Ie(t)});var yr=class extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this33=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ie(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(p){if(r.value==="aborted")return ye;let f=yield _this33._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?ye:f.status==="dirty"?Wo(f.value):r.value==="dirty"?Wo(f.value):f});return function(_x186){return _ref71.apply(this,arguments)}}());{if(r.value==="aborted")return ye;let p=this._def.schema._parseSync({data:a,path:n.path,parent:n});return p.status==="aborted"?ye:p.status==="dirty"?Wo(p.value):r.value==="dirty"?Wo(p.value):p}}if(o.type==="refinement"){let a=p=>{let f=o.refinement(p,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?ye:(p.status==="dirty"&&r.dirty(),a(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?ye:(p.status==="dirty"&&r.dirty(),a(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Zn(a))return ye;let p=o.transform(a.value,i);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Zn(a)?Promise.resolve(o.transform(a.value,i)).then(p=>({status:r.value,value:p})):ye);Ne.assertNever(o)}};yr.create=(e,t,r)=>new yr({schema:e,typeName:Ae.ZodEffects,effect:t,...Ie(r)});yr.createWithPreprocess=(e,t,r)=>new yr({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Ie(r)});var gr=class extends Pe{_parse(t){return this._getType(t)===ae.undefined?qt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};gr.create=(e,t)=>new gr({innerType:e,typeName:Ae.ZodOptional,...Ie(t)});var Wr=class extends Pe{_parse(t){return this._getType(t)===ae.null?qt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Wr.create=(e,t)=>new Wr({innerType:e,typeName:Ae.ZodNullable,...Ie(t)});var si=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};si.create=(e,t)=>new si({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ie(t)});var ci=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Oa(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ci.create=(e,t)=>new ci({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ie(t)});var ja=class extends Pe{_parse(t){if(this._getType(t)!==ae.nan){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.nan,received:n.parsedType}),ye}return{status:"valid",value:t.data}}};ja.create=e=>new ja({typeName:Ae.ZodNaN,...Ie(e)});var Zq=Symbol("zod_brand"),Tc=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Pc=class e extends Pe{_parse(t){var _this34=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this34._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ye:i.status==="dirty"?(r.dirty(),Wo(i.value)):_this34._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ye:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Ae.ZodPipeline})}},ui=class extends Pe{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Zn(o)&&(o.value=Object.freeze(o.value)),o);return Oa(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};ui.create=(e,t)=>new ui({innerType:e,typeName:Ae.ZodReadonly,...Ie(t)});function jx(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Bx(e,t={},r){return e?to.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let p=jx(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!i){let a=jx(t,n),p=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:p})}}):to.create()}var eD={object:Xt.lazycreate},Ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));var tD=(e,t={message:`Input not instance of ${e.name}`})=>Bx(r=>r instanceof e,t),Gx=eo.create,$x=Yo.create,rD=ja.create,nD=Ko.create,Hx=Jo.create,oD=Xo.create,iD=Na.create,aD=Zo.create,sD=ei.create,cD=to.create,uD=Rn.create,lD=wr.create,dD=qa.create,pD=wn.create,fD=Xt.create,mD=Xt.strictCreate,gD=ti.create,hD=xd.create,yD=ri.create,SD=zr.create,vD=Rd.create,AD=Da.create,CD=Ma.create,bD=wd.create,xD=ni.create,RD=oi.create,wD=ii.create,ID=ai.create,ED=ro.create,FD=yr.create,TD=gr.create,PD=Wr.create,kD=yr.createWithPreprocess,OD=Pc.create,_D=()=>Gx().optional(),ND=()=>$x().optional(),qD=()=>Hx().optional(),DD={string:e=>eo.create({...e,coerce:!0}),number:e=>Yo.create({...e,coerce:!0}),boolean:e=>Jo.create({...e,coerce:!0}),bigint:e=>Ko.create({...e,coerce:!0}),date:e=>Xo.create({...e,coerce:!0})};var MD=ye;var jD=F.object({name:F.string(),arguments:F.string()}),VD=F.object({id:F.string(),type:F.literal("function"),function:jD,encryptedValue:F.string().optional()}),Id=F.object({id:F.string(),role:F.string(),content:F.string().optional(),name:F.string().optional(),encryptedValue:F.string().optional()}),LD=F.object({type:F.literal("text"),text:F.string()}),zx=F.object({type:F.literal("binary"),mimeType:F.string(),id:F.string().optional(),url:F.string().optional(),data:F.string().optional(),filename:F.string().optional()}),Wx=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:F.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Oce=zx.superRefine((e,t)=>{Wx(e,t)}),UD=F.discriminatedUnion("type",[LD,zx]),QD=UD.superRefine((e,t)=>{e.type==="binary"&&Wx(e,t)}),BD=Id.extend({role:F.literal("developer"),content:F.string()}),GD=Id.extend({role:F.literal("system"),content:F.string()}),$D=Id.extend({role:F.literal("assistant"),content:F.string().optional(),toolCalls:F.array(VD).optional()}),HD=Id.extend({role:F.literal("user"),content:F.union([F.string(),F.array(QD)])}),zD=F.object({id:F.string(),content:F.string(),role:F.literal("tool"),toolCallId:F.string(),error:F.string().optional(),encryptedValue:F.string().optional()}),WD=F.object({id:F.string(),role:F.literal("activity"),activityType:F.string(),content:F.record(F.any())}),YD=F.object({id:F.string(),role:F.literal("reasoning"),content:F.string(),encryptedValue:F.string().optional()}),Yx=F.discriminatedUnion("role",[BD,GD,$D,HD,zD,WD,YD]),_ce=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user"),F.literal("tool"),F.literal("activity"),F.literal("reasoning")]),KD=F.object({description:F.string(),value:F.string()}),JD=F.object({name:F.string(),description:F.string(),parameters:F.any()}),XD=F.object({threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),state:F.any(),messages:F.array(Yx),tools:F.array(JD),context:F.array(KD),forwardedProps:F.any()}),ZD=F.any(),st=class extends Error{constructor(e){super(e)}},vy=class extends st{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},Kx=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user")]),D=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Le=F.object({type:F.nativeEnum(D),timestamp:F.number().optional(),rawEvent:F.any().optional()}).passthrough(),eM=Le.extend({type:F.literal(D.TEXT_MESSAGE_START),messageId:F.string(),role:Kx.default("assistant")}),Jx=Le.extend({type:F.literal(D.TEXT_MESSAGE_CONTENT),messageId:F.string(),delta:F.string().refine(e=>e.length>0,"Delta must not be an empty string")}),tM=Le.extend({type:F.literal(D.TEXT_MESSAGE_END),messageId:F.string()}),rM=Le.extend({type:F.literal(D.TEXT_MESSAGE_CHUNK),messageId:F.string().optional(),role:Kx.optional(),delta:F.string().optional()}),nM=Le.extend({type:F.literal(D.THINKING_TEXT_MESSAGE_START)}),oM=Jx.omit({messageId:!0,type:!0}).extend({type:F.literal(D.THINKING_TEXT_MESSAGE_CONTENT)}),iM=Le.extend({type:F.literal(D.THINKING_TEXT_MESSAGE_END)}),aM=Le.extend({type:F.literal(D.TOOL_CALL_START),toolCallId:F.string(),toolCallName:F.string(),parentMessageId:F.string().optional()}),sM=Le.extend({type:F.literal(D.TOOL_CALL_ARGS),toolCallId:F.string(),delta:F.string()}),cM=Le.extend({type:F.literal(D.TOOL_CALL_END),toolCallId:F.string()}),uM=Le.extend({messageId:F.string(),type:F.literal(D.TOOL_CALL_RESULT),toolCallId:F.string(),content:F.string(),role:F.literal("tool").optional()}),lM=Le.extend({type:F.literal(D.TOOL_CALL_CHUNK),toolCallId:F.string().optional(),toolCallName:F.string().optional(),parentMessageId:F.string().optional(),delta:F.string().optional()}),dM=Le.extend({type:F.literal(D.THINKING_START),title:F.string().optional()}),pM=Le.extend({type:F.literal(D.THINKING_END)}),fM=Le.extend({type:F.literal(D.STATE_SNAPSHOT),snapshot:ZD}),mM=Le.extend({type:F.literal(D.STATE_DELTA),delta:F.array(F.any())}),gM=Le.extend({type:F.literal(D.MESSAGES_SNAPSHOT),messages:F.array(Yx)}),hM=Le.extend({type:F.literal(D.ACTIVITY_SNAPSHOT),messageId:F.string(),activityType:F.string(),content:F.record(F.any()),replace:F.boolean().optional().default(!0)}),yM=Le.extend({type:F.literal(D.ACTIVITY_DELTA),messageId:F.string(),activityType:F.string(),patch:F.array(F.any())}),SM=Le.extend({type:F.literal(D.RAW),event:F.any(),source:F.string().optional()}),vM=Le.extend({type:F.literal(D.CUSTOM),name:F.string(),value:F.any()}),AM=Le.extend({type:F.literal(D.RUN_STARTED),threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),input:XD.optional()}),CM=Le.extend({type:F.literal(D.RUN_FINISHED),threadId:F.string(),runId:F.string(),result:F.any().optional()}),bM=Le.extend({type:F.literal(D.RUN_ERROR),message:F.string(),code:F.string().optional()}),xM=Le.extend({type:F.literal(D.STEP_STARTED),stepName:F.string()}),RM=Le.extend({type:F.literal(D.STEP_FINISHED),stepName:F.string()}),wM=F.union([F.literal("tool-call"),F.literal("message")]),IM=Le.extend({type:F.literal(D.REASONING_START),messageId:F.string()}),EM=Le.extend({type:F.literal(D.REASONING_MESSAGE_START),messageId:F.string(),role:F.literal("reasoning")}),FM=Le.extend({type:F.literal(D.REASONING_MESSAGE_CONTENT),messageId:F.string(),delta:F.string().refine(e=>e.length>0,"Delta must not be an empty string")}),TM=Le.extend({type:F.literal(D.REASONING_MESSAGE_END),messageId:F.string()}),PM=Le.extend({type:F.literal(D.REASONING_MESSAGE_CHUNK),messageId:F.string().optional(),delta:F.string().optional()}),kM=Le.extend({type:F.literal(D.REASONING_END),messageId:F.string()}),OM=Le.extend({type:F.literal(D.REASONING_ENCRYPTED_VALUE),subtype:wM,entityId:F.string(),encryptedValue:F.string()}),Ed=F.discriminatedUnion("type",[eM,Jx,tM,rM,dM,pM,nM,oM,iM,aM,sM,cM,lM,uM,fM,mM,gM,hM,yM,SM,vM,AM,CM,bM,xM,RM,IM,EM,FM,TM,PM,kM,OM]);d();c();l();u();var Ay={};Ms(Ay,{JsonPatchError:()=>lt,_areEquals:()=>_c,applyOperation:()=>li,applyPatch:()=>no,applyReducer:()=>MM,deepClone:()=>qM,getValueByPointer:()=>Od,validate:()=>Zx,validator:()=>_d});d();c();l();u();d();c();l();u();var _M=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),NM=Object.prototype.hasOwnProperty;function Td(e,t){return NM.call(e,t)}function Pd(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Td(e,o)&&n.push(o);return n}function Ot(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function kd(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Yr(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function kc(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Fd(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Fd(e[t]))return!0}else if(typeof e=="object"){for(var n=Pd(e),o=n.length,i=0;i<o;i++)if(Fd(e[n[i]]))return!0}}return!1}function Xx(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
|
|
32
|
-
`)}var Oc=function(e){_M(t,e);function t(r,n,o,i,a){var p=this.constructor,f=e.call(this,Xx(r,{name:n,index:o,operation:i,tree:a}))||this;return f.name=n,f.index=o,f.operation=i,f.tree=a,Object.setPrototypeOf(f,p.prototype),f.message=Xx(r,{name:n,index:o,operation:i,tree:a}),f}return t}(Error);var lt=Oc,qM=Ot,Va={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Od(r,this.path);n&&(n=Ot(n));var o=li(r,{op:"remove",path:this.from}).removed;return li(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Od(r,this.from);return li(r,{op:"add",path:this.path,value:Ot(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:_c(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},DM={add:function(e,t,r){return kd(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Va.move,copy:Va.copy,test:Va.test,_get:Va._get};function Od(e,t){if(t=="")return e;var r={op:"_get",path:t};return li(e,r),r.value}function li(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):_d(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=Od(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=_c(e,t.value),a.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new lt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=Ot(e));var p=t.path||"",f=p.split("/"),m=e,h=1,v=f.length,C=void 0,g=void 0,S=void 0;for(typeof r=="function"?S=r:S=_d;;){if(g=f[h],g&&g.indexOf("~")!=-1&&(g=kc(g)),o&&(g=="__proto__"||g=="prototype"&&h>0&&f[h-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&C===void 0&&(m[g]===void 0?C=f.slice(0,h).join("/"):h==v-1&&(C=t.path),C!==void 0&&S(t,0,e,C)),h++,Array.isArray(m)){if(g==="-")g=m.length;else{if(r&&!kd(g))throw new lt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);kd(g)&&(g=~~g)}if(h>=v){if(r&&t.op==="add"&&g>m.length)throw new lt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=DM[t.op].call(t,m,g,e);if(a.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(h>=v){var a=Va[t.op].call(t,m,g,e);if(a.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(m=m[g],r&&h<v&&(!m||typeof m!="object"))throw new lt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function no(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new lt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Ot(e));for(var i=new Array(t.length),a=0,p=t.length;a<p;a++)i[a]=li(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function MM(e,t,r){var n=li(e,t);if(n.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function _d(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new lt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Va[e.op]){if(typeof e.path!="string")throw new lt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new lt("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new lt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new lt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Fd(e.value))throw new lt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new lt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new lt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},p=Zx([a],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new lt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new lt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Zx(e,t,r){try{if(!Array.isArray(e))throw new lt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)no(Ot(t),Ot(e),r||!0);else{r=r||_d;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof lt)return o;throw o}}function _c(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!_c(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(i=p.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=i;o--!==0;)if(a=p[o],!_c(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Ry={};Ms(Ry,{compare:()=>$M,generate:()=>Cy,observe:()=>GM,unobserve:()=>BM});d();c();l();u();var by=new WeakMap,jM=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),VM=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function LM(e){return by.get(e)}function UM(e,t){return e.observers.get(t)}function QM(e,t){e.observers.delete(t.callback)}function BM(e,t){t.unobserve()}function GM(e,t){var r=[],n,o=LM(e);if(!o)o=new jM(e),by.set(e,o);else{var i=UM(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=Ot(e),t){n.callback=t,n.next=null;var a=function(){Cy(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){Cy(n),clearTimeout(n.next),QM(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new VM(t,n)),n}function Cy(e,t){t===void 0&&(t=!1);var r=by.get(e.object);xy(r.value,e.object,e.patches,"",t),e.patches.length&&no(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function xy(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=Pd(t),a=Pd(e),p=!1,f=!1,m=a.length-1;m>=0;m--){var h=a[m],v=e[h];if(Td(t,h)&&!(t[h]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var C=t[h];typeof v=="object"&&v!=null&&typeof C=="object"&&C!=null&&Array.isArray(v)===Array.isArray(C)?xy(v,C,r,n+"/"+Yr(h),o):v!==C&&(p=!0,o&&r.push({op:"test",path:n+"/"+Yr(h),value:Ot(v)}),r.push({op:"replace",path:n+"/"+Yr(h),value:Ot(C)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+Yr(h),value:Ot(v)}),r.push({op:"remove",path:n+"/"+Yr(h)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&i.length==a.length))for(var m=0;m<i.length;m++){var h=i[m];!Td(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+Yr(h),value:Ot(t[h])})}}}function $M(e,t,r){r===void 0&&(r=!1);var n=[];return xy(e,t,n,"",r),n}var oue=Object.assign({},Ay,Ry,{JsonPatchError:Oc,deepClone:Ot,escapePathComponent:Yr,unescapePathComponent:kc});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var wy=function(e,t){return wy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},wy(e,t)};function Kr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");wy(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function eR(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(h){try{m(n.next(h))}catch(v){a(v)}}function f(h){try{m(n.throw(h))}catch(v){a(v)}}function m(h){h.done?i(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function Nd(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=p(0),a.throw=p(1),a.return=p(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(i=m[0]&2?o.return:m[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,m[1])).done)return i;switch(o=0,i&&(m=[m[0]&2,i.value]),m[0]){case 0:case 1:i=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){r.label=m[1];break}if(m[0]===6&&r.label<i[1]){r.label=i[1],i=m;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(m);break}i[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=i=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function In(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function La(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(p){a={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Ua(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function di(e){return this instanceof di?(this.v=e,this):new di(e)}function tR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(g){return function(S){return Promise.resolve(S).then(g,v)}}function p(g,S){n[g]&&(o[g]=function(x){return new Promise(function(w,R){i.push([g,x,w,R])>1||f(g,x)})},S&&(o[g]=S(o[g])))}function f(g,S){try{m(n[g](S))}catch(x){C(i[0][3],x)}}function m(g){g.value instanceof di?Promise.resolve(g.value.v).then(h,v):C(i[0][2],g)}function h(g){f("next",g)}function v(g){f("throw",g)}function C(g,S){g(S),i.shift(),i.length&&f(i[0][0],i[0][1])}}function rR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof In=="function"?In(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(p,f){a=e[i](a),o(p,f,a.done,a.value)})}}function o(i,a,p,f){Promise.resolve(f).then(function(m){i({value:m,done:p})},a)}}d();c();l();u();function Oe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function Qa(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var qd=Qa(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
31
|
+
`;function dN(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var pN=["1",1,"yes",!0];function dc(){let e=[];return zg()&&e.push(window.doNotTrack),sh()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>pN.indexOf(t)!==-1)}var yC="v15",SC={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function fN(e=SC.default,t=yC,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var mN="38824e1f-37f5-42d3-8372-a4b8fa9df946",or=class{get defaultOptions(){return{endpoint:SC.default,isCustomEndpoint:!1,token:"",version:yC,beforeSendHooks:[],afterSendHooks:[]}}get version(){return fC}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[r_,JO].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};dc()?this.runtime=new Yu:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ke.view,{newEventType:ke.view,addClientIdParameter:!0}),this.addEventTypeMapping(ke.click,{newEventType:ke.click,addClientIdParameter:!0}),this.addEventTypeMapping(ke.custom,{newEventType:ke.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ke.search,{newEventType:ke.search,addClientIdParameter:!0})}initRuntime(t){return zg()&&Wi()?new oh(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(dN()&&console.warn(lN),new ih(t))}get storage(){return this.runtime.storage}determineVisitorId(){return V(this,void 0,void 0,function*(){try{return zg()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||_o()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),_o()}})}getCurrentVisitorId(){return V(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return V(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return V(this,void 0,void 0,function*(){if($u(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(tC(t,tC(r,mN)))}})}getParameters(t,...r){return V(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return V(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(_o()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(dc())return null;try{let r=new URL(t).searchParams.get(Mn.cvo_cid);if(r==null)return null;let n=Mn.fromString(r);return!n||!Wi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return V(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>V(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>V(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>i?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((A,w)=>V(this,void 0,void 0,function*(){let R=yield A;return yield w(t,R)}),h)].reduce((h,A)=>V(this,void 0,void 0,function*(){let w=yield h;return yield A(w)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return V(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[S=>this.setTrackingIdIfTrackingIdNotPresent(S),S=>this.removeEmptyPayloadValues(S,t),S=>this.validateParams(S,t),S=>n?eN(S):S,S=>n?this.removeUnknownParameters(S):S,S=>n?this.processCustomParameters(S):this.mapCustomParametersToCustomData(S)].reduce((S,b)=>V(this,void 0,void 0,function*(){let h=yield S;return yield b(h)}),Promise.resolve(r))})}makeEvent(t,...r){return V(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>V(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return V(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return V(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new Gu().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ke.search,t)})}sendSearchEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Nr(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ke.click,t)})}sendClickEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Nr(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ke.custom,t)})}sendCustomEvent(t){return V(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Nr(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ke.view,t)})}sendViewEvent(t){return V(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return V(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return V(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ke.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(oN(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=Nr(t,["custom"]),o={};r&&Bu(r)&&(o=this.lowercaseKeys(r));let i=iN(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Nr(t,["custom"]);if(r&&Bu(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=Nr(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ke.view||r==ke.click||r==ke.search||r==ke.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ke.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=Nr(t,["userId"]);return uN(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Nr(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Bu(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Bu(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?y_(t,r):t}get baseUrl(){return fN(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Et;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(Et||(Et={}));var O;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(O||(O={}));var ah={[O.triggerNotify]:"queryPipelineTriggers",[O.triggerExecute]:"queryPipelineTriggers",[O.triggerQuery]:"queryPipelineTriggers",[O.triggerRedirect]:"queryPipelineTriggers",[O.queryErrorBack]:"errors",[O.queryErrorClear]:"errors",[O.queryErrorRetry]:"errors",[O.pagerNext]:"getMoreResults",[O.pagerPrevious]:"getMoreResults",[O.pagerNumber]:"getMoreResults",[O.pagerResize]:"getMoreResults",[O.pagerScrolling]:"getMoreResults",[O.facetSearch]:"facet",[O.facetShowLess]:"facet",[O.facetShowMore]:"facet",[O.recommendation]:"recommendation",[O.likeSmartSnippet]:"smartSnippet",[O.dislikeSmartSnippet]:"smartSnippet",[O.expandSmartSnippet]:"smartSnippet",[O.collapseSmartSnippet]:"smartSnippet",[O.openSmartSnippetFeedbackModal]:"smartSnippet",[O.closeSmartSnippetFeedbackModal]:"smartSnippet",[O.sendSmartSnippetReason]:"smartSnippet",[O.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.clearRecentQueries]:"recentQueries",[O.recentResultClick]:"recentlyClickedDocuments",[O.clearRecentResults]:"recentlyClickedDocuments",[O.showLessFoldedResults]:"folding",[O.caseDetach]:"case",[O.likeGeneratedAnswer]:"generatedAnswer",[O.dislikeGeneratedAnswer]:"generatedAnswer",[O.openGeneratedAnswerSource]:"generatedAnswer",[O.generatedAnswerStreamEnd]:"generatedAnswer",[O.generatedAnswerSourceHover]:"generatedAnswer",[O.generatedAnswerCopyToClipboard]:"generatedAnswer",[O.generatedAnswerHideAnswers]:"generatedAnswer",[O.generatedAnswerShowAnswers]:"generatedAnswer",[O.generatedAnswerExpand]:"generatedAnswer",[O.generatedAnswerCollapse]:"generatedAnswer",[O.generatedAnswerFeedbackSubmit]:"generatedAnswer",[O.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Et.expandToFullUI]:"interface",[Et.openUserActions]:"User Actions",[Et.showPrecedingSessions]:"User Actions",[Et.showFollowingSessions]:"User Actions",[Et.clickViewedDocument]:"User Actions",[Et.clickPageView]:"User Actions",[Et.createArticle]:"createArticle"},jn=class{constructor(){this.runtime=new Yu,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ke.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ke.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ke.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ke.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return fC}};function gN(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function hN(e){return e.map(t=>t.replace(/;/g,""))}function vC(e){let r=e.join(";");return r.length<=256?r:vC(e.slice(1))}var cC=e=>{let t=hN(e),r=gN(t);return vC(r)};function uC(e){let t=typeof e.partialQueries=="string"?e.partialQueries:cC(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:cC(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Ku=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||dc();this.coveoAnalyticsClient=n?new jn:new or(t)}disable(){this.coveoAnalyticsClient=new jn}enable(){this.coveoAnalyticsClient=new or(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(O.interfaceLoad)}logInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(O.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(O.recommendation)}logRecommendation(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(O.recommendationOpen,t,r)}logRecommendationOpen(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(O.staticFilterClearAll,t)}logStaticFilterClearAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(O.staticFilterSelect,t)}logStaticFilterSelect(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(O.staticFilterDeselect,t)}logStaticFilterDeselect(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(O.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return V(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(O.interfaceChange,t)}logInterfaceChange(t){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(O.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(O.didyoumeanClick)}logDidYouMeanClick(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(O.resultsSort,t)}logResultsSort(t){return V(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(O.searchboxSubmit)}logSearchboxSubmit(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(O.searchboxClear)}logSearchboxClear(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(O.searchboxAsYouType)}logSearchboxAsYouType(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(O.breadcrumbFacet,t)}logBreadcrumbFacet(t){return V(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(O.breadcrumbResetAll)}logBreadcrumbResetAll(){return V(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(O.documentQuickview,t,r)}logDocumentQuickview(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(O.documentOpen,t,r)}logDocumentOpen(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(O.omniboxAnalytics,uC(t))}logOmniboxAnalytics(t){return V(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(O.omniboxFromLink,uC(t))}logOmniboxFromLink(t){return V(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(O.searchFromLink)}logSearchFromLink(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(O.triggerNotify,t)}logTriggerNotify(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(O.triggerExecute,t)}logTriggerExecute(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(O.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(O.undoTriggerQuery,t)}logUndoTriggerQuery(t){return V(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(O.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(O.pagerResize,t)}logPagerResize(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(O.pagerNumber,t)}logPagerNumber(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(O.pagerNext,t)}logPagerNext(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(O.pagerPrevious,t)}logPagerPrevious(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(O.pagerScrolling)}logPagerScrolling(){return V(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(O.facetClearAll,t)}logFacetClearAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(O.facetSearch,t)}logFacetSearch(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(O.facetSelect,t)}logFacetSelect(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(O.facetDeselect,t)}logFacetDeselect(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(O.facetExclude,t)}logFacetExclude(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(O.facetUnexclude,t)}logFacetUnexclude(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(O.facetSelectAll,t)}logFacetSelectAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(O.facetUpdateSort,t)}logFacetUpdateSort(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(O.facetShowMore,t)}logFacetShowMore(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(O.facetShowLess,t)}logFacetShowLess(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(O.queryError,t)}logQueryError(t){return V(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorBack);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorBack)})}})}logQueryErrorBack(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorRetry);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorRetry)})}})}logQueryErrorRetry(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorClear);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorClear)})}})}logQueryErrorClear(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(O.likeSmartSnippet)}logLikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(O.dislikeSmartSnippet)}logDislikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(O.expandSmartSnippet)}logExpandSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(O.collapseSmartSnippet)}logCollapseSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(O.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(O.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(O.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(O.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(O.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(O.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(O.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(O.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(O.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(O.copyToClipboard,t,r)}logCopyToClipboard(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(O.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(O.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(O.recentQueryClick)}logRecentQueryClick(){return V(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(O.clearRecentQueries)}logClearRecentQueries(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(O.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(O.clearRecentResults)}logClearRecentResults(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(O.noResultsBack)}logNoResultsBack(){return V(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(O.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(O.showLessFoldedResults)}logShowLessFoldedResults(){return V(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return V(this,arguments,void 0,function*(n,o,i=ah[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return V(this,arguments,void 0,function*(n,o,i=ah[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return V(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:p})=>a.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return V(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return V(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:p})=>a.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return V(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return V(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof or?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(O.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(O.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(O.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return V(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(O.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(O.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(O.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(O.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(O.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(O.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(O.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(O.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(O.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(O.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(O.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return V(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(O.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Ju=Object.assign({},cc),lC=Object.keys(Ju).map(e=>Ju[e]),Yi=class extends Kg{constructor({client:t,uuidGenerator:r=_o}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>lC.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(lC.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Ju.pageview,{newEventType:ke.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Ju.event,{newEventType:ke.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return b_(this.ticket)}};Yi.Id="svc";var Xu;(function(e){e.click="click",e.flowStart="flowStart"})(Xu||(Xu={}));var dr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(dr||(dr={}));var Zu;(function(e){e.quit="Quit",e.solved="Solved"})(Zu||(Zu={}));var el=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!dc();this.coveoAnalyticsClient=o?new or(t):new jn,this.svc=new Yi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new jn,this.svc=new Yi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new or(this.options),this.svc=new Yi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(dr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(dr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(dr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(dr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(dr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(dr.caseCancelled,{reason:Zu.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(dr.caseSolved,{reason:Zu.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(dr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Xu.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Xu.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return V(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof or?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){var i,a;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}},yN=e=>{let t={};return e.caseContext&&Object.keys(e.caseContext).forEach(r=>{var n;let o=(n=e.caseContext)===null||n===void 0?void 0:n[r];if(o){let i=`context_${r}`;t[i]=o}}),t},se=(e,t=!0)=>{let{caseContext:r,caseId:n,caseNumber:o}=e,i=Nr(e,["caseContext","caseId","caseNumber"]),a=yN(e);return Object.assign(Object.assign(Object.assign({CaseId:n,CaseNumber:o},i),!!a.context_Case_Subject&&{CaseSubject:a.context_Case_Subject}),t&&a)},tl=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||dc();this.coveoAnalyticsClient=n?new jn:new or(t)}disable(){this.coveoAnalyticsClient=new jn}enable(){this.coveoAnalyticsClient=new or(this.opts)}logInterfaceLoad(t){if(t){let r=se(t);return this.logSearchEvent(O.interfaceLoad,r)}return this.logSearchEvent(O.interfaceLoad)}logRecentQueryClick(t){if(t){let r=se(t);return this.logSearchEvent(O.recentQueryClick,r)}return this.logSearchEvent(O.recentQueryClick)}logClearRecentQueries(t){if(t){let r=se(t);return this.logCustomEvent(O.clearRecentQueries,r)}return this.logCustomEvent(O.clearRecentQueries)}logInterfaceChange(t){let r=se(t);return this.logSearchEvent(O.interfaceChange,r)}logStaticFilterDeselect(t){let r=se(t);return this.logSearchEvent(O.staticFilterDeselect,r)}logFetchMoreResults(t){if(t){let r=se(t);return this.logCustomEvent(O.pagerScrolling,Object.assign(Object.assign({},r),{type:"getMoreResults"}))}return this.logCustomEvent(O.pagerScrolling,{type:"getMoreResults"})}logBreadcrumbFacet(t){let r=se(t);return this.logSearchEvent(O.breadcrumbFacet,r)}logBreadcrumbResetAll(t){if(t){let r=se(t);return this.logSearchEvent(O.breadcrumbResetAll,r)}return this.logSearchEvent(O.breadcrumbResetAll)}logFacetSelect(t){let r=se(t);return this.logSearchEvent(O.facetSelect,r)}logFacetExclude(t){let r=se(t);return this.logSearchEvent(O.facetExclude,r)}logFacetDeselect(t){let r=se(t);return this.logSearchEvent(O.facetDeselect,r)}logFacetUpdateSort(t){let r=se(t);return this.logSearchEvent(O.facetUpdateSort,r)}logFacetClearAll(t){let r=se(t);return this.logSearchEvent(O.facetClearAll,r)}logFacetShowMore(t){let r=se(t,!1);return this.logCustomEvent(O.facetShowMore,r)}logFacetShowLess(t){let r=se(t,!1);return this.logCustomEvent(O.facetShowLess,r)}logQueryError(t){let r=se(t,!1);return this.logCustomEvent(O.queryError,r)}logPagerNumber(t){let r=se(t,!1);return this.logCustomEvent(O.pagerNumber,r)}logPagerNext(t){let r=se(t,!1);return this.logCustomEvent(O.pagerNext,r)}logPagerPrevious(t){let r=se(t,!1);return this.logCustomEvent(O.pagerPrevious,r)}logDidYouMeanAutomatic(t){if(t){let r=se(t);return this.logSearchEvent(O.didyoumeanAutomatic,r)}return this.logSearchEvent(O.didyoumeanAutomatic)}logDidYouMeanClick(t){if(t){let r=se(t);return this.logSearchEvent(O.didyoumeanClick,r)}return this.logSearchEvent(O.didyoumeanClick)}logResultsSort(t){let r=se(t);return this.logSearchEvent(O.resultsSort,r)}logSearchboxSubmit(t){if(t){let r=se(t);return this.logSearchEvent(O.searchboxSubmit,r)}return this.logSearchEvent(O.searchboxSubmit)}logContextChanged(t){let r=se(t);return this.logSearchEvent(Et.contextChanged,r)}logExpandToFullUI(t){let r=se(t);return this.logCustomEvent(Et.expandToFullUI,r)}logOpenUserActions(t){let r=se(t,!1);return this.logCustomEvent(Et.openUserActions,r)}logShowPrecedingSessions(t){let r=se(t,!1);return this.logCustomEvent(Et.showPrecedingSessions,r)}logShowFollowingSessions(t){let r=se(t,!1);return this.logCustomEvent(Et.showFollowingSessions,r)}logViewedDocumentClick(t,r){return this.logCustomEvent(Et.clickViewedDocument,Object.assign(Object.assign({},se(r,!1)),{document:t}))}logPageViewClick(t,r){return this.logCustomEvent(Et.clickPageView,Object.assign(Object.assign({},se(r,!1)),{pageView:t}))}logCreateArticle(t,r){return this.logCustomEvent(Et.createArticle,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logDocumentOpen(t,r,n){return this.logClickEvent(O.documentOpen,t,r,n?se(n,!1):void 0)}logCopyToClipboard(t,r,n){return this.logClickEvent(O.copyToClipboard,t,r,n?se(n,!1):void 0)}logCaseSendEmail(t,r,n){return this.logClickEvent(O.caseSendEmail,t,r,n?se(n,!1):void 0)}logFeedItemTextPost(t,r,n){return this.logClickEvent(O.feedItemTextPost,t,r,n?se(n,!1):void 0)}logDocumentQuickview(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl};return this.logClickEvent(O.documentQuickview,t,r,n?Object.assign(Object.assign({},se(n,!1)),o):o)}logCaseAttach(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl,resultUriHash:t.documentUriHash};return this.logClickEvent(O.caseAttach,t,r,n?Object.assign(Object.assign({},se(n,!1)),o):o)}logCaseDetach(t,r,n){let o=Object.assign(Object.assign(Object.assign({},r&&se(r,!1)),n&&{permanentId:n}),{resultUriHash:t});return this.logCustomEvent(O.caseDetach,o)}logLikeSmartSnippet(t){return this.logCustomEvent(O.likeSmartSnippet,t?se(t,!1):void 0)}logDislikeSmartSnippet(t){return this.logCustomEvent(O.dislikeSmartSnippet,t?se(t,!1):void 0)}logExpandSmartSnippet(t){return this.logCustomEvent(O.expandSmartSnippet,t?se(t,!1):void 0)}logCollapseSmartSnippet(t){return this.logCustomEvent(O.collapseSmartSnippet,t?se(t,!1):void 0)}logOpenSmartSnippetFeedbackModal(t){return this.logCustomEvent(O.openSmartSnippetFeedbackModal,t?se(t,!1):void 0)}logCloseSmartSnippetFeedbackModal(t){return this.logCustomEvent(O.closeSmartSnippetFeedbackModal,t?se(t,!1):void 0)}logSmartSnippetFeedbackReason(t,r,n){return this.logCustomEvent(O.sendSmartSnippetReason,n?Object.assign(Object.assign({},se(n,!1)),{reason:t,details:r}):{reason:t,details:r})}logExpandSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(O.expandSmartSnippetSuggestion,r?Object.assign(Object.assign({},se(r,!1)),n):n)}logCollapseSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(O.collapseSmartSnippetSuggestion,r?Object.assign(Object.assign({},se(r,!1)),n):n)}logOpenSmartSnippetSource(t,r,n){return this.logClickEvent(O.openSmartSnippetSource,t,r,n?se(n,!1):void 0)}logOpenSmartSnippetSuggestionSource(t,r,n){return this.logClickEvent(O.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logOpenSmartSnippetInlineLink(t,r,n){return this.logClickEvent(O.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logOpenSmartSnippetSuggestionInlineLink(t,r,n){return this.logClickEvent(O.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logLikeGeneratedAnswer(t,r){return this.logCustomEvent(O.likeGeneratedAnswer,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logDislikeGeneratedAnswer(t,r){return this.logCustomEvent(O.dislikeGeneratedAnswer,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logOpenGeneratedAnswerSource(t,r){return this.logCustomEvent(O.openGeneratedAnswerSource,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCitationClick(t,r,n){return this.logClickEvent(O.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logGeneratedAnswerSourceHover(t,r){return this.logCustomEvent(O.generatedAnswerSourceHover,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCopyToClipboard(t,r){return this.logCustomEvent(O.generatedAnswerCopyToClipboard,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerHideAnswers(t,r){return this.logCustomEvent(O.generatedAnswerHideAnswers,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerShowAnswers(t,r){return this.logCustomEvent(O.generatedAnswerShowAnswers,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerExpand(t,r){return this.logCustomEvent(O.generatedAnswerExpand,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCollapse(t,r){return this.logCustomEvent(O.generatedAnswerCollapse,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmit(t,r){return this.logCustomEvent(O.generatedAnswerFeedbackSubmit,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmitV2(t,r){return this.logCustomEvent(O.generatedAnswerFeedbackSubmitV2,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logRephraseGeneratedAnswer(t,r){return this.logSearchEvent(O.rephraseGeneratedAnswer,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logRetryGeneratedAnswer(t){return this.logSearchEvent(O.retryGeneratedAnswer,t?Object.assign({},se(t,!1)):{})}logGeneratedAnswerStreamEnd(t,r){return this.logCustomEvent(O.generatedAnswerStreamEnd,r?Object.assign(Object.assign({},se(r,!1)),t):t)}logGeneratedAnswerCitationDocumentAttach(t,r,n){return this.logClickEvent(O.generatedAnswerCitationDocumentAttach,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},se(n,!1)),r):r)}logCustomEvent(t,r){return V(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),o=Object.assign(Object.assign({},yield this.getBaseCustomEventRequest(n)),{eventType:ah[t],eventValue:t});return this.coveoAnalyticsClient.sendCustomEvent(o)})}logSearchEvent(t,r){return V(this,void 0,void 0,function*(){return this.coveoAnalyticsClient.sendSearchEvent(yield this.getBaseSearchEventRequest(t,r))})}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(i)})}logShowMoreFoldedResults(t,r,n){return V(this,void 0,void 0,function*(){return this.logClickEvent(O.showMoreFoldedResults,t,r,n?se(n,!1):void 0)})}logShowLessFoldedResults(t){return V(this,void 0,void 0,function*(){return this.logCustomEvent(O.showLessFoldedResults,t?se(t,!1):void 0)})}logTriggerNotify(t,r){return this.logCustomEvent(O.triggerNotify,r?Object.assign(Object.assign({},se(r,!1)),t):t)}getBaseCustomEventRequest(t){return V(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield this.getBaseEventRequest(t)),{lastSearchQueryUid:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return V(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return V(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign({},this.getOrigins()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof or?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}};d();c();l();u();d();c();l();u();var Ji=()=>"default";var SN=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Vn=class{constructor(t){this.getState=t;qe(this,"state");this.state=t()}getLanguage(){return SN(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let p=`context_${i}`;o[p]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Dn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Ji()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var AC=e=>new or(e).getCurrentVisitorId(),Xi=(e,t)=>typeof t=="function"?(...r)=>{let n=Us(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Zi=(e,t)=>(...r)=>{let n=Us(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var pc=class extends Vn{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},CC=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new pc(t)})=>{let i=t(),a=i.configuration.accessToken,p=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,m=i.configuration.analytics.enabled,g=new el({enableAnalytics:m,token:a,endpoint:p,runtimeEnvironment:f,preprocessRequest:Xi(e,n),beforeSendHooks:[Zi(e,r),(S,b)=>(e.info({...b,type:S,endpoint:p,token:a},"Analytics request"),b)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function rl(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function vN(e,t){return!!t&&t.facetId in e.facetSet}var vn=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),bC=(e,t)=>e.facetSet[t]?.request,lh=(e,t)=>{let r=vn(e,t);return vN(e,r)?r:void 0};var xC=(e,t)=>lh(e,t)?.values.filter(r=>r.state!=="idle")||[],qr=e=>e.search.isLoading;d();c();l();u();function RC(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function Dr(e){let{activeValue:t,ancestryMap:r}=AN(e);return t?CN(t,r):[]}function AN(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function CN(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function bN(e,t){return!!t&&t.facetId in e.categoryFacetSet}var dh=(e,t)=>{let r=vn(e,t);if(bN(e,r))return r},ph=(e,t)=>e.categoryFacetSet[t]?.request,wC=(e,t)=>{let r=dh(e,t);return Dr(r?.values??[])},fh=(e,t)=>{let r=ph(e,t);return Dr(r?.currentValues??[])};d();c();l();u();function ea(){return{}}d();c();l();u();function IC(e,t){return{request:e,tabs:t}}function ta(){return{}}d();c();l();u();function EC(e,t){return{request:e,tabs:t}}function ra(){return{}}d();c();l();u();function FC(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function na(){return{}}var No=(e,t)=>{let r=OC(t,e),n=r?r.field:"",o=mh(n,e);return{facetId:e,facetField:n,facetTitle:o}};function oa(e,t){let{facetId:r,facetValue:n}=e,o=No(r,t),i=_C(t,r);return{...o,facetValue:i==="hierarchical"?kC(t,r):n}}function Wt(e){return{facetSet:e.facetSet??na(),categoryFacetSet:e.categoryFacetSet??ea(),dateFacetSet:e.dateFacetSet??ta(),numericFacetSet:e.numericFacetSet??ra(),automaticFacetSet:e.automaticFacetSet??rl()}}var nl=e=>{let t=[];return wN(e).forEach((r,n)=>{let o=_C(e,r.facetId),i=PN(r,n+1);if(RN(r)){if(!!!fh(e,r.facetId).length)return;t.push({...i,...FN(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,p)=>{if(a.state==="idle")return;let f=TC(a,p+1,o),m=xN(r)?PC(a):EN(a);t.push({...i,...f,...m})})}),IN(e).forEach((r,n)=>{let o=TN(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let p=TC(i,a+1,"specific"),f=PC(i);t.push({...o,...p,...f})})}),t},xN=e=>e.type==="specific",RN=e=>e.type==="hierarchical",wN=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),IN=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),TC=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),EN=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),PC=e=>({displayValue:e.value,value:e.value}),kC=(e,t)=>fh(e,t).map(n=>n.value).join(";"),FN=(e,t)=>{let n=kC(e,t);return{value:n,valuePosition:1,displayValue:n}},TN=(e,t)=>({title:mh(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),PN=(e,t)=>({title:mh(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),mh=(e,t)=>`${e}_${t}`,OC=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,_C=(e,t)=>{let r=OC(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var gh=e=>e.configuration.search.locale,NC=e=>e.configuration.search.timezone,qC=e=>e.configuration.accessToken,DC=e=>e.configuration.organizationId,MC=e=>e.configuration.environment,ol=e=>e.configuration?.knowledge?.agentId;var Ve=e=>{if(kN(e)||hh(e))return e.generatedAnswer?.answerId;if(ON(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},kN=e=>"answer"in e&&"generatedAnswer"in e&&!te(e.generatedAnswer?.answerConfigurationId),hh=e=>{let t=ol(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},ON=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",yh=e=>e.generatedAnswer?.fieldsToIncludeInCitations,ia=ot(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var at=()=>({q:"",enableQuerySyntax:!1});var fc=class extends Vn{getSearchUID(){let t=this.getState();return t.search?.searchResponseId||t.search?.response.searchUid||yt().response.searchUid}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getFacetState(){return nl(Wt(this.state))}getBaseMetadata(){let t=this.getState(),r=super.getBaseMetadata(),n=Ve(t);return n&&(r.generativeQuestionAnsweringId=n),r}getGeneratedAnswerMetadata(){let t=this.getState();return{...(t.generatedAnswer?.isVisible!==void 0&&{showGeneratedAnswer:t.generatedAnswer.isVisible})}}get queryText(){return this.state.query?.q||at().q}get responseTime(){return this.state.search?.duration||yt().duration}mapResultsToAnalyticsDocument(){return this.state.search?.response.results.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.search?.response.results.length||yt().response.results.length}},jC=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new fc(t)})=>{let i=t(),a=i.configuration.accessToken,p=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,m=i.configuration.analytics.enabled,g=new tl({enableAnalytics:m,token:a,endpoint:p,runtimeEnvironment:f,preprocessRequest:Xi(e,n),beforeSendHooks:[Zi(e,r),(S,b)=>(e.info({...b,type:S,endpoint:p,token:a},"Analytics request"),b)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();var il=(r=>(r.Ascending="ascending",r.Descending="descending",r))(il||{}),al=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(al||{}),Mr=e=>{if(ki(e))return e.map(t=>Mr(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},sl=()=>({by:"relevancy"}),VC=e=>({by:"date",order:e});var LC=new W({values:{by:new Ls({enum:al,required:!0}),order:new Ls({enum:il}),field:new L}});function ir(){return Mr(sl())}d();c();l();u();d();c();l();u();d();c();l();u();var aa=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?Sh(t,r,i):(a=p.split("."),o=a[a.length-2]+"."+a[a.length-1],Sh(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Sh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function _N(){return typeof navigator<"u"}function UC(){try{return typeof localStorage<"u"}catch{return!1}}function QC(){try{return typeof sessionStorage<"u"}catch{return!1}}function BC(){return!!(_N()&&navigator.cookieEnabled)}var GC=null;function $C(){return GC||(UC()?localStorage:BC()?new vh:QC()?sessionStorage:new Ah)}var sa=class sa{getItem(t){return aa.get(`${sa.prefix}${t}`)}removeItem(t){aa.erase(`${sa.prefix}${t}`)}setItem(t,r,n){aa.set(`${sa.prefix}${t}`,r,n)}};qe(sa,"prefix","coveo_");var vh=sa;var Ah=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var cl="__coveo.analytics.history",NN=20,qN=1e3*60,DN=75,qo=class qo{constructor(t){qe(this,"store");this.store=t||$C()}static getInstance(t){return qo.instance||(qo.instance=new qo(t)),qo.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this6=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this6.cropQueryElement(_this6.stripEmptyQuery(t));let r=yield _this6.getHistoryWithInternalTimeAsync();r!==null?_this6.isValidEntry(t)&&_this6.setHistory([t].concat(r)):_this6.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this7=this;return _asyncToGenerator(function*(){let t=yield _this7.getHistoryWithInternalTimeAsync();return _this7.stripEmptyQueries(_this7.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(cl);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this8=this;return _asyncToGenerator(function*(){try{let t=yield _this8.store.getItem(cl);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(cl,JSON.stringify(t.slice(0,NN)))}catch{}}clear(){try{this.store.removeItem(cl)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,DN)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>qN:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};qe(qo,"instance",null);var Ch=qo,Nt=Ch;var mc=class mc extends Vn{constructor(){super(...arguments);qe(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return nl(Wt(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||mc.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||yt().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||mc.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ve(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ir()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(m=>m.expression),a=o.partialQueries.length-1,p=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||at().q}get responseTime(){return this.state.search?.duration||yt().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||yt().response.totalCountFiltered}};qe(mc,"fallbackPipelineName","default");var Ln=mc,HC=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,p=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,m=i.configuration.analytics.enabled,g=new Ku({token:a,endpoint:p,runtimeEnvironment:f,preprocessRequest:Xi(e,n),beforeSendHooks:[Zi(e,r),(S,b)=>(e.info({...b,type:S,endpoint:p,token:a},"Analytics request"),b)]},o);return m||g.disable(),g},bh=()=>{let t=Nt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function ul(e){let t=zC(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return tv([e,...t,...r],o=>o.uniqueId)}function zC(e){return e.childResults?e.childResults.flatMap(t=>[t,...zC(t)]):[]}d();c();l();u();var gc=()=>"";function WC(e,t){return{...new Ln(t).getBaseMetadata(),actionCause:e,type:e}}function MN(e){return Object.assign(e,{instantlyCallable:!0})}function jN(e,t){let r=i=>MN(le(e,i)),n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(i,{getState:a,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:a(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(S,{getState:b,extra:h}){return yield g({state:b(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var xh=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return UN(i)}return n},VN=e=>e.configuration.analytics.analyticsMode==="legacy",LN=e=>e.configuration.analytics.analyticsMode==="next",UN=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=p=>new a(p)),jN(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let S=[],b={log:function(){var _ref14=_asyncToGenerator(function*({state:x}){for(let I of S)yield I(x)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),A=i({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),w=yield t(A,p());b.description=w?.description,S.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(x){VN(x)&&(yield QN(w,r,x,g,A.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:R}=sc(h);return S.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(x){if(LN(x)&&o&&n){let I=n(x);yield KN(R,o,I)}});return function(_x27){return _ref16.apply(this,arguments)}}()),b});return function(_x24){return _ref13.apply(this,arguments)}}()));function QN(_x28,_x29,_x30,_x31,_x32){return _QN.apply(this,arguments)}function _QN(){_QN=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _QN.apply(this,arguments)}var YC=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(i){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),$e=xh(e=>HC({...e,provider:e.provider||new Ln(e.getState)}),e=>e,Ln),HK=xh(CC,YC("caseAssist"),pc),Z=e=>xh(jC,YC(e),fc),Ke=(e,t)=>{let r=i=>i+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=JC(e,o),n<0&&(n=YN(e,o)),n<0&&(n=0),GN(e,r(n),t)};var ll=(e,t)=>({sourceName:BN(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||gc()});function BN(e){let t=e.source;return te(t)?"unknown":t}var dl=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function GN(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:zN(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:WN(e),queryPipeline:r.pipeline||gc()}}var Je=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),KC={urihash:new L,sourcetype:new L,permanentid:new L},pl={uniqueId:G,raw:new W({values:KC}),title:G,uri:G,clickUri:G,rankingModifier:new L({required:!1,emptyAllowed:!0})};function $N(e){return Object.assign({},...Object.keys(KC).map(t=>({[t]:e[t]})))}function HN(e){return Object.assign({},...Object.keys(pl).map(t=>({[t]:e[t]})),{raw:$N(e.raw)})}function zN(e){let t=e.raw.author;return te(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function WN(e){let t=e.raw.source;return te(t)?"unknown":t}var Ft=e=>new Ee(pl).validate(HN(e));function YN(e,t){for(let[r,n]of t.entries()){let o=ul(n);if(JC(e,o)!==-1)return r}return-1}function JC(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function KN(_x34,_x35,_x36){return _KN.apply(this,arguments)}function _KN(){_KN=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _KN.apply(this,arguments)}var xr=(e,t)=>{let r=Je(e),n=Ke(e,t);return{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:n.documentTitle,author:n.documentAuthor,url:n.documentUri}};d();c();l();u();var Rh=e=>_(e,{evt:G,type:He}),XC=e=>$e("analytics/generic/search",t=>{Rh(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),ZC=e=>$e("analytics/generic/click",(t,r)=>(Ft(e.result),Rh(e),t.makeClickEvent(e.evt,Ke(e.result,r),Je(e.result),e.meta))),eb=e=>$e("analytics/generic/custom",t=>(Rh(e),t.makeCustomEventWithType(e.evt,e.type,e.meta)));var tb=()=>({actionCause:"interfaceLoad"}),ca=()=>({actionCause:"interfaceChange"});d();c();l();u();var wh=()=>He,rb=()=>G,ua=T("configuration/updateBasicConfiguration",e=>_(e,{accessToken:He,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:He})),la=T("configuration/updateSearchConfiguration",e=>_(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:He,timezone:He,locale:He,authenticationProviders:new re({required:!1,each:G})})),JN={enabled:new ue({default:!0}),originContext:wh(),originLevel2:wh(),originLevel3:wh(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new ue({default:!1}),deviceId:He,userDisplayName:He,documentLocation:He,trackingId:Wv,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new W({options:{required:!1},values:XA.reduce((e,t)=>(e[t]=zv,e),{})})},fl=T("configuration/updateAnalyticsConfiguration",e=>_(e,JN)),ml=T("configuration/analytics/disable"),gl=T("configuration/analytics/enable"),nb=T("configuration/analytics/originlevel2",e=>_(e,{originLevel2:rb()})),ob=T("configuration/analytics/originlevel3",e=>_(e,{originLevel3:rb()})),ib=T("knowledge/setAgentId",e=>_(e,new L({required:!0})));d();c();l();u();var hl=T("insightConfiguration/set",e=>_(e,{insightId:G}));d();c();l();u();d();c();l();u();var ab=()=>({insightId:""});var yl=ce(ab(),e=>{e.addCase(hl,(t,r)=>{t.insightId=r.payload.insightId})});d();c();l();u();d();c();l();u();var Sl=T("searchHub/set",e=>_(e,new L({required:!0,emptyAllowed:!0})));var jr=le("insight/interface/fetch",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{getState:t,dispatch:r,rejectWithValue:n,extra:{apiClient:o}}){let i=t(),a=yield o.getInterface(XN(i));return Ge(a)?n(a.error):(r(Sl(a.success.searchHub)),{response:a.success})});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),XN=e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),insightId:e.insightConfiguration.insightId});d();c();l();u();d();c();l();u();var sb=()=>({loading:!1,config:void 0});var Un=ce(sb(),e=>{e.addCase(jr.pending,t=>{t.loading=!0,t.error=void 0}).addCase(jr.rejected,(t,r)=>{t.loading=!1,t.error=r.payload}).addCase(jr.fulfilled,(t,r)=>{t.loading=!1,t.error=void 0;let{searchHub:n,...o}=r.payload.response;t.config=o})});d();c();l();u();d();c();l();u();d();c();l();u();function cb(e){return e.type==="dateRange"}function ub(e){return`start${e}`}function lb(e){return`end${e}`}var Ih=()=>({dateFacetValueMap:{}});function ZN(e,t,r){let n=e.start,o=e.end;return _n(n)&&(n=$s(n),r.dateFacetValueMap[t][ub(n)]=e.start),_n(o)&&(o=$s(o),r.dateFacetValueMap[t][lb(o)]=e.end),{...e,start:n,end:o}}function Eh(e,t){if(cb(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>ZN(o,r,t))}}return e}function Vr(e){let t=Ih();return{request:{...e,facets:e.facets?.map(n=>Eh(n,t))},mappings:t}}function e0(e,t,r){return{...e,start:r.dateFacetValueMap[t][ub(e.start)]||e.start,end:r.dateFacetValueMap[t][lb(e.end)]||e.end}}function t0(e,t){return e.facetId in t.dateFacetValueMap}function r0(e,t){return t0(e,t)?{...e,values:e.values.map(r=>e0(r,e.facetId,t))}:e}function Rr(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>r0(n,t))}}:e}d();c();l();u();d();c();l();u();var Qn=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield AC(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(bh()&&{pageId:bh()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:zi(e)})}}});return function Qn(_x39,_x40){return _ref19.apply(this,arguments)}}();var db=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,t){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:We(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,insightId:t.insightConfiguration.insightId,q:t.querySet?.[e],timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Nt.getInstance().getHistory():[],...(t.insightCaseContext?.caseContext&&{context:t.insightCaseContext.caseContext}),...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&(yield Qn(t.configuration.analytics)))})}});return function db(_x41,_x42){return _ref20.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var vl=T("didYouMean/enable"),pb=T("didYouMean/disable"),Al=T("didYouMean/automaticCorrections/disable"),fb=T("didYouMean/automaticCorrections/enable"),Yt=T("didYouMean/correction",e=>_(e,G)),hc=T("didYouMean/automaticCorrections/mode",e=>_(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var n0=T("history/undo"),o0=T("history/redo"),St=T("history/snapshot"),Z8=le("history/back",/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,{dispatch:t}){t(n0()),yield t(Ze())});return function(_x43,_x44){return _ref21.apply(this,arguments)}}()),e9=le("history/forward",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{dispatch:t}){t(o0()),yield t(Ze())});return function(_x45,_x46){return _ref22.apply(this,arguments)}}()),Ze=le("history/change",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x47,_x48){return _ref23.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var An=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});d();c();l();u();function Cl(){return{contextValues:{}}}d();c();l();u();var bl=()=>!1;d();c();l();u();function mb(){return{contextValues:{}}}d();c();l();u();function Fh(){return{enabled:!0,tabs:{}}}function xl(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function gb(){return[]}d();c();l();u();function Lr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Rl(){return{}}d();c();l();u();function hb(){return{}}d();c();l();u();function wl(){return{}}function vt(e){return{context:e.context||Cl(),dictionaryFieldContext:e.dictionaryFieldContext||mb(),facetSet:e.facetSet||na(),numericFacetSet:e.numericFacetSet||ra(),dateFacetSet:e.dateFacetSet||ta(),categoryFacetSet:e.categoryFacetSet||ea(),automaticFacetSet:e.automaticFacetSet??rl(),pagination:e.pagination||Lr(),query:e.query||at(),tabSet:e.tabSet||wl(),advancedSearchQueries:e.advancedSearchQueries||An(),staticFilterSet:e.staticFilterSet||hb(),querySet:e.querySet||Rl(),sortCriteria:e.sortCriteria||ir(),pipeline:e.pipeline||gc(),searchHub:e.searchHub||Ji(),facetOptions:e.facetOptions||xl(),facetOrder:e.facetOrder??gb(),debug:e.debug??bl()}}d();c();l();u();var Ut=T("query/updateQuery",e=>_(e,{q:new L,enableQuerySyntax:new ue}));d();c();l();u();d();c();l();u();var yb=()=>({caseContext:{},caseId:"",caseNumber:""}),J=e=>({caseContext:e?.caseContext||{},caseId:e?.caseId,caseNumber:e?.caseNumber});var Th=()=>Z("browseResults")("search/logFetchMoreResults",(e,t)=>e.logFetchMoreResults(J(t.insightCaseContext))),da=e=>Z("query")("search/queryError",(t,r)=>t.logQueryError({...J(r.insightCaseContext),query:r.query?.q||at().q,aq:"",cq:"",dq:"",errorType:e.type,errorMessage:e.message})),Sb=(e,t)=>Z("contextChanged")("analytics/contextChanged",(r,n)=>{let o={caseId:e,caseNumber:t,caseContext:n.insightCaseContext?.caseContext||{}};r.logContextChanged(o)}),Il=()=>Z("interfaceLoad")("analytics/interface/load",(e,t)=>e.logInterfaceLoad(J(t.insightCaseContext))),Bn=()=>Z("interfaceChange")("analytics/interface/change",(e,t)=>{e.logInterfaceChange({...J(t.insightCaseContext),interfaceChangeTo:t.configuration.analytics.originLevel2})});d();c();l();u();d();c();l();u();function Ur(e){return Object.values(e).map(t=>t.request)}d();c();l();u();var vb=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=a0(e),n=i0(e);return Vr({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??We(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,insightId:e.insightConfiguration.insightId,...(e.configuration.analytics.enabled&&(yield Qn(e.configuration.analytics,t))),q:e.query?.q,...(n.length&&{facets:n}),caseContext:e.insightCaseContext?.caseContext,...(r&&{cq:r}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),tab:e.configuration.analytics.originLevel2,...(e.folding&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.context&&{context:e.context.contextValues}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function vb(_x49,_x50){return _ref24.apply(this,arguments)}}(),fr=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,n=yield vb(e,t);return{...n,request:{...n.request,...(e.pagination&&{firstResult:e.pagination.firstResult,numberOfResults:r()})}}});return function fr(_x51,_x52){return _ref25.apply(this,arguments)}}(),Ab=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=yield vb(e);return{...r,request:{...r.request,filterFieldRange:100,cq:`@${e?.folding?.fields.collection}="${t}"`}}});return function Ab(_x53,_x54){return _ref26.apply(this,arguments)}}(),El=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=yield fr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.pagination?.numberOfResults??0)},r});return function El(_x55,_x56){return _ref27.apply(this,arguments)}}(),Fl=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield fr(e,t);return r.request={...r.request,numberOfResults:0},r});return function Fl(_x57,_x58){return _ref28.apply(this,arguments)}}();function i0(e){return Ur({...e.facetSet,...e.numericFacetSet,...e.dateFacetSet,...e.categoryFacetSet})}function a0(e){return Object.values(e.tabSet||{}).find(n=>n.isActive)?.expression.trim()||""}var Do=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x59,_x60){var _this9=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),i=Rr(yield _this9.extra.apiClient.query(t,n),r),a=Date.now()-o,p=_this9.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t){var _this0=this;return _asyncToGenerator(function*(){return _this0.processQueryErrorOrContinue(t)??(yield _this0.processQueryCorrectionsOrContinue(t))??_this0.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(da(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this1=this;return _asyncToGenerator(function*(){let r=_this1.getState(),n=_this1.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:p,queryCorrection:f}=n;if(!o||!i)return null;let m=a.length===0&&p&&p.length!==0,g=!te(f)&&!te(f.correctedQuery);if(!m&&!g)return null;let b=m?yield _this1.processLegacyDidYouMeanAutoCorrection(t):_this1.processNextDidYouMeanAutoCorrection(t);return _this1.dispatch(St(vt(_this1.getState()))),b})()}processLegacyDidYouMeanAutoCorrection(t){var _this10=this;return _asyncToGenerator(function*(){let r=_this10.getCurrentQuery(),n=_this10.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this10.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this10.dispatch(da(i.response.error)),_this10.rejectWithValue(i.response.error)):(_this10.dispatch(St(vt(_this10.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}automaticallyRetryQueryWithCorrection(t){var _this11=this;return _asyncToGenerator(function*(){_this11.onUpdateQueryForCorrection(t);let r=_this11.getState(),n=yield _this11.fetchFromAPI(yield fr(r));return _this11.dispatch(Yt(t)),n})()}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return qn(t.response)?t.response.success:null}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}};d();c();l();u();d();c();l();u();d();c();l();u();var Cb=()=>Z("didYouMeanClick")("analytics/didyoumean/click",(e,t)=>e.logDidYouMeanClick(J(t.insightCaseContext))),Ph=()=>Z("didYouMeanAutomatic")("analytics/didyoumean/automatic",(e,t)=>e.logDidYouMeanAutomatic(J(t.insightCaseContext)));var Mo=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x61,_x62){var _this12=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),i=Rr(yield _this12.extra.apiClient.query(t,n),r),a=Date.now()-o,p=_this12.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t,r){var _this13=this;return _asyncToGenerator(function*(){return _this13.processQueryErrorOrContinue(t)??(yield _this13.processQueryCorrectionsOrContinue(t,r))??_this13.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(da(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t,r){var _this14=this;return _asyncToGenerator(function*(){let n=_this14.getState(),o=_this14.getSuccessResponse(t);if(!o||!n.didYouMean)return null;let{enableDidYouMean:i,automaticallyCorrectQuery:a}=n.didYouMean,{results:p,queryCorrections:f,queryCorrection:m}=o;if(!i||!a)return null;let g=p.length===0&&f&&f.length!==0,S=!te(m)&&!te(m.correctedQuery);if(!g&&!S)return null;let h=g?yield _this14.processLegacyDidYouMeanAutoCorrection(t):_this14.processNextDidYouMeanAutoCorrection(t);return _this14.logOriginalAnalyticsQueryBeforeAutoCorrection(t,r),_this14.dispatch(St(vt(_this14.getState()))),h})()}processLegacyDidYouMeanAutoCorrection(t){var _this15=this;return _asyncToGenerator(function*(){let r=_this15.getCurrentQuery(),n=_this15.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this15.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this15.dispatch(da(i.response.error)),_this15.rejectWithValue(i.response.error)):(_this15.dispatch(St(vt(_this15.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Ph()})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Ph()}}automaticallyRetryQueryWithCorrection(t){var _this16=this;return _asyncToGenerator(function*(){_this16.dispatch(Ut({q:t}));let r=_this16.getState(),n=yield _this16.fetchFromAPI(yield fr(r));return _this16.dispatch(Yt(t)),n})()}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return qn(t.response)?t.response.success:null}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??at().enableQuerySyntax},search:{...yt(),duration:r,response:o,results:o.results}}}logOriginalAnalyticsQueryBeforeAutoCorrection(t,r){let n=this.getState(),o=Rr(t.response,r.mappings).success;this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,n,o),this.extra)}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get analyticsAction(){return this.config.analyticsAction}};function kh(_x63,_x64,_x65){return _kh.apply(this,arguments)}function _kh(){_kh=_asyncToGenerator(function*(e,t,r){yc(e);let n=new Mo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:i,logger:a}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:i,logger:a}),f=yield fr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _kh.apply(this,arguments)}function Oh(_x66,_x67,_x68){return _Oh.apply(this,arguments)}function _Oh(){_Oh=_asyncToGenerator(function*(e,t,r){yc(e);let n=new Mo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:i,logger:a}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:i,logger:a}),f=yield fr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Oh.apply(this,arguments)}function _h(_x69,_x70){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(e,t){let r=new Mo({...t,analyticsAction:Th}),{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield Th().prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=yield El(e,a),f=yield r.fetchFromAPI(p);return yield r.process(f,p)});return _h2.apply(this,arguments)}function Nh(_x71,_x72,_x73){return _Nh.apply(this,arguments)}function _Nh(){_Nh=_asyncToGenerator(function*(e,t,r){let n=new Mo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:i,logger:a}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:i,logger:a}),f=yield Fl(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Nh.apply(this,arguments)}var bb=le("search/executeSearch",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=t.getState();return yield kh(r,t,e)});return function(_x74,_x75){return _ref29.apply(this,arguments)}}()),xb=le("search/fetchPage",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Oh(r,t,e)});return function(_x76,_x77){return _ref30.apply(this,arguments)}}()),Rb=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();return yield _h(r,t)});return function(_x78,_x79){return _ref31.apply(this,arguments)}}()),wb=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Nh(r,t,e)});return function(_x80,_x81){return _ref32.apply(this,arguments)}}());var Ib=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t,{request:r,mappings:n},o){let i=Date.now(),a=Rr(yield e.query(r,o),n),p=Date.now()-i,f=t.query?.q||"";return{response:a,duration:p,queryExecuted:f,requestExecuted:r}});return function Ib(_x82,_x83,_x84,_x85){return _ref33.apply(this,arguments)}}(),Se=le("search/executeSearch",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return kh(r,t,e.legacy);yc(r);let n=new Do({...t}),o=e.next?qh(e.next):void 0,i=yield fr(r,o),a=yield n.fetchFromAPI(i);return yield n.process(a)});return function(_x86,_x87){return _ref34.apply(this,arguments)}}()),Tl=le("search/fetchPage",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Oh(r,t,e.legacy);yc(r);let n=new Do({...t}),o=e.next?qh(e.next):void 0,i=yield fr(r,o),a=yield n.fetchFromAPI(i);return yield n.process(a)});return function(_x88,_x89){return _ref35.apply(this,arguments)}}()),Pl=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return _h(r,t);let n=new Do({...t}),o=qh({actionCause:"browseResults"}),i=yield El(r,o),a=yield n.fetchFromAPI(i);return yield n.process(a)});return function(_x90,_x91){return _ref36.apply(this,arguments)}}()),pa=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Nh(r,t,e.legacy);let n=new Do({...t}),o=yield Fl(r),i=yield n.fetchFromAPI(o);return yield n.process(i)});return function(_x92,_x93){return _ref37.apply(this,arguments)}}()),kl=le("querySuggest/fetch",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o}}){o(e,{id:G});let i=e.id,a=yield db(i,t()),p=yield n.querySuggest(a);return Ge(p)?r(p.error):{id:i,q:a.q,...p.success}});return function(_x94,_x95){return _ref38.apply(this,arguments)}}()),yc=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},qh=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();d();c();l();u();var Kt=T("breadcrumb/deselectAll"),Ol=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var fa=T("facet/updateFacetAutoSelection",e=>_(e,{allow:new ue({required:!0})}));d();c();l();u();d();c();l();u();var _l=class extends Ln{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??at().q}get responseTime(){return this.activeInstantResultCache?.duration??yt().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??yt().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Eb=()=>$e("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new _l(e)),Fb=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var Dh={id:G},s0={...Dh,q:Ye},rX=T("instantResults/register",e=>_(e,Dh)),Nl=T("instantResults/updateQuery",e=>_(e,s0)),nX=T("instantResults/clearExpired",e=>_(e,Dh));d();c();l();u();var ql=new ne({required:!0,min:0}),Dl=T("pagination/registerNumberOfResults",e=>_(e,ql)),Ml=T("pagination/updateNumberOfResults",e=>_(e,ql)),jl=T("pagination/registerPage",e=>_(e,ql)),Gn=T("pagination/updatePage",e=>_(e,ql)),Vl=T("pagination/nextPage"),Ll=T("pagination/previousPage");d();c();l();u();d();c();l();u();var jo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:zi(e)}});var ma=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??$t(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&jo(e.configuration.analytics,t,r)),...(e.excerptLength&&!te(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var $n=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??$t(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Nt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Qn(e.configuration.analytics,t))),...(e.excerptLength&&!te(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function $n(_x96,_x97){return _ref39.apply(this,arguments)}}();d();c();l();u();var Mh=()=>$e("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Hn=e=>$e("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||at().q,aq:r.advancedSearchQueries?.aq||An().aq,cq:r.advancedSearchQueries?.cq||An().cq,dq:r.advancedSearchQueries?.dq||An().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var jh=()=>$e("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),Tb=()=>({actionCause:"didYouMeanClick"}),Pb=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();var oZ=new W({values:{undoneQuery:Ye},options:{required:!0}}),kb=()=>$e("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var ga=T("trigger/query/ignore",e=>_(e,new L({emptyAllowed:!0,required:!0}))),ha=T("trigger/query/modification",e=>_(e,new W({values:{originalQuery:He,modification:He}})));d();c();l();u();d();c();l();u();function Sc(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Ob(e){return Ur(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Vh={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function c0(e){return Ur(e).map(t=>{let r=Vh[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function u0(e){return[...c0(e.facetSet??{}),...Ob(e.numericFacetSet??{}),...Ob(e.dateFacetSet??{}),...Ur(e.categoryFacetSet??{})]}function l0(e){return u0(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ul(e){return Sc(l0(e),e.facetOrder??[])}var zn=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=f0(e),n=Ul(e),o=d0(e),i=yield $n(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Vr({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function zn(_x98,_x99){return _ref40.apply(this,arguments)}}();function d0(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(p0).filter(r=>r.currentValues.length>0):void 0}function p0(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function f0(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=m0(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function m0(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Wn=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x100,_x101){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Rr(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,p=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(Hn(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:p,queryCorrection:f}=n;if(!o||!i)return null;let m=a.length===0&&p&&p.length!==0,g=!te(f)&&!te(f.correctedQuery);if(!m&&!g)return null;let b=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(St(vt(_this19.getState()))),b})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this20.dispatch(Hn(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this20.dispatch(St(vt(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:jh()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:jh()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(ga("")),null;_this21.analyticsAction&&(yield _this21.dispatch(_this21.analyticsAction));let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Ge(a.response)?(_this21.dispatch(Hn(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(St(vt(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:kb()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??at().enableQuerySyntax},search:{...yt(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return qn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=yield _this22.fetchFromAPI(yield zn(_this22.getState()),{origin:"mainSearch"});return _this22.dispatch(Yt(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(ha({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield zn(_this23.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var uee=le("search/executeSearch",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ql(r,t,e)});return function(_x102,_x103){return _ref41.apply(this,arguments)}}()),lee=le("search/fetchPage",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Uh(r,t,e)});return function(_x104,_x105){return _ref42.apply(this,arguments)}}()),dee=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Qh(t,r)});return function(_x106,_x107){return _ref43.apply(this,arguments)}}()),pee=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();return yield S0(t,e,r)});return function(_x108,_x109){return _ref44.apply(this,arguments)}}()),fee=le("search/fetchInstantResults",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){return Lh(e,t)});return function(_x110,_x111){return _ref45.apply(this,arguments)}}()),g0=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=yield zn(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function g0(_x112,_x113){return _ref46.apply(this,arguments)}}(),h0=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r){let n=yield $n(e);return Vr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function h0(_x114,_x115,_x116){return _ref47.apply(this,arguments)}}(),y0=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=yield zn(e,t);return r.request.numberOfResults=0,r});return function y0(_x117,_x118){return _ref48.apply(this,arguments)}}(),_b=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Lh(_x119,_x120){return _Lh.apply(this,arguments)}function _Lh(){_Lh=_asyncToGenerator(function*(e,t){_(e,{id:G,q:G,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Wn({...t,analyticsAction:Eb()},m=>{t.dispatch(Nl({q:m,id:e.id}))}),a=yield h0(o,r,n),p=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Lh.apply(this,arguments)}function Uh(_x121,_x122,_x123){return _Uh.apply(this,arguments)}function _Uh(){_Uh=_asyncToGenerator(function*(e,t,r){_b(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=new Wn({...t,analyticsAction:r}),f=yield zn(e,a),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Uh.apply(this,arguments)}function Qh(_x124,_x125){return _Qh.apply(this,arguments)}function _Qh(){_Qh=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Mh().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Wn({...e,analyticsAction:Mh()}),p=yield g0(t,i),f=yield a.fetchFromAPI(p,{origin:"mainSearch"});return yield a.process(f)});return _Qh.apply(this,arguments)}function S0(_x126,_x127,_x128){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=new Wn({...e,analyticsAction:t}),f=yield y0(r,a),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _S2.apply(this,arguments)}function Ql(_x129,_x130,_x131){return _Ql.apply(this,arguments)}function _Ql(){_Ql=_asyncToGenerator(function*(e,t,r){_b(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),p=yield zn(e,a),f=new Wn({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Ql.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Nb=ot(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var mr=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=Gh(e),o=v0(e),i=A0(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield $n(e,r):ma(e,t,r);return Vr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Bh(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function mr(_x132,_x133,_x134){return _ref49.apply(this,arguments)}}();function Bh(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function v0(e){return Sc(b0(e),e.facetOrder??[])}function A0(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(C0).filter(r=>r.currentValues.length>0):void 0}function C0(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function b0(e){return x0(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function x0(e){return[...R0(e.facetSet??{}),...qb(e.numericFacetSet??{}),...qb(e.dateFacetSet??{}),...Ur(e.categoryFacetSet??{})]}function R0(e){return Ur(e).map(t=>{let r=Vh[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function qb(e){return Ur(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Gh(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Nb(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Yn=class{constructor(t,r=n=>{this.dispatch(Ut({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x135,_x136){var _this24=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Rr(yield _this24.extra.apiClient.search(r,n),t),a=Date.now()-o,p=_this24.getState().query?.q||"";return{response:i,duration:a,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this25=this;return _asyncToGenerator(function*(){return _this25.processQueryErrorOrContinue(t)??(yield _this25.processQueryCorrectionsOrContinue(t))??(yield _this25.processQueryTriggersOrContinue(t))??_this25.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Ge(t.response)?(this.dispatch(Hn(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getState(),n=_this26.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:p,queryCorrection:f}=n;if(!o||!i)return null;let m=a.length===0&&p&&p.length!==0,g=!te(f)&&!te(f.correctedQuery);if(!m&&!g)return null;let b=m?yield _this26.processLegacyDidYouMeanAutoCorrection(t):_this26.processModernDidYouMeanAutoCorrection(t);return _this26.dispatch(St(vt(_this26.getState()))),b})()}processLegacyDidYouMeanAutoCorrection(t){var _this27=this;return _asyncToGenerator(function*(){let r=_this27.getCurrentQuery(),n=_this27.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this27.automaticallyRetryQueryWithCorrection(o);return Ge(i.response)?(_this27.dispatch(Hn(i.response.error)),_this27.rejectWithValue(i.response.error)):(_this27.dispatch(St(vt(_this27.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this28=this;return _asyncToGenerator(function*(){let r=_this28.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this28.getState().triggers?.queryModification.queryToIgnore===n)return _this28.dispatch(ga("")),null;let i=_this28.getCurrentQuery(),a=yield _this28.automaticallyRetryQueryWithTriggerModification(n);return Ge(a.response)?(_this28.dispatch(Hn(a.response.error)),_this28.rejectWithValue(a.response.error)):(_this28.dispatch(St(vt(_this28.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(St(vt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return qn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this29=this;return _asyncToGenerator(function*(){_this29.onUpdateQueryForCorrection(t);let r=_this29.getState(),{actionCause:n}=Pb(),o=yield _this29.fetchFromAPI(yield mr(r,_this29.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this29.dispatch(Yt(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this30=this;return _asyncToGenerator(function*(){return _this30.dispatch(ha({newQuery:t,originalQuery:_this30.getCurrentQuery()})),_this30.onUpdateQueryForCorrection(t),yield _this30.fetchFromAPI(yield mr(_this30.getState(),_this30.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var ya=le("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;_(e,{q:new L,enableQuerySyntax:new ue,clearFilters:new ue}),e.clearFilters&&(r(Kt()),r(Ol())),r(fa({allow:!0})),r(Ut({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Gn(1))}),Db=T("search/updateSearchAction"),Fe=le("search/executeSearch",/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ql(r,t,e.legacy);Mb(r);let n=e.next?jb(e.next):void 0,o=yield mr(r,t.extra.navigatorContext,n),i=new Yn({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x137,_x138){return _ref50.apply(this,arguments)}}()),Br=le("search/fetchPage",/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=t.getState();if(Mb(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Uh(r,t,e.legacy);let n=new Yn({...t,analyticsAction:e.next}),o=yield mr(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x139,_x140){return _ref51.apply(this,arguments)}}()),Kn=le("search/fetchMoreResults",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Qh(t,r);let n=WC("browseResults",t.getState),o=new Yn({...t,analyticsAction:n}),i=yield w0(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x141,_x142){return _ref52.apply(this,arguments)}}()),Sa=le("search/fetchFacetValues",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ql(r,t,e.legacy);let n=new Yn({...t,analyticsAction:{}}),o=yield E0(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x143,_x144){return _ref53.apply(this,arguments)}}()),hte=le("search/fetchInstantResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Lh(e,t);_(e,{id:G,q:G,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:n,maxResultsPerQuery:o}=e,i=jb(Fb()),a=yield I0(r,t.extra.navigatorContext,n,o,i),p=new Yn({...t,analyticsAction:i},g=>{t.dispatch(Nl({q:g,id:e.id}))}),f=yield p.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x145,_x146){return _ref54.apply(this,arguments)}}()),w0=/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t,r){let n=yield mr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function w0(_x147,_x148,_x149){return _ref55.apply(this,arguments)}}(),I0=/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t,r,n,o){let i=ma(e,t,o);return Vr({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function I0(_x150,_x151,_x152,_x153,_x154){return _ref56.apply(this,arguments)}}(),E0=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t,r){let n=yield mr(e,t,r);return n.request.numberOfResults=0,n});return function E0(_x155,_x156,_x157){return _ref57.apply(this,arguments)}}(),Mb=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},jb=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();function Vb(_x158,_x159){return _Vb.apply(this,arguments)}function _Vb(){_Vb=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,i=e.query?.q||"";return{url:r.apiBaseUrl??$t(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:i,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Vb.apply(this,arguments)}var vc=le("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),i=yield Vb(o,e),a=yield t.apiClient.html(i);return Ge(a)?n(a.error):{content:a.success,uniqueId:e.uniqueId}});return function(_x160,_x161){return _ref58.apply(this,arguments)}}()),Bl=T("resultPreview/next"),Gl=T("resultPreview/previous"),Ub=T("resultPreview/prepare",e=>_(e,{results:new re({required:!0})})),Lb=2048,$l=le("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=jv(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Lb&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Lb} characters.`),{contentURL:o}});return function(_x162,_x163){return _ref59.apply(this,arguments)}}());d();c();l();u();function $h(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var Hh=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=$h();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},zh=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),va=ce($h(),e=>{e.addCase(vc.pending,t=>{t.isLoading=!0}).addCase(vc.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(Fe.fulfilled,(t,r)=>{Hh(t),t.resultsWithPreview=zh(r.payload.response.results)}).addCase(Kn.fulfilled,(t,r)=>{Hh(t),t.resultsWithPreview=t.resultsWithPreview.concat(zh(r.payload.response.results))}).addCase(Br.fulfilled,Hh).addCase(Ub,(t,r)=>{t.resultsWithPreview=zh(r.payload.results)}).addCase(Bl,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Gl,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase($l.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});d();c();l();u();d();c();l();u();var Jn=(e,t)=>{let r=e;return te(r[t])?te(e.raw[t])?null:e.raw[t]:r[t]},F0=e=>t=>e.every(r=>!te(Jn(t,r))),T0=e=>t=>e.every(r=>te(Jn(t,r))),P0=(e,t)=>r=>{let n=Qb(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},k0=(e,t)=>r=>{let n=Qb(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Qb=(e,t)=>{let r=Jn(t,e);return lu(r)?r:[r]},Bb={getResultProperty:Jn,fieldsMustBeDefined:F0,fieldsMustNotBeDefined:T0,fieldMustMatch:P0,fieldMustNotMatch:k0};function Hl(e){return e.search.response.searchUid!==""}function Gb(e,t,r){return e.search.results.find(n=>Jn(n,t)===r)}var Wh=ot(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Aa=T("app/setError");function Yh(e,t){let r=t.payload??null;r&&(e.response=yt().response,e.results=[],e.questionAnswer=Di()),e.error=r,e.isLoading=!1}function Kh(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function O0(e,t){Kh(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function $b(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function _0(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var xe=ce(yt(),e=>{e.addCase(Fe.rejected,(t,r)=>Yh(t,r)),e.addCase(Kn.rejected,(t,r)=>Yh(t,r)),e.addCase(Br.rejected,(t,r)=>Yh(t,r)),e.addCase(Fe.fulfilled,(t,r)=>{O0(t,r)}),e.addCase(Kn.fulfilled,(t,r)=>{Kh(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Br.fulfilled,(t,r)=>{Kh(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Sa.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(Fe.pending,$b),e.addCase(Kn.pending,_0),e.addCase(Br.pending,$b),e.addCase(Db,(t,r)=>{t.searchAction=r.payload}),e.addCase(Aa,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var zl=ce(Ji(),e=>{e.addCase(Sl,(t,r)=>r.payload).addCase(Ze.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(la,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function Hb(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var zb=Or;function ix(e,t){if(e===t||!(zb(e)&&zb(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=ix(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Ca(e){let t=0;for(let r in e)t++;return t}var Wb=e=>[].concat(...e);function N0(e){return new RegExp("(^|:)//").test(e)}function q0(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Kl(e){return e!=null}function D0(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var M0=e=>e.replace(/\/$/,""),j0=e=>e.replace(/^\//,"");function V0(e,t){if(!e)return t;if(!t)return e;if(N0(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=M0(e),t=j0(t),`${e}${r}${t}`}function L0(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Yb=(...e)=>v(...e),U0=e=>e.status>=200&&e.status<=299,Q0=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Kb(e){if(!Or(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function ax({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:r=Yb,paramsSerializer:n,isJsonContentType:o=Q0,jsonContentType:i="application/json",jsonReplacer:a,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof v>"u"&&r===Yb&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(b,h,A){let{getState:w,extra:R,endpoint:x,forced:I,type:F}=h,P,{url:j,headers:q=new C(g.headers),params:k=void 0,responseHandler:N=f??"json",validateStatus:M=m??U0,timeout:U=p,...Y}=typeof b=="string"?{url:b}:b,H,B=h.signal;U&&(H=new s.AbortController,h.signal.addEventListener("abort",H.abort),B=H.signal);let Q={...g,signal:B,...Y};q=new C(Kb(q)),Q.headers=(yield t(q,{getState:w,arg:b,extra:R,endpoint:x,forced:I,type:F,extraOptions:A}))||q;let z=Ce=>typeof Ce=="object"&&(Or(Ce)||Array.isArray(Ce)||typeof Ce.toJSON=="function");if(!Q.headers.has("content-type")&&z(Q.body)&&Q.headers.set("content-type",i),z(Q.body)&&o(Q.headers)&&(Q.body=JSON.stringify(Q.body,a)),k){let Ce=~j.indexOf("?")?"&":"?",Te=n?n(k):new URLSearchParams(Kb(k));j+=Ce+Te}j=V0(e,j);let $=new Request(j,Q);P={request:new Request(j,Q)};let ee,pe=!1,Re=H&&setTimeout(()=>{pe=!0,H.abort()},U);try{ee=yield r($)}catch(Ce){return{error:{status:pe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ce)},meta:P}}finally{Re&&clearTimeout(Re),H?.signal.removeEventListener("abort",H.abort)}let _e=ee.clone();P.response=_e;let be,we="";try{let Ce;if(yield Promise.all([S(ee,N).then(Te=>be=Te,Te=>Ce=Te),_e.text().then(Te=>we=Te,()=>{})]),Ce)throw Ce}catch(Ce){return{error:{status:"PARSING_ERROR",originalStatus:ee.status,data:we,error:String(Ce)},meta:P}}return M(ee,be)?{data:be,meta:P}:{error:{status:ee.status,data:be},meta:P}});return function(_x164,_x165,_x166){return _ref60.apply(this,arguments)}}());function S(_x167,_x168){return _S3.apply(this,arguments)}function _S3(){_S3=_asyncToGenerator(function*(b,h){if(typeof h=="function")return h(b);if(h==="content-type"&&(h=o(b.headers)?"json":"text"),h==="json"){let A=yield b.text();return A.length?JSON.parse(A):null}return b.text()});return _S3.apply(this,arguments)}}var ba=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function B0(){return _B2.apply(this,arguments)}function _B2(){_B2=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _B2.apply(this,arguments)}function G0(e,t){throw Object.assign(new ba({error:e,meta:t}),{throwImmediately:!0})}var Jb={},$0=(e,t)=>(/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Jb).maxRetries,(o||Jb).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:B0,retryCondition:(g,S,{attempt:b})=>b<=a,...t,...o},m=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new ba(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof ba)return g.value;throw g}if(g instanceof ba&&!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(m,f.maxRetries)}});return function(_x169,_x170,_x171){return _ref61.apply(this,arguments)}}()),sx=Object.assign($0,{fail:G0}),ey=T("__rtkq/focused"),cx=T("__rtkq/unfocused"),ty=T("__rtkq/online"),ux=T("__rtkq/offline");function ry(e){return e.type==="query"}function H0(e){return e.type==="mutation"}function ny(e){return e.type==="infinitequery"}function oy(e,t,r,n,o,i){return z0(e)?e(t,r,n,o).filter(Kl).map(Jh).map(i):Array.isArray(e)?e.map(Jh).map(i):[]}function z0(e){return typeof e=="function"}function Jh(e){return typeof e=="string"?{type:e}:e}function W0(e,t){return e.catch(t)}var Cc=Symbol("forceQueryFn"),Xh=e=>typeof e[Cc]=="function";function Y0({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,p=new Map,{unsubscribeQueryResult:f,removeMutationResult:m,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:I,buildInitiateMutation:F,getRunningQueryThunk:S,getRunningMutationThunk:b,getRunningQueriesThunk:h,getRunningMutationsThunk:A};function S(P,j){return q=>{let k=i.endpointDefinitions[P],N=e({queryArgs:j,endpointDefinition:k,endpointName:P});return a.get(q)?.[N]}}function b(P,j){return q=>p.get(q)?.[j]}function h(){return P=>Object.values(a.get(P)||{}).filter(Kl)}function A(){return P=>Object.values(p.get(P)||{}).filter(Kl)}function w(P){}function R(P,j){let q=(k,{subscribe:N=!0,forceRefetch:M,subscriptionOptions:U,[Cc]:Y,...H}={})=>(B,Q)=>{let z=e({queryArgs:k,endpointDefinition:j,endpointName:P}),$,X={...H,type:"query",subscribe:N,forceRefetch:M,subscriptionOptions:U,endpointName:P,originalArgs:k,queryCacheKey:z,[Cc]:Y};if(ry(j))$=t(X);else{let{direction:je,initialPageParam:it}=H;$=r({...X,direction:je,initialPageParam:it})}let ee=o.endpoints[P].select(k),pe=B($),Re=ee(Q());let{requestId:_e,abort:be}=pe,we=Re.requestId!==_e,Ce=a.get(B)?.[z],Te=()=>ee(Q()),ut=Object.assign(Y?pe.then(Te):we&&!Ce?Promise.resolve(Re):Promise.all([Ce,pe]).then(Te),{arg:k,requestId:_e,subscriptionOptions:U,queryCacheKey:z,abort:be,unwrap(){return _asyncToGenerator(function*(){let je=yield ut;if(je.isError)throw je.error;return je.data})()},refetch:()=>B(q(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){N&&B(f({queryCacheKey:z,requestId:_e}))},updateSubscriptionOptions(je){ut.subscriptionOptions=je,B(g({endpointName:P,requestId:_e,queryCacheKey:z,options:je}))}});if(!Ce&&!we&&!Y){let je=L0(a,B,{});je[z]=ut,ut.then(()=>{delete je[z],Ca(je)||a.delete(B)})}return ut};return q}function x(P,j){return R(P,j)}function I(P,j){return R(P,j)}function F(P){return(j,{track:q=!0,fixedCacheKey:k}={})=>(N,M)=>{let U=n({type:"mutation",endpointName:P,originalArgs:j,track:q,fixedCacheKey:k}),Y=N(U);let{requestId:H,abort:B,unwrap:Q}=Y,z=W0(Y.unwrap().then(pe=>({data:pe})),pe=>({error:pe})),$=()=>{N(m({requestId:H,fixedCacheKey:k}))},X=Object.assign(z,{arg:Y.arg,requestId:H,abort:B,unwrap:Q,reset:$}),ee=p.get(N)||{};return p.set(N,ee),ee[H]=X,X.then(()=>{delete ee[H],Ca(ee)||p.delete(N)}),k&&(ee[k]=X,X.then(()=>{ee[k]===X&&(delete ee[k],Ca(ee)||p.delete(N))})),X}}}function K0(e){return e}var Wl=(e={})=>({...e,[nc]:!0});function J0({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let p=(N,M,U,Y)=>(H,B)=>{let Q=r[N],z=n({queryArgs:M,endpointDefinition:Q,endpointName:N});if(H(o.internalActions.queryResultPatched({queryCacheKey:z,patches:U})),!Y)return;let $=o.endpoints[N].select(M)(B()),X=oy(Q.providesTags,$.data,void 0,M,{},i);H(o.internalActions.updateProvidedBy({queryCacheKey:z,providedTags:X}))};function f(N,M,U=0){let Y=[M,...N];return U&&Y.length>U?Y.slice(0,-1):Y}function m(N,M,U=0){let Y=[...N,M];return U&&Y.length>U?Y.slice(1):Y}let g=(N,M,U,Y=!0)=>(H,B)=>{let z=o.endpoints[N].select(M)(B()),$={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(N,M,$.inversePatches,Y))};if(z.status==="uninitialized")return $;let X;if("data"in z)if(zt(z.data)){let[ee,pe,Re]=ku(z.data,U);$.patches.push(...pe),$.inversePatches.push(...Re),X=ee}else X=U(z.data),$.patches.push({op:"replace",path:[],value:X}),$.inversePatches.push({op:"replace",path:[],value:z.data});return $.patches.length===0||H(o.util.patchQueryData(N,M,$.patches,Y)),$},S=(N,M,U)=>Y=>Y(o.endpoints[N].initiate(M,{subscribe:!1,forceRefetch:!0,[Cc]:()=>({data:U})})),b=(N,M)=>N.query&&N[M]?N[M]:K0,h=/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(N,{signal:M,abort:U,rejectWithValue:Y,fulfillWithValue:H,dispatch:B,getState:Q,extra:z}){let $=r[N.endpointName];try{let X=b($,"transformResponse"),ee={signal:M,abort:U,dispatch:B,getState:Q,extra:z,endpoint:N.endpointName,type:N.type,forced:N.type==="query"?A(N,Q()):void 0,queryCacheKey:N.type==="query"?N.queryCacheKey:void 0},pe=N.type==="query"?N[Cc]:void 0,Re,_e=/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(we,Ce,Te,ut){if(Ce==null&&we.pages.length)return Promise.resolve({data:we});let je={queryArg:N.originalArgs,pageParam:Ce},it=yield be(je),ft=ut?f:m;return{data:{pages:ft(we.pages,it.data,Te),pageParams:ft(we.pageParams,Ce,Te)}}});return function _e(_x174,_x175,_x176,_x177){return _ref63.apply(this,arguments)}}();function be(_x178){return _be.apply(this,arguments)}function _be(){_be=_asyncToGenerator(function*(we){let Ce,{extraOptions:Te}=$;if(pe?Ce=pe():$.query?Ce=yield t($.query(we),ee,Te):Ce=yield $.queryFn(we,ee,Te,je=>t(je,ee,Te)),typeof process<"u",Ce.error)throw new ba(Ce.error,Ce.meta);let ut=yield X(Ce.data,Ce.meta,we);return{...Ce,data:ut}});return _be.apply(this,arguments)}if(N.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:we}=$,{maxPages:Ce=1/0}=we,Te,ut={pages:[],pageParams:[]},je=a.selectQueryEntry(Q(),N.queryCacheKey)?.data,ft=A(N,Q())&&!N.direction||!je?ut:je;if("direction"in N&&N.direction&&ft.pages.length){let Gt=N.direction==="backward",On=(Gt?lx:Zh)(we,ft);Te=yield _e(ft,On,Ce,Gt)}else{let{initialPageParam:Gt=we.initialPageParam}=N,cr=je?.pageParams??[],On=cr[0]??Gt,wi=cr.length;Te=yield _e(ft,On,Ce),pe&&(Te={data:Te.data.pages[0]});for(let Ii=1;Ii<wi;Ii++){let _s=Zh(we,Te.data);Te=yield _e(Te.data,_s,Ce)}}Re=Te}else Re=yield be(N.originalArgs);return H(Re.data,Wl({fulfilledTimeStamp:Date.now(),baseQueryMeta:Re.meta}))}catch(X){let ee=X;if(ee instanceof ba){let pe=b($,"transformErrorResponse");try{return Y(yield pe(ee.value,ee.meta,N.originalArgs),Wl({baseQueryMeta:ee.meta}))}catch(Re){ee=Re}}throw typeof process<"u",console.error(ee),ee}});return function h(_x172,_x173){return _ref62.apply(this,arguments)}}();function A(N,M){let U=a.selectQueryEntry(M,N.queryCacheKey),Y=a.selectConfig(M).refetchOnMountOrArgChange,H=U?.fulfilledTimeStamp,B=N.forceRefetch??(N.subscribe&&Y);return B?B===!0||(Number(new Date)-Number(H))/1e3>=B:!1}let w=()=>le(`${e}/executeQuery`,h,{getPendingMeta({arg:M}){let U=r[M.endpointName];return Wl({startedTimeStamp:Date.now(),...(ny(U)?{direction:M.direction}:{})})},condition(M,{getState:U}){let Y=U(),H=a.selectQueryEntry(Y,M.queryCacheKey),B=H?.fulfilledTimeStamp,Q=M.originalArgs,z=H?.originalArgs,$=r[M.endpointName],X=M.direction;return Xh(M)?!0:H?.status==="pending"?!1:A(M,Y)||ry($)&&$?.forceRefetch?.({currentArg:Q,previousArg:z,endpointState:H,state:Y})?!0:!(B&&!X)},dispatchConditionRejection:!0}),R=w(),x=w(),I=le(`${e}/executeMutation`,h,{getPendingMeta(){return Wl({startedTimeStamp:Date.now()})}}),F=N=>"force"in N,P=N=>"ifOlderThan"in N,j=(N,M,U)=>(Y,H)=>{let B=F(U)&&U.force,Q=P(U)&&U.ifOlderThan,z=(X=!0)=>{let ee={forceRefetch:X,isPrefetch:!0};return o.endpoints[N].initiate(M,ee)},$=o.endpoints[N].select(M)(H());if(B)Y(z());else if(Q){let X=$?.fulfilledTimeStamp;if(!X){Y(z());return}(Number(new Date)-Number(new Date(X)))/1e3>=Q&&Y(z())}else Y(z(!1))};function q(N){return M=>M?.meta?.arg?.endpointName===N}function k(N,M){return{matchPending:$i(Mu(N),q(M)),matchFulfilled:$i(Sn(N),q(M)),matchRejected:$i(ko(N),q(M))}}return{queryThunk:R,mutationThunk:I,infiniteQueryThunk:x,prefetch:j,updateQueryData:g,upsertQueryData:S,patchQueryData:p,buildMatchThunkActions:k}}function Zh(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function lx(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function dx(e,t,r,n){return oy(r[e.meta.arg.endpointName][t],Sn(e)?e.payload:void 0,ic(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Yl(e,t,r){let n=e[t];n&&r(n)}function bc(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Xb(e,t,r){let n=e[bc(t)];n&&r(n)}var Ac={};function X0({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=T(`${e}/resetApiState`);function S(q,k,N,M){var U;q[U=k.queryCacheKey]??(q[U]={status:"uninitialized",endpointName:k.endpointName}),Yl(q,k.queryCacheKey,Y=>{Y.status="pending",Y.requestId=N&&Y.requestId?Y.requestId:M.requestId,k.originalArgs!==void 0&&(Y.originalArgs=k.originalArgs),Y.startedTimeStamp=M.startedTimeStamp;let H=o[M.arg.endpointName];ny(H)&&"direction"in k&&(Y.direction=k.direction)})}function b(q,k,N,M){Yl(q,k.arg.queryCacheKey,U=>{if(U.requestId!==k.requestId&&!M)return;let{merge:Y}=o[k.arg.endpointName];if(U.status="fulfilled",Y){if(U.data!==void 0){let{fulfilledTimeStamp:H,arg:B,baseQueryMeta:Q,requestId:z}=k,$=yn(U.data,X=>Y(X,N,{arg:B.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:H,requestId:z}));U.data=$}else U.data=N;}else U.data=o[k.arg.endpointName].structuralSharing??!0?ix(nr(U.data)?Tg(U.data):U.data,N):N;delete U.error,U.fulfilledTimeStamp=k.fulfilledTimeStamp})}let h=Oo({name:`${e}/queries`,initialState:Ac,reducers:{removeQueryResult:{reducer(q,{payload:{queryCacheKey:k}}){delete q[k]},prepare:Hi()},cacheEntriesUpserted:{reducer(q,k){for(let N of k.payload){let{queryDescription:M,value:U}=N;S(q,M,!0,{arg:M,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),b(q,{arg:M,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:q=>({payload:q.map(M=>{let{endpointName:U,arg:Y,value:H}=M,B=o[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:M.arg,queryCacheKey:n({queryArgs:Y,endpointDefinition:B,endpointName:U})},value:H}}),meta:{[nc]:!0,requestId:ac(),timestamp:Date.now()}})},queryResultPatched:{reducer(q,{payload:{queryCacheKey:k,patches:N}}){Yl(q,k,M=>{M.data=kg(M.data,N.concat())})},prepare:Hi()}},extraReducers(q){q.addCase(t.pending,(k,{meta:N,meta:{arg:M}})=>{let U=Xh(M);S(k,M,U,N)}).addCase(t.fulfilled,(k,{meta:N,payload:M})=>{let U=Xh(N.arg);b(k,N,M,U)}).addCase(t.rejected,(k,{meta:{condition:N,arg:M,requestId:U},error:Y,payload:H})=>{Yl(k,M.queryCacheKey,B=>{if(!N){if(B.requestId!==U)return;B.status="rejected",B.error=H??Y}})}).addMatcher(p,(k,N)=>{let{queries:M}=a(N);for(let[U,Y]of Object.entries(M))(Y?.status==="fulfilled"||Y?.status==="rejected")&&(k[U]=Y)})}}),A=Oo({name:`${e}/mutations`,initialState:Ac,reducers:{removeMutationResult:{reducer(q,{payload:k}){let N=bc(k);N in q&&delete q[N]},prepare:Hi()}},extraReducers(q){q.addCase(r.pending,(k,{meta:N,meta:{requestId:M,arg:U,startedTimeStamp:Y}})=>{U.track&&(k[bc(N)]={requestId:M,status:"pending",endpointName:U.endpointName,startedTimeStamp:Y})}).addCase(r.fulfilled,(k,{payload:N,meta:M})=>{M.arg.track&&Xb(k,M,U=>{U.requestId===M.requestId&&(U.status="fulfilled",U.data=N,U.fulfilledTimeStamp=M.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:N,error:M,meta:U})=>{U.arg.track&&Xb(k,U,Y=>{Y.requestId===U.requestId&&(Y.status="rejected",Y.error=N??M)})}).addMatcher(p,(k,N)=>{let{mutations:M}=a(N);for(let[U,Y]of Object.entries(M))(Y?.status==="fulfilled"||Y?.status==="rejected")&&U!==Y?.requestId&&(k[U]=Y)})}}),w=Oo({name:`${e}/invalidation`,initialState:Ac,reducers:{updateProvidedBy:{reducer(q,k){var U,Y;let{queryCacheKey:N,providedTags:M}=k.payload;for(let H of Object.values(q))for(let B of Object.values(H)){let Q=B.indexOf(N);Q!==-1&&B.splice(Q,1)}for(let{type:H,id:B}of M){let Q=(U=q[H]??(q[H]={}))[Y=B||"__internal_without_id"]??(U[Y]=[]);Q.includes(N)||Q.push(N)}},prepare:Hi()}},extraReducers(q){q.addCase(h.actions.removeQueryResult,(k,{payload:{queryCacheKey:N}})=>{for(let M of Object.values(k))for(let U of Object.values(M)){let Y=U.indexOf(N);Y!==-1&&U.splice(Y,1)}}).addMatcher(p,(k,N)=>{var U,Y;let{provided:M}=a(N);for(let[H,B]of Object.entries(M))for(let[Q,z]of Object.entries(B)){let $=(U=k[H]??(k[H]={}))[Y=Q||"__internal_without_id"]??(U[Y]=[]);for(let X of z)$.includes(X)||$.push(X)}}).addMatcher(_r(Sn(t),ic(t)),(k,N)=>{let M=dx(N,"providesTags",o,f),{queryCacheKey:U}=N.meta.arg;w.caseReducers.updateProvidedBy(k,w.actions.updateProvidedBy({queryCacheKey:U,providedTags:M}))})}}),R=Oo({name:`${e}/subscriptions`,initialState:Ac,reducers:{updateSubscriptionOptions(q,k){},unsubscribeQueryResult(q,k){},internal_getRTKQSubscriptions(){}}}),x=Oo({name:`${e}/internalSubscriptions`,initialState:Ac,reducers:{subscriptionsUpdated:{reducer(q,k){return kg(q,k.payload)},prepare:Hi()}}}),I=Oo({name:`${e}/config`,initialState:{online:D0(),focused:q0(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(q,{payload:k}){q.middlewareRegistered=q.middlewareRegistered==="conflict"||i!==k?"conflict":!0}},extraReducers:q=>{q.addCase(ty,k=>{k.online=!0}).addCase(ux,k=>{k.online=!1}).addCase(ey,k=>{k.focused=!0}).addCase(cx,k=>{k.focused=!1}).addMatcher(p,k=>({...k}))}}),F=ji({queries:h.reducer,mutations:A.reducer,provided:w.reducer,subscriptions:x.reducer,config:I.reducer}),P=(q,k)=>F(g.match(k)?void 0:q,k),j={...I.actions,...h.actions,...R.actions,...x.actions,...A.actions,...w.actions,resetApiState:g};return{reducer:P,actions:j}}var Vo=Symbol.for("RTKQ/skipToken"),px={status:"uninitialized"},Zb=yn(px,()=>{}),ex=yn(px,()=>{});function Z0({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=F=>Zb,o=F=>ex;return{buildQuerySelector:b,buildInfiniteQuerySelector:h,buildMutationSelector:A,selectInvalidatedBy:w,selectCachedArgsForQuery:R,selectApiState:a,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function i(F){return{...F,...Hb(F.status)}}function a(F){return F[t]}function p(F){return a(F)?.queries}function f(F,P){return p(F)?.[P]}function m(F){return a(F)?.mutations}function g(F){return a(F)?.config}function S(F,P,j){return q=>{if(q===Vo)return r(n,j);let k=e({queryArgs:q,endpointDefinition:P,endpointName:F});return r(M=>f(M,k)??Zb,j)}}function b(F,P){return S(F,P,i)}function h(F,P){let{infiniteQueryOptions:j}=P;function q(k){let N={...k,...Hb(k.status)},{isLoading:M,isError:U,direction:Y}=N,H=Y==="forward",B=Y==="backward";return{...N,hasNextPage:x(j,N.data),hasPreviousPage:I(j,N.data),isFetchingNextPage:M&&H,isFetchingPreviousPage:M&&B,isFetchNextPageError:U&&H,isFetchPreviousPageError:U&&B}}return S(F,P,q)}function A(){return F=>{let P;return typeof F=="object"?P=bc(F)??Vo:P=F,r(P===Vo?o:k=>a(k)?.mutations?.[P]??ex,i)}}function w(F,P){let j=F[t],q=new Set;for(let k of P.filter(Kl).map(Jh)){let N=j.provided[k.type];if(!N)continue;let M=(k.id!==void 0?N[k.id]:Wb(Object.values(N)))??[];for(let U of M)q.add(U)}return Wb(Array.from(q.values()).map(k=>{let N=j.queries[k];return N?[{queryCacheKey:k,endpointName:N.endpointName,originalArgs:N.originalArgs}]:[]}))}function R(F,P){return Object.values(p(F)).filter(j=>j?.endpointName===P&&j.status!=="uninitialized").map(j=>j.originalArgs)}function x(F,P){return P?Zh(F,P)!=null:!1}function I(F,P){return!P||!F.getPreviousPageParam?!1:lx(F,P)!=null}}var tx=WeakMap?new WeakMap:void 0,rx=({endpointName:e,queryArgs:t})=>{let r="",n=tx?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Or(a)?Object.keys(a).sort().reduce((p,f)=>(p[f]=a[f],p),{}):a,a));Or(t)&&tx?.set(t,o),r=o}return`${e}(${r})`};function eq(...e){return function(r){let n=Bi(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=rx;if("serializeQueryArgs"in m.endpointDefinition){let S=m.endpointDefinition.serializeQueryArgs;g=b=>{let h=S(b);return typeof h=="string"?h:rx({...b,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(m){m()},apiUid:ac(),extractRehydrationInfo:n,hasRehydrationInfo:Bi(m=>n(m)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let S of m)o.tagTypes.includes(S)||o.tagTypes.push(S);if(g)for(let[S,b]of Object.entries(g))typeof b=="function"?b(i.endpointDefinitions[S]):Object.assign(i.endpointDefinitions[S]||{},b);return a}},p=e.map(m=>m.init(a,o,i));function f(m){let g=m.endpoints({query:S=>({...S,type:"query"}),mutation:S=>({...S,type:"mutation"}),infiniteQuery:S=>({...S,type:"infinitequery"})});for(let[S,b]of Object.entries(g)){if(m.overrideExisting!==!0&&S in i.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Lt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[S]=b;for(let h of p)h.injectEndpoint(S,b)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function Cn(e,...t){return Object.assign(e,...t)}var tq=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:p}=e.internalActions,f=(h,A)=>{var R,x;if(a.match(A)){let{queryCacheKey:I,requestId:F,options:P}=A.payload;return h?.[I]?.[F]&&(h[I][F]=P),!0}if(p.match(A)){let{queryCacheKey:I,requestId:F}=A.payload;return h[I]&&delete h[I][F],!0}if(e.internalActions.removeQueryResult.match(A))return delete h[A.payload.queryCacheKey],!0;if(t.pending.match(A)){let{meta:{arg:I,requestId:F}}=A,P=h[R=I.queryCacheKey]??(h[R]={});return P[`${F}_running`]={},I.subscribe&&(P[F]=I.subscriptionOptions??P[F]??{}),!0}let w=!1;if(t.fulfilled.match(A)||t.rejected.match(A)){let I=h[A.meta.arg.queryCacheKey]||{},F=`${A.meta.requestId}_running`;w||(w=!!I[F]),delete I[F]}if(t.rejected.match(A)){let{meta:{condition:I,arg:F,requestId:P}}=A;if(I&&F.subscribe){let j=h[x=F.queryCacheKey]??(h[x]={});j[P]=F.subscriptionOptions??j[P]??{},w=!0}}return w},m=()=>r.currentSubscriptions,b={getSubscriptions:m,getSubscriptionCount:h=>{let w=m()[h]??{};return Ca(w)},isRequestSubscribed:(h,A)=>!!m()?.[h]?.[A]};return(h,A)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,b];let w=f(r.currentSubscriptions,h),R=!0;if(w){i||(i=setTimeout(()=>{let F=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,P]=ku(o,()=>F);A.next(e.internalActions.subscriptionsUpdated(P)),o=F,i=null},500));let x=typeof h.type=="string"&&!!h.type.startsWith(n),I=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;R=!x&&!I}return[R,!1]}};function rq(e){for(let t in e)return!1;return!0}var nq=2147483647/1e3-1,oq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:p,unsubscribeQueryResult:f,cacheEntriesUpserted:m}=t.internalActions,g=_r(f.match,r.fulfilled,r.rejected,m.match);function S(R){let x=o.currentSubscriptions[R];return!!x&&!rq(x)}let b={},h=(R,x,I)=>{let F=x.getState(),P=a(F);if(g(R)){let j;if(m.match(R))j=R.payload.map(q=>q.queryDescription.queryCacheKey);else{let{queryCacheKey:q}=f.match(R)?R.payload:R.meta.arg;j=[q]}A(j,x,P)}if(t.util.resetApiState.match(R))for(let[j,q]of Object.entries(b))q&&clearTimeout(q),delete b[j];if(n.hasRehydrationInfo(R)){let{queries:j}=n.extractRehydrationInfo(R);A(Object.keys(j),x,P)}};function A(R,x,I){let F=x.getState();for(let P of R){let j=i(F,P);w(P,j?.endpointName,x,I)}}function w(R,x,I,F){let j=n.endpointDefinitions[x]?.keepUnusedDataFor??F.keepUnusedDataFor;if(j===1/0)return;let q=Math.max(0,Math.min(j,nq));if(!S(R)){let k=b[R];k&&clearTimeout(k),b[R]=setTimeout(()=>{S(R)||I.dispatch(p({queryCacheKey:R})),delete b[R]},q*1e3)}}return h},nx=new Error("Promise never resolved before cacheEntryRemoved."),iq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:p}})=>{let f=ju(n),m=ju(o),g=Sn(n,o),S={};function b(x,I,F){let P=S[x];P?.valueResolved&&(P.valueResolved({data:I,meta:F}),delete P.valueResolved)}function h(x){let I=S[x];I&&(delete S[x],I.cacheEntryRemoved())}let A=(x,I,F)=>{let P=w(x);function j(q,k,N,M){let U=a(F,k),Y=a(I.getState(),k);!U&&Y&&R(q,M,k,I,N)}if(n.pending.match(x))j(x.meta.arg.endpointName,P,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:q,value:k}of x.payload){let{endpointName:N,originalArgs:M,queryCacheKey:U}=q;j(N,U,x.meta.requestId,M),b(U,k,{})}else if(o.pending.match(x))I.getState()[t].mutations[P]&&R(x.meta.arg.endpointName,x.meta.arg.originalArgs,P,I,x.meta.requestId);else if(g(x))b(P,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))h(P);else if(e.util.resetApiState.match(x))for(let q of Object.keys(S))h(q)};function w(x){return f(x)?x.meta.arg.queryCacheKey:m(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?bc(x.payload):""}function R(x,I,F,P,j){let q=r.endpointDefinitions[x],k=q?.onCacheEntryAdded;if(!k)return;let N={},M=new Promise(z=>{N.cacheEntryRemoved=z}),U=Promise.race([new Promise(z=>{N.valueResolved=z}),M.then(()=>{throw nx})]);U.catch(()=>{}),S[F]=N;let Y=e.endpoints[x].select(q.type==="query"?I:F),H=P.dispatch((z,$,X)=>X),B={...P,getCacheEntry:()=>Y(P.getState()),requestId:j,extra:H,updateCachedData:q.type==="query"?z=>P.dispatch(e.util.updateQueryData(x,I,z)):void 0,cacheDataLoaded:U,cacheEntryRemoved:M},Q=k(I,B);Promise.resolve(Q).catch(z=>{if(z!==nx)throw z})}return A},aq=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},sq=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=i.internalActions,g=_r(Sn(n),ic(n)),S=_r(Sn(n,o),ko(n,o)),b=[],h=(R,x)=>{g(R)?w(dx(R,"invalidatesTags",r,a),x):S(R)?w([],x):i.util.invalidateTags.match(R)&&w(oy(R.payload,void 0,void 0,void 0,void 0,a),x)};function A(R){let{queries:x,mutations:I}=R;for(let F of[x,I])for(let P in F)if(F[P]?.status==="pending")return!0;return!1}function w(R,x){let I=x.getState(),F=I[e];if(b.push(...R),F.config.invalidationBehavior==="delayed"&&A(F))return;let P=b;if(b=[],P.length===0)return;let j=i.util.selectInvalidatedBy(I,P);t.batch(()=>{let q=Array.from(j.values());for(let{queryCacheKey:k}of q){let N=F.queries[k],M=f.currentSubscriptions[k]??{};N&&(Ca(M)===0?x.dispatch(m({queryCacheKey:k})):N.status!=="uninitialized"&&x.dispatch(p(N)))}})}return h},cq=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(h,A)=>{(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&m(h.payload,A),(t.pending.match(h)||t.rejected.match(h)&&h.meta.condition)&&m(h.meta.arg,A),(t.fulfilled.match(h)||t.rejected.match(h)&&!h.meta.condition)&&f(h.meta.arg,A),r.util.resetApiState.match(h)&&S()};function p(h,A){let R=A.getState()[e].queries[h],x=o.currentSubscriptions[h];if(!(!R||R.status==="uninitialized"))return x}function f({queryCacheKey:h},A){let w=A.getState()[e],R=w.queries[h],x=o.currentSubscriptions[h];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:F}=b(x);if(!Number.isFinite(I))return;let P=i[h];P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);let j=Date.now()+I;i[h]={nextPollTimestamp:j,pollingInterval:I,timeout:setTimeout(()=>{(w.config.focused||!F)&&A.dispatch(n(R)),f({queryCacheKey:h},A)},I)}}function m({queryCacheKey:h},A){let R=A.getState()[e].queries[h],x=o.currentSubscriptions[h];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:I}=b(x);if(!Number.isFinite(I)){g(h);return}let F=i[h],P=Date.now()+I;(!F||P<F.nextPollTimestamp)&&f({queryCacheKey:h},A)}function g(h){let A=i[h];A?.timeout&&clearTimeout(A.timeout),delete i[h]}function S(){for(let h of Object.keys(i))g(h)}function b(h={}){let A=!1,w=Number.POSITIVE_INFINITY;for(let R in h)h[R].pollingInterval&&(w=Math.min(h[R].pollingInterval,w),A=h[R].skipPollingIfUnfocused||A);return{lowestPollingInterval:w,skipPollingIfUnfocused:A}}return a},uq=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Mu(r,n),i=ko(r,n),a=Sn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:S,arg:{endpointName:b,originalArgs:h}}=m.meta,A=t.endpointDefinitions[b],w=A?.onQueryStarted;if(w){let R={},x=new Promise((j,q)=>{R.resolve=j,R.reject=q});x.catch(()=>{}),p[S]=R;let I=e.endpoints[b].select(A.type==="query"?h:S),F=g.dispatch((j,q,k)=>k),P={...g,getCacheEntry:()=>I(g.getState()),requestId:S,extra:F,updateCachedData:A.type==="query"?j=>g.dispatch(e.util.updateQueryData(b,h,j)):void 0,queryFulfilled:x};w(h,P)}}else if(a(m)){let{requestId:S,baseQueryMeta:b}=m.meta;p[S]?.resolve({data:m.payload,meta:b}),delete p[S]}else if(i(m)){let{requestId:S,rejectedWithValue:b,baseQueryMeta:h}=m.meta;p[S]?.reject({error:m.payload??m.error,isUnhandledError:!b,meta:h}),delete p[S]}}},lq=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,m)=>{ey.match(f)&&p(m,"refetchOnFocus"),ty.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],S=g.queries,b=o.currentSubscriptions;t.batch(()=>{for(let h of Object.keys(b)){let A=S[h],w=b[h];if(!w||!A)continue;(Object.values(w).some(x=>x[m]===!0)||Object.values(w).every(x=>x[m]===void 0)&&g.config[m])&&(Ca(w)===0?f.dispatch(i({queryCacheKey:h})):A.status!=="uninitialized"&&f.dispatch(n(A)))}})}return a};function dq(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},p=S=>S.type.startsWith(`${t}/`),f=[aq,oq,sq,cq,iq,uq];return{middleware:S=>{let b=!1,A={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:p},w=f.map(I=>I(A)),R=tq(A),x=lq(A);return I=>F=>{if(!Li(F))return I(F);b||(b=!0,S.dispatch(n.internalActions.middlewareRegistered(i)));let P={...S,next:I},j=S.getState(),[q,k]=R(F,P,j),N;if(q?N=I(F):N=k,S.getState()[t]&&(x(F,P,j),p(F)||o.hasRehydrationInfo(F)))for(let M of w)M(F,P,j);return N}},actions:a};function g(S){return e.api.endpoints[S.endpointName].initiate(S.originalArgs,{subscribe:!1,forceRefetch:!0})}}var ox=Symbol(),pq=({createSelector:e=ot}={})=>({name:ox,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g},S){uA();let b=be=>(typeof process<"u",be);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ty,onOffline:ux,onFocus:ey,onFocusLost:cx},util:{}});let h=Z0({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:A,selectCachedArgsForQuery:w,buildQuerySelector:R,buildInfiniteQuerySelector:x,buildMutationSelector:I}=h;Cn(t.util,{selectInvalidatedBy:A,selectCachedArgsForQuery:w});let{queryThunk:F,infiniteQueryThunk:P,mutationThunk:j,patchQueryData:q,updateQueryData:k,upsertQueryData:N,prefetch:M,buildMatchThunkActions:U}=J0({baseQuery:r,reducerPath:o,context:S,api:t,serializeQueryArgs:i,assertTagType:b,selectors:h}),{reducer:Y,actions:H}=X0({context:S,queryThunk:F,infiniteQueryThunk:P,mutationThunk:j,serializeQueryArgs:i,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});Cn(t.util,{patchQueryData:q,updateQueryData:k,upsertQueryData:N,prefetch:M,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),Cn(t.internalActions,H);let{middleware:B,actions:Q}=dq({reducerPath:o,context:S,queryThunk:F,mutationThunk:j,infiniteQueryThunk:P,api:t,assertTagType:b,selectors:h});Cn(t.util,Q),Cn(t,{reducer:Y,middleware:B});let{buildInitiateQuery:z,buildInitiateInfiniteQuery:$,buildInitiateMutation:X,getRunningMutationThunk:ee,getRunningMutationsThunk:pe,getRunningQueriesThunk:Re,getRunningQueryThunk:_e}=Y0({queryThunk:F,mutationThunk:j,infiniteQueryThunk:P,api:t,serializeQueryArgs:i,context:S});return Cn(t.util,{getRunningMutationThunk:ee,getRunningMutationsThunk:pe,getRunningQueryThunk:_e,getRunningQueriesThunk:Re}),{name:ox,injectEndpoint(be,we){var ut;let Te=(ut=t.endpoints)[be]??(ut[be]={});ry(we)&&Cn(Te,{name:be,select:R(be,we),initiate:z(be,we)},U(F,be)),H0(we)&&Cn(Te,{name:be,select:I(),initiate:X(be)},U(j,be)),ny(we)&&Cn(Te,{name:be,select:x(be,we),initiate:$(be,we)},U(F,be))}}}}),fx=eq(pq());d();c();l();u();d();c();l();u();var Lo=e=>e.query,mx=e=>e.query?.enableQuerySyntax;var gx=ot(e=>Lo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),Jl=ot(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var xc=e=>{if(e==="yes")return!0;if(e==="no")return!1};var xa=e=>$e({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ve(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ve(t)??"",answerGenerated:e??!1})}),Ra=()=>$e({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});var hx=()=>({actionCause:"retryGeneratedAnswer"});d();c();l();u();d();c();l();u();var yx=ot(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Sx=e=>e.context;d();c();l();u();var iy=e=>e.pipeline;d();c();l();u();var ay=e=>e.searchHub;d();c();l();u();var Qt=ot(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),Bne=ot(e=>e,e=>{let t=Qt(e);return t&&e?e[t].expression:""});d();c();l();u();var vx=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var Ax=e=>e.excerptLength?.length;d();c();l();u();var Gr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,Cx=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var bx=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var xx=e=>e.sortCriteria;var Rx=/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Rx(_x179){return _ref64.apply(this,arguments)}}(),wx=(e,t)=>{let r=Lo(e)?.q,{aq:n,cq:o,dq:i,lq:a}=mq(e),p=Sx(e),f=jo(e.configuration.analytics,t,{actionCause:Wh(e)}),m=ay(e),g=iy(e),S=yh(e)??[],b=Ex(e),h=Qt(e.tabSet)||"default",A=gh(e),w=NC(e),R=t.referrer||"",x=Cx(e),I=xx(e),F=fq(e),P=Ax(e),j=bx(e),q=vx(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:mx(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(b.length&&{facets:b}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Bh(e),firstResult:e.pagination.firstResult}),tab:h,locale:A,timezone:w,...(e.debug!==void 0&&{debug:e.debug}),referrer:R,...F,...(j??{}),...(P&&{excerptLength:P}),...(q&&{dictionaryFieldContext:q}),sortCriteria:I,...(x&&{facetOptions:x}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Ix=(e,t)=>{let r=Lo(e)?.q,n=Ex(e),o=jo(e.configuration.analytics,t,{actionCause:Wh(e)}),i=gh(e),a=ay(e),p=iy(e),f=yh(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(a?.length&&{searchHub:a}),...(p?.length&&{pipeline:p}),...o,locale:i}},Ex=e=>Ul(e)?.map(t=>Eh(t,Ih())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),fq=e=>({actionsHistory:e.configuration.analytics.enabled?Nt.getInstance().getHistory():[]}),mq=e=>{let t=yx(e),r=Gh(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Xl=["searching","thinking","answering"];function Zl(e){return e.toLowerCase()}function sy(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var Fx=["text/plain","text/markdown"];var wa=new L({required:!0}),Tx=new L,Ia=new ue({required:!0}),cy={id:wa,title:wa,uri:wa,permanentid:wa,clickUri:Tx},ed=new L({required:!0,constrainTo:Fx}),Px=new L({required:!0,constrainTo:Xl}),kx=e=>({...e,name:Zl(e.name)}),Ea=T("generatedAnswer/setIsVisible",e=>_(e,Ia)),Fa=T("generatedAnswer/setAnswerId",e=>_(e,G)),td=T("generatedAnswer/setAnswerGenerationMode",e=>_(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Rc=T("generatedAnswer/setIsEnabled",e=>_(e,Ia)),Qo=T("generatedAnswer/updateMessage",e=>_(e,{textDelta:wa})),Bo=T("generatedAnswer/updateCitations",e=>_(e,{citations:new re({required:!0,each:new W({values:cy})})})),Go=T("generatedAnswer/updateError",e=>_(e,{message:Tx,code:new ne({min:0})})),ar=T("generatedAnswer/resetAnswer"),rd=T("generatedAnswer/like"),nd=T("generatedAnswer/dislike"),od=T("generatedAnswer/feedbackModal/open"),wc=T("generatedAnswer/expand"),id=T("generatedAnswer/collapse"),ad=T("generatedAnswer/setId",e=>_(e,{id:new L({required:!0})})),sd=T("generatedAnswer/feedbackModal/close"),Ta=T("generatedAnswer/sendFeedback"),$r=T("generatedAnswer/setIsLoading",e=>_(e,Ia)),Uo=T("generatedAnswer/setIsStreaming",e=>_(e,Ia)),$o=T("generatedAnswer/setAnswerContentFormat",e=>_(e,ed)),cd=T("generatedAnswer/updateResponseFormat",e=>_(e,{contentFormat:new re({each:ed,default:["text/plain"]})})),ud=T("knowledge/updateAnswerConfigurationId",e=>_(e,wa)),ld=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>_(e,Ru)),Ic=T("generatedAnswer/setIsAnswerGenerated",e=>_(e,Ia)),Ho=T("generatedAnswer/setCannotAnswer",e=>_(e,Ia)),uy=T("generatedAnswer/setAnswerApiQueryParams",e=>_(e,new W({}))),dd=T("generatedAnswer/startStep",e=>_(kx(e),{name:Px,startedAt:new ne({min:0,required:!0})})),pd=T("generatedAnswer/finishStep",e=>_(kx(e),{name:Px,finishedAt:new ne({min:0,required:!0})})),Ox=le("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:p}=a,{setAbortControllerRef:f}=e,m=yield Rx(r),g=(h,A)=>{switch(h){case"genqa.headerMessageType":{let w=JSON.parse(A);n($o(w.contentFormat));break}case"genqa.messageType":n(Qo(JSON.parse(A)));break;case"genqa.citationsType":n(Bo(JSON.parse(A)));break;case"genqa.endOfStreamType":{let w=JSON.parse(A).answerGenerated,R=p.length!==0&&!w;n(Ho(R)),n(Uo(!1)),n(Ic(w)),n(xa(w)),n(Ra());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n($r(!0));let S=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,b=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{S(m)&&(n($r(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{S(m)&&n(Go(h))},close:()=>{S(m)&&n(Uo(!1))},resetAnswer:()=>{S(m)&&n(ar())}});b?f(b):n($r(!1))});return function(_x180,_x181){return _ref65.apply(this,arguments)}}()),fd=le("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(ar());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=wx(i,n);r(uy(a)),yield r(md(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x182,_x183){return _ref66.apply(this,arguments)}}());d();c();l();u();var gq=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=We(a,i);return{data:ax({baseUrl:`${m}/rest/organizations/${a}/answer/v1/configs/${p}`,fetchFn:function(){var _ref68=_asyncToGenerator(function*(S){if(S instanceof String)throw new Error("The provided 'request' must be a Request object.");let b=S.url,h={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(A=>{h[A]=S[A]}),h.duplex="half",h.body=yield S.text(),v(b,h)});return function fetchFn(_x187){return _ref68.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function gq(_x184,_x185,_x186){return _ref67.apply(this,arguments)}}(),gd=fx({reducerPath:"answer",baseQuery:sx(gq,{maxRetries:3}),endpoints:()=>({})});var hq=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},yq=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},Sq=(e,t)=>{e.citations=t.citations},vq=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},Aq=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},Cq=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&Aq(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(hq(t,o),r($o(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(yq(t,o),r(Qo({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(Sq(t,o),r(Bo({citations:o.citations})));break;case"genqa.endOfStreamType":vq(t,o),r(xa(o.answerGenerated??!1)),r(Ra());break}},bq=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},zo=gd.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x188,_x189){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:S}=a,b=We(m,g),h=bq(b,m,p.answerConfigurationId,f?.insightId);yield Au(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${S}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref69=_asyncToGenerator(function*(A){let w=A.headers.get("x-answer-id");w&&o(R=>{R.answerId=w,i(Fa(w))})});return function onopen(_x190){return _ref69.apply(this,arguments)}}(),onmessage:A=>{o(w=>{Cq(A,w,i)})},onerror:A=>{throw A},onclose:()=>{o(A=>{i(Ho(!A.generated))})}})}).apply(this,arguments)}})})}),md=e=>zo.endpoints.getAnswer.initiate(e),ly=e=>{let t=Jl(e);return zo.endpoints.getAnswer.select(t??Vo)(e)};d();c();l();u();var _x=ce(Dn,e=>e);d();c();l();u();function xq(e){let t=e.payload?.analyticsAction;return Nx(e)&&!te(t)}function Nx(e){return"type"in e}var qx=e=>t=>r=>{let n;xq(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Nx(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var hd={q:new L,enableQuerySyntax:new ue,aq:new L,cq:new L,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new L,f:new W,fExcluded:new W,cf:new W,nf:new W,mnf:new W,df:new W,debug:new ue,sf:new W,tab:new L,af:new W};var tt=T("searchParameters/restore",e=>_(e,hd)),yd=T("searchParameters/restoreTab",e=>_(e,G));d();c();l();u();var Sd=T("tab/register",e=>{let t=new W({values:{id:G,expression:Ye}});return _(e,t)}),Tt=T("tab/updateActiveTab",e=>_(e,G));d();c();l();u();var vd=Cr(hu(),1),jx=Cr(Dx(),1),Vx=Cr(Mx(),1);vd.default.extend(Vx.default);vd.default.extend(jx.default);var Ad=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:vd.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var Rq=/(^|; )Coveo-Pendragon=([^;]*)/;function gy(){return typeof window>"u"?!1:Rq.exec(document.cookie)?.pop()||null}var Cd=ce(Ad(),e=>e.addCase(ua,(t,r)=>{wq(t,r.payload)}).addCase(la,(t,r)=>{Iq(t,r.payload)}).addCase(fl,(t,r)=>{Eq(t,r.payload)}).addCase(ml,t=>{t.analytics.enabled=!1}).addCase(gl,t=>{t.analytics.enabled=!0}).addCase(nb,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ob,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Tt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(yd,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(tt,(t,r)=>{te(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(ib,(t,{payload:r})=>{t.knowledge.agentId=r}));function wq(e,t){te(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",te(t.organizationId)||(e.organizationId=t.organizationId)}function Iq(e,t){te(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),te(t.locale)||(e.search.locale=t.locale),te(t.timezone)||(e.search.timezone=t.timezone),te(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Eq(e,t){te(t.enabled)||(e.analytics.enabled=t.enabled),te(t.originContext)||(e.analytics.originContext=t.originContext),te(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),te(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),te(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),te(t.trackingId)||(e.analytics.trackingId=t.trackingId),te(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),te(t.source)||(e.analytics.source=t.source);try{let r=gy();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}te(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),te(t.anonymous)||(e.analytics.anonymous=t.anonymous),te(t.deviceId)||(e.analytics.deviceId=t.deviceId),te(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),te(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ve=Cd;d();c();l();u();function Fq(e){return e.instantlyCallable}var Lx=()=>e=>t=>e(Fq(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function Ux(e,t=0){return(Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]).toLowerCase()}d();c();l();u();var hy,Tq=new Uint8Array(16);function yy(){if(!hy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");hy=crypto.getRandomValues.bind(crypto)}return hy(Tq)}d();c();l();u();d();c();l();u();var Pq=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Sy={randomUUID:Pq};function kq(e,t,r){if(Sy.randomUUID&&!t&&!e)return Sy.randomUUID();e=e||{};let n=e.random??e.rng?.()??yy();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Ux(n)}var Xn=kq;d();c();l();u();d();c();l();u();var E={};Ds(E,{BRAND:()=>nD,DIRTY:()=>Wo,EMPTY_PATH:()=>qq,INVALID:()=>ye,NEVER:()=>UD,OK:()=>qt,ParseStatus:()=>kt,Schema:()=>Pe,ZodAny:()=>to,ZodArray:()=>wn,ZodBigInt:()=>Ko,ZodBoolean:()=>Jo,ZodBranded:()=>Fc,ZodCatch:()=>ci,ZodDate:()=>Xo,ZodDefault:()=>si,ZodDiscriminatedUnion:()=>Rd,ZodEffects:()=>yr,ZodEnum:()=>ii,ZodError:()=>Jt,ZodFirstPartyTypeKind:()=>Ae,ZodFunction:()=>Id,ZodIntersection:()=>ri,ZodIssueCode:()=>K,ZodLazy:()=>ni,ZodLiteral:()=>oi,ZodMap:()=>qa,ZodNaN:()=>Ma,ZodNativeEnum:()=>ai,ZodNever:()=>wr,ZodNull:()=>ei,ZodNullable:()=>Wr,ZodNumber:()=>Yo,ZodObject:()=>Xt,ZodOptional:()=>gr,ZodParsedType:()=>ae,ZodPipeline:()=>Tc,ZodPromise:()=>ro,ZodReadonly:()=>ui,ZodRecord:()=>wd,ZodSchema:()=>Pe,ZodSet:()=>Da,ZodString:()=>eo,ZodSymbol:()=>_a,ZodTransformer:()=>yr,ZodTuple:()=>zr,ZodType:()=>Pe,ZodUndefined:()=>Zo,ZodUnion:()=>ti,ZodUnknown:()=>Rn,ZodVoid:()=>Na,addIssueToContext:()=>ie,any:()=>pD,array:()=>hD,bigint:()=>sD,boolean:()=>Xx,coerce:()=>LD,custom:()=>Yx,date:()=>cD,datetimeRegex:()=>zx,defaultErrorMap:()=>bn,discriminatedUnion:()=>AD,effect:()=>OD,enum:()=>TD,function:()=>ID,getErrorMap:()=>Pa,getParsedType:()=>Hr,instanceof:()=>iD,intersection:()=>CD,isAborted:()=>bd,isAsync:()=>ka,isDirty:()=>xd,isValid:()=>Zn,late:()=>oD,lazy:()=>ED,literal:()=>FD,makeIssue:()=>Ec,map:()=>RD,nan:()=>aD,nativeEnum:()=>PD,never:()=>mD,null:()=>dD,nullable:()=>ND,number:()=>Jx,object:()=>yD,objectUtil:()=>vy,oboolean:()=>VD,onumber:()=>jD,optional:()=>_D,ostring:()=>MD,pipeline:()=>DD,preprocess:()=>qD,promise:()=>kD,quotelessJson:()=>Oq,record:()=>xD,set:()=>wD,setErrorMap:()=>Nq,strictObject:()=>SD,string:()=>Kx,symbol:()=>uD,transformer:()=>OD,tuple:()=>bD,undefined:()=>lD,union:()=>vD,unknown:()=>fD,util:()=>Ne,void:()=>gD});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ne;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),a={};for(let p of i)a[p]=o[p];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ne||(Ne={}));var vy;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(vy||(vy={}));var ae=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hr=e=>{switch(typeof e){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return Number.isNaN(e)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(e)?ae.array:e===null?ae.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ae.promise:typeof Map<"u"&&e instanceof Map?ae.map:typeof Set<"u"&&e instanceof Set?ae.set:typeof Date<"u"&&e instanceof Date?ae.date:ae.object;default:return ae.unknown}};var K=Ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Oq=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Jt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let p=n,f=0;for(;f<a.path.length;){let m=a.path[f];f===a.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(a))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Jt.create=e=>new Jt(e);var _q=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===ae.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ne.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ne.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case K.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ne.assertNever(e)}return{message:r}},bn=_q;var Qx=bn;function Nq(e){Qx=e}function Pa(){return Qx}d();c();l();u();var Ec=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(a,{data:t,defaultError:p}).message;return{...o,path:i,message:p}},qq=[];function ie(e,t){let r=Pa(),n=Ec({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===bn?void 0:bn].filter(o=>!!o)});e.common.issues.push(n)}var kt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return ye;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return ye;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},ye=Object.freeze({status:"aborted"}),Wo=e=>({status:"dirty",value:e}),qt=e=>({status:"valid",value:e}),bd=e=>e.status==="aborted",xd=e=>e.status==="dirty",Zn=e=>e.status==="valid",ka=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var hr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Bx=(e,t)=>{if(Zn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Jt(e.common.issues);return this._error=r,this._error}}};function Ie(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,p)=>{let{message:f}=e;return a.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:a.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Pe=class{get description(){return this._def.description}_getType(t){return Hr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Hr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new kt,ctx:{common:t.parent.common,data:t.data,parsedType:Hr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ka(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hr(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Bx(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hr(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Zn(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Zn(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this31=this;return _asyncToGenerator(function*(){let n=yield _this31.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this32=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this32._def.errorMap,parent:null,data:t,parsedType:Hr(t)},o=_this32._parse({data:t,path:n.path,parent:n}),i=yield ka(o)?o:Promise.resolve(o);return Bx(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),p=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(f=>f?!0:(p(),!1)):a?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new yr({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return gr.create(this,this._def)}nullable(){return Wr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wn.create(this)}promise(){return ro.create(this,this._def)}or(t){return ti.create([this,t],this._def)}and(t){return ri.create(this,t,this._def)}transform(t){return new yr({...Ie(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new si({...Ie(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new Fc({typeName:Ae.ZodBranded,type:this,...Ie(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new ci({...Ie(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Tc.create(this,t)}readonly(){return ui.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dq=/^c[^\s-]{8,}$/i,Mq=/^[0-9a-z]+$/,jq=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Lq=/^[a-z0-9_-]{21}$/i,Uq=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qq=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Bq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ay,$q=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hq=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,zq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Wq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kq=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$x="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Jq=new RegExp(`^${$x}$`);function Hx(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Xq(e){return new RegExp(`^${Hx(e)}$`)}function zx(e){let t=`${$x}T${Hx(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Zq(e,t){return!!((t==="v4"||!t)&&$q.test(e)||(t==="v6"||!t)&&zq.test(e))}function eD(e,t){if(!Uq.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function tD(e,t){return!!((t==="v4"||!t)&&Hq.test(e)||(t==="v6"||!t)&&Wq.test(e))}var eo=class e extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ae.string){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_type,expected:ae.string,received:i.parsedType}),ye}let n=new kt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,p=t.data.length<i.value;(a||p)&&(o=this._getOrReturnCtx(t,o),a?ie(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):p&&ie(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Bq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ay||(Ay=new RegExp(Gq,"u")),Ay.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Vq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Lq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Dq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Mq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")jq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ie(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?zx(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?Jq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Xq(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Qq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Zq(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?eD(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?tD(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Yq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?Kq.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):Ne.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...de.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...de.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...de.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};eo.create=e=>new eo({checks:[],typeName:Ae.ZodString,coerce:e?.coerce??!1,...Ie(e)});function rD(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var Yo=class e extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ae.number){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_type,expected:ae.number,received:i.parsedType}),ye}let n,o=new kt;for(let i of this._def.checks)i.kind==="int"?Ne.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?rD(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:K.not_finite,message:i.message}),o.dirty()):Ne.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ne.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Yo.create=e=>new Yo({checks:[],typeName:Ae.ZodNumber,coerce:e?.coerce||!1,...Ie(e)});var Ko=class e extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ae.bigint)return this._getInvalidInput(t);let n,o=new kt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ne.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ie(r,{code:K.invalid_type,expected:ae.bigint,received:r.parsedType}),ye}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ko.create=e=>new Ko({checks:[],typeName:Ae.ZodBigInt,coerce:e?.coerce??!1,...Ie(e)});var Jo=class extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ae.boolean){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.boolean,received:n.parsedType}),ye}return qt(t.data)}};Jo.create=e=>new Jo({typeName:Ae.ZodBoolean,coerce:e?.coerce||!1,...Ie(e)});var Xo=class e extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ae.date){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_type,expected:ae.date,received:i.parsedType}),ye}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ie(i,{code:K.invalid_date}),ye}let n=new kt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ne.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Xo.create=e=>new Xo({checks:[],coerce:e?.coerce||!1,typeName:Ae.ZodDate,...Ie(e)});var _a=class extends Pe{_parse(t){if(this._getType(t)!==ae.symbol){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.symbol,received:n.parsedType}),ye}return qt(t.data)}};_a.create=e=>new _a({typeName:Ae.ZodSymbol,...Ie(e)});var Zo=class extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.undefined,received:n.parsedType}),ye}return qt(t.data)}};Zo.create=e=>new Zo({typeName:Ae.ZodUndefined,...Ie(e)});var ei=class extends Pe{_parse(t){if(this._getType(t)!==ae.null){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.null,received:n.parsedType}),ye}return qt(t.data)}};ei.create=e=>new ei({typeName:Ae.ZodNull,...Ie(e)});var to=class extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return qt(t.data)}};to.create=e=>new to({typeName:Ae.ZodAny,...Ie(e)});var Rn=class extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qt(t.data)}};Rn.create=e=>new Rn({typeName:Ae.ZodUnknown,...Ie(e)});var wr=class extends Pe{_parse(t){let r=this._getOrReturnCtx(t);return ie(r,{code:K.invalid_type,expected:ae.never,received:r.parsedType}),ye}};wr.create=e=>new wr({typeName:Ae.ZodNever,...Ie(e)});var Na=class extends Pe{_parse(t){if(this._getType(t)!==ae.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.void,received:n.parsedType}),ye}return qt(t.data)}};Na.create=e=>new Na({typeName:Ae.ZodVoid,...Ie(e)});var wn=class e extends Pe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ae.array)return ie(r,{code:K.invalid_type,expected:ae.array,received:r.parsedType}),ye;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(a||p)&&(ie(r,{code:a?K.too_big:K.too_small,minimum:p?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ie(r,{code:K.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ie(r,{code:K.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,p)=>o.type._parseAsync(new hr(r,a,r.path,p)))).then(a=>kt.mergeArray(n,a));let i=[...r.data].map((a,p)=>o.type._parseSync(new hr(r,a,r.path,p)));return kt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}};wn.create=(e,t)=>new wn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Ie(t)});function Oa(e){if(e instanceof Xt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=gr.create(Oa(n))}return new Xt({...e._def,shape:()=>t})}else return e instanceof wn?new wn({...e._def,type:Oa(e.element)}):e instanceof gr?gr.create(Oa(e.unwrap())):e instanceof Wr?Wr.create(Oa(e.unwrap())):e instanceof zr?zr.create(e.items.map(t=>Oa(t))):e}var Xt=class e extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ne.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ae.object){let m=this._getOrReturnCtx(t);return ie(m,{code:K.invalid_type,expected:ae.object,received:m.parsedType}),ye}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),p=[];if(!(this._def.catchall instanceof wr&&this._def.unknownKeys==="strip"))for(let m in o.data)a.includes(m)||p.push(m);let f=[];for(let m of a){let g=i[m],S=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new hr(o,S,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof wr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ie(o,{code:K.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let S=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new hr(o,S,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let S=yield g.key,b=yield g.value;m.push({key:S,value:b,alwaysSet:g.alwaysSet})}return m})).then(m=>kt.mergeObjectSync(n,m)):kt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:de.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Ne.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Ne.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Oa(this)}partial(t){let r={};for(let n of Ne.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Ne.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof gr;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Wx(Ne.objectKeys(this.shape))}};Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:wr.create(),typeName:Ae.ZodObject,...Ie(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:wr.create(),typeName:Ae.ZodObject,...Ie(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:wr.create(),typeName:Ae.ZodObject,...Ie(t)});var ti=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let p of i)if(p.result.status==="valid")return p.result;for(let p of i)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let a=i.map(p=>new Jt(p.ctx.common.issues));return ie(r,{code:K.invalid_union,unionErrors:a}),ye}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x191){return _ref71.apply(this,arguments)}}())).then(o);{let i,a=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:m}),m.common.issues.length&&a.push(m.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let p=a.map(f=>new Jt(f));return ie(r,{code:K.invalid_union,unionErrors:p}),ye}}get options(){return this._def.options}};ti.create=(e,t)=>new ti({options:e,typeName:Ae.ZodUnion,...Ie(t)});var xn=e=>e instanceof ni?xn(e.schema):e instanceof yr?xn(e.innerType()):e instanceof oi?[e.value]:e instanceof ii?e.options:e instanceof ai?Ne.objectValues(e.enum):e instanceof si?xn(e._def.innerType):e instanceof Zo?[void 0]:e instanceof ei?[null]:e instanceof gr?[void 0,...xn(e.unwrap())]:e instanceof Wr?[null,...xn(e.unwrap())]:e instanceof Fc||e instanceof ui?xn(e.unwrap()):e instanceof ci?xn(e._def.innerType):[],Rd=class e extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.object)return ie(r,{code:K.invalid_type,expected:ae.object,received:r.parsedType}),ye;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=xn(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of a){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,i)}}return new e({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Ie(n)})}};function Cy(e,t){let r=Hr(e),n=Hr(t);if(e===t)return{valid:!0,data:e};if(r===ae.object&&n===ae.object){let o=Ne.objectKeys(t),i=Ne.objectKeys(e).filter(p=>o.indexOf(p)!==-1),a={...e,...t};for(let p of i){let f=Cy(e[p],t[p]);if(!f.valid)return{valid:!1};a[p]=f.data}return{valid:!0,data:a}}else if(r===ae.array&&n===ae.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],p=t[i],f=Cy(a,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===ae.date&&n===ae.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ri=class extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(bd(i)||bd(a))return ye;let p=Cy(i.value,a.value);return p.valid?((xd(i)||xd(a))&&r.dirty(),{status:r.value,value:p.data}):(ie(n,{code:K.invalid_intersection_types}),ye)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ri.create=(e,t,r)=>new ri({left:e,right:t,typeName:Ae.ZodIntersection,...Ie(r)});var zr=class e extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.array)return ie(n,{code:K.invalid_type,expected:ae.array,received:n.parsedType}),ye;if(n.data.length<this._def.items.length)return ie(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&n.data.length>this._def.items.length&&(ie(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new hr(n,a,n.path,p)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>kt.mergeArray(r,a)):kt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};zr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zr({items:e,typeName:Ae.ZodTuple,rest:null,...Ie(t)})};var wd=class e extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.object)return ie(n,{code:K.invalid_type,expected:ae.object,received:n.parsedType}),ye;let o=[],i=this._def.keyType,a=this._def.valueType;for(let p in n.data)o.push({key:i._parse(new hr(n,p,n.path,p)),value:a._parse(new hr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?kt.mergeObjectAsync(r,o):kt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Pe?new e({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Ie(n)}):new e({keyType:eo.create(),valueType:t,typeName:Ae.ZodRecord,...Ie(r)})}},qa=class extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.map)return ie(n,{code:K.invalid_type,expected:ae.map,received:n.parsedType}),ye;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new hr(n,p,n.path,[m,"key"])),value:i._parse(new hr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of a){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return ye;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of a){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return ye;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};qa.create=(e,t,r)=>new qa({valueType:t,keyType:e,typeName:Ae.ZodMap,...Ie(r)});var Da=class e extends Pe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.set)return ie(n,{code:K.invalid_type,expected:ae.set,received:n.parsedType}),ye;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ie(n,{code:K.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ie(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(f){let m=new Set;for(let g of f){if(g.status==="aborted")return ye;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>i._parse(new hr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>a(f)):a(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Da.create=(e,t)=>new Da({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Ie(t)});var Id=class e extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.function)return ie(r,{code:K.invalid_type,expected:ae.function,received:r.parsedType}),ye;function n(p,f){return Ec({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pa(),bn].filter(m=>!!m),issueData:{code:K.invalid_arguments,argumentsError:f}})}function o(p,f){return Ec({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pa(),bn].filter(m=>!!m),issueData:{code:K.invalid_return_type,returnTypeError:f}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof ro){let p=this;return qt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new Jt([]),g=yield p._def.args.parseAsync(f,i).catch(h=>{throw m.addIssue(n(f,h)),m}),S=yield Reflect.apply(a,this,g);return yield p._def.returns._def.type.parseAsync(S,i).catch(h=>{throw m.addIssue(o(S,h)),m})}))}else{let p=this;return qt(function(...f){let m=p._def.args.safeParse(f,i);if(!m.success)throw new Jt([n(f,m.error)]);let g=Reflect.apply(a,this,m.data),S=p._def.returns.safeParse(g,i);if(!S.success)throw new Jt([o(g,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:zr.create(t).rest(Rn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||zr.create([]).rest(Rn.create()),returns:r||Rn.create(),typeName:Ae.ZodFunction,...Ie(n)})}},ni=class extends Pe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ni.create=(e,t)=>new ni({getter:e,typeName:Ae.ZodLazy,...Ie(t)});var oi=class extends Pe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:t.data}}get value(){return this._def.value}};oi.create=(e,t)=>new oi({value:e,typeName:Ae.ZodLiteral,...Ie(t)});function Wx(e,t){return new ii({values:e,typeName:Ae.ZodEnum,...Ie(t)})}var ii=class e extends Pe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:Ne.joinValues(n),received:r.parsedType,code:K.invalid_type}),ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{received:r.data,code:K.invalid_enum_value,options:n}),ye}return qt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ii.create=Wx;var ai=class extends Pe{_parse(t){let r=Ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let o=Ne.objectValues(r);return ie(n,{expected:Ne.joinValues(o),received:n.parsedType,code:K.invalid_type}),ye}if(this._cache||(this._cache=new Set(Ne.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ne.objectValues(r);return ie(n,{received:n.data,code:K.invalid_enum_value,options:o}),ye}return qt(t.data)}get enum(){return this._def.values}};ai.create=(e,t)=>new ai({values:e,typeName:Ae.ZodNativeEnum,...Ie(t)});var ro=class extends Pe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.promise&&r.common.async===!1)return ie(r,{code:K.invalid_type,expected:ae.promise,received:r.parsedType}),ye;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return qt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ro.create=(e,t)=>new ro({type:e,typeName:Ae.ZodPromise,...Ie(t)});var yr=class extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this33=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ie(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(p){if(r.value==="aborted")return ye;let f=yield _this33._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?ye:f.status==="dirty"?Wo(f.value):r.value==="dirty"?Wo(f.value):f});return function(_x192){return _ref74.apply(this,arguments)}}());{if(r.value==="aborted")return ye;let p=this._def.schema._parseSync({data:a,path:n.path,parent:n});return p.status==="aborted"?ye:p.status==="dirty"?Wo(p.value):r.value==="dirty"?Wo(p.value):p}}if(o.type==="refinement"){let a=p=>{let f=o.refinement(p,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?ye:(p.status==="dirty"&&r.dirty(),a(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?ye:(p.status==="dirty"&&r.dirty(),a(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Zn(a))return ye;let p=o.transform(a.value,i);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Zn(a)?Promise.resolve(o.transform(a.value,i)).then(p=>({status:r.value,value:p})):ye);Ne.assertNever(o)}};yr.create=(e,t,r)=>new yr({schema:e,typeName:Ae.ZodEffects,effect:t,...Ie(r)});yr.createWithPreprocess=(e,t,r)=>new yr({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Ie(r)});var gr=class extends Pe{_parse(t){return this._getType(t)===ae.undefined?qt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};gr.create=(e,t)=>new gr({innerType:e,typeName:Ae.ZodOptional,...Ie(t)});var Wr=class extends Pe{_parse(t){return this._getType(t)===ae.null?qt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Wr.create=(e,t)=>new Wr({innerType:e,typeName:Ae.ZodNullable,...Ie(t)});var si=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};si.create=(e,t)=>new si({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ie(t)});var ci=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ka(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ci.create=(e,t)=>new ci({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ie(t)});var Ma=class extends Pe{_parse(t){if(this._getType(t)!==ae.nan){let n=this._getOrReturnCtx(t);return ie(n,{code:K.invalid_type,expected:ae.nan,received:n.parsedType}),ye}return{status:"valid",value:t.data}}};Ma.create=e=>new Ma({typeName:Ae.ZodNaN,...Ie(e)});var nD=Symbol("zod_brand"),Fc=class extends Pe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Tc=class e extends Pe{_parse(t){var _this34=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this34._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ye:i.status==="dirty"?(r.dirty(),Wo(i.value)):_this34._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ye:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Ae.ZodPipeline})}},ui=class extends Pe{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Zn(o)&&(o.value=Object.freeze(o.value)),o);return ka(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};ui.create=(e,t)=>new ui({innerType:e,typeName:Ae.ZodReadonly,...Ie(t)});function Gx(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Yx(e,t={},r){return e?to.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let p=Gx(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!i){let a=Gx(t,n),p=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:p})}}):to.create()}var oD={object:Xt.lazycreate},Ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));var iD=(e,t={message:`Input not instance of ${e.name}`})=>Yx(r=>r instanceof e,t),Kx=eo.create,Jx=Yo.create,aD=Ma.create,sD=Ko.create,Xx=Jo.create,cD=Xo.create,uD=_a.create,lD=Zo.create,dD=ei.create,pD=to.create,fD=Rn.create,mD=wr.create,gD=Na.create,hD=wn.create,yD=Xt.create,SD=Xt.strictCreate,vD=ti.create,AD=Rd.create,CD=ri.create,bD=zr.create,xD=wd.create,RD=qa.create,wD=Da.create,ID=Id.create,ED=ni.create,FD=oi.create,TD=ii.create,PD=ai.create,kD=ro.create,OD=yr.create,_D=gr.create,ND=Wr.create,qD=yr.createWithPreprocess,DD=Tc.create,MD=()=>Kx().optional(),jD=()=>Jx().optional(),VD=()=>Xx().optional(),LD={string:e=>eo.create({...e,coerce:!0}),number:e=>Yo.create({...e,coerce:!0}),boolean:e=>Jo.create({...e,coerce:!0}),bigint:e=>Ko.create({...e,coerce:!0}),date:e=>Xo.create({...e,coerce:!0})};var UD=ye;var QD=E.object({name:E.string(),arguments:E.string()}),BD=E.object({id:E.string(),type:E.literal("function"),function:QD,encryptedValue:E.string().optional()}),Ed=E.object({id:E.string(),role:E.string(),content:E.string().optional(),name:E.string().optional(),encryptedValue:E.string().optional()}),GD=E.object({type:E.literal("text"),text:E.string()}),Zx=E.object({type:E.literal("binary"),mimeType:E.string(),id:E.string().optional(),url:E.string().optional(),data:E.string().optional(),filename:E.string().optional()}),eR=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:E.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Vce=Zx.superRefine((e,t)=>{eR(e,t)}),$D=E.discriminatedUnion("type",[GD,Zx]),HD=$D.superRefine((e,t)=>{e.type==="binary"&&eR(e,t)}),zD=Ed.extend({role:E.literal("developer"),content:E.string()}),WD=Ed.extend({role:E.literal("system"),content:E.string()}),YD=Ed.extend({role:E.literal("assistant"),content:E.string().optional(),toolCalls:E.array(BD).optional()}),KD=Ed.extend({role:E.literal("user"),content:E.union([E.string(),E.array(HD)])}),JD=E.object({id:E.string(),content:E.string(),role:E.literal("tool"),toolCallId:E.string(),error:E.string().optional(),encryptedValue:E.string().optional()}),XD=E.object({id:E.string(),role:E.literal("activity"),activityType:E.string(),content:E.record(E.any())}),ZD=E.object({id:E.string(),role:E.literal("reasoning"),content:E.string(),encryptedValue:E.string().optional()}),tR=E.discriminatedUnion("role",[zD,WD,YD,KD,JD,XD,ZD]),Lce=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user"),E.literal("tool"),E.literal("activity"),E.literal("reasoning")]),eM=E.object({description:E.string(),value:E.string()}),tM=E.object({name:E.string(),description:E.string(),parameters:E.any()}),rM=E.object({threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),state:E.any(),messages:E.array(tR),tools:E.array(tM),context:E.array(eM),forwardedProps:E.any()}),nM=E.any(),st=class extends Error{constructor(e){super(e)}},by=class extends st{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},rR=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user")]),D=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Le=E.object({type:E.nativeEnum(D),timestamp:E.number().optional(),rawEvent:E.any().optional()}).passthrough(),oM=Le.extend({type:E.literal(D.TEXT_MESSAGE_START),messageId:E.string(),role:rR.default("assistant")}),nR=Le.extend({type:E.literal(D.TEXT_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),iM=Le.extend({type:E.literal(D.TEXT_MESSAGE_END),messageId:E.string()}),aM=Le.extend({type:E.literal(D.TEXT_MESSAGE_CHUNK),messageId:E.string().optional(),role:rR.optional(),delta:E.string().optional()}),sM=Le.extend({type:E.literal(D.THINKING_TEXT_MESSAGE_START)}),cM=nR.omit({messageId:!0,type:!0}).extend({type:E.literal(D.THINKING_TEXT_MESSAGE_CONTENT)}),uM=Le.extend({type:E.literal(D.THINKING_TEXT_MESSAGE_END)}),lM=Le.extend({type:E.literal(D.TOOL_CALL_START),toolCallId:E.string(),toolCallName:E.string(),parentMessageId:E.string().optional()}),dM=Le.extend({type:E.literal(D.TOOL_CALL_ARGS),toolCallId:E.string(),delta:E.string()}),pM=Le.extend({type:E.literal(D.TOOL_CALL_END),toolCallId:E.string()}),fM=Le.extend({messageId:E.string(),type:E.literal(D.TOOL_CALL_RESULT),toolCallId:E.string(),content:E.string(),role:E.literal("tool").optional()}),mM=Le.extend({type:E.literal(D.TOOL_CALL_CHUNK),toolCallId:E.string().optional(),toolCallName:E.string().optional(),parentMessageId:E.string().optional(),delta:E.string().optional()}),gM=Le.extend({type:E.literal(D.THINKING_START),title:E.string().optional()}),hM=Le.extend({type:E.literal(D.THINKING_END)}),yM=Le.extend({type:E.literal(D.STATE_SNAPSHOT),snapshot:nM}),SM=Le.extend({type:E.literal(D.STATE_DELTA),delta:E.array(E.any())}),vM=Le.extend({type:E.literal(D.MESSAGES_SNAPSHOT),messages:E.array(tR)}),AM=Le.extend({type:E.literal(D.ACTIVITY_SNAPSHOT),messageId:E.string(),activityType:E.string(),content:E.record(E.any()),replace:E.boolean().optional().default(!0)}),CM=Le.extend({type:E.literal(D.ACTIVITY_DELTA),messageId:E.string(),activityType:E.string(),patch:E.array(E.any())}),bM=Le.extend({type:E.literal(D.RAW),event:E.any(),source:E.string().optional()}),xM=Le.extend({type:E.literal(D.CUSTOM),name:E.string(),value:E.any()}),RM=Le.extend({type:E.literal(D.RUN_STARTED),threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),input:rM.optional()}),wM=Le.extend({type:E.literal(D.RUN_FINISHED),threadId:E.string(),runId:E.string(),result:E.any().optional()}),IM=Le.extend({type:E.literal(D.RUN_ERROR),message:E.string(),code:E.string().optional()}),EM=Le.extend({type:E.literal(D.STEP_STARTED),stepName:E.string()}),FM=Le.extend({type:E.literal(D.STEP_FINISHED),stepName:E.string()}),TM=E.union([E.literal("tool-call"),E.literal("message")]),PM=Le.extend({type:E.literal(D.REASONING_START),messageId:E.string()}),kM=Le.extend({type:E.literal(D.REASONING_MESSAGE_START),messageId:E.string(),role:E.literal("reasoning")}),OM=Le.extend({type:E.literal(D.REASONING_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),_M=Le.extend({type:E.literal(D.REASONING_MESSAGE_END),messageId:E.string()}),NM=Le.extend({type:E.literal(D.REASONING_MESSAGE_CHUNK),messageId:E.string().optional(),delta:E.string().optional()}),qM=Le.extend({type:E.literal(D.REASONING_END),messageId:E.string()}),DM=Le.extend({type:E.literal(D.REASONING_ENCRYPTED_VALUE),subtype:TM,entityId:E.string(),encryptedValue:E.string()}),Fd=E.discriminatedUnion("type",[oM,nR,iM,aM,gM,hM,sM,cM,uM,lM,dM,pM,mM,fM,yM,SM,vM,AM,CM,bM,xM,RM,wM,IM,EM,FM,PM,kM,OM,_M,NM,qM,DM]);d();c();l();u();var xy={};Ds(xy,{JsonPatchError:()=>lt,_areEquals:()=>Oc,applyOperation:()=>li,applyPatch:()=>no,applyReducer:()=>UM,deepClone:()=>VM,getValueByPointer:()=>_d,validate:()=>iR,validator:()=>Nd});d();c();l();u();d();c();l();u();var MM=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),jM=Object.prototype.hasOwnProperty;function Pd(e,t){return jM.call(e,t)}function kd(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Pd(e,o)&&n.push(o);return n}function Ot(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Od(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function Yr(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Pc(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Td(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Td(e[t]))return!0}else if(typeof e=="object"){for(var n=kd(e),o=n.length,i=0;i<o;i++)if(Td(e[n[i]]))return!0}}return!1}function oR(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
|
|
32
|
+
`)}var kc=function(e){MM(t,e);function t(r,n,o,i,a){var p=this.constructor,f=e.call(this,oR(r,{name:n,index:o,operation:i,tree:a}))||this;return f.name=n,f.index=o,f.operation=i,f.tree=a,Object.setPrototypeOf(f,p.prototype),f.message=oR(r,{name:n,index:o,operation:i,tree:a}),f}return t}(Error);var lt=kc,VM=Ot,ja={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=_d(r,this.path);n&&(n=Ot(n));var o=li(r,{op:"remove",path:this.from}).removed;return li(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=_d(r,this.from);return li(r,{op:"add",path:this.path,value:Ot(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Oc(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},LM={add:function(e,t,r){return Od(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:ja.move,copy:ja.copy,test:ja.test,_get:ja._get};function _d(e,t){if(t=="")return e;var r={op:"_get",path:t};return li(e,r),r.value}function li(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):Nd(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=_d(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=Oc(e,t.value),a.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new lt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=Ot(e));var p=t.path||"",f=p.split("/"),m=e,g=1,S=f.length,b=void 0,h=void 0,A=void 0;for(typeof r=="function"?A=r:A=Nd;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=Pc(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&b===void 0&&(m[h]===void 0?b=f.slice(0,g).join("/"):g==S-1&&(b=t.path),b!==void 0&&A(t,0,e,b)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!Od(h))throw new lt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);Od(h)&&(h=~~h)}if(g>=S){if(r&&t.op==="add"&&h>m.length)throw new lt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=LM[t.op].call(t,m,h,e);if(a.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(g>=S){var a=ja[t.op].call(t,m,h,e);if(a.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(m=m[h],r&&g<S&&(!m||typeof m!="object"))throw new lt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function no(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new lt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Ot(e));for(var i=new Array(t.length),a=0,p=t.length;a<p;a++)i[a]=li(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function UM(e,t,r){var n=li(e,t);if(n.test===!1)throw new lt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Nd(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new lt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(ja[e.op]){if(typeof e.path!="string")throw new lt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new lt("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new lt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new lt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Td(e.value))throw new lt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new lt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new lt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},p=iR([a],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new lt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new lt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function iR(e,t,r){try{if(!Array.isArray(e))throw new lt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)no(Ot(t),Ot(e),r||!0);else{r=r||Nd;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof lt)return o;throw o}}function Oc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!Oc(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(i=p.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=i;o--!==0;)if(a=p[o],!Oc(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Ey={};Ds(Ey,{compare:()=>YM,generate:()=>Ry,observe:()=>WM,unobserve:()=>zM});d();c();l();u();var wy=new WeakMap,QM=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),BM=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function GM(e){return wy.get(e)}function $M(e,t){return e.observers.get(t)}function HM(e,t){e.observers.delete(t.callback)}function zM(e,t){t.unobserve()}function WM(e,t){var r=[],n,o=GM(e);if(!o)o=new QM(e),wy.set(e,o);else{var i=$M(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=Ot(e),t){n.callback=t,n.next=null;var a=function(){Ry(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){Ry(n),clearTimeout(n.next),HM(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new BM(t,n)),n}function Ry(e,t){t===void 0&&(t=!1);var r=wy.get(e.object);Iy(r.value,e.object,e.patches,"",t),e.patches.length&&no(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Iy(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=kd(t),a=kd(e),p=!1,f=!1,m=a.length-1;m>=0;m--){var g=a[m],S=e[g];if(Pd(t,g)&&!(t[g]===void 0&&S!==void 0&&Array.isArray(t)===!1)){var b=t[g];typeof S=="object"&&S!=null&&typeof b=="object"&&b!=null&&Array.isArray(S)===Array.isArray(b)?Iy(S,b,r,n+"/"+Yr(g),o):S!==b&&(p=!0,o&&r.push({op:"test",path:n+"/"+Yr(g),value:Ot(S)}),r.push({op:"replace",path:n+"/"+Yr(g),value:Ot(b)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+Yr(g),value:Ot(S)}),r.push({op:"remove",path:n+"/"+Yr(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&i.length==a.length))for(var m=0;m<i.length;m++){var g=i[m];!Pd(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+Yr(g),value:Ot(t[g])})}}}function YM(e,t,r){r===void 0&&(r=!1);var n=[];return Iy(e,t,n,"",r),n}var due=Object.assign({},xy,Ey,{JsonPatchError:kc,deepClone:Ot,escapePathComponent:Yr,unescapePathComponent:Pc});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Fy=function(e,t){return Fy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Fy(e,t)};function Kr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fy(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function aR(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function p(g){try{m(n.next(g))}catch(S){a(S)}}function f(g){try{m(n.throw(g))}catch(S){a(S)}}function m(g){g.done?i(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function qd(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=p(0),a.throw=p(1),a.return=p(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(i=m[0]&2?o.return:m[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,m[1])).done)return i;switch(o=0,i&&(m=[m[0]&2,i.value]),m[0]){case 0:case 1:i=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){r.label=m[1];break}if(m[0]===6&&r.label<i[1]){r.label=i[1],i=m;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(m);break}i[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=i=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function In(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Va(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(p){a={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function La(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function di(e){return this instanceof di?(this.v=e,this):new di(e)}function sR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(h){return function(A){return Promise.resolve(A).then(h,S)}}function p(h,A){n[h]&&(o[h]=function(w){return new Promise(function(R,x){i.push([h,w,R,x])>1||f(h,w)})},A&&(o[h]=A(o[h])))}function f(h,A){try{m(n[h](A))}catch(w){b(i[0][3],w)}}function m(h){h.value instanceof di?Promise.resolve(h.value.v).then(g,S):b(i[0][2],h)}function g(h){f("next",h)}function S(h){f("throw",h)}function b(h,A){h(A),i.shift(),i.length&&f(i[0][0],i[0][1])}}function cR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof In=="function"?In(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(p,f){a=e[i](a),o(p,f,a.done,a.value)})}}function o(i,a,p,f){Promise.resolve(f).then(function(m){i({value:m,done:p})},a)}}d();c();l();u();function Oe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function Ua(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Dd=Ua(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
33
33
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
34
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Nc(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ba=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var p=In(a),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(x){t={error:x}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else a.remove(this);var h=this.initialTeardown;if(Oe(h))try{h()}catch(x){i=x instanceof qd?x.errors:[x]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var C=In(v),g=C.next();!g.done;g=C.next()){var S=g.value;try{nR(S)}catch(x){i=i??[],x instanceof qd?i=Ua(Ua([],La(i)),La(x.errors)):i.push(x)}}}catch(x){n={error:x}}finally{try{g&&!g.done&&(o=C.return)&&o.call(C)}finally{if(n)throw n.error}}}if(i)throw new qd(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)nR(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Nc(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Nc(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Iy=Ba.EMPTY;function Dd(e){return e instanceof Ba||e&&"closed"in e&&Oe(e.remove)&&Oe(e.add)&&Oe(e.unsubscribe)}function nR(e){Oe(e)?e():e.unsubscribe()}d();c();l();u();var Ir={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var Ga={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Ga.delegate;return o?.setTimeout?o.setTimeout.apply(o,Ua([e,t],La(r))):setTimeout.apply(void 0,Ua([e,t],La(r)))},clearTimeout:function(e){var t=Ga.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Md(e){Ga.setTimeout(function(){var t=Ir.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function qc(){}d();c();l();u();var oR=function(){return Ey("C",void 0,void 0)}();function iR(e){return Ey("E",void 0,e)}function aR(e){return Ey("N",e,void 0)}function Ey(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var pi=null;function $a(e){if(Ir.useDeprecatedSynchronousErrorHandling){var t=!pi;if(t&&(pi={errorThrown:!1,error:null}),e(),t){var r=pi,n=r.errorThrown,o=r.error;if(pi=null,n)throw o}}else e()}function sR(e){Ir.useDeprecatedSynchronousErrorHandling&&pi&&(pi.errorThrown=!0,pi.error=e)}var Dc=function(e){Kr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Dd(r)&&r.add(n)):n.destination=KM,n}return t.create=function(r,n,o){return new Vd(r,n,o)},t.prototype.next=function(r){this.isStopped?Ty(aR(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Ty(iR(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Ty(oR,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ba);var zM=Function.prototype.bind;function Fy(e,t){return zM.call(e,t)}var WM=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){jd(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){jd(n)}else jd(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){jd(r)}},e}(),Vd=function(e){Kr(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(Oe(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;i&&Ir.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&Fy(r.next,p),error:r.error&&Fy(r.error,p),complete:r.complete&&Fy(r.complete,p)}):a=r}return i.destination=new WM(a),i}return t}(Dc);function jd(e){Ir.useDeprecatedSynchronousErrorHandling?sR(e):Md(e)}function YM(e){throw e}function Ty(e,t){var r=Ir.onStoppedNotification;r&&Ga.setTimeout(function(){return r(e,t)})}var KM={closed:!0,next:qc,error:YM,complete:qc};d();c();l();u();var Ha=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function za(e){return e}function Ld(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Py(e)}function Py(e){return e.length===0?za:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var rt=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=XM(t)?t:new Vd(t,r,n);return $a(function(){var a=o,p=a.operator,f=a.source;i.add(p?p.call(i,f):f?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=cR(r),new r(function(o,i){var a=new Vd({next:function(p){try{t(p)}catch(f){i(f),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Ha]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Py(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=cR(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function cR(e){var t;return(t=e??Ir.Promise)!==null&&t!==void 0?t:Promise}function JM(e){return e&&Oe(e.next)&&Oe(e.error)&&Oe(e.complete)}function XM(e){return e&&e instanceof Dc||JM(e)&&Dd(e)}d();c();l();u();function ZM(e){return Oe(e?.lift)}function gt(e){return function(t){if(ZM(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function At(e,t,r,n,o){return new ej(e,t,r,n,o)}var ej=function(e){Kr(t,e);function t(r,n,o,i,a,p){var f=e.call(this,r)||this;return f.onFinalize=a,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(h){r.error(h)}}:e.prototype._next,f._error=i?function(m){try{i(m)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Dc);d();c();l();u();d();c();l();u();var uR=Qa(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var Jr=function(e){Kr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new lR(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new uR},t.prototype.next=function(r){var n=this;$a(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=In(n.currentObservers),p=a.next();!p.done;p=a.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;$a(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;$a(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,p=o.observers;return i||a?Iy:(this.currentObservers=null,p.push(r),new Ba(function(){n.currentObservers=null,Nc(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new rt;return r.source=this,r},t.create=function(r,n){return new lR(r,n)},t}(rt);var lR=function(e){Kr(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Iy},t}(Jr);d();c();l();u();d();c();l();u();var ky={now:function(){return(ky.delegate||Date).now()},delegate:void 0};var Ud=function(e){Kr(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=ky);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(i.push(r),!a&&i.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,p=a.slice(),f=0;f<p.length&&!r.closed;f+=i?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,p=(a?1:2)*n;if(n<1/0&&p<i.length&&i.splice(0,i.length-p),!a){for(var f=o.now(),m=0,h=1;h<i.length&&i[h]<=f;h+=2)m=h;m&&i.splice(0,m+1)}},t}(Jr);d();c();l();u();var Qd=new rt(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function dR(e){return e&&Oe(e.schedule)}function tj(e){return e[e.length-1]}function pR(e){return dR(tj(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Bd=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function Gd(e){return Oe(e?.then)}d();c();l();u();function $d(e){return Oe(e[Ha])}d();c();l();u();function Hd(e){return Symbol.asyncIterator&&Oe(e?.[Symbol.asyncIterator])}d();c();l();u();function zd(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function rj(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Wd=rj();function Yd(e){return Oe(e?.[Wd])}d();c();l();u();function Kd(e){return tR(this,arguments,function(){var r,n,o,i;return Nd(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,di(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,di(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,di(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Jd(e){return Oe(e?.getReader)}function Ct(e){if(e instanceof rt)return e;if(e!=null){if($d(e))return nj(e);if(Bd(e))return oj(e);if(Gd(e))return ij(e);if(Hd(e))return fR(e);if(Yd(e))return aj(e);if(Jd(e))return sj(e)}throw zd(e)}function nj(e){return new rt(function(t){var r=e[Ha]();if(Oe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function oj(e){return new rt(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function ij(e){return new rt(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Md)})}function aj(e){return new rt(function(t){var r,n;try{for(var o=In(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(p){r={error:p}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function fR(e){return new rt(function(t){cj(e,t).catch(function(r){return t.error(r)})})}function sj(e){return fR(Kd(e))}function cj(e,t){var r,n,o,i;return eR(this,void 0,void 0,function(){var a,p;return Nd(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=rR(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function Sr(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function Xd(e,t){return t===void 0&&(t=0),gt(function(r,n){r.subscribe(At(n,function(o){return Sr(n,e,function(){return n.next(o)},t)},function(){return Sr(n,e,function(){return n.complete()},t)},function(o){return Sr(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function Zd(e,t){return t===void 0&&(t=0),gt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function mR(e,t){return Ct(e).pipe(Zd(t),Xd(t))}d();c();l();u();function gR(e,t){return Ct(e).pipe(Zd(t),Xd(t))}d();c();l();u();function hR(e,t){return new rt(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function yR(e,t){return new rt(function(r){var n;return Sr(r,t,function(){n=e[Wd](),Sr(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(p){r.error(p);return}a?r.complete():r.next(i)},0,!0)}),function(){return Oe(n?.return)&&n.return()}})}d();c();l();u();function ep(e,t){if(!e)throw new Error("Iterable cannot be null");return new rt(function(r){Sr(r,t,function(){var n=e[Symbol.asyncIterator]();Sr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function SR(e,t){return ep(Kd(e),t)}function vR(e,t){if(e!=null){if($d(e))return mR(e,t);if(Bd(e))return hR(e,t);if(Gd(e))return gR(e,t);if(Hd(e))return ep(e,t);if(Yd(e))return yR(e,t);if(Jd(e))return SR(e,t)}throw zd(e)}function fi(e,t){return t?vR(e,t):Ct(e)}function ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=pR(e);return fi(e,r)}d();c();l();u();function nt(e,t){var r=Oe(e)?e:function(){return e},n=function(o){return o.error(r())};return new rt(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var AR=Qa(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function tp(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(p){a=p,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new AR)}})})}d();c();l();u();function mi(e,t){return gt(function(r,n){var o=0;r.subscribe(At(n,function(i){n.next(e.call(t,i,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function CR(e,t,r,n,o,i,a,p){var f=[],m=0,h=0,v=!1,C=function(){v&&!f.length&&!m&&t.complete()},g=function(x){return m<n?S(x):f.push(x)},S=function(x){i&&t.next(x),m++;var w=!1;Ct(r(x,h++)).subscribe(At(t,function(R){o?.(R),i?g(R):t.next(R)},function(){w=!0},void 0,function(){if(w)try{m--;for(var R=function(){var I=f.shift();a?Sr(t,a,function(){return S(I)}):S(I)};f.length&&m<n;)R();C()}catch(I){t.error(I)}}))};return e.subscribe(At(t,g,function(){v=!0,C()})),function(){p?.()}}function Zt(e,t,r){return r===void 0&&(r=1/0),Oe(t)?Zt(function(n,o){return mi(function(i,a){return t(n,i,o,a)})(Ct(e(n,o)))},r):(typeof t=="number"&&(r=t),gt(function(n,o){return CR(n,o,e,r)}))}function Oy(e){return e===void 0&&(e=1/0),Zt(za,e)}d();c();l();u();function _y(e){return new rt(function(t){Ct(e()).subscribe(t)})}d();c();l();u();function Mc(e){return gt(function(t,r){var n=null,o=!1,i;n=t.subscribe(At(r,void 0,void 0,function(a){i=Ct(e(a,Mc(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}d();c();l();u();function rp(e,t){return Oe(t)?Zt(e,t,1):Zt(e,1)}d();c();l();u();function Ny(e){return gt(function(t,r){var n=!1;t.subscribe(At(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function gi(e){return gt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function qy(e,t){return gt(function(r,n){var o=null,i=0,a=!1,p=function(){return a&&!o&&n.complete()};r.subscribe(At(n,function(f){o?.unsubscribe();var m=0,h=i++;Ct(e(f,h)).subscribe(o=At(n,function(v){return n.next(t?t(f,v,h,m++):v)},function(){o=null,p()}))},function(){a=!0,p()}))})}d();c();l();u();function np(e){return gt(function(t,r){Ct(e).subscribe(At(r,function(){return r.complete()},qc)),!r.closed&&t.subscribe(r)})}d();c();l();u();function Dy(e,t,r){var n=Oe(e)||t||r?{next:e,error:t,complete:r}:e;return n?gt(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var p=!0;o.subscribe(At(i,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),i.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),i.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),i.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):za}d();c();l();u();d();c();l();u();function bR(e){return` \r
|
|
35
|
-
`.indexOf(e)>=0}function op(e){for(var t=["topLevel"],r=0,n,o,i,a=function(I){return t.push(I)},p=function(I){return t[t.length-1]=I},f=function(I){n==null&&(n=r,o=t.length,i=I)},m=function(I){I===i&&(n=void 0,o=void 0,i=void 0)},h=function(){return t.pop()},v=function(){return r--},C=function(I){if("0"<=I&&I<="9"){a("number");return}switch(I){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},g=e.length;r<g;r++){var S=e[r];switch(t[t.length-1]){case"topLevel":C(S);break;case"string":switch(S){case"\"":h();break;case"\\":f("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":S==="u"?a("stringUnicode"):(m("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),h());break;case"number":S==="."?p("numberNeedsDigit"):S==="e"||S==="E"?p("numberNeedsExponent"):(S<"0"||S>"9")&&(v(),h());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(S==="+"||S==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(S<"a"||S>"z")&&(v(),h());break;case"arrayNeedsValue":S==="]"?h():bR(S)||(m("collectionItem"),p("arrayNeedsComma"),C(S));break;case"arrayNeedsComma":S==="]"?h():S===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":S==="}"?h():S==="\""&&(f("collectionItem"),p("objectNeedsColon"),a("string"));break;case"objectNeedsColon":S===":"&&p("objectNeedsValue");break;case"objectNeedsValue":bR(S)||(m("collectionItem"),p("objectNeedsComma"),C(S));break;case"objectNeedsComma":S==="}"?h():S===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var x=[n!=null?e.slice(0,n):e],w=function(I){return x.push(I.slice(e.length-e.lastIndexOf(I[0])))},R=t.length-1;R>=0;R--)switch(t[R]){case"string":x.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":x.push("0");break;case"true":w("true");break;case"false":w("false");break;case"null":w("null");break;case"arrayNeedsValue":case"arrayNeedsComma":x.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":x.push("}");break}return x.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function RR(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function ap(e,t,r){for(let i=0;i<28;i=i+7){let a=e>>>i,p=!(!(a>>>7)&&t==0),f=(p?a|128:a)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let i=3;i<31;i=i+7){let a=t>>>i,p=!!(a>>>7),f=(p?a|128:a)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var ip=4294967296;function My(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,p){let f=Number(e.slice(a,p));o*=r,n=n*r+f,n>=ip&&(o=o+(n/ip|0),n=n%ip)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?IR(n,o):Vy(n,o)}function wR(e,t){let r=Vy(e,t),n=r.hi&2147483648;n&&(r=IR(r.lo,r.hi));let o=jy(r.lo,r.hi);return n?"-"+o:o}function jy(e,t){if({lo:e,hi:t}=uj(e,t),t<=2097151)return String(ip*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,p=o*2,f=1e7;return i>=f&&(a+=Math.floor(i/f),i%=f),a>=f&&(p+=Math.floor(a/f),a%=f),p.toString()+xR(a)+xR(i)}function uj(e,t){return{lo:e>>>0,hi:t>>>0}}function Vy(e,t){return{lo:e|0,hi:t|0}}function IR(e,t){return t=~t,e?e=~e+1:t+=1,Vy(e,t)}var xR=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Ly(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function ER(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var Er=lj();function lj(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let p=typeof a=="bigint"?a:BigInt(a);if(p>n||p<r)throw new Error(`invalid int64: ${a}`);return p},uParse(a){let p=typeof a=="bigint"?a:BigInt(a);if(p>i||p<o)throw new Error(`invalid uint64: ${a}`);return p},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,p){return e.setInt32(0,a,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(a,p){return e.setInt32(0,a,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),FR(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),TR(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),FR(r),My(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),TR(r),My(r)},dec(r,n){return wR(r,n)},uDec(r,n){return jy(r,n)}}}function FR(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function TR(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var Uy=Symbol.for("@bufbuild/protobuf/text-encoding");function Qy(){if(y[Uy]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[Uy]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[Uy]}var oo;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(oo||(oo={}));var dj=34028234663852886e22,pj=-34028234663852886e22,fj=4294967295,mj=2147483647,gj=-2147483648,Ue=class{constructor(t=Qy().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(PR(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return By(t),Ly(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){hj(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){PR(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){By(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return By(t),t=(t<<1^t>>31)>>>0,Ly(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Er.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Er.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Er.enc(t);return ap(r.lo,r.hi,this.buf),this}sint64(t){let r=Er.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return ap(o,i,this.buf),this}uint64(t){let r=Er.uEnc(t);return ap(r.lo,r.hi,this.buf),this}},me=class{constructor(t,r=Qy().decodeUtf8){this.decodeUtf8=r,this.varint64=RR,this.uint32=ER,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case oo.Varint:for(;this.buf[this.pos++]&128;);break;case oo.Bit64:this.pos+=4;case oo.Bit32:this.pos+=4;break;case oo.LengthDelimited:let o=this.uint32();this.pos+=o;break;case oo.StartGroup:for(;;){let[i,a]=this.tag();if(a===oo.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(a,i)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Er.dec(...this.varint64())}uint64(){return Er.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Er.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Er.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Er.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function By(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>mj||e<gj)throw new Error("invalid int32: "+e)}function PR(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>fj||e<0)throw new Error("invalid uint32: "+e)}function hj(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>dj||e<pj))throw new Error("invalid float32: "+e)}var yj=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function Gy(){return{fields:{}}}var jc={encode(e,t=new Ue){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&zy.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Gy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=zy.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return jc.fromPartial(e??{})},fromPartial(e){let t=Gy();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=Gy();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function kR(){return{key:"",value:void 0}}var zy={encode(e,t=new Ue){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=kR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return zy.fromPartial(e??{})},fromPartial(e){let t=kR();return t.key=e.key??"",t.value=e.value??void 0,t}};function $y(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Me={encode(e,t=new Ue){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&jc.encode(jc.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Vc.encode(Vc.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=$y();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=jc.unwrap(jc.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=Vc.unwrap(Vc.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Me.fromPartial(e??{})},fromPartial(e){let t=$y();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=$y();if(e===null)t.nullValue=yj.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Hy(){return{values:[]}}var Vc={encode(e,t=new Ue){for(let r of e.values)Me.encode(Me.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Hy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(Me.unwrap(Me.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Vc.fromPartial(e??{})},fromPartial(e){let t=Hy();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Hy();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},Sj=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function OR(){return{op:0,path:"",from:void 0,value:void 0}}var sp={encode(e,t=new Ue){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=OR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return sp.fromPartial(e??{})},fromPartial(e){let t=OR();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function _R(){return{id:"",type:"",function:void 0}}var cp={encode(e,t=new Ue){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&up.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=_R();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=up.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cp.fromPartial(e??{})},fromPartial(e){let t=_R();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?up.fromPartial(e.function):void 0,t}};function NR(){return{name:"",arguments:""}}var up={encode(e,t=new Ue){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=NR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return up.fromPartial(e??{})},fromPartial(e){let t=NR();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function qR(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var lp={encode(e,t=new Ue){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)cp.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=qR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(cp.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return lp.fromPartial(e??{})},fromPartial(e){let t=qR();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>cp.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},vj=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function DR(){return{type:0,timestamp:void 0,rawEvent:void 0}}var he={encode(e,t=new Ue){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Me.encode(Me.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=DR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=Aj(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return he.fromPartial(e??{})},fromPartial(e){let t=DR();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function MR(){return{baseEvent:void 0,messageId:"",role:void 0}}var dp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=MR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return dp.fromPartial(e??{})},fromPartial(e){let t=MR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function jR(){return{baseEvent:void 0,messageId:"",delta:""}}var pp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=jR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return pp.fromPartial(e??{})},fromPartial(e){let t=jR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function VR(){return{baseEvent:void 0,messageId:""}}var fp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=VR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return fp.fromPartial(e??{})},fromPartial(e){let t=VR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function LR(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var mp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=LR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return mp.fromPartial(e??{})},fromPartial(e){let t=LR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function UR(){return{baseEvent:void 0,toolCallId:"",delta:""}}var gp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=UR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return gp.fromPartial(e??{})},fromPartial(e){let t=UR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function QR(){return{baseEvent:void 0,toolCallId:""}}var hp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=QR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return hp.fromPartial(e??{})},fromPartial(e){let t=QR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function BR(){return{baseEvent:void 0,snapshot:void 0}}var yp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Me.encode(Me.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=BR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return yp.fromPartial(e??{})},fromPartial(e){let t=BR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function GR(){return{baseEvent:void 0,delta:[]}}var Sp={encode(e,t=new Ue){e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)sp.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=GR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push(sp.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Sp.fromPartial(e??{})},fromPartial(e){let t=GR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>sp.fromPartial(r))||[],t}};function $R(){return{baseEvent:void 0,messages:[]}}var vp={encode(e,t=new Ue){e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)lp.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=$R();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(lp.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return vp.fromPartial(e??{})},fromPartial(e){let t=$R();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>lp.fromPartial(r))||[],t}};function HR(){return{baseEvent:void 0,event:void 0,source:void 0}}var Ap={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Me.encode(Me.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=HR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=Me.unwrap(Me.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ap.fromPartial(e??{})},fromPartial(e){let t=HR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function zR(){return{baseEvent:void 0,name:"",value:void 0}}var Cp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=zR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Cp.fromPartial(e??{})},fromPartial(e){let t=zR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function WR(){return{baseEvent:void 0,threadId:"",runId:""}}var bp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=WR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return bp.fromPartial(e??{})},fromPartial(e){let t=WR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function YR(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var xp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&Me.encode(Me.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=YR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xp.fromPartial(e??{})},fromPartial(e){let t=YR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function KR(){return{baseEvent:void 0,code:void 0,message:""}}var Rp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=KR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Rp.fromPartial(e??{})},fromPartial(e){let t=KR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function JR(){return{baseEvent:void 0,stepName:""}}var wp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=JR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return wp.fromPartial(e??{})},fromPartial(e){let t=JR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function XR(){return{baseEvent:void 0,stepName:""}}var Ip={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=XR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ip.fromPartial(e??{})},fromPartial(e){let t=XR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function ZR(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Ep={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=ZR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ep.fromPartial(e??{})},fromPartial(e){let t=ZR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function ew(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Fp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=ew();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Fp.fromPartial(e??{})},fromPartial(e){let t=ew();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function tw(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var rw={encode(e,t=new Ue){return e.textMessageStart!==void 0&&dp.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&pp.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&fp.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&mp.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&gp.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&hp.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&yp.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Sp.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&vp.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Ap.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Cp.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&bp.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&xp.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Rp.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&wp.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Ip.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Ep.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Fp.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=tw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=dp.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=pp.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=fp.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=mp.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=gp.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=hp.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=yp.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=Sp.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=vp.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=Ap.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=Cp.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=bp.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=xp.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=Rp.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=wp.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=Ip.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=Ep.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=Fp.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return rw.fromPartial(e??{})},fromPartial(e){let t=tw();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?dp.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?pp.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?fp.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?mp.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?gp.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?hp.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?yp.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Sp.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?vp.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Ap.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Cp.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?bp.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?xp.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Rp.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?wp.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Ip.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Ep.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Fp.fromPartial(e.toolCallChunk):void 0,t}};function Aj(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function nw(e){let t=rw.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=vj[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===D.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===D.STATE_DELTA)for(let n of r.delta)n.op=Sj[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),Ed.parse(r)}var ow="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var bj=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Wy=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(bj);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},iw=e=>e==="*"||e==="x"||e==="X",aw=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},xj=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Rj=(e,t)=>{if(iw(e)||iw(t))return 0;let[r,n]=xj(aw(e),aw(t));return r>n?1:r<n?-1:0},Yy=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=Rj(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Tp=(e,t)=>{let r=Wy(e),n=Wy(t),o=r.pop(),i=n.pop(),a=Yy(r,n);return a!==0?a:o&&i?Yy(o.split("."),i.split(".")):o||i?o?-1:1:0};var Xe=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function Lc(){return Xn()}function ze(_x187,_x188,_x189,_x190){return _ze.apply(this,arguments)}function _ze(){_ze=_asyncToGenerator(function*(e,t,r,n){let o=t,i=r,a;for(let p of e)try{let f=yield n(p,Xe(o),Xe(i));if(f===void 0)continue;if(f.messages!==void 0&&(o=f.messages),f.state!==void 0&&(i=f.state),a=f.stopPropagation,a===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(i)===JSON.stringify(r)?{}:{state:i}),...(a===void 0?{}:{stopPropagation:a})}});return _ze.apply(this,arguments)}var pw=(e,t,r,n)=>{let o=Xe(r.messages),i=Xe(e.state),a={},p=m=>{m.messages!==void 0&&(o=m.messages,a.messages=m.messages),m.state!==void 0&&(i=m.state,a.state=m.state)},f=()=>{let m=Xe(a);return a={},m.messages!==void 0||m.state!==void 0?ct(m):Qd};return t.pipe(rp(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(m){let h=yield ze(n,o,i,(v,C,g)=>v.onEvent?.({event:m,agent:r,input:e,messages:C,state:g}));if(p(h),h.stopPropagation===!0)return f();switch(m.type){case D.TEXT_MESSAGE_START:{let v=yield ze(n,o,i,(C,g,S)=>C.onTextMessageStartEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{messageId:C,role:g="assistant"}=m;if(!o.find(S=>S.id===C)){let S={id:C,role:g,content:""};o.push(S),p({messages:o})}}return f()}case D.TEXT_MESSAGE_CONTENT:{let{messageId:v,delta:C}=m,g=o.find(x=>x.id===v);if(!g)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${v}'`),f();let S=yield ze(n,o,i,(x,w,R)=>x.onTextMessageContentEvent?.({event:m,messages:w,state:R,agent:r,input:e,textMessageBuffer:typeof g.content=="string"?g.content:""}));return p(S),S.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${C}`,p({messages:o})),f()}case D.TEXT_MESSAGE_END:{let{messageId:v}=m,C=o.find(g=>g.id===v);return C?(p(yield ze(n,o,i,(g,S,x)=>g.onTextMessageEndEvent?.({event:m,messages:S,state:x,agent:r,input:e,textMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:C,messages:o,state:i,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${v}'`),f())}case D.TOOL_CALL_START:{let v=yield ze(n,o,i,(C,g,S)=>C.onToolCallStartEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{toolCallId:C,toolCallName:g,parentMessageId:S}=m,x;S&&o.length>0&&o[o.length-1].id===S?x=o[o.length-1]:(x={id:S||C,role:"assistant",toolCalls:[]},o.push(x)),x.toolCalls??(x.toolCalls=[]),x.toolCalls.push({id:C,type:"function",function:{name:g,arguments:""}}),p({messages:o})}return f()}case D.TOOL_CALL_ARGS:{let{toolCallId:v,delta:C}=m,g=o.find(w=>w.toolCalls?.some(R=>R.id===v));if(!g)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${v}'`),f();let S=g.toolCalls?.find(w=>w.id===v);if(!S)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${v}'`),f();let x=yield ze(n,o,i,(w,R,I)=>{let E=S.function.arguments,P=S.function.name,V={};try{V=op(E)}catch{}return w.onToolCallArgsEvent?.({event:m,messages:R,state:I,agent:r,input:e,toolCallBuffer:E,toolCallName:P,partialToolCallArgs:V})});return p(x),x.stopPropagation!==!0&&(S.function.arguments+=C,p({messages:o})),f()}case D.TOOL_CALL_END:{let{toolCallId:v}=m,C=o.find(S=>S.toolCalls?.some(x=>x.id===v));if(!C)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${v}'`),f();let g=C.toolCalls?.find(S=>S.id===v);return g?(p(yield ze(n,o,i,(S,x,w)=>{let R=g.function.arguments,I=g.function.name,E={};try{E=JSON.parse(R)}catch{}return S.onToolCallEndEvent?.({event:m,messages:x,state:w,agent:r,input:e,toolCallName:I,toolCallArgs:E})})),yield Promise.all(n.map(S=>{S.onNewToolCall?.({toolCall:g,messages:o,state:i,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${v}'`),f())}case D.TOOL_CALL_RESULT:{let v=yield ze(n,o,i,(C,g,S)=>C.onToolCallResultEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{messageId:C,toolCallId:g,content:S,role:x}=m,w={id:C,toolCallId:g,role:x||"tool",content:S};o.push(w),yield Promise.all(n.map(R=>{R.onNewMessage?.({message:w,messages:o,state:i,agent:r,input:e})})),p({messages:o})}return f()}case D.STATE_SNAPSHOT:{let v=yield ze(n,o,i,(C,g,S)=>C.onStateSnapshotEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{snapshot:C}=m;i=C,p({state:i})}return f()}case D.STATE_DELTA:{let v=yield ze(n,o,i,(C,g,S)=>C.onStateDeltaEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{delta:C}=m;try{i=no(i,C,!0,!1).newDocument,p({state:i})}catch(g){let S=g instanceof Error?g.message:String(g);console.warn(`Failed to apply state patch:
|
|
34
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function _c(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Qa=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var p=In(a),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(w){t={error:w}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else a.remove(this);var g=this.initialTeardown;if(Oe(g))try{g()}catch(w){i=w instanceof Dd?w.errors:[w]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var b=In(S),h=b.next();!h.done;h=b.next()){var A=h.value;try{uR(A)}catch(w){i=i??[],w instanceof Dd?i=La(La([],Va(i)),Va(w.errors)):i.push(w)}}}catch(w){n={error:w}}finally{try{h&&!h.done&&(o=b.return)&&o.call(b)}finally{if(n)throw n.error}}}if(i)throw new Dd(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)uR(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&_c(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&_c(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Ty=Qa.EMPTY;function Md(e){return e instanceof Qa||e&&"closed"in e&&Oe(e.remove)&&Oe(e.add)&&Oe(e.unsubscribe)}function uR(e){Oe(e)?e():e.unsubscribe()}d();c();l();u();var Ir={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var Ba={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Ba.delegate;return o?.setTimeout?o.setTimeout.apply(o,La([e,t],Va(r))):setTimeout.apply(void 0,La([e,t],Va(r)))},clearTimeout:function(e){var t=Ba.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function jd(e){Ba.setTimeout(function(){var t=Ir.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function Nc(){}d();c();l();u();var lR=function(){return Py("C",void 0,void 0)}();function dR(e){return Py("E",void 0,e)}function pR(e){return Py("N",e,void 0)}function Py(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var pi=null;function Ga(e){if(Ir.useDeprecatedSynchronousErrorHandling){var t=!pi;if(t&&(pi={errorThrown:!1,error:null}),e(),t){var r=pi,n=r.errorThrown,o=r.error;if(pi=null,n)throw o}}else e()}function fR(e){Ir.useDeprecatedSynchronousErrorHandling&&pi&&(pi.errorThrown=!0,pi.error=e)}var qc=function(e){Kr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Md(r)&&r.add(n)):n.destination=ej,n}return t.create=function(r,n,o){return new Ld(r,n,o)},t.prototype.next=function(r){this.isStopped?Oy(pR(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Oy(dR(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Oy(lR,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Qa);var JM=Function.prototype.bind;function ky(e,t){return JM.call(e,t)}var XM=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Vd(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Vd(n)}else Vd(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Vd(r)}},e}(),Ld=function(e){Kr(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(Oe(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;i&&Ir.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&ky(r.next,p),error:r.error&&ky(r.error,p),complete:r.complete&&ky(r.complete,p)}):a=r}return i.destination=new XM(a),i}return t}(qc);function Vd(e){Ir.useDeprecatedSynchronousErrorHandling?fR(e):jd(e)}function ZM(e){throw e}function Oy(e,t){var r=Ir.onStoppedNotification;r&&Ba.setTimeout(function(){return r(e,t)})}var ej={closed:!0,next:Nc,error:ZM,complete:Nc};d();c();l();u();var $a=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function Ha(e){return e}function Ud(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _y(e)}function _y(e){return e.length===0?Ha:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var rt=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=rj(t)?t:new Ld(t,r,n);return Ga(function(){var a=o,p=a.operator,f=a.source;i.add(p?p.call(i,f):f?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=mR(r),new r(function(o,i){var a=new Ld({next:function(p){try{t(p)}catch(f){i(f),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[$a]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return _y(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=mR(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function mR(e){var t;return(t=e??Ir.Promise)!==null&&t!==void 0?t:Promise}function tj(e){return e&&Oe(e.next)&&Oe(e.error)&&Oe(e.complete)}function rj(e){return e&&e instanceof qc||tj(e)&&Md(e)}d();c();l();u();function nj(e){return Oe(e?.lift)}function gt(e){return function(t){if(nj(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function At(e,t,r,n,o){return new oj(e,t,r,n,o)}var oj=function(e){Kr(t,e);function t(r,n,o,i,a,p){var f=e.call(this,r)||this;return f.onFinalize=a,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=i?function(m){try{i(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(qc);d();c();l();u();d();c();l();u();var gR=Ua(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var Jr=function(e){Kr(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new hR(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new gR},t.prototype.next=function(r){var n=this;Ga(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=In(n.currentObservers),p=a.next();!p.done;p=a.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Ga(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;Ga(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,p=o.observers;return i||a?Ty:(this.currentObservers=null,p.push(r),new Qa(function(){n.currentObservers=null,_c(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new rt;return r.source=this,r},t.create=function(r,n){return new hR(r,n)},t}(rt);var hR=function(e){Kr(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Ty},t}(Jr);d();c();l();u();d();c();l();u();var Ny={now:function(){return(Ny.delegate||Date).now()},delegate:void 0};var Qd=function(e){Kr(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Ny);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(i.push(r),!a&&i.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,p=a.slice(),f=0;f<p.length&&!r.closed;f+=i?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,p=(a?1:2)*n;if(n<1/0&&p<i.length&&i.splice(0,i.length-p),!a){for(var f=o.now(),m=0,g=1;g<i.length&&i[g]<=f;g+=2)m=g;m&&i.splice(0,m+1)}},t}(Jr);d();c();l();u();var Bd=new rt(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function yR(e){return e&&Oe(e.schedule)}function ij(e){return e[e.length-1]}function SR(e){return yR(ij(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Gd=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function $d(e){return Oe(e?.then)}d();c();l();u();function Hd(e){return Oe(e[$a])}d();c();l();u();function zd(e){return Symbol.asyncIterator&&Oe(e?.[Symbol.asyncIterator])}d();c();l();u();function Wd(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function aj(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Yd=aj();function Kd(e){return Oe(e?.[Yd])}d();c();l();u();function Jd(e){return sR(this,arguments,function(){var r,n,o,i;return qd(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,di(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,di(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,di(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Xd(e){return Oe(e?.getReader)}function Ct(e){if(e instanceof rt)return e;if(e!=null){if(Hd(e))return sj(e);if(Gd(e))return cj(e);if($d(e))return uj(e);if(zd(e))return vR(e);if(Kd(e))return lj(e);if(Xd(e))return dj(e)}throw Wd(e)}function sj(e){return new rt(function(t){var r=e[$a]();if(Oe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function cj(e){return new rt(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function uj(e){return new rt(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,jd)})}function lj(e){return new rt(function(t){var r,n;try{for(var o=In(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(p){r={error:p}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function vR(e){return new rt(function(t){pj(e,t).catch(function(r){return t.error(r)})})}function dj(e){return vR(Jd(e))}function pj(e,t){var r,n,o,i;return aR(this,void 0,void 0,function(){var a,p;return qd(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=cR(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function Sr(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function Zd(e,t){return t===void 0&&(t=0),gt(function(r,n){r.subscribe(At(n,function(o){return Sr(n,e,function(){return n.next(o)},t)},function(){return Sr(n,e,function(){return n.complete()},t)},function(o){return Sr(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function ep(e,t){return t===void 0&&(t=0),gt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function AR(e,t){return Ct(e).pipe(ep(t),Zd(t))}d();c();l();u();function CR(e,t){return Ct(e).pipe(ep(t),Zd(t))}d();c();l();u();function bR(e,t){return new rt(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function xR(e,t){return new rt(function(r){var n;return Sr(r,t,function(){n=e[Yd](),Sr(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(p){r.error(p);return}a?r.complete():r.next(i)},0,!0)}),function(){return Oe(n?.return)&&n.return()}})}d();c();l();u();function tp(e,t){if(!e)throw new Error("Iterable cannot be null");return new rt(function(r){Sr(r,t,function(){var n=e[Symbol.asyncIterator]();Sr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function RR(e,t){return tp(Jd(e),t)}function wR(e,t){if(e!=null){if(Hd(e))return AR(e,t);if(Gd(e))return bR(e,t);if($d(e))return CR(e,t);if(zd(e))return tp(e,t);if(Kd(e))return xR(e,t);if(Xd(e))return RR(e,t)}throw Wd(e)}function fi(e,t){return t?wR(e,t):Ct(e)}function ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=SR(e);return fi(e,r)}d();c();l();u();function nt(e,t){var r=Oe(e)?e:function(){return e},n=function(o){return o.error(r())};return new rt(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var IR=Ua(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function rp(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(p){a=p,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new IR)}})})}d();c();l();u();function mi(e,t){return gt(function(r,n){var o=0;r.subscribe(At(n,function(i){n.next(e.call(t,i,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function ER(e,t,r,n,o,i,a,p){var f=[],m=0,g=0,S=!1,b=function(){S&&!f.length&&!m&&t.complete()},h=function(w){return m<n?A(w):f.push(w)},A=function(w){i&&t.next(w),m++;var R=!1;Ct(r(w,g++)).subscribe(At(t,function(x){o?.(x),i?h(x):t.next(x)},function(){R=!0},void 0,function(){if(R)try{m--;for(var x=function(){var I=f.shift();a?Sr(t,a,function(){return A(I)}):A(I)};f.length&&m<n;)x();b()}catch(I){t.error(I)}}))};return e.subscribe(At(t,h,function(){S=!0,b()})),function(){p?.()}}function Zt(e,t,r){return r===void 0&&(r=1/0),Oe(t)?Zt(function(n,o){return mi(function(i,a){return t(n,i,o,a)})(Ct(e(n,o)))},r):(typeof t=="number"&&(r=t),gt(function(n,o){return ER(n,o,e,r)}))}function qy(e){return e===void 0&&(e=1/0),Zt(Ha,e)}d();c();l();u();function Dy(e){return new rt(function(t){Ct(e()).subscribe(t)})}d();c();l();u();function Dc(e){return gt(function(t,r){var n=null,o=!1,i;n=t.subscribe(At(r,void 0,void 0,function(a){i=Ct(e(a,Dc(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}d();c();l();u();function np(e,t){return Oe(t)?Zt(e,t,1):Zt(e,1)}d();c();l();u();function My(e){return gt(function(t,r){var n=!1;t.subscribe(At(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function gi(e){return gt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function jy(e,t){return gt(function(r,n){var o=null,i=0,a=!1,p=function(){return a&&!o&&n.complete()};r.subscribe(At(n,function(f){o?.unsubscribe();var m=0,g=i++;Ct(e(f,g)).subscribe(o=At(n,function(S){return n.next(t?t(f,S,g,m++):S)},function(){o=null,p()}))},function(){a=!0,p()}))})}d();c();l();u();function op(e){return gt(function(t,r){Ct(e).subscribe(At(r,function(){return r.complete()},Nc)),!r.closed&&t.subscribe(r)})}d();c();l();u();function Vy(e,t,r){var n=Oe(e)||t||r?{next:e,error:t,complete:r}:e;return n?gt(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var p=!0;o.subscribe(At(i,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),i.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),i.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),i.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):Ha}d();c();l();u();d();c();l();u();function FR(e){return` \r
|
|
35
|
+
`.indexOf(e)>=0}function ip(e){for(var t=["topLevel"],r=0,n,o,i,a=function(I){return t.push(I)},p=function(I){return t[t.length-1]=I},f=function(I){n==null&&(n=r,o=t.length,i=I)},m=function(I){I===i&&(n=void 0,o=void 0,i=void 0)},g=function(){return t.pop()},S=function(){return r--},b=function(I){if("0"<=I&&I<="9"){a("number");return}switch(I){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},h=e.length;r<h;r++){var A=e[r];switch(t[t.length-1]){case"topLevel":b(A);break;case"string":switch(A){case"\"":g();break;case"\\":f("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":A==="u"?a("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":A==="."?p("numberNeedsDigit"):A==="e"||A==="E"?p("numberNeedsExponent"):(A<"0"||A>"9")&&(S(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(A==="+"||A==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(A<"a"||A>"z")&&(S(),g());break;case"arrayNeedsValue":A==="]"?g():FR(A)||(m("collectionItem"),p("arrayNeedsComma"),b(A));break;case"arrayNeedsComma":A==="]"?g():A===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":A==="}"?g():A==="\""&&(f("collectionItem"),p("objectNeedsColon"),a("string"));break;case"objectNeedsColon":A===":"&&p("objectNeedsValue");break;case"objectNeedsValue":FR(A)||(m("collectionItem"),p("objectNeedsComma"),b(A));break;case"objectNeedsComma":A==="}"?g():A===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var w=[n!=null?e.slice(0,n):e],R=function(I){return w.push(I.slice(e.length-e.lastIndexOf(I[0])))},x=t.length-1;x>=0;x--)switch(t[x]){case"string":w.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":w.push("0");break;case"true":R("true");break;case"false":R("false");break;case"null":R("null");break;case"arrayNeedsValue":case"arrayNeedsComma":w.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":w.push("}");break}return w.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function PR(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function sp(e,t,r){for(let i=0;i<28;i=i+7){let a=e>>>i,p=!(!(a>>>7)&&t==0),f=(p?a|128:a)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let i=3;i<31;i=i+7){let a=t>>>i,p=!!(a>>>7),f=(p?a|128:a)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var ap=4294967296;function Ly(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,p){let f=Number(e.slice(a,p));o*=r,n=n*r+f,n>=ap&&(o=o+(n/ap|0),n=n%ap)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?OR(n,o):Qy(n,o)}function kR(e,t){let r=Qy(e,t),n=r.hi&2147483648;n&&(r=OR(r.lo,r.hi));let o=Uy(r.lo,r.hi);return n?"-"+o:o}function Uy(e,t){if({lo:e,hi:t}=fj(e,t),t<=2097151)return String(ap*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,p=o*2,f=1e7;return i>=f&&(a+=Math.floor(i/f),i%=f),a>=f&&(p+=Math.floor(a/f),a%=f),p.toString()+TR(a)+TR(i)}function fj(e,t){return{lo:e>>>0,hi:t>>>0}}function Qy(e,t){return{lo:e|0,hi:t|0}}function OR(e,t){return t=~t,e?e=~e+1:t+=1,Qy(e,t)}var TR=e=>{let t=String(e);return"0000000".slice(t.length)+t};function By(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function _R(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var Er=mj();function mj(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let p=typeof a=="bigint"?a:BigInt(a);if(p>n||p<r)throw new Error(`invalid int64: ${a}`);return p},uParse(a){let p=typeof a=="bigint"?a:BigInt(a);if(p>i||p<o)throw new Error(`invalid uint64: ${a}`);return p},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,p){return e.setInt32(0,a,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(a,p){return e.setInt32(0,a,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),NR(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),qR(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),NR(r),Ly(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),qR(r),Ly(r)},dec(r,n){return kR(r,n)},uDec(r,n){return Uy(r,n)}}}function NR(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function qR(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var Gy=Symbol.for("@bufbuild/protobuf/text-encoding");function $y(){if(y[Gy]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[Gy]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[Gy]}var oo;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(oo||(oo={}));var gj=34028234663852886e22,hj=-34028234663852886e22,yj=4294967295,Sj=2147483647,vj=-2147483648,Ue=class{constructor(t=$y().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(DR(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Hy(t),By(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){Aj(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){DR(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Hy(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Hy(t),t=(t<<1^t>>31)>>>0,By(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Er.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Er.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Er.enc(t);return sp(r.lo,r.hi,this.buf),this}sint64(t){let r=Er.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return sp(o,i,this.buf),this}uint64(t){let r=Er.uEnc(t);return sp(r.lo,r.hi,this.buf),this}},me=class{constructor(t,r=$y().decodeUtf8){this.decodeUtf8=r,this.varint64=PR,this.uint32=_R,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case oo.Varint:for(;this.buf[this.pos++]&128;);break;case oo.Bit64:this.pos+=4;case oo.Bit32:this.pos+=4;break;case oo.LengthDelimited:let o=this.uint32();this.pos+=o;break;case oo.StartGroup:for(;;){let[i,a]=this.tag();if(a===oo.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(a,i)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Er.dec(...this.varint64())}uint64(){return Er.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Er.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Er.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Er.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function Hy(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>Sj||e<vj)throw new Error("invalid int32: "+e)}function DR(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>yj||e<0)throw new Error("invalid uint32: "+e)}function Aj(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>gj||e<hj))throw new Error("invalid float32: "+e)}var Cj=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function zy(){return{fields:{}}}var Mc={encode(e,t=new Ue){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&Ky.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=zy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=Ky.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Mc.fromPartial(e??{})},fromPartial(e){let t=zy();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=zy();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function MR(){return{key:"",value:void 0}}var Ky={encode(e,t=new Ue){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=MR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ky.fromPartial(e??{})},fromPartial(e){let t=MR();return t.key=e.key??"",t.value=e.value??void 0,t}};function Wy(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Me={encode(e,t=new Ue){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Mc.encode(Mc.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&jc.encode(jc.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Wy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=Mc.unwrap(Mc.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=jc.unwrap(jc.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Me.fromPartial(e??{})},fromPartial(e){let t=Wy();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=Wy();if(e===null)t.nullValue=Cj.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Yy(){return{values:[]}}var jc={encode(e,t=new Ue){for(let r of e.values)Me.encode(Me.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Yy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(Me.unwrap(Me.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return jc.fromPartial(e??{})},fromPartial(e){let t=Yy();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Yy();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},bj=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function jR(){return{op:0,path:"",from:void 0,value:void 0}}var cp={encode(e,t=new Ue){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=jR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cp.fromPartial(e??{})},fromPartial(e){let t=jR();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function VR(){return{id:"",type:"",function:void 0}}var up={encode(e,t=new Ue){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&lp.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=VR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=lp.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return up.fromPartial(e??{})},fromPartial(e){let t=VR();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?lp.fromPartial(e.function):void 0,t}};function LR(){return{name:"",arguments:""}}var lp={encode(e,t=new Ue){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=LR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return lp.fromPartial(e??{})},fromPartial(e){let t=LR();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function UR(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var dp={encode(e,t=new Ue){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)up.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=UR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(up.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return dp.fromPartial(e??{})},fromPartial(e){let t=UR();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>up.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},xj=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function QR(){return{type:0,timestamp:void 0,rawEvent:void 0}}var he={encode(e,t=new Ue){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Me.encode(Me.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=QR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=Rj(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return he.fromPartial(e??{})},fromPartial(e){let t=QR();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function BR(){return{baseEvent:void 0,messageId:"",role:void 0}}var pp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=BR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return pp.fromPartial(e??{})},fromPartial(e){let t=BR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function GR(){return{baseEvent:void 0,messageId:"",delta:""}}var fp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=GR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return fp.fromPartial(e??{})},fromPartial(e){let t=GR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function $R(){return{baseEvent:void 0,messageId:""}}var mp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=$R();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return mp.fromPartial(e??{})},fromPartial(e){let t=$R();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function HR(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var gp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=HR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return gp.fromPartial(e??{})},fromPartial(e){let t=HR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function zR(){return{baseEvent:void 0,toolCallId:"",delta:""}}var hp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=zR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return hp.fromPartial(e??{})},fromPartial(e){let t=zR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function WR(){return{baseEvent:void 0,toolCallId:""}}var yp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=WR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return yp.fromPartial(e??{})},fromPartial(e){let t=WR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function YR(){return{baseEvent:void 0,snapshot:void 0}}var Sp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Me.encode(Me.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=YR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Sp.fromPartial(e??{})},fromPartial(e){let t=YR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function KR(){return{baseEvent:void 0,delta:[]}}var vp={encode(e,t=new Ue){e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)cp.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=KR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push(cp.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return vp.fromPartial(e??{})},fromPartial(e){let t=KR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>cp.fromPartial(r))||[],t}};function JR(){return{baseEvent:void 0,messages:[]}}var Ap={encode(e,t=new Ue){e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)dp.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=JR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(dp.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ap.fromPartial(e??{})},fromPartial(e){let t=JR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>dp.fromPartial(r))||[],t}};function XR(){return{baseEvent:void 0,event:void 0,source:void 0}}var Cp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Me.encode(Me.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=XR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=Me.unwrap(Me.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Cp.fromPartial(e??{})},fromPartial(e){let t=XR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function ZR(){return{baseEvent:void 0,name:"",value:void 0}}var bp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=ZR();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return bp.fromPartial(e??{})},fromPartial(e){let t=ZR();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function ew(){return{baseEvent:void 0,threadId:"",runId:""}}var xp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=ew();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xp.fromPartial(e??{})},fromPartial(e){let t=ew();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function tw(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var Rp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&Me.encode(Me.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=tw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=Me.unwrap(Me.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Rp.fromPartial(e??{})},fromPartial(e){let t=tw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function rw(){return{baseEvent:void 0,code:void 0,message:""}}var wp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=rw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return wp.fromPartial(e??{})},fromPartial(e){let t=rw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function nw(){return{baseEvent:void 0,stepName:""}}var Ip={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=nw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ip.fromPartial(e??{})},fromPartial(e){let t=nw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function ow(){return{baseEvent:void 0,stepName:""}}var Ep={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=ow();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ep.fromPartial(e??{})},fromPartial(e){let t=ow();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function iw(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Fp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=iw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Fp.fromPartial(e??{})},fromPartial(e){let t=iw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function aw(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Tp={encode(e,t=new Ue){return e.baseEvent!==void 0&&he.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=aw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=he.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Tp.fromPartial(e??{})},fromPartial(e){let t=aw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?he.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function sw(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var cw={encode(e,t=new Ue){return e.textMessageStart!==void 0&&pp.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&fp.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&mp.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&gp.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&hp.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&yp.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Sp.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&vp.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Ap.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Cp.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&bp.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&xp.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Rp.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&wp.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Ip.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Ep.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Fp.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Tp.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=sw();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=pp.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=fp.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=mp.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=gp.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=hp.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=yp.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=Sp.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=vp.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=Ap.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=Cp.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=bp.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=xp.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=Rp.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=wp.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=Ip.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=Ep.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=Fp.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=Tp.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cw.fromPartial(e??{})},fromPartial(e){let t=sw();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?pp.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?fp.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?mp.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?gp.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?hp.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?yp.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Sp.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?vp.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Ap.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Cp.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?bp.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?xp.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Rp.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?wp.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Ip.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Ep.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Fp.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Tp.fromPartial(e.toolCallChunk):void 0,t}};function Rj(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function uw(e){let t=cw.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=xj[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===D.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===D.STATE_DELTA)for(let n of r.delta)n.op=bj[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),Fd.parse(r)}var lw="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var Ij=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Jy=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(Ij);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},dw=e=>e==="*"||e==="x"||e==="X",pw=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Ej=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Fj=(e,t)=>{if(dw(e)||dw(t))return 0;let[r,n]=Ej(pw(e),pw(t));return r>n?1:r<n?-1:0},Xy=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=Fj(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Pp=(e,t)=>{let r=Jy(e),n=Jy(t),o=r.pop(),i=n.pop(),a=Xy(r,n);return a!==0?a:o&&i?Xy(o.split("."),i.split(".")):o||i?o?-1:1:0};var Xe=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function Vc(){return Xn()}function ze(_x193,_x194,_x195,_x196){return _ze.apply(this,arguments)}function _ze(){_ze=_asyncToGenerator(function*(e,t,r,n){let o=t,i=r,a;for(let p of e)try{let f=yield n(p,Xe(o),Xe(i));if(f===void 0)continue;if(f.messages!==void 0&&(o=f.messages),f.state!==void 0&&(i=f.state),a=f.stopPropagation,a===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(i)===JSON.stringify(r)?{}:{state:i}),...(a===void 0?{}:{stopPropagation:a})}});return _ze.apply(this,arguments)}var Sw=(e,t,r,n)=>{let o=Xe(r.messages),i=Xe(e.state),a={},p=m=>{m.messages!==void 0&&(o=m.messages,a.messages=m.messages),m.state!==void 0&&(i=m.state,a.state=m.state)},f=()=>{let m=Xe(a);return a={},m.messages!==void 0||m.state!==void 0?ct(m):Bd};return t.pipe(np(/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(m){let g=yield ze(n,o,i,(S,b,h)=>S.onEvent?.({event:m,agent:r,input:e,messages:b,state:h}));if(p(g),g.stopPropagation===!0)return f();switch(m.type){case D.TEXT_MESSAGE_START:{let S=yield ze(n,o,i,(b,h,A)=>b.onTextMessageStartEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:b,role:h="assistant"}=m;if(!o.find(A=>A.id===b)){let A={id:b,role:h,content:""};o.push(A),p({messages:o})}}return f()}case D.TEXT_MESSAGE_CONTENT:{let{messageId:S,delta:b}=m,h=o.find(w=>w.id===S);if(!h)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let A=yield ze(n,o,i,(w,R,x)=>w.onTextMessageContentEvent?.({event:m,messages:R,state:x,agent:r,input:e,textMessageBuffer:typeof h.content=="string"?h.content:""}));return p(A),A.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${b}`,p({messages:o})),f()}case D.TEXT_MESSAGE_END:{let{messageId:S}=m,b=o.find(h=>h.id===S);return b?(p(yield ze(n,o,i,(h,A,w)=>h.onTextMessageEndEvent?.({event:m,messages:A,state:w,agent:r,input:e,textMessageBuffer:typeof b.content=="string"?b.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:b,messages:o,state:i,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${S}'`),f())}case D.TOOL_CALL_START:{let S=yield ze(n,o,i,(b,h,A)=>b.onToolCallStartEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{toolCallId:b,toolCallName:h,parentMessageId:A}=m,w;A&&o.length>0&&o[o.length-1].id===A?w=o[o.length-1]:(w={id:A||b,role:"assistant",toolCalls:[]},o.push(w)),w.toolCalls??(w.toolCalls=[]),w.toolCalls.push({id:b,type:"function",function:{name:h,arguments:""}}),p({messages:o})}return f()}case D.TOOL_CALL_ARGS:{let{toolCallId:S,delta:b}=m,h=o.find(R=>R.toolCalls?.some(x=>x.id===S));if(!h)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${S}'`),f();let A=h.toolCalls?.find(R=>R.id===S);if(!A)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${S}'`),f();let w=yield ze(n,o,i,(R,x,I)=>{let F=A.function.arguments,P=A.function.name,j={};try{j=ip(F)}catch{}return R.onToolCallArgsEvent?.({event:m,messages:x,state:I,agent:r,input:e,toolCallBuffer:F,toolCallName:P,partialToolCallArgs:j})});return p(w),w.stopPropagation!==!0&&(A.function.arguments+=b,p({messages:o})),f()}case D.TOOL_CALL_END:{let{toolCallId:S}=m,b=o.find(A=>A.toolCalls?.some(w=>w.id===S));if(!b)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${S}'`),f();let h=b.toolCalls?.find(A=>A.id===S);return h?(p(yield ze(n,o,i,(A,w,R)=>{let x=h.function.arguments,I=h.function.name,F={};try{F=JSON.parse(x)}catch{}return A.onToolCallEndEvent?.({event:m,messages:w,state:R,agent:r,input:e,toolCallName:I,toolCallArgs:F})})),yield Promise.all(n.map(A=>{A.onNewToolCall?.({toolCall:h,messages:o,state:i,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${S}'`),f())}case D.TOOL_CALL_RESULT:{let S=yield ze(n,o,i,(b,h,A)=>b.onToolCallResultEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:b,toolCallId:h,content:A,role:w}=m,R={id:b,toolCallId:h,role:w||"tool",content:A};o.push(R),yield Promise.all(n.map(x=>{x.onNewMessage?.({message:R,messages:o,state:i,agent:r,input:e})})),p({messages:o})}return f()}case D.STATE_SNAPSHOT:{let S=yield ze(n,o,i,(b,h,A)=>b.onStateSnapshotEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{snapshot:b}=m;i=b,p({state:i})}return f()}case D.STATE_DELTA:{let S=yield ze(n,o,i,(b,h,A)=>b.onStateDeltaEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{delta:b}=m;try{i=no(i,b,!0,!1).newDocument,p({state:i})}catch(h){let A=h instanceof Error?h.message:String(h);console.warn(`Failed to apply state patch:
|
|
36
36
|
Current state: ${JSON.stringify(i,null,2)}
|
|
37
|
-
Patch operations: ${JSON.stringify(
|
|
38
|
-
Error: ${S}`)}}return f()}case D.MESSAGES_SNAPSHOT:{let v=yield ze(n,o,i,(C,g,S)=>C.onMessagesSnapshotEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{messages:C}=m;o=C,p({messages:o})}return f()}case D.ACTIVITY_SNAPSHOT:{let v=m,C=o.findIndex(R=>R.id===v.messageId),g=C>=0?o[C]:void 0,S=g?.role==="activity"?g:void 0,x=v.replace??!0,w=yield ze(n,o,i,(R,I,E)=>R.onActivitySnapshotEvent?.({event:v,messages:I,state:E,agent:r,input:e,activityMessage:S,existingMessage:g}));if(p(w),w.stopPropagation!==!0){let R={id:v.messageId,role:"activity",activityType:v.activityType,content:Xe(v.content)},I;C===-1?(o.push(R),I=R):S?x&&(o[C]={...S,activityType:v.activityType,content:Xe(v.content)}):x&&(o[C]=R,I=R),p({messages:o}),I&&(yield Promise.all(n.map(E=>E.onNewMessage?.({message:I,messages:o,state:i,agent:r,input:e}))))}return f()}case D.ACTIVITY_DELTA:{let v=m,C=o.findIndex(w=>w.id===v.messageId);if(C===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${v.messageId}' to apply patch`),f();let g=o[C];if(g.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${v.messageId}' is not an activity message`),f();let S=g,x=yield ze(n,o,i,(w,R,I)=>w.onActivityDeltaEvent?.({event:v,messages:R,state:I,agent:r,input:e,activityMessage:S}));if(p(x),x.stopPropagation!==!0)try{let w=Xe(S.content??{}),R=no(w,v.patch??[],!0,!1).newDocument;o[C]={...S,content:Xe(R),activityType:v.activityType},p({messages:o})}catch(w){let R=w instanceof Error?w.message:String(w);console.warn(`Failed to apply activity patch for '${v.messageId}': ${R}`)}return f()}case D.RAW:return p(yield ze(n,o,i,(v,C,g)=>v.onRawEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.CUSTOM:return p(yield ze(n,o,i,(v,C,g)=>v.onCustomEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.RUN_STARTED:{let v=yield ze(n,o,i,(C,g,S)=>C.onRunStartedEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let C=m;if(C.input?.messages){for(let g of C.input.messages)o.find(S=>S.id===g.id)||o.push(g);p({messages:o})}}return f()}case D.RUN_FINISHED:return p(yield ze(n,o,i,(v,C,g)=>v.onRunFinishedEvent?.({event:m,messages:C,state:g,agent:r,input:e,result:m.result}))),f();case D.RUN_ERROR:return p(yield ze(n,o,i,(v,C,g)=>v.onRunErrorEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.STEP_STARTED:return p(yield ze(n,o,i,(v,C,g)=>v.onStepStartedEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.STEP_FINISHED:return p(yield ze(n,o,i,(v,C,g)=>v.onStepFinishedEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case D.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case D.THINKING_START:return f();case D.THINKING_END:return f();case D.THINKING_TEXT_MESSAGE_START:return f();case D.THINKING_TEXT_MESSAGE_CONTENT:return f();case D.THINKING_TEXT_MESSAGE_END:return f();case D.REASONING_START:return p(yield ze(n,o,i,(v,C,g)=>v.onReasoningStartEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.REASONING_MESSAGE_START:{let v=yield ze(n,o,i,(C,g,S)=>C.onReasoningMessageStartEvent?.({event:m,messages:g,state:S,agent:r,input:e}));if(p(v),v.stopPropagation!==!0){let{messageId:C}=m;if(!o.find(g=>g.id===C)){let g={id:C,role:"reasoning",content:""};o.push(g),p({messages:o})}}return f()}case D.REASONING_MESSAGE_CONTENT:{let{messageId:v,delta:C}=m,g=o.find(x=>x.id===v);if(!g)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${v}'`),f();let S=yield ze(n,o,i,(x,w,R)=>x.onReasoningMessageContentEvent?.({event:m,messages:w,state:R,agent:r,input:e,reasoningMessageBuffer:typeof g.content=="string"?g.content:""}));return p(S),S.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${C}`,p({messages:o})),f()}case D.REASONING_MESSAGE_END:{let{messageId:v}=m,C=o.find(g=>g.id===v);return C?(p(yield ze(n,o,i,(g,S,x)=>g.onReasoningMessageEndEvent?.({event:m,messages:S,state:x,agent:r,input:e,reasoningMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:C,messages:o,state:i,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${v}'`),f())}case D.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case D.REASONING_END:return p(yield ze(n,o,i,(v,C,g)=>v.onReasoningEndEvent?.({event:m,messages:C,state:g,agent:r,input:e}))),f();case D.REASONING_ENCRYPTED_VALUE:{let{subtype:v,entityId:C,encryptedValue:g}=m,S=yield ze(n,o,i,(x,w,R)=>x.onReasoningEncryptedValueEvent?.({event:m,messages:w,state:R,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let x=!1;if(v==="tool-call"){for(let w of o)if(w.role==="assistant"&&w.toolCalls){let R=w.toolCalls.find(I=>I.id===C);if(R){R.encryptedValue=g,x=!0;break}}}else{let w=o.find(R=>R.id===C);w?.role!=="activity"&&w&&(w.encryptedValue=g,x=!0)}x&&(a.messages=o)}return f()}}return m.type,f()});return function(_x191){return _ref73.apply(this,arguments)}}()),Oy(),n.length>0?Ny({}):m=>m)},Ky=e=>t=>{let r=new Map,n=new Map,o=!1,i=!1,a=!1,p=new Map,f=!1,m=!1,h=!1,v=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,o=!1,i=!1,h=!0};return t.pipe(Zt(C=>{let g=C.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(C)),i)return nt(()=>new st(`Cannot send event type '${g}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&g!==D.RUN_ERROR&&g!==D.RUN_STARTED)return nt(()=>new st(`Cannot send event type '${g}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(a){if(g===D.RUN_STARTED){if(h&&!o)return nt(()=>new st("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&v()}}else if(a=!0,g!==D.RUN_STARTED&&g!==D.RUN_ERROR)return nt(()=>new st("First event must be 'RUN_STARTED'"));switch(g){case D.TEXT_MESSAGE_START:{let S=C.messageId;return r.has(S)?nt(()=>new st(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${S}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(S,!0),ct(C))}case D.TEXT_MESSAGE_CONTENT:{let S=C.messageId;return r.has(S)?ct(C):nt(()=>new st(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${S}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case D.TEXT_MESSAGE_END:{let S=C.messageId;return r.has(S)?(r.delete(S),ct(C)):nt(()=>new st(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${S}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case D.TOOL_CALL_START:{let S=C.toolCallId;return n.has(S)?nt(()=>new st(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${S}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(S,!0),ct(C))}case D.TOOL_CALL_ARGS:{let S=C.toolCallId;return n.has(S)?ct(C):nt(()=>new st(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${S}'. Start a tool call with 'TOOL_CALL_START' first.`))}case D.TOOL_CALL_END:{let S=C.toolCallId;return n.has(S)?(n.delete(S),ct(C)):nt(()=>new st(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${S}'. A 'TOOL_CALL_START' event must be sent first.`))}case D.STEP_STARTED:{let S=C.stepName;return p.has(S)?nt(()=>new st(`Step "${S}" is already active for 'STEP_STARTED'`)):(p.set(S,!0),ct(C))}case D.STEP_FINISHED:{let S=C.stepName;return p.has(S)?(p.delete(S),ct(C)):nt(()=>new st(`Cannot send 'STEP_FINISHED' for step "${S}" that was not started`))}case D.RUN_STARTED:return h=!0,ct(C);case D.RUN_FINISHED:if(p.size>0){let S=Array.from(p.keys()).join(", ");return nt(()=>new st(`Cannot send 'RUN_FINISHED' while steps are still active: ${S}`))}if(r.size>0){let S=Array.from(r.keys()).join(", ");return nt(()=>new st(`Cannot send 'RUN_FINISHED' while text messages are still active: ${S}`))}if(n.size>0){let S=Array.from(n.keys()).join(", ");return nt(()=>new st(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${S}`))}return o=!0,ct(C);case D.RUN_ERROR:return i=!0,ct(C);case D.CUSTOM:return ct(C);case D.THINKING_TEXT_MESSAGE_START:return f?m?nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,ct(C)):nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case D.THINKING_TEXT_MESSAGE_CONTENT:return m?ct(C):nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case D.THINKING_TEXT_MESSAGE_END:return m?(m=!1,ct(C)):nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case D.THINKING_START:return f?nt(()=>new st("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,ct(C));case D.THINKING_END:return f?(f=!1,ct(C)):nt(()=>new st("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ct(C)}}))},hi=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),wj=(e,t)=>_y(()=>fi(A(e,t))).pipe(qy(r=>{if(!r.ok){let i=r.headers.get("content-type")||"";return fi(r.text()).pipe(Zt(a=>{let p=a;if(i.includes("application/json"))try{p=JSON.parse(a)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,nt(()=>f)}))}let n={type:hi.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new rt(i=>(i.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:p}=yield o.read();if(a)break;let f={type:hi.DATA,data:p};i.next(f)}i.complete()}catch(a){i.error(a)}})(),()=>{o.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):nt(()=>Error("Failed to getReader() from response"))})),Ij=e=>{let t=new Jr,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:i=>{if(i.type!==hi.HEADERS&&i.type===hi.DATA&&i.data){let a=r.decode(i.data,{stream:!0});n+=a;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)o(f)}},error:i=>t.error(i),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(i){let a=i.split(`
|
|
37
|
+
Patch operations: ${JSON.stringify(b,null,2)}
|
|
38
|
+
Error: ${A}`)}}return f()}case D.MESSAGES_SNAPSHOT:{let S=yield ze(n,o,i,(b,h,A)=>b.onMessagesSnapshotEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messages:b}=m;o=b,p({messages:o})}return f()}case D.ACTIVITY_SNAPSHOT:{let S=m,b=o.findIndex(x=>x.id===S.messageId),h=b>=0?o[b]:void 0,A=h?.role==="activity"?h:void 0,w=S.replace??!0,R=yield ze(n,o,i,(x,I,F)=>x.onActivitySnapshotEvent?.({event:S,messages:I,state:F,agent:r,input:e,activityMessage:A,existingMessage:h}));if(p(R),R.stopPropagation!==!0){let x={id:S.messageId,role:"activity",activityType:S.activityType,content:Xe(S.content)},I;b===-1?(o.push(x),I=x):A?w&&(o[b]={...A,activityType:S.activityType,content:Xe(S.content)}):w&&(o[b]=x,I=x),p({messages:o}),I&&(yield Promise.all(n.map(F=>F.onNewMessage?.({message:I,messages:o,state:i,agent:r,input:e}))))}return f()}case D.ACTIVITY_DELTA:{let S=m,b=o.findIndex(R=>R.id===S.messageId);if(b===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${S.messageId}' to apply patch`),f();let h=o[b];if(h.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${S.messageId}' is not an activity message`),f();let A=h,w=yield ze(n,o,i,(R,x,I)=>R.onActivityDeltaEvent?.({event:S,messages:x,state:I,agent:r,input:e,activityMessage:A}));if(p(w),w.stopPropagation!==!0)try{let R=Xe(A.content??{}),x=no(R,S.patch??[],!0,!1).newDocument;o[b]={...A,content:Xe(x),activityType:S.activityType},p({messages:o})}catch(R){let x=R instanceof Error?R.message:String(R);console.warn(`Failed to apply activity patch for '${S.messageId}': ${x}`)}return f()}case D.RAW:return p(yield ze(n,o,i,(S,b,h)=>S.onRawEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.CUSTOM:return p(yield ze(n,o,i,(S,b,h)=>S.onCustomEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.RUN_STARTED:{let S=yield ze(n,o,i,(b,h,A)=>b.onRunStartedEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let b=m;if(b.input?.messages){for(let h of b.input.messages)o.find(A=>A.id===h.id)||o.push(h);p({messages:o})}}return f()}case D.RUN_FINISHED:return p(yield ze(n,o,i,(S,b,h)=>S.onRunFinishedEvent?.({event:m,messages:b,state:h,agent:r,input:e,result:m.result}))),f();case D.RUN_ERROR:return p(yield ze(n,o,i,(S,b,h)=>S.onRunErrorEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.STEP_STARTED:return p(yield ze(n,o,i,(S,b,h)=>S.onStepStartedEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.STEP_FINISHED:return p(yield ze(n,o,i,(S,b,h)=>S.onStepFinishedEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case D.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case D.THINKING_START:return f();case D.THINKING_END:return f();case D.THINKING_TEXT_MESSAGE_START:return f();case D.THINKING_TEXT_MESSAGE_CONTENT:return f();case D.THINKING_TEXT_MESSAGE_END:return f();case D.REASONING_START:return p(yield ze(n,o,i,(S,b,h)=>S.onReasoningStartEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.REASONING_MESSAGE_START:{let S=yield ze(n,o,i,(b,h,A)=>b.onReasoningMessageStartEvent?.({event:m,messages:h,state:A,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:b}=m;if(!o.find(h=>h.id===b)){let h={id:b,role:"reasoning",content:""};o.push(h),p({messages:o})}}return f()}case D.REASONING_MESSAGE_CONTENT:{let{messageId:S,delta:b}=m,h=o.find(w=>w.id===S);if(!h)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let A=yield ze(n,o,i,(w,R,x)=>w.onReasoningMessageContentEvent?.({event:m,messages:R,state:x,agent:r,input:e,reasoningMessageBuffer:typeof h.content=="string"?h.content:""}));return p(A),A.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${b}`,p({messages:o})),f()}case D.REASONING_MESSAGE_END:{let{messageId:S}=m,b=o.find(h=>h.id===S);return b?(p(yield ze(n,o,i,(h,A,w)=>h.onReasoningMessageEndEvent?.({event:m,messages:A,state:w,agent:r,input:e,reasoningMessageBuffer:typeof b.content=="string"?b.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:b,messages:o,state:i,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${S}'`),f())}case D.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case D.REASONING_END:return p(yield ze(n,o,i,(S,b,h)=>S.onReasoningEndEvent?.({event:m,messages:b,state:h,agent:r,input:e}))),f();case D.REASONING_ENCRYPTED_VALUE:{let{subtype:S,entityId:b,encryptedValue:h}=m,A=yield ze(n,o,i,(w,R,x)=>w.onReasoningEncryptedValueEvent?.({event:m,messages:R,state:x,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let w=!1;if(S==="tool-call"){for(let R of o)if(R.role==="assistant"&&R.toolCalls){let x=R.toolCalls.find(I=>I.id===b);if(x){x.encryptedValue=h,w=!0;break}}}else{let R=o.find(x=>x.id===b);R?.role!=="activity"&&R&&(R.encryptedValue=h,w=!0)}w&&(a.messages=o)}return f()}}return m.type,f()});return function(_x197){return _ref76.apply(this,arguments)}}()),qy(),n.length>0?My({}):m=>m)},Zy=e=>t=>{let r=new Map,n=new Map,o=!1,i=!1,a=!1,p=new Map,f=!1,m=!1,g=!1,S=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,o=!1,i=!1,g=!0};return t.pipe(Zt(b=>{let h=b.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(b)),i)return nt(()=>new st(`Cannot send event type '${h}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&h!==D.RUN_ERROR&&h!==D.RUN_STARTED)return nt(()=>new st(`Cannot send event type '${h}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(a){if(h===D.RUN_STARTED){if(g&&!o)return nt(()=>new st("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&S()}}else if(a=!0,h!==D.RUN_STARTED&&h!==D.RUN_ERROR)return nt(()=>new st("First event must be 'RUN_STARTED'"));switch(h){case D.TEXT_MESSAGE_START:{let A=b.messageId;return r.has(A)?nt(()=>new st(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${A}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(A,!0),ct(b))}case D.TEXT_MESSAGE_CONTENT:{let A=b.messageId;return r.has(A)?ct(b):nt(()=>new st(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${A}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case D.TEXT_MESSAGE_END:{let A=b.messageId;return r.has(A)?(r.delete(A),ct(b)):nt(()=>new st(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${A}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case D.TOOL_CALL_START:{let A=b.toolCallId;return n.has(A)?nt(()=>new st(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${A}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(A,!0),ct(b))}case D.TOOL_CALL_ARGS:{let A=b.toolCallId;return n.has(A)?ct(b):nt(()=>new st(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${A}'. Start a tool call with 'TOOL_CALL_START' first.`))}case D.TOOL_CALL_END:{let A=b.toolCallId;return n.has(A)?(n.delete(A),ct(b)):nt(()=>new st(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${A}'. A 'TOOL_CALL_START' event must be sent first.`))}case D.STEP_STARTED:{let A=b.stepName;return p.has(A)?nt(()=>new st(`Step "${A}" is already active for 'STEP_STARTED'`)):(p.set(A,!0),ct(b))}case D.STEP_FINISHED:{let A=b.stepName;return p.has(A)?(p.delete(A),ct(b)):nt(()=>new st(`Cannot send 'STEP_FINISHED' for step "${A}" that was not started`))}case D.RUN_STARTED:return g=!0,ct(b);case D.RUN_FINISHED:if(p.size>0){let A=Array.from(p.keys()).join(", ");return nt(()=>new st(`Cannot send 'RUN_FINISHED' while steps are still active: ${A}`))}if(r.size>0){let A=Array.from(r.keys()).join(", ");return nt(()=>new st(`Cannot send 'RUN_FINISHED' while text messages are still active: ${A}`))}if(n.size>0){let A=Array.from(n.keys()).join(", ");return nt(()=>new st(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${A}`))}return o=!0,ct(b);case D.RUN_ERROR:return i=!0,ct(b);case D.CUSTOM:return ct(b);case D.THINKING_TEXT_MESSAGE_START:return f?m?nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,ct(b)):nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case D.THINKING_TEXT_MESSAGE_CONTENT:return m?ct(b):nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case D.THINKING_TEXT_MESSAGE_END:return m?(m=!1,ct(b)):nt(()=>new st("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case D.THINKING_START:return f?nt(()=>new st("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,ct(b));case D.THINKING_END:return f?(f=!1,ct(b)):nt(()=>new st("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ct(b)}}))},hi=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),Tj=(e,t)=>Dy(()=>fi(v(e,t))).pipe(jy(r=>{if(!r.ok){let i=r.headers.get("content-type")||"";return fi(r.text()).pipe(Zt(a=>{let p=a;if(i.includes("application/json"))try{p=JSON.parse(a)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,nt(()=>f)}))}let n={type:hi.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new rt(i=>(i.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:p}=yield o.read();if(a)break;let f={type:hi.DATA,data:p};i.next(f)}i.complete()}catch(a){i.error(a)}})(),()=>{o.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):nt(()=>Error("Failed to getReader() from response"))})),Pj=e=>{let t=new Jr,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:i=>{if(i.type!==hi.HEADERS&&i.type===hi.DATA&&i.data){let a=r.decode(i.data,{stream:!0});n+=a;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)o(f)}},error:i=>t.error(i),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(i){let a=i.split(`
|
|
39
39
|
`),p=[];for(let f of a)f.startsWith("data:")&&p.push(f.slice(5).replace(/^ /,""));if(p.length>0)try{let f=p.join(`
|
|
40
|
-
`),m=JSON.parse(f);t.next(m)}catch(f){t.error(f)}}return t.asObservable()},
|
|
41
|
-
`)},Uj=(e,t,r)=>n=>{let o={},i=!0,a=!0,p="",f=null,m=null,h=[],v={},C=g=>{typeof g=="object"&&g&&("messages"in g&&delete g.messages,o=g)};return n.pipe(Zt(g=>{switch(g.type){case D.TEXT_MESSAGE_START:{let S=g;return[{type:et.enum.TextMessageStart,messageId:S.messageId,role:S.role}]}case D.TEXT_MESSAGE_CONTENT:{let S=g;return[{type:et.enum.TextMessageContent,messageId:S.messageId,content:S.delta}]}case D.TEXT_MESSAGE_END:{let S=g;return[{type:et.enum.TextMessageEnd,messageId:S.messageId}]}case D.TOOL_CALL_START:{let S=g;return h.push({id:S.toolCallId,type:"function",function:{name:S.toolCallName,arguments:""}}),a=!0,v[S.toolCallId]=S.toolCallName,[{type:et.enum.ActionExecutionStart,actionExecutionId:S.toolCallId,actionName:S.toolCallName,parentMessageId:S.parentMessageId}]}case D.TOOL_CALL_ARGS:{let S=g,x=h.find(R=>R.id===S.toolCallId);if(!x)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${S.toolCallId}'`),[];x.function.arguments+=S.delta;let w=!1;if(m){let R=m.find(I=>I.tool==x.function.name);if(R)try{let I=JSON.parse(op(x.function.arguments));R.tool_argument&&R.tool_argument in I?(C({...o,[R.state_key]:I[R.tool_argument]}),w=!0):R.tool_argument||(C({...o,[R.state_key]:I}),w=!0)}catch{}}return[{type:et.enum.ActionExecutionArgs,actionExecutionId:S.toolCallId,args:S.delta},...(w?[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case D.TOOL_CALL_END:{let S=g;return[{type:et.enum.ActionExecutionEnd,actionExecutionId:S.toolCallId}]}case D.TOOL_CALL_RESULT:{let S=g;return[{type:et.enum.ActionExecutionResult,actionExecutionId:S.toolCallId,result:S.content,actionName:v[S.toolCallId]||"unknown"}]}case D.RAW:return[];case D.CUSTOM:{let S=g;switch(S.name){case"Exit":i=!1;break;case"PredictState":m=S.value;break}return[{type:et.enum.MetaEvent,name:S.name,value:S.value}]}case D.STATE_SNAPSHOT:return C(g.snapshot),[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case D.STATE_DELTA:{let S=g,x=no(o,S.delta,!0,!1);return x?(C(x.newDocument),[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case D.MESSAGES_SNAPSHOT:return f=g.messages,[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case D.RUN_STARTED:return[];case D.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(f?{messages:Qj(f)}:{})}),active:!1}];case D.RUN_ERROR:{let S=g;return[{type:et.enum.RunError,message:S.message,code:S.code}]}case D.STEP_STARTED:return p=g.stepName,h=[],m=null,[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case D.STEP_FINISHED:return h=[],m=null,[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function Qj(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=Lj(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var Pp=e=>t=>{let r,n,o,i,a=()=>{if(!r||i!=="text")throw Error("No text message to close");let h={type:D.TEXT_MESSAGE_END,messageId:r.messageId};return i=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(h)),h},p=()=>{if(!n||i!=="tool")throw Error("No tool call to close");let h={type:D.TOOL_CALL_END,toolCallId:n.toolCallId};return i=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(h)),h},f=()=>{if(!o||i!=="reasoning")throw Error("No reasoning message to close");let h={type:D.REASONING_MESSAGE_END,messageId:o.messageId};return i=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(h)),h},m=()=>i==="text"?[a()]:i==="tool"?[p()]:i==="reasoning"?[f()]:[];return t.pipe(Zt(h=>{switch(h.type){case D.TEXT_MESSAGE_START:case D.TEXT_MESSAGE_CONTENT:case D.TEXT_MESSAGE_END:case D.TOOL_CALL_START:case D.TOOL_CALL_ARGS:case D.TOOL_CALL_END:case D.TOOL_CALL_RESULT:case D.STATE_SNAPSHOT:case D.STATE_DELTA:case D.MESSAGES_SNAPSHOT:case D.CUSTOM:case D.RUN_STARTED:case D.RUN_FINISHED:case D.RUN_ERROR:case D.STEP_STARTED:case D.STEP_FINISHED:case D.THINKING_START:case D.THINKING_END:case D.THINKING_TEXT_MESSAGE_START:case D.THINKING_TEXT_MESSAGE_CONTENT:case D.THINKING_TEXT_MESSAGE_END:case D.REASONING_START:case D.REASONING_MESSAGE_START:case D.REASONING_MESSAGE_CONTENT:case D.REASONING_MESSAGE_END:case D.REASONING_END:return[...m(),h];case D.RAW:case D.ACTIVITY_SNAPSHOT:case D.ACTIVITY_DELTA:case D.REASONING_ENCRYPTED_VALUE:return[h];case D.TEXT_MESSAGE_CHUNK:let v=h,C=[];if((i!=="text"||v.messageId!==void 0&&v.messageId!==r?.messageId)&&C.push(...m()),i!=="text"){if(v.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:v.messageId},i="text";let R={type:D.TEXT_MESSAGE_START,messageId:v.messageId,role:v.role||"assistant"};C.push(R),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(R))}if(v.delta!==void 0){let R={type:D.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:v.delta};C.push(R),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(R))}return C;case D.TOOL_CALL_CHUNK:let g=h,S=[];if((i!=="tool"||g.toolCallId!==void 0&&g.toolCallId!==n?.toolCallId)&&S.push(...m()),i!=="tool"){if(g.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(g.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId},i="tool";let R={type:D.TOOL_CALL_START,toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId};S.push(R),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(R))}if(g.delta!==void 0){let R={type:D.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:g.delta};S.push(R),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(R))}return S;case D.REASONING_MESSAGE_CHUNK:let x=h,w=[];if((i!=="reasoning"||x.messageId&&x.messageId!==o?.messageId)&&w.push(...m()),i!=="reasoning"){if(x.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:x.messageId},i="reasoning";let R={type:D.REASONING_MESSAGE_START,messageId:x.messageId};w.push(R),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(R))}if(x.delta!==void 0){let R={type:D.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:x.delta};w.push(R),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(R))}return w}return h.type,[]}),gi(()=>{m()}))},Jy=class{runNext(e,t){return t.run(e).pipe(Pp(!1))}runNextWithState(e,t){let r=Xe(e.messages||[]),n=Xe(e.state||{}),o=new Ud;return pw(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(rp(/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:Xe(r),state:Xe(n)}});return function(_x192){return _ref75.apply(this,arguments)}}()))}},Bj=class extends Jy{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function Gj(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var $j=class extends Jy{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(Gj)};return this.runNext(o,t)}},sw="THINKING_START",cw="THINKING_END",uw="THINKING_TEXT_MESSAGE_START",lw="THINKING_TEXT_MESSAGE_CONTENT",dw="THINKING_TEXT_MESSAGE_END",Hj=class extends Jy{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(mi(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case sw:{this.currentReasoningId=Lc();let{title:t,...r}=e;return this.warnAboutTransformation(sw,D.REASONING_START),{...r,type:D.REASONING_START,messageId:this.currentReasoningId}}case uw:return this.currentMessageId=Lc(),this.warnAboutTransformation(uw,D.REASONING_MESSAGE_START),{...e,type:D.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case lw:{let{delta:t,...r}=e;return this.warnAboutTransformation(lw,D.REASONING_MESSAGE_CONTENT),{...r,type:D.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Lc(),delta:t}}case dw:{let t=this.currentMessageId??Lc();return this.warnAboutTransformation(dw,D.REASONING_MESSAGE_END),{...e,type:D.REASONING_MESSAGE_END,messageId:t}}case cw:{let t=this.currentReasoningId??Lc();return this.warnAboutTransformation(cw,D.REASONING_END),{...e,type:D.REASONING_END,messageId:t}}default:return e}}},zj="0.0.45",Wj=class{get maxVersion(){return zj}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Xn(),this.messages=Xe(n??[]),this.state=Xe(o??{}),this.debug=i??!1,Tp(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new $j),Tp(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new Hj)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new Bj(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this35=this;return _asyncToGenerator(function*(){try{_this35.isRunning=!0,_this35.agentId=_this35.agentId??Xn();let r=_this35.prepareRunAgentInput(e),n,o=new Set(_this35.messages.map(f=>f.id)),i=[{onRunFinishedEvent:f=>{n=f.result}},..._this35.subscribers,t??{}];yield _this35.onInitialize(r,i),_this35.activeRunDetach$=new Jr;let a;_this35.activeRunCompletionPromise=new Promise(f=>{a=f}),yield tp(Ld(()=>_this35.middlewares.length===0?_this35.run(r):_this35.middlewares.reduceRight((f,m)=>({run:h=>m.run(h,f)}),_this35).run(r),Pp(_this35.debug),Ky(_this35.debug),f=>f.pipe(np(_this35.activeRunDetach$)),f=>_this35.apply(r,f,i),f=>_this35.processApplyEvents(r,f,i),Mc(f=>(_this35.isRunning=!1,_this35.onError(r,f,i))),gi(()=>{_this35.isRunning=!1,_this35.onFinalize(r,i),a?.(),a=void 0,_this35.activeRunCompletionPromise=void 0,_this35.activeRunDetach$=void 0}))(ct(null)));let p=Xe(_this35.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this35.isRunning=!1}})()}connect(e){throw new vy}connectAgent(e,t){var _this36=this;return _asyncToGenerator(function*(){try{_this36.isRunning=!0,_this36.agentId=_this36.agentId??Xn();let r=_this36.prepareRunAgentInput(e),n,o=new Set(_this36.messages.map(f=>f.id)),i=[{onRunFinishedEvent:f=>{n=f.result}},..._this36.subscribers,t??{}];yield _this36.onInitialize(r,i),_this36.activeRunDetach$=new Jr;let a;_this36.activeRunCompletionPromise=new Promise(f=>{a=f}),yield tp(Ld(()=>_this36.connect(r),Pp(_this36.debug),Ky(_this36.debug),f=>f.pipe(np(_this36.activeRunDetach$)),f=>_this36.apply(r,f,i),f=>_this36.processApplyEvents(r,f,i),Mc(f=>(_this36.isRunning=!1,f instanceof vy?Qd:_this36.onError(r,f,i))),gi(()=>{_this36.isRunning=!1,_this36.onFinalize(r,i),a?.(),a=void 0,_this36.activeRunCompletionPromise=void 0,_this36.activeRunDetach$=void 0}))(ct(null)));let p=Xe(_this36.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this36.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this37=this;return _asyncToGenerator(function*(){if(!_this37.activeRunDetach$)return;let e=_this37.activeRunCompletionPromise??Promise.resolve();_this37.activeRunDetach$.next(),_this37.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return pw(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(Dy(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Xe(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Xn(),tools:Xe(e?.tools??[]),context:Xe(e?.context??[]),forwardedProps:Xe(e?.forwardedProps??{}),state:Xe(this.state),messages:t}}onInitialize(e,t){var _this38=this;return _asyncToGenerator(function*(){let r=yield ze(t,_this38.messages,_this38.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this38,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this38.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this38.messages,state:_this38.state,agent:_this38,input:e})})),r.state&&(_this38.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this38.state,messages:_this38.messages,agent:_this38,input:e})})))})()}onError(e,t,r){return fi(ze(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(mi(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this39=this;return _asyncToGenerator(function*(){let r=yield ze(t,_this39.messages,_this39.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this39,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this39.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this39.messages,state:_this39.state,agent:_this39,input:e})})),r.state!==void 0&&(_this39.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this39.state,messages:_this39.messages,agent:_this39,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Xe(this.messages),e.state=Xe(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this40=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this40.subscribers)yield t.onNewMessage?.({message:e,messages:_this40.messages,state:_this40.state,agent:_this40});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this40.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this40.messages,state:_this40.state,agent:_this40});for(let t of _this40.subscribers)yield t.onMessagesChanged?.({messages:_this40.messages,state:_this40.state,agent:_this40})})()}addMessages(e){var _this41=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this41.subscribers)yield r.onNewMessage?.({message:t,messages:_this41.messages,state:_this41.state,agent:_this41});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this41.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this41.messages,state:_this41.state,agent:_this41})}for(let t of _this41.subscribers)yield t.onMessagesChanged?.({messages:_this41.messages,state:_this41.state,agent:_this41})})()}setMessages(e){var _this42=this;this.messages=Xe(e),_asyncToGenerator(function*(){for(let t of _this42.subscribers)yield t.onMessagesChanged?.({messages:_this42.messages,state:_this42.state,agent:_this42})})()}setState(e){var _this43=this;this.state=Xe(e),_asyncToGenerator(function*(){for(let t of _this43.subscribers)yield t.onStateChanged?.({messages:_this43.messages,state:_this43.state,agent:_this43})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Xn();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(Pp(this.debug),Ky(this.debug),Uj(this.threadId,t.runId,this.agentId),r=>r.pipe(mi(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},fw=class extends Wj{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Xe(e.headers??{})}run(e){return Fj(wj(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Xe(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var mw=(e,t,r)=>{let n=We(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/preview/organizations/${t}/agents`;return`${n}${i}/${o}`};var Xy=class extends fw{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},gw=(e,t,r)=>new Xy({url:`${mw(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var Yj=new L({required:!0}),hw=T("followUpAnswers/setIsEnabled",e=>_(e,new ue({required:!0}))),yw=T("followUpAnswers/setFollowUpAnswersConversationId",e=>_(e,G)),Lve=T("followUpAnswers/createFollowUpAnswer",e=>_(e,{question:G})),Uve=T("followUpAnswers/setActiveFollowUpAnswerId",e=>_(e,G)),Qve=T("followUpAnswers/setFollowUpAnswerContentFormat",e=>_(e,{contentFormat:Zl,answerId:G})),Bve=T("followUpAnswers/setFollowUpIsLoading",e=>_(e,{isLoading:new ue({required:!0}),answerId:G})),Gve=T("followUpAnswers/setFollowUpIsStreaming",e=>_(e,{isStreaming:new ue({required:!0}),answerId:G})),$ve=T("followUpAnswers/followUpMessageChunkReceived",e=>_(e,{textDelta:Yj,answerId:G})),Hve=T("followUpAnswers/followUpCitationsReceived",e=>_(e,{citations:new re({required:!0,each:new W({values:iy})}),answerId:G})),zve=T("followUpAnswers/followUpCompleted",e=>_(e,{answerId:G,cannotAnswer:new ue({required:!1})})),Wve=T("followUpAnswers/followUpFailed",e=>_(e,{message:new L,code:new ne({min:0}),answerId:G})),Yve=T("followUpAnswers/activeFollowUpStartFailed",e=>_(e,{message:new L})),Kve=T("followUpAnswers/likeFollowUp",e=>_(e,{answerId:G})),Jve=T("followUpAnswers/dislikeFollowUp",e=>_(e,{answerId:G})),Xve=T("followUpAnswers/submitFollowUpFeedback",e=>_(e,{answerId:G})),Sw=T("followUpAnswers/resetFollowUpAnswers"),Zve=T("followUpAnswers/stepStarted",e=>_(e,{answerId:G,name:new L({required:!0,constrainTo:wa}),startedAt:new ne({min:0,required:!0})})),eAe=T("followUpAnswers/stepFinished",e=>_(e,{answerId:G,name:new L({required:!0,constrainTo:wa}),finishedAt:new ne({min:0,required:!0})}));d();c();l();u();var Kj={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004};function vw(e){return e?Kj[e]??1004:1004}var Aw=e=>({onRunStartedEvent:({event:t})=>{e(Ta(t.runId)),e($r(!1)),e(Uo(!0)),e(yw(t.threadId))},onStepStartedEvent:({event:t})=>{e(ld({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(dd({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(Qo({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e($o(n.contentFormat)),n?.followUpEnabled&&e(hw(n.followUpEnabled));return}case"citations":{e(Bo({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=vw(t.code);e(Go({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.answerGenerated??!1;e(Ec(r)),e(Ho(!r)),e(Uo(!1)),e(xa(r)),e(Ra())}});var Cw=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref80=_asyncToGenerator(function*(n,o,i){t();let a=tl(n),p=vC(n),f=AC(n),m=SC(n),h=gw(a,p,f);e=h;let v=Aw(o),C=bx(n,i());try{o($r(!0)),yield h.runAgent({forwardedProps:{params:C,accessToken:m}},v)}catch(g){o($r(!1)),o(Go({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",g)}});return function run(_x193,_x194,_x195){return _ref80.apply(this,arguments)}}(),abortRun:t}};var bw=e=>{let t=CA({extra:e}),r=Cw();return t.startListening({actionCreator:Fe.pending,effect:function(){var _ref81=_asyncToGenerator(function*(n,o){let i=o.getState();if(!ih(i))return;r.abortRun(),o.dispatch(ar()),o.dispatch(Sw());let a=Lo(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x196,_x197){return _ref81.apply(this,arguments)}}()}),t};d();c();l();u();var xw=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},Rw=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var Zy=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();function ww(e,t){let r={...e},n,o=i=>(a,p)=>{let f=i(a,p);return n?n(f,p):f};return{get combinedReducer(){let i=ZS(Object.entries(t).filter(([a])=>!(a in r)).map(([a,p])=>[a,()=>p]));return o(Mi({...i,...r}))},containsAll(i){return Object.keys(i).every(p=>p in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function Jj(e){if(!e||!Xj(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Iw(e,t=60){if(!e)return!1;let r=Jj(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Xj(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Fw(e,t){let r=0,n=null,o=mu(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(f,m=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(C){if(!m)throw C;return null}})().finally(()=>{n=null}));let v=yield n;return h&&v&&f.dispatch(ca({accessToken:v})),v});return function i(_x198){return _ref82.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(f){let m=f.getState(),h=eV(m);if(!(!h||!Iw(h))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(v){e.warn(v,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x199){return _ref84.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref85=_asyncToGenerator(function*(f,m,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Ew(f,m.error),m;r++,o(),yield i(f,!0),f.dispatch(h)});return function p(_x200,_x201,_x202){return _ref85.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref86=_asyncToGenerator(function*(h){let v=typeof h=="function",C=typeof t=="function";if(!v)return m(h);C&&(yield a(f));let g=yield m(h);return Zj(g)?C?yield p(f,g,h):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Ew(f,g.error),g):g});return function(_x203){return _ref86.apply(this,arguments)}}())}function Zj(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Ni().name}function Ew(e,t){e.dispatch(Aa({status:401,statusCode:401,message:t.message,type:t.name}))}function eV(e){return e.configuration.accessToken}d();c();l();u();function Tw({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return sA({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Rw(n.logger))})}function tV(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&XS()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Pw(e,t){let r={...e.reducers,configuration:ve,version:Ex},n=rV({...e,reducers:r},t,ve),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(ca({accessToken:o,environment:i,organizationId:a}));let p=tV(e.configuration,n.logger);return p&&n.dispatch(ll(p)),n}function rV(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=ww({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,p={...t,get relay(){return ac(m.state,o)},get navigatorContext(){return Zy(this.relay,o)}},f=nV(e,p,i),m={addReducers(h){i.containsAll(h)||(i.add(h),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(pl())},disableAnalytics(){f.dispatch(dl())},get state(){return f.getState()},get relay(){return ac(this.state,o)},get navigatorContext(){return Zy(this.relay,o)},logger:a,store:f};return m}function nV(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=oV(e,t.logger,()=>t.navigatorContext);return Tw({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function oV(e,t,r){let{renewAccessToken:n}=e.configuration,o=Fw(t,n),i=bw({getNavigatorContext:r});return[Nx,o,xw(t),Tx].concat(zo.middleware,i.middleware,e.middlewares||[])}var iV=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
40
|
+
`),m=JSON.parse(f);t.next(m)}catch(f){t.error(f)}}return t.asObservable()},kj=e=>{let t=new Jr,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==hi.HEADERS&&o.type===hi.DATA&&o.data){let i=new Uint8Array(r.length+o.data.length);i.set(r,0),i.set(o.data,r.length),r=i,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let i=r.slice(4,o),a=uw(i);t.next(a),r=r.slice(o)}catch(i){let a=i instanceof Error?i.message:String(i);t.error(Error(`Failed to decode protocol buffer message: ${a}`));return}}}return t.asObservable()},Oj=e=>{let t=new Jr,r=new Qd,n=!1;return e.subscribe({next:o=>{r.next(o),o.type===hi.HEADERS&&!n?(n=!0,o.headers.get("content-type")===lw?kj(r).subscribe({next:i=>t.next(i),error:i=>t.error(i),complete:()=>t.complete()}):Pj(r).subscribe({next:i=>{try{let a=Fd.parse(i);t.next(a)}catch(a){t.error(a)}},error:i=>{if(i?.name==="AbortError"){t.next({type:D.RUN_ERROR,message:i.message||"Request aborted",code:"abort",rawEvent:i}),t.complete();return}return t.error(i)},complete:()=>t.complete()})):n||t.error(Error("No headers event received before data events"))},error:o=>{r.error(o),t.error(o)},complete:()=>{r.complete()}}),t.asObservable()},et=E.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),_j=E.enum(["LangGraphInterruptEvent","PredictState","Exit"]),Nj=E.object({type:E.literal(et.enum.TextMessageStart),messageId:E.string(),parentMessageId:E.string().optional(),role:E.string().optional()}),qj=E.object({type:E.literal(et.enum.TextMessageContent),messageId:E.string(),content:E.string()}),Dj=E.object({type:E.literal(et.enum.TextMessageEnd),messageId:E.string()}),Mj=E.object({type:E.literal(et.enum.ActionExecutionStart),actionExecutionId:E.string(),actionName:E.string(),parentMessageId:E.string().optional()}),jj=E.object({type:E.literal(et.enum.ActionExecutionArgs),actionExecutionId:E.string(),args:E.string()}),Vj=E.object({type:E.literal(et.enum.ActionExecutionEnd),actionExecutionId:E.string()}),Lj=E.object({type:E.literal(et.enum.ActionExecutionResult),actionName:E.string(),actionExecutionId:E.string(),result:E.string()}),Uj=E.object({type:E.literal(et.enum.AgentStateMessage),threadId:E.string(),agentName:E.string(),nodeName:E.string(),runId:E.string(),active:E.boolean(),role:E.string(),state:E.string(),running:E.boolean()}),Qj=E.object({type:E.literal(et.enum.MetaEvent),name:_j,value:E.any()}),Bj=E.object({type:E.literal(et.enum.RunError),message:E.string(),code:E.string().optional()});E.discriminatedUnion("type",[Nj,qj,Dj,Mj,jj,Vj,Lj,Uj,Qj,Bj]),E.object({id:E.string(),role:E.string(),content:E.string(),parentMessageId:E.string().optional()}),E.object({id:E.string(),name:E.string(),arguments:E.any(),parentMessageId:E.string().optional()}),E.object({id:E.string(),result:E.any(),actionExecutionId:E.string(),actionName:E.string()});var Gj=e=>{if(typeof e=="string")return e;if(!Array.isArray(e))return;let t=e.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(t.length!==0)return t.join(`
|
|
41
|
+
`)},$j=(e,t,r)=>n=>{let o={},i=!0,a=!0,p="",f=null,m=null,g=[],S={},b=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,o=h)};return n.pipe(Zt(h=>{switch(h.type){case D.TEXT_MESSAGE_START:{let A=h;return[{type:et.enum.TextMessageStart,messageId:A.messageId,role:A.role}]}case D.TEXT_MESSAGE_CONTENT:{let A=h;return[{type:et.enum.TextMessageContent,messageId:A.messageId,content:A.delta}]}case D.TEXT_MESSAGE_END:{let A=h;return[{type:et.enum.TextMessageEnd,messageId:A.messageId}]}case D.TOOL_CALL_START:{let A=h;return g.push({id:A.toolCallId,type:"function",function:{name:A.toolCallName,arguments:""}}),a=!0,S[A.toolCallId]=A.toolCallName,[{type:et.enum.ActionExecutionStart,actionExecutionId:A.toolCallId,actionName:A.toolCallName,parentMessageId:A.parentMessageId}]}case D.TOOL_CALL_ARGS:{let A=h,w=g.find(x=>x.id===A.toolCallId);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${A.toolCallId}'`),[];w.function.arguments+=A.delta;let R=!1;if(m){let x=m.find(I=>I.tool==w.function.name);if(x)try{let I=JSON.parse(ip(w.function.arguments));x.tool_argument&&x.tool_argument in I?(b({...o,[x.state_key]:I[x.tool_argument]}),R=!0):x.tool_argument||(b({...o,[x.state_key]:I}),R=!0)}catch{}}return[{type:et.enum.ActionExecutionArgs,actionExecutionId:A.toolCallId,args:A.delta},...(R?[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case D.TOOL_CALL_END:{let A=h;return[{type:et.enum.ActionExecutionEnd,actionExecutionId:A.toolCallId}]}case D.TOOL_CALL_RESULT:{let A=h;return[{type:et.enum.ActionExecutionResult,actionExecutionId:A.toolCallId,result:A.content,actionName:S[A.toolCallId]||"unknown"}]}case D.RAW:return[];case D.CUSTOM:{let A=h;switch(A.name){case"Exit":i=!1;break;case"PredictState":m=A.value;break}return[{type:et.enum.MetaEvent,name:A.name,value:A.value}]}case D.STATE_SNAPSHOT:return b(h.snapshot),[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case D.STATE_DELTA:{let A=h,w=no(o,A.delta,!0,!1);return w?(b(w.newDocument),[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case D.MESSAGES_SNAPSHOT:return f=h.messages,[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case D.RUN_STARTED:return[];case D.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(f?{messages:Hj(f)}:{})}),active:!1}];case D.RUN_ERROR:{let A=h;return[{type:et.enum.RunError,message:A.message,code:A.code}]}case D.STEP_STARTED:return p=h.stepName,g=[],m=null,[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case D.STEP_FINISHED:return g=[],m=null,[{type:et.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function Hj(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=Gj(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var kp=e=>t=>{let r,n,o,i,a=()=>{if(!r||i!=="text")throw Error("No text message to close");let g={type:D.TEXT_MESSAGE_END,messageId:r.messageId};return i=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(g)),g},p=()=>{if(!n||i!=="tool")throw Error("No tool call to close");let g={type:D.TOOL_CALL_END,toolCallId:n.toolCallId};return i=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(g)),g},f=()=>{if(!o||i!=="reasoning")throw Error("No reasoning message to close");let g={type:D.REASONING_MESSAGE_END,messageId:o.messageId};return i=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(g)),g},m=()=>i==="text"?[a()]:i==="tool"?[p()]:i==="reasoning"?[f()]:[];return t.pipe(Zt(g=>{switch(g.type){case D.TEXT_MESSAGE_START:case D.TEXT_MESSAGE_CONTENT:case D.TEXT_MESSAGE_END:case D.TOOL_CALL_START:case D.TOOL_CALL_ARGS:case D.TOOL_CALL_END:case D.TOOL_CALL_RESULT:case D.STATE_SNAPSHOT:case D.STATE_DELTA:case D.MESSAGES_SNAPSHOT:case D.CUSTOM:case D.RUN_STARTED:case D.RUN_FINISHED:case D.RUN_ERROR:case D.STEP_STARTED:case D.STEP_FINISHED:case D.THINKING_START:case D.THINKING_END:case D.THINKING_TEXT_MESSAGE_START:case D.THINKING_TEXT_MESSAGE_CONTENT:case D.THINKING_TEXT_MESSAGE_END:case D.REASONING_START:case D.REASONING_MESSAGE_START:case D.REASONING_MESSAGE_CONTENT:case D.REASONING_MESSAGE_END:case D.REASONING_END:return[...m(),g];case D.RAW:case D.ACTIVITY_SNAPSHOT:case D.ACTIVITY_DELTA:case D.REASONING_ENCRYPTED_VALUE:return[g];case D.TEXT_MESSAGE_CHUNK:let S=g,b=[];if((i!=="text"||S.messageId!==void 0&&S.messageId!==r?.messageId)&&b.push(...m()),i!=="text"){if(S.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:S.messageId},i="text";let x={type:D.TEXT_MESSAGE_START,messageId:S.messageId,role:S.role||"assistant"};b.push(x),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(x))}if(S.delta!==void 0){let x={type:D.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:S.delta};b.push(x),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(x))}return b;case D.TOOL_CALL_CHUNK:let h=g,A=[];if((i!=="tool"||h.toolCallId!==void 0&&h.toolCallId!==n?.toolCallId)&&A.push(...m()),i!=="tool"){if(h.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(h.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId},i="tool";let x={type:D.TOOL_CALL_START,toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId};A.push(x),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(x))}if(h.delta!==void 0){let x={type:D.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:h.delta};A.push(x),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(x))}return A;case D.REASONING_MESSAGE_CHUNK:let w=g,R=[];if((i!=="reasoning"||w.messageId&&w.messageId!==o?.messageId)&&R.push(...m()),i!=="reasoning"){if(w.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:w.messageId},i="reasoning";let x={type:D.REASONING_MESSAGE_START,messageId:w.messageId};R.push(x),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(x))}if(w.delta!==void 0){let x={type:D.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:w.delta};R.push(x),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(x))}return R}return g.type,[]}),gi(()=>{m()}))},eS=class{runNext(e,t){return t.run(e).pipe(kp(!1))}runNextWithState(e,t){let r=Xe(e.messages||[]),n=Xe(e.state||{}),o=new Qd;return Sw(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(np(/*#__PURE__*/function(){var _ref78=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:Xe(r),state:Xe(n)}});return function(_x198){return _ref78.apply(this,arguments)}}()))}},zj=class extends eS{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function Wj(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var Yj=class extends eS{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(Wj)};return this.runNext(o,t)}},fw="THINKING_START",mw="THINKING_END",gw="THINKING_TEXT_MESSAGE_START",hw="THINKING_TEXT_MESSAGE_CONTENT",yw="THINKING_TEXT_MESSAGE_END",Kj=class extends eS{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(mi(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case fw:{this.currentReasoningId=Vc();let{title:t,...r}=e;return this.warnAboutTransformation(fw,D.REASONING_START),{...r,type:D.REASONING_START,messageId:this.currentReasoningId}}case gw:return this.currentMessageId=Vc(),this.warnAboutTransformation(gw,D.REASONING_MESSAGE_START),{...e,type:D.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case hw:{let{delta:t,...r}=e;return this.warnAboutTransformation(hw,D.REASONING_MESSAGE_CONTENT),{...r,type:D.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Vc(),delta:t}}case yw:{let t=this.currentMessageId??Vc();return this.warnAboutTransformation(yw,D.REASONING_MESSAGE_END),{...e,type:D.REASONING_MESSAGE_END,messageId:t}}case mw:{let t=this.currentReasoningId??Vc();return this.warnAboutTransformation(mw,D.REASONING_END),{...e,type:D.REASONING_END,messageId:t}}default:return e}}},Jj="0.0.45",Xj=class{get maxVersion(){return Jj}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Xn(),this.messages=Xe(n??[]),this.state=Xe(o??{}),this.debug=i??!1,Pp(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new Yj),Pp(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new Kj)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new zj(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this35=this;return _asyncToGenerator(function*(){try{_this35.isRunning=!0,_this35.agentId=_this35.agentId??Xn();let r=_this35.prepareRunAgentInput(e),n,o=new Set(_this35.messages.map(f=>f.id)),i=[{onRunFinishedEvent:f=>{n=f.result}},..._this35.subscribers,t??{}];yield _this35.onInitialize(r,i),_this35.activeRunDetach$=new Jr;let a;_this35.activeRunCompletionPromise=new Promise(f=>{a=f}),yield rp(Ud(()=>_this35.middlewares.length===0?_this35.run(r):_this35.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f)}),_this35).run(r),kp(_this35.debug),Zy(_this35.debug),f=>f.pipe(op(_this35.activeRunDetach$)),f=>_this35.apply(r,f,i),f=>_this35.processApplyEvents(r,f,i),Dc(f=>(_this35.isRunning=!1,_this35.onError(r,f,i))),gi(()=>{_this35.isRunning=!1,_this35.onFinalize(r,i),a?.(),a=void 0,_this35.activeRunCompletionPromise=void 0,_this35.activeRunDetach$=void 0}))(ct(null)));let p=Xe(_this35.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this35.isRunning=!1}})()}connect(e){throw new by}connectAgent(e,t){var _this36=this;return _asyncToGenerator(function*(){try{_this36.isRunning=!0,_this36.agentId=_this36.agentId??Xn();let r=_this36.prepareRunAgentInput(e),n,o=new Set(_this36.messages.map(f=>f.id)),i=[{onRunFinishedEvent:f=>{n=f.result}},..._this36.subscribers,t??{}];yield _this36.onInitialize(r,i),_this36.activeRunDetach$=new Jr;let a;_this36.activeRunCompletionPromise=new Promise(f=>{a=f}),yield rp(Ud(()=>_this36.connect(r),kp(_this36.debug),Zy(_this36.debug),f=>f.pipe(op(_this36.activeRunDetach$)),f=>_this36.apply(r,f,i),f=>_this36.processApplyEvents(r,f,i),Dc(f=>(_this36.isRunning=!1,f instanceof by?Bd:_this36.onError(r,f,i))),gi(()=>{_this36.isRunning=!1,_this36.onFinalize(r,i),a?.(),a=void 0,_this36.activeRunCompletionPromise=void 0,_this36.activeRunDetach$=void 0}))(ct(null)));let p=Xe(_this36.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this36.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this37=this;return _asyncToGenerator(function*(){if(!_this37.activeRunDetach$)return;let e=_this37.activeRunCompletionPromise??Promise.resolve();_this37.activeRunDetach$.next(),_this37.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return Sw(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(Vy(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Xe(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Xn(),tools:Xe(e?.tools??[]),context:Xe(e?.context??[]),forwardedProps:Xe(e?.forwardedProps??{}),state:Xe(this.state),messages:t}}onInitialize(e,t){var _this38=this;return _asyncToGenerator(function*(){let r=yield ze(t,_this38.messages,_this38.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this38,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this38.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this38.messages,state:_this38.state,agent:_this38,input:e})})),r.state&&(_this38.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this38.state,messages:_this38.messages,agent:_this38,input:e})})))})()}onError(e,t,r){return fi(ze(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(mi(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this39=this;return _asyncToGenerator(function*(){let r=yield ze(t,_this39.messages,_this39.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this39,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this39.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this39.messages,state:_this39.state,agent:_this39,input:e})})),r.state!==void 0&&(_this39.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this39.state,messages:_this39.messages,agent:_this39,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Xe(this.messages),e.state=Xe(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this40=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this40.subscribers)yield t.onNewMessage?.({message:e,messages:_this40.messages,state:_this40.state,agent:_this40});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this40.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this40.messages,state:_this40.state,agent:_this40});for(let t of _this40.subscribers)yield t.onMessagesChanged?.({messages:_this40.messages,state:_this40.state,agent:_this40})})()}addMessages(e){var _this41=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this41.subscribers)yield r.onNewMessage?.({message:t,messages:_this41.messages,state:_this41.state,agent:_this41});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this41.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this41.messages,state:_this41.state,agent:_this41})}for(let t of _this41.subscribers)yield t.onMessagesChanged?.({messages:_this41.messages,state:_this41.state,agent:_this41})})()}setMessages(e){var _this42=this;this.messages=Xe(e),_asyncToGenerator(function*(){for(let t of _this42.subscribers)yield t.onMessagesChanged?.({messages:_this42.messages,state:_this42.state,agent:_this42})})()}setState(e){var _this43=this;this.state=Xe(e),_asyncToGenerator(function*(){for(let t of _this43.subscribers)yield t.onStateChanged?.({messages:_this43.messages,state:_this43.state,agent:_this43})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Xn();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(kp(this.debug),Zy(this.debug),$j(this.threadId,t.runId,this.agentId),r=>r.pipe(mi(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},vw=class extends Xj{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Xe(e.headers??{})}run(e){return Oj(Tj(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Xe(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var Aw=(e,t,r)=>{let n=We(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/preview/organizations/${t}/agents`;return`${n}${i}/${o}`};var tS=class extends vw{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},Cw=(e,t,r)=>new tS({url:`${Aw(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var Zj=new L({required:!0}),bw=new L({required:!0,constrainTo:Xl}),xw=e=>({...e,name:Zl(e.name)}),Rw=T("followUpAnswers/setIsEnabled",e=>_(e,new ue({required:!0}))),ww=T("followUpAnswers/setFollowUpAnswersConversationId",e=>_(e,G)),zve=T("followUpAnswers/createFollowUpAnswer",e=>_(e,{question:G})),Wve=T("followUpAnswers/setActiveFollowUpAnswerId",e=>_(e,G)),Yve=T("followUpAnswers/setFollowUpAnswerContentFormat",e=>_(e,{contentFormat:ed,answerId:G})),Kve=T("followUpAnswers/setFollowUpIsLoading",e=>_(e,{isLoading:new ue({required:!0}),answerId:G})),Jve=T("followUpAnswers/setFollowUpIsStreaming",e=>_(e,{isStreaming:new ue({required:!0}),answerId:G})),Xve=T("followUpAnswers/followUpMessageChunkReceived",e=>_(e,{textDelta:Zj,answerId:G})),Zve=T("followUpAnswers/followUpCitationsReceived",e=>_(e,{citations:new re({required:!0,each:new W({values:cy})}),answerId:G})),eAe=T("followUpAnswers/followUpCompleted",e=>_(e,{answerId:G,cannotAnswer:new ue({required:!1})})),tAe=T("followUpAnswers/followUpFailed",e=>_(e,{message:new L,code:new ne({min:0}),answerId:G})),rAe=T("followUpAnswers/activeFollowUpStartFailed",e=>_(e,{message:new L})),nAe=T("followUpAnswers/likeFollowUp",e=>_(e,{answerId:G})),oAe=T("followUpAnswers/dislikeFollowUp",e=>_(e,{answerId:G})),iAe=T("followUpAnswers/submitFollowUpFeedback",e=>_(e,{answerId:G})),Iw=T("followUpAnswers/resetFollowUpAnswers"),aAe=T("followUpAnswers/stepStarted",e=>_(xw(e),{answerId:G,name:bw,startedAt:new ne({min:0,required:!0})})),sAe=T("followUpAnswers/stepFinished",e=>_(xw(e),{answerId:G,name:bw,finishedAt:new ne({min:0,required:!0})}));d();c();l();u();var eV={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004,"KNOWLEDGE:TURN_LIMIT_REACHED":1005};function Ew(e){return e?eV[e]??1004:1004}function tV(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function Op(e){if(e)return tV({...e})}var Fw=e=>({onRunStartedEvent:({event:t})=>{e(Fa(t.runId)),e($r(!1)),e(Uo(!0)),e(ww(t.threadId))},onStepStartedEvent:({event:t})=>{e(dd({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(pd({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(Qo({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e($o(n.contentFormat)),n?.followUpEnabled&&e(Rw(n.followUpEnabled));return}case"citations":{e(Bo({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=Ew(t.code);e(Go({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.completionReason==="ANSWERED";e(Ic(r)),e(Ho(!r)),e(Uo(!1)),e(xa(r)),e(Ra())}});var Tw=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref83=_asyncToGenerator(function*(n,o,i){t();let a=ol(n),p=DC(n),f=MC(n),m=qC(n),g=Cw(a,p,f);e=g;let S=Fw(o),b=Ix(n,i());try{o($r(!0)),yield g.runAgent({forwardedProps:{params:b,accessToken:m}},S)}catch(h){o($r(!1)),o(Go({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",h)}});return function run(_x199,_x200,_x201){return _ref83.apply(this,arguments)}}(),abortRun:t}};var Pw=e=>{let t=jA({extra:e}),r=Tw();return t.startListening({actionCreator:Fe.pending,effect:function(){var _ref84=_asyncToGenerator(function*(n,o){let i=o.getState();if(!hh(i))return;r.abortRun(),o.dispatch(ar()),o.dispatch(Iw());let a=Lo(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x202,_x203){return _ref84.apply(this,arguments)}}()}),t};d();c();l();u();var kw=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},Ow=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var rS=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();function _w(e,t){let r={...e},n,o=i=>(a,p)=>{let f=i(a,p);return n?n(f,p):f};return{get combinedReducer(){let i=nv(Object.entries(t).filter(([a])=>!(a in r)).map(([a,p])=>[a,()=>p]));return o(ji({...i,...r}))},containsAll(i){return Object.keys(i).every(p=>p in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function rV(e){if(!e||!nV(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Nw(e,t=60){if(!e)return!1;let r=rV(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function nV(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Dw(e,t){let r=0,n=null,o=fu(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref85=_asyncToGenerator(function*(f,m=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(b){if(!m)throw b;return null}})().finally(()=>{n=null}));let S=yield n;return g&&S&&f.dispatch(ua({accessToken:S})),S});return function i(_x204){return _ref85.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref87=_asyncToGenerator(function*(f){let m=f.getState(),g=iV(m);if(!(!g||!Nw(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(S){e.warn(S,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x205){return _ref87.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref88=_asyncToGenerator(function*(f,m,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),qw(f,m.error),m;r++,o(),yield i(f,!0),f.dispatch(g)});return function p(_x206,_x207,_x208){return _ref88.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref89=_asyncToGenerator(function*(g){let S=typeof g=="function",b=typeof t=="function";if(!S)return m(g);b&&(yield a(f));let h=yield m(g);return oV(h)?b?yield p(f,h,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),qw(f,h.error),h):h});return function(_x209){return _ref89.apply(this,arguments)}}())}function oV(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Ni().name}function qw(e,t){e.dispatch(Aa({status:401,statusCode:401,message:t.message,type:t.name}))}function iV(e){return e.configuration.accessToken}d();c();l();u();function Mw({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return RA({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Ow(n.logger))})}function aV(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&rv()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function jw(e,t){let r={...e.reducers,configuration:ve,version:_x},n=sV({...e,reducers:r},t,ve),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(ua({accessToken:o,environment:i,organizationId:a}));let p=aV(e.configuration,n.logger);return p&&n.dispatch(fl(p)),n}function sV(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=_w({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,p={...t,get relay(){return sc(m.state,o)},get navigatorContext(){return rS(this.relay,o)}},f=cV(e,p,i),m={addReducers(g){i.containsAll(g)||(i.add(g),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(gl())},disableAnalytics(){f.dispatch(ml())},get state(){return f.getState()},get relay(){return sc(this.state,o)},get navigatorContext(){return rS(this.relay,o)},logger:a,store:f};return m}function cV(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=uV(e,t.logger,()=>t.navigatorContext);return Mw({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function uV(e,t,r){let{renewAccessToken:n}=e.configuration,o=Dw(t,n),i=Pw({getNavigatorContext:r});return[Lx,o,kw(t),qx].concat(zo.middleware,i.middleware,e.middlewares||[])}var lV=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
42
42
|
However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
|
|
43
43
|
Please switch back to the "legacy" analytics mode to ensure proper functionality.
|
|
44
|
-
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function kp(e){e==="next"&&console.warn(iV)}d();c();l();u();var Vw=Cr(jw(),1);function Lw(e){return(0,Vw.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function Uw(e,t){let r=xV(e),n=ur,o=RV(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function xV(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function RV(e){return e.preprocessRequest||yu}d();c();l();u();d();c();l();u();var Qw={organizationId:G,accessToken:G,name:new L({required:!1,emptyAllowed:!1}),analytics:new W({options:{required:!1},values:{enabled:new ue({required:!1}),originContext:new L({required:!1}),originLevel2:new L({required:!1}),originLevel3:new L({required:!1}),analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new L({required:!1,url:!0}),trackingId:new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new L({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Bw(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Gw=new Ee({...Qw,insightId:G,search:new W({options:{required:!1},values:{locale:He}})}),wV="2729db39-d7fd-4504-a06e-668c64968c95";function iS(){return{...Bw(),insightId:wV}}var IV={insightConfiguration:ml,search:xe,insightInterface:Ln,searchHub:Wl,resultPreview:va};function $w(e){let t=Lw(e.loggerOptions);EV(e.configuration,t);let r=FV(e.configuration,t),n=TV(t),o={...Uw(e.configuration,t),apiClient:r,streamingClient:n},i={...e,reducers:IV},a=Pw(i,o);kp(a.state.configuration.analytics.analyticsMode);let{insightId:p,search:f}=e.configuration;return a.dispatch(fl({insightId:p})),a.dispatch(jr()),f&&a.dispatch(ua(f)),{...a,get state(){return a.state},executeFirstSearch(m=El()){zl(a.state)||a.dispatch(Se({legacy:m,next:jC()}))}}}function EV(e,t){try{Gw.validate(e)}catch(r){throw t.error(r,"Insight engine configuration error"),r}}function FV(e,t){return new Au({logger:t,preprocessRequest:e.preprocessRequest||yu})}function TV(e){return new hu({logger:e})}d();c();l();u();function fe(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),p=t!==a;return t=a,p}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&p?.()}},get state(){return{}}}}d();c();l();u();d();c();l();u();var Hw={articleLanguage:He,articlePublishStatus:He,articleVersionNumber:He,caseId:G,knowledgeArticleId:He,name:He,permanentId:He,resultUrl:He,source:He,title:G,uriHash:He,isAttachedFromCitation:new ue({required:!1,default:!1})},PV=new W({options:{required:!0},values:Hw}),Np=T("insight/attachToCase/setAttachedResults",e=>_(e,{results:new re({each:PV}),loading:new ue({required:!1,default:!1})})),ao=T("insight/attachToCase/attach",e=>zw(e)),so=T("insight/attachToCase/detach",e=>zw(e)),zw=e=>te(e.permanentId)&&te(e.uriHash)?{payload:e,error:br(new xo("Either permanentId or uriHash is required"))}:_(e,Hw);d();c();l();u();d();c();l();u();var Fr=e=>{let t=J(e.insightCaseContext);return{targetId:t.caseId||"",targetType:"Case",caseNumber:t.caseNumber}};var Ya=e=>Z("caseAttach")({prefix:"insight/caseAttach",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logCaseAttach(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:t.search?.response.searchUid||"",action:"attach",context:Fr(t)}}}),Ka=e=>Z("caseDetach")({prefix:"insight/caseDetach",__legacy__getBuilder:(t,r)=>t.logCaseDetach(e.raw.urihash,J(r.insightCaseContext)),analyticsType:"InsightPanel.DetachItem",analyticsPayloadBuilder:t=>({itemMetadata:xr(e,t),context:Fr(t)})});d();c();l();u();d();c();l();u();function Ww(){return{results:[],loading:!1}}var co=ce(Ww(),e=>{e.addCase(Np,(t,r)=>{let{results:n,loading:o}=r.payload;"results"in t&&t.results?.length>0||(t.results=n,o&&(t.loading=o))}).addCase(ao,(t,r)=>{(!te(r.payload.permanentId)||!te(r.payload.uriHash))&&(t.results=[...t.results,r.payload])}).addCase(so,(t,r)=>{t.results=t.results.filter(n=>kV(n,r.payload))})}),kV=(e,t)=>{let r=!te(e.permanentId)&&e?.permanentId===t?.permanentId,n=!te(e.uriHash)&&e?.uriHash===t?.uriHash;return!(e.caseId===t.caseId)||!r&&!n};d();c();l();u();var qp=(e,t)=>Pi(e.raw[t])?String(e.raw[t]):void 0,Ja=(e,t)=>({articleLanguage:qp(e,"sflanguage"),articleVersionNumber:qp(e,"sflanguage"),articlePublishStatus:qp(e,"articlePublishStatus"),caseId:t,knowledgeArticleId:qp(e,"knowledgeArticleId"),permanentId:e.raw?.permanentid,uriHash:e.raw?.urihash,resultUrl:e.clickUri,source:e.raw.source,title:e.title});function Yw(e,t){if(!OV(e))throw oe;let{dispatch:r}=e,n=()=>e.state.attachedResults,o=fe(e),{result:i,caseId:a}=t.options,p=()=>te(a)||te(i.raw.permanentid)&&te(i.raw.urihash)?!1:e.state.attachedResults.results.some(f=>{let m=a===f.caseId,h=!te(f.permanentId)&&f.permanentId===i.raw.permanentid,v=!te(f.uriHash)&&f.uriHash===i.raw.urihash;return m&&(h||v)});return{...o,get state(){return n()},isAttached(){return p()},attach(){r(ao(Ja(i,a))),r(Ya(i))},detach(){r(so(Ja(i,a))),r(Ka(i))}}}function OV(e){return e.addReducers({configuration:ve,attachedResults:co}),!0}d();c();l();u();function Kw(e,t){if(!_V(e))throw oe;let{dispatch:r}=e,n=fe(e),{caseId:o}=t.options,i=p=>te(o)||te(p.raw.permanentid)&&te(p.raw.urihash)?!1:e.state.attachedResults.results.some(f=>{let m=o===f.caseId,h=!te(f.permanentId)&&f.permanentId===p.raw.permanentid,v=!te(f.uriHash)&&f.uriHash===p.raw.urihash;return m&&(h||v)}),a=()=>e.state.attachedResults.results.filter(p=>p.caseId===o);return{...n,get state(){return{results:a(),loading:e.state.attachedResults.loading}},isAttached(p){return i(p)},attach(p){r(ao(Ja(p,o))),r(Ya(p))},detach(p){r(so(Ja(p,o))),r(Ka(p))}}}function _V(e){return e.addReducers({configuration:ve,attachedResults:co}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var ge=G;d();c();l();u();var NV={state:new Be({required:!0}),numberOfResults:new ne({required:!0,min:0}),value:new L({required:!0,emptyAllowed:!0}),path:new re({required:!0,each:G}),moreValuesAvailable:new ue({required:!1})};function aS(e){e.children.forEach(t=>{aS(t)}),ur({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},NV)}var Xa={facetId:ge,field:G,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),delimitingCharacter:new L({required:!1,emptyAllowed:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),basePath:new re({required:!1,each:G}),filterByBasePath:new ue({required:!1})};var Za=T("categoryFacet/register",e=>_(e,Xa)),es=T("categoryFacet/toggleSelectValue",e=>{try{return ur(e.facetId,G),aS(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),uo=T("categoryFacet/deselectAll",e=>_(e,Xa.facetId)),Qc=T("categoryFacet/updateNumberOfValues",e=>_(e,{facetId:Xa.facetId,numberOfValues:Xa.numberOfValues})),Dp=T("categoryFacet/updateSortCriterion",e=>_(e,{facetId:Xa.facetId,criterion:new Be})),Jw=T("categoryFacet/updateBasePath",e=>_(e,{facetId:Xa.facetId,basePath:new re({each:G})}));d();c();l();u();var YRe={categoryFacetId:ge,categoryFacetPath:new re({required:!0,each:G})};var Xw=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();var qV={categoryFacetId:ge,categoryFacetPath:new re({required:!0,each:G})},DV=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,i=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:i}},Mp=e=>Z("breadcrumbFacet")("analytics/categoryFacet/breadcrumb",(t,r)=>{_(e,qV);let n={...DV(r,e),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();d();c();l();u();var Qe=T("facetOptions/update",(e={freezeFacetOrder:!0})=>_(e,{freezeFacetOrder:new ue({required:!1})})),er=T("facetOptions/facet/enable",e=>_(e,ge)),dt=T("facetOptions/facet/disable",e=>_(e,ge));d();c();l();u();var tr=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var Bc={facetId:ge,captions:new W({options:{required:!1}}),numberOfValues:new ne({required:!1,min:1}),query:new L({required:!1,emptyAllowed:!0})};var MV={path:new re({required:!0,each:G}),displayValue:Ye,rawValue:Ye,count:new ne({required:!0,min:0})},jp=T("categoryFacet/selectSearchResult",e=>_(e,{facetId:ge,value:new W({values:MV})})),Zw=T("categoryFacetSearch/register",e=>_(e,Bc));d();c();l();u();function ts(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function rs(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Vp(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Gc(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Lp(e,t,r){e.currentValues=jV(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function jV(e,t){if(!e.length)return[];let r=eI(e[0],t),n=r;for(let o of e.splice(1)){let i=eI(o,t);n.children.push(i),n=i}return n.state="selected",n.retrieveChildren=!0,[r]}function eI(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var Up=ce(Zi(),e=>{e.addCase(Za,(t,r)=>{let n=r.payload,{facetId:o,tabs:i}=n;if(o in t)return;let a=LV(n),p=a.numberOfValues;t[o]={request:a,initialNumberOfValues:p,tabs:i}}).addCase(Ze.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(tt,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(i=>{let a=t[i],p=a.request;if((a.tabs?.included?.length||a.tabs?.excluded?.length)&&!tr(a.tabs,o)){p.currentValues.length&&Lp(p,[],a.initialNumberOfValues);return}let m=n[i]||[];(m.length||p.currentValues.length)&&Lp(p,m,a.initialNumberOfValues)})}).addCase(Dp,(t,r)=>{let{facetId:n,criterion:o}=r.payload,i=t[n]?.request;i&&(i.sortCriteria=o)}).addCase(Jw,(t,r)=>{let{facetId:n,basePath:o}=r.payload,i=t[n]?.request;i&&(i.basePath=[...o])}).addCase(es,(t,r)=>{let{facetId:n,selection:o,retrieveCount:i}=r.payload,a=t[n]?.request;if(!a)return;let{path:p}=o,f=p.slice(0,p.length-1),m=VV(a,f,i);if(m.length){let v=m[0];v.retrieveChildren=!0,v.state="selected",v.previousState="idle",v.children=[];return}let h=rI(o.value,i);h.state="selected",h.previousState="idle",m.push(h),a.numberOfValues=1}).addCase(uo,(t,r)=>{let n=r.payload;Gc(t,n)}).addCase(Kt,t=>{Object.keys(t).forEach(r=>Gc(t,r))}).addCase(fa,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(Qc,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,i=t[n]?.request;if(i){if(!i.currentValues.length)return Vp(i,o);UV(t,r.payload)}}).addCase(jp,(t,r)=>{let{facetId:n,value:o}=r.payload,i=t[n];if(!i)return;let a=[...o.path,o.rawValue];Lp(i.request,a,i.initialNumberOfValues)}).addCase(Sa.fulfilled,(t,r)=>{tI(t,r.payload.response.facets)}).addCase(Fe.fulfilled,(t,r)=>{tI(t,r.payload.response.facets)}).addCase(dt,(t,r)=>{Gc(t,r.payload)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&Gc(t,o)})})}),sS={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function VV(e,t,r){let n=e.currentValues;for(let o of t){let i=n[0];(!i||o!==i.value)&&(i=rI(o,r),n.length=0,n.push(i)),i.retrieveChildren=!1,i.previousState=void 0,i.state="idle",n=i.children}return n}function LV(e){return{...sS,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function rI(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function tI(e,t){t.forEach(r=>{if(!QV(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let i=BV(o,r);o.currentValues=i?[]:o.currentValues,o.preventAutoSelect=!1})}function UV(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function QV(e,t){return t.facetId in e}function BV(e,t){let r=Dr(e.currentValues),n=Dr(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var Xr=new L({regex:/^[a-zA-Z0-9-_]+$/}),Zr=new L({required:!0}),nI=new re({each:new L}),oI=new L,iI=new ue,en=new ue,tn=new ne({min:0}),Tr=new ne({min:1}),Qp=new ue({required:!0}),GV=new W,$V=new L,HV={captions:GV,numberOfValues:Tr,query:$V},ns=new W({values:HV}),Bp=new W({options:{required:!1},values:{type:new L({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new re({required:!0,max:25,each:new L({emptyAllowed:!1,required:!0})})}}),AIe=new ue,Gp=new re({min:1,max:25,required:!1,each:new L({emptyAllowed:!1,required:!0})});d();c();l();u();var Si={value:G,numberOfResults:new ne({min:0}),state:G};var zV={facetId:ge,field:new L({required:!0,emptyAllowed:!0}),tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),resultsMustMatch:new Be({required:!1}),allowedValues:Bp,customSort:Gp},os=T("facet/register",e=>_(e,zV)),lo=T("facet/toggleSelectValue",e=>_(e,{facetId:ge,selection:new W({values:Si})})),po=T("facet/toggleExcludeValue",e=>_(e,{facetId:ge,selection:new W({values:Si})})),ht=T("facet/deselectAll",e=>_(e,ge)),$p=T("facet/updateSortCriterion",e=>_(e,{facetId:ge,criterion:new Be({required:!0})})),$c=T("facet/updateNumberOfValues",e=>_(e,{facetId:ge,numberOfValues:new ne({required:!0,min:1})})),Hc=T("facet/updateIsFieldExpanded",e=>_(e,{facetId:ge,isFieldExpanded:new ue({required:!0})})),vi=T("facet/updateFreezeCurrentValues",e=>_(e,{facetId:ge,freezeCurrentValues:new ue({required:!0})}));d();c();l();u();var is=e=>$e("analytics/facet/unexclude",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n=Wt(r),o=na(e,n);return t.makeFacetUnexclude(o)});var rr=()=>({actionCause:"facetClearAll"}),sr=()=>({actionCause:"facetSelect"}),Hp=()=>({actionCause:"facetExclude"}),Fn=()=>({actionCause:"facetDeselect"});var cS=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();var as=e=>Z("showMoreFacetResults")("analytics/facet/showMore",(t,r)=>{_(e,ge);let n={...No(e,Wt(r)),...J(r.insightCaseContext)};return t.logFacetShowMore(n)}),ss=e=>Z("showLessFacetResults")("analytics/facet/showLess",(t,r)=>{_(e,ge);let n={...No(e,Wt(r)),...J(r.insightCaseContext)};return t.logFacetShowLess(n)}),rn=e=>Z("facetUpdateSort")("analytics/facet/sortChange",(t,r)=>{_(e,{facetId:ge,sortCriterion:new Be({required:!0})});let{facetId:n,sortCriterion:o}=e,i=Wt(r),p={...No(n,i),criteria:o,...J(r.insightCaseContext)};return t.logFacetUpdateSort(p)}),Dt=e=>Z("facetClearAll")("analytics/facet/reset",(t,r)=>{_(e,ge);let n=Wt(r),o={...No(e,n),...J(r.insightCaseContext)};return t.logFacetClearAll(o)}),Bt=e=>Z("facetSelect")("analytics/facet/select",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n=Wt(r),o={...na(e,n),...J(r.insightCaseContext)};return t.logFacetSelect(o)}),Pr=e=>Z("facetDeselect")("analytics/facet/deselect",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n=Wt(r),o={...na(e,n),...J(r.insightCaseContext)};return t.logFacetDeselect(o)}),zc=e=>Z("breadcrumbFacet")("analytics/facet/breadcrumb",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n={...na(e,Wt(r)),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();d();c();l();u();var aI={facetId:ge,value:new W({values:{displayValue:Ye,rawValue:Ye,count:new ne({required:!0,min:0})}})},sI=T("facetSearch/register",e=>_(e,Bc)),zp=T("facetSearch/update",e=>_(e,Bc)),Wp=T("facetSearch/toggleSelectValue",e=>_(e,aI)),Yp=T("facetSearch/toggleExcludeValue",e=>_(e,aI));var cs=ce(ra(),e=>{e.addCase(os,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=dC(WV(r.payload),o))}).addCase(Ze.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(tt,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(a=>{let{request:p}=t[a],f=n[a]||[],m=o[a]||[],h=f.length+m.length,v=p.currentValues.filter(C=>!f.includes(C.value)&&!m.includes(C.value));p.currentValues=[...f.map(uI),...m.map(lI),...v.map(KV)],p.preventAutoSelect=h>0,p.numberOfValues=Math.max(h,p.numberOfValues)})}).addCase(lo,(t,r)=>{let{facetId:n,selection:o}=r.payload,i=t[n]?.request;if(!i)return;i.preventAutoSelect=!0;let a=i.currentValues.find(f=>f.value===o.value);if(!a){Kp(i,o);return}let p=a.state==="selected";a.previousState=a.state,a.state=p?"idle":"selected",i.freezeCurrentValues=!0}).addCase(po,(t,r)=>{let{facetId:n,selection:o}=r.payload,i=t[n]?.request;if(!i)return;i.preventAutoSelect=!0;let a=i.currentValues.find(f=>f.value===o.value);if(!a){Kp(i,o);return}let p=a.state==="excluded";a.previousState=a.state,a.state=p?"idle":"excluded",i.freezeCurrentValues=!0}).addCase(vi,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,i=t[n]?.request;i&&(i.freezeCurrentValues=o)}).addCase(ht,(t,r)=>{rs(t[r.payload]?.request)}).addCase(Kt,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>rs(r))}).addCase(_l,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>rs(r))}).addCase(fa,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase($p,(t,r)=>{ts(t,r.payload)}).addCase($c,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;Vp(t[n]?.request,o)}).addCase(Hc,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,i=t[n]?.request;i&&(i.isFieldExpanded=o)}).addCase(Fe.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>cI(t[o.facetId]?.request,o))}).addCase(Sa.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>cI(t[o.facetId]?.request,o))}).addCase(Wp,(t,r)=>{let{facetId:n,value:o}=r.payload,i=t[n]?.request;if(!i)return;let{rawValue:a}=o,{currentValues:p}=i,f=p.find(h=>h.value===a);if(f){f.state="selected";return}let m=uI(a);Kp(i,m),i.freezeCurrentValues=!0,i.preventAutoSelect=!0}).addCase(Yp,(t,r)=>{let{facetId:n,value:o}=r.payload,i=t[n]?.request;if(!i)return;let{rawValue:a}=o,{currentValues:p}=i,f=p.find(h=>h.value===a);if(f){f.state="excluded";return}let m=lI(a);Kp(i,m),i.freezeCurrentValues=!0,i.preventAutoSelect=!0}).addCase(dt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];rs(n)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&rs(i.request)})})});function Kp(e,t){let{currentValues:r}=e,n=r.findIndex(i=>i.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function cI(e,t){e&&(e.currentValues=t.values.map(YV),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var uS={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function WV(e){return{...uS,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function YV(e){let{value:t,state:r}=e;return{value:t,state:r}}function uI(e){return{value:e,state:"selected"}}function lI(e){return{value:e,state:"excluded"}}function KV(e){return{...e,state:"idle"}}d();c();l();u();var Jp=()=>Z("breadcrumbResetAll")("analytics/facet/deselectAllBreadcrumbs",(e,t)=>e.logBreadcrumbResetAll(J(t.insightCaseContext)));d();c();l();u();d();c();l();u();function us(e){let t=dI(e.start,e),r=dI(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function dI(e,t){let{dateFormat:r}=t;return rb(e)?(vl(e),ZC(e)):typeof e=="string"&&Un(e)?(vl(e),e):(YC(e,r),Sl(la(e,r)))}d();c();l();u();var ls=T("rangeFacet/updateSortCriterion",e=>_(e,{facetId:ge,criterion:new Be({required:!0})}));d();c();l();u();var Ai={state:G,start:new ne({required:!0}),end:new ne({required:!0}),endInclusive:new ue({required:!0}),numberOfResults:new ne({required:!0,min:0})},Ci={start:G,end:G,endInclusive:new ue({required:!0}),state:G,numberOfResults:new ne({required:!0,min:0})},Tn=e=>({facetId:ge,selection:typeof e.start=="string"?new W({values:Ci}):new W({values:Ai})});var JV={start:G,end:G,endInclusive:new ue({required:!0}),state:G},XV={facetId:ge,field:G,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),currentValues:new re({required:!1,each:new W({values:JV})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function pI(e){return Un(e)?hc(e):e}function Xp(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=us(t);if(la(pI(r)).isAfter(la(pI(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var nn=T("dateFacet/register",e=>{try{return ur(e,XV),Xp(e),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),on=T("dateFacet/toggleSelectValue",e=>_(e,{facetId:ge,selection:new W({values:Ci})})),an=T("dateFacet/toggleExcludeValue",e=>_(e,{facetId:ge,selection:new W({values:Ci})})),Pn=T("dateFacet/updateFacetValues",e=>{try{return ur(e,{facetId:ge,values:new re({each:new W({values:Ci})})}),Xp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),Zp=ls,ef=ht;d();c();l();u();d();c();l();u();var tf=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,i=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:i,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},rf=()=>({actionCause:"breadcrumbFacet"});var lS=rf;d();c();l();u();var Wc=e=>Z("breadcrumbFacet")("analytics/dateFacet/breadcrumb",(t,r)=>{_(e,Tn(e.selection));let n={...tf(r,e),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();function ZV(e,t){return!!t&&t.facetId in e.dateFacetSet}var fI=(e,t)=>{let r=vn(e,t);if(ZV(e,r))return r},mI=(e,t)=>(fI(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),gI=(e,t)=>(fI(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var of={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function af(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=hI(r);r.numberOfValues=o,e[n]=t}function sf(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=hI(n))}function cf(e,t,r){let n=e[t]?.request;if(!n)return;let o=nf(n.currentValues,r);if(!o)return;let i=o.state==="selected";o.previousState=o.state,o.state=i?"idle":"selected",n.preventAutoSelect=!0}function uf(e,t,r){let n=e[t]?.request;if(!n)return;let o=nf(n.currentValues,r);if(!o)return;let i=o.state==="excluded";o.previousState=o.state,o.state=i?"idle":"excluded",n.preventAutoSelect=!0}function sn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function lf(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(!!nf(o,p)&&(p.state="selected"),p));let i=o.filter(p=>!nf(n.currentValues,p)),a=n.currentValues;a.push(...i),n.numberOfValues=Math.max(n.numberOfValues,a.length)})}function df(e,t,r){t.forEach(n=>{let o=n.facetId,i=e[o]?.request;if(!i)return;let a=r(n.values);i.currentValues=a,i.preventAutoSelect=!1})}function nf(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function hI(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var cn=ce(ea(),e=>{e.addCase(nn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,i=eL(n);af(t,uC(i,o))}).addCase(Ze.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(tt,(t,r)=>{let n=r.payload.df||{};lf(t,n)}).addCase(on,(t,r)=>{let{facetId:n,selection:o}=r.payload;cf(t,n,o)}).addCase(an,(t,r)=>{let{facetId:n,selection:o}=r.payload;uf(t,n,o)}).addCase(Pn,(t,r)=>{let{facetId:n,values:o}=r.payload;sf(t,n,o)}).addCase(ef,(t,r)=>{sn(t,r.payload)}).addCase(Kt,t=>{Object.keys(t).forEach(r=>{sn(t,r)})}).addCase(Zp,(t,r)=>{ts(t,r.payload)}).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.response.facets;df(t,n,tL)}).addCase(dt,(t,r)=>{sn(t,r.payload)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&sn(t,o)})})});function eL(e){return{...of,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function tL(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var rL={state:G,start:new ne({required:!0}),end:new ne({required:!0}),endInclusive:new ue({required:!0})},nL={facetId:ge,field:G,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),currentValues:new re({required:!1,each:new W({values:rL})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function pf(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var un=T("numericFacet/register",e=>{try{return _(e,nL),pf(e),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),ln=T("numericFacet/toggleSelectValue",e=>_(e,{facetId:ge,selection:new W({values:Ai})})),dn=T("numericFacet/toggleExcludeValue",e=>_(e,{facetId:ge,selection:new W({values:Ai})})),kn=T("numericFacet/updateFacetValues",e=>{try{return ur(e,{facetId:ge,values:new re({each:new W({values:Ai})})}),pf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),ff=ls,mf=ht;d();c();l();u();var dS=rf;d();c();l();u();d();c();l();u();var yI=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,i=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:i,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}};var Yc=e=>Z("breadcrumbFacet")("analytics/numericFacet/breadcrumb",(t,r)=>{_(e,Tn(e.selection));let n={...yI(r,e),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();function oL(e,t){return!!t&&t.facetId in e.numericFacetSet}var SI=(e,t)=>{let r=vn(e,t);if(oL(e,r))return r},vI=(e,t)=>(SI(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),AI=(e,t)=>(SI(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var fo=ce(ta(),e=>{e.addCase(un,(t,r)=>{let{payload:n}=r,{tabs:o}=n,i=iL(n);af(t,lC(i,o))}).addCase(Ze.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(tt,(t,r)=>{let n=r.payload.nf||{};lf(t,n)}).addCase(ln,(t,r)=>{let{facetId:n,selection:o}=r.payload;cf(t,n,o)}).addCase(dn,(t,r)=>{let{facetId:n,selection:o}=r.payload;uf(t,n,o)}).addCase(kn,(t,r)=>{let{facetId:n,values:o}=r.payload;sf(t,n,o)}).addCase(mf,(t,r)=>{sn(t,r.payload)}).addCase(Kt,t=>{Object.keys(t).forEach(r=>{sn(t,r)})}).addCase(ff,(t,r)=>{ts(t,r.payload)}).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.response.facets;df(t,n,aL)}).addCase(dt,(t,r)=>{sn(t,r.payload)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&sn(t,o)})})});function iL(e){return{...of,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function aL(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var Kc=G,gf=new W({options:{required:!0},values:{caption:Ye,expression:Ye,state:new L({constrainTo:["idle","selected","excluded"]})}}),CI=new re({required:!0,each:gf});var JPe=T("staticFilter/register",e=>_(e,{id:Kc,values:CI})),bI=T("staticFilter/toggleSelect",e=>_(e,{id:Kc,value:gf})),xI=T("staticFilter/toggleExclude",e=>_(e,{id:Kc,value:gf})),XPe=T("staticFilter/deselectAllFilterValues",e=>_(e,Kc));d();c();l();u();var hf=e=>Z("staticFilterDeselect")("analytics/staticFilter/deselect",(t,r)=>t.logStaticFilterDeselect({...e,...J(r.insightCaseContext)}));d();c();l();u();var yf=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function RI(e){let t=fe(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(Kt())},deselectBreadcrumb(n){n.deselect()}}}function wI(e){if(!sL(e))throw oe;let t=RI(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let g={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:S,selection:x})=>{let w=zc({facetId:S,facetValue:x.value});r(lo({facetId:S,selection:x})),r(vi({facetId:S,freezeCurrentValues:!1})),r(Se({legacy:w,next:cS()}))},executeToggleExclude:({facetId:S,selection:x})=>{let w=zc({facetId:S,facetValue:x.value});r(po({facetId:S,selection:x})),r(vi({facetId:S,freezeCurrentValues:!1})),r(Se({legacy:w,next:cS()}))},facetValuesSelector:aC};return yf(g)},i=()=>{let g={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:S=>{r(ln(S)),r(Se({legacy:Yc(S),next:dS()}))},executeToggleExclude:S=>{r(dn(S)),r(Se({legacy:Yc(S),next:dS()}))},facetValuesSelector:vI};return yf(g)},a=()=>{let g={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:S=>{r(on(S)),r(Se({legacy:Wc(S),next:lS()}))},executeToggleExclude:S=>{r(an(S)),r(Se({legacy:Wc(S),next:lS()}))},facetValuesSelector:gI};return yf(g)},p=g=>{let S=cC(n(),g);return{facetId:g,field:n().categoryFacetSet[g].request.field,path:S,deselect:()=>{r(uo(g)),r(Se({legacy:Mp({categoryFacetPath:S.map(x=>x.value),categoryFacetId:g}),next:Xw()}))}}},f=()=>Object.keys(n().categoryFacetSet).map(p).filter(g=>g.path.length),m=()=>{let g=n().staticFilterSet||{};return Object.values(g).map(h)},h=g=>{let{id:S,values:x}=g,w=x.filter(R=>R.state!=="idle").map(R=>v(S,R));return{id:S,values:w}},v=(g,S)=>({value:S,deselect:()=>{let{caption:x,expression:w}=S,R=hf({staticFilterId:g,staticFilterValue:{caption:x,expression:w}});S.state==="selected"?r(bI({id:g,value:S})):S.state==="excluded"&&r(xI({id:g,value:S})),r(Se({legacy:R}))}});function C(){return!![...o(),...i(),...a(),...f(),...m()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:f(),numericFacetBreadcrumbs:i(),dateFacetBreadcrumbs:a(),staticFilterBreadcrumbs:m(),hasBreadcrumbs:C()}},deselectAll:()=>{t.deselectAll(),r(Se({legacy:Jp(),next:{actionCause:"breadcrumbResetAll"}}))}}}function sL(e){return e.addReducers({configuration:ve,search:xe,facetSet:cs,numericFacetSet:fo,dateFacetSet:cn,categoryFacetSet:Up}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var II=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var Sf=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),EI=()=>({correctedQuery:"",corrections:[],originalQuery:""});function FI(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:Sf(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var TI=(e,t)=>{let r={...EI(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var PI=ce(FI(),e=>{e.addCase(Al,t=>{t.enableDidYouMean=!0}).addCase(cb,t=>{t.enableDidYouMean=!1}).addCase(ub,t=>{t.automaticallyCorrectQuery=!0}).addCase(Cl,t=>{t.automaticallyCorrectQuery=!1}).addCase(Fe.pending,t=>{t.queryCorrection=Sf(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(Fe.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let i=o?.[0]?o[0]:Sf();t.queryCorrection=i}t.queryCorrectionMode==="next"&&TI(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(Yt,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(yc,(t,r)=>{t.queryCorrectionMode=r.payload})});function kI(e,t={}){if(!cL(e))throw oe;let r=fe(e),{dispatch:n}=e;n(Al()),t.options?.automaticallyCorrectQuery===!1&&n(Cl()),n(yc(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,i=()=>II(o().didYouMean);return{...r,get state(){let a=o();return{originalQuery:a.didYouMean.originalQuery,wasCorrectedTo:a.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:a.didYouMean.wasAutomaticallyCorrected,queryCorrection:a.didYouMean.queryCorrection,hasQueryCorrection:i()}},applyCorrection(){n(Yt(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(a){n(yc(a))}}}function cL(e){return e.addReducers({configuration:ve,didYouMean:PI}),!0}var OI={automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"};function _I(e,t={options:OI}){let r={...OI,...t.options},n=kI(e,{options:r}),{dispatch:o}=e;return{...n,get state(){return n.state},applyCorrection(){n.applyCorrection(),o(Se({legacy:yb(),next:wb()}))}}}d();c();l();u();d();c();l();u();d();c();l();u();var Mt=ce(Rl(),e=>{e.addCase(Qe,(t,r)=>({...t,...r.payload})).addCase(Fe.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(Fe.rejected,t=>{t.freezeFacetOrder=!1}).addCase(Ze.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(Za,(t,r)=>{let{facetId:n,tabs:o}=r.payload;vf(o,t,n)}).addCase(os,(t,r)=>{let{facetId:n,tabs:o}=r.payload;vf(o,t,n)}).addCase(nn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;vf(o,t,n)}).addCase(un,(t,r)=>{let{facetId:n,tabs:o}=r.payload;vf(o,t,n)}).addCase(er,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(dt,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(tt,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=wh()),t.facets[n].enabled=!0})})});function vf(e,t,r){let n={...wh(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var Af=ce(Il(),e=>{e.addCase(yd,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(Tt,(t,r)=>{let n=r.payload;NI(t,n)}).addCase(hd,(t,r)=>{let n=r.payload;NI(t,n)}).addCase(Ze.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(tt,(t,r)=>{let n=r.payload.tab;te(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function NI(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function qI(e){if(!uL(e))throw oe;let t=fe(e),r=ot(n=>n.tabSet,n=>Object.values(n).find(i=>i.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function uL(e){return e.addReducers({tabSet:Af}),!0}function DI(e,t){if(!lL(e))throw oe;let r=qI(e),n=S=>e.state.facetOptions.facets[S]?.enabled??!1,o=S=>e.state.facetSet?.[S]?.request?.currentValues??e.state.categoryFacetSet?.[S]?.request?.currentValues??e.state.numericFacetSet?.[S]?.request?.currentValues??e.state.dateFacetSet?.[S]?.request?.currentValues??null,i=S=>S in e.state.facetOptions.facets,a=S=>e.state.facetOptions.facets[S]?.tabs,p=()=>Oi({isFacetRegistered:i(t.facetId),parentFacets:t.conditions.map(({parentFacetId:S})=>i(S)?{enabled:n(S),values:o(S)}:null),isTabEnabled:tr(a(t.facetId),r.state.activeTab)}),f=()=>{let S=p();return S===C?!1:(C=S,!0)},m=()=>t.conditions.length>0?t.conditions.some(S=>{if(!n(S.parentFacetId))return!1;let x=o(S.parentFacetId);return x===null?!1:S.condition(x)}):!0,h=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([S,x])=>x.request.freezeCurrentValues&&e.dispatch(vi({facetId:S,freezeCurrentValues:!1})))},v=()=>{if(!i(t.facetId))return;let S=n(t.facetId),x=m(),w=tr(a(t.facetId),r.state.activeTab),R=x&&w;S!==R&&(e.dispatch(R?er(t.facetId):dt(t.facetId)),h())},C=p(),g=e.subscribe(()=>{f()&&v()});return v(),{stopWatching(){g()}}}function lL(e){return e.addReducers({facetOptions:Mt}),!0}function MI(e,t){return DI(e,t)}d();c();l();u();d();c();l();u();function jI(e){if(!dL(e))throw oe;let t=fe(e),r=()=>e.state;return{...t,sort(n){return vc(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(i=>i.facetId)}}}}function dL(e){return e.addReducers({search:xe,facetOptions:Mt}),!0}function VI(e){return jI(e)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Cf(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,i={...ds,...t},a=r();e[n]={options:i,isLoading:o,response:a,initialNumberOfValues:i.numberOfValues,requestId:""}}function bf(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function xf(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function Rf(e,t){let r=e[t];r&&(r.isLoading=!1)}function wf(e,t,r){let{facetId:n,response:o}=t,i=e[n];i&&i.requestId===r&&(i.isLoading=!1,i.response=o)}function Jc(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=ds.query)}function If(e,t){Object.keys(e).forEach(r=>Jc(e,{facetId:r},t))}var ds={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var LI=/*#__PURE__*/function(){var _ref87=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,i=t.categoryFacetSet[e].request,{captions:a,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:h,basePath:v,filterFacetCount:C}=i,g=pL(i),S=g.length?[g]:[],x=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??$t(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:v,captions:a,numberOfValues:f,query:x,field:m,delimitingCharacter:h,ignorePaths:S,filterFacetCount:C,type:"hierarchical",...(n?{}:{searchContext:(yield mr(t,r)).request})}});return function LI(_x204,_x205,_x206,_x207){return _ref87.apply(this,arguments)}}(),pL=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var UI=/*#__PURE__*/function(){var _ref88=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:i,numberOfValues:a}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,h=f.filter(C=>C.state!=="idle").map(C=>C.value),v=`*${i}*`;return{url:t.configuration.search.apiBaseUrl??$t(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:a,query:v,field:p,ignoreValues:h,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield mr(t,r)).request})}});return function UI(_x208,_x209,_x210,_x211){return _ref88.apply(this,arguments)}}();var QI=e=>(/*#__PURE__*/function(){var _ref89=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:i}}){let a=r(),p;o(t,G),fL(a,t)?p=yield UI(t,a,i,e):p=yield LI(t,a,i,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x212,_x213){return _ref89.apply(this,arguments)}}()),mo=le("facetSearch/executeSearch",QI(!1)),PNe=le("facetSearch/executeSearch",QI(!0)),Ef=T("facetSearch/clearResults",e=>_(e,{facetId:ge})),fL=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function BI(){return{}}var GI=ce(BI(),e=>{e.addCase(Zw,(t,r)=>{let n=r.payload;Cf(t,n,pS)}).addCase(zp,(t,r)=>{bf(t,r.payload)}).addCase(mo.pending,(t,r)=>{let n=r.meta.arg;xf(t,n,r.meta.requestId)}).addCase(mo.rejected,(t,r)=>{let n=r.meta.arg;Rf(t,n)}).addCase(mo.fulfilled,(t,r)=>{wf(t,r.payload,r.meta.requestId)}).addCase(Ef,(t,{payload:{facetId:r}})=>{Jc(t,{facetId:r},pS)}).addCase(Fe.fulfilled,t=>{If(t,pS)})});function pS(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();function $I(e,t){let{field:r,state:n}=e;if(!mL(e))return r;let o=`${r}_`,i=gL(o,n);return yL(r,t),`${o}${i}`}function mL(e){let{field:t,state:r}=e;return HI(r).some(o=>o&&t in o)}function gL(e,t){let n=HI(t).map(o=>Object.keys(o||{})).reduce((o,i)=>o.concat(i),[]);return hL(n,e)+1}function HI(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function hL(e,t){return e.map(i=>{let a=i.split(t)[1],p=parseInt(a,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function yL(e,t){let r=`A facet with field "${e}" already exists.
|
|
45
|
-
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function vr(e,t){let{state:r,logger:n}=e,{field:o,facetId:i}=t;return i||$I({field:o,state:r},n)}d();c();l();u();d();c();l();u();var zI=["alphanumeric","occurrences"];var WI=new Ee({field:Zr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),basePath:nI,delimitingCharacter:oI,facetId:Xr,facetSearch:ns,filterByBasePath:iI,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,sortCriteria:new L({constrainTo:zI})});function YI(e,t){if(!SL(e))throw oe;let r=fe(e),{dispatch:n}=e,o=vr(e,t.options),i=t.options.tabs??{},a=Qt(e.state.tabSet),p={...sS,...fu("facetSearch",t.options),field:t.options.field,facetId:o,tabs:i,activeTab:a},f={facetSearch:{...ds,...t.options.facetSearch},...p};mt(e,WI,f,"buildCategoryFacet");let m=()=>th(e.state,o),h=()=>eh(e.state,o),v=()=>qr(e.state),C=()=>Gr(e.state,o);return n(Za(p)),{...r,toggleSelect(g){let S=f.numberOfValues;n(es({facetId:o,selection:g,retrieveCount:S})),n(Qe())},deselectAll(){n(uo(o)),n(Qe())},sortBy(g){n(Dp({facetId:o,criterion:g})),n(Qe())},isSortedBy(g){return m().sortCriteria===g},showMoreValues(){let{numberOfValues:g}=f,{activeValue:S,valuesAsTrees:x}=this.state,w=(S?.children.length??x.length)+g;n(Qc({facetId:o,numberOfValues:w})),n(Qe())},showLessValues(){let{numberOfValues:g}=f;n(Qc({facetId:o,numberOfValues:g})),n(Qe())},enable(){n(er(o))},disable(){n(dt(o))},get state(){let g=m(),S=h(),x=v(),w=C(),R=S?.values??[],I=R.some(U=>U.children.length>0)??!1,{parents:E,values:P}=sC(S?.values),V=Dr(R),q=V.length?V[V.length-1]:void 0,O=!!q,N=q?.moreValuesAvailable??S?.moreValuesAvailable??!1,M=q?q.children.length>f.numberOfValues:R.length>f.numberOfValues;return{facetId:o,parents:E,selectedValueAncestry:V,values:P,isHierarchical:I,valuesAsTrees:R,activeValue:q,isLoading:x,hasActiveValues:O,canShowMoreValues:N,canShowLessValues:M,sortCriteria:g.sortCriteria,enabled:w}}}}function SL(e){return e.addReducers({categoryFacetSet:Up,categoryFacetSearchSet:GI,facetOptions:Mt,configuration:ve,search:xe}),!0}function KI(e,t){let r=YI(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a={updateText(){},showMoreResults(){},search(){},clear(){},updateCaptions(){},select(){},singleSelect(){},get state(){return{values:[],isLoading:!1,moreValuesAvailable:!1,query:""}}},{state:p,...f}=a;return{...r,facetSearch:f,toggleSelect(m){r.toggleSelect(m);let h=vL(o(),m);n(Se({legacy:h,next:AL(m)}))},deselectAll(){r.deselectAll(),n(Se({legacy:Dt(o()),next:rr()}))},sortBy(m){r.sortBy(m),n(Se({legacy:rn({facetId:o(),sortCriterion:m})}))},isSortedBy(m){return r.isSortedBy(m)},showMoreValues(){r.showMoreValues(),n(pa({legacy:as(o())}))},showLessValues(){r.showLessValues(),n(pa({legacy:ss(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function vL(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Pr(r):Bt(r)}function AL(e){return e.state==="selected"?Fn():sr()}d();c();l();u();d();c();l();u();d();c();l();u();function JI(){return{}}var Ff=ce(JI(),e=>{e.addCase(sI,(t,r)=>{let n=r.payload;Cf(t,n,fS)}).addCase(zp,(t,r)=>{bf(t,r.payload)}).addCase(mo.pending,(t,r)=>{let n=r.meta.arg;xf(t,n,r.meta.requestId)}).addCase(mo.rejected,(t,r)=>{let n=r.meta.arg;Rf(t,n)}).addCase(mo.fulfilled,(t,r)=>{wf(t,r.payload,r.meta.requestId)}).addCase(Ef,(t,{payload:r})=>{Jc(t,r,fS)}).addCase(Fe.fulfilled,t=>{If(t,fS)})});function fS(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();var CL=e=>e.state==="selected",XI=(e,t)=>{let r={facetId:e,facetValue:t.value};return CL(t)?Pr(r):Bt(r)};d();c();l();u();var mS=e=>e.state==="selected",rE=e=>e.state==="excluded";var nE=e=>mS(e)?Fn():sr();d();c();l();u();d();c();l();u();var oE={facetId:ge,selection:new W({values:Si})},iE=le("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},oE),n(lo({facetId:e,selection:t})),n(Qe())}),aE=le("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},oE),n(po({facetId:e,selection:t})),n(Qe())});d();c();l();u();d();c();l();u();var ps=["allValues","atLeastOneValue"];d();c();l();u();var Tf=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var sE=new Ee({facetId:Xr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),field:Zr,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,sortCriteria:new L({constrainTo:Tf}),resultsMustMatch:new L({constrainTo:ps}),facetSearch:ns});function cE(e,t,r=sE){if(!bL(e))throw oe;let{dispatch:n}=e,o=fe(e),i=vr(e,t.options),a=t.options.tabs??{},p=Qt(e.state.tabSet),f={...uS,...fu("facetSearch",t.options),field:t.options.field,facetId:i,tabs:a,activeTab:p},m={facetSearch:{...ds,...t.options.facetSearch},...f};mt(e,r,m,"buildFacet");let h=()=>iC(e.state,i),v=()=>Zg(e.state,i),C=()=>qr(e.state),g=()=>Gr(e.state,i),S=()=>{let{currentValues:w}=h();return w.filter(R=>R.state!=="idle").length},x=()=>{let{currentValues:w}=h(),R=m.numberOfValues,I=!!w.find(E=>E.state==="idle");return R<w.length&&I};return n(os(f)),{...o,toggleSelect:w=>n(iE({facetId:m.facetId,selection:w})),toggleExclude:w=>n(aE({facetId:m.facetId,selection:w})),toggleSingleSelect:function(w){w.state==="idle"&&n(ht(i)),this.toggleSelect(w)},toggleSingleExclude:function(w){w.state==="idle"&&n(ht(i)),this.toggleExclude(w)},isValueSelected:mS,isValueExcluded:rE,deselectAll(){n(ht(i)),n(Qe())},sortBy(w){n($p({facetId:i,criterion:w})),n(Qe())},isSortedBy(w){return this.state.sortCriterion===w},showMoreValues(){let w=h().numberOfValues,R=m.numberOfValues,I=R-w%R,E=w+I;n($c({facetId:i,numberOfValues:E})),n(Hc({facetId:i,isFieldExpanded:!0})),n(Qe())},showLessValues(){let w=m.numberOfValues,R=Math.max(w,S());n($c({facetId:i,numberOfValues:R})),n(Hc({facetId:i,isFieldExpanded:!1})),n(Qe())},enable(){n(er(i))},disable(){n(dt(i))},get state(){let w=h(),R=v(),I=C(),E=g(),P;typeof w.sortCriteria=="object"?P=w.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":P=w.sortCriteria;let V=R?R.values:[],q=V.some(M=>M.state!=="idle"),O=R?R.moreValuesAvailable:!1,N=w.resultsMustMatch;return{label:R?.label,facetId:i,tabs:a,values:V,sortCriterion:P,resultsMustMatch:N,isLoading:I,hasActiveValues:q,canShowMoreValues:O,canShowLessValues:x(),enabled:E}}}}function bL(e){return e.addReducers({facetSet:cs,facetOptions:Mt,configuration:ve,facetSearchSet:Ff}),!0}d();c();l();u();var uE=new Ee({facetId:Xr,field:Zr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,sortCriteria:new L({constrainTo:Tf}),resultsMustMatch:new L({constrainTo:ps}),facetSearch:ns,allowedValues:Bp,customSort:Gp});function lE(e,t){if(!xL(e))throw oe;let{dispatch:r}=e,n=cE(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},uE),o=()=>n.state.facetId,a={updateText(){},showMoreResults(){},search(){},clear(){},updateCaptions(){},select(){},exclude(){},singleSelect(){},singleExclude(){},get state(){return{values:[],isLoading:!1,moreValuesAvailable:!1,query:""}}},{state:p,...f}=a;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(Se({legacy:XI(o(),m),next:nE(m)}))},deselectAll(){n.deselectAll(),r(Se({legacy:Dt(o()),next:rr()}))},sortBy(m){n.sortBy(m),r(Se({legacy:rn({facetId:o(),sortCriterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(pa({legacy:as(o())}))},showLessValues(){n.showLessValues(),r(pa({legacy:ss(o())}))},get state(){return{...n.state,facetSearch:a.state}}}}function xL(e){return e.addReducers({facetSet:cs,configuration:ve,facetSearchSet:Ff,search:xe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var Xc=e=>e.state==="selected",dE=e=>e.state==="excluded";var Pf=e=>Xc(e)?Fn():sr();var kf=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Xc(t)?Pr(n):Bt(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Of=T("rangeFacet/executeToggleSelect",e=>_(e,Tn(e.selection))),_f=T("rangeFacet/executeToggleExclude",e=>_(e,Tn(e.selection)));var pE={facetId:ge,selection:new W({values:Ci})},fE=le("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,pE),t(on(e)),t(Of(e)),t(Qe())}),mE=le("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,pE),t(an(e)),t(_f(e)),t(Qe())});d();c();l();u();function Nf(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function qf(e,t){let{facetId:r,getRequest:n}=t,o=fe(e),i=e.dispatch,a=()=>Gr(e.state,r);return{...o,isValueSelected:Xc,isValueExcluded:dE,deselectAll(){i(ht(r)),i(Qe())},sortBy(p){i(ls({facetId:r,criterion:p})),i(Qe())},isSortedBy(p){return this.state.sortCriterion===p},enable(){i(er(r))},disable(){i(dt(r))},get state(){let p=n(),f=vn(e.state,r),m=p.sortCriteria,h=p.resultsMustMatch,v=f?f.values:[],C=qr(e.state),g=a(),S=v.some(w=>w.state!=="idle"),x=f?.domain;return{facetId:r,values:v,sortCriterion:m,resultsMustMatch:h,hasActiveValues:S,isLoading:C,enabled:g,domain:x}}}}d();c();l();u();d();c();l();u();var Df=["idle","selected","excluded"];d();c();l();u();var Mf=["ascending","descending"],jf=["even","equiprobable"];var RL={start:new L,end:new L,endInclusive:new ue,state:new L({constrainTo:Df})},wL=new Ee({facetId:Xr,field:Zr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),generateAutomaticRanges:Qp,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,currentValues:new re({each:new W({values:RL})}),sortCriteria:new L({constrainTo:Mf}),rangeAlgorithm:new L({constrainTo:jf})});function Vf(e,t){mt(e,wL,t,"buildDateFacet"),Xp(t)}function gE(e,t){if(!IL(e))throw oe;Nf(t.options,"buildDateFacet");let r=e.dispatch,n=vr(e,t.options),o=t.options.tabs??{},i=Qt(e.state.tabSet),a={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:i};Vf(e,a),r(nn(a));let p=qf(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(fE({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(ht(n)),this.toggleSelect(f)},toggleExclude:f=>r(mE({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(ht(n)),this.toggleExclude(f)},get state(){return p.state}}}function IL(e){return e.addReducers({configuration:ve,search:xe,dateFacetSet:cn,facetOptions:Mt}),!0}function hE(e,t){let r=gE(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(Se({legacy:Dt(o()),next:rr()}))},sortBy(i){r.sortBy(i),n(Se({legacy:rn({facetId:o(),sortCriterion:i})}))},toggleSelect:i=>{r.toggleSelect(i),n(Se({legacy:kf(o(),i),next:Pf(i)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function yE(e,t){if(!EL(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i=vr(e,t.options),a=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:i,tabs:a,activeTab:p};Vf(e,f),n(nn(f));let m=()=>Gr(e.state,i);return{...r,clear:()=>{n(Pn({facetId:i,values:[]})),n(Qe())},setRange:h=>{let v={...h,state:"selected",numberOfResults:0,endInclusive:!0},C=Pn({facetId:i,values:[v]});return C.error?!1:(n(C),n(Qe()),!0)},enable(){n(er(i))},disable(){n(dt(i))},get state(){let h=qr(o()),v=m(),C=mI(o(),i),g=C.length?C[0]:void 0;return{facetId:i,isLoading:h,range:g,enabled:v}}}}function EL(e){return e.addReducers({dateFacetSet:cn,facetOptions:Mt,configuration:ve,search:xe}),!0}function SE(e,t){if(!FL(e))throw oe;let r=yE(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(Se({legacy:Dt(o()),next:rr()}))},setRange:i=>{let a=r.setRange(i);return a&&n(Se({legacy:Bt({facetId:o(),facetValue:`${i.start}..${i.end}`}),next:sr()})),a},get state(){return{...r.state}}}}function FL(e){return e.addReducers({dateFacetSet:cn,configuration:ve,search:xe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var vE={facetId:ge,selection:new W({values:Ai})},AE=le("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,vE),t(ln(e)),t(Of(e)),t(Qe())}),NVe=le("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,vE),t(dn(e)),t(_f(e)),t(Qe())});d();c();l();u();var TL={start:new ne,end:new ne,endInclusive:new ue,state:new L({constrainTo:Df})},PL=new Ee({facetId:Xr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),field:Zr,generateAutomaticRanges:Qp,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,currentValues:new re({each:new W({values:TL})}),sortCriteria:new L({constrainTo:Mf}),resultsMustMatch:new L({constrainTo:ps}),rangeAlgorithm:new L({constrainTo:jf})});function Lf(e,t){mt(e,PL,t,"buildNumericFacet"),pf(t)}d();c();l();u();function Uf(e){return{endInclusive:!1,state:"idle",...e}}function CE(e,t){if(!kL(e))throw oe;Nf(t.options,"buildNumericFacet");let r=e.dispatch,n=vr(e,t.options),o=t.options.tabs??{},i=Qt(e.state.tabSet),a={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:i};Lf(e,a),r(un(a));let p=qf(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(AE({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(ht(n)),this.toggleSelect(f)},get state(){return p.state}}}function kL(e){return e.addReducers({numericFacetSet:fo,facetOptions:Mt,configuration:ve,search:xe}),!0}function bE(e,t){let r=CE(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(Se({legacy:Dt(o()),next:rr()}))},sortBy(i){r.sortBy(i),n(Se({legacy:rn({facetId:o(),sortCriterion:i})}))},toggleSelect:i=>{r.toggleSelect(i),n(Se({legacy:kf(o(),i),next:Pf(i)}))},get state(){return{...r.state}}}}d();c();l();u();d();c();l();u();function xE(e,t){if(!OL(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i=vr(e,t.options),a=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:i,tabs:a,activeTab:p};Lf(e,f),n(un(f));let m=()=>Gr(e.state,i);return{...r,clear:()=>{n(kn({facetId:i,values:[]})),n(Qe())},setRange:h=>{let v={...h,state:"selected",numberOfResults:0,endInclusive:!0},C=kn({facetId:i,values:[v]});return C.error?!1:(n(C),n(Qe()),!0)},enable(){n(er(i))},disable(){n(dt(i))},get state(){let h=qr(o()),v=m(),C=AI(o(),i),g=C.length?C[0]:void 0;return{facetId:i,isLoading:h,range:g,enabled:v}}}}function OL(e){return e.addReducers({numericFacetSet:fo,facetOptions:Mt,configuration:ve,search:xe}),!0}function RE(e,t){let r=xE(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(Se({legacy:Dt(o()),next:rr()}))},setRange:i=>{let a=r.setRange(i);return a&&n(Se({legacy:Bt({facetId:o(),facetValue:`${i.start}..${i.end}`}),next:sr()})),a},get state(){return{...r.state}}}}d();c();l();u();d();c();l();u();var _L=e=>Z("showMoreFoldedResults")("analytics/folding/showMore",(t,r)=>(Ft(e),t.logShowMoreFoldedResults(Ke(e,r),Je(e),J(r.insightCaseContext)))),NL=()=>Z("showLessFoldedResults")("analytics/folding/showLess",(e,t)=>e.logShowLessFoldedResults(J(t.insightCaseContext))),wE={logShowMoreFoldedResults:_L,logShowLessFoldedResults:NL};d();c();l();u();d();c();l();u();var Zc={collectionField:new L({emptyAllowed:!1,required:!1}),parentField:new L({emptyAllowed:!1,required:!1}),childField:new L({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ne({min:0,required:!1})},fs=T("folding/register",e=>_(e,Zc)),Qf=le("folding/loadCollection",/*#__PURE__*/function(){var _ref90=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield $n(i):ma(i,o),p=yield n.search({...a,q:qL(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Ge(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x214,_x215){return _ref90.apply(this,arguments)}}());function qL(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}var IE=T("folding/register",e=>_(e,Zc)),Bf=le("folding/loadCollection",/*#__PURE__*/function(){var _ref91=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=yield hb(o,e),p=(yield bb(n,o,i,{origin:"foldingCollection"})).response;return Ge(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:o.folding.collections[e].result}});return function(_x216,_x217){return _ref91.apply(this,arguments)}}());d();c();l();u();d();c();l();u();d();c();l();u();var Gf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function DL(e,t){return e.raw[t.collection]}function gS(e,t){return e.raw[t.parent]}function eu(e,t){let r=e.raw[t.child];return du(r)?r[0]:r}function ML(e,t){return(e||t)!==void 0&&e===t}function FE(e,t,r,n=[]){let o=eu(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(i=>{let a=eu(i,r)===eu(e,r);return gS(i,r)===o&&!a}).map(i=>{let a={...i,searchUid:e.searchUid};return{result:a,children:FE(a,t,r,[...n,o])}}):[]}function jL(e,t){return e.find(r=>{let n=gS(r,t)===void 0,o=ML(gS(r,t),eu(r,t));return n||o})}function TE(e){return e.parentResult?TE(e.parentResult):e}function VL(e,t,r,n){let o=al(e),a={...(n??jL(o,t)??TE(e)),searchUid:r},p=FE(a,o,t);return{result:a,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function $f(e,t,r,n){let o={};return e.forEach(i=>{let a=DL(i,t);a&&(!eu(i,t)&&!i.parentResult||(o[a]=VL(i,t,r,n)))}),o}function EE(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var Hf=ce(Gf(),e=>e.addCase(Fe.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?$f(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Br.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?$f(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Kn.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...$f(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(fs,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Qf.pending,(t,{meta:r})=>{let n=r.arg;EE(t,n).isLoadingMoreResults=!0}).addCase(Qf.rejected,(t,{meta:r})=>{let n=r.arg;EE(t,n).isLoadingMoreResults=!1}).addCase(Qf.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:i}})=>{let a=$f(n,t.fields,i,o);if(!a||!a[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=a[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var tu={id:G},go=T("querySuggest/register",e=>_(e,{...tu,count:new ne({min:0})})),PE=T("querySuggest/unregister",e=>_(e,tu)),ho=T("querySuggest/selectSuggestion",e=>_(e,{...tu,expression:Ye})),yo=T("querySuggest/clear",e=>_(e,tu)),ms=le("querySuggest/fetch",/*#__PURE__*/function(){var _ref92=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:i}}){o(e,tu);let a=e.id,p=yield LL(a,t(),i),f=yield n.querySuggest(p);return Ge(f)?r(f.error):{id:a,q:p.q,...f.success}});return function(_x218,_x219){return _ref92.apply(this,arguments)}}()),LL=/*#__PURE__*/function(){var _ref93=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??$t(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Nt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield Qn(t.configuration.analytics):jo(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function LL(_x220,_x221,_x222){return _ref93.apply(this,arguments)}}();var So=ce(at(),e=>e.addCase(Ut,(t,r)=>({...t,...r.payload})).addCase(Yt,(t,r)=>{t.q=r.payload}).addCase(ho,(t,r)=>{t.q=r.payload.expression}).addCase(Ze.fulfilled,(t,r)=>r.payload?.query??t).addCase(tt,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var vo=T("fields/registerFieldsToInclude",e=>_(e,Cu)),zf=T("fields/fetchall/enable"),Wf=T("fields/fetchall/disable"),Yf=le("fields/fetchDescription",/*#__PURE__*/function(){var _ref94=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:p,url:f??$t(p,a)});return Ge(m)?n(m.error):m.success.fields});return function(_x223,_x224){return _ref94.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var kE=["author","language","urihash","objecttype","collection","source","permanentid"],UL=[...kE,"date","filetype","parents"],_Qe=[...UL,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],OE=()=>({fieldsToInclude:kE,fetchAllFields:!1,fieldsDescription:[]});var gs=ce(OE(),e=>e.addCase(vo,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(zf,t=>{t.fetchAllFields=!0}).addCase(Wf,t=>{t.fetchAllFields=!1}).addCase(Yf.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(fs,(t,{payload:r})=>{let n=Gf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function hs(e){if(!QL(e))throw oe;let t=fe(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:zl(n)}}}}function QL(e){return e.addReducers({search:xe}),!0}var BL=new Ee({fieldsToInclude:new re({required:!1,each:new L({required:!0,emptyAllowed:!1})})});function Kf(e,t){if(!GL(e))throw oe;let r=fe(e),n=hs(e),{dispatch:o}=e,i=()=>e.state,a=mt(e,BL,t?.options,"buildCoreResultList");a.fieldsToInclude&&o(vo(a.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,h=5,v=200,C=!1;return{...r,get state(){let S=i();return{...n.state,results:S.search.results,moreResultsAvailable:p(),searchResponseId:S.search.searchResponseId}},fetchMoreResults:function(){var _ref95=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<v){if(m++,m>=h){f=Date.now(),!C&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${h} times, with little delay. Please verify the conditions under which the function is called.`),C=!0;return}}else m=0;C=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref95.apply(this,arguments)}}()}}function GL(e){return e.addReducers({search:xe,configuration:ve,fields:gs}),!0}var $L=new Ee(Zc);function _E(e,t,r){if(!HL(e))throw oe;let n=Kf(e,t),{dispatch:o}=e,i=()=>e.state,a=t.options?.folding?mt(e,$L,t.options.folding,"buildFoldedResultList"):{};return o(fs({...a})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return hS(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return hS(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=i();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function HL(e){return e.addReducers({search:xe,configuration:Ad,folding:Hf,query:So}),!0}function hS(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=hS(n.children,t);if(o)return o}}return null}function NE(e,t={}){let r=_E(e,{...t,loadCollectionActionCreator:Bf,fetchMoreResultsActionCreator:kl},wE);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();var zL=()=>Z("retryGeneratedAnswer")("analytics/generatedAnswer/retry",(e,t)=>e.logRetryGeneratedAnswer(J(t.insightCaseContext))),yS=e=>Z("openGeneratedAnswerSource")({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(t,r)=>{let n=Ve(r),o=oa(r,e);return!n||!o?null:t.logGeneratedAnswerCitationClick(sl(o,r),{generativeQuestionAnsweringId:n,citationId:o.id,documentId:cl(o)},J(r.insightCaseContext))},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:t=>{let r=oa(t,e);return{answerId:Ve(t)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:r?.permanentid??"",title:r?.title,url:r?.clickUri}}}}),WL=(e,t)=>Z("generatedAnswerSourceHover")({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(r,n)=>{let o=Ve(n),i=oa(n,e);return!o||!i?null:r.logGeneratedAnswerSourceHover({generativeQuestionAnsweringId:o,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t},J(n.insightCaseContext))},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:r=>{let n=oa(r,e);return{answerId:Ve(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri},citationHoverTimeInMs:t}}}),YL=()=>Z("likeGeneratedAnswer")({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logLikeGeneratedAnswer({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"like"})}),KL=()=>Z("dislikeGeneratedAnswer")({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logDislikeGeneratedAnswer({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"dislike"})}),JL=e=>Z("generatedAnswerFeedbackSubmit")({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ve(r);return n?t.logGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e},J(r.insightCaseContext)):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ve(t),{helpful:n,readable:o,documented:i,hallucinationFree:a,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:Rc(o),documented:Rc(i),correctTopic:Rc(p),hallucinationFree:Rc(a)},additionalNotes:m,correctAnswerUrl:f}}}),XL=e=>Z("generatedAnswerStreamEnd")({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ve(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.logGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o},J(r.insightCaseContext)):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ve(t)??"",answerGenerated:e})});var ZL=()=>Z("generatedAnswerShowAnswers")({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"show"})}),eU=()=>Z("generatedAnswerHideAnswers")({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"hide"})}),tU=()=>Z("generatedAnswerExpand")({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerExpand({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"expand"})}),rU=()=>Z("generatedAnswerCollapse")({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerCollapse({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"collapse"})}),nU=()=>Z("generatedAnswerCopyToClipboard")({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"copyToClipboard"})}),Jf={logCopyGeneratedAnswer:nU,logGeneratedAnswerHideAnswers:eU,logGeneratedAnswerShowAnswers:ZL,logGeneratedAnswerStreamEnd:XL,logGeneratedAnswerFeedback:JL,logDislikeGeneratedAnswer:KL,logLikeGeneratedAnswer:YL,logHoverCitation:WL,logOpenGeneratedAnswerSource:yS,logRetryGeneratedAnswer:zL,logGeneratedAnswerExpand:tU,logGeneratedAnswerCollapse:rU};d();c();l();u();d();c();l();u();d();c();l();u();function Xf(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var ys=ce(oy(),e=>e.addCase(Fa,(t,{payload:r})=>{t.isVisible=r}).addCase(wc,(t,{payload:r})=>{t.isEnabled=r}).addCase(id,(t,{payload:r})=>{t.id=r.id}).addCase(Qo,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(Bo,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Xf([...t.citations,...r.citations]),delete t.error}).addCase(Go,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===Hm},t.citations=[],delete t.answer}).addCase(td,t=>{t.liked=!0,t.disliked=!1}).addCase(rd,t=>{t.liked=!1,t.disliked=!0}).addCase(nd,t=>{t.feedbackModalOpen=!0}).addCase(ad,t=>{t.feedbackModalOpen=!1}).addCase(Pa,t=>{t.feedbackSubmitted=!0}).addCase(ar,t=>({...oy(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase($r,(t,{payload:r})=>{t.isLoading=r}).addCase(Uo,(t,{payload:r})=>{t.isStreaming=r}).addCase($o,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(sd,(t,{payload:r})=>{t.responseFormat=r}).addCase(ud,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(Ec,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(Ic,t=>{t.expanded=!0}).addCase(od,t=>{t.expanded=!1}).addCase(cd,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(Ho,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(ay,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Ta,(t,{payload:r})=>{t.answerId=r}).addCase(ed,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(ld,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(dd,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Zf(e,t,r={}){if(!oU(e))throw oe;let{dispatch:n}=e,o=fe(e),i=()=>e.state,a=r.initialState?.isVisible;a!==void 0&&n(Fa(a));let p=r.initialState?.responseFormat;p&&n(sd(p));let f=r.fieldsToIncludeInCitations;return f&&n(ud(f)),r.initialState?.expanded&&n(Ic()),{...o,get state(){return i().generatedAnswer},like(h){this.state.liked||(n(td()),n(t.logLikeGeneratedAnswer(h)))},dislike(h){this.state.disliked||(n(rd()),n(t.logDislikeGeneratedAnswer(h)))},openFeedbackModal(){n(nd())},closeFeedbackModal(){n(ad())},sendFeedback(h){n(t.logGeneratedAnswerFeedback(h)),n(Pa())},logCitationClick(h,v){n(t.logOpenGeneratedAnswerSource(h,v))},logCitationHover(h,v,C){n(t.logHoverCitation(h,v,C))},show(){this.state.isVisible||(n(Fa(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Fa(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(Ic()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(od()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(wc(!0))},disable(){this.state.isEnabled&&n(wc(!1))},logCopyToClipboard(h){n(t.logCopyGeneratedAnswer(h))},retry(){}}}function oU(e){return e.addReducers({generatedAnswer:ys}),!0}var jt={engines:{},setAbortControllerRef:(e,t)=>{jt.engines[t].abortController=e},getIsStreamInProgress:e=>!jt.engines[e].abortController||jt.engines[e].abortController?.signal.aborted?(jt.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,i=r.generatedAnswer.id;if(jt.engines[i].lastRequestId!==n){if(jt.engines[i].lastRequestId=n,jt.engines[i].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(ar())}if(!jt.getIsStreamInProgress(i)&&o&&o!==jt.engines[i].lastStreamId){if(jt.engines[i].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(Ix({setAbortControllerRef:p=>jt.setAbortControllerRef(p,i)}))}};return e.subscribe(t)}};function qE(e,t,r={}){if(!iU(e))throw oe;let n=Zf(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!jt.engines[e.state.generatedAnswer.id]&&(jt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let a=lu("genQA-",12);e.dispatch(id({id:a}))}jt.engines[e.state.generatedAnswer.id]||(jt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),jt.subscribeToSearchRequests(e);let i=a=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in a;return{...n,get state(){return o().generatedAnswer},retry(){i(e)&&e.dispatch(Fe({legacy:t.logRetryGeneratedAnswer()}))}}}function iU(e){return e.addReducers({generatedAnswer:ys}),!0}d();c();l();u();d();c();l();u();var DE=md.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var em=e=>e==="yes"?!0:e==="no"?!1:null,aU=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:em(t.correctTopic),documented:em(t.documented),hallucinationFree:em(t.hallucinationFree),readable:em(t.readable)},helpful:t.helpful,question:r}),sU=e=>{let t="",r=()=>{let n=e.state,o=dx(n),i=o.requestId;i!==t&&(t=i,e.dispatch(ar()),o.q?.length>0&&e.dispatch(pd()))};e.subscribe(r)};function ME(e,t,r={}){if(!cU(e))throw oe;kp(e.state.configuration.analytics.analyticsMode);let{...n}=Zf(e,t,r),o=()=>e.state;return e.dispatch(cd(r.answerConfigurationId)),sU(e),{...n,get state(){let i=sy(e.state).data,a=o().generatedAnswer;return{...a,answer:i?.answer,citations:Xf(i?.citations??[]),error:{message:i?.error?.message,statusCode:i?.error?.code},isLoading:i?.isLoading??!1,isStreaming:i?.isStreaming??!1,answerContentFormat:i?.contentFormat??"text/plain",isAnswerGenerated:i?.generated??!1,cannotAnswer:a.cannotAnswer||i?.generated===!1&&!i?.isLoading&&!i?.isStreaming}},retry(){let i=Xl(o());e.dispatch(fd(i??Vo))},reset(){e.dispatch(ar())},sendFeedback(i){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(i));let a=aU({query:o().query.q,feedback:i,answerApiState:sy(e.state).data});e.dispatch(DE.endpoints.post.initiate(a)),e.dispatch(Pa())})()}}}function cU(e){return e.addReducers({[zo.reducerPath]:zo.reducer,query:So}),!0}function jE(e,t={}){let{dispatch:r}=e,n=t.answerConfigurationId?ME(e,Jf,t):qE(e,Jf,t);return{...n,get state(){return n.state},retry(){r(Se({legacy:Jf.logRetryGeneratedAnswer(),next:px()}))}}}d();c();l();u();d();c();l();u();d();c();l();u();function pn(e,t,r){if(!uU(e))throw oe;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:mu(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function uU(e){return e.addReducers({configuration:ve}),!0}function VE(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return pn(e,r,()=>{o()})}function LE(e,t){return VE(e,{logOpenGeneratedAnswerSource:yS},t)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var fU=new ne({min:1,default:8,required:!1}),mU=new ne({min:1,max:20,default:5,required:!1}),gU={desiredCount:mU,numberOfValues:fU},DGe=T("automaticFacet/setOptions",e=>_(e,gU)),MGe=T("automaticFacet/deselectAll",e=>_(e,ge)),hU=G,UE=T("automaticFacet/toggleSelectValue",e=>_(e,{field:hU,selection:new W({values:Si})}));var vs=ce(Lr(),e=>{e.addCase(Ml,(t,r)=>{let n=SS(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=ru(n,o)}).addCase(jl,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Tt,t=>{t.firstResult=0}).addCase(Vl,(t,r)=>{let n=r.payload;t.firstResult=ru(n,t.numberOfResults)}).addCase(Gn,(t,r)=>{let n=r.payload;t.firstResult=ru(n,t.numberOfResults)}).addCase(Ul,t=>{let r=SS(t),n=Math.max(r-1,1);t.firstResult=ru(n,t.numberOfResults)}).addCase(Ll,t=>{let r=SS(t),n=yU(t),o=Math.min(r+1,n);t.firstResult=ru(o,t.numberOfResults)}).addCase(Ze.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(tt,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Fe.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Br.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(ht,t=>{Vt(t)}).addCase(an,t=>{Vt(t)}).addCase(po,t=>{Vt(t)}).addCase(dn,t=>{Vt(t)}).addCase(Yp,t=>{Vt(t)}).addCase(lo,t=>{Vt(t)}).addCase(uo,t=>{Vt(t)}).addCase(es,t=>{Vt(t)}).addCase(jp,t=>{Vt(t)}).addCase(on,t=>{Vt(t)}).addCase(ln,t=>{Vt(t)}).addCase(Kt,t=>{Vt(t)}).addCase(Pn,t=>{Vt(t)}).addCase(kn,t=>{Vt(t)}).addCase(Wp,t=>{Vt(t)}).addCase(UE,t=>{Vt(t)})});function Vt(e){e.firstResult=Lr().firstResult}function SS(e){let{firstResult:t,numberOfResults:r}=e;return vS(t,r)}function yU(e){let{totalCountFiltered:t,numberOfResults:r}=e;return AS(t,r)}function ru(e,t){return(e-1)*t}function vS(e,t){return Math.round(e/t)+1}function AS(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function SU(e){return e.pagination.firstResult}function QE(e){return e.pagination.numberOfResults}function vU(e){return e.pagination.totalCountFiltered}var Ao=e=>{let t=SU(e),r=QE(e);return vS(t,r)},CS=e=>{let t=vU(e),r=QE(e);return AS(t,r)},BE=(e,t)=>{let r=Ao(e),n=CS(e),o=AU(r,t);return o=CU(o),o=bU(o,n),xU(o)};function AU(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,i=e-n,a=e+o;return{start:i,end:a}}function CU(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function bU(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function xU(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var bS=()=>$e("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||Lr().numberOfResults}));var As=()=>({actionCause:"browseResults"});d();c();l();u();d();c();l();u();var tm=()=>Z("pagerNumber")("analytics/pager/number",(e,t)=>e.logPagerNumber({pagerNumber:Ao(t),...J(t.insightCaseContext)})),rm=()=>Z("pagerNext")("analytics/pager/next",(e,t)=>e.logPagerNext({pagerNumber:Ao(t),...J(t.insightCaseContext)})),nm=()=>Z("pagerPrevious")("analytics/pager/previous",(e,t)=>e.logPagerPrevious({pagerNumber:Ao(t),...J(t.insightCaseContext)}));d();c();l();u();var RU=new Ee({numberOfPages:new ne({default:5,min:0})}),wU=new Ee({page:new ne({min:1})});function GE(e,t={}){if(!IU(e))throw oe;let r=fe(e),{dispatch:n}=e,o=mt(e,RU,t.options,"buildPager"),a=lr(e,wU,t.initialState,"buildPager").page;a&&n(Vl(a));let p=()=>Ao(e.state),f=()=>{let{numberOfPages:h}=o;return BE(e.state,h)},m=()=>CS(e.state);return{...r,get state(){let h=p(),v=m(),C=h>1&&v>0,g=h<v;return{currentPage:h,currentPages:f(),maxPage:v,hasPreviousPage:C,hasNextPage:g}},selectPage(h){n(Gn(h))},nextPage(){n(Ll())},previousPage(){n(Ul())},isCurrentPage(h){return h===this.state.currentPage}}}function IU(e){return e.addReducers({configuration:ve,pagination:vs}),!0}function $E(e,t={}){let{dispatch:r}=e,n=GE(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(Pl({legacy:tm(),next:As()}))},nextPage(){n.nextPage(),r(Pl({legacy:rm(),next:As()}))},previousPage(){n.previousPage(),r(Pl({legacy:nm(),next:As()}))}}}d();c();l();u();d();c();l();u();function HE(e){if(!EU(e))throw oe;let t=fe(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function EU(e){return e.addReducers({search:xe}),!0}function zE(e){return HE(e)}d();c();l();u();d();c();l();u();function WE(e){if(!FU(e))throw oe;let t=fe(e),r=hs(e),n=()=>e.state,o=()=>{let i=n().search.duration/1e3;return Math.round((i+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function FU(e){return e.addReducers({search:xe,pagination:vs}),!0}function YE(e){return WE(e)}d();c();l();u();d();c();l();u();function KE(_x225,_x226){return _KE.apply(this,arguments)}function _KE(){_KE=_asyncToGenerator(function*(e,t){let{accessToken:r,organizationId:n,environment:o}=e.configuration,{insightId:i}=e.insightConfiguration,a=e.query?.q||"";return{url:og({url:We(n,o),accessToken:r,organizationId:n,insightId:i}),accessToken:r,organizationId:n,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0}});return _KE.apply(this,arguments)}d();c();l();u();var JE=e=>Z("")({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Ft(e);let n=Ke(e,r),o=Je(e);t.logDocumentQuickview(n,o)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{action:"preview",itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",context:Fr(t)}}});d();c();l();u();function XE(e,t,r,n,o){if(!TU(e))throw oe;let{dispatch:i}=e,a=()=>e.state,p=fe(e),{result:f,maximumPreviewSize:m}=t.options,h=()=>{let{resultsWithPreview:C,position:g}=a().resultPreview;return C[g]},v=C=>{i(Hl({uniqueId:C,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||i(Ac({uniqueId:C,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){v(f.uniqueId)},next(){i(Gl()),v(h())},previous(){i($l()),v(h())},get state(){let C=a(),g=f.hasHtmlVersion,S=C.resultPreview,x=f.uniqueId===S.uniqueId?S.content:"",w=S.isLoading,R=S.contentURL,I=h();return{content:x,resultHasPreview:g,isLoading:w,contentURL:R,currentResultUniqueId:I}}}}function TU(e){return e.addReducers({configuration:ve,resultPreview:va}),!0}function ZE(e,t){if(!PU(e))throw oe;let r=()=>{e.dispatch(JE(t.options.result))},n="/quickview",o={options:{...t.options,onlyContentURL:!0}};return XE(e,o,(i,a)=>KE(i,a),n,r)}function PU(e){return e.addReducers({configuration:ve,resultPreview:va,insightInterface:Ln}),!0}d();c();l();u();d();c();l();u();var eF=()=>Z("clearRecentQueries")("analytics/recentQueries/clear",(e,t)=>e.logClearRecentQueries(J(t.insightCaseContext))),tF=()=>Z("recentQueriesClick")("analytics/recentQueries/click",(e,t)=>e.logRecentQueryClick(J(t.insightCaseContext)));d();c();l();u();d();c();l();u();var kU={queries:new re({required:!0,each:new L({emptyAllowed:!1})}),maxLength:new ne({required:!0,min:1,default:10})},nu=T("recentQueries/registerRecentQueries",e=>_(e,kU)),om=T("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function rF(){return{queries:[],maxLength:10}}var nF=ce(rF(),e=>{e.addCase(nu,OU).addCase(om,_U).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||NU(n,t)})});function OU(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function _U(e){e.queries=[]}function NU(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var qU={queries:[]},DU={maxLength:10,clearFilters:!0},MU=new Ee({queries:new re({required:!0})}),jU=new Ee({maxLength:new ne({required:!0,min:1}),clearFilters:new ue});function VU(e,t){mt(e,jU,t?.options,"buildRecentQueriesList"),lr(e,MU,t?.initialState,"buildRecentQueriesList")}function oF(e,t){if(!LU(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i={...DU,...t?.options},a={...qU,...t?.initialState};VU(e,{options:i,initialState:a});let p={queries:a.queries,maxLength:i.maxLength};return n(nu(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(om())},updateRecentQueries(f){let m=new re({required:!0,each:new L({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(nu({queries:f,maxLength:i.maxLength}))},executeRecentQuery(f){let m=new ne({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let h={q:this.state.queries[f],clearFilters:i.clearFilters};uu(e.state.query?.enableQuerySyntax)&&(h.enableQuerySyntax=e.state.query.enableQuerySyntax),n(ya(h))}}}function LU(e){return e.addReducers({search:xe,recentQueries:nF,query:So}),!0}function iF(e,t){let r=oF(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(eF()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(Se({legacy:tF(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var UU={results:new re({required:!0,each:new W({values:ul})}),maxLength:new ne({required:!0,min:1,default:10})},im=T("recentResults/registerRecentResults",e=>_(e,UU)),fn=T("recentResults/pushRecentResult",e=>(Ft(e),{payload:e})),am=T("recentResults/clearRecentResults");d();c();l();u();var aF=e=>Z("documentOpen")({prefix:"analytics/insight/result/open",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logDocumentOpen(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"open",context:Fr(t)}}});function sF(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(aF(t.options.result)))};return pn(e,t,()=>{n(),e.dispatch(fn(t.options.result))})}d();c();l();u();function cF(e,t){return Kf(e,{...t,fetchMoreResultsActionCreator:kl})}d();c();l();u();d();c();l();u();var QU=new Ee({numberOfResults:new ne({min:0})});function uF(e,t={}){if(!BU(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,a=lr(e,QU,t.initialState,"buildResultsPerPage").numberOfResults;return a!==void 0&&n(Ml(a)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(jl(p))},isSetTo(p){return p===this.state.numberOfResults}}}function BU(e){return e.addReducers({pagination:vs,configuration:ve}),!0}function lF(e,t={}){let r=uF(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(Se({legacy:bS(),next:As()}))}}}d();c();l();u();d();c();l();u();var xS=()=>$e("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),sm=()=>({actionCause:"searchboxSubmit"});d();c();l();u();var cm=()=>Z("searchboxSubmit")("analytics/searchbox/submit",(e,t)=>e.logSearchboxSubmit(J(t.insightCaseContext)));d();c();l();u();d();c();l();u();var dF={id:G,query:Ye},Cs=T("querySet/register",e=>_(e,dF)),bi=T("querySet/update",e=>_(e,dF));d();c();l();u();var bs=ce(wl(),e=>{e.addCase(Cs,(t,r)=>$U(t,r.payload)).addCase(bi,(t,r)=>{let{id:n,query:o}=r.payload;RS(t,n,o)}).addCase(ho,(t,r)=>{let{id:n,expression:o}=r.payload;RS(t,n,o)}).addCase(Fe.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;pF(t,n)}).addCase(tt,GU).addCase(Ze.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))RS(t,n,o)})});function GU(e,t){te(t.payload.q)||pF(e,t.payload.q)}function pF(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var RS=(e,t,r)=>{t in e&&(e[t]=r)},$U=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var fF=e=>$e("analytics/querySuggest",(t,r)=>{let n=HU(r,e);return t.makeOmniboxAnalytics(n)}),mF=()=>({actionCause:"omniboxAnalytics"});function HU(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let i=o.completions.map(m=>m.expression),a=o.partialQueries.length-1,p=o.partialQueries[a]||"",f=o.responseId;return{suggestionRanking:i.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:i,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function gF(e,t){let r=t.id;r in e||(e[r]=zU(t))}function hF(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function yF(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function SF(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function zU(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var vF=()=>({});var um=ce(vF(),e=>e.addCase(go,(t,r)=>{gF(t,r.payload)}).addCase(PE,(t,r)=>{delete t[r.payload.id]}).addCase(ms.pending,hF).addCase(ms.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(ms.rejected,yF).addCase(yo,(t,r)=>{SF(t,r.payload)}).addCase(Aa,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var AF={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},wS={open:new L,close:new L},WU={id:G,numberOfSuggestions:new ne({min:0}),enableQuerySyntax:new ue,highlightOptions:new W({values:{notMatchDelimiters:new W({values:wS}),exactMatchDelimiters:new W({values:wS}),correctionDelimiters:new W({values:wS})}}),clearFilters:new ue},CF=new Ee(WU);function bF(e,t){if(!KU(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i=t.options?.id||lu("search_box"),a={id:i,highlightOptions:{...t.options?.highlightOptions},...AF,...t.options};mt(e,CF,a,"buildSearchBox"),n(Cs({id:i,query:e.state.query.q})),a.numberOfSuggestions&&n(go({id:i,count:a.numberOfSuggestions})),a.enableQuerySyntax&&n(Ut({enableQuerySyntax:a.enableQuerySyntax}));let p=()=>e.state.querySet[a.id],f=/*#__PURE__*/function(){var _ref96=_asyncToGenerator(function*(m){let{enableQuerySyntax:h,clearFilters:v}=a;n(ya({q:p(),enableQuerySyntax:h,clearFilters:v})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x227){return _ref96.apply(this,arguments)}}();return{...r,updateText(m){n(bi({id:i,query:m})),this.showSuggestions()},clear(){n(bi({id:i,query:""})),n(yo({id:i}))},showSuggestions(){a.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:i}))},selectSuggestion(m){n(ho({id:i,expression:m})),f({legacy:fF({id:i,suggestion:m}),next:mF()}).then(()=>{n(yo({id:i}))})},submit(m=xS(),h){f({legacy:m,next:h}),n(yo({id:i}))},get state(){let m=o(),h=m.querySuggest[a.id],v=YU(h,a.highlightOptions),C=h?h.isLoading:!1;return{searchBoxId:i,value:p(),suggestions:v,isLoading:m.search.isLoading,isLoadingSuggestions:C}}}}function YU(e,t){return e?e.completions.map(r=>({highlightedValue:Um(r.highlighted,t),rawValue:r.expression})):[]}function KU(e){return e.addReducers({query:So,querySuggest:um,configuration:ve,querySet:bs,search:xe}),!0}function xF(e,t={}){let r=bF(e,{...t,executeSearchActionCreator:Se,fetchQuerySuggestionsActionCreator:Ol,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(cm(),sm())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var lm=()=>({actionCause:"resultsSort"});function RF(e,t){return e.q!==t.q?sm():e.sortCriteria!==t.sortCriteria?lm():xs(e.f,t.f)?Rs(e.f,t.f):xs(e.fExcluded,t.fExcluded)?Rs(e.fExcluded,t.fExcluded,!0):xs(e.cf,t.cf)?Rs(e.cf,t.cf):xs(e.af,t.af)?Rs(e.af,t.af):xs(e.nf,t.nf)?Rs(dm(e.nf),dm(t.nf)):xs(e.df,t.df)?Rs(dm(e.df),dm(t.df)):sa()}function xs(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function Rs(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),i=n.filter(C=>!o.includes(C));if(i.length){let C=i[0];return e[C].length>1?rr():Fn()}if(o.filter(C=>!n.includes(C)).length)return r?Hp():sr();let p=o.find(C=>t[C].filter(g=>e[C].includes(g)));if(!p)return sa();let f=e[p],m=t[p];return m.filter(C=>!f.includes(C)).length?r?Hp():sr():f.filter(C=>!m.includes(C)).length?Fn():sa()}function dm(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();var ws=()=>Z("resultsSort")("analytics/sort/results",(e,t)=>e.logResultsSort({resultsSortBy:t.sortCriteria||ir(),...J(t.insightCaseContext)}));function EF(e,t){return e.q!==t.q?cm():e.sortCriteria!==t.sortCriteria?ws():ou(e.f,t.f)?ou(e.cf,t.cf)?ou(e.nf,t.nf)?ou(e.df,t.df)?ou(e.fExcluded,t.fExcluded)?Bn():JU(e.fExcluded,t.fExcluded):IF(e.df,t.df):IF(e.nf,t.nf):pm(e.cf,t.cf):pm(e.f,t.f)}function ou(e={},t={}){return JSON.stringify(e)===JSON.stringify(t)}function wF(e){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}function pm(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),i=n.filter(C=>!o.includes(C));if(i.length){let C=i[0];return e[C].length>1?Dt(C):(r?is:Pr)({facetId:C,facetValue:e[C][0]})}let a=o.filter(C=>!n.includes(C));if(a.length){let C=a[0];return Bt({facetId:C,facetValue:t[C][0]})}let p=o.find(C=>t[C].filter(g=>e[C].includes(g)));if(!p)return Bn();let f=e[p],m=t[p],h=m.filter(C=>!f.includes(C));if(h.length)return Bt({facetId:p,facetValue:h[0]});let v=f.filter(C=>!m.includes(C));return v.length?(r?is:Pr)({facetId:p,facetValue:v[0]}):Bn()}function IF(e={},t={}){return pm(wF(e),wF(t))}function JU(e={},t={}){return pm(e,t,!0)}d();c();l();u();d();c();l();u();var XU=Object.getOwnPropertyNames,ZU=Object.getOwnPropertySymbols,eQ=Object.prototype.hasOwnProperty;function FF(e,t){return function(n,o,i){return e(n,o,i)&&t(n,o,i)}}function fm(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);var i=o.cache,a=i.get(r),p=i.get(n);if(a&&p)return a===n&&p===r;i.set(r,n),i.set(n,r);var f=e(r,n,o);return i.delete(r),i.delete(n),f}}function TF(e){return XU(e).concat(ZU(e))}var tQ=Object.hasOwn||function(e,t){return eQ.call(e,t)};function xi(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var rQ="__v",nQ="__o",oQ="_owner",PF=Object.getOwnPropertyDescriptor,kF=Object.keys;function iQ(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function aQ(e,t){return xi(e.getTime(),t.getTime())}function sQ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function cQ(e,t){return e===t}function OF(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o=new Array(n),i=e.entries(),a,p,f=0;(a=i.next())&&!a.done;){for(var m=t.entries(),h=!1,v=0;(p=m.next())&&!p.done;){if(o[v]){v++;continue}var C=a.value,g=p.value;if(r.equals(C[0],g[0],f,v,e,t,r)&&r.equals(C[1],g[1],C[0],g[0],e,t,r)){h=o[v]=!0;break}v++}if(!h)return!1;f++}return!0}var uQ=xi;function lQ(e,t,r){var n=kF(e),o=n.length;if(kF(t).length!==o)return!1;for(;o-->0;)if(!DF(e,t,r,n[o]))return!1;return!0}function iu(e,t,r){var n=TF(e),o=n.length;if(TF(t).length!==o)return!1;for(var i,a,p;o-->0;)if(i=n[o],!DF(e,t,r,i)||(a=PF(e,i),p=PF(t,i),(a||p)&&(!a||!p||a.configurable!==p.configurable||a.enumerable!==p.enumerable||a.writable!==p.writable)))return!1;return!0}function dQ(e,t){return xi(e.valueOf(),t.valueOf())}function pQ(e,t){return e.source===t.source&&e.flags===t.flags}function _F(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o=new Array(n),i=e.values(),a,p;(a=i.next())&&!a.done;){for(var f=t.values(),m=!1,h=0;(p=f.next())&&!p.done;){if(!o[h]&&r.equals(a.value,p.value,a.value,p.value,e,t,r)){m=o[h]=!0;break}h++}if(!m)return!1}return!0}function fQ(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function mQ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function DF(e,t,r,n){return(n===oQ||n===nQ||n===rQ)&&(e.$$typeof||t.$$typeof)?!0:tQ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var gQ="[object Arguments]",hQ="[object Boolean]",yQ="[object Date]",SQ="[object Error]",vQ="[object Map]",AQ="[object Number]",CQ="[object Object]",bQ="[object RegExp]",xQ="[object Set]",RQ="[object String]",wQ="[object URL]",IQ=Array.isArray,NF=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,qF=Object.assign,EQ=Object.prototype.toString.call.bind(Object.prototype.toString);function FQ(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,o=e.areFunctionsEqual,i=e.areMapsEqual,a=e.areNumbersEqual,p=e.areObjectsEqual,f=e.arePrimitiveWrappersEqual,m=e.areRegExpsEqual,h=e.areSetsEqual,v=e.areTypedArraysEqual,C=e.areUrlsEqual;return function(S,x,w){if(S===x)return!0;if(S==null||x==null)return!1;var R=typeof S;if(R!==typeof x)return!1;if(R!=="object")return R==="number"?a(S,x,w):R==="function"?o(S,x,w):!1;var I=S.constructor;if(I!==x.constructor)return!1;if(I===Object)return p(S,x,w);if(IQ(S))return t(S,x,w);if(NF!=null&&NF(S))return v(S,x,w);if(I===Date)return r(S,x,w);if(I===RegExp)return m(S,x,w);if(I===Map)return i(S,x,w);if(I===Set)return h(S,x,w);var E=EQ(S);return E===yQ?r(S,x,w):E===bQ?m(S,x,w):E===vQ?i(S,x,w):E===xQ?h(S,x,w):E===CQ?typeof S.then!="function"&&typeof x.then!="function"&&p(S,x,w):E===wQ?C(S,x,w):E===SQ?n(S,x,w):E===gQ?p(S,x,w):E===hQ||E===AQ||E===RQ?f(S,x,w):!1}}function TQ(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?iu:iQ,areDatesEqual:aQ,areErrorsEqual:sQ,areFunctionsEqual:cQ,areMapsEqual:n?FF(OF,iu):OF,areNumbersEqual:uQ,areObjectsEqual:n?iu:lQ,arePrimitiveWrappersEqual:dQ,areRegExpsEqual:pQ,areSetsEqual:n?FF(_F,iu):_F,areTypedArraysEqual:n?iu:fQ,areUrlsEqual:mQ};if(r&&(o=qF({},o,r(o))),t){var i=fm(o.areArraysEqual),a=fm(o.areMapsEqual),p=fm(o.areObjectsEqual),f=fm(o.areSetsEqual);o=qF({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:p,areSetsEqual:f})}return o}function PQ(e){return function(t,r,n,o,i,a,p){return e(t,r,p)}}function kQ(e){var t=e.circular,r=e.comparator,n=e.createState,o=e.equals,i=e.strict;if(n)return function(f,m){var h=n(),v=h.cache,C=v===void 0?t?new WeakMap:void 0:v,g=h.meta;return r(f,m,{cache:C,equals:o,meta:g,strict:i})};if(t)return function(f,m){return r(f,m,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(f,m){return r(f,m,a)}}var Z4e=mn(),eYe=mn({strict:!0}),tYe=mn({circular:!0}),rYe=mn({circular:!0,strict:!0}),nYe=mn({createInternalComparator:function(){return xi}}),oYe=mn({strict:!0,createInternalComparator:function(){return xi}}),iYe=mn({circular:!0,createInternalComparator:function(){return xi}}),aYe=mn({circular:!0,createInternalComparator:function(){return xi},strict:!0});function mn(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,o=e.createState,i=e.strict,a=i===void 0?!1:i,p=TQ(e),f=FQ(p),m=n?n(f):PQ(f);return kQ({circular:r,comparator:f,createState:o,equals:m,strict:a})}function MF(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function OQ(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>IS(r,n))!==-1)}var IS=mn({createCustomConfig:e=>({...e,areArraysEqual:OQ})});d();c();l();u();d();c();l();u();function jF(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function VF(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function mm(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([i])=>t(i)).map(([i,{request:a}])=>{let p=r(a);return p.length?{[i]:p}:{}}).reduce((i,a)=>({...i,...a}),{});return Object.keys(o).length?{[n]:o}:{}}function LF(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function UF(e){return{q:at().q,enableQuerySyntax:at().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??An().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??An().defaultFilters.cq,firstResult:Lr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??Lr().defaultNumberOfResults,sortCriteria:ir(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:xl(),sf:{},tab:"",af:{},mnf:{}}}var _Q=new Ee({parameters:new W({options:{required:!0},values:gd})});function BF(e,t){let{dispatch:r}=e,n=fe(e);lr(e,_Q,t.initialState,"buildSearchParameterManager");let o=QF(e.state.tabSet,t.initialState.parameters);return r(tt(o)),{...n,synchronize(i){let a=QF(e.state.tabSet,gm(e,i));r(tt(a))},get state(){return{parameters:ES(e)}}}}function gm(e,t){return{...UF(e.state),...t}}function QF(e,t){if(t.tab&&e){let r=Object.values(e).some(o=>o.id===t.tab),n=Object.values(e).find(o=>o.isActive);if(!r&&n)return{...t,tab:n.id};if(!r)return{...t,tab:""}}return t}function ES(e){let t=e.state;return{...jF(t.query,r=>r.q,at().q),...LF(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...VF(t.sortCriteria,r=>r,ir()),...qQ(t),...DQ(t),...MQ(t),...jQ(t),...VQ(t)}}function NQ(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function hm(e){let t=NQ(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,i=tr(n?.tabs,t);return o&&i}}function GF(e){return e.currentValues.filter(t=>t.state==="selected")}function qQ(e){let t=e.facetSet;if(t===void 0)return{};let r=hm(e),n={},o={};for(let[i,{request:a}]of Object.entries(t)){if(!r(i))continue;let p=a.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=a.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[i]=p),f.length&&(o[i]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function DQ(e){return mm(e.categoryFacetSet,hm(e),t=>Dr(t.currentValues).map(r=>r.value),"cf")}function MQ(e){return mm(e.numericFacetSet,hm(e),GF,"nf")}function jQ(e){return mm(e.dateFacetSet,hm(e),GF,"df")}function VQ(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let i=LQ(o);return i.length?{[n]:i}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function LQ(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function $F(e,t){let{dispatch:r}=e,n=BF(e,t);return{...n,synchronize(o){let i=ES(e),a=gm(e,i),p=gm(e,o);IS(a,p)||(n.synchronize(o),r(Se({legacy:EF(a,p),next:RF(a,p)})))},get state(){return n.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var au=()=>new W({values:{questionAnswerId:G},options:{required:!0}}),ym=()=>new W({values:{linkText:Ye,linkURL:Ye},options:{required:!0}});function Ri(e){return _(e,au())}d();c();l();u();function pt(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&Lb(e,r.contentIdKey,r.contentIdValue)}function Ar(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var HF={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"};var UQ=()=>Z("expandSmartSnippet")({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:(e,t)=>e.logExpandSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),QQ=()=>Z("collapseSmartSnippet")({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:(e,t)=>e.logCollapseSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),BQ=()=>Z("likeSmartSnippet")({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:(e,t)=>e.logLikeSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),GQ=()=>Z("dislikeSmartSnippet")({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:(e,t)=>e.logDislikeSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),$Q=()=>Z("openSmartSnippetSource")({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=pt(t);return e.logOpenSmartSnippetSource(Ke(r,t),Je(r),J(t.insightCaseContext))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),FS=e=>Z("openSmartSnippetSource")({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{_(e,ym());let n=pt(r);return t.logOpenSmartSnippetInlineLink(Ke(n,r),{...Je(n),...e},J(r.insightCaseContext))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=pt(t),n=Je(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),HQ=()=>Z("openSmartSnippetFeedbackModal")("analytics/smartSnippet/feedbackModal/open",(e,t)=>e.logOpenSmartSnippetFeedbackModal(J(t.insightCaseContext))),zQ=()=>Z("closeSmartSnippetFeedbackModal")("analytics/smartSnippet/feedbackModal/close",(e,t)=>e.logCloseSmartSnippetFeedbackModal(J(t.insightCaseContext))),WQ=e=>Z("sendSmartSnippetReason")({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:(t,r)=>t.logSmartSnippetFeedbackReason(e,void 0,J(r.insightCaseContext)),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=pt(t),n=Je(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:HF[e]}}}),YQ=e=>Z("sendSmartSnippetReason")({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:(t,r)=>t.logSmartSnippetFeedbackReason("other",e,J(r.insightCaseContext)),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=pt(t),n=Je(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),KQ=e=>Z("expandSmartSnippetSuggestion")({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{Ri(e);let n=Ar(r,e.questionAnswerId);return n?t.logExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId},J(r.insightCaseContext)):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ar(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=pt(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),JQ=e=>Z("collapseSmartSnippetSuggestion")({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{Ri(e);let n=Ar(r,e.questionAnswerId);return n?t.logCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId},J(r.insightCaseContext)):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ar(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=pt(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),TS=e=>Z("openSmartSnippetSuggestionSource")({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{_(e,au());let n=Ar(r,e.questionAnswerId);if(!n)return null;let o=pt(r,n.documentId);return o?t.logOpenSmartSnippetSuggestionSource(Ke(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId},J(r.insightCaseContext)):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Ar(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=pt(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),zF=(e,t)=>Z("openSmartSnippetSuggestionSource")({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{_(e,au()),_(t,ym());let o=Ar(n,e.questionAnswerId);if(!o)return null;let i=pt(n,o.documentId);return i?r.logOpenSmartSnippetSuggestionInlineLink(Ke(i,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL},J(n.insightCaseContext)):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Ar(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let i=pt(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:i?.title,url:i?.clickUri}}}}}),Sm={logExpandSmartSnippet:UQ,logCollapseSmartSnippet:QQ,logLikeSmartSnippet:BQ,logDislikeSmartSnippet:GQ,logOpenSmartSnippetSource:$Q,logOpenSmartSnippetInlineLink:FS,logOpenSmartSnippetFeedbackModal:HQ,logCloseSmartSnippetFeedbackModal:zQ,logSmartSnippetFeedback:WQ,logSmartSnippetDetailedFeedback:YQ,logExpandSmartSnippetSuggestion:KQ,logCollapseSmartSnippetSuggestion:JQ,logOpenSmartSnippetSuggestionSource:TS};d();c();l();u();d();c();l();u();var Is=T("smartSnippet/expand"),Es=T("smartSnippet/collapse"),Fs=T("smartSnippet/like"),Ts=T("smartSnippet/dislike"),Ps=T("smartSnippet/feedbackModal/open"),Co=T("smartSnippet/feedbackModal/close"),ks=T("smartSnippet/related/expand",e=>Ri(e)),Os=T("smartSnippet/related/collapse",e=>Ri(e));d();c();l();u();d();c();l();u();var PS=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var WF=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function YF({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Oi({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function XQ(e,t){let r=YF(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var gn=ce(PS(),e=>e.addCase(Is,t=>{t.expanded=!0}).addCase(Es,t=>{t.expanded=!1}).addCase(Fs,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(Ts,t=>{t.liked=!1,t.disliked=!0}).addCase(Ps,t=>{t.feedbackModalOpen=!0}).addCase(Co,t=>{t.feedbackModalOpen=!1}).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((i,a)=>XQ(i,t.relatedQuestions[a])),o=YF(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...PS(),relatedQuestions:n,questionAnswerId:o}}).addCase(ks,(t,r)=>{let n=WF(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(Os,(t,r)=>{let n=WF(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function KF(e,t,r){if(!ZQ(e))throw oe;let n=fe(e),o=()=>e.state,i=()=>pt(o()),a=null,p=pn(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=i();if(!f){a=null;return}let{searchResponseId:m}=o().search;a!==m&&(a=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(fn(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:i()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(Is())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(Es())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(Fs())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(Ts())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(Ps())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(Co())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(Co())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(Co())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function ZQ(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}d();c();l();u();function vm(e,t){if(!eB(e))throw oe;let r=()=>e.state,n=new Set,o=h=>n.has(h)?!0:(n.add(h),!1),i=null,a=h=>{i!==h&&(i=h,f={},n.clear())},p=(h,v,C)=>pn(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(v)||e.dispatch(C?zF({questionAnswerId:C},h):FS(h))}),f={},m=(h,v)=>{let{searchResponseId:C}=r().search;a(C);let g=Oi({...h,questionAnswerId:v});return g in f||(f[g]=p(h,g,v)),f[g]};return{selectInlineLink(h,v){m(h,v)?.select()},beginDelayedSelectInlineLink(h,v){m(h,v)?.beginDelayedSelect()},cancelPendingSelectInlineLink(h,v){m(h,v)?.cancelPendingSelect()}}}function eB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}function JF(e,t){let r=KF(e,Sm,t),n=vm(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function XF(e,t){if(!tB(e))throw oe;let r=fe(e),n=()=>e.state,o=i=>{let{contentIdKey:a,contentIdValue:p}=i;return e.state.search.results.find(f=>Jn(f,a)===p)};return{...r,get state(){let i=n();return{questions:i.search.questionAnswer.relatedQuestions.map((a,p)=>({question:a.question,answer:a.answerSnippet,documentId:a.documentId,questionAnswerId:i.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:i.questionAnswering.relatedQuestions[p].expanded,source:o(a.documentId)}))}},expand(i){let a={questionAnswerId:i};e.dispatch(t.logExpandSmartSnippetSuggestion(a)),e.dispatch(ks(a))},collapse(i){let a={questionAnswerId:i};e.dispatch(t.logCollapseSmartSnippetSuggestion(a)),e.dispatch(Os(a))}}}function tB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}d();c();l();u();function ZF(e,t){if(!rB(e))throw oe;let r=()=>e.state,n=v=>{let C=r(),g=Ar(C,v);return g?pt(C,g.documentId):null},o=new Set,i=v=>o.has(v)?!0:(o.add(v),!1),a=null,p=v=>{a!==v&&(a=v,m={},o.clear())},f=(v,C)=>pn(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{i(C)||(e.dispatch(TS({questionAnswerId:C})),e.dispatch(fn(v)))}),m={},h=v=>{let{searchResponseId:C}=r().search;p(C);let g=n(v);return g?(v in m||(m[v]=f(g,v)),m[v]):null};return{selectSource(v){h(v)?.select()},beginDelayedSelectSource(v){h(v)?.beginDelayedSelect()},cancelPendingSelectSource(v){h(v)?.cancelPendingSelect()}}}function rB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}function eT(e,t){let r=XF(e,Sm),n=vm(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=ZF(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(i){o.selectSource(i)},beginDelayedSelectSource(i){o.beginDelayedSelectSource(i)},cancelPendingSelectSource(i){o.cancelPendingSelectSource(i)},selectInlineLink(i,a){n.selectInlineLink(a,i)},beginDelayedSelectInlineLink(i,a){n.beginDelayedSelectInlineLink(a,i)},cancelPendingSelectInlineLink(i,a){n.cancelPendingSelectInlineLink(a,i)}}}d();c();l();u();d();c();l();u();d();c();l();u();var tT={by:new Us({enum:nl,required:!0})},Am=T("sortCriteria/register",e=>rT(e)),Cm=T("sortCriteria/update",e=>rT(e)),rT=e=>ki(e)?(e.forEach(t=>_(t,tT)),{payload:e}):_(e,tT);d();c();l();u();var nT=ce(ir(),e=>{e.addCase(Am,(t,r)=>Mr(r.payload)).addCase(Cm,(t,r)=>Mr(r.payload)).addCase(Ze.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(tt,(t,r)=>r.payload.sortCriteria??t)});function nB(e,t){if(!t)return;let r=new Ee({criterion:new re({each:xC})}),n=oB(t),o={...t,criterion:n};lr(e,r,o,"buildSort")}function oB(e){return e.criterion?ki(e.criterion)?e.criterion:[e.criterion]:[]}function oT(e,t){if(!iB(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state;nB(e,t.initialState);let i=t.initialState?.criterion;return i&&n(Am(i)),{...r,sortBy(a){n(Cm(a)),n(Gn(1))},isSortedBy(a){return this.state.sortCriteria===Mr(a)},get state(){return{sortCriteria:o().sortCriteria}}}}function iB(e){return e.addReducers({configuration:ve,sortCriteria:nT}),!0}function iT(e,t={}){let{dispatch:r}=e,n=oT(e,t),o=()=>r(Se({legacy:ws(),next:lm()}));return{...n,get state(){return n.state},sortBy(i){n.sortBy(i),o()}}}d();c();l();u();function aT(e){return hs(e)}d();c();l();u();d();c();l();u();var aB=new Ee({expression:Ye,id:G,clearFiltersOnTabChange:new ue}),sB=new Ee({isActive:new ue});function sT(e,t){if(uB(t.options.id),!cB(e))throw oe;let r=fe(e),{dispatch:n}=e;mt(e,aB,t.options,"buildTab");let o=lr(e,sB,t.initialState,"buildTab"),{id:i,expression:a}=t.options;return n(yd({id:i,expression:a})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(Tt(i)),{...r,select(){t.options.clearFiltersOnTabChange&&n(ya({q:"",clearFilters:!0})),n(Tt(i))},get state(){return{isActive:e.state.tabSet[i]?.isActive}}}}function cB(e){return e.addReducers({configuration:ve,tabSet:Af}),!0}function uB(e){let t=vd().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function cT(e,t){let{dispatch:r}=e,n=sT(e,t),o=()=>r(Se({legacy:Bn(),next:sa()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();d();c();l();u();var uT=()=>Z("query")("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.logTriggerNotify({notifications:t.triggers.notifications},J(t.insightCaseContext)):null);d();c();l();u();d();c();l();u();d();c();l();u();function lT(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function dT(e,t){let r=[],n=[],o=[],i=[];return t.forEach(a=>{switch(a.type){case"redirect":r.push(a.content);break;case"query":n.push(a.content);break;case"execute":o.push({functionName:a.content.name,params:a.content.params});break;case"notify":i.push(a.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=i,e}function pT(e,t){return e.queryModification={...t,queryToIgnore:""},e}function fT(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var mT=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var gT=ce(mT(),e=>e.addCase(Fe.pending,lT).addCase(Fe.fulfilled,(t,r)=>dT(t,r.payload.response.triggers)).addCase(ha,(t,r)=>pT(t,r.payload)).addCase(ga,(t,r)=>fT(t,r.payload)));function hT(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!lB(e))throw oe;let n=fe(e),{dispatch:o}=e,i=()=>e.state,a=i().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!MF(a,this.state.notifications);a=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:i().triggers.notifications}}}}function lB(e){return e.addReducers({triggers:gT}),!0}function yT(e){return hT(e,{options:{logNotifyTriggerActionCreator:uT}})}d();c();l();u();d();c();l();u();var ST=(e,t)=>Z("expandToFullUI")({prefix:"analytics/expandToFullUI",__legacy__getBuilder:(r,n)=>{let o=J(n.insightCaseContext),i={caseId:o.caseId,caseNumber:o.caseNumber,fullSearchComponentName:e,triggeredBy:t,caseContext:o.caseContext};return r.logExpandToFullUI(i)},analyticsType:"InsightPanel.ExpandToFullUI",analyticsPayloadBuilder:r=>{let n=J(r.insightCaseContext);return{context:{targetId:n.caseId,targetType:"Case",caseNumber:n.caseNumber}}}}),vT=e=>Z("createArticle")({prefix:"analytics/insight/createArticle",__legacy__getBuilder:(t,r)=>(_(e,{articleType:G}),t.logCreateArticle(e,J(r.insightCaseContext))),analyticsType:"InsightPanel.CreateArticle",analyticsPayloadBuilder:t=>{let r=J(t.insightCaseContext);return{articleType:e.articleType,context:{targetId:r.caseId,targetType:"Case",caseNumber:r.caseNumber}}}}),bm=()=>Z("openUserActions")({prefix:"analytics/insight/openUserActions",__legacy__getBuilder:(e,t)=>e.logOpenUserActions(J(t.insightCaseContext))});d();c();l();u();d();c();l();u();var AT=/*#__PURE__*/function(){var _ref97=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),userId:t}});return function AT(_x228,_x229){return _ref97.apply(this,arguments)}}();var dB={ticketCreationDate:new L({emptyAllowed:!1,ISODate:!0}),excludedCustomActions:new re({required:!1,each:He})},_s=T("insight/userActions/registerUserActions",e=>_(e,dB)),bo=le("insight/userActions/fetch",/*#__PURE__*/function(){var _ref98=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=yield n.userActions(yield AT(o,e));return Ge(i)?r(i.error):{response:i.success}});return function(_x230,_x231){return _ref98.apply(this,arguments)}}());d();c();l();u();d();c();l();u();d();c();l();u();function CT(){return{timeline:void 0,excludedCustomActions:[],loading:!1}}var pB=1e3,fB=pB*60,kS=30*fB,mB=2,gB=2,RT=(e,t)=>{if(!e.ticketCreationDate||!t?.length)return{precedingSessions:[],session:void 0,followingSessions:[]};let n=new Date(e.ticketCreationDate).getTime(),o=e.excludedCustomActions,i=yB(t);return vB(i,n,o)},hB=e=>{let t=JSON.parse(e.value);return{actionType:e.name,timestamp:Number(e.time),eventData:{type:t.event_type,value:t.event_value},cause:t.cause,searchHub:t.origin_level_1,document:{title:t.title,uriHash:t.uri_hash,contentIdKey:t.content_id_key||t.c_contentidkey,contentIdValue:t.content_id_value||t.c_contentidvalue},query:t.query_expression}},yB=e=>{let t=!1,r=e.reduce((n,o)=>{try{let i=hB(o);n.push(i)}catch{t=!0}return n},[]).sort((n,o)=>o.timestamp-n.timestamp);return t&&console.warn("Some user actions could not be parsed. Please check the raw user actions data."),r},SB=(e,t)=>Math.abs(e.timestamp-t)<kS,bT=(e,t,r)=>{if(e.actions?.length)if(t>=e.start-kS&&t<=e.end+kS){let n={actionType:"TICKET_CREATION",timestamp:t,eventData:{}},o=e.actions.findIndex(i=>i.timestamp<=n.timestamp);o===-1?(o=e.actions.length,e.start=t):o===0&&(e.end=t),e.actions.splice(o,0,n),r.session=e}else t<e.start?r.followingSessions.push(e):r.precedingSessions.push(e)},xT=(e,t)=>{if(e.actionType==="SEARCH"&&!e.query)return!0;if(e.actionType==="CUSTOM"){let r=e.eventData?.type||"",n=e.eventData?.value||"";return t.includes(r)||t.includes(n)}return!1},vB=(e,t,r)=>{let n={precedingSessions:[],session:void 0,followingSessions:[]},o={start:e[0].timestamp,end:e[0].timestamp,actions:[]};return e.forEach(i=>{if(SB(i,o.start)){o.actions.push(i),o.start=i.timestamp;return}o.actions=o.actions.filter(a=>!xT(a,r)),bT(o,t,n),o={start:i.timestamp,end:i.timestamp,actions:[i]}}),o.actions=o.actions.filter(i=>!xT(i,r)),bT(o,t,n),n.session===void 0&&(n.session={start:t,end:t,actions:[{actionType:"TICKET_CREATION",timestamp:t,eventData:{}}]}),{precedingSessions:n.precedingSessions.slice(0,mB),session:n.session,followingSessions:n.followingSessions.slice(n.followingSessions.length-gB)}};var xm=ce(CT(),e=>{e.addCase(_s,(t,r)=>{t.ticketCreationDate=r.payload.ticketCreationDate,r.payload.excludedCustomActions&&(t.excludedCustomActions=r.payload.excludedCustomActions)}).addCase(bo.pending,t=>{t.loading=!0,t.error=void 0}).addCase(bo.rejected,(t,r)=>{t.loading=!1,t.error=r.payload}).addCase(bo.fulfilled,(t,r)=>{t.loading=!1,t.error=void 0,t.timeline=RT(t,r.payload.response.value)})});function wT(e,t){if(!AB(e))throw oe;let{dispatch:r}=e,n=()=>e.state.insightUserActions,o=fe(e),{ticketCreationDate:i,excludedCustomActions:a}=t.options;return r(_s({ticketCreationDate:i,excludedCustomActions:a})),{...o,get state(){return n()},fetchUserActions(p){r(bo(p))},logOpenUserActions(){r(bm())}}}function AB(e){return e.addReducers({configuration:ve,insightUserActions:xm}),!0}d();c();l();u();function IT(e){if(!CB(e))throw oe;let t=fe(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return n().insightInterface},fetch(){r(jr())}}}function CB(e){return e.addReducers({configuration:ve,insightConfiguration:ml,insightInterface:Ln,searchHub:Wl}),!0}d();c();l();u();function bB(e){return e.addReducers({}),{logSearchEvent:qC,logClickEvent:DC,logCustomEvent:MC}}d();c();l();u();d();c();l();u();var ET=e=>Z("copyToClipboard")({prefix:"analytics/resultAction/insight/copyToClipboard",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logCopyToClipboard(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"copyToClipboard",context:Fr(t)}}}),FT=e=>Z("Case.SendEmail")({prefix:"analytics/resultAction/insight/caseSendEmail",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logCaseSendEmail(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"sendEmail",context:Fr(t)}}}),TT=e=>Z("FeedItem.TextPost")({prefix:"analytics/resultAction/insight/feedItemTextPost",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logFeedItemTextPost(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"postToFeed",context:Fr(t)}}});function xB(e){return e.addReducers({}),{logClearBreadcrumbs:Jp,logInterfaceLoad:El,logInterfaceChange:Bn,logCreateArticle:vT,logCategoryFacetBreadcrumb:Mp,logFacetBreadcrumb:zc,logFacetClearAll:Dt,logFacetDeselect:Pr,logFacetSelect:Bt,logFacetShowLess:ss,logFacetShowMore:as,logFacetUpdateSort:rn,logDateFacetBreadcrumb:Wc,logNumericFacetBreadcrumb:Yc,logPageNext:rm,logPageNumber:tm,logPagePrevious:nm,logResultsSort:ws,logStaticFilterDeselect:hf,logCopyToClipboard:ET,logCaseSendEmail:FT,logFeedItemTextPost:TT,logOpenUserActions:bm}}d();c();l();u();function RB(e){return e.addReducers({attachedResults:co}),{setAttachedResults:Np,detachResult:so,attachResult:ao}}d();c();l();u();function wB(e){return e.addReducers({attachedResults:co}),{logCaseDetach:Ka,logCaseAttach:Ya}}d();c();l();u();d();c();l();u();d();c();l();u();var Rm=T("insight/caseContext/set",e=>{let t=new W({options:{required:!0}}),r=_(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new re({each:Ye}),i=_(n,o).error;return i?{payload:e,error:i}:{payload:e}}),wm=T("insight/caseId/set",e=>{let r=_(e,Ye).error;return r?{payload:e,error:r}:{payload:e}}),Im=T("insight/caseNumber/set",e=>{let r=_(e,Ye).error;return r?{payload:e,error:r}:{payload:e}});var PT=ce(fb(),e=>{e.addCase(Rm,(t,r)=>{t.caseContext=r.payload}).addCase(wm,(t,r)=>{t.caseId=r.payload}).addCase(Im,(t,r)=>{t.caseNumber=r.payload})});function IB(e){return e.addReducers({insightCaseContext:PT}),{setCaseContext:Rm,setCaseId:wm,setCaseNumber:Im}}d();c();l();u();d();c();l();u();d();c();l();u();var EB=new re({each:G,required:!0}),kT=(e,t)=>(_(e,G),Pi(t)?_(t,G):_(t,EB),{payload:{contextKey:e,contextValue:t}}),Em=T("context/set",e=>{for(let[t,r]of Object.entries(e))kT(t,r);return{payload:e}}),Fm=T("context/add",e=>kT(e.contextKey,e.contextValue)),Tm=T("context/remove",e=>_(e,G));var OT=ce(bl(),e=>{e.addCase(Em,(t,r)=>{t.contextValues=r.payload}).addCase(Fm,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Tm,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Ze.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});function FB(e){return e.addReducers({context:OT}),{addContext:Fm,removeContext:Tm,setContext:Em}}d();c();l();u();function TB(e){return e.addReducers({dateFacetSet:cn}),{deselectAllDateFacetValues:ef,registerDateFacet:nn,toggleSelectDateFacetValue:on,toggleExcludeDateFacetValue:an,updateDateFacetSortCriterion:Zp,updateDateFacetValues:Pn}}d();c();l();u();function PB(e){return e.addReducers({numericFacetSet:fo}),{deselectAllNumericFacetValues:mf,registerNumericFacet:un,toggleSelectNumericFacetValue:ln,toggleExcludeNumericFacetValue:dn,updateNumericFacetSortCriterion:ff,updateNumericFacetValues:kn}}d();c();l();u();function kB(e){return e.addReducers({fields:gs}),{registerFieldsToInclude:vo,enableFetchAllFields:zf,disableFetchAllFields:Wf,fetchFieldsDescription:Yf}}d();c();l();u();function OB(e){return e.addReducers({folding:Hf}),{registerFolding:IE,loadCollection:Bf}}d();c();l();u();function _B(e){return e.addReducers({generatedAnswer:ys}),{generateAnswer:pd,resetAnswer:ar,setAnswerGenerationMode:ed}}d();c();l();u();function NB(e){return e.addReducers({insightInterface:Ln}),{fetch:jr}}d();c();l();u();function qB(e){return e.addReducers({querySet:bs}),{registerQuerySetQuery:Cs,updateQuerySetQuery:bi}}d();c();l();u();function DB(e){return e.addReducers({search:xe}),{executeSearch:Sb,fetchFacetValues:Cb,fetchMoreResults:Ab,fetchPage:vb,fetchQuerySuggestions:Ol,registerQuerySuggest:go}}d();c();l();u();function MB(e){return e.addReducers({}),{logContextChanged:mb,logExpandToFullUI:ST}}d();c();l();u();function jB(e){return e.addReducers({insightUserActions:xm}),{registerUserActions:_s,fetchUserActions:bo}}d();c();l();u();function VB(e){return e.addReducers({querySuggest:um,querySet:bs}),{clearQuerySuggest:yo,fetchQuerySuggestions:ms,registerQuerySuggest:go,selectQuerySuggestion:ho}}d();c();l();u();function LB(e){return e.addReducers({questionAnswering:gn}),{collapseSmartSnippet:Es,expandSmartSnippet:Is,dislikeSmartSnippet:Ts,likeSmartSnippet:Fs,openFeedbackModal:Ps,closeFeedbackModal:Co,expandSmartSnippetRelatedQuestion:ks,collapseSmartSnippetRelatedQuestion:Os}}d();c();l();u();d();c();l();u();d();c();l();u();function _T(){return{results:[],maxLength:10}}var NT=ce(_T(),e=>{e.addCase(im,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(am,t=>{t.results=[]}).addCase(fn,(t,r)=>{let n=r.payload;t.results=t.results.filter(i=>i.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});function UB(e){return e.addReducers({recentResults:NT}),{registerRecentResults:im,clearRecentResults:am,pushRecentResult:fn}}d();c();l();u();d();c();l();u();var QB=new Ee({content:new Be({required:!0}),conditions:new Be({required:!0}),priority:new ne({required:!1,default:0,min:0}),fields:new re({required:!1,each:G})});function qT(){let e=[],t=r=>{let n=QB.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new xo("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function DT(e){if(!BB(e))throw oe;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=qT();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(vo(i))},selectTemplate:r,selectLinkTemplate:n}}function BB(e){return e.addReducers({fields:gs}),!0}/**
|
|
44
|
+
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function _p(e){e==="next"&&console.warn(lV)}d();c();l();u();var zw=Cr(Hw(),1);function Ww(e){return(0,zw.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function Yw(e,t){let r=FV(e),n=ur,o=TV(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function FV(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function TV(e){return e.preprocessRequest||bu}d();c();l();u();d();c();l();u();var Kw={organizationId:G,accessToken:G,name:new L({required:!1,emptyAllowed:!1}),analytics:new W({options:{required:!1},values:{enabled:new ue({required:!1}),originContext:new L({required:!1}),originLevel2:new L({required:!1}),originLevel3:new L({required:!1}),analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new L({required:!1,url:!0}),trackingId:new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new L({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Jw(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Xw=new Ee({...Kw,insightId:G,search:new W({options:{required:!1},values:{locale:He}})}),PV="2729db39-d7fd-4504-a06e-668c64968c95";function cS(){return{...Jw(),insightId:PV}}var kV={insightConfiguration:yl,search:xe,insightInterface:Un,searchHub:zl,resultPreview:va};function Zw(e){let t=Ww(e.loggerOptions);OV(e.configuration,t);let r=_V(e.configuration,t),n=NV(t),o={...Yw(e.configuration,t),apiClient:r,streamingClient:n},i={...e,reducers:kV},a=jw(i,o);_p(a.state.configuration.analytics.analyticsMode);let{insightId:p,search:f}=e.configuration;return a.dispatch(hl({insightId:p})),a.dispatch(jr()),f&&a.dispatch(la(f)),{...a,get state(){return a.state},executeFirstSearch(m=Il()){Hl(a.state)||a.dispatch(Se({legacy:m,next:tb()}))}}}function OV(e,t){try{Xw.validate(e)}catch(r){throw t.error(r,"Insight engine configuration error"),r}}function _V(e,t){return new xu({logger:t,preprocessRequest:e.preprocessRequest||bu})}function NV(e){return new Cu({logger:e})}d();c();l();u();function fe(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),p=t!==a;return t=a,p}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&p?.()}},get state(){return{}}}}d();c();l();u();d();c();l();u();var eI={articleLanguage:He,articlePublishStatus:He,articleVersionNumber:He,caseId:G,knowledgeArticleId:He,name:He,permanentId:He,resultUrl:He,source:He,title:G,uriHash:He,isAttachedFromCitation:new ue({required:!1,default:!1})},qV=new W({options:{required:!0},values:eI}),Dp=T("insight/attachToCase/setAttachedResults",e=>_(e,{results:new re({each:qV}),loading:new ue({required:!1,default:!1})})),ao=T("insight/attachToCase/attach",e=>tI(e)),so=T("insight/attachToCase/detach",e=>tI(e)),tI=e=>te(e.permanentId)&&te(e.uriHash)?{payload:e,error:br(new xo("Either permanentId or uriHash is required"))}:_(e,eI);d();c();l();u();d();c();l();u();var Fr=e=>{let t=J(e.insightCaseContext);return{targetId:t.caseId||"",targetType:"Case",caseNumber:t.caseNumber}};var Wa=e=>Z("caseAttach")({prefix:"insight/caseAttach",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logCaseAttach(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:t.search?.response.searchUid||"",action:"attach",context:Fr(t)}}}),Ya=e=>Z("caseDetach")({prefix:"insight/caseDetach",__legacy__getBuilder:(t,r)=>t.logCaseDetach(e.raw.urihash,J(r.insightCaseContext)),analyticsType:"InsightPanel.DetachItem",analyticsPayloadBuilder:t=>({itemMetadata:xr(e,t),context:Fr(t)})});d();c();l();u();d();c();l();u();function rI(){return{results:[],loading:!1}}var co=ce(rI(),e=>{e.addCase(Dp,(t,r)=>{let{results:n,loading:o}=r.payload;"results"in t&&t.results?.length>0||(t.results=n,o&&(t.loading=o))}).addCase(ao,(t,r)=>{(!te(r.payload.permanentId)||!te(r.payload.uriHash))&&(t.results=[...t.results,r.payload])}).addCase(so,(t,r)=>{t.results=t.results.filter(n=>DV(n,r.payload))})}),DV=(e,t)=>{let r=!te(e.permanentId)&&e?.permanentId===t?.permanentId,n=!te(e.uriHash)&&e?.uriHash===t?.uriHash;return!(e.caseId===t.caseId)||!r&&!n};d();c();l();u();var Mp=(e,t)=>Pi(e.raw[t])?String(e.raw[t]):void 0,Ka=(e,t)=>({articleLanguage:Mp(e,"sflanguage"),articleVersionNumber:Mp(e,"sflanguage"),articlePublishStatus:Mp(e,"articlePublishStatus"),caseId:t,knowledgeArticleId:Mp(e,"knowledgeArticleId"),permanentId:e.raw?.permanentid,uriHash:e.raw?.urihash,resultUrl:e.clickUri,source:e.raw.source,title:e.title});function nI(e,t){if(!MV(e))throw oe;let{dispatch:r}=e,n=()=>e.state.attachedResults,o=fe(e),{result:i,caseId:a}=t.options,p=()=>te(a)||te(i.raw.permanentid)&&te(i.raw.urihash)?!1:e.state.attachedResults.results.some(f=>{let m=a===f.caseId,g=!te(f.permanentId)&&f.permanentId===i.raw.permanentid,S=!te(f.uriHash)&&f.uriHash===i.raw.urihash;return m&&(g||S)});return{...o,get state(){return n()},isAttached(){return p()},attach(){r(ao(Ka(i,a))),r(Wa(i))},detach(){r(so(Ka(i,a))),r(Ya(i))}}}function MV(e){return e.addReducers({configuration:ve,attachedResults:co}),!0}d();c();l();u();function oI(e,t){if(!jV(e))throw oe;let{dispatch:r}=e,n=fe(e),{caseId:o}=t.options,i=p=>te(o)||te(p.raw.permanentid)&&te(p.raw.urihash)?!1:e.state.attachedResults.results.some(f=>{let m=o===f.caseId,g=!te(f.permanentId)&&f.permanentId===p.raw.permanentid,S=!te(f.uriHash)&&f.uriHash===p.raw.urihash;return m&&(g||S)}),a=()=>e.state.attachedResults.results.filter(p=>p.caseId===o);return{...n,get state(){return{results:a(),loading:e.state.attachedResults.loading}},isAttached(p){return i(p)},attach(p){r(ao(Ka(p,o))),r(Wa(p))},detach(p){r(so(Ka(p,o))),r(Ya(p))}}}function jV(e){return e.addReducers({configuration:ve,attachedResults:co}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var ge=G;d();c();l();u();var VV={state:new Be({required:!0}),numberOfResults:new ne({required:!0,min:0}),value:new L({required:!0,emptyAllowed:!0}),path:new re({required:!0,each:G}),moreValuesAvailable:new ue({required:!1})};function uS(e){e.children.forEach(t=>{uS(t)}),ur({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},VV)}var Ja={facetId:ge,field:G,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),delimitingCharacter:new L({required:!1,emptyAllowed:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),basePath:new re({required:!1,each:G}),filterByBasePath:new ue({required:!1})};var Xa=T("categoryFacet/register",e=>_(e,Ja)),Za=T("categoryFacet/toggleSelectValue",e=>{try{return ur(e.facetId,G),uS(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),uo=T("categoryFacet/deselectAll",e=>_(e,Ja.facetId)),Uc=T("categoryFacet/updateNumberOfValues",e=>_(e,{facetId:Ja.facetId,numberOfValues:Ja.numberOfValues})),jp=T("categoryFacet/updateSortCriterion",e=>_(e,{facetId:Ja.facetId,criterion:new Be})),iI=T("categoryFacet/updateBasePath",e=>_(e,{facetId:Ja.facetId,basePath:new re({each:G})}));d();c();l();u();var rwe={categoryFacetId:ge,categoryFacetPath:new re({required:!0,each:G})};var aI=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();var LV={categoryFacetId:ge,categoryFacetPath:new re({required:!0,each:G})},UV=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,i=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:i}},Vp=e=>Z("breadcrumbFacet")("analytics/categoryFacet/breadcrumb",(t,r)=>{_(e,LV);let n={...UV(r,e),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();d();c();l();u();var Qe=T("facetOptions/update",(e={freezeFacetOrder:!0})=>_(e,{freezeFacetOrder:new ue({required:!1})})),er=T("facetOptions/facet/enable",e=>_(e,ge)),dt=T("facetOptions/facet/disable",e=>_(e,ge));d();c();l();u();var tr=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var Qc={facetId:ge,captions:new W({options:{required:!1}}),numberOfValues:new ne({required:!1,min:1}),query:new L({required:!1,emptyAllowed:!0})};var QV={path:new re({required:!0,each:G}),displayValue:Ye,rawValue:Ye,count:new ne({required:!0,min:0})},Lp=T("categoryFacet/selectSearchResult",e=>_(e,{facetId:ge,value:new W({values:QV})})),sI=T("categoryFacetSearch/register",e=>_(e,Qc));d();c();l();u();function es(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function ts(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Up(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Bc(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Qp(e,t,r){e.currentValues=BV(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function BV(e,t){if(!e.length)return[];let r=cI(e[0],t),n=r;for(let o of e.splice(1)){let i=cI(o,t);n.children.push(i),n=i}return n.state="selected",n.retrieveChildren=!0,[r]}function cI(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var Bp=ce(ea(),e=>{e.addCase(Xa,(t,r)=>{let n=r.payload,{facetId:o,tabs:i}=n;if(o in t)return;let a=$V(n),p=a.numberOfValues;t[o]={request:a,initialNumberOfValues:p,tabs:i}}).addCase(Ze.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(tt,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(i=>{let a=t[i],p=a.request;if((a.tabs?.included?.length||a.tabs?.excluded?.length)&&!tr(a.tabs,o)){p.currentValues.length&&Qp(p,[],a.initialNumberOfValues);return}let m=n[i]||[];(m.length||p.currentValues.length)&&Qp(p,m,a.initialNumberOfValues)})}).addCase(jp,(t,r)=>{let{facetId:n,criterion:o}=r.payload,i=t[n]?.request;i&&(i.sortCriteria=o)}).addCase(iI,(t,r)=>{let{facetId:n,basePath:o}=r.payload,i=t[n]?.request;i&&(i.basePath=[...o])}).addCase(Za,(t,r)=>{let{facetId:n,selection:o,retrieveCount:i}=r.payload,a=t[n]?.request;if(!a)return;let{path:p}=o,f=p.slice(0,p.length-1),m=GV(a,f,i);if(m.length){let S=m[0];S.retrieveChildren=!0,S.state="selected",S.previousState="idle",S.children=[];return}let g=lI(o.value,i);g.state="selected",g.previousState="idle",m.push(g),a.numberOfValues=1}).addCase(uo,(t,r)=>{let n=r.payload;Bc(t,n)}).addCase(Kt,t=>{Object.keys(t).forEach(r=>Bc(t,r))}).addCase(fa,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(Uc,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,i=t[n]?.request;if(i){if(!i.currentValues.length)return Up(i,o);HV(t,r.payload)}}).addCase(Lp,(t,r)=>{let{facetId:n,value:o}=r.payload,i=t[n];if(!i)return;let a=[...o.path,o.rawValue];Qp(i.request,a,i.initialNumberOfValues)}).addCase(Sa.fulfilled,(t,r)=>{uI(t,r.payload.response.facets)}).addCase(Fe.fulfilled,(t,r)=>{uI(t,r.payload.response.facets)}).addCase(dt,(t,r)=>{Bc(t,r.payload)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&Bc(t,o)})})}),lS={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function GV(e,t,r){let n=e.currentValues;for(let o of t){let i=n[0];(!i||o!==i.value)&&(i=lI(o,r),n.length=0,n.push(i)),i.retrieveChildren=!1,i.previousState=void 0,i.state="idle",n=i.children}return n}function $V(e){return{...lS,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function lI(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function uI(e,t){t.forEach(r=>{if(!zV(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let i=WV(o,r);o.currentValues=i?[]:o.currentValues,o.preventAutoSelect=!1})}function HV(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function zV(e,t){return t.facetId in e}function WV(e,t){let r=Dr(e.currentValues),n=Dr(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var Xr=new L({regex:/^[a-zA-Z0-9-_]+$/}),Zr=new L({required:!0}),dI=new re({each:new L}),pI=new L,fI=new ue,en=new ue,tn=new ne({min:0}),Tr=new ne({min:1}),Gp=new ue({required:!0}),YV=new W,KV=new L,JV={captions:YV,numberOfValues:Tr,query:KV},rs=new W({values:JV}),$p=new W({options:{required:!1},values:{type:new L({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new re({required:!0,max:25,each:new L({emptyAllowed:!1,required:!0})})}}),EIe=new ue,Hp=new re({min:1,max:25,required:!1,each:new L({emptyAllowed:!1,required:!0})});d();c();l();u();var Si={value:G,numberOfResults:new ne({min:0}),state:G};var XV={facetId:ge,field:new L({required:!0,emptyAllowed:!0}),tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),resultsMustMatch:new Be({required:!1}),allowedValues:$p,customSort:Hp},ns=T("facet/register",e=>_(e,XV)),lo=T("facet/toggleSelectValue",e=>_(e,{facetId:ge,selection:new W({values:Si})})),po=T("facet/toggleExcludeValue",e=>_(e,{facetId:ge,selection:new W({values:Si})})),ht=T("facet/deselectAll",e=>_(e,ge)),zp=T("facet/updateSortCriterion",e=>_(e,{facetId:ge,criterion:new Be({required:!0})})),Gc=T("facet/updateNumberOfValues",e=>_(e,{facetId:ge,numberOfValues:new ne({required:!0,min:1})})),$c=T("facet/updateIsFieldExpanded",e=>_(e,{facetId:ge,isFieldExpanded:new ue({required:!0})})),vi=T("facet/updateFreezeCurrentValues",e=>_(e,{facetId:ge,freezeCurrentValues:new ue({required:!0})}));d();c();l();u();var os=e=>$e("analytics/facet/unexclude",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n=Wt(r),o=oa(e,n);return t.makeFacetUnexclude(o)});var rr=()=>({actionCause:"facetClearAll"}),sr=()=>({actionCause:"facetSelect"}),Wp=()=>({actionCause:"facetExclude"}),Fn=()=>({actionCause:"facetDeselect"});var dS=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();var is=e=>Z("showMoreFacetResults")("analytics/facet/showMore",(t,r)=>{_(e,ge);let n={...No(e,Wt(r)),...J(r.insightCaseContext)};return t.logFacetShowMore(n)}),as=e=>Z("showLessFacetResults")("analytics/facet/showLess",(t,r)=>{_(e,ge);let n={...No(e,Wt(r)),...J(r.insightCaseContext)};return t.logFacetShowLess(n)}),rn=e=>Z("facetUpdateSort")("analytics/facet/sortChange",(t,r)=>{_(e,{facetId:ge,sortCriterion:new Be({required:!0})});let{facetId:n,sortCriterion:o}=e,i=Wt(r),p={...No(n,i),criteria:o,...J(r.insightCaseContext)};return t.logFacetUpdateSort(p)}),Dt=e=>Z("facetClearAll")("analytics/facet/reset",(t,r)=>{_(e,ge);let n=Wt(r),o={...No(e,n),...J(r.insightCaseContext)};return t.logFacetClearAll(o)}),Bt=e=>Z("facetSelect")("analytics/facet/select",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n=Wt(r),o={...oa(e,n),...J(r.insightCaseContext)};return t.logFacetSelect(o)}),Pr=e=>Z("facetDeselect")("analytics/facet/deselect",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n=Wt(r),o={...oa(e,n),...J(r.insightCaseContext)};return t.logFacetDeselect(o)}),Hc=e=>Z("breadcrumbFacet")("analytics/facet/breadcrumb",(t,r)=>{_(e,{facetId:ge,facetValue:G});let n={...oa(e,Wt(r)),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();d();c();l();u();var mI={facetId:ge,value:new W({values:{displayValue:Ye,rawValue:Ye,count:new ne({required:!0,min:0})}})},gI=T("facetSearch/register",e=>_(e,Qc)),Yp=T("facetSearch/update",e=>_(e,Qc)),Kp=T("facetSearch/toggleSelectValue",e=>_(e,mI)),Jp=T("facetSearch/toggleExcludeValue",e=>_(e,mI));var ss=ce(na(),e=>{e.addCase(ns,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=FC(ZV(r.payload),o))}).addCase(Ze.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(tt,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(a=>{let{request:p}=t[a],f=n[a]||[],m=o[a]||[],g=f.length+m.length,S=p.currentValues.filter(b=>!f.includes(b.value)&&!m.includes(b.value));p.currentValues=[...f.map(yI),...m.map(SI),...S.map(tL)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(lo,(t,r)=>{let{facetId:n,selection:o}=r.payload,i=t[n]?.request;if(!i)return;i.preventAutoSelect=!0;let a=i.currentValues.find(f=>f.value===o.value);if(!a){Xp(i,o);return}let p=a.state==="selected";a.previousState=a.state,a.state=p?"idle":"selected",i.freezeCurrentValues=!0}).addCase(po,(t,r)=>{let{facetId:n,selection:o}=r.payload,i=t[n]?.request;if(!i)return;i.preventAutoSelect=!0;let a=i.currentValues.find(f=>f.value===o.value);if(!a){Xp(i,o);return}let p=a.state==="excluded";a.previousState=a.state,a.state=p?"idle":"excluded",i.freezeCurrentValues=!0}).addCase(vi,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,i=t[n]?.request;i&&(i.freezeCurrentValues=o)}).addCase(ht,(t,r)=>{ts(t[r.payload]?.request)}).addCase(Kt,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>ts(r))}).addCase(Ol,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>ts(r))}).addCase(fa,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(zp,(t,r)=>{es(t,r.payload)}).addCase(Gc,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;Up(t[n]?.request,o)}).addCase($c,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,i=t[n]?.request;i&&(i.isFieldExpanded=o)}).addCase(Fe.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>hI(t[o.facetId]?.request,o))}).addCase(Sa.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>hI(t[o.facetId]?.request,o))}).addCase(Kp,(t,r)=>{let{facetId:n,value:o}=r.payload,i=t[n]?.request;if(!i)return;let{rawValue:a}=o,{currentValues:p}=i,f=p.find(g=>g.value===a);if(f){f.state="selected";return}let m=yI(a);Xp(i,m),i.freezeCurrentValues=!0,i.preventAutoSelect=!0}).addCase(Jp,(t,r)=>{let{facetId:n,value:o}=r.payload,i=t[n]?.request;if(!i)return;let{rawValue:a}=o,{currentValues:p}=i,f=p.find(g=>g.value===a);if(f){f.state="excluded";return}let m=SI(a);Xp(i,m),i.freezeCurrentValues=!0,i.preventAutoSelect=!0}).addCase(dt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];ts(n)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&ts(i.request)})})});function Xp(e,t){let{currentValues:r}=e,n=r.findIndex(i=>i.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function hI(e,t){e&&(e.currentValues=t.values.map(eL),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var pS={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function ZV(e){return{...pS,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function eL(e){let{value:t,state:r}=e;return{value:t,state:r}}function yI(e){return{value:e,state:"selected"}}function SI(e){return{value:e,state:"excluded"}}function tL(e){return{...e,state:"idle"}}d();c();l();u();var Zp=()=>Z("breadcrumbResetAll")("analytics/facet/deselectAllBreadcrumbs",(e,t)=>e.logBreadcrumbResetAll(J(t.insightCaseContext)));d();c();l();u();d();c();l();u();function cs(e){let t=vI(e.start,e),r=vI(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function vI(e,t){let{dateFormat:r}=t;return Fv(e)?(vu(e),wv(e)):typeof e=="string"&&_n(e)?(vu(e),e):(Cv(e,r),Su(qi(e,r)))}d();c();l();u();var us=T("rangeFacet/updateSortCriterion",e=>_(e,{facetId:ge,criterion:new Be({required:!0})}));d();c();l();u();var Ai={state:G,start:new ne({required:!0}),end:new ne({required:!0}),endInclusive:new ue({required:!0}),numberOfResults:new ne({required:!0,min:0})},Ci={start:G,end:G,endInclusive:new ue({required:!0}),state:G,numberOfResults:new ne({required:!0,min:0})},Tn=e=>({facetId:ge,selection:typeof e.start=="string"?new W({values:Ci}):new W({values:Ai})});var rL={start:G,end:G,endInclusive:new ue({required:!0}),state:G},nL={facetId:ge,field:G,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),currentValues:new re({required:!1,each:new W({values:rL})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function AI(e){return _n(e)?$s(e):e}function ef(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=cs(t);if(qi(AI(r)).isAfter(qi(AI(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var nn=T("dateFacet/register",e=>{try{return ur(e,nL),ef(e),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),on=T("dateFacet/toggleSelectValue",e=>_(e,{facetId:ge,selection:new W({values:Ci})})),an=T("dateFacet/toggleExcludeValue",e=>_(e,{facetId:ge,selection:new W({values:Ci})})),Pn=T("dateFacet/updateFacetValues",e=>{try{return ur(e,{facetId:ge,values:new re({each:new W({values:Ci})})}),ef({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),tf=us,rf=ht;d();c();l();u();d();c();l();u();var nf=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,i=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:i,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},of=()=>({actionCause:"breadcrumbFacet"});var fS=of;d();c();l();u();var zc=e=>Z("breadcrumbFacet")("analytics/dateFacet/breadcrumb",(t,r)=>{_(e,Tn(e.selection));let n={...nf(r,e),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();function oL(e,t){return!!t&&t.facetId in e.dateFacetSet}var CI=(e,t)=>{let r=vn(e,t);if(oL(e,r))return r},bI=(e,t)=>(CI(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),xI=(e,t)=>(CI(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var sf={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function cf(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=RI(r);r.numberOfValues=o,e[n]=t}function uf(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=RI(n))}function lf(e,t,r){let n=e[t]?.request;if(!n)return;let o=af(n.currentValues,r);if(!o)return;let i=o.state==="selected";o.previousState=o.state,o.state=i?"idle":"selected",n.preventAutoSelect=!0}function df(e,t,r){let n=e[t]?.request;if(!n)return;let o=af(n.currentValues,r);if(!o)return;let i=o.state==="excluded";o.previousState=o.state,o.state=i?"idle":"excluded",n.preventAutoSelect=!0}function sn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function pf(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(af(o,p)&&(p.state="selected"),p));let i=o.filter(p=>!af(n.currentValues,p)),a=n.currentValues;a.push(...i),n.numberOfValues=Math.max(n.numberOfValues,a.length)})}function ff(e,t,r){t.forEach(n=>{let o=n.facetId,i=e[o]?.request;if(!i)return;let a=r(n.values);i.currentValues=a,i.preventAutoSelect=!1})}function af(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function RI(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var cn=ce(ta(),e=>{e.addCase(nn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,i=iL(n);cf(t,IC(i,o))}).addCase(Ze.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(tt,(t,r)=>{let n=r.payload.df||{};pf(t,n)}).addCase(on,(t,r)=>{let{facetId:n,selection:o}=r.payload;lf(t,n,o)}).addCase(an,(t,r)=>{let{facetId:n,selection:o}=r.payload;df(t,n,o)}).addCase(Pn,(t,r)=>{let{facetId:n,values:o}=r.payload;uf(t,n,o)}).addCase(rf,(t,r)=>{sn(t,r.payload)}).addCase(Kt,t=>{Object.keys(t).forEach(r=>{sn(t,r)})}).addCase(tf,(t,r)=>{es(t,r.payload)}).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.response.facets;ff(t,n,aL)}).addCase(dt,(t,r)=>{sn(t,r.payload)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&sn(t,o)})})});function iL(e){return{...sf,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function aL(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var sL={state:G,start:new ne({required:!0}),end:new ne({required:!0}),endInclusive:new ue({required:!0})},cL={facetId:ge,field:G,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),activeTab:new L({required:!1}),currentValues:new re({required:!1,each:new W({values:sL})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function mf(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var un=T("numericFacet/register",e=>{try{return _(e,cL),mf(e),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),ln=T("numericFacet/toggleSelectValue",e=>_(e,{facetId:ge,selection:new W({values:Ai})})),dn=T("numericFacet/toggleExcludeValue",e=>_(e,{facetId:ge,selection:new W({values:Ai})})),kn=T("numericFacet/updateFacetValues",e=>{try{return ur(e,{facetId:ge,values:new re({each:new W({values:Ai})})}),mf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:br(t)}}}),gf=us,hf=ht;d();c();l();u();var mS=of;d();c();l();u();d();c();l();u();var wI=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,i=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:i,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}};var Wc=e=>Z("breadcrumbFacet")("analytics/numericFacet/breadcrumb",(t,r)=>{_(e,Tn(e.selection));let n={...wI(r,e),...J(r.insightCaseContext)};return t.logBreadcrumbFacet(n)});d();c();l();u();function uL(e,t){return!!t&&t.facetId in e.numericFacetSet}var II=(e,t)=>{let r=vn(e,t);if(uL(e,r))return r},EI=(e,t)=>(II(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),FI=(e,t)=>(II(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var fo=ce(ra(),e=>{e.addCase(un,(t,r)=>{let{payload:n}=r,{tabs:o}=n,i=lL(n);cf(t,EC(i,o))}).addCase(Ze.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(tt,(t,r)=>{let n=r.payload.nf||{};pf(t,n)}).addCase(ln,(t,r)=>{let{facetId:n,selection:o}=r.payload;lf(t,n,o)}).addCase(dn,(t,r)=>{let{facetId:n,selection:o}=r.payload;df(t,n,o)}).addCase(kn,(t,r)=>{let{facetId:n,values:o}=r.payload;uf(t,n,o)}).addCase(hf,(t,r)=>{sn(t,r.payload)}).addCase(Kt,t=>{Object.keys(t).forEach(r=>{sn(t,r)})}).addCase(gf,(t,r)=>{es(t,r.payload)}).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.response.facets;ff(t,n,dL)}).addCase(dt,(t,r)=>{sn(t,r.payload)}).addCase(Tt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let i=t[o];(i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,n)&&sn(t,o)})})});function lL(e){return{...sf,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function dL(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var Yc=G,yf=new W({options:{required:!0},values:{caption:Ye,expression:Ye,state:new L({constrainTo:["idle","selected","excluded"]})}}),TI=new re({required:!0,each:yf});var oke=T("staticFilter/register",e=>_(e,{id:Yc,values:TI})),PI=T("staticFilter/toggleSelect",e=>_(e,{id:Yc,value:yf})),kI=T("staticFilter/toggleExclude",e=>_(e,{id:Yc,value:yf})),ike=T("staticFilter/deselectAllFilterValues",e=>_(e,Yc));d();c();l();u();var Sf=e=>Z("staticFilterDeselect")("analytics/staticFilter/deselect",(t,r)=>t.logStaticFilterDeselect({...e,...J(r.insightCaseContext)}));d();c();l();u();var vf=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function OI(e){let t=fe(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(Kt())},deselectBreadcrumb(n){n.deselect()}}}function _I(e){if(!pL(e))throw oe;let t=OI(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let h={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:A,selection:w})=>{let R=Hc({facetId:A,facetValue:w.value});r(lo({facetId:A,selection:w})),r(vi({facetId:A,freezeCurrentValues:!1})),r(Se({legacy:R,next:dS()}))},executeToggleExclude:({facetId:A,selection:w})=>{let R=Hc({facetId:A,facetValue:w.value});r(po({facetId:A,selection:w})),r(vi({facetId:A,freezeCurrentValues:!1})),r(Se({legacy:R,next:dS()}))},facetValuesSelector:xC};return vf(h)},i=()=>{let h={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:A=>{r(ln(A)),r(Se({legacy:Wc(A),next:mS()}))},executeToggleExclude:A=>{r(dn(A)),r(Se({legacy:Wc(A),next:mS()}))},facetValuesSelector:EI};return vf(h)},a=()=>{let h={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:A=>{r(on(A)),r(Se({legacy:zc(A),next:fS()}))},executeToggleExclude:A=>{r(an(A)),r(Se({legacy:zc(A),next:fS()}))},facetValuesSelector:xI};return vf(h)},p=h=>{let A=wC(n(),h);return{facetId:h,field:n().categoryFacetSet[h].request.field,path:A,deselect:()=>{r(uo(h)),r(Se({legacy:Vp({categoryFacetPath:A.map(w=>w.value),categoryFacetId:h}),next:aI()}))}}},f=()=>Object.keys(n().categoryFacetSet).map(p).filter(h=>h.path.length),m=()=>{let h=n().staticFilterSet||{};return Object.values(h).map(g)},g=h=>{let{id:A,values:w}=h,R=w.filter(x=>x.state!=="idle").map(x=>S(A,x));return{id:A,values:R}},S=(h,A)=>({value:A,deselect:()=>{let{caption:w,expression:R}=A,x=Sf({staticFilterId:h,staticFilterValue:{caption:w,expression:R}});A.state==="selected"?r(PI({id:h,value:A})):A.state==="excluded"&&r(kI({id:h,value:A})),r(Se({legacy:x}))}});function b(){return!![...o(),...i(),...a(),...f(),...m()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:f(),numericFacetBreadcrumbs:i(),dateFacetBreadcrumbs:a(),staticFilterBreadcrumbs:m(),hasBreadcrumbs:b()}},deselectAll:()=>{t.deselectAll(),r(Se({legacy:Zp(),next:{actionCause:"breadcrumbResetAll"}}))}}}function pL(e){return e.addReducers({configuration:ve,search:xe,facetSet:ss,numericFacetSet:fo,dateFacetSet:cn,categoryFacetSet:Bp}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var NI=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var Af=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),qI=()=>({correctedQuery:"",corrections:[],originalQuery:""});function DI(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:Af(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var MI=(e,t)=>{let r={...qI(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var jI=ce(DI(),e=>{e.addCase(vl,t=>{t.enableDidYouMean=!0}).addCase(pb,t=>{t.enableDidYouMean=!1}).addCase(fb,t=>{t.automaticallyCorrectQuery=!0}).addCase(Al,t=>{t.automaticallyCorrectQuery=!1}).addCase(Fe.pending,t=>{t.queryCorrection=Af(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(Fe.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let i=o?.[0]?o[0]:Af();t.queryCorrection=i}t.queryCorrectionMode==="next"&&MI(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(Yt,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(hc,(t,r)=>{t.queryCorrectionMode=r.payload})});function VI(e,t={}){if(!fL(e))throw oe;let r=fe(e),{dispatch:n}=e;n(vl()),t.options?.automaticallyCorrectQuery===!1&&n(Al()),n(hc(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,i=()=>NI(o().didYouMean);return{...r,get state(){let a=o();return{originalQuery:a.didYouMean.originalQuery,wasCorrectedTo:a.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:a.didYouMean.wasAutomaticallyCorrected,queryCorrection:a.didYouMean.queryCorrection,hasQueryCorrection:i()}},applyCorrection(){n(Yt(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(a){n(hc(a))}}}function fL(e){return e.addReducers({configuration:ve,didYouMean:jI}),!0}var LI={automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"};function UI(e,t={options:LI}){let r={...LI,...t.options},n=VI(e,{options:r}),{dispatch:o}=e;return{...n,get state(){return n.state},applyCorrection(){n.applyCorrection(),o(Se({legacy:Cb(),next:Tb()}))}}}d();c();l();u();d();c();l();u();d();c();l();u();var Mt=ce(xl(),e=>{e.addCase(Qe,(t,r)=>({...t,...r.payload})).addCase(Fe.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(Fe.rejected,t=>{t.freezeFacetOrder=!1}).addCase(Ze.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(Xa,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Cf(o,t,n)}).addCase(ns,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Cf(o,t,n)}).addCase(nn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Cf(o,t,n)}).addCase(un,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Cf(o,t,n)}).addCase(er,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(dt,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(tt,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=Fh()),t.facets[n].enabled=!0})})});function Cf(e,t,r){let n={...Fh(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var bf=ce(wl(),e=>{e.addCase(Sd,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(Tt,(t,r)=>{let n=r.payload;QI(t,n)}).addCase(yd,(t,r)=>{let n=r.payload;QI(t,n)}).addCase(Ze.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(tt,(t,r)=>{let n=r.payload.tab;te(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function QI(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function BI(e){if(!mL(e))throw oe;let t=fe(e),r=ot(n=>n.tabSet,n=>Object.values(n).find(i=>i.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function mL(e){return e.addReducers({tabSet:bf}),!0}function GI(e,t){if(!gL(e))throw oe;let r=BI(e),n=A=>e.state.facetOptions.facets[A]?.enabled??!1,o=A=>e.state.facetSet?.[A]?.request?.currentValues??e.state.categoryFacetSet?.[A]?.request?.currentValues??e.state.numericFacetSet?.[A]?.request?.currentValues??e.state.dateFacetSet?.[A]?.request?.currentValues??null,i=A=>A in e.state.facetOptions.facets,a=A=>e.state.facetOptions.facets[A]?.tabs,p=()=>Oi({isFacetRegistered:i(t.facetId),parentFacets:t.conditions.map(({parentFacetId:A})=>i(A)?{enabled:n(A),values:o(A)}:null),isTabEnabled:tr(a(t.facetId),r.state.activeTab)}),f=()=>{let A=p();return A===b?!1:(b=A,!0)},m=()=>t.conditions.length>0?t.conditions.some(A=>{if(!n(A.parentFacetId))return!1;let w=o(A.parentFacetId);return w===null?!1:A.condition(w)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([A,w])=>w.request.freezeCurrentValues&&e.dispatch(vi({facetId:A,freezeCurrentValues:!1})))},S=()=>{if(!i(t.facetId))return;let A=n(t.facetId),w=m(),R=tr(a(t.facetId),r.state.activeTab),x=w&&R;A!==x&&(e.dispatch(x?er(t.facetId):dt(t.facetId)),g())},b=p(),h=e.subscribe(()=>{f()&&S()});return S(),{stopWatching(){h()}}}function gL(e){return e.addReducers({facetOptions:Mt}),!0}function $I(e,t){return GI(e,t)}d();c();l();u();d();c();l();u();function HI(e){if(!hL(e))throw oe;let t=fe(e),r=()=>e.state;return{...t,sort(n){return Sc(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(i=>i.facetId)}}}}function hL(e){return e.addReducers({search:xe,facetOptions:Mt}),!0}function zI(e){return HI(e)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function xf(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,i={...ls,...t},a=r();e[n]={options:i,isLoading:o,response:a,initialNumberOfValues:i.numberOfValues,requestId:""}}function Rf(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function wf(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function If(e,t){let r=e[t];r&&(r.isLoading=!1)}function Ef(e,t,r){let{facetId:n,response:o}=t,i=e[n];i&&i.requestId===r&&(i.isLoading=!1,i.response=o)}function Kc(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=ls.query)}function Ff(e,t){Object.keys(e).forEach(r=>Kc(e,{facetId:r},t))}var ls={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var WI=/*#__PURE__*/function(){var _ref90=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,i=t.categoryFacetSet[e].request,{captions:a,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:g,basePath:S,filterFacetCount:b}=i,h=yL(i),A=h.length?[h]:[],w=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??$t(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:S,captions:a,numberOfValues:f,query:w,field:m,delimitingCharacter:g,ignorePaths:A,filterFacetCount:b,type:"hierarchical",...(n?{}:{searchContext:(yield mr(t,r)).request})}});return function WI(_x210,_x211,_x212,_x213){return _ref90.apply(this,arguments)}}(),yL=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var YI=/*#__PURE__*/function(){var _ref91=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:i,numberOfValues:a}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(b=>b.state!=="idle").map(b=>b.value),S=`*${i}*`;return{url:t.configuration.search.apiBaseUrl??$t(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:a,query:S,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield mr(t,r)).request})}});return function YI(_x214,_x215,_x216,_x217){return _ref91.apply(this,arguments)}}();var KI=e=>(/*#__PURE__*/function(){var _ref92=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:i}}){let a=r(),p;o(t,G),SL(a,t)?p=yield YI(t,a,i,e):p=yield WI(t,a,i,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x218,_x219){return _ref92.apply(this,arguments)}}()),mo=le("facetSearch/executeSearch",KI(!1)),MNe=le("facetSearch/executeSearch",KI(!0)),Tf=T("facetSearch/clearResults",e=>_(e,{facetId:ge})),SL=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function JI(){return{}}var XI=ce(JI(),e=>{e.addCase(sI,(t,r)=>{let n=r.payload;xf(t,n,gS)}).addCase(Yp,(t,r)=>{Rf(t,r.payload)}).addCase(mo.pending,(t,r)=>{let n=r.meta.arg;wf(t,n,r.meta.requestId)}).addCase(mo.rejected,(t,r)=>{let n=r.meta.arg;If(t,n)}).addCase(mo.fulfilled,(t,r)=>{Ef(t,r.payload,r.meta.requestId)}).addCase(Tf,(t,{payload:{facetId:r}})=>{Kc(t,{facetId:r},gS)}).addCase(Fe.fulfilled,t=>{Ff(t,gS)})});function gS(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();function ZI(e,t){let{field:r,state:n}=e;if(!vL(e))return r;let o=`${r}_`,i=AL(o,n);return bL(r,t),`${o}${i}`}function vL(e){let{field:t,state:r}=e;return eE(r).some(o=>o&&t in o)}function AL(e,t){let n=eE(t).map(o=>Object.keys(o||{})).reduce((o,i)=>o.concat(i),[]);return CL(n,e)+1}function eE(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function CL(e,t){return e.map(i=>{let a=i.split(t)[1],p=parseInt(a,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function bL(e,t){let r=`A facet with field "${e}" already exists.
|
|
45
|
+
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function vr(e,t){let{state:r,logger:n}=e,{field:o,facetId:i}=t;return i||ZI({field:o,state:r},n)}d();c();l();u();d();c();l();u();var tE=["alphanumeric","occurrences"];var rE=new Ee({field:Zr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),basePath:dI,delimitingCharacter:pI,facetId:Xr,facetSearch:rs,filterByBasePath:fI,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,sortCriteria:new L({constrainTo:tE})});function nE(e,t){if(!xL(e))throw oe;let r=fe(e),{dispatch:n}=e,o=vr(e,t.options),i=t.options.tabs??{},a=Qt(e.state.tabSet),p={...lS,...pu("facetSearch",t.options),field:t.options.field,facetId:o,tabs:i,activeTab:a},f={facetSearch:{...ls,...t.options.facetSearch},...p};mt(e,rE,f,"buildCategoryFacet");let m=()=>ph(e.state,o),g=()=>dh(e.state,o),S=()=>qr(e.state),b=()=>Gr(e.state,o);return n(Xa(p)),{...r,toggleSelect(h){let A=f.numberOfValues;n(Za({facetId:o,selection:h,retrieveCount:A})),n(Qe())},deselectAll(){n(uo(o)),n(Qe())},sortBy(h){n(jp({facetId:o,criterion:h})),n(Qe())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:A,valuesAsTrees:w}=this.state,R=(A?.children.length??w.length)+h;n(Uc({facetId:o,numberOfValues:R})),n(Qe())},showLessValues(){let{numberOfValues:h}=f;n(Uc({facetId:o,numberOfValues:h})),n(Qe())},enable(){n(er(o))},disable(){n(dt(o))},get state(){let h=m(),A=g(),w=S(),R=b(),x=A?.values??[],I=x.some(U=>U.children.length>0)??!1,{parents:F,values:P}=RC(A?.values),j=Dr(x),q=j.length?j[j.length-1]:void 0,k=!!q,N=q?.moreValuesAvailable??A?.moreValuesAvailable??!1,M=q?q.children.length>f.numberOfValues:x.length>f.numberOfValues;return{facetId:o,parents:F,selectedValueAncestry:j,values:P,isHierarchical:I,valuesAsTrees:x,activeValue:q,isLoading:w,hasActiveValues:k,canShowMoreValues:N,canShowLessValues:M,sortCriteria:h.sortCriteria,enabled:R}}}}function xL(e){return e.addReducers({categoryFacetSet:Bp,categoryFacetSearchSet:XI,facetOptions:Mt,configuration:ve,search:xe}),!0}function oE(e,t){let r=nE(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a={updateText(){},showMoreResults(){},search(){},clear(){},updateCaptions(){},select(){},singleSelect(){},get state(){return{values:[],isLoading:!1,moreValuesAvailable:!1,query:""}}},{state:p,...f}=a;return{...r,facetSearch:f,toggleSelect(m){r.toggleSelect(m);let g=RL(o(),m);n(Se({legacy:g,next:wL(m)}))},deselectAll(){r.deselectAll(),n(Se({legacy:Dt(o()),next:rr()}))},sortBy(m){r.sortBy(m),n(Se({legacy:rn({facetId:o(),sortCriterion:m})}))},isSortedBy(m){return r.isSortedBy(m)},showMoreValues(){r.showMoreValues(),n(pa({legacy:is(o())}))},showLessValues(){r.showLessValues(),n(pa({legacy:as(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function RL(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Pr(r):Bt(r)}function wL(e){return e.state==="selected"?Fn():sr()}d();c();l();u();d();c();l();u();d();c();l();u();function iE(){return{}}var Pf=ce(iE(),e=>{e.addCase(gI,(t,r)=>{let n=r.payload;xf(t,n,hS)}).addCase(Yp,(t,r)=>{Rf(t,r.payload)}).addCase(mo.pending,(t,r)=>{let n=r.meta.arg;wf(t,n,r.meta.requestId)}).addCase(mo.rejected,(t,r)=>{let n=r.meta.arg;If(t,n)}).addCase(mo.fulfilled,(t,r)=>{Ef(t,r.payload,r.meta.requestId)}).addCase(Tf,(t,{payload:r})=>{Kc(t,r,hS)}).addCase(Fe.fulfilled,t=>{Ff(t,hS)})});function hS(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();var IL=e=>e.state==="selected",aE=(e,t)=>{let r={facetId:e,facetValue:t.value};return IL(t)?Pr(r):Bt(r)};d();c();l();u();var yS=e=>e.state==="selected",lE=e=>e.state==="excluded";var dE=e=>yS(e)?Fn():sr();d();c();l();u();d();c();l();u();var pE={facetId:ge,selection:new W({values:Si})},fE=le("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},pE),n(lo({facetId:e,selection:t})),n(Qe())}),mE=le("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},pE),n(po({facetId:e,selection:t})),n(Qe())});d();c();l();u();d();c();l();u();var ds=["allValues","atLeastOneValue"];d();c();l();u();var kf=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var gE=new Ee({facetId:Xr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),field:Zr,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,sortCriteria:new L({constrainTo:kf}),resultsMustMatch:new L({constrainTo:ds}),facetSearch:rs});function hE(e,t,r=gE){if(!EL(e))throw oe;let{dispatch:n}=e,o=fe(e),i=vr(e,t.options),a=t.options.tabs??{},p=Qt(e.state.tabSet),f={...pS,...pu("facetSearch",t.options),field:t.options.field,facetId:i,tabs:a,activeTab:p},m={facetSearch:{...ls,...t.options.facetSearch},...f};mt(e,r,m,"buildFacet");let g=()=>bC(e.state,i),S=()=>lh(e.state,i),b=()=>qr(e.state),h=()=>Gr(e.state,i),A=()=>{let{currentValues:R}=g();return R.filter(x=>x.state!=="idle").length},w=()=>{let{currentValues:R}=g(),x=m.numberOfValues,I=!!R.find(F=>F.state==="idle");return x<R.length&&I};return n(ns(f)),{...o,toggleSelect:R=>n(fE({facetId:m.facetId,selection:R})),toggleExclude:R=>n(mE({facetId:m.facetId,selection:R})),toggleSingleSelect:function(R){R.state==="idle"&&n(ht(i)),this.toggleSelect(R)},toggleSingleExclude:function(R){R.state==="idle"&&n(ht(i)),this.toggleExclude(R)},isValueSelected:yS,isValueExcluded:lE,deselectAll(){n(ht(i)),n(Qe())},sortBy(R){n(zp({facetId:i,criterion:R})),n(Qe())},isSortedBy(R){return this.state.sortCriterion===R},showMoreValues(){let R=g().numberOfValues,x=m.numberOfValues,I=x-R%x,F=R+I;n(Gc({facetId:i,numberOfValues:F})),n($c({facetId:i,isFieldExpanded:!0})),n(Qe())},showLessValues(){let R=m.numberOfValues,x=Math.max(R,A());n(Gc({facetId:i,numberOfValues:x})),n($c({facetId:i,isFieldExpanded:!1})),n(Qe())},enable(){n(er(i))},disable(){n(dt(i))},get state(){let R=g(),x=S(),I=b(),F=h(),P;typeof R.sortCriteria=="object"?P=R.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":P=R.sortCriteria;let j=x?x.values:[],q=j.some(M=>M.state!=="idle"),k=x?x.moreValuesAvailable:!1,N=R.resultsMustMatch;return{label:x?.label,facetId:i,tabs:a,values:j,sortCriterion:P,resultsMustMatch:N,isLoading:I,hasActiveValues:q,canShowMoreValues:k,canShowLessValues:w(),enabled:F}}}}function EL(e){return e.addReducers({facetSet:ss,facetOptions:Mt,configuration:ve,facetSearchSet:Pf}),!0}d();c();l();u();var yE=new Ee({facetId:Xr,field:Zr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,sortCriteria:new L({constrainTo:kf}),resultsMustMatch:new L({constrainTo:ds}),facetSearch:rs,allowedValues:$p,customSort:Hp});function SE(e,t){if(!FL(e))throw oe;let{dispatch:r}=e,n=hE(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},yE),o=()=>n.state.facetId,a={updateText(){},showMoreResults(){},search(){},clear(){},updateCaptions(){},select(){},exclude(){},singleSelect(){},singleExclude(){},get state(){return{values:[],isLoading:!1,moreValuesAvailable:!1,query:""}}},{state:p,...f}=a;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(Se({legacy:aE(o(),m),next:dE(m)}))},deselectAll(){n.deselectAll(),r(Se({legacy:Dt(o()),next:rr()}))},sortBy(m){n.sortBy(m),r(Se({legacy:rn({facetId:o(),sortCriterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(pa({legacy:is(o())}))},showLessValues(){n.showLessValues(),r(pa({legacy:as(o())}))},get state(){return{...n.state,facetSearch:a.state}}}}function FL(e){return e.addReducers({facetSet:ss,configuration:ve,facetSearchSet:Pf,search:xe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var Jc=e=>e.state==="selected",vE=e=>e.state==="excluded";var Of=e=>Jc(e)?Fn():sr();var _f=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Jc(t)?Pr(n):Bt(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Nf=T("rangeFacet/executeToggleSelect",e=>_(e,Tn(e.selection))),qf=T("rangeFacet/executeToggleExclude",e=>_(e,Tn(e.selection)));var AE={facetId:ge,selection:new W({values:Ci})},CE=le("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,AE),t(on(e)),t(Nf(e)),t(Qe())}),bE=le("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,AE),t(an(e)),t(qf(e)),t(Qe())});d();c();l();u();function Df(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function Mf(e,t){let{facetId:r,getRequest:n}=t,o=fe(e),i=e.dispatch,a=()=>Gr(e.state,r);return{...o,isValueSelected:Jc,isValueExcluded:vE,deselectAll(){i(ht(r)),i(Qe())},sortBy(p){i(us({facetId:r,criterion:p})),i(Qe())},isSortedBy(p){return this.state.sortCriterion===p},enable(){i(er(r))},disable(){i(dt(r))},get state(){let p=n(),f=vn(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,S=f?f.values:[],b=qr(e.state),h=a(),A=S.some(R=>R.state!=="idle"),w=f?.domain;return{facetId:r,values:S,sortCriterion:m,resultsMustMatch:g,hasActiveValues:A,isLoading:b,enabled:h,domain:w}}}}d();c();l();u();d();c();l();u();var jf=["idle","selected","excluded"];d();c();l();u();var Vf=["ascending","descending"],Lf=["even","equiprobable"];var TL={start:new L,end:new L,endInclusive:new ue,state:new L({constrainTo:jf})},PL=new Ee({facetId:Xr,field:Zr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),generateAutomaticRanges:Gp,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,currentValues:new re({each:new W({values:TL})}),sortCriteria:new L({constrainTo:Vf}),rangeAlgorithm:new L({constrainTo:Lf})});function Uf(e,t){mt(e,PL,t,"buildDateFacet"),ef(t)}function xE(e,t){if(!kL(e))throw oe;Df(t.options,"buildDateFacet");let r=e.dispatch,n=vr(e,t.options),o=t.options.tabs??{},i=Qt(e.state.tabSet),a={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:i};Uf(e,a),r(nn(a));let p=Mf(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(CE({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(ht(n)),this.toggleSelect(f)},toggleExclude:f=>r(bE({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(ht(n)),this.toggleExclude(f)},get state(){return p.state}}}function kL(e){return e.addReducers({configuration:ve,search:xe,dateFacetSet:cn,facetOptions:Mt}),!0}function RE(e,t){let r=xE(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(Se({legacy:Dt(o()),next:rr()}))},sortBy(i){r.sortBy(i),n(Se({legacy:rn({facetId:o(),sortCriterion:i})}))},toggleSelect:i=>{r.toggleSelect(i),n(Se({legacy:_f(o(),i),next:Of(i)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function wE(e,t){if(!OL(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i=vr(e,t.options),a=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:i,tabs:a,activeTab:p};Uf(e,f),n(nn(f));let m=()=>Gr(e.state,i);return{...r,clear:()=>{n(Pn({facetId:i,values:[]})),n(Qe())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},b=Pn({facetId:i,values:[S]});return b.error?!1:(n(b),n(Qe()),!0)},enable(){n(er(i))},disable(){n(dt(i))},get state(){let g=qr(o()),S=m(),b=bI(o(),i),h=b.length?b[0]:void 0;return{facetId:i,isLoading:g,range:h,enabled:S}}}}function OL(e){return e.addReducers({dateFacetSet:cn,facetOptions:Mt,configuration:ve,search:xe}),!0}function IE(e,t){if(!_L(e))throw oe;let r=wE(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(Se({legacy:Dt(o()),next:rr()}))},setRange:i=>{let a=r.setRange(i);return a&&n(Se({legacy:Bt({facetId:o(),facetValue:`${i.start}..${i.end}`}),next:sr()})),a},get state(){return{...r.state}}}}function _L(e){return e.addReducers({dateFacetSet:cn,configuration:ve,search:xe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var EE={facetId:ge,selection:new W({values:Ai})},FE=le("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,EE),t(ln(e)),t(Nf(e)),t(Qe())}),UVe=le("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,EE),t(dn(e)),t(qf(e)),t(Qe())});d();c();l();u();var NL={start:new ne,end:new ne,endInclusive:new ue,state:new L({constrainTo:jf})},qL=new Ee({facetId:Xr,tabs:new W({options:{required:!1},values:{included:new re({each:new L}),excluded:new re({each:new L})}}),field:Zr,generateAutomaticRanges:Gp,filterFacetCount:en,injectionDepth:tn,numberOfValues:Tr,currentValues:new re({each:new W({values:NL})}),sortCriteria:new L({constrainTo:Vf}),resultsMustMatch:new L({constrainTo:ds}),rangeAlgorithm:new L({constrainTo:Lf})});function Qf(e,t){mt(e,qL,t,"buildNumericFacet"),mf(t)}d();c();l();u();function Bf(e){return{endInclusive:!1,state:"idle",...e}}function TE(e,t){if(!DL(e))throw oe;Df(t.options,"buildNumericFacet");let r=e.dispatch,n=vr(e,t.options),o=t.options.tabs??{},i=Qt(e.state.tabSet),a={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:i};Qf(e,a),r(un(a));let p=Mf(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(FE({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(ht(n)),this.toggleSelect(f)},get state(){return p.state}}}function DL(e){return e.addReducers({numericFacetSet:fo,facetOptions:Mt,configuration:ve,search:xe}),!0}function PE(e,t){let r=TE(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(Se({legacy:Dt(o()),next:rr()}))},sortBy(i){r.sortBy(i),n(Se({legacy:rn({facetId:o(),sortCriterion:i})}))},toggleSelect:i=>{r.toggleSelect(i),n(Se({legacy:_f(o(),i),next:Of(i)}))},get state(){return{...r.state}}}}d();c();l();u();d();c();l();u();function kE(e,t){if(!ML(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i=vr(e,t.options),a=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:i,tabs:a,activeTab:p};Qf(e,f),n(un(f));let m=()=>Gr(e.state,i);return{...r,clear:()=>{n(kn({facetId:i,values:[]})),n(Qe())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},b=kn({facetId:i,values:[S]});return b.error?!1:(n(b),n(Qe()),!0)},enable(){n(er(i))},disable(){n(dt(i))},get state(){let g=qr(o()),S=m(),b=FI(o(),i),h=b.length?b[0]:void 0;return{facetId:i,isLoading:g,range:h,enabled:S}}}}function ML(e){return e.addReducers({numericFacetSet:fo,facetOptions:Mt,configuration:ve,search:xe}),!0}function OE(e,t){let r=kE(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(Se({legacy:Dt(o()),next:rr()}))},setRange:i=>{let a=r.setRange(i);return a&&n(Se({legacy:Bt({facetId:o(),facetValue:`${i.start}..${i.end}`}),next:sr()})),a},get state(){return{...r.state}}}}d();c();l();u();d();c();l();u();var jL=e=>Z("showMoreFoldedResults")("analytics/folding/showMore",(t,r)=>(Ft(e),t.logShowMoreFoldedResults(Ke(e,r),Je(e),J(r.insightCaseContext)))),VL=()=>Z("showLessFoldedResults")("analytics/folding/showLess",(e,t)=>e.logShowLessFoldedResults(J(t.insightCaseContext))),_E={logShowMoreFoldedResults:jL,logShowLessFoldedResults:VL};d();c();l();u();d();c();l();u();var Xc={collectionField:new L({emptyAllowed:!1,required:!1}),parentField:new L({emptyAllowed:!1,required:!1}),childField:new L({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ne({min:0,required:!1})},ps=T("folding/register",e=>_(e,Xc)),Gf=le("folding/loadCollection",/*#__PURE__*/function(){var _ref93=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield $n(i):ma(i,o),p=yield n.search({...a,q:LL(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Ge(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x220,_x221){return _ref93.apply(this,arguments)}}());function LL(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}var NE=T("folding/register",e=>_(e,Xc)),$f=le("folding/loadCollection",/*#__PURE__*/function(){var _ref94=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=yield Ab(o,e),p=(yield Ib(n,o,i,{origin:"foldingCollection"})).response;return Ge(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:o.folding.collections[e].result}});return function(_x222,_x223){return _ref94.apply(this,arguments)}}());d();c();l();u();d();c();l();u();d();c();l();u();var Hf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function UL(e,t){return e.raw[t.collection]}function SS(e,t){return e.raw[t.parent]}function Zc(e,t){let r=e.raw[t.child];return lu(r)?r[0]:r}function QL(e,t){return(e||t)!==void 0&&e===t}function DE(e,t,r,n=[]){let o=Zc(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(i=>{let a=Zc(i,r)===Zc(e,r);return SS(i,r)===o&&!a}).map(i=>{let a={...i,searchUid:e.searchUid};return{result:a,children:DE(a,t,r,[...n,o])}}):[]}function BL(e,t){return e.find(r=>{let n=SS(r,t)===void 0,o=QL(SS(r,t),Zc(r,t));return n||o})}function ME(e){return e.parentResult?ME(e.parentResult):e}function GL(e,t,r,n){let o=ul(e),a={...(n??BL(o,t)??ME(e)),searchUid:r},p=DE(a,o,t);return{result:a,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function zf(e,t,r,n){let o={};return e.forEach(i=>{let a=UL(i,t);a&&(!Zc(i,t)&&!i.parentResult||(o[a]=GL(i,t,r,n)))}),o}function qE(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var Wf=ce(Hf(),e=>e.addCase(Fe.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?zf(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Br.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?zf(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Kn.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...zf(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(ps,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Gf.pending,(t,{meta:r})=>{let n=r.arg;qE(t,n).isLoadingMoreResults=!0}).addCase(Gf.rejected,(t,{meta:r})=>{let n=r.arg;qE(t,n).isLoadingMoreResults=!1}).addCase(Gf.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:i}})=>{let a=zf(n,t.fields,i,o);if(!a||!a[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=a[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var eu={id:G},go=T("querySuggest/register",e=>_(e,{...eu,count:new ne({min:0})})),jE=T("querySuggest/unregister",e=>_(e,eu)),ho=T("querySuggest/selectSuggestion",e=>_(e,{...eu,expression:Ye})),yo=T("querySuggest/clear",e=>_(e,eu)),fs=le("querySuggest/fetch",/*#__PURE__*/function(){var _ref95=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:i}}){o(e,eu);let a=e.id,p=yield $L(a,t(),i),f=yield n.querySuggest(p);return Ge(f)?r(f.error):{id:a,q:p.q,...f.success}});return function(_x224,_x225){return _ref95.apply(this,arguments)}}()),$L=/*#__PURE__*/function(){var _ref96=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??$t(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Nt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield Qn(t.configuration.analytics):jo(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function $L(_x226,_x227,_x228){return _ref96.apply(this,arguments)}}();var So=ce(at(),e=>e.addCase(Ut,(t,r)=>({...t,...r.payload})).addCase(Yt,(t,r)=>{t.q=r.payload}).addCase(ho,(t,r)=>{t.q=r.payload.expression}).addCase(Ze.fulfilled,(t,r)=>r.payload?.query??t).addCase(tt,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var vo=T("fields/registerFieldsToInclude",e=>_(e,Ru)),Yf=T("fields/fetchall/enable"),Kf=T("fields/fetchall/disable"),Jf=le("fields/fetchDescription",/*#__PURE__*/function(){var _ref97=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:p,url:f??$t(p,a)});return Ge(m)?n(m.error):m.success.fields});return function(_x229,_x230){return _ref97.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var VE=["author","language","urihash","objecttype","collection","source","permanentid"],HL=[...VE,"date","filetype","parents"],LQe=[...HL,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],LE=()=>({fieldsToInclude:VE,fetchAllFields:!1,fieldsDescription:[]});var ms=ce(LE(),e=>e.addCase(vo,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Yf,t=>{t.fetchAllFields=!0}).addCase(Kf,t=>{t.fetchAllFields=!1}).addCase(Jf.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(ps,(t,{payload:r})=>{let n=Hf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function gs(e){if(!zL(e))throw oe;let t=fe(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:Hl(n)}}}}function zL(e){return e.addReducers({search:xe}),!0}var WL=new Ee({fieldsToInclude:new re({required:!1,each:new L({required:!0,emptyAllowed:!1})})});function Xf(e,t){if(!YL(e))throw oe;let r=fe(e),n=gs(e),{dispatch:o}=e,i=()=>e.state,a=mt(e,WL,t?.options,"buildCoreResultList");a.fieldsToInclude&&o(vo(a.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,S=200,b=!1;return{...r,get state(){let A=i();return{...n.state,results:A.search.results,moreResultsAvailable:p(),searchResponseId:A.search.searchResponseId}},fetchMoreResults:function(){var _ref98=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<S){if(m++,m>=g){f=Date.now(),!b&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),b=!0;return}}else m=0;b=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref98.apply(this,arguments)}}()}}function YL(e){return e.addReducers({search:xe,configuration:ve,fields:ms}),!0}var KL=new Ee(Xc);function UE(e,t,r){if(!JL(e))throw oe;let n=Xf(e,t),{dispatch:o}=e,i=()=>e.state,a=t.options?.folding?mt(e,KL,t.options.folding,"buildFoldedResultList"):{};return o(ps({...a})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return vS(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return vS(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=i();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function JL(e){return e.addReducers({search:xe,configuration:Cd,folding:Wf,query:So}),!0}function vS(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=vS(n.children,t);if(o)return o}}return null}function QE(e,t={}){let r=UE(e,{...t,loadCollectionActionCreator:$f,fetchMoreResultsActionCreator:Pl},_E);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();var XL=()=>Z("retryGeneratedAnswer")("analytics/generatedAnswer/retry",(e,t)=>e.logRetryGeneratedAnswer(J(t.insightCaseContext))),AS=e=>Z("openGeneratedAnswerSource")({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(t,r)=>{let n=Ve(r),o=ia(r,e);return!n||!o?null:t.logGeneratedAnswerCitationClick(ll(o,r),{generativeQuestionAnsweringId:n,citationId:o.id,documentId:dl(o)},J(r.insightCaseContext))},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:t=>{let r=ia(t,e);return{answerId:Ve(t)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:r?.permanentid??"",title:r?.title,url:r?.clickUri}}}}),ZL=(e,t)=>Z("generatedAnswerSourceHover")({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(r,n)=>{let o=Ve(n),i=ia(n,e);return!o||!i?null:r.logGeneratedAnswerSourceHover({generativeQuestionAnsweringId:o,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t},J(n.insightCaseContext))},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:r=>{let n=ia(r,e);return{answerId:Ve(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri},citationHoverTimeInMs:t}}}),eU=()=>Z("likeGeneratedAnswer")({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logLikeGeneratedAnswer({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"like"})}),tU=()=>Z("dislikeGeneratedAnswer")({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logDislikeGeneratedAnswer({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"dislike"})}),rU=e=>Z("generatedAnswerFeedbackSubmit")({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ve(r);return n?t.logGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e},J(r.insightCaseContext)):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ve(t),{helpful:n,readable:o,documented:i,hallucinationFree:a,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:xc(o),documented:xc(i),correctTopic:xc(p),hallucinationFree:xc(a)},additionalNotes:m,correctAnswerUrl:f}}}),nU=e=>Z("generatedAnswerStreamEnd")({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ve(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.logGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o},J(r.insightCaseContext)):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ve(t)??"",answerGenerated:e})});var oU=()=>Z("generatedAnswerShowAnswers")({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"show"})}),iU=()=>Z("generatedAnswerHideAnswers")({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"hide"})}),aU=()=>Z("generatedAnswerExpand")({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerExpand({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"expand"})}),sU=()=>Z("generatedAnswerCollapse")({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerCollapse({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"collapse"})}),cU=()=>Z("generatedAnswerCopyToClipboard")({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(e,t)=>{let r=Ve(t);return r?e.logGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:r},J(t.insightCaseContext)):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ve(e)??"",action:"copyToClipboard"})}),Zf={logCopyGeneratedAnswer:cU,logGeneratedAnswerHideAnswers:iU,logGeneratedAnswerShowAnswers:oU,logGeneratedAnswerStreamEnd:nU,logGeneratedAnswerFeedback:rU,logDislikeGeneratedAnswer:tU,logLikeGeneratedAnswer:eU,logHoverCitation:ZL,logOpenGeneratedAnswerSource:AS,logRetryGeneratedAnswer:XL,logGeneratedAnswerExpand:aU,logGeneratedAnswerCollapse:sU};d();c();l();u();d();c();l();u();d();c();l();u();function em(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var hs=ce(sy(),e=>e.addCase(Ea,(t,{payload:r})=>{t.isVisible=r}).addCase(Rc,(t,{payload:r})=>{t.isEnabled=r}).addCase(ad,(t,{payload:r})=>{t.id=r.id}).addCase(Qo,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(Bo,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=em([...t.citations,...r.citations]),delete t.error}).addCase(Go,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===dg},t.citations=[],delete t.answer}).addCase(rd,t=>{t.liked=!0,t.disliked=!1}).addCase(nd,t=>{t.liked=!1,t.disliked=!0}).addCase(od,t=>{t.feedbackModalOpen=!0}).addCase(sd,t=>{t.feedbackModalOpen=!1}).addCase(Ta,t=>{t.feedbackSubmitted=!0}).addCase(ar,t=>({...sy(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase($r,(t,{payload:r})=>{t.isLoading=r}).addCase(Uo,(t,{payload:r})=>{t.isStreaming=r}).addCase($o,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(cd,(t,{payload:r})=>{t.responseFormat=r}).addCase(ld,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(Ic,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(wc,t=>{t.expanded=!0}).addCase(id,t=>{t.expanded=!1}).addCase(ud,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(Ho,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(uy,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Fa,(t,{payload:r})=>{t.answerId=r}).addCase(td,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(dd,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(pd,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function tm(e,t,r={}){if(!uU(e))throw oe;let{dispatch:n}=e,o=fe(e),i=()=>e.state,a=r.initialState?.isVisible;a!==void 0&&n(Ea(a));let p=r.initialState?.responseFormat;p&&n(cd(p));let f=r.fieldsToIncludeInCitations;return f&&n(ld(f)),r.initialState?.expanded&&n(wc()),{...o,get state(){let g=i().generatedAnswer;return{...g,error:Op(g.error)}},like(g){this.state.liked||(n(rd()),n(t.logLikeGeneratedAnswer(g)))},dislike(g){this.state.disliked||(n(nd()),n(t.logDislikeGeneratedAnswer(g)))},openFeedbackModal(){n(od())},closeFeedbackModal(){n(sd())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(Ta())},logCitationClick(g,S){n(t.logOpenGeneratedAnswerSource(g,S))},logCitationHover(g,S,b){n(t.logHoverCitation(g,S,b))},show(){this.state.isVisible||(n(Ea(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Ea(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(wc()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(id()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(Rc(!0))},disable(){this.state.isEnabled&&n(Rc(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function uU(e){return e.addReducers({generatedAnswer:hs}),!0}var jt={engines:{},setAbortControllerRef:(e,t)=>{jt.engines[t].abortController=e},getIsStreamInProgress:e=>!jt.engines[e].abortController||jt.engines[e].abortController?.signal.aborted?(jt.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,i=r.generatedAnswer.id;if(jt.engines[i].lastRequestId!==n){if(jt.engines[i].lastRequestId=n,jt.engines[i].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(ar())}if(!jt.getIsStreamInProgress(i)&&o&&o!==jt.engines[i].lastStreamId){if(jt.engines[i].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(Ox({setAbortControllerRef:p=>jt.setAbortControllerRef(p,i)}))}};return e.subscribe(t)}};function BE(e,t,r={}){if(!lU(e))throw oe;let n=tm(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!jt.engines[e.state.generatedAnswer.id]&&(jt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let a=uu("genQA-",12);e.dispatch(ad({id:a}))}jt.engines[e.state.generatedAnswer.id]||(jt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),jt.subscribeToSearchRequests(e);let i=a=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in a;return{...n,get state(){return o().generatedAnswer},retry(){i(e)&&e.dispatch(Fe({legacy:t.logRetryGeneratedAnswer()}))}}}function lU(e){return e.addReducers({generatedAnswer:hs}),!0}d();c();l();u();d();c();l();u();var GE=gd.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var rm=e=>e==="yes"?!0:e==="no"?!1:null,dU=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:rm(t.correctTopic),documented:rm(t.documented),hallucinationFree:rm(t.hallucinationFree),readable:rm(t.readable)},helpful:t.helpful,question:r}),pU=e=>{let t="",r=()=>{let n=e.state,o=gx(n),i=o.requestId;i!==t&&(t=i,e.dispatch(ar()),o.q?.length>0&&e.dispatch(fd()))};e.subscribe(r)};function $E(e,t,r={}){if(!fU(e))throw oe;_p(e.state.configuration.analytics.analyticsMode);let{...n}=tm(e,t,r),o=()=>e.state;return e.dispatch(ud(r.answerConfigurationId)),pU(e),{...n,get state(){let i=ly(e.state).data,a=o().generatedAnswer;return{...a,answer:i?.answer,citations:em(i?.citations??[]),error:Op({message:i?.error?.message,code:i?.error?.code}),isLoading:i?.isLoading??!1,isStreaming:i?.isStreaming??!1,answerContentFormat:i?.contentFormat??"text/plain",isAnswerGenerated:i?.generated??!1,cannotAnswer:a.cannotAnswer||i?.generated===!1&&!i?.isLoading&&!i?.isStreaming}},retry(){let i=Jl(o());e.dispatch(md(i??Vo))},reset(){e.dispatch(ar())},sendFeedback(i){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(i));let a=dU({query:o().query.q,feedback:i,answerApiState:ly(e.state).data});e.dispatch(GE.endpoints.post.initiate(a)),e.dispatch(Ta())})()}}}function fU(e){return e.addReducers({[zo.reducerPath]:zo.reducer,query:So}),!0}function HE(e,t={}){let{dispatch:r}=e,n=t.answerConfigurationId?$E(e,Zf,t):BE(e,Zf,t);return{...n,get state(){return n.state},retry(){r(Se({legacy:Zf.logRetryGeneratedAnswer(),next:hx()}))}}}d();c();l();u();d();c();l();u();d();c();l();u();function pn(e,t,r){if(!mU(e))throw oe;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:fu(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function mU(e){return e.addReducers({configuration:ve}),!0}function zE(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return pn(e,r,()=>{o()})}function WE(e,t){return zE(e,{logOpenGeneratedAnswerSource:AS},t)}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var SU=new ne({min:1,default:8,required:!1}),vU=new ne({min:1,max:20,default:5,required:!1}),AU={desiredCount:vU,numberOfValues:SU},$Ge=T("automaticFacet/setOptions",e=>_(e,AU)),HGe=T("automaticFacet/deselectAll",e=>_(e,ge)),CU=G,YE=T("automaticFacet/toggleSelectValue",e=>_(e,{field:CU,selection:new W({values:Si})}));var Ss=ce(Lr(),e=>{e.addCase(Dl,(t,r)=>{let n=CS(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=tu(n,o)}).addCase(Ml,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Tt,t=>{t.firstResult=0}).addCase(jl,(t,r)=>{let n=r.payload;t.firstResult=tu(n,t.numberOfResults)}).addCase(Gn,(t,r)=>{let n=r.payload;t.firstResult=tu(n,t.numberOfResults)}).addCase(Ll,t=>{let r=CS(t),n=Math.max(r-1,1);t.firstResult=tu(n,t.numberOfResults)}).addCase(Vl,t=>{let r=CS(t),n=bU(t),o=Math.min(r+1,n);t.firstResult=tu(o,t.numberOfResults)}).addCase(Ze.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(tt,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Fe.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Br.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(ht,t=>{Vt(t)}).addCase(an,t=>{Vt(t)}).addCase(po,t=>{Vt(t)}).addCase(dn,t=>{Vt(t)}).addCase(Jp,t=>{Vt(t)}).addCase(lo,t=>{Vt(t)}).addCase(uo,t=>{Vt(t)}).addCase(Za,t=>{Vt(t)}).addCase(Lp,t=>{Vt(t)}).addCase(on,t=>{Vt(t)}).addCase(ln,t=>{Vt(t)}).addCase(Kt,t=>{Vt(t)}).addCase(Pn,t=>{Vt(t)}).addCase(kn,t=>{Vt(t)}).addCase(Kp,t=>{Vt(t)}).addCase(YE,t=>{Vt(t)})});function Vt(e){e.firstResult=Lr().firstResult}function CS(e){let{firstResult:t,numberOfResults:r}=e;return bS(t,r)}function bU(e){let{totalCountFiltered:t,numberOfResults:r}=e;return xS(t,r)}function tu(e,t){return(e-1)*t}function bS(e,t){return Math.round(e/t)+1}function xS(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function xU(e){return e.pagination.firstResult}function KE(e){return e.pagination.numberOfResults}function RU(e){return e.pagination.totalCountFiltered}var Ao=e=>{let t=xU(e),r=KE(e);return bS(t,r)},RS=e=>{let t=RU(e),r=KE(e);return xS(t,r)},JE=(e,t)=>{let r=Ao(e),n=RS(e),o=wU(r,t);return o=IU(o),o=EU(o,n),FU(o)};function wU(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,i=e-n,a=e+o;return{start:i,end:a}}function IU(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function EU(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function FU(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var wS=()=>$e("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||Lr().numberOfResults}));var vs=()=>({actionCause:"browseResults"});d();c();l();u();d();c();l();u();var nm=()=>Z("pagerNumber")("analytics/pager/number",(e,t)=>e.logPagerNumber({pagerNumber:Ao(t),...J(t.insightCaseContext)})),om=()=>Z("pagerNext")("analytics/pager/next",(e,t)=>e.logPagerNext({pagerNumber:Ao(t),...J(t.insightCaseContext)})),im=()=>Z("pagerPrevious")("analytics/pager/previous",(e,t)=>e.logPagerPrevious({pagerNumber:Ao(t),...J(t.insightCaseContext)}));d();c();l();u();var TU=new Ee({numberOfPages:new ne({default:5,min:0})}),PU=new Ee({page:new ne({min:1})});function XE(e,t={}){if(!kU(e))throw oe;let r=fe(e),{dispatch:n}=e,o=mt(e,TU,t.options,"buildPager"),a=lr(e,PU,t.initialState,"buildPager").page;a&&n(jl(a));let p=()=>Ao(e.state),f=()=>{let{numberOfPages:g}=o;return JE(e.state,g)},m=()=>RS(e.state);return{...r,get state(){let g=p(),S=m(),b=g>1&&S>0,h=g<S;return{currentPage:g,currentPages:f(),maxPage:S,hasPreviousPage:b,hasNextPage:h}},selectPage(g){n(Gn(g))},nextPage(){n(Vl())},previousPage(){n(Ll())},isCurrentPage(g){return g===this.state.currentPage}}}function kU(e){return e.addReducers({configuration:ve,pagination:Ss}),!0}function ZE(e,t={}){let{dispatch:r}=e,n=XE(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(Tl({legacy:nm(),next:vs()}))},nextPage(){n.nextPage(),r(Tl({legacy:om(),next:vs()}))},previousPage(){n.previousPage(),r(Tl({legacy:im(),next:vs()}))}}}d();c();l();u();d();c();l();u();function eF(e){if(!OU(e))throw oe;let t=fe(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function OU(e){return e.addReducers({search:xe}),!0}function tF(e){return eF(e)}d();c();l();u();d();c();l();u();function rF(e){if(!_U(e))throw oe;let t=fe(e),r=gs(e),n=()=>e.state,o=()=>{let i=n().search.duration/1e3;return Math.round((i+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function _U(e){return e.addReducers({search:xe,pagination:Ss}),!0}function nF(e){return rF(e)}d();c();l();u();d();c();l();u();function oF(_x231,_x232){return _oF.apply(this,arguments)}function _oF(){_oF=_asyncToGenerator(function*(e,t){let{accessToken:r,organizationId:n,environment:o}=e.configuration,{insightId:i}=e.insightConfiguration,a=e.query?.q||"";return{url:gg({url:We(n,o),accessToken:r,organizationId:n,insightId:i}),accessToken:r,organizationId:n,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0}});return _oF.apply(this,arguments)}d();c();l();u();var iF=e=>Z("")({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Ft(e);let n=Ke(e,r),o=Je(e);t.logDocumentQuickview(n,o)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{action:"preview",itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",context:Fr(t)}}});d();c();l();u();function aF(e,t,r,n,o){if(!NU(e))throw oe;let{dispatch:i}=e,a=()=>e.state,p=fe(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:b,position:h}=a().resultPreview;return b[h]},S=b=>{i($l({uniqueId:b,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||i(vc({uniqueId:b,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){S(f.uniqueId)},next(){i(Bl()),S(g())},previous(){i(Gl()),S(g())},get state(){let b=a(),h=f.hasHtmlVersion,A=b.resultPreview,w=f.uniqueId===A.uniqueId?A.content:"",R=A.isLoading,x=A.contentURL,I=g();return{content:w,resultHasPreview:h,isLoading:R,contentURL:x,currentResultUniqueId:I}}}}function NU(e){return e.addReducers({configuration:ve,resultPreview:va}),!0}function sF(e,t){if(!qU(e))throw oe;let r=()=>{e.dispatch(iF(t.options.result))},n="/quickview",o={options:{...t.options,onlyContentURL:!0}};return aF(e,o,(i,a)=>oF(i,a),n,r)}function qU(e){return e.addReducers({configuration:ve,resultPreview:va,insightInterface:Un}),!0}d();c();l();u();d();c();l();u();var cF=()=>Z("clearRecentQueries")("analytics/recentQueries/clear",(e,t)=>e.logClearRecentQueries(J(t.insightCaseContext))),uF=()=>Z("recentQueriesClick")("analytics/recentQueries/click",(e,t)=>e.logRecentQueryClick(J(t.insightCaseContext)));d();c();l();u();d();c();l();u();var DU={queries:new re({required:!0,each:new L({emptyAllowed:!1})}),maxLength:new ne({required:!0,min:1,default:10})},ru=T("recentQueries/registerRecentQueries",e=>_(e,DU)),am=T("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function lF(){return{queries:[],maxLength:10}}var dF=ce(lF(),e=>{e.addCase(ru,MU).addCase(am,jU).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||VU(n,t)})});function MU(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function jU(e){e.queries=[]}function VU(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var LU={queries:[]},UU={maxLength:10,clearFilters:!0},QU=new Ee({queries:new re({required:!0})}),BU=new Ee({maxLength:new ne({required:!0,min:1}),clearFilters:new ue});function GU(e,t){mt(e,BU,t?.options,"buildRecentQueriesList"),lr(e,QU,t?.initialState,"buildRecentQueriesList")}function pF(e,t){if(!$U(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i={...UU,...t?.options},a={...LU,...t?.initialState};GU(e,{options:i,initialState:a});let p={queries:a.queries,maxLength:i.maxLength};return n(ru(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(am())},updateRecentQueries(f){let m=new re({required:!0,each:new L({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(ru({queries:f,maxLength:i.maxLength}))},executeRecentQuery(f){let m=new ne({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:i.clearFilters};cu(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(ya(g))}}}function $U(e){return e.addReducers({search:xe,recentQueries:dF,query:So}),!0}function fF(e,t){let r=pF(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(cF()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(Se({legacy:uF(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var HU={results:new re({required:!0,each:new W({values:pl})}),maxLength:new ne({required:!0,min:1,default:10})},sm=T("recentResults/registerRecentResults",e=>_(e,HU)),fn=T("recentResults/pushRecentResult",e=>(Ft(e),{payload:e})),cm=T("recentResults/clearRecentResults");d();c();l();u();var mF=e=>Z("documentOpen")({prefix:"analytics/insight/result/open",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logDocumentOpen(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"open",context:Fr(t)}}});function gF(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(mF(t.options.result)))};return pn(e,t,()=>{n(),e.dispatch(fn(t.options.result))})}d();c();l();u();function hF(e,t){return Xf(e,{...t,fetchMoreResultsActionCreator:Pl})}d();c();l();u();d();c();l();u();var zU=new Ee({numberOfResults:new ne({min:0})});function yF(e,t={}){if(!WU(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,a=lr(e,zU,t.initialState,"buildResultsPerPage").numberOfResults;return a!==void 0&&n(Dl(a)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(Ml(p))},isSetTo(p){return p===this.state.numberOfResults}}}function WU(e){return e.addReducers({pagination:Ss,configuration:ve}),!0}function SF(e,t={}){let r=yF(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(Se({legacy:wS(),next:vs()}))}}}d();c();l();u();d();c();l();u();var IS=()=>$e("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),um=()=>({actionCause:"searchboxSubmit"});d();c();l();u();var lm=()=>Z("searchboxSubmit")("analytics/searchbox/submit",(e,t)=>e.logSearchboxSubmit(J(t.insightCaseContext)));d();c();l();u();d();c();l();u();var vF={id:G,query:Ye},As=T("querySet/register",e=>_(e,vF)),bi=T("querySet/update",e=>_(e,vF));d();c();l();u();var Cs=ce(Rl(),e=>{e.addCase(As,(t,r)=>KU(t,r.payload)).addCase(bi,(t,r)=>{let{id:n,query:o}=r.payload;ES(t,n,o)}).addCase(ho,(t,r)=>{let{id:n,expression:o}=r.payload;ES(t,n,o)}).addCase(Fe.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;AF(t,n)}).addCase(tt,YU).addCase(Ze.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))ES(t,n,o)})});function YU(e,t){te(t.payload.q)||AF(e,t.payload.q)}function AF(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var ES=(e,t,r)=>{t in e&&(e[t]=r)},KU=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var CF=e=>$e("analytics/querySuggest",(t,r)=>{let n=JU(r,e);return t.makeOmniboxAnalytics(n)}),bF=()=>({actionCause:"omniboxAnalytics"});function JU(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let i=o.completions.map(m=>m.expression),a=o.partialQueries.length-1,p=o.partialQueries[a]||"",f=o.responseId;return{suggestionRanking:i.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:i,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function xF(e,t){let r=t.id;r in e||(e[r]=XU(t))}function RF(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function wF(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function IF(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function XU(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var EF=()=>({});var dm=ce(EF(),e=>e.addCase(go,(t,r)=>{xF(t,r.payload)}).addCase(jE,(t,r)=>{delete t[r.payload.id]}).addCase(fs.pending,RF).addCase(fs.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(fs.rejected,wF).addCase(yo,(t,r)=>{IF(t,r.payload)}).addCase(Aa,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var FF={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},FS={open:new L,close:new L},ZU={id:G,numberOfSuggestions:new ne({min:0}),enableQuerySyntax:new ue,highlightOptions:new W({values:{notMatchDelimiters:new W({values:FS}),exactMatchDelimiters:new W({values:FS}),correctionDelimiters:new W({values:FS})}}),clearFilters:new ue},TF=new Ee(ZU);function PF(e,t){if(!tQ(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state,i=t.options?.id||uu("search_box"),a={id:i,highlightOptions:{...t.options?.highlightOptions},...FF,...t.options};mt(e,TF,a,"buildSearchBox"),n(As({id:i,query:e.state.query.q})),a.numberOfSuggestions&&n(go({id:i,count:a.numberOfSuggestions})),a.enableQuerySyntax&&n(Ut({enableQuerySyntax:a.enableQuerySyntax}));let p=()=>e.state.querySet[a.id],f=/*#__PURE__*/function(){var _ref99=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:S}=a;n(ya({q:p(),enableQuerySyntax:g,clearFilters:S})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x233){return _ref99.apply(this,arguments)}}();return{...r,updateText(m){n(bi({id:i,query:m})),this.showSuggestions()},clear(){n(bi({id:i,query:""})),n(yo({id:i}))},showSuggestions(){a.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:i}))},selectSuggestion(m){n(ho({id:i,expression:m})),f({legacy:CF({id:i,suggestion:m}),next:bF()}).then(()=>{n(yo({id:i}))})},submit(m=IS(),g){f({legacy:m,next:g}),n(yo({id:i}))},get state(){let m=o(),g=m.querySuggest[a.id],S=eQ(g,a.highlightOptions),b=g?g.isLoading:!1;return{searchBoxId:i,value:p(),suggestions:S,isLoading:m.search.isLoading,isLoadingSuggestions:b}}}}function eQ(e,t){return e?e.completions.map(r=>({highlightedValue:Gm(r.highlighted,t),rawValue:r.expression})):[]}function tQ(e){return e.addReducers({query:So,querySuggest:dm,configuration:ve,querySet:Cs,search:xe}),!0}function kF(e,t={}){let r=PF(e,{...t,executeSearchActionCreator:Se,fetchQuerySuggestionsActionCreator:kl,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(lm(),um())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var pm=()=>({actionCause:"resultsSort"});function OF(e,t){return e.q!==t.q?um():e.sortCriteria!==t.sortCriteria?pm():bs(e.f,t.f)?xs(e.f,t.f):bs(e.fExcluded,t.fExcluded)?xs(e.fExcluded,t.fExcluded,!0):bs(e.cf,t.cf)?xs(e.cf,t.cf):bs(e.af,t.af)?xs(e.af,t.af):bs(e.nf,t.nf)?xs(fm(e.nf),fm(t.nf)):bs(e.df,t.df)?xs(fm(e.df),fm(t.df)):ca()}function bs(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function xs(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),i=n.filter(b=>!o.includes(b));if(i.length){let b=i[0];return e[b].length>1?rr():Fn()}if(o.filter(b=>!n.includes(b)).length)return r?Wp():sr();let p=o.find(b=>t[b].filter(h=>e[b].includes(h)));if(!p)return ca();let f=e[p],m=t[p];return m.filter(b=>!f.includes(b)).length?r?Wp():sr():f.filter(b=>!m.includes(b)).length?Fn():ca()}function fm(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();var Rs=()=>Z("resultsSort")("analytics/sort/results",(e,t)=>e.logResultsSort({resultsSortBy:t.sortCriteria||ir(),...J(t.insightCaseContext)}));function qF(e,t){return e.q!==t.q?lm():e.sortCriteria!==t.sortCriteria?Rs():nu(e.f,t.f)?nu(e.cf,t.cf)?nu(e.nf,t.nf)?nu(e.df,t.df)?nu(e.fExcluded,t.fExcluded)?Bn():rQ(e.fExcluded,t.fExcluded):NF(e.df,t.df):NF(e.nf,t.nf):mm(e.cf,t.cf):mm(e.f,t.f)}function nu(e={},t={}){return JSON.stringify(e)===JSON.stringify(t)}function _F(e){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}function mm(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),i=n.filter(b=>!o.includes(b));if(i.length){let b=i[0];return e[b].length>1?Dt(b):(r?os:Pr)({facetId:b,facetValue:e[b][0]})}let a=o.filter(b=>!n.includes(b));if(a.length){let b=a[0];return Bt({facetId:b,facetValue:t[b][0]})}let p=o.find(b=>t[b].filter(h=>e[b].includes(h)));if(!p)return Bn();let f=e[p],m=t[p],g=m.filter(b=>!f.includes(b));if(g.length)return Bt({facetId:p,facetValue:g[0]});let S=f.filter(b=>!m.includes(b));return S.length?(r?os:Pr)({facetId:p,facetValue:S[0]}):Bn()}function NF(e={},t={}){return mm(_F(e),_F(t))}function rQ(e={},t={}){return mm(e,t,!0)}d();c();l();u();d();c();l();u();var{getOwnPropertyNames:nQ,getOwnPropertySymbols:oQ}=Object,{hasOwnProperty:iQ}=Object.prototype;function TS(e,t){return function(n,o,i){return e(n,o,i)&&t(n,o,i)}}function gm(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:i}=o,a=i.get(r),p=i.get(n);if(a&&p)return a===n&&p===r;i.set(r,n),i.set(n,r);let f=e(r,n,o);return i.delete(r),i.delete(n),f}}function aQ(e){return e?.[Symbol.toStringTag]}function DF(e){return nQ(e).concat(oQ(e))}var sQ=Object.hasOwn||((e,t)=>iQ.call(e,t));function xi(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var cQ="__v",uQ="__o",lQ="_owner",{getOwnPropertyDescriptor:MF,keys:jF}=Object;function dQ(e,t){return e.byteLength===t.byteLength&&hm(new Uint8Array(e),new Uint8Array(t))}function pQ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function fQ(e,t){return e.byteLength===t.byteLength&&hm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function mQ(e,t){return xi(e.getTime(),t.getTime())}function gQ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function hQ(e,t){return e===t}function VF(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),i=e.entries(),a,p,f=0;for(;(a=i.next())&&!a.done;){let m=t.entries(),g=!1,S=0;for(;(p=m.next())&&!p.done;){if(o[S]){S++;continue}let b=a.value,h=p.value;if(r.equals(b[0],h[0],f,S,e,t,r)&&r.equals(b[1],h[1],b[0],h[0],e,t,r)){g=o[S]=!0;break}S++}if(!g)return!1;f++}return!0}var yQ=xi;function SQ(e,t,r){let n=jF(e),o=n.length;if(jF(t).length!==o)return!1;for(;o-->0;)if(!UF(e,t,r,n[o]))return!1;return!0}function ou(e,t,r){let n=DF(e),o=n.length;if(DF(t).length!==o)return!1;let i,a,p;for(;o-->0;)if(i=n[o],!UF(e,t,r,i)||(a=MF(e,i),p=MF(t,i),(a||p)&&(!a||!p||a.configurable!==p.configurable||a.enumerable!==p.enumerable||a.writable!==p.writable)))return!1;return!0}function vQ(e,t){return xi(e.valueOf(),t.valueOf())}function AQ(e,t){return e.source===t.source&&e.flags===t.flags}function LF(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),i=e.values(),a,p;for(;(a=i.next())&&!a.done;){let f=t.values(),m=!1,g=0;for(;(p=f.next())&&!p.done;){if(!o[g]&&r.equals(a.value,p.value,a.value,p.value,e,t,r)){m=o[g]=!0;break}g++}if(!m)return!1}return!0}function hm(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function CQ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function UF(e,t,r,n){return(n===lQ||n===uQ||n===cQ)&&(e.$$typeof||t.$$typeof)?!0:sQ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var bQ="[object ArrayBuffer]",xQ="[object Arguments]",RQ="[object Boolean]",wQ="[object DataView]",IQ="[object Date]",EQ="[object Error]",FQ="[object Map]",TQ="[object Number]",PQ="[object Object]",kQ="[object RegExp]",OQ="[object Set]",_Q="[object String]",NQ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},qQ="[object URL]",DQ=Object.prototype.toString;function MQ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:g,areSetsEqual:S,areTypedArraysEqual:b,areUrlsEqual:h,unknownTagComparators:A}){return function(R,x,I){if(R===x)return!0;if(R==null||x==null)return!1;let F=typeof R;if(F!==typeof x)return!1;if(F!=="object")return F==="number"?p(R,x,I):F==="function"?i(R,x,I):!1;let P=R.constructor;if(P!==x.constructor)return!1;if(P===Object)return f(R,x,I);if(Array.isArray(R))return t(R,x,I);if(P===Date)return n(R,x,I);if(P===RegExp)return g(R,x,I);if(P===Map)return a(R,x,I);if(P===Set)return S(R,x,I);let j=DQ.call(R);if(j===IQ)return n(R,x,I);if(j===kQ)return g(R,x,I);if(j===FQ)return a(R,x,I);if(j===OQ)return S(R,x,I);if(j===PQ)return typeof R.then!="function"&&typeof x.then!="function"&&f(R,x,I);if(j===qQ)return h(R,x,I);if(j===EQ)return o(R,x,I);if(j===xQ)return f(R,x,I);if(NQ[j])return b(R,x,I);if(j===bQ)return e(R,x,I);if(j===wQ)return r(R,x,I);if(j===RQ||j===TQ||j===_Q)return m(R,x,I);if(A){let q=A[j];if(!q){let k=aQ(R);k&&(q=A[k])}if(q)return q(R,x,I)}return!1}}function jQ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:dQ,areArraysEqual:r?ou:pQ,areDataViewsEqual:fQ,areDatesEqual:mQ,areErrorsEqual:gQ,areFunctionsEqual:hQ,areMapsEqual:r?TS(VF,ou):VF,areNumbersEqual:yQ,areObjectsEqual:r?ou:SQ,arePrimitiveWrappersEqual:vQ,areRegExpsEqual:AQ,areSetsEqual:r?TS(LF,ou):LF,areTypedArraysEqual:r?TS(hm,ou):hm,areUrlsEqual:CQ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=gm(n.areArraysEqual),i=gm(n.areMapsEqual),a=gm(n.areObjectsEqual),p=gm(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:a,areSetsEqual:p})}return n}function VQ(e){return function(t,r,n,o,i,a,p){return e(t,r,p)}}function LQ({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:g}=r();return t(p,f,{cache:m,equals:n,meta:g,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let i={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,i)}}var cYe=mn(),uYe=mn({strict:!0}),lYe=mn({circular:!0}),dYe=mn({circular:!0,strict:!0}),pYe=mn({createInternalComparator:()=>xi}),fYe=mn({strict:!0,createInternalComparator:()=>xi}),mYe=mn({circular:!0,createInternalComparator:()=>xi}),gYe=mn({circular:!0,createInternalComparator:()=>xi,strict:!0});function mn(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,i=jQ(e),a=MQ(i),p=r?r(a):VQ(a);return LQ({circular:t,comparator:a,createState:n,equals:p,strict:o})}function QF(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function UQ(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>PS(r,n))!==-1)}var PS=mn({createCustomConfig:e=>({...e,areArraysEqual:UQ})});d();c();l();u();d();c();l();u();function BF(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function GF(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function ym(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([i])=>t(i)).map(([i,{request:a}])=>{let p=r(a);return p.length?{[i]:p}:{}}).reduce((i,a)=>({...i,...a}),{});return Object.keys(o).length?{[n]:o}:{}}function $F(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function HF(e){return{q:at().q,enableQuerySyntax:at().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??An().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??An().defaultFilters.cq,firstResult:Lr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??Lr().defaultNumberOfResults,sortCriteria:ir(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:bl(),sf:{},tab:"",af:{},mnf:{}}}var QQ=new Ee({parameters:new W({options:{required:!0},values:hd})});function YF(e,t){let{dispatch:r}=e,n=fe(e);lr(e,QQ,t.initialState,"buildSearchParameterManager");let o=zF(e.state.tabSet,t.initialState.parameters);return r(tt(o)),{...n,synchronize(i){let a=zF(e.state.tabSet,Sm(e,i));r(tt(a))},get state(){return{parameters:kS(e)}}}}function Sm(e,t){return{...HF(e.state),...t}}function zF(e,t){if(te(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:WF(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??WF(e)}}return t}function WF(e){return Object.keys(e)[0]??""}function kS(e){let t=e.state;return{...BF(t.query,r=>r.q,at().q),...$F(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...GF(t.sortCriteria,r=>r,ir()),...GQ(t),...$Q(t),...HQ(t),...zQ(t),...WQ(t)}}function BQ(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function vm(e){let t=BQ(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,i=tr(n?.tabs,t);return o&&i}}function KF(e){return e.currentValues.filter(t=>t.state==="selected")}function GQ(e){let t=e.facetSet;if(t===void 0)return{};let r=vm(e),n={},o={};for(let[i,{request:a}]of Object.entries(t)){if(!r(i))continue;let p=a.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=a.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[i]=p),f.length&&(o[i]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function $Q(e){return ym(e.categoryFacetSet,vm(e),t=>Dr(t.currentValues).map(r=>r.value),"cf")}function HQ(e){return ym(e.numericFacetSet,vm(e),KF,"nf")}function zQ(e){return ym(e.dateFacetSet,vm(e),KF,"df")}function WQ(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let i=YQ(o);return i.length?{[n]:i}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function YQ(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function JF(e,t){let{dispatch:r}=e,n=YF(e,t);return{...n,synchronize(o){let i=kS(e),a=Sm(e,i),p=Sm(e,o);PS(a,p)||(n.synchronize(o),r(Se({legacy:qF(a,p),next:OF(a,p)})))},get state(){return n.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var iu=()=>new W({values:{questionAnswerId:G},options:{required:!0}}),Am=()=>new W({values:{linkText:Ye,linkURL:Ye},options:{required:!0}});function Ri(e){return _(e,iu())}d();c();l();u();function pt(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&Gb(e,r.contentIdKey,r.contentIdValue)}function Ar(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var XF={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"};var KQ=()=>Z("expandSmartSnippet")({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:(e,t)=>e.logExpandSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),JQ=()=>Z("collapseSmartSnippet")({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:(e,t)=>e.logCollapseSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),XQ=()=>Z("likeSmartSnippet")({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:(e,t)=>e.logLikeSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),ZQ=()=>Z("dislikeSmartSnippet")({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:(e,t)=>e.logDislikeSmartSnippet(J(t.insightCaseContext)),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),eB=()=>Z("openSmartSnippetSource")({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=pt(t);return e.logOpenSmartSnippetSource(Ke(r,t),Je(r),J(t.insightCaseContext))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=pt(e),r=Je(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),OS=e=>Z("openSmartSnippetSource")({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{_(e,Am());let n=pt(r);return t.logOpenSmartSnippetInlineLink(Ke(n,r),{...Je(n),...e},J(r.insightCaseContext))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=pt(t),n=Je(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),tB=()=>Z("openSmartSnippetFeedbackModal")("analytics/smartSnippet/feedbackModal/open",(e,t)=>e.logOpenSmartSnippetFeedbackModal(J(t.insightCaseContext))),rB=()=>Z("closeSmartSnippetFeedbackModal")("analytics/smartSnippet/feedbackModal/close",(e,t)=>e.logCloseSmartSnippetFeedbackModal(J(t.insightCaseContext))),nB=e=>Z("sendSmartSnippetReason")({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:(t,r)=>t.logSmartSnippetFeedbackReason(e,void 0,J(r.insightCaseContext)),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=pt(t),n=Je(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:XF[e]}}}),oB=e=>Z("sendSmartSnippetReason")({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:(t,r)=>t.logSmartSnippetFeedbackReason("other",e,J(r.insightCaseContext)),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=pt(t),n=Je(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),iB=e=>Z("expandSmartSnippetSuggestion")({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{Ri(e);let n=Ar(r,e.questionAnswerId);return n?t.logExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId},J(r.insightCaseContext)):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ar(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=pt(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),aB=e=>Z("collapseSmartSnippetSuggestion")({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{Ri(e);let n=Ar(r,e.questionAnswerId);return n?t.logCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId},J(r.insightCaseContext)):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ar(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=pt(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),_S=e=>Z("openSmartSnippetSuggestionSource")({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{_(e,iu());let n=Ar(r,e.questionAnswerId);if(!n)return null;let o=pt(r,n.documentId);return o?t.logOpenSmartSnippetSuggestionSource(Ke(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId},J(r.insightCaseContext)):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Ar(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=pt(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),ZF=(e,t)=>Z("openSmartSnippetSuggestionSource")({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{_(e,iu()),_(t,Am());let o=Ar(n,e.questionAnswerId);if(!o)return null;let i=pt(n,o.documentId);return i?r.logOpenSmartSnippetSuggestionInlineLink(Ke(i,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL},J(n.insightCaseContext)):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Ar(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let i=pt(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:i?.title,url:i?.clickUri}}}}}),Cm={logExpandSmartSnippet:KQ,logCollapseSmartSnippet:JQ,logLikeSmartSnippet:XQ,logDislikeSmartSnippet:ZQ,logOpenSmartSnippetSource:eB,logOpenSmartSnippetInlineLink:OS,logOpenSmartSnippetFeedbackModal:tB,logCloseSmartSnippetFeedbackModal:rB,logSmartSnippetFeedback:nB,logSmartSnippetDetailedFeedback:oB,logExpandSmartSnippetSuggestion:iB,logCollapseSmartSnippetSuggestion:aB,logOpenSmartSnippetSuggestionSource:_S};d();c();l();u();d();c();l();u();var ws=T("smartSnippet/expand"),Is=T("smartSnippet/collapse"),Es=T("smartSnippet/like"),Fs=T("smartSnippet/dislike"),Ts=T("smartSnippet/feedbackModal/open"),Co=T("smartSnippet/feedbackModal/close"),Ps=T("smartSnippet/related/expand",e=>Ri(e)),ks=T("smartSnippet/related/collapse",e=>Ri(e));d();c();l();u();d();c();l();u();var NS=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var eT=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function tT({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Oi({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function sB(e,t){let r=tT(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var gn=ce(NS(),e=>e.addCase(ws,t=>{t.expanded=!0}).addCase(Is,t=>{t.expanded=!1}).addCase(Es,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(Fs,t=>{t.liked=!1,t.disliked=!0}).addCase(Ts,t=>{t.feedbackModalOpen=!0}).addCase(Co,t=>{t.feedbackModalOpen=!1}).addCase(Fe.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((i,a)=>sB(i,t.relatedQuestions[a])),o=tT(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...NS(),relatedQuestions:n,questionAnswerId:o}}).addCase(Ps,(t,r)=>{let n=eT(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(ks,(t,r)=>{let n=eT(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function rT(e,t,r){if(!cB(e))throw oe;let n=fe(e),o=()=>e.state,i=()=>pt(o()),a=null,p=pn(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=i();if(!f){a=null;return}let{searchResponseId:m}=o().search;a!==m&&(a=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(fn(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:i()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(ws())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(Is())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(Es())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(Fs())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(Ts())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(Co())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(Co())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(Co())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function cB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}d();c();l();u();function bm(e,t){if(!uB(e))throw oe;let r=()=>e.state,n=new Set,o=g=>n.has(g)?!0:(n.add(g),!1),i=null,a=g=>{i!==g&&(i=g,f={},n.clear())},p=(g,S,b)=>pn(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(S)||e.dispatch(b?ZF({questionAnswerId:b},g):OS(g))}),f={},m=(g,S)=>{let{searchResponseId:b}=r().search;a(b);let h=Oi({...g,questionAnswerId:S});return h in f||(f[h]=p(g,h,S)),f[h]};return{selectInlineLink(g,S){m(g,S)?.select()},beginDelayedSelectInlineLink(g,S){m(g,S)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,S){m(g,S)?.cancelPendingSelect()}}}function uB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}function nT(e,t){let r=rT(e,Cm,t),n=bm(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function oT(e,t){if(!lB(e))throw oe;let r=fe(e),n=()=>e.state,o=i=>{let{contentIdKey:a,contentIdValue:p}=i;return e.state.search.results.find(f=>Jn(f,a)===p)};return{...r,get state(){let i=n();return{questions:i.search.questionAnswer.relatedQuestions.map((a,p)=>({question:a.question,answer:a.answerSnippet,documentId:a.documentId,questionAnswerId:i.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:i.questionAnswering.relatedQuestions[p].expanded,source:o(a.documentId)}))}},expand(i){let a={questionAnswerId:i};e.dispatch(t.logExpandSmartSnippetSuggestion(a)),e.dispatch(Ps(a))},collapse(i){let a={questionAnswerId:i};e.dispatch(t.logCollapseSmartSnippetSuggestion(a)),e.dispatch(ks(a))}}}function lB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}d();c();l();u();function iT(e,t){if(!dB(e))throw oe;let r=()=>e.state,n=S=>{let b=r(),h=Ar(b,S);return h?pt(b,h.documentId):null},o=new Set,i=S=>o.has(S)?!0:(o.add(S),!1),a=null,p=S=>{a!==S&&(a=S,m={},o.clear())},f=(S,b)=>pn(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{i(b)||(e.dispatch(_S({questionAnswerId:b})),e.dispatch(fn(S)))}),m={},g=S=>{let{searchResponseId:b}=r().search;p(b);let h=n(S);return h?(S in m||(m[S]=f(h,S)),m[S]):null};return{selectSource(S){g(S)?.select()},beginDelayedSelectSource(S){g(S)?.beginDelayedSelect()},cancelPendingSelectSource(S){g(S)?.cancelPendingSelect()}}}function dB(e){return e.addReducers({search:xe,questionAnswering:gn}),!0}function aT(e,t){let r=oT(e,Cm),n=bm(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=iT(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(i){o.selectSource(i)},beginDelayedSelectSource(i){o.beginDelayedSelectSource(i)},cancelPendingSelectSource(i){o.cancelPendingSelectSource(i)},selectInlineLink(i,a){n.selectInlineLink(a,i)},beginDelayedSelectInlineLink(i,a){n.beginDelayedSelectInlineLink(a,i)},cancelPendingSelectInlineLink(i,a){n.cancelPendingSelectInlineLink(a,i)}}}d();c();l();u();d();c();l();u();d();c();l();u();var sT={by:new Ls({enum:al,required:!0})},xm=T("sortCriteria/register",e=>cT(e)),Rm=T("sortCriteria/update",e=>cT(e)),cT=e=>ki(e)?(e.forEach(t=>_(t,sT)),{payload:e}):_(e,sT);d();c();l();u();var uT=ce(ir(),e=>{e.addCase(xm,(t,r)=>Mr(r.payload)).addCase(Rm,(t,r)=>Mr(r.payload)).addCase(Ze.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(tt,(t,r)=>r.payload.sortCriteria??t)});function pB(e,t){if(!t)return;let r=new Ee({criterion:new re({each:LC})}),n=fB(t),o={...t,criterion:n};lr(e,r,o,"buildSort")}function fB(e){return e.criterion?ki(e.criterion)?e.criterion:[e.criterion]:[]}function lT(e,t){if(!mB(e))throw oe;let r=fe(e),{dispatch:n}=e,o=()=>e.state;pB(e,t.initialState);let i=t.initialState?.criterion;return i&&n(xm(i)),{...r,sortBy(a){n(Rm(a)),n(Gn(1))},isSortedBy(a){return this.state.sortCriteria===Mr(a)},get state(){return{sortCriteria:o().sortCriteria}}}}function mB(e){return e.addReducers({configuration:ve,sortCriteria:uT}),!0}function dT(e,t={}){let{dispatch:r}=e,n=lT(e,t),o=()=>r(Se({legacy:Rs(),next:pm()}));return{...n,get state(){return n.state},sortBy(i){n.sortBy(i),o()}}}d();c();l();u();function pT(e){return gs(e)}d();c();l();u();d();c();l();u();var gB=new Ee({expression:Ye,id:G,clearFiltersOnTabChange:new ue}),hB=new Ee({isActive:new ue});function fT(e,t){if(SB(t.options.id),!yB(e))throw oe;let r=fe(e),{dispatch:n}=e;mt(e,gB,t.options,"buildTab");let o=lr(e,hB,t.initialState,"buildTab"),{id:i,expression:a}=t.options;return n(Sd({id:i,expression:a})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(Tt(i)),{...r,select(){t.options.clearFiltersOnTabChange&&n(ya({q:"",clearFilters:!0})),n(Tt(i))},get state(){return{isActive:e.state.tabSet[i]?.isActive}}}}function yB(e){return e.addReducers({configuration:ve,tabSet:bf}),!0}function SB(e){let t=Ad().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function mT(e,t){let{dispatch:r}=e,n=fT(e,t),o=()=>r(Se({legacy:Bn(),next:ca()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();d();c();l();u();var gT=()=>Z("query")("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.logTriggerNotify({notifications:t.triggers.notifications},J(t.insightCaseContext)):null);d();c();l();u();d();c();l();u();d();c();l();u();function hT(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function yT(e,t){let r=[],n=[],o=[],i=[];return t.forEach(a=>{switch(a.type){case"redirect":r.push(a.content);break;case"query":n.push(a.content);break;case"execute":o.push({functionName:a.content.name,params:a.content.params});break;case"notify":i.push(a.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=i,e}function ST(e,t){return e.queryModification={...t,queryToIgnore:""},e}function vT(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var AT=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var CT=ce(AT(),e=>e.addCase(Fe.pending,hT).addCase(Fe.fulfilled,(t,r)=>yT(t,r.payload.response.triggers)).addCase(ha,(t,r)=>ST(t,r.payload)).addCase(ga,(t,r)=>vT(t,r.payload)));function bT(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!vB(e))throw oe;let n=fe(e),{dispatch:o}=e,i=()=>e.state,a=i().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!QF(a,this.state.notifications);a=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:i().triggers.notifications}}}}function vB(e){return e.addReducers({triggers:CT}),!0}function xT(e){return bT(e,{options:{logNotifyTriggerActionCreator:gT}})}d();c();l();u();d();c();l();u();var RT=(e,t)=>Z("expandToFullUI")({prefix:"analytics/expandToFullUI",__legacy__getBuilder:(r,n)=>{let o=J(n.insightCaseContext),i={caseId:o.caseId,caseNumber:o.caseNumber,fullSearchComponentName:e,triggeredBy:t,caseContext:o.caseContext};return r.logExpandToFullUI(i)},analyticsType:"InsightPanel.ExpandToFullUI",analyticsPayloadBuilder:r=>{let n=J(r.insightCaseContext);return{context:{targetId:n.caseId,targetType:"Case",caseNumber:n.caseNumber}}}}),wT=e=>Z("createArticle")({prefix:"analytics/insight/createArticle",__legacy__getBuilder:(t,r)=>(_(e,{articleType:G}),t.logCreateArticle(e,J(r.insightCaseContext))),analyticsType:"InsightPanel.CreateArticle",analyticsPayloadBuilder:t=>{let r=J(t.insightCaseContext);return{articleType:e.articleType,context:{targetId:r.caseId,targetType:"Case",caseNumber:r.caseNumber}}}}),wm=()=>Z("openUserActions")({prefix:"analytics/insight/openUserActions",__legacy__getBuilder:(e,t)=>e.logOpenUserActions(J(t.insightCaseContext))});d();c();l();u();d();c();l();u();var IT=/*#__PURE__*/function(){var _ref100=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),userId:t}});return function IT(_x234,_x235){return _ref100.apply(this,arguments)}}();var AB={ticketCreationDate:new L({emptyAllowed:!1,ISODate:!0}),excludedCustomActions:new re({required:!1,each:He})},Os=T("insight/userActions/registerUserActions",e=>_(e,AB)),bo=le("insight/userActions/fetch",/*#__PURE__*/function(){var _ref101=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=yield n.userActions(yield IT(o,e));return Ge(i)?r(i.error):{response:i.success}});return function(_x236,_x237){return _ref101.apply(this,arguments)}}());d();c();l();u();d();c();l();u();d();c();l();u();function ET(){return{timeline:void 0,excludedCustomActions:[],loading:!1}}var CB=1e3,bB=CB*60,qS=30*bB,xB=2,RB=2,PT=(e,t)=>{if(!e.ticketCreationDate||!t?.length)return{precedingSessions:[],session:void 0,followingSessions:[]};let n=new Date(e.ticketCreationDate).getTime(),o=e.excludedCustomActions,i=IB(t);return FB(i,n,o)},wB=e=>{let t=JSON.parse(e.value);return{actionType:e.name,timestamp:Number(e.time),eventData:{type:t.event_type,value:t.event_value},cause:t.cause,searchHub:t.origin_level_1,document:{title:t.title,uriHash:t.uri_hash,contentIdKey:t.content_id_key||t.c_contentidkey,contentIdValue:t.content_id_value||t.c_contentidvalue},query:t.query_expression}},IB=e=>{let t=!1,r=e.reduce((n,o)=>{try{let i=wB(o);n.push(i)}catch{t=!0}return n},[]).sort((n,o)=>o.timestamp-n.timestamp);return t&&console.warn("Some user actions could not be parsed. Please check the raw user actions data."),r},EB=(e,t)=>Math.abs(e.timestamp-t)<qS,FT=(e,t,r)=>{if(e.actions?.length)if(t>=e.start-qS&&t<=e.end+qS){let n={actionType:"TICKET_CREATION",timestamp:t,eventData:{}},o=e.actions.findIndex(i=>i.timestamp<=n.timestamp);o===-1?(o=e.actions.length,e.start=t):o===0&&(e.end=t),e.actions.splice(o,0,n),r.session=e}else t<e.start?r.followingSessions.push(e):r.precedingSessions.push(e)},TT=(e,t)=>{if(e.actionType==="SEARCH"&&!e.query)return!0;if(e.actionType==="CUSTOM"){let r=e.eventData?.type||"",n=e.eventData?.value||"";return t.includes(r)||t.includes(n)}return!1},FB=(e,t,r)=>{let n={precedingSessions:[],session:void 0,followingSessions:[]},o={start:e[0].timestamp,end:e[0].timestamp,actions:[]};return e.forEach(i=>{if(EB(i,o.start)){o.actions.push(i),o.start=i.timestamp;return}o.actions=o.actions.filter(a=>!TT(a,r)),FT(o,t,n),o={start:i.timestamp,end:i.timestamp,actions:[i]}}),o.actions=o.actions.filter(i=>!TT(i,r)),FT(o,t,n),n.session===void 0&&(n.session={start:t,end:t,actions:[{actionType:"TICKET_CREATION",timestamp:t,eventData:{}}]}),{precedingSessions:n.precedingSessions.slice(0,xB),session:n.session,followingSessions:n.followingSessions.slice(n.followingSessions.length-RB)}};var Im=ce(ET(),e=>{e.addCase(Os,(t,r)=>{t.ticketCreationDate=r.payload.ticketCreationDate,r.payload.excludedCustomActions&&(t.excludedCustomActions=r.payload.excludedCustomActions)}).addCase(bo.pending,t=>{t.loading=!0,t.error=void 0}).addCase(bo.rejected,(t,r)=>{t.loading=!1,t.error=r.payload}).addCase(bo.fulfilled,(t,r)=>{t.loading=!1,t.error=void 0,t.timeline=PT(t,r.payload.response.value)})});function kT(e,t){if(!TB(e))throw oe;let{dispatch:r}=e,n=()=>e.state.insightUserActions,o=fe(e),{ticketCreationDate:i,excludedCustomActions:a}=t.options;return r(Os({ticketCreationDate:i,excludedCustomActions:a})),{...o,get state(){return n()},fetchUserActions(p){r(bo(p))},logOpenUserActions(){r(wm())}}}function TB(e){return e.addReducers({configuration:ve,insightUserActions:Im}),!0}d();c();l();u();function OT(e){if(!PB(e))throw oe;let t=fe(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return n().insightInterface},fetch(){r(jr())}}}function PB(e){return e.addReducers({configuration:ve,insightConfiguration:yl,insightInterface:Un,searchHub:zl}),!0}d();c();l();u();function kB(e){return e.addReducers({}),{logSearchEvent:XC,logClickEvent:ZC,logCustomEvent:eb}}d();c();l();u();d();c();l();u();var _T=e=>Z("copyToClipboard")({prefix:"analytics/resultAction/insight/copyToClipboard",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logCopyToClipboard(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"copyToClipboard",context:Fr(t)}}}),NT=e=>Z("Case.SendEmail")({prefix:"analytics/resultAction/insight/caseSendEmail",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logCaseSendEmail(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"sendEmail",context:Fr(t)}}}),qT=e=>Z("FeedItem.TextPost")({prefix:"analytics/resultAction/insight/feedItemTextPost",__legacy__getBuilder:(t,r)=>{Ft(e);let n=J(r.insightCaseContext);return t.logFeedItemTextPost(Ke(e,r),Je(e),n)},analyticsType:"InsightPanel.ItemAction",analyticsPayloadBuilder:t=>{let r=Ke(e,t);return{itemMetadata:xr(e,t),position:r.documentPosition,responseId:e.searchUid||"",action:"postToFeed",context:Fr(t)}}});function OB(e){return e.addReducers({}),{logClearBreadcrumbs:Zp,logInterfaceLoad:Il,logInterfaceChange:Bn,logCreateArticle:wT,logCategoryFacetBreadcrumb:Vp,logFacetBreadcrumb:Hc,logFacetClearAll:Dt,logFacetDeselect:Pr,logFacetSelect:Bt,logFacetShowLess:as,logFacetShowMore:is,logFacetUpdateSort:rn,logDateFacetBreadcrumb:zc,logNumericFacetBreadcrumb:Wc,logPageNext:om,logPageNumber:nm,logPagePrevious:im,logResultsSort:Rs,logStaticFilterDeselect:Sf,logCopyToClipboard:_T,logCaseSendEmail:NT,logFeedItemTextPost:qT,logOpenUserActions:wm}}d();c();l();u();function _B(e){return e.addReducers({attachedResults:co}),{setAttachedResults:Dp,detachResult:so,attachResult:ao}}d();c();l();u();function NB(e){return e.addReducers({attachedResults:co}),{logCaseDetach:Ya,logCaseAttach:Wa}}d();c();l();u();d();c();l();u();d();c();l();u();var Em=T("insight/caseContext/set",e=>{let t=new W({options:{required:!0}}),r=_(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new re({each:Ye}),i=_(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Fm=T("insight/caseId/set",e=>{let r=_(e,Ye).error;return r?{payload:e,error:r}:{payload:e}}),Tm=T("insight/caseNumber/set",e=>{let r=_(e,Ye).error;return r?{payload:e,error:r}:{payload:e}});var DT=ce(yb(),e=>{e.addCase(Em,(t,r)=>{t.caseContext=r.payload}).addCase(Fm,(t,r)=>{t.caseId=r.payload}).addCase(Tm,(t,r)=>{t.caseNumber=r.payload})});function qB(e){return e.addReducers({insightCaseContext:DT}),{setCaseContext:Em,setCaseId:Fm,setCaseNumber:Tm}}d();c();l();u();d();c();l();u();d();c();l();u();var DB=new re({each:G,required:!0}),MT=(e,t)=>(_(e,G),Pi(t)?_(t,G):_(t,DB),{payload:{contextKey:e,contextValue:t}}),Pm=T("context/set",e=>{for(let[t,r]of Object.entries(e))MT(t,r);return{payload:e}}),km=T("context/add",e=>MT(e.contextKey,e.contextValue)),Om=T("context/remove",e=>_(e,G));var jT=ce(Cl(),e=>{e.addCase(Pm,(t,r)=>{t.contextValues=r.payload}).addCase(km,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Om,(t,r)=>{delete t.contextValues[r.payload]}).addCase(Ze.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});function MB(e){return e.addReducers({context:jT}),{addContext:km,removeContext:Om,setContext:Pm}}d();c();l();u();function jB(e){return e.addReducers({dateFacetSet:cn}),{deselectAllDateFacetValues:rf,registerDateFacet:nn,toggleSelectDateFacetValue:on,toggleExcludeDateFacetValue:an,updateDateFacetSortCriterion:tf,updateDateFacetValues:Pn}}d();c();l();u();function VB(e){return e.addReducers({numericFacetSet:fo}),{deselectAllNumericFacetValues:hf,registerNumericFacet:un,toggleSelectNumericFacetValue:ln,toggleExcludeNumericFacetValue:dn,updateNumericFacetSortCriterion:gf,updateNumericFacetValues:kn}}d();c();l();u();function LB(e){return e.addReducers({fields:ms}),{registerFieldsToInclude:vo,enableFetchAllFields:Yf,disableFetchAllFields:Kf,fetchFieldsDescription:Jf}}d();c();l();u();function UB(e){return e.addReducers({folding:Wf}),{registerFolding:NE,loadCollection:$f}}d();c();l();u();function QB(e){return e.addReducers({generatedAnswer:hs}),{generateAnswer:fd,resetAnswer:ar,setAnswerGenerationMode:td}}d();c();l();u();function BB(e){return e.addReducers({insightInterface:Un}),{fetch:jr}}d();c();l();u();function GB(e){return e.addReducers({querySet:Cs}),{registerQuerySetQuery:As,updateQuerySetQuery:bi}}d();c();l();u();function $B(e){return e.addReducers({search:xe}),{executeSearch:bb,fetchFacetValues:wb,fetchMoreResults:Rb,fetchPage:xb,fetchQuerySuggestions:kl,registerQuerySuggest:go}}d();c();l();u();function HB(e){return e.addReducers({}),{logContextChanged:Sb,logExpandToFullUI:RT}}d();c();l();u();function zB(e){return e.addReducers({insightUserActions:Im}),{registerUserActions:Os,fetchUserActions:bo}}d();c();l();u();function WB(e){return e.addReducers({querySuggest:dm,querySet:Cs}),{clearQuerySuggest:yo,fetchQuerySuggestions:fs,registerQuerySuggest:go,selectQuerySuggestion:ho}}d();c();l();u();function YB(e){return e.addReducers({questionAnswering:gn}),{collapseSmartSnippet:Is,expandSmartSnippet:ws,dislikeSmartSnippet:Fs,likeSmartSnippet:Es,openFeedbackModal:Ts,closeFeedbackModal:Co,expandSmartSnippetRelatedQuestion:Ps,collapseSmartSnippetRelatedQuestion:ks}}d();c();l();u();d();c();l();u();d();c();l();u();function VT(){return{results:[],maxLength:10}}var LT=ce(VT(),e=>{e.addCase(sm,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(cm,t=>{t.results=[]}).addCase(fn,(t,r)=>{let n=r.payload;t.results=t.results.filter(i=>i.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});function KB(e){return e.addReducers({recentResults:LT}),{registerRecentResults:sm,clearRecentResults:cm,pushRecentResult:fn}}d();c();l();u();d();c();l();u();var JB=new Ee({content:new Be({required:!0}),conditions:new Be({required:!0}),priority:new ne({required:!1,default:0,min:0}),fields:new re({required:!1,each:G})});function UT(){let e=[],t=r=>{let n=JB.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new xo("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function QT(e){if(!XB(e))throw oe;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=UT();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(vo(i))},selectTemplate:r,selectLinkTemplate:n}}function XB(e){return e.addReducers({fields:ms}),!0}/**
|
|
46
46
|
* @license
|
|
47
47
|
*
|
|
48
48
|
* Copyright 2026 Coveo Solutions Inc.
|
|
@@ -75,4 +75,4 @@ fast-json-patch/module/duplex.mjs:
|
|
|
75
75
|
*)
|
|
76
76
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
77
77
|
|
|
78
|
-
window.coveoQuanticVersion = '3.36.
|
|
78
|
+
window.coveoQuanticVersion = '3.36.9';
|