@stencil/core 5.0.0-next.0 → 5.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +94 -0
  2. package/bin/stencil.mjs +1 -1
  3. package/dist/app-data/index.d.ts +2 -0
  4. package/dist/{runtime/app-data → app-data}/index.js +23 -15
  5. package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
  6. package/dist/client-BMtGBEQV.mjs +2498 -0
  7. package/dist/compiler/browser.d.ts +1573 -0
  8. package/dist/compiler/browser.js +16998 -0
  9. package/dist/compiler/index.d.mts +284 -7
  10. package/dist/compiler/index.mjs +3 -9
  11. package/dist/compiler/utils/index.d.mts +272 -3
  12. package/dist/compiler/utils/index.mjs +4 -5
  13. package/dist/{transpile-CJQcQEVa.mjs → compiler-C_Y38j4m.mjs} +20984 -15554
  14. package/dist/declarations/stencil-ext-modules.d.ts +8 -8
  15. package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
  16. package/dist/declarations/stencil-public-compiler.js +3 -5
  17. package/dist/declarations/stencil-public-docs.d.ts +441 -376
  18. package/dist/declarations/stencil-public-docs.js +0 -0
  19. package/dist/declarations/stencil-public-runtime.d.ts +361 -113
  20. package/dist/fragment-Di1hWOC8.mjs +4 -0
  21. package/dist/helpers-pTCZhNi0.mjs +529 -0
  22. package/dist/{index-szczUd2l.d.mts → index-CFiy6MZ3.d.mts} +1471 -2044
  23. package/dist/index-CViiWNQ9.d.mts +104 -0
  24. package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
  25. package/dist/index.d.mts +14 -2
  26. package/dist/index.mjs +171 -4
  27. package/dist/jsx-runtime.d.mts +24 -0
  28. package/dist/jsx-runtime.mjs +3 -0
  29. package/dist/mock-doc.mjs +2 -3
  30. package/dist/{node-sys-BGURUNOZ.mjs → node-Bkq8vRnu.mjs} +176 -197
  31. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  32. package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3794 -2659
  33. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
  34. package/dist/runtime/client/{index.js → runtime.js} +3596 -2857
  35. package/dist/runtime/index.d.ts +90 -72
  36. package/dist/runtime/index.js +3528 -2897
  37. package/dist/runtime/server/index.d.mts +243 -219
  38. package/dist/runtime/server/index.mjs +3770 -3352
  39. package/dist/runtime/server/runner.d.mts +114 -47
  40. package/dist/runtime/server/runner.mjs +12710 -763
  41. package/dist/signals/index.d.ts +58 -0
  42. package/dist/signals/index.js +182 -0
  43. package/dist/sys/node/index.d.mts +1 -3
  44. package/dist/sys/node/index.mjs +2 -7
  45. package/dist/sys/node/worker.d.mts +1 -1
  46. package/dist/sys/node/worker.mjs +3 -12
  47. package/dist/testing/index.d.mts +4763 -12
  48. package/dist/testing/index.mjs +7945 -618
  49. package/dist/util-CP6-333M.mjs +731 -0
  50. package/dist/validation-C1mr0klL.mjs +825 -0
  51. package/package.json +91 -59
  52. package/dist/chunk-ClPoSABd.mjs +0 -21
  53. package/dist/index-Bxo2jCf6.d.mts +0 -77
  54. package/dist/runtime/app-data/index.d.ts +0 -30
  55. package/dist/serialize-BJvhE9aQ.mjs +0 -775
  56. package/dist/validation-BdcPruW_.mjs +0 -1451
  57. /package/{LICENSE.md → LICENSE} +0 -0
  58. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ //#region src/runtime/fragment.ts
2
+ const Fragment = (_, children) => children;
3
+ //#endregion
4
+ export { Fragment as t };
@@ -0,0 +1,529 @@
1
+ const MEMBER_FLAGS = {
2
+ String: 1,
3
+ Number: 2,
4
+ Boolean: 4,
5
+ Any: 8,
6
+ Unknown: 16,
7
+ State: 32,
8
+ Method: 64,
9
+ Event: 128,
10
+ Element: 256,
11
+ ReflectAttr: 512,
12
+ Mutable: 1024,
13
+ Getter: 2048,
14
+ Setter: 4096,
15
+ Prop: 31,
16
+ HasAttribute: 31,
17
+ PropLike: 63
18
+ };
19
+ const WATCH_FLAGS = { Immediate: 1 };
20
+ const EVENT_FLAGS = {
21
+ Cancellable: 1,
22
+ Composed: 2,
23
+ Bubbles: 4
24
+ };
25
+ const LISTENER_FLAGS = {
26
+ Passive: 1,
27
+ Capture: 2,
28
+ TargetDocument: 4,
29
+ TargetWindow: 8,
30
+ TargetBody: 16
31
+ };
32
+ const HOST_FLAGS = {
33
+ hasConnected: 1,
34
+ hasRendered: 2,
35
+ isWaitingForChildren: 4,
36
+ isConstructingInstance: 8,
37
+ isQueuedForUpdate: 16,
38
+ hasInitializedComponent: 32,
39
+ hasLoadedComponent: 64,
40
+ isWatchReady: 128,
41
+ isListenReady: 256,
42
+ needsRerender: 512,
43
+ /**
44
+ * Set once this component's real (lazy-loaded) `connectedCallback` has fired for
45
+ * the first time. Lets a descendant skip creating/awaiting a connect-promise for
46
+ * an ancestor that's already connected. See {@link HostRef.$onFirstConnectResolve$}.
47
+ */
48
+ hasFiredConnected: 1024,
49
+ /**
50
+ * Set when a lazy component's dynamic `import()` fails to resolve a
51
+ * constructor. Distinct from `hasInitializedComponent` being unset, which
52
+ * is true while an initialization attempt is merely queued/in-flight.
53
+ */
54
+ hasFailedLoad: 2048,
55
+ /**
56
+ * Set while `renderVdom` patches the host, so writes of a serialized reflected value
57
+ * coming from the runtime's own reflection aren't applied back to the prop.
58
+ */
59
+ isReflecting: 16384,
60
+ devOnRender: 4096,
61
+ devOnDidLoad: 8192
62
+ };
63
+ const CF_scopedCssEncapsulation = 2;
64
+ /**
65
+ * A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
66
+ *
67
+ * These flags should only be used in conjunction with {@link ComponentRuntimeMeta#$flags$}.
68
+ * They should _not_ be used for calculations against other fields/numbers
69
+ */
70
+ const CMP_FLAGS = {
71
+ /**
72
+ * Used to determine if a component is using the shadow DOM.
73
+ * e.g. `shadow: true | {}` is set on the `@Component()` decorator
74
+ */
75
+ shadowDomEncapsulation: 1,
76
+ /**
77
+ * Used to determine if a component is using scoped stylesheets
78
+ * e.g. `scoped: true` is set on the `@Component()` decorator
79
+ */
80
+ scopedCssEncapsulation: CF_scopedCssEncapsulation,
81
+ /**
82
+ * Used to determine if a component does not use the shadow DOM _and_ has `<slot/>` tags in its markup.
83
+ */
84
+ hasSlotRelocation: 4,
85
+ /**
86
+ * Determines if `delegatesFocus` is enabled for a component that uses the shadow DOM.
87
+ * e.g. `shadow: { delegatesFocus: true }` is set on the `@Component()` decorator
88
+ */
89
+ shadowDelegatesFocus: 16,
90
+ /**
91
+ * Determines if `mode` is set on the `@Component()` decorator
92
+ */
93
+ hasMode: 32,
94
+ /**
95
+ * Determines if styles must be scoped - i.e. the component uses scoped stylesheets.
96
+ */
97
+ needsScopedEncapsulation: CF_scopedCssEncapsulation,
98
+ /**
99
+ * Determines if a component is form-associated or not. This is set based on
100
+ * options passed to the `@Component` decorator.
101
+ */
102
+ formAssociated: 64,
103
+ /**
104
+ * Determines if a `shadow: true` component needs
105
+ * to have its styles scoped during SSR as opposed to using DSD.
106
+ */
107
+ shadowNeedsScopedCss: 128,
108
+ /**
109
+ * Determines if a component has a `<slot>` in its template.
110
+ */
111
+ hasSlot: 256,
112
+ /**
113
+ * Determines if a component uses modern class property declarations.
114
+ */
115
+ hasModernPropertyDecls: 512,
116
+ /**
117
+ * Determines if `slotAssignment` is set to `'manual'` for a component that uses the shadow DOM.
118
+ * e.g. `shadow: { slotAssignment: 'manual' }` is set on the `@Component()` decorator
119
+ */
120
+ shadowSlotAssignmentManual: 1024,
121
+ /**
122
+ * Determines if the shadow DOM mode is 'closed'.
123
+ * e.g. `encapsulation: { type: 'shadow', mode: 'closed' }` is set on the `@Component()` decorator
124
+ */
125
+ shadowModeClosed: 2048,
126
+ /**
127
+ * Determines if the component should patch child node accessors for slot handling.
128
+ * e.g. `encapsulation: { type: 'none', patches: ['children'] }`
129
+ */
130
+ patchChildren: 4096,
131
+ /**
132
+ * Determines if the component should patch cloneNode() for slot handling.
133
+ * e.g. `encapsulation: { type: 'none', patches: ['clone'] }`
134
+ */
135
+ patchClone: 8192,
136
+ /**
137
+ * Determines if the component should patch appendChild/insertBefore for slot handling.
138
+ * e.g. `encapsulation: { type: 'none', patches: ['insert'] }`
139
+ */
140
+ patchInsert: 16384,
141
+ /**
142
+ * Determines if the component should apply all slot patches.
143
+ * e.g. `encapsulation: { type: 'none', patches: ['all'] }`
144
+ * Equivalent to the global `experimentalSlotFixes` config option.
145
+ */
146
+ patchAll: 32768,
147
+ /**
148
+ * Determines if `clonable` is enabled for a component that uses the shadow DOM.
149
+ * e.g. `encapsulation: { type: 'shadow', clonable: true }` is set on the `@Component()` decorator
150
+ */
151
+ shadowClonable: 65536,
152
+ /**
153
+ * Determines if `serializable` is enabled for a component that uses the shadow DOM.
154
+ * e.g. `encapsulation: { type: 'shadow', serializable: true }` is set on the `@Component()` decorator
155
+ */
156
+ shadowSerializable: 1 << 17
157
+ };
158
+ /**
159
+ * Default style mode id
160
+ */
161
+ const DEFAULT_STYLE_MODE = "$";
162
+ /**
163
+ * Namespaces
164
+ */
165
+ const SVG_NS = "http://www.w3.org/2000/svg";
166
+ const HTML_NS = "http://www.w3.org/1999/xhtml";
167
+ const XLINK_NS = "http://www.w3.org/1999/xlink";
168
+ /**
169
+ * File names and value
170
+ */
171
+ const COLLECTION_MANIFEST_FILE_NAME = "collection-manifest.json";
172
+ const COLLECTION_APP_DATA_FILE_NAME = "app-data.js";
173
+ /**
174
+ * Constant for the 'copy' output target
175
+ */
176
+ const COPY = "copy";
177
+ /**
178
+ * Constant for the 'custom' output target
179
+ */
180
+ const CUSTOM = "custom";
181
+ /**
182
+ * Constant for the 'loader-bundle' output target
183
+ * (formerly 'dist' in v4)
184
+ */
185
+ const LOADER_BUNDLE = "loader-bundle";
186
+ /**
187
+ * Constant for the 'standalone' output target
188
+ * (formerly 'dist-custom-elements' in v4)
189
+ */
190
+ const STANDALONE = "standalone";
191
+ /**
192
+ * Constant for the 'ssr' output target
193
+ * (formerly 'dist-hydrate-script' in v4)
194
+ */
195
+ const SSR = "ssr";
196
+ /**
197
+ * Constant for the 'ssr-wasm' output target.
198
+ * Compiles the SSR script to a WASM binary via javy for use in any WASM-capable host
199
+ * (PHP, Java, Ruby, Go, etc.) without requiring a JavaScript runtime.
200
+ */
201
+ const SSR_WASM = "ssr-wasm";
202
+ /**
203
+ * Constant for the 'collection' output target
204
+ * (formerly 'dist-collection' sub-output in v4)
205
+ *
206
+ * Contains transpiled source + metadata for downstream Stencil projects
207
+ * to re-compile/bundle.
208
+ */
209
+ const COLLECTION = "collection";
210
+ /**
211
+ * Constant for the 'types' output target
212
+ * (formerly 'dist-types' sub-output in v4)
213
+ */
214
+ const TYPES = "types";
215
+ /**
216
+ * Constant for the 'global-style' output target
217
+ * Outputs global styles to a unified location available to all distributions.
218
+ */
219
+ const GLOBAL_STYLE = "global-style";
220
+ /**
221
+ * Constant for the 'assets' output target
222
+ * Copies component assetsDirs to a unified location available to all distributions.
223
+ */
224
+ const ASSETS = "assets";
225
+ /**
226
+ * Internal constant for the 'dist-lazy' output target
227
+ * (used by loader-bundle and www)
228
+ */
229
+ const DIST_LAZY = "dist-lazy";
230
+ /**
231
+ * Constant for the 'docs-custom' output target
232
+ */
233
+ const DOCS_CUSTOM = "docs-custom";
234
+ /**
235
+ * Constant for the 'docs-json' output target
236
+ */
237
+ const DOCS_JSON = "docs-json";
238
+ /**
239
+ * Constant for the 'docs-readme' output target
240
+ */
241
+ const DOCS_README = "docs-readme";
242
+ /**
243
+ * Constant for the 'docs-vscode' output target
244
+ */
245
+ const DOCS_VSCODE = "docs-vscode";
246
+ /**
247
+ * Constant for the 'docs-custom-elements-manifest' output target
248
+ */
249
+ const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
250
+ /**
251
+ * Constant for the 'docs-agent-skill' output target
252
+ */
253
+ const DOCS_AGENT_SKILL = "docs-agent-skill";
254
+ /**
255
+ * Constant for the 'stats' output target
256
+ */
257
+ const STATS = "stats";
258
+ /**
259
+ * Constant for the 'www' output target
260
+ */
261
+ const WWW = "www";
262
+ /**
263
+ * Valid output targets to specify in a Stencil config.
264
+ *
265
+ * Note that some internal output targets (e.g. `DIST_LAZY`, `DIST_GLOBAL_STYLES`)
266
+ * are programmatically created by the compiler and are not user-configurable.
267
+ *
268
+ * In v5, `TYPES` and `COLLECTION` are auto-generated in production builds unless explicitly configured.
269
+ */
270
+ const VALID_CONFIG_OUTPUT_TARGETS = [
271
+ "www",
272
+ LOADER_BUNDLE,
273
+ STANDALONE,
274
+ "ssr",
275
+ SSR_WASM,
276
+ COLLECTION,
277
+ TYPES,
278
+ GLOBAL_STYLE,
279
+ ASSETS,
280
+ "dist",
281
+ "dist-custom-elements",
282
+ "dist-hydrate-script",
283
+ "dist-collection",
284
+ "dist-types",
285
+ DOCS_JSON,
286
+ DOCS_README,
287
+ DOCS_VSCODE,
288
+ DOCS_CUSTOM,
289
+ DOCS_CUSTOM_ELEMENTS_MANIFEST,
290
+ DOCS_AGENT_SKILL,
291
+ COPY,
292
+ CUSTOM,
293
+ STATS
294
+ ];
295
+ const GENERATED_DTS = "components.d.ts";
296
+ const STYLE_EXT = [
297
+ "css",
298
+ "scss",
299
+ "sass",
300
+ "pcss",
301
+ "styl",
302
+ "stylus",
303
+ "less"
304
+ ];
305
+ /**
306
+ * DOM Node types
307
+ *
308
+ * See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
309
+ *
310
+ * Note: this is a duplicate of the `NODE_TYPES` enum in mock-doc, it's
311
+ * copied over here so that we do not need to introduce a dependency on the
312
+ * mock-doc bundle in the runtime. See
313
+ * https://github.com/stenciljs/core/pull/5705 for more details.
314
+ */
315
+ const NODE_TYPES = {
316
+ ELEMENT_NODE: 1,
317
+ ATTRIBUTE_NODE: 2,
318
+ TEXT_NODE: 3,
319
+ CDATA_SECTION_NODE: 4,
320
+ ENTITY_REFERENCE_NODE: 5,
321
+ ENTITY_NODE: 6,
322
+ PROCESSING_INSTRUCTION_NODE: 7,
323
+ COMMENT_NODE: 8,
324
+ DOCUMENT_NODE: 9,
325
+ DOCUMENT_TYPE_NODE: 10,
326
+ DOCUMENT_FRAGMENT_NODE: 11,
327
+ NOTATION_NODE: 12
328
+ };
329
+ //#endregion
330
+ //#region src/utils/query-nonce-meta-tag-content.ts
331
+ /**
332
+ * Helper method for querying a `meta` tag that contains a nonce value
333
+ * out of a DOM's head.
334
+ *
335
+ * @param doc The DOM containing the `head` to query against
336
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
337
+ * exists or the tag has no content.
338
+ */
339
+ function queryNonceMetaTagContent(doc) {
340
+ return doc.head?.querySelector("meta[name=\"csp-nonce\"]")?.getAttribute("content") ?? void 0;
341
+ }
342
+ //#endregion
343
+ //#region src/utils/helpers.ts
344
+ /**
345
+ * Check if a value is defined (not null and not undefined).
346
+ *
347
+ * @param v - the value to check
348
+ * @returns true if the value is defined
349
+ */
350
+ const isDef = (v) => v != null && v !== void 0;
351
+ /**
352
+ * Convert a string from PascalCase to dash-case
353
+ *
354
+ * @param str the string to convert
355
+ * @returns a converted string
356
+ */
357
+ const toDashCase = (str) => str.replace(/([A-Z0-9])/g, (match) => ` ${match[0]}`).trim().split(" ").join("-").toLowerCase();
358
+ /**
359
+ * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
360
+ * or whatever you call it!)
361
+ *
362
+ * @param str a string to convert
363
+ * @returns a converted string
364
+ */
365
+ const dashToPascalCase = (str) => str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("");
366
+ /**
367
+ * Convert a string to 'camelCase'
368
+ *
369
+ * @param str the string to convert
370
+ * @returns the converted string
371
+ */
372
+ const toCamelCase = (str) => {
373
+ const pascalCase = dashToPascalCase(str);
374
+ return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);
375
+ };
376
+ /**
377
+ * Capitalize the first letter of a string
378
+ *
379
+ * @param str the string to capitalize
380
+ * @returns a capitalized string
381
+ */
382
+ const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
383
+ /**
384
+ * Escapes all occurrences of a specified pattern in a string.
385
+ * This function replaces all matches of a given pattern in the input text with a specified replacement string.
386
+ * It can handle both string and regular expression patterns and allows toggling between global and single-match replacements.
387
+ *
388
+ * @param text - The input string to process.
389
+ * @param pattern - The pattern to search for in the input string. Can be a regular expression or a string.
390
+ * @param replacement - The string to replace each match with.
391
+ * @param replaceAll - Whether to replace all occurrences (true) or just the first occurrence (false). Defaults to true.
392
+ * @returns The processed string with the replacements applied.
393
+ */
394
+ const escapeWithPattern = (text, pattern, replacement, replaceAll = true) => {
395
+ let regex;
396
+ if (typeof pattern === "string") {
397
+ const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
398
+ regex = new RegExp(escaped, replaceAll ? "g" : "");
399
+ } else {
400
+ const flags = pattern.flags;
401
+ const hasG = flags.includes("g");
402
+ const newFlags = replaceAll ? hasG ? flags : flags + "g" : hasG ? flags.replace(/g/g, "") : flags;
403
+ regex = new RegExp(pattern.source, newFlags);
404
+ }
405
+ return text.replace(regex, replacement);
406
+ };
407
+ /**
408
+ * This is just a no-op, don't expect it to do anything.
409
+ */
410
+ const noop = () => {};
411
+ /**
412
+ * Check whether a value is a 'complex type', defined here as an object or a
413
+ * function.
414
+ *
415
+ * @param o the value to check
416
+ * @returns whether it's a complex type or not
417
+ */
418
+ const isComplexType = (o) => {
419
+ o = typeof o;
420
+ return o === "object" || o === "function";
421
+ };
422
+ /**
423
+ * Sort an array without mutating it in-place (as `Array.prototype.sort`
424
+ * unfortunately does)
425
+ *
426
+ * @param array the array you'd like to sort
427
+ * @param prop a function for deriving sortable values (strings or numbers)
428
+ * from array members
429
+ * @returns a new array of all items `x` in `array` ordered by `prop(x)`
430
+ */
431
+ const sortBy = (array, prop) => {
432
+ return array.slice().sort((a, b) => {
433
+ const nameA = prop(a);
434
+ const nameB = prop(b);
435
+ if (nameA < nameB) return -1;
436
+ if (nameA > nameB) return 1;
437
+ return 0;
438
+ });
439
+ };
440
+ /**
441
+ * A polyfill of sorts for `Array.prototype.flat` which will return the result
442
+ * of calling that method if present and, if not, return an equivalent based on
443
+ * `Array.prototype.reduce`.
444
+ *
445
+ * @param array the array to flatten (one level)
446
+ * @returns a flattened array
447
+ */
448
+ const flatOne = (array) => {
449
+ if (array.flat) return array.flat(1);
450
+ return array.reduce((result, item) => {
451
+ result.push(...item);
452
+ return result;
453
+ }, []);
454
+ };
455
+ /**
456
+ * Deduplicate an array, retaining items at the earliest position in which
457
+ * they appear.
458
+ *
459
+ * So `unique([1,3,2,1,1,4])` would be `[1,3,2,4]`.
460
+ *
461
+ * @param array the array to deduplicate
462
+ * @param predicate an optional function used to generate the key used to
463
+ * determine uniqueness
464
+ * @returns a new, deduplicated array
465
+ */
466
+ const unique = (array, predicate = (i) => i) => {
467
+ const set = /* @__PURE__ */ new Set();
468
+ return array.filter((item) => {
469
+ const key = predicate(item);
470
+ if (key == null) return true;
471
+ if (set.has(key)) return false;
472
+ set.add(key);
473
+ return true;
474
+ });
475
+ };
476
+ /**
477
+ * Merge elements of an array into an existing array, using a predicate to
478
+ * determine uniqueness and only adding elements when they are not present in
479
+ * the first array.
480
+ *
481
+ * **Note**: this mutates the target array! This is intentional to avoid
482
+ * unnecessary array allocation, but be sure that it's what you want!
483
+ *
484
+ * @param target the target array, to which new unique items should be added
485
+ * @param newItems a list of new items, some (or all!) of which may be added
486
+ * @param mergeWith a predicate function which reduces the items in `target`
487
+ * and `newItems` to a value which can be equated with `===` for the purposes
488
+ * of determining uniqueness
489
+ */
490
+ function mergeIntoWith(target, newItems, mergeWith) {
491
+ for (const item of newItems) if (!target.find((existingItem) => mergeWith(existingItem) === mergeWith(item))) target.push(item);
492
+ }
493
+ /**
494
+ * A utility for building an object from an iterable very similar to
495
+ * `Object.fromEntries`
496
+ *
497
+ * @param entries an iterable object holding entries (key-value tuples) to
498
+ * plop into a new object
499
+ * @returns an object containing those entries
500
+ */
501
+ const fromEntries = (entries) => {
502
+ const object = {};
503
+ for (const [key, value] of entries) object[key] = value;
504
+ return object;
505
+ };
506
+ /**
507
+ * Based on a given object, create a new object which has only the specified
508
+ * key-value pairs included in it.
509
+ *
510
+ * @param obj the object from which to take values
511
+ * @param keys a set of keys to take
512
+ * @returns an object mapping `key` to `obj[key]` if `obj[key]` is truthy for
513
+ * every `key` in `keys`
514
+ */
515
+ const pluck = (obj, keys) => {
516
+ return keys.reduce((final, key) => {
517
+ if (obj[key]) final[key] = obj[key];
518
+ return final;
519
+ }, {});
520
+ };
521
+ const isDefined = (v) => v !== null && v !== void 0;
522
+ const isBoolean = (v) => typeof v === "boolean";
523
+ const isFunction = (v) => typeof v === "function";
524
+ const isNumber = (v) => typeof v === "number";
525
+ const isObject = (val) => val != null && typeof val === "object" && Array.isArray(val) === false;
526
+ const isString = (v) => typeof v === "string";
527
+ const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
528
+ //#endregion
529
+ export { VALID_CONFIG_OUTPUT_TARGETS as $, DIST_LAZY as A, HOST_FLAGS as B, CMP_FLAGS as C, COPY as D, COLLECTION_MANIFEST_FILE_NAME as E, DOCS_README as F, NODE_TYPES as G, LISTENER_FLAGS as H, DOCS_VSCODE as I, STANDALONE as J, SSR as K, EVENT_FLAGS as L, DOCS_CUSTOM as M, DOCS_CUSTOM_ELEMENTS_MANIFEST as N, CUSTOM as O, DOCS_JSON as P, TYPES as Q, GENERATED_DTS as R, ASSETS as S, COLLECTION_APP_DATA_FILE_NAME as T, LOADER_BUNDLE as U, HTML_NS as V, MEMBER_FLAGS as W, STYLE_EXT as X, STATS as Y, SVG_NS as Z, toCamelCase as _, isBoolean as a, unique as b, isFunction as c, isObject as d, WATCH_FLAGS as et, isString as f, sortBy as g, pluck as h, fromEntries as i, DOCS_AGENT_SKILL as j, DEFAULT_STYLE_MODE as k, isIterable as l, noop as m, escapeWithPattern as n, XLINK_NS as nt, isComplexType as o, mergeIntoWith as p, SSR_WASM as q, flatOne as r, isDef as s, dashToPascalCase as t, WWW as tt, isNumber as u, toDashCase as v, COLLECTION as w, queryNonceMetaTagContent as x, toTitleCase as y, GLOBAL_STYLE as z };