@planningcenter/tapestry 3.3.0 → 3.3.1-qa-887.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +136 -8
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/page-header/index.js +3 -3
- package/dist/components/sidenav/index.js +5 -5
- package/dist/ext/@internationalized/date/dist/string.js +19 -1
- package/dist/ext/@internationalized/date/dist/string.js.map +1 -1
- package/dist/reactRender.css +474 -474
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +474 -474
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/tapestry-wc/dist/components/p-B00sJe3H.js +41 -0
- package/dist/tapestry-wc/dist/components/p-B00sJe3H.js.map +1 -0
- package/dist/tapestry-wc/dist/components/p-Bn0hHWDB.js +22 -0
- package/dist/tapestry-wc/dist/components/p-Bn0hHWDB.js.map +1 -0
- package/dist/tapestry-wc/dist/components/p-Dq8WF4tc.js +886 -0
- package/dist/tapestry-wc/dist/components/p-Dq8WF4tc.js.map +1 -0
- package/dist/tapestry-wc/dist/components/p-T7x-WXUY.js +51 -0
- package/dist/tapestry-wc/dist/components/p-T7x-WXUY.js.map +1 -0
- package/dist/tapestry-wc/dist/components/p-nyMzpSUR.js +1736 -0
- package/dist/tapestry-wc/dist/components/p-nyMzpSUR.js.map +1 -0
- package/dist/tapestry-wc/dist/components/tds-page-header-nav.js +10 -0
- package/dist/tapestry-wc/dist/components/tds-page-header-nav.js.map +1 -0
- package/dist/tapestry-wc/dist/components/tds-page-header.js +63 -0
- package/dist/tapestry-wc/dist/components/tds-page-header.js.map +1 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav-item.js +96 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav-item.js.map +1 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav-responsive-header.js +10 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav-responsive-header.js.map +1 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav-section.js +52 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav-section.js.map +1 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav.js +74 -0
- package/dist/tapestry-wc/dist/components/tds-sidenav.js.map +1 -0
- package/dist/unstable.js +0 -1
- package/dist/unstable.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,1736 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Planning Center Tapestry Web Components
|
|
3
|
+
* Version: 3.3.0
|
|
4
|
+
*/
|
|
5
|
+
const NAMESPACE = 'tapestry';
|
|
6
|
+
const BUILD = /* tapestry */ { experimentalSlotFixes: true, hydratedSelectorName: "hydrated", lazyLoad: false, shadowDom: false, slotRelocation: true, updatable: true, watchCallback: false };
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Platform v4.30.0 | MIT Licensed | https://stenciljs.com
|
|
10
|
+
*/
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/utils/constants.ts
|
|
18
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
19
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
20
|
+
|
|
21
|
+
// src/client/client-host-ref.ts
|
|
22
|
+
var getHostRef = (ref) => {
|
|
23
|
+
if (ref.__stencil__getHostRef) {
|
|
24
|
+
return ref.__stencil__getHostRef();
|
|
25
|
+
}
|
|
26
|
+
return void 0;
|
|
27
|
+
};
|
|
28
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
29
|
+
const hostRef = {
|
|
30
|
+
$flags$: 0,
|
|
31
|
+
$hostElement$: hostElement,
|
|
32
|
+
$cmpMeta$: cmpMeta,
|
|
33
|
+
$instanceValues$: /* @__PURE__ */ new Map()
|
|
34
|
+
};
|
|
35
|
+
{
|
|
36
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
37
|
+
hostElement["s-p"] = [];
|
|
38
|
+
hostElement["s-rc"] = [];
|
|
39
|
+
}
|
|
40
|
+
const ref = hostRef;
|
|
41
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
42
|
+
return ref;
|
|
43
|
+
};
|
|
44
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
45
|
+
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
46
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
47
|
+
var H = win.HTMLElement || class {
|
|
48
|
+
};
|
|
49
|
+
var plt = {
|
|
50
|
+
$flags$: 0,
|
|
51
|
+
$resourcesUrl$: "",
|
|
52
|
+
jmp: (h2) => h2(),
|
|
53
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
54
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
55
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
56
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
57
|
+
};
|
|
58
|
+
var supportsShadow = BUILD.shadowDom;
|
|
59
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
60
|
+
var queuePending = false;
|
|
61
|
+
var queueDomReads = [];
|
|
62
|
+
var queueDomWrites = [];
|
|
63
|
+
var queueTask = (queue, write) => (cb) => {
|
|
64
|
+
queue.push(cb);
|
|
65
|
+
if (!queuePending) {
|
|
66
|
+
queuePending = true;
|
|
67
|
+
if (plt.$flags$ & 4 /* queueSync */) {
|
|
68
|
+
nextTick(flush);
|
|
69
|
+
} else {
|
|
70
|
+
plt.raf(flush);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var consume = (queue) => {
|
|
75
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
76
|
+
try {
|
|
77
|
+
queue[i2](performance.now());
|
|
78
|
+
} catch (e) {
|
|
79
|
+
consoleError(e);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
queue.length = 0;
|
|
83
|
+
};
|
|
84
|
+
var flush = () => {
|
|
85
|
+
consume(queueDomReads);
|
|
86
|
+
{
|
|
87
|
+
consume(queueDomWrites);
|
|
88
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
89
|
+
plt.raf(flush);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
94
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites);
|
|
95
|
+
|
|
96
|
+
// src/utils/helpers.ts
|
|
97
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
98
|
+
var isComplexType = (o) => {
|
|
99
|
+
o = typeof o;
|
|
100
|
+
return o === "object" || o === "function";
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// src/utils/regular-expression.ts
|
|
104
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
105
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// src/utils/result.ts
|
|
109
|
+
var result_exports = {};
|
|
110
|
+
__export(result_exports, {
|
|
111
|
+
err: () => err,
|
|
112
|
+
map: () => map,
|
|
113
|
+
ok: () => ok,
|
|
114
|
+
unwrap: () => unwrap,
|
|
115
|
+
unwrapErr: () => unwrapErr
|
|
116
|
+
});
|
|
117
|
+
var ok = (value) => ({
|
|
118
|
+
isOk: true,
|
|
119
|
+
isErr: false,
|
|
120
|
+
value
|
|
121
|
+
});
|
|
122
|
+
var err = (value) => ({
|
|
123
|
+
isOk: false,
|
|
124
|
+
isErr: true,
|
|
125
|
+
value
|
|
126
|
+
});
|
|
127
|
+
function map(result, fn) {
|
|
128
|
+
if (result.isOk) {
|
|
129
|
+
const val = fn(result.value);
|
|
130
|
+
if (val instanceof Promise) {
|
|
131
|
+
return val.then((newVal) => ok(newVal));
|
|
132
|
+
} else {
|
|
133
|
+
return ok(val);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (result.isErr) {
|
|
137
|
+
const value = result.value;
|
|
138
|
+
return err(value);
|
|
139
|
+
}
|
|
140
|
+
throw "should never get here";
|
|
141
|
+
}
|
|
142
|
+
var unwrap = (result) => {
|
|
143
|
+
if (result.isOk) {
|
|
144
|
+
return result.value;
|
|
145
|
+
} else {
|
|
146
|
+
throw result.value;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var unwrapErr = (result) => {
|
|
150
|
+
if (result.isErr) {
|
|
151
|
+
return result.value;
|
|
152
|
+
} else {
|
|
153
|
+
throw result.value;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
157
|
+
const childNodes = internalCall(elm, "childNodes");
|
|
158
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
159
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
160
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
161
|
+
if (getSlotChildSiblings(slotNode, getSlotName(slotNode), false).length) {
|
|
162
|
+
slotNode.hidden = true;
|
|
163
|
+
} else {
|
|
164
|
+
slotNode.hidden = false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
let i2 = 0;
|
|
170
|
+
for (i2 = 0; i2 < childNodes.length; i2++) {
|
|
171
|
+
const childNode = childNodes[i2];
|
|
172
|
+
if (childNode.nodeType === 1 /* ElementNode */ && internalCall(childNode, "childNodes").length) {
|
|
173
|
+
updateFallbackSlotVisibility(childNode);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
178
|
+
const result = [];
|
|
179
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
180
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
181
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
182
|
+
result.push(slottedNode);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return result;
|
|
186
|
+
};
|
|
187
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
188
|
+
let i2 = 0;
|
|
189
|
+
let slottedNodes = [];
|
|
190
|
+
let childNode;
|
|
191
|
+
for (; i2 < childNodes.length; i2++) {
|
|
192
|
+
childNode = childNodes[i2];
|
|
193
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0 || getSlotName(childNode) === slotName)) {
|
|
194
|
+
slottedNodes.push(childNode);
|
|
195
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
196
|
+
}
|
|
197
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
198
|
+
}
|
|
199
|
+
return slottedNodes;
|
|
200
|
+
}
|
|
201
|
+
var getSlotChildSiblings = (slot, slotName, includeSlot = true) => {
|
|
202
|
+
const childNodes = [];
|
|
203
|
+
if (includeSlot && slot["s-sr"] || !slot["s-sr"]) childNodes.push(slot);
|
|
204
|
+
let node = slot;
|
|
205
|
+
while (node = node.nextSibling) {
|
|
206
|
+
if (getSlotName(node) === slotName && (includeSlot || !node["s-sr"])) childNodes.push(node);
|
|
207
|
+
}
|
|
208
|
+
return childNodes;
|
|
209
|
+
};
|
|
210
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
211
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
212
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
return slotName === "";
|
|
224
|
+
};
|
|
225
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
226
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
230
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
231
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
232
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
233
|
+
const appendMethod = prepend ? internalCall(parent, "prepend") : internalCall(parent, "appendChild");
|
|
234
|
+
{
|
|
235
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
236
|
+
}
|
|
237
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
238
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
239
|
+
};
|
|
240
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
241
|
+
function patchSlotNode(node) {
|
|
242
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
243
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
244
|
+
const toReturn = [];
|
|
245
|
+
const slotName = this["s-sn"];
|
|
246
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
247
|
+
console.error(`
|
|
248
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
249
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
250
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
251
|
+
`);
|
|
252
|
+
}
|
|
253
|
+
const parent = this["s-cr"].parentElement;
|
|
254
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
255
|
+
slottedNodes.forEach((n) => {
|
|
256
|
+
if (slotName === getSlotName(n)) {
|
|
257
|
+
toReturn.push(n);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
if (elementsOnly) {
|
|
261
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
262
|
+
}
|
|
263
|
+
return toReturn;
|
|
264
|
+
}).bind(node);
|
|
265
|
+
node.assignedElements = assignedFactory(true);
|
|
266
|
+
node.assignedNodes = assignedFactory(false);
|
|
267
|
+
}
|
|
268
|
+
function dispatchSlotChangeEvent(elm) {
|
|
269
|
+
elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
|
|
270
|
+
}
|
|
271
|
+
function findSlotFromSlottedNode(slottedNode, parentHost) {
|
|
272
|
+
var _a;
|
|
273
|
+
parentHost = parentHost || ((_a = slottedNode["s-ol"]) == null ? void 0 : _a.parentElement);
|
|
274
|
+
if (!parentHost) return { slotNode: null, slotName: "" };
|
|
275
|
+
const slotName = slottedNode["s-sn"] = getSlotName(slottedNode) || "";
|
|
276
|
+
const childNodes = internalCall(parentHost, "childNodes");
|
|
277
|
+
const slotNode = getHostSlotNodes(childNodes, parentHost.tagName, slotName)[0];
|
|
278
|
+
return { slotNode, slotName };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/runtime/dom-extras.ts
|
|
282
|
+
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
283
|
+
patchCloneNode(hostElementPrototype);
|
|
284
|
+
patchSlotAppendChild(hostElementPrototype);
|
|
285
|
+
patchSlotAppend(hostElementPrototype);
|
|
286
|
+
patchSlotPrepend(hostElementPrototype);
|
|
287
|
+
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
288
|
+
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
289
|
+
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
290
|
+
patchInsertBefore(hostElementPrototype);
|
|
291
|
+
patchTextContent(hostElementPrototype);
|
|
292
|
+
patchChildSlotNodes(hostElementPrototype);
|
|
293
|
+
patchSlotRemoveChild(hostElementPrototype);
|
|
294
|
+
};
|
|
295
|
+
var patchCloneNode = (HostElementPrototype) => {
|
|
296
|
+
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
297
|
+
HostElementPrototype.cloneNode = function(deep) {
|
|
298
|
+
const srcNode = this;
|
|
299
|
+
const clonedNode = orgCloneNode.call(srcNode, false);
|
|
300
|
+
if (deep) {
|
|
301
|
+
let i2 = 0;
|
|
302
|
+
let slotted, nonStencilNode;
|
|
303
|
+
const stencilPrivates = [
|
|
304
|
+
"s-id",
|
|
305
|
+
"s-cr",
|
|
306
|
+
"s-lr",
|
|
307
|
+
"s-rc",
|
|
308
|
+
"s-sc",
|
|
309
|
+
"s-p",
|
|
310
|
+
"s-cn",
|
|
311
|
+
"s-sr",
|
|
312
|
+
"s-sn",
|
|
313
|
+
"s-hn",
|
|
314
|
+
"s-ol",
|
|
315
|
+
"s-nr",
|
|
316
|
+
"s-si",
|
|
317
|
+
"s-rf",
|
|
318
|
+
"s-scs"
|
|
319
|
+
];
|
|
320
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
321
|
+
for (; i2 < childNodes.length; i2++) {
|
|
322
|
+
slotted = childNodes[i2]["s-nr"];
|
|
323
|
+
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
324
|
+
if (slotted) {
|
|
325
|
+
if (clonedNode.__appendChild) {
|
|
326
|
+
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
327
|
+
} else {
|
|
328
|
+
clonedNode.appendChild(slotted.cloneNode(true));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (nonStencilNode) {
|
|
332
|
+
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return clonedNode;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
340
|
+
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
341
|
+
HostElementPrototype.appendChild = function(newChild) {
|
|
342
|
+
const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
|
|
343
|
+
if (slotNode) {
|
|
344
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
345
|
+
const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
|
|
346
|
+
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
347
|
+
const parent = internalCall(appendAfter, "parentNode");
|
|
348
|
+
const insertedNode = internalCall(parent, "insertBefore")(newChild, appendAfter.nextSibling);
|
|
349
|
+
dispatchSlotChangeEvent(slotNode);
|
|
350
|
+
updateFallbackSlotVisibility(this);
|
|
351
|
+
return insertedNode;
|
|
352
|
+
}
|
|
353
|
+
return this.__appendChild(newChild);
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
357
|
+
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
358
|
+
ElementPrototype.removeChild = function(toRemove) {
|
|
359
|
+
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
360
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
361
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
362
|
+
if (slotNode && toRemove.isConnected) {
|
|
363
|
+
toRemove.remove();
|
|
364
|
+
updateFallbackSlotVisibility(this);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return this.__removeChild(toRemove);
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
var patchSlotPrepend = (HostElementPrototype) => {
|
|
372
|
+
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
373
|
+
HostElementPrototype.prepend = function(...newChildren) {
|
|
374
|
+
newChildren.forEach((newChild) => {
|
|
375
|
+
if (typeof newChild === "string") {
|
|
376
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
377
|
+
}
|
|
378
|
+
const slotName = (newChild["s-sn"] = getSlotName(newChild)) || "";
|
|
379
|
+
const childNodes = internalCall(this, "childNodes");
|
|
380
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
381
|
+
if (slotNode) {
|
|
382
|
+
addSlotRelocateNode(newChild, slotNode, true);
|
|
383
|
+
const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
|
|
384
|
+
const appendAfter = slotChildNodes[0];
|
|
385
|
+
const parent = internalCall(appendAfter, "parentNode");
|
|
386
|
+
const toReturn = internalCall(parent, "insertBefore")(newChild, internalCall(appendAfter, "nextSibling"));
|
|
387
|
+
dispatchSlotChangeEvent(slotNode);
|
|
388
|
+
return toReturn;
|
|
389
|
+
}
|
|
390
|
+
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
391
|
+
newChild.hidden = true;
|
|
392
|
+
}
|
|
393
|
+
return HostElementPrototype.__prepend(newChild);
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
var patchSlotAppend = (HostElementPrototype) => {
|
|
398
|
+
HostElementPrototype.__append = HostElementPrototype.append;
|
|
399
|
+
HostElementPrototype.append = function(...newChildren) {
|
|
400
|
+
newChildren.forEach((newChild) => {
|
|
401
|
+
if (typeof newChild === "string") {
|
|
402
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
403
|
+
}
|
|
404
|
+
this.appendChild(newChild);
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
409
|
+
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
410
|
+
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
411
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
412
|
+
return originalInsertAdjacentHtml.call(this, position, text);
|
|
413
|
+
}
|
|
414
|
+
const container = this.ownerDocument.createElement("_");
|
|
415
|
+
let node;
|
|
416
|
+
container.innerHTML = text;
|
|
417
|
+
if (position === "afterbegin") {
|
|
418
|
+
while (node = container.firstChild) {
|
|
419
|
+
this.prepend(node);
|
|
420
|
+
}
|
|
421
|
+
} else if (position === "beforeend") {
|
|
422
|
+
while (node = container.firstChild) {
|
|
423
|
+
this.append(node);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
429
|
+
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
430
|
+
this.insertAdjacentHTML(position, text);
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
var patchInsertBefore = (HostElementPrototype) => {
|
|
434
|
+
const eleProto = HostElementPrototype;
|
|
435
|
+
if (eleProto.__insertBefore) return;
|
|
436
|
+
eleProto.__insertBefore = HostElementPrototype.insertBefore;
|
|
437
|
+
HostElementPrototype.insertBefore = function(newChild, currentChild) {
|
|
438
|
+
const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
|
|
439
|
+
const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
440
|
+
if (slotNode) {
|
|
441
|
+
let found = false;
|
|
442
|
+
slottedNodes.forEach((childNode) => {
|
|
443
|
+
if (childNode === currentChild || currentChild === null) {
|
|
444
|
+
found = true;
|
|
445
|
+
if (currentChild === null || slotName !== currentChild["s-sn"]) {
|
|
446
|
+
this.appendChild(newChild);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (slotName === currentChild["s-sn"]) {
|
|
450
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
451
|
+
const parent = internalCall(currentChild, "parentNode");
|
|
452
|
+
internalCall(parent, "insertBefore")(newChild, currentChild);
|
|
453
|
+
dispatchSlotChangeEvent(slotNode);
|
|
454
|
+
}
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
if (found) return newChild;
|
|
459
|
+
}
|
|
460
|
+
const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;
|
|
461
|
+
if (parentNode && !this.isSameNode(parentNode)) {
|
|
462
|
+
return this.appendChild(newChild);
|
|
463
|
+
}
|
|
464
|
+
return this.__insertBefore(newChild, currentChild);
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
468
|
+
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
469
|
+
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
470
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
471
|
+
return originalInsertAdjacentElement.call(this, position, element);
|
|
472
|
+
}
|
|
473
|
+
if (position === "afterbegin") {
|
|
474
|
+
this.prepend(element);
|
|
475
|
+
return element;
|
|
476
|
+
} else if (position === "beforeend") {
|
|
477
|
+
this.append(element);
|
|
478
|
+
return element;
|
|
479
|
+
}
|
|
480
|
+
return element;
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
var patchTextContent = (hostElementPrototype) => {
|
|
484
|
+
patchHostOriginalAccessor("textContent", hostElementPrototype);
|
|
485
|
+
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
486
|
+
get: function() {
|
|
487
|
+
let text = "";
|
|
488
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
489
|
+
childNodes.forEach((node) => text += node.textContent || "");
|
|
490
|
+
return text;
|
|
491
|
+
},
|
|
492
|
+
set: function(value) {
|
|
493
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
494
|
+
childNodes.forEach((node) => {
|
|
495
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
496
|
+
node.remove();
|
|
497
|
+
});
|
|
498
|
+
this.insertAdjacentHTML("beforeend", value);
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
var patchChildSlotNodes = (elm) => {
|
|
503
|
+
class FakeNodeList extends Array {
|
|
504
|
+
item(n) {
|
|
505
|
+
return this[n];
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
patchHostOriginalAccessor("children", elm);
|
|
509
|
+
Object.defineProperty(elm, "children", {
|
|
510
|
+
get() {
|
|
511
|
+
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
Object.defineProperty(elm, "childElementCount", {
|
|
515
|
+
get() {
|
|
516
|
+
return this.children.length;
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
patchHostOriginalAccessor("firstChild", elm);
|
|
520
|
+
Object.defineProperty(elm, "firstChild", {
|
|
521
|
+
get() {
|
|
522
|
+
return this.childNodes[0];
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
patchHostOriginalAccessor("lastChild", elm);
|
|
526
|
+
Object.defineProperty(elm, "lastChild", {
|
|
527
|
+
get() {
|
|
528
|
+
return this.childNodes[this.childNodes.length - 1];
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
patchHostOriginalAccessor("childNodes", elm);
|
|
532
|
+
Object.defineProperty(elm, "childNodes", {
|
|
533
|
+
get() {
|
|
534
|
+
const result = new FakeNodeList();
|
|
535
|
+
result.push(...getSlottedChildNodes(this.__childNodes));
|
|
536
|
+
return result;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
};
|
|
540
|
+
var patchParentNode = (node) => {
|
|
541
|
+
if (!node || node.__parentNode) return;
|
|
542
|
+
patchHostOriginalAccessor("parentNode", node);
|
|
543
|
+
Object.defineProperty(node, "parentNode", {
|
|
544
|
+
get: function() {
|
|
545
|
+
var _a;
|
|
546
|
+
return ((_a = this["s-ol"]) == null ? void 0 : _a.parentNode) || this.__parentNode;
|
|
547
|
+
},
|
|
548
|
+
set: function(value) {
|
|
549
|
+
this.__parentNode = value;
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
554
|
+
var validNodesPatches = [
|
|
555
|
+
"childNodes",
|
|
556
|
+
"firstChild",
|
|
557
|
+
"lastChild",
|
|
558
|
+
"nextSibling",
|
|
559
|
+
"previousSibling",
|
|
560
|
+
"textContent",
|
|
561
|
+
"parentNode"
|
|
562
|
+
];
|
|
563
|
+
function patchHostOriginalAccessor(accessorName, node) {
|
|
564
|
+
let accessor;
|
|
565
|
+
if (validElementPatches.includes(accessorName)) {
|
|
566
|
+
accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
|
|
567
|
+
} else if (validNodesPatches.includes(accessorName)) {
|
|
568
|
+
accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
|
|
569
|
+
}
|
|
570
|
+
if (!accessor) {
|
|
571
|
+
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
572
|
+
}
|
|
573
|
+
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
574
|
+
}
|
|
575
|
+
function internalCall(node, method) {
|
|
576
|
+
if ("__" + method in node) {
|
|
577
|
+
const toReturn = node["__" + method];
|
|
578
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
579
|
+
return toReturn.bind(node);
|
|
580
|
+
} else {
|
|
581
|
+
if (typeof node[method] !== "function") return node[method];
|
|
582
|
+
return node[method].bind(node);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
var createTime = (fnName, tagName = "") => {
|
|
586
|
+
{
|
|
587
|
+
return () => {
|
|
588
|
+
return;
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
var h = (nodeName, vnodeData, ...children) => {
|
|
593
|
+
let child = null;
|
|
594
|
+
let key = null;
|
|
595
|
+
let slotName = null;
|
|
596
|
+
let simple = false;
|
|
597
|
+
let lastSimple = false;
|
|
598
|
+
const vNodeChildren = [];
|
|
599
|
+
const walk = (c) => {
|
|
600
|
+
for (let i2 = 0; i2 < c.length; i2++) {
|
|
601
|
+
child = c[i2];
|
|
602
|
+
if (Array.isArray(child)) {
|
|
603
|
+
walk(child);
|
|
604
|
+
} else if (child != null && typeof child !== "boolean") {
|
|
605
|
+
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
606
|
+
child = String(child);
|
|
607
|
+
}
|
|
608
|
+
if (simple && lastSimple) {
|
|
609
|
+
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
610
|
+
} else {
|
|
611
|
+
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
612
|
+
}
|
|
613
|
+
lastSimple = simple;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
walk(children);
|
|
618
|
+
if (vnodeData) {
|
|
619
|
+
if (vnodeData.key) {
|
|
620
|
+
key = vnodeData.key;
|
|
621
|
+
}
|
|
622
|
+
if (vnodeData.name) {
|
|
623
|
+
slotName = vnodeData.name;
|
|
624
|
+
}
|
|
625
|
+
{
|
|
626
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
627
|
+
if (classData) {
|
|
628
|
+
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
const vnode = newVNode(nodeName, null);
|
|
633
|
+
vnode.$attrs$ = vnodeData;
|
|
634
|
+
if (vNodeChildren.length > 0) {
|
|
635
|
+
vnode.$children$ = vNodeChildren;
|
|
636
|
+
}
|
|
637
|
+
{
|
|
638
|
+
vnode.$key$ = key;
|
|
639
|
+
}
|
|
640
|
+
{
|
|
641
|
+
vnode.$name$ = slotName;
|
|
642
|
+
}
|
|
643
|
+
return vnode;
|
|
644
|
+
};
|
|
645
|
+
var newVNode = (tag, text) => {
|
|
646
|
+
const vnode = {
|
|
647
|
+
$flags$: 0,
|
|
648
|
+
$tag$: tag,
|
|
649
|
+
$text$: text,
|
|
650
|
+
$elm$: null,
|
|
651
|
+
$children$: null
|
|
652
|
+
};
|
|
653
|
+
{
|
|
654
|
+
vnode.$attrs$ = null;
|
|
655
|
+
}
|
|
656
|
+
{
|
|
657
|
+
vnode.$key$ = null;
|
|
658
|
+
}
|
|
659
|
+
{
|
|
660
|
+
vnode.$name$ = null;
|
|
661
|
+
}
|
|
662
|
+
return vnode;
|
|
663
|
+
};
|
|
664
|
+
var Host = {};
|
|
665
|
+
var isHost = (node) => node && node.$tag$ === Host;
|
|
666
|
+
var createSupportsRuleRe = (selector) => {
|
|
667
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
668
|
+
return new RegExp(
|
|
669
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
670
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
671
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
672
|
+
"g"
|
|
673
|
+
);
|
|
674
|
+
};
|
|
675
|
+
createSupportsRuleRe("::slotted");
|
|
676
|
+
createSupportsRuleRe(":host");
|
|
677
|
+
createSupportsRuleRe(":host-context");
|
|
678
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
679
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
680
|
+
if (propType & 4 /* Boolean */) {
|
|
681
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
682
|
+
}
|
|
683
|
+
if (propType & 2 /* Number */) {
|
|
684
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
685
|
+
}
|
|
686
|
+
if (propType & 1 /* String */) {
|
|
687
|
+
return String(propValue);
|
|
688
|
+
}
|
|
689
|
+
return propValue;
|
|
690
|
+
}
|
|
691
|
+
return propValue;
|
|
692
|
+
};
|
|
693
|
+
var emitEvent = (elm, name, opts) => {
|
|
694
|
+
const ev = plt.ce(name, opts);
|
|
695
|
+
elm.dispatchEvent(ev);
|
|
696
|
+
return ev;
|
|
697
|
+
};
|
|
698
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
699
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
700
|
+
if (oldValue === newValue) {
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
704
|
+
let ln = memberName.toLowerCase();
|
|
705
|
+
if (memberName === "class") {
|
|
706
|
+
const classList = elm.classList;
|
|
707
|
+
const oldClasses = parseClassList(oldValue);
|
|
708
|
+
let newClasses = parseClassList(newValue);
|
|
709
|
+
{
|
|
710
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
711
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
712
|
+
}
|
|
713
|
+
} else if (memberName === "key") ; else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
714
|
+
if (memberName[2] === "-") {
|
|
715
|
+
memberName = memberName.slice(3);
|
|
716
|
+
} else if (isMemberInElement(win, ln)) {
|
|
717
|
+
memberName = ln.slice(2);
|
|
718
|
+
} else {
|
|
719
|
+
memberName = ln[2] + memberName.slice(3);
|
|
720
|
+
}
|
|
721
|
+
if (oldValue || newValue) {
|
|
722
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
723
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
724
|
+
if (oldValue) {
|
|
725
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
726
|
+
}
|
|
727
|
+
if (newValue) {
|
|
728
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
} else {
|
|
732
|
+
const isComplex = isComplexType(newValue);
|
|
733
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
734
|
+
try {
|
|
735
|
+
if (!elm.tagName.includes("-")) {
|
|
736
|
+
const n = newValue == null ? "" : newValue;
|
|
737
|
+
if (memberName === "list") {
|
|
738
|
+
isProp = false;
|
|
739
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
740
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
741
|
+
elm[memberName] = n;
|
|
742
|
+
} else {
|
|
743
|
+
elm.setAttribute(memberName, n);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
} else if (elm[memberName] !== newValue) {
|
|
747
|
+
elm[memberName] = newValue;
|
|
748
|
+
}
|
|
749
|
+
} catch (e) {
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
if (newValue == null || newValue === false) {
|
|
753
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
754
|
+
{
|
|
755
|
+
elm.removeAttribute(memberName);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
759
|
+
newValue = newValue === true ? "" : newValue;
|
|
760
|
+
{
|
|
761
|
+
elm.setAttribute(memberName, newValue);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
var parseClassListRegex = /\s/;
|
|
767
|
+
var parseClassList = (value) => {
|
|
768
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
769
|
+
value = value.baseVal;
|
|
770
|
+
}
|
|
771
|
+
if (!value || typeof value !== "string") {
|
|
772
|
+
return [];
|
|
773
|
+
}
|
|
774
|
+
return value.split(parseClassListRegex);
|
|
775
|
+
};
|
|
776
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
777
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
778
|
+
|
|
779
|
+
// src/runtime/vdom/update-element.ts
|
|
780
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
781
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
782
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
783
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
784
|
+
{
|
|
785
|
+
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
786
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
787
|
+
setAccessor(
|
|
788
|
+
elm,
|
|
789
|
+
memberName,
|
|
790
|
+
oldVnodeAttrs[memberName],
|
|
791
|
+
void 0,
|
|
792
|
+
isSvgMode2,
|
|
793
|
+
newVnode.$flags$);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
798
|
+
setAccessor(
|
|
799
|
+
elm,
|
|
800
|
+
memberName,
|
|
801
|
+
oldVnodeAttrs[memberName],
|
|
802
|
+
newVnodeAttrs[memberName],
|
|
803
|
+
isSvgMode2,
|
|
804
|
+
newVnode.$flags$);
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
function sortedAttrNames(attrNames) {
|
|
808
|
+
return attrNames.includes("ref") ? (
|
|
809
|
+
// we need to sort these to ensure that `'ref'` is the last attr
|
|
810
|
+
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
811
|
+
) : (
|
|
812
|
+
// no need to sort, return the original array
|
|
813
|
+
attrNames
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
// src/runtime/vdom/vdom-render.ts
|
|
818
|
+
var scopeId;
|
|
819
|
+
var contentRef;
|
|
820
|
+
var hostTagName;
|
|
821
|
+
var useNativeShadowDom = false;
|
|
822
|
+
var checkSlotFallbackVisibility = false;
|
|
823
|
+
var checkSlotRelocate = false;
|
|
824
|
+
var isSvgMode = false;
|
|
825
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
826
|
+
var _a;
|
|
827
|
+
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
828
|
+
let i2 = 0;
|
|
829
|
+
let elm;
|
|
830
|
+
let childNode;
|
|
831
|
+
let oldVNode;
|
|
832
|
+
if (!useNativeShadowDom) {
|
|
833
|
+
checkSlotRelocate = true;
|
|
834
|
+
if (newVNode2.$tag$ === "slot") {
|
|
835
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
836
|
+
// slot element has fallback content
|
|
837
|
+
// still create an element that "mocks" the slot element
|
|
838
|
+
2 /* isSlotFallback */
|
|
839
|
+
) : (
|
|
840
|
+
// slot element does not have fallback content
|
|
841
|
+
// create an html comment we'll use to always reference
|
|
842
|
+
// where actual slot content should sit next to
|
|
843
|
+
1 /* isSlotReference */
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if (newVNode2.$text$ !== null) {
|
|
848
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
849
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
850
|
+
elm = newVNode2.$elm$ = win.document.createTextNode("");
|
|
851
|
+
{
|
|
852
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
853
|
+
}
|
|
854
|
+
} else {
|
|
855
|
+
if (!isSvgMode) {
|
|
856
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
857
|
+
}
|
|
858
|
+
if (!win.document) {
|
|
859
|
+
throw new Error(
|
|
860
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
864
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
865
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
866
|
+
) ;
|
|
867
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
868
|
+
isSvgMode = false;
|
|
869
|
+
}
|
|
870
|
+
{
|
|
871
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
872
|
+
}
|
|
873
|
+
if (isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
874
|
+
elm.classList.add(elm["s-si"] = scopeId);
|
|
875
|
+
}
|
|
876
|
+
if (newVNode2.$children$) {
|
|
877
|
+
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
878
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
879
|
+
if (childNode) {
|
|
880
|
+
elm.appendChild(childNode);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
{
|
|
885
|
+
if (newVNode2.$tag$ === "svg") {
|
|
886
|
+
isSvgMode = false;
|
|
887
|
+
} else if (elm.tagName === "foreignObject") {
|
|
888
|
+
isSvgMode = true;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
elm["s-hn"] = hostTagName;
|
|
893
|
+
{
|
|
894
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
895
|
+
elm["s-sr"] = true;
|
|
896
|
+
elm["s-cr"] = contentRef;
|
|
897
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
898
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
899
|
+
patchSlotNode(elm);
|
|
900
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
901
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
902
|
+
{
|
|
903
|
+
relocateToHostRoot(oldParentVNode.$elm$);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
{
|
|
907
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return elm;
|
|
912
|
+
};
|
|
913
|
+
var relocateToHostRoot = (parentElm) => {
|
|
914
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
915
|
+
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
916
|
+
if (host != null) {
|
|
917
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
918
|
+
(ref) => ref["s-cr"]
|
|
919
|
+
);
|
|
920
|
+
const childNodeArray = Array.from(
|
|
921
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
922
|
+
);
|
|
923
|
+
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
924
|
+
if (childNode["s-sh"] != null) {
|
|
925
|
+
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
926
|
+
childNode["s-sh"] = void 0;
|
|
927
|
+
checkSlotRelocate = true;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
932
|
+
};
|
|
933
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
934
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
935
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
936
|
+
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
937
|
+
let node = parentElm;
|
|
938
|
+
while (node = node.nextSibling) {
|
|
939
|
+
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
940
|
+
oldSlotChildNodes.push(node);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
945
|
+
const childNode = oldSlotChildNodes[i2];
|
|
946
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
947
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
948
|
+
childNode["s-ol"].remove();
|
|
949
|
+
childNode["s-ol"] = void 0;
|
|
950
|
+
childNode["s-sh"] = void 0;
|
|
951
|
+
checkSlotRelocate = true;
|
|
952
|
+
}
|
|
953
|
+
if (recursive) {
|
|
954
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
958
|
+
};
|
|
959
|
+
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
960
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
961
|
+
let childNode;
|
|
962
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
963
|
+
if (vnodes[startIdx]) {
|
|
964
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
965
|
+
if (childNode) {
|
|
966
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
967
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
973
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
974
|
+
const vnode = vnodes[index];
|
|
975
|
+
if (vnode) {
|
|
976
|
+
const elm = vnode.$elm$;
|
|
977
|
+
if (elm) {
|
|
978
|
+
{
|
|
979
|
+
checkSlotFallbackVisibility = true;
|
|
980
|
+
if (elm["s-ol"]) {
|
|
981
|
+
elm["s-ol"].remove();
|
|
982
|
+
} else {
|
|
983
|
+
putBackInOriginalLocation(elm, true);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
elm.remove();
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
|
|
992
|
+
let oldStartIdx = 0;
|
|
993
|
+
let newStartIdx = 0;
|
|
994
|
+
let idxInOld = 0;
|
|
995
|
+
let i2 = 0;
|
|
996
|
+
let oldEndIdx = oldCh.length - 1;
|
|
997
|
+
let oldStartVnode = oldCh[0];
|
|
998
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
999
|
+
let newEndIdx = newCh.length - 1;
|
|
1000
|
+
let newStartVnode = newCh[0];
|
|
1001
|
+
let newEndVnode = newCh[newEndIdx];
|
|
1002
|
+
let node;
|
|
1003
|
+
let elmToMove;
|
|
1004
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
1005
|
+
if (oldStartVnode == null) {
|
|
1006
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1007
|
+
} else if (oldEndVnode == null) {
|
|
1008
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1009
|
+
} else if (newStartVnode == null) {
|
|
1010
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1011
|
+
} else if (newEndVnode == null) {
|
|
1012
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1013
|
+
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
1014
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
1015
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1016
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1017
|
+
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
1018
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
1019
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1020
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1021
|
+
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1022
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1023
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1024
|
+
}
|
|
1025
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
1026
|
+
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
1027
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1028
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1029
|
+
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1030
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1031
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1032
|
+
}
|
|
1033
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
1034
|
+
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
1035
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1036
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1037
|
+
} else {
|
|
1038
|
+
idxInOld = -1;
|
|
1039
|
+
{
|
|
1040
|
+
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1041
|
+
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1042
|
+
idxInOld = i2;
|
|
1043
|
+
break;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
if (idxInOld >= 0) {
|
|
1048
|
+
elmToMove = oldCh[idxInOld];
|
|
1049
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1050
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
1051
|
+
} else {
|
|
1052
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1053
|
+
oldCh[idxInOld] = void 0;
|
|
1054
|
+
node = elmToMove.$elm$;
|
|
1055
|
+
}
|
|
1056
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1057
|
+
} else {
|
|
1058
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
1059
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1060
|
+
}
|
|
1061
|
+
if (node) {
|
|
1062
|
+
{
|
|
1063
|
+
insertBefore(
|
|
1064
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1065
|
+
node,
|
|
1066
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
if (oldStartIdx > oldEndIdx) {
|
|
1073
|
+
addVnodes(
|
|
1074
|
+
parentElm,
|
|
1075
|
+
newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
|
|
1076
|
+
newVNode2,
|
|
1077
|
+
newCh,
|
|
1078
|
+
newStartIdx,
|
|
1079
|
+
newEndIdx
|
|
1080
|
+
);
|
|
1081
|
+
} else if (newStartIdx > newEndIdx) {
|
|
1082
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1086
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1087
|
+
if (leftVNode.$tag$ === "slot") {
|
|
1088
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
1089
|
+
}
|
|
1090
|
+
if (!isInitialRender) {
|
|
1091
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
1092
|
+
}
|
|
1093
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1094
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1095
|
+
}
|
|
1096
|
+
return true;
|
|
1097
|
+
}
|
|
1098
|
+
return false;
|
|
1099
|
+
};
|
|
1100
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
1101
|
+
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
1102
|
+
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1103
|
+
const oldChildren = oldVNode.$children$;
|
|
1104
|
+
const newChildren = newVNode2.$children$;
|
|
1105
|
+
const tag = newVNode2.$tag$;
|
|
1106
|
+
const text = newVNode2.$text$;
|
|
1107
|
+
let defaultHolder;
|
|
1108
|
+
if (text === null) {
|
|
1109
|
+
{
|
|
1110
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1111
|
+
}
|
|
1112
|
+
{
|
|
1113
|
+
if (tag === "slot" && !useNativeShadowDom) {
|
|
1114
|
+
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
1115
|
+
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1116
|
+
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1120
|
+
}
|
|
1121
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
1122
|
+
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1123
|
+
} else if (newChildren !== null) {
|
|
1124
|
+
if (oldVNode.$text$ !== null) {
|
|
1125
|
+
elm.textContent = "";
|
|
1126
|
+
}
|
|
1127
|
+
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1128
|
+
} else if (
|
|
1129
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1130
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1131
|
+
) {
|
|
1132
|
+
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1133
|
+
}
|
|
1134
|
+
if (isSvgMode && tag === "svg") {
|
|
1135
|
+
isSvgMode = false;
|
|
1136
|
+
}
|
|
1137
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1138
|
+
defaultHolder.parentNode.textContent = text;
|
|
1139
|
+
} else if (oldVNode.$text$ !== text) {
|
|
1140
|
+
elm.data = text;
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
var relocateNodes = [];
|
|
1144
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1145
|
+
let node;
|
|
1146
|
+
let hostContentNodes;
|
|
1147
|
+
let j;
|
|
1148
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1149
|
+
for (const childNode of children) {
|
|
1150
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1151
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1152
|
+
const slotName = childNode["s-sn"];
|
|
1153
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1154
|
+
node = hostContentNodes[j];
|
|
1155
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1156
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1157
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1158
|
+
checkSlotFallbackVisibility = true;
|
|
1159
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1160
|
+
if (relocateNodeData) {
|
|
1161
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1162
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1163
|
+
} else {
|
|
1164
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1165
|
+
relocateNodes.push({
|
|
1166
|
+
$slotRefNode$: childNode,
|
|
1167
|
+
$nodeToRelocate$: node
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
if (node["s-sr"]) {
|
|
1171
|
+
relocateNodes.map((relocateNode) => {
|
|
1172
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1173
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1174
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1175
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1181
|
+
relocateNodes.push({
|
|
1182
|
+
$nodeToRelocate$: node
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1189
|
+
markSlotContentForRelocation(childNode);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
var insertBefore = (parent, newNode, reference) => {
|
|
1194
|
+
if (typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1195
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1196
|
+
} else if (typeof newNode["s-sn"] === "string") {
|
|
1197
|
+
if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
|
|
1198
|
+
patchParentNode(newNode);
|
|
1199
|
+
}
|
|
1200
|
+
parent.insertBefore(newNode, reference);
|
|
1201
|
+
const { slotNode } = findSlotFromSlottedNode(newNode);
|
|
1202
|
+
if (slotNode) dispatchSlotChangeEvent(slotNode);
|
|
1203
|
+
return newNode;
|
|
1204
|
+
}
|
|
1205
|
+
if (parent.__insertBefore) {
|
|
1206
|
+
return parent.__insertBefore(newNode, reference);
|
|
1207
|
+
} else {
|
|
1208
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1212
|
+
var _a, _b;
|
|
1213
|
+
let scopeId2;
|
|
1214
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1215
|
+
const scopeName = slotNode["s-sn"];
|
|
1216
|
+
const hostName = slotNode["s-hn"];
|
|
1217
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1218
|
+
if (oldParent && ((_b = oldParent.classList) == null ? void 0 : _b.contains(scopeId2 + "-s"))) {
|
|
1219
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1220
|
+
let found = false;
|
|
1221
|
+
while (child) {
|
|
1222
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1223
|
+
found = true;
|
|
1224
|
+
break;
|
|
1225
|
+
}
|
|
1226
|
+
child = child.nextSibling;
|
|
1227
|
+
}
|
|
1228
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1233
|
+
var _a, _b, _c, _d, _e;
|
|
1234
|
+
const hostElm = hostRef.$hostElement$;
|
|
1235
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1236
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1237
|
+
const isHostElement = isHost(renderFnResults);
|
|
1238
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1239
|
+
hostTagName = hostElm.tagName;
|
|
1240
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1241
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1242
|
+
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
1243
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
rootVnode.$tag$ = null;
|
|
1248
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1249
|
+
hostRef.$vnode$ = rootVnode;
|
|
1250
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm;
|
|
1251
|
+
{
|
|
1252
|
+
scopeId = hostElm["s-sc"];
|
|
1253
|
+
}
|
|
1254
|
+
useNativeShadowDom = supportsShadow;
|
|
1255
|
+
{
|
|
1256
|
+
contentRef = hostElm["s-cr"];
|
|
1257
|
+
checkSlotFallbackVisibility = false;
|
|
1258
|
+
}
|
|
1259
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1260
|
+
{
|
|
1261
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1262
|
+
if (checkSlotRelocate) {
|
|
1263
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1264
|
+
for (const relocateData of relocateNodes) {
|
|
1265
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1266
|
+
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
1267
|
+
const orgLocationNode = win.document.createTextNode("");
|
|
1268
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1269
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
for (const relocateData of relocateNodes) {
|
|
1273
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1274
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1275
|
+
if (slotRefNode) {
|
|
1276
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1277
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1278
|
+
if ((insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1279
|
+
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1280
|
+
while (orgLocationNode) {
|
|
1281
|
+
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1282
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1283
|
+
refNode = refNode.nextSibling;
|
|
1284
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1285
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
1286
|
+
}
|
|
1287
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
1288
|
+
insertBeforeNode = refNode;
|
|
1289
|
+
break;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1296
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1297
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1298
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1299
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1300
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1301
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](slotRefNode);
|
|
1306
|
+
} else {
|
|
1307
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1308
|
+
if (isInitialLoad) {
|
|
1309
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
1310
|
+
}
|
|
1311
|
+
nodeToRelocate.hidden = true;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
if (checkSlotFallbackVisibility) {
|
|
1317
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1318
|
+
}
|
|
1319
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1320
|
+
relocateNodes.length = 0;
|
|
1321
|
+
}
|
|
1322
|
+
if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1323
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1324
|
+
for (const childNode of children) {
|
|
1325
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1326
|
+
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1327
|
+
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1328
|
+
}
|
|
1329
|
+
childNode.hidden = true;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
contentRef = void 0;
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
// src/runtime/update-component.ts
|
|
1337
|
+
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1338
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1339
|
+
const index = ancestorComponent["s-p"].push(
|
|
1340
|
+
new Promise(
|
|
1341
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
1342
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
1343
|
+
r();
|
|
1344
|
+
}
|
|
1345
|
+
)
|
|
1346
|
+
);
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1350
|
+
{
|
|
1351
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1352
|
+
}
|
|
1353
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1354
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1355
|
+
return;
|
|
1356
|
+
}
|
|
1357
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1358
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1359
|
+
return writeTask(dispatch) ;
|
|
1360
|
+
};
|
|
1361
|
+
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1362
|
+
const elm = hostRef.$hostElement$;
|
|
1363
|
+
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1364
|
+
const instance = elm;
|
|
1365
|
+
if (!instance) {
|
|
1366
|
+
throw new Error(
|
|
1367
|
+
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
1368
|
+
);
|
|
1369
|
+
}
|
|
1370
|
+
let maybePromise;
|
|
1371
|
+
if (isInitialLoad) {
|
|
1372
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
1373
|
+
} else {
|
|
1374
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
1375
|
+
}
|
|
1376
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
1377
|
+
endSchedule();
|
|
1378
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1379
|
+
};
|
|
1380
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
|
|
1381
|
+
console.error(err2);
|
|
1382
|
+
fn();
|
|
1383
|
+
}) : fn();
|
|
1384
|
+
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
1385
|
+
var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
1386
|
+
var _a;
|
|
1387
|
+
const elm = hostRef.$hostElement$;
|
|
1388
|
+
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1389
|
+
const rc = elm["s-rc"];
|
|
1390
|
+
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1391
|
+
{
|
|
1392
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1393
|
+
}
|
|
1394
|
+
if (rc) {
|
|
1395
|
+
rc.map((cb) => cb());
|
|
1396
|
+
elm["s-rc"] = void 0;
|
|
1397
|
+
}
|
|
1398
|
+
endRender();
|
|
1399
|
+
endUpdate();
|
|
1400
|
+
{
|
|
1401
|
+
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1402
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1403
|
+
if (childrenPromises.length === 0) {
|
|
1404
|
+
postUpdate();
|
|
1405
|
+
} else {
|
|
1406
|
+
Promise.all(childrenPromises).then(postUpdate);
|
|
1407
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1408
|
+
childrenPromises.length = 0;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1413
|
+
try {
|
|
1414
|
+
instance = instance.render() ;
|
|
1415
|
+
{
|
|
1416
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1417
|
+
}
|
|
1418
|
+
{
|
|
1419
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1420
|
+
}
|
|
1421
|
+
{
|
|
1422
|
+
{
|
|
1423
|
+
{
|
|
1424
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
} catch (e) {
|
|
1429
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1430
|
+
}
|
|
1431
|
+
return null;
|
|
1432
|
+
};
|
|
1433
|
+
var postUpdateComponent = (hostRef) => {
|
|
1434
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1435
|
+
const elm = hostRef.$hostElement$;
|
|
1436
|
+
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1437
|
+
const instance = elm;
|
|
1438
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1439
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1440
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1441
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1442
|
+
{
|
|
1443
|
+
addHydratedFlag(elm);
|
|
1444
|
+
}
|
|
1445
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1446
|
+
endPostUpdate();
|
|
1447
|
+
{
|
|
1448
|
+
hostRef.$onReadyResolve$(elm);
|
|
1449
|
+
if (!ancestorComponent) {
|
|
1450
|
+
appDidLoad();
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
} else {
|
|
1454
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1455
|
+
endPostUpdate();
|
|
1456
|
+
}
|
|
1457
|
+
{
|
|
1458
|
+
if (hostRef.$onRenderResolve$) {
|
|
1459
|
+
hostRef.$onRenderResolve$();
|
|
1460
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1461
|
+
}
|
|
1462
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1463
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1464
|
+
}
|
|
1465
|
+
hostRef.$flags$ &= -517;
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
var appDidLoad = (who) => {
|
|
1469
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1470
|
+
};
|
|
1471
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1472
|
+
if (instance && instance[method]) {
|
|
1473
|
+
try {
|
|
1474
|
+
return instance[method](arg);
|
|
1475
|
+
} catch (e) {
|
|
1476
|
+
consoleError(e, elm);
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
return void 0;
|
|
1480
|
+
};
|
|
1481
|
+
var addHydratedFlag = (elm) => {
|
|
1482
|
+
var _a;
|
|
1483
|
+
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
|
1484
|
+
};
|
|
1485
|
+
|
|
1486
|
+
// src/runtime/set-value.ts
|
|
1487
|
+
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1488
|
+
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1489
|
+
const hostRef = getHostRef(ref);
|
|
1490
|
+
const elm = ref;
|
|
1491
|
+
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1492
|
+
const flags = hostRef.$flags$;
|
|
1493
|
+
const instance = elm;
|
|
1494
|
+
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1495
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1496
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1497
|
+
if (didValueChange) {
|
|
1498
|
+
hostRef.$instanceValues$.set(propName, newVal);
|
|
1499
|
+
{
|
|
1500
|
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1501
|
+
if (instance.componentShouldUpdate) {
|
|
1502
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
scheduleUpdate(hostRef, false);
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
// src/runtime/proxy-component.ts
|
|
1513
|
+
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1514
|
+
var _a, _b;
|
|
1515
|
+
const prototype = Cstr.prototype;
|
|
1516
|
+
if (cmpMeta.$members$ || BUILD.watchCallback) {
|
|
1517
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1518
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
1519
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
1520
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1521
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1522
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1523
|
+
{
|
|
1524
|
+
Object.defineProperty(prototype, memberName, {
|
|
1525
|
+
get() {
|
|
1526
|
+
{
|
|
1527
|
+
return origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
configurable: true,
|
|
1531
|
+
enumerable: true
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
Object.defineProperty(prototype, memberName, {
|
|
1535
|
+
set(newValue) {
|
|
1536
|
+
const ref = getHostRef(this);
|
|
1537
|
+
if (origSetter) {
|
|
1538
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1539
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1540
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1541
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1542
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1543
|
+
}
|
|
1544
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1545
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1546
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
{
|
|
1550
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
});
|
|
1557
|
+
{
|
|
1558
|
+
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
1559
|
+
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
1560
|
+
plt.jmp(() => {
|
|
1561
|
+
var _a2;
|
|
1562
|
+
const propName = attrNameToPropName.get(attrName);
|
|
1563
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ; else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
1564
|
+
this[propName] == newValue) {
|
|
1565
|
+
return;
|
|
1566
|
+
} else if (propName == null) {
|
|
1567
|
+
const hostRef = getHostRef(this);
|
|
1568
|
+
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1569
|
+
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1570
|
+
const elm = this;
|
|
1571
|
+
const instance = elm;
|
|
1572
|
+
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
1573
|
+
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
1574
|
+
if (instance[callbackName] != null) {
|
|
1575
|
+
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1582
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1583
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1584
|
+
this[propName] = newValue;
|
|
1585
|
+
}
|
|
1586
|
+
});
|
|
1587
|
+
};
|
|
1588
|
+
Cstr.observedAttributes = Array.from(
|
|
1589
|
+
/* @__PURE__ */ new Set([
|
|
1590
|
+
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1591
|
+
...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
|
|
1592
|
+
const attrName = m[1] || propName;
|
|
1593
|
+
attrNameToPropName.set(attrName, propName);
|
|
1594
|
+
return attrName;
|
|
1595
|
+
})
|
|
1596
|
+
])
|
|
1597
|
+
);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
return Cstr;
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
// src/runtime/initialize-component.ts
|
|
1604
|
+
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1605
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1606
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1607
|
+
{
|
|
1608
|
+
const cmpTag = elm.localName;
|
|
1609
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1613
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1614
|
+
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
1615
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
1616
|
+
} else {
|
|
1617
|
+
schedule();
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
// src/runtime/connected-callback.ts
|
|
1624
|
+
var connectedCallback = (elm) => {
|
|
1625
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1626
|
+
const hostRef = getHostRef(elm);
|
|
1627
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1628
|
+
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1629
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1630
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1631
|
+
{
|
|
1632
|
+
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1633
|
+
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1634
|
+
setContentReference(elm);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
{
|
|
1638
|
+
let ancestorComponent = elm;
|
|
1639
|
+
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1640
|
+
if (ancestorComponent["s-p"]) {
|
|
1641
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1642
|
+
break;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
if (cmpMeta.$members$) {
|
|
1647
|
+
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1648
|
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1649
|
+
const value = elm[memberName];
|
|
1650
|
+
delete elm[memberName];
|
|
1651
|
+
elm[memberName] = value;
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
if (BUILD.initializeNextTick) {
|
|
1656
|
+
nextTick(() => initializeComponent(elm, hostRef));
|
|
1657
|
+
} else {
|
|
1658
|
+
initializeComponent(elm, hostRef);
|
|
1659
|
+
}
|
|
1660
|
+
} else {
|
|
1661
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1662
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
endConnected();
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
var setContentReference = (elm) => {
|
|
1669
|
+
if (!win.document) {
|
|
1670
|
+
return;
|
|
1671
|
+
}
|
|
1672
|
+
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
1673
|
+
""
|
|
1674
|
+
);
|
|
1675
|
+
contentRefElm["s-cn"] = true;
|
|
1676
|
+
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
1677
|
+
};
|
|
1678
|
+
var disconnectedCallback = async (elm) => {
|
|
1679
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1680
|
+
getHostRef(elm);
|
|
1681
|
+
}
|
|
1682
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1683
|
+
rootAppliedStyles.delete(elm);
|
|
1684
|
+
}
|
|
1685
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1686
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
var proxyCustomElement = (Cstr, compactMeta) => {
|
|
1690
|
+
const cmpMeta = {
|
|
1691
|
+
$flags$: compactMeta[0],
|
|
1692
|
+
$tagName$: compactMeta[1]
|
|
1693
|
+
};
|
|
1694
|
+
{
|
|
1695
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1696
|
+
}
|
|
1697
|
+
{
|
|
1698
|
+
if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1699
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1703
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1704
|
+
Object.assign(Cstr.prototype, {
|
|
1705
|
+
__hasHostListenerAttached: false,
|
|
1706
|
+
__registerHost() {
|
|
1707
|
+
registerHost(this, cmpMeta);
|
|
1708
|
+
},
|
|
1709
|
+
connectedCallback() {
|
|
1710
|
+
if (!this.__hasHostListenerAttached) {
|
|
1711
|
+
getHostRef(this);
|
|
1712
|
+
this.__hasHostListenerAttached = true;
|
|
1713
|
+
}
|
|
1714
|
+
connectedCallback(this);
|
|
1715
|
+
if (originalConnectedCallback) {
|
|
1716
|
+
originalConnectedCallback.call(this);
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
disconnectedCallback() {
|
|
1720
|
+
disconnectedCallback(this);
|
|
1721
|
+
if (originalDisconnectedCallback) {
|
|
1722
|
+
originalDisconnectedCallback.call(this);
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
__attachShadow() {
|
|
1726
|
+
{
|
|
1727
|
+
this.shadowRoot = this;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
Cstr.is = cmpMeta.$tagName$;
|
|
1732
|
+
return proxyComponent(Cstr, cmpMeta);
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
export { H, Host as c, h, proxyCustomElement as p };
|
|
1736
|
+
//# sourceMappingURL=p-nyMzpSUR.js.map
|