@cludosearch/cludo-search-components 1.0.54 → 1.0.55
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/dist/csr/main.csr.js +1 -1
- package/dist/csr/main.csr.js.map +1 -1
- package/dist/csr/service-worker.js +1 -1
- package/dist/csr/service-worker.js.map +1 -1
- package/dist/ssr/main.ssr.js +1 -1
- package/dist/ssr/main.ssr.js.map +1 -1
- package/dist/ssr/service-worker.js +1 -1
- package/dist/ssr/service-worker.js.map +1 -1
- package/package.json +1 -1
package/dist/csr/main.csr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
/*! For license information please see main.csr.js.LICENSE.txt */
|
|
3
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CludoSearchComponents=t():e.CludoSearchComponents=t()}(this,(()=>(()=>{var e={971:(e,t)=>{"use strict";var n;t.d=void 0,(n=t.d||(t.d={})).AdvancedIntents="advanced insights",n.Intents="basic insights",n.Sayt="sayt",n.AnalyticsFilters="analytics filters",n.VoiceSearches="voice search",n.InstantSuggestions="instant suggestions",n.Advanced404Analytics="advanced 404 analytics",n.BannerStatistics="banner statistics",n.RelatedSearches="related searches",n.Basic404="basic 404",n.IntelligentRanking="intelligent rankings (ml)",n.GranularPermissions="granular permissions",n.TimeScheduledBanner="time-scheduled banners",n.GeoData="geo analytics",n.DeviceData="device analytics",n.AsyncCrawlingOneThousandPagesCrawledEveryDays="async crawling 1000 pages crawled every day",n.AsyncCrawlingTwoThousandPagesCrawledEveryTwoDays="async crawling 2000 pages crawled every 2 days",n.AsyncCrawlingThreeThousandPagesCrawledEveryThreeDays="async crawling 3000 pages crawled every 3 days",n.AsyncCrawlingFourThousandPagesCrawledEveryFourDays="async crawling 4000 pages crawled every 4 days",n.AsyncCrawlingFiveThousandPagesCrawledEveryFiveDays="async crawling 5000 pages crawled every 5 days",n.AsyncCrawlingSixThousandPagesCrawledEverySixDays="async crawling 6000 pages crawled every 6 days",n.AsyncCrawlingSevenThousandPagesCrawledEverySevenDays="async crawling 7000 pages crawled every 7 days",n.WebContentHighlighter="web content highlighter",n.Audiences="audiences"},470:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!l)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,u,s,d=arguments[0],f=1,p=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(o=c(t,n))&&(m&&o&&(i(o)||(u=l(o)))?(u?(u=!1,s=r&&l(r)?r:[]):s=r&&i(r)?r:{},a(d,{name:n,newValue:e(m,s,o)})):void 0!==o&&a(d,{name:n,newValue:o}));return d}},139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,u="";function s(e){return e?e.replace(c,u):u}e.exports=function(e,c){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];c=c||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function m(){var e={line:d,column:f};return function(t){return t.position=new h(e),b(),t}}function h(e){this.start=e,this.end={line:d,column:f},this.source=c.source}h.prototype.content=e;var g=[];function v(t){var n=new Error(c.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=c.source,n.line=d,n.column=f,n.source=e,!c.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){y(r)}function k(e){var t;for(e=e||[];t=S();)!1!==t&&e.push(t);return e}function S(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=m(),n=y(o);if(n){if(S(),!y(l))return v("property missing ':'");var r=y(i),c=e({type:"declaration",property:s(n[0].replace(t,u)),value:r?s(r[0].replace(t,u)):u});return y(a),c}}return b(),function(){var e,t=[];for(k(t);e=x();)!1!==e&&(t.push(e),k(t));return t}()}},738:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function l(){}l.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,l,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},471:(e,t)=>{"use strict";var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case a:case i:case f:case p:return e;default:switch(e=e&&e.$$typeof){case s:case u:case d:case h:case m:case c:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference"),t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=l,t.Lazy=h,t.Memo=m,t.Portal=o,t.Profiler=a,t.StrictMode=i,t.Suspense=f,t.SuspenseList=p,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return v(e)===u},t.isContextProvider=function(e){return v(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return v(e)===d},t.isFragment=function(e){return v(e)===l},t.isLazy=function(e){return v(e)===h},t.isMemo=function(e){return v(e)===m},t.isPortal=function(e){return v(e)===o},t.isProfiler=function(e){return v(e)===a},t.isStrictMode=function(e){return v(e)===i},t.isSuspense=function(e){return v(e)===f},t.isSuspenseList=function(e){return v(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===a||e===i||e===f||e===p||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===d||e.$$typeof===n||void 0!==e.getModuleId)},t.typeOf=v},143:(e,t,n)=>{"use strict";e.exports=n(471)},848:(e,t,n)=>{var r=n(139);function o(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var l,i,a=r(e),c="function"==typeof t,u=0,s=a.length;u<s;u++)l=(n=a[u]).property,i=n.value,c?t(l,i,n):i&&(o||(o={}),o[l]=i);return o}e.exports=o,e.exports.default=o}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Banner:()=>ao,BannerGroup:()=>uo,CheckboxFacet:()=>xl,CheckboxFacetItem:()=>kl,ClearAllFacets:()=>Il,CludoAutocompleteContainer:()=>Ml,CludoContext:()=>i,CludoInstanceController:()=>Uo,CludoResultsContainer:()=>jl,CludoSearchAutocomplete:()=>_o,CludoSearchForm:()=>zl,CludoSearchInput:()=>Bl,CludoSearchResults:()=>xo,CludoSortPicker:()=>qo,CludoWrapper:()=>Dl,ComponentsController:()=>Ho,CurrentFacets:()=>Al,CustomResult:()=>$r,DidYouMean:()=>so,EventControllerContext:()=>a,FacetGroup:()=>bl,FragmentHighlight:()=>Gr,FragmentHighlightGroup:()=>Xr,GenerativeResponseModule:()=>Ur,LoadMoreResults:()=>bo,Pagination:()=>io,RadioFacet:()=>wl,RadioFacetItem:()=>Cl,ResultBadge:()=>no,ResultBreadcrumbs:()=>_l,ResultContext:()=>Kr,ResultCount:()=>fo,ResultDescription:()=>Jr,ResultImage:()=>Ol,ResultLink:()=>Qr,ResultTitle:()=>Zr,ResultUrl:()=>eo,ResultsList:()=>vo,ResultsPerPage:()=>gl,SaytCategorizedResult:()=>yl,SaytRecentSearch:()=>Po,SaytResult:()=>wo,SaytSuggestion:()=>To,SearchInput:()=>ql,StandardFacet:()=>nl,StandardFacetItem:()=>Yo,StandardLoader:()=>go,StandardResult:()=>oo,TemplateType:()=>jo,autocompleteHandleInputBlur:()=>Io,autocompleteHandleInputChange:()=>Oo,autocompleteHandleInputKeyDown:()=>Ao,composeControls:()=>ll,composeResults:()=>Co,getFieldValue:()=>Fr,getFieldValues:()=>Rr,getFormattedHTML:()=>Ir,getHighlightsOrValues:()=>Nr,getHighlightsOrValuesArray:()=>Ar,getPublicSettings:()=>dl,getUrl:()=>Tr,hasField:()=>Pr,initCludo:()=>pl,initCludoWithPublicSettings:()=>ml,injectCoreScript:()=>fl,isAutocompleteItem:()=>_r,useAutocomplete:()=>No,useBanners:()=>co,useEndlessScroll:()=>Wl,useFacet:()=>Qo,useFacetGroup:()=>rl,usePagination:()=>lo,useSearchInput:()=>Hl,useSearchResults:()=>Cr,useSortBy:()=>Vo});var e={};n.r(e),n.d(e,{attentionMarkers:()=>It,contentInitial:()=>Tt,disable:()=>Ot,document:()=>wt,flow:()=>Ft,flowInitial:()=>Pt,insideSpan:()=>At,string:()=>Rt,text:()=>Nt});var t={};n.r(t),n.d(t,{boolean:()=>wn,booleanish:()=>Tn,commaOrSpaceSeparated:()=>An,commaSeparated:()=>Nn,number:()=>Fn,overloadedBoolean:()=>Pn,spaceSeparated:()=>Rn});const o=require("react");var l=n.n(o),i=l().createContext({}),a=l().createContext({});function c(){return{context:(0,o.useContext)(i),eventController:(0,o.useContext)(a)}}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)},s=function(e,t,n,r){return new(n||(n=Promise))((function(o,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function a(e){try{c(r.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},d=function(e,t){var n,r,o,l,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},f=l().createContext({});function p(e){var t;return(null===(t=e.theme)||void 0===t?void 0:t.length)?l().createElement(f.Provider,{value:e},l().createElement("div",{className:e.theme},e.children)):l().createElement(l().Fragment,null,e.children)}function m(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return[(0,o.useContext)(f)&&!t?e:"",n.filter(Boolean).join(" ")].join(" ")}function h(e){var t=(0,o.useState)(""),n=t[0],r=t[1],i=e.feedbackCommentPrompt||"Want to add a comment?",a=e.feedbackCommentPromptPlaceholder||"Leave us a comment here",c=e.feedbackSubmitButtonText||"Submit",u=m("cludo-display-flex cludo-column cludo-align-items-start cludo-width-100",e.disableTheme),s=m("cludo-font-size-sm cludo-m-0 cludo-mb-2",e.disableTheme),d=m("ai-summary-feedback-comment-input cludo-resize-vertical cludo-font-family-default cludo-bg-transparent cludo-border-1-black cludo-border-radius-2 cludo-py-3 cludo-px-3 cludo-font-size-sm",e.disableTheme),f=m("ai-summary-feedback-submit-button cludo-bg-transparent cludo-px-3 cludo-border-radius-2 cludo-border-1-black cludo-cursor-pointer cludo-bg-hover-neutral-n10",e.disableTheme);return l().createElement("div",{className:"cludo-ai-summary-feedback__comment cludo-display-flex cludo-column cludo-align-items-start cludo-width-100"+u},l().createElement("p",{className:"cludo-ai-summary-feedback__comment-prompt "+s},i),l().createElement("textarea",{className:"cludo-ai-summary-feedback__comment-input cludo-width-100 "+d,maxLength:500,placeholder:a,onChange:function(e){r(e.target.value)}}),l().createElement("div",{className:"cludo-ai-summary-feedback__comment-buttons cludo-display-flex cludo-width-100 cludo-justify-content-end cludo-mt-3"},l().createElement("button",{className:"cludo-ai-summary-feedback__comment-submit-button "+f,"aria-label":"Submit",onClick:function(){return e.onCommentSubmit(n)}},c)))}function g(e){var t=e.feedbackCTA||"Was this helpful?",n=e.feedbackPositiveIcon||l().createElement("div",{className:"ai-summary-feedback-icon"},l().createElement("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M4.04108 10.5817C4.48801 10.6836 4.93494 10.7792 5.38854 10.862C6.29574 11.034 7.20961 11.1868 8.13015 11.276C8.39697 11.3015 8.66379 11.3206 8.93062 11.327C9.23079 11.3334 9.53097 11.327 9.83114 11.3334C9.96455 11.3334 10.1046 11.327 10.238 11.3079C10.5716 11.2569 10.9051 11.1232 11.1319 10.8747C11.3387 10.6518 11.4321 10.3652 11.4588 10.0722L11.8123 6.09109C11.8123 6.09109 12.1125 4.5114 10.4248 4.60058C10.4248 4.60058 9.4109 4.58147 8.1635 4.66428C8.1635 4.66428 8.69715 2.81706 8.7972 1.7788C8.7972 1.7788 9.05069 0.899782 8.23021 0.695952C8.23021 0.695952 7.36303 0.460273 7.00949 1.32655C7.00949 1.32655 6.03559 4.56873 3.97438 5.07194C3.97438 5.07194 3.8343 5.11016 3.72757 5.12926C3.72757 5.12926 2.9271 5.16748 2.90042 5.63247V9.91291C2.90042 9.91291 2.85372 10.225 3.21393 10.3397C3.21393 10.3397 3.40738 10.4034 3.52078 10.4289L4.02774 10.569L4.04108 10.5817Z",stroke:"#101828",strokeWidth:"1.25",strokeLinejoin:"round"}),l().createElement("path",{d:"M1.16602 5.34583V10.1295",stroke:"#101828",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}))),r=e.feedbackNegativeIcon||l().createElement("div",{className:"ai-summary-feedback-icon"},l().createElement("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M8.95892 1.41833C8.51199 1.31642 8.06506 1.22087 7.61146 1.13807C6.70426 0.966084 5.79039 0.813211 4.86985 0.724035C4.60303 0.698557 4.33621 0.679447 4.06938 0.673078C3.76921 0.666708 3.46903 0.673078 3.16886 0.666708C3.03545 0.666708 2.89536 0.673077 2.76195 0.692186C2.42842 0.743144 2.09489 0.876908 1.8681 1.12533C1.66131 1.34827 1.56792 1.6349 1.54124 1.92791L1.1877 5.90897C1.1877 5.90897 0.88752 7.48866 2.57518 7.39948C2.57518 7.39948 3.5891 7.41859 4.8365 7.33579C4.8365 7.33579 4.30285 9.183 4.2028 10.2213C4.2028 10.2213 3.94931 11.1003 4.76979 11.3041C4.76979 11.3041 5.63697 11.5398 5.99051 10.6735C5.99051 10.6735 6.96441 7.43133 9.02562 6.92812C9.02562 6.92812 9.1657 6.88991 9.27243 6.8708C9.27243 6.8708 10.0729 6.83258 10.0996 6.36759V2.08715C10.0996 2.08715 10.1463 1.77504 9.78607 1.66038C9.78607 1.66038 9.59262 1.59668 9.47922 1.57121L8.97226 1.43107L8.95892 1.41833Z",stroke:"#101828",strokeWidth:"1.25",strokeLinejoin:"round"}),l().createElement("path",{d:"M11.834 6.65424V1.87059",stroke:"#101828",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}))),o=m("cludo-font-size-sm cludo-m-0",e.disableTheme),i=m("cludo-gap-1 cludo-display-flex cludo-m-0",e.disableTheme),a=m("ai-summary-feedback-button cludo-bg-transparent cludo-display-flex cludo-justify-content-center cludo-align-items-center cludo-width-sm cludo-height-sm cludo-p-0 cludo-cursor-pointer cludo-bg-hover-neutral-n10",e.disableTheme);return l().createElement(l().Fragment,null,l().createElement("p",{className:"cludo-ai-summary-feedback__cta "+o},t),l().createElement("div",{className:"cludo-ai-summary-feedback__buttons "+i},l().createElement("button",{className:"cludo-ai-summary-feedback__positive-button "+a,"aria-label":"Yes",onClick:e.onPositiveFeedbackClick},n),l().createElement("button",{className:"cludo-ai-summary-feedback__negative-button "+a,"aria-label":"No",onClick:e.onNegativeFeedbackClick},r)))}function v(e){var t=e.feedbackFollowUpPrompt||"What was wrong?",n=e.feedbackFollowUpQuestions||["It's not what I was looking for","I'm missing information","Other"],r=m("cludo-font-size-sm cludo-m-0",e.disableTheme),o=m("ai-summary-feedback-follow-up-button cludo-border-1-black cludo-bg-transparent cludo-mt-2 cludo-font-size-sm cludo-px-3 cludo-cursor-pointer cludo-bg-hover-neutral-n10",e.disableTheme);return l().createElement("div",{className:"cludo-ai-summary-feedback__follow-up cludo-display-flex cludo-column cludo-align-items-end"},l().createElement("p",{className:"cludo-ai-summary-feedback__follow-up-prompt "+r},t),null==n?void 0:n.map((function(t,r){return l().createElement("button",{className:"cludo-ai-summary-feedback__follow-up-answer "+o,key:"followup-".concat(r),"aria-label":t,onClick:function(){return e.onSelectFeedbackReason(n[r]||"")}},t)})))}function y(e){var t=e.feedbackThankYouMessage||"Thank you!",n=e.feedbackThankYouMessageIcon||l().createElement("div",{className:"ai-summary-feedback-thank-you-icon cludo-mr-1"},l().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M4.9987 7.99992L6.9987 9.99992L10.9987 5.99992M14.6654 7.99992C14.6654 11.6818 11.6806 14.6666 7.9987 14.6666C4.3168 14.6666 1.33203 11.6818 1.33203 7.99992C1.33203 4.31802 4.3168 1.33325 7.9987 1.33325C11.6806 1.33325 14.6654 4.31802 14.6654 7.99992Z",stroke:"#101828",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}))),r=m("cludo-font-size-sm",e.disableTheme);return l().createElement("div",{className:"cludo-ai-summary-feedback__thank-you-message cludo-display-flex cludo-align-items-center "+r},n," ",t)}function b(e){var t=(0,o.useState)(!0),n=t[0],r=t[1],i=(0,o.useState)(!1),a=i[0],c=i[1],u=(0,o.useState)(!1),s=u[0],d=u[1],f=(0,o.useState)(!1),p=f[0],m=f[1];return l().createElement("div",{className:"cludo-ai-summary-feedback cludo-display-flex cludo-align-items-center cludo-justify-content-end cludo-gap-1 cludo-mt-3"},n&&l().createElement(g,{feedbackCTA:e.feedbackCTA,feedbackPositiveIcon:e.feedbackPositiveIcon,feedbackNegativeIcon:e.feedbackNegativeIcon,onPositiveFeedbackClick:function(){e.onSubmitFeedback({rating:"positive"}),r(!1),m(!0)},onNegativeFeedbackClick:function(){e.onSubmitFeedback({rating:"negative"}),r(!1),c(!0)}}),a&&l().createElement(v,{feedbackFollowUpPrompt:e.feedbackFollowUpPrompt,feedbackFollowUpQuestions:e.feedbackFollowUpQuestions,onSelectFeedbackReason:function(t){e.onSubmitFeedback({selectedReason:t||""}),c(!1),d(!0)}}),s&&l().createElement(h,{feedbackCommentPrompt:e.feedbackCommentPrompt,feedbackCommentPromptPlaceholder:e.feedbackCommentPromptPlaceholder,feedbackSubmitButtonText:e.feedbackSubmitButtonText,onCommentSubmit:function(t){e.onSubmitFeedback({comment:t}),d(!1),m(!0)}}),p&&l().createElement(y,{feedbackThankYouMessage:e.feedbackThankYouMessage,feedbackThankYouMessageIcon:e.feedbackThankYouMessageIcon}))}function k(e){var t=e.chatIcon||l().createElement("div",{className:"cludo-ai-icon cludo-display-flex cludo-align-items-center cludo-justify-content-center"},l().createElement("svg",{width:"17",height:"12",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M14 9.66667H14.9167C15.4229 9.66667 15.8333 9.25626 15.8333 8.75V6.91667C15.8333 6.41041 15.4229 6 14.9167 6H14",stroke:"#181818"}),l().createElement("rect",{x:"3",y:"4.16663",width:"11",height:"7.33333",rx:"2",stroke:"#181818"}),l().createElement("path",{d:"M2.99935 6H2.08268C1.57642 6 1.16602 6.41041 1.16602 6.91667V8.75C1.16602 9.25626 1.57642 9.66667 2.08268 9.66667H2.99935",stroke:"#181818"}),l().createElement("circle",{cx:"5.7487",cy:"7.83329",r:"0.5",fill:"#181818",stroke:"#181818",strokeWidth:"0.833333"}),l().createElement("circle",{cx:"11.2487",cy:"7.83329",r:"0.5",fill:"#181818",stroke:"#181818",strokeWidth:"0.833333"}),l().createElement("path",{d:"M8.5 2.33337V4.16671",stroke:"#181818"}),l().createElement("circle",{cx:"8.4987",cy:"1.41667",r:"0.916667",stroke:"#181818"}))),n=m("cludo-generative-ai__icon-container cludo-mr-3",e.disableTheme);return l().createElement("div",{className:n},t)}function S(e){var t,n=null===(t=e.isLoading)||void 0===t||t,r=e.loadingElement||l().createElement("div",{className:"typing"},l().createElement("div",{className:"typing__dot"}),l().createElement("div",{className:"typing__dot"}),l().createElement("div",{className:"typing__dot"}));return n&&l().createElement("div",null,r)||l().createElement(l().Fragment,null)}var x=n(738);function C(e){return e&&"object"==typeof e?"position"in e||"type"in e?w(e.position):"start"in e||"end"in e?w(e):"line"in e||"column"in e?E(e):"":""}function E(e){return T(e&&e.line)+":"+T(e&&e.column)}function w(e){return E(e&&e.start)+"-"+E(e&&e.end)}function T(e){return e&&"number"==typeof e?e:1}class P extends Error{constructor(e,t,n){const r=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"==typeof t&&(n=t,t=void 0),"string"==typeof n){const e=n.indexOf(":");-1===e?r[1]=n:(r[0]=n.slice(0,e),r[1]=n.slice(e+1))}t&&("type"in t||"position"in t?t.position&&(o=t.position):"start"in t||"end"in t?o=t:("line"in t||"column"in t)&&(o.start=t)),this.name=C(t)||"1:1",this.message="object"==typeof e?e.message:e,this.stack="","object"==typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}P.prototype.file="",P.prototype.name="",P.prototype.reason="",P.prototype.message="",P.prototype.stack="",P.prototype.fatal=null,P.prototype.column=null,P.prototype.line=null,P.prototype.source=null,P.prototype.ruleId=null,P.prototype.position=null;const F=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');O(e);let n,r=0,o=-1,l=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;l--;)if(47===e.charCodeAt(l)){if(n){r=l+1;break}}else o<0&&(n=!0,o=l+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,a=t.length-1;for(;l--;)if(47===e.charCodeAt(l)){if(n){r=l+1;break}}else i<0&&(n=!0,i=l+1),a>-1&&(e.charCodeAt(l)===t.charCodeAt(a--)?a<0&&(o=l):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},R=function(e){if(O(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},N=function(e){O(e);let t,n=e.length,r=-1,o=0,l=-1,i=0;for(;n--;){const a=e.charCodeAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?l<0?l=n:1!==i&&(i=1):l>-1&&(i=-1);else if(t){o=n+1;break}}return l<0||r<0||0===i||1===i&&l===r-1&&l===o+1?"":e.slice(l,r)},A=function(...e){let t,n=-1;for(;++n<e.length;)O(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){O(e);const t=47===e.charCodeAt(0);let n=function(e,t){let n,r,o="",l=0,i=-1,a=0,c=-1;for(;++c<=e.length;){if(c<e.length)n=e.charCodeAt(c);else{if(47===n)break;n=47}if(47===n){if(i===c-1||1===a);else if(i!==c-1&&2===a){if(o.length<2||2!==l||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",l=0):(o=o.slice(0,r),l=o.length-1-o.lastIndexOf("/")),i=c,a=0;continue}}else if(o.length>0){o="",l=0,i=c,a=0;continue}t&&(o=o.length>0?o+"/..":"..",l=2)}else o.length>0?o+="/"+e.slice(i+1,c):o=e.slice(i+1,c),l=c-i-1;i=c,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},I="/";function O(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _=function(){return"/"};function L(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const D=["history","path","basename","stem","extname","dirname"];class M{constructor(e){let t;t=e?"string"==typeof e||function(e){return x(e)}(e)?{value:e}:L(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=_(),this.value,this.stored,this.result,this.map;let n,r=-1;for(;++r<D.length;){const e=D[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)D.includes(n)||(this[n]=t[n])}get path(){return this.history[this.history.length-1]}set path(e){L(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!L(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.charCodeAt(n)&&50===t.charCodeAt(n+1)){const e=t.charCodeAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),B(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return"string"==typeof this.path?R(this.path):void 0}set dirname(e){z(this.basename,"dirname"),this.path=A(e||"",this.basename)}get basename(){return"string"==typeof this.path?F(this.path):void 0}set basename(e){B(e,"basename"),j(e,"basename"),this.path=A(this.dirname||"",e)}get extname(){return"string"==typeof this.path?N(this.path):void 0}set extname(e){if(j(e,"extname"),z(this.dirname,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=A(this.dirname,this.stem+(e||""))}get stem(){return"string"==typeof this.path?F(this.path,this.extname):void 0}set stem(e){B(e,"stem"),j(e,"stem"),this.path=A(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,t,n){const r=new P(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=null,r}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}}function j(e,t){if(e&&e.includes(I))throw new Error("`"+t+"` cannot be a path: did not expect `"+I+"`")}function B(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function z(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function H(e){if(e)throw e}var U=n(470);function V(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const q=function e(){const t=function(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(l,...i){const a=e[++n];let c=-1;if(l)r(l);else{for(;++c<t.length;)null!==i[c]&&void 0!==i[c]||(i[c]=t[c]);t=i,a?function(e,t){let n;return function(...t){const l=e.length>t.length;let i;l&&t.push(r);try{i=e.apply(this,t)}catch(e){if(l&&n)throw e;return r(e)}l||(i&&i.then&&"function"==typeof i.then?i.then(o,r):i instanceof Error?r(i):o(i))};function r(e,...r){n||(n=!0,t(e,...r))}function o(e){r(null,e)}}(a,o)(...i):r(null,...i)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}(),n=[];let r,o={},l=-1;return i.data=function(e,t){return"string"==typeof e?2===arguments.length?($("data",r),o[e]=t,i):W.call(o,e)&&o[e]||null:e?($("data",r),o=e,i):o},i.Parser=void 0,i.Compiler=void 0,i.freeze=function(){if(r)return i;for(;++l<n.length;){const[e,...r]=n[l];if(!1===r[0])continue;!0===r[0]&&(r[0]=void 0);const o=e.call(i,...r);"function"==typeof o&&t.use(o)}return r=!0,l=Number.POSITIVE_INFINITY,i},i.attachers=n,i.use=function(e,...t){let l;if($("use",r),null==e);else if("function"==typeof e)s(e,...t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?u(e):c(e)}return l&&(o.settings=Object.assign(o.settings||{},l)),i;function a(e){if("function"==typeof e)s(e);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,...n)}else c(e)}}function c(e){u(e.plugins),e.settings&&(l=Object.assign(l||{},e.settings))}function u(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)a(e[t])}}function s(e,t){let r,o=-1;for(;++o<n.length;)if(n[o][0]===e){r=n[o];break}r?(V(r[1])&&V(t)&&(t=U(!0,r[1],t)),r[1]=t):n.push([...arguments])}},i.parse=function(e){i.freeze();const t=X(e),n=i.Parser;return Y("parse",n),Q(n,"parse")?new n(String(t),t).parse():n(String(t),t)},i.stringify=function(e,t){i.freeze();const n=X(t),r=i.Compiler;return K("stringify",r),Z(e),Q(r,"compile")?new r(e,n).compile():r(e,n)},i.run=function(e,n,r){if(Z(e),i.freeze(),r||"function"!=typeof n||(r=n,n=void 0),!r)return new Promise(o);function o(o,l){t.run(e,X(n),(function(t,n,i){n=n||e,t?l(t):o?o(n):r(null,n,i)}))}o(null,r)},i.runSync=function(e,t){let n,r;return i.run(e,t,(function(e,t){H(e),n=t,r=!0})),G("runSync","run",r),n},i.process=function(e,t){if(i.freeze(),Y("process",i.Parser),K("process",i.Compiler),!t)return new Promise(n);function n(n,r){const o=X(e);function l(e,o){e||!o?r(e):n?n(o):t(null,o)}i.run(i.parse(o),o,((e,t,n)=>{if(!e&&t&&n){const o=i.stringify(t,n);null==o||("string"==typeof(r=o)||x(r)?n.value=o:n.result=o),l(e,n)}else l(e);var r}))}n(null,t)},i.processSync=function(e){let t;i.freeze(),Y("processSync",i.Parser),K("processSync",i.Compiler);const n=X(e);return i.process(n,(function(e){t=!0,H(e)})),G("processSync","process",t),n},i;function i(){const t=e();let r=-1;for(;++r<n.length;)t.use(...n[r]);return t.data(U(!0,{},o)),t}}().freeze(),W={}.hasOwnProperty;function Q(e,t){return"function"==typeof e&&e.prototype&&(function(e){let t;for(t in e)if(W.call(e,t))return!0;return!1}(e.prototype)||t in e.prototype)}function Y(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Parser`")}function K(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Compiler`")}function $(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Z(e){if(!V(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function G(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function X(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new M(e)}const J={};function ee(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return te(e.children,t,n)}return Array.isArray(e)?te(e,t,n):""}function te(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ee(e[o],t,n);return r.join("")}function ne(e,t,n,r){const o=e.length;let l,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function re(e,t){return e.length>0?(ne(e,e.length,0,t),e):t}const oe={}.hasOwnProperty;function le(e,t){let n;for(n in t){const r=(oe.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){oe.call(r,l)||(r[l]=[]);const e=o[l];ie(r[l],Array.isArray(e)?e:e?[e]:[])}}}function ie(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ne(e,0,0,r)}const ae=be(/[A-Za-z]/),ce=be(/[\dA-Za-z]/),ue=be(/[#-'*+\--9=?A-Z^-~]/);function se(e){return null!==e&&(e<32||127===e)}const de=be(/\d/),fe=be(/[\dA-Fa-f]/),pe=be(/[!-/:-@[-`{-~]/);function me(e){return null!==e&&e<-2}function he(e){return null!==e&&(e<0||32===e)}function ge(e){return-2===e||-1===e||32===e}const ve=be(/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/),ye=be(/\s/);function be(e){return function(t){return null!==t&&e.test(String.fromCharCode(t))}}function ke(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let l=0;return function(r){return ge(r)?(e.enter(n),i(r)):t(r)};function i(r){return ge(r)&&l++<o?(e.consume(r),i):(e.exit(n),t(r))}}const Se={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ke(e,t,"linePrefix");e.consume(n)}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):me(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}},xe={tokenize:function(e){const t=this,n=[];let r,o,l,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,c,u)(r)}return u(r)}function c(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let o,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){o=t.events[l][1].end;break}v(i);let a=n;for(;a<t.events.length;)t.events[a][1].end=Object.assign({},o),a++;return ne(t.events,l+1,0,t.events.slice(n)),t.events.length=a,u(e)}return a(e)}function u(o){if(i===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return m(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ce,s,d)(o)}function s(e){return r&&y(),v(i),f(e)}function d(e){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ce,p,m)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):me(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<l&&(!r.events[e][1].end||r.events[e][1].end.offset>l))return;const n=t.events.length;let o,a,c=n;for(;c--;)if("exit"===t.events[c][0]&&"chunkFlow"===t.events[c][1].type){if(o){a=t.events[c][1].end;break}o=!0}for(v(i),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},a),e++;ne(t.events,c+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Ce={tokenize:function(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},Ee={tokenize:function(e,t,n){return function(t){return ge(t)?ke(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||me(e)?t(e):n(e)}},partial:!0};function we(e){const t={};let n,r,o,l,i,a,c,u=-1;for(;++u<e.length;){for(;u in t;)u=t[u];if(n=e[u],u&&"chunkFlow"===n[1].type&&"listItemPrefix"===e[u-1][1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Te(e,u)),u=t[u],c=!0);else if(n[1]._container){for(o=u,r=void 0;o--&&(l=e[o],"lineEnding"===l[1].type||"lineEndingBlank"===l[1].type);)"enter"===l[0]&&(r&&(e[r][1].type="lineEndingBlank"),l[1].type="lineEnding",r=o);r&&(n[1].end=Object.assign({},e[r][1].start),i=e.slice(r,u),i.unshift(n),ne(e,r,u-r+1,i))}}return!c}function Te(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const l=[],i=n._tokenizer||r.parser[n.contentType](n.start),a=i.events,c=[],u={};let s,d,f=-1,p=n,m=0,h=0;const g=[h];for(;p;){for(;e[++o][1]!==p;);l.push(o),p._tokenizer||(s=r.sliceStream(p),p.next||s.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(s),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)"exit"===a[f][0]&&"enter"===a[f-1][0]&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){const t=a.slice(g[f],g[f+1]),n=l.pop();c.unshift([n,n+t.length-1]),ne(e,n,2,t)}for(f=-1;++f<c.length;)u[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return u}const Pe={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):me(t)?e.check(Fe,l,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function l(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return we(e),e}},Fe={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ke(e,o,"linePrefix")};function o(o){if(null===o||me(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}},partial:!0},Re={tokenize:function(e){const t=this,n=e.attempt(Ee,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,ke(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Pe,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},Ne={resolveAll:_e()},Ae=Oe("string"),Ie=Oe("text");function Oe(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,l,i);return l;function l(e){return c(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return c(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function c(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:_e("text"===e?Le:void 0)}}function _e(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function Le(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let l,i=o.length,a=-1,c=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)c++,a--;if(a)break;a=-1}else if(-2===e)l=!0,c++;else if(-1!==e){i++;break}}if(c){const o={type:n===e.length||l||c<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-c,offset:r.end.offset-c,_index:r.start._index+i,_bufferIndex:i?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},o.start),r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}function De(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const l=e[o].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}function Me(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},l=[];let i=[],a=[],c=!0;const u={consume:function(e){me(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=e,c=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=m(),s.events.push(["enter",n,s]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=m(),s.events.push(["exit",t,s]),t},attempt:v((function(e,t){y(e,t.from)})),check:v(g),interrupt:v(g,{interrupt:!0})},s={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const l=e[n];let i;if("string"==typeof l)i=l;else switch(l){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(l)}o=-2===l,r.push(i)}return r.join("")}(p(e),t)},now:m,defineSkip:function(e){o[e.line]=e.column,b()},write:function(e){return i=re(i,e),function(){let e;for(;r._index<i.length;){const t=i[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}(),null!==i[i.length-1]?[]:(y(t,0),s.events=De(l,s.events,s),s.events)}};let d,f=t.tokenize.call(s,u);return t.resolveAll&&l.push(t),s;function p(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,l=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,l)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}l>0&&i.push(e[o].slice(0,l))}return i}(i,e)}function m(){const{line:e,column:t,offset:n,_index:o,_bufferIndex:l}=r;return{line:e,column:t,offset:n,_index:o,_bufferIndex:l}}function h(e){c=void 0,d=e,f=f(e)}function g(e,t){t.restore()}function v(e,t){return function(n,o,l){let i,d,f,p;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):(h=n,function(e){const t=null!==e&&h[e],n=null!==e&&h.null;return g([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});var h;function g(e){return i=e,d=0,0===e.length?l:v(e[d])}function v(e){return function(n){return p=function(){const e=m(),t=s.previous,n=s.currentConstruct,o=s.events.length,l=Array.from(a);return{restore:function(){r=e,s.previous=t,s.currentConstruct=n,s.events.length=o,a=l,b()},from:o}}(),f=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name)?k():e.tokenize.call(t?Object.assign(Object.create(s),t):s,u,y,k)(n)}}function y(t){return c=!0,e(f,p),o}function k(e){return c=!0,p.restore(),++d<i.length?v(i[d]):l}}}function y(e,t){e.resolveAll&&!l.includes(e)&&l.push(e),e.resolve&&ne(s.events,t,s.events.length-t,e.resolve(s.events.slice(t),s)),e.resolveTo&&(s.events=e.resolveTo(s.events,s))}function b(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const je={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,l(e)}(t)};function l(l){return l===r?(e.enter("thematicBreakSequence"),i(l)):o>=3&&(null===l||me(l))?(e.exit("thematicBreak"),t(l)):n(l)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),ge(t)?ke(e,l,"whitespace")(t):l(t))}}},Be={name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let l=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:de(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(je,n,c)(t):c(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return de(t)&&++i<10?(e.consume(t),a):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),c(t)):n(t)}function c(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Ee,r.interrupt?n:u,e.attempt(ze,d,s))}function u(e){return r.containerState.initialBlankLine=!0,l++,d(e)}function s(t){return ge(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ee,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!ge(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(He,t,o)(n))}));function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(Be,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},ze={tokenize:function(e,t,n){const r=this;return ke(e,(function(e){const o=r.events[r.events.length-1];return!ge(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},He={tokenize:function(e,t,n){const r=this;return ke(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},Ue={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return ge(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){return ge(t)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(Ue,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function Ve(e,t,n,r,o,l,i,a,c){const u=c||Number.POSITIVE_INFINITY;let s=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(l),e.consume(t),e.exit(l),d):null===t||32===t||41===t||se(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(t))};function d(n){return 62===n?(e.enter(l),e.consume(n),e.exit(l),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||me(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function m(o){return s||null!==o&&41!==o&&!he(o)?s<u&&40===o?(e.consume(o),s++,m):41===o?(e.consume(o),s--,m):null===o||32===o||40===o||se(o)?n(o):(e.consume(o),92===o?h:m):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),m):m(t)}}function qe(e,t,n,r,o,l){const i=this;let a,c=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(l),u};function u(d){return c>999||null===d||91===d||93===d&&!a||94===d&&!c&&"_hiddenFootnoteSupport"in i.parser.constructs?n(d):93===d?(e.exit(l),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),s(d))}function s(t){return null===t||91===t||93===t||me(t)||c++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a||(a=!ge(t)),92===t?d:s)}function d(t){return 91===t||92===t||93===t?(e.consume(t),c++,s):s(t)}}function We(e,t,n,r,o,l){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(l),c(n))}function c(t){return t===i?(e.exit(l),a(i)):null===t?n(t):me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===i||null===t||me(t)?(e.exit("chunkString"),c(t)):(e.consume(t),92===t?s:u)}function s(t){return t===i||92===t?(e.consume(t),u):u(t)}}function Qe(e,t){let n;return function r(o){return me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ge(o)?ke(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function Ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ke={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return qe.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function l(t){return o=Ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return he(t)?Qe(e,a)(t):a(t)}function a(t){return Ve(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function c(t){return e.attempt($e,u,u)(t)}function u(t){return ge(t)?ke(e,s,"whitespace")(t):s(t)}function s(l){return null===l||me(l)?(e.exit("definition"),r.parser.defined.push(o),t(l)):n(l)}}},$e={tokenize:function(e,t,n){return function(t){return he(t)?Qe(e,r)(t):n(t)};function r(t){return We(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return ge(t)?ke(e,l,"whitespace")(t):l(t)}function l(e){return null===e||me(e)?t(e):n(e)}},partial:!0},Ze={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?l(e):n(e)}function l(t){return null===t?a(t):me(t)?e.attempt(Ge,l,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||me(t)?(e.exit("codeFlowValue"),l(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Ge={tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):ke(e,l,"linePrefix",5)(t)}function l(e){const l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(e):me(e)?o(e):n(e)}},partial:!0},Xe={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||he(t)?(e.exit("atxHeadingSequence"),l(t)):n(t)}function l(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||me(n)?(e.exit("atxHeading"),t(n)):ge(n)?ke(e,l,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),l(t))}function a(t){return null===t||35===t||he(t)?(e.exit("atxHeadingText"),l(t)):(e.consume(t),a)}},resolve:function(e,t){let n,r,o=e.length-2,l=3;return"whitespace"===e[l][1].type&&(l+=2),o-2>l&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(l===o-1||o-4>l&&"whitespace"===e[o-2][1].type)&&(o-=l+1===o?2:4),o>l&&(n={type:"atxHeadingText",start:e[l][1].start,end:e[o][1].end},r={type:"chunkText",start:e[l][1].start,end:e[o][1].end,contentType:"text"},ne(e,l,o-l+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},Je={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let o;return function(t){let i,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),l(t)}(t))};function l(t){return t===o?(e.consume(t),l):(e.exit("setextHeadingLineSequence"),ge(t)?ke(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||me(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,o,l=e.length;for(;l--;)if("enter"===e[l][0]){if("content"===e[l][1].type){n=l;break}"paragraph"===e[l][1].type&&(r=l)}else"content"===e[l][1].type&&e.splice(l,1),o||"definition"!==e[l][1].type||(o=l);const i={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=i,e.push(["exit",i,t]),e}},et=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tt=["pre","script","style","textarea"],nt={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let o,l,i,a,c;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u}(t)};function u(a){return 33===a?(e.consume(a),s):47===a?(e.consume(a),l=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:_):ae(a)?(e.consume(a),i=String.fromCharCode(a),m):n(a)}function s(l){return 45===l?(e.consume(l),o=2,d):91===l?(e.consume(l),o=5,a=0,f):ae(l)?(e.consume(l),o=4,r.interrupt?t:_):n(l)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:_):n(o)}function f(o){return o==="CDATA[".charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:T:f):n(o)}function p(t){return ae(t)?(e.consume(t),i=String.fromCharCode(t),m):n(t)}function m(a){if(null===a||47===a||62===a||he(a)){const c=47===a,u=i.toLowerCase();return c||l||!tt.includes(u)?et.includes(i.toLowerCase())?(o=6,c?(e.consume(a),h):r.interrupt?t(a):T(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):l?g(a):v(a)):(o=1,r.interrupt?t(a):T(a))}return 45===a||ce(a)?(e.consume(a),i+=String.fromCharCode(a),m):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:T):n(o)}function g(t){return ge(t)?(e.consume(t),g):E(t)}function v(t){return 47===t?(e.consume(t),E):58===t||95===t||ae(t)?(e.consume(t),y):ge(t)?(e.consume(t),v):E(t)}function y(t){return 45===t||46===t||58===t||95===t||ce(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),k):ge(t)?(e.consume(t),b):v(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),c=t,S):ge(t)?(e.consume(t),k):x(t)}function S(t){return t===c?(e.consume(t),c=null,C):null===t||me(t)?n(t):(e.consume(t),S)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||he(t)?b(t):(e.consume(t),x)}function C(e){return 47===e||62===e||ge(e)?v(e):n(e)}function E(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||me(t)?T(t):ge(t)?(e.consume(t),w):n(t)}function T(t){return 45===t&&2===o?(e.consume(t),N):60===t&&1===o?(e.consume(t),A):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),_):93===t&&5===o?(e.consume(t),O):!me(t)||6!==o&&7!==o?null===t||me(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),T):(e.exit("htmlFlowData"),e.check(rt,D,P)(t))}function P(t){return e.check(ot,F,D)(t)}function F(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return null===t||me(t)?P(t):(e.enter("htmlFlowData"),T(t))}function N(t){return 45===t?(e.consume(t),_):T(t)}function A(t){return 47===t?(e.consume(t),i="",I):T(t)}function I(t){if(62===t){const n=i.toLowerCase();return tt.includes(n)?(e.consume(t),L):T(t)}return ae(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),I):T(t)}function O(t){return 93===t?(e.consume(t),_):T(t)}function _(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),_):T(t)}function L(t){return null===t||me(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),L)}function D(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},rt={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Ee,t,n)}},partial:!0},ot={tokenize:function(e,t,n){const r=this;return function(t){return me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},lt={tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},it={name:"codeFenced",tokenize:function(e,t,n){const r=this,o={tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(t){return e.enter("codeFencedFence"),ge(t)?ke(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===l?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===l?(o++,e.consume(t),u):o>=a?(e.exit("codeFencedFenceSequence"),ge(t)?ke(e,s,"whitespace")(t):s(t)):n(t)}function s(r){return null===r||me(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let l,i=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,l=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(t)}(t)};function c(t){return t===l?(a++,e.consume(t),c):a<3?n(t):(e.exit("codeFencedFenceSequence"),ge(t)?ke(e,u,"whitespace")(t):u(t))}function u(n){return null===n||me(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(lt,p,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),s(n))}function s(t){return null===t||me(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(t)):ge(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(t)):96===t&&t===l?n(t):(e.consume(t),s)}function d(t){return null===t||me(t)?u(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||me(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(t)):96===t&&t===l?n(t):(e.consume(t),f)}function p(t){return e.attempt(o,y,m)(t)}function m(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&ge(t)?ke(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||me(t)?e.check(lt,p,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||me(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),v)}function y(n){return e.exit("codeFenced"),t(n)}},concrete:!0},at=document.createElement("i");function ct(e){const t="&"+e+";";at.innerHTML=t;const n=at.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const ut={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,l,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,l=ce,u(t))}function c(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=fe,u):(e.enter("characterReferenceValue"),o=7,l=de,u(t))}function u(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return l!==ce||ct(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return l(a)&&i++<o?(e.consume(a),u):n(a)}}},st={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return pe(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},dt={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ke(e,t,"linePrefix")}}},ft={name:"labelEnd",tokenize:function(e,t,n){const r=this;let o,l,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?s(t):(l=r.parser.defined.includes(Ye(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(pt,u,l?u:s)(t):91===t?e.attempt(mt,u,l?c:s)(t):l?u(t):s(t)}function c(t){return e.attempt(ht,u,s)(t)}function u(e){return t(e)}function s(e){return o._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,o,l,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=i);const c={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[o][1].end)},s={type:"labelText",start:Object.assign({},e[r+a+2][1].end),end:Object.assign({},e[o-2][1].start)};return l=[["enter",c,t],["enter",u,t]],l=re(l,e.slice(r+1,r+a+3)),l=re(l,[["enter",s,t]]),l=re(l,De(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),l=re(l,[["exit",s,t],e[o-2],e[o-1],["exit",u,t]]),l=re(l,e.slice(o+1)),l=re(l,[["exit",c,t]]),ne(e,r,e.length,l),e},resolveAll:function(e){let t=-1;for(;++t<e.length;){const n=e[t][1];"labelImage"!==n.type&&"labelLink"!==n.type&&"labelEnd"!==n.type||(e.splice(t+1,"labelImage"===n.type?4:2),n.type="data",t++)}return e}},pt={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return he(t)?Qe(e,o)(t):o(t)}function o(t){return 41===t?u(t):Ve(e,l,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function l(t){return he(t)?Qe(e,a)(t):u(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?We(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function c(t){return he(t)?Qe(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},mt={tokenize:function(e,t,n){const r=this;return function(t){return qe.call(r,e,o,l,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(Ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function l(e){return n(e)}}},ht={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},gt={name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),l):n(t)}function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:ft.resolveAll};function vt(e){return null===e||he(e)||ye(e)?1:ve(e)?2:void 0}const yt={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=vt(r);let l;return function(t){return l=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===l)return e.consume(a),i;const c=e.exit("attentionSequence"),u=vt(a),s=!u||2===u&&o||n.includes(a),d=!o||2===o&&u||n.includes(r);return c._open=Boolean(42===l?s:s&&(o||!d)),c._close=Boolean(42===l?d:d&&(u||!s)),t(a)}},resolveAll:function(e,t){let n,r,o,l,i,a,c,u,s=-1;for(;++s<e.length;)if("enter"===e[s][0]&&"attentionSequence"===e[s][1].type&&e[s][1]._close)for(n=s;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[n][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const d=Object.assign({},e[n][1].end),f=Object.assign({},e[s][1].start);bt(d,-a),bt(f,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},i={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[s][1].start),end:f},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[s][1].start)},r={type:a>1?"strong":"emphasis",start:Object.assign({},l.start),end:Object.assign({},i.end)},e[n][1].end=Object.assign({},l.start),e[s][1].start=Object.assign({},i.end),c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=re(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=re(c,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=re(c,De(t.parser.constructs.insideSpan.null,e.slice(n+1,s),t)),c=re(c,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[s][1].end.offset-e[s][1].start.offset?(u=2,c=re(c,[["enter",e[s][1],t],["exit",e[s][1],t]])):u=0,ne(e,n-1,s-n+3,c),s=n+c.length-u-2;break}for(s=-1;++s<e.length;)"attentionSequence"===e[s][1].type&&(e[s][1].type="data");return e}};function bt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kt={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ae(t)?(e.consume(t),l):c(t)}function l(e){return 43===e||45===e||46===e||ce(e)?(r=1,i(e)):c(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||ce(t))&&r++<32?(e.consume(t),i):(r=0,c(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||se(r)?n(r):(e.consume(r),a)}function c(t){return 64===t?(e.consume(t),u):ue(t)?(e.consume(t),c):n(t)}function u(e){return ce(e)?s(e):n(e)}function s(n){return 46===n?(e.consume(n),r=0,u):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||ce(t))&&r++<63){const n=45===t?d:s;return e.consume(t),n}return n(t)}}},St={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,l,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),c):47===t?(e.consume(t),k):63===t?(e.consume(t),y):ae(t)?(e.consume(t),C):n(t)}function c(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),l=0,p):ae(t)?(e.consume(t),v):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function s(t){return null===t?n(t):45===t?(e.consume(t),d):me(t)?(i=s,I(t)):(e.consume(t),s)}function d(t){return 45===t?(e.consume(t),f):s(t)}function f(e){return 62===e?A(e):45===e?d(e):s(e)}function p(t){return t==="CDATA[".charCodeAt(l++)?(e.consume(t),6===l?m:p):n(t)}function m(t){return null===t?n(t):93===t?(e.consume(t),h):me(t)?(i=m,I(t)):(e.consume(t),m)}function h(t){return 93===t?(e.consume(t),g):m(t)}function g(t){return 62===t?A(t):93===t?(e.consume(t),g):m(t)}function v(t){return null===t||62===t?A(t):me(t)?(i=v,I(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),b):me(t)?(i=y,I(t)):(e.consume(t),y)}function b(e){return 62===e?A(e):y(e)}function k(t){return ae(t)?(e.consume(t),S):n(t)}function S(t){return 45===t||ce(t)?(e.consume(t),S):x(t)}function x(t){return me(t)?(i=x,I(t)):ge(t)?(e.consume(t),x):A(t)}function C(t){return 45===t||ce(t)?(e.consume(t),C):47===t||62===t||he(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),A):58===t||95===t||ae(t)?(e.consume(t),w):me(t)?(i=E,I(t)):ge(t)?(e.consume(t),E):A(t)}function w(t){return 45===t||46===t||58===t||95===t||ce(t)?(e.consume(t),w):T(t)}function T(t){return 61===t?(e.consume(t),P):me(t)?(i=T,I(t)):ge(t)?(e.consume(t),T):E(t)}function P(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,F):me(t)?(i=P,I(t)):ge(t)?(e.consume(t),P):(e.consume(t),R)}function F(t){return t===o?(e.consume(t),o=void 0,N):null===t?n(t):me(t)?(i=F,I(t)):(e.consume(t),F)}function R(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||he(t)?E(t):(e.consume(t),R)}function N(e){return 47===e||62===e||he(e)?E(e):n(e)}function A(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),O}function O(t){return ge(t)?ke(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):_(t)}function _(t){return e.enter("htmlTextData"),i(t)}}},xt={name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:ft.resolveAll},Ct={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return me(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},Et={name:"codeText",tokenize:function(e,t,n){let r,o,l=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),l++,i):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,u(t)):me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),c(t))}function c(t){return null===t||32===t||96===t||me(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),c)}function u(n){return 96===n?(e.consume(n),r++,u):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",c(n))}},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}},wt={42:Be,43:Be,45:Be,48:Be,49:Be,50:Be,51:Be,52:Be,53:Be,54:Be,55:Be,56:Be,57:Be,62:Ue},Tt={91:Ke},Pt={[-2]:Ze,[-1]:Ze,32:Ze},Ft={35:Xe,42:je,45:[Je,je],60:nt,61:Je,95:je,96:it,126:it},Rt={38:ut,92:st},Nt={[-5]:dt,[-4]:dt,[-3]:dt,33:gt,38:ut,42:yt,60:[kt,St],91:xt,92:[Ct,st],93:ft,95:yt,96:Et},At={null:[yt,Ne]},It={null:[42,95]},Ot={null:[]};const _t=/[\0\t\n\r]/g;function Lt(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}const Dt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Mt(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Lt(n.slice(t?2:1),t?16:10)}return ct(n)||e}const jt={}.hasOwnProperty,Bt=function(t,n,r){return"string"!=typeof n&&(r=n,n=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(k),autolinkProtocol:f,autolinkEmail:f,atxHeading:i(v),blockQuote:i((function(){return{type:"blockquote",children:[]}})),characterEscape:f,characterReference:f,codeFenced:i(g),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(g,a),codeText:i((function(){return{type:"inlineCode",value:""}}),a),codeTextData:f,data:f,codeFlowValue:f,definition:i((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:i(y),hardBreakTrailing:i(y),htmlFlow:i(b,a),htmlFlowData:f,htmlText:i(b,a),htmlTextData:f,image:i((function(){return{type:"image",title:null,url:"",alt:null}})),label:a,link:i(k),listItem:i((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){l("expectingFirstListItemValue")&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),o("expectingFirstListItemValue"))},listOrdered:i(S,(function(){o("expectingFirstListItemValue",!0)})),listUnordered:i(S),paragraph:i((function(){return{type:"paragraph",children:[]}})),reference:function(){o("referenceType","collapsed")},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(v),strong:i((function(){return{type:"strong",children:[]}})),thematicBreak:i((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:u(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:u(),autolinkEmail:function(e){p.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){p.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:u(),characterEscapeValue:p,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=l("characterReferenceType");let r;n?(r=Lt(t,"characterReferenceMarkerNumeric"===n?10:16),o("characterReferenceType")):r=ct(t);const i=this.stack.pop();i.value+=r,i.position.end=zt(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")})),codeFencedFence:function(){l("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:p,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:p,data:p,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ye(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(m),hardBreakTrailing:u(m),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:p,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:p,image:u((function(){const e=this.stack[this.stack.length-1];if(l("inReference")){const t=l("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(o("inReference",!0),"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Dt,Mt)}(t),n.identifier=Ye(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(l("atHardBreak"))return n.children[n.children.length-1].position.end=zt(e.end),void o("atHardBreak");!l("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(f.call(this,e),p.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];if(l("inReference")){const t=l("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ye(this.sliceSerialize(e)).toLowerCase(),o("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){o("inReference")},setextHeading:u((function(){o("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){o("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}};Ht(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let n={type:"root",children:[]};const i={stack:[n],tokenStack:[],config:t,enter:c,exit:s,buffer:a,resume:d,setData:o,getData:l},u=[];let f=-1;for(;++f<e.length;)"listOrdered"!==e[f][1].type&&"listUnordered"!==e[f][1].type||("enter"===e[f][0]?u.push(f):f=r(e,u.pop(),f));for(f=-1;++f<e.length;){const n=t[e[f][0]];jt.call(n,e[f][1].type)&&n[e[f][1].type].call(Object.assign({sliceSerialize:e[f][2].sliceSerialize},i),e[f][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Vt).call(i,void 0,e[0])}for(n.position={start:zt(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:zt(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},f=-1;++f<t.transforms.length;)n=t.transforms[f](n)||n;return n};function r(e,t,n){let r,o,l,i,a=t-1,c=-1,u=!1;for(;++a<=n;){const t=e[a];if("listUnordered"===t[1].type||"listOrdered"===t[1].type||"blockQuote"===t[1].type?("enter"===t[0]?c++:c--,i=void 0):"lineEndingBlank"===t[1].type?"enter"===t[0]&&(!r||i||c||l||(l=a),i=void 0):"linePrefix"===t[1].type||"listItemValue"===t[1].type||"listItemMarker"===t[1].type||"listItemPrefix"===t[1].type||"listItemPrefixWhitespace"===t[1].type||(i=void 0),!c&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===c&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}l&&(!o||l<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}"listItemPrefix"===t[1].type&&(r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0},e.splice(a,0,["enter",r,t[2]]),a++,n++,l=void 0,i=!0)}}return e[t][1]._spread=u,n}function o(e,t){n[e]=t}function l(e){return n[e]}function i(e,t){return function(n){c.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(e,t,n){return this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:zt(t.start)},e}function u(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+C({start:e.start,end:e.end})+"): it’s not open");return r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Vt).call(this,e,r[0])),n.position.end=zt(e.end),n}function d(){return function(e,t){return ee(e,"boolean"!=typeof J.includeImageAlt||J.includeImageAlt,"boolean"!=typeof J.includeHtml||J.includeHtml)}(this.stack.pop())}function f(e){const t=this.stack[this.stack.length-1];let n=t.children[t.children.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:zt(e.start)},t.children.push(n)),this.stack.push(n)}function p(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=zt(e.end)}function m(){o("atHardBreak",!0)}function h(e){o("characterReferenceType",e.type)}function g(){return{type:"code",lang:null,meta:null,value:""}}function v(){return{type:"heading",depth:void 0,children:[]}}function y(){return{type:"break"}}function b(){return{type:"html",value:""}}function k(){return{type:"link",title:null,url:"",children:[]}}function S(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(r)(function(e){for(;!we(e););return e}(function(t){const n=function(e){const t={};let n=-1;for(;++n<e.length;)le(t,e[n]);return t}([e,...(t||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(Se),document:o(xe),flow:o(Re),string:o(Ae),text:o(Ie)};return r;function o(e){return function(t){return Me(r,e,t)}}}(r).document().write(function(){let e,t=1,n="",r=!0;return function(o,l,i){const a=[];let c,u,s,d,f;for(o=n+o.toString(l),s=0,n="",r&&(65279===o.charCodeAt(0)&&s++,r=void 0);s<o.length;){if(_t.lastIndex=s,c=_t.exec(o),d=c&&void 0!==c.index?c.index:o.length,f=o.charCodeAt(d),!c){n=o.slice(s);break}if(10===f&&s===d&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),s<d&&(a.push(o.slice(s,d)),t+=d-s),f){case 0:a.push(65533),t++;break;case 9:for(u=4*Math.ceil(t/4),a.push(-2);t++<u;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}s=d+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(t,n,!0))))};function zt(e){return{line:e.line,column:e.column,offset:e.offset}}function Ht(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ht(e,r):Ut(e,r)}}function Ut(e,t){let n;for(n in t)if(jt.call(t,n))if("canContainEols"===n){const r=t[n];r&&e[n].push(...r)}else if("transforms"===n){const r=t[n];r&&e[n].push(...r)}else if("enter"===n||"exit"===n){const r=t[n];r&&Object.assign(e[n],r)}}function Vt(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+C({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+C({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+C({start:t.start,end:t.end})+") is still open")}function qt(e){Object.assign(this,{Parser:t=>{const n=this.data("settings");return Bt(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Wt(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const l=e.charCodeAt(n);let i="";if(37===l&&ce(e.charCodeAt(n+1))&&ce(e.charCodeAt(n+2)))o=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(i=String.fromCharCode(l));else if(l>55295&&l<57344){const t=e.charCodeAt(n+1);l<56320&&t>56319&&t<57344?(i=String.fromCharCode(l,t),o=1):i="�"}else i=String.fromCharCode(l);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}const Qt=function(e){if(null==e)return Kt;if("string"==typeof e)return t=e,Yt((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qt(e[n]);return Yt((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return Yt((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return Yt(e);throw new Error("Expected function, string, or object as test")};function Yt(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function Kt(){return!0}const $t=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null);const o=Qt(t),l=r?-1:1;!function e(i,a,c){const u=i&&"object"==typeof i?i:{};if("string"==typeof u.type){const e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(s,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return s;function s(){let u,s,d,f=[];if((!t||o(i,a,c[c.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(i,c)),!1===f[0]))return f;if(i.children&&"skip"!==f[0])for(s=(r?i.children.length:-1)+l,d=c.concat(i);s>-1&&s<i.children.length;){if(u=e(i.children[s],s,d)(),!1===u[0])return u;s="number"==typeof u[1]?u[1]:s+l}return f}}(e,void 0,[])()}(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)},Zt=Xt("start"),Gt=Xt("end");function Xt(e){return function(t){const n=t&&t.position&&t.position[e]||{};return{line:n.line||null,column:n.column||null,offset:n.offset>-1?n.offset:null}}}const Jt={}.hasOwnProperty;function en(e){return String(e||"").toUpperCase()}function tn(e,t){const n=String(t.identifier).toUpperCase(),r=Wt(n.toLowerCase()),o=e.footnoteOrder.indexOf(n);let l;-1===o?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,l=e.footnoteOrder.length):(e.footnoteCounts[n]++,l=o+1);const i=e.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}function nn(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return{type:"text",value:"!["+t.alt+r};const o=e.all(t),l=o[0];l&&"text"===l.type?l.value="["+l.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function rn(e){const t=e.spread;return null==t?e.children.length>1:t}const on=9,ln=32;function an(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const l=[];for(;r;)l.push(cn(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return l.push(cn(t.slice(o),o>0,!1)),l.join("")}function cn(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;t===on||t===ln;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;t===on||t===ln;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const un={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,o={};r&&(o.className=["language-"+r]);let l={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:tn,footnote:function(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const o=String(r);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},tn(e,{type:"footnoteReference",identifier:o,position:t.position})},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null},imageReference:function(e,t){const n=e.definition(t.identifier);if(!n)return nn(e,t);const r={src:Wt(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(r.title=n.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:Wt(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=e.definition(t.identifier);if(!n)return nn(e,t);const r={href:Wt(n.url||"")};null!==n.title&&void 0!==n.title&&(r.title=n.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:Wt(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=rn(n[r])}return t}(n):rn(t),l={},i=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const c=r[r.length-1];c&&(o||"element"!==c.type||"p"!==c.tagName)&&i.push({type:"text",value:"\n"});const u={type:"element",tagName:"li",properties:l,children:i};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Zt(t.children[1]),i=Gt(t.children[t.children.length-1]);l.line&&i.line&&(r.position={start:l,end:i}),o.push(r)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",l=n&&"table"===n.type?n.align:void 0,i=l?l.length:t.children.length;let a=-1;const c=[];for(;++a<i;){const n=t.children[a],r={},i=l?l[a]:void 0;i&&(r.align=i);let u={type:"element",tagName:o,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(t,u)),c.push(u)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){const n={type:"text",value:an(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:sn,yaml:sn,definition:sn,footnoteDefinition:sn};function sn(){return null}const dn={}.hasOwnProperty;function fn(e,t){var n;e.position&&(t.position={start:Zt(n=e),end:Gt(n)})}function pn(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:[]}),"element"===n.type&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function mn(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return dn.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:hn(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):function(e,t){const n=t.data||{},r=!("value"in t)||dn.call(n,"hProperties")||dn.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:hn(e,t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}(e,t)}function hn(e,t){const n=[];if("children"in t){const r=t.children;let o=-1;for(;++o<r.length;){const l=mn(e,r[o],t);if(l){if(o&&"break"===r[o-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=l.value.replace(/^\s+/,"")),!Array.isArray(l)&&"element"===l.type)){const e=l.children[0];e&&"text"===e.type&&(e.value=e.value.replace(/^\s+/,""))}Array.isArray(l)?n.push(...l):n.push(l)}}}return n}function gn(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function vn(e,t){const n=function(e,t){const n=t||{},r=n.allowDangerousHtml||!1,o={};return i.dangerous=r,i.clobberPrefix=void 0===n.clobberPrefix||null===n.clobberPrefix?"user-content-":n.clobberPrefix,i.footnoteLabel=n.footnoteLabel||"Footnotes",i.footnoteLabelTagName=n.footnoteLabelTagName||"h2",i.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},i.footnoteBackLabel=n.footnoteBackLabel||"Back to content",i.unknownHandler=n.unknownHandler,i.passThrough=n.passThrough,i.handlers={...un,...n.handlers},i.definition=function(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return $t(e,"definition",(e=>{const n=en(e.identifier);n&&!Jt.call(t,n)&&(t[n]=e)})),function(e){const n=en(e);return n&&Jt.call(t,n)?t[n]:null}}(e),i.footnoteById=o,i.footnoteOrder=[],i.footnoteCounts={},i.patch=fn,i.applyData=pn,i.one=function(e,t){return mn(i,e,t)},i.all=function(e){return hn(i,e)},i.wrap=gn,i.augment=l,$t(e,"footnoteDefinition",(e=>{const t=String(e.identifier).toUpperCase();dn.call(o,t)||(o[t]=e)})),i;function l(e,t){if(e&&"data"in e&&e.data){const n=e.data;n.hName&&("element"!==t.type&&(t={type:"element",tagName:"",properties:{},children:[]}),t.tagName=n.hName),"element"===t.type&&n.hProperties&&(t.properties={...t.properties,...n.hProperties}),"children"in t&&t.children&&n.hChildren&&(t.children=n.hChildren)}if(e){const r="type"in e?e:{position:e};!((n=r)&&n.position&&n.position.start&&n.position.start.line&&n.position.start.column&&n.position.end&&n.position.end.line&&n.position.end.column)||(t.position={start:Zt(r),end:Gt(r)})}var n;return t}function i(e,t,n,r){return Array.isArray(n)&&(r=n,n={}),l(e,{type:"element",tagName:t,properties:n||{},children:r||[]})}}(e,t),r=n.one(e,null),o=function(e){const t=[];let n=-1;for(;++n<e.footnoteOrder.length;){const r=e.footnoteById[e.footnoteOrder[n]];if(!r)continue;const o=e.all(r),l=String(r.identifier).toUpperCase(),i=Wt(l.toLowerCase());let a=0;const c=[];for(;++a<=e.footnoteCounts[l];){const t={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&t.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),c.length>0&&c.push({type:"text",value:" "}),c.push(t)}const u=o[o.length-1];if(u&&"element"===u.type&&"p"===u.tagName){const e=u.children[u.children.length-1];e&&"text"===e.type?e.value+=" ":u.children.push({type:"text",value:" "}),u.children.push(...c)}else o.push(...c);const s={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+i},children:e.wrap(o,!0)};e.patch(r,s),t.push(s)}if(0!==t.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:"\n"}]}}(n);return o&&r.children.push({type:"text",value:"\n"},o),Array.isArray(r)?{type:"root",children:r}:r}const yn=function(e,t){return e&&"run"in e?function(e,t){return(n,r,o)=>{e.run(vn(n,t),r,(e=>{o(e)}))}}(e,t):function(e){return t=>vn(t,e)}(e||t)};var bn=n(697);class kn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Sn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new kn(n,r,t)}function xn(e){return e.toLowerCase()}kn.prototype.property={},kn.prototype.normal={},kn.prototype.space=null;class Cn{constructor(e,t){this.property=e,this.attribute=t}}Cn.prototype.space=null,Cn.prototype.boolean=!1,Cn.prototype.booleanish=!1,Cn.prototype.overloadedBoolean=!1,Cn.prototype.number=!1,Cn.prototype.commaSeparated=!1,Cn.prototype.spaceSeparated=!1,Cn.prototype.commaOrSpaceSeparated=!1,Cn.prototype.mustUseProperty=!1,Cn.prototype.defined=!1;let En=0;const wn=In(),Tn=In(),Pn=In(),Fn=In(),Rn=In(),Nn=In(),An=In();function In(){return 2**++En}const On=Object.keys(t);class _n extends Cn{constructor(e,n,r,o){let l=-1;if(super(e,n),Ln(this,"space",o),"number"==typeof r)for(;++l<On.length;){const e=On[l];Ln(this,On[l],(r&t[e])===t[e])}}}function Ln(e,t,n){n&&(e[t]=n)}_n.prototype.defined=!0;const Dn={}.hasOwnProperty;function Mn(e){const t={},n={};let r;for(r in e.properties)if(Dn.call(e.properties,r)){const o=e.properties[r],l=new _n(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[xn(r)]=r,n[xn(l.attribute)]=r}return new kn(t,n,e.space)}const jn=Mn({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Bn=Mn({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function zn(e,t){return t in e?e[t]:t}function Hn(e,t){return zn(e,t.toLowerCase())}const Un=Mn({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Hn,properties:{xmlns:null,xmlnsXLink:null}}),Vn=Mn({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Tn,ariaAutoComplete:null,ariaBusy:Tn,ariaChecked:Tn,ariaColCount:Fn,ariaColIndex:Fn,ariaColSpan:Fn,ariaControls:Rn,ariaCurrent:null,ariaDescribedBy:Rn,ariaDetails:null,ariaDisabled:Tn,ariaDropEffect:Rn,ariaErrorMessage:null,ariaExpanded:Tn,ariaFlowTo:Rn,ariaGrabbed:Tn,ariaHasPopup:null,ariaHidden:Tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rn,ariaLevel:Fn,ariaLive:null,ariaModal:Tn,ariaMultiLine:Tn,ariaMultiSelectable:Tn,ariaOrientation:null,ariaOwns:Rn,ariaPlaceholder:null,ariaPosInSet:Fn,ariaPressed:Tn,ariaReadOnly:Tn,ariaRelevant:null,ariaRequired:Tn,ariaRoleDescription:Rn,ariaRowCount:Fn,ariaRowIndex:Fn,ariaRowSpan:Fn,ariaSelected:Tn,ariaSetSize:Fn,ariaSort:null,ariaValueMax:Fn,ariaValueMin:Fn,ariaValueNow:Fn,ariaValueText:null,role:null}}),qn=Mn({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Hn,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:Rn,accessKey:Rn,action:null,allow:null,allowFullScreen:wn,allowPaymentRequest:wn,allowUserMedia:wn,alt:null,as:null,async:wn,autoCapitalize:null,autoComplete:Rn,autoFocus:wn,autoPlay:wn,blocking:Rn,capture:null,charSet:null,checked:wn,cite:null,className:Rn,cols:Fn,colSpan:null,content:null,contentEditable:Tn,controls:wn,controlsList:Rn,coords:Fn|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wn,defer:wn,dir:null,dirName:null,disabled:wn,download:Pn,draggable:Tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wn,formTarget:null,headers:Rn,height:Fn,hidden:wn,high:Fn,href:null,hrefLang:null,htmlFor:Rn,httpEquiv:Rn,id:null,imageSizes:null,imageSrcSet:null,inert:wn,inputMode:null,integrity:null,is:null,isMap:wn,itemId:null,itemProp:Rn,itemRef:Rn,itemScope:wn,itemType:Rn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wn,low:Fn,manifest:null,max:null,maxLength:Fn,media:null,method:null,min:null,minLength:Fn,multiple:wn,muted:wn,name:null,nonce:null,noModule:wn,noValidate:wn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:wn,optimum:Fn,pattern:null,ping:Rn,placeholder:null,playsInline:wn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wn,referrerPolicy:null,rel:Rn,required:wn,reversed:wn,rows:Fn,rowSpan:Fn,sandbox:Rn,scope:null,scoped:wn,seamless:wn,selected:wn,shadowRootClonable:wn,shadowRootDelegatesFocus:wn,shadowRootMode:null,shape:null,size:Fn,sizes:null,slot:null,span:Fn,spellCheck:Tn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Fn,step:null,style:null,tabIndex:Fn,target:null,title:null,translate:null,type:null,typeMustMatch:wn,useMap:null,value:Tn,width:Fn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Rn,axis:null,background:null,bgColor:null,border:Fn,borderColor:null,bottomMargin:Fn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wn,declare:wn,event:null,face:null,frame:null,frameBorder:null,hSpace:Fn,leftMargin:Fn,link:null,longDesc:null,lowSrc:null,marginHeight:Fn,marginWidth:Fn,noResize:wn,noHref:wn,noShade:wn,noWrap:wn,object:null,profile:null,prompt:null,rev:null,rightMargin:Fn,rules:null,scheme:null,scrolling:Tn,standby:null,summary:null,text:null,topMargin:Fn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Fn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wn,disableRemotePlayback:wn,prefix:null,property:null,results:Fn,security:null,unselectable:null}}),Wn=Mn({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:zn,properties:{about:An,accentHeight:Fn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Fn,amplitude:Fn,arabicForm:null,ascent:Fn,attributeName:null,attributeType:null,azimuth:Fn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Fn,by:null,calcMode:null,capHeight:Fn,className:Rn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Fn,diffuseConstant:Fn,direction:null,display:null,dur:null,divisor:Fn,dominantBaseline:null,download:wn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Fn,enableBackground:null,end:null,event:null,exponent:Fn,externalResourcesRequired:null,fill:null,fillOpacity:Fn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Fn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Fn,horizOriginX:Fn,horizOriginY:Fn,id:null,ideographic:Fn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Fn,k:Fn,k1:Fn,k2:Fn,k3:Fn,k4:Fn,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Fn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Fn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Fn,overlineThickness:Fn,paintOrder:null,panose1:null,path:null,pathLength:Fn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Fn,pointsAtY:Fn,pointsAtZ:Fn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Fn,specularExponent:Fn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Fn,strikethroughThickness:Fn,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Fn,strokeOpacity:Fn,strokeWidth:null,style:null,surfaceScale:Fn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:Fn,tableValues:null,target:null,targetX:Fn,targetY:Fn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Fn,underlineThickness:Fn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Fn,values:null,vAlphabetic:Fn,vMathematical:Fn,vectorEffect:null,vHanging:Fn,vIdeographic:Fn,version:null,vertAdvY:Fn,vertOriginX:Fn,vertOriginY:Fn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Fn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Qn=Sn([Bn,jn,Un,Vn,qn],"html"),Yn=Sn([Bn,jn,Un,Vn,Wn],"svg"),Kn=function(e){if(null==e)return Zn;if("string"==typeof e)return t=e,$n((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Kn(e[n]);return $n((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return $n((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return $n(e);throw new Error("Expected function, string, or object as test")};function $n(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function Zn(){return!0}const Gn=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null);const o=Kn(t),l=r?-1:1;!function e(i,a,c){const u=i&&"object"==typeof i?i:{};if("string"==typeof u.type){const e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(s,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return s;function s(){let u,s,d,f=[];if((!t||o(i,a,c[c.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(i,c)),!1===f[0]))return f;if(i.children&&"skip"!==f[0])for(s=(r?i.children.length:-1)+l,d=c.concat(i);s>-1&&s<i.children.length;){if(u=e(i.children[s],s,d)(),!1===u[0])return u;s="number"==typeof u[1]?u[1]:s+l}return f}}(e,void 0,[])()}(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)};function Xn(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Gn(t,"element",((t,n,r)=>{const o=r;let l;if(e.allowedElements?l=!e.allowedElements.includes(t.tagName):e.disallowedElements&&(l=e.disallowedElements.includes(t.tagName)),!l&&e.allowElement&&"number"==typeof n&&(l=!e.allowElement(t,n,o)),l&&"number"==typeof n)return e.unwrapDisallowed&&t.children?o.children.splice(n,1,...t.children):o.children.splice(n,1),n}))}}var Jn=n(143);function er(e){const t=e&&"object"==typeof e&&"text"===e.type?e.value||"":e;return"string"==typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}const tr=/^data[-\w.:]+$/i,nr=/-[a-z]/g,rr=/[A-Z]/g;function or(e){return"-"+e.toLowerCase()}function lr(e){return e.charAt(1).toUpperCase()}const ir={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ar=n(848),cr=["http","https","mailto","tel"];function ur(e){const t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;const r=t.indexOf(":");if(-1===r)return t;let o=-1;for(;++o<cr.length;){const e=cr[o];if(r===e.length&&t.slice(0,e.length).toLowerCase()===e)return t}return o=t.indexOf("?"),-1!==o&&r>o?t:(o=t.indexOf("#"),-1!==o&&r>o?t:"javascript:void(0)")}const sr={}.hasOwnProperty,dr=new Set(["table","thead","tbody","tfoot","tr"]);function fr(e,t){const n=[];let r,o=-1;for(;++o<t.children.length;)r=t.children[o],"element"===r.type?n.push(pr(e,r,o,t)):"text"===r.type?"element"===t.type&&dr.has(t.tagName)&&er(r)||n.push(r.value):"raw"!==r.type||e.options.skipHtml||n.push(r.value);return n}function pr(e,t,n,r){const l=e.options,i=void 0===l.transformLinkUri?ur:l.transformLinkUri,a=e.schema,c=t.tagName,u={};let s,d=a;if("html"===a.space&&"svg"===c&&(d=Yn,e.schema=d),t.properties)for(s in t.properties)sr.call(t.properties,s)&&hr(u,s,t.properties[s],e);"ol"!==c&&"ul"!==c||e.listDepth++;const f=fr(e,t);"ol"!==c&&"ul"!==c||e.listDepth--,e.schema=a;const p=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},m=l.components&&sr.call(l.components,c)?l.components[c]:c,h="string"==typeof m||m===o.Fragment;if(!Jn.isValidElementType(m))throw new TypeError(`Component for name \`${c}\` not defined or is not renderable`);if(u.key=n,"a"===c&&l.linkTarget&&(u.target="function"==typeof l.linkTarget?l.linkTarget(String(u.href||""),t.children,"string"==typeof u.title?u.title:null):l.linkTarget),"a"===c&&i&&(u.href=i(String(u.href||""),t.children,"string"==typeof u.title?u.title:null)),h||"code"!==c||"element"!==r.type||"pre"===r.tagName||(u.inline=!0),h||"h1"!==c&&"h2"!==c&&"h3"!==c&&"h4"!==c&&"h5"!==c&&"h6"!==c||(u.level=Number.parseInt(c.charAt(1),10)),"img"===c&&l.transformImageUri&&(u.src=l.transformImageUri(String(u.src||""),String(u.alt||""),"string"==typeof u.title?u.title:null)),!h&&"li"===c&&"element"===r.type){const e=function(e){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if("element"===n.type&&"input"===n.tagName)return n}return null}(t);u.checked=e&&e.properties?Boolean(e.properties.checked):null,u.index=mr(r,t),u.ordered="ol"===r.tagName}var g;return h||"ol"!==c&&"ul"!==c||(u.ordered="ol"===c,u.depth=e.listDepth),"td"!==c&&"th"!==c||(u.align&&(u.style||(u.style={}),u.style.textAlign=u.align,delete u.align),h||(u.isHeader="th"===c)),h||"tr"!==c||"element"!==r.type||(u.isHeader=Boolean("thead"===r.tagName)),l.sourcePos&&(u["data-sourcepos"]=[(g=p).start.line,":",g.start.column,"-",g.end.line,":",g.end.column].map(String).join("")),!h&&l.rawSourcePos&&(u.sourcePosition=t.position),!h&&l.includeElementIndex&&(u.index=mr(r,t),u.siblingCount=mr(r)),h||(u.node=t),f.length>0?o.createElement(m,u,f):o.createElement(m,u)}function mr(e,t){let n=-1,r=0;for(;++n<e.children.length&&e.children[n]!==t;)"element"===e.children[n].type&&r++;return r}function hr(e,t,n,r){const o=function(e,t){const n=xn(t);let r=t,o=Cn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&tr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(nr,lr);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!nr.test(e)){let n=e.replace(rr,or);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=_n}return new o(r,t)}(r.schema,t);let l=n;null!=l&&l==l&&(Array.isArray(l)&&(l=o.commaSeparated?function(e,t){const n={};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(l):l.join(" ").trim()),"style"===o.property&&"string"==typeof l&&(l=function(e){const t={};try{ar(e,(function(e,n){const r="-ms-"===e.slice(0,4)?`ms-${e.slice(4)}`:e;t[r.replace(/-([a-z])/g,gr)]=n}))}catch{}return t}(l)),o.space&&o.property?e[sr.call(ir,o.property)?ir[o.property]:o.property]=l:o.attribute&&(e[o.attribute]=l))}function gr(e,t){return t.toUpperCase()}const vr={}.hasOwnProperty,yr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",br={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function kr(e){for(const t in br)if(vr.call(br,t)&&vr.call(e,t)){const e=br[t];console.warn(`[react-markdown] Warning: please ${e.to?`use \`${e.to}\` instead of`:"remove"} \`${t}\` (see <${yr}#${e.id}> for more info)`),delete br[t]}const t=q().use(qt).use(e.remarkPlugins||[]).use(yn,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(Xn,e),n=new M;"string"==typeof e.children?n.value=e.children:void 0!==e.children&&null!==e.children&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if("root"!==r.type)throw new TypeError("Expected a `root` node");let l=o.createElement(o.Fragment,{},fr({options:e,schema:Qn,listDepth:0},r));return e.className&&(l=o.createElement("div",{className:e.className},l)),l}function Sr(e,t){var n=(0,o.useContext)(a);(0,o.useEffect)((function(){var r=[];return n&&Object.keys(n).length>0&&(t?t.forEach((function(t){r.push(n.subscribe(t,e))})):r=[n.subscribeToAllEvents((function(){return e()}))]),function(){n&&n.unsubscribe&&r.forEach((function(e){return n.unsubscribe(e)}))}}),[n])}kr.propTypes={children:bn.string,className:bn.string,allowElement:bn.func,allowedElements:bn.arrayOf(bn.string),disallowedElements:bn.arrayOf(bn.string),unwrapDisallowed:bn.bool,remarkPlugins:bn.arrayOf(bn.oneOfType([bn.object,bn.func,bn.arrayOf(bn.oneOfType([bn.bool,bn.string,bn.object,bn.func,bn.arrayOf(bn.any)]))])),rehypePlugins:bn.arrayOf(bn.oneOfType([bn.object,bn.func,bn.arrayOf(bn.oneOfType([bn.bool,bn.string,bn.object,bn.func,bn.arrayOf(bn.any)]))])),sourcePos:bn.bool,rawSourcePos:bn.bool,skipHtml:bn.bool,includeElementIndex:bn.bool,transformLinkUri:bn.oneOfType([bn.func,bn.bool]),linkTarget:bn.oneOfType([bn.func,bn.string]),transformImageUri:bn.func,components:bn.object};var xr=function(){return xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xr.apply(this,arguments)};function Cr(){var e=c(),t=e.context,n=e.eventController,r=function(){var e,n,r,o,l,i,a,c,u,s,d,f,p,m,h,g,v,y,b,k,S,x,C,E,w=t.currentPage||1,T=t.resultsPerPage||10,P={resultCount:(null===(n=null===(e=t.storedSearchResponseData)||void 0===e?void 0:e.cludoSearchResponse)||void 0===n?void 0:n.ResultCount)||0,resultCountMessage:(null===(o=null===(r=t.storedSearchResponseData)||void 0===r?void 0:r.cludoSearchResponse)||void 0===o?void 0:o.ResultCountMessage)||"",fixedQuery:(null===(i=null===(l=t.storedSearchResponseData)||void 0===l?void 0:l.cludoSearchResponse)||void 0===i?void 0:i.FixedQuery)||"",facets:null===(c=null===(a=t.storedSearchResponseData)||void 0===a?void 0:a.cludoSearchResponse)||void 0===c?void 0:c.Facets,didYouMean:(null===(s=null===(u=t.storedSearchResponseData)||void 0===u?void 0:u.cludoSearchResponse)||void 0===s?void 0:s.Suggestions[0])||""};return{suggestions:(null===(f=null===(d=t.storedSearchResponseData)||void 0===d?void 0:d.cludoSearchResponse)||void 0===f?void 0:f.Suggestions)||[],results:(null===(m=null===(p=t.storedSearchResponseData)||void 0===p?void 0:p.cludoSearchResponse)||void 0===m?void 0:m.TypedDocuments)||[],categorizedResults:(null===(g=null===(h=t.storedSearchResponseData)||void 0===h?void 0:h.cludoSearchResponse)||void 0===g?void 0:g.TopHits)||[],resultsSummary:P,paginationOptions:{itemsPerPage:t.resultsPerPage,currentPage:t.currentPage,maxPages:Math.ceil((null===(y=null===(v=t.storedSearchResponseData)||void 0===v?void 0:v.cludoSearchResponse)||void 0===y?void 0:y.ResultCount)/T)},endlessScrollOptions:xr({isEnabled:t.isEndlessScrollEnabled},t.endlessScroll),currentPage:w,banners:(null===(k=null===(b=t.storedSearchResponseData)||void 0===b?void 0:b.cludoSearchResponse)||void 0===k?void 0:k.Banners)||[],relatedSearches:(null===(x=null===(S=t.storedSearchResponseData)||void 0===S?void 0:S.cludoSearchResponse)||void 0===x?void 0:x.RelatedSearchDocuments)||[],resultCount:(null===(E=null===(C=t.storedSearchResponseData)||void 0===C?void 0:C.cludoSearchResponse)||void 0===E?void 0:E.ResultCount)||0,isLoading:t.isLoadingResults}},l=function(){var e,t,r,o,l;return{loadMore:(null===(e=null==n?void 0:n.endlessScrollLoadMore)||void 0===e?void 0:e.bind(n))||function(){},searchResultKeyUp:(null===(t=null==n?void 0:n.searchResultKeyUpEvent)||void 0===t?void 0:t.bind(n))||function(){},linkToSearchClickEvent:(null===(r=null==n?void 0:n.linkToSearchClickEvent)||void 0===r?void 0:r.bind(n))||function(){},handleDidYouMeanSelect:(null===(o=null==n?void 0:n.handleDidYouMeanSelect)||void 0===o?void 0:o.bind(n))||function(){},searchResultTrackClickEventHandler:(null===(l=null==n?void 0:n.searchResultTrackClickEventHandler)||void 0===l?void 0:l.bind(n))||function(){}}};Sr((function(){u(r()),f(l())}));var i=(0,o.useState)(r()),a=i[0],u=i[1],s=(0,o.useState)(l()),d=s[0],f=s[1];return[a,d]}var Er=function(){return Er=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Er.apply(this,arguments)},wr=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,l=t.length;o<l;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Tr(e){return e.Fields.Url.Value}function Pr(e,t){return-1!==e.FieldNames.indexOf(t)}function Fr(e,t,n,r){if(void 0===r&&(r=" "),Pr(e,t)){var o=e.Fields[t].Value;if(n&&n>0){var l=o.split(r);l.length>n&&(o=l.slice(0,n).join(r))}return o}}function Rr(e,t){if(Pr(e,t))return e.Fields[t].Values}function Nr(e,t,n,r,o){if(void 0===r&&(r=" "),void 0===o&&(o="..."),Pr(e,t))return Ar(e,t,n,r).join(o)}function Ar(e,t,n,r){var o,l,i;return void 0===r&&(r=" "),(null===(l=null===(o=e.Fields[t])||void 0===o?void 0:o.Highlights)||void 0===l?void 0:l.length)>0?function(e,t){var n=wr([],e,!0);if(t)for(var r=0,o=0;o<n.length;o++)if((r+=n[o].split(" ").length)>t)return n.splice(o),n;return n}(e.Fields[t].Highlights,n):[null!==(i=Fr(e,t,n,r))&&void 0!==i?i:""]}function Ir(e){return{__html:e}}function Or(e){console.error("No result provided to ".concat(e," component. ").concat(e," must receive a result through props or from a result context provider."))}function _r(e){return!!e&&e.hasAttribute("data-cludo-autocomplete")}function Lr(e,t){return{Field:e.Field,Values:e.Values.map((function(n){var r,o=t[e.Field],l=null===(r=null==o?void 0:o.Items)||void 0===r?void 0:r.find((function(e){return e.Key===n.Value})),i=l?l.Count:0;return Er(Er({},n),{AllCount:i})}))}}function Dr(e){var t,n=Cr()[0],r=(0,o.useState)([]),i=r[0],a=r[1],c=(0,o.useState)({}),u=c[0],s=c[1],d=n.results,f={da:"Læs mere",en:"Learn more"},p=null!==(t=e.referencesCTA||f[e.language])&&void 0!==t?t:f.en;(0,o.useEffect)((function(){var t=h(e.response),n=g(t);a(n);var r={};t.forEach((function(e){r[e.url]=v(e.url)})),s(r)}),[e.response]);var h=function(e){return Array.from(e.matchAll(/\[(\d+)\]\((https?:\/\/[^\s)]+)\)/g)).map((function(e){return{id:e[1],url:e[2]}}))},g=function(e){var t=e.reduce((function(e,t){return e[t.id]=t,e}),{});return Object.values(t).sort((function(e,t){return Number(e.id)-Number(t.id)}))},v=function(e){var t=d.find((function(t){return Fr(t,"Id")===e}));return t&&Fr(t,"Title")?Fr(t,"Title"):e},y=m("cludo-display-flex cludo-mt-4 cludo-mb-3 ",e.disableTheme),b=m("cludo-font-size-sm cludo-m-0 cludo-mr-3 cludo-mt-1",e.disableTheme),k=m("cludo-display-flex cludo-flex-wrap cludo-m-0 cludo-p-0 cludo-list-style-none",e.disableTheme),S=m("",e.disableTheme),x=m("cludo-display-block cludo-py-1 cludo-px-2 cludo-font-size-sm cludo-font-color-black cludo-text-decoration-none",e.disableTheme);return i.length>0?l().createElement("div",{className:"cludo-generative-ai-references "+y},l().createElement("p",{className:"cludo-generative-ai-references__cta "+b},p),l().createElement("ul",{className:"cludo-generative-ai-references__list "+k},i.map((function(e,t){return l().createElement("li",{key:t,className:"cludo-generative-ai-references__list-item "+S},l().createElement("a",{href:e.url,target:"_blank",className:"cludo-generative-ai-references__list-item-anchor "+x},e.id," | ",u[e.url]||e.url))})))):null}var Mr=function(){return Mr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Mr.apply(this,arguments)},jr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Br(e){var t=m("cludo-m-0 cludo-font-size-md",e.disableTheme),n=m("cludo-font-size-xs cludo-border-radius-button cludo-font-weight-bold cludo-font-color-black cludo-text-decoration-none",e.disableTheme),r=m("cludo-font-size-sm cludo-mt-2 cludo-color-neutral-n70",e.disableTheme);return l().createElement(l().Fragment,null,l().createElement(kr,{components:{p:function(e){e.node;var n=jr(e,["node"]);return l().createElement("p",Mr({className:"cludo-generative-ai__answer-text "+t},n))},a:function(e){e.node;var t=jr(e,["node"]);return l().createElement("a",Mr({className:"cludo-generative-ai__answer-citation "+n},t))}}},e.response),e.isLoading||e.isStreaming||!e.showReferences?null:l().createElement(Dr,{response:e.response,referencesCTA:e.referencesCTA,language:e.language}),e.isLoading||e.isStreaming||!e.disclaimer?null:l().createElement("span",{className:r},e.disclaimer))}var zr=function(e,t,n,r){return new(n||(n=Promise))((function(o,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function a(e){try{c(r.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},Hr=function(e,t){var n,r,o,l,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};function Ur(e){var t,n,r=this,a=(0,o.useContext)(i),f=e.language||a.translateProvider.language,p=e.header?"string"==typeof e.header?l().createElement("h2",{className:"cludo-generative-ai__header cludo-m-0 cludo-mb-3 cludo-font-size-lg cludo-font-weight-normal"},e.header):e.header:null,h=e.sourceFields&&e.sourceFields.length?e.sourceFields:["Title","Description"],g=e.sourceCount||3,v=(null===(n=null===(t=a.storedSearchResponseData)||void 0===t?void 0:t.cludoSearchResponse)||void 0===n?void 0:n.TypedDocuments)||[],y=v.slice(0,g).map((function(e){return{id:e.Fields.Id.Value,fields:h}})),x=(0,o.useState)(!1),C=x[0],E=x[1],w=(0,o.useState)(!1),T=w[0],P=w[1],F=function(){var e,t=this,n=c(),r=n.context,l=(n.eventController,void 0===(e=4)&&(e=3),r.customerId>=1e7?"https://api-us1.cludo.com/api/v".concat(e):"https://api-eu1.cludo.com/api/v".concat(e)),i="".concat(r.customerId,":").concat(r.engineId,":SearchKey"),a="".concat(l,"/").concat(r.customerId,"/").concat(r.engineId,"/search/summarize/stream"),f="".concat(l,"/").concat(r.customerId,"/").concat(r.engineId,"/search/summarize/feedback"),p=(0,o.useRef)(null),m=(0,o.useRef)(null),h=(0,o.useState)({isLoading:!1,isStreaming:!1,response:"",summaryId:""}),g=h[0],v=h[1],y={getResponse:function(e,n,r,o,l,c){return s(t,void 0,void 0,(function(){var t,s,f,h,g,y,b,k,S,x,C,E,w,T,P,F,R,N,A;return d(this,(function(I){switch(I.label){case 0:t=!0,m.current=n,p.current&&p.current.abort(),s=new AbortController,p.current=s,v((function(e){return u(u({},e),{isLoading:!0,isStreaming:t,response:""})})),f={query:e,queryId:n,sources:r,language:o,length:l,includeCitations:!0},I.label=1;case 1:return I.trys.push([1,11,,12]),[4,fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"SiteKey "+window.btoa(i)},body:JSON.stringify(f),signal:s.signal})];case 2:if(!(h=I.sent()).ok)throw new Error("HTTP error. status: ".concat(h.status));if(g=null!==(A=h.headers.get("Cludo-Summary-Id"))&&void 0!==A?A:"",v((function(e){return u(u({},e),{summaryId:g})})),y=new TextDecoder("utf-8"),!h.body)return[3,10];b=h.body.getReader(),I.label=3;case 3:return t?[4,b.read()]:[3,9];case 4:if(k=I.sent(),S=k.value,x=k.done,t=!x,!S)return[3,8];C=y.decode(S,{stream:!0}),E=C.match(/[\S]+|\s+/g)||[],w=function(e){return d(this,(function(t){switch(t.label){case 0:return m.current!==n?[2,{value:void 0}]:(v((function(t){var n;return u(u({},t),{isLoading:!1,isStreaming:!0,response:(null!==(n=t.response)&&void 0!==n?n:"")+e})})),[4,new Promise((function(e){return setTimeout(e,c||20)}))]);case 1:return t.sent(),[2]}}))},T=0,P=E,I.label=5;case 5:return T<P.length?(F=P[T],[5,w(F)]):[3,8];case 6:if("object"==typeof(R=I.sent()))return[2,R.value];I.label=7;case 7:return T++,[3,5];case 8:return[3,3];case 9:v((function(e){return u(u({},e),{isLoading:!1,isStreaming:t})})),I.label=10;case 10:return[3,12];case 11:return"AbortError"===(N=I.sent()).name?[2]:(console.log("error",N),v((function(e){return u(u({},e),{isLoading:!1,isStreaming:!1,response:""})})),[3,12]);case 12:return[2]}}))}))},sendFeedback:function(e){return s(t,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,fetch(f,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"SiteKey "+window.btoa(i)},body:JSON.stringify(e)})];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),console.log("Error sending feedback",t),[3,3];case 3:return[2]}}))}))}};return[g,y]}(),R=F[0],N=F[1];(0,o.useEffect)((function(){1!==a.currentPage&&T||(!0===a.storedSearchResponseData.cludoSearchResponse.GenerativeAnswerAvailable?(E(!0),N.getResponse(a.query,a.storedSearchResponseData.cludoSearchResponse.QueryId,y,f,e.length,e.streamAnimationDelay)):E(!1),P(!0))}),[v]),(0,o.useEffect)((function(){R.isLoading||R.isStreaming||R.response||E(!1)}),[R]);var A=m("cludo-bg-netral-n5 cludo-border-radius-card cludo-font-family-default cludo-mb-4 cludo-p-4",e.disableTheme,e.className),I=m("",e.disableTheme),O=m("cludo-display-flex cludo-justify-content-center cludo-column",e.disableTheme);return C&&l().createElement("div",{id:"cludo-generative-ai",className:"cludo-generative-ai cludo-rollout "+A},p||null,l().createElement("div",{className:"cludo-generative-ai__answer-container cludo-display-flex "+I},l().createElement(k,{chatIcon:e.chatIcon}),l().createElement("div",{className:"cludo-generative-ai__answer "+O},R.isLoading?l().createElement(S,{loadingElement:e.loadingElement}):R&&R.response&&l().createElement(l().Fragment,null,l().createElement(Br,{response:R.response,isLoading:R.isLoading,isStreaming:R.isStreaming,disclaimer:e.disclaimer,showReferences:e.showReferences,referencesCTA:e.referencesCTA,language:f,disableTheme:e.disableTheme})))),!R.isStreaming&&!R.isLoading&&e.allowFeedback&&l().createElement(b,{disableTheme:e.disableTheme,onSubmitFeedback:function(e){return zr(r,void 0,void 0,(function(){var t,n;return Hr(this,(function(r){return t=R.summaryId,n=function(e,t,n,r){return{rating:n.rating?n.rating:void 0,reason:n.selectedReason?n.selectedReason:void 0,comment:n.comment?n.comment:void 0,summaryId:e,sessionId:t,deviceType:r.deviceType,userAgent:navigator.userAgent,browserLanguage:window.navigator.language,screenResolution:screen.width+"x"+screen.height}}(t,a.sessionId,e,a),N.sendFeedback(n),[2]}))}))},feedbackCTA:e.feedbackCTA,feedbackPositiveIcon:e.feedbackPositiveIcon,feedbackNegativeIcon:e.feedbackNegativeIcon,feedbackFollowUpPrompt:e.feedbackFollowUpPrompt,feedbackFollowUpQuestions:e.feedbackFollowUpQuestions,feedbackCommentPrompt:e.feedbackCommentPrompt,feedbackCommentPromptPlaceholder:e.feedbackCommentPromptPlaceholder,feedbackSubmitButtonText:e.feedbackSubmitButtonText,feedbackThankYouMessage:e.feedbackThankYouMessage,feedbackThankYouMessageIcon:e.feedbackThankYouMessageIcon}))||l().createElement(l().Fragment,null)}var Vr=n(971);function qr(e,t){if(t.isFeatureEnabled(Vr.d.WebContentHighlighter)){var n=e.replace(/<[^>]+>/g,"");return"#:~:text="+encodeURIComponent(n)}return""}var Wr=l().createContext({});function Qr(e){var t=(0,o.useContext)(i),n=(0,o.useContext)(a),r=(0,o.useContext)(Kr),c=e.highlightQueryOnClickedPage?qr(t.query,t):"",u=(0,o.useState)(c),s=u[0],d=u[1],f=e.result||r;if(!f)return Or("ResultLink"),null;var p=f,m=e.className?e.className:"",h="PageContent"===Fr(f,"_type")?"Title":"fc_Title",g=e.linkField?Fr(f,e.linkField):p.Fields.Url.Value,v=g;s&&(v+=s);var y=(0,o.useRef)(null),b={onFragmentHover:function(e){var n=e?qr(e,t):"";d(n)},onFragmentSelect:function(){y.current&&y.current.click()}};return(0,o.useEffect)((function(){e.autofocus&&y.current&&y.current.focus()}),[]),l().createElement("a",{ref:y,href:v,"data-cludo-result":"searchresult","data-cludo-index":p.ResultIndex,"data-cludo-url":g,"data-cludo-title":Fr(f,h),"data-cludo-page":t.currentPage,className:m,target:e.openNewTab?"_blank":"",onKeyUp:function(e){return function(e,t){t.searchResultKeyUpEvent(e.nativeEvent)}(e,n)},onClick:function(e){return function(e,t,n){t.searchResultTrackClickEventHandler(e.nativeEvent,n)}(e,n,y.current)}},l().createElement(Wr.Provider,{value:b},e.children))}var Yr=function(){return Yr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Yr.apply(this,arguments)},Kr=l().createContext({});function $r(e){var t=(0,o.useContext)(i),n=1===e.result.ResultIndex&&1===t.currentPage&&t.focusOnResultsAfterSearch,r=m("cludo-theme-result-link",e.disableTheme,e.className);return l().createElement(Kr.Provider,{value:Yr({},e.result)},e.wrapWithLink||void 0===e.wrapWithLink?l().createElement(Qr,{openNewTab:e.openNewTab,highlightQueryOnClickedPage:e.highlightQueryOnClickedPage,result:e.result,autofocus:n,className:r},e.children):l().createElement("div",{className:e.className},e.children))}function Zr(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultTitle"),null;var r=m("cludo-theme-result-title ".concat(e.showRawText?"cludo-font-weight-bold":"cludo-font-weight-normal"),e.disableTheme,e.className),i=e.headingElement||"h3",a=Fr(n,"_type"),c=e.titleField||("PageContent"===a?"Title":"fc_Title"),u=e.showRawText?Fr(n,c):Nr(n,c);return u?l().createElement(i,{className:r,dangerouslySetInnerHTML:Ir(u)}):l().createElement(l().Fragment,null)}function Gr(e){var t=(0,o.useContext)(i),n=(0,o.useContext)(Wr),r=t.isFeatureEnabled(Vr.d.WebContentHighlighter)?"cludo-theme-fragment-highlight":"cludo-ellipsis-after";return l().createElement("span",{tabIndex:0,role:"link",className:r,onKeyDown:function(e){"Enter"===e.code&&n.onFragmentSelect()},onFocus:function(){return n.onFragmentHover(e.fragment)},onMouseEnter:function(){return n.onFragmentHover(e.fragment)},onMouseLeave:function(){return n.onFragmentHover()},dangerouslySetInnerHTML:Ir(e.fragment)})}function Xr(e){var t,n,r,o=(t=e.result,n=e.maxWords,r=e.fieldName,Ar(t,r||(Pr(t,"fc_Content")?"fc_Content":"Description"),n).map((function(e,t){return l().createElement(Gr,{key:t,fragment:e})})));return e.maxFragments&&e.maxFragments>0&&(o=o.slice(0,e.maxFragments)),l().createElement("p",{className:e.className},o)}function Jr(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultDescription"),null;var r=m("cludo-theme-result-description",e.disableTheme,e.className),i=e.descriptionField||(Pr(n,"fc_Content")?"fc_Content":"Description");if(e.makeHighlightsClickable)return l().createElement(Xr,{className:r,result:n,fieldName:i,maxWords:e.maxWordCount});var a=e.showRawText?Fr(n,i,e.maxWordCount):Nr(n,i,e.maxWordCount,void 0,e.highlightDelimiter);return a?l().createElement("p",{className:r,dangerouslySetInnerHTML:Ir(a)}):l().createElement(l().Fragment,null)}function eo(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultUrl"),null;var r=m("cludo-theme-result-url",e.disableTheme,e.className),i=Fr(n,"Url");if(e.showRelativeUrl&&i){var a=new URL(i);i=a.toString().substring(a.origin.length)}return i?l().createElement("div",{className:r},i):l().createElement(l().Fragment,null)}var to="Category";function no(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n&&!e.text)return Or("ResultBadge"),null;var r=m("cludo-theme-result-badge",e.disableTheme,e.className),i=e.text||Fr(n,e.field||to);return i?l().createElement("span",{className:r},i," "):null}var ro=["title","description","url","badge"];function oo(e){var t,n,r,o,i,a,c,u,s=(u=e.order||[]).concat(ro.filter((function(e){return-1===u.indexOf(e)})));s=s.filter((function(t){return!("title"===t&&e.hideTitle||"description"===t&&e.hideDescription||"url"===t&&e.hideUrl||"badge"===t&&e.hideBadge)}));var d=new Map([["title",l().createElement(Zr,{className:null===(t=e.classNames)||void 0===t?void 0:t.title,disableTheme:e.disableTheme})],["description",l().createElement(Jr,{className:null===(n=e.classNames)||void 0===n?void 0:n.description,disableTheme:e.disableTheme,maxWordCount:e.descriptionMaxWordCount||90,makeHighlightsClickable:e.makeHighlightsClickable})],["url",l().createElement(eo,{className:null===(r=e.classNames)||void 0===r?void 0:r.url,disableTheme:e.disableTheme})],["badge",l().createElement(no,{className:null===(o=e.classNames)||void 0===o?void 0:o.badge,disableTheme:e.disableTheme,field:e.badgeField||"Category"})]]);return l().createElement($r,{highlightQueryOnClickedPage:e.highlightQueryOnClickedPage,disableTheme:e.disableTheme,className:"".concat(null!==(i=e.className)&&void 0!==i?i:""," ").concat(null!==(c=null===(a=e.classNames)||void 0===a?void 0:a.root)&&void 0!==c?c:""),result:e.result},s.map((function(e,t){return l().createElement(l().Fragment,{key:t},d.get(e))})))}function lo(){var e=c(),t=e.context,n=e.eventController,r=t.storedSearchResponseData.cludoSearchResponse,l=function(){var e,n,o,l=t.resultsPerPage||10;return{itemsPerPage:t.resultsPerPage||10,currentPage:t.currentPage||1,maxPages:Math.ceil((null===(e=t.storedSearchResponseData)||void 0===e?void 0:e.cludoSearchResponse.ResultCount)/l),nextPageLabel:(null===(n=t.translateProvider)||void 0===n?void 0:n.translate("next_page"))||"Next page",prevPageLabel:(null===(o=t.translateProvider)||void 0===o?void 0:o.translate("prev_page"))||"Previous page",showPagination:!(r.ResultCount<t.resultsPerPage||t.isEndlessScrollEnabled),showResultsPerPage:!(t.storedSearchResponseData.cludoSearchResponse.ResultCount<=0||t.isEndlessScrollEnabled)}},i=function(){var e,t;return{goToPage:(null===(e=null==n?void 0:n.goToPage)||void 0===e?void 0:e.bind(n))||function(){},setPerPage:(null===(t=null==n?void 0:n.setPerPage)||void 0===t?void 0:t.bind(n))||function(){}}};Sr((function(){s(l()),p(i())}));var a=(0,o.useState)(l()),u=a[0],s=a[1],d=(0,o.useState)(i()),f=d[0],p=d[1];return[u,f]}function io(e){var t,n,r,a,c,u,s,d,f,p,h,g,v,y,b,k,S,x=lo(),C=x[0],E=x[1],w=Cr()[0],T=(0,o.useState)(C),P=T[0],F=T[1],R=(0,o.useContext)(i);(0,o.useEffect)((function(){R.isLoadingResults||F(C)}),[C]);var N=e.previousButtonIcon||"<",A=e.nextButtonIcon||">",I=e.firstButtonIcon||"<<",O=e.lastButtonIcon||">>",_=P.currentPage<=5?1:P.currentPage>=P.maxPages-2?P.maxPages-3:P.currentPage-2,L=P.prevPageLabel,D=P.nextPageLabel,M=m("cludo-theme-btn-accent-secondary cludo-width-sm cludo-mr-2 cludo-my-1",e.disableTheme),j=m("cludo-theme-btn-accent-secondary-inactive cludo-width-sm cludo-mr-2 cludo-my-1",e.disableTheme),B=m(" cludo-theme-loading-disable",e.disableTheme||!w.isLoading);return P.showPagination?l().createElement("nav",{className:"".concat(null!==(t=e.className)&&void 0!==t?t:""," ").concat(null!==(r=null===(n=e.classNames)||void 0===n?void 0:n.root)&&void 0!==r?r:""," ").concat(B)},l().createElement("ul",{className:"".concat(null!==(c=null===(a=e.classNames)||void 0===a?void 0:a.list)&&void 0!==c?c:""," cludo-display-flex cludo-list-style-none cludo-p-0 cludo-m-0 cludo-mt-3 cludo-flex-wrap")},1===P.currentPage||e.hideFirst?null:l().createElement("li",{className:null===(u=e.classNames)||void 0===u?void 0:u.listItem,key:"first"},l().createElement("button",{"data-page":"first",className:"".concat(null!==(d=null===(s=e.classNames)||void 0===s?void 0:s.paginationButton)&&void 0!==d?d:""," ").concat(M),"aria-label":"First page",onClick:function(){E.goToPage(1)}},I)),1===P.currentPage||e.hidePrevious?null:l().createElement("li",{className:null===(f=e.classNames)||void 0===f?void 0:f.listItem,key:"prev"},l().createElement("button",{"data-page":"prev",className:"".concat(null!==(h=null===(p=e.classNames)||void 0===p?void 0:p.paginationButton)&&void 0!==h?h:""," ").concat(M),"aria-label":L,onClick:function(){E.goToPage(P.currentPage-1)}},N)),function(t,n){for(var r,o,i,a,c,u,s=P.currentPage||1,d=[],f=R.translateProvider.translate("general_page"),p=function(t){t===s?d.push(l().createElement("li",{className:null===(r=e.classNames)||void 0===r?void 0:r.listItem,key:t},l().createElement("button",{"aria-label":"Current, "+f+" "+t,"aria-current":"true","aria-disabled":"true",className:"".concat(null!==(i=null===(o=e.classNames)||void 0===o?void 0:o.paginationButton)&&void 0!==i?i:""," ").concat(j)},t))):d.push(l().createElement("li",{className:null===(a=e.classNames)||void 0===a?void 0:a.listItem,key:t},l().createElement("button",{"aria-label":f+" "+t,className:"".concat(null!==(u=null===(c=e.classNames)||void 0===c?void 0:c.paginationButton)&&void 0!==u?u:""," ").concat(M),onClick:function(){E.goToPage(t)}},t)))},m=t;m<=n&&m<=t+4;m++)p(m);return d}(_,P.maxPages),P.currentPage<P.maxPages&&!e.hideNext?l().createElement("li",{className:null===(g=e.classNames)||void 0===g?void 0:g.listItem,key:"next"},l().createElement("button",{"data-page":"next",className:"".concat(null!==(y=null===(v=e.classNames)||void 0===v?void 0:v.paginationButton)&&void 0!==y?y:""," ").concat(M),"aria-label":D,onClick:function(){E.goToPage(P.currentPage+1)}},A)):null,P.currentPage<P.maxPages&&!e.hideLast?l().createElement("li",{className:null===(b=e.classNames)||void 0===b?void 0:b.listItem,key:"last"},l().createElement("button",{"data-page":"last",className:"".concat(null!==(S=null===(k=e.classNames)||void 0===k?void 0:k.paginationButton)&&void 0!==S?S:""," ").concat(M),"aria-label":"Last page",onClick:function(){E.goToPage(P.maxPages)}},O)):null)):null}function ao(e){var t=(0,o.useContext)(i),n=(0,o.useContext)(a),r=(0,o.useRef)(null);(0,o.useEffect)((function(){r.current&&function(e,t,n,r){var o=e.querySelectorAll("a"),l=n.paramsPrefix;o.forEach((function(e){!function(e,t){var n=String(t.Id),r=t.Name;e.setAttribute("data-cludo-result","banner"),e.setAttribute("data-cludo-index","1"),e.setAttribute("data-cludo-object-id",n),e.setAttribute("data-cludo-title",r)}(e,t),-1!==decodeURIComponent(e.href).indexOf("#?"+l)?e.addEventListener("click",(function(t){t.preventDefault(),r.linkToSearchClickEvent(e)})):e.addEventListener("click",(function(t){r.searchResultTrackClickEventHandler(t,e)}))}))}(r.current,e.banner,t,n)}),[]);var c=m("cludo-mb-4 cludo-overflow-auto cludo-border-radius-card cludo-p-4 cludo-bg-color-accent-primary-light",e.disableTheme,e.className),u=m("cludo-theme-loading-disable-children",e.disableTheme||!t.isLoadingResults);return l().createElement("div",{ref:r,"data-cludo-result":"banner","data-cludo-id":e.banner.Id,"data-cludo-title":e.banner.Name,className:"cludo-banner ".concat(c," ").concat(u),role:"banner",dangerouslySetInnerHTML:Ir(e.banner.Banner)})}function co(){var e=c().context,t=function(){var t;return{banners:(null===(t=e.storedSearchResponseData)||void 0===t?void 0:t.cludoSearchResponse.Banners)||[]}};Sr((function(){return l(t())}));var n=(0,o.useState)(t()),r=n[0],l=n[1];return[r]}function uo(e){var t=co()[0],n=(e.banners||t.banners).map((function(t){return l().createElement(ao,{key:t.Id,banner:t,className:e.className})}));return n.length?l().createElement("div",{className:"cludo-banner-group"},n):l().createElement(l().Fragment,null)}function so(e){var t=Cr(),n=t[0],r=(t[1],(0,o.useContext)(i)),c=(0,o.useContext)(a),u=n.resultCount&&n.resultCount<10?n.resultsSummary.didYouMean:"",s=e.suggestedQuery||u,d=r.translateProvider.translate("did_you_mean",s),f=m("cludo-font-family-default cludo-font-size-md cludo-mb-2",e.disableTheme,e.className),p=m(" cludo-theme-loading-disable",e.disableTheme||!n.isLoading);return l().createElement("div",{className:f+p+" cludo-did-you-mean",onClick:function(e){return function(e,t,n){var r=e.target;r instanceof HTMLElement&&r.closest(".cludo-did-you-mean > a")&&(e.preventDefault(),n.handleDidYouMeanSelect(t))}(e,s,c)},dangerouslySetInnerHTML:s?Ir(d):{__html:""}})}function fo(e){var t=Cr(),n=t[0],r=(t[1],(0,o.useState)("")),a=r[0],c=r[1],u=(0,o.useContext)(i),s=e.resultCount||n.resultCount,d=u.storedSearchResponseData.cludoSearchResponse.Query;(0,o.useEffect)((function(){if(!u.isLoadingResults&&d){var e=u.translateProvider.translate("your_search_on",d),t=1===s?u.translateProvider.translate("total_result",s.toString()):u.translateProvider.translate("total_results",s.toString()),n=e+(e.length&&t.length?" ":"")+t;c(n)}}),[n]);var f=m("cludo-font-family-default cludo-font-size-md cludo-mb-2",e.disableTheme,e.className),p=m(" cludo-theme-loading-disable",e.disableTheme||!u.isLoadingResults);return a.length?l().createElement("span",{className:f+p,role:"status",dangerouslySetInnerHTML:{__html:a}}):null}var po=function(){return po=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},po.apply(this,arguments)};function mo(e){return l().createElement(l().Fragment,null,l().createElement(fo,po({},e)),l().createElement(so,{suggestedQuery:e.suggestedQuery}))}function ho(e){var t=(0,o.useContext)(i).translateProvider.translate("loading_results");return l().createElement(l().Fragment,null,e.isLoading?l().createElement("img",{src:"https://customer.cludo.com/img/loading.gif",className:"loading",tabIndex:-1,alt:t}):l().createElement(l().Fragment,null))}function go(e){return l().createElement("div",{className:"cludo-loader ".concat(e.className)},l().createElement("div",null),l().createElement("div",null),l().createElement("div",null),l().createElement("div",null))}function vo(e){var t,n,r,a,c=Cr(),u=c[0],s=(c[1],co()[0]),d=(0,o.useContext)(i),f=e.template||function(t){return l().createElement(oo,{disableTheme:e.disableTheme,result:t})},p=e.results||u.results,h=e.columns||1,g=e.resultSpacing||0,v=e.cssUnit||"px",y=(0,o.useState)([]),b=y[0],k=y[1],S=(0,o.useState)([]),x=S[0],C=S[1];(0,o.useEffect)((function(){d.isLoadingResults||k(p)}),[u]),(0,o.useEffect)((function(){d.isLoadingResults||C(s.banners)}),[s]);var E,w=m("cludo-position-relative",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),T=m("",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.banner),P=m("cludo-theme-results-list",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.resultsListContainer)+" cludo_results-list cludo-box-sizing cludo-display-flex cludo-flex-wrap cludo-list-style-none cludo-p-0",F=m("",e.disableTheme,null===(a=null==e?void 0:e.classNames)||void 0===a?void 0:a.resultsListItem)+" cludo_result cludo-border-box cludo-col-in-grid-"+h,R=m(" cludo-theme-loading-disable",e.disableTheme||!d.isLoadingResults);return l().createElement(l().Fragment,null,e.hideBanners?l().createElement(l().Fragment,null):x.map((function(e){return l().createElement(ao,{className:T,banner:e})})),l().createElement("div",{className:w},b.length>0&&l().createElement("ul",{className:P},l().createElement("style",null,(E="",e.columnsBreakpoint&&(E+="\n @media (max-width: ".concat(e.columnsBreakpoint).concat(v,") {\n .cludo_result { width: 100% !important }\n }\n ")),E+="\n .cludo_results-list { margin: -".concat(g/2).concat(v," }\n .cludo_result { padding: ").concat(g/2).concat(v," }\n "))),b.map((function(e,t){return l().createElement("li",{className:F+R,key:t},f(e))}))),!e.disableTheme&&u.isLoading?l().createElement("div",{className:"cludo-my-5 cludo-position-absolute cludo-top-0 cludo-absolute-center"},l().createElement(go,null)):l().createElement(l().Fragment,null)))}function yo(e){var t,n,r,a,c,u=(0,o.useContext)(i),s=e.label||u.translateProvider.translate("load_more");return l().createElement("div",{className:"".concat(null!==(n=null===(t=e.classNames)||void 0===t?void 0:t.root)&&void 0!==n?n:""," ").concat(null!==(r=e.className)&&void 0!==r?r:""),id:"cludo-load-more"},l().createElement("button",{className:null!==(c=null===(a=e.classNames)||void 0===a?void 0:a.loadMoreButton)&&void 0!==c?c:"",type:"button",onClick:e.onClick},s))}function bo(e){var t,n,r,a,c=Cr(),u=c[0],s=c[1],d=lo(),f=d[0],p=(d[1],(0,o.useContext)(i)),h=e.label||p.translateProvider.translate("load_more"),g=u.endlessScrollOptions.isEnabled&&(null===(t=u.endlessScrollOptions)||void 0===t?void 0:t.stopAfterPage)&&(null===(n=u.endlessScrollOptions)||void 0===n?void 0:n.stopAfterPage)<=f.currentPage&&f.currentPage!==f.maxPages&&!u.isLoading,v={root:m("",e.disableTheme,e.className,null===(r=e.classNames)||void 0===r?void 0:r.root),loadMoreButton:m("cludo-theme-btn-accent-secondary cludo-font-size-sm cludo-font-weight-bold cludo-width-100 cludo-mt-3",e.disableTheme,null===(a=e.classNames)||void 0===a?void 0:a.loadMoreButton)};return g?l().createElement(yo,{classNames:v,label:h,onClick:s.loadMore}):null}var ko,So=function(){return So=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},So.apply(this,arguments)},xo=Co({});function Co(e){var t=e.result||oo,n=e.list||vo,r=e.loader||ho,o=e.pagination||io;return function(){var e=Cr(),i=e[0],a=(e[1],i.suggestions[0]?i.suggestions[0]:"");return l().createElement(l().Fragment,null,l().createElement(mo,So({},i.resultsSummary,{suggestedQuery:a})),l().createElement(uo,null),l().createElement(n,{template:function(e){return l().createElement(t,{result:e})}}),l().createElement(r,{isLoading:i.isLoading}),l().createElement(o,null),l().createElement(bo,null))}}function Eo(e){return l().createElement(l().Fragment,null,e.chunkedText.map((function(e,t){return"highlight"===e.displayType?l().createElement("strong",{role:"presentation none",key:t},e.text):l().createElement("span",{role:"presentation none",key:t},e.text)})))}function wo(e){var t,n=(0,o.useContext)(a),r="cludo-result-item-".concat(e.resultIndex),i=m("cludo-p-2 cludo-font-family-default cludo-border-b-1-neutral cludo-border-b-solid cludo-border-radius-button cludo-cursor-pointer cludo-bg-hover-gray-light ".concat(e.isSelected?"cludo-bg-color-gray-light":"cludo-bg-color-white"),e.disableTheme,e.className)+(e.isSelected?" active":""),c=null!==(t=e.children)&&void 0!==t?t:l().createElement(Eo,{chunkedText:e.result.chunkedTitle}),u=e.resultType||ko.Result;return(0,o.useEffect)((function(){e.isSelected&&n.setActiveDescendantToSuggestions(r)}),[e.isSelected]),l().createElement("li",{id:r,tabIndex:0,"aria-selected":e.isSelected?"true":void 0,role:"option",className:i,"data-cludo-autocomplete":u,"data-cludo-autocomplete-index":e.resultIndex,onClick:function(){return n.selectResult(e.result.document)}},l().createElement(Qr,{result:e.result.document},c))}function To(e){var t=(0,o.useContext)(a),n="cludo-suggestion-item-".concat(e.suggestionIndex),r=m("cludo-p-2 cludo-font-family-default cludo-border-b-1-neutral cludo-border-b-solid cludo-border-radius-button cludo-cursor-pointer cludo-bg-hover-gray-light ".concat(e.isSelected?"cludo-bg-color-gray-light":"cludo-bg-color-white"),e.disableTheme,e.className)+(e.isSelected?" active":"");return(0,o.useEffect)((function(){e.isSelected&&t.setActiveDescendantToSuggestions(n)}),[e.isSelected]),l().createElement("li",{id:n,tabIndex:0,"aria-selected":e.isSelected?"true":void 0,role:"option",className:r,"data-cludo-autocomplete":ko.Suggestion,"data-cludo-autocomplete-index":e.suggestionIndex,onClick:function(){return t.selectSuggestion(e.suggestion.title,e.suggestionIndex)}},l().createElement(Eo,{chunkedText:e.suggestion.chunkedTitle}))}function Po(e){var t=(0,o.useContext)(a),n="cludo-recent-search-item-".concat(e.recentSearchIndex),r=m("cludo-p-2 cludo-font-family-default cludo-border-b-1-neutral cludo-border-b-solid cludo-border-radius-button cludo-cursor-pointer cludo-bg-hover-gray-light ".concat(e.isSelected?"cludo-bg-color-gray-light":"cludo-bg-color-white"),e.disableTheme,e.className)+(e.isSelected?" active":"");return(0,o.useEffect)((function(){e.isSelected&&t.setActiveDescendantToSuggestions(n)}),[e.isSelected]),l().createElement("li",{id:n,tabIndex:0,"aria-selected":e.isSelected?"true":void 0,role:"option",className:r,"data-cludo-autocomplete":ko.RecentSearch,"data-cludo-autocomplete-index":e.recentSearchIndex,onClick:function(){return t.selectSuggestion(e.recentSearch.title,e.recentSearchIndex)}},l().createElement(Eo,{chunkedText:e.recentSearch.chunkedTitle}))}function Fo(){return!("undefined"==typeof window||"undefined"==typeof document)}!function(e){e.Result="result",e.CategorizedResult="categorized-result",e.Suggestion="suggestion",e.RecentSearch="recent-search"}(ko||(ko={}));var Ro=function(){return Ro=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ro.apply(this,arguments)};function No(){var e,t,n,r,l,i=c(),a=i.context,u=i.eventController,s=(0,o.useRef)(-1),d=function(e){var t,n,r,o,l,i;if(Fo()){var c,d,f,p=(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.suggestions)||[],g=(null===(n=a.storedAutocompleteResponse)||void 0===n?void 0:n.data.instantSuggestions)||[],v=(null===(r=a.storedAutocompleteResponse)||void 0===r?void 0:r.data.results)||[],y=(null===(o=a.storedAutocompleteResponse)||void 0===o?void 0:o.data.recentSearches)||[],b=function(e){var t=[];return e.forEach((function(e){e.Values.forEach((function(e){t=t.concat(e.Hits)}))})),t}((null===(l=a.storedAutocompleteResponse)||void 0===l?void 0:l.data.categorizedResults)||[]),k=document.querySelectorAll("[data-cludo-autocomplete]");c=d=f=-1;var S=s.current,x=k.length;if("Enter"===e&&-1===S)u.search();else if(k&&k.length>0&&("ArrowKeyUp"===e&&(S=(((S=-1===S?0:S)-1)%x+x)%x),"ArrowKeyDown"===e&&(S=((S+1)%x+x)%x),k[S]))switch(k[S].getAttribute("data-cludo-autocomplete")){case"suggestion":var C=null!==(i=p[c=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))])&&void 0!==i?i:g[c];"Enter"===e&&u.selectSuggestion(C.title,c);break;case"result":var E=v[d=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))];"Enter"===e&&u.selectResult(E.document);break;case"categorized-result":var w=b[d=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))];"Enter"===e&&u.selectResult(w.document);break;case"recent-search":var T=y[f=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))];"Enter"===e&&u.selectRecentSearch(T.title,f)}s.current=S;var P=Ro(Ro({},h()),{selectedSuggestion:c,selectedResult:d,selectedRecentSearch:f});m(P)}};(0,o.useEffect)((function(){var e=Object.keys(u).length>0,t=e?u.subscribe("autocompleteSelectionNext",(function(){d("ArrowKeyDown")})):-1,n=e?u.subscribe("autocompleteSelectionPrev",(function(){d("ArrowKeyUp")})):-1,r=e?u.subscribe("autocompleteSetSelection",(function(){d("Enter")})):-1,o=e?u.subscribe("afterautocomplete",(function(){!function(){var e,t;s.current=-1;var n=Ro(Ro({},h()),{suggestions:(null===(e=a.storedAutocompleteResponse)||void 0===e?void 0:e.data.suggestions)||[],results:(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.results)||[],selectedSuggestion:-1,selectedResult:-1,selectedRecentSearch:-1});m(n)}()})):-1;return function(){e&&(u.unsubscribe(t),u.unsubscribe(n),u.unsubscribe(r),u.unsubscribe(o))}}));var f=(0,o.useState)({suggestions:[],instantSuggestions:(null===(e=a.storedAutocompleteResponse)||void 0===e?void 0:e.data.instantSuggestions)||[],results:[],recentSearches:(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.recentSearches)||[],categorizedResults:[],selectedSuggestion:-1,selectedResult:-1,selectedRecentSearch:-1,suggestionsTitle:(null===(n=a.translateProvider)||void 0===n?void 0:n.translate("template_suggestions"))||"",resultsTitle:(null===(r=a.translateProvider)||void 0===r?void 0:r.translate("template_search_results"))||"",recentSearchesTitle:(null===(l=a.translateProvider)||void 0===l?void 0:l.translate("recent_searches_title"))||""}),p=f[0],m=f[1],h=function(){var e,t,n,r,o,l,i,c;return Ro(Ro({},p),{suggestions:(null===(e=a.storedAutocompleteResponse)||void 0===e?void 0:e.data.suggestions)||[],instantSuggestions:(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.instantSuggestions)||[],results:(null===(n=a.storedAutocompleteResponse)||void 0===n?void 0:n.data.results)||[],recentSearches:(null===(r=a.storedAutocompleteResponse)||void 0===r?void 0:r.data.recentSearches)||[],categorizedResults:(null===(o=a.storedAutocompleteResponse)||void 0===o?void 0:o.data.categorizedResults)||[],suggestionsTitle:(null===(l=a.translateProvider)||void 0===l?void 0:l.translate("template_suggestions"))||"",resultsTitle:(null===(i=a.translateProvider)||void 0===i?void 0:i.translate("template_search_results"))||"",recentSearchesTitle:(null===(c=a.translateProvider)||void 0===c?void 0:c.translate("recent_searches_title"))||""})};return[p,{initiateAutocompleteRequest:function(e){return u.initiateAutocompleteRequest(e)},autocompleteSelectionNext:function(){u.emitEvent("autocompleteSelectionNext",{})},autocompleteSelectionPrev:function(){u.emitEvent("autocompleteSelectionPrev",{})},autocompleteSelect:function(){-1!==p.selectedSuggestion&&u.selectSuggestion(p.suggestions[p.selectedSuggestion].title,p.selectedSuggestion),-1!==p.selectedResult&&u.selectResult(p.results[p.selectedResult].document),-1!==p.selectedRecentSearch&&u.selectRecentSearch(p.recentSearches[p.selectedRecentSearch].title,p.selectedRecentSearch)},clear:function(){u.clearAutocomplete()}}]}var Ao=function(e,t){switch(e.key){case"ArrowDown":e.preventDefault(),t.autocompleteSelectionNext();break;case"ArrowUp":e.preventDefault(),t.autocompleteSelectionPrev();break;case"Enter":e.preventDefault(),t.autocompleteSelect()}},Io=function(e,t){_r(e.relatedTarget)||t.clear()},Oo=function(e,t){t.initiateAutocompleteRequest(e.target.value)};function _o(){var e=No()[0],t=e.suggestions,n=e.results,r=e.recentSearches,o=e.selectedSuggestion,i=e.selectedResult,a=e.selectedRecentSearch,c=e.suggestionsTitle,u=e.resultsTitle,s=e.recentSearchesTitle;return l().createElement(l().Fragment,null,t.length?l().createElement(l().Fragment,null,l().createElement("h3",null,c),l().createElement("div",{className:"section-divider"}),l().createElement("ul",{className:"cludo-search-autocomplete-suggestions"},t.map((function(e,t){var n=t===o;return l().createElement(To,{key:t,suggestion:e,isSelected:n,suggestionIndex:t})})))):null,n.length?l().createElement(l().Fragment,null,l().createElement("h3",null,u),l().createElement("ul",{className:"cludo-search-autocomplete-results"},n.map((function(e,t){var n=t===i;return l().createElement(wo,{key:t,result:e,isSelected:n,resultIndex:t})})))):null,r.length?l().createElement(l().Fragment,null,l().createElement("h3",null,s),l().createElement("div",{className:"section-divider"}),l().createElement("ul",{className:"cludo-search-autocomplete-recent-searches"},r.map((function(e,t){var n=t===a;return l().createElement(Po,{key:t,recentSearch:e,isSelected:n,recentSearchIndex:t})})))):null)}var Lo=function(){return Lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lo.apply(this,arguments)},Do=function(){function e(e){this._cludoSearch=e}return Object.defineProperty(e.prototype,"params",{get:function(){return this._cludoSearch.params},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"customerId",{get:function(){return this._cludoSearch.customerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"engineId",{get:function(){return this._cludoSearch.engineId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._cludoSearch.params.query},set:function(e){this._cludoSearch.params.query=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentPage",{get:function(){return this._cludoSearch.params.page},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resultsPerPage",{get:function(){return this._cludoSearch.params.perPage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sort",{get:function(){return this._cludoSearch.params.sort},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortItems",{get:function(){return this._cludoSearch.clientTemplateSortOptions||[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"experienceConfigs",{get:function(){return this._cludoSearch.websiteSettings.configurations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateProvider",{get:function(){return this._cludoSearch.translateProvider},enumerable:!1,configurable:!0}),e.prototype.isFacetSelected=function(e,t){return this.params.facets[e]&&-1!==this.params.facets[e].indexOf(t)},e.prototype.isFilterSelected=function(e,t){return this.params.filters[e]&&-1!==this.params.filters[e].indexOf(t)},e.prototype.getSelectedMapItem=function(e){var t={};for(var n in e)e[n].length&&(t[n]=e[n]);return t},Object.defineProperty(e.prototype,"selectedFacets",{get:function(){return this.getSelectedMapItem(this.params.facets)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedFilters",{get:function(){return this.getSelectedMapItem(this.params.filters)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"facets",{get:function(){var e=this,t=this.storedSearchResponseData.cludoSearchResponse.Facets,n=Object.keys(this._cludoSearch.facets);return Object.entries(t).filter((function(e){var t=e[0];return e[1],n.includes(t)})).map((function(t){var n=t[0],r=t[1];return{key:n,hasSelection:!!e.params.facets[n]&&e.params.facets[n].length>0,values:r.Items.map((function(t){return{facetName:n,count:t.Count,value:t.Key,isSelected:e.isFacetSelected(n,t.Key)}})),allCount:r.AllCount,missingCount:r.MissingCount}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLoadingResults",{get:function(){return this._cludoSearch.isLoadingResults},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enabledFeatures",{get:function(){return this._cludoSearch.enabledFeatures},enumerable:!1,configurable:!0}),e.prototype.isFeatureEnabled=function(e){return this._cludoSearch.enabledFeatures.includes(e)},Object.defineProperty(e.prototype,"endlessScroll",{get:function(){return this._cludoSearch.endlessScroll||null},set:function(e){this._cludoSearch.endlessScroll=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEndlessScrollEnabled",{get:function(){return!!this._cludoSearch.endlessScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAutocompleteEnabled",{get:function(){return this._cludoSearch.richAutocomplete},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paramsPrefix",{get:function(){return this._cludoSearch.paramsPrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkFragment",{set:function(e){this._cludoSearch.linkFragment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storedSearchResponseData",{get:function(){var e=this;return{cludoSearchResponse:Lo(Lo({},this._cludoSearch.storedSearchResponseData),{TopHits:this._cludoSearch.storedSearchResponseData.TopHits.map((function(t){return Lr(t,e._cludoSearch.storedSearchResponseData.Facets)}))})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"focusOnResultsAfterSearch",{get:function(){return this._cludoSearch.focusOnResultsAfterSearch},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"customEngineSettings",{get:function(){var e,t=this,n={};try{n=null!==(e=JSON.parse(this._cludoSearch.websiteSettings.customEngineSettings))&&void 0!==e?e:n}catch(e){}return this._cludoSearch.websiteSettings.configurations?(Object.keys(this._cludoSearch.websiteSettings.configurations).forEach((function(e){n[e]=t._cludoSearch.websiteSettings.configurations[e]})),n):n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instantSuggestionsConfiguration",{get:function(){return this._cludoSearch.websiteSettings.instantSuggestionsConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recentSearches",{get:function(){return this._cludoSearch.recentSearches},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storedError",{get:function(){return this._cludoSearch.storedError},enumerable:!1,configurable:!0}),e.prototype.chunkString=function(e,t){var n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?[{text:e,displayType:"default"}]:[{text:e.substring(0,n),displayType:"default"},{text:e.substring(n,n+t.length),displayType:"highlight"},{text:e.substring(n+t.length),displayType:"default"}]},e.prototype.mapTypedDocumentToResult=function(e,t){var n,r=null!==(n=Fr(e,"Title"))&&void 0!==n?n:"";return{title:r,chunkedTitle:this.chunkString(r,t),document:e}},e.prototype.mapTypedDocumentToSuggestion=function(e,t){var n,r=null!==(n=Fr(e,"Title"))&&void 0!==n?n:"";return{title:r,chunkedTitle:this.chunkString(r,t)}},e.prototype.mapStringToSuggestion=function(e){return{title:e,chunkedTitle:this.chunkString(e,"")}},e.prototype.mapTopHitsToCategorizedResults=function(e,t){var n=this;return{Field:e.Field,Values:e.Values.map((function(e){return n.mapHitValuesToResults(e,t)}))}},e.prototype.mapHitValuesToResults=function(e,t){var n=this;return{Value:e.Value,Hits:e.Hits.map((function(e){return n.mapTypedDocumentToResult(e,t)}))}},Object.defineProperty(e.prototype,"storedAutocompleteResponse",{get:function(){var e,t,n,r,o,l=this,i=this._cludoSearch.storedAutocompleteResponse;return{data:{query:i.cludoAutocompleteResponse.query,facets:i.cludoAutocompleteResponse.facets,totalResults:i.cludoAutocompleteResponse.totalResults,totalSuggestions:i.cludoAutocompleteResponse.totalSuggestions,totalRecentSearches:i.cludoAutocompleteResponse.totalRecentSearches,results:null===(e=i.cludoAutocompleteResponse.results)||void 0===e?void 0:e.map((function(e){return l.mapTypedDocumentToResult(e,i.cludoAutocompleteResponse.query)})),suggestions:null===(t=i.cludoAutocompleteResponse.suggestions)||void 0===t?void 0:t.map((function(e){return l.mapTypedDocumentToSuggestion(e,i.cludoAutocompleteResponse.query)})),instantSuggestions:null===(n=i.cludoAutocompleteResponse.instantSuggestions)||void 0===n?void 0:n.map((function(e){return l.mapTypedDocumentToSuggestion(e,i.cludoAutocompleteResponse.query)})),recentSearches:null===(r=i.cludoAutocompleteResponse.recentSearches)||void 0===r?void 0:r.map((function(e){return l.mapStringToSuggestion(e)})),categorizedResults:null===(o=i.cludoAutocompleteResponse.topHits)||void 0===o?void 0:o.map((function(e){return Lr(l.mapTopHitsToCategorizedResults(e,i.cludoAutocompleteResponse.query),i.cludoAutocompleteResponse.facets)}))},isLoading:i.isLoading}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTrackedSession",{get:function(){return 0!==this._cludoSearch.isTrackedSession},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canUserBeTracked",{set:function(e){this._cludoSearch.canUserBeTracked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"queryId",{get:function(){return this._cludoSearch.queryId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._cludoSearch.getSessionId()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"querySessionId",{get:function(){return this._cludoSearch.querySessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceType",{get:function(){return this._cludoSearch.deviceType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"traits",{get:function(){return this._cludoSearch.getTraitsFromStorage()||[]},enumerable:!1,configurable:!0}),e}();const Mo=require("react-dom");var jo,Bo=n.n(Mo),zo=function(){function e(e,t){var n=this;this.keyedSubscriptions=[],this._curSubscriptionIndex=1,this.setDateRangeFacet=function(e,t,r){return n.setRangeFacetMap("date",e,t,r)},this.setNumberRangeFacet=function(e,t,r){return n.setRangeFacetMap("range",e,t,r)},this.clearDateRangeFacet=function(){n.clearRangeFacetMap("date")},this.clearNumberRangeFacet=function(){n.clearRangeFacetMap("range")},this._cludoSearch=e,this._searchContext=t}return e.prototype.subscribe=function(e,t){var n=this._curSubscriptionIndex++;return this.keyedSubscriptions.push({id:n,type:e,fnc:t}),n},e.prototype.subscribeToAllEvents=function(e){var t=this,n=this._curSubscriptionIndex++;return["afterautocomplete","aftersearch","autocompleteSelectionNext","autocompleteSelectionPrev","autocompleteSetSelection","beforeredirect","beforesearch","error"].forEach((function(r){t.keyedSubscriptions.push({id:n,type:r,fnc:e})})),n},e.prototype.unsubscribe=function(e){this.keyedSubscriptions=this.keyedSubscriptions.filter((function(t){return t.id!==e}))},e.prototype.emitEvent=function(e,t){this.executeCallbacksForType(e,t)},e.prototype.executeCallbacksForType=function(e,t){this.subscribersForType(e).forEach((function(e){e.fnc(t)}))},e.prototype.subscribersForType=function(e){return this.keyedSubscriptions.filter((function(t){return t.type===e}))},e.prototype.search=function(e){e&&(this._cludoSearch.params.query=e),this._cludoSearch._handleQuickLinks()||this._cludoSearch.search()},e.prototype.clearResults=function(){this._cludoSearch.clearStoredSearchResponseData()},Object.defineProperty(e.prototype,"searchResultKeyUpEvent",{get:function(){return this._cludoSearch.searchResultKeyUpEvent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchResultTrackClickEventHandler",{get:function(){return this._cludoSearch.searchResultTrackClickEventHandler},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkToSearchClickEvent",{get:function(){return this._cludoSearch.linkToSearchClickEvent},enumerable:!1,configurable:!0}),e.prototype.selectFacet=function(e,t,n){void 0===n&&(n=!1),this._cludoSearch.facet(e,t,n)},e.prototype.deselectFacet=function(e,t){this._cludoSearch.clearFacet(e,t)},e.prototype.clearFacet=function(e){this._cludoSearch.clearFacetByName(e)},e.prototype.clearAllFacets=function(){this._cludoSearch.clearAllFacetsAndSearch()},e.prototype.softClearAllFacets=function(){this._cludoSearch.clearAllFacets()},e.prototype.setRangeFacetMap=function(e,t,n,r){this._cludoSearch.params.facets[e]=[t,n.toString(),r.toString()]},e.prototype.clearRangeFacetMap=function(e){this._cludoSearch.clearFacetByName(e)},e.prototype.setFilter=function(e,t){this._cludoSearch.filter(e,t)},e.prototype.setFilters=function(e){this._cludoSearch.params.filters=e},e.prototype.clearAllFilters=function(){this._cludoSearch.clearAllFilters()},e.prototype.toggleFacetValue=function(e,t){this._searchContext.isFacetSelected(e,t)?this.deselectFacet(e,t):this.selectFacet(e,t)},Object.defineProperty(e.prototype,"didYouMean",{set:function(e){this._cludoSearch.didYouMean=e},enumerable:!1,configurable:!0}),e.prototype.handleDidYouMeanSelect=function(e){this.didYouMean=e,this._cludoSearch.setDidYouMean()},e.prototype.goToPage=function(e){this._cludoSearch.page(e,!0)},e.prototype.setPerPage=function(e){this._cludoSearch.params.perPage=e,this._cludoSearch.page(1)},e.prototype.clearSortOrder=function(){this._cludoSearch.clearSortOrder()},e.prototype.clearSortParams=function(){this._cludoSearch.clearSortParams()},e.prototype.addToSortOrder=function(e,t){this._cludoSearch.setSortOrder(e,t)},e.prototype.setSortOrder=function(e,t){this.clearSortParams(),this.addToSortOrder(e,t)},e.prototype.initiateAutocompleteRequest=function(e){this._cludoSearch.autocompleteByQuery(e)},e.prototype.selectSuggestion=function(e,t){this._cludoSearch.autocompleteSetSelectedSuggestion(e,t)},e.prototype.selectResult=function(e){this._cludoSearch.autocompleteSetSelectedResult(e)},e.prototype.selectRecentSearch=function(e,t){this._cludoSearch.autocompleteSetSelectedRecentSearch(e,t)},e.prototype.clearRecentSearches=function(){this._cludoSearch.clearRecentSearches()},e.prototype.clearAutocomplete=function(){this._cludoSearch.autocompleteRestoreClient()},e.prototype.setActiveDescendantToSuggestions=function(e){this._cludoSearch.setActiveDescendantToSuggestions(e)},e.prototype.endlessScrollLoadMore=function(){this._cludoSearch.endlessScrollLoadMoreClickEvent()},e.prototype.trackQuery=function(e){return this._cludoSearch.trackQuery(e)},e.prototype.trackClick=function(e){return this._cludoSearch.trackClick(e)},e.prototype.trackChatClick=function(e){return this._cludoSearch.trackChatClick(e)},e.prototype.getConversations=function(){return this._cludoSearch.conversationService.getConversationsFromStorage()},e.prototype.storeConversations=function(e){this._cludoSearch.conversationService.storeConversations(e)},e.prototype.sendQuestion=function(e,t,n,r){return this._cludoSearch.conversationService.sendQuestion(e,t,n,r)},e.prototype.sendChatFeedbackData=function(e,t,n){return this._cludoSearch.conversationService.sendFeedbackData(e,t,n)},e.prototype.getTrendingPages=function(e,t,n){return this._cludoSearch.getTrendingPages(e,t,n)},e.prototype.getPopularPages=function(e,t,n){return this._cludoSearch.getPopularPages(e,t,n)},e.prototype.getRelatedPages=function(e,t){return this._cludoSearch.getRelatedPages(e,t)},e}();!function(e){e.Results="results",e.Autocomplete="autocomplete",e.Controls="controls",e.Loader="loader",e.Custom="custom"}(jo||(jo={}));var Ho=function(){function e(e,t,n){this.managedComponents=[],this._searchContext=t,this.events=new zo(e,t),this._cssTheme=n}return e.prototype.registerSearchResultsComponent=function(e,t){this.addManagedComponent(e,t,["beforesearch","aftersearch"])},e.prototype.registerControlsComponent=function(e,t){this.addManagedComponent(e,t,["beforesearch","aftersearch"])},e.prototype.registerAutocompleteComponent=function(e,t){this.addManagedComponent(e,t,["afterautocomplete","afterinputfocus"])},e.prototype.registerComponent=function(e,t,n,r){void 0===n&&(n=[]),void 0===r&&(r=!0),this.addManagedComponent(e,t,n,r)},e.prototype.addManagedComponent=function(e,t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=!1),Fo()){var o={component:e,elem:"string"==typeof t?document.querySelector(t):t,elemSelector:"string"==typeof t?t:void 0,observedEventTypes:n};this.managedComponents.push(o),r&&this.renderComponent(o)}},e.prototype.processEvent=function(e,t,n){var r=this;this.events.emitEvent(e,t),this.managedComponents.filter((function(t){return 0===t.observedEventTypes.length||t.observedEventTypes.includes(e)})).forEach((function(e){return r.renderComponent(e)})),n&&n()},e.prototype.renderComponent=function(e){var t=e.component;!e.elem&&Fo()&&(e.elem=document.querySelector(e.elemSelector)),e.elem&&Bo().render(l().createElement(l().StrictMode,null,l().createElement(i.Provider,{value:this._searchContext},l().createElement(a.Provider,{value:this.events},l().createElement(p,{theme:this._cssTheme},l().createElement(t,null))))),e.elem,(function(){}))},e}(),Uo=function(){function e(e,t){this._cludoSearch=e,this.instance=new Do(this._cludoSearch),this.components=new Ho(this._cludoSearch,this.instance,t)}return e.prototype.search=function(){this._cludoSearch.search()},e.prototype.addWidget=function(e,t,n){switch(e){case jo.Results:this.components.registerSearchResultsComponent(t,n);case jo.Controls:this.components.registerControlsComponent(t,n);case jo.Autocomplete:this.components.registerAutocompleteComponent(t,n)}return this},e.prototype.setOverrideString=function(e,t,n){var r=this._cludoSearch.translateProvider.translations[n];return r&&(r[e]=t),this},e.prototype.setOverrideStrings=function(e){var t=this,n=this.instance.translateProvider.language;return Object.keys(e).map((function(r){var o=e[r];r&&o&&t.setOverrideString(r,o,n)})),this},e.prototype.setLanguage=function(e){return this.instance.translateProvider.language=e,this},e}();function Vo(){var e=c(),t=e.context,n=e.eventController,r=function(){return{sortOrder:t.sort||{},sortItems:t.sortItems||[]}},l=function(){var e,t,r;return{setSortOrder:(null===(e=null==n?void 0:n.setSortOrder)||void 0===e?void 0:e.bind(n))||function(){},addToSortOrder:(null===(t=null==n?void 0:n.addToSortOrder)||void 0===t?void 0:t.bind(n))||function(){},clearSortOrder:(null===(r=null==n?void 0:n.clearSortOrder)||void 0===r?void 0:r.bind(n))||function(){}}};Sr((function(){u(r()),f(l())}));var i=(0,o.useState)(r()),a=i[0],u=i[1],s=(0,o.useState)(l()),d=s[0],f=s[1];return[a,d]}function qo(e){var t=Vo(),n=t[0],r=t[1],o=e.relevanceLabel?e.relevanceLabel:"Relevance",i=Object.keys(n.sortOrder),a=i.length>0,c=a?void 0:"active";return l().createElement("div",{className:"cludo-sort-picker"},l().createElement("ul",{className:"cludo-sort-picker-list"},l().createElement("li",{className:"cludo-sort-picker-item ".concat(c)},l().createElement("a",{onClick:function(){return r.clearSortOrder()}},o)),n.sortItems.map((function(e){var t=a&&i[0]==e.key&&n.sortOrder[e.key]==e.direction?"active":void 0;return l().createElement("li",{className:"cludo-sort-picker-item ".concat(t),key:e.key+e.direction},l().createElement("a",{onClick:function(){return r.setSortOrder(e.key,e.direction)}},e.displayText))}))))}function Wo(e){return l().createElement("a",{className:e.className,href:"#",onClick:function(t){return t.preventDefault(),void e.onClick()}},e.children)}function Qo(e){var t=c(),n=t.context,r=t.eventController,l=function(){var t;return{facet:(null===(t=null==n?void 0:n.facets)||void 0===t?void 0:t.find((function(t){return t.key===e})))||null}},i=function(){var t,n,o,l,i,a;return{selectFacet:(null===(t=null==r?void 0:r.selectFacet)||void 0===t?void 0:t.bind(r,e))||function(){},deselectFacet:(null===(n=null==r?void 0:r.deselectFacet)||void 0===n?void 0:n.bind(r,e))||function(){},toggleFacetValue:(null===(o=null==r?void 0:r.toggleFacetValue)||void 0===o?void 0:o.bind(r,e))||function(){},clearFacet:(null===(l=null==r?void 0:r.clearFacet)||void 0===l?void 0:l.bind(r,e))||function(){},setDateRangeFacet:(null===(i=null==r?void 0:r.setDateRangeFacet)||void 0===i?void 0:i.bind(r,e))||function(){},setNumberRangeFacet:(null===(a=null==r?void 0:r.setNumberRangeFacet)||void 0===a?void 0:a.bind(r,e))||function(){}}};Sr((function(){s(l()),p(i())}));var a=(0,o.useState)(l()),u=a[0],s=a[1],d=(0,o.useState)(i()),f=d[0],p=d[1];return[u,f]}function Yo(e){var t=Qo(e.facetItem.facetName),n=(t[0],t[1]),r=m("cludo-theme-facet-option",e.disableTheme,e.className),o=m("cludo-theme-facet-option cludo-font-weight-bold",e.disableTheme,e.className)+" cludo-active",i=m("cludo-theme-facet-count",e.disableTheme,e.className),a=e.facetItem.isSelected?o:r;return l().createElement(Wo,{className:a,onClick:function(){n.toggleFacetValue(e.facetItem.value),e.onChange&&e.onChange()}},e.facetItem.value,!e.hideCount&&e.facetItem.count?l().createElement(l().Fragment,null," ",l().createElement("span",{className:i},e.facetItem.count)):null)}var Ko=function(){return Ko=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ko.apply(this,arguments)},$o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,l=t.length;o<l;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Zo(e,t){var n=$o([],e,!0),r=$o([],t,!0);if(r.filter((function(e){return"*"===e})).length>1)throw new Error("Only one wildcard (*) allowed in a reference order");r=r.filter((function(e){return n.includes(e)||"*"===e})),n=n.filter((function(e){return!r.includes(e)}));var o=r.indexOf("*");return o>-1?(r.splice.apply(r,$o([o,1],n,!1)),r):r.concat(n)}function Go(e){var t,n,r,o=m("cludo-display-flex cludo-align-items-center cludo-mb-2",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),i=m("cludo-font-size-lg cludo-m-0 cludo-mr-3 cludo-line-height-2",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.header),a=m("cludo-theme-btn-gray",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.clearButton);return e.facet?l().createElement("div",{className:o},l().createElement("h3",{className:i},e.label),!e.hideClear&&e.facet.hasSelection?l().createElement("button",{className:a,onClick:e.onClear},e.clearLabel||"Clear"):null):null}function Xo(e){var t=e.facetItems,n=e.placeholder||"Search options",r=e.hideSelected||!1,o=m("cludo-theme-searchbar",e.disableTheme,e.className);return l().createElement("input",{placeholder:n,className:o,onChange:function(n){var o,l=null===(o=n.currentTarget)||void 0===o?void 0:o.value,i=null==t?void 0:t.filter((function(e){return e.value.toLowerCase().includes(l.toLowerCase())||e.isSelected&&!r}));e.onChange(i)}})}function Jo(e){var t,n,r,i=e.limit||1/0,a=e.hideShowMore||!1,c=e.hideCount||!1,u=(0,o.useState)(i),s=u[0],d=u[1],f=(e.className?e.className+" ":"")+((null===(t=e.classNames)||void 0===t?void 0:t.root)?e.classNames.root+" ":"")+"cludo-list-style-none cludo-p-0 cludo-mt-0 cludo-mb-3",p=(null===(n=e.classNames)||void 0===n?void 0:n.listItem)?e.classNames.listItem+" ":"",h=m("cludo-theme-btn-accent-secondary cludo-font-weight-bold",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.loadMoreButton);function g(e,t){return!e.isSelected&&t>s-1}return(0,o.useEffect)((function(){d(i)}),[e.limit]),l().createElement(l().Fragment,null,l().createElement("ul",{className:f},e.facetItems.map((function(t,n){return l().createElement("li",{className:(g(t,n)?"cludo-display-none ":"")+p,key:"facet-value-".concat(t.value)},l().createElement(e.itemComponent,{key:"facet-value-".concat(t.value),facetItem:t,hideCount:c,disableTheme:e.disableTheme}))}))),!a&&s<e.facetItems.length?l().createElement(yo,{classNames:{loadMoreButton:h},onClick:function(){return d(1/0)}}):null)}function el(e){var t,n,r,a,c,u,s,d=Qo(e.field),f=d[0],p=d[1],h=(0,o.useContext)(i),g=e.sortBy||"count",v=e.order||[],y=e.exclude||[],b=m("cludo-box-shadow-card cludo-border-radius-card cludo-p-4 cludo-mb-5 cludo-font-family-default cludo-bg-color-white",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),k=m(" cludo-theme-loading-disable-children",e.disableTheme||!h.isLoadingResults),S=e.facet||f.facet,x=(0,o.useState)(null),C=x[0],E=x[1],w=(0,o.useState)([]),T=w[0],P=w[1],F=(0,o.useState)([]),R=F[0],N=F[1];return(0,o.useEffect)((function(){h.isLoadingResults||E(S)}),[f]),(0,o.useEffect)((function(){var e,t;if(null===(e=null==C?void 0:C.values)||void 0===e?void 0:e.length){var n=C.values.map((function(e){return e.value}));if(g)switch(g){case"count":n=C.values.sort((function(e,t){return(t.count||-1)-(e.count||-1)})).map((function(e){return e.value}));break;case"alphabetical":n=C.values.sort((function(e,t){return e.value.localeCompare(t.value)})).map((function(e){return e.value}))}y.length&&(n=n.filter((function(e){return!y.includes(e)}))),v.length&&(n=Zo(n,v));var r=new Map(null===(t=C.values)||void 0===t?void 0:t.map((function(e){return[e.value,e]}))),o=[];n.forEach((function(e){var t=r.get(e);t&&o.push(t)})),P(o),N(o)}}),[C]),(null==C?void 0:C.values.length)?l().createElement("div",{className:b+k},l().createElement(Go,{classNames:{header:null===(n=e.classNames)||void 0===n?void 0:n.header,clearButton:null===(r=e.classNames)||void 0===r?void 0:r.clearButton},facet:C,label:e.label?e.label:(null==C?void 0:C.key)||"",hideClear:e.hideClear,onClear:function(){p.clearFacet()},disableTheme:e.disableTheme}),e.hideSearchBar?null:l().createElement(Xo,{className:null===(a=e.classNames)||void 0===a?void 0:a.search,facetItems:T,placeholder:e.searchPlaceholder,onChange:function(e){N(e)},disableTheme:e.disableTheme}),l().createElement(Jo,{classNames:{root:null===(c=e.classNames)||void 0===c?void 0:c.facetListContainer,listItem:null===(u=e.classNames)||void 0===u?void 0:u.facetListItem,loadMoreButton:null===(s=e.classNames)||void 0===s?void 0:s.loadMoreButton},facetItems:R,itemComponent:e.itemComponent,limit:e.limit,hideShowMore:e.hideShowMore,hideCount:e.hideCount,disableTheme:e.disableTheme})):null}var tl=function(){return tl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tl.apply(this,arguments)};function nl(e){return l().createElement(el,tl({itemComponent:Yo},e))}function rl(){var e=c(),t=e.context,n=e.eventController,r=function(){return{facets:(null==t?void 0:t.facets)||[],selectedFacets:null==t?void 0:t.selectedFacets}},l=function(){var e,t,r;return{clearAllFacets:(null===(e=null==n?void 0:n.clearAllFacets)||void 0===e?void 0:e.bind(n))||function(){},softClearAllFacets:(null===(t=null==n?void 0:n.softClearAllFacets)||void 0===t?void 0:t.bind(n))||function(){},deselectFacet:(null===(r=null==n?void 0:n.deselectFacet)||void 0===r?void 0:r.bind(n))||function(){}}};Sr((function(){u(r()),f(l())}));var i=(0,o.useState)(r()),a=i[0],u=i[1],s=(0,o.useState)(l()),d=s[0],f=s[1];return[a,d]}var ol=ll({});function ll(e){var t=e.sortPicker||qo,n=e.facet||nl;return function(){var e=Vo()[0],r=rl()[0],o=e.sortItems.length>0,i=r.facets;return l().createElement(l().Fragment,null,o?l().createElement(t,null):l().createElement(l().Fragment,null),i.map((function(e){return l().createElement(n,{key:e.key,field:e.key})})))}}var il=function(){return il=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},il.apply(this,arguments)},al=function(e,t,n,r){return new(n||(n=Promise))((function(o,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function a(e){try{c(r.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},cl=function(e,t){var n,r,o,l,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},ul="da",sl="https://customer.cludo.com/scripts/bundles/search-script.min.js";function dl(e){return al(this,void 0,void 0,(function(){var t,n;return cl(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t="",[4,window.Cludo.getPublicSettingsByOptions({customerId:e.customerId,engineId:e.engineId,experienceId:e.experienceId,apiUrl:void 0,authKey:void 0,searchSiteKey:void 0,isIntranet:e.isIntranet})];case 1:return t=r.sent(),(n=JSON.parse(t)).instantSuggestionsConfiguration=JSON.parse(n.instantSuggestionsConfiguration),[2,n];case 2:throw r.sent(),"Unable to resolve public settings via web service";case 3:return[2]}}))}))}function fl(){return al(this,void 0,void 0,(function(){return cl(this,(function(e){return Fo()?[2,new Promise((function(e,t){if(Fo()||e(),document.querySelector('script[src="'.concat(sl,'"]')))e();else{var n=document.createElement("script");n.onload=function(){return e()},n.onerror=function(){return t()},n.src=sl,document.body.appendChild(n)}}))]:[2]}))}))}function pl(e){var t;return al(this,void 0,void 0,(function(){var n,r;return cl(this,(function(o){switch(o.label){case 0:return Fo()?(n={customerId:e.customerId,engineId:e.engineId,experienceId:e.experienceId,isIntranet:null===(t=e.secureSearch)||void 0===t?void 0:t.enable},e.headless?[4,fl()]:[3,2]):[2,{}];case 1:o.sent(),o.label=2;case 2:return[4,dl(n)];case 3:return r=o.sent(),[2,ml(e,r)]}}))}))}function ml(e,t){var n,r,o,l,i,a,c,u,s,d,f,p,m,h,g,v,y,b,k,S,x,C,E,w,T,P,F,R,N,A,I,O,_,L,D,M,j,B,z,H,U,V,q,W,Q,Y,K,$,Z,G,X,J,ee,te,ne,re,oe,le,ie,ae,ce,ue,se,de,fe,pe,me,he,ge,ve={customerId:e.customerId,engineId:e.engineId,language:e.language,searchUrl:e.searchUrl,paramsPrefix:e.instanceId,clientTemplates:!0,publicSettings:t,searchInputs:e.searchInputSelectors,headlessSearch:e.headless,searchResultsWrapper:e.searchResultsWrapperSelector,intranetSearch:null===(n=e.secureSearch)||void 0===n?void 0:n.enable,searchApiUrl:null===(r=e.secureSearch)||void 0===r?void 0:r.proxyApiUrl,customHttpHeaders:null===(o=e.secureSearch)||void 0===o?void 0:o.customHttpHeaders,disableAutocomplete:null===(l=e.autocomplete)||void 0===l?void 0:l.disable,facets:null===(i=e.facets)||void 0===i?void 0:i.keys,initFacets:null===(a=e.facets)||void 0===a?void 0:a.defaultValues,filters:e.filters,perPage:null===(c=e.theme)||void 0===c?void 0:c.resultsPerPage,hideResultsCount:null===(u=e.theme)||void 0===u?void 0:u.hideResultsCount,hideSearchFilters:null===(s=e.theme)||void 0===s?void 0:s.hideSearchFilters,hideSearchDidYouMean:null===(d=e.theme)||void 0===d?void 0:d.hideSearchDidYouMean,type:null===(f=e.theme)||void 0===f?void 0:f.type,sortOrder:null===(p=e.sort)||void 0===p?void 0:p.defaultOrder,sortOptions:null===(m=e.sort)||void 0===m?void 0:m.options,logPageVisits:!(null===(h=e.tracking)||void 0===h?void 0:h.skipLoggingPageVisits),richAutocomplete:null===(g=e.autocomplete)||void 0===g?void 0:g.useSearchAsYouType,autocompleteForceUseTemplate:null===(v=e.autocomplete)||void 0===v?void 0:v.renderTemplateWhenNoResults,autocompleteMinimumQueryLength:null===(y=e.autocomplete)||void 0===y?void 0:y.minimumQueryLength,applyMultiLevelFacets:null===(b=e.facets)||void 0===b?void 0:b.applyMultiLevel,rangeFacets:null===(k=e.facets)||void 0===k?void 0:k.rangeValues,pierceShadowDom:null===(S=e.behavior)||void 0===S?void 0:S.pierceShadowDom,enableRelatedSearches:null===(x=e.behavior)||void 0===x?void 0:x.enableRelatedSearches,customNoResultsMessage:null===(C=e.overrideStrings)||void 0===C?void 0:C.noResultsMessage,enableVoiceSearch:null===(E=e.voiceSearch)||void 0===E?void 0:E.enable,disableVoiceSearchActiveAnimation:null===(w=e.voiceSearch)||void 0===w?void 0:w.disableActiveAnimation,useFixedQueryInResultsCount:null===(T=e.theme)||void 0===T?void 0:T.showFixedQueryInResultsCount,allowSearchWithoutSearchword:null===(P=e.behavior)||void 0===P?void 0:P.allowSearchWithoutSearchword,jumpToTopOnFacetClick:null===(F=e.behavior)||void 0===F?void 0:F.jumpToTopOnFacetClick,endlessScroll:null===(R=e.behavior)||void 0===R?void 0:R.endlessScroll,enableExtendedTracking:!(null===(N=e.tracking)||void 0===N?void 0:N.disableExtendedTracking),customCallbackAfterSearch:null===(A=e.callbacks)||void 0===A?void 0:A.afterSearch,customCallbackBeforeSearch:null===(I=e.callbacks)||void 0===I?void 0:I.beforeSearch,customCallbackBeforeRedirect:null===(O=e.callbacks)||void 0===O?void 0:O.beforeRedirect,customCallbackAfterAutocomplete:null===(_=e.callbacks)||void 0===_?void 0:_.afterAutocomplete,customCallbackBeforeQuicklink:null===(L=e.callbacks)||void 0===L?void 0:L.beforeQuicklink,canUserBeTracked:null===(D=e.tracking)||void 0===D?void 0:D.canUserBeTracked,ovarlayResultsWrapperOpenClass:null===(M=e.theme)||void 0===M?void 0:M.overlayResultsWrapperOpenClass,theme:{searchBoxPosition:null===(j=e.theme)||void 0===j?void 0:j.searchBoxPosition,themeColor:null===(B=e.theme)||void 0===B?void 0:B.themeColor,elementFocusColor:null===(z=e.theme)||void 0===z?void 0:z.elementFocusColor,themeBannerColor:null===(H=e.theme)||void 0===H?void 0:H.themeBannerColor,textColor:null===(U=e.theme)||void 0===U?void 0:U.textColor,borderRadius:null===(V=e.theme)||void 0===V?void 0:V.borderRadius,borderRadiusInput:null===(q=e.theme)||void 0===q?void 0:q.borderRadius},showInstantSuggestions:null===(W=e.autocomplete)||void 0===W?void 0:W.showInstantSuggestions,suggestedSearchesHeader:null===(Q=e.overrideStrings)||void 0===Q?void 0:Q.suggestedSearchesHeader,recentSearchesHeader:null===(Y=e.overrideStrings)||void 0===Y?void 0:Y.recentSearchesHeader,googleAnalyticsTrackingId:null===(K=e.tracking)||void 0===K?void 0:K.googleAnalyticsId,focusOnResultsAfterSearch:null===($=e.behavior)||void 0===$?void 0:$.focusOnResultsAfterSearch,translateSearchTemplates:!0,changeWindowLocation:void 0===(null===(Z=e.behavior)||void 0===Z?void 0:Z.updateUrlOnSearch)||(null===(G=e.behavior)||void 0===G?void 0:G.updateUrlOnSearch)},ye=new window.Cludo(ve),be=ye.translateProvider.translations[e.language||(null===(X=e.filters)||void 0===X?void 0:X.Language[0])||ul];be?be=Object.assign(be,e.overrideStrings):console.warn("Cludo: Translations not found for language "+e.language),e.categorizeResultsByField&&(ye.params.topHitsFields=[il(il({field:e.categorizeResultsByField.field},e.categorizeResultsByField.maxResultsPerCategory&&{size:e.categorizeResultsByField.maxResultsPerCategory}),e.categorizeResultsByField.maxCategories&&{MaxFieldValues:e.categorizeResultsByField.maxCategories})]);var ke=new Uo(ye,e.cssTheme);if(ye.setClientTemplateComponentsController&&ye.setClientTemplateComponentsController(ke.components),ye.configureFeaturesFromPublicSettings(t),ye.init(),!0!==e.headless){var Se={results:{},controls:{},autocomplete:{}};Ce(null===(J=e.components)||void 0===J?void 0:J.results)?Se.results=null===(ee=e.components)||void 0===ee?void 0:ee.results:Se.results={component:null!==(ne=null===(te=e.components)||void 0===te?void 0:te.results)&&void 0!==ne?ne:xo,containerSelector:null!==(re=ve.searchResultsWrapper)&&void 0!==re?re:".search-results .search-results-container",renderEvents:["beforesearch","aftersearch"]},Ce(null===(oe=e.components)||void 0===oe?void 0:oe.controls)?Se.controls=null===(le=e.components)||void 0===le?void 0:le.controls:Se.controls={component:null!==(ae=null===(ie=e.components)||void 0===ie?void 0:ie.controls)&&void 0!==ae?ae:ol,containerSelector:null!==(ce=e.controlsWrapperSelector)&&void 0!==ce?ce:".search-filters",renderEvents:["beforesearch","aftersearch"]},Ce(null===(ue=e.components)||void 0===ue?void 0:ue.autocomplete)?Se.autocomplete=null===(se=e.components)||void 0===se?void 0:se.autocomplete:Se.autocomplete={component:null!==(fe=null===(de=e.components)||void 0===de?void 0:de.autocomplete)&&void 0!==fe?fe:_o,containerSelector:"#cludo-search-input #search_autocomplete",renderEvents:["afterautocomplete","afterinputfocus"]},xe(Se.results),!ve.hideSearchFilters&&xe(Se.controls),!0!==(null===(pe=e.autocomplete)||void 0===pe?void 0:pe.disable)&&((null===(me=e.searchInputSelectors)||void 0===me?void 0:me.length)?e.searchInputSelectors.forEach((function(e){xe(Se.autocomplete,e+" #search_autocomplete")})):xe(Se.autocomplete)),null===(ge=null===(he=e.components)||void 0===he?void 0:he.custom)||void 0===ge||ge.forEach((function(e){return xe(e)}))}function xe(e,t){ke.components.registerComponent(e.component,null!=t?t:e.containerSelector,e.renderEvents,e.renderEvents.includes("afterpageload"))}function Ce(e){return null!=e&&"object"==typeof e&&"string"==typeof e.containerSelector&&Array.isArray(e.renderEvents)}return ke}function hl(e){var t,n,r,o,i=m("cludo-font-family-default cludo-font-size-md cludo-font-weight-bold cludo-mr-2",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.label),a=m("cludo-p-1 cludo-border-radius-button cludo-height-sm",e.disableTheme,e.className,null===(n=e.classNames)||void 0===n?void 0:n.dropdown);return l().createElement("div",{className:null!==(o=null===(r=e.classNames)||void 0===r?void 0:r.root)&&void 0!==o?o:""},e.label?l().createElement("label",{htmlFor:e.id,className:i},e.label):null,l().createElement("select",{id:e.id,className:a,value:e.currentValue,defaultValue:e.default,onChange:function(t){return e.onChange(t.target.value)}},e.options.map((function(t,n){var r,o;return l().createElement("option",{className:null!==(o=null===(r=e.classNames)||void 0===r?void 0:r.dropdownOption)&&void 0!==o?o:"",key:n,value:t.value},t.label)}))))}function gl(e){var t,n,r,a,c,u=lo(),s=u[0],d=u[1],f=Cr()[0],p=(0,o.useState)(s),h=p[0],g=p[1],v=(0,o.useContext)(i);(0,o.useEffect)((function(){v.isLoadingResults||g(s)}),[s]);var y=(e.options||[10,20,50]).map((function(e){return{label:e.toString(),value:e}})),b=e.label||"Results per page: ",k=h.itemsPerPage,S=m("cludo-mt-3",e.disableTheme,e.className),x=m(" cludo-theme-loading-disable",e.disableTheme||!f.isLoading),C=hl;return h.showResultsPerPage?l().createElement(l().Fragment,null,l().createElement(C,{options:y,id:"perpage",label:b,disableTheme:e.disableTheme,className:x,classNames:{root:null===(t=e.classNames)||void 0===t?void 0:t.root,label:null===(n=e.classNames)||void 0===n?void 0:n.label,dropdown:"".concat(S," ").concat(null!==(a=null===(r=e.classNames)||void 0===r?void 0:r.selector)&&void 0!==a?a:""),dropdownOption:null===(c=e.classNames)||void 0===c?void 0:c.selectorOption},currentValue:k,onChange:function(e){return d.setPerPage(Number(e))}})):null}var vl=function(){return vl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vl.apply(this,arguments)};function yl(e){return l().createElement(wo,vl({},e,{resultType:ko.CategorizedResult}))}function bl(e){var t,n=rl()[0],r=e.order||[],i=e.exclude||[],a=(null===(t=e.children)||void 0===t?void 0:t.type)===o.Fragment?e.children.props.children:e.children,c=n.facets.map((function(e){return e.key})),u=(0,o.useRef)([]),s=(0,o.useRef)(new Map);return(0,o.useMemo)((function(){c.length&&(u.current=c,i.length&&(u.current=c.filter((function(e){return!i.includes(e)}))),r.length&&(u.current=Zo(c,r)),s.current=function(e,t){var n,r=new Map(e.map((function(e){return[e,null]})));return t&&l().Children.forEach(t,(function(e){if(l().isValidElement(e)){var t=e.props.field,o=e.type,i=e.props;if(!t)throw new Error('Could not find "field" prop for facet group override '.concat(o||"unknown","."));if("*"===e.props.field){if(n)throw new Error("Only one override component with wildcard (*) field allowed in a facet group");n=l().createElement(o,Ko({},i))}else r.set(t,l().createElement(o,Ko({field:t},i)))}})),r.forEach((function(e,t,r){if(null===e){var o=n?l().cloneElement(n,{field:t}):l().createElement(nl,{field:t});r.set(t,o)}})),r}(c,a))}),[n]),l().createElement(l().Fragment,null,u.current.map((function(e){return l().createElement(o.Fragment,{key:e},s.current.get(e))})))}function kl(e){var t=Qo(e.facetItem.facetName),n=(t[0],t[1]),r=m("cludo-theme-facet-option",e.disableTheme),o=m("cludo-theme-facet-option cludo-font-weight-bold",e.disableTheme)+" cludo-active",i=m("cludo-theme-facet-count",e.disableTheme),a=m("cludo-m-0 cludo-mr-2",e.disableTheme);return l().createElement("label",{className:(e.className?e.className+" ":"")+(e.facetItem.isSelected?o:r)},l().createElement("input",{name:e.facetItem.facetName,type:"checkbox",checked:e.facetItem.isSelected,className:a,onChange:function(t){return function(t,r){t.target.checked?n.selectFacet(r,!0):n.deselectFacet(r),e.onChange&&e.onChange()}(t,e.facetItem.value)}}),e.facetItem.value,!e.hideCount&&e.facetItem.count?l().createElement(l().Fragment,null," ",l().createElement("span",{className:i},e.facetItem.count)):null)}var Sl=function(){return Sl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Sl.apply(this,arguments)};function xl(e){return l().createElement(el,Sl({itemComponent:kl},e))}function Cl(e){var t=Qo(e.facetItem.facetName),n=(t[0],t[1]),r=m("cludo-theme-facet-option",e.disableTheme,e.className),o=m("cludo-theme-facet-option cludo-font-weight-bold",e.disableTheme,e.className)+" cludo-active",i=m("cludo-theme-facet-count",e.disableTheme,e.className),a=m("cludo-m-0 cludo-mr-2",e.disableTheme,e.className);return l().createElement("label",{className:e.facetItem.isSelected?o:r},l().createElement("input",{name:e.facetItem.facetName,type:"radio",checked:e.facetItem.isSelected,className:a,onChange:function(t){return function(t,r){t.target.checked&&n.selectFacet(r),e.onChange&&e.onChange()}(t,e.facetItem.value)}}),e.facetItem.value,!e.hideCount&&e.facetItem.count?l().createElement(l().Fragment,null," ",l().createElement("span",{className:i},e.facetItem.count)):null)}var El=function(){return El=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},El.apply(this,arguments)};function wl(e){return l().createElement(el,El({itemComponent:Cl},e))}var Tl=function(e){var t=e.width||"200",n=e.height||"200",r=e.color||"#000";return l().createElement("svg",{width:t,height:n,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().cloneElement(e.children,{color:r},null))},Pl=function(){return Pl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pl.apply(this,arguments)};function Fl(e){return l().createElement(Tl,Pl({},e),l().createElement("path",{d:"M4.62154 23.33C-0.245279 28.1934 -0.245271 36.0785 4.62155 40.9419L59.6556 95.9373L4.5986 150.956C-0.268218 155.819 -0.268218 163.704 4.5986 168.567L23.3455 187.301C28.2123 192.165 36.103 192.165 40.9698 187.301L96.0267 132.283L150.927 187.145C155.794 192.008 163.685 192.008 168.551 187.145L187.298 168.411C192.165 163.548 192.165 155.663 187.298 150.799L132.398 95.9373L187.275 41.0983C192.142 36.2349 192.142 28.3498 187.275 23.4864L168.529 4.75271C163.662 -0.11069 155.771 -0.110682 150.904 4.75272L96.0267 59.5916L40.9927 4.59628C36.1259 -0.267119 28.2352 -0.267119 23.3684 4.59628L4.62154 23.33Z",fill:e.color}))}var Rl="10",Nl="#344054";function Al(e){var t=rl(),n=t[0],r=t[1],o=Cr()[0],i=n.selectedFacets,a=m("cludo-theme-current-facets",e.disableTheme),c=m("cludo-font-weight-bold",e.disableTheme),u=m("cludo-ml-2 cludo-display-inline-block",e.disableTheme),s=m("cludo-theme-current-facets-btn cludo-height-xs",e.disableTheme),d=m(" cludo-theme-loading-disable",e.disableTheme||!o.isLoading);return l().createElement("div",{className:(e.className?e.className+" ":"")+"cludo-display-flex cludo-align-items-start cludo-flex-wrap"},Object.keys(i).map((function(t,n){var o;return(null===(o=e.exclude)||void 0===o?void 0:o.includes(t))?null:l().createElement("div",{className:a+d,key:n},l().createElement("label",{className:c},e.labelsMap&&e.labelsMap[t]||t,": "),l().createElement("div",null,i[t].map((function(e,n){return l().createElement("span",{key:n,className:u},e," ",l().createElement("button",{className:s,onClick:function(){return r.deselectFacet(t,e)}},l().createElement(Fl,{height:Rl,width:Rl,color:Nl})))}))))})))}function Il(e){var t=rl(),n=t[0],r=t[1],o=m("cludo-theme-btn-accent-secondary cludo-font-weight-bold cludo-mb-2",e.disableTheme,e.className);return l().createElement(l().Fragment,null,Object.keys(n.selectedFacets).length>0&&l().createElement("button",{className:o,onClick:r.clearAllFacets},e.label||"Clear all"))}function Ol(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultImage"),null;var r=Fr(n,e.imageField||"Image"),i=e.altText||Fr(n,"Title");return r?l().createElement("img",{src:r,alt:i}):null}function _l(e){var t,n,r,i,a,c=(0,o.useContext)(Kr),u=e.result||c;if(!u)return Or("ResultBreadcrumbs"),null;var s=e.template||function(e){return l().createElement("span",null,e)},d=e.separator||l().createElement("span",{className:"cludo-px-1"},"/"),f=(0,o.useRef)([]),p=(0,o.useRef)([]),h=m("cludo-font-family-default cludo-font-size-sm cludo-mb-2 cludo-font-color-gray",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),g=m("cludo-list-style-none cludo-p-0 cludo-display-flex",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.list),v=m("",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.listItem),y=m("cludo-font-color-gray",e.disableTheme,null===(i=e.classNames)||void 0===i?void 0:i.listItemLink),b=m("",e.disableTheme,null===(a=e.classNames)||void 0===a?void 0:a.separator);function k(e,t,n){var r;if(Array.isArray(e))e.forEach((function(e){var n=Fr(u,e);t.current.push(null!=n?n:void 0)}));else{var o=Rr(u,e);if(o&&o[0]){var l=n?o[0].split(n):o;(r=t.current).push.apply(r,l)}else t.current.push(void 0)}}return(0,o.useMemo)((function(){k(e.textField,f,e.textFieldDelimiter),e.linkField&&k(e.linkField,p,e.linkFieldDelimiter)}),[]),f.current.length&&!f.current.every((function(e){return void 0===e}))?l().createElement("nav",{className:h,"aria-label":"breadcrumb"},l().createElement("ol",{className:g},f.current.map((function(e,t){return void 0!==e?void 0!==p.current[t]?l().createElement(l().Fragment,{key:t},l().createElement("li",{className:v},l().createElement("a",{className:y,href:p.current[t]},s(e))),t!==f.current.length-1?l().createElement("li",{className:b,"aria-hidden":"true"},d):null):l().createElement(l().Fragment,{key:t},l().createElement("li",{className:v},l().createElement(l().Fragment,null,s(e))),t!==f.current.length-1?l().createElement("li",{className:b,"aria-hidden":"true"},d):null):null})))):l().createElement(l().Fragment,null)}var Ll=function(){return Ll=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ll.apply(this,arguments)};function Dl(e){var t=(0,o.useState)({}),n=t[0],r=t[1],c=(0,o.useState)({}),u=c[0],s=c[1],d=(0,o.useState)(!1),f=d[0],m=d[1];return(0,o.useEffect)((function(){if(e.publicSettings){var t=ml(e.config,e.publicSettings);e.onInit&&e.onInit(t),r(t.instance),s(t.components.events),m(!0)}else pl(Ll({headless:!0},e.config)).then((function(t){e.onInit&&e.onInit(t),r(t.instance),s(t.components.events),m(!0)}));return function(){var t,n=window;(null===(t=null==n?void 0:n.CludoSearchInstances)||void 0===t?void 0:t.length)&&(n.CludoSearchInstances=n.CludoSearchInstances.filter((function(t){return t.engineId!==e.config.engineId})))}}),[]),f?l().createElement(i.Provider,{value:n},l().createElement(a.Provider,{value:u},l().createElement(p,{theme:e.config.cssTheme},e.children))):null}function Ml(){var e,t=null===(e=(0,o.useContext)(i).translateProvider)||void 0===e?void 0:e.translate("template_autocomplete_hint");return l().createElement(l().Fragment,null,l().createElement("div",{className:"search_autocomplete",id:"search_autocomplete",tabIndex:0}),l().createElement("span",{id:"autocomplete_hint","aria-hidden":"false","aria-atomic":"true",role:"status","aria-live":"polite"},t))}function jl(e){var t=e.id?e.id:"cludo-search-results";return l().createElement("div",{id:t})}function Bl(){var e,t,n=(0,o.useContext)(i),r=null===(e=n.translateProvider)||void 0===e?void 0:e.translate("search_input_label"),a=null===(t=n.translateProvider)||void 0===t?void 0:t.translate("search_input_label");return n.isAutocompleteEnabled?l().createElement("input",{type:"search",className:"cludo-search-input","aria-label":a,placeholder:r,"aria-describedby":"autocomplete_hint","aria-autocomplete":"list","aria-controls":"search_autocomplete"}):l().createElement("input",{type:"search",className:"cludo-search-input","aria-label":a,placeholder:r})}function zl(e){var t,n=(0,o.useContext)(i),r=null===(t=n.translateProvider)||void 0===t?void 0:t.translate("search_input_label"),a=n.isAutocompleteEnabled,c=e.uniqueFormId?e.uniqueFormId:"cludo-search-input";return l().createElement("form",{id:c,role:"search"},l().createElement(Bl,null),l().createElement("button",{type:"submit",className:"cludo-search-button","aria-label":r}),a?l().createElement(Ml,null):l().createElement(l().Fragment,null))}function Hl(){var e=c(),t=e.context,n=e.eventController,r=(0,o.useState)({query:t.query||""}),l=r[0],i=r[1],a={search:function(e){n.search(e)},setQuery:function(e){i({query:e})}};return(0,o.useEffect)((function(){i({query:t.query||""})}),[t.query]),[l,a]}var Ul=function(){return Ul=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ul.apply(this,arguments)};function Vl(e){return l().createElement(Tl,Ul({},e),l().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M112.092 140.376C101.162 146.595 88.5179 150.147 75.0446 150.147C33.5986 150.147 0 116.535 0 75.0733C0 33.6115 33.5986 0 75.0446 0C116.491 0 150.089 33.6115 150.089 75.0733C150.089 88.5145 146.558 101.131 140.374 112.044L186.485 158.173C191.17 162.86 191.17 170.46 186.485 175.147L175.151 186.485C170.466 191.172 162.869 191.172 158.184 186.485L112.092 140.376ZM120.071 75.0733C120.071 99.9504 99.9122 120.117 75.0446 120.117C50.177 120.117 30.0179 99.9504 30.0179 75.0733C30.0179 50.1962 50.177 30.0293 75.0446 30.0293C99.9122 30.0293 120.071 50.1962 120.071 75.0733Z",fill:e.color}))}function ql(e){var t,n,r,o=Hl(),i=o[0],a=o[1],c=e.placeholder||"Enter a search term",u=m("cludo-display-flex cludo-box-shadow-card cludo-border-radius-card cludo-p-4 cludo-mb-3 cludo-align-items-center cludo-bg-color-white",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),s=m("cludo-font-size-md cludo-py-1 cludo-px-2 cludo-font-family-default cludo-border-radius-button cludo-border-1-neutral cludo-height-sm cludo-flex-grow-1 cludo-bg-color-gray-light",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.input),d=m("cludo-theme-icon-btn-secondary cludo-ml-1",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.submitButton),f=e.submitIcon?e.submitIcon:l().createElement(Vl,{width:"100%",height:"100%",color:"#fff"});return l().createElement("form",{id:e.formId,onSubmit:function(t){t.preventDefault(),a.search(i.query),e.onSubmit&&e.onSubmit(t)},className:u},l().createElement("input",{type:"search",className:s,placeholder:c,onChange:function(t){a.setQuery(t.target.value),e.onChange&&e.onChange(t)},onBlur:e.onBlur,onKeyDown:e.onKeyDown,"aria-label":e.ariaLabel,value:i.query}),l().createElement("button",{className:d,type:"submit"},f))}function Wl(e){var t=c().context,n=Cr(),r=n[0],l=n[1];t.endlessScroll=e,(0,o.useEffect)((function(){if(Fo()){var t=function(){r.isLoading||(i instanceof Element?n(i):o())},n=function(t){t.scrollTop+t.clientHeight>=t.scrollHeight-e.bottomOffset&&r.currentPage<e.stopAfterPage&&r.resultCount>e.resultsPerPage&&r.currentPage<Math.ceil(r.resultCount/e.resultsPerPage)&&l.loadMore()},o=function(){Fo()&&window.scrollY+window.innerHeight>=document.body.scrollHeight-e.bottomOffset&&r.currentPage<e.stopAfterPage&&r.resultCount>e.resultsPerPage&&r.currentPage<Math.ceil(r.resultCount/e.resultsPerPage)&&l.loadMore()},i=(e.scrolledElementSelector?document.querySelector(e.scrolledElementSelector):window)||window;return i.addEventListener("scroll",t),function(){i.removeEventListener("scroll",t)}}}),[e]),(0,o.useEffect)((function(){var t;u({showLoadMore:(t=r).currentPage>=e.stopAfterPage&&t.resultCount>e.resultsPerPage&&t.currentPage<Math.ceil(t.resultCount/e.resultsPerPage),isLoading:t.isLoading})}),[r]);var i=(0,o.useState)({showLoadMore:!1,isLoading:!1}),a=i[0],u=i[1];return a}})(),r})()));
|
|
3
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CludoSearchComponents=t():e.CludoSearchComponents=t()}(this,(()=>(()=>{var e={971:(e,t)=>{"use strict";var n;t.d=void 0,(n=t.d||(t.d={})).AdvancedIntents="advanced insights",n.Intents="basic insights",n.Sayt="sayt",n.AnalyticsFilters="analytics filters",n.VoiceSearches="voice search",n.InstantSuggestions="instant suggestions",n.Advanced404Analytics="advanced 404 analytics",n.BannerStatistics="banner statistics",n.RelatedSearches="related searches",n.Basic404="basic 404",n.IntelligentRanking="intelligent rankings (ml)",n.GranularPermissions="granular permissions",n.TimeScheduledBanner="time-scheduled banners",n.GeoData="geo analytics",n.DeviceData="device analytics",n.AsyncCrawlingOneThousandPagesCrawledEveryDays="async crawling 1000 pages crawled every day",n.AsyncCrawlingTwoThousandPagesCrawledEveryTwoDays="async crawling 2000 pages crawled every 2 days",n.AsyncCrawlingThreeThousandPagesCrawledEveryThreeDays="async crawling 3000 pages crawled every 3 days",n.AsyncCrawlingFourThousandPagesCrawledEveryFourDays="async crawling 4000 pages crawled every 4 days",n.AsyncCrawlingFiveThousandPagesCrawledEveryFiveDays="async crawling 5000 pages crawled every 5 days",n.AsyncCrawlingSixThousandPagesCrawledEverySixDays="async crawling 6000 pages crawled every 6 days",n.AsyncCrawlingSevenThousandPagesCrawledEverySevenDays="async crawling 7000 pages crawled every 7 days",n.WebContentHighlighter="web content highlighter",n.Audiences="audiences"},470:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!l)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,u,s,d=arguments[0],f=1,p=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(o=c(t,n))&&(m&&o&&(i(o)||(u=l(o)))?(u?(u=!1,s=r&&l(r)?r:[]):s=r&&i(r)?r:{},a(d,{name:n,newValue:e(m,s,o)})):void 0!==o&&a(d,{name:n,newValue:o}));return d}},139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,u="";function s(e){return e?e.replace(c,u):u}e.exports=function(e,c){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];c=c||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function m(){var e={line:d,column:f};return function(t){return t.position=new h(e),b(),t}}function h(e){this.start=e,this.end={line:d,column:f},this.source=c.source}h.prototype.content=e;var g=[];function v(t){var n=new Error(c.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=c.source,n.line=d,n.column=f,n.source=e,!c.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){y(r)}function k(e){var t;for(e=e||[];t=S();)!1!==t&&e.push(t);return e}function S(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=m(),n=y(o);if(n){if(S(),!y(l))return v("property missing ':'");var r=y(i),c=e({type:"declaration",property:s(n[0].replace(t,u)),value:r?s(r[0].replace(t,u)):u});return y(a),c}}return b(),function(){var e,t=[];for(k(t);e=x();)!1!==e&&(t.push(e),k(t));return t}()}},738:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function l(){}l.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,l,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},471:(e,t)=>{"use strict";var n,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case a:case i:case f:case p:return e;default:switch(e=e&&e.$$typeof){case s:case u:case d:case h:case m:case c:return e;default:return t}}case o:return t}}}n=Symbol.for("react.module.reference"),t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=l,t.Lazy=h,t.Memo=m,t.Portal=o,t.Profiler=a,t.StrictMode=i,t.Suspense=f,t.SuspenseList=p,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return v(e)===u},t.isContextProvider=function(e){return v(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return v(e)===d},t.isFragment=function(e){return v(e)===l},t.isLazy=function(e){return v(e)===h},t.isMemo=function(e){return v(e)===m},t.isPortal=function(e){return v(e)===o},t.isProfiler=function(e){return v(e)===a},t.isStrictMode=function(e){return v(e)===i},t.isSuspense=function(e){return v(e)===f},t.isSuspenseList=function(e){return v(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===a||e===i||e===f||e===p||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===d||e.$$typeof===n||void 0!==e.getModuleId)},t.typeOf=v},143:(e,t,n)=>{"use strict";e.exports=n(471)},848:(e,t,n)=>{var r=n(139);function o(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var l,i,a=r(e),c="function"==typeof t,u=0,s=a.length;u<s;u++)l=(n=a[u]).property,i=n.value,c?t(l,i,n):i&&(o||(o={}),o[l]=i);return o}e.exports=o,e.exports.default=o}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Banner:()=>ao,BannerGroup:()=>uo,CheckboxFacet:()=>xl,CheckboxFacetItem:()=>kl,ClearAllFacets:()=>Il,CludoAutocompleteContainer:()=>Ml,CludoContext:()=>i,CludoInstanceController:()=>Uo,CludoResultsContainer:()=>jl,CludoSearchAutocomplete:()=>_o,CludoSearchForm:()=>zl,CludoSearchInput:()=>Bl,CludoSearchResults:()=>xo,CludoSortPicker:()=>qo,CludoWrapper:()=>Dl,ComponentsController:()=>Ho,CurrentFacets:()=>Al,CustomResult:()=>$r,DidYouMean:()=>so,EventControllerContext:()=>a,FacetGroup:()=>bl,FragmentHighlight:()=>Gr,FragmentHighlightGroup:()=>Xr,GenerativeResponseModule:()=>Ur,LoadMoreResults:()=>bo,Pagination:()=>io,RadioFacet:()=>wl,RadioFacetItem:()=>Cl,ResultBadge:()=>no,ResultBreadcrumbs:()=>_l,ResultContext:()=>Kr,ResultCount:()=>fo,ResultDescription:()=>Jr,ResultImage:()=>Ol,ResultLink:()=>Qr,ResultTitle:()=>Zr,ResultUrl:()=>eo,ResultsList:()=>vo,ResultsPerPage:()=>gl,SaytCategorizedResult:()=>yl,SaytRecentSearch:()=>Po,SaytResult:()=>wo,SaytSuggestion:()=>To,SearchInput:()=>ql,StandardFacet:()=>nl,StandardFacetItem:()=>Yo,StandardLoader:()=>go,StandardResult:()=>oo,TemplateType:()=>jo,autocompleteHandleInputBlur:()=>Io,autocompleteHandleInputChange:()=>Oo,autocompleteHandleInputKeyDown:()=>Ao,composeControls:()=>ll,composeResults:()=>Co,getFieldValue:()=>Fr,getFieldValues:()=>Rr,getFormattedHTML:()=>Ir,getHighlightsOrValues:()=>Nr,getHighlightsOrValuesArray:()=>Ar,getPublicSettings:()=>dl,getUrl:()=>Tr,hasField:()=>Pr,initCludo:()=>pl,initCludoWithPublicSettings:()=>ml,injectCoreScript:()=>fl,isAutocompleteItem:()=>_r,useAutocomplete:()=>No,useBanners:()=>co,useEndlessScroll:()=>Wl,useFacet:()=>Qo,useFacetGroup:()=>rl,usePagination:()=>lo,useSearchInput:()=>Hl,useSearchResults:()=>Cr,useSortBy:()=>Vo});var e={};n.r(e),n.d(e,{attentionMarkers:()=>It,contentInitial:()=>Tt,disable:()=>Ot,document:()=>wt,flow:()=>Ft,flowInitial:()=>Pt,insideSpan:()=>At,string:()=>Rt,text:()=>Nt});var t={};n.r(t),n.d(t,{boolean:()=>wn,booleanish:()=>Tn,commaOrSpaceSeparated:()=>An,commaSeparated:()=>Nn,number:()=>Fn,overloadedBoolean:()=>Pn,spaceSeparated:()=>Rn});const o=require("react");var l=n.n(o),i=l().createContext({}),a=l().createContext({});function c(){return{context:(0,o.useContext)(i),eventController:(0,o.useContext)(a)}}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)},s=function(e,t,n,r){return new(n||(n=Promise))((function(o,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function a(e){try{c(r.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},d=function(e,t){var n,r,o,l,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},f=l().createContext({});function p(e){var t;return(null===(t=e.theme)||void 0===t?void 0:t.length)?l().createElement(f.Provider,{value:e},l().createElement("div",{className:e.theme},e.children)):l().createElement(l().Fragment,null,e.children)}function m(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return[(0,o.useContext)(f)&&!t?e:"",n.filter(Boolean).join(" ")].join(" ")}function h(e){var t=(0,o.useState)(""),n=t[0],r=t[1],i=e.feedbackCommentPrompt||"Want to add a comment?",a=e.feedbackCommentPromptPlaceholder||"Leave us a comment here",c=e.feedbackSubmitButtonText||"Submit",u=m("cludo-display-flex cludo-column cludo-align-items-start cludo-width-100",e.disableTheme),s=m("cludo-font-size-sm cludo-m-0 cludo-mb-2",e.disableTheme),d=m("ai-summary-feedback-comment-input cludo-resize-vertical cludo-font-family-default cludo-bg-transparent cludo-border-1-black cludo-border-radius-2 cludo-py-3 cludo-px-3 cludo-font-size-sm",e.disableTheme),f=m("ai-summary-feedback-submit-button cludo-bg-transparent cludo-px-3 cludo-border-radius-2 cludo-border-1-black cludo-cursor-pointer cludo-bg-hover-neutral-n10",e.disableTheme);return l().createElement("div",{className:"cludo-ai-summary-feedback__comment cludo-display-flex cludo-column cludo-align-items-start cludo-width-100"+u},l().createElement("p",{className:"cludo-ai-summary-feedback__comment-prompt "+s},i),l().createElement("textarea",{className:"cludo-ai-summary-feedback__comment-input cludo-width-100 "+d,maxLength:500,placeholder:a,onChange:function(e){r(e.target.value)}}),l().createElement("div",{className:"cludo-ai-summary-feedback__comment-buttons cludo-display-flex cludo-width-100 cludo-justify-content-end cludo-mt-3"},l().createElement("button",{className:"cludo-ai-summary-feedback__comment-submit-button "+f,"aria-label":"Submit",onClick:function(){return e.onCommentSubmit(n)}},c)))}function g(e){var t=e.feedbackCTA||"Was this helpful?",n=e.feedbackPositiveIcon||l().createElement("div",{className:"ai-summary-feedback-icon"},l().createElement("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M4.04108 10.5817C4.48801 10.6836 4.93494 10.7792 5.38854 10.862C6.29574 11.034 7.20961 11.1868 8.13015 11.276C8.39697 11.3015 8.66379 11.3206 8.93062 11.327C9.23079 11.3334 9.53097 11.327 9.83114 11.3334C9.96455 11.3334 10.1046 11.327 10.238 11.3079C10.5716 11.2569 10.9051 11.1232 11.1319 10.8747C11.3387 10.6518 11.4321 10.3652 11.4588 10.0722L11.8123 6.09109C11.8123 6.09109 12.1125 4.5114 10.4248 4.60058C10.4248 4.60058 9.4109 4.58147 8.1635 4.66428C8.1635 4.66428 8.69715 2.81706 8.7972 1.7788C8.7972 1.7788 9.05069 0.899782 8.23021 0.695952C8.23021 0.695952 7.36303 0.460273 7.00949 1.32655C7.00949 1.32655 6.03559 4.56873 3.97438 5.07194C3.97438 5.07194 3.8343 5.11016 3.72757 5.12926C3.72757 5.12926 2.9271 5.16748 2.90042 5.63247V9.91291C2.90042 9.91291 2.85372 10.225 3.21393 10.3397C3.21393 10.3397 3.40738 10.4034 3.52078 10.4289L4.02774 10.569L4.04108 10.5817Z",stroke:"#101828",strokeWidth:"1.25",strokeLinejoin:"round"}),l().createElement("path",{d:"M1.16602 5.34583V10.1295",stroke:"#101828",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}))),r=e.feedbackNegativeIcon||l().createElement("div",{className:"ai-summary-feedback-icon"},l().createElement("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M8.95892 1.41833C8.51199 1.31642 8.06506 1.22087 7.61146 1.13807C6.70426 0.966084 5.79039 0.813211 4.86985 0.724035C4.60303 0.698557 4.33621 0.679447 4.06938 0.673078C3.76921 0.666708 3.46903 0.673078 3.16886 0.666708C3.03545 0.666708 2.89536 0.673077 2.76195 0.692186C2.42842 0.743144 2.09489 0.876908 1.8681 1.12533C1.66131 1.34827 1.56792 1.6349 1.54124 1.92791L1.1877 5.90897C1.1877 5.90897 0.88752 7.48866 2.57518 7.39948C2.57518 7.39948 3.5891 7.41859 4.8365 7.33579C4.8365 7.33579 4.30285 9.183 4.2028 10.2213C4.2028 10.2213 3.94931 11.1003 4.76979 11.3041C4.76979 11.3041 5.63697 11.5398 5.99051 10.6735C5.99051 10.6735 6.96441 7.43133 9.02562 6.92812C9.02562 6.92812 9.1657 6.88991 9.27243 6.8708C9.27243 6.8708 10.0729 6.83258 10.0996 6.36759V2.08715C10.0996 2.08715 10.1463 1.77504 9.78607 1.66038C9.78607 1.66038 9.59262 1.59668 9.47922 1.57121L8.97226 1.43107L8.95892 1.41833Z",stroke:"#101828",strokeWidth:"1.25",strokeLinejoin:"round"}),l().createElement("path",{d:"M11.834 6.65424V1.87059",stroke:"#101828",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}))),o=m("cludo-font-size-sm cludo-m-0",e.disableTheme),i=m("cludo-gap-1 cludo-display-flex cludo-m-0",e.disableTheme),a=m("ai-summary-feedback-button cludo-bg-transparent cludo-display-flex cludo-justify-content-center cludo-align-items-center cludo-width-sm cludo-height-sm cludo-p-0 cludo-cursor-pointer cludo-bg-hover-neutral-n10",e.disableTheme);return l().createElement(l().Fragment,null,l().createElement("p",{className:"cludo-ai-summary-feedback__cta "+o},t),l().createElement("div",{className:"cludo-ai-summary-feedback__buttons "+i},l().createElement("button",{className:"cludo-ai-summary-feedback__positive-button "+a,"aria-label":"Yes",onClick:e.onPositiveFeedbackClick},n),l().createElement("button",{className:"cludo-ai-summary-feedback__negative-button "+a,"aria-label":"No",onClick:e.onNegativeFeedbackClick},r)))}function v(e){var t=e.feedbackFollowUpPrompt||"What was wrong?",n=e.feedbackFollowUpQuestions||["It's not what I was looking for","I'm missing information","Other"],r=m("cludo-font-size-sm cludo-m-0",e.disableTheme),o=m("ai-summary-feedback-follow-up-button cludo-border-1-black cludo-bg-transparent cludo-mt-2 cludo-font-size-sm cludo-px-3 cludo-cursor-pointer cludo-bg-hover-neutral-n10",e.disableTheme);return l().createElement("div",{className:"cludo-ai-summary-feedback__follow-up cludo-display-flex cludo-column cludo-align-items-end"},l().createElement("p",{className:"cludo-ai-summary-feedback__follow-up-prompt "+r},t),null==n?void 0:n.map((function(t,r){return l().createElement("button",{className:"cludo-ai-summary-feedback__follow-up-answer "+o,key:"followup-".concat(r),"aria-label":t,onClick:function(){return e.onSelectFeedbackReason(n[r]||"")}},t)})))}function y(e){var t=e.feedbackThankYouMessage||"Thank you!",n=e.feedbackThankYouMessageIcon||l().createElement("div",{className:"ai-summary-feedback-thank-you-icon cludo-mr-1"},l().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M4.9987 7.99992L6.9987 9.99992L10.9987 5.99992M14.6654 7.99992C14.6654 11.6818 11.6806 14.6666 7.9987 14.6666C4.3168 14.6666 1.33203 11.6818 1.33203 7.99992C1.33203 4.31802 4.3168 1.33325 7.9987 1.33325C11.6806 1.33325 14.6654 4.31802 14.6654 7.99992Z",stroke:"#101828",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}))),r=m("cludo-font-size-sm",e.disableTheme);return l().createElement("div",{className:"cludo-ai-summary-feedback__thank-you-message cludo-display-flex cludo-align-items-center "+r},n," ",t)}function b(e){var t=(0,o.useState)(!0),n=t[0],r=t[1],i=(0,o.useState)(!1),a=i[0],c=i[1],u=(0,o.useState)(!1),s=u[0],d=u[1],f=(0,o.useState)(!1),p=f[0],m=f[1];return l().createElement("div",{className:"cludo-ai-summary-feedback cludo-display-flex cludo-align-items-center cludo-justify-content-end cludo-gap-1 cludo-mt-3"},n&&l().createElement(g,{feedbackCTA:e.feedbackCTA,feedbackPositiveIcon:e.feedbackPositiveIcon,feedbackNegativeIcon:e.feedbackNegativeIcon,onPositiveFeedbackClick:function(){e.onSubmitFeedback({rating:"positive"}),r(!1),m(!0)},onNegativeFeedbackClick:function(){e.onSubmitFeedback({rating:"negative"}),r(!1),c(!0)}}),a&&l().createElement(v,{feedbackFollowUpPrompt:e.feedbackFollowUpPrompt,feedbackFollowUpQuestions:e.feedbackFollowUpQuestions,onSelectFeedbackReason:function(t){e.onSubmitFeedback({selectedReason:t||""}),c(!1),d(!0)}}),s&&l().createElement(h,{feedbackCommentPrompt:e.feedbackCommentPrompt,feedbackCommentPromptPlaceholder:e.feedbackCommentPromptPlaceholder,feedbackSubmitButtonText:e.feedbackSubmitButtonText,onCommentSubmit:function(t){e.onSubmitFeedback({comment:t}),d(!1),m(!0)}}),p&&l().createElement(y,{feedbackThankYouMessage:e.feedbackThankYouMessage,feedbackThankYouMessageIcon:e.feedbackThankYouMessageIcon}))}function k(e){var t=e.chatIcon||l().createElement("div",{className:"cludo-ai-icon cludo-display-flex cludo-align-items-center cludo-justify-content-center"},l().createElement("svg",{width:"17",height:"12",viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().createElement("path",{d:"M14 9.66667H14.9167C15.4229 9.66667 15.8333 9.25626 15.8333 8.75V6.91667C15.8333 6.41041 15.4229 6 14.9167 6H14",stroke:"#181818"}),l().createElement("rect",{x:"3",y:"4.16663",width:"11",height:"7.33333",rx:"2",stroke:"#181818"}),l().createElement("path",{d:"M2.99935 6H2.08268C1.57642 6 1.16602 6.41041 1.16602 6.91667V8.75C1.16602 9.25626 1.57642 9.66667 2.08268 9.66667H2.99935",stroke:"#181818"}),l().createElement("circle",{cx:"5.7487",cy:"7.83329",r:"0.5",fill:"#181818",stroke:"#181818",strokeWidth:"0.833333"}),l().createElement("circle",{cx:"11.2487",cy:"7.83329",r:"0.5",fill:"#181818",stroke:"#181818",strokeWidth:"0.833333"}),l().createElement("path",{d:"M8.5 2.33337V4.16671",stroke:"#181818"}),l().createElement("circle",{cx:"8.4987",cy:"1.41667",r:"0.916667",stroke:"#181818"}))),n=m("cludo-generative-ai__icon-container cludo-mr-3",e.disableTheme);return l().createElement("div",{className:n},t)}function S(e){var t,n=null===(t=e.isLoading)||void 0===t||t,r=e.loadingElement||l().createElement("div",{className:"typing"},l().createElement("div",{className:"typing__dot"}),l().createElement("div",{className:"typing__dot"}),l().createElement("div",{className:"typing__dot"}));return n&&l().createElement("div",null,r)||l().createElement(l().Fragment,null)}var x=n(738);function C(e){return e&&"object"==typeof e?"position"in e||"type"in e?w(e.position):"start"in e||"end"in e?w(e):"line"in e||"column"in e?E(e):"":""}function E(e){return T(e&&e.line)+":"+T(e&&e.column)}function w(e){return E(e&&e.start)+"-"+E(e&&e.end)}function T(e){return e&&"number"==typeof e?e:1}class P extends Error{constructor(e,t,n){const r=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"==typeof t&&(n=t,t=void 0),"string"==typeof n){const e=n.indexOf(":");-1===e?r[1]=n:(r[0]=n.slice(0,e),r[1]=n.slice(e+1))}t&&("type"in t||"position"in t?t.position&&(o=t.position):"start"in t||"end"in t?o=t:("line"in t||"column"in t)&&(o.start=t)),this.name=C(t)||"1:1",this.message="object"==typeof e?e.message:e,this.stack="","object"==typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}P.prototype.file="",P.prototype.name="",P.prototype.reason="",P.prototype.message="",P.prototype.stack="",P.prototype.fatal=null,P.prototype.column=null,P.prototype.line=null,P.prototype.source=null,P.prototype.ruleId=null,P.prototype.position=null;const F=function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');O(e);let n,r=0,o=-1,l=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;l--;)if(47===e.charCodeAt(l)){if(n){r=l+1;break}}else o<0&&(n=!0,o=l+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,a=t.length-1;for(;l--;)if(47===e.charCodeAt(l)){if(n){r=l+1;break}}else i<0&&(n=!0,i=l+1),a>-1&&(e.charCodeAt(l)===t.charCodeAt(a--)?a<0&&(o=l):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},R=function(e){if(O(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},N=function(e){O(e);let t,n=e.length,r=-1,o=0,l=-1,i=0;for(;n--;){const a=e.charCodeAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?l<0?l=n:1!==i&&(i=1):l>-1&&(i=-1);else if(t){o=n+1;break}}return l<0||r<0||0===i||1===i&&l===r-1&&l===o+1?"":e.slice(l,r)},A=function(...e){let t,n=-1;for(;++n<e.length;)O(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){O(e);const t=47===e.charCodeAt(0);let n=function(e,t){let n,r,o="",l=0,i=-1,a=0,c=-1;for(;++c<=e.length;){if(c<e.length)n=e.charCodeAt(c);else{if(47===n)break;n=47}if(47===n){if(i===c-1||1===a);else if(i!==c-1&&2===a){if(o.length<2||2!==l||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",l=0):(o=o.slice(0,r),l=o.length-1-o.lastIndexOf("/")),i=c,a=0;continue}}else if(o.length>0){o="",l=0,i=c,a=0;continue}t&&(o=o.length>0?o+"/..":"..",l=2)}else o.length>0?o+="/"+e.slice(i+1,c):o=e.slice(i+1,c),l=c-i-1;i=c,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},I="/";function O(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _=function(){return"/"};function L(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const D=["history","path","basename","stem","extname","dirname"];class M{constructor(e){let t;t=e?"string"==typeof e||function(e){return x(e)}(e)?{value:e}:L(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=_(),this.value,this.stored,this.result,this.map;let n,r=-1;for(;++r<D.length;){const e=D[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)D.includes(n)||(this[n]=t[n])}get path(){return this.history[this.history.length-1]}set path(e){L(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!L(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.charCodeAt(n)&&50===t.charCodeAt(n+1)){const e=t.charCodeAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),B(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return"string"==typeof this.path?R(this.path):void 0}set dirname(e){z(this.basename,"dirname"),this.path=A(e||"",this.basename)}get basename(){return"string"==typeof this.path?F(this.path):void 0}set basename(e){B(e,"basename"),j(e,"basename"),this.path=A(this.dirname||"",e)}get extname(){return"string"==typeof this.path?N(this.path):void 0}set extname(e){if(j(e,"extname"),z(this.dirname,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=A(this.dirname,this.stem+(e||""))}get stem(){return"string"==typeof this.path?F(this.path,this.extname):void 0}set stem(e){B(e,"stem"),j(e,"stem"),this.path=A(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,t,n){const r=new P(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=null,r}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}}function j(e,t){if(e&&e.includes(I))throw new Error("`"+t+"` cannot be a path: did not expect `"+I+"`")}function B(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function z(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function H(e){if(e)throw e}var U=n(470);function V(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}const q=function e(){const t=function(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(l,...i){const a=e[++n];let c=-1;if(l)r(l);else{for(;++c<t.length;)null!==i[c]&&void 0!==i[c]||(i[c]=t[c]);t=i,a?function(e,t){let n;return function(...t){const l=e.length>t.length;let i;l&&t.push(r);try{i=e.apply(this,t)}catch(e){if(l&&n)throw e;return r(e)}l||(i&&i.then&&"function"==typeof i.then?i.then(o,r):i instanceof Error?r(i):o(i))};function r(e,...r){n||(n=!0,t(e,...r))}function o(e){r(null,e)}}(a,o)(...i):r(null,...i)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}(),n=[];let r,o={},l=-1;return i.data=function(e,t){return"string"==typeof e?2===arguments.length?($("data",r),o[e]=t,i):W.call(o,e)&&o[e]||null:e?($("data",r),o=e,i):o},i.Parser=void 0,i.Compiler=void 0,i.freeze=function(){if(r)return i;for(;++l<n.length;){const[e,...r]=n[l];if(!1===r[0])continue;!0===r[0]&&(r[0]=void 0);const o=e.call(i,...r);"function"==typeof o&&t.use(o)}return r=!0,l=Number.POSITIVE_INFINITY,i},i.attachers=n,i.use=function(e,...t){let l;if($("use",r),null==e);else if("function"==typeof e)s(e,...t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?u(e):c(e)}return l&&(o.settings=Object.assign(o.settings||{},l)),i;function a(e){if("function"==typeof e)s(e);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,...n)}else c(e)}}function c(e){u(e.plugins),e.settings&&(l=Object.assign(l||{},e.settings))}function u(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;)a(e[t])}}function s(e,t){let r,o=-1;for(;++o<n.length;)if(n[o][0]===e){r=n[o];break}r?(V(r[1])&&V(t)&&(t=U(!0,r[1],t)),r[1]=t):n.push([...arguments])}},i.parse=function(e){i.freeze();const t=X(e),n=i.Parser;return Y("parse",n),Q(n,"parse")?new n(String(t),t).parse():n(String(t),t)},i.stringify=function(e,t){i.freeze();const n=X(t),r=i.Compiler;return K("stringify",r),Z(e),Q(r,"compile")?new r(e,n).compile():r(e,n)},i.run=function(e,n,r){if(Z(e),i.freeze(),r||"function"!=typeof n||(r=n,n=void 0),!r)return new Promise(o);function o(o,l){t.run(e,X(n),(function(t,n,i){n=n||e,t?l(t):o?o(n):r(null,n,i)}))}o(null,r)},i.runSync=function(e,t){let n,r;return i.run(e,t,(function(e,t){H(e),n=t,r=!0})),G("runSync","run",r),n},i.process=function(e,t){if(i.freeze(),Y("process",i.Parser),K("process",i.Compiler),!t)return new Promise(n);function n(n,r){const o=X(e);function l(e,o){e||!o?r(e):n?n(o):t(null,o)}i.run(i.parse(o),o,((e,t,n)=>{if(!e&&t&&n){const o=i.stringify(t,n);null==o||("string"==typeof(r=o)||x(r)?n.value=o:n.result=o),l(e,n)}else l(e);var r}))}n(null,t)},i.processSync=function(e){let t;i.freeze(),Y("processSync",i.Parser),K("processSync",i.Compiler);const n=X(e);return i.process(n,(function(e){t=!0,H(e)})),G("processSync","process",t),n},i;function i(){const t=e();let r=-1;for(;++r<n.length;)t.use(...n[r]);return t.data(U(!0,{},o)),t}}().freeze(),W={}.hasOwnProperty;function Q(e,t){return"function"==typeof e&&e.prototype&&(function(e){let t;for(t in e)if(W.call(e,t))return!0;return!1}(e.prototype)||t in e.prototype)}function Y(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Parser`")}function K(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `Compiler`")}function $(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Z(e){if(!V(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function G(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function X(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new M(e)}const J={};function ee(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return te(e.children,t,n)}return Array.isArray(e)?te(e,t,n):""}function te(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ee(e[o],t,n);return r.join("")}function ne(e,t,n,r){const o=e.length;let l,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function re(e,t){return e.length>0?(ne(e,e.length,0,t),e):t}const oe={}.hasOwnProperty;function le(e,t){let n;for(n in t){const r=(oe.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){oe.call(r,l)||(r[l]=[]);const e=o[l];ie(r[l],Array.isArray(e)?e:e?[e]:[])}}}function ie(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);ne(e,0,0,r)}const ae=be(/[A-Za-z]/),ce=be(/[\dA-Za-z]/),ue=be(/[#-'*+\--9=?A-Z^-~]/);function se(e){return null!==e&&(e<32||127===e)}const de=be(/\d/),fe=be(/[\dA-Fa-f]/),pe=be(/[!-/:-@[-`{-~]/);function me(e){return null!==e&&e<-2}function he(e){return null!==e&&(e<0||32===e)}function ge(e){return-2===e||-1===e||32===e}const ve=be(/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/),ye=be(/\s/);function be(e){return function(t){return null!==t&&e.test(String.fromCharCode(t))}}function ke(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let l=0;return function(r){return ge(r)?(e.enter(n),i(r)):t(r)};function i(r){return ge(r)&&l++<o?(e.consume(r),i):(e.exit(n),t(r))}}const Se={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null!==n)return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ke(e,t,"linePrefix");e.consume(n)}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):me(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}},xe={tokenize:function(e){const t=this,n=[];let r,o,l,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,c,u)(r)}return u(r)}function c(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let o,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){o=t.events[l][1].end;break}v(i);let a=n;for(;a<t.events.length;)t.events[a][1].end=Object.assign({},o),a++;return ne(t.events,l+1,0,t.events.slice(n)),t.events.length=a,u(e)}return a(e)}function u(o){if(i===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return m(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ce,s,d)(o)}function s(e){return r&&y(),v(i),f(e)}function d(e){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ce,p,m)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):me(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<l&&(!r.events[e][1].end||r.events[e][1].end.offset>l))return;const n=t.events.length;let o,a,c=n;for(;c--;)if("exit"===t.events[c][0]&&"chunkFlow"===t.events[c][1].type){if(o){a=t.events[c][1].end;break}o=!0}for(v(i),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},a),e++;ne(t.events,c+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Ce={tokenize:function(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},Ee={tokenize:function(e,t,n){return function(t){return ge(t)?ke(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||me(e)?t(e):n(e)}},partial:!0};function we(e){const t={};let n,r,o,l,i,a,c,u=-1;for(;++u<e.length;){for(;u in t;)u=t[u];if(n=e[u],u&&"chunkFlow"===n[1].type&&"listItemPrefix"===e[u-1][1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Te(e,u)),u=t[u],c=!0);else if(n[1]._container){for(o=u,r=void 0;o--&&(l=e[o],"lineEnding"===l[1].type||"lineEndingBlank"===l[1].type);)"enter"===l[0]&&(r&&(e[r][1].type="lineEndingBlank"),l[1].type="lineEnding",r=o);r&&(n[1].end=Object.assign({},e[r][1].start),i=e.slice(r,u),i.unshift(n),ne(e,r,u-r+1,i))}}return!c}function Te(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const l=[],i=n._tokenizer||r.parser[n.contentType](n.start),a=i.events,c=[],u={};let s,d,f=-1,p=n,m=0,h=0;const g=[h];for(;p;){for(;e[++o][1]!==p;);l.push(o),p._tokenizer||(s=r.sliceStream(p),p.next||s.push(null),d&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(s),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)"exit"===a[f][0]&&"enter"===a[f-1][0]&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){const t=a.slice(g[f],g[f+1]),n=l.pop();c.unshift([n,n+t.length-1]),ne(e,n,2,t)}for(f=-1;++f<c.length;)u[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return u}const Pe={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):me(t)?e.check(Fe,l,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function l(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return we(e),e}},Fe={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ke(e,o,"linePrefix")};function o(o){if(null===o||me(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}},partial:!0},Re={tokenize:function(e){const t=this,n=e.attempt(Ee,(function(r){if(null!==r)return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(r)}),e.attempt(this.parser.constructs.flowInitial,r,ke(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Pe,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}},Ne={resolveAll:_e()},Ae=Oe("string"),Ie=Oe("text");function Oe(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,l,i);return l;function l(e){return c(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return c(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function c(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:_e("text"===e?Le:void 0)}}function _e(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function Le(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let l,i=o.length,a=-1,c=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)c++,a--;if(a)break;a=-1}else if(-2===e)l=!0,c++;else if(-1!==e){i++;break}}if(c){const o={type:n===e.length||l||c<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-c,offset:r.end.offset-c,_index:r.start._index+i,_bufferIndex:i?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},o.start),r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}function De(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const l=e[o].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}function Me(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},l=[];let i=[],a=[],c=!0;const u={consume:function(e){me(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=e,c=!0},enter:function(e,t){const n=t||{};return n.type=e,n.start=m(),s.events.push(["enter",n,s]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=m(),s.events.push(["exit",t,s]),t},attempt:v((function(e,t){y(e,t.from)})),check:v(g),interrupt:v(g,{interrupt:!0})},s={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const l=e[n];let i;if("string"==typeof l)i=l;else switch(l){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(l)}o=-2===l,r.push(i)}return r.join("")}(p(e),t)},now:m,defineSkip:function(e){o[e.line]=e.column,b()},write:function(e){return i=re(i,e),function(){let e;for(;r._index<i.length;){const t=i[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}(),null!==i[i.length-1]?[]:(y(t,0),s.events=De(l,s.events,s),s.events)}};let d,f=t.tokenize.call(s,u);return t.resolveAll&&l.push(t),s;function p(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,l=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,l)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}l>0&&i.push(e[o].slice(0,l))}return i}(i,e)}function m(){const{line:e,column:t,offset:n,_index:o,_bufferIndex:l}=r;return{line:e,column:t,offset:n,_index:o,_bufferIndex:l}}function h(e){c=void 0,d=e,f=f(e)}function g(e,t){t.restore()}function v(e,t){return function(n,o,l){let i,d,f,p;return Array.isArray(n)?g(n):"tokenize"in n?g([n]):(h=n,function(e){const t=null!==e&&h[e],n=null!==e&&h.null;return g([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});var h;function g(e){return i=e,d=0,0===e.length?l:v(e[d])}function v(e){return function(n){return p=function(){const e=m(),t=s.previous,n=s.currentConstruct,o=s.events.length,l=Array.from(a);return{restore:function(){r=e,s.previous=t,s.currentConstruct=n,s.events.length=o,a=l,b()},from:o}}(),f=e,e.partial||(s.currentConstruct=e),e.name&&s.parser.constructs.disable.null.includes(e.name)?k():e.tokenize.call(t?Object.assign(Object.create(s),t):s,u,y,k)(n)}}function y(t){return c=!0,e(f,p),o}function k(e){return c=!0,p.restore(),++d<i.length?v(i[d]):l}}}function y(e,t){e.resolveAll&&!l.includes(e)&&l.push(e),e.resolve&&ne(s.events,t,s.events.length-t,e.resolve(s.events.slice(t),s)),e.resolveTo&&(s.events=e.resolveTo(s.events,s))}function b(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const je={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,l(e)}(t)};function l(l){return l===r?(e.enter("thematicBreakSequence"),i(l)):o>=3&&(null===l||me(l))?(e.exit("thematicBreak"),t(l)):n(l)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),ge(t)?ke(e,l,"whitespace")(t):l(t))}}},Be={name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let l=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:de(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(je,n,c)(t):c(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return de(t)&&++i<10?(e.consume(t),a):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),c(t)):n(t)}function c(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Ee,r.interrupt?n:u,e.attempt(ze,d,s))}function u(e){return r.containerState.initialBlankLine=!0,l++,d(e)}function s(t){return ge(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ee,(function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(n)}),(function(n){return r.containerState.furtherBlankLines||!ge(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(He,t,o)(n))}));function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(Be,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},ze={tokenize:function(e,t,n){const r=this;return ke(e,(function(e){const o=r.events[r.events.length-1];return!ge(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},He={tokenize:function(e,t,n){const r=this;return ke(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0},Ue={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return ge(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){return ge(t)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(Ue,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function Ve(e,t,n,r,o,l,i,a,c){const u=c||Number.POSITIVE_INFINITY;let s=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(l),e.consume(t),e.exit(l),d):null===t||32===t||41===t||se(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(t))};function d(n){return 62===n?(e.enter(l),e.consume(n),e.exit(l),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||me(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function m(o){return s||null!==o&&41!==o&&!he(o)?s<u&&40===o?(e.consume(o),s++,m):41===o?(e.consume(o),s--,m):null===o||32===o||40===o||se(o)?n(o):(e.consume(o),92===o?h:m):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),m):m(t)}}function qe(e,t,n,r,o,l){const i=this;let a,c=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(l),u};function u(d){return c>999||null===d||91===d||93===d&&!a||94===d&&!c&&"_hiddenFootnoteSupport"in i.parser.constructs?n(d):93===d?(e.exit(l),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),s(d))}function s(t){return null===t||91===t||93===t||me(t)||c++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a||(a=!ge(t)),92===t?d:s)}function d(t){return 91===t||92===t||93===t?(e.consume(t),c++,s):s(t)}}function We(e,t,n,r,o,l){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(l),c(n))}function c(t){return t===i?(e.exit(l),a(i)):null===t?n(t):me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===i||null===t||me(t)?(e.exit("chunkString"),c(t)):(e.consume(t),92===t?s:u)}function s(t){return t===i||92===t?(e.consume(t),u):u(t)}}function Qe(e,t){let n;return function r(o){return me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ge(o)?ke(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function Ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ke={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return qe.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function l(t){return o=Ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return he(t)?Qe(e,a)(t):a(t)}function a(t){return Ve(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function c(t){return e.attempt($e,u,u)(t)}function u(t){return ge(t)?ke(e,s,"whitespace")(t):s(t)}function s(l){return null===l||me(l)?(e.exit("definition"),r.parser.defined.push(o),t(l)):n(l)}}},$e={tokenize:function(e,t,n){return function(t){return he(t)?Qe(e,r)(t):n(t)};function r(t){return We(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return ge(t)?ke(e,l,"whitespace")(t):l(t)}function l(e){return null===e||me(e)?t(e):n(e)}},partial:!0},Ze={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?l(e):n(e)}function l(t){return null===t?a(t):me(t)?e.attempt(Ge,l,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||me(t)?(e.exit("codeFlowValue"),l(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Ge={tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):ke(e,l,"linePrefix",5)(t)}function l(e){const l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(e):me(e)?o(e):n(e)}},partial:!0},Xe={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||he(t)?(e.exit("atxHeadingSequence"),l(t)):n(t)}function l(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||me(n)?(e.exit("atxHeading"),t(n)):ge(n)?ke(e,l,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),l(t))}function a(t){return null===t||35===t||he(t)?(e.exit("atxHeadingText"),l(t)):(e.consume(t),a)}},resolve:function(e,t){let n,r,o=e.length-2,l=3;return"whitespace"===e[l][1].type&&(l+=2),o-2>l&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(l===o-1||o-4>l&&"whitespace"===e[o-2][1].type)&&(o-=l+1===o?2:4),o>l&&(n={type:"atxHeadingText",start:e[l][1].start,end:e[o][1].end},r={type:"chunkText",start:e[l][1].start,end:e[o][1].end,contentType:"text"},ne(e,l,o-l+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e}},Je={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let o;return function(t){let i,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),l(t)}(t))};function l(t){return t===o?(e.consume(t),l):(e.exit("setextHeadingLineSequence"),ge(t)?ke(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||me(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,o,l=e.length;for(;l--;)if("enter"===e[l][0]){if("content"===e[l][1].type){n=l;break}"paragraph"===e[l][1].type&&(r=l)}else"content"===e[l][1].type&&e.splice(l,1),o||"definition"!==e[l][1].type||(o=l);const i={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=i,e.push(["exit",i,t]),e}},et=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tt=["pre","script","style","textarea"],nt={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let o,l,i,a,c;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u}(t)};function u(a){return 33===a?(e.consume(a),s):47===a?(e.consume(a),l=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:_):ae(a)?(e.consume(a),i=String.fromCharCode(a),m):n(a)}function s(l){return 45===l?(e.consume(l),o=2,d):91===l?(e.consume(l),o=5,a=0,f):ae(l)?(e.consume(l),o=4,r.interrupt?t:_):n(l)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:_):n(o)}function f(o){return o==="CDATA[".charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:T:f):n(o)}function p(t){return ae(t)?(e.consume(t),i=String.fromCharCode(t),m):n(t)}function m(a){if(null===a||47===a||62===a||he(a)){const c=47===a,u=i.toLowerCase();return c||l||!tt.includes(u)?et.includes(i.toLowerCase())?(o=6,c?(e.consume(a),h):r.interrupt?t(a):T(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):l?g(a):v(a)):(o=1,r.interrupt?t(a):T(a))}return 45===a||ce(a)?(e.consume(a),i+=String.fromCharCode(a),m):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:T):n(o)}function g(t){return ge(t)?(e.consume(t),g):E(t)}function v(t){return 47===t?(e.consume(t),E):58===t||95===t||ae(t)?(e.consume(t),y):ge(t)?(e.consume(t),v):E(t)}function y(t){return 45===t||46===t||58===t||95===t||ce(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),k):ge(t)?(e.consume(t),b):v(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),c=t,S):ge(t)?(e.consume(t),k):x(t)}function S(t){return t===c?(e.consume(t),c=null,C):null===t||me(t)?n(t):(e.consume(t),S)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||he(t)?b(t):(e.consume(t),x)}function C(e){return 47===e||62===e||ge(e)?v(e):n(e)}function E(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||me(t)?T(t):ge(t)?(e.consume(t),w):n(t)}function T(t){return 45===t&&2===o?(e.consume(t),N):60===t&&1===o?(e.consume(t),A):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),_):93===t&&5===o?(e.consume(t),O):!me(t)||6!==o&&7!==o?null===t||me(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),T):(e.exit("htmlFlowData"),e.check(rt,D,P)(t))}function P(t){return e.check(ot,F,D)(t)}function F(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return null===t||me(t)?P(t):(e.enter("htmlFlowData"),T(t))}function N(t){return 45===t?(e.consume(t),_):T(t)}function A(t){return 47===t?(e.consume(t),i="",I):T(t)}function I(t){if(62===t){const n=i.toLowerCase();return tt.includes(n)?(e.consume(t),L):T(t)}return ae(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),I):T(t)}function O(t){return 93===t?(e.consume(t),_):T(t)}function _(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),_):T(t)}function L(t){return null===t||me(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),L)}function D(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},rt={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Ee,t,n)}},partial:!0},ot={tokenize:function(e,t,n){const r=this;return function(t){return me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},lt={tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},it={name:"codeFenced",tokenize:function(e,t,n){const r=this,o={tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(t){return e.enter("codeFencedFence"),ge(t)?ke(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===l?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===l?(o++,e.consume(t),u):o>=a?(e.exit("codeFencedFenceSequence"),ge(t)?ke(e,s,"whitespace")(t):s(t)):n(t)}function s(r){return null===r||me(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let l,i=0,a=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,l=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(t)}(t)};function c(t){return t===l?(a++,e.consume(t),c):a<3?n(t):(e.exit("codeFencedFenceSequence"),ge(t)?ke(e,u,"whitespace")(t):u(t))}function u(n){return null===n||me(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(lt,p,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),s(n))}function s(t){return null===t||me(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(t)):ge(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(t)):96===t&&t===l?n(t):(e.consume(t),s)}function d(t){return null===t||me(t)?u(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||me(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(t)):96===t&&t===l?n(t):(e.consume(t),f)}function p(t){return e.attempt(o,y,m)(t)}function m(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&ge(t)?ke(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||me(t)?e.check(lt,p,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||me(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),v)}function y(n){return e.exit("codeFenced"),t(n)}},concrete:!0},at=document.createElement("i");function ct(e){const t="&"+e+";";at.innerHTML=t;const n=at.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}const ut={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,l,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,l=ce,u(t))}function c(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=fe,u):(e.enter("characterReferenceValue"),o=7,l=de,u(t))}function u(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return l!==ce||ct(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return l(a)&&i++<o?(e.consume(a),u):n(a)}}},st={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return pe(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},dt={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ke(e,t,"linePrefix")}}},ft={name:"labelEnd",tokenize:function(e,t,n){const r=this;let o,l,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?s(t):(l=r.parser.defined.includes(Ye(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(pt,u,l?u:s)(t):91===t?e.attempt(mt,u,l?c:s)(t):l?u(t):s(t)}function c(t){return e.attempt(ht,u,s)(t)}function u(e){return t(e)}function s(e){return o._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,o,l,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(o=i);const c={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[o][1].end)},s={type:"labelText",start:Object.assign({},e[r+a+2][1].end),end:Object.assign({},e[o-2][1].start)};return l=[["enter",c,t],["enter",u,t]],l=re(l,e.slice(r+1,r+a+3)),l=re(l,[["enter",s,t]]),l=re(l,De(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),l=re(l,[["exit",s,t],e[o-2],e[o-1],["exit",u,t]]),l=re(l,e.slice(o+1)),l=re(l,[["exit",c,t]]),ne(e,r,e.length,l),e},resolveAll:function(e){let t=-1;for(;++t<e.length;){const n=e[t][1];"labelImage"!==n.type&&"labelLink"!==n.type&&"labelEnd"!==n.type||(e.splice(t+1,"labelImage"===n.type?4:2),n.type="data",t++)}return e}},pt={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return he(t)?Qe(e,o)(t):o(t)}function o(t){return 41===t?u(t):Ve(e,l,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function l(t){return he(t)?Qe(e,a)(t):u(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?We(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function c(t){return he(t)?Qe(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},mt={tokenize:function(e,t,n){const r=this;return function(t){return qe.call(r,e,o,l,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(Ye(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function l(e){return n(e)}}},ht={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},gt={name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),l):n(t)}function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:ft.resolveAll};function vt(e){return null===e||he(e)||ye(e)?1:ve(e)?2:void 0}const yt={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=vt(r);let l;return function(t){return l=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===l)return e.consume(a),i;const c=e.exit("attentionSequence"),u=vt(a),s=!u||2===u&&o||n.includes(a),d=!o||2===o&&u||n.includes(r);return c._open=Boolean(42===l?s:s&&(o||!d)),c._close=Boolean(42===l?d:d&&(u||!s)),t(a)}},resolveAll:function(e,t){let n,r,o,l,i,a,c,u,s=-1;for(;++s<e.length;)if("enter"===e[s][0]&&"attentionSequence"===e[s][1].type&&e[s][1]._close)for(n=s;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[n][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const d=Object.assign({},e[n][1].end),f=Object.assign({},e[s][1].start);bt(d,-a),bt(f,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},i={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[s][1].start),end:f},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[s][1].start)},r={type:a>1?"strong":"emphasis",start:Object.assign({},l.start),end:Object.assign({},i.end)},e[n][1].end=Object.assign({},l.start),e[s][1].start=Object.assign({},i.end),c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=re(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=re(c,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=re(c,De(t.parser.constructs.insideSpan.null,e.slice(n+1,s),t)),c=re(c,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[s][1].end.offset-e[s][1].start.offset?(u=2,c=re(c,[["enter",e[s][1],t],["exit",e[s][1],t]])):u=0,ne(e,n-1,s-n+3,c),s=n+c.length-u-2;break}for(s=-1;++s<e.length;)"attentionSequence"===e[s][1].type&&(e[s][1].type="data");return e}};function bt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kt={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ae(t)?(e.consume(t),l):c(t)}function l(e){return 43===e||45===e||46===e||ce(e)?(r=1,i(e)):c(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||ce(t))&&r++<32?(e.consume(t),i):(r=0,c(t))}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||se(r)?n(r):(e.consume(r),a)}function c(t){return 64===t?(e.consume(t),u):ue(t)?(e.consume(t),c):n(t)}function u(e){return ce(e)?s(e):n(e)}function s(n){return 46===n?(e.consume(n),r=0,u):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||ce(t))&&r++<63){const n=45===t?d:s;return e.consume(t),n}return n(t)}}},St={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,l,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),c):47===t?(e.consume(t),k):63===t?(e.consume(t),y):ae(t)?(e.consume(t),C):n(t)}function c(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),l=0,p):ae(t)?(e.consume(t),v):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function s(t){return null===t?n(t):45===t?(e.consume(t),d):me(t)?(i=s,I(t)):(e.consume(t),s)}function d(t){return 45===t?(e.consume(t),f):s(t)}function f(e){return 62===e?A(e):45===e?d(e):s(e)}function p(t){return t==="CDATA[".charCodeAt(l++)?(e.consume(t),6===l?m:p):n(t)}function m(t){return null===t?n(t):93===t?(e.consume(t),h):me(t)?(i=m,I(t)):(e.consume(t),m)}function h(t){return 93===t?(e.consume(t),g):m(t)}function g(t){return 62===t?A(t):93===t?(e.consume(t),g):m(t)}function v(t){return null===t||62===t?A(t):me(t)?(i=v,I(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),b):me(t)?(i=y,I(t)):(e.consume(t),y)}function b(e){return 62===e?A(e):y(e)}function k(t){return ae(t)?(e.consume(t),S):n(t)}function S(t){return 45===t||ce(t)?(e.consume(t),S):x(t)}function x(t){return me(t)?(i=x,I(t)):ge(t)?(e.consume(t),x):A(t)}function C(t){return 45===t||ce(t)?(e.consume(t),C):47===t||62===t||he(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),A):58===t||95===t||ae(t)?(e.consume(t),w):me(t)?(i=E,I(t)):ge(t)?(e.consume(t),E):A(t)}function w(t){return 45===t||46===t||58===t||95===t||ce(t)?(e.consume(t),w):T(t)}function T(t){return 61===t?(e.consume(t),P):me(t)?(i=T,I(t)):ge(t)?(e.consume(t),T):E(t)}function P(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,F):me(t)?(i=P,I(t)):ge(t)?(e.consume(t),P):(e.consume(t),R)}function F(t){return t===o?(e.consume(t),o=void 0,N):null===t?n(t):me(t)?(i=F,I(t)):(e.consume(t),F)}function R(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||he(t)?E(t):(e.consume(t),R)}function N(e){return 47===e||62===e||he(e)?E(e):n(e)}function A(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),O}function O(t){return ge(t)?ke(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):_(t)}function _(t){return e.enter("htmlTextData"),i(t)}}},xt={name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:ft.resolveAll},Ct={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return me(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},Et={name:"codeText",tokenize:function(e,t,n){let r,o,l=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),l++,i):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,u(t)):me(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),c(t))}function c(t){return null===t||32===t||96===t||me(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),c)}function u(n){return 96===n?(e.consume(n),r++,u):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",c(n))}},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}},wt={42:Be,43:Be,45:Be,48:Be,49:Be,50:Be,51:Be,52:Be,53:Be,54:Be,55:Be,56:Be,57:Be,62:Ue},Tt={91:Ke},Pt={[-2]:Ze,[-1]:Ze,32:Ze},Ft={35:Xe,42:je,45:[Je,je],60:nt,61:Je,95:je,96:it,126:it},Rt={38:ut,92:st},Nt={[-5]:dt,[-4]:dt,[-3]:dt,33:gt,38:ut,42:yt,60:[kt,St],91:xt,92:[Ct,st],93:ft,95:yt,96:Et},At={null:[yt,Ne]},It={null:[42,95]},Ot={null:[]};const _t=/[\0\t\n\r]/g;function Lt(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}const Dt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Mt(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Lt(n.slice(t?2:1),t?16:10)}return ct(n)||e}const jt={}.hasOwnProperty,Bt=function(t,n,r){return"string"!=typeof n&&(r=n,n=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(k),autolinkProtocol:f,autolinkEmail:f,atxHeading:i(v),blockQuote:i((function(){return{type:"blockquote",children:[]}})),characterEscape:f,characterReference:f,codeFenced:i(g),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(g,a),codeText:i((function(){return{type:"inlineCode",value:""}}),a),codeTextData:f,data:f,codeFlowValue:f,definition:i((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:i(y),hardBreakTrailing:i(y),htmlFlow:i(b,a),htmlFlowData:f,htmlText:i(b,a),htmlTextData:f,image:i((function(){return{type:"image",title:null,url:"",alt:null}})),label:a,link:i(k),listItem:i((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){l("expectingFirstListItemValue")&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),o("expectingFirstListItemValue"))},listOrdered:i(S,(function(){o("expectingFirstListItemValue",!0)})),listUnordered:i(S),paragraph:i((function(){return{type:"paragraph",children:[]}})),reference:function(){o("referenceType","collapsed")},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(v),strong:i((function(){return{type:"strong",children:[]}})),thematicBreak:i((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:u(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:u(),autolinkEmail:function(e){p.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){p.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:u(),characterEscapeValue:p,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=l("characterReferenceType");let r;n?(r=Lt(t,"characterReferenceMarkerNumeric"===n?10:16),o("characterReferenceType")):r=ct(t);const i=this.stack.pop();i.value+=r,i.position.end=zt(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")})),codeFencedFence:function(){l("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:p,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:p,data:p,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ye(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(m),hardBreakTrailing:u(m),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:p,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:p,image:u((function(){const e=this.stack[this.stack.length-1];if(l("inReference")){const t=l("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(o("inReference",!0),"link"===n.type){const t=e.children;n.children=t}else n.alt=t},labelText:function(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Dt,Mt)}(t),n.identifier=Ye(t).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(l("atHardBreak"))return n.children[n.children.length-1].position.end=zt(e.end),void o("atHardBreak");!l("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(f.call(this,e),p.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];if(l("inReference")){const t=l("referenceType")||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;o("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ye(this.sliceSerialize(e)).toLowerCase(),o("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){o("inReference")},setextHeading:u((function(){o("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){o("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}};Ht(t,(e||{}).mdastExtensions||[]);const n={};return function(e){let n={type:"root",children:[]};const i={stack:[n],tokenStack:[],config:t,enter:c,exit:s,buffer:a,resume:d,setData:o,getData:l},u=[];let f=-1;for(;++f<e.length;)"listOrdered"!==e[f][1].type&&"listUnordered"!==e[f][1].type||("enter"===e[f][0]?u.push(f):f=r(e,u.pop(),f));for(f=-1;++f<e.length;){const n=t[e[f][0]];jt.call(n,e[f][1].type)&&n[e[f][1].type].call(Object.assign({sliceSerialize:e[f][2].sliceSerialize},i),e[f][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Vt).call(i,void 0,e[0])}for(n.position={start:zt(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:zt(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},f=-1;++f<t.transforms.length;)n=t.transforms[f](n)||n;return n};function r(e,t,n){let r,o,l,i,a=t-1,c=-1,u=!1;for(;++a<=n;){const t=e[a];if("listUnordered"===t[1].type||"listOrdered"===t[1].type||"blockQuote"===t[1].type?("enter"===t[0]?c++:c--,i=void 0):"lineEndingBlank"===t[1].type?"enter"===t[0]&&(!r||i||c||l||(l=a),i=void 0):"linePrefix"===t[1].type||"listItemValue"===t[1].type||"listItemMarker"===t[1].type||"listItemPrefix"===t[1].type||"listItemPrefixWhitespace"===t[1].type||(i=void 0),!c&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===c&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}l&&(!o||l<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||a,0,["exit",r,t[2]]),a++,n++}"listItemPrefix"===t[1].type&&(r={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0},e.splice(a,0,["enter",r,t[2]]),a++,n++,l=void 0,i=!0)}}return e[t][1]._spread=u,n}function o(e,t){n[e]=t}function l(e){return n[e]}function i(e,t){return function(n){c.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(e,t,n){return this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:zt(t.start)},e}function u(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+C({start:e.start,end:e.end})+"): it’s not open");return r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Vt).call(this,e,r[0])),n.position.end=zt(e.end),n}function d(){return function(e,t){return ee(e,"boolean"!=typeof J.includeImageAlt||J.includeImageAlt,"boolean"!=typeof J.includeHtml||J.includeHtml)}(this.stack.pop())}function f(e){const t=this.stack[this.stack.length-1];let n=t.children[t.children.length-1];n&&"text"===n.type||(n={type:"text",value:""},n.position={start:zt(e.start)},t.children.push(n)),this.stack.push(n)}function p(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=zt(e.end)}function m(){o("atHardBreak",!0)}function h(e){o("characterReferenceType",e.type)}function g(){return{type:"code",lang:null,meta:null,value:""}}function v(){return{type:"heading",depth:void 0,children:[]}}function y(){return{type:"break"}}function b(){return{type:"html",value:""}}function k(){return{type:"link",title:null,url:"",children:[]}}function S(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}}(r)(function(e){for(;!we(e););return e}(function(t){const n=function(e){const t={};let n=-1;for(;++n<e.length;)le(t,e[n]);return t}([e,...(t||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(Se),document:o(xe),flow:o(Re),string:o(Ae),text:o(Ie)};return r;function o(e){return function(t){return Me(r,e,t)}}}(r).document().write(function(){let e,t=1,n="",r=!0;return function(o,l,i){const a=[];let c,u,s,d,f;for(o=n+o.toString(l),s=0,n="",r&&(65279===o.charCodeAt(0)&&s++,r=void 0);s<o.length;){if(_t.lastIndex=s,c=_t.exec(o),d=c&&void 0!==c.index?c.index:o.length,f=o.charCodeAt(d),!c){n=o.slice(s);break}if(10===f&&s===d&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),s<d&&(a.push(o.slice(s,d)),t+=d-s),f){case 0:a.push(65533),t++;break;case 9:for(u=4*Math.ceil(t/4),a.push(-2);t++<u;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}s=d+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(t,n,!0))))};function zt(e){return{line:e.line,column:e.column,offset:e.offset}}function Ht(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ht(e,r):Ut(e,r)}}function Ut(e,t){let n;for(n in t)if(jt.call(t,n))if("canContainEols"===n){const r=t[n];r&&e[n].push(...r)}else if("transforms"===n){const r=t[n];r&&e[n].push(...r)}else if("enter"===n||"exit"===n){const r=t[n];r&&Object.assign(e[n],r)}}function Vt(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+C({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+C({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+C({start:t.start,end:t.end})+") is still open")}function qt(e){Object.assign(this,{Parser:t=>{const n=this.data("settings");return Bt(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Wt(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const l=e.charCodeAt(n);let i="";if(37===l&&ce(e.charCodeAt(n+1))&&ce(e.charCodeAt(n+2)))o=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(i=String.fromCharCode(l));else if(l>55295&&l<57344){const t=e.charCodeAt(n+1);l<56320&&t>56319&&t<57344?(i=String.fromCharCode(l,t),o=1):i="�"}else i=String.fromCharCode(l);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}const Qt=function(e){if(null==e)return Kt;if("string"==typeof e)return t=e,Yt((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qt(e[n]);return Yt((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return Yt((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return Yt(e);throw new Error("Expected function, string, or object as test")};function Yt(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function Kt(){return!0}const $t=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null);const o=Qt(t),l=r?-1:1;!function e(i,a,c){const u=i&&"object"==typeof i?i:{};if("string"==typeof u.type){const e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(s,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return s;function s(){let u,s,d,f=[];if((!t||o(i,a,c[c.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(i,c)),!1===f[0]))return f;if(i.children&&"skip"!==f[0])for(s=(r?i.children.length:-1)+l,d=c.concat(i);s>-1&&s<i.children.length;){if(u=e(i.children[s],s,d)(),!1===u[0])return u;s="number"==typeof u[1]?u[1]:s+l}return f}}(e,void 0,[])()}(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)},Zt=Xt("start"),Gt=Xt("end");function Xt(e){return function(t){const n=t&&t.position&&t.position[e]||{};return{line:n.line||null,column:n.column||null,offset:n.offset>-1?n.offset:null}}}const Jt={}.hasOwnProperty;function en(e){return String(e||"").toUpperCase()}function tn(e,t){const n=String(t.identifier).toUpperCase(),r=Wt(n.toLowerCase()),o=e.footnoteOrder.indexOf(n);let l;-1===o?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,l=e.footnoteOrder.length):(e.footnoteCounts[n]++,l=o+1);const i=e.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}function nn(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return{type:"text",value:"!["+t.alt+r};const o=e.all(t),l=o[0];l&&"text"===l.type?l.value="["+l.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function rn(e){const t=e.spread;return null==t?e.children.length>1:t}const on=9,ln=32;function an(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const l=[];for(;r;)l.push(cn(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return l.push(cn(t.slice(o),o>0,!1)),l.join("")}function cn(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;t===on||t===ln;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;t===on||t===ln;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const un={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,o={};r&&(o.className=["language-"+r]);let l={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:tn,footnote:function(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const o=String(r);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},tn(e,{type:"footnoteReference",identifier:o,position:t.position})},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null},imageReference:function(e,t){const n=e.definition(t.identifier);if(!n)return nn(e,t);const r={src:Wt(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(r.title=n.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:Wt(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=e.definition(t.identifier);if(!n)return nn(e,t);const r={href:Wt(n.url||"")};null!==n.title&&void 0!==n.title&&(r.title=n.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:Wt(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=rn(n[r])}return t}(n):rn(t),l={},i=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const c=r[r.length-1];c&&(o||"element"!==c.type||"p"!==c.tagName)&&i.push({type:"text",value:"\n"});const u={type:"element",tagName:"li",properties:l,children:i};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Zt(t.children[1]),i=Gt(t.children[t.children.length-1]);l.line&&i.line&&(r.position={start:l,end:i}),o.push(r)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",l=n&&"table"===n.type?n.align:void 0,i=l?l.length:t.children.length;let a=-1;const c=[];for(;++a<i;){const n=t.children[a],r={},i=l?l[a]:void 0;i&&(r.align=i);let u={type:"element",tagName:o,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(t,u)),c.push(u)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){const n={type:"text",value:an(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:sn,yaml:sn,definition:sn,footnoteDefinition:sn};function sn(){return null}const dn={}.hasOwnProperty;function fn(e,t){var n;e.position&&(t.position={start:Zt(n=e),end:Gt(n)})}function pn(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:[]}),"element"===n.type&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function mn(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return dn.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:hn(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):function(e,t){const n=t.data||{},r=!("value"in t)||dn.call(n,"hProperties")||dn.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:hn(e,t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}(e,t)}function hn(e,t){const n=[];if("children"in t){const r=t.children;let o=-1;for(;++o<r.length;){const l=mn(e,r[o],t);if(l){if(o&&"break"===r[o-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=l.value.replace(/^\s+/,"")),!Array.isArray(l)&&"element"===l.type)){const e=l.children[0];e&&"text"===e.type&&(e.value=e.value.replace(/^\s+/,""))}Array.isArray(l)?n.push(...l):n.push(l)}}}return n}function gn(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function vn(e,t){const n=function(e,t){const n=t||{},r=n.allowDangerousHtml||!1,o={};return i.dangerous=r,i.clobberPrefix=void 0===n.clobberPrefix||null===n.clobberPrefix?"user-content-":n.clobberPrefix,i.footnoteLabel=n.footnoteLabel||"Footnotes",i.footnoteLabelTagName=n.footnoteLabelTagName||"h2",i.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},i.footnoteBackLabel=n.footnoteBackLabel||"Back to content",i.unknownHandler=n.unknownHandler,i.passThrough=n.passThrough,i.handlers={...un,...n.handlers},i.definition=function(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return $t(e,"definition",(e=>{const n=en(e.identifier);n&&!Jt.call(t,n)&&(t[n]=e)})),function(e){const n=en(e);return n&&Jt.call(t,n)?t[n]:null}}(e),i.footnoteById=o,i.footnoteOrder=[],i.footnoteCounts={},i.patch=fn,i.applyData=pn,i.one=function(e,t){return mn(i,e,t)},i.all=function(e){return hn(i,e)},i.wrap=gn,i.augment=l,$t(e,"footnoteDefinition",(e=>{const t=String(e.identifier).toUpperCase();dn.call(o,t)||(o[t]=e)})),i;function l(e,t){if(e&&"data"in e&&e.data){const n=e.data;n.hName&&("element"!==t.type&&(t={type:"element",tagName:"",properties:{},children:[]}),t.tagName=n.hName),"element"===t.type&&n.hProperties&&(t.properties={...t.properties,...n.hProperties}),"children"in t&&t.children&&n.hChildren&&(t.children=n.hChildren)}if(e){const r="type"in e?e:{position:e};!((n=r)&&n.position&&n.position.start&&n.position.start.line&&n.position.start.column&&n.position.end&&n.position.end.line&&n.position.end.column)||(t.position={start:Zt(r),end:Gt(r)})}var n;return t}function i(e,t,n,r){return Array.isArray(n)&&(r=n,n={}),l(e,{type:"element",tagName:t,properties:n||{},children:r||[]})}}(e,t),r=n.one(e,null),o=function(e){const t=[];let n=-1;for(;++n<e.footnoteOrder.length;){const r=e.footnoteById[e.footnoteOrder[n]];if(!r)continue;const o=e.all(r),l=String(r.identifier).toUpperCase(),i=Wt(l.toLowerCase());let a=0;const c=[];for(;++a<=e.footnoteCounts[l];){const t={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&t.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),c.length>0&&c.push({type:"text",value:" "}),c.push(t)}const u=o[o.length-1];if(u&&"element"===u.type&&"p"===u.tagName){const e=u.children[u.children.length-1];e&&"text"===e.type?e.value+=" ":u.children.push({type:"text",value:" "}),u.children.push(...c)}else o.push(...c);const s={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+i},children:e.wrap(o,!0)};e.patch(r,s),t.push(s)}if(0!==t.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:"\n"}]}}(n);return o&&r.children.push({type:"text",value:"\n"},o),Array.isArray(r)?{type:"root",children:r}:r}const yn=function(e,t){return e&&"run"in e?function(e,t){return(n,r,o)=>{e.run(vn(n,t),r,(e=>{o(e)}))}}(e,t):function(e){return t=>vn(t,e)}(e||t)};var bn=n(697);class kn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Sn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new kn(n,r,t)}function xn(e){return e.toLowerCase()}kn.prototype.property={},kn.prototype.normal={},kn.prototype.space=null;class Cn{constructor(e,t){this.property=e,this.attribute=t}}Cn.prototype.space=null,Cn.prototype.boolean=!1,Cn.prototype.booleanish=!1,Cn.prototype.overloadedBoolean=!1,Cn.prototype.number=!1,Cn.prototype.commaSeparated=!1,Cn.prototype.spaceSeparated=!1,Cn.prototype.commaOrSpaceSeparated=!1,Cn.prototype.mustUseProperty=!1,Cn.prototype.defined=!1;let En=0;const wn=In(),Tn=In(),Pn=In(),Fn=In(),Rn=In(),Nn=In(),An=In();function In(){return 2**++En}const On=Object.keys(t);class _n extends Cn{constructor(e,n,r,o){let l=-1;if(super(e,n),Ln(this,"space",o),"number"==typeof r)for(;++l<On.length;){const e=On[l];Ln(this,On[l],(r&t[e])===t[e])}}}function Ln(e,t,n){n&&(e[t]=n)}_n.prototype.defined=!0;const Dn={}.hasOwnProperty;function Mn(e){const t={},n={};let r;for(r in e.properties)if(Dn.call(e.properties,r)){const o=e.properties[r],l=new _n(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[xn(r)]=r,n[xn(l.attribute)]=r}return new kn(t,n,e.space)}const jn=Mn({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Bn=Mn({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function zn(e,t){return t in e?e[t]:t}function Hn(e,t){return zn(e,t.toLowerCase())}const Un=Mn({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Hn,properties:{xmlns:null,xmlnsXLink:null}}),Vn=Mn({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Tn,ariaAutoComplete:null,ariaBusy:Tn,ariaChecked:Tn,ariaColCount:Fn,ariaColIndex:Fn,ariaColSpan:Fn,ariaControls:Rn,ariaCurrent:null,ariaDescribedBy:Rn,ariaDetails:null,ariaDisabled:Tn,ariaDropEffect:Rn,ariaErrorMessage:null,ariaExpanded:Tn,ariaFlowTo:Rn,ariaGrabbed:Tn,ariaHasPopup:null,ariaHidden:Tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rn,ariaLevel:Fn,ariaLive:null,ariaModal:Tn,ariaMultiLine:Tn,ariaMultiSelectable:Tn,ariaOrientation:null,ariaOwns:Rn,ariaPlaceholder:null,ariaPosInSet:Fn,ariaPressed:Tn,ariaReadOnly:Tn,ariaRelevant:null,ariaRequired:Tn,ariaRoleDescription:Rn,ariaRowCount:Fn,ariaRowIndex:Fn,ariaRowSpan:Fn,ariaSelected:Tn,ariaSetSize:Fn,ariaSort:null,ariaValueMax:Fn,ariaValueMin:Fn,ariaValueNow:Fn,ariaValueText:null,role:null}}),qn=Mn({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Hn,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:Rn,accessKey:Rn,action:null,allow:null,allowFullScreen:wn,allowPaymentRequest:wn,allowUserMedia:wn,alt:null,as:null,async:wn,autoCapitalize:null,autoComplete:Rn,autoFocus:wn,autoPlay:wn,blocking:Rn,capture:null,charSet:null,checked:wn,cite:null,className:Rn,cols:Fn,colSpan:null,content:null,contentEditable:Tn,controls:wn,controlsList:Rn,coords:Fn|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wn,defer:wn,dir:null,dirName:null,disabled:wn,download:Pn,draggable:Tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wn,formTarget:null,headers:Rn,height:Fn,hidden:wn,high:Fn,href:null,hrefLang:null,htmlFor:Rn,httpEquiv:Rn,id:null,imageSizes:null,imageSrcSet:null,inert:wn,inputMode:null,integrity:null,is:null,isMap:wn,itemId:null,itemProp:Rn,itemRef:Rn,itemScope:wn,itemType:Rn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wn,low:Fn,manifest:null,max:null,maxLength:Fn,media:null,method:null,min:null,minLength:Fn,multiple:wn,muted:wn,name:null,nonce:null,noModule:wn,noValidate:wn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:wn,optimum:Fn,pattern:null,ping:Rn,placeholder:null,playsInline:wn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wn,referrerPolicy:null,rel:Rn,required:wn,reversed:wn,rows:Fn,rowSpan:Fn,sandbox:Rn,scope:null,scoped:wn,seamless:wn,selected:wn,shadowRootClonable:wn,shadowRootDelegatesFocus:wn,shadowRootMode:null,shape:null,size:Fn,sizes:null,slot:null,span:Fn,spellCheck:Tn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Fn,step:null,style:null,tabIndex:Fn,target:null,title:null,translate:null,type:null,typeMustMatch:wn,useMap:null,value:Tn,width:Fn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Rn,axis:null,background:null,bgColor:null,border:Fn,borderColor:null,bottomMargin:Fn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wn,declare:wn,event:null,face:null,frame:null,frameBorder:null,hSpace:Fn,leftMargin:Fn,link:null,longDesc:null,lowSrc:null,marginHeight:Fn,marginWidth:Fn,noResize:wn,noHref:wn,noShade:wn,noWrap:wn,object:null,profile:null,prompt:null,rev:null,rightMargin:Fn,rules:null,scheme:null,scrolling:Tn,standby:null,summary:null,text:null,topMargin:Fn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Fn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wn,disableRemotePlayback:wn,prefix:null,property:null,results:Fn,security:null,unselectable:null}}),Wn=Mn({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:zn,properties:{about:An,accentHeight:Fn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Fn,amplitude:Fn,arabicForm:null,ascent:Fn,attributeName:null,attributeType:null,azimuth:Fn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Fn,by:null,calcMode:null,capHeight:Fn,className:Rn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Fn,diffuseConstant:Fn,direction:null,display:null,dur:null,divisor:Fn,dominantBaseline:null,download:wn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Fn,enableBackground:null,end:null,event:null,exponent:Fn,externalResourcesRequired:null,fill:null,fillOpacity:Fn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Fn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Fn,horizOriginX:Fn,horizOriginY:Fn,id:null,ideographic:Fn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Fn,k:Fn,k1:Fn,k2:Fn,k3:Fn,k4:Fn,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Fn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Fn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Fn,overlineThickness:Fn,paintOrder:null,panose1:null,path:null,pathLength:Fn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Fn,pointsAtY:Fn,pointsAtZ:Fn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Fn,specularExponent:Fn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Fn,strikethroughThickness:Fn,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Fn,strokeOpacity:Fn,strokeWidth:null,style:null,surfaceScale:Fn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:Fn,tableValues:null,target:null,targetX:Fn,targetY:Fn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Fn,underlineThickness:Fn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Fn,values:null,vAlphabetic:Fn,vMathematical:Fn,vectorEffect:null,vHanging:Fn,vIdeographic:Fn,version:null,vertAdvY:Fn,vertOriginX:Fn,vertOriginY:Fn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Fn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Qn=Sn([Bn,jn,Un,Vn,qn],"html"),Yn=Sn([Bn,jn,Un,Vn,Wn],"svg"),Kn=function(e){if(null==e)return Zn;if("string"==typeof e)return t=e,$n((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Kn(e[n]);return $n((function(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}))}(e):function(e){return $n((function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}))}(e);if("function"==typeof e)return $n(e);throw new Error("Expected function, string, or object as test")};function $n(e){return function(t,...n){return Boolean(t&&"object"==typeof t&&"type"in t&&Boolean(e.call(this,t,...n)))}}function Zn(){return!0}const Gn=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null);const o=Kn(t),l=r?-1:1;!function e(i,a,c){const u=i&&"object"==typeof i?i:{};if("string"==typeof u.type){const e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(s,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return s;function s(){let u,s,d,f=[];if((!t||o(i,a,c[c.length-1]||null))&&(f=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(i,c)),!1===f[0]))return f;if(i.children&&"skip"!==f[0])for(s=(r?i.children.length:-1)+l,d=c.concat(i);s>-1&&s<i.children.length;){if(u=e(i.children[s],s,d)(),!1===u[0])return u;s="number"==typeof u[1]?u[1]:s+l}return f}}(e,void 0,[])()}(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)};function Xn(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{Gn(t,"element",((t,n,r)=>{const o=r;let l;if(e.allowedElements?l=!e.allowedElements.includes(t.tagName):e.disallowedElements&&(l=e.disallowedElements.includes(t.tagName)),!l&&e.allowElement&&"number"==typeof n&&(l=!e.allowElement(t,n,o)),l&&"number"==typeof n)return e.unwrapDisallowed&&t.children?o.children.splice(n,1,...t.children):o.children.splice(n,1),n}))}}var Jn=n(143);function er(e){const t=e&&"object"==typeof e&&"text"===e.type?e.value||"":e;return"string"==typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}const tr=/^data[-\w.:]+$/i,nr=/-[a-z]/g,rr=/[A-Z]/g;function or(e){return"-"+e.toLowerCase()}function lr(e){return e.charAt(1).toUpperCase()}const ir={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ar=n(848),cr=["http","https","mailto","tel"];function ur(e){const t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;const r=t.indexOf(":");if(-1===r)return t;let o=-1;for(;++o<cr.length;){const e=cr[o];if(r===e.length&&t.slice(0,e.length).toLowerCase()===e)return t}return o=t.indexOf("?"),-1!==o&&r>o?t:(o=t.indexOf("#"),-1!==o&&r>o?t:"javascript:void(0)")}const sr={}.hasOwnProperty,dr=new Set(["table","thead","tbody","tfoot","tr"]);function fr(e,t){const n=[];let r,o=-1;for(;++o<t.children.length;)r=t.children[o],"element"===r.type?n.push(pr(e,r,o,t)):"text"===r.type?"element"===t.type&&dr.has(t.tagName)&&er(r)||n.push(r.value):"raw"!==r.type||e.options.skipHtml||n.push(r.value);return n}function pr(e,t,n,r){const l=e.options,i=void 0===l.transformLinkUri?ur:l.transformLinkUri,a=e.schema,c=t.tagName,u={};let s,d=a;if("html"===a.space&&"svg"===c&&(d=Yn,e.schema=d),t.properties)for(s in t.properties)sr.call(t.properties,s)&&hr(u,s,t.properties[s],e);"ol"!==c&&"ul"!==c||e.listDepth++;const f=fr(e,t);"ol"!==c&&"ul"!==c||e.listDepth--,e.schema=a;const p=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},m=l.components&&sr.call(l.components,c)?l.components[c]:c,h="string"==typeof m||m===o.Fragment;if(!Jn.isValidElementType(m))throw new TypeError(`Component for name \`${c}\` not defined or is not renderable`);if(u.key=n,"a"===c&&l.linkTarget&&(u.target="function"==typeof l.linkTarget?l.linkTarget(String(u.href||""),t.children,"string"==typeof u.title?u.title:null):l.linkTarget),"a"===c&&i&&(u.href=i(String(u.href||""),t.children,"string"==typeof u.title?u.title:null)),h||"code"!==c||"element"!==r.type||"pre"===r.tagName||(u.inline=!0),h||"h1"!==c&&"h2"!==c&&"h3"!==c&&"h4"!==c&&"h5"!==c&&"h6"!==c||(u.level=Number.parseInt(c.charAt(1),10)),"img"===c&&l.transformImageUri&&(u.src=l.transformImageUri(String(u.src||""),String(u.alt||""),"string"==typeof u.title?u.title:null)),!h&&"li"===c&&"element"===r.type){const e=function(e){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if("element"===n.type&&"input"===n.tagName)return n}return null}(t);u.checked=e&&e.properties?Boolean(e.properties.checked):null,u.index=mr(r,t),u.ordered="ol"===r.tagName}var g;return h||"ol"!==c&&"ul"!==c||(u.ordered="ol"===c,u.depth=e.listDepth),"td"!==c&&"th"!==c||(u.align&&(u.style||(u.style={}),u.style.textAlign=u.align,delete u.align),h||(u.isHeader="th"===c)),h||"tr"!==c||"element"!==r.type||(u.isHeader=Boolean("thead"===r.tagName)),l.sourcePos&&(u["data-sourcepos"]=[(g=p).start.line,":",g.start.column,"-",g.end.line,":",g.end.column].map(String).join("")),!h&&l.rawSourcePos&&(u.sourcePosition=t.position),!h&&l.includeElementIndex&&(u.index=mr(r,t),u.siblingCount=mr(r)),h||(u.node=t),f.length>0?o.createElement(m,u,f):o.createElement(m,u)}function mr(e,t){let n=-1,r=0;for(;++n<e.children.length&&e.children[n]!==t;)"element"===e.children[n].type&&r++;return r}function hr(e,t,n,r){const o=function(e,t){const n=xn(t);let r=t,o=Cn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&tr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(nr,lr);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!nr.test(e)){let n=e.replace(rr,or);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=_n}return new o(r,t)}(r.schema,t);let l=n;null!=l&&l==l&&(Array.isArray(l)&&(l=o.commaSeparated?function(e,t){const n={};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(l):l.join(" ").trim()),"style"===o.property&&"string"==typeof l&&(l=function(e){const t={};try{ar(e,(function(e,n){const r="-ms-"===e.slice(0,4)?`ms-${e.slice(4)}`:e;t[r.replace(/-([a-z])/g,gr)]=n}))}catch{}return t}(l)),o.space&&o.property?e[sr.call(ir,o.property)?ir[o.property]:o.property]=l:o.attribute&&(e[o.attribute]=l))}function gr(e,t){return t.toUpperCase()}const vr={}.hasOwnProperty,yr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",br={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function kr(e){for(const t in br)if(vr.call(br,t)&&vr.call(e,t)){const e=br[t];console.warn(`[react-markdown] Warning: please ${e.to?`use \`${e.to}\` instead of`:"remove"} \`${t}\` (see <${yr}#${e.id}> for more info)`),delete br[t]}const t=q().use(qt).use(e.remarkPlugins||[]).use(yn,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(Xn,e),n=new M;"string"==typeof e.children?n.value=e.children:void 0!==e.children&&null!==e.children&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if("root"!==r.type)throw new TypeError("Expected a `root` node");let l=o.createElement(o.Fragment,{},fr({options:e,schema:Qn,listDepth:0},r));return e.className&&(l=o.createElement("div",{className:e.className},l)),l}function Sr(e,t){var n=(0,o.useContext)(a);(0,o.useEffect)((function(){var r=[];return n&&Object.keys(n).length>0&&(t?t.forEach((function(t){r.push(n.subscribe(t,e))})):r=[n.subscribeToAllEvents((function(){return e()}))]),function(){n&&n.unsubscribe&&r.forEach((function(e){return n.unsubscribe(e)}))}}),[n])}kr.propTypes={children:bn.string,className:bn.string,allowElement:bn.func,allowedElements:bn.arrayOf(bn.string),disallowedElements:bn.arrayOf(bn.string),unwrapDisallowed:bn.bool,remarkPlugins:bn.arrayOf(bn.oneOfType([bn.object,bn.func,bn.arrayOf(bn.oneOfType([bn.bool,bn.string,bn.object,bn.func,bn.arrayOf(bn.any)]))])),rehypePlugins:bn.arrayOf(bn.oneOfType([bn.object,bn.func,bn.arrayOf(bn.oneOfType([bn.bool,bn.string,bn.object,bn.func,bn.arrayOf(bn.any)]))])),sourcePos:bn.bool,rawSourcePos:bn.bool,skipHtml:bn.bool,includeElementIndex:bn.bool,transformLinkUri:bn.oneOfType([bn.func,bn.bool]),linkTarget:bn.oneOfType([bn.func,bn.string]),transformImageUri:bn.func,components:bn.object};var xr=function(){return xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xr.apply(this,arguments)};function Cr(){var e=c(),t=e.context,n=e.eventController,r=function(){var e,n,r,o,l,i,a,c,u,s,d,f,p,m,h,g,v,y,b,k,S,x,C,E,w=t.currentPage||1,T=t.resultsPerPage||10,P={resultCount:(null===(n=null===(e=t.storedSearchResponseData)||void 0===e?void 0:e.cludoSearchResponse)||void 0===n?void 0:n.ResultCount)||0,resultCountMessage:(null===(o=null===(r=t.storedSearchResponseData)||void 0===r?void 0:r.cludoSearchResponse)||void 0===o?void 0:o.ResultCountMessage)||"",fixedQuery:(null===(i=null===(l=t.storedSearchResponseData)||void 0===l?void 0:l.cludoSearchResponse)||void 0===i?void 0:i.FixedQuery)||"",facets:null===(c=null===(a=t.storedSearchResponseData)||void 0===a?void 0:a.cludoSearchResponse)||void 0===c?void 0:c.Facets,didYouMean:(null===(s=null===(u=t.storedSearchResponseData)||void 0===u?void 0:u.cludoSearchResponse)||void 0===s?void 0:s.Suggestions[0])||""};return{suggestions:(null===(f=null===(d=t.storedSearchResponseData)||void 0===d?void 0:d.cludoSearchResponse)||void 0===f?void 0:f.Suggestions)||[],results:(null===(m=null===(p=t.storedSearchResponseData)||void 0===p?void 0:p.cludoSearchResponse)||void 0===m?void 0:m.TypedDocuments)||[],categorizedResults:(null===(g=null===(h=t.storedSearchResponseData)||void 0===h?void 0:h.cludoSearchResponse)||void 0===g?void 0:g.TopHits)||[],resultsSummary:P,paginationOptions:{itemsPerPage:t.resultsPerPage,currentPage:t.currentPage,maxPages:Math.ceil((null===(y=null===(v=t.storedSearchResponseData)||void 0===v?void 0:v.cludoSearchResponse)||void 0===y?void 0:y.ResultCount)/T)},endlessScrollOptions:xr({isEnabled:t.isEndlessScrollEnabled},t.endlessScroll),currentPage:w,banners:(null===(k=null===(b=t.storedSearchResponseData)||void 0===b?void 0:b.cludoSearchResponse)||void 0===k?void 0:k.Banners)||[],relatedSearches:(null===(x=null===(S=t.storedSearchResponseData)||void 0===S?void 0:S.cludoSearchResponse)||void 0===x?void 0:x.RelatedSearchDocuments)||[],resultCount:(null===(E=null===(C=t.storedSearchResponseData)||void 0===C?void 0:C.cludoSearchResponse)||void 0===E?void 0:E.ResultCount)||0,isLoading:t.isLoadingResults}},l=function(){var e,t,r,o,l;return{loadMore:(null===(e=null==n?void 0:n.endlessScrollLoadMore)||void 0===e?void 0:e.bind(n))||function(){},searchResultKeyUp:(null===(t=null==n?void 0:n.searchResultKeyUpEvent)||void 0===t?void 0:t.bind(n))||function(){},linkToSearchClickEvent:(null===(r=null==n?void 0:n.linkToSearchClickEvent)||void 0===r?void 0:r.bind(n))||function(){},handleDidYouMeanSelect:(null===(o=null==n?void 0:n.handleDidYouMeanSelect)||void 0===o?void 0:o.bind(n))||function(){},searchResultTrackClickEventHandler:(null===(l=null==n?void 0:n.searchResultTrackClickEventHandler)||void 0===l?void 0:l.bind(n))||function(){}}};Sr((function(){u(r()),f(l())}));var i=(0,o.useState)(r()),a=i[0],u=i[1],s=(0,o.useState)(l()),d=s[0],f=s[1];return[a,d]}var Er=function(){return Er=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Er.apply(this,arguments)},wr=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,l=t.length;o<l;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Tr(e){return e.Fields.Url.Value}function Pr(e,t){return-1!==e.FieldNames.indexOf(t)}function Fr(e,t,n,r){if(void 0===r&&(r=" "),Pr(e,t)){var o=e.Fields[t].Value;if(n&&n>0){var l=o.split(r);l.length>n&&(o=l.slice(0,n).join(r))}return o}}function Rr(e,t){if(Pr(e,t))return e.Fields[t].Values}function Nr(e,t,n,r,o){if(void 0===r&&(r=" "),void 0===o&&(o="..."),Pr(e,t))return Ar(e,t,n,r).join(o)}function Ar(e,t,n,r){var o,l,i;return void 0===r&&(r=" "),(null===(l=null===(o=e.Fields[t])||void 0===o?void 0:o.Highlights)||void 0===l?void 0:l.length)>0?function(e,t){var n=wr([],e,!0);if(t)for(var r=0,o=0;o<n.length;o++)if((r+=n[o].split(" ").length)>t)return n.splice(o),n;return n}(e.Fields[t].Highlights,n):[null!==(i=Fr(e,t,n,r))&&void 0!==i?i:""]}function Ir(e){return{__html:e}}function Or(e){console.error("No result provided to ".concat(e," component. ").concat(e," must receive a result through props or from a result context provider."))}function _r(e){return!!e&&e.hasAttribute("data-cludo-autocomplete")}function Lr(e,t){return{Field:e.Field,Values:e.Values.map((function(n){var r,o=t[e.Field],l=null===(r=null==o?void 0:o.Items)||void 0===r?void 0:r.find((function(e){return e.Key===n.Value})),i=l?l.Count:0;return Er(Er({},n),{AllCount:i})}))}}function Dr(e){var t,n=Cr()[0],r=(0,o.useState)([]),i=r[0],a=r[1],c=(0,o.useState)({}),u=c[0],s=c[1],d=n.results,f={da:"Læs mere",en:"Learn more"},p=null!==(t=e.referencesCTA||f[e.language])&&void 0!==t?t:f.en;(0,o.useEffect)((function(){var t=h(e.response),n=g(t);a(n);var r={};t.forEach((function(e){r[e.url]=v(e.url)})),s(r)}),[e.response]);var h=function(e){return Array.from(e.matchAll(/\[(\d+)\]\((https?:\/\/[^\s)]+)\)/g)).map((function(e){return{id:e[1],url:e[2]}}))},g=function(e){var t=e.reduce((function(e,t){return e[t.id]=t,e}),{});return Object.values(t).sort((function(e,t){return Number(e.id)-Number(t.id)}))},v=function(e){var t=d.find((function(t){return Fr(t,"Id")===e}));return t&&Fr(t,"Title")?Fr(t,"Title"):e},y=m("cludo-display-flex cludo-mt-4 cludo-mb-3 ",e.disableTheme),b=m("cludo-font-size-sm cludo-m-0 cludo-mr-3 cludo-mt-1",e.disableTheme),k=m("cludo-display-flex cludo-flex-wrap cludo-m-0 cludo-p-0 cludo-list-style-none",e.disableTheme),S=m("",e.disableTheme),x=m("cludo-display-block cludo-py-1 cludo-px-2 cludo-font-size-sm cludo-font-color-black cludo-text-decoration-none",e.disableTheme);return i.length>0?l().createElement("div",{className:"cludo-generative-ai-references "+y},l().createElement("p",{className:"cludo-generative-ai-references__cta "+b},p),l().createElement("ul",{className:"cludo-generative-ai-references__list "+k},i.map((function(e,t){return l().createElement("li",{key:t,className:"cludo-generative-ai-references__list-item "+S},l().createElement("a",{href:e.url,target:"_blank",className:"cludo-generative-ai-references__list-item-anchor "+x},e.id," | ",u[e.url]||e.url))})))):null}var Mr=function(){return Mr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Mr.apply(this,arguments)},jr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Br(e){var t=m("cludo-m-0 cludo-font-size-md",e.disableTheme),n=m("cludo-font-size-xs cludo-border-radius-button cludo-font-weight-bold cludo-font-color-black cludo-text-decoration-none",e.disableTheme),r=m("cludo-font-size-sm cludo-mt-2 cludo-color-neutral-n70",e.disableTheme);return l().createElement(l().Fragment,null,l().createElement(kr,{components:{p:function(e){e.node;var n=jr(e,["node"]);return l().createElement("p",Mr({className:"cludo-generative-ai__answer-text "+t},n))},a:function(e){e.node;var t=jr(e,["node"]);return l().createElement("a",Mr({className:"cludo-generative-ai__answer-citation "+n},t))}}},e.response),e.isLoading||e.isStreaming||!e.showReferences?null:l().createElement(Dr,{response:e.response,referencesCTA:e.referencesCTA,language:e.language}),e.isLoading||e.isStreaming||!e.disclaimer?null:l().createElement("span",{className:r},e.disclaimer))}var zr=function(e,t,n,r){return new(n||(n=Promise))((function(o,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function a(e){try{c(r.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},Hr=function(e,t){var n,r,o,l,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};function Ur(e){var t,n,r=this,a=(0,o.useContext)(i),f=e.language||a.translateProvider.language,p=e.header?"string"==typeof e.header?l().createElement("h2",{className:"cludo-generative-ai__header cludo-m-0 cludo-mb-3 cludo-font-size-lg cludo-font-weight-normal"},e.header):e.header:null,h=e.sourceFields&&e.sourceFields.length?e.sourceFields:["Title","Description"],g=e.sourceCount||3,v=(null===(n=null===(t=a.storedSearchResponseData)||void 0===t?void 0:t.cludoSearchResponse)||void 0===n?void 0:n.TypedDocuments)||[],y=v.slice(0,g).map((function(e){return{id:e.Fields.Id.Value,fields:h}})),x=(0,o.useState)(!1),C=x[0],E=x[1],w=(0,o.useState)(!1),T=w[0],P=w[1],F=function(){var e,t=this,n=c(),r=n.context,l=(n.eventController,void 0===(e=4)&&(e=3),r.customerId>=1e7?"https://api-us1.cludo.com/api/v".concat(e):"https://api-eu1.cludo.com/api/v".concat(e)),i="".concat(r.customerId,":").concat(r.engineId,":SearchKey"),a="".concat(l,"/").concat(r.customerId,"/").concat(r.engineId,"/search/summarize/stream"),f="".concat(l,"/").concat(r.customerId,"/").concat(r.engineId,"/search/summarize/feedback"),p=(0,o.useRef)(null),m=(0,o.useRef)(null),h=(0,o.useState)({isLoading:!1,isStreaming:!1,response:"",summaryId:""}),g=h[0],v=h[1],y={getResponse:function(e,n,r,o,l,c){return s(t,void 0,void 0,(function(){var t,s,f,h,g,y,b,k,S,x,C,E,w,T,P,F,R,N,A;return d(this,(function(I){switch(I.label){case 0:t=!0,m.current=n,p.current&&p.current.abort(),s=new AbortController,p.current=s,v((function(e){return u(u({},e),{isLoading:!0,isStreaming:t,response:""})})),f={query:e,queryId:n,sources:r,language:o,length:l,includeCitations:!0},I.label=1;case 1:return I.trys.push([1,11,,12]),[4,fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"SiteKey "+window.btoa(i)},body:JSON.stringify(f),signal:s.signal})];case 2:if(!(h=I.sent()).ok)throw new Error("HTTP error. status: ".concat(h.status));if(g=null!==(A=h.headers.get("Cludo-Summary-Id"))&&void 0!==A?A:"",v((function(e){return u(u({},e),{summaryId:g})})),y=new TextDecoder("utf-8"),!h.body)return[3,10];b=h.body.getReader(),I.label=3;case 3:return t?[4,b.read()]:[3,9];case 4:if(k=I.sent(),S=k.value,x=k.done,t=!x,!S)return[3,8];C=y.decode(S,{stream:!0}),E=C.match(/[\S]+|\s+/g)||[],w=function(e){return d(this,(function(t){switch(t.label){case 0:return m.current!==n?[2,{value:void 0}]:(v((function(t){var n;return u(u({},t),{isLoading:!1,isStreaming:!0,response:(null!==(n=t.response)&&void 0!==n?n:"")+e})})),[4,new Promise((function(e){return setTimeout(e,c||20)}))]);case 1:return t.sent(),[2]}}))},T=0,P=E,I.label=5;case 5:return T<P.length?(F=P[T],[5,w(F)]):[3,8];case 6:if("object"==typeof(R=I.sent()))return[2,R.value];I.label=7;case 7:return T++,[3,5];case 8:return[3,3];case 9:v((function(e){return u(u({},e),{isLoading:!1,isStreaming:t})})),I.label=10;case 10:return[3,12];case 11:return"AbortError"===(N=I.sent()).name?[2]:(console.log("error",N),v((function(e){return u(u({},e),{isLoading:!1,isStreaming:!1,response:""})})),[3,12]);case 12:return[2]}}))}))},sendFeedback:function(e){return s(t,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,fetch(f,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"SiteKey "+window.btoa(i)},body:JSON.stringify(e)})];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),console.log("Error sending feedback",t),[3,3];case 3:return[2]}}))}))}};return[g,y]}(),R=F[0],N=F[1];(0,o.useEffect)((function(){1!==a.currentPage&&T||(!0===a.storedSearchResponseData.cludoSearchResponse.GenerativeAnswerAvailable?(E(!0),N.getResponse(a.query,a.storedSearchResponseData.cludoSearchResponse.QueryId,y,f,e.length,e.streamAnimationDelay)):E(!1),P(!0))}),[v]),(0,o.useEffect)((function(){R.isLoading||R.isStreaming||R.response||E(!1)}),[R]);var A=m("cludo-bg-netral-n5 cludo-border-radius-card cludo-font-family-default cludo-mb-4 cludo-p-4",e.disableTheme,e.className),I=m("",e.disableTheme),O=m("cludo-display-flex cludo-justify-content-center cludo-column",e.disableTheme);return C&&l().createElement("div",{id:"cludo-generative-ai",className:"cludo-generative-ai cludo-rollout "+A},p||null,l().createElement("div",{className:"cludo-generative-ai__answer-container cludo-display-flex "+I},l().createElement(k,{chatIcon:e.chatIcon}),l().createElement("div",{className:"cludo-generative-ai__answer "+O},R.isLoading?l().createElement(S,{loadingElement:e.loadingElement}):R&&R.response&&l().createElement(l().Fragment,null,l().createElement(Br,{response:R.response,isLoading:R.isLoading,isStreaming:R.isStreaming,disclaimer:e.disclaimer,showReferences:e.showReferences,referencesCTA:e.referencesCTA,language:f,disableTheme:e.disableTheme})))),!R.isStreaming&&!R.isLoading&&e.allowFeedback&&l().createElement(b,{disableTheme:e.disableTheme,onSubmitFeedback:function(e){return zr(r,void 0,void 0,(function(){var t,n;return Hr(this,(function(r){return t=R.summaryId,n=function(e,t,n,r){return{rating:n.rating?n.rating:void 0,reason:n.selectedReason?n.selectedReason:void 0,comment:n.comment?n.comment:void 0,summaryId:e,sessionId:t,deviceType:r.deviceType,userAgent:navigator.userAgent,browserLanguage:window.navigator.language,screenResolution:screen.width+"x"+screen.height}}(t,a.sessionId,e,a),N.sendFeedback(n),[2]}))}))},feedbackCTA:e.feedbackCTA,feedbackPositiveIcon:e.feedbackPositiveIcon,feedbackNegativeIcon:e.feedbackNegativeIcon,feedbackFollowUpPrompt:e.feedbackFollowUpPrompt,feedbackFollowUpQuestions:e.feedbackFollowUpQuestions,feedbackCommentPrompt:e.feedbackCommentPrompt,feedbackCommentPromptPlaceholder:e.feedbackCommentPromptPlaceholder,feedbackSubmitButtonText:e.feedbackSubmitButtonText,feedbackThankYouMessage:e.feedbackThankYouMessage,feedbackThankYouMessageIcon:e.feedbackThankYouMessageIcon}))||l().createElement(l().Fragment,null)}var Vr=n(971);function qr(e,t){if(t.isFeatureEnabled(Vr.d.WebContentHighlighter)){var n=e.replace(/<[^>]+>/g,"");return"#:~:text="+encodeURIComponent(n)}return""}var Wr=l().createContext({});function Qr(e){var t=(0,o.useContext)(i),n=(0,o.useContext)(a),r=(0,o.useContext)(Kr),c=e.highlightQueryOnClickedPage?qr(t.query,t):"",u=(0,o.useState)(c),s=u[0],d=u[1],f=e.result||r;if(!f)return Or("ResultLink"),null;var p=f,m=e.className?e.className:"",h="PageContent"===Fr(f,"_type")?"Title":"fc_Title",g=e.linkField?Fr(f,e.linkField):p.Fields.Url.Value,v=g;s&&(v+=s);var y=(0,o.useRef)(null),b={onFragmentHover:function(e){var n=e?qr(e,t):"";d(n)},onFragmentSelect:function(){y.current&&y.current.click()}};return(0,o.useEffect)((function(){e.autofocus&&y.current&&y.current.focus()}),[]),l().createElement("a",{ref:y,href:v,"data-cludo-result":"searchresult","data-cludo-index":p.ResultIndex,"data-cludo-url":g,"data-cludo-title":Fr(f,h),"data-cludo-page":t.currentPage,className:m,target:e.openNewTab?"_blank":"",onKeyUp:function(e){return function(e,t){t.searchResultKeyUpEvent(e.nativeEvent)}(e,n)},onClick:function(e){return function(e,t,n){t.searchResultTrackClickEventHandler(e.nativeEvent,n)}(e,n,y.current)}},l().createElement(Wr.Provider,{value:b},e.children))}var Yr=function(){return Yr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Yr.apply(this,arguments)},Kr=l().createContext({});function $r(e){var t=(0,o.useContext)(i),n=1===e.result.ResultIndex&&1===t.currentPage&&t.focusOnResultsAfterSearch,r=m("cludo-theme-result-link",e.disableTheme,e.className);return l().createElement(Kr.Provider,{value:Yr({},e.result)},e.wrapWithLink||void 0===e.wrapWithLink?l().createElement(Qr,{openNewTab:e.openNewTab,highlightQueryOnClickedPage:e.highlightQueryOnClickedPage,result:e.result,autofocus:n,className:r},e.children):l().createElement("div",{className:e.className},e.children))}function Zr(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultTitle"),null;var r=m("cludo-theme-result-title ".concat(e.showRawText?"cludo-font-weight-bold":"cludo-font-weight-normal"),e.disableTheme,e.className),i=e.headingElement||"h3",a=Fr(n,"_type"),c=e.titleField||("PageContent"===a?"Title":"fc_Title"),u=e.showRawText?Fr(n,c):Nr(n,c);return u?l().createElement(i,{className:r,dangerouslySetInnerHTML:Ir(u)}):l().createElement(l().Fragment,null)}function Gr(e){var t=(0,o.useContext)(i),n=(0,o.useContext)(Wr),r=t.isFeatureEnabled(Vr.d.WebContentHighlighter)?"cludo-theme-fragment-highlight":"cludo-ellipsis-after";return l().createElement("span",{tabIndex:0,role:"link",className:r,onKeyDown:function(e){"Enter"===e.code&&n.onFragmentSelect()},onFocus:function(){return n.onFragmentHover(e.fragment)},onMouseEnter:function(){return n.onFragmentHover(e.fragment)},onMouseLeave:function(){return n.onFragmentHover()},dangerouslySetInnerHTML:Ir(e.fragment)})}function Xr(e){var t,n,r,o=(t=e.result,n=e.maxWords,r=e.fieldName,Ar(t,r||(Pr(t,"fc_Content")?"fc_Content":"Description"),n).map((function(e,t){return l().createElement(Gr,{key:t,fragment:e})})));return e.maxFragments&&e.maxFragments>0&&(o=o.slice(0,e.maxFragments)),l().createElement("p",{className:e.className},o)}function Jr(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultDescription"),null;var r=m("cludo-theme-result-description",e.disableTheme,e.className),i=e.descriptionField||(Pr(n,"fc_Content")?"fc_Content":"Description");if(e.makeHighlightsClickable)return l().createElement(Xr,{className:r,result:n,fieldName:i,maxWords:e.maxWordCount});var a=e.showRawText?Fr(n,i,e.maxWordCount):Nr(n,i,e.maxWordCount,void 0,e.highlightDelimiter);return a?l().createElement("p",{className:r,dangerouslySetInnerHTML:Ir(a)}):l().createElement(l().Fragment,null)}function eo(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultUrl"),null;var r=m("cludo-theme-result-url",e.disableTheme,e.className),i=Fr(n,"Url");if(e.showRelativeUrl&&i){var a=new URL(i);i=a.toString().substring(a.origin.length)}return i?l().createElement("div",{className:r},i):l().createElement(l().Fragment,null)}var to="Category";function no(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n&&!e.text)return Or("ResultBadge"),null;var r=m("cludo-theme-result-badge",e.disableTheme,e.className),i=e.text||Fr(n,e.field||to);return i?l().createElement("span",{className:r},i," "):null}var ro=["title","description","url","badge"];function oo(e){var t,n,r,o,i,a,c,u,s=(u=e.order||[]).concat(ro.filter((function(e){return-1===u.indexOf(e)})));s=s.filter((function(t){return!("title"===t&&e.hideTitle||"description"===t&&e.hideDescription||"url"===t&&e.hideUrl||"badge"===t&&e.hideBadge)}));var d=new Map([["title",l().createElement(Zr,{className:null===(t=e.classNames)||void 0===t?void 0:t.title,disableTheme:e.disableTheme})],["description",l().createElement(Jr,{className:null===(n=e.classNames)||void 0===n?void 0:n.description,disableTheme:e.disableTheme,maxWordCount:e.descriptionMaxWordCount||90,makeHighlightsClickable:e.makeHighlightsClickable})],["url",l().createElement(eo,{className:null===(r=e.classNames)||void 0===r?void 0:r.url,disableTheme:e.disableTheme})],["badge",l().createElement(no,{className:null===(o=e.classNames)||void 0===o?void 0:o.badge,disableTheme:e.disableTheme,field:e.badgeField||"Category"})]]);return l().createElement($r,{highlightQueryOnClickedPage:e.highlightQueryOnClickedPage,disableTheme:e.disableTheme,className:"".concat(null!==(i=e.className)&&void 0!==i?i:""," ").concat(null!==(c=null===(a=e.classNames)||void 0===a?void 0:a.root)&&void 0!==c?c:""),result:e.result},s.map((function(e,t){return l().createElement(l().Fragment,{key:t},d.get(e))})))}function lo(){var e=c(),t=e.context,n=e.eventController,r=t.storedSearchResponseData.cludoSearchResponse,l=function(){var e,n,o,l=t.resultsPerPage||10;return{itemsPerPage:t.resultsPerPage||10,currentPage:t.currentPage||1,maxPages:Math.ceil((null===(e=t.storedSearchResponseData)||void 0===e?void 0:e.cludoSearchResponse.ResultCount)/l),nextPageLabel:(null===(n=t.translateProvider)||void 0===n?void 0:n.translate("next_page"))||"Next page",prevPageLabel:(null===(o=t.translateProvider)||void 0===o?void 0:o.translate("prev_page"))||"Previous page",showPagination:!(r.ResultCount<t.resultsPerPage||t.isEndlessScrollEnabled),showResultsPerPage:!(t.storedSearchResponseData.cludoSearchResponse.ResultCount<=0||t.isEndlessScrollEnabled)}},i=function(){var e,t;return{goToPage:(null===(e=null==n?void 0:n.goToPage)||void 0===e?void 0:e.bind(n))||function(){},setPerPage:(null===(t=null==n?void 0:n.setPerPage)||void 0===t?void 0:t.bind(n))||function(){}}};Sr((function(){s(l()),p(i())}));var a=(0,o.useState)(l()),u=a[0],s=a[1],d=(0,o.useState)(i()),f=d[0],p=d[1];return[u,f]}function io(e){var t,n,r,a,c,u,s,d,f,p,h,g,v,y,b,k,S,x=lo(),C=x[0],E=x[1],w=Cr()[0],T=(0,o.useState)(C),P=T[0],F=T[1],R=(0,o.useContext)(i);(0,o.useEffect)((function(){R.isLoadingResults||F(C)}),[C]);var N=e.previousButtonIcon||"<",A=e.nextButtonIcon||">",I=e.firstButtonIcon||"<<",O=e.lastButtonIcon||">>",_=P.currentPage<=5?1:P.currentPage>=P.maxPages-2?P.maxPages-3:P.currentPage-2,L=P.prevPageLabel,D=P.nextPageLabel,M=m("cludo-theme-btn-accent-secondary cludo-width-sm cludo-mr-2 cludo-my-1",e.disableTheme),j=m("cludo-theme-btn-accent-secondary-inactive cludo-width-sm cludo-mr-2 cludo-my-1",e.disableTheme),B=m(" cludo-theme-loading-disable",e.disableTheme||!w.isLoading);return P.showPagination?l().createElement("nav",{className:"".concat(null!==(t=e.className)&&void 0!==t?t:""," ").concat(null!==(r=null===(n=e.classNames)||void 0===n?void 0:n.root)&&void 0!==r?r:""," ").concat(B)},l().createElement("ul",{className:"".concat(null!==(c=null===(a=e.classNames)||void 0===a?void 0:a.list)&&void 0!==c?c:""," cludo-display-flex cludo-list-style-none cludo-p-0 cludo-m-0 cludo-mt-3 cludo-flex-wrap")},1===P.currentPage||e.hideFirst?null:l().createElement("li",{className:null===(u=e.classNames)||void 0===u?void 0:u.listItem,key:"first"},l().createElement("button",{"data-page":"first",className:"".concat(null!==(d=null===(s=e.classNames)||void 0===s?void 0:s.paginationButton)&&void 0!==d?d:""," ").concat(M),"aria-label":"First page",onClick:function(){E.goToPage(1)}},I)),1===P.currentPage||e.hidePrevious?null:l().createElement("li",{className:null===(f=e.classNames)||void 0===f?void 0:f.listItem,key:"prev"},l().createElement("button",{"data-page":"prev",className:"".concat(null!==(h=null===(p=e.classNames)||void 0===p?void 0:p.paginationButton)&&void 0!==h?h:""," ").concat(M),"aria-label":L,onClick:function(){E.goToPage(P.currentPage-1)}},N)),function(t,n){for(var r,o,i,a,c,u,s=P.currentPage||1,d=[],f=R.translateProvider.translate("general_page"),p=function(t){t===s?d.push(l().createElement("li",{className:null===(r=e.classNames)||void 0===r?void 0:r.listItem,key:t},l().createElement("button",{"aria-label":"Current, "+f+" "+t,"aria-current":"true","aria-disabled":"true",className:"".concat(null!==(i=null===(o=e.classNames)||void 0===o?void 0:o.paginationButton)&&void 0!==i?i:""," ").concat(j)},t))):d.push(l().createElement("li",{className:null===(a=e.classNames)||void 0===a?void 0:a.listItem,key:t},l().createElement("button",{"aria-label":f+" "+t,className:"".concat(null!==(u=null===(c=e.classNames)||void 0===c?void 0:c.paginationButton)&&void 0!==u?u:""," ").concat(M),onClick:function(){E.goToPage(t)}},t)))},m=t;m<=n&&m<=t+4;m++)p(m);return d}(_,P.maxPages),P.currentPage<P.maxPages&&!e.hideNext?l().createElement("li",{className:null===(g=e.classNames)||void 0===g?void 0:g.listItem,key:"next"},l().createElement("button",{"data-page":"next",className:"".concat(null!==(y=null===(v=e.classNames)||void 0===v?void 0:v.paginationButton)&&void 0!==y?y:""," ").concat(M),"aria-label":D,onClick:function(){E.goToPage(P.currentPage+1)}},A)):null,P.currentPage<P.maxPages&&!e.hideLast?l().createElement("li",{className:null===(b=e.classNames)||void 0===b?void 0:b.listItem,key:"last"},l().createElement("button",{"data-page":"last",className:"".concat(null!==(S=null===(k=e.classNames)||void 0===k?void 0:k.paginationButton)&&void 0!==S?S:""," ").concat(M),"aria-label":"Last page",onClick:function(){E.goToPage(P.maxPages)}},O)):null)):null}function ao(e){var t=(0,o.useContext)(i),n=(0,o.useContext)(a),r=(0,o.useRef)(null);(0,o.useEffect)((function(){r.current&&function(e,t,n,r){var o=e.querySelectorAll("a"),l=n.paramsPrefix;o.forEach((function(e){!function(e,t){var n=String(t.Id),r=t.Name;e.setAttribute("data-cludo-result","banner"),e.setAttribute("data-cludo-index","1"),e.setAttribute("data-cludo-object-id",n),e.setAttribute("data-cludo-title",r)}(e,t),-1!==decodeURIComponent(e.href).indexOf("#?"+l)?e.addEventListener("click",(function(t){t.preventDefault(),r.linkToSearchClickEvent(e)})):e.addEventListener("click",(function(t){r.searchResultTrackClickEventHandler(t,e)}))}))}(r.current,e.banner,t,n)}),[]);var c=m("cludo-mb-4 cludo-overflow-auto cludo-border-radius-card cludo-p-4 cludo-bg-color-accent-primary-light",e.disableTheme,e.className),u=m("cludo-theme-loading-disable-children",e.disableTheme||!t.isLoadingResults);return l().createElement("div",{ref:r,"data-cludo-result":"banner","data-cludo-id":e.banner.Id,"data-cludo-title":e.banner.Name,className:"cludo-banner ".concat(c," ").concat(u),role:"banner",dangerouslySetInnerHTML:Ir(e.banner.Banner)})}function co(){var e=c().context,t=function(){var t;return{banners:(null===(t=e.storedSearchResponseData)||void 0===t?void 0:t.cludoSearchResponse.Banners)||[]}};Sr((function(){return l(t())}));var n=(0,o.useState)(t()),r=n[0],l=n[1];return[r]}function uo(e){var t=co()[0],n=(e.banners||t.banners).map((function(t){return l().createElement(ao,{key:t.Id,banner:t,className:e.className})}));return n.length?l().createElement("div",{className:"cludo-banner-group"},n):l().createElement(l().Fragment,null)}function so(e){var t=Cr(),n=t[0],r=(t[1],(0,o.useContext)(i)),c=(0,o.useContext)(a),u=n.resultCount&&n.resultCount<10?n.resultsSummary.didYouMean:"",s=e.suggestedQuery||u,d=r.translateProvider.translate("did_you_mean",s),f=m("cludo-font-family-default cludo-font-size-md cludo-mb-2",e.disableTheme,e.className),p=m(" cludo-theme-loading-disable",e.disableTheme||!n.isLoading);return l().createElement("div",{className:f+p+" cludo-did-you-mean",onClick:function(e){return function(e,t,n){var r=e.target;r instanceof HTMLElement&&r.closest(".cludo-did-you-mean > a")&&(e.preventDefault(),n.handleDidYouMeanSelect(t))}(e,s,c)},dangerouslySetInnerHTML:s?Ir(d):{__html:""}})}function fo(e){var t=Cr(),n=t[0],r=(t[1],(0,o.useState)("")),a=r[0],c=r[1],u=(0,o.useContext)(i),s=e.resultCount||n.resultCount,d=u.storedSearchResponseData.cludoSearchResponse.Query;(0,o.useEffect)((function(){if(!u.isLoadingResults&&d){var e=u.translateProvider.translate("your_search_on",d),t=1===s?u.translateProvider.translate("total_result",s.toString()):u.translateProvider.translate("total_results",s.toString()),n=e+(e.length&&t.length?" ":"")+t;c(n)}}),[n]);var f=m("cludo-font-family-default cludo-font-size-md cludo-mb-2",e.disableTheme,e.className),p=m(" cludo-theme-loading-disable",e.disableTheme||!u.isLoadingResults);return a.length?l().createElement("span",{className:f+p,role:"status",dangerouslySetInnerHTML:{__html:a}}):null}var po=function(){return po=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},po.apply(this,arguments)};function mo(e){return l().createElement(l().Fragment,null,l().createElement(fo,po({},e)),l().createElement(so,{suggestedQuery:e.suggestedQuery}))}function ho(e){var t=(0,o.useContext)(i).translateProvider.translate("loading_results");return l().createElement(l().Fragment,null,e.isLoading?l().createElement("img",{src:"https://customer.cludo.com/img/loading.gif",className:"loading",tabIndex:-1,alt:t}):l().createElement(l().Fragment,null))}function go(e){return l().createElement("div",{className:"cludo-loader ".concat(e.className)},l().createElement("div",null),l().createElement("div",null),l().createElement("div",null),l().createElement("div",null))}function vo(e){var t,n,r,a,c=Cr(),u=c[0],s=(c[1],co()[0]),d=(0,o.useContext)(i),f=e.template||function(t){return l().createElement(oo,{disableTheme:e.disableTheme,result:t})},p=e.results||u.results,h=e.columns||1,g=e.resultSpacing||0,v=e.cssUnit||"px",y=(0,o.useState)([]),b=y[0],k=y[1],S=(0,o.useState)([]),x=S[0],C=S[1];(0,o.useEffect)((function(){d.isLoadingResults||k(p)}),[u]),(0,o.useEffect)((function(){d.isLoadingResults||C(s.banners)}),[s]);var E,w=m("cludo-position-relative",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),T=m("",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.banner),P=m("cludo-theme-results-list",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.resultsListContainer)+" cludo_results-list cludo-box-sizing cludo-display-flex cludo-flex-wrap cludo-list-style-none cludo-p-0",F=m("",e.disableTheme,null===(a=null==e?void 0:e.classNames)||void 0===a?void 0:a.resultsListItem)+" cludo_result cludo-border-box cludo-col-in-grid-"+h,R=m(" cludo-theme-loading-disable",e.disableTheme||!d.isLoadingResults);return l().createElement(l().Fragment,null,e.hideBanners?l().createElement(l().Fragment,null):x.map((function(e,t){return l().createElement(ao,{key:"banner-"+t,className:T,banner:e})})),l().createElement("div",{className:w},b.length>0&&l().createElement("ul",{className:P},l().createElement("style",null,(E="",e.columnsBreakpoint&&(E+="\n @media (max-width: ".concat(e.columnsBreakpoint).concat(v,") {\n .cludo_result { width: 100% !important }\n }\n ")),E+="\n .cludo_results-list { margin: -".concat(g/2).concat(v," }\n .cludo_result { padding: ").concat(g/2).concat(v," }\n "))),b.map((function(e,t){return l().createElement("li",{className:F+R,key:"result-"+t},f(e))}))),!e.disableTheme&&u.isLoading?l().createElement("div",{className:"cludo-my-5 cludo-position-absolute cludo-top-0 cludo-absolute-center"},l().createElement(go,null)):l().createElement(l().Fragment,null)))}function yo(e){var t,n,r,a,c,u=(0,o.useContext)(i),s=e.label||u.translateProvider.translate("load_more");return l().createElement("div",{className:"".concat(null!==(n=null===(t=e.classNames)||void 0===t?void 0:t.root)&&void 0!==n?n:""," ").concat(null!==(r=e.className)&&void 0!==r?r:""),id:"cludo-load-more"},l().createElement("button",{className:null!==(c=null===(a=e.classNames)||void 0===a?void 0:a.loadMoreButton)&&void 0!==c?c:"",type:"button",onClick:e.onClick},s))}function bo(e){var t,n,r,a,c=Cr(),u=c[0],s=c[1],d=lo(),f=d[0],p=(d[1],(0,o.useContext)(i)),h=e.label||p.translateProvider.translate("load_more"),g=u.endlessScrollOptions.isEnabled&&(null===(t=u.endlessScrollOptions)||void 0===t?void 0:t.stopAfterPage)&&(null===(n=u.endlessScrollOptions)||void 0===n?void 0:n.stopAfterPage)<=f.currentPage&&f.currentPage!==f.maxPages&&!u.isLoading,v={root:m("",e.disableTheme,e.className,null===(r=e.classNames)||void 0===r?void 0:r.root),loadMoreButton:m("cludo-theme-btn-accent-secondary cludo-font-size-sm cludo-font-weight-bold cludo-width-100 cludo-mt-3",e.disableTheme,null===(a=e.classNames)||void 0===a?void 0:a.loadMoreButton)};return g?l().createElement(yo,{classNames:v,label:h,onClick:s.loadMore}):null}var ko,So=function(){return So=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},So.apply(this,arguments)},xo=Co({});function Co(e){var t=e.result||oo,n=e.list||vo,r=e.loader||ho,o=e.pagination||io;return function(){var e=Cr(),i=e[0],a=(e[1],i.suggestions[0]?i.suggestions[0]:"");return l().createElement(l().Fragment,null,l().createElement(mo,So({},i.resultsSummary,{suggestedQuery:a})),l().createElement(uo,null),l().createElement(n,{template:function(e){return l().createElement(t,{result:e})}}),l().createElement(r,{isLoading:i.isLoading}),l().createElement(o,null),l().createElement(bo,null))}}function Eo(e){return l().createElement(l().Fragment,null,e.chunkedText.map((function(e,t){return"highlight"===e.displayType?l().createElement("strong",{role:"presentation none",key:t},e.text):l().createElement("span",{role:"presentation none",key:t},e.text)})))}function wo(e){var t,n=(0,o.useContext)(a),r="cludo-result-item-".concat(e.resultIndex),i=m("cludo-p-2 cludo-font-family-default cludo-border-b-1-neutral cludo-border-b-solid cludo-border-radius-button cludo-cursor-pointer cludo-bg-hover-gray-light ".concat(e.isSelected?"cludo-bg-color-gray-light":"cludo-bg-color-white"),e.disableTheme,e.className)+(e.isSelected?" active":""),c=null!==(t=e.children)&&void 0!==t?t:l().createElement(Eo,{chunkedText:e.result.chunkedTitle}),u=e.resultType||ko.Result;return(0,o.useEffect)((function(){e.isSelected&&n.setActiveDescendantToSuggestions(r)}),[e.isSelected]),l().createElement("li",{id:r,tabIndex:0,"aria-selected":e.isSelected?"true":void 0,role:"option",className:i,"data-cludo-autocomplete":u,"data-cludo-autocomplete-index":e.resultIndex,onClick:function(){return n.selectResult(e.result.document)}},l().createElement(Qr,{result:e.result.document},c))}function To(e){var t=(0,o.useContext)(a),n="cludo-suggestion-item-".concat(e.suggestionIndex),r=m("cludo-p-2 cludo-font-family-default cludo-border-b-1-neutral cludo-border-b-solid cludo-border-radius-button cludo-cursor-pointer cludo-bg-hover-gray-light ".concat(e.isSelected?"cludo-bg-color-gray-light":"cludo-bg-color-white"),e.disableTheme,e.className)+(e.isSelected?" active":"");return(0,o.useEffect)((function(){e.isSelected&&t.setActiveDescendantToSuggestions(n)}),[e.isSelected]),l().createElement("li",{id:n,tabIndex:0,"aria-selected":e.isSelected?"true":void 0,role:"option",className:r,"data-cludo-autocomplete":ko.Suggestion,"data-cludo-autocomplete-index":e.suggestionIndex,onClick:function(){return t.selectSuggestion(e.suggestion.title,e.suggestionIndex)}},l().createElement(Eo,{chunkedText:e.suggestion.chunkedTitle}))}function Po(e){var t=(0,o.useContext)(a),n="cludo-recent-search-item-".concat(e.recentSearchIndex),r=m("cludo-p-2 cludo-font-family-default cludo-border-b-1-neutral cludo-border-b-solid cludo-border-radius-button cludo-cursor-pointer cludo-bg-hover-gray-light ".concat(e.isSelected?"cludo-bg-color-gray-light":"cludo-bg-color-white"),e.disableTheme,e.className)+(e.isSelected?" active":"");return(0,o.useEffect)((function(){e.isSelected&&t.setActiveDescendantToSuggestions(n)}),[e.isSelected]),l().createElement("li",{id:n,tabIndex:0,"aria-selected":e.isSelected?"true":void 0,role:"option",className:r,"data-cludo-autocomplete":ko.RecentSearch,"data-cludo-autocomplete-index":e.recentSearchIndex,onClick:function(){return t.selectSuggestion(e.recentSearch.title,e.recentSearchIndex)}},l().createElement(Eo,{chunkedText:e.recentSearch.chunkedTitle}))}function Fo(){return!("undefined"==typeof window||"undefined"==typeof document)}!function(e){e.Result="result",e.CategorizedResult="categorized-result",e.Suggestion="suggestion",e.RecentSearch="recent-search"}(ko||(ko={}));var Ro=function(){return Ro=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ro.apply(this,arguments)};function No(){var e,t,n,r,l,i=c(),a=i.context,u=i.eventController,s=(0,o.useRef)(-1),d=function(e){var t,n,r,o,l,i;if(Fo()){var c,d,f,p=(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.suggestions)||[],g=(null===(n=a.storedAutocompleteResponse)||void 0===n?void 0:n.data.instantSuggestions)||[],v=(null===(r=a.storedAutocompleteResponse)||void 0===r?void 0:r.data.results)||[],y=(null===(o=a.storedAutocompleteResponse)||void 0===o?void 0:o.data.recentSearches)||[],b=function(e){var t=[];return e.forEach((function(e){e.Values.forEach((function(e){t=t.concat(e.Hits)}))})),t}((null===(l=a.storedAutocompleteResponse)||void 0===l?void 0:l.data.categorizedResults)||[]),k=document.querySelectorAll("[data-cludo-autocomplete]");c=d=f=-1;var S=s.current,x=k.length;if("Enter"===e&&-1===S)u.search();else if(k&&k.length>0&&("ArrowKeyUp"===e&&(S=(((S=-1===S?0:S)-1)%x+x)%x),"ArrowKeyDown"===e&&(S=((S+1)%x+x)%x),k[S]))switch(k[S].getAttribute("data-cludo-autocomplete")){case"suggestion":var C=null!==(i=p[c=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))])&&void 0!==i?i:g[c];"Enter"===e&&u.selectSuggestion(C.title,c);break;case"result":var E=v[d=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))];"Enter"===e&&u.selectResult(E.document);break;case"categorized-result":var w=b[d=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))];"Enter"===e&&u.selectResult(w.document);break;case"recent-search":var T=y[f=parseInt(k[S].getAttribute("data-cludo-autocomplete-index"))];"Enter"===e&&u.selectRecentSearch(T.title,f)}s.current=S;var P=Ro(Ro({},h()),{selectedSuggestion:c,selectedResult:d,selectedRecentSearch:f});m(P)}};(0,o.useEffect)((function(){var e=Object.keys(u).length>0,t=e?u.subscribe("autocompleteSelectionNext",(function(){d("ArrowKeyDown")})):-1,n=e?u.subscribe("autocompleteSelectionPrev",(function(){d("ArrowKeyUp")})):-1,r=e?u.subscribe("autocompleteSetSelection",(function(){d("Enter")})):-1,o=e?u.subscribe("afterautocomplete",(function(){!function(){var e,t;s.current=-1;var n=Ro(Ro({},h()),{suggestions:(null===(e=a.storedAutocompleteResponse)||void 0===e?void 0:e.data.suggestions)||[],results:(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.results)||[],selectedSuggestion:-1,selectedResult:-1,selectedRecentSearch:-1});m(n)}()})):-1;return function(){e&&(u.unsubscribe(t),u.unsubscribe(n),u.unsubscribe(r),u.unsubscribe(o))}}));var f=(0,o.useState)({suggestions:[],instantSuggestions:(null===(e=a.storedAutocompleteResponse)||void 0===e?void 0:e.data.instantSuggestions)||[],results:[],recentSearches:(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.recentSearches)||[],categorizedResults:[],selectedSuggestion:-1,selectedResult:-1,selectedRecentSearch:-1,suggestionsTitle:(null===(n=a.translateProvider)||void 0===n?void 0:n.translate("template_suggestions"))||"",resultsTitle:(null===(r=a.translateProvider)||void 0===r?void 0:r.translate("template_search_results"))||"",recentSearchesTitle:(null===(l=a.translateProvider)||void 0===l?void 0:l.translate("recent_searches_title"))||""}),p=f[0],m=f[1],h=function(){var e,t,n,r,o,l,i,c;return Ro(Ro({},p),{suggestions:(null===(e=a.storedAutocompleteResponse)||void 0===e?void 0:e.data.suggestions)||[],instantSuggestions:(null===(t=a.storedAutocompleteResponse)||void 0===t?void 0:t.data.instantSuggestions)||[],results:(null===(n=a.storedAutocompleteResponse)||void 0===n?void 0:n.data.results)||[],recentSearches:(null===(r=a.storedAutocompleteResponse)||void 0===r?void 0:r.data.recentSearches)||[],categorizedResults:(null===(o=a.storedAutocompleteResponse)||void 0===o?void 0:o.data.categorizedResults)||[],suggestionsTitle:(null===(l=a.translateProvider)||void 0===l?void 0:l.translate("template_suggestions"))||"",resultsTitle:(null===(i=a.translateProvider)||void 0===i?void 0:i.translate("template_search_results"))||"",recentSearchesTitle:(null===(c=a.translateProvider)||void 0===c?void 0:c.translate("recent_searches_title"))||""})};return[p,{initiateAutocompleteRequest:function(e){return u.initiateAutocompleteRequest(e)},autocompleteSelectionNext:function(){u.emitEvent("autocompleteSelectionNext",{})},autocompleteSelectionPrev:function(){u.emitEvent("autocompleteSelectionPrev",{})},autocompleteSelect:function(){-1!==p.selectedSuggestion&&u.selectSuggestion(p.suggestions[p.selectedSuggestion].title,p.selectedSuggestion),-1!==p.selectedResult&&u.selectResult(p.results[p.selectedResult].document),-1!==p.selectedRecentSearch&&u.selectRecentSearch(p.recentSearches[p.selectedRecentSearch].title,p.selectedRecentSearch)},clear:function(){u.clearAutocomplete()}}]}var Ao=function(e,t){switch(e.key){case"ArrowDown":e.preventDefault(),t.autocompleteSelectionNext();break;case"ArrowUp":e.preventDefault(),t.autocompleteSelectionPrev();break;case"Enter":e.preventDefault(),t.autocompleteSelect()}},Io=function(e,t){_r(e.relatedTarget)||t.clear()},Oo=function(e,t){t.initiateAutocompleteRequest(e.target.value)};function _o(){var e=No()[0],t=e.suggestions,n=e.results,r=e.recentSearches,o=e.selectedSuggestion,i=e.selectedResult,a=e.selectedRecentSearch,c=e.suggestionsTitle,u=e.resultsTitle,s=e.recentSearchesTitle;return l().createElement(l().Fragment,null,t.length?l().createElement(l().Fragment,null,l().createElement("h3",null,c),l().createElement("div",{className:"section-divider"}),l().createElement("ul",{className:"cludo-search-autocomplete-suggestions"},t.map((function(e,t){var n=t===o;return l().createElement(To,{key:t,suggestion:e,isSelected:n,suggestionIndex:t})})))):null,n.length?l().createElement(l().Fragment,null,l().createElement("h3",null,u),l().createElement("ul",{className:"cludo-search-autocomplete-results"},n.map((function(e,t){var n=t===i;return l().createElement(wo,{key:t,result:e,isSelected:n,resultIndex:t})})))):null,r.length?l().createElement(l().Fragment,null,l().createElement("h3",null,s),l().createElement("div",{className:"section-divider"}),l().createElement("ul",{className:"cludo-search-autocomplete-recent-searches"},r.map((function(e,t){var n=t===a;return l().createElement(Po,{key:t,recentSearch:e,isSelected:n,recentSearchIndex:t})})))):null)}var Lo=function(){return Lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lo.apply(this,arguments)},Do=function(){function e(e){this._cludoSearch=e}return Object.defineProperty(e.prototype,"params",{get:function(){return this._cludoSearch.params},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"customerId",{get:function(){return this._cludoSearch.customerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"engineId",{get:function(){return this._cludoSearch.engineId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._cludoSearch.params.query},set:function(e){this._cludoSearch.params.query=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentPage",{get:function(){return this._cludoSearch.params.page},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resultsPerPage",{get:function(){return this._cludoSearch.params.perPage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sort",{get:function(){return this._cludoSearch.params.sort},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortItems",{get:function(){return this._cludoSearch.clientTemplateSortOptions||[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"experienceConfigs",{get:function(){return this._cludoSearch.websiteSettings.configurations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateProvider",{get:function(){return this._cludoSearch.translateProvider},enumerable:!1,configurable:!0}),e.prototype.isFacetSelected=function(e,t){return this.params.facets[e]&&-1!==this.params.facets[e].indexOf(t)},e.prototype.isFilterSelected=function(e,t){return this.params.filters[e]&&-1!==this.params.filters[e].indexOf(t)},e.prototype.getSelectedMapItem=function(e){var t={};for(var n in e)e[n].length&&(t[n]=e[n]);return t},Object.defineProperty(e.prototype,"selectedFacets",{get:function(){return this.getSelectedMapItem(this.params.facets)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedFilters",{get:function(){return this.getSelectedMapItem(this.params.filters)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"facets",{get:function(){var e=this,t=this.storedSearchResponseData.cludoSearchResponse.Facets,n=Object.keys(this._cludoSearch.facets);return Object.entries(t).filter((function(e){var t=e[0];return e[1],n.includes(t)})).map((function(t){var n=t[0],r=t[1];return{key:n,hasSelection:!!e.params.facets[n]&&e.params.facets[n].length>0,values:r.Items.map((function(t){return{facetName:n,count:t.Count,value:t.Key,isSelected:e.isFacetSelected(n,t.Key)}})),allCount:r.AllCount,missingCount:r.MissingCount}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLoadingResults",{get:function(){return this._cludoSearch.isLoadingResults},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enabledFeatures",{get:function(){return this._cludoSearch.enabledFeatures},enumerable:!1,configurable:!0}),e.prototype.isFeatureEnabled=function(e){return this._cludoSearch.enabledFeatures.includes(e)},Object.defineProperty(e.prototype,"endlessScroll",{get:function(){return this._cludoSearch.endlessScroll||null},set:function(e){this._cludoSearch.endlessScroll=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEndlessScrollEnabled",{get:function(){return!!this._cludoSearch.endlessScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAutocompleteEnabled",{get:function(){return this._cludoSearch.richAutocomplete},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paramsPrefix",{get:function(){return this._cludoSearch.paramsPrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkFragment",{set:function(e){this._cludoSearch.linkFragment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storedSearchResponseData",{get:function(){var e=this;return{cludoSearchResponse:Lo(Lo({},this._cludoSearch.storedSearchResponseData),{TopHits:this._cludoSearch.storedSearchResponseData.TopHits.map((function(t){return Lr(t,e._cludoSearch.storedSearchResponseData.Facets)}))})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"focusOnResultsAfterSearch",{get:function(){return this._cludoSearch.focusOnResultsAfterSearch},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"customEngineSettings",{get:function(){var e,t=this,n={};try{n=null!==(e=JSON.parse(this._cludoSearch.websiteSettings.customEngineSettings))&&void 0!==e?e:n}catch(e){}return this._cludoSearch.websiteSettings.configurations?(Object.keys(this._cludoSearch.websiteSettings.configurations).forEach((function(e){n[e]=t._cludoSearch.websiteSettings.configurations[e]})),n):n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instantSuggestionsConfiguration",{get:function(){return this._cludoSearch.websiteSettings.instantSuggestionsConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recentSearches",{get:function(){return this._cludoSearch.recentSearches},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storedError",{get:function(){return this._cludoSearch.storedError},enumerable:!1,configurable:!0}),e.prototype.chunkString=function(e,t){var n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?[{text:e,displayType:"default"}]:[{text:e.substring(0,n),displayType:"default"},{text:e.substring(n,n+t.length),displayType:"highlight"},{text:e.substring(n+t.length),displayType:"default"}]},e.prototype.mapTypedDocumentToResult=function(e,t){var n,r=null!==(n=Fr(e,"Title"))&&void 0!==n?n:"";return{title:r,chunkedTitle:this.chunkString(r,t),document:e}},e.prototype.mapTypedDocumentToSuggestion=function(e,t){var n,r=null!==(n=Fr(e,"Title"))&&void 0!==n?n:"";return{title:r,chunkedTitle:this.chunkString(r,t)}},e.prototype.mapStringToSuggestion=function(e){return{title:e,chunkedTitle:this.chunkString(e,"")}},e.prototype.mapTopHitsToCategorizedResults=function(e,t){var n=this;return{Field:e.Field,Values:e.Values.map((function(e){return n.mapHitValuesToResults(e,t)}))}},e.prototype.mapHitValuesToResults=function(e,t){var n=this;return{Value:e.Value,Hits:e.Hits.map((function(e){return n.mapTypedDocumentToResult(e,t)}))}},Object.defineProperty(e.prototype,"storedAutocompleteResponse",{get:function(){var e,t,n,r,o,l=this,i=this._cludoSearch.storedAutocompleteResponse;return{data:{query:i.cludoAutocompleteResponse.query,facets:i.cludoAutocompleteResponse.facets,totalResults:i.cludoAutocompleteResponse.totalResults,totalSuggestions:i.cludoAutocompleteResponse.totalSuggestions,totalRecentSearches:i.cludoAutocompleteResponse.totalRecentSearches,results:null===(e=i.cludoAutocompleteResponse.results)||void 0===e?void 0:e.map((function(e){return l.mapTypedDocumentToResult(e,i.cludoAutocompleteResponse.query)})),suggestions:null===(t=i.cludoAutocompleteResponse.suggestions)||void 0===t?void 0:t.map((function(e){return l.mapTypedDocumentToSuggestion(e,i.cludoAutocompleteResponse.query)})),instantSuggestions:null===(n=i.cludoAutocompleteResponse.instantSuggestions)||void 0===n?void 0:n.map((function(e){return l.mapTypedDocumentToSuggestion(e,i.cludoAutocompleteResponse.query)})),recentSearches:null===(r=i.cludoAutocompleteResponse.recentSearches)||void 0===r?void 0:r.map((function(e){return l.mapStringToSuggestion(e)})),categorizedResults:null===(o=i.cludoAutocompleteResponse.topHits)||void 0===o?void 0:o.map((function(e){return Lr(l.mapTopHitsToCategorizedResults(e,i.cludoAutocompleteResponse.query),i.cludoAutocompleteResponse.facets)}))},isLoading:i.isLoading}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTrackedSession",{get:function(){return 0!==this._cludoSearch.isTrackedSession},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canUserBeTracked",{set:function(e){this._cludoSearch.canUserBeTracked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"queryId",{get:function(){return this._cludoSearch.queryId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._cludoSearch.getSessionId()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"querySessionId",{get:function(){return this._cludoSearch.querySessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceType",{get:function(){return this._cludoSearch.deviceType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"traits",{get:function(){return this._cludoSearch.getTraitsFromStorage()||[]},enumerable:!1,configurable:!0}),e}();const Mo=require("react-dom");var jo,Bo=n.n(Mo),zo=function(){function e(e,t){var n=this;this.keyedSubscriptions=[],this._curSubscriptionIndex=1,this.setDateRangeFacet=function(e,t,r){return n.setRangeFacetMap("date",e,t,r)},this.setNumberRangeFacet=function(e,t,r){return n.setRangeFacetMap("range",e,t,r)},this.clearDateRangeFacet=function(){n.clearRangeFacetMap("date")},this.clearNumberRangeFacet=function(){n.clearRangeFacetMap("range")},this._cludoSearch=e,this._searchContext=t}return e.prototype.subscribe=function(e,t){var n=this._curSubscriptionIndex++;return this.keyedSubscriptions.push({id:n,type:e,fnc:t}),n},e.prototype.subscribeToAllEvents=function(e){var t=this,n=this._curSubscriptionIndex++;return["afterautocomplete","aftersearch","autocompleteSelectionNext","autocompleteSelectionPrev","autocompleteSetSelection","beforeredirect","beforesearch","error"].forEach((function(r){t.keyedSubscriptions.push({id:n,type:r,fnc:e})})),n},e.prototype.unsubscribe=function(e){this.keyedSubscriptions=this.keyedSubscriptions.filter((function(t){return t.id!==e}))},e.prototype.emitEvent=function(e,t){this.executeCallbacksForType(e,t)},e.prototype.executeCallbacksForType=function(e,t){this.subscribersForType(e).forEach((function(e){e.fnc(t)}))},e.prototype.subscribersForType=function(e){return this.keyedSubscriptions.filter((function(t){return t.type===e}))},e.prototype.search=function(e){e&&(this._cludoSearch.params.query=e),this._cludoSearch._handleQuickLinks()||this._cludoSearch.search()},e.prototype.clearResults=function(){this._cludoSearch.clearStoredSearchResponseData()},Object.defineProperty(e.prototype,"searchResultKeyUpEvent",{get:function(){return this._cludoSearch.searchResultKeyUpEvent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchResultTrackClickEventHandler",{get:function(){return this._cludoSearch.searchResultTrackClickEventHandler},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkToSearchClickEvent",{get:function(){return this._cludoSearch.linkToSearchClickEvent},enumerable:!1,configurable:!0}),e.prototype.selectFacet=function(e,t,n){void 0===n&&(n=!1),this._cludoSearch.facet(e,t,n)},e.prototype.deselectFacet=function(e,t){this._cludoSearch.clearFacet(e,t)},e.prototype.clearFacet=function(e){this._cludoSearch.clearFacetByName(e)},e.prototype.clearAllFacets=function(){this._cludoSearch.clearAllFacetsAndSearch()},e.prototype.softClearAllFacets=function(){this._cludoSearch.clearAllFacets()},e.prototype.setRangeFacetMap=function(e,t,n,r){this._cludoSearch.params.facets[e]=[t,n.toString(),r.toString()]},e.prototype.clearRangeFacetMap=function(e){this._cludoSearch.clearFacetByName(e)},e.prototype.setFilter=function(e,t){this._cludoSearch.filter(e,t)},e.prototype.setFilters=function(e){this._cludoSearch.params.filters=e},e.prototype.clearAllFilters=function(){this._cludoSearch.clearAllFilters()},e.prototype.toggleFacetValue=function(e,t){this._searchContext.isFacetSelected(e,t)?this.deselectFacet(e,t):this.selectFacet(e,t)},Object.defineProperty(e.prototype,"didYouMean",{set:function(e){this._cludoSearch.didYouMean=e},enumerable:!1,configurable:!0}),e.prototype.handleDidYouMeanSelect=function(e){this.didYouMean=e,this._cludoSearch.setDidYouMean()},e.prototype.goToPage=function(e){this._cludoSearch.page(e,!0)},e.prototype.setPerPage=function(e){this._cludoSearch.params.perPage=e,this._cludoSearch.page(1)},e.prototype.clearSortOrder=function(){this._cludoSearch.clearSortOrder()},e.prototype.clearSortParams=function(){this._cludoSearch.clearSortParams()},e.prototype.addToSortOrder=function(e,t){this._cludoSearch.setSortOrder(e,t)},e.prototype.setSortOrder=function(e,t){this.clearSortParams(),this.addToSortOrder(e,t)},e.prototype.initiateAutocompleteRequest=function(e){this._cludoSearch.autocompleteByQuery(e)},e.prototype.selectSuggestion=function(e,t){this._cludoSearch.autocompleteSetSelectedSuggestion(e,t)},e.prototype.selectResult=function(e){this._cludoSearch.autocompleteSetSelectedResult(e)},e.prototype.selectRecentSearch=function(e,t){this._cludoSearch.autocompleteSetSelectedRecentSearch(e,t)},e.prototype.clearRecentSearches=function(){this._cludoSearch.clearRecentSearches()},e.prototype.clearAutocomplete=function(){this._cludoSearch.autocompleteRestoreClient()},e.prototype.setActiveDescendantToSuggestions=function(e){this._cludoSearch.setActiveDescendantToSuggestions(e)},e.prototype.endlessScrollLoadMore=function(){this._cludoSearch.endlessScrollLoadMoreClickEvent()},e.prototype.trackQuery=function(e){return this._cludoSearch.trackQuery(e)},e.prototype.trackClick=function(e){return this._cludoSearch.trackClick(e)},e.prototype.trackChatClick=function(e){return this._cludoSearch.trackChatClick(e)},e.prototype.getConversations=function(){return this._cludoSearch.conversationService.getConversationsFromStorage()},e.prototype.storeConversations=function(e){this._cludoSearch.conversationService.storeConversations(e)},e.prototype.sendQuestion=function(e,t,n,r){return this._cludoSearch.conversationService.sendQuestion(e,t,n,r)},e.prototype.sendChatFeedbackData=function(e,t,n){return this._cludoSearch.conversationService.sendFeedbackData(e,t,n)},e.prototype.getTrendingPages=function(e,t,n){return this._cludoSearch.getTrendingPages(e,t,n)},e.prototype.getPopularPages=function(e,t,n){return this._cludoSearch.getPopularPages(e,t,n)},e.prototype.getRelatedPages=function(e,t){return this._cludoSearch.getRelatedPages(e,t)},e}();!function(e){e.Results="results",e.Autocomplete="autocomplete",e.Controls="controls",e.Loader="loader",e.Custom="custom"}(jo||(jo={}));var Ho=function(){function e(e,t,n){this.managedComponents=[],this._searchContext=t,this.events=new zo(e,t),this._cssTheme=n}return e.prototype.registerSearchResultsComponent=function(e,t){this.addManagedComponent(e,t,["beforesearch","aftersearch"])},e.prototype.registerControlsComponent=function(e,t){this.addManagedComponent(e,t,["beforesearch","aftersearch"])},e.prototype.registerAutocompleteComponent=function(e,t){this.addManagedComponent(e,t,["afterautocomplete","afterinputfocus"])},e.prototype.registerComponent=function(e,t,n,r){void 0===n&&(n=[]),void 0===r&&(r=!0),this.addManagedComponent(e,t,n,r)},e.prototype.addManagedComponent=function(e,t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=!1),Fo()){var o={component:e,elem:"string"==typeof t?document.querySelector(t):t,elemSelector:"string"==typeof t?t:void 0,observedEventTypes:n};this.managedComponents.push(o),r&&this.renderComponent(o)}},e.prototype.processEvent=function(e,t,n){var r=this;this.events.emitEvent(e,t),this.managedComponents.filter((function(t){return 0===t.observedEventTypes.length||t.observedEventTypes.includes(e)})).forEach((function(e){return r.renderComponent(e)})),n&&n()},e.prototype.renderComponent=function(e){var t=e.component;!e.elem&&Fo()&&(e.elem=document.querySelector(e.elemSelector)),e.elem&&Bo().render(l().createElement(l().StrictMode,null,l().createElement(i.Provider,{value:this._searchContext},l().createElement(a.Provider,{value:this.events},l().createElement(p,{theme:this._cssTheme},l().createElement(t,null))))),e.elem,(function(){}))},e}(),Uo=function(){function e(e,t){this._cludoSearch=e,this.instance=new Do(this._cludoSearch),this.components=new Ho(this._cludoSearch,this.instance,t)}return e.prototype.search=function(){this._cludoSearch.search()},e.prototype.addWidget=function(e,t,n){switch(e){case jo.Results:this.components.registerSearchResultsComponent(t,n);case jo.Controls:this.components.registerControlsComponent(t,n);case jo.Autocomplete:this.components.registerAutocompleteComponent(t,n)}return this},e.prototype.setOverrideString=function(e,t,n){var r=this._cludoSearch.translateProvider.translations[n];return r&&(r[e]=t),this},e.prototype.setOverrideStrings=function(e){var t=this,n=this.instance.translateProvider.language;return Object.keys(e).map((function(r){var o=e[r];r&&o&&t.setOverrideString(r,o,n)})),this},e.prototype.setLanguage=function(e){return this.instance.translateProvider.language=e,this},e}();function Vo(){var e=c(),t=e.context,n=e.eventController,r=function(){return{sortOrder:t.sort||{},sortItems:t.sortItems||[]}},l=function(){var e,t,r;return{setSortOrder:(null===(e=null==n?void 0:n.setSortOrder)||void 0===e?void 0:e.bind(n))||function(){},addToSortOrder:(null===(t=null==n?void 0:n.addToSortOrder)||void 0===t?void 0:t.bind(n))||function(){},clearSortOrder:(null===(r=null==n?void 0:n.clearSortOrder)||void 0===r?void 0:r.bind(n))||function(){}}};Sr((function(){u(r()),f(l())}));var i=(0,o.useState)(r()),a=i[0],u=i[1],s=(0,o.useState)(l()),d=s[0],f=s[1];return[a,d]}function qo(e){var t=Vo(),n=t[0],r=t[1],o=e.relevanceLabel?e.relevanceLabel:"Relevance",i=Object.keys(n.sortOrder),a=i.length>0,c=a?void 0:"active";return l().createElement("div",{className:"cludo-sort-picker"},l().createElement("ul",{className:"cludo-sort-picker-list"},l().createElement("li",{className:"cludo-sort-picker-item ".concat(c)},l().createElement("a",{onClick:function(){return r.clearSortOrder()}},o)),n.sortItems.map((function(e){var t=a&&i[0]==e.key&&n.sortOrder[e.key]==e.direction?"active":void 0;return l().createElement("li",{className:"cludo-sort-picker-item ".concat(t),key:e.key+e.direction},l().createElement("a",{onClick:function(){return r.setSortOrder(e.key,e.direction)}},e.displayText))}))))}function Wo(e){return l().createElement("a",{className:e.className,href:"#",onClick:function(t){return t.preventDefault(),void e.onClick()}},e.children)}function Qo(e){var t=c(),n=t.context,r=t.eventController,l=function(){var t;return{facet:(null===(t=null==n?void 0:n.facets)||void 0===t?void 0:t.find((function(t){return t.key===e})))||null}},i=function(){var t,n,o,l,i,a;return{selectFacet:(null===(t=null==r?void 0:r.selectFacet)||void 0===t?void 0:t.bind(r,e))||function(){},deselectFacet:(null===(n=null==r?void 0:r.deselectFacet)||void 0===n?void 0:n.bind(r,e))||function(){},toggleFacetValue:(null===(o=null==r?void 0:r.toggleFacetValue)||void 0===o?void 0:o.bind(r,e))||function(){},clearFacet:(null===(l=null==r?void 0:r.clearFacet)||void 0===l?void 0:l.bind(r,e))||function(){},setDateRangeFacet:(null===(i=null==r?void 0:r.setDateRangeFacet)||void 0===i?void 0:i.bind(r,e))||function(){},setNumberRangeFacet:(null===(a=null==r?void 0:r.setNumberRangeFacet)||void 0===a?void 0:a.bind(r,e))||function(){}}};Sr((function(){s(l()),p(i())}));var a=(0,o.useState)(l()),u=a[0],s=a[1],d=(0,o.useState)(i()),f=d[0],p=d[1];return[u,f]}function Yo(e){var t=Qo(e.facetItem.facetName),n=(t[0],t[1]),r=m("cludo-theme-facet-option",e.disableTheme,e.className),o=m("cludo-theme-facet-option cludo-font-weight-bold",e.disableTheme,e.className)+" cludo-active",i=m("cludo-theme-facet-count",e.disableTheme,e.className),a=e.facetItem.isSelected?o:r;return l().createElement(Wo,{className:a,onClick:function(){n.toggleFacetValue(e.facetItem.value),e.onChange&&e.onChange()}},e.facetItem.value,!e.hideCount&&e.facetItem.count?l().createElement(l().Fragment,null," ",l().createElement("span",{className:i},e.facetItem.count)):null)}var Ko=function(){return Ko=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ko.apply(this,arguments)},$o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,l=t.length;o<l;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Zo(e,t){var n=$o([],e,!0),r=$o([],t,!0);if(r.filter((function(e){return"*"===e})).length>1)throw new Error("Only one wildcard (*) allowed in a reference order");r=r.filter((function(e){return n.includes(e)||"*"===e})),n=n.filter((function(e){return!r.includes(e)}));var o=r.indexOf("*");return o>-1?(r.splice.apply(r,$o([o,1],n,!1)),r):r.concat(n)}function Go(e){var t,n,r,o=m("cludo-display-flex cludo-align-items-center cludo-mb-2",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),i=m("cludo-font-size-lg cludo-m-0 cludo-mr-3 cludo-line-height-2",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.header),a=m("cludo-theme-btn-gray",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.clearButton);return e.facet?l().createElement("div",{className:o},l().createElement("h3",{className:i},e.label),!e.hideClear&&e.facet.hasSelection?l().createElement("button",{className:a,onClick:e.onClear},e.clearLabel||"Clear"):null):null}function Xo(e){var t=e.facetItems,n=e.placeholder||"Search options",r=e.hideSelected||!1,o=m("cludo-theme-searchbar",e.disableTheme,e.className);return l().createElement("input",{placeholder:n,className:o,onChange:function(n){var o,l=null===(o=n.currentTarget)||void 0===o?void 0:o.value,i=null==t?void 0:t.filter((function(e){return e.value.toLowerCase().includes(l.toLowerCase())||e.isSelected&&!r}));e.onChange(i)}})}function Jo(e){var t,n,r,i=e.limit||1/0,a=e.hideShowMore||!1,c=e.hideCount||!1,u=(0,o.useState)(i),s=u[0],d=u[1],f=(e.className?e.className+" ":"")+((null===(t=e.classNames)||void 0===t?void 0:t.root)?e.classNames.root+" ":"")+"cludo-list-style-none cludo-p-0 cludo-mt-0 cludo-mb-3",p=(null===(n=e.classNames)||void 0===n?void 0:n.listItem)?e.classNames.listItem+" ":"",h=m("cludo-theme-btn-accent-secondary cludo-font-weight-bold",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.loadMoreButton);function g(e,t){return!e.isSelected&&t>s-1}return(0,o.useEffect)((function(){d(i)}),[e.limit]),l().createElement(l().Fragment,null,l().createElement("ul",{className:f},e.facetItems.map((function(t,n){return l().createElement("li",{className:(g(t,n)?"cludo-display-none ":"")+p,key:"facet-value-".concat(t.value)},l().createElement(e.itemComponent,{key:"facet-value-".concat(t.value),facetItem:t,hideCount:c,disableTheme:e.disableTheme}))}))),!a&&s<e.facetItems.length?l().createElement(yo,{classNames:{loadMoreButton:h},onClick:function(){return d(1/0)}}):null)}function el(e){var t,n,r,a,c,u,s,d=Qo(e.field),f=d[0],p=d[1],h=(0,o.useContext)(i),g=e.sortBy||"count",v=e.order||[],y=e.exclude||[],b=m("cludo-box-shadow-card cludo-border-radius-card cludo-p-4 cludo-mb-5 cludo-font-family-default cludo-bg-color-white",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),k=m(" cludo-theme-loading-disable-children",e.disableTheme||!h.isLoadingResults),S=e.facet||f.facet,x=(0,o.useState)(null),C=x[0],E=x[1],w=(0,o.useState)([]),T=w[0],P=w[1],F=(0,o.useState)([]),R=F[0],N=F[1];return(0,o.useEffect)((function(){h.isLoadingResults||E(S)}),[f]),(0,o.useEffect)((function(){var e,t;if(null===(e=null==C?void 0:C.values)||void 0===e?void 0:e.length){var n=C.values.map((function(e){return e.value}));if(g)switch(g){case"count":n=C.values.sort((function(e,t){return(t.count||-1)-(e.count||-1)})).map((function(e){return e.value}));break;case"alphabetical":n=C.values.sort((function(e,t){return e.value.localeCompare(t.value)})).map((function(e){return e.value}))}y.length&&(n=n.filter((function(e){return!y.includes(e)}))),v.length&&(n=Zo(n,v));var r=new Map(null===(t=C.values)||void 0===t?void 0:t.map((function(e){return[e.value,e]}))),o=[];n.forEach((function(e){var t=r.get(e);t&&o.push(t)})),P(o),N(o)}}),[C]),(null==C?void 0:C.values.length)?l().createElement("div",{className:b+k},l().createElement(Go,{classNames:{header:null===(n=e.classNames)||void 0===n?void 0:n.header,clearButton:null===(r=e.classNames)||void 0===r?void 0:r.clearButton},facet:C,label:e.label?e.label:(null==C?void 0:C.key)||"",hideClear:e.hideClear,onClear:function(){p.clearFacet()},disableTheme:e.disableTheme}),e.hideSearchBar?null:l().createElement(Xo,{className:null===(a=e.classNames)||void 0===a?void 0:a.search,facetItems:T,placeholder:e.searchPlaceholder,onChange:function(e){N(e)},disableTheme:e.disableTheme}),l().createElement(Jo,{classNames:{root:null===(c=e.classNames)||void 0===c?void 0:c.facetListContainer,listItem:null===(u=e.classNames)||void 0===u?void 0:u.facetListItem,loadMoreButton:null===(s=e.classNames)||void 0===s?void 0:s.loadMoreButton},facetItems:R,itemComponent:e.itemComponent,limit:e.limit,hideShowMore:e.hideShowMore,hideCount:e.hideCount,disableTheme:e.disableTheme})):null}var tl=function(){return tl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tl.apply(this,arguments)};function nl(e){return l().createElement(el,tl({itemComponent:Yo},e))}function rl(){var e=c(),t=e.context,n=e.eventController,r=function(){return{facets:(null==t?void 0:t.facets)||[],selectedFacets:null==t?void 0:t.selectedFacets}},l=function(){var e,t,r;return{clearAllFacets:(null===(e=null==n?void 0:n.clearAllFacets)||void 0===e?void 0:e.bind(n))||function(){},softClearAllFacets:(null===(t=null==n?void 0:n.softClearAllFacets)||void 0===t?void 0:t.bind(n))||function(){},deselectFacet:(null===(r=null==n?void 0:n.deselectFacet)||void 0===r?void 0:r.bind(n))||function(){}}};Sr((function(){u(r()),f(l())}));var i=(0,o.useState)(r()),a=i[0],u=i[1],s=(0,o.useState)(l()),d=s[0],f=s[1];return[a,d]}var ol=ll({});function ll(e){var t=e.sortPicker||qo,n=e.facet||nl;return function(){var e=Vo()[0],r=rl()[0],o=e.sortItems.length>0,i=r.facets;return l().createElement(l().Fragment,null,o?l().createElement(t,null):l().createElement(l().Fragment,null),i.map((function(e){return l().createElement(n,{key:e.key,field:e.key})})))}}var il=function(){return il=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},il.apply(this,arguments)},al=function(e,t,n,r){return new(n||(n=Promise))((function(o,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function a(e){try{c(r.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},cl=function(e,t){var n,r,o,l,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},ul="da",sl="https://customer.cludo.com/scripts/bundles/search-script.min.js";function dl(e){return al(this,void 0,void 0,(function(){var t,n;return cl(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),t="",[4,window.Cludo.getPublicSettingsByOptions({customerId:e.customerId,engineId:e.engineId,experienceId:e.experienceId,apiUrl:void 0,authKey:void 0,searchSiteKey:void 0,isIntranet:e.isIntranet})];case 1:return t=r.sent(),(n=JSON.parse(t)).instantSuggestionsConfiguration=JSON.parse(n.instantSuggestionsConfiguration),[2,n];case 2:throw r.sent(),"Unable to resolve public settings via web service";case 3:return[2]}}))}))}function fl(){return al(this,void 0,void 0,(function(){return cl(this,(function(e){return Fo()?[2,new Promise((function(e,t){if(Fo()||e(),document.querySelector('script[src="'.concat(sl,'"]')))e();else{var n=document.createElement("script");n.onload=function(){return e()},n.onerror=function(){return t()},n.src=sl,document.body.appendChild(n)}}))]:[2]}))}))}function pl(e){var t;return al(this,void 0,void 0,(function(){var n,r;return cl(this,(function(o){switch(o.label){case 0:return Fo()?(n={customerId:e.customerId,engineId:e.engineId,experienceId:e.experienceId,isIntranet:null===(t=e.secureSearch)||void 0===t?void 0:t.enable},e.headless?[4,fl()]:[3,2]):[2,{}];case 1:o.sent(),o.label=2;case 2:return[4,dl(n)];case 3:return r=o.sent(),[2,ml(e,r)]}}))}))}function ml(e,t){var n,r,o,l,i,a,c,u,s,d,f,p,m,h,g,v,y,b,k,S,x,C,E,w,T,P,F,R,N,A,I,O,_,L,D,M,j,B,z,H,U,V,q,W,Q,Y,K,$,Z,G,X,J,ee,te,ne,re,oe,le,ie,ae,ce,ue,se,de,fe,pe,me,he,ge,ve={customerId:e.customerId,engineId:e.engineId,language:e.language,searchUrl:e.searchUrl,paramsPrefix:e.instanceId,clientTemplates:!0,publicSettings:t,searchInputs:e.searchInputSelectors,headlessSearch:e.headless,searchResultsWrapper:e.searchResultsWrapperSelector,intranetSearch:null===(n=e.secureSearch)||void 0===n?void 0:n.enable,searchApiUrl:null===(r=e.secureSearch)||void 0===r?void 0:r.proxyApiUrl,customHttpHeaders:null===(o=e.secureSearch)||void 0===o?void 0:o.customHttpHeaders,disableAutocomplete:null===(l=e.autocomplete)||void 0===l?void 0:l.disable,facets:null===(i=e.facets)||void 0===i?void 0:i.keys,initFacets:null===(a=e.facets)||void 0===a?void 0:a.defaultValues,filters:e.filters,perPage:null===(c=e.theme)||void 0===c?void 0:c.resultsPerPage,hideResultsCount:null===(u=e.theme)||void 0===u?void 0:u.hideResultsCount,hideSearchFilters:null===(s=e.theme)||void 0===s?void 0:s.hideSearchFilters,hideSearchDidYouMean:null===(d=e.theme)||void 0===d?void 0:d.hideSearchDidYouMean,type:null===(f=e.theme)||void 0===f?void 0:f.type,sortOrder:null===(p=e.sort)||void 0===p?void 0:p.defaultOrder,sortOptions:null===(m=e.sort)||void 0===m?void 0:m.options,logPageVisits:!(null===(h=e.tracking)||void 0===h?void 0:h.skipLoggingPageVisits),richAutocomplete:null===(g=e.autocomplete)||void 0===g?void 0:g.useSearchAsYouType,autocompleteForceUseTemplate:null===(v=e.autocomplete)||void 0===v?void 0:v.renderTemplateWhenNoResults,autocompleteMinimumQueryLength:null===(y=e.autocomplete)||void 0===y?void 0:y.minimumQueryLength,applyMultiLevelFacets:null===(b=e.facets)||void 0===b?void 0:b.applyMultiLevel,rangeFacets:null===(k=e.facets)||void 0===k?void 0:k.rangeValues,pierceShadowDom:null===(S=e.behavior)||void 0===S?void 0:S.pierceShadowDom,enableRelatedSearches:null===(x=e.behavior)||void 0===x?void 0:x.enableRelatedSearches,customNoResultsMessage:null===(C=e.overrideStrings)||void 0===C?void 0:C.noResultsMessage,enableVoiceSearch:null===(E=e.voiceSearch)||void 0===E?void 0:E.enable,disableVoiceSearchActiveAnimation:null===(w=e.voiceSearch)||void 0===w?void 0:w.disableActiveAnimation,useFixedQueryInResultsCount:null===(T=e.theme)||void 0===T?void 0:T.showFixedQueryInResultsCount,allowSearchWithoutSearchword:null===(P=e.behavior)||void 0===P?void 0:P.allowSearchWithoutSearchword,jumpToTopOnFacetClick:null===(F=e.behavior)||void 0===F?void 0:F.jumpToTopOnFacetClick,endlessScroll:null===(R=e.behavior)||void 0===R?void 0:R.endlessScroll,enableExtendedTracking:!(null===(N=e.tracking)||void 0===N?void 0:N.disableExtendedTracking),customCallbackAfterSearch:null===(A=e.callbacks)||void 0===A?void 0:A.afterSearch,customCallbackBeforeSearch:null===(I=e.callbacks)||void 0===I?void 0:I.beforeSearch,customCallbackBeforeRedirect:null===(O=e.callbacks)||void 0===O?void 0:O.beforeRedirect,customCallbackAfterAutocomplete:null===(_=e.callbacks)||void 0===_?void 0:_.afterAutocomplete,customCallbackBeforeQuicklink:null===(L=e.callbacks)||void 0===L?void 0:L.beforeQuicklink,canUserBeTracked:null===(D=e.tracking)||void 0===D?void 0:D.canUserBeTracked,ovarlayResultsWrapperOpenClass:null===(M=e.theme)||void 0===M?void 0:M.overlayResultsWrapperOpenClass,theme:{searchBoxPosition:null===(j=e.theme)||void 0===j?void 0:j.searchBoxPosition,themeColor:null===(B=e.theme)||void 0===B?void 0:B.themeColor,elementFocusColor:null===(z=e.theme)||void 0===z?void 0:z.elementFocusColor,themeBannerColor:null===(H=e.theme)||void 0===H?void 0:H.themeBannerColor,textColor:null===(U=e.theme)||void 0===U?void 0:U.textColor,borderRadius:null===(V=e.theme)||void 0===V?void 0:V.borderRadius,borderRadiusInput:null===(q=e.theme)||void 0===q?void 0:q.borderRadius},showInstantSuggestions:null===(W=e.autocomplete)||void 0===W?void 0:W.showInstantSuggestions,suggestedSearchesHeader:null===(Q=e.overrideStrings)||void 0===Q?void 0:Q.suggestedSearchesHeader,recentSearchesHeader:null===(Y=e.overrideStrings)||void 0===Y?void 0:Y.recentSearchesHeader,googleAnalyticsTrackingId:null===(K=e.tracking)||void 0===K?void 0:K.googleAnalyticsId,focusOnResultsAfterSearch:null===($=e.behavior)||void 0===$?void 0:$.focusOnResultsAfterSearch,translateSearchTemplates:!0,changeWindowLocation:void 0===(null===(Z=e.behavior)||void 0===Z?void 0:Z.updateUrlOnSearch)||(null===(G=e.behavior)||void 0===G?void 0:G.updateUrlOnSearch)},ye=new window.Cludo(ve),be=ye.translateProvider.translations[e.language||(null===(X=e.filters)||void 0===X?void 0:X.Language[0])||ul];be?be=Object.assign(be,e.overrideStrings):console.warn("Cludo: Translations not found for language "+e.language),e.categorizeResultsByField&&(ye.params.topHitsFields=[il(il({field:e.categorizeResultsByField.field},e.categorizeResultsByField.maxResultsPerCategory&&{size:e.categorizeResultsByField.maxResultsPerCategory}),e.categorizeResultsByField.maxCategories&&{MaxFieldValues:e.categorizeResultsByField.maxCategories})]);var ke=new Uo(ye,e.cssTheme);if(ye.setClientTemplateComponentsController&&ye.setClientTemplateComponentsController(ke.components),ye.configureFeaturesFromPublicSettings(t),ye.init(),!0!==e.headless){var Se={results:{},controls:{},autocomplete:{}};Ce(null===(J=e.components)||void 0===J?void 0:J.results)?Se.results=null===(ee=e.components)||void 0===ee?void 0:ee.results:Se.results={component:null!==(ne=null===(te=e.components)||void 0===te?void 0:te.results)&&void 0!==ne?ne:xo,containerSelector:null!==(re=ve.searchResultsWrapper)&&void 0!==re?re:".search-results .search-results-container",renderEvents:["beforesearch","aftersearch"]},Ce(null===(oe=e.components)||void 0===oe?void 0:oe.controls)?Se.controls=null===(le=e.components)||void 0===le?void 0:le.controls:Se.controls={component:null!==(ae=null===(ie=e.components)||void 0===ie?void 0:ie.controls)&&void 0!==ae?ae:ol,containerSelector:null!==(ce=e.controlsWrapperSelector)&&void 0!==ce?ce:".search-filters",renderEvents:["beforesearch","aftersearch"]},Ce(null===(ue=e.components)||void 0===ue?void 0:ue.autocomplete)?Se.autocomplete=null===(se=e.components)||void 0===se?void 0:se.autocomplete:Se.autocomplete={component:null!==(fe=null===(de=e.components)||void 0===de?void 0:de.autocomplete)&&void 0!==fe?fe:_o,containerSelector:"#cludo-search-input #search_autocomplete",renderEvents:["afterautocomplete","afterinputfocus"]},xe(Se.results),!ve.hideSearchFilters&&xe(Se.controls),!0!==(null===(pe=e.autocomplete)||void 0===pe?void 0:pe.disable)&&((null===(me=e.searchInputSelectors)||void 0===me?void 0:me.length)?e.searchInputSelectors.forEach((function(e){xe(Se.autocomplete,e+" #search_autocomplete")})):xe(Se.autocomplete)),null===(ge=null===(he=e.components)||void 0===he?void 0:he.custom)||void 0===ge||ge.forEach((function(e){return xe(e)}))}function xe(e,t){ke.components.registerComponent(e.component,null!=t?t:e.containerSelector,e.renderEvents,e.renderEvents.includes("afterpageload"))}function Ce(e){return null!=e&&"object"==typeof e&&"string"==typeof e.containerSelector&&Array.isArray(e.renderEvents)}return ke}function hl(e){var t,n,r,o,i=m("cludo-font-family-default cludo-font-size-md cludo-font-weight-bold cludo-mr-2",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.label),a=m("cludo-p-1 cludo-border-radius-button cludo-height-sm",e.disableTheme,e.className,null===(n=e.classNames)||void 0===n?void 0:n.dropdown);return l().createElement("div",{className:null!==(o=null===(r=e.classNames)||void 0===r?void 0:r.root)&&void 0!==o?o:""},e.label?l().createElement("label",{htmlFor:e.id,className:i},e.label):null,l().createElement("select",{id:e.id,className:a,value:e.currentValue,defaultValue:e.default,onChange:function(t){return e.onChange(t.target.value)}},e.options.map((function(t,n){var r,o;return l().createElement("option",{className:null!==(o=null===(r=e.classNames)||void 0===r?void 0:r.dropdownOption)&&void 0!==o?o:"",key:n,value:t.value},t.label)}))))}function gl(e){var t,n,r,a,c,u=lo(),s=u[0],d=u[1],f=Cr()[0],p=(0,o.useState)(s),h=p[0],g=p[1],v=(0,o.useContext)(i);(0,o.useEffect)((function(){v.isLoadingResults||g(s)}),[s]);var y=(e.options||[10,20,50]).map((function(e){return{label:e.toString(),value:e}})),b=e.label||"Results per page: ",k=h.itemsPerPage,S=m("cludo-mt-3",e.disableTheme,e.className),x=m(" cludo-theme-loading-disable",e.disableTheme||!f.isLoading),C=hl;return h.showResultsPerPage?l().createElement(l().Fragment,null,l().createElement(C,{options:y,id:"perpage",label:b,disableTheme:e.disableTheme,className:x,classNames:{root:null===(t=e.classNames)||void 0===t?void 0:t.root,label:null===(n=e.classNames)||void 0===n?void 0:n.label,dropdown:"".concat(S," ").concat(null!==(a=null===(r=e.classNames)||void 0===r?void 0:r.selector)&&void 0!==a?a:""),dropdownOption:null===(c=e.classNames)||void 0===c?void 0:c.selectorOption},currentValue:k,onChange:function(e){return d.setPerPage(Number(e))}})):null}var vl=function(){return vl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vl.apply(this,arguments)};function yl(e){return l().createElement(wo,vl({},e,{resultType:ko.CategorizedResult}))}function bl(e){var t,n=rl()[0],r=e.order||[],i=e.exclude||[],a=(null===(t=e.children)||void 0===t?void 0:t.type)===o.Fragment?e.children.props.children:e.children,c=n.facets.map((function(e){return e.key})),u=(0,o.useRef)([]),s=(0,o.useRef)(new Map);return(0,o.useMemo)((function(){c.length&&(u.current=c,i.length&&(u.current=c.filter((function(e){return!i.includes(e)}))),r.length&&(u.current=Zo(c,r)),s.current=function(e,t){var n,r=new Map(e.map((function(e){return[e,null]})));return t&&l().Children.forEach(t,(function(e){if(l().isValidElement(e)){var t=e.props.field,o=e.type,i=e.props;if(!t)throw new Error('Could not find "field" prop for facet group override '.concat(o||"unknown","."));if("*"===e.props.field){if(n)throw new Error("Only one override component with wildcard (*) field allowed in a facet group");n=l().createElement(o,Ko({},i))}else r.set(t,l().createElement(o,Ko({field:t},i)))}})),r.forEach((function(e,t,r){if(null===e){var o=n?l().cloneElement(n,{field:t}):l().createElement(nl,{field:t});r.set(t,o)}})),r}(c,a))}),[n]),l().createElement(l().Fragment,null,u.current.map((function(e){return l().createElement(o.Fragment,{key:e},s.current.get(e))})))}function kl(e){var t=Qo(e.facetItem.facetName),n=(t[0],t[1]),r=m("cludo-theme-facet-option",e.disableTheme),o=m("cludo-theme-facet-option cludo-font-weight-bold",e.disableTheme)+" cludo-active",i=m("cludo-theme-facet-count",e.disableTheme),a=m("cludo-m-0 cludo-mr-2",e.disableTheme);return l().createElement("label",{className:(e.className?e.className+" ":"")+(e.facetItem.isSelected?o:r)},l().createElement("input",{name:e.facetItem.facetName,type:"checkbox",checked:e.facetItem.isSelected,className:a,onChange:function(t){return function(t,r){t.target.checked?n.selectFacet(r,!0):n.deselectFacet(r),e.onChange&&e.onChange()}(t,e.facetItem.value)}}),e.facetItem.value,!e.hideCount&&e.facetItem.count?l().createElement(l().Fragment,null," ",l().createElement("span",{className:i},e.facetItem.count)):null)}var Sl=function(){return Sl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Sl.apply(this,arguments)};function xl(e){return l().createElement(el,Sl({itemComponent:kl},e))}function Cl(e){var t=Qo(e.facetItem.facetName),n=(t[0],t[1]),r=m("cludo-theme-facet-option",e.disableTheme,e.className),o=m("cludo-theme-facet-option cludo-font-weight-bold",e.disableTheme,e.className)+" cludo-active",i=m("cludo-theme-facet-count",e.disableTheme,e.className),a=m("cludo-m-0 cludo-mr-2",e.disableTheme,e.className);return l().createElement("label",{className:e.facetItem.isSelected?o:r},l().createElement("input",{name:e.facetItem.facetName,type:"radio",checked:e.facetItem.isSelected,className:a,onChange:function(t){return function(t,r){t.target.checked&&n.selectFacet(r),e.onChange&&e.onChange()}(t,e.facetItem.value)}}),e.facetItem.value,!e.hideCount&&e.facetItem.count?l().createElement(l().Fragment,null," ",l().createElement("span",{className:i},e.facetItem.count)):null)}var El=function(){return El=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},El.apply(this,arguments)};function wl(e){return l().createElement(el,El({itemComponent:Cl},e))}var Tl=function(e){var t=e.width||"200",n=e.height||"200",r=e.color||"#000";return l().createElement("svg",{width:t,height:n,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l().cloneElement(e.children,{color:r},null))},Pl=function(){return Pl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pl.apply(this,arguments)};function Fl(e){return l().createElement(Tl,Pl({},e),l().createElement("path",{d:"M4.62154 23.33C-0.245279 28.1934 -0.245271 36.0785 4.62155 40.9419L59.6556 95.9373L4.5986 150.956C-0.268218 155.819 -0.268218 163.704 4.5986 168.567L23.3455 187.301C28.2123 192.165 36.103 192.165 40.9698 187.301L96.0267 132.283L150.927 187.145C155.794 192.008 163.685 192.008 168.551 187.145L187.298 168.411C192.165 163.548 192.165 155.663 187.298 150.799L132.398 95.9373L187.275 41.0983C192.142 36.2349 192.142 28.3498 187.275 23.4864L168.529 4.75271C163.662 -0.11069 155.771 -0.110682 150.904 4.75272L96.0267 59.5916L40.9927 4.59628C36.1259 -0.267119 28.2352 -0.267119 23.3684 4.59628L4.62154 23.33Z",fill:e.color}))}var Rl="10",Nl="#344054";function Al(e){var t=rl(),n=t[0],r=t[1],o=Cr()[0],i=n.selectedFacets,a=m("cludo-theme-current-facets",e.disableTheme),c=m("cludo-font-weight-bold",e.disableTheme),u=m("cludo-ml-2 cludo-display-inline-block",e.disableTheme),s=m("cludo-theme-current-facets-btn cludo-height-xs",e.disableTheme),d=m(" cludo-theme-loading-disable",e.disableTheme||!o.isLoading);return l().createElement("div",{className:(e.className?e.className+" ":"")+"cludo-display-flex cludo-align-items-start cludo-flex-wrap"},Object.keys(i).map((function(t,n){var o;return(null===(o=e.exclude)||void 0===o?void 0:o.includes(t))?null:l().createElement("div",{className:a+d,key:n},l().createElement("label",{className:c},e.labelsMap&&e.labelsMap[t]||t,": "),l().createElement("div",null,i[t].map((function(e,n){return l().createElement("span",{key:n,className:u},e," ",l().createElement("button",{className:s,onClick:function(){return r.deselectFacet(t,e)}},l().createElement(Fl,{height:Rl,width:Rl,color:Nl})))}))))})))}function Il(e){var t=rl(),n=t[0],r=t[1],o=m("cludo-theme-btn-accent-secondary cludo-font-weight-bold cludo-mb-2",e.disableTheme,e.className);return l().createElement(l().Fragment,null,Object.keys(n.selectedFacets).length>0&&l().createElement("button",{className:o,onClick:r.clearAllFacets},e.label||"Clear all"))}function Ol(e){var t=(0,o.useContext)(Kr),n=e.result||t;if(!n)return Or("ResultImage"),null;var r=Fr(n,e.imageField||"Image"),i=e.altText||Fr(n,"Title");return r?l().createElement("img",{src:r,alt:i}):null}function _l(e){var t,n,r,i,a,c=(0,o.useContext)(Kr),u=e.result||c;if(!u)return Or("ResultBreadcrumbs"),null;var s=e.template||function(e){return l().createElement("span",null,e)},d=e.separator||l().createElement("span",{className:"cludo-px-1"},"/"),f=(0,o.useRef)([]),p=(0,o.useRef)([]),h=m("cludo-font-family-default cludo-font-size-sm cludo-mb-2 cludo-font-color-gray",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),g=m("cludo-list-style-none cludo-p-0 cludo-display-flex",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.list),v=m("",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.listItem),y=m("cludo-font-color-gray",e.disableTheme,null===(i=e.classNames)||void 0===i?void 0:i.listItemLink),b=m("",e.disableTheme,null===(a=e.classNames)||void 0===a?void 0:a.separator);function k(e,t,n){var r;if(Array.isArray(e))e.forEach((function(e){var n=Fr(u,e);t.current.push(null!=n?n:void 0)}));else{var o=Rr(u,e);if(o&&o[0]){var l=n?o[0].split(n):o;(r=t.current).push.apply(r,l)}else t.current.push(void 0)}}return(0,o.useMemo)((function(){k(e.textField,f,e.textFieldDelimiter),e.linkField&&k(e.linkField,p,e.linkFieldDelimiter)}),[]),f.current.length&&!f.current.every((function(e){return void 0===e}))?l().createElement("nav",{className:h,"aria-label":"breadcrumb"},l().createElement("ol",{className:g},f.current.map((function(e,t){return void 0!==e?void 0!==p.current[t]?l().createElement(l().Fragment,{key:t},l().createElement("li",{className:v},l().createElement("a",{className:y,href:p.current[t]},s(e))),t!==f.current.length-1?l().createElement("li",{className:b,"aria-hidden":"true"},d):null):l().createElement(l().Fragment,{key:t},l().createElement("li",{className:v},l().createElement(l().Fragment,null,s(e))),t!==f.current.length-1?l().createElement("li",{className:b,"aria-hidden":"true"},d):null):null})))):l().createElement(l().Fragment,null)}var Ll=function(){return Ll=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ll.apply(this,arguments)};function Dl(e){var t=(0,o.useState)({}),n=t[0],r=t[1],c=(0,o.useState)({}),u=c[0],s=c[1],d=(0,o.useState)(!1),f=d[0],m=d[1];return(0,o.useEffect)((function(){if(e.publicSettings){var t=ml(e.config,e.publicSettings);e.onInit&&e.onInit(t),r(t.instance),s(t.components.events),m(!0)}else pl(Ll({headless:!0},e.config)).then((function(t){e.onInit&&e.onInit(t),r(t.instance),s(t.components.events),m(!0)}));return function(){var t,n=window;(null===(t=null==n?void 0:n.CludoSearchInstances)||void 0===t?void 0:t.length)&&(n.CludoSearchInstances=n.CludoSearchInstances.filter((function(t){return t.engineId!==e.config.engineId})))}}),[]),f?l().createElement(i.Provider,{value:n},l().createElement(a.Provider,{value:u},l().createElement(p,{theme:e.config.cssTheme},e.children))):null}function Ml(){var e,t=null===(e=(0,o.useContext)(i).translateProvider)||void 0===e?void 0:e.translate("template_autocomplete_hint");return l().createElement(l().Fragment,null,l().createElement("div",{className:"search_autocomplete",id:"search_autocomplete",tabIndex:0}),l().createElement("span",{id:"autocomplete_hint","aria-hidden":"false","aria-atomic":"true",role:"status","aria-live":"polite"},t))}function jl(e){var t=e.id?e.id:"cludo-search-results";return l().createElement("div",{id:t})}function Bl(){var e,t,n=(0,o.useContext)(i),r=null===(e=n.translateProvider)||void 0===e?void 0:e.translate("search_input_label"),a=null===(t=n.translateProvider)||void 0===t?void 0:t.translate("search_input_label");return n.isAutocompleteEnabled?l().createElement("input",{type:"search",className:"cludo-search-input","aria-label":a,placeholder:r,"aria-describedby":"autocomplete_hint","aria-autocomplete":"list","aria-controls":"search_autocomplete"}):l().createElement("input",{type:"search",className:"cludo-search-input","aria-label":a,placeholder:r})}function zl(e){var t,n=(0,o.useContext)(i),r=null===(t=n.translateProvider)||void 0===t?void 0:t.translate("search_input_label"),a=n.isAutocompleteEnabled,c=e.uniqueFormId?e.uniqueFormId:"cludo-search-input";return l().createElement("form",{id:c,role:"search"},l().createElement(Bl,null),l().createElement("button",{type:"submit",className:"cludo-search-button","aria-label":r}),a?l().createElement(Ml,null):l().createElement(l().Fragment,null))}function Hl(){var e=c(),t=e.context,n=e.eventController,r=(0,o.useState)({query:t.query||""}),l=r[0],i=r[1],a={search:function(e){n.search(e)},setQuery:function(e){i({query:e})}};return(0,o.useEffect)((function(){i({query:t.query||""})}),[t.query]),[l,a]}var Ul=function(){return Ul=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ul.apply(this,arguments)};function Vl(e){return l().createElement(Tl,Ul({},e),l().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M112.092 140.376C101.162 146.595 88.5179 150.147 75.0446 150.147C33.5986 150.147 0 116.535 0 75.0733C0 33.6115 33.5986 0 75.0446 0C116.491 0 150.089 33.6115 150.089 75.0733C150.089 88.5145 146.558 101.131 140.374 112.044L186.485 158.173C191.17 162.86 191.17 170.46 186.485 175.147L175.151 186.485C170.466 191.172 162.869 191.172 158.184 186.485L112.092 140.376ZM120.071 75.0733C120.071 99.9504 99.9122 120.117 75.0446 120.117C50.177 120.117 30.0179 99.9504 30.0179 75.0733C30.0179 50.1962 50.177 30.0293 75.0446 30.0293C99.9122 30.0293 120.071 50.1962 120.071 75.0733Z",fill:e.color}))}function ql(e){var t,n,r,o=Hl(),i=o[0],a=o[1],c=e.placeholder||"Enter a search term",u=m("cludo-display-flex cludo-box-shadow-card cludo-border-radius-card cludo-p-4 cludo-mb-3 cludo-align-items-center cludo-bg-color-white",e.disableTheme,e.className,null===(t=e.classNames)||void 0===t?void 0:t.root),s=m("cludo-font-size-md cludo-py-1 cludo-px-2 cludo-font-family-default cludo-border-radius-button cludo-border-1-neutral cludo-height-sm cludo-flex-grow-1 cludo-bg-color-gray-light",e.disableTheme,null===(n=e.classNames)||void 0===n?void 0:n.input),d=m("cludo-theme-icon-btn-secondary cludo-ml-1",e.disableTheme,null===(r=e.classNames)||void 0===r?void 0:r.submitButton),f=e.submitIcon?e.submitIcon:l().createElement(Vl,{width:"100%",height:"100%",color:"#fff"});return l().createElement("form",{id:e.formId,onSubmit:function(t){t.preventDefault(),a.search(i.query),e.onSubmit&&e.onSubmit(t)},className:u},l().createElement("input",{type:"search",className:s,placeholder:c,onChange:function(t){a.setQuery(t.target.value),e.onChange&&e.onChange(t)},onBlur:e.onBlur,onKeyDown:e.onKeyDown,"aria-label":e.ariaLabel,value:i.query}),l().createElement("button",{className:d,type:"submit"},f))}function Wl(e){var t=c().context,n=Cr(),r=n[0],l=n[1];t.endlessScroll=e,(0,o.useEffect)((function(){if(Fo()){var t=function(){r.isLoading||(i instanceof Element?n(i):o())},n=function(t){t.scrollTop+t.clientHeight>=t.scrollHeight-e.bottomOffset&&r.currentPage<e.stopAfterPage&&r.resultCount>e.resultsPerPage&&r.currentPage<Math.ceil(r.resultCount/e.resultsPerPage)&&l.loadMore()},o=function(){Fo()&&window.scrollY+window.innerHeight>=document.body.scrollHeight-e.bottomOffset&&r.currentPage<e.stopAfterPage&&r.resultCount>e.resultsPerPage&&r.currentPage<Math.ceil(r.resultCount/e.resultsPerPage)&&l.loadMore()},i=(e.scrolledElementSelector?document.querySelector(e.scrolledElementSelector):window)||window;return i.addEventListener("scroll",t),function(){i.removeEventListener("scroll",t)}}}),[e]),(0,o.useEffect)((function(){var t;u({showLoadMore:(t=r).currentPage>=e.stopAfterPage&&t.resultCount>e.resultsPerPage&&t.currentPage<Math.ceil(t.resultCount/e.resultsPerPage),isLoading:t.isLoading})}),[r]);var i=(0,o.useState)({showLoadMore:!1,isLoading:!1}),a=i[0],u=i[1];return a}})(),r})()));
|
|
4
4
|
//# sourceMappingURL=main.csr.js.map
|