coveo-search-ui
Version:
Coveo JavaScript Search Framework
2 lines • 61.8 kB
JavaScript
webpackJsonpCoveo__temporary([18,42,56],{180:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(26),r=n(471),a=n(6),s=n(1),l=n(25),u=n(20),c=function(){function e(e,t,n,r){void 0===n&&(n=o.ModalBox),void 0===r&&(r={}),this.className=e,this.ownerElement=t,this.modalboxModule=n,this.options=i({sizeMod:"big"},r)}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return!!this.focusTrap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.activeModal&&this.activeModal.modalBox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this.activeModal&&this.activeModal.content},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapper",{get:function(){return this.activeModal&&this.activeModal.wrapper},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerElement",{get:function(){return this.element&&this.element.querySelector(".coveo-modal-header h1")},enumerable:!0,configurable:!0}),e.prototype.openResult=function(e){this.isOpen||(this.openModalAndTrap({content:e.content,validation:e.validation,origin:e.origin,title:u.DomUtils.getQuickviewHeader(e.result,e.options,e.bindings).el}),this.makeAccessible(e.options.title||e.result.title))},e.prototype.open=function(e){this.isOpen||(this.openModalAndTrap(e),this.makeAccessible())},e.prototype.openModalAndTrap=function(e){var t=this;this.initiallyFocusedElement=e.origin||document.activeElement,this.activeModal=this.modalboxModule.open(e.content,{title:e.title,className:this.className,validation:function(){return t.onModalClose(),e.validation()},body:this.ownerElement,sizeMod:this.options.sizeMod,overlayClose:this.options.overlayClose}),this.focusTrap=new r.FocusTrap(this.element)},e.prototype.close=function(){this.isOpen&&(this.activeModal.close(),this.activeModal=null)},e.prototype.makeAccessible=function(e){this.element.setAttribute("aria-modal","true"),e&&this.headerElement.setAttribute("aria-label",e),this.makeCloseButtonAccessible(),this.updateFocus()},Object.defineProperty(e.prototype,"closeButton",{get:function(){return this.element.querySelector(".coveo-small-close")},enumerable:!0,configurable:!0}),e.prototype.makeCloseButtonAccessible=function(){var e=this.closeButton;e.setAttribute("aria-label",a.l("Close")),e.setAttribute("role","button"),e.tabIndex=0,s.$$(e).on("keyup",l.KeyboardUtils.keypressAction(l.KEYBOARD.ENTER,function(){return e.click()}))},e.prototype.updateFocus=function(){(this.options.focusOnOpen&&this.options.focusOnOpen()||this.closeButton).focus()},e.prototype.onModalClose=function(){this.focusTrap.disable(),this.focusTrap=null,this.initiallyFocusedElement&&document.body.contains(this.initiallyFocusedElement)&&this.initiallyFocusedElement.focus()},e}();t.AccessibleModal=c},230:function(e,t,n){"use strict";function i(e){if(!e.answerSnippet)return"";try{return o.sanitize(e.answerSnippet,{USE_PROFILES:{html:!0}})}catch(t){return e.answerSnippet}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(589),r=n(1),a=n(475);t.getDefaultSnippetStyle=function(e){return'\n body {\n font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif, sans-serif;\n }\n\n .'+e+" > :first-child {\n margin-top: 0;\n }\n\n ."+e+" > :last-child {\n margin-bottom: 0;\n }\n"},t.getSanitizedAnswerSnippet=i,t.transformSnippetLinks=function(e,t,n){r.Dom.nodeListToArray(e.querySelectorAll("a")).forEach(function(e){a.bindAnalyticsToLink(e,function(){return n(e)}),e.target=t?"_blank":"_top"})}},299:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}l((i=i.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(a=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(r,n[1])).done)return a;switch(r=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,r=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(a=l.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){l.label=n[1];break}if(6===n[0]&&l.label<a[1]){l.label=a[1],a=n;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(n);break}a[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],r=0}finally{o=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,r,a,s,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};Object.defineProperty(t,"__esModule",{value:!0});var s=n(26),l=n(3),u=n(7),c=n(20);n(705);var p=n(0),d=n(706),h=n(10),f=n(707),m=n(708),y=n(6),b=n(523),g=n(4),v=n(8),A=n(230),S=n(71),E=[{analytics:h.AnalyticsSmartSnippetFeedbackReason.DoesNotAnswer,localeKey:"UsefulnessFeedbackDoesNotAnswer"},{analytics:h.AnalyticsSmartSnippetFeedbackReason.PartiallyAnswers,localeKey:"UsefulnessFeedbackPartiallyAnswers"},{analytics:h.AnalyticsSmartSnippetFeedbackReason.WasNotAQuestion,localeKey:"UsefulnessFeedbackWasNotAQuestion"},{analytics:h.AnalyticsSmartSnippetFeedbackReason.Other,localeKey:"Other",hasDetails:!0}],C="coveo-smart-snippet",N=C+"-content-wrapper",O=C+"-source";t.SmartSnippetClassNames={QUESTION_CLASSNAME:"coveo-smart-snippet-question",ANSWER_CONTAINER_CLASSNAME:"coveo-smart-snippet-answer",HAS_ANSWER_CLASSNAME:"coveo-smart-snippet-has-answer",SHADOW_CLASSNAME:"coveo-smart-snippet-content",CONTENT_CLASSNAME:N,SOURCE_CLASSNAME:O,SOURCE_TITLE_CLASSNAME:"coveo-smart-snippet-source-title",SOURCE_URL_CLASSNAME:"coveo-smart-snippet-source-url"};var _=function(e){function t(n,i,o,r){void 0===r&&(r=s.ModalBox);var a=e.call(this,n,t.ID,o)||this;return a.element=n,a.options=i,a.ModalBox=r,a.lastRenderedResult=null,a.options=v.ComponentOptions.initComponentOptions(n,t,i),a.bind.onRootElement(c.QueryEvents.deferredQuerySuccess,function(e){return a.handleQuerySuccess(e)}),a}return i(t,e),Object.defineProperty(t.prototype,"loading",{get:function(){return this.shadowLoading},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var e=c.$$(this.element).children().filter(function(e){return e instanceof HTMLScriptElement&&"text/css"===e.type.toLowerCase()}).map(function(e){return e.innerHTML});return e.length?e.join("\n"):null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasAnswer",{set:function(e){c.$$(this.element).toggleClass("coveo-smart-snippet-has-answer",e)},enumerable:!0,configurable:!0}),t.prototype.createDom=function(){var e=this;this.element.appendChild(this.buildAnswerContainer()),this.feedbackBanner=new d.UserFeedbackBanner(function(t){return t?e.sendLikeSmartSnippetAnalytics():e.sendDislikeSmartSnippetAnalytics()},function(){return e.openExplanationModal()}),this.element.appendChild(this.feedbackBanner.build()),this.explanationModal=new m.ExplanationModal({reasons:E.map(function(t){return{label:y.l(t.localeKey),id:t.analytics.replace(/_/g,"-"),onSelect:function(){return e.sendExplanationAnalytics(t.analytics,e.explanationModal.details)},hasDetails:t.hasDetails}}),onClosed:function(){return e.sendCloseFeedbackModalAnalytics()},ownerElement:this.searchInterface.options.modalContainer,modalBoxModule:this.ModalBox})},t.prototype.buildAnswerContainer=function(){return c.$$("div",{className:"coveo-smart-snippet-answer"},this.buildQuestion(),this.buildShadow(),this.buildHeightLimiter(),this.buildSourceContainer()).el},t.prototype.buildQuestion=function(){return this.questionContainer=c.$$("div",{className:"coveo-smart-snippet-question"}).el},t.prototype.buildShadow=function(){var e=this;return this.shadowContainer=c.$$("div",{className:"coveo-smart-snippet-content"}).el,this.snippetContainer=c.$$("section",{className:N}).el,this.shadowLoading=b.attachShadow(this.shadowContainer,{mode:"open",title:y.l("AnswerSnippet"),onSizeChanged:function(){return e.handleAnswerSizeChanged()},useIFrame:this.options.useIFrame}).then(function(t){t.appendChild(e.snippetContainer);var n=e.buildStyle();return t.appendChild(n),t}),this.shadowContainer},t.prototype.buildHeightLimiter=function(){var e=this;return(this.heightLimiter=new f.HeightLimiter(this.shadowContainer,this.shadowContainer.childNodes.item(0),this.options.maximumSnippetHeight,function(t){return t?e.sendExpandSmartSnippetAnalytics():e.sendCollapseSmartSnippetAnalytics()})).toggleButton},t.prototype.buildSourceContainer=function(){return this.sourceContainer=c.$$("div",{className:O}).el},t.prototype.buildStyle=function(){var e=g.Utils.isNullOrUndefined(this.style)?A.getDefaultSnippetStyle(N):this.style,t=document.createElement("style");return t.innerHTML=e,t},t.prototype.handleAnswerSizeChanged=function(){this.heightLimiter.onContentHeightChanged()},t.prototype.getCorrespondingResult=function(e){var t=this.queryController.getLastResults().results,n=p.flatten(p.map(t,function(e){return e.childResults})),i=p.flatten(p.map(t,function(e){return e.attachments}));return p.find(p.compact(t.concat(n,i)),function(t){return t.raw[e.documentId.contentIdKey]===e.documentId.contentIdValue})},t.prototype.handleQuerySuccess=function(e){return r(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return t=e.results.questionAnswer,this.containsQuestionAnswer(t)?(this.hasAnswer=!0,this.searchUid=e.results.searchUid,[4,this.render(t)]):(this.hasAnswer=!1,[2]);case 1:return n.sent(),[2]}})})},t.prototype.containsQuestionAnswer=function(e){return e&&e.question&&e.answerSnippet},t.prototype.render=function(e){return r(this,void 0,void 0,function(){return a(this,function(t){return this.ensureDom(),this.feedbackBanner.reset(),this.questionContainer.innerText=e.question,this.renderSnippet(e),this.lastRenderedResult=this.getCorrespondingResult(e),this.lastRenderedResult?this.renderSource():this.lastRenderedResult=null,[2]})})},t.prototype.renderSnippet=function(e){var t=this;this.snippetContainer.innerHTML=A.getSanitizedAnswerSnippet(e),A.transformSnippetLinks(this.snippetContainer,this.options.alwaysOpenInNewWindow,function(e){return t.sendClickSnippetLinkAnalytics(e)})},t.prototype.renderSource=function(){var e=c.$$(this.sourceContainer);e.empty(),e.append(this.renderSourceUrl().el),e.append(this.renderSourceTitle().el)},t.prototype.renderSourceTitle=function(){var e=this.buildLink("coveo-smart-snippet-source-title");return e.text(g.Utils.getFieldValue(this.lastRenderedResult,this.options.titleField)),e},t.prototype.renderSourceUrl=function(){var e=this.buildLink("coveo-smart-snippet-source-url");return e.text(e.el.href),e},t.prototype.buildLink=function(e){var t=this,n=c.$$("a",{className:"CoveoResultLink"});return n.addClass(e),new S.ResultLink(n.el,{hrefTemplate:this.options.hrefTemplate,logAnalytics:function(e){return t.sendClickSourceAnalytics(n.el,e)},alwaysOpenInNewWindow:this.options.alwaysOpenInNewWindow},o({},this.getBindings(),{resultElement:this.element}),this.lastRenderedResult),n},t.prototype.openExplanationModal=function(){this.sendOpenFeedbackModalAnalytics(),this.explanationModal.open(this.feedbackBanner.explainWhy)},t.prototype.sendLikeSmartSnippetAnalytics=function(){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.likeSmartSnippet,{searchQueryUid:this.searchUid},this.element)},t.prototype.sendDislikeSmartSnippetAnalytics=function(){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.dislikeSmartSnippet,{searchQueryUid:this.searchUid},this.element)},t.prototype.sendExpandSmartSnippetAnalytics=function(){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.expandSmartSnippet,{searchQueryUid:this.searchUid},this.element)},t.prototype.sendCollapseSmartSnippetAnalytics=function(){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.collapseSmartSnippet,{searchQueryUid:this.searchUid},this.element)},t.prototype.sendOpenFeedbackModalAnalytics=function(){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.openSmartSnippetFeedbackModal,{searchQueryUid:this.searchUid},this.element)},t.prototype.sendCloseFeedbackModalAnalytics=function(){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.closeSmartSnippetFeedbackModal,{searchQueryUid:this.searchUid},this.element)},t.prototype.sendExplanationAnalytics=function(e,t){return this.usageAnalytics.logCustomEvent(h.analyticsActionCauseList.sendSmartSnippetReason,{searchQueryUid:this.searchUid,reason:e,details:t},this.element)},t.prototype.sendClickSourceAnalytics=function(e,t){return this.usageAnalytics.logClickEvent(h.analyticsActionCauseList.openSmartSnippetSource,{searchQueryUid:this.searchUid,documentTitle:this.lastRenderedResult.title,author:g.Utils.getFieldValue(this.lastRenderedResult,"author"),documentURL:t},this.lastRenderedResult,e)},t.prototype.sendClickSnippetLinkAnalytics=function(e){return this.usageAnalytics.logClickEvent(h.analyticsActionCauseList.openSmartSnippetInlineLink,{searchQueryUid:this.searchUid,linkText:e.innerText,linkURL:e.href},this.lastRenderedResult,e)},t.ID="SmartSnippet",t.doExport=function(){l.exportGlobally({SmartSnippet:t})},t.options={maximumSnippetHeight:v.ComponentOptions.buildNumberOption({defaultValue:250,min:0}),titleField:v.ComponentOptions.buildFieldOption({defaultValue:"@title"}),hrefTemplate:v.ComponentOptions.buildStringOption(),alwaysOpenInNewWindow:v.ComponentOptions.buildBooleanOption({defaultValue:!1}),useIFrame:v.ComponentOptions.buildBooleanOption({defaultValue:!0})},t}(u.Component);t.SmartSnippet=_,c.Initialization.registerAutoCreateComponent(_)},471:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(31),o=n(0),r=n(1),a=function(){function e(e,t){void 0===t&&(t={focusableSelector:"[tabindex], button"}),this.container=e,this.options=t,this.hiddenElements=[],this.enable()}return Object.defineProperty(e.prototype,"focusableElements",{get:function(){return o.chain(r.Dom.nodeListToArray(this.container.querySelectorAll(this.options.focusableSelector))).filter(function(e){return r.$$(e).isVisible()}).sortBy(function(e){return e.tabIndex}).value()},enumerable:!0,configurable:!0}),e.prototype.disable=function(){document.removeEventListener("focusin",this.focusInEvent),document.removeEventListener("focusout",this.focusOutEvent),this.showHiddenElements(),this.enabled=!1},e.prototype.enable=function(){var e=this;document.addEventListener("focusin",this.focusInEvent=function(t){return e.onFocusIn(t)}),document.addEventListener("focusout",this.focusOutEvent=function(t){return e.onFocusOut(t)}),this.hideAllExcept(this.container),this.enabled=!0},e.prototype.showHiddenElements=function(){for(;this.hiddenElements.length;)this.hiddenElements.pop().removeAttribute("aria-hidden")},e.prototype.hideElement=function(e){e.getAttribute("aria-hidden")||(this.hiddenElements.push(e),e.setAttribute("aria-hidden",""+!0))},e.prototype.hideSiblings=function(e){var t=this,n=e.parentElement;n&&o.without(r.$$(n).children(),e).forEach(function(e){t.hideElement(e)})},e.prototype.hideAllExcept=function(e){this.hideSiblings(e);var t=e.parentElement;t&&t!==document.body&&this.hideAllExcept(t)},e.prototype.getFocusableSibling=function(e,t){void 0===t&&(t=!1);var n=this.focusableElements,i=n.indexOf(e);return-1===i?null:n[(i+(t?-1:1)+n.length)%n.length]},e.prototype.focusSibling=function(e,t){void 0===t&&(t=!1);var n=this.getFocusableSibling(e,t);n&&n.focus()},e.prototype.focusFirstElement=function(){var e=this.focusableElements;e.length&&e[0].focus()},e.prototype.elementIsBefore=function(e,t){return!!t&&e.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING},e.prototype.onLosingFocus=function(e,t){var n=this;i.Defer.defer(function(){n.enabled&&(n.enabled=!1,e&&n.focusIsAllowed(e)?n.focusSibling(e,n.elementIsBefore(e,t)):n.focusFirstElement(),n.enabled=!0)})},e.prototype.focusIsAllowed=function(e){return this.container.contains(e)},e.prototype.elementIsInPage=function(e){return e&&e!==document.body.parentElement},e.prototype.onFocusIn=function(e){if(this.enabled){var t=e.relatedTarget;if(!this.elementIsInPage(t)){var n=e.target;this.elementIsInPage(n)&&(this.focusIsAllowed(n)||this.onLosingFocus(null,n))}}},e.prototype.onFocusOut=function(e){if(this.enabled){var t=e.relatedTarget;this.elementIsInPage(t)&&(t&&this.focusIsAllowed(t)||this.onLosingFocus(e.target,t))}},e}();t.FocusTrap=a},475:function(e,t,n){"use strict";function i(e,t){var n=o.once(function(){return t()});r.$$(e).on(["contextmenu","click","mousedown","mouseup"],n);var i;r.$$(e).on("touchstart",function(){i=window.setTimeout(n,1e3)}),r.$$(e).on("touchend",function(){i&&clearTimeout(i)})}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=n(1);t.bindAnalyticsToLink=i},523:function(e,t,n){"use strict";function i(e,t){return r(this,void 0,void 0,function(){var n,i,r,l,u;return a(this,function(a){switch(a.label){case 0:return n={className:"coveo-shadow-iframe",scrolling:"no",title:t.title},t.useIFrame?(i=s.$$("iframe",n).el,l=new Promise(function(e){return i.addEventListener("load",function(){return e()})}),e.appendChild(i),[4,l]):[3,2];case 1:return a.sent(),r=i.contentDocument.body,[3,3];case 2:i=s.$$("div",n).el,r=i,e.appendChild(i),a.label=3;case 3:return r.style.margin="0",u=s.$$("div",{style:"overflow: auto;"}).el,r.appendChild(u),o(i,u,t.onSizeChanged),"open"===t.mode&&Object.defineProperty(e,"shadowRoot",{get:function(){return u}}),[2,u]}})})}function o(e,t,n){var i=t.clientWidth,o=t.clientHeight;new MutationObserver(function(){i===t.clientWidth&&o===t.clientHeight||(i=t.clientWidth,o=t.clientHeight,e.style.width=t.clientWidth+"px",e.style.height=t.clientHeight+"px",n&&n())}).observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}var r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}l((i=i.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(a=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(r,n[1])).done)return a;switch(r=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,r=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(a=l.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){l.label=n[1];break}if(6===n[0]&&l.label<a[1]){l.label=a[1],a=n;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(n);break}a[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],r=0}finally{o=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,r,a,s,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1);n(588),t.attachShadow=i},535:function(e,t){},561:function(e,t){},588:function(e,t){},589:function(e,t,n){/*! @license DOMPurify 2.5.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.4/LICENSE */
!function(t,n){e.exports=n()}(0,function(){"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,n){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function i(e,o,r){return i=n()?Reflect.construct:function(e,n,i){var o=[null];o.push.apply(o,n);var r=Function.bind.apply(e,o),a=new r;return i&&t(a,i.prototype),a},i.apply(null,arguments)}function o(e){return r(e)||a(e)||s(e)||u()}function r(e){if(Array.isArray(e))return l(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e){return"number"==typeof e&&isNaN(e)}function p(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return O(e,t,i)}}function d(e,t,n){var i;n=null!==(i=n)&&void 0!==i?i:L,b&&b(e,null);for(var o=t.length;o--;){var r=t[o];if("string"==typeof r){var a=n(r);a!==r&&(g(t)||(t[o]=a),r=a)}e[r]=!0}return e}function h(e){var t,n=C(null);for(t in e)!0===O(y,e,[t])&&(n[t]=e[t]);return n}function f(e,t){function n(e){return console.warn("fallback value for",e),null}for(;null!==e;){var i=A(e,t);if(i){if(i.get)return p(i.get);if("function"==typeof i.value)return p(i.value)}e=v(e)}return n}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re(),n=function(e){return m(e)};if(n.version="2.5.4",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var i=t.document,r=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,l=t.Node,u=t.Element,p=t.NodeFilter,y=t.NamedNodeMap,b=void 0===y?t.NamedNodeMap||t.MozNamedAttrMap:y,g=t.HTMLFormElement,v=t.DOMParser,A=t.trustedTypes,E=u.prototype,C=f(E,"cloneNode"),N=f(E,"nextSibling"),O=f(E,"childNodes"),_=f(E,"parentNode");if("function"==typeof s){var se=r.createElement("template");se.content&&se.content.ownerDocument&&(r=se.content.ownerDocument)}var le=ae(A,i),ue=le?le.createHTML(""):"",ce=r,pe=ce.implementation,de=ce.createNodeIterator,he=ce.createDocumentFragment,fe=ce.getElementsByTagName,me=i.importNode,ye={};try{ye=h(r).documentMode?r.documentMode:{}}catch(e){}var be={};n.isSupported="function"==typeof _&&pe&&void 0!==pe.createHTMLDocument&&9!==ye;var ge,ve,Ae=V,Se=K,Ee=X,Ce=Z,Ne=J,Oe=te,_e=ne,we=oe,Te=ee,ke=null,Le=d({},[].concat(o(B),o(F),o(P),o(j),o(z))),xe=null,Me=d({},[].concat(o(G),o(Q),o(Y),o(q))),Re=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ie=null,Ue=null,$e=!0,De=!0,Be=!1,Fe=!0,Pe=!1,He=!0,je=!1,We=!1,ze=!1,Ge=!1,Qe=!1,Ye=!1,qe=!0,Ve=!1,Ke=!0,Xe=!1,Ze={},Je=null,et=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),tt=null,nt=d({},["audio","video","img","source","image","track"]),it=null,ot=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",lt=st,ut=!1,ct=null,pt=d({},[rt,at,st],x),dt=["application/xhtml+xml","text/html"],ht=null,ft=r.createElement("form"),mt=function(e){return e instanceof RegExp||e instanceof Function},yt=function(t){ht&&ht===t||(t&&"object"===e(t)||(t={}),t=h(t),ge=ge=-1===dt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ve="application/xhtml+xml"===ge?x:L,ke="ALLOWED_TAGS"in t?d({},t.ALLOWED_TAGS,ve):Le,xe="ALLOWED_ATTR"in t?d({},t.ALLOWED_ATTR,ve):Me,ct="ALLOWED_NAMESPACES"in t?d({},t.ALLOWED_NAMESPACES,x):pt,it="ADD_URI_SAFE_ATTR"in t?d(h(ot),t.ADD_URI_SAFE_ATTR,ve):ot,tt="ADD_DATA_URI_TAGS"in t?d(h(nt),t.ADD_DATA_URI_TAGS,ve):nt,Je="FORBID_CONTENTS"in t?d({},t.FORBID_CONTENTS,ve):et,Ie="FORBID_TAGS"in t?d({},t.FORBID_TAGS,ve):{},Ue="FORBID_ATTR"in t?d({},t.FORBID_ATTR,ve):{},Ze="USE_PROFILES"in t&&t.USE_PROFILES,$e=!1!==t.ALLOW_ARIA_ATTR,De=!1!==t.ALLOW_DATA_ATTR,Be=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Pe=t.SAFE_FOR_TEMPLATES||!1,He=!1!==t.SAFE_FOR_XML,je=t.WHOLE_DOCUMENT||!1,Ge=t.RETURN_DOM||!1,Qe=t.RETURN_DOM_FRAGMENT||!1,Ye=t.RETURN_TRUSTED_TYPE||!1,ze=t.FORCE_BODY||!1,qe=!1!==t.SANITIZE_DOM,Ve=t.SANITIZE_NAMED_PROPS||!1,Ke=!1!==t.KEEP_CONTENT,Xe=t.IN_PLACE||!1,Te=t.ALLOWED_URI_REGEXP||Te,lt=t.NAMESPACE||st,Re=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Re.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Re.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Re.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(De=!1),Qe&&(Ge=!0),Ze&&(ke=d({},o(z)),xe=[],!0===Ze.html&&(d(ke,B),d(xe,G)),!0===Ze.svg&&(d(ke,F),d(xe,Q),d(xe,q)),!0===Ze.svgFilters&&(d(ke,P),d(xe,Q),d(xe,q)),!0===Ze.mathMl&&(d(ke,j),d(xe,Y),d(xe,q))),t.ADD_TAGS&&(ke===Le&&(ke=h(ke)),d(ke,t.ADD_TAGS,ve)),t.ADD_ATTR&&(xe===Me&&(xe=h(xe)),d(xe,t.ADD_ATTR,ve)),t.ADD_URI_SAFE_ATTR&&d(it,t.ADD_URI_SAFE_ATTR,ve),t.FORBID_CONTENTS&&(Je===et&&(Je=h(Je)),d(Je,t.FORBID_CONTENTS,ve)),Ke&&(ke["#text"]=!0),je&&d(ke,["html","head","body"]),ke.table&&(d(ke,["tbody"]),delete Ie.tbody),S&&S(t),ht=t)},bt=d({},["mi","mo","mn","ms","mtext"]),gt=d({},["foreignobject","annotation-xml"]),vt=d({},["title","style","font","a","script"]),At=d({},F);d(At,P),d(At,H);var St=d({},j);d(St,W);var Et=function(e){var t=_(e);t&&t.tagName||(t={namespaceURI:lt,tagName:"template"});var n=L(e.tagName),i=L(t.tagName);return!!ct[e.namespaceURI]&&(e.namespaceURI===at?t.namespaceURI===st?"svg"===n:t.namespaceURI===rt?"svg"===n&&("annotation-xml"===i||bt[i]):Boolean(At[n]):e.namespaceURI===rt?t.namespaceURI===st?"math"===n:t.namespaceURI===at?"math"===n&>[i]:Boolean(St[n]):e.namespaceURI===st?!(t.namespaceURI===at&&!gt[i])&&(!(t.namespaceURI===rt&&!bt[i])&&(!St[n]&&(vt[n]||!At[n]))):!("application/xhtml+xml"!==ge||!ct[e.namespaceURI]))},Ct=function(e){k(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ue}catch(t){e.remove()}}},Nt=function(e,t){try{k(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){k(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Ge||Qe)try{Ct(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ot=function(e){var t,n;if(ze)e="<remove></remove>"+e;else{var i=M(e,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===ge&<===st&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=le?le.createHTML(e):e;if(lt===st)try{t=(new v).parseFromString(o,ge)}catch(e){}if(!t||!t.documentElement){t=pe.createDocument(lt,"template",null);try{t.documentElement.innerHTML=ut?ue:o}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),lt===st?fe.call(t,je?"html":"body")[0]:je?t.documentElement:a},_t=function(e){return de.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null,!1)},wt=function(e){return e instanceof g&&(void 0!==e.__depth&&"number"!=typeof e.__depth||void 0!==e.__removalCount&&"number"!=typeof e.__removalCount||"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof b)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Tt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},kt=function(e,t,i){be[e]&&w(be[e],function(e){e.call(n,t,i,ht)})},Lt=function(e){var t;if(kt("beforeSanitizeElements",e,null),wt(e))return Ct(e),!0;if($(/[\u0080-\uFFFF]/,e.nodeName))return Ct(e),!0;var i=ve(e.nodeName);if(kt("uponSanitizeElement",e,{tagName:i,allowedTags:ke}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&(!Tt(e.content)||!Tt(e.content.firstElementChild))&&$(/<[/\w]/g,e.innerHTML)&&$(/<[/\w]/g,e.textContent))return Ct(e),!0;if("select"===i&&$(/<template/i,e.innerHTML))return Ct(e),!0;if(7===e.nodeType)return Ct(e),!0;if(He&&8===e.nodeType&&$(/<[/\w]/g,e.data))return Ct(e),!0;if(!ke[i]||Ie[i]){if(!Ie[i]&&Mt(i)){if(Re.tagNameCheck instanceof RegExp&&$(Re.tagNameCheck,i))return!1;if(Re.tagNameCheck instanceof Function&&Re.tagNameCheck(i))return!1}if(Ke&&!Je[i]){var o=_(e)||e.parentNode,r=O(e)||e.childNodes;if(r&&o)for(var a=r.length,s=a-1;s>=0;--s){var l=C(r[s],!0);l.__removalCount=(e.__removalCount||0)+1,o.insertBefore(l,N(e))}}return Ct(e),!0}return e instanceof u&&!Et(e)?(Ct(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!$(/<\/no(script|embed|frames)/i,e.innerHTML)?(Pe&&3===e.nodeType&&(t=e.textContent,t=R(t,Ae," "),t=R(t,Se," "),t=R(t,Ee," "),e.textContent!==t&&(k(n.removed,{element:e.cloneNode()}),e.textContent=t)),kt("afterSanitizeElements",e,null),!1):(Ct(e),!0)},xt=function(e,t,n){if(qe&&("id"===t||"name"===t)&&(n in r||n in ft||"__depth"===n||"__removalCount"===n))return!1;if(De&&!Ue[t]&&$(Ce,t));else if($e&&$(Ne,t));else if(!xe[t]||Ue[t]){if(!(Mt(e)&&(Re.tagNameCheck instanceof RegExp&&$(Re.tagNameCheck,e)||Re.tagNameCheck instanceof Function&&Re.tagNameCheck(e))&&(Re.attributeNameCheck instanceof RegExp&&$(Re.attributeNameCheck,t)||Re.attributeNameCheck instanceof Function&&Re.attributeNameCheck(t))||"is"===t&&Re.allowCustomizedBuiltInElements&&(Re.tagNameCheck instanceof RegExp&&$(Re.tagNameCheck,n)||Re.tagNameCheck instanceof Function&&Re.tagNameCheck(n))))return!1}else if(it[t]);else if($(Te,R(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==I(n,"data:")||!tt[e]){if(Be&&!$(Oe,R(n,_e,"")));else if(n)return!1}else;return!0},Mt=function(e){return"annotation-xml"!==e&&M(e,we)},Rt=function(t){var i,o,r,a;kt("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(a=s.length;a--;){i=s[a];var u=i,c=u.name,p=u.namespaceURI;if(o="value"===c?i.value:U(i.value),r=ve(c),l.attrName=r,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,kt("uponSanitizeAttribute",t,l),o=l.attrValue,!l.forceKeepAttr&&(Nt(c,t),l.keepAttr))if(Fe||!$(/\/>/i,o))if(He&&$(/((--!?|])>)|<\/(style|title)/i,o))Nt(c,t);else{Pe&&(o=R(o,Ae," "),o=R(o,Se," "),o=R(o,Ee," "));var d=ve(t.nodeName);if(xt(d,r,o)){if(!Ve||"id"!==r&&"name"!==r||(Nt(c,t),o="user-content-"+o),le&&"object"===e(A)&&"function"==typeof A.getAttributeType)if(p);else switch(A.getAttributeType(d,r)){case"TrustedHTML":o=le.createHTML(o);break;case"TrustedScriptURL":o=le.createScriptURL(o)}try{p?t.setAttributeNS(p,c,o):t.setAttribute(c,o),wt(t)?Ct(t):T(n.removed)}catch(e){}}}else Nt(c,t)}kt("afterSanitizeAttributes",t,null)}},It=function e(t){var n,i=_t(t);for(kt("beforeSanitizeShadowDOM",t,null);n=i.nextNode();)if(kt("uponSanitizeShadowNode",n,null),!Lt(n)){var o=_(n);1===n.nodeType&&(o&&o.__depth?n.__depth=(n.__removalCount||0)+o.__depth+1:n.__depth=1),(n.__depth>=255||c(n.__depth))&&Ct(n),n.content instanceof a&&(n.content.__depth=n.__depth,e(n.content)),Rt(n)}kt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(o){var r,s,u,p,d,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ut=!o,ut&&(o="\x3c!--\x3e"),"string"!=typeof o&&!Tt(o)){if("function"!=typeof o.toString)throw D("toString is not a function");if("string"!=typeof(o=o.toString()))throw D("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof o)return t.toStaticHTML(o);if(Tt(o))return t.toStaticHTML(o.outerHTML)}return o}if(We||yt(h),n.removed=[],"string"==typeof o&&(Xe=!1),Xe){if(o.nodeName){var f=ve(o.nodeName);if(!ke[f]||Ie[f])throw D("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof l)r=Ot("\x3c!----\x3e"),s=r.ownerDocument.importNode(o,!0),1===s.nodeType&&"BODY"===s.nodeName?r=s:"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!Ge&&!Pe&&!je&&-1===o.indexOf("<"))return le&&Ye?le.createHTML(o):o;if(!(r=Ot(o)))return Ge?null:Ye?ue:""}r&&ze&&Ct(r.firstChild);for(var m=_t(Xe?o:r);u=m.nextNode();)if((3!==u.nodeType||u!==p)&&!Lt(u)){var y=_(u);1===u.nodeType&&(y&&y.__depth?u.__depth=(u.__removalCount||0)+y.__depth+1:u.__depth=1),(u.__depth>=255||c(u.__depth))&&Ct(u),u.content instanceof a&&(u.content.__depth=u.__depth,It(u.content)),Rt(u),p=u}if(p=null,Xe)return o;if(Ge){if(Qe)for(d=he.call(r.ownerDocument);r.firstChild;)d.appendChild(r.firstChild);else d=r;return(xe.shadowroot||xe.shadowrootmod)&&(d=me.call(i,d,!0)),d}var b=je?r.outerHTML:r.innerHTML;return je&&ke["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&$(ie,r.ownerDocument.doctype.name)&&(b="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+b),Pe&&(b=R(b,Ae," "),b=R(b,Se," "),b=R(b,Ee," ")),le&&Ye?le.createHTML(b):b},n.setConfig=function(e){yt(e),We=!0},n.clearConfig=function(){ht=null,We=!1},n.isValidAttribute=function(e,t,n){ht||yt({});var i=ve(e),o=ve(t);return xt(i,o,n)},n.addHook=function(e,t){"function"==typeof t&&(be[e]=be[e]||[],k(be[e],t))},n.removeHook=function(e){if(be[e])return T(be[e])},n.removeHooks=function(e){be[e]&&(be[e]=[])},n.removeAllHooks=function(){be={}},n}var y=Object.hasOwnProperty,b=Object.setPrototypeOf,g=Object.isFrozen,v=Object.getPrototypeOf,A=Object.getOwnPropertyDescriptor,S=Object.freeze,E=Object.seal,C=Object.create,N="undefined"!=typeof Reflect&&Reflect,O=N.apply,_=N.construct;O||(O=function(e,t,n){return e.apply(t,n)}),S||(S=function(e){return e}),E||(E=function(e){return e}),_||(_=function(e,t){return i(e,o(t))});var w=p(Array.prototype.forEach),T=p(Array.prototype.pop),k=p(Array.prototype.push),L=p(String.prototype.toLowerCase),x=p(String.prototype.toString),M=p(String.prototype.match),R=p(String.prototype.replace),I=p(String.prototype.indexOf),U=p(String.prototype.trim),$=p(RegExp.prototype.test),D=function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return _(e,n)}}(TypeError),B=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),H=S(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),j=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),W=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),z=S(["#text"]),G=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Q=S(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Y=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),q=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),V=E(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=E(/<%[\w\W]*|[\w\W]*%>/gm),X=E(/\${[\w\W]*}/gm),Z=E(/^data-[\-\w.\u00B7-\uFFFF]/),J=E(/^aria-[\-\w]+$/),ee=E(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),te=E(/^(?:\w+script|data):/i),ne=E(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ie=E(/^html$/i),oe=E(/^[a-z][.\w]*(-[.\w]+)+$/i),re=function(){return"undefined"==typeof window?null:window},ae=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var i=null;n.currentScript&&n.currentScript.hasAttribute("data-tt-policy-suffix")&&(i=n.currentScript.getAttribute("data-tt-policy-suffix"));var o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return m()})},705:function(e,t){},706:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(1),a=n(6),s=n(12),l=n(0),u="coveo-user-feedback-banner",c=u+"-label",p=u+"-button-active",d="coveo-user-feedback-banner-thanks-icon";!function(e){e[e.Unknown=0]="Unknown",e[e.Yes=1]="Yes",e[e.No=2]="No"}(o||(o={})),t.UserFeedbackBannerClassNames={ROOT_CLASSNAME:u,CONTAINER_CLASSNAME:"coveo-user-feedback-banner-container",LABEL_CLASSNAME:c,BUTTONS_CONTAINER_CLASSNAME:"coveo-user-feedback-banner-buttons",YES_BUTTON_CLASSNAME:"coveo-user-feedback-banner-yes-button",NO_BUTTON_CLASSNAME:"coveo-user-feedback-banner-no-button",BUTTON_ACTIVE_CLASSNAME:p,THANK_YOU_BANNER_CLASSNAME:"coveo-user-feedback-banner-thanks",THANK_YOU_BANNER_ACTIVE_CLASSNAME:"coveo-user-feedback-banner-thanks-active",ICON_CLASSNAME:d,EXPLAIN_WHY_CLASSNAME:"coveo-user-feedback-banner-explain-why",EXPLAIN_WHY_ACTIVE_CLASSNAME:"coveo-user-feedback-banner-explain-why-active"};var h=function(){function e(e,t){this.sendUsefulnessAnalytics=e,this.onExplainWhyPressed=t,this.isUseful=o.Unknown,this.labelId=l.uniqueId(c)}return e.prototype.build=function(){return r.$$("div",{className:u,ariaLive:"polite"},this.buildContainer(),this.buildThankYouBanner()).el},e.prototype.reset=function(){this.isUseful=o.Unknown,r.$$(this.yesButton).removeClass(p),r.$$(this.yesButton).setAttribute("aria-pressed","false"),r.$$(this.noButton).removeClass(p),r.$$(this.noButton).setAttribute("aria-pressed","false"),r.$$(this.thankYouBanner).removeClass("coveo-user-feedback-banner-thanks-active"),r.$$(this.explainWhy).removeClass("coveo-user-feedback-banner-explain-why-active")},e.prototype.buildContainer=function(){return r.$$("div",{className:"coveo-user-feedback-banner-container",ariaLabelledby:this.labelId},this.buildLabel(),this.buildButtons()).el},e.prototype.buildLabel=function(){return r.$$("span",{className:c,id:this.labelId},a.l("UsefulnessFeedbackRequest")).el},e.prototype.buildThankYouBanner=function(){var e=this;this.thankYouBanner=r.$$("div",{className:"coveo-user-feedback-banner-thanks"}).el;var t=r.$$("span",{},a.l("UsefulnessFeedbackThankYou")).el;return this.thankYouBanner.appendChild(t),this.explainWhy=this.buildButton({text:a.l("UsefulnessFeedbackExplainWhy"),className:"coveo-user-feedback-banner-explain-why",action:function(){return e.requestExplaination()}}),this.thankYouBanner.appendChild(this.explainWhy),this.thankYouBanner},e.prototype.buildButtons=function(){var e=this,t=r.$$("div",{className:"coveo-user-feedback-banner-buttons"}).el;return this.yesButton=this.buildButton({text:a.l("Yes"),className:"coveo-user-feedback-banner-yes-button",action:function(){return e.showThankYouBanner(!0)},icon:{className:d,content:s.SVGIcons.icons.checkYes},attributes:{ariaPressed:!1,ariaDescribedby:this.labelId}}),this.yesButton.setAttribute("aria-pressed","false"),t.appendChild(this.yesButton),this.noButton=this.buildButton({text:a.l("No"),className:"coveo-user-feedback-banner-no-button",action:function(){return e.showThankYouBanner(!1)},icon:{className:d,content:s.SVGIcons.icons.clearSmall},attributes:{ariaPressed:!1,ariaDescribedby:this.labelId}}),t.appendChild(this.noButton),t},e.prototype.buildButton=function(e){var t=r.$$("button",i({},e.attributes||{},{className:e.className,type:"button"})).el;if(e.icon){var n=r.$$("span",{className:e.icon.className},e.icon.content).el;t.appendChild(n);var o=r.$$("span",{},e.text).el;t.appendChild(o)}else t.innerText=e.text;return t.addEventListener("click",function(){return e.action()}),t},e.prototype.showThankYouBanner=function(e){this.isUseful!==o.Unknown&&e===(this.isUseful===o.Yes)||(this.isUseful=e?o.Yes:o.No,r.$$(this.yesButton).toggleClass(p,e),r.$$(this.yesButton).setAttribute("aria-pressed",""+e),r.$$(this.noButton).toggleClass(p,!e),r.$$(this.noButton).setAttribute("aria-pressed",""+!e),r.$$(this.thankYouBanner).addClass("coveo-user-feedback-banner-thanks-active"),r.$$(this.explainWhy).toggleClass("coveo-user-feedback-banner-explain-why-active",!e),this.sendUsefulnessAnalytics(e))},e.prototype.requestExplaination=function(){this.onExplainWhyPressed()},e}();t.UserFeedbackBanner=h},707:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(12),r=n(6),a="coveo-height-limiter-button";t.HeightLimiterClassNames={CONTAINER_ACTIVE_CLASSNAME:"coveo-height-limiter-container-active",CONTAINER_EXPANDED_CLASSNAME:"coveo-height-limiter-container-expanded",BUTTON_CLASSNAME:a,BUTTON_LABEL_CLASSNAME:"coveo-height-limiter-button-label",BUTTON_ICON_CLASSNAME:"coveo-height-limiter-button-icon",BUTTON_ACTIVE_CLASSNAME:"coveo-height-limiter-button-active"};var s=function(){function e(e,t,n,i){this.containerElement=e,this.contentElement=t,this.heightLimit=n,this.onToggle=i,this.isExpanded=!1,this.buildButton(),this.updateActiveAppearance()}return Object.defineProperty(e.prototype,"toggleButton",{get:function(){return this.button},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{set:function(e){this.containerElement.style.height=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentHeight",{get:function(){return this.contentElement.clientHeight},enumerable:!0,configurable:!0}),e.prototype.onContentHeightChanged=function(){this.updateActiveAppearance()},e.prototype.buildButton=function(){var e=this;return this.button=i.$$("button",{className:a,type:"button",ariaLabel:r.l("ShowMore"),ariaPressed:"false",ariaHidden:"true"},this.buttonLabel=i.$$("span",{className:"coveo-height-limiter-button-label"}).el,this.buttonIcon=i.$$("span",{className:"coveo-height-limiter-button-icon"}).el).el,this.button.addEventListener("click",function(){return e.toggle()}),this.updateButton(),this.button},e.prototype.updateActiveAppearance=function(){var e=this.contentHeight>this.heightLimit;i.$$(this.containerElement).toggleClass("coveo-height-limiter-container-active",e),i.$$(this.button).toggleClass("coveo-height-limiter-button-active",e),e?this.updateExpandedAppearance():(this.isExpanded=!1,this.updateExpandedAppearance(),this.containerElement.style.height="")},e.prototype.updateButton=function(){this.buttonLabel.innerText=this.isExpanded?r.l("ShowLess"):r.l("ShowMore"),this.button.setAttribute("aria-pressed",""+this.isExpanded),this.buttonIcon.innerHTML=this.isExpanded?o.SVGIcons.icons.arrowUp:o.SVGIcons.icons.arrowDown},e.prototype.updateExpandedAppearance=function(){this.updateButton(),i.$$(this.containerElement).toggleClass("coveo-height-limiter-container-expanded",this.isExpanded),this.height=this.isExpanded?this.contentHeight:this.heightLimit},e.prototype.toggle=function(){thi