Commit d0da616d authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[TASK] Update to Lit v2-rc1

Lit is the umbrella term for the next major
lit-html (v2) and lit-element (v3) versions.
Therefore we will refer to these components as
*Lit* in TYPO3 from now on as well.

These two libraries also have been migrated into
a single entry point module named `lit`.
It is officially described as:
> The main module exports the core pieces needed for component
> development: LitElement, html, css, and the most

lit-html v2 and lit-element v3 are mostly compatible
to the previous major versions. Main changes are

 * Deprecation of the `lit-element` entry point in
   favor of the new `lit` module
 * @internalProperty changed to @state
 * shadow css declaration via static property
   instead of static getter method
 * The CSSResult type declaration is gone
 * Directive (currently unused in TYPO3) API has changed

Related testing framework change is:
https://github.com/TYPO3/testing-framework/pull/229

Commands used:

  rm -rf typo3/sysext/core/Resources/Public/JavaScript/Contrib/{@lit,lit-element,lit-html,lit}/
  yarn add lit@^2.0.0-rc.1 lit-html@^2.0.0-rc.2 lit-element@^3.0.0-rc.1
  yarn add --dev rollup@^2.32.0 @rollup/plugin-replace
  grunt build
  git add typo3/sysext/core/Resources/Public/JavaScript/Contrib/{@lit,lit-element,lit-html,lit}/

  composer require --dev typo3/testing-framework:^6.8.1
  composer require --dev typo3/testing-framework:^6.8.1 \
    --no-update --working-dir=typo3/sysext/core

Resolves: #93965
Releases: master
Change-Id: I9b659d851e6ad9dc3cc649bd40aab886b86fb0f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68104

Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
parent 0005bc5b
define(["exports","../lib/directive","../lib/parts","../lit-html"],(function(e,t,i,n){"use strict";
define(["exports","../lit-html"],(function(exports,litHtml){"use strict";
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const o=new WeakMap,r=t.directive(e=>t=>{const n=o.get(t);if(void 0===e&&t instanceof i.AttributePart){if(void 0!==n||!o.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);o.set(t,e)});e.ifDefined=r,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/exports.ifDefined=l=>null!=l?l:litHtml.nothing,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/parts","../lit-html"],(function(e,t,i,n){"use strict";
define(["exports","../lit-html","../directive","../directive-helpers"],(function(exports,litHtml,directive,directiveHelpers){"use strict";
/**
* @license
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const r=t.directive(e=>t=>{let n;if(t instanceof i.EventPart||t instanceof i.NodePart)throw new Error("The `live` directive is not allowed on text or event bindings");if(t instanceof i.BooleanAttributePart)o(t.strings),n=t.element.hasAttribute(t.name),t.value=n;else{const{element:r,name:s,strings:a}=t.committer;if(o(a),t instanceof i.PropertyPart){if(n=r[s],n===e)return}else t instanceof i.AttributePart&&(n=r.getAttribute(s));if(n===String(e))return}t.setValue(e)}),o=e=>{if(2!==e.length||""!==e[0]||""!==e[1])throw new Error("`live` bindings can only contain a single expression")};e.live=r,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const l=directive.directive(class extends directive.Directive{constructor(r){if(super(r),r.type!==directive.PartType.PROPERTY&&r.type!==directive.PartType.ATTRIBUTE&&r.type!==directive.PartType.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!directiveHelpers.isSingleExpression(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t]){if(t===litHtml.noChange||t===litHtml.nothing)return t;const o=i.element,l=i.name;if(i.type===directive.PartType.PROPERTY){if(t===o[l])return litHtml.noChange}else if(i.type===directive.PartType.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(l))return litHtml.noChange}else if(i.type===directive.PartType.ATTRIBUTE&&o.getAttribute(l)===t+"")return litHtml.noChange;return directiveHelpers.setCommittedValue(i),t}});exports.live=l,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lit-html","../directive","../async-directive"],(function(exports,litHtml,directive,asyncDirective){"use strict";
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class o{}const h=new WeakMap,n=directive.directive(class extends asyncDirective.AsyncDirective{render(i){return litHtml.nothing}update(i,[s]){var e;const o=s!==this.gt;return o&&void 0!==this.gt&&this.xt(void 0),(o||this.Tt!==this.Et)&&(this.gt=s,this.At=null===(e=i.options)||void 0===e?void 0:e.host,this.xt(this.Et=i.element)),litHtml.nothing}xt(t){"function"==typeof this.gt?(void 0!==h.get(this.gt)&&this.gt.call(this.At,void 0),h.set(this.gt,t),void 0!==t&&this.gt.call(this.At,t)):this.gt.value=t}get Tt(){var t;return"function"==typeof this.gt?h.get(this.gt):null===(t=this.gt)||void 0===t?void 0:t.value}disconnected(){this.Tt===this.Et&&this.xt(void 0)}reconnected(){this.xt(this.Et)}});exports.createRef=()=>new o,exports.ref=n,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/dom","../lib/template","../lib/parts","../lit-html"],(function(e,t,o,n,r,s){"use strict";
define(["exports","../lit-html","../directive","../directive-helpers"],(function(exports,litHtml,directive,directiveHelpers){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const i=(e,t)=>{const o=e.startNode.parentNode,s=void 0===t?e.endNode:t.startNode,i=o.insertBefore(n.createMarker(),s);o.insertBefore(n.createMarker(),s);const l=new r.NodePart(e.options);return l.insertAfterNode(i),l},l=(e,t)=>(e.setValue(t),e.commit(),e),d=(e,t,n)=>{const r=e.startNode.parentNode,s=n?n.startNode:e.endNode,i=t.endNode.nextSibling;i!==s&&o.reparentNodes(r,t.startNode,i,s)},a=e=>{o.removeNodes(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},f=(e,t,o)=>{const n=new Map;for(let r=t;r<=o;r++)n.set(e[r],r);return n},c=new WeakMap,N=new WeakMap,u=t.directive((e,t,o)=>{let n;return void 0===o?o=t:void 0!==t&&(n=t),t=>{if(!(t instanceof r.NodePart))throw new Error("repeat can only be used in text bindings");const s=c.get(t)||[],u=N.get(t)||[],p=[],b=[],v=[];let g,h,m=0;for(const t of e)v[m]=n?n(t,m):m,b[m]=o(t,m),m++;let w=0,M=s.length-1,k=0,x=b.length-1;for(;w<=M&&k<=x;)if(null===s[w])w++;else if(null===s[M])M--;else if(u[w]===v[k])p[k]=l(s[w],b[k]),w++,k++;else if(u[M]===v[x])p[x]=l(s[M],b[x]),M--,x--;else if(u[w]===v[x])p[x]=l(s[w],b[x]),d(t,s[w],p[x+1]),w++,x--;else if(u[M]===v[k])p[k]=l(s[M],b[k]),d(t,s[M],s[w]),M--,k++;else if(void 0===g&&(g=f(v,k,x),h=f(u,w,M)),g.has(u[w]))if(g.has(u[M])){const e=h.get(v[k]),o=void 0!==e?s[e]:null;if(null===o){const e=i(t,s[w]);l(e,b[k]),p[k]=e}else p[k]=l(o,b[k]),d(t,o,s[w]),s[e]=null;k++}else a(s[M]),M--;else a(s[w]),w++;for(;k<=x;){const e=i(t,p[x+1]);l(e,b[k]),p[k++]=e}for(;w<=M;){const e=s[w++];null!==e&&a(e)}c.set(t,p),N.set(t,v)}});e.repeat=u,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const u=(e,s,t)=>{const r=new Map;for(let l=s;l<=t;l++)r.set(e[l],l);return r},c=directive.directive(class extends directive.Directive{constructor(e){if(super(e),e.type!==directive.PartType.CHILD)throw Error("repeat() can only be used in text expressions")}Mt(e,s,t){let r;void 0===t?t=s:void 0!==s&&(r=s);const l=[],o=[];let i=0;for(const s of e)l[i]=r?r(s,i):i,o[i]=t(s,i),i++;return{values:o,keys:l}}render(e,s,t){return this.Mt(e,s,t).values}update(s,[t,r,c]){var d;const p=directiveHelpers.getCommittedValue(s),{values:v,keys:a}=this.Mt(t,r,c);if(!p)return this.Pt=a,v;const h=null!==(d=this.Pt)&&void 0!==d?d:this.Pt=[],m=[];let x,y,j=0,k=p.length-1,w=0,b=v.length-1;for(;j<=k&&w<=b;)if(null===p[j])j++;else if(null===p[k])k--;else if(h[j]===a[w])m[w]=directiveHelpers.setChildPartValue(p[j],v[w]),j++,w++;else if(h[k]===a[b])m[b]=directiveHelpers.setChildPartValue(p[k],v[b]),k--,b--;else if(h[j]===a[b])m[b]=directiveHelpers.setChildPartValue(p[j],v[b]),directiveHelpers.insertPart(s,m[b+1],p[j]),j++,b--;else if(h[k]===a[w])m[w]=directiveHelpers.setChildPartValue(p[k],v[w]),directiveHelpers.insertPart(s,p[j],p[k]),k--,w++;else if(void 0===x&&(x=u(a,w,b),y=u(h,j,k)),x.has(h[j]))if(x.has(h[k])){const e=y.get(a[w]),t=void 0!==e?p[e]:null;if(null===t){const e=directiveHelpers.insertPart(s,p[j]);directiveHelpers.setChildPartValue(e,v[w]),m[w]=e}else m[w]=directiveHelpers.setChildPartValue(t,v[w]),directiveHelpers.insertPart(s,p[j],t),p[e]=null;w++}else directiveHelpers.removePart(p[k]),k--;else directiveHelpers.removePart(p[j]),j++;for(;w<=b;){const e=directiveHelpers.insertPart(s,m[b+1]);directiveHelpers.setChildPartValue(e,v[w]),m[w++]=e}for(;j<=k;){const e=p[j++];null!==e&&directiveHelpers.removePart(e)}return this.Pt=a,directiveHelpers.setCommittedValue(s,m),litHtml.noChange}});exports.repeat=c,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/parts","../lit-html"],(function(e,t,r,i){"use strict";
define(["exports","../lit-html","../directive"],(function(exports,litHtml,directive){"use strict";
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const n=new WeakMap,s=t.directive(e=>t=>{if(!(t instanceof r.AttributePart)||t instanceof r.PropertyPart||"style"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=t,{style:s}=i.element;let o=n.get(t);void 0===o&&(s.cssText=i.strings.join(" "),n.set(t,o=new Set)),o.forEach(t=>{t in e||(o.delete(t),-1===t.indexOf("-")?s[t]=null:s.removeProperty(t))});for(const t in e)o.add(t),-1===t.indexOf("-")?s[t]=e[t]:s.setProperty(t,e[t])});e.styleMap=s,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const i=directive.directive(class extends directive.Directive{constructor(t){var e;if(super(t),t.type!==directive.PartType.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.St){this.St=new Set;for(const t in r)this.St.add(t);return this.render(r)}this.St.forEach(t=>{null==r[t]&&(this.St.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")});for(const t in r){const e=r[t];null!=e&&(this.St.add(t),t.includes("-")?s.setProperty(t,e):s[t]=e)}return litHtml.noChange}});exports.styleMap=i,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/parts","../lit-html"],(function(e,t,n,i){"use strict";
define(["exports","../lit-html","../directive"],(function(exports,litHtml,directive){"use strict";
/**
* @license
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const o=new WeakMap,r=t.directive(e=>t=>{if(!(t instanceof n.NodePart))throw new Error("templateContent can only be used in text bindings");const i=o.get(t);if(void 0!==i&&e===i.template&&t.value===i.fragment)return;const r=document.importNode(e.content,!0);t.setValue(r),o.set(t,{template:e,fragment:r})});e.templateContent=r,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const o=directive.directive(class extends directive.Directive{constructor(t){if(super(t),t.type!==directive.PartType.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.kt===r?litHtml.noChange:(this.kt=r,document.importNode(r.content,!0))}});exports.templateContent=o,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/parts","../lit-html"],(function(e,t,n,i){"use strict";
define(["exports","../lit-html","../directive"],(function(exports,litHtml,directive){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const r=new WeakMap,o=t.directive(e=>t=>{if(!(t instanceof n.NodePart))throw new Error("unsafeHTML can only be used in text bindings");const i=r.get(t);if(void 0!==i&&n.isPrimitive(e)&&e===i.value&&t.value===i.fragment)return;const o=document.createElement("template");o.innerHTML=e;const a=document.importNode(o.content,!0);t.setValue(a),r.set(t,{value:e,fragment:a})});e.unsafeHTML=o,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class n extends directive.Directive{constructor(i){if(super(i),this.vt=litHtml.nothing,i.type!==directive.PartType.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===litHtml.nothing)return this.Vt=void 0,this.vt=r;if(r===litHtml.noChange)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.vt)return this.Vt;this.vt=r;const s=[r];return s.raw=s,this.Vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}n.directiveName="unsafeHTML",n.resultType=1;const o=directive.directive(n);exports.UnsafeHTMLDirective=n,exports.unsafeHTML=o,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/dom","../lib/parts","../lit-html"],(function(e,t,n,i,r){"use strict";
define(["exports","../directive","./unsafe-html"],(function(exports,directive,unsafeHtml){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const o=new WeakMap,s=window.navigator.userAgent.indexOf("Trident/")>0,d=t.directive(e=>t=>{if(!(t instanceof i.NodePart))throw new Error("unsafeSVG can only be used in text bindings");const r=o.get(t);if(void 0!==r&&i.isPrimitive(e)&&e===r.value&&t.value===r.fragment)return;const d=document.createElement("template"),a=d.content;let l;s?(d.innerHTML=`<svg>${e}</svg>`,l=a.firstChild):(l=document.createElementNS("http://www.w3.org/2000/svg","svg"),a.appendChild(l),l.innerHTML=e),a.removeChild(l),n.reparentNodes(a,l.firstChild);const c=document.importNode(a,!0);t.setValue(c),o.set(t,{value:e,fragment:c})});e.unsafeSVG=d,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class t extends unsafeHtml.UnsafeHTMLDirective{}t.directiveName="unsafeSVG",t.resultType=2;const o=directive.directive(t);exports.unsafeSVG=o,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","../lib/directive","../lib/parts","../lit-html"],(function(e,t,n,d){"use strict";
define(["exports","../lit-html","../directive","../directive-helpers","../async-directive"],(function(exports,litHtml,directive,directiveHelpers,asyncDirective){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const l=new WeakMap,s=2147483647,i=t.directive((...e)=>t=>{let d=l.get(t);void 0===d&&(d={lastRenderedIndex:s,values:[]},l.set(t,d));const i=d.values;let r=i.length;d.values=e;for(let l=0;l<e.length&&!(l>d.lastRenderedIndex);l++){const a=e[l];if(n.isPrimitive(a)||"function"!=typeof a.then){t.setValue(a),d.lastRenderedIndex=l;break}l<r&&a===i[l]||(d.lastRenderedIndex=s,r=0,Promise.resolve(a).then(e=>{const n=d.values.indexOf(a);n>-1&&n<d.lastRenderedIndex&&(d.lastRenderedIndex=n,t.setValue(e),t.commit())}))}});e.until=i,Object.defineProperty(e,"__esModule",{value:!0})}));
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const e=t=>!directiveHelpers.isPrimitive(t)&&"function"==typeof t.then,o=directive.directive(class extends asyncDirective.AsyncDirective{constructor(){super(...arguments),this.Ct=2147483647,this.Rt=[]}render(...r){var s;return null!==(s=r.find(t=>!e(t)))&&void 0!==s?s:litHtml.noChange}update(r,s){const i=this.Rt;let o=i.length;this.Rt=s;for(let t=0;t<s.length&&!(t>this.Ct);t++){const r=s[t];if(!e(r))return this.Ct=t,r;t<o&&r===i[t]||(this.Ct=2147483647,o=0,Promise.resolve(r).then(t=>{const s=this.Rt.indexOf(r);s>-1&&s<this.Ct&&(this.Ct=s,this.setValue(t))}))}return litHtml.noChange}});exports.until=o,Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","./lit-html","./directive","./directive-helpers"],(function(exports,litHtml,directive,directiveHelpers){"use strict";
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{tt:i,it:a,st:s,et:c,ht:d}=litHtml.,f=(t,r,l,d)=>{let p,f;if(0===l.length)f=new c(r,null,void 0,d),p=t;else{const e=l[l.length-1];if("template-instance"===e.type)f=new c(r,null,e.instance,d),e.instance.l.push(f),p=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){f=new c(r,null,e.part,d);const t=e.iterator.next();if(t.done)throw p=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");p=t.value,e.part.H.push(f)}else f=new c(r,null,e.part,d)}if(p=s(f,p),p===litHtml.noChange)l.push({part:f,type:"leaf"});else if(directiveHelpers.isPrimitive(p))l.push({part:f,type:"leaf"}),f.H=p;else if(directiveHelpers.isTemplateResult(p)){const e="lit-part "+m(p);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=c.prototype.C(p),t=new i(e,f);l.push({type:"template-instance",instance:t,part:f,templatePartIndex:0,instancePartIndex:0,result:p}),f.H=t}}else a(p)?(l.push({part:f,type:"iterable",value:p,iterator:p[Symbol.iterator](),done:!1}),f.H=[]):(l.push({part:f,type:"leaf"}),f.H=null==p?"":p);return f},h=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t.B=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},u=(e,t,n)=>{var o;const i=/lit-node (\d+)/.exec(e.data),a=parseInt(i[1]),c=null!==(o=e.previousSibling)&&void 0!==o?o:e.parentElement,p=t[t.length-1];if("template-instance"!==p.type)throw Error("internal error");{const e=p.instance;for(;;){const t=e.D.parts[p.templatePartIndex];if(void 0===t||t.type!==directive.PartType.ATTRIBUTE&&t.type!==directive.PartType.ELEMENT||t.index!==a)break;if(t.type===directive.PartType.ATTRIBUTE){const o=new t.ctor(c,t.name,t.strings,p.instance,n),i=directiveHelpers.isSingleExpression(o)?p.result.values[p.instancePartIndex]:p.result.values,a=!(o.type===directive.PartType.EVENT||o.type===directive.PartType.PROPERTY);o.I(i,o,p.instancePartIndex,a),p.instancePartIndex+=t.strings.length-1,e.l.push(o)}else{const t=new d(c,p.instance,n);s(t,p.result.values[p.instancePartIndex++]),e.l.push(t)}p.templatePartIndex++}}},m=e=>{const t=new Uint32Array(2).fill(5381);for(const r of e.strings)for(let e=0;e<r.length;e++)t[e%2]=33*t[e%2]^r.charCodeAt(e);return btoa(String.fromCharCode(...new Uint8Array(t.buffer)))};exports.digestForTemplateResult=m,exports.hydrate=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o;const l=[],i=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1);let a;for(;null!==(a=i.nextNode());){const t=a.data;if(t.startsWith("lit-part")){if(0===l.length&&void 0!==n)throw Error("there must be only one root part per container");o=f(e,a,l,r),null!=n||(n=o)}else if(t.startsWith("lit-node")){u(a,l,r);const e=a.parentElement;e.hasAttribute("defer-hydration")&&e.removeAttribute("defer-hydration")}else if(t.startsWith("/lit-part")){if(1===l.length&&o!==n)throw Error("internal error");o=h(a,o,l)}}console.assert(void 0!==n,"there should be exactly one root part in a render container"),t._$litPart$=n},Object.defineProperty(exports,"__esModule",{value:!0})}));
define(["exports","./parts"],(function(e,t){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/class r{handleAttributeExpressions(e,r,n,s){const o=r[0];if("."===o){return new t.PropertyCommitter(e,r.slice(1),n).parts}if("@"===o)return[new t.EventPart(e,r.slice(1),s.eventContext)];if("?"===o)return[new t.BooleanAttributePart(e,r.slice(1),n)];return new t.AttributeCommitter(e,r,n).parts}handleTextExpression(e){return new t.NodePart(e)}}const n=new r;e.DefaultTemplateProcessor=r,e.defaultTemplateProcessor=n,Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports"],(function(e){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const t=new WeakMap;e.directive=e=>(...i)=>{const n=e(...i);return t.set(n,!0),n},e.isDirective=e=>"function"==typeof e&&t.has(e),Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports"],(function(e){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const l="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback;e.isCEPolyfill=l,e.removeNodes=(e,l,n=null)=>{for(;l!==n;){const n=l.nextSibling;e.removeChild(l),l=n}},e.reparentNodes=(e,l,n=null,o=null)=>{for(;l!==n;){const n=l.nextSibling;e.insertBefore(l,o),l=n}},Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports","./template"],(function(e,n){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const t=e=>{let n=11===e.nodeType?0:1;const t=document.createTreeWalker(e,133,null,!1);for(;t.nextNode();)n++;return n},r=(e,t=-1)=>{for(let r=t+1;r<e.length;r++){const t=e[r];if(n.isTemplatePartActive(t))return r}return-1};e.insertNodeIntoTemplate=function(e,n,o=null){const{element:{content:l},parts:u}=e;if(null==o)return void l.appendChild(n);const d=document.createTreeWalker(l,133,null,!1);let c=r(u),i=0,s=-1;for(;d.nextNode();){s++;for(d.currentNode===o&&(i=t(n),o.parentNode.insertBefore(n,o));-1!==c&&u[c].index===s;){if(i>0){for(;-1!==c;)u[c].index+=i,c=r(u,c);return}c=r(u,c)}}},e.removeNodesFromTemplate=function(e,n){const{element:{content:t},parts:o}=e,l=document.createTreeWalker(t,133,null,!1);let u=r(o),d=o[u],c=-1,i=0;const s=[];let a=null;for(;l.nextNode();){c++;const e=l.currentNode;for(e.previousSibling===a&&(a=null),n.has(e)&&(s.push(e),null===a&&(a=e)),null!==a&&i++;void 0!==d&&d.index===c;)d.index=null!==a?-1:d.index-i,u=r(o,u),d=o[u]}s.forEach(e=>e.parentNode.removeChild(e))},Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports"],(function(e){"use strict";
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/e.noChange={},e.nothing={},Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports","./directive","./dom","./part","./template","./template-instance","./template-result"],(function(t,e,i,s,n,a,o){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const r=t=>null===t||!("object"==typeof t||"function"==typeof t),h=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class l{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t<i.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new u(this)}_getValue(){const t=this.strings,e=t.length-1,i=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=i[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!h(t))return t}let s="";for(let n=0;n<e;n++){s+=t[n];const e=i[n];if(void 0!==e){const t=e.value;if(r(t)||!h(t))s+="string"==typeof t?t:String(t);else for(const e of t)s+="string"==typeof e?e:String(e)}}return s+=t[e],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class u{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===s.noChange||r(t)&&t===this.value||(this.value=t,e.isDirective(t)||(this.committer.dirty=!0))}commit(){for(;e.isDirective(this.value);){const t=this.value;this.value=s.noChange,t(this)}this.value!==s.noChange&&this.committer.commit()}}class d{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(n.createMarker()),this.endNode=t.appendChild(n.createMarker())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=n.createMarker()),t.__insert(this.endNode=n.createMarker())}insertAfterPart(t){t.__insert(this.startNode=n.createMarker()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;e.isDirective(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=s.noChange,t(this)}const t=this.__pendingValue;t!==s.noChange&&(r(t)?t!==this.value&&this.__commitText(t):t instanceof o.TemplateResult?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):h(t)?this.__commitIterable(t):t===s.nothing?(this.value=s.nothing,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,i="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=i:this.__commitNode(document.createTextNode(i)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof a.TemplateInstance&&this.value.template===e)this.value.update(t.values);else{const i=new a.TemplateInstance(e,t.processor,this.options),s=i._clone();i.update(t.values),this.__commitNode(s),this.value=i}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let i,s=0;for(const n of t)i=e[s],void 0===i&&(i=new d(this.options),e.push(i),0===s?i.appendIntoPart(this):i.insertAfterPart(e[s-1])),i.setValue(n),i.commit(),s++;s<e.length&&(e.length=s,this.clear(i&&i.endNode))}clear(t=this.startNode){i.removeNodes(this.startNode.parentNode,t.nextSibling,this.endNode)}}class c extends u{}let _=!1;(()=>{try{const t={get capture(){return _=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();const p=t=>t&&(_?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);t.AttributeCommitter=l,t.AttributePart=u,t.BooleanAttributePart=class{constructor(t,e,i){if(this.value=void 0,this.__pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=i}setValue(t){this.__pendingValue=t}commit(){for(;e.isDirective(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=s.noChange,t(this)}if(this.__pendingValue===s.noChange)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=s.noChange}},t.EventPart=class{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;e.isDirective(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=s.noChange,t(this)}if(this.__pendingValue===s.noChange)return;const t=this.__pendingValue,i=this.value,n=null==t||null!=i&&(t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive),a=null!=t&&(null==i||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),a&&(this.__options=p(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=s.noChange}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}},t.NodePart=d,t.PropertyCommitter=class extends l{constructor(t,e,i){super(t,e,i),this.single=2===i.length&&""===i[0]&&""===i[1]}_createPart(){return new c(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}},t.PropertyPart=c,t.isIterable=h,t.isPrimitive=r,Object.defineProperty(t,"__esModule",{value:!0})}));
define(["exports","./dom","./parts","./template-factory"],(function(e,t,a,o){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const r=new WeakMap;e.parts=r,e.render=(e,s,n)=>{let d=r.get(s);void 0===d&&(t.removeNodes(s,s.firstChild),r.set(s,d=new a.NodePart(Object.assign({templateFactory:o.templateFactory},n))),d.appendInto(s)),d.setValue(e),d.commit()},Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports","./dom","./template","./template-instance","./template-result","./template-factory","./render","../lit-html","./modify-template"],(function(e,t,n,o,r,s,a,l,d){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const i=(e,t)=>`${e}--${t}`;let m=!0;void 0===window.ShadyCSS?m=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),m=!1);const c=e=>t=>{const o=i(t.type,e);let r=s.templateCaches.get(o);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},s.templateCaches.set(o,r));let a=r.stringsArray.get(t.strings);if(void 0!==a)return a;const l=t.strings.join(n.marker);if(a=r.keyString.get(l),void 0===a){const o=t.getTemplateElement();m&&window.ShadyCSS.prepareTemplateDom(o,e),a=new n.Template(t,o),r.keyString.set(l,a)}return r.stringsArray.set(t.strings,a),a},p=["html","svg"],S=new Set,y=(e,t,n)=>{S.add(e);const o=n?n.element:document.createElement("template"),r=t.querySelectorAll("style"),{length:a}=r;if(0===a)return void window.ShadyCSS.prepareTemplateStyles(o,e);const l=document.createElement("style");for(let e=0;e<a;e++){const t=r[e];t.parentNode.removeChild(t),l.textContent+=t.textContent}(e=>{p.forEach(t=>{const n=s.templateCaches.get(i(t,e));void 0!==n&&n.keyString.forEach(e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{n.add(e)}),d.removeNodesFromTemplate(e,n)})})})(e);const m=o.content;n?d.insertNodeIntoTemplate(n,l,m.firstChild):m.insertBefore(l,m.firstChild),window.ShadyCSS.prepareTemplateStyles(o,e);const c=m.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)t.insertBefore(c.cloneNode(!0),t.firstChild);else if(n){m.insertBefore(l,m.firstChild);const e=new Set;e.add(l),d.removeNodesFromTemplate(n,e)}};e.TemplateResult=r.TemplateResult,e.html=l.html,e.svg=l.svg,e.render=(e,n,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const s=r.scopeName,l=a.parts.has(n),d=m&&11===n.nodeType&&!!n.host,i=d&&!S.has(s),p=i?document.createDocumentFragment():n;if(a.render(e,p,Object.assign({templateFactory:c(s)},r)),i){const e=a.parts.get(p);a.parts.delete(p);const r=e.value instanceof o.TemplateInstance?e.value.template:void 0;y(s,p,r),t.removeNodes(n,n.firstChild),n.appendChild(p),a.parts.set(n,e)}!l&&d&&window.ShadyCSS.styleElement(n.host)},e.shadyTemplateFactory=c,Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports","./template"],(function(e,t){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const r=new Map;e.templateCaches=r,e.templateFactory=function(e){let n=r.get(e.type);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},r.set(e.type,n));let s=n.stringsArray.get(e.strings);if(void 0!==s)return s;const i=e.strings.join(t.marker);return s=n.keyString.get(i),void 0===s&&(s=new t.Template(e,e.getTemplateElement()),n.keyString.set(i,s)),n.stringsArray.set(e.strings,s),s},Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports","./dom","./template"],(function(e,t,s){"use strict";
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/e.TemplateInstance=class{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=t.isCEPolyfill?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),o=[],n=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r,p=0,l=0,a=i.nextNode();for(;p<n.length;)if(r=n[p],s.isTemplatePartActive(r)){for(;l<r.index;)l++,"TEMPLATE"===a.nodeName&&(o.push(a),i.currentNode=a.content),null===(a=i.nextNode())&&(i.currentNode=o.pop(),a=i.nextNode());if("node"===r.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(a.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,r.name,r.strings,this.options));p++}else this.__parts.push(void 0),p++;return t.isCEPolyfill&&(document.adoptNode(e),customElements.upgrade(e)),e}},Object.defineProperty(e,"__esModule",{value:!0})}));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment