@joist/element 3.0.0-next.2 → 3.0.0-next.20

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/README.md CHANGED
@@ -2,33 +2,40 @@
2
2
 
3
3
  Create a shadow root and apply styles and html as defined
4
4
 
5
+ ## NOTE: This lastest version uses the stage-3 decorator proposal. This requires typescript >= 5.0 and many other tools do not yet support this latest syntax.
6
+
5
7
  #### Installation:
6
8
 
7
9
  ```BASH
8
- npm i @joist/element
10
+ npm i @joist/element@next
9
11
  ```
10
12
 
11
13
  #### Example:
12
14
 
13
15
  ```TS
14
- import { styles, template, css, html, define, listen, attr } from '@joist/element';
16
+ import { tagName, shadow, css, html, attr, listen } from '@joist/element';
15
17
 
16
18
  export class MyElement extends HTMLElement {
17
- @define static tagName = 'my-element';
18
-
19
- @styles styles = css`
19
+ // define a custom element
20
+ @tagName static tagName = 'my-element';
21
+
22
+ // apply styles to shadow dom
23
+ @shadow styles = css`
20
24
  :host {
21
25
  display: block;
22
26
  color: red;
23
27
  }
24
28
  `;
25
29
 
26
- @template template = html`
30
+ // apply html to shadow dom
31
+ @shadow template = html`
27
32
  <slot></slot>
28
33
  `;
29
-
34
+
35
+ // define attributes
30
36
  @attr accessor value = 0;
31
-
37
+
38
+ // listen for events
32
39
  @listen('click') onClick() {
33
40
  console.log('clicked!')
34
41
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@joist/element",
3
- "version": "3.0.0-next.2",
3
+ "version": "3.0.0-next.20",
4
+ "type": "module",
4
5
  "main": "./target/lib.js",
5
6
  "module": "./target/lib.js",
6
7
  "exports": {
@@ -47,11 +48,16 @@
47
48
  "tsconfig.json"
48
49
  ],
49
50
  "output": [
50
- "target/**"
51
+ "target/**",
52
+ "tsconfig.tsbuildinfo"
51
53
  ]
52
54
  },
53
55
  "test": {
54
- "command": "wtr --config ../../wtr.config.mjs --port 8001",
56
+ "command": "wtr --config wtr.config.mjs --port 8001",
57
+ "files": [
58
+ "target/**"
59
+ ],
60
+ "output": [],
55
61
  "dependencies": [
56
62
  "build"
57
63
  ]
@@ -4,31 +4,23 @@ export function attr({ get, set }, ctx) {
4
4
  if (typeof ctx.name === 'string') {
5
5
  if (this.hasAttribute(ctx.name)) {
6
6
  const attr = this.getAttribute(ctx.name);
7
- // treat as boolean
8
7
  if (attr === '') {
9
8
  return true;
10
9
  }
11
- // treat as number
12
10
  if (typeof value === 'number') {
13
11
  return Number(attr);
14
12
  }
15
- // treat as string
16
13
  return attr;
17
14
  }
18
- // should set attributes AFTER init to allow setup to complete
19
- // If we do not do this the attributeChangedCallback could fire before init.
20
- // If the user attempts to read or write to this property it will fail
21
- // this also normalizes when the attributeChangedCallback is called in different rendering scenarios
22
15
  Promise.resolve().then(() => {
23
16
  const cached = get.call(this);
24
- if (cached === true) {
25
- // set boolean attribute
26
- this.setAttribute(ctx.name.toString(), '');
27
- }
28
- else {
29
- // set key/value attribute
30
- const attrValue = String(cached);
31
- if (attrValue !== this.getAttribute(ctx.name.toString())) {
17
+ if (cached !== null && cached !== undefined && cached !== '') {
18
+ if (typeof cached === 'boolean') {
19
+ if (cached === true) {
20
+ this.setAttribute(ctx.name.toString(), '');
21
+ }
22
+ }
23
+ else {
32
24
  this.setAttribute(ctx.name.toString(), String(cached));
33
25
  }
34
26
  }
@@ -56,20 +48,17 @@ export function attr({ get, set }, ctx) {
56
48
  const ogValue = get.call(this);
57
49
  if (typeof ctx.name === 'string') {
58
50
  const attr = this.getAttribute(ctx.name);
59
- // treat as attribute
60
- if (attr === '') {
61
- return true;
62
- }
63
- // treat as number
64
- if (typeof ogValue === 'number') {
65
- return Number(attr);
51
+ if (attr !== null) {
52
+ if (attr === '') {
53
+ return true;
54
+ }
55
+ if (typeof ogValue === 'number') {
56
+ return Number(attr);
57
+ }
58
+ return attr;
66
59
  }
67
- // treat as string
68
- return attr;
69
- }
70
- else {
71
- return ogValue;
72
60
  }
61
+ return ogValue;
73
62
  },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9B,IAAI,KAAK,EAAE;wBACT,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;qBACjC;yBAAM;wBACL,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;qBAChC;iBACF;qBAAM;oBACL,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;iBAC5C;aACF;YAED,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC;QACD,GAAG;YACD,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE/B,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAChC,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAEzC,IAAI,IAAI,KAAK,IAAI,EAAE;oBAEjB,IAAI,IAAI,KAAK,EAAE,EAAE;wBACf,OAAO,IAAI,CAAC;qBACb;oBAGD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;wBAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;qBACrB;oBAGD,OAAO,IAAI,CAAC;iBACb;aACF;YAGD,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -5,118 +5,162 @@ describe('observable: attr()', () => {
5
5
  it('should write default value to attribute', async () => {
6
6
  let MyElement = (() => {
7
7
  let _instanceExtraInitializers = [];
8
- let _hello_decorators;
9
- let _hello_initializers = [];
8
+ let _value1_decorators;
9
+ let _value1_initializers = [];
10
+ let _value2_decorators;
11
+ let _value2_initializers = [];
12
+ let _value3_decorators;
13
+ let _value3_initializers = [];
10
14
  return class MyElement extends HTMLElement {
11
15
  static {
12
- _hello_decorators = [attr];
13
- __esDecorate(this, null, _hello_decorators, { kind: "accessor", name: "hello", static: false, private: false, access: { has: obj => "hello" in obj, get: obj => obj.hello, set: (obj, value) => { obj.hello = value; } } }, _hello_initializers, _instanceExtraInitializers);
16
+ _value1_decorators = [attr];
17
+ _value2_decorators = [attr];
18
+ _value3_decorators = [attr];
19
+ __esDecorate(this, null, _value1_decorators, { kind: "accessor", name: "value1", static: false, private: false, access: { has: obj => "value1" in obj, get: obj => obj.value1, set: (obj, value) => { obj.value1 = value; } } }, _value1_initializers, _instanceExtraInitializers);
20
+ __esDecorate(this, null, _value2_decorators, { kind: "accessor", name: "value2", static: false, private: false, access: { has: obj => "value2" in obj, get: obj => obj.value2, set: (obj, value) => { obj.value2 = value; } } }, _value2_initializers, _instanceExtraInitializers);
21
+ __esDecorate(this, null, _value3_decorators, { kind: "accessor", name: "value3", static: false, private: false, access: { has: obj => "value3" in obj, get: obj => obj.value3, set: (obj, value) => { obj.value3 = value; } } }, _value3_initializers, _instanceExtraInitializers);
14
22
  }
15
- #hello_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _hello_initializers, 'world'));
16
- get hello() { return this.#hello_accessor_storage; }
17
- set hello(value) { this.#hello_accessor_storage = value; }
23
+ #value1_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value1_initializers, 'hello'));
24
+ get value1() { return this.#value1_accessor_storage; }
25
+ set value1(value) { this.#value1_accessor_storage = value; }
26
+ #value2_accessor_storage = __runInitializers(this, _value2_initializers, 0);
27
+ get value2() { return this.#value2_accessor_storage; }
28
+ set value2(value) { this.#value2_accessor_storage = value; }
29
+ #value3_accessor_storage = __runInitializers(this, _value3_initializers, true);
30
+ get value3() { return this.#value3_accessor_storage; }
31
+ set value3(value) { this.#value3_accessor_storage = value; }
18
32
  };
19
33
  })();
20
34
  customElements.define('attr-test-1', MyElement);
21
35
  const el = await fixture(html `<attr-test-1></attr-test-1>`);
22
- expect(el.getAttribute('hello')).to.equal('world');
36
+ expect(el.getAttribute('value1')).to.equal('hello');
37
+ expect(el.getAttribute('value2')).to.equal('0');
38
+ expect(el.getAttribute('value3')).to.equal('');
23
39
  });
24
- it('should read default value from attribute', async () => {
40
+ it('should read and parse the correct values', async () => {
25
41
  let MyElement = (() => {
26
42
  let _instanceExtraInitializers_1 = [];
27
- let _hello_decorators;
28
- let _hello_initializers = [];
43
+ let _value1_decorators;
44
+ let _value1_initializers = [];
45
+ let _value2_decorators;
46
+ let _value2_initializers = [];
47
+ let _value3_decorators;
48
+ let _value3_initializers = [];
49
+ let _value4_decorators;
50
+ let _value4_initializers = [];
29
51
  return class MyElement extends HTMLElement {
30
52
  static {
31
- _hello_decorators = [attr];
32
- __esDecorate(this, null, _hello_decorators, { kind: "accessor", name: "hello", static: false, private: false, access: { has: obj => "hello" in obj, get: obj => obj.hello, set: (obj, value) => { obj.hello = value; } } }, _hello_initializers, _instanceExtraInitializers_1);
53
+ _value1_decorators = [attr];
54
+ _value2_decorators = [attr];
55
+ _value3_decorators = [attr];
56
+ _value4_decorators = [attr];
57
+ __esDecorate(this, null, _value1_decorators, { kind: "accessor", name: "value1", static: false, private: false, access: { has: obj => "value1" in obj, get: obj => obj.value1, set: (obj, value) => { obj.value1 = value; } } }, _value1_initializers, _instanceExtraInitializers_1);
58
+ __esDecorate(this, null, _value2_decorators, { kind: "accessor", name: "value2", static: false, private: false, access: { has: obj => "value2" in obj, get: obj => obj.value2, set: (obj, value) => { obj.value2 = value; } } }, _value2_initializers, _instanceExtraInitializers_1);
59
+ __esDecorate(this, null, _value3_decorators, { kind: "accessor", name: "value3", static: false, private: false, access: { has: obj => "value3" in obj, get: obj => obj.value3, set: (obj, value) => { obj.value3 = value; } } }, _value3_initializers, _instanceExtraInitializers_1);
60
+ __esDecorate(this, null, _value4_decorators, { kind: "accessor", name: "value4", static: false, private: false, access: { has: obj => "value4" in obj, get: obj => obj.value4, set: (obj, value) => { obj.value4 = value; } } }, _value4_initializers, _instanceExtraInitializers_1);
33
61
  }
34
- #hello_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_1), __runInitializers(this, _hello_initializers, 'world'));
35
- get hello() { return this.#hello_accessor_storage; }
36
- set hello(value) { this.#hello_accessor_storage = value; }
62
+ #value1_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_1), __runInitializers(this, _value1_initializers, 100));
63
+ get value1() { return this.#value1_accessor_storage; }
64
+ set value1(value) { this.#value1_accessor_storage = value; }
65
+ #value2_accessor_storage = __runInitializers(this, _value2_initializers, 0);
66
+ get value2() { return this.#value2_accessor_storage; }
67
+ set value2(value) { this.#value2_accessor_storage = value; }
68
+ #value3_accessor_storage = __runInitializers(this, _value3_initializers, false);
69
+ get value3() { return this.#value3_accessor_storage; }
70
+ set value3(value) { this.#value3_accessor_storage = value; }
71
+ #value4_accessor_storage = __runInitializers(this, _value4_initializers, 'hello');
72
+ get value4() { return this.#value4_accessor_storage; }
73
+ set value4(value) { this.#value4_accessor_storage = value; }
37
74
  };
38
75
  })();
39
76
  customElements.define('attr-test-2', MyElement);
40
- const el = await fixture(html `<attr-test-2 hello="foo"></attr-test-2>`);
41
- expect(el.hello).to.equal('foo');
77
+ const el = await fixture(html `<attr-test-2 value2="2" value3 value4="world"></attr-test-2>`);
78
+ expect(el.value1).to.equal(100);
79
+ expect(el.value2).to.equal(2);
80
+ expect(el.value3).to.equal(true);
81
+ expect(el.value4).to.equal('world');
42
82
  });
43
- it('should write boolean attr values', async () => {
83
+ it('should not write falsy props to attributes', async () => {
44
84
  let MyElement = (() => {
45
85
  let _instanceExtraInitializers_2 = [];
46
- let _hello_decorators;
47
- let _hello_initializers = [];
86
+ let _value1_decorators;
87
+ let _value1_initializers = [];
88
+ let _value2_decorators;
89
+ let _value2_initializers = [];
90
+ let _value3_decorators;
91
+ let _value3_initializers = [];
48
92
  return class MyElement extends HTMLElement {
49
93
  static {
50
- _hello_decorators = [attr];
51
- __esDecorate(this, null, _hello_decorators, { kind: "accessor", name: "hello", static: false, private: false, access: { has: obj => "hello" in obj, get: obj => obj.hello, set: (obj, value) => { obj.hello = value; } } }, _hello_initializers, _instanceExtraInitializers_2);
94
+ _value1_decorators = [attr];
95
+ _value2_decorators = [attr];
96
+ _value3_decorators = [attr];
97
+ __esDecorate(this, null, _value1_decorators, { kind: "accessor", name: "value1", static: false, private: false, access: { has: obj => "value1" in obj, get: obj => obj.value1, set: (obj, value) => { obj.value1 = value; } } }, _value1_initializers, _instanceExtraInitializers_2);
98
+ __esDecorate(this, null, _value2_decorators, { kind: "accessor", name: "value2", static: false, private: false, access: { has: obj => "value2" in obj, get: obj => obj.value2, set: (obj, value) => { obj.value2 = value; } } }, _value2_initializers, _instanceExtraInitializers_2);
99
+ __esDecorate(this, null, _value3_decorators, { kind: "accessor", name: "value3", static: false, private: false, access: { has: obj => "value3" in obj, get: obj => obj.value3, set: (obj, value) => { obj.value3 = value; } } }, _value3_initializers, _instanceExtraInitializers_2);
52
100
  }
53
- #hello_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_2), __runInitializers(this, _hello_initializers, true));
54
- get hello() { return this.#hello_accessor_storage; }
55
- set hello(value) { this.#hello_accessor_storage = value; }
101
+ #value1_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_2), __runInitializers(this, _value1_initializers, undefined));
102
+ get value1() { return this.#value1_accessor_storage; }
103
+ set value1(value) { this.#value1_accessor_storage = value; }
104
+ #value2_accessor_storage = __runInitializers(this, _value2_initializers, null);
105
+ get value2() { return this.#value2_accessor_storage; }
106
+ set value2(value) { this.#value2_accessor_storage = value; }
107
+ #value3_accessor_storage = __runInitializers(this, _value3_initializers, '');
108
+ get value3() { return this.#value3_accessor_storage; }
109
+ set value3(value) { this.#value3_accessor_storage = value; }
56
110
  };
57
111
  })();
58
112
  customElements.define('attr-test-3', MyElement);
59
113
  const el = await fixture(html `<attr-test-3></attr-test-3>`);
60
- expect(el.getAttribute('hello')).to.equal('');
61
- el.hello = false;
62
- expect(el.getAttribute('hello')).to.equal(null);
114
+ expect(el.hasAttribute('value1')).to.be.false;
115
+ expect(el.hasAttribute('value2')).to.be.false;
116
+ expect(el.hasAttribute('value3')).to.be.false;
63
117
  });
64
- it('should parse to boolean values', async () => {
118
+ it('should update attributes when props are changed', async () => {
65
119
  let MyElement = (() => {
66
120
  let _instanceExtraInitializers_3 = [];
67
- let _hello_decorators;
68
- let _hello_initializers = [];
121
+ let _value1_decorators;
122
+ let _value1_initializers = [];
123
+ let _value2_decorators;
124
+ let _value2_initializers = [];
125
+ let _value3_decorators;
126
+ let _value3_initializers = [];
127
+ let _value4_decorators;
128
+ let _value4_initializers = [];
69
129
  return class MyElement extends HTMLElement {
70
130
  static {
71
- _hello_decorators = [attr];
72
- __esDecorate(this, null, _hello_decorators, { kind: "accessor", name: "hello", static: false, private: false, access: { has: obj => "hello" in obj, get: obj => obj.hello, set: (obj, value) => { obj.hello = value; } } }, _hello_initializers, _instanceExtraInitializers_3);
131
+ _value1_decorators = [attr];
132
+ _value2_decorators = [attr];
133
+ _value3_decorators = [attr];
134
+ _value4_decorators = [attr];
135
+ __esDecorate(this, null, _value1_decorators, { kind: "accessor", name: "value1", static: false, private: false, access: { has: obj => "value1" in obj, get: obj => obj.value1, set: (obj, value) => { obj.value1 = value; } } }, _value1_initializers, _instanceExtraInitializers_3);
136
+ __esDecorate(this, null, _value2_decorators, { kind: "accessor", name: "value2", static: false, private: false, access: { has: obj => "value2" in obj, get: obj => obj.value2, set: (obj, value) => { obj.value2 = value; } } }, _value2_initializers, _instanceExtraInitializers_3);
137
+ __esDecorate(this, null, _value3_decorators, { kind: "accessor", name: "value3", static: false, private: false, access: { has: obj => "value3" in obj, get: obj => obj.value3, set: (obj, value) => { obj.value3 = value; } } }, _value3_initializers, _instanceExtraInitializers_3);
138
+ __esDecorate(this, null, _value4_decorators, { kind: "accessor", name: "value4", static: false, private: false, access: { has: obj => "value4" in obj, get: obj => obj.value4, set: (obj, value) => { obj.value4 = value; } } }, _value4_initializers, _instanceExtraInitializers_3);
73
139
  }
74
- #hello_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_3), __runInitializers(this, _hello_initializers, false));
75
- get hello() { return this.#hello_accessor_storage; }
76
- set hello(value) { this.#hello_accessor_storage = value; }
140
+ #value1_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_3), __runInitializers(this, _value1_initializers, 'hello'));
141
+ get value1() { return this.#value1_accessor_storage; }
142
+ set value1(value) { this.#value1_accessor_storage = value; }
143
+ #value2_accessor_storage = __runInitializers(this, _value2_initializers, 0);
144
+ get value2() { return this.#value2_accessor_storage; }
145
+ set value2(value) { this.#value2_accessor_storage = value; }
146
+ #value3_accessor_storage = __runInitializers(this, _value3_initializers, true);
147
+ get value3() { return this.#value3_accessor_storage; }
148
+ set value3(value) { this.#value3_accessor_storage = value; }
149
+ #value4_accessor_storage = __runInitializers(this, _value4_initializers, false);
150
+ get value4() { return this.#value4_accessor_storage; }
151
+ set value4(value) { this.#value4_accessor_storage = value; }
77
152
  };
78
153
  })();
79
154
  customElements.define('attr-test-4', MyElement);
80
- const el = await fixture(html `<attr-test-4 hello></attr-test-4>`);
81
- expect(el.hello).to.equal(true);
82
- });
83
- it('should read attributes as number if prop is of type number', async () => {
84
- let MyElement = (() => {
85
- let _instanceExtraInitializers_4 = [];
86
- let _value_decorators;
87
- let _value_initializers = [];
88
- return class MyElement extends HTMLElement {
89
- static {
90
- _value_decorators = [attr];
91
- __esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } } }, _value_initializers, _instanceExtraInitializers_4);
92
- }
93
- #value_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_4), __runInitializers(this, _value_initializers, 0));
94
- get value() { return this.#value_accessor_storage; }
95
- set value(value) { this.#value_accessor_storage = value; }
96
- };
97
- })();
98
- customElements.define('attr-test-5', MyElement);
99
- const el = await fixture(html `<attr-test-5 value="100"></attr-test-5>`);
100
- expect(el.value).to.equal(100);
101
- });
102
- it('should NOT read attributes as number if prop is of type string', async () => {
103
- let MyElement = (() => {
104
- let _instanceExtraInitializers_5 = [];
105
- let _value_decorators;
106
- let _value_initializers = [];
107
- return class MyElement extends HTMLElement {
108
- static {
109
- _value_decorators = [attr];
110
- __esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } } }, _value_initializers, _instanceExtraInitializers_5);
111
- }
112
- #value_accessor_storage = (__runInitializers(this, _instanceExtraInitializers_5), __runInitializers(this, _value_initializers, '0'));
113
- get value() { return this.#value_accessor_storage; }
114
- set value(value) { this.#value_accessor_storage = value; }
115
- };
116
- })();
117
- customElements.define('attr-test-6', MyElement);
118
- const el = await fixture(html `<attr-test-6 value="100"></attr-test-6>`);
119
- expect(el.value).to.equal('100');
155
+ const el = await fixture(html `<attr-test-4></attr-test-4>`);
156
+ el.value1 = 'world';
157
+ el.value2 = 100;
158
+ el.value3 = false;
159
+ el.value4 = true;
160
+ expect(el.getAttribute('value1')).to.equal('world');
161
+ expect(el.getAttribute('value2')).to.equal('100');
162
+ expect(el.hasAttribute('value3')).to.be.false;
163
+ expect(el.hasAttribute('value4')).to.be.true;
120
164
  });
121
165
  });
122
166
  //# sourceMappingURL=attr.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attr.test.js","sourceRoot":"","sources":["../../src/lib/attr.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACjD,SAAS;;;;yBAAT,SAAU,SAAQ,WAAW;;yCAChC,IAAI;oBAAC,oKAAS,KAAK,6BAAL,KAAK,kEAAW;;gBAAzB,6HAAiB,OAAO,GAAC;gBAAzB,IAAS,KAAK,2CAAW;gBAAzB,IA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CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QAC9C,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- export declare function listen<This extends HTMLElement>(event: string): (value: (e: Event) => void, ctx: ClassMethodDecoratorContext<This>) => void;
1
+ export declare function listen<This extends HTMLElement>(event: string, root?: (el: This) => ShadowRoot | This): (value: (e: Event) => void, ctx: ClassMethodDecoratorContext<This>) => void;
@@ -1,11 +1,8 @@
1
- export function listen(event) {
1
+ export function listen(event, root = (el) => el.shadowRoot || el) {
2
2
  return (value, ctx) => {
3
3
  ctx.addInitializer(function () {
4
- // method initializers are run before fields and accessors.
5
- // we want to wait till after all have run so we can check if there is a shadowRoot or not.
6
4
  Promise.resolve().then(() => {
7
- const root = this.shadowRoot || this;
8
- root.addEventListener(event, value.bind(this));
5
+ root(this).addEventListener(event, value.bind(this));
9
6
  });
10
7
  });
11
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"listen.js","sourceRoot":"","sources":["../../src/lib/listen.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAA2B,KAAa;IAC5D,OAAO,CAAC,KAAyB,EAAE,GAAsC,EAAE,EAAE;QAC3E,GAAG,CAAC,cAAc,CAAC;YACjB,2DAA2D;YAC3D,2FAA2F;YAC3F,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC;gBAErC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"listen.js","sourceRoot":"","sources":["../../src/lib/listen.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CACpB,KAAa,EACb,OAAwC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,IAAI,EAAE;IAEnE,OAAO,CAAC,KAAyB,EAAE,GAAsC,EAAE,EAAE;QAC3E,GAAG,CAAC,cAAc,CAAC;YAGjB,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -1,6 +1,9 @@
1
- export declare abstract class TemplateResult {
1
+ export declare abstract class ShadowResult {
2
+ #private;
2
3
  strings: TemplateStringsArray;
3
4
  values: any[];
5
+ get shadow(): ShadowRoot;
4
6
  constructor(raw: TemplateStringsArray, ...values: any[]);
7
+ execute(root: ShadowRoot): void;
5
8
  abstract apply(root: ShadowRoot): void;
6
9
  }
@@ -1,9 +1,20 @@
1
- export class TemplateResult {
1
+ export class ShadowResult {
2
2
  strings;
3
3
  values;
4
+ #shadow = undefined;
5
+ get shadow() {
6
+ if (!this.#shadow) {
7
+ throw new Error('ShadowResult has not been applied');
8
+ }
9
+ return this.#shadow;
10
+ }
4
11
  constructor(raw, ...values) {
5
12
  this.strings = raw;
6
13
  this.values = values;
7
14
  }
15
+ execute(root) {
16
+ this.#shadow = root;
17
+ this.apply(root);
18
+ }
8
19
  }
9
20
  //# sourceMappingURL=result.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/lib/result.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,cAAc;IAClC,OAAO,CAAuB;IAC9B,MAAM,CAAQ;IAEd,YAAY,GAAyB,EAAE,GAAG,MAAa;QACrD,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CAGF"}
1
+ {"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/lib/result.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,YAAY;IAChC,OAAO,CAAuB;IAC9B,MAAM,CAAQ;IAEd,OAAO,GAA2B,SAAS,CAAC;IAE5C,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAY,GAAyB,EAAE,GAAG,MAAa;QACrD,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,IAAgB;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;CAGF"}
@@ -1,2 +1,2 @@
1
- import { TemplateResult } from './result.js';
2
- export declare function shadow<This extends HTMLElement, T extends TemplateResult>(_: undefined, ctx: ClassFieldDecoratorContext<This, T>): (result: T) => T;
1
+ import { ShadowResult } from './result.js';
2
+ export declare function shadow<This extends HTMLElement, T extends ShadowResult>(_: undefined, ctx: ClassFieldDecoratorContext<This, T>): (this: This, result: T) => T;
@@ -1,16 +1,12 @@
1
1
  export function shadow(_, ctx) {
2
- const shadow = applyShadow(ctx);
3
- return (result) => {
4
- const root = shadow();
5
- result.apply(root);
6
- return result;
7
- };
8
- }
9
- function applyShadow(ctx) {
10
- let shadow;
11
2
  ctx.addInitializer(function () {
12
- shadow = this.shadowRoot || this.attachShadow({ mode: 'open' });
3
+ if (!this.shadowRoot) {
4
+ this.attachShadow({ mode: 'open' });
5
+ }
13
6
  });
14
- return () => shadow;
7
+ return function (result) {
8
+ result.execute(this.shadowRoot);
9
+ return result;
10
+ };
15
11
  }
16
12
  //# sourceMappingURL=shadow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadow.js","sourceRoot":"","sources":["../../src/lib/shadow.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,MAAM,CACpB,CAAY,EACZ,GAAwC;IAExC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAEhC,OAAO,CAAC,MAAS,EAAE,EAAE;QACnB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC;QAEtB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEnB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAClB,GAAyE;IAEzE,IAAI,MAAkB,CAAC;IAEvB,GAAG,CAAC,cAAc,CAAC;QACjB,MAAM,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"shadow.js","sourceRoot":"","sources":["../../src/lib/shadow.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,MAAM,CACpB,CAAY,EACZ,GAAwC;IAExC,GAAG,CAAC,cAAc,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;SACrC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAsB,MAAS;QACpC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAW,CAAC,CAAC;QAEjC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,21 @@
1
- "use strict";
1
+ import { __esDecorate, __runInitializers } from "tslib";
2
+ import { tagName } from './tag-name.js';
3
+ describe('tag-name', () => {
4
+ it('should define a custom element', async () => {
5
+ let MyElement = (() => {
6
+ let _staticExtraInitializers = [];
7
+ let _static_tagName_decorators;
8
+ let _static_tagName_initializers = [];
9
+ return class MyElement extends HTMLElement {
10
+ static {
11
+ _static_tagName_decorators = [tagName];
12
+ __esDecorate(null, null, _static_tagName_decorators, { kind: "field", name: "tagName", static: true, private: false, access: { has: obj => "tagName" in obj, get: obj => obj.tagName, set: (obj, value) => { obj.tagName = value; } } }, _static_tagName_initializers, _staticExtraInitializers);
13
+ __runInitializers(this, _staticExtraInitializers);
14
+ }
15
+ static tagName = __runInitializers(this, _static_tagName_initializers, 'tn-test-1');
16
+ };
17
+ })();
18
+ return customElements.whenDefined(MyElement.tagName);
19
+ });
20
+ });
2
21
  //# sourceMappingURL=tag-name.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-name.test.js","sourceRoot":"","sources":["../../src/lib/tag-name.test.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"tag-name.test.js","sourceRoot":"","sources":["../../src/lib/tag-name.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;YACxC,SAAS;;;;yBAAT,SAAU,SAAQ,WAAW;;kDAChC,OAAO;oBAAC,6KAAO,OAAO,6BAAP,OAAO,yEAAe;oBADlC,kDAAS;;gBACJ,MAAM,CAAC,OAAO,yDAAG,WAAW,EAAC;;;QAGxC,OAAO,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,9 +1,23 @@
1
- import { TemplateResult } from './result.js';
2
- export declare class HTMLResult extends TemplateResult {
1
+ import { ShadowResult } from './result.js';
2
+ type Tags = keyof HTMLElementTagNameMap;
3
+ type SVGTags = keyof SVGElementTagNameMap;
4
+ type MathTags = keyof MathMLElementTagNameMap;
5
+ export declare const htmlTemplateCache: WeakMap<TemplateStringsArray, HTMLTemplateElement>;
6
+ export declare class HTMLResult extends ShadowResult {
7
+ query<K extends Tags>(selectors: K): HTMLElementTagNameMap[K] | null;
8
+ query<K extends SVGTags>(selectors: K): SVGElementTagNameMap[K] | null;
9
+ query<K extends MathTags>(selectors: K): MathMLElementTagNameMap[K] | null;
10
+ query<E extends Element = Element>(selectors: string): E | null;
11
+ queryAll<K extends Tags>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
12
+ queryAll<K extends SVGTags>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
13
+ queryAll<K extends MathTags>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
14
+ queryAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
3
15
  apply(root: ShadowRoot): void;
4
16
  }
5
- export declare function html(strings: TemplateStringsArray): HTMLResult;
6
- export declare class CSSResult extends TemplateResult {
17
+ export declare function html(strings: TemplateStringsArray, ...values: any[]): HTMLResult;
18
+ export declare const styleSheetCache: WeakMap<TemplateStringsArray, CSSStyleSheet>;
19
+ export declare class CSSResult extends ShadowResult {
7
20
  apply(root: ShadowRoot): void;
8
21
  }
9
22
  export declare function css(strings: TemplateStringsArray): CSSResult;
23
+ export {};
@@ -1,22 +1,50 @@
1
- import { TemplateResult } from './result.js';
2
- export class HTMLResult extends TemplateResult {
1
+ import { ShadowResult } from './result.js';
2
+ export const htmlTemplateCache = new WeakMap();
3
+ export class HTMLResult extends ShadowResult {
4
+ query(query) {
5
+ return this.shadow.querySelector(query);
6
+ }
7
+ queryAll(query) {
8
+ return this.shadow.querySelectorAll(query);
9
+ }
3
10
  apply(root) {
4
- const el = document.createElement('template');
5
- el.innerHTML = this.strings.join(',');
6
- root.append(el.content.cloneNode(true));
11
+ let template;
12
+ if (htmlTemplateCache.has(this.strings)) {
13
+ template = htmlTemplateCache.get(this.strings);
14
+ }
15
+ else {
16
+ template = document.createElement('template');
17
+ template.innerHTML = concat(this.strings);
18
+ htmlTemplateCache.set(this.strings, template);
19
+ }
20
+ root.append(template.content.cloneNode(true));
7
21
  }
8
22
  }
9
- export function html(strings) {
10
- return new HTMLResult(strings);
23
+ export function html(strings, ...values) {
24
+ return new HTMLResult(strings, ...values);
11
25
  }
12
- export class CSSResult extends TemplateResult {
26
+ export const styleSheetCache = new WeakMap();
27
+ export class CSSResult extends ShadowResult {
13
28
  apply(root) {
14
- const sheet = new CSSStyleSheet();
15
- sheet.replaceSync(this.strings.join(''));
29
+ let sheet;
30
+ if (styleSheetCache.has(this.strings)) {
31
+ sheet = styleSheetCache.get(this.strings);
32
+ }
33
+ else {
34
+ sheet = new CSSStyleSheet();
35
+ sheet.replaceSync(concat(this.strings));
36
+ }
16
37
  root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
17
38
  }
18
39
  }
19
40
  export function css(strings) {
20
41
  return new CSSResult(strings);
21
42
  }
43
+ function concat(strings) {
44
+ let res = '';
45
+ for (let i = 0; i < strings.length; i++) {
46
+ res += strings[i];
47
+ }
48
+ return res;
49
+ }
22
50
  //# sourceMappingURL=tags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/lib/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,OAAO,UAAW,SAAQ,cAAc;IAC5C,KAAK,CAAC,IAAgB;QACpB,MAAM,EAAE,GAAG,QAAQ,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C,CAAC;AAED,SAAS,MAAM,CAAC,OAA6B;IAC3C,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;KACnB;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { expect } from '@open-wc/testing';
2
+ import { css, html, htmlTemplateCache, styleSheetCache } from './tags.js';
3
+ describe('tags', () => {
4
+ it('should ensure return the same CSSResult', () => {
5
+ class Test {
6
+ styles = css `Hello World`;
7
+ }
8
+ const a = new Test();
9
+ const b = new Test();
10
+ expect(a.styles.strings).to.equal(b.styles.strings);
11
+ expect(styleSheetCache.get(a.styles.strings)).to.equal(styleSheetCache.get(b.styles.strings));
12
+ });
13
+ it('should cache the HTMLTemplateElement', () => {
14
+ class Test {
15
+ dom = html `Hello World`;
16
+ }
17
+ const a = new Test();
18
+ const b = new Test();
19
+ expect(a.dom.strings).to.equal(b.dom.strings);
20
+ expect(htmlTemplateCache.get(a.dom.strings)).to.equal(htmlTemplateCache.get(b.dom.strings));
21
+ });
22
+ });
23
+ //# sourceMappingURL=tags.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tags.test.js","sourceRoot":"","sources":["../../src/lib/tags.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE1E,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,IAAI;YACR,MAAM,GAAG,GAAG,CAAA,aAAa,CAAC;SAC3B;QAED,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QAErB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,IAAI;YACR,GAAG,GAAG,IAAI,CAAA,aAAa,CAAC;SACzB;QAED,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QAErB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9C,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/target/lib.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { TemplateResult } from './lib/result.js';
1
+ export { ShadowResult as TemplateResult } from './lib/result.js';
2
2
  export { css, html, HTMLResult, CSSResult } from './lib/tags.js';
3
3
  export { shadow } from './lib/shadow.js';
4
4
  export { attr } from './lib/attr.js';
package/target/lib.js CHANGED
@@ -1,4 +1,4 @@
1
- export { TemplateResult } from './lib/result.js';
1
+ export { ShadowResult as TemplateResult } from './lib/result.js';
2
2
  export { css, html, HTMLResult, CSSResult } from './lib/tags.js';
3
3
  export { shadow } from './lib/shadow.js';
4
4
  export { attr } from './lib/attr.js';
package/target/lib.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/typescript/lib/lib.es2022.full.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/lib/result.ts","../src/lib/tags.ts","../src/lib/shadow.ts","../src/lib/attr.ts","../src/lib/listen.ts","../src/lib/tag-name.ts","../src/lib.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/get-diffable-html.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff-plugin.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/index.d.ts","../../../node_modules/chai-a11y-axe/chai-a11y-axe-plugin.d.ts","../../../node_modules/chai-a11y-axe/src/accessible.d.ts","../../../node_modules/chai-a11y-axe/index.d.ts","../../../node_modules/@types/chai-dom/index.d.ts","../../../node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@open-wc/testing/register-chai-plugins.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/elementupdated.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-html/static.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/renderable.d.ts","../../../node_modules/@open-wc/dedupe-mixin/index.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/types.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/scopedelementsmixin.d.ts","../../../node_modules/@open-wc/scoped-elements/types/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixturewrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/helpers.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/scopedelementswrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/litfixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/stringfixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/index.d.ts","../../../node_modules/@open-wc/testing/index.d.ts","../src/lib/attr.test.ts","../src/lib/shadow.test.ts","../src/lib/tag-name.test.ts","../typings.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/accepts/index.d.ts","../../../node_modules/@types/babel__code-frame/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/co-body/index.d.ts","../../../node_modules/@types/command-line-args/index.d.ts","../../../node_modules/@types/content-disposition/index.d.ts","../../../node_modules/@types/convert-source-map/index.d.ts","../../../node_modules/@types/keygrip/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/cookies/index.d.ts","../../../node_modules/@types/debounce/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/http-assert/index.d.ts","../../../node_modules/@types/http-errors/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@types/koa-compose/index.d.ts","../../../node_modules/@types/koa/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/parse5/lib/tree-adapters/default.d.ts","../../../node_modules/@types/parse5/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts","../../../../../node_modules/source-map/source-map.d.ts","../../../../../node_modules/@types/clean-css/index.d.ts","../../../../../node_modules/@types/uglify-js/index.d.ts","../../../../../node_modules/@types/relateurl/index.d.ts","../../../../../node_modules/@types/html-minifier/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1df2366de6650547b3dc1d7c4147355c0f6b4729c964e3839636fa418982d131","f1c9fe42b65437a61104e601eb298c5c859fb522b483f1bdb700eed67a16f980",{"version":"1adc194539bd764fde970b76f0b55a02eefab83b4b27ec41dd2bd532728d525c","signature":"3e951d9449b9b4ae75713d34101fe1b34d37febead00df9c6e910446937afaad"},{"version":"6d3a0d321f9ec175761125f95762a800843109ef119c429dccde2f165400ed8b","signature":"dbb5299fa847b183de2324b239a9d5a3f9d4a2fa5b55b094812a205bca97863a"},{"version":"c32cbda479b2823e080bbd02a4bc975f82701502e82d3c1d842ed66f919bc5a0","signature":"a49aacca7fad594c7e4780eb76759dc09b9cfaee80a10c0fc55144b497e82d2b"},{"version":"3aa3c273eaeba76ce766241231141f2796779b7b008897f0a07e8b043e31109d","signature":"d0d3e5045b9aa4998e83fa4328a6b5713f0204a1a829959dfde720c24243f001"},{"version":"74dbafba311ff3f59ed3bb2f4af96a877f6a8c5dda021d6858dac2892bc54495","signature":"bb6997baa1910e66b799aa26d8f4c32bb72c1d6a58786e27c580e9e6fd1b5945"},{"version":"0efa914817fbdd53b8911606049d24511fe4115981b6ece2271458584d3552a0","signature":"feb0c3511de12ee51ff340730a078fdd751f317ffefa9443eac870b93b02bdcd"},"333e83cb57f0d9a929659575e79be2739a45d609c21a6a9639e98cae9f824068",{"version":"3a15910b7f45dfc393f010ee8f913580b08d65752800fc48147ea13445acd5f7","affectsGlobalScope":true},"72bee526b949b9932edba50997ff3b9cdede7b314d790d5f0d94f3d2944930ea",{"version":"75cd6dce1c5f87511772c891de86d0c9e6829e6273dea9f92a5bec9d0479d1e7","affectsGlobalScope":true},{"version":"cd711db43a952f15464b571ac11b7a440332cd52342bc92c4bf908c70688f57f","affectsGlobalScope":true},"9d8709c916778cb34830708ed47b78e9a46d1fb2eb73a682b14eee990bed4aa6",{"version":"5d90911f942229eb9049feab241739a5ced76f137948f8f42a615e5f01d4e7ea","affectsGlobalScope":true},"999a90d30a3183dcee987d0a5a7c586aba5bacbf6ce087ba8635124082ccfeea","8a5878edd52f4a720560b4c6e6247e9ddc3df6118ad9cf2f9927903b03d5f440",{"version":"4cdd1b520504f86d680470dc91baa79d625fa20e1f9dc1f99eba242eae9fada4","affectsGlobalScope":true},"6b40029289530423f407a22755c85b81740f9acfd88d2b53564f8c1657c26660","50a5b297e6c91df4f6068d98467a5e7ba4eeb888b9376757734dd4b1dfcdacd4",{"version":"b644a9e5433c651fb751aeb6e06f24dfa5604950d948622dcd2980b782bb1f50","affectsGlobalScope":true},"65b91a3725399231d3469529b5e27b85bf2aa98013e607f308e5fe260b47eeff","04e3793f33c71ceae20a4719698c068b72c98cf925b3c5f8a33096c00ed44258","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"3c150a2e1758724811db3bdc5c773421819343b1627714e09f29b1f40a5dfb26","affectsGlobalScope":true},"7000ec8572390d035ba5ef993953957150d0c38ffb31b56653c97dd78cb6e1aa","5a4af5e4727864a08625d5c892d7cba8916d205c7f0c68e15eda5d6579968497","bbc354c6a2740b087f1139e88e90309de480c5390362e2f0d32a145d8d7cf539","e59262ddaae67dec2d226f8a5d05cf6c4dc353c0d9b1e4980a61d7fcf9a2b051","5e30131b6a5587fe666926ad1d9807e733c0a597ed12d682669fcaa331aea576","d27ead0e913b4225279e8beb10450ecaf54af5ed145a6ecbbed18bb130815006","4ddf3962990379d1ea59b369a5516c7533b7944010d6998e0e9b1ab35d5af1f0","1bcd560deed90a43c51b08aa18f7f55229f2e30974ab5ed1b7bb5721be379013","dc08fe04e50bc24d1baded4f33e942222bbdd5d77d6341a93cfe6e4e4586a3be","605e0f5adf8993110c06c775e2a59b7774d1e7a99fc9657140380bab005063bc","88cda4269c54f0803834fd62b2fac61af8bff7a085693f7ca9df85c1f19dee8a",{"version":"d40075d9f1c08b4a8d8e468076f5258900e99895e7259c40f3923b7044bbed6c","affectsGlobalScope":true},"47a20e497d83cd84ad0aa5363200003f08f850fa819339044e03399941eef063","ade0d37a4c1d1abede2abf2591b7cc6347892ea53d4a39bf44a25fb6f707822f","eefa12914a21dafe4352e79866599498b73b3bd232d19854932f58ef36303fb0","d7840fd94e6dfb5b0d9df5a20fe1e79c8dd72b1efdb74d2ef04c31e3588c6b5b","fa6d684e15fe6e99c7208a51b45c04f8e0147f1c8587871aac48fff55b7b1f24","26a3d4bf5351a0034f4203d42946ef5308b22919ba2f26a3ecb976a17c714d83","735eca4958f164c1121f08f9de89352e6f75a56c1533ceefeae075c085799618","d5b69429138b2fb26076427c630064a71c12959263ec3d92cbec54baf89354e1","793fca6322a14fa8fa6bc6a4fc694fd7bcc88922c4f9abcd48bf6908f8bf939b","0b2b7cb8164fcc6f4a71c1bf47c2cd4828c867f0ec19d178bb20954348de9a30","e5fefd2fe7d4d459dadbc1384a3643fb7598e5f41ea97a411c0155447d9f71e5",{"version":"6accc0b9eda49e8433df5f7340bbdc6c181148e423a2cee38066eb9e2c1fbaef","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6a6767af33d0ad0446297febf0199451c5817b2a4c1686073ff23958e1d34c09","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",{"version":"741351edfd1ed1d70e96cf4219b75797459201efe6f21802f13f2a5598d74859","affectsGlobalScope":true},"66a6e7b6e32eea099615d627028ed0d681679e31237df03e68e1b912e3e61da0","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true},"fd536fe411f46ae62c4729e342a3494adbdd54335e41039c238170c9781da9ff",{"version":"772ff00e189d93488d1ca6f0f4dfba77bd090a99ed31e19a14bc16fad4078e48","affectsGlobalScope":true},"d9b1fa0da9fbff85402c3ee794bcfe6d7cfef2fa053761b7d83989cdb7f9b26d","ac0c7cb0a4c1bec60be2c0460b3bda1e674eaf2c98312d7b6f16a0bb58718e2d",{"version":"7e2181a6fc140b4525d5a45c204477c37fa78a635558e88552c68f76a4325403","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","6a6bfa45d3ed96dea1ad653444fb26ddaa9245d2e2d6ddaab050cb9a2c0936d7","276b547eeb8eeeee9a446a3bfa6e07d1c0199269bdcf33813abab1281394a9cb","c999f7816955f75b447823e3e4085f699600e2a4a3327907df9af65b0a9c0df6","958df89fdcf5555cdfd57a14037e05505048dd29c59e8009bea279b65523b241","ffa8324a4c0611f9a50262fb36f097eeabe0fa0d71755aa67156da13cde1b932","9b814e0806922056145bedb096f11b73bdce70cc871f3ccfc4ce00b2cba75718",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"be3d24f3fd8c85fedd91485b207d180f14ac2602805b52f6a33462ada14c27b0","affectsGlobalScope":true},"e58cfbe7db26c2077027662ef6c87a3cf9d721717e77ecaa98c4d8d7911b3299","2ad6a251b6ef19fd1f8498f83bb7b265033bd52287e1f6569d09544f18806713","bfa08f2c30c475aef1c9451855ba6b2acfdc64f61950a38fae75806d66fb85c2","159807eb55a9439f9a675bd493788190a6203b5f36c315f8c3acbfcb875c7072","fe31b2b31ac5453fc7b8eef32b62017e55b214ceb884f0b177f442af92e84682","dd72576c8ea64d55af46a386068503d3cfcecce84ed7e1cbd4ff4081ba67fafc",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"70a7e8a7880d55396285e4b85ff5bdf3af3083176abe07f944967836f2a43188","3570df7c6f3a976109f55b596a2d88c2f87e0574cd1502272594ee5c4e56d0ef","850e95721334c2aa7697b08782f443ec4286274e5024169d4443933544f359d7",{"version":"74e6cd21f7b5e29fab05060ea24e2b90aa254f16f3f62ccd7055bdb8fc7b2ff5","affectsGlobalScope":true},{"version":"5761c90b0cabdd6bd1f5fb1c3bf942088fdd39e18ed35dbe39b0c34bc733bf13","affectsGlobalScope":true},"1eb6c5569d41e6021832d0a8a71f45fecbc13d03ad7d306da485999148b64955","c05ef0ecf06540ad3039515c10d3b27f9380639ced40f4093fd073e1b5ff21d9","c774096c5935712de41c763e3c08a04b7a788a85fb07a0c2df23fb5ace3bc610","2b847f2aba41dcd69677684d5d300c08aea4e306c305fd39bf548cef19f03cfe","f4c0cbc93eb51fd61e07a86111739770dd524f6297bd83266ff004aec553e085","9a134dbb29f0af914d90b23f609b39019d66ed53db7d492ab6b04c67114559da","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","7b3781fbdfddbee8dba55ccee5aa74a7c8d6701ade11d49ab7d8cb1fcefe669e","c4aab2ec3a249f2a4caa9cbdb099752a80daf999b79d85aa3504cdfd6e559476",{"version":"2cff47e15621f3055af1df1547426f833c9d0a571750c4f0659836f45c50fe0a","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","c764a6cf523d13f2304a23216cd1084e28c041eebabd8aa9b2a9d99866c668c0","1272a5c2bd05961adc473e905332b7a422b00485c10b41c752f7fcf6835e3436","30ef92bf8135ce36ba1231fe41715276f2a40be72a478ddeb862bc16672e8680",{"version":"4ace0a30a70fe5963442d75ea6e69f525671ae76f6e57ab7556c44839b4237e8","affectsGlobalScope":true},{"version":"a6f03dbf03c001fb3ac1c9bea6dde049dfff27ef8886cc4a886374aacf2e997d","affectsGlobalScope":true},"66bfb3de947abf4b117ee849c245425dbe494d6903e28f9ded566e91c9d05d77","c28d4f58131b93d60e087b86148d4e0c9d9b5c49c23ff1a9d1a9594fdedd5d08","c6b5d7f259544c91024ecf2b17138574a3f6ff2476468fafd7f957d2b68d6d98",{"version":"1ec27c4b695590464113276d174f873e260e468ef226b7dc18f9193875fa559d","affectsGlobalScope":true},"33da4ee2ab9fdd9ef8b3fc526d871ce02ae8c825283f5695e7cad507c087b97c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"71709584ed5ed7d236dc225441ec4634ffc6c718853e04b9c27b9ea121459044","6738101ae8e56cd3879ab3f99630ada7d78097fc9fd334df7e766216778ca219","b95f751a58d283cb5e32f2655361f6e2a27f0368f69edc463a3472aae21d1303","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc","495da6628b9474e31d0636d66c54448bb8d84dbce902e8f70539ef6a525a2d7b","629766229f541d92210f30a92b6038568ec165fab14b7ee53bdf13667da37ca3","204dbe6c72467fb14bbe8f06510b11fb541b6ce29580c6e10ebd3bdb2eb0c1f9","c1ea344dc311b2c539ed1e3b4e17e9f4853dc7f348366b51f1d8a09a40fb223f","ce013414484233b24f42c0fcfca48a60bb66ab4e13c82953662305e8f1ee4925","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c",{"version":"101eb8b4e972b9326f39591e2e40e967e3331e8d960f81248daeb266ea1affec","affectsGlobalScope":true},"84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","0b85cb069d0e427ba946e5eb2d86ef65ffd19867042810516d16919f6c1a5aec","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","eb96a2321f717bccc3e49e104e299152984b927ea4546b559ae631c06565819c","68c559681a043ca6d622debcce75c4d82446fec08e06bf1066f71d6c325f224e","bee89e1eb6425eb49894f3f25e4562dc2564e84e5aa7610b7e13d8ecddf8f5db","e98185f4249720ace1921d59c1ff4612fa5c633a183fc9bf28e2e7b8e3c7fd51","6168414aa12d33d0fcfac4f9870aa81ce27e136db6faf182001a5f3792e1d720","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","5006668996956580886022c05108e32c742823e1b5652aff7914917233731518","0c52f5366c9146ad79b546e70162c659972a2798522806e8283f3137feab3965",{"version":"677646e2620795c98a539fb12fb531f10331c217cef1492132b2518f894fa92d","affectsGlobalScope":true},"fc37aca06f6b8b296c42412a2e75ab53d30cd1fa8a340a3bb328a723fd678377","5f2c582b9ef260cb9559a64221b38606378c1fabe17694592cdfe5975a6d7efa","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","bc81aff061c53a7140270555f4b22da4ecfe8601e8027cf5aa175fbdc7927c31","65dfa4bc49ccd1355789abb6ae215b302a5b050fdee9651124fe7e826f33113c","2887592574fcdfd087647c539dcb0fbe5af2521270dad4a37f9d17c16190d579","2d1323c55cb7a4f2cf73f03797b26645a7657dd0217beb41b0079b0490ec3370","9dcd1a6ae84def6ce3e80b27a367912e5b8e9f15c039143820ab76f7ceb8f3ab","0def05b4e59413659e7f1cad8b0e32858d7d272a4701457e7fea95618f6ef7db","3f6bff86e78e065dad71ca8e395824703f56977f7309139127e58718d7915410"],"root":[[63,69],[109,112]],"options":{"declaration":true,"esModuleInterop":true,"importHelpers":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","sourceMap":true,"strict":true,"target":9},"fileIdsList":[[159],[89,90,159],[98,159],[91,96,97,159],[91,96,159],[70,71,159],[72,159],[71,73,159],[83,88,101,102,103,105,106,159],[95,99,159],[100,159],[96,159],[95,100,104,159],[94,159],[95,159],[70,82,107,159],[74,77,78,81,159],[132,159,166],[132,159,166,169],[70,159],[132,159,166,171],[132,159,166,169,176,181],[129,132,159,166,171,177],[159,170,171,178,180],[159,187],[159,188],[159,191],[129,132,133,137,143,158,159,166,167,174,176,182,185,186,190],[113,159],[116,159],[117,122,150,159],[118,129,130,137,147,158,159],[118,119,129,137,159],[120,159],[121,122,130,138,159],[122,147,155,159],[123,125,129,137,159],[124,159],[125,126,159],[129,159],[127,129,159],[129,130,131,147,158,159],[129,130,131,144,147,150,159],[159,163],[125,129,132,137,147,158,159],[129,130,132,133,137,147,155,158,159],[132,134,147,155,158,159],[113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165],[129,135,159],[136,158,159],[125,129,137,147,159],[138,159],[139,159],[116,140,159],[141,157,159,163],[142,159],[143,159],[129,144,145,159],[144,146,159,161],[117,129,147,148,149,150,159],[117,147,149,159],[147,148,159],[150,159],[151,159],[147,159],[129,153,154,159],[153,154,159],[122,137,147,155,159],[156,159],[137,157,159],[117,132,143,158,159],[122,159],[147,159,160],[159,161],[159,162],[117,122,129,131,140,147,158,159,161,163],[147,159,164],[159,193],[159,194],[132,159,166,179],[70,80,159],[79,159],[84,159],[129,132,134,137,147,155,158,159,164,166],[129,147,159,166],[76,159],[75,159],[87,91,159],[87,159],[85,86,159],[87,91,92,93,159],[62,63,64,65,66,67,68,159],[62,66,108,159],[62,159],[62,64,65,108,159],[62,63,159],[132,134,159,166,198],[159,199,200,201],[159,198],[63,64,65,66,67,68],[63]],"referencedMap":[[89,1],[90,1],[91,2],[96,1],[99,3],[98,4],[97,5],[72,6],[73,7],[71,1],[74,8],[107,9],[83,1],[100,10],[101,11],[102,1],[103,12],[105,13],[95,14],[104,15],[106,11],[108,16],[82,17],[79,1],[167,18],[168,1],[170,19],[78,20],[70,1],[172,21],[173,1],[169,18],[174,1],[175,1],[182,22],[183,1],[184,1],[178,23],[181,24],[185,1],[186,1],[187,1],[188,25],[189,26],[176,1],[190,27],[191,28],[179,1],[192,1],[113,29],[114,29],[116,30],[117,31],[118,32],[119,33],[120,34],[121,35],[122,36],[123,37],[124,38],[125,39],[126,39],[128,40],[127,41],[129,40],[130,42],[131,43],[115,44],[165,1],[132,45],[133,46],[134,47],[166,48],[135,49],[136,50],[137,51],[138,52],[139,53],[140,54],[141,55],[142,56],[143,57],[144,58],[145,58],[146,59],[147,60],[149,61],[148,62],[150,63],[151,64],[152,65],[153,66],[154,67],[155,68],[156,69],[157,70],[158,71],[159,72],[160,73],[161,74],[162,75],[163,76],[164,77],[194,78],[193,79],[171,1],[177,1],[195,1],[180,80],[81,81],[80,82],[85,83],[84,1],[196,84],[197,85],[75,20],[77,86],[76,87],[92,88],[86,89],[93,1],[87,90],[88,89],[94,91],[62,1],[59,1],[60,1],[10,1],[11,1],[15,1],[14,1],[2,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[3,1],[4,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[61,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[13,1],[12,1],[69,92],[109,93],[66,94],[67,94],[63,94],[110,95],[65,96],[111,1],[68,94],[64,96],[112,1],[199,97],[202,98],[201,1],[200,99],[198,1]],"exportedModulesMap":[[89,1],[90,1],[91,2],[96,1],[99,3],[98,4],[97,5],[72,6],[73,7],[71,1],[74,8],[107,9],[83,1],[100,10],[101,11],[102,1],[103,12],[105,13],[95,14],[104,15],[106,11],[108,16],[82,17],[79,1],[167,18],[168,1],[170,19],[78,20],[70,1],[172,21],[173,1],[169,18],[174,1],[175,1],[182,22],[183,1],[184,1],[178,23],[181,24],[185,1],[186,1],[187,1],[188,25],[189,26],[176,1],[190,27],[191,28],[179,1],[192,1],[113,29],[114,29],[116,30],[117,31],[118,32],[119,33],[120,34],[121,35],[122,36],[123,37],[124,38],[125,39],[126,39],[128,40],[127,41],[129,40],[130,42],[131,43],[115,44],[165,1],[132,45],[133,46],[134,47],[166,48],[135,49],[136,50],[137,51],[138,52],[139,53],[140,54],[141,55],[142,56],[143,57],[144,58],[145,58],[146,59],[147,60],[149,61],[148,62],[150,63],[151,64],[152,65],[153,66],[154,67],[155,68],[156,69],[157,70],[158,71],[159,72],[160,73],[161,74],[162,75],[163,76],[164,77],[194,78],[193,79],[171,1],[177,1],[195,1],[180,80],[81,81],[80,82],[85,83],[84,1],[196,84],[197,85],[75,20],[77,86],[76,87],[92,88],[86,89],[93,1],[87,90],[88,89],[94,91],[62,1],[59,1],[60,1],[10,1],[11,1],[15,1],[14,1],[2,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[3,1],[4,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[61,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[13,1],[12,1],[69,100],[65,101],[111,1],[64,101],[112,1],[199,97],[202,98],[201,1],[200,99],[198,1]],"semanticDiagnosticsPerFile":[89,90,91,96,99,98,97,72,73,71,74,107,83,100,101,102,103,105,95,104,106,108,82,79,167,168,170,78,70,172,173,169,174,175,182,183,184,178,181,185,186,187,188,189,176,190,191,179,192,113,114,116,117,118,119,120,121,122,123,124,125,126,128,127,129,130,131,115,165,132,133,134,166,135,136,137,138,139,140,141,142,143,144,145,146,147,149,148,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,194,193,171,177,195,180,81,80,85,84,196,197,75,77,76,92,86,93,87,88,94,62,59,60,10,11,15,14,2,16,17,18,19,20,21,22,23,3,4,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,61,53,54,57,55,56,1,58,13,12,69,109,66,67,63,110,65,111,68,64,112,199,202,201,200,198]},"version":"5.0.4"}