@sitecore-feaas/clientside 0.1.47 → 0.1.49

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 (54) hide show
  1. package/build/components/FEAASExternal.js +79 -0
  2. package/build/components/FEAASExternal.js.map +1 -0
  3. package/build/headless.js +1 -0
  4. package/build/headless.js.map +1 -1
  5. package/build/ui/react.js +1 -1
  6. package/build/ui/react.js.map +1 -1
  7. package/build/utils/string.js +13 -0
  8. package/build/utils/string.js.map +1 -0
  9. package/dist/browser/headless.cjs +5 -5
  10. package/dist/browser/headless.cjs.map +4 -4
  11. package/dist/browser/headless.esm.js +5 -5
  12. package/dist/browser/headless.esm.js.map +1 -1
  13. package/dist/browser/index.cjs +5 -5
  14. package/dist/browser/index.cjs.map +4 -4
  15. package/dist/browser/index.esm.js +5 -5
  16. package/dist/browser/index.esm.js.map +1 -1
  17. package/dist/browser/react.cjs +5 -5
  18. package/dist/browser/react.cjs.map +4 -4
  19. package/dist/browser/react.esm.js +5 -5
  20. package/dist/browser/react.esm.js.map +1 -1
  21. package/dist/node/headless.cjs +3 -3
  22. package/dist/node/headless.cjs.map +4 -4
  23. package/dist/node/headless.esm.js +3 -3
  24. package/dist/node/headless.esm.js.map +4 -4
  25. package/dist/node/index.cjs +3 -3
  26. package/dist/node/index.cjs.map +4 -4
  27. package/dist/node/index.esm.js +3 -3
  28. package/dist/node/index.esm.js.map +4 -4
  29. package/dist/node/react.cjs +3 -3
  30. package/dist/node/react.cjs.map +4 -4
  31. package/dist/node/react.esm.js +3 -3
  32. package/dist/node/react.esm.js.map +4 -4
  33. package/headless.cjs +3 -3
  34. package/headless.cjs.map +4 -4
  35. package/headless.js +3 -3
  36. package/headless.js.map +4 -4
  37. package/package.json +1 -1
  38. package/react.cjs +5 -5
  39. package/react.cjs.map +4 -4
  40. package/react.js +5 -5
  41. package/react.js.map +4 -4
  42. package/src/components/FEAASExternal.tsx +107 -0
  43. package/src/headless.ts +1 -0
  44. package/src/ui/react.tsx +1 -1
  45. package/src/utils/string.ts +12 -0
  46. package/test/FEAASExternal.test.tsx +49 -0
  47. package/types/components/FEAASExternal.d.ts +44 -0
  48. package/types/components/FEAASExternal.d.ts.map +1 -0
  49. package/types/headless.d.ts +1 -0
  50. package/types/headless.d.ts.map +1 -1
  51. package/types/tsbuildinfo +1 -1
  52. package/types/tsbuildinfo_ui +1 -1
  53. package/types/utils/string.d.ts +3 -0
  54. package/types/utils/string.d.ts.map +1 -0
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import { FEAASBase } from './FEAASBase.js';
4
+ import { kebabCase, reverseKebabCase } from '../utils/string.js';
5
+ const convertSchemaPropertiesToKebabCase = (schema) => {
6
+ if (!schema)
7
+ return;
8
+ let kebabSchemaProperties, kebabRequiredProperties;
9
+ if (schema.properties) {
10
+ kebabSchemaProperties = Object.keys(schema.properties).reduce((acc, key) => {
11
+ acc[kebabCase(key)] = schema.properties[key];
12
+ return acc;
13
+ }, {});
14
+ kebabRequiredProperties = schema.required.map((item) => kebabCase(item));
15
+ }
16
+ return { ...schema, properties: kebabSchemaProperties, required: kebabRequiredProperties };
17
+ };
18
+ export function FEAASExternalProps(element = this) {
19
+ const attributes = element.getAttributeNames();
20
+ const props = attributes.reduce((prev, curr) => {
21
+ if (!curr.startsWith('data-attribute') && !['class', 'id', 'contenteditable'].includes(curr))
22
+ return { ...prev, [reverseKebabCase(curr)]: element.getAttribute(curr) };
23
+ else
24
+ return prev;
25
+ }, {});
26
+ return props;
27
+ }
28
+ export default class FEAASExternal extends FEAASBase {
29
+ load() {
30
+ return Promise.resolve({ React, ReactDOM });
31
+ }
32
+ render(props, { React }) {
33
+ var _a;
34
+ const { dataExternalId: id } = props;
35
+ const Component = (_a = FEAASExternal.registered[id]) === null || _a === void 0 ? void 0 : _a.component;
36
+ if (!Component)
37
+ console.warn('FEAASExternal: The component you requested is not registered');
38
+ return React.createElement(React.Fragment, null, Component && React.createElement(Component, { ...props }));
39
+ }
40
+ getProps() {
41
+ return FEAASExternalProps(this);
42
+ }
43
+ static registerComponent(component, schema = {}, id) {
44
+ FEAASExternal.registered[id || component.name] = { component, schema };
45
+ }
46
+ static setRegistrationCallback() {
47
+ // if registerCallback has not already been triggered by another component, set it
48
+ if (!FEAASExternal.registrationCallback) {
49
+ FEAASExternal.registrationCallback = setTimeout(() => {
50
+ // create components array from object
51
+ const components = Object.keys(FEAASExternal.registered).map((name) => ({
52
+ ...FEAASExternal.registered[name],
53
+ name,
54
+ schema: convertSchemaPropertiesToKebabCase(FEAASExternal.registered[name].schema),
55
+ component: FEAASExternal.registered[name].component.toString()
56
+ }));
57
+ // send components from iframe to parent window
58
+ window.parent.postMessage(JSON.stringify({
59
+ action: 'register-components',
60
+ data: components
61
+ }), '*');
62
+ }, 500);
63
+ }
64
+ }
65
+ static loadComponents() {
66
+ const components = JSON.parse(sessionStorage.getItem('feaas-external-components'));
67
+ components.forEach((c) => {
68
+ const name = c.name;
69
+ const schema = c.schema;
70
+ const component = eval('(' + c.component + ')');
71
+ FEAASExternal.registerComponent(component, schema, name);
72
+ });
73
+ }
74
+ }
75
+ FEAASExternal.registered = {};
76
+ FEAASExternal.register('feaas-external');
77
+ FEAASExternal.setRegistrationCallback();
78
+ export { FEAASExternal as External };
79
+ //# sourceMappingURL=FEAASExternal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FEAASExternal.js","sourceRoot":"","sources":["../../src/components/FEAASExternal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAEhE,MAAM,kCAAkC,GAAG,CAAC,MAAW,EAAE,EAAE;IACzD,IAAI,CAAC,MAAM;QAAE,OAAM;IAEnB,IAAI,qBAAqB,EAAE,uBAAuB,CAAA;IAClD,IAAI,MAAM,CAAC,UAAU,EAAE;QACrB,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GAA8B,EAAE,GAAG,EAAE,EAAE;YACpG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC5C,OAAO,GAAG,CAAA;QACZ,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,uBAAuB,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;KACjF;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,CAAA;AAC5F,CAAC,CAAA;AAED,MAAM,UAAU,kBAAkB,CAAC,UAAqB,IAAI;IAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAA;IAC9C,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAC7C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC1F,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAA;;YACrE,OAAO,IAAI,CAAA;IAClB,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,KAAK,CAAA;AACd,CAAC;AAKD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAA2C;IAGpF,IAAI;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,CAAC,KAAyB,EAAE,EAAE,KAAK,EAAgB;;QACvD,MAAM,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,KAAK,CAAA;QACpC,MAAM,SAAS,GAAG,MAAA,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,0CAAE,SAAS,CAAA;QACzD,IAAI,CAAC,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAA;QAC5F,OAAO,0CAAG,SAAS,IAAI,oBAAC,SAAS,OAAK,KAAK,GAAI,CAAI,CAAA;IACrD,CAAC;IAED,QAAQ;QACN,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,SAAmB,EAAE,SAAc,EAAE,EAAE,EAAW;QACzE,aAAa,CAAC,UAAU,CAAC,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;IACxE,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,kFAAkF;QAClF,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE;YACvC,aAAa,CAAC,oBAAoB,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnD,sCAAsC;gBACtC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBACtE,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC;oBACjC,IAAI;oBACJ,MAAM,EAAE,kCAAkC,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;oBACjF,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE;iBAC/D,CAAC,CAAC,CAAA;gBACH,+CAA+C;gBAC/C,MAAM,CAAC,MAAM,CAAC,WAAW,CACvB,IAAI,CAAC,SAAS,CAAC;oBACb,MAAM,EAAE,qBAAqB;oBAC7B,IAAI,EAAE,UAAU;iBACjB,CAAC,EACF,GAAG,CACJ,CAAA;YACH,CAAC,EAAE,GAAG,CAAC,CAAA;SACR;IACH,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAA;QAClF,UAAU,CAAC,OAAO,CAAC,CAAC,CAAqD,EAAE,EAAE;YAC3E,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAA;YACnB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAA;YACvB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAA;YAC/C,aAAa,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;;AApDM,wBAAU,GAAyB,EAAE,CAAA;AAoE9C,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;AACxC,aAAa,CAAC,uBAAuB,EAAE,CAAA;AAEvC,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,CAAA"}
package/build/headless.js CHANGED
@@ -16,6 +16,7 @@ export * from './components/FEAASElement.js';
16
16
  export * from './components/FEAASComponent.js';
17
17
  export * from './components/FEAASLoader.js';
18
18
  export * from './components/FEAASStylesheet.js';
19
+ export * from './components/FEAASExternal.js';
19
20
  if (typeof window != 'undefined') {
20
21
  window.FEAASElement = FEAASElement;
21
22
  (_a = window.FEAASLoading) !== null && _a !== void 0 ? _a : (window.FEAASLoading = Promise.resolve());
@@ -1 +1 @@
1
- {"version":3,"file":"headless.js","sourceRoot":"","sources":["../src/headless.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,YAAY,MAAM,8BAA8B,CAAA;AAEvD,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAS/C,IAAI,OAAO,MAAM,IAAI,WAAW,EAAE;IAChC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,MAAA,MAAM,CAAC,YAAY,oCAAnB,MAAM,CAAC,YAAY,GAAK,OAAO,CAAC,OAAO,EAAE,EAAA;CAC1C"}
1
+ {"version":3,"file":"headless.js","sourceRoot":"","sources":["../src/headless.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,YAAY,MAAM,8BAA8B,CAAA;AAEvD,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAS7C,IAAI,OAAO,MAAM,IAAI,WAAW,EAAE;IAChC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,MAAA,MAAM,CAAC,YAAY,oCAAnB,MAAM,CAAC,YAAY,GAAK,OAAO,CAAC,OAAO,EAAE,EAAA;CAC1C"}
package/build/ui/react.js CHANGED
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  import { renderHTMLContent } from '../dom/html.js';
5
5
  export { renderHTMLContent };
6
6
  export function FEAASEmbed({ data, ...props }) {
7
- if ('template' in props) {
7
+ if ('template' in props && typeof props.template == 'string') {
8
8
  var html = renderHTMLContent(props.template, data || {});
9
9
  }
10
10
  if ('src' in props) {
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/ui/react.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAE5B,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAA4B;IACrE,IAAI,UAAU,IAAI,KAAK,EAAE;QACvB,IAAI,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,CAAA;KACzD;IACD,IAAI,KAAK,IAAI,KAAK,EAAE;QAClB,KAAK,GAAG;YACN,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC;YAClC,GAAG,KAAK;SACT,CAAA;KACF;IACD,OAAO,CACL,4CACM,KAAK,EACT,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,OAAO,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EACzE,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,EAAE,GAC/C,CACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAA"}
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/ui/react.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAuB,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAE5B,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAA4B;IACrE,IAAI,UAAU,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,QAAQ,IAAI,QAAQ,EAAE;QAC5D,IAAI,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,CAAA;KACzD;IACD,IAAI,KAAK,IAAI,KAAK,EAAE;QAClB,KAAK,GAAG;YACN,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC;YAClC,GAAG,KAAK;SACT,CAAA;KACF;IACD,OAAO,CACL,4CACM,KAAK,EACT,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,OAAO,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EACzE,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,EAAE,GAC/C,CACH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAA"}
@@ -0,0 +1,13 @@
1
+ export function kebabCase(str) {
2
+ const KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
3
+ return str.replace(KEBAB_REGEX, function (match) {
4
+ return '-' + match.toLowerCase();
5
+ });
6
+ }
7
+ export function reverseKebabCase(str) {
8
+ const REVERSE_KEBAB_REGEX = /-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g;
9
+ return str.replace(REVERSE_KEBAB_REGEX, function (match) {
10
+ return match.slice(1).toUpperCase();
11
+ });
12
+ }
13
+ //# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,WAAW,GAAG,kCAAkC,CAAA;IACtD,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,KAAK;QAC7C,OAAO,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;AACJ,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,mBAAmB,GAAG,mCAAmC,CAAA;IAC/D,OAAO,GAAG,CAAC,OAAO,CAAC,mBAAmB,EAAE,UAAU,KAAK;QACrD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
- var re=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var We=(t,e)=>{for(var r in e)re(t,r,{get:e[r],enumerable:!0})},ze=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ie(e))!He.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=Ue(e,i))||n.enumerable});return t};var Je=t=>ze(re({},"__esModule",{value:!0}),t);var mt={};We(mt,{Base:()=>b,Component:()=>z,ComponentProps:()=>ke,DEFAULT_CDN_URL:()=>w,FEAASBase:()=>b,FEAASComponent:()=>z,FEAASComponentsProps:()=>ke,FEAASLoader:()=>J,FEAASLoaderProps:()=>$e,FEAASStylesheet:()=>ee,FEAASStylesheetProps:()=>Te,JSONPath:()=>f,Loader:()=>J,MyComponent:()=>G,Stylesheet:()=>ee,autoloadScripts:()=>Ee,cleanCollectionBit:()=>Ae,clearFetchCache:()=>ct,createStylesheet:()=>Ne,fetchAndRevalidate:()=>ce,fetchAndRevalidateComponent:()=>$,fetchAndRevalidateStylesheet:()=>Q,fetchBypassingCache:()=>Y,fetchCache:()=>U,fetchComponent:()=>ft,fetchToValidateCache:()=>I,fetchWithCacheAwareness:()=>D,findStylesheet:()=>Oe,getComponentSource:()=>dt,getComponentURL:()=>de,getFetchCache:()=>Re,getStylesheetSource:()=>ht,getStylesheetURL:()=>W,loadScript:()=>j,loadStylesheet:()=>X,loadStylesheetAllowStale:()=>he,normalizeCollectionScope:()=>ae,observeDOMElement:()=>Se,parseComponentSource:()=>H,parseStylesheetSource:()=>Z,queryScopes:()=>V,renderComponent:()=>vt,renderComponentElement:()=>yt,renderComponentPromise:()=>Pe,renderDOMContent:()=>k,renderDOMElement:()=>g,renderHTMLContent:()=>lt,renderStylesheet:()=>pt,renderStylesheetPromise:()=>De,serializeCH1RichText:()=>N,setDOMAttribute:()=>P});module.exports=Je(mt);function x(t,e=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((u,c)=>{i=l=>{t==null||t(l),u(l)},o=c});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(e),a};return n()}var qe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,b=class extends qe{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=x(e=>{this.payload=e}),this.whenRendered=x(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEvent(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(e){this.onError(e)}}log(...e){console.log(...e)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEvent(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,-1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var o=e.refs.parent;o;o=o.refs.parent)o.render&&((n=e.refs).parentReact||(n.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(e,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEvent(i),this.whenLoaded.reject(e),!i.defaultPrevented&&!n){this.whenRendered.reject(e);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEvent(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:s}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r)}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return n.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:n,ReactDOM:i}=e.payload||{};return e.reactWrapper=o=>{if(e.render){let[s,a]=n.useReducer(u=>u+1,0);return e.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var O=class extends b{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([e,r])=>({React:e,ReactDOM:r}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},G=class extends O{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",n))}};G.observedAttributes=["counter"];function A(t){return A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(t)}function ve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function me(t,e,r){return e&&ye(t.prototype,e),r&&ye(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&B(t,e)}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L(t)}function B(t,e){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},B(t,e)}function be(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function M(t,e,r){return be()?M=Reflect.construct.bind():M=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),c=new u;return s&&B(c,s.prototype),c},M.apply(null,arguments)}function Ge(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ne(t){var e=typeof Map=="function"?new Map:void 0;return ne=function(n){if(n===null||!Ge(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return M(n,arguments,L(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},ne(t)}function Ve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ye(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ve(t)}function Ze(t){var e=be();return function(){var n=L(t),i;if(e){var o=L(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ye(this,i)}}function Qe(t){return Xe(t)||et(t)||ge(t)||tt()}function Xe(t){if(Array.isArray(t))return ie(t)}function et(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ge(t,e){if(t){if(typeof t=="string")return ie(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ie(t,e)}}function ie(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ge(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var m=Object.prototype.hasOwnProperty;function C(t,e){return t=t.slice(),t.push(e),t}function oe(t,e){return e=e.slice(),e.unshift(t),e}var nt=function(t){Ke(r,t);var e=Ze(r);function r(n){var i;return ve(this,r),i=e.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return me(r)}(ne(Error));function f(t,e,r,n,i){if(!(this instanceof f))try{return new f(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&A(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=m.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;var a=this.evaluate(s);if(!a||A(a)!=="object")throw new nt(a);return a}}f.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,s=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&A(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!m.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var c=t;e=c.json,a=m.call(t,"flatten")?t.flatten:a,this.currResultType=m.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=m.call(t,"sandbox")?t.sandbox:this.currSandbox,u=m.call(t,"wrap")?t.wrap:u,this.currPreventEval=m.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=m.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=m.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=m.call(t,"parent")?t.parent:o,s=m.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(o=o||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!e)){var l=f.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var h=this._trace(l,e,["$"],o,s,r).filter(function(d){return d&&!d.isParentSelector});return h.length?!u&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(d,p){var S=i._getPreferredOutput(p);return a&&Array.isArray(S)?d=d.concat(S):d.push(S),d},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(r),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return f.toPathString(t[e]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),e(n,r,t)}};f.prototype._trace=function(t,e,r,n,i,o,s,a){var u=this,c;if(!t.length)return c={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(c,o,"value"),c;var l=t[0],h=t.slice(1),d=[];function p(y){Array.isArray(y)?y.forEach(function(je){d.push(je)}):d.push(y)}if((typeof l!="string"||a)&&e&&m.call(e,l))p(this._trace(h,e[l],C(r,l),e,l,o,s));else if(l==="*")this._walk(e,function(y){p(u._trace(h,e[y],C(r,y),e,y,o,!0,!0))});else if(l==="..")p(this._trace(h,e,r,n,i,o,s)),this._walk(e,function(y){A(e[y])==="object"&&p(u._trace(t.slice(),e[y],C(r,y),e,y,o,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(l==="~")return c={path:C(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if(l==="$")p(this._trace(h,e,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,h,e,r,n,i,o));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var S=l.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(e,function(y){u._eval(S,e[y],y,r,n,i)&&p(u._trace(h,e[y],C(r,y),e,y,o,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(oe(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),h),e,r,n,i,o,s))}else if(l[0]==="@"){var v=!1,E=l.slice(1,-2);switch(E){case"scalar":(!e||!["object","function"].includes(A(e)))&&(v=!0);break;case"boolean":case"string":case"undefined":case"function":A(e)===E&&(v=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(v=!0);break;case"number":Number.isFinite(e)&&(v=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(v=!0);break;case"object":e&&A(e)===E&&(v=!0);break;case"array":Array.isArray(e)&&(v=!0);break;case"other":v=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(v=!0);break;default:throw new TypeError("Unknown value type "+E)}if(v)return c={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if(l[0]==="`"&&e&&m.call(e,l.slice(1))){var _=l.slice(1);p(this._trace(h,e[_],C(r,_),e,_,o,s,!0))}else if(l.includes(",")){var Me=l.split(","),q=rt(Me),pe;try{for(q.s();!(pe=q.n()).done;){var Le=pe.value;p(this._trace(oe(Le,h),e,r,n,i,o,!0))}}catch(y){q.e(y)}finally{q.f()}}else!a&&e&&m.call(e,l)&&p(this._trace(h,e[l],C(r,l),e,l,o,s,!0))}if(this._hasParentSelector)for(var F=0;F<d.length;F++){var K=d[F];if(K&&K.isParentSelector){var T=this._trace(K.expr,e,K.path,n,i,o,s);if(Array.isArray(T)){d[F]=T[0];for(var Be=T.length,te=1;te<Be;te++)F++,d.splice(F,0,T[te])}else d[F]=T}}return d};f.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&A(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};f.prototype._slice=function(t,e,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,u=t.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,h=u[1]&&Number.parseInt(u[1])||a;l=l<0?Math.max(0,l+a):Math.min(a,l),h=h<0?Math.max(0,h+a):Math.min(a,h);for(var d=[],p=l;p<h;p+=c){var S=this._trace(oe(p,e),r,n,i,o,s,!0);S.forEach(function(v){d.push(v)})}return d}};f.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var s=t.includes("@path");s&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+t;if(!f.cache[a]){var u=t.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");s&&(u=u.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(u)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+t)}};f.cache={};f.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};f.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};f.toPathArray=function(t){var e=f.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var s=o.match(/#([0-9]+)/);return!s||!s[1]?o:r[s[1]]});return e[t]=i,e[t].concat()};var it=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var s=e[o];n(s)&&r.push(e.splice(o--,1)[0])}},ot=function(){function t(e){ve(this,t),this.code=e}return me(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];it(i,o,function(l){return typeof r[l]=="function"});var s=i.map(function(l,h){return r[l]}),a=o.reduce(function(l,h){var d=r[h].toString();return/function/.test(d)||(d="function "+d),"var "+h+"="+d+";"+l},"");n=a+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var u=n.lastIndexOf(";"),c=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return M(Function,i.concat([c])).apply(void 0,Qe(s))}}]),t}();f.prototype.vm={Script:ot};function Ae(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ae(t){return Ae(t)+".*"}function V(t,e,r=!1,n=t){var i=e;let o=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of o)if(e.startsWith(a)){if(a==e){if(r)return t[a];continue}i=e.substring(a.length+1),n=t[a];break}var s=f({path:i,json:n});return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((a,u,c)=>c.indexOf(a)===u).reduce((a,u)=>a.length>0?a:f({path:u,json:n}),[])),r&&Array.isArray(s)?s[0]:s}function se(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${N(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):N(t)}function N(t){var e;if(Array.isArray(t))return t.map(N).join(`
4
- `).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return se(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>se(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return se(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var R=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new R(i)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get innerHTML(){return ue(this.childNodes)}set innerHTML(e){this.childNodes=le(String(e!=null?e:""))}get outerHTML(){return ue([this])}closest(e){let r=this;for(;r;){if(we(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(we(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};for(let o of this.childNodes)i(o);return n}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+e;o>=0&&o<n.length;o+=e){let s=n[o];if(!r||s.nodeType===1)return s}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,1),e.parentNode=void 0,e}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(e=!1){let r=new R(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function we(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(e.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(e.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],s=i[3],a=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function le(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(i){let s=i[1],u=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(l=>{let[h,d,,p]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:at(p||"")}}))||[],c=new R(s,1);if(c.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);n.push(c),t=t.slice(i[0].length)}else if(o)n.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),u=new R("#text",3);if(u.textContent=a,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);t=t.slice(a.length)}}return r}function st(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function at(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function ue(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:s,value:a})=>` ${s}="${st(String(a))}"`).join(""),o=ue(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Se(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&j(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&Ee(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Ee(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];j(i,i.getAttribute("data-embed-src"))}if(e)return Se(t)}function j(t,e){for(var r=t;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",e),r.appendChild(o);break}}function _e(t){let e=t.getAttribute("data-path-scope");for(var r=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==e&&r++;return r}function ut(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=_e(t);if(i!=0)return;let o=t.parentNode;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var s=i+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,a=u);for(var c=s;c<e;c++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,e);c<s;c++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function P(t,e,r,n){var i;if(t){var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=N(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var s=e.replace("data-path-","");if(e=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")o=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")s="innerHTML";else if(e=="data-embed-src")j(t,r);else if(e=="data-path-attributes"){let h=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var a in r){var u=r[a];P(t,a,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var c=0;c<h.length;c++)(r==null||!(h[c]in r))&&P(t,h[c],null,n);P(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);r!=null?s=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(s)!=r&&o.setAttribute(s,r):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}var xe=["data-attributes-keys","data-path-attributes","data-path-scope"];function g(t,e,r,n){var i,o,s;let a=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,e))||e),a.nodeType==1){let l=a.getAttribute("data-path-scope");if(l){let d=_e(a),p=V(e,l,!1)||[];d==0&&ut(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,p))===!1?1:p.length,r),e={...e,[ae(l)]:p[d]}}let h=Array.prototype.slice.call(a.attributes).sort((d,p)=>xe.indexOf(d.name)-xe.indexOf(p.name));for(var u=0;u<h.length;u++){let{name:d,value:p}=h[u];d.startsWith("data-path")&&d!="data-path-scope"&&P(a,d,V(e,p,!0),r),d=="data-embed-src"&&P(a,d,a.getAttribute(d),r)}}for(var u=0,c;c=a.childNodes[u++];)Fe(c)&&g(c,e,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,e),a}function Fe(t){return t.nodeType==1}function k(t,e,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=o,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var a=0,u;u=t.childNodes[a++];)Fe(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return g(t,r,n)}function lt(t,e,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,t,e))||t;if(typeof document=="undefined"||n){let s=le(o);return g(s[0],e,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,g(s,e,r),s.innerHTML}}var Ce=["initial","check","updated"],U={};function ct(){U={}}async function ce(t,e,r,n,i=U){return D({url:t,options:e,validator:r,callback:n,cache:i}).then(I).then(o=>o.response)}function Re(t,e=!1){let r=String(t).replace("?head","");var n=U[r];return!n&&!e&&(n=U[r]={phase:null,initial:x(),check:x(),updated:x(),final:x()}),n}async function D({url:t,options:e,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=Re(t);if(Ce.indexOf(a.phase)>=Ce.indexOf(o))var u=a[o];else a.phase=o}let c=await(u||fetch(t,e));if(!u&&a&&(c.ok?a[o].resolve(c):a[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");if((r==null?void 0:r(c))===!1)throw new Error("Response is not valid");let l=new Date(c.headers.get("date"))<s||u&&o=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(c,o,l)),{url:t,options:e,isCached:l,response:c,validator:r,callback:n,cache:i}}async function I(t){let{url:e,isCached:r,options:n,validator:i,response:o,cache:s}=t;if(r){let{response:a}=await D({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return Y(t)}return t}async function Y(t){return D({...t,options:{...t.options,cache:"reload"}},"updated")}var w="https://feaas.blob.core.windows.net";function H(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,o,s]=e;return{cdn:r,library:n,component:i,version:o,revision:s}}}function dt(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=w?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function ht(t){return`${t.cdn&&t.cdn!=w?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function Z(t){let e=t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,n,i]=e;return{cdn:r,library:n,revision:i}}else{let o=H(t);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function de(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...H(t.src)}),`${t.cdn||t.hostname||w}/components/${t.library}/${t.component}/${t.version}/${t.revision||"published"}.html`}function W(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...Z(t.src)}),`${t.cdn||t.hostname||w}/styles/${t.library}/${t.revision||"published"}.css`}async function $(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&D({options:{headers:{Accept:"text/html"},credentials:"omit"},url:de({...t,version:t.instance}),validator:n}).catch(a=>a),D({url:de(t),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:I({...s,callback:i}).catch(a=>{if(o[0]==s&&(Y({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),I({...o[1],callback:i});throw a})}async function ft(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await $(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function Q(t,e){return typeof t=="string"&&(t={src:t}),ce(W(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>e(i,n)))}function pt(t,e){return De(t,e||(e=document.createElement("style"))),e}function De(t,e){return e||(e=document.createElement("style")),Q(t,(r,n)=>{e.textContent=r}).then(()=>e)}function X(t,e){var r=Oe(t);if(!r)var n=Ne(t);return Q(t,(i,o)=>{n&&(n.textContent=i),e==null||e(i,o)}).then(()=>r||n)}function he(t){return new Promise((e,r)=>{X(t,e).catch(r)})}function Oe(t){return document.head.querySelector(`style[data-href="${W(t)}"]`)}function Ne(t){let e=W(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function yt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return g(n,e),r}function vt(t,e){return Pe(t,e||(e=document.createElement("div"))),e}async function Pe(t,e){return e||(e=document.createElement("div")),e.childNodes.length?g(e,t.data,t):"template"in t?k(e,t.template,t.data,t):$(t,r=>k(e,r,t.data,t)).then(()=>e)}function ke(t=this){var e,r,n,i,o,s,a,u;let c,l=t.getAttribute("src");if(l){let _=H(l);if(!_)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:h,library:d,component:p,version:S,revision:v}=_}let E=t.getAttribute("data");if(E!=null&&E!="")try{c=typeof E=="string"?JSON.parse(E):{}}catch(_){}return{data:c||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:h)!==null&&r!==void 0?r:w,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:p,version:(s=(o=t.getAttribute("version"))!==null&&o!==void 0?o:S)!==null&&s!==void 0?s:"responsive",revision:(u=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:v)!==null&&u!==void 0?u:"published",hostname:t.getAttribute("hostname"),template:t.getAttribute("template"),instance:t.getAttribute("instance"),editable:t.getAttribute("editable")!=null,suspended:t.getAttribute("suspended")!=null,lastModified:t.getAttribute("last-modified"),withStylesheet:t.getAttribute("with-stylesheet")!="false"}}var z=class extends b{setData(e){this.set({data:e})}getProps(){return ke(this)}attributeChangedCallback(e,r,n){r!==n&&((e=="library"||e=="component"||e=="revision"||e=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(e,r,n))}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.defaultProps={cdn:w,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=e=>{this.payload=e,this.advance()},this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let e=this.getEditor();if(e!=null&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==e;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(!this.getOriginal()){if(this.props.withStylesheet)var e=he({...this.props,revision:"published"}).then(()=>{e=null,this.payload&&this.onLoad(this.payload)});return Promise.all([e,$(this.props,r=>{this.payload=r,e||this.onLoad(r)})]).then(()=>this.payload)}}update(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)g(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;k(this,this.payload,this.props.data)}}};z.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];z.register("feaas-component");function $e(t=this){return{opacity:t!=null&&t.getAttribute("opacity")?parseFloat(t==null?void 0:t.getAttribute("opacity")):1,hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var J=class extends b{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return $e(this)}attributeChangedCallback(e,r,n){if(r!==n)return e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
1
+ var Ge=Object.create;var V=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var Qe=(t,e)=>{for(var r in e)V(t,r,{get:e[r],enumerable:!0})},me=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ye(e))!Ze.call(t,i)&&i!==r&&V(t,i,{get:()=>e[i],enumerable:!(n=Ve(e,i))||n.enumerable});return t};var be=(t,e,r)=>(r=t!=null?Ge(Xe(t)):{},me(e||!t||!t.__esModule?V(r,"default",{value:t,enumerable:!0}):r,t)),et=t=>me(V({},"__esModule",{value:!0}),t);var Ct={};Qe(Ct,{Base:()=>g,Component:()=>J,ComponentProps:()=>Le,DEFAULT_CDN_URL:()=>S,External:()=>_FEAASExternal,FEAASBase:()=>g,FEAASComponent:()=>J,FEAASComponentsProps:()=>Le,FEAASExternalProps:()=>We,FEAASLoader:()=>q,FEAASLoaderProps:()=>Be,FEAASStylesheet:()=>re,FEAASStylesheetProps:()=>je,JSONPath:()=>p,Loader:()=>q,MyComponent:()=>Y,Stylesheet:()=>re,autoloadScripts:()=>Ce,cleanCollectionBit:()=>xe,clearFetchCache:()=>gt,createStylesheet:()=>$e,fetchAndRevalidate:()=>de,fetchAndRevalidateComponent:()=>$,fetchAndRevalidateStylesheet:()=>ee,fetchBypassingCache:()=>Z,fetchCache:()=>I,fetchComponent:()=>St,fetchToValidateCache:()=>H,fetchWithCacheAwareness:()=>O,findStylesheet:()=>Te,getComponentSource:()=>At,getComponentURL:()=>he,getFetchCache:()=>Pe,getStylesheetSource:()=>Et,getStylesheetURL:()=>z,loadScript:()=>U,loadStylesheet:()=>te,loadStylesheetAllowStale:()=>fe,normalizeCollectionScope:()=>ue,observeDOMElement:()=>_e,parseComponentSource:()=>W,parseStylesheetSource:()=>Q,queryScopes:()=>X,renderComponent:()=>Ft,renderComponentElement:()=>xt,renderComponentPromise:()=>Me,renderDOMContent:()=>T,renderDOMElement:()=>A,renderHTMLContent:()=>bt,renderStylesheet:()=>wt,renderStylesheetPromise:()=>ke,serializeCH1RichText:()=>P,setDOMAttribute:()=>k});module.exports=et(Ct);function F(t,e=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((u,d)=>{i=l=>{t==null||t(l),u(l)},o=d});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(e),a};return n()}var tt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,g=class extends tt{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=F(e=>{this.payload=e}),this.whenRendered=F(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEvent(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(e){this.onError(e)}}log(...e){console.log(...e)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEvent(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,-1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var o=e.refs.parent;o;o=o.refs.parent)o.render&&((n=e.refs).parentReact||(n.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(e,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEvent(i),this.whenLoaded.reject(e),!i.defaultPrevented&&!n){this.whenRendered.reject(e);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEvent(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:s}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r)}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return n.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:n,ReactDOM:i}=e.payload||{};return e.reactWrapper=o=>{if(e.render){let[s,a]=n.useReducer(u=>u+1,0);return e.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var N=class extends g{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([e,r])=>({React:e,ReactDOM:r}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},Y=class extends N{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",n))}};Y.observedAttributes=["counter"];function E(t){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(t)}function Ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ge(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ee(t,e,r){return e&&ge(t.prototype,e),r&&ge(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B(t)}function j(t,e){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},j(t,e)}function Se(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function L(t,e,r){return Se()?L=Reflect.construct.bind():L=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),d=new u;return s&&j(d,s.prototype),d},L.apply(null,arguments)}function nt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ie(t){var e=typeof Map=="function"?new Map:void 0;return ie=function(n){if(n===null||!nt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return L(n,arguments,B(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),j(i,n)},ie(t)}function it(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ot(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return it(t)}function st(t){var e=Se();return function(){var n=B(t),i;if(e){var o=B(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ot(this,i)}}function at(t){return ut(t)||lt(t)||we(t)||ct()}function ut(t){if(Array.isArray(t))return oe(t)}function lt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function we(t,e){if(t){if(typeof t=="string")return oe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oe(t,e)}}function oe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ct(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=we(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var b=Object.prototype.hasOwnProperty;function R(t,e){return t=t.slice(),t.push(e),t}function se(t,e){return e=e.slice(),e.unshift(t),e}var ht=function(t){rt(r,t);var e=st(r);function r(n){var i;return Ae(this,r),i=e.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return Ee(r)}(ie(Error));function p(t,e,r,n,i){if(!(this instanceof p))try{return new p(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&E(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=b.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;var a=this.evaluate(s);if(!a||E(a)!=="object")throw new ht(a);return a}}p.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,s=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&E(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var d=t;e=d.json,a=b.call(t,"flatten")?t.flatten:a,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=b.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=b.call(t,"parent")?t.parent:o,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(o=o||null,s=s||null,Array.isArray(t)&&(t=p.toPathString(t)),!(!t&&t!==""||!e)){var l=p.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var f=this._trace(l,e,["$"],o,s,r).filter(function(h){return h&&!h.isParentSelector});return f.length?!u&&f.length===1&&!f[0].hasArrExpr?this._getPreferredOutput(f[0]):f.reduce(function(h,y){var w=i._getPreferredOutput(y);return a&&Array.isArray(w)?h=h.concat(w):h.push(w),h},[]):u?[]:void 0}};p.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:p.toPathArray(t.path);return t.pointer=p.toPointer(r),t.path=typeof t.path=="string"?t.path:p.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return p.toPathString(t[e]);case"pointer":return p.toPointer(t.path);default:throw new TypeError("Unknown result type")}};p.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:p.toPathString(t.path),e(n,r,t)}};p.prototype._trace=function(t,e,r,n,i,o,s,a){var u=this,d;if(!t.length)return d={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(d,o,"value"),d;var l=t[0],f=t.slice(1),h=[];function y(v){Array.isArray(v)?v.forEach(function(Ke){h.push(Ke)}):h.push(v)}if((typeof l!="string"||a)&&e&&b.call(e,l))y(this._trace(f,e[l],R(r,l),e,l,o,s));else if(l==="*")this._walk(e,function(v){y(u._trace(f,e[v],R(r,v),e,v,o,!0,!0))});else if(l==="..")y(this._trace(f,e,r,n,i,o,s)),this._walk(e,function(v){E(e[v])==="object"&&y(u._trace(t.slice(),e[v],R(r,v),e,v,o,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:f,isParentSelector:!0};if(l==="~")return d={path:R(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(d,o,"property"),d;if(l==="$")y(this._trace(f,e,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))y(this._slice(l,f,e,r,n,i,o));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var w=l.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(e,function(v){u._eval(w,e[v],v,r,n,i)&&y(u._trace(f,e[v],R(r,v),e,v,o,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(se(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),f),e,r,n,i,o,s))}else if(l[0]==="@"){var m=!1,x=l.slice(1,-2);switch(x){case"scalar":(!e||!["object","function"].includes(E(e)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":E(e)===x&&(m=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(m=!0);break;case"number":Number.isFinite(e)&&(m=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(m=!0);break;case"object":e&&E(e)===x&&(m=!0);break;case"array":Array.isArray(e)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+x)}if(m)return d={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(d,o,"value"),d}else if(l[0]==="`"&&e&&b.call(e,l.slice(1))){var _=l.slice(1);y(this._trace(f,e[_],R(r,_),e,_,o,s,!0))}else if(l.includes(",")){var ze=l.split(","),K=dt(ze),ve;try{for(K.s();!(ve=K.n()).done;){var Je=ve.value;y(this._trace(se(Je,f),e,r,n,i,o,!0))}}catch(v){K.e(v)}finally{K.f()}}else!a&&e&&b.call(e,l)&&y(this._trace(f,e[l],R(r,l),e,l,o,s,!0))}if(this._hasParentSelector)for(var C=0;C<h.length;C++){var G=h[C];if(G&&G.isParentSelector){var M=this._trace(G.expr,e,G.path,n,i,o,s);if(Array.isArray(M)){h[C]=M[0];for(var qe=M.length,ne=1;ne<qe;ne++)C++,h.splice(C,0,M[ne])}else h[C]=M}}return h};p.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&E(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};p.prototype._slice=function(t,e,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,u=t.split(":"),d=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||a;l=l<0?Math.max(0,l+a):Math.min(a,l),f=f<0?Math.max(0,f+a):Math.min(a,f);for(var h=[],y=l;y<f;y+=d){var w=this._trace(se(y,e),r,n,i,o,s,!0);w.forEach(function(m){h.push(m)})}return h}};p.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var s=t.includes("@path");s&&(this.currSandbox._$_path=p.toPathString(n.concat([r])));var a="script:"+t;if(!p.cache[a]){var u=t.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");s&&(u=u.replace(/@path/g,"_$_path")),p.cache[a]=new this.vm.Script(u)}try{return p.cache[a].runInNewContext(this.currSandbox)}catch(d){throw new Error("jsonPath: "+d.message+": "+t)}};p.cache={};p.toPathString=function(t){for(var e=t,r=e.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};p.toPointer=function(t){for(var e=t,r=e.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};p.toPathArray=function(t){var e=p.cache;if(e[t])return e[t].concat();var r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var s=o.match(/#([0-9]+)/);return!s||!s[1]?o:r[s[1]]});return e[t]=i,e[t].concat()};var ft=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var s=e[o];n(s)&&r.push(e.splice(o--,1)[0])}},pt=function(){function t(e){Ae(this,t),this.code=e}return Ee(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];ft(i,o,function(l){return typeof r[l]=="function"});var s=i.map(function(l,f){return r[l]}),a=o.reduce(function(l,f){var h=r[f].toString();return/function/.test(h)||(h="function "+h),"var "+f+"="+h+";"+l},"");n=a+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var u=n.lastIndexOf(";"),d=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return L(Function,i.concat([d])).apply(void 0,at(s))}}]),t}();p.prototype.vm={Script:pt};function xe(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ue(t){return xe(t)+".*"}function X(t,e,r=!1,n=t){var i=e;let o=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of o)if(e.startsWith(a)){if(a==e){if(r)return t[a];continue}i=e.substring(a.length+1),n=t[a];break}var s=p({path:i,json:n});return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((a,u,d)=>d.indexOf(a)===u).reduce((a,u)=>a.length>0?a:p({path:u,json:n}),[])),r&&Array.isArray(s)?s[0]:s}function ae(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${P(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):P(t)}function P(t){var e;if(Array.isArray(t))return t.map(P).join(`
4
+ `).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return ae(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>ae(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return ae(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var D=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new D(i)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get innerHTML(){return le(this.childNodes)}set innerHTML(e){this.childNodes=ce(String(e!=null?e:""))}get outerHTML(){return le([this])}closest(e){let r=this;for(;r;){if(Fe(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(Fe(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};for(let o of this.childNodes)i(o);return n}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+e;o>=0&&o<n.length;o+=e){let s=n[o];if(!r||s.nodeType===1)return s}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,1),e.parentNode=void 0,e}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(e=!1){let r=new D(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function Fe(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(e.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(e.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],s=i[3],a=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function ce(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(i){let s=i[1],u=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(l=>{let[f,h,,y]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:vt(y||"")}}))||[],d=new D(s,1);if(d.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(d),d.parentNode=l}else r.push(d);n.push(d),t=t.slice(i[0].length)}else if(o)n.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),u=new D("#text",3);if(u.textContent=a,n.length>0){let d=n[n.length-1];d.childNodes.push(u),u.parentNode=d}else r.push(u);t=t.slice(a.length)}}return r}function yt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function vt(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function le(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:s,value:a})=>` ${s}="${yt(String(a))}"`).join(""),o=le(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function _e(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&U(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&Ce(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Ce(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];U(i,i.getAttribute("data-embed-src"))}if(e)return _e(t)}function U(t,e){for(var r=t;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",e),r.appendChild(o);break}}function De(t){let e=t.getAttribute("data-path-scope");for(var r=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==e&&r++;return r}function mt(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=De(t);if(i!=0)return;let o=t.parentNode;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var s=i+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,a=u);for(var d=s;d<e;d++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,e);d<s;d++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function k(t,e,r,n){var i;if(t){var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=P(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var s=e.replace("data-path-","");if(e=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")o=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")s="innerHTML";else if(e=="data-embed-src")U(t,r);else if(e=="data-path-attributes"){let f=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var a in r){var u=r[a];k(t,a,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var d=0;d<f.length;d++)(r==null||!(f[d]in r))&&k(t,f[d],null,n);k(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);r!=null?s=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(s)!=r&&o.setAttribute(s,r):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}var Re=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(t,e,r,n){var i,o,s;let a=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,e))||e),a.nodeType==1){let l=a.getAttribute("data-path-scope");if(l){let h=De(a),y=X(e,l,!1)||[];h==0&&mt(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,y))===!1?1:y.length,r),e={...e,[ue(l)]:y[h]}}let f=Array.prototype.slice.call(a.attributes).sort((h,y)=>Re.indexOf(h.name)-Re.indexOf(y.name));for(var u=0;u<f.length;u++){let{name:h,value:y}=f[u];h.startsWith("data-path")&&h!="data-path-scope"&&k(a,h,X(e,y,!0),r),h=="data-embed-src"&&k(a,h,a.getAttribute(h),r)}}for(var u=0,d;d=a.childNodes[u++];)Oe(d)&&A(d,e,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,e),a}function Oe(t){return t.nodeType==1}function T(t,e,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=o,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var a=0,u;u=t.childNodes[a++];)Oe(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(t,r,n)}function bt(t,e,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,t,e))||t;if(typeof document=="undefined"||n){let s=ce(o);return A(s[0],e,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,A(s,e,r),s.innerHTML}}var Ne=["initial","check","updated"],I={};function gt(){I={}}async function de(t,e,r,n,i=I){return O({url:t,options:e,validator:r,callback:n,cache:i}).then(H).then(o=>o.response)}function Pe(t,e=!1){let r=String(t).replace("?head","");var n=I[r];return!n&&!e&&(n=I[r]={phase:null,initial:F(),check:F(),updated:F(),final:F()}),n}async function O({url:t,options:e,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=Pe(t);if(Ne.indexOf(a.phase)>=Ne.indexOf(o))var u=a[o];else a.phase=o}let d=await(u||fetch(t,e));if(!u&&a&&(d.ok?a[o].resolve(d):a[o].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");if((r==null?void 0:r(d))===!1)throw new Error("Response is not valid");let l=new Date(d.headers.get("date"))<s||u&&o=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(d,o,l)),{url:t,options:e,isCached:l,response:d,validator:r,callback:n,cache:i}}async function H(t){let{url:e,isCached:r,options:n,validator:i,response:o,cache:s}=t;if(r){let{response:a}=await O({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return Z(t)}return t}async function Z(t){return O({...t,options:{...t.options,cache:"reload"}},"updated")}var S="https://feaas.blob.core.windows.net";function W(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,o,s]=e;return{cdn:r,library:n,component:i,version:o,revision:s}}}function At(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=S?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Et(t){return`${t.cdn&&t.cdn!=S?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function Q(t){let e=t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,n,i]=e;return{cdn:r,library:n,revision:i}}else{let o=W(t);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function he(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...W(t.src)}),`${t.cdn||t.hostname||S}/components/${t.library}/${t.component}/${t.version}/${t.revision||"published"}.html`}function z(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...Q(t.src)}),`${t.cdn||t.hostname||S}/styles/${t.library}/${t.revision||"published"}.css`}async function $(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&O({options:{headers:{Accept:"text/html"},credentials:"omit"},url:he({...t,version:t.instance}),validator:n}).catch(a=>a),O({url:he(t),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:H({...s,callback:i}).catch(a=>{if(o[0]==s&&(Z({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),H({...o[1],callback:i});throw a})}async function St(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await $(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function ee(t,e){return typeof t=="string"&&(t={src:t}),de(z(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>e(i,n)))}function wt(t,e){return ke(t,e||(e=document.createElement("style"))),e}function ke(t,e){return e||(e=document.createElement("style")),ee(t,(r,n)=>{e.textContent=r}).then(()=>e)}function te(t,e){var r=Te(t);if(!r)var n=$e(t);return ee(t,(i,o)=>{n&&(n.textContent=i),e==null||e(i,o)}).then(()=>r||n)}function fe(t){return new Promise((e,r)=>{te(t,e).catch(r)})}function Te(t){return document.head.querySelector(`style[data-href="${z(t)}"]`)}function $e(t){let e=z(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function xt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,e),r}function Ft(t,e){return Me(t,e||(e=document.createElement("div"))),e}async function Me(t,e){return e||(e=document.createElement("div")),e.childNodes.length?A(e,t.data,t):"template"in t?T(e,t.template,t.data,t):$(t,r=>T(e,r,t.data,t)).then(()=>e)}function Le(t=this){var e,r,n,i,o,s,a,u;let d,l=t.getAttribute("src");if(l){let _=W(l);if(!_)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:f,library:h,component:y,version:w,revision:m}=_}let x=t.getAttribute("data");if(x!=null&&x!="")try{d=typeof x=="string"?JSON.parse(x):{}}catch(_){}return{data:d||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:f)!==null&&r!==void 0?r:S,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:h,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:y,version:(s=(o=t.getAttribute("version"))!==null&&o!==void 0?o:w)!==null&&s!==void 0?s:"responsive",revision:(u=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:m)!==null&&u!==void 0?u:"published",hostname:t.getAttribute("hostname"),template:t.getAttribute("template"),instance:t.getAttribute("instance"),editable:t.getAttribute("editable")!=null,suspended:t.getAttribute("suspended")!=null,lastModified:t.getAttribute("last-modified"),withStylesheet:t.getAttribute("with-stylesheet")!="false"}}var J=class extends g{setData(e){this.set({data:e})}getProps(){return Le(this)}attributeChangedCallback(e,r,n){r!==n&&((e=="library"||e=="component"||e=="revision"||e=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(e,r,n))}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.defaultProps={cdn:S,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=e=>{this.payload=e,this.advance()},this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let e=this.getEditor();if(e!=null&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==e;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(!this.getOriginal()){if(this.props.withStylesheet)var e=fe({...this.props,revision:"published"}).then(()=>{e=null,this.payload&&this.onLoad(this.payload)});return Promise.all([e,$(this.props,r=>{this.payload=r,e||this.onLoad(r)})]).then(()=>this.payload)}}update(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;T(this,this.payload,this.props.data)}}};J.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];J.register("feaas-component");function Be(t=this){return{opacity:t!=null&&t.getAttribute("opacity")?parseFloat(t==null?void 0:t.getAttribute("opacity")):1,hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var q=class extends g{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Be(this)}attributeChangedCallback(e,r,n){if(r!==n)return e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
5
5
  #loader {
6
6
  position: absolute;
7
7
  top: 0;
@@ -65,5 +65,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
65
65
  style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
66
66
  ></circle>
67
67
  </svg>
68
- </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};J.observedAttributes=["hidden","opacity"];J.register("feaas-loader");function Te(t=this){var e,r,n,i;let o=t.getAttribute("src");if(o)var{cdn:s,library:a,revision:u}=Z(o);return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=(e=t==null?void 0:t.getAttribute("revision"))!==null&&e!==void 0?e:u)!==null&&r!==void 0?r:"published",cdn:(i=(n=t==null?void 0:t.getContextAttribute("cdn"))!==null&&n!==void 0?n:t==null?void 0:t.getContextAttribute("hostname"))!==null&&i!==void 0?i:w}}var ee=class extends b{constructor(){super(...arguments),this.onLoad=e=>{this.payload=e,this.advance()}}getProps(){return Te(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return X(this.props,this.onLoad)}};ee.register("feaas-stylesheet");var fe;typeof window!="undefined"&&(window.FEAASElement=O,(fe=window.FEAASLoading)!==null&&fe!==void 0||(window.FEAASLoading=Promise.resolve()));
68
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};q.observedAttributes=["hidden","opacity"];q.register("feaas-loader");function je(t=this){var e,r,n,i;let o=t.getAttribute("src");if(o)var{cdn:s,library:a,revision:u}=Q(o);return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=(e=t==null?void 0:t.getAttribute("revision"))!==null&&e!==void 0?e:u)!==null&&r!==void 0?r:"published",cdn:(i=(n=t==null?void 0:t.getContextAttribute("cdn"))!==null&&n!==void 0?n:t==null?void 0:t.getContextAttribute("hostname"))!==null&&i!==void 0?i:S}}var re=class extends g{constructor(){super(...arguments),this.onLoad=e=>{this.payload=e,this.advance()}}getProps(){return je(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return te(this.props,this.onLoad)}};re.register("feaas-stylesheet");var Ie=be(require("react"),1),He=be(require("react-dom"),1);function pe(t){let e=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return t.replace(e,function(r){return"-"+r.toLowerCase()})}function Ue(t){let e=/-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g;return t.replace(e,function(r){return r.slice(1).toUpperCase()})}var _t=t=>{if(!t)return;let e,r;return t.properties&&(e=Object.keys(t.properties).reduce((n,i)=>(n[pe(i)]=t.properties[i],n),{}),r=t.required.map(n=>pe(n))),{...t,properties:e,required:r}};function We(t=this){return t.getAttributeNames().reduce((n,i)=>!i.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(i)?{...n,[Ue(i)]:t.getAttribute(i)}:n,{})}var _FEAASExternal=class extends g{load(){return Promise.resolve({React:Ie.default,ReactDOM:He.default})}render(t,{React:e}){var r;let{dataExternalId:n}=t,i=(r=_FEAASExternal.registered[n])===null||r===void 0?void 0:r.component;return i||console.warn("FEAASExternal: The component you requested is not registered"),e.createElement(e.Fragment,null,i&&e.createElement(i,{...t}))}getProps(){return We(this)}static registerComponent(t,e={},r){_FEAASExternal.registered[r||t.name]={component:t,schema:e}}static setRegistrationCallback(){_FEAASExternal.registrationCallback||(_FEAASExternal.registrationCallback=setTimeout(()=>{let t=Object.keys(_FEAASExternal.registered).map(e=>({..._FEAASExternal.registered[e],name:e,schema:_t(_FEAASExternal.registered[e].schema),component:_FEAASExternal.registered[e].component.toString()}));window.parent.postMessage(JSON.stringify({action:"register-components",data:t}),"*")},500))}static loadComponents(){let components=JSON.parse(sessionStorage.getItem("feaas-external-components"));components.forEach(c=>{let name=c.name,schema=c.schema,component=eval("("+c.component+")");_FEAASExternal.registerComponent(component,schema,name)})}};_FEAASExternal.registered={};_FEAASExternal.register("feaas-external");_FEAASExternal.setRegistrationCallback();var ye;typeof window!="undefined"&&(window.FEAASElement=N,(ye=window.FEAASLoading)!==null&&ye!==void 0||(window.FEAASLoading=Promise.resolve()));
69
69
  //# sourceMappingURL=headless.cjs.map