ednl-liftstatus-web-components 1.0.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/cjs/ednl-liftstatus-web-components.cjs.js +19 -0
  4. package/dist/cjs/index-844f384e.js +1073 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +21 -0
  7. package/dist/cjs/ls-3d-scene_8.cjs.entry.js +10130 -0
  8. package/dist/collection/collection-manifest.json +19 -0
  9. package/dist/collection/components/ls-3d-scene/ls-3d-scene.css +4 -0
  10. package/dist/collection/components/ls-3d-scene/ls-3d-scene.js +17 -0
  11. package/dist/collection/components/ls-counters/ls-counters.css +4 -0
  12. package/dist/collection/components/ls-counters/ls-counters.js +17 -0
  13. package/dist/collection/components/ls-data/ls-data.css +4 -0
  14. package/dist/collection/components/ls-data/ls-data.js +51 -0
  15. package/dist/collection/components/ls-history/ls-history.css +4 -0
  16. package/dist/collection/components/ls-history/ls-history.js +17 -0
  17. package/dist/collection/components/ls-status/ls-status.css +4 -0
  18. package/dist/collection/components/ls-status/ls-status.js +24 -0
  19. package/dist/collection/components/ls-status-history/ls-status-history.css +4 -0
  20. package/dist/collection/components/ls-status-history/ls-status-history.js +17 -0
  21. package/dist/collection/components/ls-status-item/ls-status-item.css +19 -0
  22. package/dist/collection/components/ls-status-item/ls-status-item.js +68 -0
  23. package/dist/collection/components/ls-swimlane/ls-swimlane.css +4 -0
  24. package/dist/collection/components/ls-swimlane/ls-swimlane.js +17 -0
  25. package/dist/collection/index.js +1 -0
  26. package/dist/collection/utils/utils.js +3 -0
  27. package/dist/custom-elements/index.d.ts +87 -0
  28. package/dist/custom-elements/index.js +10163 -0
  29. package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.css +1 -0
  30. package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.esm.js +1 -0
  31. package/dist/ednl-liftstatus-web-components/index.esm.js +0 -0
  32. package/dist/ednl-liftstatus-web-components/p-7b9ecd22.js +1 -0
  33. package/dist/ednl-liftstatus-web-components/p-db25283a.entry.js +2 -0
  34. package/dist/esm/ednl-liftstatus-web-components.js +17 -0
  35. package/dist/esm/index-01d5c148.js +1047 -0
  36. package/dist/esm/index.js +1 -0
  37. package/dist/esm/loader.js +17 -0
  38. package/dist/esm/ls-3d-scene_8.entry.js +10119 -0
  39. package/dist/esm/polyfills/core-js.js +11 -0
  40. package/dist/esm/polyfills/css-shim.js +1 -0
  41. package/dist/esm/polyfills/dom.js +79 -0
  42. package/dist/esm/polyfills/es5-html-element.js +1 -0
  43. package/dist/esm/polyfills/index.js +34 -0
  44. package/dist/esm/polyfills/system.js +6 -0
  45. package/dist/index.cjs.js +1 -0
  46. package/dist/index.js +1 -0
  47. package/dist/types/components/ls-3d-scene/ls-3d-scene.d.ts +3 -0
  48. package/dist/types/components/ls-counters/ls-counters.d.ts +3 -0
  49. package/dist/types/components/ls-data/ls-data.d.ts +10 -0
  50. package/dist/types/components/ls-history/ls-history.d.ts +3 -0
  51. package/dist/types/components/ls-status/ls-status.d.ts +3 -0
  52. package/dist/types/components/ls-status-history/ls-status-history.d.ts +3 -0
  53. package/dist/types/components/ls-status-item/ls-status-item.d.ts +26 -0
  54. package/dist/types/components/ls-swimlane/ls-swimlane.d.ts +3 -0
  55. package/dist/types/components.d.ts +144 -0
  56. package/dist/types/index.d.ts +1 -0
  57. package/dist/types/stencil-public-runtime.d.ts +1563 -0
  58. package/dist/types/utils/utils.d.ts +1 -0
  59. package/loader/cdn.js +3 -0
  60. package/loader/index.cjs.js +3 -0
  61. package/loader/index.d.ts +13 -0
  62. package/loader/index.es2017.js +3 -0
  63. package/loader/index.js +4 -0
  64. package/loader/package.json +10 -0
  65. package/package.json +76 -0
@@ -0,0 +1,1047 @@
1
+ const NAMESPACE = 'ednl-liftstatus-web-components';
2
+
3
+ let scopeId;
4
+ let hostTagName;
5
+ let isSvgMode = false;
6
+ let queuePending = false;
7
+ const win = typeof window !== 'undefined' ? window : {};
8
+ const doc = win.document || { head: {} };
9
+ const plt = {
10
+ $flags$: 0,
11
+ $resourcesUrl$: '',
12
+ jmp: (h) => h(),
13
+ raf: (h) => requestAnimationFrame(h),
14
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
15
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
16
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
+ };
18
+ const promiseResolve = (v) => Promise.resolve(v);
19
+ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
20
+ try {
21
+ new CSSStyleSheet();
22
+ return typeof new CSSStyleSheet().replace === 'function';
23
+ }
24
+ catch (e) { }
25
+ return false;
26
+ })()
27
+ ;
28
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
29
+ const createTime = (fnName, tagName = '') => {
30
+ {
31
+ return () => {
32
+ return;
33
+ };
34
+ }
35
+ };
36
+ const uniqueTime = (key, measureText) => {
37
+ {
38
+ return () => {
39
+ return;
40
+ };
41
+ }
42
+ };
43
+ const rootAppliedStyles = new WeakMap();
44
+ const registerStyle = (scopeId, cssText, allowCS) => {
45
+ let style = styles.get(scopeId);
46
+ if (supportsConstructibleStylesheets && allowCS) {
47
+ style = (style || new CSSStyleSheet());
48
+ style.replace(cssText);
49
+ }
50
+ else {
51
+ style = cssText;
52
+ }
53
+ styles.set(scopeId, style);
54
+ };
55
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
56
+ let scopeId = getScopeId(cmpMeta);
57
+ let style = styles.get(scopeId);
58
+ // if an element is NOT connected then getRootNode() will return the wrong root node
59
+ // so the fallback is to always use the document for the root node in those cases
60
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
61
+ if (style) {
62
+ if (typeof style === 'string') {
63
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
64
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
65
+ let styleElm;
66
+ if (!appliedStyles) {
67
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
68
+ }
69
+ if (!appliedStyles.has(scopeId)) {
70
+ {
71
+ {
72
+ styleElm = doc.createElement('style');
73
+ styleElm.innerHTML = style;
74
+ }
75
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
76
+ }
77
+ if (appliedStyles) {
78
+ appliedStyles.add(scopeId);
79
+ }
80
+ }
81
+ }
82
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
83
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
84
+ }
85
+ }
86
+ return scopeId;
87
+ };
88
+ const attachStyles = (hostRef) => {
89
+ const cmpMeta = hostRef.$cmpMeta$;
90
+ const elm = hostRef.$hostElement$;
91
+ const flags = cmpMeta.$flags$;
92
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
93
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
94
+ if (flags & 10 /* needsScopedEncapsulation */) {
95
+ // only required when we're NOT using native shadow dom (slot)
96
+ // or this browser doesn't support native shadow dom
97
+ // and this host element was NOT created with SSR
98
+ // let's pick out the inner content for slot projection
99
+ // create a node to represent where the original
100
+ // content was first placed, which is useful later on
101
+ // DOM WRITE!!
102
+ elm['s-sc'] = scopeId;
103
+ elm.classList.add(scopeId + '-h');
104
+ }
105
+ endAttachStyles();
106
+ };
107
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
108
+ /**
109
+ * Default style mode id
110
+ */
111
+ /**
112
+ * Reusable empty obj/array
113
+ * Don't add values to these!!
114
+ */
115
+ const EMPTY_OBJ = {};
116
+ const isDef = (v) => v != null;
117
+ const isComplexType = (o) => {
118
+ // https://jsperf.com/typeof-fn-object/5
119
+ o = typeof o;
120
+ return o === 'object' || o === 'function';
121
+ };
122
+ /**
123
+ * Production h() function based on Preact by
124
+ * Jason Miller (@developit)
125
+ * Licensed under the MIT License
126
+ * https://github.com/developit/preact/blob/master/LICENSE
127
+ *
128
+ * Modified for Stencil's compiler and vdom
129
+ */
130
+ // const stack: any[] = [];
131
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
132
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
133
+ const h = (nodeName, vnodeData, ...children) => {
134
+ let child = null;
135
+ let simple = false;
136
+ let lastSimple = false;
137
+ let vNodeChildren = [];
138
+ const walk = (c) => {
139
+ for (let i = 0; i < c.length; i++) {
140
+ child = c[i];
141
+ if (Array.isArray(child)) {
142
+ walk(child);
143
+ }
144
+ else if (child != null && typeof child !== 'boolean') {
145
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
146
+ child = String(child);
147
+ }
148
+ if (simple && lastSimple) {
149
+ // If the previous child was simple (string), we merge both
150
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
151
+ }
152
+ else {
153
+ // Append a new vNode, if it's text, we create a text vNode
154
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
155
+ }
156
+ lastSimple = simple;
157
+ }
158
+ }
159
+ };
160
+ walk(children);
161
+ if (vnodeData) {
162
+ {
163
+ const classData = vnodeData.className || vnodeData.class;
164
+ if (classData) {
165
+ vnodeData.class =
166
+ typeof classData !== 'object'
167
+ ? classData
168
+ : Object.keys(classData)
169
+ .filter((k) => classData[k])
170
+ .join(' ');
171
+ }
172
+ }
173
+ }
174
+ const vnode = newVNode(nodeName, null);
175
+ vnode.$attrs$ = vnodeData;
176
+ if (vNodeChildren.length > 0) {
177
+ vnode.$children$ = vNodeChildren;
178
+ }
179
+ return vnode;
180
+ };
181
+ const newVNode = (tag, text) => {
182
+ const vnode = {
183
+ $flags$: 0,
184
+ $tag$: tag,
185
+ $text$: text,
186
+ $elm$: null,
187
+ $children$: null,
188
+ };
189
+ {
190
+ vnode.$attrs$ = null;
191
+ }
192
+ return vnode;
193
+ };
194
+ const Host = {};
195
+ const isHost = (node) => node && node.$tag$ === Host;
196
+ /**
197
+ * Production setAccessor() function based on Preact by
198
+ * Jason Miller (@developit)
199
+ * Licensed under the MIT License
200
+ * https://github.com/developit/preact/blob/master/LICENSE
201
+ *
202
+ * Modified for Stencil's compiler and vdom
203
+ */
204
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
205
+ if (oldValue !== newValue) {
206
+ let isProp = isMemberInElement(elm, memberName);
207
+ memberName.toLowerCase();
208
+ if (memberName === 'class') {
209
+ const classList = elm.classList;
210
+ const oldClasses = parseClassList(oldValue);
211
+ const newClasses = parseClassList(newValue);
212
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
213
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
214
+ }
215
+ else {
216
+ // Set property if it exists and it's not a SVG
217
+ const isComplex = isComplexType(newValue);
218
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
219
+ try {
220
+ if (!elm.tagName.includes('-')) {
221
+ let n = newValue == null ? '' : newValue;
222
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
223
+ if (memberName === 'list') {
224
+ isProp = false;
225
+ // tslint:disable-next-line: triple-equals
226
+ }
227
+ else if (oldValue == null || elm[memberName] != n) {
228
+ elm[memberName] = n;
229
+ }
230
+ }
231
+ else {
232
+ elm[memberName] = newValue;
233
+ }
234
+ }
235
+ catch (e) { }
236
+ }
237
+ if (newValue == null || newValue === false) {
238
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
239
+ {
240
+ elm.removeAttribute(memberName);
241
+ }
242
+ }
243
+ }
244
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
245
+ newValue = newValue === true ? '' : newValue;
246
+ {
247
+ elm.setAttribute(memberName, newValue);
248
+ }
249
+ }
250
+ }
251
+ }
252
+ };
253
+ const parseClassListRegex = /\s/;
254
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
255
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
256
+ // if the element passed in is a shadow root, which is a document fragment
257
+ // then we want to be adding attrs/props to the shadow root's "host" element
258
+ // if it's not a shadow root, then we add attrs/props to the same element
259
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
260
+ ? newVnode.$elm$.host
261
+ : newVnode.$elm$;
262
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
263
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
264
+ {
265
+ // remove attributes no longer present on the vnode by setting them to undefined
266
+ for (memberName in oldVnodeAttrs) {
267
+ if (!(memberName in newVnodeAttrs)) {
268
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
269
+ }
270
+ }
271
+ }
272
+ // add new & update changed attributes
273
+ for (memberName in newVnodeAttrs) {
274
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
275
+ }
276
+ };
277
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
278
+ // tslint:disable-next-line: prefer-const
279
+ let newVNode = newParentVNode.$children$[childIndex];
280
+ let i = 0;
281
+ let elm;
282
+ let childNode;
283
+ if (newVNode.$text$ !== null) {
284
+ // create text node
285
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
286
+ }
287
+ else {
288
+ // create element
289
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
290
+ // add css classes, attrs, props, listeners, etc.
291
+ {
292
+ updateElement(null, newVNode, isSvgMode);
293
+ }
294
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
295
+ // if there is a scopeId and this is the initial render
296
+ // then let's add the scopeId as a css class
297
+ elm.classList.add((elm['s-si'] = scopeId));
298
+ }
299
+ if (newVNode.$children$) {
300
+ for (i = 0; i < newVNode.$children$.length; ++i) {
301
+ // create the node
302
+ childNode = createElm(oldParentVNode, newVNode, i);
303
+ // return node could have been null
304
+ if (childNode) {
305
+ // append our new node
306
+ elm.appendChild(childNode);
307
+ }
308
+ }
309
+ }
310
+ }
311
+ return elm;
312
+ };
313
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
314
+ let containerElm = (parentElm);
315
+ let childNode;
316
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
317
+ containerElm = containerElm.shadowRoot;
318
+ }
319
+ for (; startIdx <= endIdx; ++startIdx) {
320
+ if (vnodes[startIdx]) {
321
+ childNode = createElm(null, parentVNode, startIdx);
322
+ if (childNode) {
323
+ vnodes[startIdx].$elm$ = childNode;
324
+ containerElm.insertBefore(childNode, before);
325
+ }
326
+ }
327
+ }
328
+ };
329
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
330
+ for (; startIdx <= endIdx; ++startIdx) {
331
+ if ((vnode = vnodes[startIdx])) {
332
+ elm = vnode.$elm$;
333
+ // remove the vnode's element from the dom
334
+ elm.remove();
335
+ }
336
+ }
337
+ };
338
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
339
+ let oldStartIdx = 0;
340
+ let newStartIdx = 0;
341
+ let oldEndIdx = oldCh.length - 1;
342
+ let oldStartVnode = oldCh[0];
343
+ let oldEndVnode = oldCh[oldEndIdx];
344
+ let newEndIdx = newCh.length - 1;
345
+ let newStartVnode = newCh[0];
346
+ let newEndVnode = newCh[newEndIdx];
347
+ let node;
348
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
349
+ if (oldStartVnode == null) {
350
+ // Vnode might have been moved left
351
+ oldStartVnode = oldCh[++oldStartIdx];
352
+ }
353
+ else if (oldEndVnode == null) {
354
+ oldEndVnode = oldCh[--oldEndIdx];
355
+ }
356
+ else if (newStartVnode == null) {
357
+ newStartVnode = newCh[++newStartIdx];
358
+ }
359
+ else if (newEndVnode == null) {
360
+ newEndVnode = newCh[--newEndIdx];
361
+ }
362
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
363
+ patch(oldStartVnode, newStartVnode);
364
+ oldStartVnode = oldCh[++oldStartIdx];
365
+ newStartVnode = newCh[++newStartIdx];
366
+ }
367
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
368
+ patch(oldEndVnode, newEndVnode);
369
+ oldEndVnode = oldCh[--oldEndIdx];
370
+ newEndVnode = newCh[--newEndIdx];
371
+ }
372
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
373
+ patch(oldStartVnode, newEndVnode);
374
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
375
+ oldStartVnode = oldCh[++oldStartIdx];
376
+ newEndVnode = newCh[--newEndIdx];
377
+ }
378
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
379
+ patch(oldEndVnode, newStartVnode);
380
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
381
+ oldEndVnode = oldCh[--oldEndIdx];
382
+ newStartVnode = newCh[++newStartIdx];
383
+ }
384
+ else {
385
+ {
386
+ // new element
387
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
388
+ newStartVnode = newCh[++newStartIdx];
389
+ }
390
+ if (node) {
391
+ {
392
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
393
+ }
394
+ }
395
+ }
396
+ }
397
+ if (oldStartIdx > oldEndIdx) {
398
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
399
+ }
400
+ else if (newStartIdx > newEndIdx) {
401
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
402
+ }
403
+ };
404
+ const isSameVnode = (vnode1, vnode2) => {
405
+ // compare if two vnode to see if they're "technically" the same
406
+ // need to have the same element tag, and same key to be the same
407
+ if (vnode1.$tag$ === vnode2.$tag$) {
408
+ return true;
409
+ }
410
+ return false;
411
+ };
412
+ const patch = (oldVNode, newVNode) => {
413
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
414
+ const oldChildren = oldVNode.$children$;
415
+ const newChildren = newVNode.$children$;
416
+ const tag = newVNode.$tag$;
417
+ const text = newVNode.$text$;
418
+ if (text === null) {
419
+ // element node
420
+ {
421
+ if (tag === 'slot')
422
+ ;
423
+ else {
424
+ // either this is the first render of an element OR it's an update
425
+ // AND we already know it's possible it could have changed
426
+ // this updates the element's css classes, attrs, props, listeners, etc.
427
+ updateElement(oldVNode, newVNode, isSvgMode);
428
+ }
429
+ }
430
+ if (oldChildren !== null && newChildren !== null) {
431
+ // looks like there's child vnodes for both the old and new vnodes
432
+ updateChildren(elm, oldChildren, newVNode, newChildren);
433
+ }
434
+ else if (newChildren !== null) {
435
+ // no old child vnodes, but there are new child vnodes to add
436
+ if (oldVNode.$text$ !== null) {
437
+ // the old vnode was text, so be sure to clear it out
438
+ elm.textContent = '';
439
+ }
440
+ // add the new vnode children
441
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
442
+ }
443
+ else if (oldChildren !== null) {
444
+ // no new child vnodes, but there are old child vnodes to remove
445
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
446
+ }
447
+ }
448
+ else if (oldVNode.$text$ !== text) {
449
+ // update the text content for the text only vnode
450
+ // and also only if the text is different than before
451
+ elm.data = text;
452
+ }
453
+ };
454
+ const renderVdom = (hostRef, renderFnResults) => {
455
+ const hostElm = hostRef.$hostElement$;
456
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
457
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
458
+ hostTagName = hostElm.tagName;
459
+ rootVnode.$tag$ = null;
460
+ rootVnode.$flags$ |= 4 /* isHost */;
461
+ hostRef.$vnode$ = rootVnode;
462
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
463
+ {
464
+ scopeId = hostElm['s-sc'];
465
+ }
466
+ // synchronous patch
467
+ patch(oldVNode, rootVnode);
468
+ };
469
+ /**
470
+ * Helper function to create & dispatch a custom Event on a provided target
471
+ * @param elm the target of the Event
472
+ * @param name the name to give the custom Event
473
+ * @param opts options for configuring a custom Event
474
+ * @returns the custom Event
475
+ */
476
+ const emitEvent = (elm, name, opts) => {
477
+ const ev = plt.ce(name, opts);
478
+ elm.dispatchEvent(ev);
479
+ return ev;
480
+ };
481
+ const attachToAncestor = (hostRef, ancestorComponent) => {
482
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
483
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
484
+ }
485
+ };
486
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
487
+ {
488
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
489
+ }
490
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
491
+ hostRef.$flags$ |= 512 /* needsRerender */;
492
+ return;
493
+ }
494
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
495
+ // there is no ancestor component or the ancestor component
496
+ // has already fired off its lifecycle update then
497
+ // fire off the initial update
498
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
499
+ return writeTask(dispatch) ;
500
+ };
501
+ const dispatchHooks = (hostRef, isInitialLoad) => {
502
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
503
+ const instance = hostRef.$lazyInstance$ ;
504
+ let promise;
505
+ if (isInitialLoad) {
506
+ {
507
+ promise = safeCall(instance, 'componentWillLoad');
508
+ }
509
+ }
510
+ endSchedule();
511
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
512
+ };
513
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
514
+ // updateComponent
515
+ const elm = hostRef.$hostElement$;
516
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
517
+ const rc = elm['s-rc'];
518
+ if (isInitialLoad) {
519
+ // DOM WRITE!
520
+ attachStyles(hostRef);
521
+ }
522
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
523
+ {
524
+ callRender(hostRef, instance);
525
+ }
526
+ if (rc) {
527
+ // ok, so turns out there are some child host elements
528
+ // waiting on this parent element to load
529
+ // let's fire off all update callbacks waiting
530
+ rc.map((cb) => cb());
531
+ elm['s-rc'] = undefined;
532
+ }
533
+ endRender();
534
+ endUpdate();
535
+ {
536
+ const childrenPromises = elm['s-p'];
537
+ const postUpdate = () => postUpdateComponent(hostRef);
538
+ if (childrenPromises.length === 0) {
539
+ postUpdate();
540
+ }
541
+ else {
542
+ Promise.all(childrenPromises).then(postUpdate);
543
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
544
+ childrenPromises.length = 0;
545
+ }
546
+ }
547
+ };
548
+ const callRender = (hostRef, instance, elm) => {
549
+ try {
550
+ instance = instance.render() ;
551
+ {
552
+ hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
553
+ }
554
+ {
555
+ hostRef.$flags$ |= 2 /* hasRendered */;
556
+ }
557
+ {
558
+ {
559
+ // looks like we've got child nodes to render into this host element
560
+ // or we need to update the css class/attrs on the host element
561
+ // DOM WRITE!
562
+ {
563
+ renderVdom(hostRef, instance);
564
+ }
565
+ }
566
+ }
567
+ }
568
+ catch (e) {
569
+ consoleError(e, hostRef.$hostElement$);
570
+ }
571
+ return null;
572
+ };
573
+ const postUpdateComponent = (hostRef) => {
574
+ const tagName = hostRef.$cmpMeta$.$tagName$;
575
+ const elm = hostRef.$hostElement$;
576
+ const endPostUpdate = createTime('postUpdate', tagName);
577
+ const ancestorComponent = hostRef.$ancestorComponent$;
578
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
579
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
580
+ {
581
+ // DOM WRITE!
582
+ addHydratedFlag(elm);
583
+ }
584
+ endPostUpdate();
585
+ {
586
+ hostRef.$onReadyResolve$(elm);
587
+ if (!ancestorComponent) {
588
+ appDidLoad();
589
+ }
590
+ }
591
+ }
592
+ else {
593
+ endPostUpdate();
594
+ }
595
+ // load events fire from bottom to top
596
+ // the deepest elements load first then bubbles up
597
+ {
598
+ if (hostRef.$onRenderResolve$) {
599
+ hostRef.$onRenderResolve$();
600
+ hostRef.$onRenderResolve$ = undefined;
601
+ }
602
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
603
+ nextTick(() => scheduleUpdate(hostRef, false));
604
+ }
605
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
606
+ }
607
+ // ( •_•)
608
+ // ( •_•)>⌐■-■
609
+ // (⌐■_■)
610
+ };
611
+ const appDidLoad = (who) => {
612
+ // on appload
613
+ // we have finish the first big initial render
614
+ {
615
+ addHydratedFlag(doc.documentElement);
616
+ }
617
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
618
+ };
619
+ const safeCall = (instance, method, arg) => {
620
+ if (instance && instance[method]) {
621
+ try {
622
+ return instance[method](arg);
623
+ }
624
+ catch (e) {
625
+ consoleError(e);
626
+ }
627
+ }
628
+ return undefined;
629
+ };
630
+ const then = (promise, thenFn) => {
631
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
632
+ };
633
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
634
+ ;
635
+ const parsePropertyValue = (propValue, propType) => {
636
+ // ensure this value is of the correct prop type
637
+ if (propValue != null && !isComplexType(propValue)) {
638
+ if (propType & 2 /* Number */) {
639
+ // force it to be a number
640
+ return parseFloat(propValue);
641
+ }
642
+ if (propType & 1 /* String */) {
643
+ // could have been passed as a number or boolean
644
+ // but we still want it as a string
645
+ return String(propValue);
646
+ }
647
+ // redundant return here for better minification
648
+ return propValue;
649
+ }
650
+ // not sure exactly what type we want
651
+ // so no need to change to a different type
652
+ return propValue;
653
+ };
654
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
655
+ const setValue = (ref, propName, newVal, cmpMeta) => {
656
+ // check our new property value against our internal value
657
+ const hostRef = getHostRef(ref);
658
+ const oldVal = hostRef.$instanceValues$.get(propName);
659
+ const flags = hostRef.$flags$;
660
+ const instance = hostRef.$lazyInstance$ ;
661
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
662
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
663
+ // gadzooks! the property's value has changed!!
664
+ // set our new value!
665
+ hostRef.$instanceValues$.set(propName, newVal);
666
+ if (instance) {
667
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
668
+ // looks like this value actually changed, so we've got work to do!
669
+ // but only if we've already rendered, otherwise just chill out
670
+ // queue that we need to do an update, but don't worry about queuing
671
+ // up millions cuz this function ensures it only runs once
672
+ scheduleUpdate(hostRef, false);
673
+ }
674
+ }
675
+ }
676
+ };
677
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
678
+ if (cmpMeta.$members$) {
679
+ // It's better to have a const than two Object.entries()
680
+ const members = Object.entries(cmpMeta.$members$);
681
+ const prototype = Cstr.prototype;
682
+ members.map(([memberName, [memberFlags]]) => {
683
+ if ((memberFlags & 31 /* Prop */ ||
684
+ ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
685
+ // proxyComponent - prop
686
+ Object.defineProperty(prototype, memberName, {
687
+ get() {
688
+ // proxyComponent, get value
689
+ return getValue(this, memberName);
690
+ },
691
+ set(newValue) {
692
+ // proxyComponent, set value
693
+ setValue(this, memberName, newValue, cmpMeta);
694
+ },
695
+ configurable: true,
696
+ enumerable: true,
697
+ });
698
+ }
699
+ });
700
+ if ((flags & 1 /* isElementConstructor */)) {
701
+ const attrNameToPropName = new Map();
702
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
703
+ plt.jmp(() => {
704
+ const propName = attrNameToPropName.get(attrName);
705
+ // In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
706
+ // in the case where an attribute was set inline.
707
+ // ```html
708
+ // <my-component some-attribute="some-value"></my-component>
709
+ // ```
710
+ //
711
+ // There is an edge case where a developer sets the attribute inline on a custom element and then programatically
712
+ // changes it before it has been upgraded as shown below:
713
+ //
714
+ // ```html
715
+ // <!-- this component has _not_ been upgraded yet -->
716
+ // <my-component id="test" some-attribute="some-value"></my-component>
717
+ // <script>
718
+ // // grab non-upgraded component
719
+ // el = document.querySelector("#test");
720
+ // el.someAttribute = "another-value";
721
+ // // upgrade component
722
+ // cutsomElements.define('my-component', MyComponent);
723
+ // </script>
724
+ // ```
725
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
726
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
727
+ // to the value that was set inline i.e. "some-value" from above example. When
728
+ // the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
729
+ //
730
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
731
+ // by connectedCallback as this attributeChangedCallback will not fire.
732
+ //
733
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
734
+ //
735
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
736
+ // properties here given that this goes against best practices outlined here
737
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
738
+ if (this.hasOwnProperty(propName)) {
739
+ newValue = this[propName];
740
+ delete this[propName];
741
+ }
742
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
743
+ });
744
+ };
745
+ // create an array of attributes to observe
746
+ // and also create a map of html attribute name to js property name
747
+ Cstr.observedAttributes = members
748
+ .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
749
+ .map(([propName, m]) => {
750
+ const attrName = m[1] || propName;
751
+ attrNameToPropName.set(attrName, propName);
752
+ return attrName;
753
+ });
754
+ }
755
+ }
756
+ return Cstr;
757
+ };
758
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
759
+ // initializeComponent
760
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
761
+ {
762
+ // we haven't initialized this element yet
763
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
764
+ // lazy loaded components
765
+ // request the component's implementation to be
766
+ // wired up with the host element
767
+ Cstr = loadModule(cmpMeta);
768
+ if (Cstr.then) {
769
+ // Await creates a micro-task avoid if possible
770
+ const endLoad = uniqueTime();
771
+ Cstr = await Cstr;
772
+ endLoad();
773
+ }
774
+ if (!Cstr.isProxied) {
775
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
776
+ Cstr.isProxied = true;
777
+ }
778
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
779
+ // ok, time to construct the instance
780
+ // but let's keep track of when we start and stop
781
+ // so that the getters/setters don't incorrectly step on data
782
+ {
783
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
784
+ }
785
+ // construct the lazy-loaded component implementation
786
+ // passing the hostRef is very important during
787
+ // construction in order to directly wire together the
788
+ // host element and the lazy-loaded instance
789
+ try {
790
+ new Cstr(hostRef);
791
+ }
792
+ catch (e) {
793
+ consoleError(e);
794
+ }
795
+ {
796
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
797
+ }
798
+ endNewInstance();
799
+ }
800
+ if (Cstr.style) {
801
+ // this component has styles but we haven't registered them yet
802
+ let style = Cstr.style;
803
+ const scopeId = getScopeId(cmpMeta);
804
+ if (!styles.has(scopeId)) {
805
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
806
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
807
+ endRegisterStyles();
808
+ }
809
+ }
810
+ }
811
+ // we've successfully created a lazy instance
812
+ const ancestorComponent = hostRef.$ancestorComponent$;
813
+ const schedule = () => scheduleUpdate(hostRef, true);
814
+ if (ancestorComponent && ancestorComponent['s-rc']) {
815
+ // this is the intial load and this component it has an ancestor component
816
+ // but the ancestor component has NOT fired its will update lifecycle yet
817
+ // so let's just cool our jets and wait for the ancestor to continue first
818
+ // this will get fired off when the ancestor component
819
+ // finally gets around to rendering its lazy self
820
+ // fire off the initial update
821
+ ancestorComponent['s-rc'].push(schedule);
822
+ }
823
+ else {
824
+ schedule();
825
+ }
826
+ };
827
+ const connectedCallback = (elm) => {
828
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
829
+ const hostRef = getHostRef(elm);
830
+ const cmpMeta = hostRef.$cmpMeta$;
831
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
832
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
833
+ // first time this component has connected
834
+ hostRef.$flags$ |= 1 /* hasConnected */;
835
+ {
836
+ // find the first ancestor component (if there is one) and register
837
+ // this component as one of the actively loading child components for its ancestor
838
+ let ancestorComponent = elm;
839
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
840
+ // climb up the ancestors looking for the first
841
+ // component that hasn't finished its lifecycle update yet
842
+ if (ancestorComponent['s-p']) {
843
+ // we found this components first ancestor component
844
+ // keep a reference to this component's ancestor component
845
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
846
+ break;
847
+ }
848
+ }
849
+ }
850
+ // Lazy properties
851
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
852
+ if (cmpMeta.$members$) {
853
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
854
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
855
+ const value = elm[memberName];
856
+ delete elm[memberName];
857
+ elm[memberName] = value;
858
+ }
859
+ });
860
+ }
861
+ {
862
+ initializeComponent(elm, hostRef, cmpMeta);
863
+ }
864
+ }
865
+ endConnected();
866
+ }
867
+ };
868
+ const disconnectedCallback = (elm) => {
869
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
870
+ const hostRef = getHostRef(elm);
871
+ const instance = hostRef.$lazyInstance$ ;
872
+ {
873
+ safeCall(instance, 'disconnectedCallback');
874
+ }
875
+ }
876
+ };
877
+ const bootstrapLazy = (lazyBundles, options = {}) => {
878
+ const endBootstrap = createTime();
879
+ const cmpTags = [];
880
+ const exclude = options.exclude || [];
881
+ const customElements = win.customElements;
882
+ const head = doc.head;
883
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
884
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
885
+ const deferredConnectedCallbacks = [];
886
+ let appLoadFallback;
887
+ let isBootstrapping = true;
888
+ Object.assign(plt, options);
889
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
890
+ lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
891
+ const cmpMeta = {
892
+ $flags$: compactMeta[0],
893
+ $tagName$: compactMeta[1],
894
+ $members$: compactMeta[2],
895
+ $listeners$: compactMeta[3],
896
+ };
897
+ {
898
+ cmpMeta.$members$ = compactMeta[2];
899
+ }
900
+ const tagName = cmpMeta.$tagName$;
901
+ const HostElement = class extends HTMLElement {
902
+ // StencilLazyHost
903
+ constructor(self) {
904
+ // @ts-ignore
905
+ super(self);
906
+ self = this;
907
+ registerHost(self, cmpMeta);
908
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
909
+ // this component is using shadow dom
910
+ // and this browser supports shadow dom
911
+ // add the read-only property "shadowRoot" to the host element
912
+ // adding the shadow root build conditionals to minimize runtime
913
+ {
914
+ {
915
+ self.attachShadow({ mode: 'open' });
916
+ }
917
+ }
918
+ }
919
+ }
920
+ connectedCallback() {
921
+ if (appLoadFallback) {
922
+ clearTimeout(appLoadFallback);
923
+ appLoadFallback = null;
924
+ }
925
+ if (isBootstrapping) {
926
+ // connectedCallback will be processed once all components have been registered
927
+ deferredConnectedCallbacks.push(this);
928
+ }
929
+ else {
930
+ plt.jmp(() => connectedCallback(this));
931
+ }
932
+ }
933
+ disconnectedCallback() {
934
+ plt.jmp(() => disconnectedCallback(this));
935
+ }
936
+ componentOnReady() {
937
+ return getHostRef(this).$onReadyPromise$;
938
+ }
939
+ };
940
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
941
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
942
+ cmpTags.push(tagName);
943
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
944
+ }
945
+ }));
946
+ {
947
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
948
+ visibilityStyle.setAttribute('data-styles', '');
949
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
950
+ }
951
+ // Process deferred connectedCallbacks now all components have been registered
952
+ isBootstrapping = false;
953
+ if (deferredConnectedCallbacks.length) {
954
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
955
+ }
956
+ else {
957
+ {
958
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
959
+ }
960
+ }
961
+ // Fallback appLoad event
962
+ endBootstrap();
963
+ };
964
+ const hostRefs = new WeakMap();
965
+ const getHostRef = (ref) => hostRefs.get(ref);
966
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
967
+ const registerHost = (elm, cmpMeta) => {
968
+ const hostRef = {
969
+ $flags$: 0,
970
+ $hostElement$: elm,
971
+ $cmpMeta$: cmpMeta,
972
+ $instanceValues$: new Map(),
973
+ };
974
+ {
975
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
976
+ elm['s-p'] = [];
977
+ elm['s-rc'] = [];
978
+ }
979
+ return hostRefs.set(elm, hostRef);
980
+ };
981
+ const isMemberInElement = (elm, memberName) => memberName in elm;
982
+ const consoleError = (e, el) => (0, console.error)(e, el);
983
+ const cmpModules = /*@__PURE__*/ new Map();
984
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
985
+ // loadModuleImport
986
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
987
+ const bundleId = cmpMeta.$lazyBundleId$;
988
+ const module = cmpModules.get(bundleId) ;
989
+ if (module) {
990
+ return module[exportName];
991
+ }
992
+ return import(
993
+ /* webpackInclude: /\.entry\.js$/ */
994
+ /* webpackExclude: /\.system\.entry\.js$/ */
995
+ /* webpackMode: "lazy" */
996
+ `./${bundleId}.entry.js${''}`).then((importedModule) => {
997
+ {
998
+ cmpModules.set(bundleId, importedModule);
999
+ }
1000
+ return importedModule[exportName];
1001
+ }, consoleError);
1002
+ };
1003
+ const styles = new Map();
1004
+ const queueDomReads = [];
1005
+ const queueDomWrites = [];
1006
+ const queueTask = (queue, write) => (cb) => {
1007
+ queue.push(cb);
1008
+ if (!queuePending) {
1009
+ queuePending = true;
1010
+ if (write && plt.$flags$ & 4 /* queueSync */) {
1011
+ nextTick(flush);
1012
+ }
1013
+ else {
1014
+ plt.raf(flush);
1015
+ }
1016
+ }
1017
+ };
1018
+ const consume = (queue) => {
1019
+ for (let i = 0; i < queue.length; i++) {
1020
+ try {
1021
+ queue[i](performance.now());
1022
+ }
1023
+ catch (e) {
1024
+ consoleError(e);
1025
+ }
1026
+ }
1027
+ queue.length = 0;
1028
+ };
1029
+ const flush = () => {
1030
+ // always force a bunch of medium callbacks to run, but still have
1031
+ // a throttle on how many can run in a certain time
1032
+ // DOM READS!!!
1033
+ consume(queueDomReads);
1034
+ // DOM WRITES!!!
1035
+ {
1036
+ consume(queueDomWrites);
1037
+ if ((queuePending = queueDomReads.length > 0)) {
1038
+ // still more to do yet, but we've run out of time
1039
+ // let's let this thing cool off and try again in the next tick
1040
+ plt.raf(flush);
1041
+ }
1042
+ }
1043
+ };
1044
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1045
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1046
+
1047
+ export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };