Created
November 21, 2024 18:21
-
-
Save Slashgear/2c2ed7f3cf2d9e9a88cd33be451f38db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @license | |
| * Copyright 2019 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| const t=window,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new r(i,t,s)},n=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,s))(e)})(t):t | |
| /** | |
| * @license | |
| * Copyright 2017 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */;var l;const a=window,h=a.trustedTypes,c=h?h.emptyScript:"",d=a.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},p=(t,e)=>e!==t&&(e==e||t==t),m={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:p};class v extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,s)=>{const i=this._$Ep(s,e);void 0!==i&&(this._$Ev.set(i,s),t.push(i))})),t}static createProperty(t,e=m){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||m}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of e)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(n(t))}else void 0!==t&&e.push(n(t));return e}static _$Ep(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,s;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var s;const i=null!==(s=this.shadowRoot)&&void 0!==s?s:this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{e?s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=m){var i;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const o=(void 0!==(null===(i=s.converter)||void 0===i?void 0:i.toAttribute)?s.converter:u).toAttribute(e,s.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:u;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,s){let i=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(s)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} | |
| /** | |
| * @license | |
| * Copyright 2017 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| var f;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(l=a.reactiveElementVersions)&&void 0!==l?l:a.reactiveElementVersions=[]).push("1.4.1");const g=window,$=g.trustedTypes,_=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,b=`lit$${(Math.random()+"").slice(9)}$`,y="?"+b,A=`<${y}>`,j=document,E=(t="")=>j.createComment(t),w=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,k=/>/g,T=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),M=/'/g,U=/"/g,H=/^(?:script|style|textarea|title)$/i,O=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),P=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),z=new WeakMap,R=j.createTreeWalker(j,129,null,!1),L=(t,e)=>{const s=t.length-1,i=[];let r,o=2===e?"<svg>":"",n=x;for(let e=0;e<s;e++){const s=t[e];let l,a,h=-1,c=0;for(;c<s.length&&(n.lastIndex=c,a=n.exec(s),null!==a);)c=n.lastIndex,n===x?"!--"===a[1]?n=C:void 0!==a[1]?n=k:void 0!==a[2]?(H.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=T):void 0!==a[3]&&(n=T):n===T?">"===a[0]?(n=null!=r?r:x,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?T:'"'===a[3]?U:M):n===U||n===M?n=T:n===C||n===k?n=x:(n=T,r=void 0);const d=n===T&&t[e+1].startsWith("/>")?" ":"";o+=n===x?s+A:h>=0?(i.push(l),s.slice(0,h)+"$lit$"+s.slice(h)+b+d):s+b+(-2===h?(i.push(void 0),e):d)}const l=o+(t[s]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(l):l,i]};class D{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const n=t.length-1,l=this.parts,[a,h]=L(t,e);if(this.el=D.createElement(a,s),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=R.nextNode())&&l.length<n;){if(1===i.nodeType){if(i.hasAttributes()){const t=[];for(const e of i.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(b)){const s=h[o++];if(t.push(e),void 0!==s){const t=i.getAttribute(s.toLowerCase()+"$lit$").split(b),e=/([.?@])?(.*)/.exec(s);l.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?V:"?"===e[1]?K:"@"===e[1]?J:W})}else l.push({type:6,index:r})}for(const e of t)i.removeAttribute(e)}if(H.test(i.tagName)){const t=i.textContent.split(b),e=t.length-1;if(e>0){i.textContent=$?$.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],E()),R.nextNode(),l.push({type:2,index:++r});i.append(t[e],E())}}}else if(8===i.nodeType)if(i.data===y)l.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(b,t+1));)l.push({type:7,index:r}),t+=b.length-1}r++}}static createElement(t,e){const s=j.createElement("template");return s.innerHTML=t,s}}function I(t,e,s=t,i){var r,o,n,l;if(e===P)return e;let a=void 0!==i?null===(r=s._$Co)||void 0===r?void 0:r[i]:s._$Cl;const h=w(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(o=null==a?void 0:a._$AO)||void 0===o||o.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,s,i)),void 0!==i?(null!==(n=(l=s)._$Co)&&void 0!==n?n:l._$Co=[])[i]=a:s._$Cl=a),void 0!==a&&(e=I(t,a._$AS(t,e.values),a,i)),e}class B{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:s},parts:i}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:j).importNode(s,!0);R.currentNode=r;let o=R.nextNode(),n=0,l=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new q(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new X(o,this,t)),this.u.push(e),a=i[++l]}n!==(null==a?void 0:a.index)&&(o=R.nextNode(),n++)}return r}p(t){let e=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class q{constructor(t,e,s,i){var r;this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cm=null===(r=null==i?void 0:i.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=I(this,t,e),w(t)?t===N||null==t||""===t?(this._$AH!==N&&this._$AR(),this._$AH=N):t!==this._$AH&&t!==P&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>S(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==N&&w(this._$AH)?this._$AA.nextSibling.data=t:this.T(j.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=D.createElement(i.h,this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.p(s);else{const t=new B(r,this),e=t.v(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=z.get(t.strings);return void 0===e&&z.set(t.strings,e=new D(t)),e}k(t){S(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new q(this.O(E()),this.O(E()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class W{constructor(t,e,s,i,r){this.type=1,this._$AH=N,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=N}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(void 0===r)t=I(this,t,e,0),o=!w(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const i=t;let n,l;for(t=r[0],n=0;n<r.length-1;n++)l=I(this,i[s+n],e,n),l===P&&(l=this._$AH[n]),o||(o=!w(l)||l!==this._$AH[n]),l===N?t=N:t!==N&&(t+=(null!=l?l:"")+r[n+1]),this._$AH[n]=l}o&&!i&&this.j(t)}j(t){t===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class V extends W{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===N?void 0:t}}const F=$?$.emptyScript:"";class K extends W{constructor(){super(...arguments),this.type=4}j(t){t&&t!==N?this.element.setAttribute(this.name,F):this.element.removeAttribute(this.name)}}class J extends W{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){var s;if((t=null!==(s=I(this,t,e,0))&&void 0!==s?s:N)===P)return;const i=this._$AH,r=t===N&&i!==N||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==N&&(i===N||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class X{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){I(this,t)}}const Y=g.litHtmlPolyfillSupport;null==Y||Y(D,q),(null!==(f=g.litHtmlVersions)&&void 0!==f?f:g.litHtmlVersions=[]).push("2.4.0"); | |
| /** | |
| * @license | |
| * Copyright 2017 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| var Z,G;class Q extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{var i,r;const o=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==s?void 0:s.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new q(e.insertBefore(E(),t),t,void 0,null!=s?s:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return P}}Q.finalized=!0,Q._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:Q});const tt=globalThis.litElementPolyfillSupport;null==tt||tt({LitElement:Q}),(null!==(G=globalThis.litElementVersions)&&void 0!==G?G:globalThis.litElementVersions=[]).push("3.2.2"); | |
| /** | |
| * @license | |
| * Copyright 2017 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| const et=1,st=2,it=t=>(...e)=>({_$litDirective$:t,values:e});class rt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} | |
| /** | |
| * @license | |
| * Copyright 2018 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */const ot=it(class extends rt{constructor(t){var e;if(super(t),t.type!==et||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var s,i;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(s=this.st)||void 0===s?void 0:s.has(t))&&this.nt.add(t);return this.render(e)}const r=t.element.classList;this.nt.forEach((t=>{t in e||(r.remove(t),this.nt.delete(t))}));for(const t in e){const s=!!e[t];s===this.nt.has(t)||(null===(i=this.st)||void 0===i?void 0:i.has(t))||(s?(r.add(t),this.nt.add(t)):(r.remove(t),this.nt.delete(t)))}return P}});function nt(t,e){return Array.from(t.querySelectorAll(e))}function lt(t){return t.replace(/\*(.*?)\*/g,"<strong>$1</strong>").replace(/`(.*?)`/g,"<code>$1</code>").replace(/_(.*?)_/g,"<em>$1</em>").replace(/\+(.*?)\+/g,'<span class="underline">$1</span>').replace(/~(.*?)~/g,'<span class="strike-through">$1</span>').replace(/#(.*?)#/g,"<mark>$1</mark>").replace(/@(.*?)@/g,'<span class="time">$1</span>').replace(/\$(.*?)\$/g,'<span class="question">$1</span>')}function at(t,e,s,i){if(s===i.length-1)return Object.fromEntries(i)}const ht=o`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote,.hljs-variable{color:green}.hljs-built_in,.hljs-keyword,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#00f}.hljs-addition,.hljs-attribute,.hljs-literal,.hljs-section,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type{color:#a31515}.hljs-deletion,.hljs-meta,.hljs-selector-attr,.hljs-selector-pseudo{color:#2b91af}.hljs-doctag{color:grey}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}`,ct=o`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#a0a1a7;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e45649}.hljs-literal{color:#0184bb}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#50a14f}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#4078f2}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#c18401}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}`,dt=o`.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#7b5502}.hljs-attr{color:#a00}:host{display:block;background-color:#fff}:host([todo]){position:relative}.todo-banner,:host([todo])::after{content:'TODO';display:block;position:absolute;left:0;background-color:#ff0;border-style:solid;border-color:#000;border-width:.1rem 0;font-family:Arial,sans-serif;padding:0 5rem;top:0;transform:translateX(-35%) translateY(60%) rotate(-45deg)}audio{display:none}`,ut=o`.code-blocks{align-content:center;display:grid;gap:1rem;justify-content:center}pre{background-color:#f5f5f5;white-space:pre-wrap;margin:0 2rem;padding:1rem;border-radius:.5rem;font-family:OperatorMono-Medium,monospace;font-size:1.25rem}pre[big]{font-size:1.5rem}pre[medium]{font-size:1.1rem}pre[small]{font-size:.8rem}pre[tiny]{font-size:.6rem}pre[invisible]{opacity:0}pre[dim]{opacity:.5}`;const pt=new WeakMap;function mt(t,e=0){if(null==t)return;const s=setTimeout((()=>{try{t.pause(),t.currentTime=0,t.play()}catch(t){console.log(t)}}),e);pt.set(t,s)} | |
| /** | |
| * @license | |
| * Copyright 2017 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| class vt extends rt{constructor(t){if(super(t),this.it=N,t.type!==st)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===N||null==t)return this._t=void 0,this.it=t;if(t===P)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}vt.directiveName="unsafeHTML",vt.resultType=1;const ft=it(vt),gt=["","k","M","G","T","P"],$t=new Intl.NumberFormat("fr",{minimumFractionDigits:0,maximumFractionDigits:1});function _t(t,e,s){return null==e?function(t){const e=t>1?Math.floor(Math.log10(t)/3):0,s=t/1e3**e,i=$t.format(s);return O`${i}<strong class="unit">${gt[e]+"o"}</strong>`}(t):""===e?O`${$t.format(t)}`:"raw"===e?O`${t}`:"time"===e?function(t,e){const s=t/e;if(s>1e3){const t=$t.format(s/1e3);return O`${t}<strong class="unit">s</strong>`}const i=parseInt(s);return O`${i}<strong class="unit">ms</strong>`}(t,s):O`${$t.format(t)}<strong class="unit">${e}</strong>`}var bt,yt;bt="slide-barchart",yt={render({attrs:t,content:e}){const s=t.unit,[i,...r]=e.trim().split("\n").map((t=>t.trim())),o=r.map((t=>{const[e,s]=t.split(" : ").map((t=>t.trim())),[i,r="#888"]=s.split(" "),o=e.startsWith("// ");return{label:e.replace("// ",""),value:Number(i),isCommented:o,color:r}})).map(((e,s,i)=>{const r=null!=t.max?Number(t.max):Math.max(...i.map((t=>t.value))),o=100*e.value/r;return{...e,percent:o}}));return Math.max(...o.map((t=>t.value))),O`<div class="title"><div>${ft(lt(i))}</div>${null!=t.logo?O`<img class="title-logo" src="src/img/logo-${t.logo}.svg" alt="">`:""}</div><div class="container">${o.map((({label:e,value:i,isCommented:r,color:o,percent:n})=>O`<div class="section ${ot({comment:r})}"><div class="bar"><div class="bar-value" style="--bar-percent:${n}" data-color="${o}">${null==t.percent?O`<div class="bar-label">${_t(i,s,t.speed)}</div>`:""} ${null!=t.percent?O`<div class="bar-label">${_t(n,"%")}</div>`:""}</div></div><div class="legend">${ft(lt(e))}</div></div>`))}</div>`},styles:o`:host{display:grid;grid-template-rows:min-content 1fr;justify-content:center}.title{align-self:center;justify-self:center;font-size:3rem;font-weight:700;padding:1rem 0;font-family:'Yanone Kaffeesatz',sans-serif;display:flex;align-items:center;gap:1rem}strong{color:#0082ff}.underline{text-decoration:underline}em{margin-left:1rem;font-style:normal;color:#666;font-size:2rem}.title-logo{display:none;height:3rem}.container{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;align-content:center;justify-content:center}.section{display:flex;flex-direction:column;align-items:center}.bar{height:18rem;position:relative;width:2.5rem}:host([narrow]) .bar{width:1.75rem}:host([tiny]) .bar{width:1.5rem}.section.comment .bar{visibility:hidden}.bar-label{bottom:100%;box-sizing:border-box;font-family:OperatorMono-Medium,monospace;font-size:1.5rem;left:50%;padding-bottom:.5rem;position:absolute;text-align:center;transform-origin:center center;transform:translateX(-50%) scale(1,1);white-space:nowrap}:host([small]) .bar-label{font-size:1.25rem}:host([tiny]) .bar-label{font-size:.9rem}.unit{padding-left:.25rem;font-size:.8em;vertical-align:baseline;color:#777}.bar-value{box-sizing:border-box;position:absolute;bottom:0;left:0;width:100%;height:calc(var(--bar-percent) * 1%);background-color:#4285f4;border:.15rem solid #000;border-bottom:none}.bar-value[data-color=brut]{background-color:#ea4335}.bar-value[data-color=min]{background-color:#fbbc04}.bar-value[data-color=compressed]{background-color:#ff1493}.bar-value[data-color=gzip]{background-color:#4285f4}.bar-value[data-color=zopfli]{background-color:#46bdc6}.bar-value[data-color=brotli]{background-color:#34a853}.bar-value[data-color=zstd]{background-color:#663399}.legend{border-top:.15rem solid #000;box-sizing:border-box;font-family:OperatorMono-Medium,monospace;font-size:1.4rem;line-height:1.5;padding:.5rem 1rem;text-align:center;width:100%}:host([small]) .legend{min-width:5rem}:host([narrow]) .legend{padding:.5rem .75rem}:host([tiny]) .legend{padding:.5rem .6rem}.section.comment .legend{color:transparent}`},window.customElements.define(bt,class extends Q{static get properties(){return{position:{type:String,attribute:"data-position",reflect:!0}}}render(){const t=this.getAttributeNames().map((t=>{return[(e=t,e.replace(/-(.)/g,((t,e)=>e.toUpperCase()))),this.getAttribute(t)];var e})).reduce(at);var e;""===("string"==typeof(e=this.innerHTML)?e.trim():e)&&(this.innerHTML="");const s=""!==this.innerHTML?this.innerHTML:null;return yt.render?yt.render({attrs:t,content:s,slide:this}):""}update(t){if(super.update(t),t.has("position")){const t=Array.from(this.shadowRoot.querySelectorAll("[id]")).map((t=>[t.id,t])).reduce(at,[]);t.host=this.shadowRoot,"current"===this.position&&(null!=yt.onEnter&&yt.onEnter(t),nt(this.shadowRoot,"audio.global, video").forEach((t=>{console.log({media:t}),mt(t)})),nt(this,"audio.global").forEach((t=>{console.log({media:t}),mt(t)}))),"current"!==this.position&&(null!=yt.onLeave&&yt.onLeave(this.position,t,this),nt(this,"audio, video").forEach((t=>function(t){null!=t&&(t.pause(),t.currentTime=0,pt.has(t)&&(clearTimeout(pt.get(t)),pt.delete(t)))}(t))))}}static get styles(){return[ct,ht,dt,ut,yt.styles??""]}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment