@ptengine/widgets 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +38 -2
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/index-DRCOne2Q.js +1583 -0
- package/dist/cjs/index-DRCOne2Q.js.map +1 -0
- package/dist/cjs/index.cjs.js +107 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/pt-provider.cjs.entry.js +85 -0
- package/dist/cjs/pt-provider.cjs.entry.js.map +1 -0
- package/dist/cjs/ptengine-widgets.cjs.js +28 -0
- package/dist/cjs/ptengine-widgets.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +13 -0
- package/dist/collection/components/pt-provider/pt-provider.js +136 -0
- package/dist/collection/components/pt-provider/pt-provider.js.map +1 -0
- package/dist/collection/index.js +9 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/context.js +98 -0
- package/dist/collection/utils/context.js.map +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/pt-provider.d.ts +11 -0
- package/dist/components/pt-provider.js +2 -0
- package/dist/components/pt-provider.js.map +1 -0
- package/dist/define/pt-provider.d.ts +1 -0
- package/dist/define/pt-provider.js +5 -0
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/index-CZKQmozD.js +1559 -0
- package/dist/esm/index-CZKQmozD.js.map +1 -0
- package/dist/esm/index.js +102 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +14 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/pt-provider.entry.js +83 -0
- package/dist/esm/pt-provider.entry.js.map +1 -0
- package/dist/esm/ptengine-widgets.js +24 -0
- package/dist/esm/ptengine-widgets.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/ptengine-widgets/index.esm.js +2 -0
- package/dist/ptengine-widgets/index.esm.js.map +1 -0
- package/dist/ptengine-widgets/p-8a0ee9f5.entry.js +2 -0
- package/dist/ptengine-widgets/p-8a0ee9f5.entry.js.map +1 -0
- package/dist/ptengine-widgets/p-CZKQmozD.js +3 -0
- package/dist/ptengine-widgets/p-CZKQmozD.js.map +1 -0
- package/dist/ptengine-widgets/p-DQuL1Twl.js +2 -0
- package/dist/ptengine-widgets/p-DQuL1Twl.js.map +1 -0
- package/dist/ptengine-widgets/ptengine-widgets.css +1 -0
- package/dist/ptengine-widgets/ptengine-widgets.esm.js +2 -0
- package/dist/ptengine-widgets/ptengine-widgets.esm.js.map +1 -0
- package/dist/types/components/pt-provider/pt-provider.d.ts +59 -0
- package/dist/types/components.d.ts +107 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/stencil-public-runtime.d.ts +1879 -0
- package/dist/types/utils/context.d.ts +45 -0
- package/docs.json +86 -0
- package/hydrate/index.d.ts +287 -0
- package/hydrate/index.js +22214 -0
- package/hydrate/index.mjs +22204 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +93 -3
|
@@ -0,0 +1,1583 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopNamespace(e) {
|
|
4
|
+
if (e && e.__esModule) return e;
|
|
5
|
+
var n = Object.create(null);
|
|
6
|
+
if (e) {
|
|
7
|
+
Object.keys(e).forEach(function (k) {
|
|
8
|
+
if (k !== 'default') {
|
|
9
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return e[k]; }
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return Object.freeze(n);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const NAMESPACE = 'ptengine-widgets';
|
|
22
|
+
const BUILD = /* ptengine-widgets */ { hydratedSelectorName: "hydrated", lazyLoad: true, prop: true, propChangeCallback: true};
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
Stencil Client Platform v4.45.0 | MIT Licensed | https://stenciljs.com
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
29
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
30
|
+
PrimitiveType2["Null"] = "null";
|
|
31
|
+
PrimitiveType2["String"] = "string";
|
|
32
|
+
PrimitiveType2["Number"] = "number";
|
|
33
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
34
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
35
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
36
|
+
return PrimitiveType2;
|
|
37
|
+
})(PrimitiveType || {});
|
|
38
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
39
|
+
NonPrimitiveType2["Array"] = "array";
|
|
40
|
+
NonPrimitiveType2["Date"] = "date";
|
|
41
|
+
NonPrimitiveType2["Map"] = "map";
|
|
42
|
+
NonPrimitiveType2["Object"] = "object";
|
|
43
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
44
|
+
NonPrimitiveType2["Set"] = "set";
|
|
45
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
46
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
47
|
+
return NonPrimitiveType2;
|
|
48
|
+
})(NonPrimitiveType || {});
|
|
49
|
+
var TYPE_CONSTANT = "type";
|
|
50
|
+
var VALUE_CONSTANT = "value";
|
|
51
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
52
|
+
|
|
53
|
+
// src/utils/get-prop-descriptor.ts
|
|
54
|
+
function getPropertyDescriptor(obj, memberName, getOnly) {
|
|
55
|
+
const stopAt = typeof HTMLElement !== "undefined" ? HTMLElement.prototype : null;
|
|
56
|
+
while (obj && obj !== stopAt) {
|
|
57
|
+
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
58
|
+
if (desc && (!getOnly || desc.get)) return desc;
|
|
59
|
+
obj = Object.getPrototypeOf(obj);
|
|
60
|
+
}
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
65
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
66
|
+
var _a;
|
|
67
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
68
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
69
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
70
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
71
|
+
const ogValue = instance[memberName];
|
|
72
|
+
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName, true) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
73
|
+
if (ogDescriptor) {
|
|
74
|
+
Object.defineProperty(instance, memberName, {
|
|
75
|
+
get() {
|
|
76
|
+
return ogDescriptor.get.call(this);
|
|
77
|
+
},
|
|
78
|
+
set(newValue) {
|
|
79
|
+
ogDescriptor.set.call(this, newValue);
|
|
80
|
+
},
|
|
81
|
+
configurable: true,
|
|
82
|
+
enumerable: true
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (hostRef.$instanceValues$.has(memberName)) {
|
|
86
|
+
instance[memberName] = hostRef.$instanceValues$.get(memberName);
|
|
87
|
+
} else if (ogValue !== void 0) {
|
|
88
|
+
instance[memberName] = ogValue;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// src/client/client-host-ref.ts
|
|
95
|
+
var getHostRef = (ref) => {
|
|
96
|
+
if (ref.__stencil__getHostRef) {
|
|
97
|
+
return ref.__stencil__getHostRef();
|
|
98
|
+
}
|
|
99
|
+
return void 0;
|
|
100
|
+
};
|
|
101
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
102
|
+
if (!hostRef) return;
|
|
103
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
104
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
|
105
|
+
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.prop)) {
|
|
106
|
+
reWireGetterSetter(lazyInstance, hostRef);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
110
|
+
const hostRef = {
|
|
111
|
+
$flags$: 0,
|
|
112
|
+
$hostElement$: hostElement,
|
|
113
|
+
$cmpMeta$: cmpMeta,
|
|
114
|
+
$instanceValues$: /* @__PURE__ */ new Map(),
|
|
115
|
+
$serializerValues$: /* @__PURE__ */ new Map()
|
|
116
|
+
};
|
|
117
|
+
{
|
|
118
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
119
|
+
hostElement["s-p"] = [];
|
|
120
|
+
hostElement["s-rc"] = [];
|
|
121
|
+
}
|
|
122
|
+
{
|
|
123
|
+
hostRef.$fetchedCbList$ = [];
|
|
124
|
+
}
|
|
125
|
+
const ref = hostRef;
|
|
126
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
127
|
+
return ref;
|
|
128
|
+
};
|
|
129
|
+
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
130
|
+
|
|
131
|
+
// src/client/client-load-module.ts
|
|
132
|
+
var cmpModules = /* @__PURE__ */ new Map();
|
|
133
|
+
var failedLoadAttempts = /* @__PURE__ */ new Map();
|
|
134
|
+
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
135
|
+
var _a;
|
|
136
|
+
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
137
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
138
|
+
if (!bundleId) {
|
|
139
|
+
return void 0;
|
|
140
|
+
}
|
|
141
|
+
const module = cmpModules.get(bundleId) ;
|
|
142
|
+
if (module) {
|
|
143
|
+
return module[exportName];
|
|
144
|
+
}
|
|
145
|
+
const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
|
|
146
|
+
const cacheBustParams = [
|
|
147
|
+
retryCount > 0 ? `s-retry=${retryCount}` : "",
|
|
148
|
+
""
|
|
149
|
+
].filter(Boolean).join("&");
|
|
150
|
+
|
|
151
|
+
if (!hmrVersionId || !BUILD.hotModuleReplacement) {
|
|
152
|
+
const processMod = importedModule => {
|
|
153
|
+
cmpModules.set(bundleId, importedModule);
|
|
154
|
+
return importedModule[exportName];
|
|
155
|
+
}
|
|
156
|
+
switch(bundleId) {
|
|
157
|
+
|
|
158
|
+
case 'pt-provider.cjs':
|
|
159
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
160
|
+
/* webpackMode: "lazy" */
|
|
161
|
+
'./pt-provider.cjs.entry.js')); }).then(processMod, consoleError);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(
|
|
165
|
+
/* @vite-ignore */
|
|
166
|
+
/* webpackInclude: /\.entry\.js$/ */
|
|
167
|
+
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
168
|
+
/* webpackMode: "lazy" */
|
|
169
|
+
`./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
|
|
170
|
+
).then(
|
|
171
|
+
(importedModule) => {
|
|
172
|
+
{
|
|
173
|
+
failedLoadAttempts.delete(bundleId);
|
|
174
|
+
cmpModules.set(bundleId, importedModule);
|
|
175
|
+
}
|
|
176
|
+
return importedModule[exportName];
|
|
177
|
+
},
|
|
178
|
+
(e) => {
|
|
179
|
+
failedLoadAttempts.set(bundleId, retryCount + 1);
|
|
180
|
+
consoleError(e, hostRef.$hostElement$);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
var ORG_LOCATION_ID = "o";
|
|
185
|
+
var SLOT_NODE_ID = "s";
|
|
186
|
+
var TEXT_NODE_ID = "t";
|
|
187
|
+
var COMMENT_NODE_ID = "c";
|
|
188
|
+
var HYDRATE_ID = "s-id";
|
|
189
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
190
|
+
var HYDRATED_CSS = "{visibility:hidden}[hydrated]{visibility:inherit}";
|
|
191
|
+
var MAX_LAZY_LOAD_RETRIES = 3;
|
|
192
|
+
var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
|
|
193
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
194
|
+
var plt = {
|
|
195
|
+
$flags$: 0,
|
|
196
|
+
$resourcesUrl$: "",
|
|
197
|
+
jmp: (h2) => h2(),
|
|
198
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
199
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
200
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
201
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
202
|
+
};
|
|
203
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
204
|
+
var _a;
|
|
205
|
+
let supportsListenerOptions2 = false;
|
|
206
|
+
try {
|
|
207
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
208
|
+
"e",
|
|
209
|
+
null,
|
|
210
|
+
Object.defineProperty({}, "passive", {
|
|
211
|
+
get() {
|
|
212
|
+
supportsListenerOptions2 = true;
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
);
|
|
216
|
+
} catch (e) {
|
|
217
|
+
}
|
|
218
|
+
return supportsListenerOptions2;
|
|
219
|
+
})();
|
|
220
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
221
|
+
var queuePending = false;
|
|
222
|
+
var queueDomReads = [];
|
|
223
|
+
var queueDomWrites = [];
|
|
224
|
+
var scheduleFlush = () => {
|
|
225
|
+
var _a;
|
|
226
|
+
return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
|
|
227
|
+
};
|
|
228
|
+
var queueTask = (queue, write) => (cb) => {
|
|
229
|
+
queue.push(cb);
|
|
230
|
+
if (!queuePending) {
|
|
231
|
+
queuePending = true;
|
|
232
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
233
|
+
nextTick(flush);
|
|
234
|
+
} else {
|
|
235
|
+
scheduleFlush();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var consume = (queue) => {
|
|
240
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
241
|
+
try {
|
|
242
|
+
queue[i2](performance.now());
|
|
243
|
+
} catch (e) {
|
|
244
|
+
consoleError(e);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
queue.length = 0;
|
|
248
|
+
};
|
|
249
|
+
var flush = () => {
|
|
250
|
+
consume(queueDomReads);
|
|
251
|
+
{
|
|
252
|
+
consume(queueDomWrites);
|
|
253
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
254
|
+
scheduleFlush();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
259
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
260
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
261
|
+
const result = [];
|
|
262
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
263
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
264
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
265
|
+
result.push(slottedNode);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
};
|
|
270
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
271
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
275
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
276
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
277
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
278
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
279
|
+
if (typeof position !== "undefined") {
|
|
280
|
+
slottedNodeLocation["s-oo"] = position;
|
|
281
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
282
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
283
|
+
childNodes.forEach((n) => {
|
|
284
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
285
|
+
});
|
|
286
|
+
slotRelocateNodes.sort((a, b) => {
|
|
287
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
288
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
289
|
+
return 0;
|
|
290
|
+
});
|
|
291
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
292
|
+
} else {
|
|
293
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
294
|
+
}
|
|
295
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
296
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
297
|
+
};
|
|
298
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
299
|
+
function patchSlotNode(node) {
|
|
300
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
301
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
302
|
+
const toReturn = [];
|
|
303
|
+
const slotName = this["s-sn"];
|
|
304
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
305
|
+
console.error(`
|
|
306
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
307
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
308
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
309
|
+
`);
|
|
310
|
+
}
|
|
311
|
+
const parent = this["s-cr"].parentElement;
|
|
312
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
313
|
+
slottedNodes.forEach((n) => {
|
|
314
|
+
if (slotName === getSlotName(n)) {
|
|
315
|
+
toReturn.push(n);
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
if (elementsOnly) {
|
|
319
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
320
|
+
}
|
|
321
|
+
return toReturn;
|
|
322
|
+
}).bind(node);
|
|
323
|
+
node.assignedElements = assignedFactory(true);
|
|
324
|
+
node.assignedNodes = assignedFactory(false);
|
|
325
|
+
}
|
|
326
|
+
function internalCall(node, method) {
|
|
327
|
+
if ("__" + method in node) {
|
|
328
|
+
const toReturn = node["__" + method];
|
|
329
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
330
|
+
return toReturn.bind(node);
|
|
331
|
+
} else {
|
|
332
|
+
if (typeof node[method] !== "function") return node[method];
|
|
333
|
+
return node[method].bind(node);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
var createTime = (fnName, tagName = "") => {
|
|
337
|
+
{
|
|
338
|
+
return () => {
|
|
339
|
+
return;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
var uniqueTime = (key, measureText) => {
|
|
344
|
+
{
|
|
345
|
+
return () => {
|
|
346
|
+
return;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
// src/utils/query-nonce-meta-tag-content.ts
|
|
352
|
+
function queryNonceMetaTagContent(doc) {
|
|
353
|
+
var _a, _b, _c;
|
|
354
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// src/runtime/styles.ts
|
|
358
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
359
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
360
|
+
var isComplexType = (o) => {
|
|
361
|
+
o = typeof o;
|
|
362
|
+
return o === "object" || o === "function";
|
|
363
|
+
};
|
|
364
|
+
var newVNode = (tag, text) => {
|
|
365
|
+
const vnode = {
|
|
366
|
+
$flags$: 0,
|
|
367
|
+
$tag$: tag,
|
|
368
|
+
// Normalize undefined to null to prevent rendering "undefined" as text
|
|
369
|
+
$text$: text != null ? text : null,
|
|
370
|
+
$elm$: null,
|
|
371
|
+
$children$: null
|
|
372
|
+
};
|
|
373
|
+
return vnode;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
// src/runtime/client-hydrate.ts
|
|
377
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
378
|
+
var _a, _b, _c, _d;
|
|
379
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
380
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
381
|
+
const childRenderNodes = [];
|
|
382
|
+
const slotNodes = [];
|
|
383
|
+
const slottedNodes = [];
|
|
384
|
+
const shadowRootNodes = null;
|
|
385
|
+
const vnode = newVNode(tagName, null);
|
|
386
|
+
vnode.$elm$ = hostElm;
|
|
387
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
388
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
389
|
+
}
|
|
390
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
391
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
392
|
+
hostRef.$vnode$ = clientHydrate(
|
|
393
|
+
vnode,
|
|
394
|
+
childRenderNodes,
|
|
395
|
+
slotNodes,
|
|
396
|
+
shadowRootNodes,
|
|
397
|
+
hostElm,
|
|
398
|
+
hostElm,
|
|
399
|
+
hostId,
|
|
400
|
+
slottedNodes
|
|
401
|
+
);
|
|
402
|
+
let crIndex = 0;
|
|
403
|
+
const crLength = childRenderNodes.length;
|
|
404
|
+
let childRenderNode;
|
|
405
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
406
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
407
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
408
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
409
|
+
const node = childRenderNode.$elm$;
|
|
410
|
+
if (!shadowRoot) {
|
|
411
|
+
node["s-hn"] = transformTag(tagName).toUpperCase();
|
|
412
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
413
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
414
|
+
}
|
|
415
|
+
} else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
|
|
416
|
+
const cmpMeta = getHostRef(childRenderNode.$elm$);
|
|
417
|
+
if (cmpMeta) {
|
|
418
|
+
const scopeId3 = getScopeId(
|
|
419
|
+
cmpMeta.$cmpMeta$);
|
|
420
|
+
const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
|
|
421
|
+
if (styleSheet) {
|
|
422
|
+
shadowRootNodes.unshift(styleSheet.cloneNode(true));
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
427
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
428
|
+
if (childRenderNode.$children$) {
|
|
429
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
430
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
431
|
+
childRenderNode.$children$.forEach((c) => {
|
|
432
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
} else {
|
|
436
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
440
|
+
if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
|
|
441
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
442
|
+
}
|
|
443
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
444
|
+
if (!shadowRoot) {
|
|
445
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (orgLocationNode && !orgLocationNode["s-id"]) {
|
|
449
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
const hosts = [];
|
|
453
|
+
const snLen = slottedNodes.length;
|
|
454
|
+
let snIndex = 0;
|
|
455
|
+
let slotGroup;
|
|
456
|
+
let snGroupIdx;
|
|
457
|
+
let snGroupLen;
|
|
458
|
+
let slottedItem;
|
|
459
|
+
let currentPos = 0;
|
|
460
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
461
|
+
slotGroup = slottedNodes[snIndex];
|
|
462
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
463
|
+
snGroupLen = slotGroup.length;
|
|
464
|
+
snGroupIdx = 0;
|
|
465
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
466
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
467
|
+
if (!hosts[slottedItem.hostId]) {
|
|
468
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
469
|
+
}
|
|
470
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
471
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
472
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
473
|
+
hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
|
|
474
|
+
}
|
|
475
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
476
|
+
if (!slottedItem.slot["s-cr"]) {
|
|
477
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
478
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
479
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
480
|
+
} else {
|
|
481
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
|
|
485
|
+
if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
|
|
486
|
+
slottedItem.node.removeAttribute("slot");
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
hostRef.$hostElement$ = hostElm;
|
|
493
|
+
endHydrate();
|
|
494
|
+
};
|
|
495
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
496
|
+
let childNodeType;
|
|
497
|
+
let childIdSplt;
|
|
498
|
+
let childVNode;
|
|
499
|
+
let i2;
|
|
500
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
501
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
502
|
+
if (childNodeType) {
|
|
503
|
+
childIdSplt = childNodeType.split(".");
|
|
504
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
505
|
+
childVNode = createSimpleVNode({
|
|
506
|
+
$flags$: 0,
|
|
507
|
+
$hostId$: childIdSplt[0],
|
|
508
|
+
$nodeId$: childIdSplt[1],
|
|
509
|
+
$depth$: childIdSplt[2],
|
|
510
|
+
$index$: childIdSplt[3],
|
|
511
|
+
$tag$: node.tagName.toLowerCase(),
|
|
512
|
+
$elm$: node,
|
|
513
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
514
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
515
|
+
$attrs$: { class: node.className || "" }
|
|
516
|
+
});
|
|
517
|
+
childRenderNodes.push(childVNode);
|
|
518
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
519
|
+
if (!parentVNode.$children$) {
|
|
520
|
+
parentVNode.$children$ = [];
|
|
521
|
+
}
|
|
522
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
523
|
+
if (typeof slotName === "string") {
|
|
524
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
525
|
+
addSlot(
|
|
526
|
+
slotName,
|
|
527
|
+
childIdSplt[2],
|
|
528
|
+
childVNode,
|
|
529
|
+
node,
|
|
530
|
+
parentVNode,
|
|
531
|
+
childRenderNodes,
|
|
532
|
+
slotNodes,
|
|
533
|
+
shadowRootNodes,
|
|
534
|
+
slottedNodes
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
538
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
539
|
+
}
|
|
540
|
+
if (childVNode.$index$ !== void 0) {
|
|
541
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
542
|
+
}
|
|
543
|
+
parentVNode = childVNode;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
if (node.shadowRoot) {
|
|
547
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
548
|
+
clientHydrate(
|
|
549
|
+
parentVNode,
|
|
550
|
+
childRenderNodes,
|
|
551
|
+
slotNodes,
|
|
552
|
+
shadowRootNodes,
|
|
553
|
+
hostElm,
|
|
554
|
+
node.shadowRoot.childNodes[i2],
|
|
555
|
+
hostId,
|
|
556
|
+
slottedNodes
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
561
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
562
|
+
clientHydrate(
|
|
563
|
+
parentVNode,
|
|
564
|
+
childRenderNodes,
|
|
565
|
+
slotNodes,
|
|
566
|
+
shadowRootNodes,
|
|
567
|
+
hostElm,
|
|
568
|
+
nonShadowNodes[i2],
|
|
569
|
+
hostId,
|
|
570
|
+
slottedNodes
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
574
|
+
childIdSplt = node.nodeValue.split(".");
|
|
575
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
576
|
+
childNodeType = childIdSplt[0];
|
|
577
|
+
childVNode = createSimpleVNode({
|
|
578
|
+
$hostId$: childIdSplt[1],
|
|
579
|
+
$nodeId$: childIdSplt[2],
|
|
580
|
+
$depth$: childIdSplt[3],
|
|
581
|
+
$index$: childIdSplt[4] || "0",
|
|
582
|
+
$elm$: node,
|
|
583
|
+
$attrs$: null,
|
|
584
|
+
$children$: null,
|
|
585
|
+
$key$: null,
|
|
586
|
+
$name$: null,
|
|
587
|
+
$tag$: null,
|
|
588
|
+
$text$: null
|
|
589
|
+
});
|
|
590
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
591
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
592
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
593
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
594
|
+
childRenderNodes.push(childVNode);
|
|
595
|
+
node.remove();
|
|
596
|
+
if (hostId === childVNode.$hostId$) {
|
|
597
|
+
if (!parentVNode.$children$) {
|
|
598
|
+
parentVNode.$children$ = [];
|
|
599
|
+
}
|
|
600
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
604
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
605
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
606
|
+
childRenderNodes.push(childVNode);
|
|
607
|
+
node.remove();
|
|
608
|
+
}
|
|
609
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
610
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
611
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
612
|
+
addSlot(
|
|
613
|
+
slotName,
|
|
614
|
+
childIdSplt[2],
|
|
615
|
+
childVNode,
|
|
616
|
+
node,
|
|
617
|
+
parentVNode,
|
|
618
|
+
childRenderNodes,
|
|
619
|
+
slotNodes,
|
|
620
|
+
shadowRootNodes,
|
|
621
|
+
slottedNodes
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
627
|
+
const vnode = newVNode(null, node.textContent);
|
|
628
|
+
vnode.$elm$ = node;
|
|
629
|
+
vnode.$index$ = "0";
|
|
630
|
+
parentVNode.$children$ = [vnode];
|
|
631
|
+
}
|
|
632
|
+
return parentVNode;
|
|
633
|
+
};
|
|
634
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
635
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
636
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
637
|
+
if (componentId) {
|
|
638
|
+
orgLocNodes.set(componentId, node);
|
|
639
|
+
}
|
|
640
|
+
let i2 = 0;
|
|
641
|
+
if (node.shadowRoot) {
|
|
642
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
643
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
647
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
648
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
649
|
+
}
|
|
650
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
651
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
652
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
653
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
654
|
+
node.nodeValue = "";
|
|
655
|
+
node["s-en"] = childIdSplt[3];
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
var createSimpleVNode = (vnode) => {
|
|
660
|
+
const defaultVNode = {
|
|
661
|
+
$flags$: 0,
|
|
662
|
+
$hostId$: null,
|
|
663
|
+
$nodeId$: null,
|
|
664
|
+
$depth$: null,
|
|
665
|
+
$index$: "0",
|
|
666
|
+
$elm$: null,
|
|
667
|
+
$attrs$: null,
|
|
668
|
+
$children$: null,
|
|
669
|
+
$key$: null,
|
|
670
|
+
$name$: null,
|
|
671
|
+
$tag$: null,
|
|
672
|
+
$text$: null
|
|
673
|
+
};
|
|
674
|
+
return { ...defaultVNode, ...vnode };
|
|
675
|
+
};
|
|
676
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
677
|
+
node["s-sr"] = true;
|
|
678
|
+
childVNode.$name$ = slotName || null;
|
|
679
|
+
childVNode.$tag$ = "slot";
|
|
680
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
681
|
+
{
|
|
682
|
+
const slot = childVNode.$elm$;
|
|
683
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
684
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
685
|
+
patchSlotNode(node);
|
|
686
|
+
if (shouldMove) {
|
|
687
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
childRenderNodes.push(childVNode);
|
|
691
|
+
slotNodes.push(childVNode);
|
|
692
|
+
if (!parentVNode.$children$) {
|
|
693
|
+
parentVNode.$children$ = [];
|
|
694
|
+
}
|
|
695
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
696
|
+
}
|
|
697
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
698
|
+
var _a, _b;
|
|
699
|
+
let slottedNode = slotNode.nextSibling;
|
|
700
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
701
|
+
if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
|
|
702
|
+
do {
|
|
703
|
+
if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
704
|
+
slottedNode["s-sn"] = slotName;
|
|
705
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
706
|
+
}
|
|
707
|
+
slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
|
|
708
|
+
} while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
|
|
709
|
+
};
|
|
710
|
+
var findCorrespondingNode = (node, type) => {
|
|
711
|
+
let sibling = node;
|
|
712
|
+
do {
|
|
713
|
+
sibling = sibling.nextSibling;
|
|
714
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
715
|
+
return sibling;
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
// src/runtime/normalize-watchers.ts
|
|
719
|
+
var normalizeWatchers = (raw) => {
|
|
720
|
+
if (!raw) return void 0;
|
|
721
|
+
const keys = Object.keys(raw);
|
|
722
|
+
if (keys.length === 0) return void 0;
|
|
723
|
+
let hasLegacy = false;
|
|
724
|
+
for (const propName of keys) {
|
|
725
|
+
if (hasLegacy) break;
|
|
726
|
+
for (const h2 of raw[propName]) {
|
|
727
|
+
if (typeof h2 === "string") {
|
|
728
|
+
hasLegacy = true;
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (!hasLegacy) return raw;
|
|
734
|
+
const out = {};
|
|
735
|
+
for (const propName of keys) {
|
|
736
|
+
out[propName] = raw[propName].map(
|
|
737
|
+
(h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
return out;
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
// src/utils/remote-value.ts
|
|
744
|
+
var RemoteValue = class _RemoteValue {
|
|
745
|
+
/**
|
|
746
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
747
|
+
*
|
|
748
|
+
* @param serialized The serialized LocalValue object
|
|
749
|
+
* @returns The original JavaScript value/object
|
|
750
|
+
*/
|
|
751
|
+
static fromLocalValue(serialized) {
|
|
752
|
+
const type = serialized[TYPE_CONSTANT];
|
|
753
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
754
|
+
switch (type) {
|
|
755
|
+
case "string" /* String */:
|
|
756
|
+
return value;
|
|
757
|
+
case "boolean" /* Boolean */:
|
|
758
|
+
return value;
|
|
759
|
+
case "bigint" /* BigInt */:
|
|
760
|
+
return BigInt(value);
|
|
761
|
+
case "undefined" /* Undefined */:
|
|
762
|
+
return void 0;
|
|
763
|
+
case "null" /* Null */:
|
|
764
|
+
return null;
|
|
765
|
+
case "number" /* Number */:
|
|
766
|
+
if (value === "NaN") return NaN;
|
|
767
|
+
if (value === "-0") return -0;
|
|
768
|
+
if (value === "Infinity") return Infinity;
|
|
769
|
+
if (value === "-Infinity") return -Infinity;
|
|
770
|
+
return value;
|
|
771
|
+
case "array" /* Array */:
|
|
772
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
773
|
+
case "date" /* Date */:
|
|
774
|
+
return new Date(value);
|
|
775
|
+
case "map" /* Map */:
|
|
776
|
+
const map = /* @__PURE__ */ new Map();
|
|
777
|
+
for (const [key, val] of value) {
|
|
778
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
779
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
780
|
+
map.set(deserializedKey, deserializedValue);
|
|
781
|
+
}
|
|
782
|
+
return map;
|
|
783
|
+
case "object" /* Object */:
|
|
784
|
+
const obj = {};
|
|
785
|
+
for (const [key, val] of value) {
|
|
786
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
787
|
+
}
|
|
788
|
+
return obj;
|
|
789
|
+
case "regexp" /* RegularExpression */:
|
|
790
|
+
const { pattern, flags } = value;
|
|
791
|
+
return new RegExp(pattern, flags);
|
|
792
|
+
case "set" /* Set */:
|
|
793
|
+
const set = /* @__PURE__ */ new Set();
|
|
794
|
+
for (const item of value) {
|
|
795
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
796
|
+
}
|
|
797
|
+
return set;
|
|
798
|
+
case "symbol" /* Symbol */:
|
|
799
|
+
return Symbol(value);
|
|
800
|
+
default:
|
|
801
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
806
|
+
*
|
|
807
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
808
|
+
* @returns Array of deserialized JavaScript values
|
|
809
|
+
*/
|
|
810
|
+
static fromLocalValueArray(serializedValues) {
|
|
811
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
815
|
+
*
|
|
816
|
+
* @param obj Object to verify
|
|
817
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
818
|
+
*/
|
|
819
|
+
static isLocalValueObject(obj) {
|
|
820
|
+
if (typeof obj !== "object" || obj === null) {
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
824
|
+
return false;
|
|
825
|
+
}
|
|
826
|
+
const type = obj[TYPE_CONSTANT];
|
|
827
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
828
|
+
if (!hasTypeProperty) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
832
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
833
|
+
}
|
|
834
|
+
return true;
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
// src/utils/serialize.ts
|
|
839
|
+
function decodeBase64Unicode(base64) {
|
|
840
|
+
const binary = atob(base64);
|
|
841
|
+
const bytes = new Uint8Array(binary.length);
|
|
842
|
+
for (let i2 = 0; i2 < binary.length; i2++) {
|
|
843
|
+
bytes[i2] = binary.charCodeAt(i2);
|
|
844
|
+
}
|
|
845
|
+
return new TextDecoder().decode(bytes);
|
|
846
|
+
}
|
|
847
|
+
function deserializeProperty(value) {
|
|
848
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
849
|
+
return value;
|
|
850
|
+
}
|
|
851
|
+
return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// src/runtime/parse-property-value.ts
|
|
855
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
856
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
857
|
+
propValue = deserializeProperty(propValue);
|
|
858
|
+
return propValue;
|
|
859
|
+
}
|
|
860
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
861
|
+
return propValue;
|
|
862
|
+
}
|
|
863
|
+
return propValue;
|
|
864
|
+
};
|
|
865
|
+
var getElement = (ref) => {
|
|
866
|
+
var _a;
|
|
867
|
+
return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
|
|
868
|
+
};
|
|
869
|
+
var emitEvent = (elm, name, opts) => {
|
|
870
|
+
const ev = plt.ce(name, opts);
|
|
871
|
+
elm.dispatchEvent(ev);
|
|
872
|
+
return ev;
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
// src/runtime/update-component.ts
|
|
876
|
+
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
877
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
878
|
+
const index = ancestorComponent["s-p"].push(
|
|
879
|
+
new Promise(
|
|
880
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
881
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
882
|
+
r();
|
|
883
|
+
}
|
|
884
|
+
)
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
889
|
+
{
|
|
890
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
891
|
+
}
|
|
892
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
893
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
897
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
898
|
+
if (isInitialLoad) {
|
|
899
|
+
queueMicrotask(() => {
|
|
900
|
+
dispatch();
|
|
901
|
+
});
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
return writeTask(dispatch) ;
|
|
905
|
+
};
|
|
906
|
+
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
907
|
+
const elm = hostRef.$hostElement$;
|
|
908
|
+
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
909
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
910
|
+
if (!instance) {
|
|
911
|
+
throw new Error(
|
|
912
|
+
`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`
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
let maybePromise;
|
|
916
|
+
if (isInitialLoad) {
|
|
917
|
+
{
|
|
918
|
+
{
|
|
919
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
920
|
+
if (hostRef.$queuedListeners$) {
|
|
921
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
922
|
+
hostRef.$queuedListeners$ = void 0;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
if (hostRef.$fetchedCbList$.length) {
|
|
926
|
+
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
930
|
+
} else {
|
|
931
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
932
|
+
}
|
|
933
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
934
|
+
endSchedule();
|
|
935
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance));
|
|
936
|
+
};
|
|
937
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
|
|
938
|
+
console.error(err);
|
|
939
|
+
fn();
|
|
940
|
+
}) : fn();
|
|
941
|
+
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
942
|
+
var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
943
|
+
var _a;
|
|
944
|
+
const elm = hostRef.$hostElement$;
|
|
945
|
+
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
946
|
+
const rc = elm["s-rc"];
|
|
947
|
+
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
948
|
+
{
|
|
949
|
+
callRender(hostRef, instance);
|
|
950
|
+
}
|
|
951
|
+
if (rc) {
|
|
952
|
+
rc.map((cb) => cb());
|
|
953
|
+
elm["s-rc"] = void 0;
|
|
954
|
+
}
|
|
955
|
+
endRender();
|
|
956
|
+
endUpdate();
|
|
957
|
+
{
|
|
958
|
+
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
959
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
960
|
+
if (childrenPromises.length === 0) {
|
|
961
|
+
postUpdate();
|
|
962
|
+
} else {
|
|
963
|
+
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
|
|
964
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
965
|
+
childrenPromises.length = 0;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
970
|
+
try {
|
|
971
|
+
instance = instance.render && instance.render();
|
|
972
|
+
{
|
|
973
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
974
|
+
}
|
|
975
|
+
{
|
|
976
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
977
|
+
}
|
|
978
|
+
} catch (e) {
|
|
979
|
+
consoleError(e, hostRef.$hostElement$);
|
|
980
|
+
}
|
|
981
|
+
return null;
|
|
982
|
+
};
|
|
983
|
+
var postUpdateComponent = (hostRef) => {
|
|
984
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
985
|
+
const elm = hostRef.$hostElement$;
|
|
986
|
+
const endPostUpdate = createTime("postUpdate", tagName);
|
|
987
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
988
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
989
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
990
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
991
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
992
|
+
{
|
|
993
|
+
addHydratedFlag(elm);
|
|
994
|
+
}
|
|
995
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
996
|
+
endPostUpdate();
|
|
997
|
+
{
|
|
998
|
+
hostRef.$onReadyResolve$(elm);
|
|
999
|
+
if (!ancestorComponent) {
|
|
1000
|
+
appDidLoad();
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
} else {
|
|
1004
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1005
|
+
endPostUpdate();
|
|
1006
|
+
}
|
|
1007
|
+
{
|
|
1008
|
+
if (hostRef.$onRenderResolve$) {
|
|
1009
|
+
hostRef.$onRenderResolve$();
|
|
1010
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1011
|
+
}
|
|
1012
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1013
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1014
|
+
}
|
|
1015
|
+
hostRef.$flags$ &= -517;
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
var appDidLoad = (who) => {
|
|
1019
|
+
var _a;
|
|
1020
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1021
|
+
{
|
|
1022
|
+
if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
|
|
1023
|
+
plt.$orgLocNodes$.clear();
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1028
|
+
if (instance && instance[method]) {
|
|
1029
|
+
try {
|
|
1030
|
+
return instance[method](arg);
|
|
1031
|
+
} catch (e) {
|
|
1032
|
+
consoleError(e, elm);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
return void 0;
|
|
1036
|
+
};
|
|
1037
|
+
var addHydratedFlag = (elm) => {
|
|
1038
|
+
var _b;
|
|
1039
|
+
return elm.setAttribute((_b = BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") ;
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
// src/runtime/set-value.ts
|
|
1043
|
+
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1044
|
+
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1045
|
+
const hostRef = getHostRef(ref);
|
|
1046
|
+
if (!hostRef) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
if (!hostRef) {
|
|
1050
|
+
throw new Error(
|
|
1051
|
+
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
const elm = hostRef.$hostElement$ ;
|
|
1055
|
+
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1056
|
+
const flags = hostRef.$flags$;
|
|
1057
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1058
|
+
newVal = parsePropertyValue(
|
|
1059
|
+
newVal);
|
|
1060
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1061
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1062
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
1063
|
+
hostRef.$instanceValues$.set(propName, newVal);
|
|
1064
|
+
if (cmpMeta.$watchers$) {
|
|
1065
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1066
|
+
if (watchMethods) {
|
|
1067
|
+
watchMethods.map((watcher) => {
|
|
1068
|
+
try {
|
|
1069
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
1070
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
1071
|
+
if (!instance) {
|
|
1072
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
1073
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
1074
|
+
});
|
|
1075
|
+
} else {
|
|
1076
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
} catch (e) {
|
|
1080
|
+
consoleError(e, elm);
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
if (flags & 2 /* hasRendered */) {
|
|
1086
|
+
if (instance.componentShouldUpdate) {
|
|
1087
|
+
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
|
|
1088
|
+
if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
if (!(flags & 16 /* isQueuedForUpdate */)) {
|
|
1093
|
+
scheduleUpdate(hostRef, false);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1099
|
+
var _a, _b;
|
|
1100
|
+
const prototype = Cstr.prototype;
|
|
1101
|
+
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
|
|
1102
|
+
{
|
|
1103
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1104
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1105
|
+
}
|
|
1106
|
+
if (Cstr.deserializers && !cmpMeta.$deserializers$) {
|
|
1107
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1108
|
+
}
|
|
1109
|
+
if (Cstr.serializers && !cmpMeta.$serializers$) {
|
|
1110
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1114
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
1115
|
+
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1116
|
+
const { get: origGetter, set: origSetter } = getPropertyDescriptor(prototype, memberName) || {};
|
|
1117
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1118
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1119
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1120
|
+
Object.defineProperty(prototype, memberName, {
|
|
1121
|
+
get() {
|
|
1122
|
+
{
|
|
1123
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1124
|
+
return getValue(this, memberName);
|
|
1125
|
+
}
|
|
1126
|
+
const ref = getHostRef(this);
|
|
1127
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1128
|
+
if (!instance) return;
|
|
1129
|
+
return instance[memberName];
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
configurable: true,
|
|
1133
|
+
enumerable: true
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
Object.defineProperty(prototype, memberName, {
|
|
1137
|
+
set(newValue) {
|
|
1138
|
+
const ref = getHostRef(this);
|
|
1139
|
+
if (!ref) {
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
if (origSetter) {
|
|
1143
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1144
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1145
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1146
|
+
}
|
|
1147
|
+
origSetter.apply(this, [
|
|
1148
|
+
parsePropertyValue(
|
|
1149
|
+
newValue)
|
|
1150
|
+
]);
|
|
1151
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1152
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
{
|
|
1156
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1157
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1158
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1159
|
+
ref.$fetchedCbList$.push(() => {
|
|
1160
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1161
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
const parsedValue = parsePropertyValue(
|
|
1168
|
+
newValue);
|
|
1169
|
+
const setterSetVal = (val) => {
|
|
1170
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1171
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1172
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1173
|
+
}
|
|
1174
|
+
ref.$lazyInstance$[memberName] = val;
|
|
1175
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1176
|
+
};
|
|
1177
|
+
if (ref.$lazyInstance$) {
|
|
1178
|
+
setterSetVal(parsedValue);
|
|
1179
|
+
} else {
|
|
1180
|
+
ref.$instanceValues$.set(memberName, parsedValue);
|
|
1181
|
+
ref.$fetchedCbList$.push(() => {
|
|
1182
|
+
const pendingValue = ref.$instanceValues$.get(memberName);
|
|
1183
|
+
if (ref.$lazyInstance$[memberName] !== pendingValue) {
|
|
1184
|
+
setterSetVal(pendingValue);
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
if ((flags & 1 /* isElementConstructor */)) {
|
|
1194
|
+
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
1195
|
+
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
1196
|
+
plt.jmp(() => {
|
|
1197
|
+
var _a2;
|
|
1198
|
+
const propName = attrNameToPropName.get(attrName);
|
|
1199
|
+
const hostRef = getHostRef(this);
|
|
1200
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1201
|
+
newValue = this[propName];
|
|
1202
|
+
delete this[propName];
|
|
1203
|
+
}
|
|
1204
|
+
if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
1205
|
+
this[propName] == newValue) {
|
|
1206
|
+
return;
|
|
1207
|
+
} else if (propName == null) {
|
|
1208
|
+
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1209
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
|
|
1210
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1211
|
+
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
1212
|
+
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
1213
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
1214
|
+
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
1215
|
+
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
const propFlags = members.find(([m]) => m === propName);
|
|
1222
|
+
const propMemberFlags = propFlags ? propFlags[1][0] : 0;
|
|
1223
|
+
const isBooleanTarget = propMemberFlags & 4 /* Boolean */;
|
|
1224
|
+
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
1225
|
+
if (isBooleanTarget) {
|
|
1226
|
+
newValue = newValue === null || newValue === "false" ? false : true;
|
|
1227
|
+
}
|
|
1228
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1229
|
+
if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1230
|
+
this[propName] = newValue;
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1233
|
+
};
|
|
1234
|
+
Cstr.observedAttributes = Array.from(
|
|
1235
|
+
/* @__PURE__ */ new Set([
|
|
1236
|
+
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1237
|
+
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
1238
|
+
const attrName = m[1] || propName;
|
|
1239
|
+
attrNameToPropName.set(attrName, propName);
|
|
1240
|
+
return attrName;
|
|
1241
|
+
})
|
|
1242
|
+
])
|
|
1243
|
+
);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
return Cstr;
|
|
1247
|
+
};
|
|
1248
|
+
|
|
1249
|
+
// src/runtime/initialize-component.ts
|
|
1250
|
+
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1251
|
+
var _a;
|
|
1252
|
+
let Cstr;
|
|
1253
|
+
try {
|
|
1254
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1255
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1256
|
+
hostRef.$flags$ &= -1025 /* hasFailedLoad */;
|
|
1257
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1258
|
+
if (bundleId) {
|
|
1259
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1260
|
+
if (CstrImport && "then" in CstrImport) {
|
|
1261
|
+
const endLoad = uniqueTime();
|
|
1262
|
+
Cstr = await CstrImport;
|
|
1263
|
+
endLoad();
|
|
1264
|
+
} else {
|
|
1265
|
+
Cstr = CstrImport;
|
|
1266
|
+
}
|
|
1267
|
+
if (!Cstr) {
|
|
1268
|
+
hostRef.$flags$ &= -33 /* hasInitializedComponent */;
|
|
1269
|
+
hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
|
|
1270
|
+
if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
|
|
1271
|
+
hostRef.$flags$ |= 1024 /* hasFailedLoad */;
|
|
1272
|
+
}
|
|
1273
|
+
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1274
|
+
}
|
|
1275
|
+
if (!Cstr.isProxied) {
|
|
1276
|
+
{
|
|
1277
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1278
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1279
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1280
|
+
}
|
|
1281
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1282
|
+
Cstr.isProxied = true;
|
|
1283
|
+
}
|
|
1284
|
+
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
1285
|
+
{
|
|
1286
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1287
|
+
}
|
|
1288
|
+
try {
|
|
1289
|
+
new Cstr(hostRef);
|
|
1290
|
+
} catch (e) {
|
|
1291
|
+
consoleError(e, elm);
|
|
1292
|
+
}
|
|
1293
|
+
{
|
|
1294
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1295
|
+
}
|
|
1296
|
+
{
|
|
1297
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1298
|
+
}
|
|
1299
|
+
endNewInstance();
|
|
1300
|
+
{
|
|
1301
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1302
|
+
}
|
|
1303
|
+
} else {
|
|
1304
|
+
Cstr = elm.constructor;
|
|
1305
|
+
const cmpTag = elm.localName;
|
|
1306
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1310
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1311
|
+
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
1312
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
1313
|
+
} else {
|
|
1314
|
+
schedule();
|
|
1315
|
+
}
|
|
1316
|
+
} catch (e) {
|
|
1317
|
+
consoleError(e, elm);
|
|
1318
|
+
if (hostRef.$onRenderResolve$) {
|
|
1319
|
+
hostRef.$onRenderResolve$();
|
|
1320
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1321
|
+
}
|
|
1322
|
+
if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
|
|
1323
|
+
hostRef.$onReadyResolve$(elm);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1328
|
+
{
|
|
1329
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1330
|
+
}
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
// src/runtime/connected-callback.ts
|
|
1334
|
+
var connectedCallback = (elm) => {
|
|
1335
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1336
|
+
const hostRef = getHostRef(elm);
|
|
1337
|
+
if (!hostRef) {
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1341
|
+
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1342
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1343
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1344
|
+
let hostId;
|
|
1345
|
+
{
|
|
1346
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
1347
|
+
if (hostId) {
|
|
1348
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
{
|
|
1352
|
+
let ancestorComponent = elm;
|
|
1353
|
+
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1354
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1355
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1356
|
+
break;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
if (cmpMeta.$members$) {
|
|
1361
|
+
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1362
|
+
if (memberFlags & 31 /* Prop */ && Object.prototype.hasOwnProperty.call(elm, memberName)) {
|
|
1363
|
+
const value = elm[memberName];
|
|
1364
|
+
delete elm[memberName];
|
|
1365
|
+
elm[memberName] = value;
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
{
|
|
1370
|
+
initializeComponent(elm, hostRef, cmpMeta);
|
|
1371
|
+
}
|
|
1372
|
+
} else {
|
|
1373
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1374
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1375
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1376
|
+
} else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
|
|
1377
|
+
setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
|
|
1378
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1379
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
endConnected();
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
var disconnectInstance = (instance, elm) => {
|
|
1386
|
+
{
|
|
1387
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
var disconnectedCallback = async (elm) => {
|
|
1391
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1392
|
+
const hostRef = getHostRef(elm);
|
|
1393
|
+
{
|
|
1394
|
+
if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
|
|
1395
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1396
|
+
hostRef.$rmListeners$ = void 0;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1400
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1401
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1402
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1406
|
+
rootAppliedStyles.delete(elm);
|
|
1407
|
+
}
|
|
1408
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1409
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
// src/runtime/bootstrap-lazy.ts
|
|
1414
|
+
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1415
|
+
var _a;
|
|
1416
|
+
if (!win.document) {
|
|
1417
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
const endBootstrap = createTime();
|
|
1421
|
+
const cmpTags = [];
|
|
1422
|
+
const exclude = options.exclude || [];
|
|
1423
|
+
const customElements2 = win.customElements;
|
|
1424
|
+
const head = win.document.head;
|
|
1425
|
+
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1426
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1427
|
+
const deferredConnectedCallbacks = [];
|
|
1428
|
+
let appLoadFallback;
|
|
1429
|
+
let isBootstrapping = true;
|
|
1430
|
+
Object.assign(plt, options);
|
|
1431
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1432
|
+
{
|
|
1433
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
1434
|
+
}
|
|
1435
|
+
lazyBundles.map((lazyBundle) => {
|
|
1436
|
+
lazyBundle[1].map((compactMeta) => {
|
|
1437
|
+
var _a2, _b;
|
|
1438
|
+
const cmpMeta = {
|
|
1439
|
+
$flags$: compactMeta[0],
|
|
1440
|
+
$tagName$: compactMeta[1],
|
|
1441
|
+
$members$: compactMeta[2],
|
|
1442
|
+
$listeners$: compactMeta[3]
|
|
1443
|
+
};
|
|
1444
|
+
{
|
|
1445
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1446
|
+
}
|
|
1447
|
+
{
|
|
1448
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1449
|
+
}
|
|
1450
|
+
{
|
|
1451
|
+
cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
|
|
1452
|
+
cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
|
|
1453
|
+
cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
|
|
1454
|
+
}
|
|
1455
|
+
const tagName = transformTag(cmpMeta.$tagName$);
|
|
1456
|
+
const HostElement = class extends HTMLElement {
|
|
1457
|
+
["s-p"];
|
|
1458
|
+
["s-rc"];
|
|
1459
|
+
hasRegisteredEventListeners = false;
|
|
1460
|
+
// StencilLazyHost
|
|
1461
|
+
constructor(self) {
|
|
1462
|
+
super(self);
|
|
1463
|
+
self = this;
|
|
1464
|
+
registerHost(self, cmpMeta);
|
|
1465
|
+
}
|
|
1466
|
+
connectedCallback() {
|
|
1467
|
+
const hostRef = getHostRef(this);
|
|
1468
|
+
if (!hostRef) {
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
if (!this.hasRegisteredEventListeners) {
|
|
1472
|
+
this.hasRegisteredEventListeners = true;
|
|
1473
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1474
|
+
}
|
|
1475
|
+
if (appLoadFallback) {
|
|
1476
|
+
clearTimeout(appLoadFallback);
|
|
1477
|
+
appLoadFallback = null;
|
|
1478
|
+
}
|
|
1479
|
+
if (isBootstrapping) {
|
|
1480
|
+
deferredConnectedCallbacks.push(this);
|
|
1481
|
+
} else {
|
|
1482
|
+
plt.jmp(() => connectedCallback(this));
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
disconnectedCallback() {
|
|
1486
|
+
plt.jmp(() => disconnectedCallback(this));
|
|
1487
|
+
nextTick(() => {
|
|
1488
|
+
var _a3;
|
|
1489
|
+
const hostRef = getHostRef(this);
|
|
1490
|
+
if (!hostRef) {
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1494
|
+
if (i2 > -1) {
|
|
1495
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
1496
|
+
}
|
|
1497
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1498
|
+
delete hostRef.$vnode$.$elm$;
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
componentOnReady() {
|
|
1503
|
+
var _a3;
|
|
1504
|
+
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1508
|
+
if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
|
|
1509
|
+
cmpTags.push(tagName);
|
|
1510
|
+
customElements2.define(
|
|
1511
|
+
tagName,
|
|
1512
|
+
proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
|
|
1513
|
+
);
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
});
|
|
1517
|
+
if (cmpTags.length > 0) {
|
|
1518
|
+
{
|
|
1519
|
+
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
1520
|
+
}
|
|
1521
|
+
if (dataStyles.innerHTML.length) {
|
|
1522
|
+
dataStyles.setAttribute("data-styles", "");
|
|
1523
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1524
|
+
if (nonce != null) {
|
|
1525
|
+
dataStyles.setAttribute("nonce", nonce);
|
|
1526
|
+
}
|
|
1527
|
+
head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
isBootstrapping = false;
|
|
1531
|
+
if (deferredConnectedCallbacks.length) {
|
|
1532
|
+
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
1533
|
+
} else {
|
|
1534
|
+
{
|
|
1535
|
+
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
endBootstrap();
|
|
1539
|
+
};
|
|
1540
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1541
|
+
if (listeners && win.document) {
|
|
1542
|
+
listeners.map(([flags, name, method]) => {
|
|
1543
|
+
const target = elm;
|
|
1544
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1545
|
+
const opts = hostListenerOpts(flags);
|
|
1546
|
+
plt.ael(target, name, handler, opts);
|
|
1547
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1551
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1552
|
+
var _a;
|
|
1553
|
+
try {
|
|
1554
|
+
{
|
|
1555
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
1556
|
+
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
1557
|
+
} else {
|
|
1558
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
} catch (e) {
|
|
1562
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1566
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
1567
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
1568
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
1569
|
+
|
|
1570
|
+
// src/runtime/nonce.ts
|
|
1571
|
+
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1572
|
+
function transformTag(tag) {
|
|
1573
|
+
return tag;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
exports.bootstrapLazy = bootstrapLazy;
|
|
1577
|
+
exports.getElement = getElement;
|
|
1578
|
+
exports.promiseResolve = promiseResolve;
|
|
1579
|
+
exports.registerInstance = registerInstance;
|
|
1580
|
+
exports.setNonce = setNonce;
|
|
1581
|
+
//# sourceMappingURL=index-DRCOne2Q.js.map
|
|
1582
|
+
|
|
1583
|
+
//# sourceMappingURL=index-DRCOne2Q.js.map
|