smartdown
Version:
A library for translating, rendering and interacting with Smartdown documents. Smartdown is an extension of Markdown that provides richer media support and reactive programming capability.
2 lines • 74.2 kB
JavaScript
/*! For license information please see webcomponents-sd.js.LICENSE.txt */
(function(){"use strict";var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}function n(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function r(e){if(!(e instanceof Array)){e=n(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(){}function s(e){return e.__shady||(e.__shady=new o),e.__shady}function a(e){return e&&e.__shady}o.prototype.toJSON=function(){return{}};var l=window.ShadyDOM||{};l.xa=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var d,u=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");l.j=!!(u&&u.configurable&&u.get),l.Z=l.force||!l.xa,l.s=l.noPatch||!1,l.L=l.preferPerformance,l.ba="on-demand"===l.s;var h=l.querySelectorImplementation;function c(){return Document.prototype.msElementsFromPoint?"msElementsFromPoint":"elementsFromPoint"}function _(e){return(e=a(e))&&void 0!==e.firstChild}function f(e){return e instanceof ShadowRoot}function p(e){return(e=(e=a(e))&&e.root)&&un(e)}d=-1<["native","selectorEngine"].indexOf(h)?h:void 0,l.Ka=d,l.la=navigator.userAgent.match("Trident");var v=Element.prototype,y=v.matches||v.matchesSelector||v.mozMatchesSelector||v.msMatchesSelector||v.oMatchesSelector||v.webkitMatchesSelector,m=document.createTextNode(""),g=0,b=[];function N(e){b.push(e),m.textContent=g++}new MutationObserver((function(){for(;b.length;)try{b.shift()()}catch(e){throw m.textContent=g++,e}})).observe(m,{characterData:!0});var E=document.contains?function(e,t){return e.__shady_native_contains(t)}:function(e,t){return e===t||e.documentElement&&e.documentElement.__shady_native_contains(t)};function S(e,t){for(;t;){if(t==e)return!0;t=t.__shady_parentNode}return!1}function C(e){for(var t=e.length-1;0<=t;t--){var r=e[t],i=r.getAttribute("id")||r.getAttribute("name");i&&"length"!==i&&isNaN(i)&&(e[i]=r)}return e.item=function(t){return e[t]},e.namedItem=function(t){if("length"!==t&&isNaN(t)&&e[t])return e[t];for(var r=n(e),i=r.next();!i.done;i=r.next())if(((i=i.value).getAttribute("id")||i.getAttribute("name"))==t)return i;return null},e}function w(e){var t=[];for(e=e.__shady_native_firstChild;e;e=e.__shady_native_nextSibling)t.push(e);return t}function T(e){var t=[];for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling)t.push(e);return t}function O(e,t,n){if(n.configurable=!0,n.value)e[t]=n.value;else try{Object.defineProperty(e,t,n)}catch(e){}}function x(e,t,n,r){for(var i in n=void 0===n?"":n,t)r&&0<=r.indexOf(i)||O(e,n+i,t[i])}function D(e,t){for(var n in t)n in e&&O(e,n,t[n])}function M(e){var t={};return Object.getOwnPropertyNames(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t}function P(e,t){for(var n,r=Object.getOwnPropertyNames(t),i=0;i<r.length;i++)e[n=r[i]]=t[n]}function A(e){return e instanceof Node?e:document.createTextNode(""+e)}function L(e){for(var t=[],r=0;r<arguments.length;++r)t[r]=arguments[r];if(1===t.length)return A(t[0]);r=document.createDocumentFragment();for(var i=(t=n(t)).next();!i.done;i=t.next())r.appendChild(A(i.value));return r}function R(e){var t;for(t=void 0===t?1:t;0<t;t--)e=e.reduce((function(e,t){return Array.isArray(t)?e.push.apply(e,r(t)):e.push(t),e}),[]);return e}var j,I=[];function k(e){j||(j=!0,N(H)),I.push(e)}function H(){j=!1;for(var e=!!I.length;I.length;)I.shift()();return e}function F(){this.g=!1,this.addedNodes=[],this.removedNodes=[],this.R=new Set}H.list=I,F.prototype.flush=function(){if(this.g){this.g=!1;var e=this.takeRecords();e.length&&this.R.forEach((function(t){t(e)}))}},F.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var e=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];return this.addedNodes=[],this.removedNodes=[],e}return[]};var B=/[&\u00A0"]/g,U=/[&\u00A0<>]/g;function q(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case" ":return" "}}function V(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}var G=V("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),W=V("style script xmp iframe noembed noframes plaintext noscript".split(" "));function X(e,t){"template"===e.localName&&(e=e.content);for(var n="",r=t?t(e):e.childNodes,i=0,o=r.length,s=void 0;i<o&&(s=r[i]);i++){e:{var a=s,l=e,d=t;switch(a.nodeType){case Node.ELEMENT_NODE:for(var u,h="<"+(l=a.localName),c=a.attributes,_=0;u=c[_];_++)h+=" "+u.name+'="'+u.value.replace(B,q)+'"';h+=">",a=G[l]?h:h+X(a,d)+"</"+l+">";break e;case Node.TEXT_NODE:a=a.data,a=l&&W[l.localName]?a:a.replace(U,q);break e;case Node.COMMENT_NODE:a="\x3c!--"+a.data+"--\x3e";break e;default:throw window.console.error(a),Error("not implemented")}}n+=a}return n}var z=l.j,J={querySelector:function(e){return this.__shady_native_querySelector(e)},querySelectorAll:function(e){return this.__shady_native_querySelectorAll(e)}},K={};function $(e){K[e]=function(t){return t["__shady_native_"+e]}}function Y(e,t){for(var n in x(e,t,"__shady_native_"),t)$(n)}function Z(e,t){t=void 0===t?[]:t;for(var n=0;n<t.length;n++){var r=t[n],i=Object.getOwnPropertyDescriptor(e,r);i&&(Object.defineProperty(e,"__shady_native_"+r,i),i.value?J[r]||(J[r]=i.value):$(r))}}var Q=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),ee=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),te=document.implementation.createHTMLDocument("inert");function ne(e){for(var t;t=e.__shady_native_firstChild;)e.__shady_native_removeChild(t)}var re=["firstElementChild","lastElementChild","children","childElementCount"],ie=["querySelector","querySelectorAll","append","prepend","replaceChildren"],oe=M({get childNodes(){return this.__shady_childNodes},get firstChild(){return this.__shady_firstChild},get lastChild(){return this.__shady_lastChild},get childElementCount(){return this.__shady_childElementCount},get children(){return this.__shady_children},get firstElementChild(){return this.__shady_firstElementChild},get lastElementChild(){return this.__shady_lastElementChild},get shadowRoot(){return this.__shady_shadowRoot}}),se=M({get textContent(){return this.__shady_textContent},set textContent(e){this.__shady_textContent=e},get innerHTML(){return this.__shady_innerHTML},set innerHTML(e){this.__shady_innerHTML=e}}),ae=M({get parentElement(){return this.__shady_parentElement},get parentNode(){return this.__shady_parentNode},get nextSibling(){return this.__shady_nextSibling},get previousSibling(){return this.__shady_previousSibling},get nextElementSibling(){return this.__shady_nextElementSibling},get previousElementSibling(){return this.__shady_previousElementSibling},get className(){return this.__shady_className},set className(e){this.__shady_className=e}});function le(e){for(var t in e){var n=e[t];n&&(n.enumerable=!1)}}le(oe),le(se),le(ae);var de,ue=l.j||!0===l.s,he=ue?function(){}:function(e){var t=s(e);t.na||(t.na=!0,D(e,ae))},ce=ue?function(){}:function(e){var t=s(e);t.ma||(t.ma=!0,D(e,oe),window.customElements&&window.customElements.polyfillWrapFlushCallback&&!l.s||D(e,se))},_e="__eventWrappers"+Date.now(),fe=(de=Object.getOwnPropertyDescriptor(Event.prototype,"composed"))?function(e){return de.get.call(e)}:null,pe=function(){function e(){}var t=!1,n={get capture(){return t=!0,!1}};return window.addEventListener("test",e,n),window.removeEventListener("test",e,n),t}();function ve(e){if(null===e||"object"!=typeof e&&"function"!=typeof e)var t=!!e,n=!1;else{t=!!e.capture,n=!!e.once;var r=e.F}return{ja:r,capture:t,once:n,ia:pe?e:t}}var ye={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},me={DOMAttrModified:!0,DOMAttributeNameChanged:!0,DOMCharacterDataModified:!0,DOMElementNameChanged:!0,DOMNodeInserted:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemoved:!0,DOMNodeRemovedFromDocument:!0,DOMSubtreeModified:!0};function ge(e){return e instanceof Node?e.__shady_getRootNode():e}function be(e,t){var n=[],r=e;for(e=ge(e);r;)n.push(r),r=r.__shady_assignedSlot?r.__shady_assignedSlot:r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host&&(t||r!==e)?r.host:r.__shady_parentNode;return n[n.length-1]===document&&n.push(window),n}function Ne(e,t){if(!f)return e;e=be(e,!0);for(var n,r,i=0,o=void 0,s=void 0;i<t.length;i++)if((r=ge(n=t[i]))!==o&&(s=e.indexOf(r),o=r),!f(r)||-1<s)return n}var Ee={get composed(){return void 0===this.__composed&&(fe?this.__composed="focusin"===this.type||"focusout"===this.type||fe(this):!1!==this.isTrusted&&(this.__composed=ye[this.type])),this.__composed||!1},composedPath:function(){return this.__composedPath||(this.__composedPath=be(this.__target,this.composed)),this.__composedPath},get target(){return Ne(this.currentTarget||this.__previousCurrentTarget,this.composedPath())},get relatedTarget(){return this.__relatedTarget?(this.__relatedTargetComposedPath||(this.__relatedTargetComposedPath=be(this.__relatedTarget,!0)),Ne(this.currentTarget||this.__previousCurrentTarget,this.__relatedTargetComposedPath)):null},stopPropagation:function(){Event.prototype.stopPropagation.call(this),this.W=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this),this.W=this.__immediatePropagationStopped=!0}},Se=l.j&&Object.getOwnPropertyDescriptor(Event.prototype,"eventPhase");function Ce(e){function t(t,n){return(t=new e(t,n)).__composed=n&&!!n.composed,t}return t.__proto__=e,t.prototype=e.prototype,t}Se&&(Object.defineProperty(Ee,"eventPhase",{get:function(){return this.currentTarget===this.target?Event.AT_TARGET:this.__shady_native_eventPhase},enumerable:!0,configurable:!0}),Object.defineProperty(Ee,"__shady_native_eventPhase",Se));var we={focus:!0,blur:!0};function Te(e){return e.__target!==e.target||e.__relatedTarget!==e.relatedTarget}function Oe(e,t,n){if(n=t.__handlers&&t.__handlers[e.type]&&t.__handlers[e.type][n])for(var r,i=0;(r=n[i])&&(!Te(e)||e.target!==e.relatedTarget)&&(r.call(t,e),!e.__immediatePropagationStopped);i++);}var xe=new Event("e").hasOwnProperty("currentTarget");function De(e){var t=(e=xe?Object.create(e):e).composedPath(),n=t.map((function(e){return Ne(e,t)})),r=e.bubbles,i=Object.getOwnPropertyDescriptor(e,"currentTarget");Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:function(){return l}});var o=Event.CAPTURING_PHASE,s=Object.getOwnPropertyDescriptor(e,"eventPhase");Object.defineProperty(e,"eventPhase",{configurable:!0,enumerable:!0,get:function(){return o}});try{for(var a=t.length-1;0<=a;a--){var l=t[a];if(o=l===n[a]?Event.AT_TARGET:Event.CAPTURING_PHASE,Oe(e,l,"capture"),e.W)return}for(a=0;a<t.length;a++){var d=(l=t[a])===n[a];if((d||r)&&(o=d?Event.AT_TARGET:Event.BUBBLING_PHASE,Oe(e,l,"bubble"),e.W))break}}finally{xe||(i?Object.defineProperty(e,"currentTarget",i):delete e.currentTarget,s?Object.defineProperty(e,"eventPhase",s):delete e.eventPhase)}}function Me(e,t,n,r){for(var i=0;i<e.length;i++){var o=e[i],s=o.type,a=o.capture;if(t===o.node&&n===s&&r===a)return i}return-1}function Pe(e){return H(),!l.L&&this instanceof Node&&!E(document,this)?(e.__target||je(e,this),De(e)):this.__shady_native_dispatchEvent(e)}function Ae(e,t,n){var r=this,i=ve(n),o=i.capture,s=i.once,a=i.ja;if(i=i.ia,t){var l=typeof t;if(("function"===l||"object"===l)&&("object"!==l||t.handleEvent&&"function"==typeof t.handleEvent)){if(me[e])return this.__shady_native_addEventListener(e,t,i);var d=a||this;if(a=t[_e]){if(-1<Me(a,d,e,o))return}else t[_e]=[];a=function(i){if(s&&r.__shady_removeEventListener(e,t,n),i.__target||je(i),d!==r){var a=Object.getOwnPropertyDescriptor(i,"currentTarget");Object.defineProperty(i,"currentTarget",{get:function(){return d},configurable:!0});var u=Object.getOwnPropertyDescriptor(i,"eventPhase");Object.defineProperty(i,"eventPhase",{configurable:!0,enumerable:!0,get:function(){return o?Event.CAPTURING_PHASE:Event.BUBBLING_PHASE}})}if(i.__previousCurrentTarget=i.currentTarget,(!f(d)&&"slot"!==d.localName||-1!=i.composedPath().indexOf(d))&&(i.composed||-1<i.composedPath().indexOf(d)))if(Te(i)&&i.target===i.relatedTarget)i.eventPhase===Event.BUBBLING_PHASE&&i.stopImmediatePropagation();else if(i.eventPhase===Event.CAPTURING_PHASE||i.bubbles||i.target===d||d instanceof Window){var h="function"===l?t.call(d,i):t.handleEvent&&t.handleEvent(i);return d!==r&&(a?(Object.defineProperty(i,"currentTarget",a),a=null):delete i.currentTarget,u?(Object.defineProperty(i,"eventPhase",u),u=null):delete i.eventPhase),h}},t[_e].push({node:d,type:e,capture:o,Ia:a}),this.__handlers=this.__handlers||{},this.__handlers[e]=this.__handlers[e]||{capture:[],bubble:[]},this.__handlers[e][o?"capture":"bubble"].push(a),we[e]||this.__shady_native_addEventListener(e,a,i)}}}function Le(e,t,n){if(t){var r=ve(n);n=r.capture;var i=r.ja;if(r=r.ia,me[e])return this.__shady_native_removeEventListener(e,t,r);var o=i||this;i=void 0;var s=null;try{s=t[_e]}catch(e){}s&&-1<(o=Me(s,o,e,n))&&(i=s.splice(o,1)[0].Ia,s.length||(t[_e]=void 0)),this.__shady_native_removeEventListener(e,i||t,r),i&&this.__handlers&&this.__handlers[e]&&-1<(t=(e=this.__handlers[e][n?"capture":"bubble"]).indexOf(i))&&e.splice(t,1)}}var Re=M(Ee);function je(e,t){if(t=void 0===t?e.target:t,e.__target=t,e.__relatedTarget=e.relatedTarget,l.j){if(!(t=Object.getPrototypeOf(e)).hasOwnProperty("__shady_patchedProto")){var n=Object.create(t);n.__shady_sourceProto=t,x(n,Re),t.__shady_patchedProto=n}e.__proto__=t.__shady_patchedProto}else x(e,Re)}var Ie=Ce(Event),ke=Ce(CustomEvent),He=Ce(MouseEvent),Fe=Object.getOwnPropertyNames(Element.prototype).filter((function(e){return"on"===e.substring(0,2)})),Be=Object.getOwnPropertyNames(HTMLElement.prototype).filter((function(e){return"on"===e.substring(0,2)}));function Ue(e){return{set:function(t){var n=s(this),r=e.substring(2);n.D||(n.D={}),n.D[e]&&this.removeEventListener(r,n.D[e]),this.__shady_addEventListener(r,t),n.D[e]=t},get:function(){var t=a(this);return t&&t.D&&t.D[e]},configurable:!0}}function qe(e,t){return{index:e,M:[],P:t}}function Ve(e,t,n,r){var i=0,o=0,s=0,a=0,l=Math.min(t-i,r-o);if(0==i&&0==o)e:{for(s=0;s<l;s++)if(e[s]!==n[s])break e;s=l}if(t==e.length&&r==n.length){a=e.length;for(var d=n.length,u=0;u<l-s&&Ge(e[--a],n[--d]);)u++;a=u}if(o+=s,r-=a,0==(t-=a)-(i+=s)&&0==r-o)return[];if(i==t){for(t=qe(i,0);o<r;)t.M.push(n[o++]);return[t]}if(o==r)return[qe(i,t-i)];for(r=r-(s=o)+1,a=t-(l=i)+1,t=Array(r),d=0;d<r;d++)t[d]=Array(a),t[d][0]=d;for(d=0;d<a;d++)t[0][d]=d;for(d=1;d<r;d++)for(u=1;u<a;u++)if(e[l+u-1]===n[s+d-1])t[d][u]=t[d-1][u-1];else{var h=t[d-1][u]+1,c=t[d][u-1]+1;t[d][u]=h<c?h:c}for(l=t.length-1,s=t[0].length-1,r=t[l][s],e=[];0<l||0<s;)0==l?(e.push(2),s--):0==s?(e.push(3),l--):(a=t[l-1][s-1],(h=(d=t[l-1][s])<(u=t[l][s-1])?d<a?d:a:u<a?u:a)==a?(a==r?e.push(0):(e.push(1),r=a),l--,s--):h==d?(e.push(3),l--,r=d):(e.push(2),s--,r=u));for(e.reverse(),t=void 0,l=[],s=0;s<e.length;s++)switch(e[s]){case 0:t&&(l.push(t),t=void 0),i++,o++;break;case 1:t||(t=qe(i,0)),t.P++,i++,t.M.push(n[o]),o++;break;case 2:t||(t=qe(i,0)),t.P++,i++;break;case 3:t||(t=qe(i,0)),t.M.push(n[o]),o++}return t&&l.push(t),l}function Ge(e,t){return e===t}var We=M({dispatchEvent:Pe,addEventListener:Ae,removeEventListener:Le}),Xe=null;function ze(){return Xe||(Xe=window.ShadyCSS&&window.ShadyCSS.ScopingShim),Xe||null}function Je(e,t,n){var r=ze();return!(!r||"class"!==t||(r.setElementClass(e,n),0))}function Ke(e,t){var n=ze();n&&n.unscopeNode(e,t)}function $e(e,t){var n=ze();if(!n)return!0;if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(n=!0,e=e.__shady_firstChild;e;e=e.__shady_nextSibling)n=n&&$e(e,t);return n}return e.nodeType!==Node.ELEMENT_NODE||n.currentScopeForNode(e)===t}function Ye(e){if(e.nodeType!==Node.ELEMENT_NODE)return"";var t=ze();return t?t.currentScopeForNode(e):""}function Ze(e,t){if(e)for(e.nodeType===Node.ELEMENT_NODE&&t(e),e=e.__shady_firstChild;e;e=e.__shady_nextSibling)e.nodeType===Node.ELEMENT_NODE&&Ze(e,t)}var Qe=window.document,et=l.L,tt=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),nt=tt&&tt.get;function rt(e){for(var t;t=e.__shady_firstChild;)e.__shady_removeChild(t)}function it(e){var t=a(e);if(t&&void 0!==t.V)for(t=e.__shady_firstChild;t;t=t.__shady_nextSibling)it(t);(e=a(e))&&(e.V=void 0)}function ot(e){var t=e;if(e&&"slot"===e.localName){var n=a(e);(n=n&&n.H)&&(t=n.length?n[0]:ot(e.__shady_nextSibling))}return t}function st(e,t,n){if(e=(e=a(e))&&e.K){if(t)if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var r=0,i=t.childNodes.length;r<i;r++)e.addedNodes.push(t.childNodes[r]);else e.addedNodes.push(t);n&&e.removedNodes.push(n),function(e){e.g||(e.g=!0,N((function(){e.flush()})))}(e)}}var at=M({get parentNode(){var e=a(this);return void 0!==(e=e&&e.parentNode)?e:this.__shady_native_parentNode},get firstChild(){var e=a(this);return void 0!==(e=e&&e.firstChild)?e:this.__shady_native_firstChild},get lastChild(){var e=a(this);return void 0!==(e=e&&e.lastChild)?e:this.__shady_native_lastChild},get nextSibling(){var e=a(this);return void 0!==(e=e&&e.nextSibling)?e:this.__shady_native_nextSibling},get previousSibling(){var e=a(this);return void 0!==(e=e&&e.previousSibling)?e:this.__shady_native_previousSibling},get childNodes(){if(_(this)){var e=a(this);if(!e.childNodes){e.childNodes=[];for(var t=this.__shady_firstChild;t;t=t.__shady_nextSibling)e.childNodes.push(t)}var n=e.childNodes}else n=this.__shady_native_childNodes;return n.item=function(e){return n[e]},n},get parentElement(){var e=a(this);return(e=e&&e.parentNode)&&e.nodeType!==Node.ELEMENT_NODE&&(e=null),void 0!==e?e:this.__shady_native_parentElement},get isConnected(){if(nt&&nt.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1;var e=this.ownerDocument;if(null===e||E(e,this))return!0;for(e=this;e&&!(e instanceof Document);)e=e.__shady_parentNode||(f(e)?e.host:void 0);return!!(e&&e instanceof Document)},get textContent(){if(_(this)){for(var e=[],t=this.__shady_firstChild;t;t=t.__shady_nextSibling)t.nodeType!==Node.COMMENT_NODE&&e.push(t.__shady_textContent);return e.join("")}return this.__shady_native_textContent},set textContent(e){switch(null==e&&(e=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!_(this)&&l.j){var t=this.__shady_firstChild;(t!=this.__shady_lastChild||t&&t.nodeType!=Node.TEXT_NODE)&&rt(this),this.__shady_native_textContent=e}else rt(this),(0<e.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_insertBefore(document.createTextNode(e));break;default:this.nodeValue=e}},insertBefore:function(e,t){if(this.ownerDocument!==Qe&&e.ownerDocument!==Qe)return this.__shady_native_insertBefore(e,t),e;if(e===this)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(t){var n=a(t);if(void 0!==(n=n&&n.parentNode)&&n!==this||void 0===n&&t.__shady_native_parentNode!==this)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.")}if(t===e)return e;st(this,e);var i=[],o=(n=fn(this))?n.host.localName:Ye(this),l=e.__shady_parentNode;if(l){var d=Ye(e),u=!!n||!fn(e)||et&&void 0!==this.__noInsertionPoint;l.__shady_removeChild(e,u)}l=!0;var h=(!et||void 0===e.__noInsertionPoint&&void 0===this.__noInsertionPoint)&&!$e(e,o),c=n&&!e.__noInsertionPoint&&(!et||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE);return(c||h)&&(h&&(d=d||Ye(e)),Ze(e,(function(e){if(c&&"slot"===e.localName&&i.push(e),h){var t=d;ze()&&(t&&Ke(e,t),(t=ze())&&t.scopeNode(e,o))}}))),i.length&&(sn(n),n.i.push.apply(n.i,r(i)),en(n)),_(this)&&(function(e,t,n){Vt(t,2);var r=s(t);if(void 0!==r.firstChild&&(r.childNodes=null),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(e=e.__shady_native_firstChild;e;e=e.__shady_native_nextSibling)Gt(e,t,r,n);else Gt(e,t,r,n)}(e,this,t),(u=a(this)).root?(l=!1,p(this)&&en(u.root)):n&&"slot"===this.localName&&(l=!1,en(n))),l?(n=f(this)?this.host:this,t?(t=ot(t),n.__shady_native_insertBefore(e,t)):n.__shady_native_appendChild(e)):e.ownerDocument!==this.ownerDocument&&this.ownerDocument.adoptNode(e),e},appendChild:function(e){if(this!=e||!f(e))return this.__shady_insertBefore(e)},removeChild:function(e,t){if(t=void 0!==t&&t,this.ownerDocument!==Qe)return this.__shady_native_removeChild(e);if(e.__shady_parentNode!==this)throw Error("The node to be removed is not a child of this node: "+e);st(this,null,e);var n=fn(e),r=n&&function(e,t){if(e.g){an(e);var n,r=e.h;for(n in r)for(var i=r[n],o=0;o<i.length;o++){var s=i[o];if(S(t,s)){i.splice(o,1);var l=e.g.indexOf(s);if(0<=l&&(e.g.splice(l,1),(l=a(s.__shady_parentNode))&&l.O&&l.O--),o--,l=(s=a(s)).H)for(var d=0;d<l.length;d++){var u=l[d],h=u.__shady_native_parentNode;h&&h.__shady_native_removeChild(u)}s.H=[],s.assignedNodes=[],l=!0}}return l}}(n,e),i=a(this);if(_(this)&&(function(e,t){var n=s(e);e===(t=s(t)).firstChild&&(t.firstChild=n.nextSibling),e===t.lastChild&&(t.lastChild=n.previousSibling),e=n.previousSibling;var r=n.nextSibling;e&&(s(e).nextSibling=r),r&&(s(r).previousSibling=e),n.parentNode=n.previousSibling=n.nextSibling=void 0,void 0!==t.childNodes&&(t.childNodes=null)}(e,this),p(this))){en(i.root);var o=!0}if(ze()&&!t&&n&&e.nodeType!==Node.TEXT_NODE){var l=Ye(e);Ze(e,(function(e){Ke(e,l)}))}return it(e),n&&((t="slot"===this.localName)&&(o=!0),(r||t)&&en(n)),o||(o=f(this)?this.host:this,(!i.root&&"slot"!==e.localName||o===e.__shady_native_parentNode)&&o.__shady_native_removeChild(e)),e},replaceChild:function(e,t){return this.__shady_insertBefore(e,t),this.__shady_removeChild(t),e},cloneNode:function(e){if("template"==this.localName)return this.__shady_native_cloneNode(e);var t=this.__shady_native_cloneNode(!1);if(e&&t.nodeType!==Node.ATTRIBUTE_NODE){e=this.__shady_firstChild;for(var n;e;e=e.__shady_nextSibling)n=e.__shady_cloneNode(!0),t.__shady_appendChild(n)}return t},getRootNode:function(e){if(this&&this.nodeType){var t=s(this),n=t.V;return void 0===n&&(f(this)?(n=this,t.V=n):(n=(n=this.__shady_parentNode)?n.__shady_getRootNode(e):this,document.documentElement.__shady_native_contains(this)&&(t.V=n))),n}},contains:function(e){return S(this,e)}}),lt=M({get assignedSlot(){var e=this.__shady_parentNode;return(e=e&&e.__shady_shadowRoot)&&tn(e),(e=a(this))&&e.assignedSlot||null}}),dt=new Map;function ut(e,t,n,r){for(r=void 0===r||r;t<e.length;t++)if("\\"===e[t]&&t<e.length-1&&"\n"!==e[t+1])t++;else{if(-1!==n.indexOf(e[t]))return t;if(r&&dt.has(e[t])){var i=dt.get(e[t]);t=ut(e,t+1,[i.end],i.U)}}return e.length}function ht(e,t,n){var r=[];return ct(e,t,n,r),r}function ct(e,t,n,r){for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling){var i;if(i=e.nodeType===Node.ELEMENT_NODE){var o=t,s=n,a=r,l=o(i=e);l&&a.push(i),s&&s(l)?i=l:(ct(i,o,s,a),i=void 0)}if(i)break}}[["(",{end:")",U:!0}],["[",{end:"]",U:!0}],['"',{end:'"',U:!1}],["'",{end:"'",U:!1}]].forEach((function(e){var t=n(e);e=t.next().value,t=t.next().value,dt.set(e,t)}));var _t={get firstElementChild(){var e=a(this);if(e&&void 0!==e.firstChild){for(e=this.__shady_firstChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_nextSibling;return e}return this.__shady_native_firstElementChild},get lastElementChild(){var e=a(this);if(e&&void 0!==e.lastChild){for(e=this.__shady_lastChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_previousSibling;return e}return this.__shady_native_lastElementChild},get children(){return _(this)?C(Array.prototype.filter.call(T(this),(function(e){return e.nodeType===Node.ELEMENT_NODE}))):this.__shady_native_children},get childElementCount(){var e=this.__shady_children;return e?e.length:0}},ft=M((_t.append=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];this.__shady_insertBefore(L.apply(null,r(t)),null)},_t.prepend=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];this.__shady_insertBefore(L.apply(null,r(t)),this.__shady_firstChild)},_t.replaceChildren=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];for(;null!==(n=this.__shady_firstChild);)this.__shady_removeChild(n);this.__shady_insertBefore(L.apply(null,r(t)),null)},_t));function pt(e,t){function r(t,n){return(t===e||-1===n.indexOf(":scope"))&&y.call(t,n)}var i=function(e){function t(){if(0<r.length){for(;" "===r[r.length-1];)r.pop();n.push({fa:r.filter((function(e,t){return 0==t%2})),ua:r.filter((function(e,t){return 1==t%2}))}),r.length=0}}for(var n=[],r=[],i=0;i<e.length;){var o=r[r.length-1],s=ut(e,i,[","," ",">","+","~"]),a=s===i?e[i]:e.substring(i,s);","===a?t():-1!==[void 0," ",">","+","~"].indexOf(o)&&" "===a||(" "===o&&-1!==[">","+","~"].indexOf(a)?r[r.length-1]=a:r.push(a)),i=s+(s===i?1:0)}return t(),n}(t);if(1>i.length)return[];for(t=R(ht(e,(function(){return!0})).map((function(e){return R(i.map((function(t){var n=t.fa,i=n.length-1;return r(e,n[i])?{target:e,I:t,J:e,index:i}:[]})))})));t.some((function(e){return 0<e.index}));)t=R(t.map((function(e){if(0>=e.index)return e;var t=e.target,n=e.J,i=e.I;e=e.index-1;var o=i.ua[e],s=i.fa[e];if(" "===o){for(o=[],n=n.__shady_parentElement;n;n=n.__shady_parentElement)r(n,s)&&o.push({target:t,I:i,J:n,index:e});return o}if(">"===o)return r(n=n.__shady_parentElement,s)?{target:t,I:i,J:n,index:e}:[];if("+"===o)return(n=n.__shady_previousElementSibling)&&r(n,s)?{target:t,I:i,J:n,index:e}:[];if("~"===o){for(o=[],n=n.__shady_previousElementSibling;n;n=n.__shady_previousElementSibling)r(n,s)&&o.push({target:t,I:i,J:n,index:e});return o}throw Error("Unrecognized combinator: '"+o+"'.")})));return function(e){for(var t=[],r=new Set,i=(e=n(e)).next();!i.done;i=e.next())i=i.value,r.has(i)||(t.push(i),r.add(i));return t}(t.map((function(e){return e.target})))}var vt=l.querySelectorImplementation,yt=M({querySelector:function(e){if("native"===vt){for(var t=Array.prototype.slice.call((this instanceof ShadowRoot?this.host:this).__shady_native_querySelectorAll(e)),r=this.__shady_getRootNode(),i=(t=n(t)).next();!i.done;i=t.next())if((i=i.value).__shady_getRootNode()==r)return i;return null}if("selectorEngine"===vt)return pt(this,e)[0]||null;if(void 0===vt)return ht(this,(function(t){return y.call(t,e)}),(function(e){return!!e}))[0]||null;throw Error("Unrecognized value of ShadyDOM.querySelectorImplementation: '"+vt+"'")},querySelectorAll:function(e,t){if(t||"native"===vt){t=Array.prototype.slice.call((this instanceof ShadowRoot?this.host:this).__shady_native_querySelectorAll(e));var n=this.__shady_getRootNode();return C(t.filter((function(e){return e.__shady_getRootNode()==n})))}if("selectorEngine"===vt)return C(pt(this,e));if(void 0===vt)return C(ht(this,(function(t){return y.call(t,e)})));throw Error("Unrecognized value of ShadyDOM.querySelectorImplementation: '"+vt+"'")}}),mt=l.L&&!l.s?P({},ft):ft;P(ft,yt);var gt=M({after:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=this.__shady_parentNode)){var i=this.__shady_nextSibling;n.__shady_insertBefore(L.apply(null,r(t)),i)}},before:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];null!==(n=this.__shady_parentNode)&&n.__shady_insertBefore(L.apply(null,r(t)),this)},remove:function(){var e=this.__shady_parentNode;null!==e&&e.__shady_removeChild(this)},replaceWith:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=this.__shady_parentNode)){var i=this.__shady_nextSibling;n.__shady_removeChild(this),n.__shady_insertBefore(L.apply(null,r(t)),i)}}}),bt=window.document;function Nt(e,t){if("slot"===t)p(e=e.__shady_parentNode)&&en(a(e).root);else if("slot"===e.localName&&"name"===t&&(t=fn(e))){if(t.g){an(t);var n=e.oa,r=ln(e);if(r!==n){var i=(n=t.h[n]).indexOf(e);0<=i&&n.splice(i,1),(n=t.h[r]||(t.h[r]=[])).push(e),1<n.length&&(t.h[r]=dn(n))}}en(t)}}var Et=M({get previousElementSibling(){var e=a(this);if(e&&void 0!==e.previousSibling){for(e=this.__shady_previousSibling;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_previousSibling;return e}return this.__shady_native_previousElementSibling},get nextElementSibling(){var e=a(this);if(e&&void 0!==e.nextSibling){for(e=this.__shady_nextSibling;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_nextSibling;return e}return this.__shady_native_nextElementSibling},get slot(){return this.getAttribute("slot")},set slot(e){this.__shady_setAttribute("slot",e)},get className(){return this.getAttribute("class")||""},set className(e){this.__shady_setAttribute("class",e)},setAttribute:function(e,t){this.ownerDocument!==bt?this.__shady_native_setAttribute(e,t):Je(this,e,t)||(this.__shady_native_setAttribute(e,t),Nt(this,e))},removeAttribute:function(e){this.ownerDocument!==bt?this.__shady_native_removeAttribute(e):Je(this,e,"")?""===this.getAttribute(e)&&this.__shady_native_removeAttribute(e):(this.__shady_native_removeAttribute(e),Nt(this,e))},toggleAttribute:function(e,t){return this.ownerDocument!==bt?this.__shady_native_toggleAttribute(e,t):Je(this,e,"")?""!==this.getAttribute(e)||t?void 0:this.__shady_native_toggleAttribute(e,t):(t=this.__shady_native_toggleAttribute(e,t),Nt(this,e),t)}});l.L||Fe.forEach((function(e){Et[e]=Ue(e)}));var St=M({attachShadow:function(e){if(!this)throw Error("Must provide a host.");if(!e)throw Error("Not enough arguments.");if(e.shadyUpgradeFragment&&!l.la){var t=e.shadyUpgradeFragment;if(t.__proto__=ShadowRoot.prototype,Qt(t,this,e),Wt(t,t),e=t.__noInsertionPoint?null:t.querySelectorAll("slot"),t.__noInsertionPoint=void 0,e&&e.length){var n=t;sn(n),n.i.push.apply(n.i,r(e)),en(t)}t.host.__shady_native_appendChild(t)}else t=new Zt(Kt,this,e);return this.__CE_shadowRoot=t},get shadowRoot(){var e=a(this);return e&&e.Ba||null}});P(Et,St);var Ct=document.implementation.createHTMLDocument("inert"),wt=M({get innerHTML(){return _(this)?X("template"===this.localName?this.content:this,T):this.__shady_native_innerHTML},set innerHTML(e){if("template"===this.localName)this.__shady_native_innerHTML=e;else{rt(this);var t=this.localName||"div";for(t=this.namespaceURI&&this.namespaceURI!==Ct.namespaceURI?Ct.createElementNS(this.namespaceURI,t):Ct.createElement(t),l.j?t.__shady_native_innerHTML=e:t.innerHTML=e;e=t.__shady_firstChild;)this.__shady_insertBefore(e)}}}),Tt=M({blur:function(){var e=a(this);(e=(e=e&&e.root)&&e.activeElement)?e.__shady_blur():this.__shady_native_blur()}});l.L||Be.forEach((function(e){Tt[e]=Ue(e)}));var Ot=M({assignedNodes:function(e){if("slot"===this.localName){var t=this.__shady_getRootNode();return t&&f(t)&&tn(t),(t=a(this))&&(e&&e.flatten?t.H:t.assignedNodes)||[]}},addEventListener:function(e,t,n){if("slot"!==this.localName||"slotchange"===e)Ae.call(this,e,t,n);else{"object"!=typeof n&&(n={capture:!!n});var r=this.__shady_parentNode;if(!r)throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");n.F=this,r.__shady_addEventListener(e,t,n)}},removeEventListener:function(e,t,n){if("slot"!==this.localName||"slotchange"===e)Le.call(this,e,t,n);else{"object"!=typeof n&&(n={capture:!!n});var r=this.__shady_parentNode;if(!r)throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");n.F=this,r.__shady_removeEventListener(e,t,n)}}}),xt=M({getElementById:function(e){return""===e?null:ht(this,(function(t){return t.id==e}),(function(e){return!!e}))[0]||null}});function Dt(e,t){for(var n;t&&!e.has(n=t.__shady_getRootNode());)t=n.host;return t}var Mt="__shady_native_"+c(),Pt=M({get activeElement(){var e=l.j?document.__shady_native_activeElement:document.activeElement;if(!e||!e.nodeType)return null;var t=!!f(this);if(!(this===document||t&&this.host!==e&&this.host.__shady_native_contains(e)))return null;for(t=fn(e);t&&t!==this;)t=fn(e=t.host);return this===document?t?null:e:t===this?e:null},elementsFromPoint:function(e,t){if(e=document[Mt](e,t),this===document&&l.useNativeDocumentEFP)return e;e=[].slice.call(e),t=function(e){var t=new Set;for(t.add(e);f(e)&&e.host;)e=e.host.__shady_getRootNode(),t.add(e);return t}(this);for(var n=new Set,r=0;r<e.length;r++)n.add(Dt(t,e[r]));var i=[];return n.forEach((function(e){return i.push(e)})),i},elementFromPoint:function(e,t){return this===document&&l.useNativeDocumentEFP?this.__shady_native_elementFromPoint(e,t):this.__shady_elementsFromPoint(e,t)[0]||null}}),At=window.document,Lt=M({importNode:function(e,t){if(e.ownerDocument!==At||"template"===e.localName)return this.__shady_native_importNode(e,t);var n=this.__shady_native_importNode(e,!1);if(t)for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling)t=this.__shady_importNode(e,!0),n.__shady_appendChild(t);return n}}),Rt=M({dispatchEvent:Pe,addEventListener:Ae.bind(window),removeEventListener:Le.bind(window)}),jt={};Object.getOwnPropertyDescriptor(HTMLElement.prototype,"parentElement")&&(jt.parentElement=at.parentElement),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"contains")&&(jt.contains=at.contains),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"children")&&(jt.children=ft.children),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML")&&(jt.innerHTML=wt.innerHTML),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"className")&&(jt.className=Et.className);var It={EventTarget:[We],Node:[at,window.EventTarget?null:We],Text:[lt],Comment:[lt],CDATASection:[lt],ProcessingInstruction:[lt],Element:[Et,ft,gt,lt,!l.j||"innerHTML"in Element.prototype?wt:null,window.HTMLSlotElement?null:Ot],HTMLElement:[Tt,jt],HTMLSlotElement:[Ot],DocumentFragment:[mt,xt],Document:[Lt,mt,xt,Pt],Window:[Rt],CharacterData:[gt],XMLHttpRequest:[window.EventTarget?null:We]},kt=l.j?null:["innerHTML","textContent"];function Ht(e,t,n,r){t.forEach((function(t){return e&&t&&x(e,t,n,r)}))}function Ft(e){var t,n=e?null:kt;for(t in It)Ht(window[t]&&window[t].prototype,It[t],e,n)}function Bt(e){return e.__shady_protoIsPatched=!0,Ht(e,It.EventTarget),Ht(e,It.Node),Ht(e,It.Element),Ht(e,It.HTMLElement),Ht(e,It.HTMLSlotElement),e}["Text","Comment","CDATASection","ProcessingInstruction"].forEach((function(e){var t=window[e],n=Object.create(t.prototype);n.__shady_protoIsPatched=!0,Ht(n,It.EventTarget),Ht(n,It.Node),It[e]&&Ht(n,It[e]),t.prototype.__shady_patchedProto=n}));var Ut=l.ba,qt=l.j;function Vt(e,t){if(Ut&&!e.__shady_protoIsPatched&&!f(e)){var n=Object.getPrototypeOf(e),r=n.hasOwnProperty("__shady_patchedProto")&&n.__shady_patchedProto;r||(Bt(r=Object.create(n)),n.__shady_patchedProto=r),Object.setPrototypeOf(e,r)}qt||(1===t?he(e):2===t&&ce(e))}function Gt(e,t,n,r){Vt(e,1),r=r||null;var i=s(e),o=r?s(r):null;i.previousSibling=r?o.previousSibling:t.__shady_lastChild,(o=a(i.previousSibling))&&(o.nextSibling=e),(o=a(i.nextSibling=r))&&(o.previousSibling=e),i.parentNode=t,r?r===n.firstChild&&(n.firstChild=e):(n.lastChild=e,n.firstChild||(n.firstChild=e)),n.childNodes=null}function Wt(e,t){var n=s(e);if(t||void 0===n.firstChild){n.childNodes=null;var r=n.firstChild=e.__shady_native_firstChild;for(n.lastChild=e.__shady_native_lastChild,Vt(e,2),n=r,r=void 0;n;n=n.__shady_native_nextSibling){var i=s(n);i.parentNode=t||e,i.nextSibling=n.__shady_native_nextSibling,i.previousSibling=r||null,r=n,Vt(n,1)}}}var Xt=M({addEventListener:function(e,t,n){"object"!=typeof n&&(n={capture:!!n}),n.F=n.F||this,this.host.__shady_addEventListener(e,t,n)},removeEventListener:function(e,t,n){"object"!=typeof n&&(n={capture:!!n}),n.F=n.F||this,this.host.__shady_removeEventListener(e,t,n)}});function zt(e,t){x(e,Xt,t),x(e,Pt,t),x(e,wt,t),x(e,ft,t),l.s&&!t?(x(e,at,t),x(e,xt,t)):l.j||(x(e,ae),x(e,oe),x(e,se))}var Jt,Kt={},$t=l.deferConnectionCallbacks&&"loading"===document.readyState;function Yt(e){var t=[];do{t.unshift(e)}while(e=e.__shady_parentNode);return t}function Zt(e,t,n){if(e!==Kt)throw new TypeError("Illegal constructor");this.g=null,Qt(this,t,n)}function Qt(e,t,n){if(e.host=t,e.mode=n&&n.mode,Wt(e.host),(t=s(e.host)).root=e,t.Ba="closed"!==e.mode?e:null,(t=s(e)).firstChild=t.lastChild=t.parentNode=t.nextSibling=t.previousSibling=null,l.preferPerformance)for(;t=e.host.__shady_native_firstChild;)e.host.__shady_native_removeChild(t);else en(e)}function en(e){e.G||(e.G=!0,k((function(){return tn(e)})))}function tn(e){var t;if(t=e.G){for(var n;e;)e.G&&(n=e),f(e=(t=e).host.__shady_getRootNode())&&(t=a(t.host))&&0<t.O||(e=void 0);t=n}(n=t)&&n._renderSelf()}function nn(e,t,n){var r=s(t),i=r.X;r.X=null,n||(n=(e=e.h[t.__shady_slot||"__catchall"])&&e[0]),n?(s(n).assignedNodes.push(t),r.assignedSlot=n):r.assignedSlot=void 0,i!==r.assignedSlot&&r.assignedSlot&&(s(r.assignedSlot).Y=!0)}function rn(e,t,n){for(var r=0,i=void 0;r<n.length&&(i=n[r]);r++)if("slot"==i.localName){var o=a(i).assignedNodes;o&&o.length&&rn(e,t,o)}else t.push(n[r])}function on(e,t){t.__shady_native_dispatchEvent(new Event("slotchange")),(t=a(t)).assignedSlot&&on(e,t.assignedSlot)}function sn(e){e.i=e.i||[],e.g=e.g||[],e.h=e.h||{}}function an(e){if(e.i&&e.i.length){for(var t,n=e.i,r=0;r<n.length;r++){var i=n[r];Wt(i);var o=i.__shady_parentNode;Wt(o),(o=a(o)).O=(o.O||0)+1,o=ln(i),e.h[o]?((t=t||{})[o]=!0,e.h[o].push(i)):e.h[o]=[i],e.g.push(i)}if(t)for(var s in t)e.h[s]=dn(e.h[s]);e.i=[]}}function ln(e){var t=e.name||e.getAttribute("name")||"__catchall";return e.oa=t}function dn(e){return e.sort((function(e,t){e=Yt(e);for(var n=Yt(t),r=0;r<e.length;r++){t=e[r];var i=n[r];if(t!==i)return(e=T(t.__shady_parentNode)).indexOf(t)-e.indexOf(i)}}))}function un(e){return an(e),!(!e.g||!e.g.length)}if(Zt.prototype._renderSelf=function(){var e=$t;if($t=!0,this.G=!1,this.g){an(this);for(var t,n=0;n<this.g.length;n++){var r=a(t=this.g[n]),i=r.assignedNodes;if(r.assignedNodes=[],r.H=[],r.ea=i)for(r=0;r<i.length;r++){var o=a(i[r]);o.X=o.assignedSlot,o.assignedSlot===t&&(o.assignedSlot=null)}}for(n=this.host.__shady_firstChild;n;n=n.__shady_nextSibling)nn(this,n);for(n=0;n<this.g.length;n++){if(!(i=a(t=this.g[n])).assignedNodes.length)for(r=t.__shady_firstChild;r;r=r.__shady_nextSibling)nn(this,r,t);if((r=(r=a(t.__shady_parentNode))&&r.root)&&(un(r)||r.G)&&r._renderSelf(),rn(this,i.H,i.assignedNodes),r=i.ea){for(o=0;o<r.length;o++)a(r[o]).X=null;i.ea=null,r.length>i.assignedNodes.length&&(i.Y=!0)}i.Y&&(i.Y=!1,on(this,t))}for(t=this.g,n=[],i=0;i<t.length;i++)(o=a(r=t[i].__shady_parentNode))&&o.root||!(0>n.indexOf(r))||n.push(r);for(t=0;t<n.length;t++){for(i=(o=n[t])===this?this.host:o,r=[],o=o.__shady_firstChild;o;o=o.__shady_nextSibling)if("slot"==o.localName)for(var s=a(o).H,d=0;d<s.length;d++)r.push(s[d]);else r.push(o);o=w(i),s=Ve(r,r.length,o,o.length);for(var u=d=0,h=void 0;d<s.length&&(h=s[d]);d++){for(var c=0,_=void 0;c<h.M.length&&(_=h.M[c]);c++)_.__shady_native_parentNode===i&&i.__shady_native_removeChild(_),o.splice(h.index+u,1);u-=h.P}for(u=0,h=void 0;u<s.length&&(h=s[u]);u++)for(d=o[h.index],c=h.index;c<h.index+h.P;c++)_=r[c],i.__shady_native_insertBefore(_,d),o.splice(c,0,_)}}if(!l.preferPerformance&&!this.da)for(n=this.host.__shady_firstChild;n;n=n.__shady_nextSibling)t=a(n),n.__shady_native_parentNode!==this.host||"slot"!==n.localName&&t.assignedSlot||this.host.__shady_native_removeChild(n);this.da=!0,$t=e,Jt&&Jt()},function(e){e.__proto__=DocumentFragment.prototype,zt(e,"__shady_"),zt(e),Object.defineProperties(e,{nodeType:{value:Node.DOCUMENT_FRAGMENT_NODE,configurable:!0},nodeName:{value:"#document-fragment",configurable:!0},nodeValue:{value:null,configurable:!0}}),["localName","namespaceURI","prefix"].forEach((function(t){Object.defineProperty(e,t,{value:void 0,configurable:!0})})),["ownerDocument","baseURI","isConnected"].forEach((function(t){Object.defineProperty(e,t,{get:function(){return this.host[t]},configurable:!0})}))}(Zt.prototype),window.customElements&&window.customElements.define&&l.Z&&!l.preferPerformance){var hn=new Map;Jt=function(){var e=[];hn.forEach((function(t,n){e.push([n,t])})),hn.clear();for(var t=0;t<e.length;t++){var n=e[t][0];e[t][1]?n.__shadydom_connectedCallback():n.__shadydom_disconnectedCallback()}},$t&&document.addEventListener("readystatechange",(function(){$t=!1,Jt()}),{once:!0});var cn=window.customElements.define,_n=function(e,t){var n=t.prototype.connectedCallback,r=t.prototype.disconnectedCallback;cn.call(window.customElements,e,function(e,t,n){var r=0,i="__isConnected"+r++;return(t||n)&&(e.prototype.connectedCallback=e.prototype.__shadydom_connectedCallback=function(){$t?hn.set(this,!0):this[i]||(this[i]=!0,t&&t.call(this))},e.prototype.disconnectedCallback=e.prototype.__shadydom_disconnectedCallback=function(){$t?this.isConnected||hn.set(this,!1):this[i]&&(this[i]=!1,n&&n.call(this))}),e}(t,n,r)),t.prototype.connectedCallback=n,t.prototype.disconnectedCallback=r};window.customElements.define=_n,Object.defineProperty(window.CustomElementRegistry.prototype,"define",{value:_n,configurable:!0})}function fn(e){if(f(e=e.__shady_getRootNode()))return e}function pn(e){this.node=e}function vn(e){Object.defineProperty(pn.prototype,e,{get:function(){return this.node["__shady_"+e]},set:function(t){this.node["__shady_"+e]=t},configurable:!0})}(e=pn.prototype).addEventListener=function(e,t,n){return this.node.__shady_addEventListener(e,t,n)},e.removeEventListener=function(e,t,n){return this.node.__shady_removeEventListener(e,t,n)},e.appendChild=function(e){return this.node.__shady_appendChild(e)},e.insertBefore=function(e,t){return this.node.__shady_insertBefore(e,t)},e.removeChild=function(e){return this.node.__shady_removeChild(e)},e.replaceChild=function(e,t){return this.node.__shady_replaceChild(e,t)},e.cloneNode=function(e){return this.node.__shady_cloneNode(e)},e.getRootNode=function(e){return this.node.__shady_getRootNode(e)},e.contains=function(e){return this.node.__shady_contains(e)},e.dispatchEvent=function(e){return this.node.__shady_dispatchEvent(e)},e.setAttribute=function(e,t){this.node.__shady_setAttribute(e,t)},e.getAttribute=function(e){return this.node.__shady_native_getAttribute(e)},e.removeAttribute=function(e){this.node.__shady_removeAttribute(e)},e.toggleAttribute=function(e,t){return this.node.__shady_toggleAttribute(e,t)},e.attachShadow=function(e){return this.node.__shady_attachShadow(e)},e.focus=function(){this.node.__shady_native_focus()},e.blur=function(){this.node.__shady_blur()},e.importNode=function(e,t){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_importNode(e,t)},e.getElementById=function(e){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_getElementById(e)},e.elementsFromPoint=function(e,t){return this.node.__shady_elementsFromPoint(e,t)},e.elementFromPoint=function(e,t){return this.node.__shady_elementFromPoint(e,t)},e.querySelector=function(e){return this.node.__shady_querySelector(e)},e.querySelectorAll=function(e,t){return this.node.__shady_querySelectorAll(e,t)},e.assignedNodes=function(e){if("slot"===this.node.localName)return this.node.__shady_assignedNodes(e)},e.append=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_append.apply(this.node,r(t))},e.prepend=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_prepend.apply(this.node,r(t))},e.after=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_after.apply(this.node,r(t))},e.before=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_before.apply(this.node,r(t))},e.remove=function(){return this.node.__shady_remove()},e.replaceWith=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_replaceWith.apply(this.node,r(t))},i.Object.defineProperties(pn.prototype,{activeElement:{configurable:!0,enumerable:!0,get:function(){if(f(this.node)||this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_activeElement}},_activeElement:{configurable:!0,enumerable:!0,get:function(){return this.activeElement}},host:{configurable:!0,enumerable:!0,get:function(){if(f(this.node))return this.node.host}},parentNode:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentNode}},firstChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstChild}},lastChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastChild}},nextSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextSibling}},previousSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousSibling}},childNodes:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childNodes}},parentElement:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentElement}},firstElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstElementChild}},lastElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastElementChild}},nextElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextElementSibling}},previousElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousElementSibling}},children:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_children}},childElementCount:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childElementCount}},shadowRoot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_shadowRoot}},assignedSlot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_assignedSlot}},isConnected:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_isConnected}},innerHTML:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_innerHTML},set:function(e){this.node.__shady_innerHTML=e}},textContent:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_textContent},set:function(e){this.node.__shady_textContent=e}},slot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_slot},set:function(e){this.node.__shady_slot=e}},className:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_className},set:function(e){this.node.__shady_className=e}}}),Fe.forEach((function(e){return vn(e)})),Be.forEach((function(e){return vn(e)}));var yn=new WeakMap;function mn(e){if(f(e)||e instanceof pn)return e;var t=yn.get(e);return t||(t=new pn(e),yn.set(e,t)),t}if(l.Z){var gn=l.j?function(e){return e}:function(e){return ce(e),he(e),e},bn={inUse:l.Z,patch:gn,isShadyRoot:f,enqueue:k,flush:H,flushInitial:function(e){!e.da&&e.G&&tn(e)},settings:l,filterMutations:function(e,t){var n=t.getRootNode();return e.map((function(e){var t=n===e.target.getRootNode();if(t&&e.addedNodes){if((t=[].slice.call(e.addedNodes).filter((function(e){return n===e.getRootNode()}))).length)return e=Object.create(e),Object.defineProperty(e,"addedNodes",{value:t,configurable:!0}),e}else if(t)return e})).filter((function(e){return e}))},observeChildren:function(e,t){var n=s(e);n.K||(n.K=new F),n.K.R.add(t);var r=n.K;return{pa:t,ra:r,qa:e,takeRecords:function(){return r.takeRecords()}}},unobserveChildren:function(e){var t=e&&e.ra;t&&(t.R.delete(e.pa),t.R.size||(s(e.qa).K=null))},deferConnectionCallbacks:l.deferConnectionCallbacks,preferPerformance:l.preferPerformance,handlesDynamicScoping:!0,wrap:l.s?mn:gn,wrapIfNeeded:!0===l.s?mn:function(e){return e},Wrapper:pn,composedPath:function(e){return e.__composedPath||(e.__composedPath=be(e.target,!0)),e.__composedPath},noPatch:l.s,patchOnDemand:l.ba,nativeMethods:J,nativeTree:K,patchElementProto:Bt,querySelectorImplementation:l.querySelectorImplementation};window.ShadyDOM=bn,function(){var e=["dispatchEvent","addEventListener","removeEventListener"];window.EventTarget?(Z(window.EventTarget.prototype,e),void 0===window.__shady_native_addEventListener&&Z(Window.prototype,e)):(Z(Node.prototype,e),Z(Window.prototype,e),Z(XMLHttpRequest.prototype,e)),z?Z(Node.prototype,"parentNode firstChild lastChild previousSibling nextSibling childNodes parentElement textContent".split(" ")):Y(Node.prototype,{parentNode:{get:function(){return Q.currentNode=this,Q.parentNode()}},firstChild:{get:function(){return Q.currentNode=this,Q.firstChild()}},lastChild:{get:function(){return Q.currentNode=this,Q.lastChild()}},previousSibling:{get:function(){return Q.currentNode=this,Q.previousSibling()}},nextSibling:{get:function(){return Q.currentNode=this,Q.nextSibling()}},childNodes:{get:function(){var e=[];Q.currentNode=this;for(var t=Q.firstChild();t;)e.push(t),t=Q.nextSibling();return e}},parentElement:{get:function(){return ee.currentNode=this,ee.parentNode()}},textContent:{get:function(){switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:for(var e,t=document.createTreeWalker(this,NodeFilter.SHOW_TEXT,null,!1),n="";e=t.nextNode();)n+=e.nodeValue;return n;default:return this.nodeValue}},set:function(e){switch(null==e&&(e=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:ne(this),(0<e.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_native_insertBefore(document.createTextNode(e),void 0);break;default:this.nodeValue=e}}}}),Z(Node.prototype,"appendChild insertBefore removeChild replaceChild cloneNode contains".split(" ")),Z(HTMLElement.prototype,["parentElement","contains"]),e={firstElementChild:{get:function(){return ee.currentNode=this,ee.firstChild()}},lastElementChild:{get:function(){return ee.currentNode=this,ee.lastChild()}},children:{get:function(){var e=[];ee.curre