@telperion/elements 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build-manifest.json +1 -1
- package/button/button.element.cjs +3 -3
- package/button/button.element.js +3 -3
- package/button/index.d.cts +1 -1
- package/button/index.d.ts +1 -1
- package/custom-elements.json +3 -3
- package/fesm/elements.mjs +7 -7
- package/iife/button/index.js +8 -8
- package/iife/elements.js +17 -17
- package/iife/router/index.js +2 -2
- package/iife/select/index.js +16 -16
- package/package.json +1 -1
- package/select/option.element.cjs +2 -2
- package/select/option.element.js +2 -2
- package/utils/shade-mixer-lit-element.cjs +2 -2
- package/utils/shade-mixer-lit-element.js +2 -2
package/.build-manifest.json
CHANGED
|
@@ -34,7 +34,7 @@ var shadeMixerLitElement = require('../utils/shade-mixer-lit-element.cjs');
|
|
|
34
34
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
35
35
|
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
36
36
|
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
37
|
-
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in
|
|
37
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```html
|
|
@@ -60,7 +60,7 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
60
60
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
61
61
|
--tp-button-active-mixer-color: transparent;
|
|
62
62
|
--tp-button-active-mixer-percentage: 10%;
|
|
63
|
-
--tp-button-active-color: color-mix(in
|
|
63
|
+
--tp-button-active-color: color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
64
64
|
display: inline-block;
|
|
65
65
|
border: 1px solid transparent;
|
|
66
66
|
cursor: pointer;
|
|
@@ -80,7 +80,7 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
&[disabled] {
|
|
83
|
-
--tp-button-color: color-mix(in
|
|
83
|
+
--tp-button-color: color-mix(in oklab, var(--tp-calc-element-color) 50%, var(--tp-color-white) 50%);
|
|
84
84
|
--tp-button-contrast-color: rgb(from var(--tp-calc-contrast-color) r g b / 50%);
|
|
85
85
|
pointer-events: none;
|
|
86
86
|
user-select: none;
|
package/button/button.element.js
CHANGED
|
@@ -32,7 +32,7 @@ import { ShadeMixerLitElement } from '../utils/shade-mixer-lit-element.js';
|
|
|
32
32
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
33
33
|
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
34
34
|
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
35
|
-
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in
|
|
35
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```html
|
|
@@ -58,7 +58,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
58
58
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
59
59
|
--tp-button-active-mixer-color: transparent;
|
|
60
60
|
--tp-button-active-mixer-percentage: 10%;
|
|
61
|
-
--tp-button-active-color: color-mix(in
|
|
61
|
+
--tp-button-active-color: color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
62
62
|
display: inline-block;
|
|
63
63
|
border: 1px solid transparent;
|
|
64
64
|
cursor: pointer;
|
|
@@ -78,7 +78,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
&[disabled] {
|
|
81
|
-
--tp-button-color: color-mix(in
|
|
81
|
+
--tp-button-color: color-mix(in oklab, var(--tp-calc-element-color) 50%, var(--tp-color-white) 50%);
|
|
82
82
|
--tp-button-contrast-color: rgb(from var(--tp-calc-contrast-color) r g b / 50%);
|
|
83
83
|
pointer-events: none;
|
|
84
84
|
user-select: none;
|
package/button/index.d.cts
CHANGED
|
@@ -52,7 +52,7 @@ declare global {
|
|
|
52
52
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
53
53
|
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
54
54
|
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
55
|
-
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in
|
|
55
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```html
|
package/button/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ declare global {
|
|
|
52
52
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
53
53
|
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
54
54
|
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
55
|
-
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in
|
|
55
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```html
|
package/custom-elements.json
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"name": "--tp-button-active-mixer-percentage"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
"description": "Final hover/active color, computed as `color-mix(in
|
|
31
|
+
"description": "Final hover/active color, computed as `color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.",
|
|
32
32
|
"name": "--tp-button-active-color"
|
|
33
33
|
}
|
|
34
34
|
],
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"kind": "field",
|
|
125
125
|
"name": "shadedElementStyles",
|
|
126
126
|
"static": true,
|
|
127
|
-
"default": "css` --tp-element-color: var(--tp-color-primary); --tp-shade-attr: attr(shade type(<number>)); --tp-shade-mixer-type: attr(mixer type(*)); --tp-shade-mixer-color: if( style(--tp-shade-mixer-type: black): var(--tp-color-black); else: var(--tp-color-white) ); --tp-shade-mixer-percent: if( style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%)); else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%)) ); --tp-calc-element-color: color-mix(in
|
|
127
|
+
"default": "css` --tp-element-color: var(--tp-color-primary); --tp-shade-attr: attr(shade type(<number>)); --tp-shade-mixer-type: attr(mixer type(*)); --tp-shade-mixer-color: if( style(--tp-shade-mixer-type: black): var(--tp-color-black); else: var(--tp-color-white) ); --tp-shade-mixer-percent: if( style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%)); else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%)) ); --tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent))); --tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color)); --tp-contrast-color: if( style(--tp-calc-contrast-color: white): var(--tp-color-white); else: var(--tp-color-black); ); &[color=\"contrast\"] { --tp-element-color: var(--tp-color-contrast); } &[color=\"primary\"] { --tp-element-color: var(--tp-color-primary); } &[color=\"secondary\"] { --tp-element-color: var(--tp-color-secondary); } &[color=\"tertiary\"] { --tp-element-color: var(--tp-color-tertiary); } &[color=\"quaternary\"] { --tp-element-color: var(--tp-color-quaternary); } &[color=\"success\"] { --tp-element-color: var(--tp-color-success); } &[color=\"danger\"] { --tp-element-color: var(--tp-color-danger); } &[color=\"warning\"] { --tp-element-color: var(--tp-color-warning); } &[color=\"neutral\"] { --tp-element-color: var(--tp-color-neutral); } `",
|
|
128
128
|
"inheritedFrom": {
|
|
129
129
|
"name": "ShadeMixerLitElement",
|
|
130
130
|
"module": "src/utils/shade-mixer-lit-element.ts"
|
|
@@ -8558,7 +8558,7 @@
|
|
|
8558
8558
|
"kind": "field",
|
|
8559
8559
|
"name": "shadedElementStyles",
|
|
8560
8560
|
"static": true,
|
|
8561
|
-
"default": "css` --tp-element-color: var(--tp-color-primary); --tp-shade-attr: attr(shade type(<number>)); --tp-shade-mixer-type: attr(mixer type(*)); --tp-shade-mixer-color: if( style(--tp-shade-mixer-type: black): var(--tp-color-black); else: var(--tp-color-white) ); --tp-shade-mixer-percent: if( style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%)); else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%)) ); --tp-calc-element-color: color-mix(in
|
|
8561
|
+
"default": "css` --tp-element-color: var(--tp-color-primary); --tp-shade-attr: attr(shade type(<number>)); --tp-shade-mixer-type: attr(mixer type(*)); --tp-shade-mixer-color: if( style(--tp-shade-mixer-type: black): var(--tp-color-black); else: var(--tp-color-white) ); --tp-shade-mixer-percent: if( style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%)); else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%)) ); --tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent))); --tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color)); --tp-contrast-color: if( style(--tp-calc-contrast-color: white): var(--tp-color-white); else: var(--tp-color-black); ); &[color=\"contrast\"] { --tp-element-color: var(--tp-color-contrast); } &[color=\"primary\"] { --tp-element-color: var(--tp-color-primary); } &[color=\"secondary\"] { --tp-element-color: var(--tp-color-secondary); } &[color=\"tertiary\"] { --tp-element-color: var(--tp-color-tertiary); } &[color=\"quaternary\"] { --tp-element-color: var(--tp-color-quaternary); } &[color=\"success\"] { --tp-element-color: var(--tp-color-success); } &[color=\"danger\"] { --tp-element-color: var(--tp-color-danger); } &[color=\"warning\"] { --tp-element-color: var(--tp-color-warning); } &[color=\"neutral\"] { --tp-element-color: var(--tp-color-neutral); } `"
|
|
8562
8562
|
},
|
|
8563
8563
|
{
|
|
8564
8564
|
"kind": "field",
|
package/fesm/elements.mjs
CHANGED
|
@@ -448,7 +448,7 @@ class ShadeMixerLitElement extends LitElement {
|
|
|
448
448
|
--tp-color-success: hsl(140 70% 40%);
|
|
449
449
|
--tp-color-danger: hsl(0 70% 50%);
|
|
450
450
|
--tp-color-warning: hsl(45 100% 50%);
|
|
451
|
-
--tp-color-neutral: color-mix(in
|
|
451
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
`;
|
|
@@ -467,7 +467,7 @@ class ShadeMixerLitElement extends LitElement {
|
|
|
467
467
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
468
468
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
469
469
|
);
|
|
470
|
-
--tp-calc-element-color: color-mix(in
|
|
470
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
471
471
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
472
472
|
--tp-contrast-color: if(
|
|
473
473
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|
|
@@ -3238,7 +3238,7 @@ let OptionElement = class OptionElement extends SignalWatcherLitElement {
|
|
|
3238
3238
|
background: var(--tp-select-option-color, white);
|
|
3239
3239
|
|
|
3240
3240
|
&:hover {
|
|
3241
|
-
background: color-mix(in
|
|
3241
|
+
background: color-mix(in oklab, var(--tp-select-option-color, white) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
3242
3242
|
}
|
|
3243
3243
|
|
|
3244
3244
|
&[selected] {
|
|
@@ -3246,7 +3246,7 @@ let OptionElement = class OptionElement extends SignalWatcherLitElement {
|
|
|
3246
3246
|
color: var(--tp-select-selection-contrast-color, white);
|
|
3247
3247
|
|
|
3248
3248
|
&:hover {
|
|
3249
|
-
background: color-mix(in
|
|
3249
|
+
background: color-mix(in oklab, var(--tp-select-selection-color, #0078d4) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
3250
3250
|
}
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
@@ -3873,7 +3873,7 @@ SelectElement = SelectElement_1 = __decorate([
|
|
|
3873
3873
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
3874
3874
|
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
3875
3875
|
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
3876
|
-
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in
|
|
3876
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
3877
3877
|
*
|
|
3878
3878
|
* @example
|
|
3879
3879
|
* ```html
|
|
@@ -3899,7 +3899,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3899
3899
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
3900
3900
|
--tp-button-active-mixer-color: transparent;
|
|
3901
3901
|
--tp-button-active-mixer-percentage: 10%;
|
|
3902
|
-
--tp-button-active-color: color-mix(in
|
|
3902
|
+
--tp-button-active-color: color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
3903
3903
|
display: inline-block;
|
|
3904
3904
|
border: 1px solid transparent;
|
|
3905
3905
|
cursor: pointer;
|
|
@@ -3919,7 +3919,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3919
3919
|
}
|
|
3920
3920
|
|
|
3921
3921
|
&[disabled] {
|
|
3922
|
-
--tp-button-color: color-mix(in
|
|
3922
|
+
--tp-button-color: color-mix(in oklab, var(--tp-calc-element-color) 50%, var(--tp-color-white) 50%);
|
|
3923
3923
|
--tp-button-contrast-color: rgb(from var(--tp-calc-contrast-color) r g b / 50%);
|
|
3924
3924
|
pointer-events: none;
|
|
3925
3925
|
user-select: none;
|
package/iife/button/index.js
CHANGED
|
@@ -4,18 +4,18 @@ this.TelperionElements=this.TelperionElements||{},function(t){"use strict";funct
|
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const r=globalThis,o=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),n=new WeakMap;let a=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(o&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&n.set(e,t))}return t}toString(){return this.cssText}};const l=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,r)=>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[r+1],t[0]);return new a(s,t,i)},c=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:h,defineProperty:p,getOwnPropertyDescriptor:d,getOwnPropertyNames:u,getOwnPropertySymbols:m,getPrototypeOf:f}=Object,$=globalThis,y=$.trustedTypes,v=y?y.emptyScript:"",_=$.reactiveElementPolyfillSupport,
|
|
7
|
+
const r=globalThis,o=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),n=new WeakMap;let a=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(o&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&n.set(e,t))}return t}toString(){return this.cssText}};const l=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,r)=>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[r+1],t[0]);return new a(s,t,i)},c=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:h,defineProperty:p,getOwnPropertyDescriptor:d,getOwnPropertyNames:u,getOwnPropertySymbols:m,getPrototypeOf:f}=Object,$=globalThis,y=$.trustedTypes,v=y?y.emptyScript:"",_=$.reactiveElementPolyfillSupport,b=(t,e)=>t,g={toAttribute(t,e){switch(e){case Boolean:t=t?v: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}},A=(t,e)=>!h(t,e),E={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:A};
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/Symbol.metadata??=Symbol("metadata"),$.litPropertyMetadata??=new WeakMap;let S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=E){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);void 0!==r&&p(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:o}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const i=r?.call(this);o?.call(this,e),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static _$Ei(){if(this.hasOwnProperty(
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),$.litPropertyMetadata??=new WeakMap;let S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=E){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);void 0!==r&&p(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:o}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const i=r?.call(this);o?.call(this,e),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...u(t),...m(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}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(c(t))}else void 0!==t&&e.push(c(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(o)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),o=r.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(void 0!==r&&!0===s.reflect){const o=(void 0!==s.converter?.toAttribute?s.converter:g).toAttribute(e,s.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){const s=this.constructor,r=s._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=s.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:g;this._$Em=r;const i=o.fromAttribute(e,t.type);this[r]=i??this._$Ej?.get(r)??i,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const r=this.constructor,o=this[t];if(s??=r.getPropertyOptions(t),!((s.hasChanged??A)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:o},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==o||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,s,r)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[b("elementProperties")]=new Map,S[b("finalized")]=new Map,_?.({ReactiveElement:S}),($.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const w=globalThis,x=w.trustedTypes,C=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,U="?"+k,O=`<${U}>`,T=document,M=()=>T.createComment(""),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,H="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,D=/>/g,
|
|
18
|
+
const w=globalThis,x=w.trustedTypes,C=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,U="?"+k,O=`<${U}>`,T=document,M=()=>T.createComment(""),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,H="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,D=/>/g,L=RegExp(`>|${H}(?:([^\\s"'>=/]+)(${H}*=${H}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,I=/"/g,q=/^(?:script|style|textarea|title)$/i,W=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),V=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),J=new WeakMap,Z=T.createTreeWalker(T,129);function F(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}const G=(t,e)=>{const s=t.length-1,r=[];let o,i=2===e?"<svg>":3===e?"<math>":"",n=j;for(let e=0;e<s;e++){const s=t[e];let a,l,c=-1,h=0;for(;h<s.length&&(n.lastIndex=h,l=n.exec(s),null!==l);)h=n.lastIndex,n===j?"!--"===l[1]?n=B:void 0!==l[1]?n=D:void 0!==l[2]?(q.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=L):void 0!==l[3]&&(n=L):n===L?">"===l[0]?(n=o??j,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?L:'"'===l[3]?I:z):n===I||n===z?n=L:n===B||n===D?n=j:(n=L,o=void 0);const p=n===L&&t[e+1].startsWith("/>")?" ":"";i+=n===j?s+O:c>=0?(r.push(a),s.slice(0,c)+P+s.slice(c)+k+p):s+k+(-2===c?e:p)}return[F(t,i+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class Q{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let o=0,i=0;const n=t.length-1,a=this.parts,[l,c]=G(t,e);if(this.el=Q.createElement(l,s),Z.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=Z.nextNode())&&a.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(P)){const e=c[i++],s=r.getAttribute(t).split(k),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:n[2],strings:s,ctor:"."===n[1]?st:"?"===n[1]?rt:"@"===n[1]?ot:et}),r.removeAttribute(t)}else t.startsWith(k)&&(a.push({type:6,index:o}),r.removeAttribute(t));if(q.test(r.tagName)){const t=r.textContent.split(k),e=t.length-1;if(e>0){r.textContent=x?x.emptyScript:"";for(let s=0;s<e;s++)r.append(t[s],M()),Z.nextNode(),a.push({type:2,index:++o});r.append(t[e],M())}}}else if(8===r.nodeType)if(r.data===U)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(k,t+1));)a.push({type:7,index:o}),t+=k.length-1}o++}}static createElement(t,e){const s=T.createElement("template");return s.innerHTML=t,s}}function X(t,e,s=t,r){if(e===V)return e;let o=void 0!==r?s._$Co?.[r]:s._$Cl;const i=R(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(t),o._$AT(t,s,r)),void 0!==r?(s._$Co??=[])[r]=o:s._$Cl=o),void 0!==o&&(e=X(t,o._$AS(t,e.values),o,r)),e}class Y{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);Z.currentNode=r;let o=Z.nextNode(),i=0,n=0,a=s[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new tt(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new it(o,this,t)),this._$AV.push(e),a=s[++n]}i!==a?.index&&(o=Z.nextNode(),i++)}return Z.currentNode=T,r}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}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=X(this,t,e),R(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==K&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Q.createElement(F(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new Y(r,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=J.get(t.strings);return void 0===e&&J.set(t.strings,e=new Q(t)),e}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const o of t)r===e.length?e.push(s=new tt(this.O(M()),this.O(M()),this,this.options)):s=e[r],s._$AI(o),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,o){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=K}_$AI(t,e=this,s,r){const o=this.strings;let i=!1;if(void 0===o)t=X(this,t,e,0),i=!R(t)||t!==this._$AH&&t!==V,i&&(this._$AH=t);else{const r=t;let n,a;for(t=o[0],n=0;n<o.length-1;n++)a=X(this,r[s+n],e,n),a===V&&(a=this._$AH[n]),i||=!R(a)||a!==this._$AH[n],a===K?t=K:t!==K&&(t+=(a??"")+o[n+1]),this._$AH[n]=a}i&&!r&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class st extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class rt extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class ot extends et{constructor(t,e,s,r,o){super(t,e,s,r,o),this.type=5}_$AI(t,e=this){if((t=X(this,t,e,0)??K)===V)return;const s=this._$AH,r=t===K&&s!==K||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==K&&(s===K||r);r&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class it{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){X(this,t)}}const nt=w.litHtmlPolyfillSupport;nt?.(Q,tt),(w.litHtmlVersions??=[]).push("3.3.1");const at=globalThis;
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
@@ -26,7 +26,7 @@ const w=globalThis,x=w.trustedTypes,C=x?x.createPolicy("lit-html",{createHTML:t=
|
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
const ht={attribute:!0,type:String,converter:
|
|
29
|
+
const ht={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:A},pt=(t=ht,e,s)=>{const{kind:r,metadata:o}=s;let i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),i.set(s.name,t),"accessor"===r){const{name:r}=s;return{set(s){const o=e.get.call(this);e.set.call(this,s),this.requestUpdate(r,o,t)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=s;return function(s){const o=this[r];e.call(this,s),this.requestUpdate(r,o,t)}}throw Error("Unsupported decorator location: "+r)};
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
@@ -44,7 +44,7 @@ const ht={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:A},pt=(t=ht
|
|
|
44
44
|
--tp-color-success: hsl(140 70% 40%);
|
|
45
45
|
--tp-color-danger: hsl(0 70% 50%);
|
|
46
46
|
--tp-color-warning: hsl(45 100% 50%);
|
|
47
|
-
--tp-color-neutral: color-mix(in
|
|
47
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
`;var e;return document.adoptedStyleSheets=(e=[...document.adoptedStyleSheets,t.styleSheet],[...new Set(e)]),t})()}static{this.shadedElementStyles=l`
|
|
@@ -59,7 +59,7 @@ const ht={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:A},pt=(t=ht
|
|
|
59
59
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
60
60
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
61
61
|
);
|
|
62
|
-
--tp-calc-element-color: color-mix(in
|
|
62
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
63
63
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
64
64
|
--tp-contrast-color: if(
|
|
65
65
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|
|
@@ -83,7 +83,7 @@ const ht={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:A},pt=(t=ht
|
|
|
83
83
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
84
84
|
--tp-button-active-mixer-color: transparent;
|
|
85
85
|
--tp-button-active-mixer-percentage: 10%;
|
|
86
|
-
--tp-button-active-color: color-mix(in
|
|
86
|
+
--tp-button-active-color: color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
87
87
|
display: inline-block;
|
|
88
88
|
border: 1px solid transparent;
|
|
89
89
|
cursor: pointer;
|
|
@@ -103,7 +103,7 @@ const ht={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:A},pt=(t=ht
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
&[disabled] {
|
|
106
|
-
--tp-button-color: color-mix(in
|
|
106
|
+
--tp-button-color: color-mix(in oklab, var(--tp-calc-element-color) 50%, var(--tp-color-white) 50%);
|
|
107
107
|
--tp-button-contrast-color: rgb(from var(--tp-calc-contrast-color) r g b / 50%);
|
|
108
108
|
pointer-events: none;
|
|
109
109
|
user-select: none;
|
package/iife/elements.js
CHANGED
|
@@ -15,7 +15,7 @@ const n=globalThis,s=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow
|
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const $=globalThis,A=$.trustedTypes,O=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,_="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+x,D=`<${T}>`,N=document,R=()=>N.createComment(""),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,L="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,U=/>/g,H=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,
|
|
18
|
+
const $=globalThis,A=$.trustedTypes,O=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,_="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+x,D=`<${T}>`,N=document,R=()=>N.createComment(""),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,L="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,U=/>/g,H=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,W=/"/g,z=/^(?:script|style|textarea|title)$/i,B=(t=>(e,...r)=>({_$litType$:t,strings:e,values:r}))(1),Z=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),F=new WeakMap,Y=N.createTreeWalker(N,129);function G(t,e){if(!P(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(e):e}const J=(t,e)=>{const r=t.length-1,n=[];let s,o=2===e?"<svg>":3===e?"<math>":"",i=j;for(let e=0;e<r;e++){const r=t[e];let a,l,c=-1,h=0;for(;h<r.length&&(i.lastIndex=h,l=i.exec(r),null!==l);)h=i.lastIndex,i===j?"!--"===l[1]?i=I:void 0!==l[1]?i=U:void 0!==l[2]?(z.test(l[2])&&(s=RegExp("</"+l[2],"g")),i=H):void 0!==l[3]&&(i=H):i===H?">"===l[0]?(i=s??j,c=-1):void 0===l[1]?c=-2:(c=i.lastIndex-l[2].length,a=l[1],i=void 0===l[3]?H:'"'===l[3]?W:V):i===W||i===V?i=H:i===I||i===U?i=j:(i=H,s=void 0);const d=i===H&&t[e+1].startsWith("/>")?" ":"";o+=i===j?r+D:c>=0?(n.push(a),r.slice(0,c)+_+r.slice(c)+x+d):r+x+(-2===c?e:d)}return[G(t,o+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class K{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let s=0,o=0;const i=t.length-1,a=this.parts,[l,c]=J(t,e);if(this.el=K.createElement(l,r),Y.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=Y.nextNode())&&a.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(_)){const e=c[o++],r=n.getAttribute(t).split(x),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:i[2],strings:r,ctor:"."===i[1]?rt:"?"===i[1]?nt:"@"===i[1]?st:et}),n.removeAttribute(t)}else t.startsWith(x)&&(a.push({type:6,index:s}),n.removeAttribute(t));if(z.test(n.tagName)){const t=n.textContent.split(x),e=t.length-1;if(e>0){n.textContent=A?A.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],R()),Y.nextNode(),a.push({type:2,index:++s});n.append(t[e],R())}}}else if(8===n.nodeType)if(n.data===T)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=n.data.indexOf(x,t+1));)a.push({type:7,index:s}),t+=x.length-1}s++}}static createElement(t,e){const r=N.createElement("template");return r.innerHTML=t,r}}function X(t,e,r=t,n){if(e===Z)return e;let s=void 0!==n?r._$Co?.[n]:r._$Cl;const o=M(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),void 0===o?s=void 0:(s=new o(t),s._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=s:r._$Cl=s),void 0!==s&&(e=X(t,s._$AS(t,e.values),s,n)),e}class Q{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??N).importNode(e,!0);Y.currentNode=n;let s=Y.nextNode(),o=0,i=0,a=r[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new tt(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new ot(s,this,t)),this._$AV.push(e),a=r[++i]}o!==a?.index&&(s=Y.nextNode(),o++)}return Y.currentNode=N,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}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=X(this,t,e),M(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>P(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==q&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(N.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=K.createElement(G(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new Q(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new K(t)),e}k(t){P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const s of t)n===e.length?e.push(r=new tt(this.O(R()),this.O(R()),this,this.options)):r=e[n],r._$AI(s),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,s){this.type=1,this._$AH=q,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=s,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=q}_$AI(t,e=this,r,n){const s=this.strings;let o=!1;if(void 0===s)t=X(this,t,e,0),o=!M(t)||t!==this._$AH&&t!==Z,o&&(this._$AH=t);else{const n=t;let i,a;for(t=s[0],i=0;i<s.length-1;i++)a=X(this,n[r+i],e,i),a===Z&&(a=this._$AH[i]),o||=!M(a)||a!==this._$AH[i],a===q?t=q:t!==q&&(t+=(a??"")+s[i+1]),this._$AH[i]=a}o&&!n&&this.j(t)}j(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class rt extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===q?void 0:t}}class nt extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==q)}}class st extends et{constructor(t,e,r,n,s){super(t,e,r,n,s),this.type=5}_$AI(t,e=this){if((t=X(this,t,e,0)??q)===Z)return;const r=this._$AH,n=t===q&&r!==q||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==q&&(r===q||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const it=$.litHtmlPolyfillSupport;it?.(K,tt),($.litHtmlVersions??=[]).push("3.3.1");const at=globalThis;
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
@@ -66,7 +66,7 @@ function Et(t,e){return Object.is(t,e)}
|
|
|
66
66
|
* Use of this source code is governed by an MIT-style license that can be
|
|
67
67
|
* found in the LICENSE file at https://angular.io/license
|
|
68
68
|
*/
|
|
69
|
-
function(){throw new Error};function
|
|
69
|
+
function(){throw new Error};function Wt(){return Ot(this),this.value}function zt(t,e){!1===(null==St?void 0:St.consumerAllowSignalWrites)&&Vt(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,function(t){t.version++,Ct++,xt(t)}
|
|
70
70
|
/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2024 Bloomberg Finance L.P.
|
|
@@ -90,7 +90,7 @@ function(){throw new Error};function zt(){return Ot(this),this.value}function Wt
|
|
|
90
90
|
* Use of this source code is governed by an MIT-style license that can be
|
|
91
91
|
* found in the LICENSE file at https://angular.io/license
|
|
92
92
|
*/
|
|
93
|
-
function(t){const e=Object.create(Bt);e.value=t;const r=()=>(Ot(e),e.value);return r[kt]=e,r}(n),i=o[kt];if(this[Zt]=i,i.wrapper=this,s){const e=s.equals;e&&(i.equal=e),i.watched=s[t.subtle.watched],i.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return
|
|
93
|
+
function(t){const e=Object.create(Bt);e.value=t;const r=()=>(Ot(e),e.value);return r[kt]=e,r}(n),i=o[kt];if(this[Zt]=i,i.wrapper=this,s){const e=s.equals;e&&(i.equal=e),i.watched=s[t.subtle.watched],i.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return Wt.call(this[Zt])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(wt)throw new Error("Writes to signals not permitted during Watcher callback");zt(this[Zt],e)}};n=Zt,s=new WeakSet,t.isComputed=t=>"object"==typeof t&&vt(s,t),t.Computed=class{constructor(e,r){yt(this,s),ft(this,n);const o=function(t){const e=Object.create(Ht);e.computation=t;const r=()=>Lt(e);return r[kt]=e,r}(e),i=o[kt];if(i.consumerAllowSignalWrites=!0,this[Zt]=i,i.wrapper=this,r){const e=r.equals;e&&(i.equal=e),i.watched=r[t.subtle.watched],i.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return Lt(this[Zt])}},(e=>{var r,n,s,o;e.untrack=function(t){let e,r=null;try{r=$t(null),e=t()}finally{$t(r)}return e},e.introspectSources=function(e){var r;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(r=e[Zt].producerNode)?void 0:r.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var r;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(r=e[Zt].liveConsumerNode)?void 0:r.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const r=e[Zt].liveConsumerNode;return!!r&&r.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const r=e[Zt].producerNode;return!!r&&r.length>0};r=Zt,n=new WeakSet,s=new WeakSet,o=function(e){for(const r of e)if(!(0,t.isComputed)(r)&&!(0,t.isState)(r))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>vt(n,t),e.Watcher=class{constructor(t){yt(this,n),yt(this,s),ft(this,r);let e=Object.create(At);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[Zt]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");bt(this,s,o).call(this,e);const r=this[Zt];r.dirty=!1;const n=$t(r);for(const t of e)Ot(t[Zt]);$t(n)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");bt(this,s,o).call(this,e);const r=this[Zt];Mt(r);for(let t=r.producerNode.length-1;t>=0;t--)if(e.includes(r.producerNode[t].wrapper)){Nt(r.producerNode[t],r.producerIndexOfThis[t]);const e=r.producerNode.length-1;if(r.producerNode[t]=r.producerNode[e],r.producerIndexOfThis[t]=r.producerIndexOfThis[e],r.producerNode.length--,r.producerIndexOfThis.length--,r.nextProducerIndex--,t<r.producerNode.length){const e=r.producerIndexOfThis[t],n=r.producerNode[t];Pt(n),n.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[Zt].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=St)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(qt||(qt={}));
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2023 Google LLC
|
|
@@ -140,7 +140,7 @@ qt.State,qt.Computed;const ue=(t,e)=>new qt.State(t,e),pe=(t,e)=>new qt.Computed
|
|
|
140
140
|
--tp-color-success: hsl(140 70% 40%);
|
|
141
141
|
--tp-color-danger: hsl(0 70% 50%);
|
|
142
142
|
--tp-color-warning: hsl(45 100% 50%);
|
|
143
|
-
--tp-color-neutral: color-mix(in
|
|
143
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
`;var e;return document.adoptedStyleSheets=(e=[...document.adoptedStyleSheets,t.styleSheet],[...new Set(e)]),t})()}static{this.shadedElementStyles=l`
|
|
@@ -155,7 +155,7 @@ qt.State,qt.Computed;const ue=(t,e)=>new qt.State(t,e),pe=(t,e)=>new qt.Computed
|
|
|
155
155
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
156
156
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
157
157
|
);
|
|
158
|
-
--tp-calc-element-color: color-mix(in
|
|
158
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
159
159
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
160
160
|
--tp-contrast-color: if(
|
|
161
161
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|
|
@@ -171,7 +171,7 @@ qt.State,qt.Computed;const ue=(t,e)=>new qt.State(t,e),pe=(t,e)=>new qt.Computed
|
|
|
171
171
|
&[color="danger"] { --tp-element-color: var(--tp-color-danger); }
|
|
172
172
|
&[color="warning"] { --tp-element-color: var(--tp-color-warning); }
|
|
173
173
|
&[color="neutral"] { --tp-element-color: var(--tp-color-neutral); }
|
|
174
|
-
`}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([pt({type:String,reflect:!0}),r("design:type",String)],De.prototype,"color",void 0),e([pt({type:Number,reflect:!0,converter(t,e){const r=Number(t);return isNaN(r)?500:function(t,e,r){return Math.max(Math.min(e,r),t)}(0,1e3,r)}}),r("design:type",Number)],De.prototype,"shade",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],De.prototype,"mixer",void 0);const Ne=Xt(lt),Re=Xt(De);function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Me.apply(null,arguments)}var Pe;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(Pe||(Pe={}));var Le="production"!==process.env.NODE_ENV?function(t){return Object.freeze(t)}:function(t){return t};function je(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}var Ie="beforeunload",Ue="popstate";function He(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=qe(r.location.hash.substr(1)),e=t.pathname,s=void 0===e?"/":e,o=t.search,i=void 0===o?"":o,a=t.hash,l=void 0===a?"":a,c=n.state||{};return[c.idx,Le({pathname:s,search:i,hash:l,state:c.usr||null,key:c.key||"default"})]}var o=null;function i(){if(o)u.call(o),o=null;else{var t=Pe.Pop,e=s(),r=e[0],n=e[1];if(u.length)if(null!=r){var i=c-r;i&&(o={action:t,location:n,retry:function(){y(-1*i)}},y(i))}else"production"!==process.env.NODE_ENV&&je(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else v(t)}}r.addEventListener(Ue,i),r.addEventListener("hashchange",function(){Ze(s()[1])!==Ze(h)&&i()});var a=Pe.Pop,l=s(),c=l[0],h=l[1],d=We(),u=We();function p(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,s=n.indexOf("#");e=-1===s?n:n.slice(0,s)}return e}()+"#"+("string"==typeof t?t:Ze(t))}function m(t,e){return void 0===e&&(e=null),Le(Me({pathname:h.pathname,hash:"",search:""},"string"==typeof t?qe(t):t,{state:e,key:Be()}))}function g(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function f(t,e,r){return!u.length||(u.call({action:t,location:e,retry:r}),!1)}function v(t){a=t;var e=s();c=e[0],h=e[1],d.call({action:a,location:h})}function y(t){n.go(t)}null==c&&(c=0,n.replaceState(Me({},n.state,{idx:c}),""));var b={get action(){return a},get location(){return h},createHref:p,push:function t(e,s){var o=Pe.Push,i=m(e,s);if("production"!==process.env.NODE_ENV&&je("/"===i.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")"),f(o,i,function(){t(e,s)})){var a=g(i,c+1),l=a[0],h=a[1];try{n.pushState(l,"",h)}catch(t){r.location.assign(h)}v(o)}},replace:function t(e,r){var s=Pe.Replace,o=m(e,r);if("production"!==process.env.NODE_ENV&&je("/"===o.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(e)+")"),f(s,o,function(){t(e,r)})){var i=g(o,c),a=i[0],l=i[1];n.replaceState(a,"",l),v(s)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return d.push(t)},block:function(t){var e=u.push(t);return 1===u.length&&r.addEventListener(Ie,ze),function(){e(),u.length||r.removeEventListener(Ie,ze)}}};return b}function Ve(t,e,r){return Math.min(Math.max(t,e),r)}function ze(t){t.preventDefault(),t.returnValue=""}function We(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter(function(t){return t!==e})}},call:function(e){t.forEach(function(t){return t&&t(e)})}}}function Be(){return Math.random().toString(36).substr(2,8)}function Ze(t){var e=t.pathname,r=void 0===e?"/":e,n=t.search,s=void 0===n?"":n,o=t.hash,i=void 0===o?"":o;return s&&"?"!==s&&(r+="?"===s.charAt(0)?s:"?"+s),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}function qe(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const Fe={},Ye=ue("browser");function Ge(t){let e=Fe[t];if(!e){switch(t){case"browser":e=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=r.location,e=t.pathname,s=t.search,o=t.hash,i=n.state||{};return[i.idx,Le({pathname:e,search:s,hash:o,state:i.usr||null,key:i.key||"default"})]}var o=null;r.addEventListener(Ue,function(){if(o)d.call(o),o=null;else{var t=Pe.Pop,e=s(),r=e[0],n=e[1];if(d.length)if(null!=r){var i=l-r;i&&(o={action:t,location:n,retry:function(){v(-1*i)}},v(i))}else"production"!==process.env.NODE_ENV&&je(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else f(t)}});var i=Pe.Pop,a=s(),l=a[0],c=a[1],h=We(),d=We();function u(t){return"string"==typeof t?t:Ze(t)}function p(t,e){return void 0===e&&(e=null),Le(Me({pathname:c.pathname,hash:"",search:""},"string"==typeof t?qe(t):t,{state:e,key:Be()}))}function m(t,e){return[{usr:t.state,key:t.key,idx:e},u(t)]}function g(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function f(t){i=t;var e=s();l=e[0],c=e[1],h.call({action:i,location:c})}function v(t){n.go(t)}null==l&&(l=0,n.replaceState(Me({},n.state,{idx:l}),""));var y={get action(){return i},get location(){return c},createHref:u,push:function t(e,s){var o=Pe.Push,i=p(e,s);if(g(o,i,function(){t(e,s)})){var a=m(i,l+1),c=a[0],h=a[1];try{n.pushState(c,"",h)}catch(t){r.location.assign(h)}f(o)}},replace:function t(e,r){var s=Pe.Replace,o=p(e,r);if(g(s,o,function(){t(e,r)})){var i=m(o,l),a=i[0],c=i[1];n.replaceState(a,"",c),f(s)}},go:v,back:function(){v(-1)},forward:function(){v(1)},listen:function(t){return h.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(Ie,ze),function(){e(),d.length||r.removeEventListener(Ie,ze)}}};return y}();break;case"hash":e=He();break;default:e=function(t){void 0===t&&(t={});var e=t,r=e.initialEntries,n=void 0===r?["/"]:r,s=e.initialIndex,o=n.map(function(t){var e=Le(Me({pathname:"/",search:"",hash:"",state:null,key:Be()},"string"==typeof t?qe(t):t));return"production"!==process.env.NODE_ENV&&je("/"===e.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(t)+")"),e}),i=Ve(null==s?o.length-1:s,0,o.length-1),a=Pe.Pop,l=o[i],c=We(),h=We();function d(t,e){return void 0===e&&(e=null),Le(Me({pathname:l.pathname,search:"",hash:""},"string"==typeof t?qe(t):t,{state:e,key:Be()}))}function u(t,e,r){return!h.length||(h.call({action:t,location:e,retry:r}),!1)}function p(t,e){a=t,l=e,c.call({action:a,location:l})}function m(t){var e=Ve(i+t,0,o.length-1),r=Pe.Pop,n=o[e];u(r,n,function(){m(t)})&&(i=e,p(r,n))}var g={get index(){return i},get action(){return a},get location(){return l},createHref:function(t){return"string"==typeof t?t:Ze(t)},push:function t(e,r){var n=Pe.Push,s=d(e,r);"production"!==process.env.NODE_ENV&&je("/"===l.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(i+=1,o.splice(i,o.length,s),p(n,s))},replace:function t(e,r){var n=Pe.Replace,s=d(e,r);"production"!==process.env.NODE_ENV&&je("/"===l.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(o[i]=s,p(n,s))},go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(t){return c.push(t)},block:function(t){return h.push(t)}};return g}()}Fe[t]=e}return e}pe(()=>Ge(Ye.get()));const Je=Symbol("HistoryManaged:history"),Ke=Symbol("HistoryManaged:historyType"),Xe=t=>{var n,s;class o extends t{constructor(){super(...arguments),this.history=void 0,this.#u=ue(this.history),this.#p=pe(()=>{const t=this.parentElement?.closest("tp-router-config, tp-router-outlet");return t?.[Ke]?.get()}),this[n]=pe(()=>this.#u.get()??this.#p.get()??Ye.get()),this[s]=pe(()=>Ge(this[Ke].get()))}static{n=Ke,s=Je}#u;#p;attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"history"===t)this.#u.set(r)}}return e([pt({type:String}),r("design:type",Object)],o.prototype,"history",void 0),o};function Qe(t=Te){return new Promise((e,r)=>{setTimeout(()=>{try{const r=t();e(r)}catch(t){r(t)}},0)})}var tr;const er=Symbol("RouterOutletElement:renderRoute"),rr=Symbol("RouterOutletElement:params");function nr(t){return!!t}function sr(t){return t.filter(nr)}t.RouterOutletElement=class extends Ne{constructor(){super(...arguments),this.#m=ue(void 0),this.#g=ue(null),this.#f=pe(()=>this.#g.get()?.deref()?.[$e].get()??null),this.#v=pe(()=>{const t=this.#m.get()?.deref(),e=this.#g.get()?.deref(),r=e?.[Ae];if(!t||!r)return null;const{location:{pathname:n}}=t[Je].get();return r.exec(n,"http://dummy.base")?.pathname.groups??null}),this[tr]=pe(()=>{const t=this.#v.get()??{},e=this.parentElement?.closest("tp-router-outlet"),r=e?.[rr].get()??{};return Object.freeze({...r,...t})}),this.params={},this.#y=[],this.#b=Te,this.#E=Te,this.#S=Te,this.for=null,this.routePath=null,this.routeID=void 0}#m;#g;#f;#v;#y;#b;#E;#S;connectedCallback(){super.connectedCallback(),Qe(()=>{this.bindToRouter()}),this.#b=this.updateEffect(()=>{this.#y.forEach(t=>t.parentNode?.removeChild(t)),this.#y=[];const t=this.#f.get();if(!t)return;const e=t.cloneNode(!0);this.#y=Array.from(e.childNodes),this.renderRoot.appendChild(e)}),this.#E=this.updateEffect(()=>{const t=this.#g.get()?.deref()??null;this.routePath=t?.getAttribute("path")??null,this.routeID=t?.id?t?.id:void 0;const e=t?.[Oe].get()??null;this.toggleAttribute("route-loading","idle"===e||"loading"===e),this.toggleAttribute("route-error","error"===e)}),this.#S=this.updateEffect(()=>{const t=this[rr].get();Array.from(this.attributes).filter(t=>t.name.startsWith("param-")).filter(e=>!(e.name.slice(6)in t)).forEach(t=>{this.removeAttribute(t.name)});for(const[e,r]of Object.entries(t))this.setAttribute(`param-${e}`,r??"");this.params=t})}bindToRouter(t){if(!t)if(this.for){t=this.getRootNode().querySelector(`tp-router#${this.for}`)??void 0}else t=this.closest("tp-router")??void 0;const e=this.#m?.get()?.deref()??null;return e===t?e:(e?.assignOutlet(null),t?.assignOutlet(this),this.#m.set(t?new WeakRef(t):void 0),t??null)}[(tr=rr,er)](t){this.#g.set(t?new WeakRef(t):null)}disconnectedCallback(){super.disconnectedCallback(),this.#m?.get()?.deref()?.assignOutlet(null);try{this.#b(),this.#E(),this.#S()}catch{}}createRenderRoot(){return this}},e([mt(),r("design:type",Object)],t.RouterOutletElement.prototype,"params",void 0),e([pt({type:String}),r("design:type",Object)],t.RouterOutletElement.prototype,"for",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.RouterOutletElement.prototype,"routePath",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.RouterOutletElement.prototype,"routeID",void 0),t.RouterOutletElement=e([ht("tp-router-outlet")],t.RouterOutletElement),t.RouterElement=class extends(Xe(Ne)){static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tp-router-styles"),t.textContent=l`
|
|
174
|
+
`}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([pt({type:String,reflect:!0}),r("design:type",String)],De.prototype,"color",void 0),e([pt({type:Number,reflect:!0,converter(t,e){const r=Number(t);return isNaN(r)?500:function(t,e,r){return Math.max(Math.min(e,r),t)}(0,1e3,r)}}),r("design:type",Number)],De.prototype,"shade",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],De.prototype,"mixer",void 0);const Ne=Xt(lt),Re=Xt(De);function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Me.apply(null,arguments)}var Pe;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(Pe||(Pe={}));var Le="production"!==process.env.NODE_ENV?function(t){return Object.freeze(t)}:function(t){return t};function je(t,e){if(!t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}}var Ie="beforeunload",Ue="popstate";function He(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=qe(r.location.hash.substr(1)),e=t.pathname,s=void 0===e?"/":e,o=t.search,i=void 0===o?"":o,a=t.hash,l=void 0===a?"":a,c=n.state||{};return[c.idx,Le({pathname:s,search:i,hash:l,state:c.usr||null,key:c.key||"default"})]}var o=null;function i(){if(o)u.call(o),o=null;else{var t=Pe.Pop,e=s(),r=e[0],n=e[1];if(u.length)if(null!=r){var i=c-r;i&&(o={action:t,location:n,retry:function(){y(-1*i)}},y(i))}else"production"!==process.env.NODE_ENV&&je(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else v(t)}}r.addEventListener(Ue,i),r.addEventListener("hashchange",function(){Ze(s()[1])!==Ze(h)&&i()});var a=Pe.Pop,l=s(),c=l[0],h=l[1],d=ze(),u=ze();function p(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=r.location.href,s=n.indexOf("#");e=-1===s?n:n.slice(0,s)}return e}()+"#"+("string"==typeof t?t:Ze(t))}function m(t,e){return void 0===e&&(e=null),Le(Me({pathname:h.pathname,hash:"",search:""},"string"==typeof t?qe(t):t,{state:e,key:Be()}))}function g(t,e){return[{usr:t.state,key:t.key,idx:e},p(t)]}function f(t,e,r){return!u.length||(u.call({action:t,location:e,retry:r}),!1)}function v(t){a=t;var e=s();c=e[0],h=e[1],d.call({action:a,location:h})}function y(t){n.go(t)}null==c&&(c=0,n.replaceState(Me({},n.state,{idx:c}),""));var b={get action(){return a},get location(){return h},createHref:p,push:function t(e,s){var o=Pe.Push,i=m(e,s);if("production"!==process.env.NODE_ENV&&je("/"===i.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(e)+")"),f(o,i,function(){t(e,s)})){var a=g(i,c+1),l=a[0],h=a[1];try{n.pushState(l,"",h)}catch(t){r.location.assign(h)}v(o)}},replace:function t(e,r){var s=Pe.Replace,o=m(e,r);if("production"!==process.env.NODE_ENV&&je("/"===o.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(e)+")"),f(s,o,function(){t(e,r)})){var i=g(o,c),a=i[0],l=i[1];n.replaceState(a,"",l),v(s)}},go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(t){return d.push(t)},block:function(t){var e=u.push(t);return 1===u.length&&r.addEventListener(Ie,We),function(){e(),u.length||r.removeEventListener(Ie,We)}}};return b}function Ve(t,e,r){return Math.min(Math.max(t,e),r)}function We(t){t.preventDefault(),t.returnValue=""}function ze(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter(function(t){return t!==e})}},call:function(e){t.forEach(function(t){return t&&t(e)})}}}function Be(){return Math.random().toString(36).substr(2,8)}function Ze(t){var e=t.pathname,r=void 0===e?"/":e,n=t.search,s=void 0===n?"":n,o=t.hash,i=void 0===o?"":o;return s&&"?"!==s&&(r+="?"===s.charAt(0)?s:"?"+s),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}function qe(t){var e={};if(t){var r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}const Fe={},Ye=ue("browser");function Ge(t){let e=Fe[t];if(!e){switch(t){case"browser":e=function(t){void 0===t&&(t={});var e=t.window,r=void 0===e?document.defaultView:e,n=r.history;function s(){var t=r.location,e=t.pathname,s=t.search,o=t.hash,i=n.state||{};return[i.idx,Le({pathname:e,search:s,hash:o,state:i.usr||null,key:i.key||"default"})]}var o=null;r.addEventListener(Ue,function(){if(o)d.call(o),o=null;else{var t=Pe.Pop,e=s(),r=e[0],n=e[1];if(d.length)if(null!=r){var i=l-r;i&&(o={action:t,location:n,retry:function(){v(-1*i)}},v(i))}else"production"!==process.env.NODE_ENV&&je(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else f(t)}});var i=Pe.Pop,a=s(),l=a[0],c=a[1],h=ze(),d=ze();function u(t){return"string"==typeof t?t:Ze(t)}function p(t,e){return void 0===e&&(e=null),Le(Me({pathname:c.pathname,hash:"",search:""},"string"==typeof t?qe(t):t,{state:e,key:Be()}))}function m(t,e){return[{usr:t.state,key:t.key,idx:e},u(t)]}function g(t,e,r){return!d.length||(d.call({action:t,location:e,retry:r}),!1)}function f(t){i=t;var e=s();l=e[0],c=e[1],h.call({action:i,location:c})}function v(t){n.go(t)}null==l&&(l=0,n.replaceState(Me({},n.state,{idx:l}),""));var y={get action(){return i},get location(){return c},createHref:u,push:function t(e,s){var o=Pe.Push,i=p(e,s);if(g(o,i,function(){t(e,s)})){var a=m(i,l+1),c=a[0],h=a[1];try{n.pushState(c,"",h)}catch(t){r.location.assign(h)}f(o)}},replace:function t(e,r){var s=Pe.Replace,o=p(e,r);if(g(s,o,function(){t(e,r)})){var i=m(o,l),a=i[0],c=i[1];n.replaceState(a,"",c),f(s)}},go:v,back:function(){v(-1)},forward:function(){v(1)},listen:function(t){return h.push(t)},block:function(t){var e=d.push(t);return 1===d.length&&r.addEventListener(Ie,We),function(){e(),d.length||r.removeEventListener(Ie,We)}}};return y}();break;case"hash":e=He();break;default:e=function(t){void 0===t&&(t={});var e=t,r=e.initialEntries,n=void 0===r?["/"]:r,s=e.initialIndex,o=n.map(function(t){var e=Le(Me({pathname:"/",search:"",hash:"",state:null,key:Be()},"string"==typeof t?qe(t):t));return"production"!==process.env.NODE_ENV&&je("/"===e.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(t)+")"),e}),i=Ve(null==s?o.length-1:s,0,o.length-1),a=Pe.Pop,l=o[i],c=ze(),h=ze();function d(t,e){return void 0===e&&(e=null),Le(Me({pathname:l.pathname,search:"",hash:""},"string"==typeof t?qe(t):t,{state:e,key:Be()}))}function u(t,e,r){return!h.length||(h.call({action:t,location:e,retry:r}),!1)}function p(t,e){a=t,l=e,c.call({action:a,location:l})}function m(t){var e=Ve(i+t,0,o.length-1),r=Pe.Pop,n=o[e];u(r,n,function(){m(t)})&&(i=e,p(r,n))}var g={get index(){return i},get action(){return a},get location(){return l},createHref:function(t){return"string"==typeof t?t:Ze(t)},push:function t(e,r){var n=Pe.Push,s=d(e,r);"production"!==process.env.NODE_ENV&&je("/"===l.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(i+=1,o.splice(i,o.length,s),p(n,s))},replace:function t(e,r){var n=Pe.Replace,s=d(e,r);"production"!==process.env.NODE_ENV&&je("/"===l.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(e)+")"),u(n,s,function(){t(e,r)})&&(o[i]=s,p(n,s))},go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(t){return c.push(t)},block:function(t){return h.push(t)}};return g}()}Fe[t]=e}return e}pe(()=>Ge(Ye.get()));const Je=Symbol("HistoryManaged:history"),Ke=Symbol("HistoryManaged:historyType"),Xe=t=>{var n,s;class o extends t{constructor(){super(...arguments),this.history=void 0,this.#u=ue(this.history),this.#p=pe(()=>{const t=this.parentElement?.closest("tp-router-config, tp-router-outlet");return t?.[Ke]?.get()}),this[n]=pe(()=>this.#u.get()??this.#p.get()??Ye.get()),this[s]=pe(()=>Ge(this[Ke].get()))}static{n=Ke,s=Je}#u;#p;attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"history"===t)this.#u.set(r)}}return e([pt({type:String}),r("design:type",Object)],o.prototype,"history",void 0),o};function Qe(t=Te){return new Promise((e,r)=>{setTimeout(()=>{try{const r=t();e(r)}catch(t){r(t)}},0)})}var tr;const er=Symbol("RouterOutletElement:renderRoute"),rr=Symbol("RouterOutletElement:params");function nr(t){return!!t}function sr(t){return t.filter(nr)}t.RouterOutletElement=class extends Ne{constructor(){super(...arguments),this.#m=ue(void 0),this.#g=ue(null),this.#f=pe(()=>this.#g.get()?.deref()?.[$e].get()??null),this.#v=pe(()=>{const t=this.#m.get()?.deref(),e=this.#g.get()?.deref(),r=e?.[Ae];if(!t||!r)return null;const{location:{pathname:n}}=t[Je].get();return r.exec(n,"http://dummy.base")?.pathname.groups??null}),this[tr]=pe(()=>{const t=this.#v.get()??{},e=this.parentElement?.closest("tp-router-outlet"),r=e?.[rr].get()??{};return Object.freeze({...r,...t})}),this.params={},this.#y=[],this.#b=Te,this.#E=Te,this.#S=Te,this.for=null,this.routePath=null,this.routeID=void 0}#m;#g;#f;#v;#y;#b;#E;#S;connectedCallback(){super.connectedCallback(),Qe(()=>{this.bindToRouter()}),this.#b=this.updateEffect(()=>{this.#y.forEach(t=>t.parentNode?.removeChild(t)),this.#y=[];const t=this.#f.get();if(!t)return;const e=t.cloneNode(!0);this.#y=Array.from(e.childNodes),this.renderRoot.appendChild(e)}),this.#E=this.updateEffect(()=>{const t=this.#g.get()?.deref()??null;this.routePath=t?.getAttribute("path")??null,this.routeID=t?.id?t?.id:void 0;const e=t?.[Oe].get()??null;this.toggleAttribute("route-loading","idle"===e||"loading"===e),this.toggleAttribute("route-error","error"===e)}),this.#S=this.updateEffect(()=>{const t=this[rr].get();Array.from(this.attributes).filter(t=>t.name.startsWith("param-")).filter(e=>!(e.name.slice(6)in t)).forEach(t=>{this.removeAttribute(t.name)});for(const[e,r]of Object.entries(t))this.setAttribute(`param-${e}`,r??"");this.params=t})}bindToRouter(t){if(!t)if(this.for){t=this.getRootNode().querySelector(`tp-router#${this.for}`)??void 0}else t=this.closest("tp-router")??void 0;const e=this.#m?.get()?.deref()??null;return e===t?e:(e?.assignOutlet(null),t?.assignOutlet(this),this.#m.set(t?new WeakRef(t):void 0),t??null)}[(tr=rr,er)](t){this.#g.set(t?new WeakRef(t):null)}disconnectedCallback(){super.disconnectedCallback(),this.#m?.get()?.deref()?.assignOutlet(null);try{this.#b(),this.#E(),this.#S()}catch{}}createRenderRoot(){return this}},e([mt(),r("design:type",Object)],t.RouterOutletElement.prototype,"params",void 0),e([pt({type:String}),r("design:type",Object)],t.RouterOutletElement.prototype,"for",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.RouterOutletElement.prototype,"routePath",void 0),e([pt({type:String,reflect:!0}),r("design:type",Object)],t.RouterOutletElement.prototype,"routeID",void 0),t.RouterOutletElement=e([ht("tp-router-outlet")],t.RouterOutletElement),t.RouterElement=class extends(Xe(Ne)){static{const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-id","tp-router-styles"),t.textContent=l`
|
|
175
175
|
tp-router {
|
|
176
176
|
& > :not(tp-router-outlet) {
|
|
177
177
|
display: none;
|
|
@@ -181,7 +181,7 @@ qt.State,qt.Computed;const ue=(t,e)=>new qt.State(t,e),pe=(t,e)=>new qt.Computed
|
|
|
181
181
|
tp-router-link {
|
|
182
182
|
cursor: pointer;
|
|
183
183
|
}
|
|
184
|
-
`.toString(),document.head.appendChild(t)}#N;#A;#R;#M;connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#P),this.#N=this.updateEffect(()=>{const t=this[Je].get(),e=this.#M.get();this.active=e?.test({pathname:t?.location.pathname??""})??!1,this.#A=t?.listen(()=>{this.active=e?.test({pathname:t.location.pathname})??!1})??Te})}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"to"===t)this.#R.set(r)}#P;disconnectedCallback(){super.disconnectedCallback();try{this.#N()}catch{}this.#A(),this.removeEventListener("click",this.#P)}createRenderRoot(){return this}},e([pt({type:String}),r("design:type",Object)],t.RouterLinkElement.prototype,"to",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.RouterLinkElement.prototype,"active",void 0),t.RouterLinkElement=e([ht("tp-router-link")],t.RouterLinkElement),t.RouterConfigElement=class extends(Xe(Ne)){#L=Te;connectedCallback(){super.connectedCallback(),document.head.contains(this)&&(console.log("RouterConfigElement: Setting global history type to",this[Ke].get()),this.#L=this.updateEffect(()=>{Ye.set(this[Ke].get())}))}disconnectedCallback(){super.disconnectedCallback();try{this.#L()}catch{}}createRenderRoot(){return this}},t.RouterConfigElement=e([ht("tp-router-config")],t.RouterConfigElement),t.RouterParamElement=class extends Ne{constructor(){super(...arguments),this.#_=ue(null),this.#j=ue(""),this.#I=pe(()=>this.#_.get()?.[rr]?.get()[this.#j.get()]),this.name=""}#_;#j;#I;connectedCallback(){super.connectedCallback();const t=this.closest("tp-router-outlet");if(!t)throw new Error("<tp-router-param> must be used within a <tp-router-outlet>.");this.#_.set(t)}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"name"===t)this.#j.set(r??"")}render(){return de`${this.#I}`}},e([pt({type:String}),r("design:type",String)],t.RouterParamElement.prototype,"name",void 0),t.RouterParamElement=e([ht("tp-router-param")],t.RouterParamElement);const or=Symbol("Accept Drop"),ir=Symbol("Register Handle"),ar=Symbol("Unregister Handle");var lr,cr;class hr extends DragEvent{static#U=["tp-drag-move","tp-drag-start","tp-drag-end","tp-drag-zone-enter","tp-drag-zone-leave","tp-drag-zone-over","tp-drag-drop"];static#H=["tp-dropzone-drop","tp-dropzone-drop-end","tp-dropzone-enter","tp-dropzone-leave","tp-dropzone-over"];get#V(){return lr.#H.includes(this.type)?this.dropzoneTarget:lr.#U.includes(this.type)?this.dragTarget:new WeakRef(this.target)}get name(){return this.#V.deref()?.name}get dragData(){return this.dragTarget.deref()?.dragData}constructor(t,{dragTarget:e,dropzoneTarget:r},n){super(t,n),this.dragTarget=e,this.dropzoneTarget=r}acceptDrop(t){this.dragTarget.deref()?.[or](this.dropzoneTarget,t)}}let dr;function ur(t,e){if(null===t||""===t)return 0;const r=Number(t);if(!Number.isFinite(r))return 0;const n=Math.trunc(r);return n>=0?Math.min(n,e):Math.max(0,e+n+1)}lr=hr,t.DragElement=class extends lt{constructor(){super(...arguments),this.dragData={},this.preDragData={boundingRect:null,dragStartEvent:null,styles:{pointerEvents:""}},this.#
|
|
184
|
+
`.toString(),document.head.appendChild(t)}#N;#A;#R;#M;connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#P),this.#N=this.updateEffect(()=>{const t=this[Je].get(),e=this.#M.get();this.active=e?.test({pathname:t?.location.pathname??""})??!1,this.#A=t?.listen(()=>{this.active=e?.test({pathname:t.location.pathname})??!1})??Te})}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"to"===t)this.#R.set(r)}#P;disconnectedCallback(){super.disconnectedCallback();try{this.#N()}catch{}this.#A(),this.removeEventListener("click",this.#P)}createRenderRoot(){return this}},e([pt({type:String}),r("design:type",Object)],t.RouterLinkElement.prototype,"to",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.RouterLinkElement.prototype,"active",void 0),t.RouterLinkElement=e([ht("tp-router-link")],t.RouterLinkElement),t.RouterConfigElement=class extends(Xe(Ne)){#L=Te;connectedCallback(){super.connectedCallback(),document.head.contains(this)&&(console.log("RouterConfigElement: Setting global history type to",this[Ke].get()),this.#L=this.updateEffect(()=>{Ye.set(this[Ke].get())}))}disconnectedCallback(){super.disconnectedCallback();try{this.#L()}catch{}}createRenderRoot(){return this}},t.RouterConfigElement=e([ht("tp-router-config")],t.RouterConfigElement),t.RouterParamElement=class extends Ne{constructor(){super(...arguments),this.#_=ue(null),this.#j=ue(""),this.#I=pe(()=>this.#_.get()?.[rr]?.get()[this.#j.get()]),this.name=""}#_;#j;#I;connectedCallback(){super.connectedCallback();const t=this.closest("tp-router-outlet");if(!t)throw new Error("<tp-router-param> must be used within a <tp-router-outlet>.");this.#_.set(t)}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),"name"===t)this.#j.set(r??"")}render(){return de`${this.#I}`}},e([pt({type:String}),r("design:type",String)],t.RouterParamElement.prototype,"name",void 0),t.RouterParamElement=e([ht("tp-router-param")],t.RouterParamElement);const or=Symbol("Accept Drop"),ir=Symbol("Register Handle"),ar=Symbol("Unregister Handle");var lr,cr;class hr extends DragEvent{static#U=["tp-drag-move","tp-drag-start","tp-drag-end","tp-drag-zone-enter","tp-drag-zone-leave","tp-drag-zone-over","tp-drag-drop"];static#H=["tp-dropzone-drop","tp-dropzone-drop-end","tp-dropzone-enter","tp-dropzone-leave","tp-dropzone-over"];get#V(){return lr.#H.includes(this.type)?this.dropzoneTarget:lr.#U.includes(this.type)?this.dragTarget:new WeakRef(this.target)}get name(){return this.#V.deref()?.name}get dragData(){return this.dragTarget.deref()?.dragData}constructor(t,{dragTarget:e,dropzoneTarget:r},n){super(t,n),this.dragTarget=e,this.dropzoneTarget=r}acceptDrop(t){this.dragTarget.deref()?.[or](this.dropzoneTarget,t)}}let dr;function ur(t,e){if(null===t||""===t)return 0;const r=Number(t);if(!Number.isFinite(r))return 0;const n=Math.trunc(r);return n>=0?Math.min(n,e):Math.max(0,e+n+1)}lr=hr,t.DragElement=class extends lt{constructor(){super(...arguments),this.dragData={},this.preDragData={boundingRect:null,dragStartEvent:null,styles:{pointerEvents:""}},this.#W=null,this.#z=null,this.#B=new Set,this.draggingStrategy="move",this.dragging=!1,this.dragend=!1,this.draggedOver=null,this.dropAccepted=!1,this.#Z=t=>{if(!this.#q(t))return t.preventDefault();t.stopPropagation(),t.dataTransfer?.setDragImage(cr.TRANSPARENT_IMAGE,0,0),t.dataTransfer.effectAllowed=this.draggingStrategy,document.addEventListener("dragover",this.#F),this.#Y(t),this.#G(),Qe().then(()=>{if(this.style.pointerEvents="none",this.dragging=!0,this.replaceClone){const t=this.#J();this.#z=new WeakRef(t),this.parentElement.insertBefore(t,this.nextSibling)}this.dispatchEvent(new hr("tp-drag-start",{dragTarget:new WeakRef(this)},t))})},this.#K=t=>{document.removeEventListener("dragover",this.#F),this.dragend=!0;const e=getComputedStyle(this).transitionDuration.match(/\d*\.?\d+/g)?.map(Number).some(t=>t>0),r=()=>{this.replaceClone&&this.clone?.remove(),this.style.pointerEvents=this.preDragData.styles.pointerEvents,["--tp-drag-width","--tp-drag-height","--tp-drag-left","--tp-drag-top","--tp-drag-x","--tp-drag-y","--tp-drag-cx","--tp-drag-cy"].forEach(t=>{this.style.removeProperty(t)}),["width","height","left","right","top","bottom"].forEach(t=>{this.style.removeProperty(`--tp-drag-target-${t}`)});const e=this.#W,r=this.dropAccepted;this.dragging=!1,this.dragend=!1,this.draggedOver=null,this.dropAccepted=!1,this.#W=null,r&&e&&e.deref()?.dispatchEvent(new hr("tp-dropzone-drop-end",{dragTarget:new WeakRef(this),dropzoneTarget:e},t)),this.dispatchEvent(new hr("tp-drag-end",{dragTarget:new WeakRef(this)},t))};e?this.addEventListener("transitionend",r,{once:!0}):r()},this.#X=t=>{const{x:e,y:r}=t;this.style.setProperty("--tp-drag-cx",`${e}px`),this.style.setProperty("--tp-drag-cy",`${r}px`)},this.#Q=t=>{this.draggedOver=t.dropzoneTarget?.deref()?.name??""},this.#tt=()=>{this.draggedOver=null}}static{cr=this}static{this.DRAG_DATA_OBSERVER=new MutationObserver(t=>{for(const{attributeName:e,target:r}of t){if(!e?.startsWith("data-drag-"))continue;const t=r;t.dragData[e.replace("data-drag-","")]=t.getAttribute(e)}})}static{this.styles=l`
|
|
185
185
|
:host {
|
|
186
186
|
--tp-drag-diff-x: calc(var(--tp-drag-cx) - var(--tp-drag-x));
|
|
187
187
|
--tp-drag-diff-y: calc(var(--tp-drag-cy) - var(--tp-drag-y));
|
|
@@ -219,7 +219,7 @@ qt.State,qt.Computed;const ue=(t,e)=>new qt.State(t,e),pe=(t,e)=>new qt.Computed
|
|
|
219
219
|
width: var(--tp-drag-target-width);
|
|
220
220
|
height: var(--tp-drag-target-height);
|
|
221
221
|
}
|
|
222
|
-
`}static{this.TRANSPARENT_IMAGE=new Image(1,1),this.TRANSPARENT_IMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==";const t=this.GLOBAL_STYLE=document.createElement("style");t.innerHTML="\n @property --tp-drag-offset-x {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n\n @property --tp-drag-offset-y {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n ",document.head.appendChild(t)}#z;#W;#B;get clone(){return this.#W.deref()}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#et(),this.addEventListener("dragstart",this.#Z),this.addEventListener("dragend",this.#K),this.addEventListener("drag",this.#X),this.addEventListener("tp-drag-zone-enter",this.#Q),this.addEventListener("tp-drag-zone-leave",this.#tt)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dragstart",this.#Z),this.removeEventListener("dragend",this.#K),this.removeEventListener("drag",this.#X),this.removeEventListener("tp-drag-zone-enter",this.#Q),this.removeEventListener("tp-drag-zone-leave",this.#tt)}render(){return B`<slot></slot>`}[or](t,e){if(this.dropAccepted=!0,this.#z=t,!e)return;const{width:r,height:n,left:s,right:o,top:i,bottom:a}=e;for(const t in{width:r,height:n,left:s,right:o,top:i,bottom:a})this.style.setProperty(`--tp-drag-target-${t}`,`${e[t]}px`)}[ir](t){this.#B.add(t)}[ar](t){this.#B.delete(t)}#et(){cr.DRAG_DATA_OBSERVER.observe(this,{attributes:!0});for(const{name:t,value:e}of Object.values(this.attributes).filter(t=>t.name.startsWith("data-drag-")))this.dragData[t.replace("data-drag-","")]=e}#Z;#K;#X;#Q;#tt;#J(){const t=document.createElement("tp-drag-clone");return Object.values(this.attributes).filter(t=>!["dragging","replaceclone","draggable"].includes(t.name)).forEach(e=>{t.attributes.setNamedItem(e.cloneNode())}),this.childNodes.forEach(e=>{t.appendChild(e.cloneNode(!0))}),t}#Y(t){this.preDragData.boundingRect=this.getBoundingClientRect(),this.preDragData.dragStartEvent=t,this.preDragData.styles.pointerEvents=this.style.pointerEvents}#G(){const{boundingRect:{width:t,height:e,left:r,top:n},dragStartEvent:{x:s,y:o}}=this.preDragData,i={width:t,height:e,left:r,top:n,x:s,y:o};for(const t in i)this.style.setProperty(`--tp-drag-${t}`,`${i[t]}px`)}#F(t){t.preventDefault()}#q(t){return!this.disabled&&(!this.#B.size||!!this.#B.has(t.target))}},e([pt({type:String}),r("design:type",String)],t.DragElement.prototype,"name",void 0),e([pt({type:String,reflect:!0,attribute:"draggingstrategy"}),r("design:type",String)],t.DragElement.prototype,"draggingStrategy",void 0),e([pt({type:String,attribute:"draggroup"}),r("design:type",String)],t.DragElement.prototype,"dragGroup",void 0),e([pt({type:Boolean,attribute:"replaceclone"}),r("design:type",Boolean)],t.DragElement.prototype,"replaceClone",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragging",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragend",void 0),e([pt({type:String,reflect:!0,attribute:"draggedover"}),r("design:type",Object)],t.DragElement.prototype,"draggedOver",void 0),e([pt({type:Boolean,reflect:!0,attribute:"dropaccepted"}),r("design:type",Object)],t.DragElement.prototype,"dropAccepted",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.DragElement.prototype,"disabled",void 0),t.DragElement=cr=e([ht("tp-drag")],t.DragElement),document.addEventListener("tp-drag-start",t=>{dr=t}),t.DropZoneElement=class extends lt{constructor(){super(...arguments),this.#rt=0,this.accept=[],this.name="",this.itemDragged=null,this.acceptableDrag=!1,this.#nt=t=>{this.accept.length&&!this.accept.includes(t.name)||(this.acceptableDrag=!0)},this.#st=()=>{this.itemDragged=null,this.acceptableDrag=!1,this.#rt=0},this.#ot=t=>{this.#it()&&(++this.#rt>1||(this.itemDragged=dr.name??"",this.#at("tp-dropzone-enter","tp-drag-zone-enter",t)))},this.#lt=t=>{this.#it()&&(--this.#rt>0||(this.itemDragged=null,this.#at("tp-dropzone-leave","tp-drag-zone-leave",t)))},this.#ct=t=>{this.#it()&&this.#at("tp-dropzone-over","tp-drag-zone-over",t)},this.#ht=t=>{this.#it()&&this.#at("tp-dropzone-drop","tp-drag-drop",t)}}static{this.styles=l``}#rt;render(){return B`<slot></slot>`}connectedCallback(){super.connectedCallback(),document.addEventListener("tp-drag-start",this.#nt),document.addEventListener("tp-drag-end",this.#st),document.addEventListener("tp-dropzone-drop-end",this.#st),this.addEventListener("dragenter",this.#ot),this.addEventListener("dragleave",this.#lt),this.addEventListener("dragover",this.#ct),this.addEventListener("drop",this.#ht)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("tp-drag-start",this.#nt),document.removeEventListener("tp-drag-end",this.#st),document.removeEventListener("tp-dropzone-drop-end",this.#st),this.removeEventListener("dragenter",this.#ot),this.removeEventListener("dragleave",this.#lt),this.removeEventListener("dragover",this.#ct),this.removeEventListener("drop",this.#ht)}#nt;#st;#ot;#lt;#ct;#ht;#it(){return!dr.name||!this.accept.length||this.accept.includes(dr.name)}#at(t,e,r){const{dragTarget:n}=dr,s=new WeakRef(this);this.dispatchEvent(new hr(t,{dragTarget:n,dropzoneTarget:s},r)),n.deref()?.dispatchEvent(new hr(e,{dragTarget:n,dropzoneTarget:s},r))}},e([pt({converter:t=>(t??"").split(",").map(t=>t.trim())}),r("design:type",Array)],t.DropZoneElement.prototype,"accept",void 0),e([pt({type:String}),r("design:type",Object)],t.DropZoneElement.prototype,"name",void 0),e([pt({type:String,reflect:!0,attribute:"itemdragged"}),r("design:type",Object)],t.DropZoneElement.prototype,"itemDragged",void 0),e([pt({type:Boolean,reflect:!0,attribute:"acceptabledrag"}),r("design:type",Object)],t.DropZoneElement.prototype,"acceptableDrag",void 0),t.DropZoneElement=e([ht("tp-dropzone")],t.DropZoneElement),t.DragHandleElement=class extends lt{get#dt(){for(const e of function*(t){for(;t.parentElement;)yield t=t.parentElement}(this))if(e instanceof t.DragElement)return e;return null}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#dt?.[ir](this)}disconnectedCallback(){super.disconnectedCallback(),this.#dt?.[ar](this)}render(){return B`<slot></slot>`}},t.DragHandleElement=e([ht("tp-drag-handle")],t.DragHandleElement),t.DetailsSetElement=class extends lt{constructor(){super(...arguments),this.maxOpenItems=0,this.toggleOn="summary",this.#ut=[],this.#pt=new Map,this.#mt=new Map,this.#gt=new WeakMap,this.#ft=()=>{this.#vt()},this.#yt=()=>{this.#bt()},this.#Et=t=>{const e=t.target;e instanceof HTMLDetailsElement&&e.parentElement===this&&this.#St(e)},this.#wt=t=>{this.#St(t)},this.#Ct=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const r=e.closest("summary");if(!r)return;const n=r.parentElement;if(!(n instanceof HTMLDetailsElement))return;if(n.parentElement!==this)return;if(r!==n.querySelector(":scope > summary"))return;"marker"===this.#kt(n)&&0!==t.detail&&r.querySelector("[tp-summary-marker]")&&(e.closest("[tp-summary-marker]")||t.preventDefault())}}static{const t=this.GLOBAL_STYLE=document.createElement("style");t.textContent='\n tp-details-set {\n display: block;\n interpolate-size: allow-keywords;\n }\n\n tp-details-set > details::details-content {\n block-size: 0;\n overflow: clip;\n transition:\n block-size var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease),\n content-visibility var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease)\n allow-discrete;\n }\n\n tp-details-set > details[open]::details-content {\n block-size: auto;\n }\n\n /* Hide the native disclosure marker when the consumer has supplied at\n least one custom marker via <template summary-marker>. */\n tp-details-set > details > summary:has(> [tp-summary-marker]) {\n list-style: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::-webkit-details-marker {\n display: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::marker {\n content: "";\n }\n ',document.head.appendChild(t)}#ut;#pt;#$t;#mt;#gt;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("toggle",this.#Et,{capture:!0}),this.addEventListener("click",this.#Ct,{capture:!0}),this.#$t=new MutationObserver(this.#yt),this.#$t.observe(this,{childList:!0}),this.#bt()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",this.#Et,{capture:!0}),this.removeEventListener("click",this.#Ct,{capture:!0}),this.#$t?.disconnect(),this.#$t=void 0;for(const t of this.#pt.values())t.disconnect();this.#pt.clear();for(const t of this.#mt.values())t.disconnect();this.#mt.clear(),this.#ut=[]}updated(t){t.has("maxOpenItems")&&this.#At()}render(){return B``}#bt(){const t=new Set(this.#Ot());for(const[e,r]of this.#pt)t.has(e)||(r.disconnect(),this.#pt.delete(e));this.#ut=this.#ut.filter(e=>t.has(e));for(const e of t)if(!this.#pt.has(e)){const t=new MutationObserver(()=>this.#wt(e));t.observe(e,{attributes:!0,attributeFilter:["open"]}),this.#pt.set(e,t),e.open&&!this.#ut.includes(e)&&this.#ut.push(e)}this.#At(),this.#_t(),this.#vt()}#_t(){const t=new Set(this.#xt());for(const[e,r]of this.#mt)t.has(e)||(r.disconnect(),this.#mt.delete(e));for(const e of t)if(!this.#mt.has(e)){const t=new MutationObserver(this.#ft);t.observe(e,{attributes:!0,attributeFilter:["index","summary-marker"]}),t.observe(e.content,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.#mt.set(e,t)}}#ft;#vt(){const t=this.#xt();for(const e of this.#Ot()){const r=e.querySelector(":scope > summary");r instanceof HTMLElement&&this.#Tt(r,t)}}#Tt(t,e){let r=this.#gt.get(t);r||(r=new Map,this.#gt.set(t,r));for(const e of r.values())for(const r of e)r.parentNode===t&&t.removeChild(r);r.clear();for(const n of e){const e=n.content.cloneNode(!0),s=Array.from(e.childNodes);if(0===s.length)continue;for(const t of s)t instanceof Element&&t.setAttribute("tp-summary-marker","");const o=ur(n.getAttribute("index"),t.childNodes.length),i=t.childNodes[o]??null;t.insertBefore(e,i),r.set(n,s)}}#xt(){return Array.from(this.children).filter(t=>t instanceof HTMLTemplateElement&&t.hasAttribute("summary-marker"))}#Ot(){return Array.from(this.children).filter(t=>t instanceof HTMLDetailsElement)}#yt;#Et;#wt;#Ct;#kt(t){const e=t.getAttribute("toggle-on");return"marker"===e||"summary"===e?e:"marker"===this.toggleOn?"marker":"summary"}#St(t){const e=this.#ut.includes(t);t.open&&!e?(this.#ut.push(t),this.#At()):!t.open&&e&&(this.#ut=this.#ut.filter(e=>e!==t))}#At(){const t=this.maxOpenItems;if(!Number.isFinite(t)||t<=0)return;const e=[];for(;this.#ut.length>t;){const t=this.#ut.shift();if(!t)break;t.open&&(t.open=!1,e.push(t))}e.length>0&&this.dispatchEvent(new CustomEvent("tp-details-set-change",{bubbles:!0,composed:!0,detail:{opened:[],closed:e}}))}},e([pt({type:Number,reflect:!0,attribute:"max-open-items"}),r("design:type",Object)],t.DetailsSetElement.prototype,"maxOpenItems",void 0),e([pt({reflect:!0,attribute:"toggle-on"}),r("design:type",String)],t.DetailsSetElement.prototype,"toggleOn",void 0),t.DetailsSetElement=e([ht("tp-details-set")],t.DetailsSetElement);const pr={};const mr={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},gr=new Set(["start","center","end"]),fr=new Set(["top","middle","bottom"]),vr={start:["end","start"],center:["center","center"],end:["start","end"]},yr={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function br(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return gr.has(t)?vr[t]:null}return 2===e.length&&gr.has(e[0])&&gr.has(e[1])?[e[0],e[1]]:null}function Er(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return fr.has(t)?yr[t]:null}return 2===e.length&&fr.has(e[0])&&fr.has(e[1])?[e[0],e[1]]:null}t.PopoverElement=class extends lt{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="click",this.#Dt=((t="tp-popover")in pr||(pr[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),pr[t].next().value),this.#Nt=null,this.#Rt=!1,this.#Mt=[]}static{this.styles=(()=>{const t=l`
|
|
222
|
+
`}static{this.TRANSPARENT_IMAGE=new Image(1,1),this.TRANSPARENT_IMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg==";const t=this.GLOBAL_STYLE=document.createElement("style");t.innerHTML="\n @property --tp-drag-offset-x {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n\n @property --tp-drag-offset-y {\n syntax: '<length>';\n initial-value: 0px;\n inherits: true;\n }\n ",document.head.appendChild(t)}#W;#z;#B;get clone(){return this.#z.deref()}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#et(),this.addEventListener("dragstart",this.#Z),this.addEventListener("dragend",this.#K),this.addEventListener("drag",this.#X),this.addEventListener("tp-drag-zone-enter",this.#Q),this.addEventListener("tp-drag-zone-leave",this.#tt)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dragstart",this.#Z),this.removeEventListener("dragend",this.#K),this.removeEventListener("drag",this.#X),this.removeEventListener("tp-drag-zone-enter",this.#Q),this.removeEventListener("tp-drag-zone-leave",this.#tt)}render(){return B`<slot></slot>`}[or](t,e){if(this.dropAccepted=!0,this.#W=t,!e)return;const{width:r,height:n,left:s,right:o,top:i,bottom:a}=e;for(const t in{width:r,height:n,left:s,right:o,top:i,bottom:a})this.style.setProperty(`--tp-drag-target-${t}`,`${e[t]}px`)}[ir](t){this.#B.add(t)}[ar](t){this.#B.delete(t)}#et(){cr.DRAG_DATA_OBSERVER.observe(this,{attributes:!0});for(const{name:t,value:e}of Object.values(this.attributes).filter(t=>t.name.startsWith("data-drag-")))this.dragData[t.replace("data-drag-","")]=e}#Z;#K;#X;#Q;#tt;#J(){const t=document.createElement("tp-drag-clone");return Object.values(this.attributes).filter(t=>!["dragging","replaceclone","draggable"].includes(t.name)).forEach(e=>{t.attributes.setNamedItem(e.cloneNode())}),this.childNodes.forEach(e=>{t.appendChild(e.cloneNode(!0))}),t}#Y(t){this.preDragData.boundingRect=this.getBoundingClientRect(),this.preDragData.dragStartEvent=t,this.preDragData.styles.pointerEvents=this.style.pointerEvents}#G(){const{boundingRect:{width:t,height:e,left:r,top:n},dragStartEvent:{x:s,y:o}}=this.preDragData,i={width:t,height:e,left:r,top:n,x:s,y:o};for(const t in i)this.style.setProperty(`--tp-drag-${t}`,`${i[t]}px`)}#F(t){t.preventDefault()}#q(t){return!this.disabled&&(!this.#B.size||!!this.#B.has(t.target))}},e([pt({type:String}),r("design:type",String)],t.DragElement.prototype,"name",void 0),e([pt({type:String,reflect:!0,attribute:"draggingstrategy"}),r("design:type",String)],t.DragElement.prototype,"draggingStrategy",void 0),e([pt({type:String,attribute:"draggroup"}),r("design:type",String)],t.DragElement.prototype,"dragGroup",void 0),e([pt({type:Boolean,attribute:"replaceclone"}),r("design:type",Boolean)],t.DragElement.prototype,"replaceClone",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragging",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.DragElement.prototype,"dragend",void 0),e([pt({type:String,reflect:!0,attribute:"draggedover"}),r("design:type",Object)],t.DragElement.prototype,"draggedOver",void 0),e([pt({type:Boolean,reflect:!0,attribute:"dropaccepted"}),r("design:type",Object)],t.DragElement.prototype,"dropAccepted",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.DragElement.prototype,"disabled",void 0),t.DragElement=cr=e([ht("tp-drag")],t.DragElement),document.addEventListener("tp-drag-start",t=>{dr=t}),t.DropZoneElement=class extends lt{constructor(){super(...arguments),this.#rt=0,this.accept=[],this.name="",this.itemDragged=null,this.acceptableDrag=!1,this.#nt=t=>{this.accept.length&&!this.accept.includes(t.name)||(this.acceptableDrag=!0)},this.#st=()=>{this.itemDragged=null,this.acceptableDrag=!1,this.#rt=0},this.#ot=t=>{this.#it()&&(++this.#rt>1||(this.itemDragged=dr.name??"",this.#at("tp-dropzone-enter","tp-drag-zone-enter",t)))},this.#lt=t=>{this.#it()&&(--this.#rt>0||(this.itemDragged=null,this.#at("tp-dropzone-leave","tp-drag-zone-leave",t)))},this.#ct=t=>{this.#it()&&this.#at("tp-dropzone-over","tp-drag-zone-over",t)},this.#ht=t=>{this.#it()&&this.#at("tp-dropzone-drop","tp-drag-drop",t)}}static{this.styles=l``}#rt;render(){return B`<slot></slot>`}connectedCallback(){super.connectedCallback(),document.addEventListener("tp-drag-start",this.#nt),document.addEventListener("tp-drag-end",this.#st),document.addEventListener("tp-dropzone-drop-end",this.#st),this.addEventListener("dragenter",this.#ot),this.addEventListener("dragleave",this.#lt),this.addEventListener("dragover",this.#ct),this.addEventListener("drop",this.#ht)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("tp-drag-start",this.#nt),document.removeEventListener("tp-drag-end",this.#st),document.removeEventListener("tp-dropzone-drop-end",this.#st),this.removeEventListener("dragenter",this.#ot),this.removeEventListener("dragleave",this.#lt),this.removeEventListener("dragover",this.#ct),this.removeEventListener("drop",this.#ht)}#nt;#st;#ot;#lt;#ct;#ht;#it(){return!dr.name||!this.accept.length||this.accept.includes(dr.name)}#at(t,e,r){const{dragTarget:n}=dr,s=new WeakRef(this);this.dispatchEvent(new hr(t,{dragTarget:n,dropzoneTarget:s},r)),n.deref()?.dispatchEvent(new hr(e,{dragTarget:n,dropzoneTarget:s},r))}},e([pt({converter:t=>(t??"").split(",").map(t=>t.trim())}),r("design:type",Array)],t.DropZoneElement.prototype,"accept",void 0),e([pt({type:String}),r("design:type",Object)],t.DropZoneElement.prototype,"name",void 0),e([pt({type:String,reflect:!0,attribute:"itemdragged"}),r("design:type",Object)],t.DropZoneElement.prototype,"itemDragged",void 0),e([pt({type:Boolean,reflect:!0,attribute:"acceptabledrag"}),r("design:type",Object)],t.DropZoneElement.prototype,"acceptableDrag",void 0),t.DropZoneElement=e([ht("tp-dropzone")],t.DropZoneElement),t.DragHandleElement=class extends lt{get#dt(){for(const e of function*(t){for(;t.parentElement;)yield t=t.parentElement}(this))if(e instanceof t.DragElement)return e;return null}connectedCallback(){super.connectedCallback(),this.draggable=!0,this.#dt?.[ir](this)}disconnectedCallback(){super.disconnectedCallback(),this.#dt?.[ar](this)}render(){return B`<slot></slot>`}},t.DragHandleElement=e([ht("tp-drag-handle")],t.DragHandleElement),t.DetailsSetElement=class extends lt{constructor(){super(...arguments),this.maxOpenItems=0,this.toggleOn="summary",this.#ut=[],this.#pt=new Map,this.#mt=new Map,this.#gt=new WeakMap,this.#ft=()=>{this.#vt()},this.#yt=()=>{this.#bt()},this.#Et=t=>{const e=t.target;e instanceof HTMLDetailsElement&&e.parentElement===this&&this.#St(e)},this.#wt=t=>{this.#St(t)},this.#Ct=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const r=e.closest("summary");if(!r)return;const n=r.parentElement;if(!(n instanceof HTMLDetailsElement))return;if(n.parentElement!==this)return;if(r!==n.querySelector(":scope > summary"))return;"marker"===this.#kt(n)&&0!==t.detail&&r.querySelector("[tp-summary-marker]")&&(e.closest("[tp-summary-marker]")||t.preventDefault())}}static{const t=this.GLOBAL_STYLE=document.createElement("style");t.textContent='\n tp-details-set {\n display: block;\n interpolate-size: allow-keywords;\n }\n\n tp-details-set > details::details-content {\n block-size: 0;\n overflow: clip;\n transition:\n block-size var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease),\n content-visibility var(--tp-details-set-transition-duration, 0.3s)\n var(--tp-details-set-transition-easing, ease)\n allow-discrete;\n }\n\n tp-details-set > details[open]::details-content {\n block-size: auto;\n }\n\n /* Hide the native disclosure marker when the consumer has supplied at\n least one custom marker via <template summary-marker>. */\n tp-details-set > details > summary:has(> [tp-summary-marker]) {\n list-style: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::-webkit-details-marker {\n display: none;\n }\n tp-details-set > details > summary:has(> [tp-summary-marker])::marker {\n content: "";\n }\n ',document.head.appendChild(t)}#ut;#pt;#$t;#mt;#gt;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("toggle",this.#Et,{capture:!0}),this.addEventListener("click",this.#Ct,{capture:!0}),this.#$t=new MutationObserver(this.#yt),this.#$t.observe(this,{childList:!0}),this.#bt()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",this.#Et,{capture:!0}),this.removeEventListener("click",this.#Ct,{capture:!0}),this.#$t?.disconnect(),this.#$t=void 0;for(const t of this.#pt.values())t.disconnect();this.#pt.clear();for(const t of this.#mt.values())t.disconnect();this.#mt.clear(),this.#ut=[]}updated(t){t.has("maxOpenItems")&&this.#At()}render(){return B``}#bt(){const t=new Set(this.#Ot());for(const[e,r]of this.#pt)t.has(e)||(r.disconnect(),this.#pt.delete(e));this.#ut=this.#ut.filter(e=>t.has(e));for(const e of t)if(!this.#pt.has(e)){const t=new MutationObserver(()=>this.#wt(e));t.observe(e,{attributes:!0,attributeFilter:["open"]}),this.#pt.set(e,t),e.open&&!this.#ut.includes(e)&&this.#ut.push(e)}this.#At(),this.#_t(),this.#vt()}#_t(){const t=new Set(this.#xt());for(const[e,r]of this.#mt)t.has(e)||(r.disconnect(),this.#mt.delete(e));for(const e of t)if(!this.#mt.has(e)){const t=new MutationObserver(this.#ft);t.observe(e,{attributes:!0,attributeFilter:["index","summary-marker"]}),t.observe(e.content,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.#mt.set(e,t)}}#ft;#vt(){const t=this.#xt();for(const e of this.#Ot()){const r=e.querySelector(":scope > summary");r instanceof HTMLElement&&this.#Tt(r,t)}}#Tt(t,e){let r=this.#gt.get(t);r||(r=new Map,this.#gt.set(t,r));for(const e of r.values())for(const r of e)r.parentNode===t&&t.removeChild(r);r.clear();for(const n of e){const e=n.content.cloneNode(!0),s=Array.from(e.childNodes);if(0===s.length)continue;for(const t of s)t instanceof Element&&t.setAttribute("tp-summary-marker","");const o=ur(n.getAttribute("index"),t.childNodes.length),i=t.childNodes[o]??null;t.insertBefore(e,i),r.set(n,s)}}#xt(){return Array.from(this.children).filter(t=>t instanceof HTMLTemplateElement&&t.hasAttribute("summary-marker"))}#Ot(){return Array.from(this.children).filter(t=>t instanceof HTMLDetailsElement)}#yt;#Et;#wt;#Ct;#kt(t){const e=t.getAttribute("toggle-on");return"marker"===e||"summary"===e?e:"marker"===this.toggleOn?"marker":"summary"}#St(t){const e=this.#ut.includes(t);t.open&&!e?(this.#ut.push(t),this.#At()):!t.open&&e&&(this.#ut=this.#ut.filter(e=>e!==t))}#At(){const t=this.maxOpenItems;if(!Number.isFinite(t)||t<=0)return;const e=[];for(;this.#ut.length>t;){const t=this.#ut.shift();if(!t)break;t.open&&(t.open=!1,e.push(t))}e.length>0&&this.dispatchEvent(new CustomEvent("tp-details-set-change",{bubbles:!0,composed:!0,detail:{opened:[],closed:e}}))}},e([pt({type:Number,reflect:!0,attribute:"max-open-items"}),r("design:type",Object)],t.DetailsSetElement.prototype,"maxOpenItems",void 0),e([pt({reflect:!0,attribute:"toggle-on"}),r("design:type",String)],t.DetailsSetElement.prototype,"toggleOn",void 0),t.DetailsSetElement=e([ht("tp-details-set")],t.DetailsSetElement);const pr={};const mr={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},gr=new Set(["start","center","end"]),fr=new Set(["top","middle","bottom"]),vr={start:["end","start"],center:["center","center"],end:["start","end"]},yr={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function br(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return gr.has(t)?vr[t]:null}return 2===e.length&&gr.has(e[0])&&gr.has(e[1])?[e[0],e[1]]:null}function Er(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return fr.has(t)?yr[t]:null}return 2===e.length&&fr.has(e[0])&&fr.has(e[1])?[e[0],e[1]]:null}t.PopoverElement=class extends lt{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="click",this.#Dt=((t="tp-popover")in pr||(pr[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),pr[t].next().value),this.#Nt=null,this.#Rt=!1,this.#Mt=[]}static{this.styles=(()=>{const t=l`
|
|
223
223
|
tp-popover {
|
|
224
224
|
--tp-popover-inline-position: attr(data-ti type(*));
|
|
225
225
|
--tp-popover-block-position: attr(data-tb type(*));
|
|
@@ -257,7 +257,7 @@ qt.State,qt.Computed;const ue=(t,e)=>new qt.State(t,e),pe=(t,e)=>new qt.Computed
|
|
|
257
257
|
inset-block-end: anchor(var(--tp-popover-block-position));
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#Dt;#Nt;get anchorElement(){return this.#Nt}get anchorName(){return`--${this.#Dt}`}#Rt;#Mt;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#Pt(),this.#Lt(),this.#jt(),this.#It()}disconnectedCallback(){super.disconnectedCallback(),this.#Ut(),this.#Ht()}updated(t){t.has("mode")&&this.#Pt(),t.has("target")&&(this.#Lt(),this.#It()),t.has("position")&&this.#jt(),t.has("trigger")&&this.#It()}render(){return B``}#Pt(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#Vt(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const r=this.getRootNode();return r instanceof ShadowRoot&&r.host instanceof HTMLElement?r.host:null}#Lt(){const t=this.#Vt();t!==this.#Nt?(this.#Ht(),this.#Nt=t,t&&this.#
|
|
260
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#Dt;#Nt;get anchorElement(){return this.#Nt}get anchorName(){return`--${this.#Dt}`}#Rt;#Mt;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#Pt(),this.#Lt(),this.#jt(),this.#It()}disconnectedCallback(){super.disconnectedCallback(),this.#Ut(),this.#Ht()}updated(t){t.has("mode")&&this.#Pt(),t.has("target")&&(this.#Lt(),this.#It()),t.has("position")&&this.#jt(),t.has("trigger")&&this.#It()}render(){return B``}#Pt(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#Vt(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const r=this.getRootNode();return r instanceof ShadowRoot&&r.host instanceof HTMLElement?r.host:null}#Lt(){const t=this.#Vt();t!==this.#Nt?(this.#Ht(),this.#Nt=t,t&&this.#Wt(t)):t&&this.#Wt(t)}#Wt(t){const e=`--${this.#Dt}`,r=t.style.getPropertyValue("anchor-name").trim();if(r&&r!==e)return this.style.setProperty("position-anchor",r),void(this.#Rt=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#Rt=!0}#Ht(){if(this.#Nt&&this.#Rt){const t=`--${this.#Dt}`;this.#Nt.style.getPropertyValue("anchor-name").trim()===t&&this.#Nt.style.removeProperty("anchor-name")}this.#Nt=null,this.#Rt=!1,this.style.removeProperty("position-anchor")}#jt(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=br(e);if(t){const[e,r]=yr.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:r}}const r=Er(e);if(r){const[t,e]=vr.center;return{popInline:t,targetInline:e,popBlock:r[0],targetBlock:r[1]}}return null}const r=e.split("/");if(2!==r.length)return null;const n=br(r[0]),s=Er(r[1]);return n&&s?{popInline:n[0],targetInline:n[1],popBlock:s[0],targetBlock:s[1]}:null}(this.position);this.position&&!t&&console.warn(`<tp-popover>: invalid position "${this.position}"; using default.`),t??=mr,this.dataset.pi=t.popInline,this.dataset.ti=t.targetInline,this.dataset.pb=t.popBlock,this.dataset.tb=t.targetBlock}#Ut(){for(const t of this.#Mt)t();this.#Mt=[]}#It(){this.#Ut();const t=this.#Nt;if(t){if("click"===this.trigger){const e=t=>{if(!t.composedPath().includes(this))try{this.togglePopover()}catch{}};return t.addEventListener("click",e),void this.#Mt.push(()=>t.removeEventListener("click",e))}if("hover"===this.trigger){let e=null;const r=()=>{null!==e&&(clearTimeout(e),e=null)},n=()=>{r();try{this.showPopover()}catch{}},s=()=>{r(),e=setTimeout(()=>{try{this.hidePopover()}catch{}},120)};t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",s),t.addEventListener("focusin",n),t.addEventListener("focusout",s),this.addEventListener("pointerenter",r),this.addEventListener("pointerleave",s),this.addEventListener("focusin",r),this.addEventListener("focusout",s),this.#Mt.push(()=>{r(),t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",s),t.removeEventListener("focusin",n),t.removeEventListener("focusout",s),this.removeEventListener("pointerenter",r),this.removeEventListener("pointerleave",s),this.removeEventListener("focusin",r),this.removeEventListener("focusout",s)})}}}},e([pt({reflect:!0}),r("design:type",String)],t.PopoverElement.prototype,"mode",void 0),e([pt({reflect:!0}),r("design:type",Object)],t.PopoverElement.prototype,"target",void 0),e([pt({reflect:!0}),r("design:type",Object)],t.PopoverElement.prototype,"position",void 0),e([pt({reflect:!0}),r("design:type",String)],t.PopoverElement.prototype,"trigger",void 0),t.PopoverElement=e([ht("tp-popover")],t.PopoverElement);
|
|
261
261
|
/**
|
|
262
262
|
* @license
|
|
263
263
|
* Copyright 2021 Google LLC
|
|
@@ -295,7 +295,7 @@ let wr=class{constructor(t,e,r,n){if(this.subscribe=!1,this.provided=!1,this.val
|
|
|
295
295
|
* Copyright 2022 Google LLC
|
|
296
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
297
297
|
*/
|
|
298
|
-
function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addInitializer(function(){new wr(this,{context:t,callback:t=>{r.set.call(this,t)},subscribe:e})}):r.constructor.addInitializer(r=>{new wr(r,{context:t,callback:t=>{r[n]=t},subscribe:e})})}}class Or extends Promise{static#
|
|
298
|
+
function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addInitializer(function(){new wr(this,{context:t,callback:t=>{r.set.call(this,t)},subscribe:e})}):r.constructor.addInitializer(r=>{new wr(r,{context:t,callback:t=>{r[n]=t},subscribe:e})})}}class Or extends Promise{static#zt=Te;static#Bt=Te;#Zt=!1;#qt=!1;#Ft=Te;#Yt=Te;get resolved(){return this.#Zt}get rejected(){return this.#qt}get finished(){return this.#Zt||this.#qt}constructor(t=Te){super((e,r)=>{Or.#zt=e,Or.#Bt=r,t(e,r)}),this.#Ft=Or.#zt,this.#Yt=Or.#Bt,Or.#zt=Te,Or.#Bt=Te}resolve(...t){if(this.finished)throw new Error("Promise is already finished");this.#Zt=!0,this.#Ft(...t)}reject(...t){if(this.finished)throw new Error("Promise is already finished");this.#qt=!0,this.#Yt(...t)}bindTo(t){t.then(t=>{this.resolve(t)}).catch(t=>this.reject(t))}}const _r=function(){const t=new WeakMap,e=new Map,r=(r,n,s)=>{const o=new Or,i=setTimeout(()=>{o.resolve(n)},r),a={openPromise:o,id:i};return t.set(o,a),s&&e.set(s,a),o};return Object.defineProperties(r,{FINISHED_ALREADY:{writable:!1,value:Symbol("Timeout finished already")},IDENTIFIER_NOT_FOUND:{writable:!1,value:Symbol("Timeout not found via identifier")},TIMEOUT_CANCELLED:{writable:!1,value:Symbol("Timeout cancelled")}}),r.cancel=async(n,s)=>{const{FINISHED_ALREADY:o,IDENTIFIER_NOT_FOUND:i,TIMEOUT_CANCELLED:a}=r;let l;if(void 0===s&&(s=a),l="symbol"==typeof n?e.get(n):t.get(n),!l)throw i;if(l.openPromise.finished)throw o;clearTimeout(l.id),l.openPromise.reject(s),"symbol"==typeof n&&e.delete(n)},r}();const xr=new Map;function Tr(t,e,r=180,n=null,...s){let o,i;if(xr.has(t)){const e=xr.get(t);o=e.timeout,i=e.promise,_r.cancel(o)}else i=new Or;return o=_r(r),xr.set(t,{promise:i,timeout:o}),o.then(()=>{xr.delete(t);const r=e.call(n,...s);return i.bindTo(async function(t){return await t}(r)),r}).catch(t=>{t!==_r.TIMEOUT_CANCELLED&&i.reject(t)}),i}const Dr=Symbol("tp-select");class Nr{#V;#Gt;#Jt=!1;constructor(t,e={}){const{attributes:r=!0,childList:n=!0,characterData:s=!0}=e;this.#V=t,this.clone=t.cloneNode(!0),this.#Gt=new MutationObserver(t=>this.#Kt(t)),this.#Gt.observe(t,{attributes:r,childList:n,characterData:s,subtree:!0})}disconnect(){this.#Jt||(this.#Jt=!0,this.#Gt.disconnect())}#Kt(t){for(const e of t){const t=this.#Xt(e.target);if(!t)continue;const r=this.#Qt(t);if(r)switch(e.type){case"attributes":this.#te(e,r);break;case"characterData":r.nodeValue=e.target.nodeValue;break;case"childList":this.#ee(e.target,r)}}}#te(t,e){const r=t.attributeName;if(!r)return;const n=t.attributeNamespace??null,s=t.target,o=n?s.getAttributeNS(n,r):s.getAttribute(r);null===o?n?e.removeAttributeNS(n,r):e.removeAttribute(r):n?e.setAttributeNS(n,r,o):e.setAttribute(r,o)}#ee(t,e){for(;e.firstChild;)e.removeChild(e.firstChild);for(const r of Array.from(t.childNodes))e.appendChild(r.cloneNode(!0))}#Xt(t){if(t===this.#V)return[];const e=[];let r=t;for(;r&&r!==this.#V;){const t=r.parentNode;if(!t)return null;e.push(Array.prototype.indexOf.call(t.childNodes,r)),r=t}return r===this.#V?e.reverse():null}#Qt(t){let e=this.clone;for(const r of t){const t=e.childNodes[r];if(!t)return null;e=t}return e}}const Rr=Symbol("select:register-option"),Mr=Symbol("select:unregister-option"),Pr=Symbol("option:should-register-to-select");var Lr,jr;t.SelectedContentElement=class extends Ne{static{this.styles=(()=>{const t=l`
|
|
299
299
|
tp-selected-content {
|
|
300
300
|
display: inline-block;
|
|
301
301
|
|
|
@@ -316,7 +316,7 @@ function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addIniti
|
|
|
316
316
|
background: var(--tp-select-option-color, white);
|
|
317
317
|
|
|
318
318
|
&:hover {
|
|
319
|
-
background: color-mix(in
|
|
319
|
+
background: color-mix(in oklab, var(--tp-select-option-color, white) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
&[selected] {
|
|
@@ -324,7 +324,7 @@ function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addIniti
|
|
|
324
324
|
color: var(--tp-select-selection-contrast-color, white);
|
|
325
325
|
|
|
326
326
|
&:hover {
|
|
327
|
-
background: color-mix(in
|
|
327
|
+
background: color-mix(in oklab, var(--tp-select-selection-color, #0078d4) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
}
|
|
@@ -407,7 +407,7 @@ function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addIniti
|
|
|
407
407
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
408
408
|
--tp-button-active-mixer-color: transparent;
|
|
409
409
|
--tp-button-active-mixer-percentage: 10%;
|
|
410
|
-
--tp-button-active-color: color-mix(in
|
|
410
|
+
--tp-button-active-color: color-mix(in oklab, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
411
411
|
display: inline-block;
|
|
412
412
|
border: 1px solid transparent;
|
|
413
413
|
cursor: pointer;
|
|
@@ -427,7 +427,7 @@ function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addIniti
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
&[disabled] {
|
|
430
|
-
--tp-button-color: color-mix(in
|
|
430
|
+
--tp-button-color: color-mix(in oklab, var(--tp-calc-element-color) 50%, var(--tp-color-white) 50%);
|
|
431
431
|
--tp-button-contrast-color: rgb(from var(--tp-calc-contrast-color) r g b / 50%);
|
|
432
432
|
pointer-events: none;
|
|
433
433
|
user-select: none;
|
|
@@ -481,7 +481,7 @@ function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addIniti
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#de;constructor(){super(),this.variant="solid",this.type="button",this.disabled=!1,this.#P=t=>{if(this.disabled)return t.preventDefault(),void t.stopImmediatePropagation();const e=this.#de.form;e&&("submit"===this.type?e.requestSubmit():"reset"===this.type&&e.reset())},this.#ye=t=>{this.disabled||" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.click())},this.#de=this.attachInternals(),this.#de.role="button"}get form(){return this.#de.form}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex",this.disabled?"-1":"0"),this.addEventListener("click",this.#P),this.addEventListener("keydown",this.#ye)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#P),this.removeEventListener("keydown",this.#ye)}updated(t){super.updated?.(t),t.has("disabled")&&(this.setAttribute("tabindex",this.disabled?"-1":"0"),this.#de.ariaDisabled=this.disabled?"true":"false")}#P;#ye;createRenderRoot(){return this}render(){return B``}},e([pt({type:String,reflect:!0}),r("design:type",String)],t.ButtonElement.prototype,"variant",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],t.ButtonElement.prototype,"type",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.ButtonElement.prototype,"disabled",void 0),t.ButtonElement=e([ht("tp-button"),r("design:paramtypes",[])],t.ButtonElement);const Ur=Node.prototype.insertBefore,Hr=Node.prototype.removeChild,Vr=Node.prototype.replaceChild,zr=Element.prototype.moveBefore;function Wr(t,e,r){Ur.call(t,e,r)}function Br(t){t.parentNode&&Hr.call(t.parentNode,t)}function Zr(t,e,r,n=!0){if(n&&zr&&e.isConnected&&t.isConnected)try{return void zr.call(t,e,r)}catch{}Ur.call(t,e,r)}const qr={"&":"&","<":"<",">":">"," ":" "};const Fr=Symbol("portal:sync"),Yr=Symbol("portal-outlet:attach"),Gr=Symbol("portal-outlet:detach");const Jr=new class{#be=new Map;#Ee=new Map;outletFor(t){const e=this.#be.get(t);return e?.[e.length-1]??null}addOutlet(t,e){const r=this.#be.get(t)??[];r.includes(e)||r.push(e),this.#be.set(t,r),this.#Se(t)}removeOutlet(t,e){const r=this.#be.get(t);if(!r)return;const n=r.indexOf(e);-1!==n&&(r.splice(n,1),r.length||this.#be.delete(t),this.#Se(t))}addPortal(t,e){const r=this.#Ee.get(t)??new Set;r.add(e),this.#Ee.set(t,r),e[Fr]()}removePortal(t,e){const r=this.#Ee.get(t);r&&(r.delete(e),r.size||this.#Ee.delete(t))}#Se(t){for(const e of[...this.#Ee.get(t)??[]])e[Fr]()}};class Kr{#we=document.createComment("tp-portal");#Ce=document.createComment("/tp-portal");#ke=null;get container(){return this.#ke}get active(){return null!==this.#ke}nodes(){return this.#ke?function(t,e){const r=[];if(!t.parentNode||t.parentNode!==e.parentNode)return r;for(let n=t.nextSibling;n&&n!==e;n=n.nextSibling)r.push(n);return r}(this.#we,this.#Ce):[]}owns(t){return null===t||null!==this.#ke&&t.parentNode===this.#ke}open(t,e){this.#ke=t,Wr(t,this.#we,null),Wr(t,this.#Ce,null),this.pull(e)}pull(t){if(this.#ke)for(const e of Array.from(t.childNodes))Zr(this.#ke,e,this.#Ce)}close(t){if(!this.#ke)return;const e=this.nodes();this.#ke=null;for(const r of e)Zr(t,r,null);Br(this.#we),Br(this.#Ce)}insert(t,e){Wr(this.#ke,t,e??this.#Ce)}prepend(t){Wr(this.#ke,t,this.#we.nextSibling)}remove(t){Br(t)}replace(t,e){!function(t,e,r){Vr.call(t,e,r)}(this.#ke,t,e)}clear(){for(const t of this.nodes())Br(t)}refFor(t){return t??this.#Ce}}let Xr=!1;function Qr(){if(!Xr&&"undefined"!=typeof document){Xr=!0;try{const t=new CSSStyleSheet;t.replaceSync("\n :where(tp-portal) { display: none; }\n :where(tp-portal-outlet) { display: contents; }\n :where(tp-portal-outlet-fallback) { display: contents; }\n tp-portal-outlet[active] > tp-portal-outlet-fallback { display: none !important; }\n "),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}catch{}}}class tn extends HTMLElement{static{this.observedAttributes=["name"]}#$e=new Kr;#Gt=new MutationObserver(()=>this.#$e.pull(this));#_=null;#Ae=null;get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get outlet(){return this.#_}get projectedNodes(){return this.#$e.active?this.#$e.nodes():Array.from(this.childNodes)}connectedCallback(){Qr(),this.#Gt.observe(this,{childList:!0}),this.#Oe()}disconnectedCallback(){this.#_e(),this.#Gt.disconnect()}attributeChangedCallback(){this.isConnected&&(this.#_e(),this.#Oe())}[Fr](){const t=null===this.#Ae?null:Jr.outletFor(this.#Ae);t!==this.#_&&(this.#xe(),t&&!this.contains(t)&&this.#Te(t))}#Oe(){const t=this.name;t&&(this.#Ae=t,Jr.addPortal(t,this))}#_e(){null!==this.#Ae&&(Jr.removePortal(this.#Ae,this),this.#Ae=null),this.#xe()}#Te(t){this.#_=t,this.#$e.open(t,this),t[Yr](this),this.toggleAttribute("projected",!0)}#xe(){const t=this.#_;t&&(this.#_=null,this.#$e.close(this),t[Gr](this),this.toggleAttribute("projected",!1))}appendChild(t){return this.#$e.active?(this.#$e.insert(t,null),t):super.appendChild(t)}insertBefore(t,e){return this.#$e.active&&this.#$e.owns(e)?(this.#$e.insert(t,e),t):super.insertBefore(t,e)}removeChild(t){return this.#$e.active&&this.#$e.owns(t)?(this.#$e.remove(t),t):super.removeChild(t)}replaceChild(t,e){return this.#$e.active&&this.#$e.owns(e)?(this.#$e.replace(t,e),e):super.replaceChild(t,e)}static{void 0!==zr&&Object.defineProperty(this.prototype,"moveBefore",{configurable:!0,writable:!0,value(t,e){const r=this.#$e.active&&this.#$e.owns(e);!function(t,e,r){if(!zr)throw new DOMException("moveBefore is not supported","NotSupportedError");zr.call(t,e,r)}(r?this.#$e.container:this,t,r?this.#$e.refFor(e):e)}})}append(...t){if(!this.#$e.active)return super.append(...t);for(const e of en(t))this.#$e.insert(e,null)}prepend(...t){if(!this.#$e.active)return super.prepend(...t);for(const e of en(t).reverse())this.#$e.prepend(e)}replaceChildren(...t){if(!this.#$e.active)return super.replaceChildren(...t);this.#$e.clear(),this.append(...t)}get textContent(){return this.#$e.active?this.#$e.nodes().map(t=>t.nodeType===Node.COMMENT_NODE?"":t.textContent??"").join(""):super.textContent}set textContent(t){this.#$e.active?(this.#$e.clear(),t&&this.#$e.insert(document.createTextNode(t),null)):super.textContent=t}get innerHTML(){return this.#$e.active?this.#$e.nodes().map(t=>t instanceof Element?t.outerHTML:t.nodeType===Node.TEXT_NODE?(t.nodeValue??"").replace(/[&<> ]/g,t=>qr[t]??t):t.nodeType===Node.COMMENT_NODE?`\x3c!--${t.nodeValue??""}--\x3e`:"").join(""):super.innerHTML}set innerHTML(t){this.#$e.active?(this.#$e.clear(),super.innerHTML=t,this.#$e.pull(this)):super.innerHTML=t}}function en(t){return t.map(t=>"string"==typeof t?document.createTextNode(t):t)}customElements.get("tp-portal")||customElements.define("tp-portal",tn);class rn extends HTMLElement{static{this.observedAttributes=["name"]}#Ee=new Set;#Ae=null;get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get portals(){return[...this.#Ee]}connectedCallback(){Qr(),this.#Oe()}disconnectedCallback(){this.#_e()}attributeChangedCallback(){this.isConnected&&(this.#_e(),this.#Oe())}[Yr](t){this.#Ee.add(t),this.toggleAttribute("active",!0)}[Gr](t){this.#Ee.delete(t),this.toggleAttribute("active",this.#Ee.size>0)}#Oe(){const t=this.name;t&&(this.#Ae=t,Jr.addOutlet(t,this))}#_e(){if(null===this.#Ae)return;const t=this.#Ae;this.#Ae=null,Jr.removeOutlet(t,this)}}customElements.get("tp-portal-outlet")||customElements.define("tp-portal-outlet",rn);class nn extends HTMLElement{get shown(){const t=this.parentElement;return"tp-portal-outlet"===t?.localName&&!t.hasAttribute("active")}connectedCallback(){Qr()}}customElements.get("tp-portal-outlet-fallback")||customElements.define("tp-portal-outlet-fallback",nn);const sn=new Map,on=new Map;function an(t,e){const r=`${t??""}|${JSON.stringify(e)}`;let n=sn.get(r);return n||(n=new Intl.DateTimeFormat(t,e),sn.set(r,n)),n}function ln(t,e){return t.find(t=>t.type===e)?.value}const cn=new Map;function hn(t,e){let r=cn.get(t);return r||(r=e(),cn.set(t,r)),r}function dn(t,e){return hn(`month|${t}|${e}`,()=>{const r=an(t,{timeZone:"UTC",day:"numeric",month:e});return Array.from({length:12},(t,e)=>ln(r.formatToParts(Date.UTC(2e3,e,15)),"month")??"")})}function un(t,e){return hn(`weekday|${t}|${e}`,()=>{const r=an(t,{timeZone:"UTC",weekday:e});return Array.from({length:7},(t,e)=>r.format(Date.UTC(2e3,0,2+e)))})}function pn(t){return hn(`period|${t}`,()=>{const e=an(t,{timeZone:"UTC",hour:"numeric",hourCycle:"h12"}),r=(t,r)=>ln(e.formatToParts(Date.UTC(2e3,0,1,t)),"dayPeriod")??r;return[r(9,"AM"),r(21,"PM")]})}const mn=["YYYY","MMMM","dddd","MMM","ddd","SSS","YY","MM","DD","HH","hh","mm","ss","ZZ","M","D","d","H","h","m","s","A","a","Z","X","x"],gn=new Map;function fn(t){let e=gn.get(t);if(e)return e;e=[];let r="",n=0;const s=()=>{r&&e.push({literal:r}),r=""};for(;n<t.length;){if("["===t[n]){const e=t.indexOf("]",n+1);if(-1!==e){r+=t.slice(n+1,e),n=e+1;continue}}const o=mn.find(e=>t.startsWith(e,n));o?(s(),e.push({token:o}),n+=o.length):r+=t[n++]}return s(),gn.set(t,e),e}const vn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function yn(t,e){if(!e)return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds(),weekday:t.getDay()};const r=an("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}).formatToParts(t),n=t=>Number(ln(r,t)),s=n("year");return{year:"BC"===ln(r,"era")?1-s:s,month:n("month"),day:n("day"),hour:n("hour"),minute:n("minute"),second:n("second"),millisecond:t.getUTCMilliseconds(),weekday:vn.indexOf(ln(r,"weekday")??"")}}function bn(t){const e=new Date(0);return e.setUTCFullYear(t.year,t.month-1,t.day),e.setUTCHours(t.hour,t.minute,t.second,t.millisecond),e.getTime()}function En(t,e){return e?Math.round((bn(yn(t,e))-t.getTime())/6e4):-t.getTimezoneOffset()}function Sn(t,e=":"){const r=t<0?"-":"+",n=Math.abs(t);return`${r}${wn(Math.floor(n/60))}${e}${wn(n%60)}`}function wn(t,e=2){return String(Math.abs(t)).padStart(e,"0")}const Cn=t=>t%12||12,kn={YYYY:({fields:t})=>(t.year<0?"-":"")+wn(t.year,4),YY:({fields:t})=>wn(t.year%100),MMMM:({fields:t,locale:e})=>dn(e,"long")[t.month-1],MMM:({fields:t,locale:e})=>dn(e,"short")[t.month-1],MM:({fields:t})=>wn(t.month),M:({fields:t})=>String(t.month),DD:({fields:t})=>wn(t.day),D:({fields:t})=>String(t.day),dddd:({fields:t,locale:e})=>un(e,"long")[t.weekday],ddd:({fields:t,locale:e})=>un(e,"short")[t.weekday],d:({fields:t})=>String(t.weekday),HH:({fields:t})=>wn(t.hour),H:({fields:t})=>String(t.hour),hh:({fields:t})=>wn(Cn(t.hour)),h:({fields:t})=>String(Cn(t.hour)),mm:({fields:t})=>wn(t.minute),m:({fields:t})=>String(t.minute),ss:({fields:t})=>wn(t.second),s:({fields:t})=>String(t.second),SSS:({fields:t})=>wn(t.millisecond,3),A:({fields:t,locale:e})=>pn(e)[t.hour<12?0:1],a:({fields:t,locale:e})=>pn(e)[t.hour<12?0:1].toLocaleLowerCase(e),ZZ:({date:t,timeZone:e})=>Sn(En(t,e),""),Z:({date:t,timeZone:e})=>Sn(En(t,e)),X:({date:t})=>String(Math.floor(t.getTime()/1e3)),x:({date:t})=>String(t.getTime())};function $n(t,e,r,n){const s={date:t,fields:yn(t,n),locale:r,timeZone:n};return fn(e).map(t=>"token"in t?kn[t.token](s):t.literal).join("")}const An=1e3,On=6e4,_n=36e5,xn=24*_n,Tn=[["year",365*xn],["month",30*xn],["week",7*xn],["day",xn],["hour",_n],["minute",On]];function Dn(t,e,r){const n=t.getTime()-e,s=Math.abs(n),[o,i]=Tn.find(([,t])=>s>=t)??["second",An];return function(t){const e=t??"";let r=on.get(e);return r||(r=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),on.set(e,r)),r}(r).format(Math.trunc(n/i)||0,o)}const Nn=["short","medium","long","full"];function Rn(t,e,r){const n=t.trim();if("relative"===n)return{kind:"relative"};if(n&&!Nn.includes(n))return{kind:"pattern",pattern:t};const s=n||"medium",o=Mn(e,s),i=Mn(r,s);return o||i?{kind:"preset",dateStyle:o,timeStyle:i}:{kind:"preset",dateStyle:s}}function Mn(t,e){if("none"!==t)return t&&Nn.includes(t)?t:e}function Pn(t,e,{locale:r,timeZone:n,now:s}){switch(e.kind){case"relative":return Dn(t,s,r);case"pattern":return $n(t,e.pattern,r,n);case"preset":return an(r,{dateStyle:e.dateStyle,timeStyle:e.timeStyle,timeZone:n}).format(t)}}function Ln(t,e){return jn(e)??jn(function(t){let e=t;for(;e;){if(e instanceof Element){const t=e.closest("[lang]")?.getAttribute("lang");if(t)return t}const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:null}return""}(t))}function jn(t){if(t?.trim())try{return Intl.getCanonicalLocales(t.trim())[0]}catch{return}}function In(t,{timeZone:e,now:r}){if(void 0!==t.timestamp)return Number.isFinite(t.timestamp)?new Date(t.timestamp):void 0;const n=yn(new Date(r),e),s=void 0!==t.year||void 0!==t.month||void 0!==t.day,o={year:t.year??n.year,month:t.month??(s?1:n.month),day:t.day??(s?1:n.day),hour:t.hour??0,minute:t.minute??0,second:t.second??0,millisecond:t.millisecond??0};if(void 0!==t.pm){if(o.hour<1||o.hour>12)return;o.hour=o.hour%12+(t.pm?12:0)}return function(t){return Object.values(t).every(Number.isInteger)&&t.month>=1&&t.month<=12&&t.day>=1&&t.day<=(e=t.year,r=t.month,new Date(bn({year:e,month:r+1,day:0,hour:0,minute:0,second:0,millisecond:0})).getUTCDate())&&t.hour>=0&&t.hour<=23&&t.minute>=0&&t.minute<=59&&t.second>=0&&t.second<=59&&t.millisecond>=0&&t.millisecond<=999;var e,r}(o)?void 0!==t.offset?new Date(bn(o)-6e4*t.offset):function(t,e){if(!e){const e=new Date(0);return e.setFullYear(t.year,t.month-1,t.day),e.setHours(t.hour,t.minute,t.second,t.millisecond),e}const r=bn(t),n=En(new Date(r),e),s=r-6e4*n,o=En(new Date(s),e);return new Date(o===n?s:r-6e4*o)}(o,e):void 0}function Un(t){const e=Number(t);return t.length>2?e:e+(e<=68?2e3:1900)}function Hn(t){return Number(t.slice(0,3).padEnd(3,"0"))}function Vn(t){if(/^z$/i.test(t))return 0;const e=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!e)return;const r=60*Number(e[2])+Number(e[3]??0);return"-"===e[1]?-r:r}const zn=/^([+-]\d{6}|\d{4})-(\d{2})(?:-(\d{2}))?(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?\s*(Z|[+-]\d{2}(?::?\d{2})?)?)?$/i,Wn=/^-?\d+$/;const Bn=/^(\d{1,4})\s*[./-]\s*(\d{1,4})\s*[./-]\s*(\d{1,4})(?:(?:\s+|\s*[T,]\s*)(\d{1,2})[:.](\d{2})(?:[:.](\d{2}))?\s*(am|pm)?)?$/i,Zn=new Map;function qn(t,e){const r=Bn.exec(t),n=function(t){const e=t??"";let r=Zn.get(e);return r||(r=an(t,{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(Date.UTC(2e3,0,2)).map(t=>t.type).filter(t=>"year"===t||"month"===t||"day"===t),Zn.set(e,r)),r}(e);if(!r||3!==n.length)return;const[,s,o,i,a,l,c,h]=r,d={};return[s,o,i].forEach((t,e)=>{const r=n[e];d[r]="year"===r?Un(t):Number(t)}),void 0!==a&&(d.hour=Number(a),d.minute=Number(l),d.second=void 0===c?0:Number(c),h&&(d.pm="pm"===h.toLowerCase())),d}const Fn=(t,e)=>({source:()=>t,apply:(t,r)=>{t[e]=Number(r)}}),Yn=(t,e)=>({source:e=>ts(t(e)),apply:(r,n,s)=>{if(!e)return!0;const o=function(t,e,r){const n=e.toLocaleLowerCase(r);return t.findIndex(t=>t.toLocaleLowerCase(r)===n)}(t(s),n,s);return-1!==o&&(r[e]=o+1,!0)}}),Gn={source:t=>ts([...pn(t),"am","pm"]),apply:(t,e,r)=>{const[n,s]=pn(r).map(t=>t.toLocaleLowerCase(r)),o=e.toLocaleLowerCase(r);t.pm=o===s||"pm"===o||o!==n&&"am"!==o&&void 0}},Jn={source:()=>"Z|[+-]\\d{2}:?\\d{2}",apply:(t,e)=>{t.offset=Vn(e.toUpperCase())}},Kn={YYYY:{source:()=>"[+-]?\\d{4,6}",apply:(t,e)=>{t.year=Number(e)}},YY:{source:()=>"\\d{2}",apply:(t,e)=>{t.year=Un(e)}},MMMM:Yn(t=>dn(t,"long"),"month"),MMM:Yn(t=>dn(t,"short"),"month"),MM:Fn("\\d{1,2}","month"),M:Fn("\\d{1,2}","month"),DD:Fn("\\d{1,2}","day"),D:Fn("\\d{1,2}","day"),dddd:Yn(t=>un(t,"long")),ddd:Yn(t=>un(t,"short")),d:{source:()=>"[0-6]",apply:()=>{}},HH:Fn("\\d{1,2}","hour"),H:Fn("\\d{1,2}","hour"),hh:Fn("\\d{1,2}","hour"),h:Fn("\\d{1,2}","hour"),mm:Fn("\\d{1,2}","minute"),m:Fn("\\d{1,2}","minute"),ss:Fn("\\d{1,2}","second"),s:Fn("\\d{1,2}","second"),SSS:{source:()=>"\\d{1,9}",apply:(t,e)=>{t.millisecond=Hn(e)}},A:Gn,a:Gn,ZZ:Jn,Z:Jn,X:{source:()=>"-?\\d+(?:\\.\\d+)?",apply:(t,e)=>{t.timestamp=Math.round(1e3*Number(e))}},x:{source:()=>"-?\\d+",apply:(t,e)=>{t.timestamp=Number(e)}}},Xn=new Map;function Qn(t,e,r){const{regex:n,tokens:s}=function(t,e){const r=`${e??""}|${t}`;let n=Xn.get(r);if(!n){const s=[],o=fn(t).map(t=>"literal"in t?es(t.literal).replace(/\s+/g,"\\s+"):(s.push(t.token),`(${Kn[t.token].source(e)})`)).join("");n={regex:new RegExp(`^${o}$`,"iu"),tokens:s},Xn.set(r,n)}return n}(e,r),o=n.exec(t);if(!o)return;const i={};for(const[t,e]of s.entries())if(!1===Kn[e].apply(i,o[t+1],r))return;return void 0===i.pm||s.some(t=>"h"===t||"hh"===t)||(i.pm=void 0),i}function ts(t){return[...new Set(t.filter(Boolean))].sort((t,e)=>e.length-t.length).map(es).join("|")}function es(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rs(t,e){if(t instanceof Date)return ns(new Date(t.getTime()));if("number"==typeof t)return ns(new Date(t));const r=t?.trim();if(!r)return;const n=e.inputFormat?.trim()?Qn(r,e.inputFormat,e.locale):function(t){if(Wn.test(t)&&t.replace("-","").length>4)return{timestamp:Number(t)};const e=zn.exec(t);if(!e)return;const[,r,n,s,o,i,a,l,c]=e,h={year:Un(r),month:Number(n),day:void 0===s?1:Number(s)};return void 0!==o&&(h.hour=Number(o),h.minute=Number(i),h.second=void 0===a?0:Number(a),h.millisecond=void 0===l?0:Hn(l)),void 0===c||(h.offset=Vn(c.toUpperCase()),void 0!==h.offset)?h:void 0}(r)??qn(r,e.locale);return ns(n&&In(n,e))}function ns(t){return t&&!Number.isNaN(t.getTime())?t:void 0}const ss=6e4,os={millisecond:50,second:1e3,minute:ss,hour:9e5,day:9e5},is={SSS:"millisecond",x:"millisecond",ss:"second",s:"second",X:"second",mm:"minute",m:"minute",HH:"hour",H:"hour",hh:"hour",h:"hour",A:"hour",a:"hour",ZZ:"hour",Z:"hour"},as={short:"minute",medium:"second",long:"second",full:"second"};function ls(t,e,r){switch(t.kind){case"relative":return function(t,e){const r=Math.abs(t.getTime()-e);return r<_n?An:r<xn?On:9e5}(e,r);case"preset":return os[t.timeStyle?as[t.timeStyle]:"day"];case"pattern":return Math.min(os.day,...fn(t.pattern).map(t=>"token"in t?os[is[t.token]??"day"]:os.day))}}const cs=l`
|
|
484
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#de;constructor(){super(),this.variant="solid",this.type="button",this.disabled=!1,this.#P=t=>{if(this.disabled)return t.preventDefault(),void t.stopImmediatePropagation();const e=this.#de.form;e&&("submit"===this.type?e.requestSubmit():"reset"===this.type&&e.reset())},this.#ye=t=>{this.disabled||" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.click())},this.#de=this.attachInternals(),this.#de.role="button"}get form(){return this.#de.form}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex",this.disabled?"-1":"0"),this.addEventListener("click",this.#P),this.addEventListener("keydown",this.#ye)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#P),this.removeEventListener("keydown",this.#ye)}updated(t){super.updated?.(t),t.has("disabled")&&(this.setAttribute("tabindex",this.disabled?"-1":"0"),this.#de.ariaDisabled=this.disabled?"true":"false")}#P;#ye;createRenderRoot(){return this}render(){return B``}},e([pt({type:String,reflect:!0}),r("design:type",String)],t.ButtonElement.prototype,"variant",void 0),e([pt({type:String,reflect:!0}),r("design:type",String)],t.ButtonElement.prototype,"type",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],t.ButtonElement.prototype,"disabled",void 0),t.ButtonElement=e([ht("tp-button"),r("design:paramtypes",[])],t.ButtonElement);const Ur=Node.prototype.insertBefore,Hr=Node.prototype.removeChild,Vr=Node.prototype.replaceChild,Wr=Element.prototype.moveBefore;function zr(t,e,r){Ur.call(t,e,r)}function Br(t){t.parentNode&&Hr.call(t.parentNode,t)}function Zr(t,e,r,n=!0){if(n&&Wr&&e.isConnected&&t.isConnected)try{return void Wr.call(t,e,r)}catch{}Ur.call(t,e,r)}const qr={"&":"&","<":"<",">":">"," ":" "};const Fr=Symbol("portal:sync"),Yr=Symbol("portal-outlet:attach"),Gr=Symbol("portal-outlet:detach");const Jr=new class{#be=new Map;#Ee=new Map;outletFor(t){const e=this.#be.get(t);return e?.[e.length-1]??null}addOutlet(t,e){const r=this.#be.get(t)??[];r.includes(e)||r.push(e),this.#be.set(t,r),this.#Se(t)}removeOutlet(t,e){const r=this.#be.get(t);if(!r)return;const n=r.indexOf(e);-1!==n&&(r.splice(n,1),r.length||this.#be.delete(t),this.#Se(t))}addPortal(t,e){const r=this.#Ee.get(t)??new Set;r.add(e),this.#Ee.set(t,r),e[Fr]()}removePortal(t,e){const r=this.#Ee.get(t);r&&(r.delete(e),r.size||this.#Ee.delete(t))}#Se(t){for(const e of[...this.#Ee.get(t)??[]])e[Fr]()}};class Kr{#we=document.createComment("tp-portal");#Ce=document.createComment("/tp-portal");#ke=null;get container(){return this.#ke}get active(){return null!==this.#ke}nodes(){return this.#ke?function(t,e){const r=[];if(!t.parentNode||t.parentNode!==e.parentNode)return r;for(let n=t.nextSibling;n&&n!==e;n=n.nextSibling)r.push(n);return r}(this.#we,this.#Ce):[]}owns(t){return null===t||null!==this.#ke&&t.parentNode===this.#ke}open(t,e){this.#ke=t,zr(t,this.#we,null),zr(t,this.#Ce,null),this.pull(e)}pull(t){if(this.#ke)for(const e of Array.from(t.childNodes))Zr(this.#ke,e,this.#Ce)}close(t){if(!this.#ke)return;const e=this.nodes();this.#ke=null;for(const r of e)Zr(t,r,null);Br(this.#we),Br(this.#Ce)}insert(t,e){zr(this.#ke,t,e??this.#Ce)}prepend(t){zr(this.#ke,t,this.#we.nextSibling)}remove(t){Br(t)}replace(t,e){!function(t,e,r){Vr.call(t,e,r)}(this.#ke,t,e)}clear(){for(const t of this.nodes())Br(t)}refFor(t){return t??this.#Ce}}let Xr=!1;function Qr(){if(!Xr&&"undefined"!=typeof document){Xr=!0;try{const t=new CSSStyleSheet;t.replaceSync("\n :where(tp-portal) { display: none; }\n :where(tp-portal-outlet) { display: contents; }\n :where(tp-portal-outlet-fallback) { display: contents; }\n tp-portal-outlet[active] > tp-portal-outlet-fallback { display: none !important; }\n "),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}catch{}}}class tn extends HTMLElement{static{this.observedAttributes=["name"]}#$e=new Kr;#Gt=new MutationObserver(()=>this.#$e.pull(this));#_=null;#Ae=null;get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get outlet(){return this.#_}get projectedNodes(){return this.#$e.active?this.#$e.nodes():Array.from(this.childNodes)}connectedCallback(){Qr(),this.#Gt.observe(this,{childList:!0}),this.#Oe()}disconnectedCallback(){this.#_e(),this.#Gt.disconnect()}attributeChangedCallback(){this.isConnected&&(this.#_e(),this.#Oe())}[Fr](){const t=null===this.#Ae?null:Jr.outletFor(this.#Ae);t!==this.#_&&(this.#xe(),t&&!this.contains(t)&&this.#Te(t))}#Oe(){const t=this.name;t&&(this.#Ae=t,Jr.addPortal(t,this))}#_e(){null!==this.#Ae&&(Jr.removePortal(this.#Ae,this),this.#Ae=null),this.#xe()}#Te(t){this.#_=t,this.#$e.open(t,this),t[Yr](this),this.toggleAttribute("projected",!0)}#xe(){const t=this.#_;t&&(this.#_=null,this.#$e.close(this),t[Gr](this),this.toggleAttribute("projected",!1))}appendChild(t){return this.#$e.active?(this.#$e.insert(t,null),t):super.appendChild(t)}insertBefore(t,e){return this.#$e.active&&this.#$e.owns(e)?(this.#$e.insert(t,e),t):super.insertBefore(t,e)}removeChild(t){return this.#$e.active&&this.#$e.owns(t)?(this.#$e.remove(t),t):super.removeChild(t)}replaceChild(t,e){return this.#$e.active&&this.#$e.owns(e)?(this.#$e.replace(t,e),e):super.replaceChild(t,e)}static{void 0!==Wr&&Object.defineProperty(this.prototype,"moveBefore",{configurable:!0,writable:!0,value(t,e){const r=this.#$e.active&&this.#$e.owns(e);!function(t,e,r){if(!Wr)throw new DOMException("moveBefore is not supported","NotSupportedError");Wr.call(t,e,r)}(r?this.#$e.container:this,t,r?this.#$e.refFor(e):e)}})}append(...t){if(!this.#$e.active)return super.append(...t);for(const e of en(t))this.#$e.insert(e,null)}prepend(...t){if(!this.#$e.active)return super.prepend(...t);for(const e of en(t).reverse())this.#$e.prepend(e)}replaceChildren(...t){if(!this.#$e.active)return super.replaceChildren(...t);this.#$e.clear(),this.append(...t)}get textContent(){return this.#$e.active?this.#$e.nodes().map(t=>t.nodeType===Node.COMMENT_NODE?"":t.textContent??"").join(""):super.textContent}set textContent(t){this.#$e.active?(this.#$e.clear(),t&&this.#$e.insert(document.createTextNode(t),null)):super.textContent=t}get innerHTML(){return this.#$e.active?this.#$e.nodes().map(t=>t instanceof Element?t.outerHTML:t.nodeType===Node.TEXT_NODE?(t.nodeValue??"").replace(/[&<> ]/g,t=>qr[t]??t):t.nodeType===Node.COMMENT_NODE?`\x3c!--${t.nodeValue??""}--\x3e`:"").join(""):super.innerHTML}set innerHTML(t){this.#$e.active?(this.#$e.clear(),super.innerHTML=t,this.#$e.pull(this)):super.innerHTML=t}}function en(t){return t.map(t=>"string"==typeof t?document.createTextNode(t):t)}customElements.get("tp-portal")||customElements.define("tp-portal",tn);class rn extends HTMLElement{static{this.observedAttributes=["name"]}#Ee=new Set;#Ae=null;get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get portals(){return[...this.#Ee]}connectedCallback(){Qr(),this.#Oe()}disconnectedCallback(){this.#_e()}attributeChangedCallback(){this.isConnected&&(this.#_e(),this.#Oe())}[Yr](t){this.#Ee.add(t),this.toggleAttribute("active",!0)}[Gr](t){this.#Ee.delete(t),this.toggleAttribute("active",this.#Ee.size>0)}#Oe(){const t=this.name;t&&(this.#Ae=t,Jr.addOutlet(t,this))}#_e(){if(null===this.#Ae)return;const t=this.#Ae;this.#Ae=null,Jr.removeOutlet(t,this)}}customElements.get("tp-portal-outlet")||customElements.define("tp-portal-outlet",rn);class nn extends HTMLElement{get shown(){const t=this.parentElement;return"tp-portal-outlet"===t?.localName&&!t.hasAttribute("active")}connectedCallback(){Qr()}}customElements.get("tp-portal-outlet-fallback")||customElements.define("tp-portal-outlet-fallback",nn);const sn=new Map,on=new Map;function an(t,e){const r=`${t??""}|${JSON.stringify(e)}`;let n=sn.get(r);return n||(n=new Intl.DateTimeFormat(t,e),sn.set(r,n)),n}function ln(t,e){return t.find(t=>t.type===e)?.value}const cn=new Map;function hn(t,e){let r=cn.get(t);return r||(r=e(),cn.set(t,r)),r}function dn(t,e){return hn(`month|${t}|${e}`,()=>{const r=an(t,{timeZone:"UTC",day:"numeric",month:e});return Array.from({length:12},(t,e)=>ln(r.formatToParts(Date.UTC(2e3,e,15)),"month")??"")})}function un(t,e){return hn(`weekday|${t}|${e}`,()=>{const r=an(t,{timeZone:"UTC",weekday:e});return Array.from({length:7},(t,e)=>r.format(Date.UTC(2e3,0,2+e)))})}function pn(t){return hn(`period|${t}`,()=>{const e=an(t,{timeZone:"UTC",hour:"numeric",hourCycle:"h12"}),r=(t,r)=>ln(e.formatToParts(Date.UTC(2e3,0,1,t)),"dayPeriod")??r;return[r(9,"AM"),r(21,"PM")]})}const mn=["YYYY","MMMM","dddd","MMM","ddd","SSS","YY","MM","DD","HH","hh","mm","ss","ZZ","M","D","d","H","h","m","s","A","a","Z","X","x"],gn=new Map;function fn(t){let e=gn.get(t);if(e)return e;e=[];let r="",n=0;const s=()=>{r&&e.push({literal:r}),r=""};for(;n<t.length;){if("["===t[n]){const e=t.indexOf("]",n+1);if(-1!==e){r+=t.slice(n+1,e),n=e+1;continue}}const o=mn.find(e=>t.startsWith(e,n));o?(s(),e.push({token:o}),n+=o.length):r+=t[n++]}return s(),gn.set(t,e),e}const vn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function yn(t,e){if(!e)return{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds(),weekday:t.getDay()};const r=an("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}).formatToParts(t),n=t=>Number(ln(r,t)),s=n("year");return{year:"BC"===ln(r,"era")?1-s:s,month:n("month"),day:n("day"),hour:n("hour"),minute:n("minute"),second:n("second"),millisecond:t.getUTCMilliseconds(),weekday:vn.indexOf(ln(r,"weekday")??"")}}function bn(t){const e=new Date(0);return e.setUTCFullYear(t.year,t.month-1,t.day),e.setUTCHours(t.hour,t.minute,t.second,t.millisecond),e.getTime()}function En(t,e){return e?Math.round((bn(yn(t,e))-t.getTime())/6e4):-t.getTimezoneOffset()}function Sn(t,e=":"){const r=t<0?"-":"+",n=Math.abs(t);return`${r}${wn(Math.floor(n/60))}${e}${wn(n%60)}`}function wn(t,e=2){return String(Math.abs(t)).padStart(e,"0")}const Cn=t=>t%12||12,kn={YYYY:({fields:t})=>(t.year<0?"-":"")+wn(t.year,4),YY:({fields:t})=>wn(t.year%100),MMMM:({fields:t,locale:e})=>dn(e,"long")[t.month-1],MMM:({fields:t,locale:e})=>dn(e,"short")[t.month-1],MM:({fields:t})=>wn(t.month),M:({fields:t})=>String(t.month),DD:({fields:t})=>wn(t.day),D:({fields:t})=>String(t.day),dddd:({fields:t,locale:e})=>un(e,"long")[t.weekday],ddd:({fields:t,locale:e})=>un(e,"short")[t.weekday],d:({fields:t})=>String(t.weekday),HH:({fields:t})=>wn(t.hour),H:({fields:t})=>String(t.hour),hh:({fields:t})=>wn(Cn(t.hour)),h:({fields:t})=>String(Cn(t.hour)),mm:({fields:t})=>wn(t.minute),m:({fields:t})=>String(t.minute),ss:({fields:t})=>wn(t.second),s:({fields:t})=>String(t.second),SSS:({fields:t})=>wn(t.millisecond,3),A:({fields:t,locale:e})=>pn(e)[t.hour<12?0:1],a:({fields:t,locale:e})=>pn(e)[t.hour<12?0:1].toLocaleLowerCase(e),ZZ:({date:t,timeZone:e})=>Sn(En(t,e),""),Z:({date:t,timeZone:e})=>Sn(En(t,e)),X:({date:t})=>String(Math.floor(t.getTime()/1e3)),x:({date:t})=>String(t.getTime())};function $n(t,e,r,n){const s={date:t,fields:yn(t,n),locale:r,timeZone:n};return fn(e).map(t=>"token"in t?kn[t.token](s):t.literal).join("")}const An=1e3,On=6e4,_n=36e5,xn=24*_n,Tn=[["year",365*xn],["month",30*xn],["week",7*xn],["day",xn],["hour",_n],["minute",On]];function Dn(t,e,r){const n=t.getTime()-e,s=Math.abs(n),[o,i]=Tn.find(([,t])=>s>=t)??["second",An];return function(t){const e=t??"";let r=on.get(e);return r||(r=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),on.set(e,r)),r}(r).format(Math.trunc(n/i)||0,o)}const Nn=["short","medium","long","full"];function Rn(t,e,r){const n=t.trim();if("relative"===n)return{kind:"relative"};if(n&&!Nn.includes(n))return{kind:"pattern",pattern:t};const s=n||"medium",o=Mn(e,s),i=Mn(r,s);return o||i?{kind:"preset",dateStyle:o,timeStyle:i}:{kind:"preset",dateStyle:s}}function Mn(t,e){if("none"!==t)return t&&Nn.includes(t)?t:e}function Pn(t,e,{locale:r,timeZone:n,now:s}){switch(e.kind){case"relative":return Dn(t,s,r);case"pattern":return $n(t,e.pattern,r,n);case"preset":return an(r,{dateStyle:e.dateStyle,timeStyle:e.timeStyle,timeZone:n}).format(t)}}function Ln(t,e){return jn(e)??jn(function(t){let e=t;for(;e;){if(e instanceof Element){const t=e.closest("[lang]")?.getAttribute("lang");if(t)return t}const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:null}return""}(t))}function jn(t){if(t?.trim())try{return Intl.getCanonicalLocales(t.trim())[0]}catch{return}}function In(t,{timeZone:e,now:r}){if(void 0!==t.timestamp)return Number.isFinite(t.timestamp)?new Date(t.timestamp):void 0;const n=yn(new Date(r),e),s=void 0!==t.year||void 0!==t.month||void 0!==t.day,o={year:t.year??n.year,month:t.month??(s?1:n.month),day:t.day??(s?1:n.day),hour:t.hour??0,minute:t.minute??0,second:t.second??0,millisecond:t.millisecond??0};if(void 0!==t.pm){if(o.hour<1||o.hour>12)return;o.hour=o.hour%12+(t.pm?12:0)}return function(t){return Object.values(t).every(Number.isInteger)&&t.month>=1&&t.month<=12&&t.day>=1&&t.day<=(e=t.year,r=t.month,new Date(bn({year:e,month:r+1,day:0,hour:0,minute:0,second:0,millisecond:0})).getUTCDate())&&t.hour>=0&&t.hour<=23&&t.minute>=0&&t.minute<=59&&t.second>=0&&t.second<=59&&t.millisecond>=0&&t.millisecond<=999;var e,r}(o)?void 0!==t.offset?new Date(bn(o)-6e4*t.offset):function(t,e){if(!e){const e=new Date(0);return e.setFullYear(t.year,t.month-1,t.day),e.setHours(t.hour,t.minute,t.second,t.millisecond),e}const r=bn(t),n=En(new Date(r),e),s=r-6e4*n,o=En(new Date(s),e);return new Date(o===n?s:r-6e4*o)}(o,e):void 0}function Un(t){const e=Number(t);return t.length>2?e:e+(e<=68?2e3:1900)}function Hn(t){return Number(t.slice(0,3).padEnd(3,"0"))}function Vn(t){if(/^z$/i.test(t))return 0;const e=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!e)return;const r=60*Number(e[2])+Number(e[3]??0);return"-"===e[1]?-r:r}const Wn=/^([+-]\d{6}|\d{4})-(\d{2})(?:-(\d{2}))?(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?\s*(Z|[+-]\d{2}(?::?\d{2})?)?)?$/i,zn=/^-?\d+$/;const Bn=/^(\d{1,4})\s*[./-]\s*(\d{1,4})\s*[./-]\s*(\d{1,4})(?:(?:\s+|\s*[T,]\s*)(\d{1,2})[:.](\d{2})(?:[:.](\d{2}))?\s*(am|pm)?)?$/i,Zn=new Map;function qn(t,e){const r=Bn.exec(t),n=function(t){const e=t??"";let r=Zn.get(e);return r||(r=an(t,{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(Date.UTC(2e3,0,2)).map(t=>t.type).filter(t=>"year"===t||"month"===t||"day"===t),Zn.set(e,r)),r}(e);if(!r||3!==n.length)return;const[,s,o,i,a,l,c,h]=r,d={};return[s,o,i].forEach((t,e)=>{const r=n[e];d[r]="year"===r?Un(t):Number(t)}),void 0!==a&&(d.hour=Number(a),d.minute=Number(l),d.second=void 0===c?0:Number(c),h&&(d.pm="pm"===h.toLowerCase())),d}const Fn=(t,e)=>({source:()=>t,apply:(t,r)=>{t[e]=Number(r)}}),Yn=(t,e)=>({source:e=>ts(t(e)),apply:(r,n,s)=>{if(!e)return!0;const o=function(t,e,r){const n=e.toLocaleLowerCase(r);return t.findIndex(t=>t.toLocaleLowerCase(r)===n)}(t(s),n,s);return-1!==o&&(r[e]=o+1,!0)}}),Gn={source:t=>ts([...pn(t),"am","pm"]),apply:(t,e,r)=>{const[n,s]=pn(r).map(t=>t.toLocaleLowerCase(r)),o=e.toLocaleLowerCase(r);t.pm=o===s||"pm"===o||o!==n&&"am"!==o&&void 0}},Jn={source:()=>"Z|[+-]\\d{2}:?\\d{2}",apply:(t,e)=>{t.offset=Vn(e.toUpperCase())}},Kn={YYYY:{source:()=>"[+-]?\\d{4,6}",apply:(t,e)=>{t.year=Number(e)}},YY:{source:()=>"\\d{2}",apply:(t,e)=>{t.year=Un(e)}},MMMM:Yn(t=>dn(t,"long"),"month"),MMM:Yn(t=>dn(t,"short"),"month"),MM:Fn("\\d{1,2}","month"),M:Fn("\\d{1,2}","month"),DD:Fn("\\d{1,2}","day"),D:Fn("\\d{1,2}","day"),dddd:Yn(t=>un(t,"long")),ddd:Yn(t=>un(t,"short")),d:{source:()=>"[0-6]",apply:()=>{}},HH:Fn("\\d{1,2}","hour"),H:Fn("\\d{1,2}","hour"),hh:Fn("\\d{1,2}","hour"),h:Fn("\\d{1,2}","hour"),mm:Fn("\\d{1,2}","minute"),m:Fn("\\d{1,2}","minute"),ss:Fn("\\d{1,2}","second"),s:Fn("\\d{1,2}","second"),SSS:{source:()=>"\\d{1,9}",apply:(t,e)=>{t.millisecond=Hn(e)}},A:Gn,a:Gn,ZZ:Jn,Z:Jn,X:{source:()=>"-?\\d+(?:\\.\\d+)?",apply:(t,e)=>{t.timestamp=Math.round(1e3*Number(e))}},x:{source:()=>"-?\\d+",apply:(t,e)=>{t.timestamp=Number(e)}}},Xn=new Map;function Qn(t,e,r){const{regex:n,tokens:s}=function(t,e){const r=`${e??""}|${t}`;let n=Xn.get(r);if(!n){const s=[],o=fn(t).map(t=>"literal"in t?es(t.literal).replace(/\s+/g,"\\s+"):(s.push(t.token),`(${Kn[t.token].source(e)})`)).join("");n={regex:new RegExp(`^${o}$`,"iu"),tokens:s},Xn.set(r,n)}return n}(e,r),o=n.exec(t);if(!o)return;const i={};for(const[t,e]of s.entries())if(!1===Kn[e].apply(i,o[t+1],r))return;return void 0===i.pm||s.some(t=>"h"===t||"hh"===t)||(i.pm=void 0),i}function ts(t){return[...new Set(t.filter(Boolean))].sort((t,e)=>e.length-t.length).map(es).join("|")}function es(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rs(t,e){if(t instanceof Date)return ns(new Date(t.getTime()));if("number"==typeof t)return ns(new Date(t));const r=t?.trim();if(!r)return;const n=e.inputFormat?.trim()?Qn(r,e.inputFormat,e.locale):function(t){if(zn.test(t)&&t.replace("-","").length>4)return{timestamp:Number(t)};const e=Wn.exec(t);if(!e)return;const[,r,n,s,o,i,a,l,c]=e,h={year:Un(r),month:Number(n),day:void 0===s?1:Number(s)};return void 0!==o&&(h.hour=Number(o),h.minute=Number(i),h.second=void 0===a?0:Number(a),h.millisecond=void 0===l?0:Hn(l)),void 0===c||(h.offset=Vn(c.toUpperCase()),void 0!==h.offset)?h:void 0}(r)??qn(r,e.locale);return ns(n&&In(n,e))}function ns(t){return t&&!Number.isNaN(t.getTime())?t:void 0}const ss=6e4,os={millisecond:50,second:1e3,minute:ss,hour:9e5,day:9e5},is={SSS:"millisecond",x:"millisecond",ss:"second",s:"second",X:"second",mm:"minute",m:"minute",HH:"hour",H:"hour",hh:"hour",h:"hour",A:"hour",a:"hour",ZZ:"hour",Z:"hour"},as={short:"minute",medium:"second",long:"second",full:"second"};function ls(t,e,r){switch(t.kind){case"relative":return function(t,e){const r=Math.abs(t.getTime()-e);return r<_n?An:r<xn?On:9e5}(e,r);case"preset":return os[t.timeStyle?as[t.timeStyle]:"day"];case"pattern":return Math.min(os.day,...fn(t.pattern).map(t=>"token"in t?os[is[t.token]??"day"]:os.day))}}const cs=l`
|
|
485
485
|
:host {
|
|
486
486
|
display: inline;
|
|
487
487
|
}
|
|
@@ -494,10 +494,10 @@ function Ar({context:t,subscribe:e}){return(r,n)=>{"object"==typeof n?n.addIniti
|
|
|
494
494
|
time {
|
|
495
495
|
font-variant-numeric: var(--tp-date-numeric, tabular-nums);
|
|
496
496
|
}
|
|
497
|
-
`,hs=new Map;let ds=!1;function us(t,e){let r=hs.get(t);return r||(r={listeners:new Set},hs.set(t,r)),r.listeners.add(e),function(){if(ds||"undefined"==typeof document)return;ds=!0,document.addEventListener("visibilitychange",()=>{for(const[t,e]of[...hs])gs()?(clearTimeout(e.timer),e.timer=void 0):(ms(e),hs.get(t)===e&&ps(t,e))})}(),ps(t,r),()=>{r.listeners.delete(e),0===r.listeners.size&&(clearTimeout(r.timer),hs.delete(t))}}function ps(t,e){void 0!==e.timer||gs()||(e.timer=setTimeout(()=>{e.timer=void 0,ms(e),hs.get(t)===e&&ps(t,e)},t-Date.now()%t))}function ms(t){for(const e of[...t.listeners])e()}function gs(){return"undefined"!=typeof document&&"hidden"===document.visibilityState}const fs=["value","datetime","text","inputFormat","locale","timeZone"];class vs extends lt{constructor(){super(...arguments),this.format="",this.inputFormat="",this.datetime="",this.locale="",this.timeZone="",this.live=!1,this.interval=0,this.invalid=!1,this.text="",this.#De=Date.now(),this.#Ne=0}static{this.styles=cs}#Re;#De;#Gt;#Me;#Ne;#Pe;#Le;get date(){return new Date(this.#Re?.getTime()??this.#De)}connectedCallback(){super.connectedCallback(),this.#Gt??=new MutationObserver(()=>this.#je()),this.#Gt.observe(this,{childList:!0,characterData:!0,subtree:!0}),this.#je(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.#Gt?.disconnect(),this.#Ie(0)}willUpdate(t){this.#De=Date.now(),fs.some(e=>t.has(e))&&this.#Ue()}render(){const t=this.#He(),e=this.date,r=this.#Ve(),n=this.#
|
|
497
|
+
`,hs=new Map;let ds=!1;function us(t,e){let r=hs.get(t);return r||(r={listeners:new Set},hs.set(t,r)),r.listeners.add(e),function(){if(ds||"undefined"==typeof document)return;ds=!0,document.addEventListener("visibilitychange",()=>{for(const[t,e]of[...hs])gs()?(clearTimeout(e.timer),e.timer=void 0):(ms(e),hs.get(t)===e&&ps(t,e))})}(),ps(t,r),()=>{r.listeners.delete(e),0===r.listeners.size&&(clearTimeout(r.timer),hs.delete(t))}}function ps(t,e){void 0!==e.timer||gs()||(e.timer=setTimeout(()=>{e.timer=void 0,ms(e),hs.get(t)===e&&ps(t,e)},t-Date.now()%t))}function ms(t){for(const e of[...t.listeners])e()}function gs(){return"undefined"!=typeof document&&"hidden"===document.visibilityState}const fs=["value","datetime","text","inputFormat","locale","timeZone"];class vs extends lt{constructor(){super(...arguments),this.format="",this.inputFormat="",this.datetime="",this.locale="",this.timeZone="",this.live=!1,this.interval=0,this.invalid=!1,this.text="",this.#De=Date.now(),this.#Ne=0}static{this.styles=cs}#Re;#De;#Gt;#Me;#Ne;#Pe;#Le;get date(){return new Date(this.#Re?.getTime()??this.#De)}connectedCallback(){super.connectedCallback(),this.#Gt??=new MutationObserver(()=>this.#je()),this.#Gt.observe(this,{childList:!0,characterData:!0,subtree:!0}),this.#je(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.#Gt?.disconnect(),this.#Ie(0)}willUpdate(t){this.#De=Date.now(),fs.some(e=>t.has(e))&&this.#Ue()}render(){const t=this.#He(),e=this.date,r=this.#Ve(),n=this.#We();return B`<time
|
|
498
498
|
part="time"
|
|
499
499
|
datetime=${e.toISOString()}
|
|
500
500
|
title=${"relative"===t.kind?function(t,e,r){return an(e,{dateStyle:"full",timeStyle:"long",timeZone:r}).format(t)}(e,r,n):q}
|
|
501
501
|
>${Pn(e,t,{locale:r,timeZone:n,now:this.#De})}</time
|
|
502
|
-
>`}updated(){if(this.#
|
|
502
|
+
>`}updated(){if(this.#ze(),void 0!==this.#Pe){const t=this.#Pe;this.#Pe=void 0,this.dispatchEvent(new CustomEvent("tp-date-invalid",{bubbles:!0,composed:!0,detail:{input:t}}))}}#Ue(){const t=this.value??(this.datetime.trim()||this.text),e=rs(t,{inputFormat:this.inputFormat,locale:this.#Ve(),timeZone:this.#We(),now:this.#De}),r=null==t||"string"==typeof t&&!t.trim(),n=!e&&!r,s=String(t);n&&s!==this.#Le&&(this.#Pe=s),this.#Le=n?s:void 0,this.#Re=e,this.invalid=n}#He(){return Rn(this.format,this.dateStyle,this.timeStyle)}#Ve(){return Ln(this,this.locale)}#We(){const t=this.timeZone.trim();return t&&function(t){try{return an(void 0,{timeZone:t}),!0}catch{return!1}}(t)?t:void 0}#ze(){const t=this.#He(),e=this.live||!this.#Re||"relative"===t.kind;if(!this.isConnected||!e)return this.#Ie(0);const r=Number(this.interval);this.#Ie(r>0?Math.max(r,16):ls(t,this.date,this.#De))}#Ie(t){t!==this.#Ne&&(this.#Me?.(),this.#Me=void 0,this.#Ne=t,t&&(this.#Me=us(t,()=>this.requestUpdate())))}#je(){this.text=(this.textContent??"").trim()}}return e([pt(),r("design:type",Object)],vs.prototype,"format",void 0),e([pt({attribute:"date-style"}),r("design:type",String)],vs.prototype,"dateStyle",void 0),e([pt({attribute:"time-style"}),r("design:type",String)],vs.prototype,"timeStyle",void 0),e([pt({attribute:"input-format"}),r("design:type",Object)],vs.prototype,"inputFormat",void 0),e([pt(),r("design:type",Object)],vs.prototype,"datetime",void 0),e([pt(),r("design:type",Object)],vs.prototype,"locale",void 0),e([pt({attribute:"time-zone"}),r("design:type",Object)],vs.prototype,"timeZone",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],vs.prototype,"live",void 0),e([pt({type:Number}),r("design:type",Object)],vs.prototype,"interval",void 0),e([pt({attribute:!1}),r("design:type",Object)],vs.prototype,"value",void 0),e([pt({type:Boolean,reflect:!0}),r("design:type",Object)],vs.prototype,"invalid",void 0),e([mt(),r("design:type",Object)],vs.prototype,"text",void 0),customElements.get("tp-date")||customElements.define("tp-date",vs),t.DateElement=vs,t.DragDropEvent=hr,t.PortalElement=tn,t.PortalOutletElement=rn,t.PortalOutletFallbackElement=nn,t.ROUTE_ERROR_EVENT=ge,t.ROUTE_LOAD_EVENT=me,t.SelectChangeEvent=Ir,t.defaultRouteSourceLoader=ye,t.formatDate=Pn,t.formatPattern=$n,t.formatRelative=Dn,t.parseDate=rs,t.resolveFormat=Rn,t}({});
|
|
503
503
|
//# sourceMappingURL=elements.js.map
|
package/iife/router/index.js
CHANGED
|
@@ -140,7 +140,7 @@ Bt.State,Bt.Computed;const ue=(t,e)=>new Bt.State(t,e),de=(t,e)=>new Bt.Computed
|
|
|
140
140
|
--tp-color-success: hsl(140 70% 40%);
|
|
141
141
|
--tp-color-danger: hsl(0 70% 50%);
|
|
142
142
|
--tp-color-warning: hsl(45 100% 50%);
|
|
143
|
-
--tp-color-neutral: color-mix(in
|
|
143
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
`;var e;return document.adoptedStyleSheets=(e=[...document.adoptedStyleSheets,t.styleSheet],[...new Set(e)]),t})()}static{this.shadedElementStyles=l`
|
|
@@ -155,7 +155,7 @@ Bt.State,Bt.Computed;const ue=(t,e)=>new Bt.State(t,e),de=(t,e)=>new Bt.Computed
|
|
|
155
155
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
156
156
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
157
157
|
);
|
|
158
|
-
--tp-calc-element-color: color-mix(in
|
|
158
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
159
159
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
160
160
|
--tp-contrast-color: if(
|
|
161
161
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|
package/iife/select/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function f(t,e){return Object.is(t,e)}
|
|
|
48
48
|
*
|
|
49
49
|
* Use of this source code is governed by an MIT-style license that can be
|
|
50
50
|
* found in the LICENSE file at https://angular.io/license
|
|
51
|
-
*/function
|
|
51
|
+
*/function k(t){if(w(t),$(t),t.value===I)throw t.error;return t.value}const T=Symbol("UNSET"),P=Symbol("COMPUTING"),I=Symbol("ERRORED"),R=(()=>({...S,value:T,dirty:!0,error:null,equal:f,producerMustRecompute:t=>t.value===T||t.value===P,producerRecomputeValue(t){if(t.value===P)throw new Error("Detected cycle in computations.");const e=t.value;t.value=P;const s=function(t){return t&&(t.nextProducerIndex=0),b(t)}(t);let o,r=!1;try{o=t.computation.call(t.wrapper);r=e!==T&&e!==I&&t.equal.call(t.wrapper,e,o)}catch(e){o=I,t.error=e}finally{!function(t,e){if(b(e),t&&void 0!==t.producerNode&&void 0!==t.producerIndexOfThis&&void 0!==t.producerLastReadVersion){if(x(t))for(let e=t.nextProducerIndex;e<t.producerNode.length;e++)C(t.producerNode[e],t.producerIndexOfThis[e]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}(t,s)}r?t.value=e:(t.value=o,t.version++)}}))();let M=
|
|
52
52
|
/**
|
|
53
53
|
* @license
|
|
54
54
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -80,13 +80,13 @@ function(){throw new Error};function L(){return $(this),this.value}function U(t,
|
|
|
80
80
|
* Use of this source code is governed by an MIT-style license that can be
|
|
81
81
|
* found in the LICENSE file at https://angular.io/license
|
|
82
82
|
*/
|
|
83
|
-
function(t){const e=Object.create(j);e.value=t;const s=()=>($(e),e.value);return s[y]=e,s}(o),n=i[y];if(this[V]=n,n.wrapper=this,r){const e=r.equals;e&&(n.equal=e),n.watched=r[t.subtle.watched],n.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return L.call(this[V])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(v)throw new Error("Writes to signals not permitted during Watcher callback");U(this[V],e)}};o=V,r=new WeakSet,t.isComputed=t=>"object"==typeof t&&d(r,t),t.Computed=class{constructor(e,s){p(this,r),h(this,o);const i=function(t){const e=Object.create(R);e.computation=t;const s=()=>
|
|
83
|
+
function(t){const e=Object.create(j);e.value=t;const s=()=>($(e),e.value);return s[y]=e,s}(o),n=i[y];if(this[V]=n,n.wrapper=this,r){const e=r.equals;e&&(n.equal=e),n.watched=r[t.subtle.watched],n.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return L.call(this[V])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(v)throw new Error("Writes to signals not permitted during Watcher callback");U(this[V],e)}};o=V,r=new WeakSet,t.isComputed=t=>"object"==typeof t&&d(r,t),t.Computed=class{constructor(e,s){p(this,r),h(this,o);const i=function(t){const e=Object.create(R);e.computation=t;const s=()=>k(e);return s[y]=e,s}(e),n=i[y];if(n.consumerAllowSignalWrites=!0,this[V]=n,n.wrapper=this,s){const e=s.equals;e&&(n.equal=e),n.watched=s[t.subtle.watched],n.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return k(this[V])}},(e=>{var s,o,r,i;e.untrack=function(t){let e,s=null;try{s=b(null),e=t()}finally{b(s)}return e},e.introspectSources=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(s=e[V].producerNode)?void 0:s.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(s=e[V].liveConsumerNode)?void 0:s.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const s=e[V].liveConsumerNode;return!!s&&s.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const s=e[V].producerNode;return!!s&&s.length>0};s=V,o=new WeakSet,r=new WeakSet,i=function(e){for(const s of e)if(!(0,t.isComputed)(s)&&!(0,t.isState)(s))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>d(o,t),e.Watcher=class{constructor(t){p(this,o),p(this,r),h(this,s);let e=Object.create(S);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[V]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");u(this,r,i).call(this,e);const s=this[V];s.dirty=!1;const o=b(s);for(const t of e)$(t[V]);b(o)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");u(this,r,i).call(this,e);const s=this[V];O(s);for(let t=s.producerNode.length-1;t>=0;t--)if(e.includes(s.producerNode[t].wrapper)){C(s.producerNode[t],s.producerIndexOfThis[t]);const e=s.producerNode.length-1;if(s.producerNode[t]=s.producerNode[e],s.producerIndexOfThis[t]=s.producerIndexOfThis[e],s.producerNode.length--,s.producerIndexOfThis.length--,s.nextProducerIndex--,t<s.producerNode.length){const e=s.producerIndexOfThis[t],o=s.producerNode[t];N(o),o.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[V].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=m)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(D||(D={}));
|
|
84
84
|
/**
|
|
85
85
|
* @license
|
|
86
86
|
* Copyright 2023 Google LLC
|
|
87
87
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
88
|
*/
|
|
89
|
-
let H=!1;const W=new D.subtle.Watcher(()=>{H||(H=!0,queueMicrotask(()=>{H=!1;for(const t of W.getPending())t.get();W.watch()}))}),q=Symbol("SignalWatcherBrand"),B=new FinalizationRegistry(t=>{t.unwatch(...D.subtle.introspectSources(t))}),
|
|
89
|
+
let H=!1;const W=new D.subtle.Watcher(()=>{H||(H=!0,queueMicrotask(()=>{H=!1;for(const t of W.getPending())t.get();W.watch()}))}),q=Symbol("SignalWatcherBrand"),B=new FinalizationRegistry(t=>{t.unwatch(...D.subtle.introspectSources(t))}),F=new WeakMap;function z(t){return!0===t[q]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new D.State(0),this._$Si=!1}_$Sl(){var t,e;const s=[],o=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?s:o).push(e)});const r=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));s.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),r.forEach(t=>t.get()),o.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new D.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new D.subtle.Watcher(function(){const t=F.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});F.set(t,this),B.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...D.subtle.introspectSources(this.h).filter(e=>{var s;const o=!0!==(null===(s=this._$St.get(e))||void 0===s?void 0:s.manualDispose);return o&&this._$St.delete(e),t||(t=!o),o})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var s;this._$S_();const o=new D.Computed(()=>{t()});return this.h.watch(o),this._$St.set(o,e),null!==(s=null==e?void 0:e.beforeUpdate)&&void 0!==s&&s?D.subtle.untrack(()=>o.get()):this.updateComplete.then(()=>D.subtle.untrack(()=>o.get())),()=>{this._$St.delete(o),this.h.unwatch(o),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}
|
|
90
90
|
/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
@@ -97,22 +97,22 @@ let H=!1;const W=new D.subtle.Watcher(()=>{H||(H=!0,queueMicrotask(()=>{H=!1;for
|
|
|
97
97
|
* Copyright 2023 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
99
|
*/
|
|
100
|
-
let Nt=!1;const
|
|
100
|
+
let Nt=!1;const kt=new D.subtle.Watcher(async()=>{Nt||(Nt=!0,queueMicrotask(()=>{Nt=!1;for(const t of kt.getPending())t.get();kt.watch()}))});
|
|
101
101
|
/**
|
|
102
102
|
* @license
|
|
103
103
|
* Copyright 2023 Google LLC
|
|
104
104
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
105
|
-
*/D.State,D.Computed;const
|
|
105
|
+
*/D.State,D.Computed;const Tt=(t,e)=>new D.State(t,e),Pt=globalThis,It=Pt.ShadowRoot&&(void 0===Pt.ShadyCSS||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),Mt=new WeakMap;
|
|
106
106
|
/**
|
|
107
107
|
* @license
|
|
108
108
|
* Copyright 2019 Google LLC
|
|
109
109
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
110
|
-
*/let Lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(It&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=Mt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}};const Ut=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,o)=>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[o+1],t[0]);return new Lt(s,t,Rt)},jt=It?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new Lt("string"==typeof t?t:t+"",void 0,Rt))(e)})(t):t,{is:Vt,defineProperty:Dt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Wt,getOwnPropertySymbols:qt,getPrototypeOf:Bt}=Object,
|
|
110
|
+
*/let Lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(It&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=Mt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}};const Ut=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,o)=>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[o+1],t[0]);return new Lt(s,t,Rt)},jt=It?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new Lt("string"==typeof t?t:t+"",void 0,Rt))(e)})(t):t,{is:Vt,defineProperty:Dt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Wt,getOwnPropertySymbols:qt,getPrototypeOf:Bt}=Object,Ft=globalThis,zt=Ft.trustedTypes,Yt=zt?zt.emptyScript:"",Gt=Ft.reactiveElementPolyfillSupport,Jt=(t,e)=>t,Kt={toAttribute(t,e){switch(e){case Boolean:t=t?Yt: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}},Zt=(t,e)=>!Vt(t,e),Xt={attribute:!0,type:String,converter:Kt,reflect:!1,useDefault:!1,hasChanged:Zt};
|
|
111
111
|
/**
|
|
112
112
|
* @license
|
|
113
113
|
* Copyright 2017 Google LLC
|
|
114
114
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
115
|
-
*/Symbol.metadata??=Symbol("metadata"),
|
|
115
|
+
*/Symbol.metadata??=Symbol("metadata"),Ft.litPropertyMetadata??=new WeakMap;class Qt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Xt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),o=this.getPropertyDescriptor(t,s,e);void 0!==o&&Dt(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){const{get:o,set:r}=Ht(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const i=o?.call(this);r?.call(this,e),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Xt}static _$Ei(){if(this.hasOwnProperty(Jt("elementProperties")))return;const t=Bt(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jt("properties"))){const t=this.properties,e=[...Wt(t),...qt(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}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(jt(t))}else void 0!==t&&e.push(jt(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(It)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),o=Pt.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(void 0!==o&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:Kt).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,o=s._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Kt;this._$Em=o;const i=r.fromAttribute(e,t.type);this[o]=i??this._$Ej?.get(o)??i,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const o=this.constructor,r=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Zt)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:o,wrapped:r},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==r||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,s,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}Qt.elementStyles=[],Qt.shadowRootOptions={mode:"open"},Qt[Jt("elementProperties")]=new Map,Qt[Jt("finalized")]=new Map,Gt?.({ReactiveElement:Qt}),(Ft.reactiveElementVersions??=[]).push("2.1.1");
|
|
116
116
|
/**
|
|
117
117
|
* @license
|
|
118
118
|
* Copyright 2017 Google LLC
|
|
@@ -147,7 +147,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
147
147
|
--tp-color-success: hsl(140 70% 40%);
|
|
148
148
|
--tp-color-danger: hsl(0 70% 50%);
|
|
149
149
|
--tp-color-warning: hsl(45 100% 50%);
|
|
150
|
-
--tp-color-neutral: color-mix(in
|
|
150
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
`;var e;return document.adoptedStyleSheets=(e=[...document.adoptedStyleSheets,t.styleSheet],[...new Set(e)]),t})()}static{this.shadedElementStyles=Ut`
|
|
@@ -162,7 +162,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
162
162
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
163
163
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
164
164
|
);
|
|
165
|
-
--tp-calc-element-color: color-mix(in
|
|
165
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
166
166
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
167
167
|
--tp-contrast-color: if(
|
|
168
168
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|
|
@@ -178,7 +178,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
178
178
|
&[color="danger"] { --tp-element-color: var(--tp-color-danger); }
|
|
179
179
|
&[color="warning"] { --tp-element-color: var(--tp-color-warning); }
|
|
180
180
|
&[color="neutral"] { --tp-element-color: var(--tp-color-neutral); }
|
|
181
|
-
`}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([ne({type:String,reflect:!0}),s("design:type",String)],me.prototype,"color",void 0),e([ne({type:Number,reflect:!0,converter(t,e){const s=Number(t);return isNaN(s)?500:function(t,e,s){return Math.max(Math.min(e,s),t)}(0,1e3,s)}}),s("design:type",Number)],me.prototype,"shade",void 0),e([ne({type:String,reflect:!0}),s("design:type",String)],me.prototype,"mixer",void 0);const ve=
|
|
181
|
+
`}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([ne({type:String,reflect:!0}),s("design:type",String)],me.prototype,"color",void 0),e([ne({type:Number,reflect:!0,converter(t,e){const s=Number(t);return isNaN(s)?500:function(t,e,s){return Math.max(Math.min(e,s),t)}(0,1e3,s)}}),s("design:type",Number)],me.prototype,"shade",void 0),e([ne({type:String,reflect:!0}),s("design:type",String)],me.prototype,"mixer",void 0);const ve=z(ee),ge=z(me),ye=Symbol("select:register-option"),be=Symbol("select:unregister-option"),Se=Symbol("option:should-register-to-select");var $e;t.SelectedContentElement=class extends ve{static{this.styles=(()=>{const t=Ut`
|
|
182
182
|
tp-selected-content {
|
|
183
183
|
display: inline-block;
|
|
184
184
|
|
|
@@ -199,7 +199,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
199
199
|
background: var(--tp-select-option-color, white);
|
|
200
200
|
|
|
201
201
|
&:hover {
|
|
202
|
-
background: color-mix(in
|
|
202
|
+
background: color-mix(in oklab, var(--tp-select-option-color, white) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
&[selected] {
|
|
@@ -207,11 +207,11 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
207
207
|
color: var(--tp-select-selection-contrast-color, white);
|
|
208
208
|
|
|
209
209
|
&:hover {
|
|
210
|
-
background: color-mix(in
|
|
210
|
+
background: color-mix(in oklab, var(--tp-select-selection-color, #0078d4) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}connectedCallback(){super.connectedCallback(),this[Se]&&this.select?.[ye](this)}disconnectedCallback(){super.disconnectedCallback(),this[Se]&&this.select?.[be](this)}willUpdate(t){if(!this[Se])return;const e=this.select?.selectedOptions.get().some(t=>t.deref()===this)??!1;this.toggleAttribute("selected",e)}createRenderRoot(){return this}render(){return pt``}},e([c({context:ue,subscribe:!0}),le(),s("design:type",Function)],t.OptionElement.prototype,"select",void 0),e([ne({type:String,reflect:!0}),s("design:type",Object)],t.OptionElement.prototype,"value",void 0),t.OptionElement=e([oe("tp-option")],t.OptionElement);class we extends Event{constructor(t,e){super("change",{bubbles:!0,composed:!1,cancelable:!1,...e}),this.value=t.value,this.selectedOptions=t.selectedOptions}}const Ee={};const _e={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},Ae=new Set(["start","center","end"]),Ce=new Set(["top","middle","bottom"]),xe={start:["end","start"],center:["center","center"],end:["start","end"]},Oe={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function Ne(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return Ae.has(t)?xe[t]:null}return 2===e.length&&Ae.has(e[0])&&Ae.has(e[1])?[e[0],e[1]]:null}function
|
|
214
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}connectedCallback(){super.connectedCallback(),this[Se]&&this.select?.[ye](this)}disconnectedCallback(){super.disconnectedCallback(),this[Se]&&this.select?.[be](this)}willUpdate(t){if(!this[Se])return;const e=this.select?.selectedOptions.get().some(t=>t.deref()===this)??!1;this.toggleAttribute("selected",e)}createRenderRoot(){return this}render(){return pt``}},e([c({context:ue,subscribe:!0}),le(),s("design:type",Function)],t.OptionElement.prototype,"select",void 0),e([ne({type:String,reflect:!0}),s("design:type",Object)],t.OptionElement.prototype,"value",void 0),t.OptionElement=e([oe("tp-option")],t.OptionElement);class we extends Event{constructor(t,e){super("change",{bubbles:!0,composed:!1,cancelable:!1,...e}),this.value=t.value,this.selectedOptions=t.selectedOptions}}const Ee={};const _e={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},Ae=new Set(["start","center","end"]),Ce=new Set(["top","middle","bottom"]),xe={start:["end","start"],center:["center","center"],end:["start","end"]},Oe={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function Ne(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return Ae.has(t)?xe[t]:null}return 2===e.length&&Ae.has(e[0])&&Ae.has(e[1])?[e[0],e[1]]:null}function ke(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return Ce.has(t)?Oe[t]:null}return 2===e.length&&Ce.has(e[0])&&Ce.has(e[1])?[e[0],e[1]]:null}let Te=class extends ee{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="click",this.#v=((t="tp-popover")in Ee||(Ee[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),Ee[t].next().value),this.#g=null,this.#y=!1,this.#b=[]}static{this.styles=(()=>{const t=Ut`
|
|
215
215
|
tp-popover {
|
|
216
216
|
--tp-popover-inline-position: attr(data-ti type(*));
|
|
217
217
|
--tp-popover-block-position: attr(data-tb type(*));
|
|
@@ -249,7 +249,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
249
249
|
inset-block-end: anchor(var(--tp-popover-block-position));
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#v;#g;get anchorElement(){return this.#g}get anchorName(){return`--${this.#v}`}#y;#b;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#S(),this.#$(),this.#w(),this.#E()}disconnectedCallback(){super.disconnectedCallback(),this.#_(),this.#A()}updated(t){t.has("mode")&&this.#S(),t.has("target")&&(this.#$(),this.#E()),t.has("position")&&this.#w(),t.has("trigger")&&this.#E()}render(){return pt``}#S(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#C(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const s=this.getRootNode();return s instanceof ShadowRoot&&s.host instanceof HTMLElement?s.host:null}#$(){const t=this.#C();t!==this.#g?(this.#A(),this.#g=t,t&&this.#x(t)):t&&this.#x(t)}#x(t){const e=`--${this.#v}`,s=t.style.getPropertyValue("anchor-name").trim();if(s&&s!==e)return this.style.setProperty("position-anchor",s),void(this.#y=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#y=!0}#A(){if(this.#g&&this.#y){const t=`--${this.#v}`;this.#g.style.getPropertyValue("anchor-name").trim()===t&&this.#g.style.removeProperty("anchor-name")}this.#g=null,this.#y=!1,this.style.removeProperty("position-anchor")}#w(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=Ne(e);if(t){const[e,s]=Oe.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:s}}const s=
|
|
252
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#v;#g;get anchorElement(){return this.#g}get anchorName(){return`--${this.#v}`}#y;#b;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#S(),this.#$(),this.#w(),this.#E()}disconnectedCallback(){super.disconnectedCallback(),this.#_(),this.#A()}updated(t){t.has("mode")&&this.#S(),t.has("target")&&(this.#$(),this.#E()),t.has("position")&&this.#w(),t.has("trigger")&&this.#E()}render(){return pt``}#S(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#C(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const s=this.getRootNode();return s instanceof ShadowRoot&&s.host instanceof HTMLElement?s.host:null}#$(){const t=this.#C();t!==this.#g?(this.#A(),this.#g=t,t&&this.#x(t)):t&&this.#x(t)}#x(t){const e=`--${this.#v}`,s=t.style.getPropertyValue("anchor-name").trim();if(s&&s!==e)return this.style.setProperty("position-anchor",s),void(this.#y=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#y=!0}#A(){if(this.#g&&this.#y){const t=`--${this.#v}`;this.#g.style.getPropertyValue("anchor-name").trim()===t&&this.#g.style.removeProperty("anchor-name")}this.#g=null,this.#y=!1,this.style.removeProperty("position-anchor")}#w(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=Ne(e);if(t){const[e,s]=Oe.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:s}}const s=ke(e);if(s){const[t,e]=xe.center;return{popInline:t,targetInline:e,popBlock:s[0],targetBlock:s[1]}}return null}const s=e.split("/");if(2!==s.length)return null;const o=Ne(s[0]),r=ke(s[1]);return o&&r?{popInline:o[0],targetInline:o[1],popBlock:r[0],targetBlock:r[1]}:null}(this.position);this.position&&!t&&console.warn(`<tp-popover>: invalid position "${this.position}"; using default.`),t??=_e,this.dataset.pi=t.popInline,this.dataset.ti=t.targetInline,this.dataset.pb=t.popBlock,this.dataset.tb=t.targetBlock}#_(){for(const t of this.#b)t();this.#b=[]}#E(){this.#_();const t=this.#g;if(t){if("click"===this.trigger){const e=t=>{if(!t.composedPath().includes(this))try{this.togglePopover()}catch{}};return t.addEventListener("click",e),void this.#b.push(()=>t.removeEventListener("click",e))}if("hover"===this.trigger){let e=null;const s=()=>{null!==e&&(clearTimeout(e),e=null)},o=()=>{s();try{this.showPopover()}catch{}},r=()=>{s(),e=setTimeout(()=>{try{this.hidePopover()}catch{}},120)};t.addEventListener("pointerenter",o),t.addEventListener("pointerleave",r),t.addEventListener("focusin",o),t.addEventListener("focusout",r),this.addEventListener("pointerenter",s),this.addEventListener("pointerleave",r),this.addEventListener("focusin",s),this.addEventListener("focusout",r),this.#b.push(()=>{s(),t.removeEventListener("pointerenter",o),t.removeEventListener("pointerleave",r),t.removeEventListener("focusin",o),t.removeEventListener("focusout",r),this.removeEventListener("pointerenter",s),this.removeEventListener("pointerleave",r),this.removeEventListener("focusin",s),this.removeEventListener("focusout",r)})}}}};var Pe;e([ne({reflect:!0}),s("design:type",String)],Te.prototype,"mode",void 0),e([ne({reflect:!0}),s("design:type",Object)],Te.prototype,"target",void 0),e([ne({reflect:!0}),s("design:type",Object)],Te.prototype,"position",void 0),e([ne({reflect:!0}),s("design:type",String)],Te.prototype,"trigger",void 0),Te=e([oe("tp-popover")],Te),t.SelectElement=class extends ge{static{Pe=this}static{this.formAssociated=!0}static{this.ALLOWED_OPTION_ELEMENTS=[t.OptionElement]}static{this.styles=(()=>{const t=Ut`
|
|
253
253
|
${me.shadedElementStyles}
|
|
254
254
|
--tp-select-option-color: white;
|
|
255
255
|
--tp-select-selection-color: var(--tp-calc-element-color);
|
|
@@ -301,7 +301,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
301
301
|
${t}
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,s.styleSheet],e})()}#O;get#N(){return this.shadowRoot?.querySelector("tp-popover")}#T;#
|
|
304
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,s.styleSheet],e})()}#O;get#N(){return this.shadowRoot?.querySelector("tp-popover")}#k;#T;#P;get value(){return this.#P.get()}set value(t){this.#k=t,pe(this.#T,this.#I,10,this)}#R;get placeholder(){return this.#R.get()}set placeholder(t){this.#M(this.#R,"placeholder",t)}#L;#U;#j;constructor(){super(),this.#O=new Set,this.self=this,this.selectedOptions=Tt([]),this.#k=null,this.#T=Symbol("tpselect:assignValueDebouncer"),this.#P=((t,e)=>new D.Computed(t,e))(()=>this.selectedOptions.get().map(t=>t.deref()?.value??"").filter(Boolean).join(",")),this.#R=Tt("Select an option"),this.max=1,this.min=0,this.name=null,this.disabled=!1,this.required=!1,this.open=!1,this.#U="",this.#j=null,this.#L=this.attachInternals()}get internals(){return this.#L}get form(){return this.#L.form}get validity(){return this.#L.validity}get validationMessage(){return this.#L.validationMessage}get willValidate(){return this.#L.willValidate}checkValidity(){return this.#L.checkValidity()}reportValidity(){return this.#L.reportValidity()}createRenderRoot(){const e=super.createRenderRoot();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,Te.styles.styleSheet,t.SelectedContentElement.styles.styleSheet,t.OptionElement.styles.styleSheet],e}connectedCallback(){super.connectedCallback(),this.#U=this.value}disconnectedCallback(){super.disconnectedCallback()}render(){return pt`
|
|
305
305
|
<div pseudo="button" part="button">
|
|
306
306
|
<slot name="button">
|
|
307
307
|
<tp-selected-content part="selected-content"></tp-selected-content>
|
|
@@ -320,7 +320,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
320
320
|
<slot></slot>
|
|
321
321
|
</slot>
|
|
322
322
|
</tp-popover>
|
|
323
|
-
`}updated(t){if(super.updated(t),t.has("max")&&Number.isFinite(this.max)){const t=this.selectedOptions.get();t.length>this.max&&this.selectedOptions.set(t.slice(t.length-this.max))}}willUpdate(t){this.#H(),this.#W()}formResetCallback(){this.value=this.#U}formDisabledCallback(t){this.disabled=t}formStateRestoreCallback(t){if(null!=t)if("string"!=typeof t){if(t instanceof FormData){const e=[];t.forEach(t=>{"string"==typeof t&&e.push(t)}),this.value=e.join(",")}}else this.value=t;else this.value=""}#H(){const t=""===this.value?[]:this.value.split(",");if(1===this.max)this.#L.setFormValue(t[0]??"");else{const e=new FormData,s=this.name??"";for(const o of t)e.append(s,o);this.#L.setFormValue(e)}this.required&&0===t.length?this.#L.setValidity({valueMissing:!0},"Please select an option."):this.#L.setValidity({})}#W(){const t=this.value;if(t===this.#j)return;const e=null===this.#j;if(this.#j=t,e)return;const s=this.selectedOptions.get().map(t=>t.deref()).filter(Boolean);this.dispatchEvent(new we({value:t,selectedOptions:s}))}selectOption(t){const e=this.selectedOptions.get();if(e.find(e=>e.deref()===t))return;const s=[...e,new WeakRef(t)],o=s.length>this.max?s.slice(s.length-this.max):s;this.selectedOptions.set(o)}deselectOption(t){const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&(e.length<=this.min||this.selectedOptions.set(e.filter(t=>t!==s)))}toggleOption(t){this.selectedOptions.get().find(e=>e.deref()===t)?this.deselectOption(t):this.selectOption(t)}togglePopover(){return this.#N.togglePopover()}hidePopover(){this.#N.hidePopover()}showPopover(){this.#N.showPopover()}[ye](t){this.#O.add(t),pe(this.#
|
|
323
|
+
`}updated(t){if(super.updated(t),t.has("max")&&Number.isFinite(this.max)){const t=this.selectedOptions.get();t.length>this.max&&this.selectedOptions.set(t.slice(t.length-this.max))}}willUpdate(t){this.#H(),this.#W()}formResetCallback(){this.value=this.#U}formDisabledCallback(t){this.disabled=t}formStateRestoreCallback(t){if(null!=t)if("string"!=typeof t){if(t instanceof FormData){const e=[];t.forEach(t=>{"string"==typeof t&&e.push(t)}),this.value=e.join(",")}}else this.value=t;else this.value=""}#H(){const t=""===this.value?[]:this.value.split(",");if(1===this.max)this.#L.setFormValue(t[0]??"");else{const e=new FormData,s=this.name??"";for(const o of t)e.append(s,o);this.#L.setFormValue(e)}this.required&&0===t.length?this.#L.setValidity({valueMissing:!0},"Please select an option."):this.#L.setValidity({})}#W(){const t=this.value;if(t===this.#j)return;const e=null===this.#j;if(this.#j=t,e)return;const s=this.selectedOptions.get().map(t=>t.deref()).filter(Boolean);this.dispatchEvent(new we({value:t,selectedOptions:s}))}selectOption(t){const e=this.selectedOptions.get();if(e.find(e=>e.deref()===t))return;const s=[...e,new WeakRef(t)],o=s.length>this.max?s.slice(s.length-this.max):s;this.selectedOptions.set(o)}deselectOption(t){const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&(e.length<=this.min||this.selectedOptions.set(e.filter(t=>t!==s)))}toggleOption(t){this.selectedOptions.get().find(e=>e.deref()===t)?this.deselectOption(t):this.selectOption(t)}togglePopover(){return this.#N.togglePopover()}hidePopover(){this.#N.hidePopover()}showPopover(){this.#N.showPopover()}[ye](t){this.#O.add(t),pe(this.#T,this.#I,10,this)}[be](t){this.#O.delete(t);const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&this.selectedOptions.set(e.filter(t=>t!==s))}#V(t){if(this.disabled)return;const e=function(t,e){const s=t.indexOf(e);return s<0?[]:t.slice(0,s)}(t.composedPath(),this).find(t=>Pe.ALLOWED_OPTION_ELEMENTS.some(e=>t instanceof e));if(!e)return;this.toggleOption(e);if(this.selectedOptions.get().length>=this.max){const t=this.shadowRoot?.querySelector("tp-popover");t?.hidePopover()}}#D(t){this.open="open"===t.newState}#M(t,e,s){const o=t.get();o!==s&&(t.set(s),this.requestUpdate(e,o))}#I(){const t=this.#k?.split(",").map(t=>t.trim())??[],e=Array.from(this.#O);this.selectedOptions.set(t.map(t=>e.find(e=>e.value===t)).filter(Boolean).map(t=>new WeakRef(t)))}},e([
|
|
324
324
|
/**
|
|
325
325
|
* @license
|
|
326
326
|
* Copyright 2017 Google LLC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telperion/elements",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "Framework-agnostic web components built with Lit: Material Symbols / Simple Icons / theSVG icons, declarative client-side router, drag-and-drop primitives, details accordion with FIFO open caps, a CSS-anchored popover, a form-associated selectbox with single/multi-select, a form-associated button, portals that render content into named outlets elsewhere in the document, a localized and optionally live date/time with moment-style formatting, and Shiki-powered syntax-highlighted code (inline or block) with lazily loaded languages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -24,7 +24,7 @@ exports.OptionElement = class OptionElement extends signalWatcherLitElement.Sign
|
|
|
24
24
|
background: var(--tp-select-option-color, white);
|
|
25
25
|
|
|
26
26
|
&:hover {
|
|
27
|
-
background: color-mix(in
|
|
27
|
+
background: color-mix(in oklab, var(--tp-select-option-color, white) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&[selected] {
|
|
@@ -32,7 +32,7 @@ exports.OptionElement = class OptionElement extends signalWatcherLitElement.Sign
|
|
|
32
32
|
color: var(--tp-select-selection-contrast-color, white);
|
|
33
33
|
|
|
34
34
|
&:hover {
|
|
35
|
-
background: color-mix(in
|
|
35
|
+
background: color-mix(in oklab, var(--tp-select-selection-color, #0078d4) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
package/select/option.element.js
CHANGED
|
@@ -22,7 +22,7 @@ let OptionElement = class OptionElement extends SignalWatcherLitElement {
|
|
|
22
22
|
background: var(--tp-select-option-color, white);
|
|
23
23
|
|
|
24
24
|
&:hover {
|
|
25
|
-
background: color-mix(in
|
|
25
|
+
background: color-mix(in oklab, var(--tp-select-option-color, white) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
&[selected] {
|
|
@@ -30,7 +30,7 @@ let OptionElement = class OptionElement extends SignalWatcherLitElement {
|
|
|
30
30
|
color: var(--tp-select-selection-contrast-color, white);
|
|
31
31
|
|
|
32
32
|
&:hover {
|
|
33
|
-
background: color-mix(in
|
|
33
|
+
background: color-mix(in oklab, var(--tp-select-selection-color, #0078d4) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -63,7 +63,7 @@ class ShadeMixerLitElement extends lit.LitElement {
|
|
|
63
63
|
--tp-color-success: hsl(140 70% 40%);
|
|
64
64
|
--tp-color-danger: hsl(0 70% 50%);
|
|
65
65
|
--tp-color-warning: hsl(45 100% 50%);
|
|
66
|
-
--tp-color-neutral: color-mix(in
|
|
66
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
`;
|
|
@@ -82,7 +82,7 @@ class ShadeMixerLitElement extends lit.LitElement {
|
|
|
82
82
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
83
83
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
84
84
|
);
|
|
85
|
-
--tp-calc-element-color: color-mix(in
|
|
85
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
86
86
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
87
87
|
--tp-contrast-color: if(
|
|
88
88
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|
|
@@ -61,7 +61,7 @@ class ShadeMixerLitElement extends LitElement {
|
|
|
61
61
|
--tp-color-success: hsl(140 70% 40%);
|
|
62
62
|
--tp-color-danger: hsl(0 70% 50%);
|
|
63
63
|
--tp-color-warning: hsl(45 100% 50%);
|
|
64
|
-
--tp-color-neutral: color-mix(in
|
|
64
|
+
--tp-color-neutral: color-mix(in oklab, var(--tp-color-white) 50%, var(--tp-color-black) 50%);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
`;
|
|
@@ -80,7 +80,7 @@ class ShadeMixerLitElement extends LitElement {
|
|
|
80
80
|
style(--tp-shade-mixer-type: black): calc(100% - ((var(--tp-shade-attr) - 500) / 500 * 100%));
|
|
81
81
|
else: calc(100% - ((500 - var(--tp-shade-attr)) / 500 * 100%))
|
|
82
82
|
);
|
|
83
|
-
--tp-calc-element-color: color-mix(in
|
|
83
|
+
--tp-calc-element-color: color-mix(in oklab, var(--tp-element-color) var(--tp-shade-mixer-percent), var(--tp-shade-mixer-color) calc(100% - var(--tp-shade-mixer-percent)));
|
|
84
84
|
--tp-calc-contrast-color: contrast-color(var(--tp-calc-element-color));
|
|
85
85
|
--tp-contrast-color: if(
|
|
86
86
|
style(--tp-calc-contrast-color: white): var(--tp-color-white);
|