@ui5/webcomponents-base 0.0.0-99b763015 → 0.0.0-99b9fe544

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 (50) hide show
  1. package/.eslintignore +4 -4
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +37 -0
  4. package/bundle.esm.js +2 -0
  5. package/config/wdio.conf.cjs +400 -0
  6. package/dist/InitialConfiguration.d.ts +6 -1
  7. package/dist/InitialConfiguration.js +10 -1
  8. package/dist/InitialConfiguration.js.map +1 -1
  9. package/dist/asset-registries/Icons.js +3 -0
  10. package/dist/asset-registries/Icons.js.map +1 -1
  11. package/dist/assets/Boot.0d8f227d.js +9 -0
  12. package/dist/assets/bundle.esm.d78699e8.js +50 -0
  13. package/dist/config/Icons.js +5 -5
  14. package/dist/config/Icons.js.map +1 -1
  15. package/dist/config/NoConflict.js +1 -0
  16. package/dist/config/NoConflict.js.map +1 -1
  17. package/dist/config/Theme.d.ts +6 -5
  18. package/dist/config/Theme.js +14 -7
  19. package/dist/config/Theme.js.map +1 -1
  20. package/dist/config/Timezone.d.ts +17 -0
  21. package/dist/config/Timezone.js +30 -0
  22. package/dist/config/Timezone.js.map +1 -0
  23. package/dist/decorators/customElement.js +10 -4
  24. package/dist/decorators/customElement.js.map +1 -1
  25. package/dist/decorators/slot.js +2 -2
  26. package/dist/decorators/slot.js.map +1 -1
  27. package/dist/features/OpenUI5Support.d.ts +1 -0
  28. package/dist/features/OpenUI5Support.js +1 -0
  29. package/dist/features/OpenUI5Support.js.map +1 -1
  30. package/dist/generated/AssetParameters.js +2 -0
  31. package/dist/generated/VersionInfo.js +3 -3
  32. package/dist/getSharedResource.d.ts +1 -1
  33. package/dist/getSharedResource.js +2 -2
  34. package/dist/getSharedResource.js.map +1 -1
  35. package/dist/global.d.ts +2 -0
  36. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
  37. package/dist/util/FocusableElements.js +4 -3
  38. package/dist/util/FocusableElements.js.map +1 -1
  39. package/dist/validateThemeRoot.js +14 -13
  40. package/dist/validateThemeRoot.js.map +1 -1
  41. package/index.js +227 -1
  42. package/lib/generate-asset-parameters/index.js +4 -2
  43. package/lib/generate-styles/index.js +3 -3
  44. package/lib/generate-version-info/index.js +1 -1
  45. package/{package-scripts.js → package-scripts.cjs} +2 -1
  46. package/package.json +4 -3
  47. package/config/wdio.conf.js +0 -1
  48. package/dist/assets/Boot.6080e450.js +0 -9
  49. package/dist/assets/bundle.esm.c372ea32.js +0 -52
  50. /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
@@ -1,10 +1,10 @@
1
1
  const VersionInfo = {
2
- version: "0.0.0-99b763015",
2
+ version: "0.0.0-99b9fe544",
3
3
  major: 0,
4
4
  minor: 0,
5
5
  patch: 0,
6
- suffix: "-99b763015",
6
+ suffix: "-99b9fe544",
7
7
  isNext: true,
8
- buildTime: 1679580986,
8
+ buildTime: 1681309027,
9
9
  };
10
10
  export default VersionInfo;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Use this method to initialize/get resources that you would like to be shared among UI5 Web Components runtime instances.
3
- * The data will be accessed via a singleton "ui5-shared-resources" HTML element in the "head" element of the page.
3
+ * The data will be accessed via a singleton "ui5-shared-resources" HTML element in the "body" element of the page.
4
4
  *
5
5
  * @public
6
6
  * @param namespace Unique ID of the resource, may contain "." to denote hierarchy
@@ -3,11 +3,11 @@ const getSharedResourcesInstance = () => {
3
3
  if (typeof document === "undefined") {
4
4
  return null;
5
5
  }
6
- return getSingletonElementInstance("ui5-shared-resources", document.head);
6
+ return getSingletonElementInstance("ui5-shared-resources");
7
7
  };
8
8
  /**
9
9
  * Use this method to initialize/get resources that you would like to be shared among UI5 Web Components runtime instances.
10
- * The data will be accessed via a singleton "ui5-shared-resources" HTML element in the "head" element of the page.
10
+ * The data will be accessed via a singleton "ui5-shared-resources" HTML element in the "body" element of the page.
11
11
  *
12
12
  * @public
13
13
  * @param namespace Unique ID of the resource, may contain "." to denote hierarchy
@@ -1 +1 @@
1
- {"version":3,"file":"getSharedResource.js","sourceRoot":"","sources":["../src/getSharedResource.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,uCAAuC,CAAC;AAEhF,MAAM,0BAA0B,GAAG,GAAmC,EAAE;IACvE,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACpC,OAAO,IAAI,CAAC;KACZ;IACD,OAAO,2BAA2B,CAAC,sBAAsB,EAAE,QAAQ,CAAC,IAAI,CAAuC,CAAC;AACjH,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GAAG,CAAI,SAAiB,EAAE,YAAe,EAAK,EAAE;IACtE,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,OAAO,GAAG,0BAA0B,EAAyB,CAAC;IAElE,IAAI,CAAC,OAAO,EAAE;QACb,OAAO,YAAY,CAAC;KACpB;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;YACzD,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C;QACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACxB;IAED,OAAO,OAAY,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import getSingletonElementInstance from \"./util/getSingletonElementInstance.js\";\n\nconst getSharedResourcesInstance = (): Record<string, unknown> | null => {\n\tif (typeof document === \"undefined\") {\n\t\treturn null;\n\t}\n\treturn getSingletonElementInstance(\"ui5-shared-resources\", document.head) as unknown as Record<string, unknown>;\n};\n\n/**\n * Use this method to initialize/get resources that you would like to be shared among UI5 Web Components runtime instances.\n * The data will be accessed via a singleton \"ui5-shared-resources\" HTML element in the \"head\" element of the page.\n *\n * @public\n * @param namespace Unique ID of the resource, may contain \".\" to denote hierarchy\n * @param initialValue Object or primitive that will be used as an initial value if the resource does not exist\n * @returns {*}\n */\nconst getSharedResource = <T>(namespace: string, initialValue: T): T => {\n\tconst parts = namespace.split(\".\");\n\tlet current = getSharedResourcesInstance() as Record<string, any>;\n\n\tif (!current) {\n\t\treturn initialValue;\n\t}\n\n\tfor (let i = 0; i < parts.length; i++) {\n\t\tconst part = parts[i];\n\t\tconst lastPart = i === parts.length - 1;\n\t\tif (!Object.prototype.hasOwnProperty.call(current, part)) {\n\t\t\tcurrent[part] = lastPart ? initialValue : {};\n\t\t}\n\t\tcurrent = current[part];\n\t}\n\n\treturn current as T;\n};\n\nexport default getSharedResource;\n"]}
1
+ {"version":3,"file":"getSharedResource.js","sourceRoot":"","sources":["../src/getSharedResource.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,uCAAuC,CAAC;AAEhF,MAAM,0BAA0B,GAAG,GAAmC,EAAE;IACvE,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACpC,OAAO,IAAI,CAAC;KACZ;IACD,OAAO,2BAA2B,CAAC,sBAAsB,CAAuC,CAAC;AAClG,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GAAG,CAAI,SAAiB,EAAE,YAAe,EAAK,EAAE;IACtE,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,OAAO,GAAG,0BAA0B,EAAyB,CAAC;IAElE,IAAI,CAAC,OAAO,EAAE;QACb,OAAO,YAAY,CAAC;KACpB;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;YACzD,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C;QACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACxB;IAED,OAAO,OAAY,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import getSingletonElementInstance from \"./util/getSingletonElementInstance.js\";\n\nconst getSharedResourcesInstance = (): Record<string, unknown> | null => {\n\tif (typeof document === \"undefined\") {\n\t\treturn null;\n\t}\n\treturn getSingletonElementInstance(\"ui5-shared-resources\") as unknown as Record<string, unknown>;\n};\n\n/**\n * Use this method to initialize/get resources that you would like to be shared among UI5 Web Components runtime instances.\n * The data will be accessed via a singleton \"ui5-shared-resources\" HTML element in the \"body\" element of the page.\n *\n * @public\n * @param namespace Unique ID of the resource, may contain \".\" to denote hierarchy\n * @param initialValue Object or primitive that will be used as an initial value if the resource does not exist\n * @returns {*}\n */\nconst getSharedResource = <T>(namespace: string, initialValue: T): T => {\n\tconst parts = namespace.split(\".\");\n\tlet current = getSharedResourcesInstance() as Record<string, any>;\n\n\tif (!current) {\n\t\treturn initialValue;\n\t}\n\n\tfor (let i = 0; i < parts.length; i++) {\n\t\tconst part = parts[i];\n\t\tconst lastPart = i === parts.length - 1;\n\t\tif (!Object.prototype.hasOwnProperty.call(current, part)) {\n\t\t\tcurrent[part] = lastPart ? initialValue : {};\n\t\t}\n\t\tcurrent = current[part];\n\t}\n\n\treturn current as T;\n};\n\nexport default getSharedResource;\n"]}
package/dist/global.d.ts CHANGED
@@ -20,11 +20,13 @@ declare global {
20
20
 
21
21
  module "*generated/AssetParameters.js" {
22
22
  const DEFAULT_THEME: string;
23
+ const SUPPORTED_THEMES: Array<string>;
23
24
  const DEFAULT_LANGUAGE: string;
24
25
  const DEFAULT_LOCALE: string;
25
26
  const SUPPORTED_LOCALES: Array<string>;
26
27
  export {
27
28
  DEFAULT_THEME,
29
+ SUPPORTED_THEMES,
28
30
  DEFAULT_LANGUAGE,
29
31
  DEFAULT_LOCALE,
30
32
  SUPPORTED_LOCALES,
@@ -1989,7 +1989,7 @@ if (typeof window !== 'undefined') {
1989
1989
  }
1990
1990
  /*!
1991
1991
  * OpenUI5
1992
- * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
1992
+ * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
1993
1993
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
1994
1994
  */
1995
1995
  // Based on coding from the HTML4 Sanitizer by Google Inc.
@@ -58,10 +58,11 @@ const findFocusableElement = async (container, forward, startFromContainer) => {
58
58
  }
59
59
  child = forward ? originalChild.nextSibling : originalChild.previousSibling;
60
60
  // If the child element is not part of the currently assigned element,
61
- // we have to check the next element assigned to the slot or continue with the next sibling of the slot,
62
- // otherwise, the nextSibling is the next element inside the light DOM
61
+ // we have to check the next/previous element assigned to the slot or continue with the next/previous sibling of the slot,
62
+ // otherwise, the nextSibling/previousSibling is the next element inside the light DOM
63
63
  if (assignedElements && !assignedElements[currentIndex].contains(child)) {
64
- child = assignedElements[++currentIndex];
64
+ currentIndex = forward ? currentIndex + 1 : currentIndex - 1;
65
+ child = assignedElements[currentIndex];
65
66
  }
66
67
  }
67
68
  /* eslint-enable no-await-in-loop */
@@ -1 +1 @@
1
- {"version":3,"file":"FocusableElements.js","sourceRoot":"","sources":["../../src/util/FocusableElements.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM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CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC;aAC7G;SACD;QAED,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,WAA0B,CAAC,CAAC,CAAC,aAAa,CAAC,eAA8B,CAAC;QAE1G,sEAAsE;QACtE,wGAAwG;QACxG,sEAAsE;QACtE,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACxE,KAAK,GAAG,gBAAgB,CAAC,EAAE,YAAY,CAAgB,CAAC;SACxD;KACD;IAED,oCAAoC;IAEpC,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,uBAAuB,GACvB,CAAC","sourcesContent":["import isElementHidden from \"./isElementHidden.js\";\nimport isElementClickable from \"./isElementClickable.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\n\ntype FocusableElementPromise = Promise<HTMLElement | null>;\n\nconst isFocusTrap = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-trap\");\n};\n\nconst getFirstFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, true, startFromContainer);\n};\n\nconst getLastFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, false, startFromContainer);\n};\n\nconst isElemFocusable = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-redirect\") || !isElementHidden(el);\n};\n\nconst findFocusableElement = async (container: HTMLElement, forward: boolean, startFromContainer?: boolean): FocusableElementPromise => {\n\tlet child: HTMLElement | undefined;\n\tlet assignedElements;\n\tlet currentIndex = -1;\n\n\tif (container.shadowRoot) {\n\t\tchild = forward ? container.shadowRoot.firstChild as HTMLElement : container.shadowRoot.lastChild as HTMLElement;\n\t} else if (container instanceof HTMLSlotElement && container.assignedNodes()) {\n\t\tassignedElements = container.assignedNodes();\n\t\tcurrentIndex = forward ? 0 : assignedElements.length - 1;\n\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t} else if (startFromContainer) {\n\t\tchild = container;\n\t} else {\n\t\tchild = forward ? container.firstElementChild as HTMLElement : container.lastElementChild as HTMLElement;\n\t}\n\n\tlet focusableDescendant;\n\n\t/* eslint-disable no-await-in-loop */\n\n\twhile (child) {\n\t\tconst originalChild: HTMLElement | undefined = child;\n\n\t\tif (instanceOfUI5Element(child)) {\n\t\t\tchild = await child.getFocusDomRefAsync();\n\t\t}\n\n\t\tif (!child) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (child.nodeType === 1 && isElemFocusable(child) && !isFocusTrap(child)) {\n\t\t\tif (isElementClickable(child)) {\n\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t}\n\n\t\t\tfocusableDescendant = await findFocusableElement(child, forward);\n\t\t\tif (focusableDescendant) {\n\t\t\t\treturn (focusableDescendant && typeof focusableDescendant.focus === \"function\") ? focusableDescendant : null;\n\t\t\t}\n\t\t}\n\n\t\tchild = forward ? originalChild.nextSibling as HTMLElement : originalChild.previousSibling as HTMLElement;\n\n\t\t// If the child element is not part of the currently assigned element,\n\t\t// we have to check the next element assigned to the slot or continue with the next sibling of the slot,\n\t\t// otherwise, the nextSibling is the next element inside the light DOM\n\t\tif (assignedElements && !assignedElements[currentIndex].contains(child)) {\n\t\t\tchild = assignedElements[++currentIndex] as HTMLElement;\n\t\t}\n\t}\n\n\t/* eslint-enable no-await-in-loop */\n\n\treturn null;\n};\n\nexport {\n\tgetFirstFocusableElement,\n\tgetLastFocusableElement,\n};\n"]}
1
+ {"version":3,"file":"FocusableElements.js","sourceRoot":"","sources":["../../src/util/FocusableElements.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,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AAC,IAAI,CAAC;aAC7G;SACD;QAED,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,WAA0B,CAAC,CAAC,CAAC,aAAa,CAAC,eAA8B,CAAC;QAE1G,sEAAsE;QACtE,0HAA0H;QAC1H,sFAAsF;QACtF,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACxE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC;YAE7D,KAAK,GAAG,gBAAgB,CAAC,YAAY,CAAgB,CAAC;SACtD;KACD;IAED,oCAAoC;IAEpC,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,uBAAuB,GACvB,CAAC","sourcesContent":["import isElementHidden from \"./isElementHidden.js\";\nimport isElementClickable from \"./isElementClickable.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\n\ntype FocusableElementPromise = Promise<HTMLElement | null>;\n\nconst isFocusTrap = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-trap\");\n};\n\nconst getFirstFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, true, startFromContainer);\n};\n\nconst getLastFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, false, startFromContainer);\n};\n\nconst isElemFocusable = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-redirect\") || !isElementHidden(el);\n};\n\nconst findFocusableElement = async (container: HTMLElement, forward: boolean, startFromContainer?: boolean): FocusableElementPromise => {\n\tlet child: HTMLElement | undefined;\n\tlet assignedElements;\n\tlet currentIndex = -1;\n\n\tif (container.shadowRoot) {\n\t\tchild = forward ? container.shadowRoot.firstChild as HTMLElement : container.shadowRoot.lastChild as HTMLElement;\n\t} else if (container instanceof HTMLSlotElement && container.assignedNodes()) {\n\t\tassignedElements = container.assignedNodes();\n\t\tcurrentIndex = forward ? 0 : assignedElements.length - 1;\n\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t} else if (startFromContainer) {\n\t\tchild = container;\n\t} else {\n\t\tchild = forward ? container.firstElementChild as HTMLElement : container.lastElementChild as HTMLElement;\n\t}\n\n\tlet focusableDescendant;\n\n\t/* eslint-disable no-await-in-loop */\n\n\twhile (child) {\n\t\tconst originalChild: HTMLElement | undefined = child;\n\n\t\tif (instanceOfUI5Element(child)) {\n\t\t\tchild = await child.getFocusDomRefAsync();\n\t\t}\n\n\t\tif (!child) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (child.nodeType === 1 && isElemFocusable(child) && !isFocusTrap(child)) {\n\t\t\tif (isElementClickable(child)) {\n\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t}\n\n\t\t\tfocusableDescendant = await findFocusableElement(child, forward);\n\t\t\tif (focusableDescendant) {\n\t\t\t\treturn (focusableDescendant && typeof focusableDescendant.focus === \"function\") ? focusableDescendant : null;\n\t\t\t}\n\t\t}\n\n\t\tchild = forward ? originalChild.nextSibling as HTMLElement : originalChild.previousSibling as HTMLElement;\n\n\t\t// If the child element is not part of the currently assigned element,\n\t\t// we have to check the next/previous element assigned to the slot or continue with the next/previous sibling of the slot,\n\t\t// otherwise, the nextSibling/previousSibling is the next element inside the light DOM\n\t\tif (assignedElements && !assignedElements[currentIndex].contains(child)) {\n\t\t\tcurrentIndex = forward ? currentIndex + 1 : currentIndex - 1;\n\n\t\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t\t}\n\t}\n\n\t/* eslint-enable no-await-in-loop */\n\n\treturn null;\n};\n\nexport {\n\tgetFirstFocusableElement,\n\tgetLastFocusableElement,\n};\n"]}
@@ -13,26 +13,27 @@ const buildCorrectUrl = (oldUrl, newOrigin) => {
13
13
  return new URL(oldUrlPath, newOrigin).toString();
14
14
  };
15
15
  const validateThemeRoot = (themeRoot) => {
16
- let themeRootURL, resultUrl;
16
+ let resultUrl;
17
17
  try {
18
- themeRootURL = new URL(themeRoot);
19
- const origin = themeRootURL.origin;
20
- themeRootURL = themeRootURL.toString();
21
- if (themeRootURL.startsWith(".") || themeRootURL.startsWith("/")) {
18
+ if (themeRoot.startsWith(".") || themeRoot.startsWith("/")) {
22
19
  // Handle relative url
23
20
  // new URL("/newExmPath", "http://example.com/exmPath") => http://example.com/newExmPath
24
21
  // new URL("./newExmPath", "http://example.com/exmPath") => http://example.com/exmPath/newExmPath
25
22
  // new URL("../newExmPath", "http://example.com/exmPath") => http://example.com/newExmPath
26
- resultUrl = new URL(themeRootURL, window.location.href).toString();
27
- }
28
- else if (origin && validateThemeOrigin(origin)) {
29
- // If origin is allowed, use it
30
- resultUrl = themeRootURL.toString();
23
+ resultUrl = new URL(themeRoot, window.location.href).toString();
31
24
  }
32
25
  else {
33
- // If origin is not allow and the URL is not relative, we have to replace the origin
34
- // with current location
35
- resultUrl = buildCorrectUrl(themeRootURL, window.location.href);
26
+ const themeRootURL = new URL(themeRoot);
27
+ const origin = themeRootURL.origin;
28
+ if (origin && validateThemeOrigin(origin)) {
29
+ // If origin is allowed, use it
30
+ resultUrl = themeRootURL.toString();
31
+ }
32
+ else {
33
+ // If origin is not allow and the URL is not relative, we have to replace the origin
34
+ // with current location
35
+ resultUrl = buildCorrectUrl(themeRootURL.toString(), window.location.href);
36
+ }
36
37
  }
37
38
  if (!resultUrl.endsWith("/")) {
38
39
  resultUrl = `${resultUrl}/`;
@@ -1 +1 @@
1
- {"version":3,"file":"validateThemeRoot.js","sourceRoot":"","sources":["../src/validateThemeRoot.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC/C,MAAM,OAAO,GAAG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EAAE,CAAC;SACnE;aAAM,IAAI,MAAM,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE;YACjD,+BAA+B;YAC/B,SAAS,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;SACpC;aAAM;YACN,oFAAoF;YACpF,wBAAwB;YACxB,SAAS,GAAG,eAAe,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SAChE;QAED,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC7B,SAAS,GAAG,GAAG,SAAS,GAAG,CAAC;SAC5B;QAED,OAAO,GAAG,SAAS,MAAM,CAAC;KAC1B;IAAC,OAAO,CAAC,EAAE;QACX,8BAA8B;KAC9B;AACF,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["const getMetaTagValue = (metaTagName: string) => {\n\tconst metaTag = document.querySelector(`META[name=\"${metaTagName}\"]`),\n\t\tmetaTagContent = metaTag && metaTag.getAttribute(\"content\");\n\n\treturn metaTagContent;\n};\n\nconst validateThemeOrigin = (origin: string) => {\n\tconst allowedOrigins = getMetaTagValue(\"sap-allowedThemeOrigins\");\n\n\treturn allowedOrigins && allowedOrigins.split(\",\").some(allowedOrigin => {\n\t\treturn allowedOrigin === \"*\" || origin === allowedOrigin.trim();\n\t});\n};\n\nconst buildCorrectUrl = (oldUrl: string, newOrigin: string) => {\n\tconst oldUrlPath = new URL(oldUrl).pathname;\n\n\treturn new URL(oldUrlPath, newOrigin).toString();\n};\n\nconst validateThemeRoot = (themeRoot: string) => {\n\tlet themeRootURL,\n\t\tresultUrl;\n\n\ttry {\n\t\tthemeRootURL = new URL(themeRoot);\n\n\t\tconst origin = themeRootURL.origin;\n\n\t\tthemeRootURL = themeRootURL.toString();\n\n\t\tif (themeRootURL.startsWith(\".\") || themeRootURL.startsWith(\"/\")) {\n\t\t\t// Handle relative url\n\t\t\t// new URL(\"/newExmPath\", \"http://example.com/exmPath\") => http://example.com/newExmPath\n\t\t\t// new URL(\"./newExmPath\", \"http://example.com/exmPath\") => http://example.com/exmPath/newExmPath\n\t\t\t// new URL(\"../newExmPath\", \"http://example.com/exmPath\") => http://example.com/newExmPath\n\t\t\tresultUrl = new URL(themeRootURL, window.location.href).toString();\n\t\t} else if (origin && validateThemeOrigin(origin)) {\n\t\t\t// If origin is allowed, use it\n\t\t\tresultUrl = themeRootURL.toString();\n\t\t} else {\n\t\t\t// If origin is not allow and the URL is not relative, we have to replace the origin\n\t\t\t// with current location\n\t\t\tresultUrl = buildCorrectUrl(themeRootURL, window.location.href);\n\t\t}\n\n\t\tif (!resultUrl.endsWith(\"/\")) {\n\t\t\tresultUrl = `${resultUrl}/`;\n\t\t}\n\n\t\treturn `${resultUrl}UI5/`;\n\t} catch (e) {\n\t\t// Catch if URL is not correct\n\t}\n};\n\nexport default validateThemeRoot;\n"]}
1
+ {"version":3,"file":"validateThemeRoot.js","sourceRoot":"","sources":["../src/validateThemeRoot.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC/C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,WAAW,IAAI,CAAC,EACpE,cAAc,GAAG,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAE7D,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC9C,MAAM,cAAc,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;IAElE,OAAO,cAAc,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;QACvE,OAAO,aAAa,KAAK,GAAG,IAAI,MAAM,KAAK,aAAa,CAAC,IAAI,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE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n\tconst metaTag = document.querySelector(`META[name=\"${metaTagName}\"]`),\n\t\tmetaTagContent = metaTag && metaTag.getAttribute(\"content\");\n\n\treturn metaTagContent;\n};\n\nconst validateThemeOrigin = (origin: string) => {\n\tconst allowedOrigins = getMetaTagValue(\"sap-allowedThemeOrigins\");\n\n\treturn allowedOrigins && allowedOrigins.split(\",\").some(allowedOrigin => {\n\t\treturn allowedOrigin === \"*\" || origin === allowedOrigin.trim();\n\t});\n};\n\nconst buildCorrectUrl = (oldUrl: string, newOrigin: string) => {\n\tconst oldUrlPath = new URL(oldUrl).pathname;\n\n\treturn new URL(oldUrlPath, newOrigin).toString();\n};\n\nconst validateThemeRoot = (themeRoot: string) => {\n\tlet resultUrl;\n\n\ttry {\n\t\tif (themeRoot.startsWith(\".\") || themeRoot.startsWith(\"/\")) {\n\t\t\t// Handle relative url\n\t\t\t// new URL(\"/newExmPath\", \"http://example.com/exmPath\") => http://example.com/newExmPath\n\t\t\t// new URL(\"./newExmPath\", \"http://example.com/exmPath\") => http://example.com/exmPath/newExmPath\n\t\t\t// new URL(\"../newExmPath\", \"http://example.com/exmPath\") => http://example.com/newExmPath\n\t\t\tresultUrl = new URL(themeRoot, window.location.href).toString();\n\t\t} else {\n\t\t\tconst themeRootURL = new URL(themeRoot);\n\t\t\tconst origin = themeRootURL.origin;\n\n\t\t\tif (origin && validateThemeOrigin(origin)) {\n\t\t\t\t// If origin is allowed, use it\n\t\t\t\tresultUrl = themeRootURL.toString();\n\t\t\t} else {\n\t\t\t\t// If origin is not allow and the URL is not relative, we have to replace the origin\n\t\t\t\t// with current location\n\t\t\t\tresultUrl = buildCorrectUrl(themeRootURL.toString(), window.location.href);\n\t\t\t}\n\t\t}\n\n\t\tif (!resultUrl.endsWith(\"/\")) {\n\t\t\tresultUrl = `${resultUrl}/`;\n\t\t}\n\n\t\treturn `${resultUrl}UI5/`;\n\t} catch (e) {\n\t\t// Catch if URL is not correct\n\t}\n};\n\nexport default validateThemeRoot;\n"]}
package/index.js CHANGED
@@ -1,4 +1,230 @@
1
+ // animations/
2
+ import scroll from "./dist/animations/scroll.js";
3
+ import slideDown from "./dist/animations/slideDown.js";
4
+ import slideUp from "./dist/animations/slideup.js";
5
+
6
+ // config/
7
+ import { getAnimationMode, setAnimationMode } from "./dist/config/AnimationMode.js";
8
+ import { getCalendarType } from "./dist/config/CalendarType.js";
9
+ import { getFirstDayOfWeek, getLegacyDateCalendarCustomizing } from "./dist/config/FormatSettings.js";
10
+ import {
11
+ setDefaultIconCollection,
12
+ getDefaultIconCollection,
13
+ getEffectiveIconCollection,
14
+ RegisteredIconCollection,
15
+ } from "./dist/config/Icons.js";
16
+ import {
17
+ getLanguage,
18
+ setLanguage,
19
+ getDefaultLanguage,
20
+ setFetchDefaultLanguage,
21
+ getFetchDefaultLanguage,
22
+ } from "./dist/config/Language.js";
23
+ import { getNoConflict, setNoConflict } from "./dist/config/NoConflict.js";
24
+ import { getRTL } from "./dist/config/RTL.js";
25
+ import {
26
+ getTheme,
27
+ setTheme,
28
+ getDefaultTheme,
29
+ } from "./dist/config/Theme.js";
30
+
31
+ // decorators/
32
+ import customElement from "./dist/decorators/customElement.js";
33
+ import event from "./dist/decorators/event.js";
34
+ import property from "./dist/decorators/property.js";
35
+ import slot from "./dist/decorators/slot.js";
36
+
37
+ // delegate/
38
+ import ItemNavigation from "./dist/delegate/ItemNavigation.js";
39
+ import ResizeHandler from "./dist/delegate/ResizeHandler.js";
40
+ import ScrollEnablement from "./dist/delegate/ScrollEnablement.js";
41
+
42
+ // locale/
43
+ import applyDirection from "./dist/locale/applyDirection.js";
44
+ import { attachDirectionChange, detachDirectionChange } from "./dist/locale/directionChange.js";
45
+ import getEffectiveDir from "./dist/locale/getEffectiveDir.js";
46
+ import { attachLanguageChange, detachLanguageChange } from "./dist/locale/languageChange.js";
47
+
48
+ // util/
49
+ import { URLListValidator, sanitizeHTML } from "./dist/util/HTMLSanitizer.js";
50
+
51
+ // Assets.ts
52
+ import { registerI18nLoader } from "./dist/asset-registries/i18n.js";
53
+ import { registerLocaleDataLoader } from "./dist/asset-registries/LocaleData.js";
54
+ import { registerThemePropertiesLoader } from "./dist/asset-registries/Themes.js";
55
+ import { registerIconLoader } from "./dist/asset-registries/Icons.js";
56
+
57
+ // Boot.ts
58
+ import { attachBoot } from "./dist/Boot.js";
59
+
60
+ // CSP.ts
61
+ import {
62
+ setPackageCSSRoot,
63
+ setUseLinks,
64
+ setPreloadLinks,
65
+ } from "./dist/CSP.js";
66
+
67
+ // CustomElementsScope.ts
68
+ import {
69
+ setCustomElementsScopingSuffix,
70
+ getCustomElementsScopingSuffix,
71
+ setCustomElementsScopingRules,
72
+ getCustomElementsScopingRules,
73
+ getEffectiveScopingSuffixForTag,
74
+ } from "./dist/CustomElementsScope.js";
75
+
76
+ // Device.ts
77
+ import {
78
+ supportsTouch,
79
+ isIE,
80
+ isSafari,
81
+ isChrome,
82
+ isFirefox,
83
+ isPhone,
84
+ isTablet,
85
+ isDesktop,
86
+ isCombi,
87
+ isIOS,
88
+ isAndroid,
89
+ } from "./dist/Device.js";
90
+
91
+ // EventProvider.ts
92
+ import EventProvider from "./dist/EventProvider.js";
93
+
94
+ // i18nBundle.ts
95
+ import I18nBundle, { getI18nBundle, registerCustomI18nBundleGetter } from "./dist/i18nBundle.js";
96
+
97
+ // MediaRange.ts
98
+ import MediaRange from "./dist/MediaRange.js";
99
+
100
+ // PropertiesFileFormat.ts
101
+ import parseProperties from "./dist/PropertiesFileFormat.js";
102
+
103
+ // Render.ts
104
+ import {
105
+ renderDeferred,
106
+ renderImmediately,
107
+ cancelRender,
108
+ renderFinished,
109
+ } from "./dist/Render.js";
110
+
111
+ // Theming.ts
112
+ import { addCustomCSS, attachThemeLoaded, detachThemeLoaded } from "./dist/Theming.js";
113
+
114
+ // UI5Element.ts
1
115
  import UI5Element from "./dist/UI5Element.js";
2
116
 
3
117
  export default UI5Element;
4
- export { UI5Element };
118
+ export {
119
+ // animations/
120
+ scroll,
121
+ slideDown,
122
+ slideUp,
123
+
124
+ // config/
125
+ getAnimationMode,
126
+ setAnimationMode,
127
+ getCalendarType,
128
+ getFirstDayOfWeek,
129
+ getLegacyDateCalendarCustomizing,
130
+ setDefaultIconCollection,
131
+ getDefaultIconCollection,
132
+ getEffectiveIconCollection,
133
+ RegisteredIconCollection,
134
+ getLanguage,
135
+ setLanguage,
136
+ getDefaultLanguage,
137
+ setFetchDefaultLanguage,
138
+ getFetchDefaultLanguage,
139
+ getNoConflict,
140
+ setNoConflict,
141
+ getRTL,
142
+ getTheme,
143
+ setTheme,
144
+ getDefaultTheme,
145
+
146
+ // decorators/
147
+ customElement,
148
+ event,
149
+ property,
150
+ slot,
151
+
152
+ // delegate/
153
+ ItemNavigation,
154
+ ResizeHandler,
155
+ ScrollEnablement,
156
+
157
+ // locale/
158
+ applyDirection,
159
+ attachDirectionChange,
160
+ detachDirectionChange,
161
+ getEffectiveDir,
162
+ attachLanguageChange,
163
+ detachLanguageChange,
164
+
165
+ // util/
166
+ URLListValidator,
167
+ sanitizeHTML,
168
+
169
+ // Assets.ts
170
+ registerI18nLoader,
171
+ registerLocaleDataLoader,
172
+ registerThemePropertiesLoader,
173
+ registerIconLoader,
174
+
175
+ // Boot.ts
176
+ attachBoot,
177
+
178
+ // CSP.ts
179
+ setPackageCSSRoot,
180
+ setUseLinks,
181
+ setPreloadLinks,
182
+
183
+ // CustomElementsScope.ts
184
+ setCustomElementsScopingSuffix,
185
+ getCustomElementsScopingSuffix,
186
+ setCustomElementsScopingRules,
187
+ getCustomElementsScopingRules,
188
+ getEffectiveScopingSuffixForTag,
189
+
190
+ // Device.ts
191
+ supportsTouch,
192
+ isIE,
193
+ isSafari,
194
+ isChrome,
195
+ isFirefox,
196
+ isPhone,
197
+ isTablet,
198
+ isDesktop,
199
+ isCombi,
200
+ isIOS,
201
+ isAndroid,
202
+
203
+ // EventProvider.ts
204
+ EventProvider,
205
+
206
+ // i18nBundle.ts
207
+ I18nBundle,
208
+ getI18nBundle,
209
+ registerCustomI18nBundleGetter,
210
+
211
+ // MediaRange.ts
212
+ MediaRange,
213
+
214
+ // PropertiesFileFormat.ts
215
+ parseProperties,
216
+
217
+ // Render.ts
218
+ renderDeferred,
219
+ renderImmediately,
220
+ cancelRender,
221
+ renderFinished,
222
+
223
+ // Theming.ts
224
+ addCustomCSS,
225
+ attachThemeLoaded,
226
+ detachThemeLoaded,
227
+
228
+ // UI5Element.ts
229
+ UI5Element,
230
+ };
@@ -1,15 +1,17 @@
1
- const fs = require('fs').promises;
2
- const assets = require('@ui5/webcomponents-tools/assets-meta.js');
1
+ import fs from "fs/promises";
2
+ import assets from "@ui5/webcomponents-tools/assets-meta.js";
3
3
 
4
4
  const fileContent = `const assetParameters = ${JSON.stringify(assets)};
5
5
 
6
6
  const DEFAULT_THEME = assetParameters.themes.default;
7
+ const SUPPORTED_THEMES = assetParameters.themes.all;
7
8
  const DEFAULT_LANGUAGE = assetParameters.languages.default;
8
9
  const DEFAULT_LOCALE = assetParameters.locales.default;
9
10
  const SUPPORTED_LOCALES = assetParameters.locales.all;
10
11
 
11
12
  export {
12
13
  DEFAULT_THEME,
14
+ SUPPORTED_THEMES,
13
15
  DEFAULT_LANGUAGE,
14
16
  DEFAULT_LOCALE,
15
17
  SUPPORTED_LOCALES,
@@ -1,6 +1,6 @@
1
- const fs = require('fs').promises;
2
- const path = require('path');
3
- const CleanCSS = require('clean-css');
1
+ import fs from 'fs/promises';
2
+ import path from "path";
3
+ import CleanCSS from "clean-css";
4
4
 
5
5
  const generate = async () => {
6
6
  await fs.mkdir("src/generated/css/", {recursive: true});
@@ -1,4 +1,4 @@
1
- const fs = require('fs').promises;
1
+ import fs from "fs/promises";
2
2
 
3
3
  const generate = async () => {
4
4
  const version = JSON.parse(await fs.readFile("package.json")).version;
@@ -58,8 +58,9 @@ const scripts = {
58
58
  },
59
59
  start: "nps prepare watch.withBundle",
60
60
  test: {
61
- default: 'concurrently "nps test.wdio"',
61
+ default: 'concurrently "nps test.wdio" "nps test.ssr" "nps test.ssr2"',
62
62
  ssr: `mocha test/ssr`,
63
+ ssr2: "node -e \"import('./dist/Device.js')\"",
63
64
  wdio: `node "${LIB}/test-runner/test-runner.js"`
64
65
  },
65
66
  };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "0.0.0-99b763015",
3
+ "version": "0.0.0-99b9fe544",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
7
+ "type": "module",
7
8
  "module": "index.js",
8
9
  "keywords": [
9
10
  "openui5",
@@ -35,8 +36,8 @@
35
36
  },
36
37
  "devDependencies": {
37
38
  "@buxlabs/amd-to-es6": "0.16.1",
38
- "@openui5/sap.ui.core": "1.109.0",
39
- "@ui5/webcomponents-tools": "0.0.0-99b763015",
39
+ "@openui5/sap.ui.core": "1.112.0",
40
+ "@ui5/webcomponents-tools": "0.0.0-99b9fe544",
40
41
  "chromedriver": "110.0.0",
41
42
  "clean-css": "^5.2.2",
42
43
  "copy-and-watch": "^0.1.5",
@@ -1 +0,0 @@
1
- module.exports = require("@ui5/webcomponents-tools/components-package/wdio.js");
@@ -1,9 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerpolicy&&(o.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?o.credentials="include":r.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();const k={themes:{default:"sap_fiori_3",all:["sap_fiori_3","sap_fiori_3_dark","sap_belize","sap_belize_hcb","sap_belize_hcw","sap_fiori_3_hcb","sap_fiori_3_hcw","sap_horizon","sap_horizon_dark","sap_horizon_hcb","sap_horizon_hcw","sap_horizon_exp"]},languages:{default:"en",all:["ar","bg","ca","cs","cy","da","de","el","en","en_GB","en_US_sappsd","en_US_saprigi","en_US_saptrc","es","es_MX","et","fi","fr","fr_CA","hi","hr","hu","in","it","iw","ja","kk","ko","lt","lv","ms","nl","no","pl","pt_PT","pt","ro","ru","sh","sk","sl","sv","th","tr","uk","vi","zh_CN","zh_TW"]},locales:{default:"en",all:["ar","ar_EG","ar_SA","bg","ca","cs","da","de","de_AT","de_CH","el","el_CY","en","en_AU","en_GB","en_HK","en_IE","en_IN","en_NZ","en_PG","en_SG","en_ZA","es","es_AR","es_BO","es_CL","es_CO","es_MX","es_PE","es_UY","es_VE","et","fa","fi","fr","fr_BE","fr_CA","fr_CH","fr_LU","he","hi","hr","hu","id","it","it_CH","ja","kk","ko","lt","lv","ms","nb","nl","nl_BE","pl","pt","pt_PT","ro","ru","ru_UA","sk","sl","sr","sr_Latn","sv","th","tr","uk","vi","zh_CN","zh_HK","zh_SG","zh_TW"]}},C=k.themes.default,B=k.languages.default,u=k.locales.default,ce=k.locales.all,st=()=>{const e=navigator.languages,t=()=>navigator.language;return e&&e[0]||t()||B};var Pe={},$e=Pe.hasOwnProperty,rt=Pe.toString,Ce=$e.toString,ot=Ce.call(Object),ue=function(e){var t,n;return!e||rt.call(e)!=="[object Object]"?!1:(t=Object.getPrototypeOf(e),t?(n=$e.call(t,"constructor")&&t.constructor,typeof n=="function"&&Ce.call(n)===ot):!0)},at=Object.create(null),Re=function(e,t,n,s){var r,o,a,c,v,p,f=arguments[2]||{},V=3,tt=arguments.length,ie=arguments[0]||!1,nt=arguments[1]?void 0:at;for(typeof f!="object"&&typeof f!="function"&&(f={});V<tt;V++)if((v=arguments[V])!=null)for(c in v)r=f[c],a=v[c],!(c==="__proto__"||f===a)&&(ie&&a&&(ue(a)||(o=Array.isArray(a)))?(o?(o=!1,p=r&&Array.isArray(r)?r:[]):p=r&&ue(r)?r:{},f[c]=Re(ie,arguments[1],p,a)):a!==nt&&(f[c]=a));return f};const Oe=function(e,t){return Re(!0,!1,...arguments)},Ue=new Map,Vn=(e,t)=>{Ue.set(e,t)},w=e=>Ue.get(e),it=e=>{const t=document.querySelector(`META[name="${e}"]`);return t&&t.getAttribute("content")},ct=e=>{const t=it("sap-allowedThemeOrigins");return t&&t.split(",").some(n=>n==="*"||e===n.trim())},ut=(e,t)=>{const n=new URL(e).pathname;return new URL(n,t).toString()},lt=e=>{let t,n;try{t=new URL(e);const s=t.origin;return t=t.toString(),t.startsWith(".")||t.startsWith("/")?n=new URL(t,window.location.href).toString():s&&ct(s)?n=t.toString():n=ut(t,window.location.href),n.endsWith("/")||(n=`${n}/`),`${n}UI5/`}catch{}};var Y;(function(e){e.Full="full",e.Basic="basic",e.Minimal="minimal",e.None="none"})(Y||(Y={}));const ft=Y;let le=!1,i={animationMode:ft.Full,theme:C,themeRoot:void 0,rtl:void 0,language:void 0,calendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1};const Nn=()=>(l(),i.animationMode),dt=()=>(l(),i.theme),ht=()=>(l(),i.themeRoot),Zn=()=>(l(),i.rtl),pt=()=>(l(),i.language),gt=()=>(l(),i.fetchDefaultLanguage),Wn=()=>(l(),i.noConflict),Hn=()=>(l(),i.calendarType),qn=()=>(l(),i.formatSettings),R=new Map;R.set("true",!0);R.set("false",!1);const mt=()=>{const e=document.querySelector("[data-ui5-config]")||document.querySelector("[data-id='sap-ui-config']");let t;if(e){try{t=JSON.parse(e.innerHTML)}catch{console.warn("Incorrect data-sap-ui-config format. Please use JSON")}t&&(i=Oe(i,t))}},yt=()=>{const e=new URLSearchParams(window.location.search);e.forEach((t,n)=>{const s=n.split("sap-").length;s===0||s===n.split("sap-ui-").length||fe(n,t,"sap")}),e.forEach((t,n)=>{!n.startsWith("sap-ui")||fe(n,t,"sap-ui")})},wt=e=>{const t=e.split("@")[1];return lt(t)},St=(e,t)=>e==="theme"&&t.includes("@")?t.split("@")[0]:t,fe=(e,t,n)=>{const s=t.toLowerCase(),r=e.split(`${n}-`)[1];R.has(t)&&(t=R.get(s)),r==="theme"?(i.theme=St(r,t),t&&t.includes("@")&&(i.themeRoot=wt(t))):i[r]=t},_t=()=>{const e=w("OpenUI5Support");if(!e||!e.isLoaded())return;const t=e.getConfigurationSettingsObject();i=Oe(i,t)},l=()=>{typeof document>"u"||le||(mt(),yt(),_t(),le=!0)};class A{constructor(){this._eventRegistry=new Map}attachEvent(t,n){const s=this._eventRegistry,r=s.get(t);if(!Array.isArray(r)){s.set(t,[n]);return}r.includes(n)||r.push(n)}detachEvent(t,n){const s=this._eventRegistry,r=s.get(t);if(!r)return;const o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&s.delete(t)}fireEvent(t,n){const r=this._eventRegistry.get(t);return r?r.map(o=>o.call(this,n)):[]}fireEventAsync(t,n){return Promise.all(this.fireEvent(t,n))}isHandlerAttached(t,n){const r=this._eventRegistry.get(t);return r?r.includes(n):!1}hasListeners(t){return!!this._eventRegistry.get(t)}}const Ie=new A,Me="languageChange",ke=e=>{Ie.attachEvent(Me,e)},bt=e=>Ie.fireEventAsync(Me,e),de=10;class Tt{constructor(){this.list=[],this.lookup=new Set}add(t){this.lookup.has(t)||(this.list.push(t),this.lookup.add(t))}remove(t){!this.lookup.has(t)||(this.list=this.list.filter(n=>n!==t),this.lookup.delete(t))}shift(){const t=this.list.shift();if(t)return this.lookup.delete(t),t}isEmpty(){return this.list.length===0}isAdded(t){return this.lookup.has(t)}process(t){let n;const s=new Map;for(n=this.shift();n;){const r=s.get(n)||0;if(r>de)throw new Error(`Web component processed too many times this task, max allowed is: ${de}`);t(n),s.set(n,r+1),n=this.shift()}}}const At=(e,t=document.body)=>{let n=document.querySelector(e);return n||(n=document.createElement(e),t.insertBefore(n,t.firstChild))},vt=()=>typeof document>"u"?null:At("ui5-shared-resources",document.head),D=(e,t)=>{const n=e.split(".");let s=vt();if(!s)return t;for(let r=0;r<n.length;r++){const o=n[r],a=r===n.length-1;Object.prototype.hasOwnProperty.call(s,o)||(s[o]=a?t:{}),s=s[o]}return s},Lt={version:"0.0.0-99b763015",major:0,minor:0,patch:0,suffix:"-99b763015",isNext:!0,buildTime:1679580986};let P,Et="";const N=new Map,b=D("Runtimes",[]),Pt=()=>{if(P===void 0){P=b.length;const e=Lt;b.push({...e,alias:Et,description:`Runtime ${P} - ver ${e.version}`})}},Be=()=>P,$t=(e,t)=>{const n=`${e},${t}`;if(N.has(n))return N.get(n);const s=b[e],r=b[t];if(!s||!r)throw new Error("Invalid runtime index supplied");if(s.isNext||r.isNext)return s.buildTime-r.buildTime;const o=s.major-r.major;if(o)return o;const a=s.minor-r.minor;if(a)return a;const c=s.patch-r.patch;if(c)return c;const p=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}).compare(s.suffix,r.suffix);return N.set(n,p),p},Ct=()=>b,De=D("Tags",new Map),te=new Set;let h=new Map,Z;const xe=-1,Gn=e=>{te.add(e),De.set(e,Be())},Kn=e=>te.has(e),Rt=()=>[...te.values()],Jn=e=>{let t=De.get(e);t===void 0&&(t=xe),h.has(t)||h.set(t,new Set),h.get(t).add(e),Z||(Z=setTimeout(()=>{Ot(),h=new Map,Z=void 0},1e3))},Ot=()=>{const e=Ct(),t=Be(),n=e[t];let s="Multiple UI5 Web Components instances detected.";e.length>1&&(s=`${s}
2
- Loading order (versions before 1.1.0 not listed): ${e.map(r=>`
3
- ${r.description}`).join("")}`),[...h.keys()].forEach(r=>{let o,a;r===xe?(o=1,a={description:"Older unknown runtime"}):(o=$t(t,r),a=e[r]);let c;o>0?c="an older":o<0?c="a newer":c="the same",s=`${s}
4
-
5
- "${n.description}" failed to define ${h.get(r).size} tag(s) as they were defined by a runtime of ${c} version "${a.description}": ${[...h.get(r)].sort().join(", ")}.`,o>0?s=`${s}
6
- WARNING! If your code uses features of the above web components, unavailable in ${a.description}, it might not work as expected!`:s=`${s}
7
- Since the above web components were defined by the same or newer version runtime, they should be compatible with your code.`}),s=`${s}
8
-
9
- To prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/03-scoping.md.`,console.warn(s)},Fe=new Set,Xn=e=>{Fe.add(e)},Ut=e=>Fe.has(e),ne=new Set,It=new A,S=new Tt;let g,$,W,L;const Mt=async e=>{S.add(e),await Bt()},kt=e=>{It.fireEvent("beforeComponentRender",e),ne.add(e),e._render()},Yn=e=>{S.remove(e),ne.delete(e)},Bt=async()=>{L||(L=new Promise(e=>{window.requestAnimationFrame(()=>{S.process(kt),L=null,e(),W||(W=setTimeout(()=>{W=void 0,S.isEmpty()&&jt()},200))})})),await L},Dt=()=>g||(g=new Promise(e=>{$=e,window.requestAnimationFrame(()=>{S.isEmpty()&&(g=void 0,e())})}),g),xt=()=>{const e=Rt().map(t=>customElements.whenDefined(t));return Promise.all(e)},Ft=async()=>{await xt(),await Dt()},jt=()=>{!S.isEmpty()||$&&($(),$=void 0,g=void 0)},je=async e=>{ne.forEach(t=>{const n=t.constructor,s=n.getMetadata().getTag(),r=Ut(n),o=n.getMetadata().isLanguageAware(),a=n.getMetadata().isThemeAware();(!e||e.tag===s||e.rtlAware&&r||e.languageAware&&o||e.themeAware&&a)&&Mt(t)}),await Ft()};let _,Q;const zt=()=>(_===void 0&&(_=pt()),_),Qn=async e=>{_!==e&&(_=e,await bt(e),await je({languageAware:!0}))},Vt=e=>{Q=e},Nt=()=>(Q===void 0&&Vt(gt()),Q),Zt=/^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i;class ze{constructor(t){const n=Zt.exec(t.replace(/_/g,"-"));if(n===null)throw new Error(`The given language ${t} does not adhere to BCP-47.`);this.sLocaleId=t,this.sLanguage=n[1]||B,this.sScript=n[2]||"",this.sRegion=n[3]||"",this.sVariant=n[4]&&n[4].slice(1)||null,this.sExtension=n[5]&&n[5].slice(1)||null,this.sPrivateUse=n[6]||null,this.sLanguage&&(this.sLanguage=this.sLanguage.toLowerCase()),this.sScript&&(this.sScript=this.sScript.toLowerCase().replace(/^[a-z]/,s=>s.toUpperCase())),this.sRegion&&(this.sRegion=this.sRegion.toUpperCase())}getLanguage(){return this.sLanguage}getScript(){return this.sScript}getRegion(){return this.sRegion}getVariant(){return this.sVariant}getVariantSubtags(){return this.sVariant?this.sVariant.split("-"):[]}getExtension(){return this.sExtension}getExtensionSubtags(){return this.sExtension?this.sExtension.slice(2).split("-"):[]}getPrivateUse(){return this.sPrivateUse}getPrivateUseSubtags(){return this.sPrivateUse?this.sPrivateUse.slice(2).split("-"):[]}hasPrivateUseSubtag(t){return this.getPrivateUseSubtags().indexOf(t)>=0}toString(){const t=[this.sLanguage];return this.sScript&&t.push(this.sScript),this.sRegion&&t.push(this.sRegion),this.sVariant&&t.push(this.sVariant),this.sExtension&&t.push(this.sExtension),this.sPrivateUse&&t.push(this.sPrivateUse),t.join("-")}}const H=new Map,Ve=e=>(H.has(e)||H.set(e,new ze(e)),H.get(e)),he=e=>{try{if(e&&typeof e=="string")return Ve(e)}catch{}return new ze(u)},ee=e=>{if(e)return he(e);const t=zt();return t?Ve(t):he(st())},Wt=/^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i,pe=/(?:^|-)(saptrc|sappsd)(?:-|$)/i,Ht={he:"iw",yi:"ji",nb:"no",sr:"sh"},qt=e=>{let t;if(!e)return u;if(typeof e=="string"&&(t=Wt.exec(e.replace(/_/g,"-")))){let n=t[1].toLowerCase(),s=t[3]?t[3].toUpperCase():void 0;const r=t[2]?t[2].toLowerCase():void 0,o=t[4]?t[4].slice(1):void 0,a=t[6];return n=Ht[n]||n,a&&(t=pe.exec(a))||o&&(t=pe.exec(o))?`en_US_${t[1].toLowerCase()}`:(n==="zh"&&!s&&(r==="hans"?s="CN":r==="hant"&&(s="TW")),n+(s?"_"+s+(o?"_"+o.replace("-","_"):""):""))}return u},Gt=e=>{if(!e)return u;if(e==="zh_HK")return"zh_TW";const t=e.lastIndexOf("_");return t>=0?e.slice(0,t):e!==u?u:""},ge=new Set,me=new Set,se=new Map,q=new Map,re=new Map,es=(e,t,n)=>{const s=`${e}/${t}`;re.set(s,n)},ye=(e,t)=>{se.set(e,t)},ts=e=>se.get(e),Ne=(e,t)=>{const n=`${e}/${t}`;return re.has(n)},Kt=(e,t)=>{const n=`${e}/${t}`,s=re.get(n);return s&&!q.get(n)&&q.set(n,s(t)),q.get(n)},Jt=e=>{ge.has(e)||(console.warn(`[${e}]: Message bundle assets are not configured. Falling back to English texts.`,` Add \`import "${e}/dist/Assets.js"\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section "Assets" in the documentation for more information.`),ge.add(e))},we=(e,t)=>t!==B&&!Ne(e,t),Xt=async e=>{const t=ee().getLanguage(),n=ee().getRegion();let s=t+(n?`-${n}`:"");if(we(e,s))for(s=qt(s);we(e,s);)s=Gt(s);const r=Nt();if(s===B&&!r){ye(e,null);return}if(!Ne(e,s)){Jt(e);return}try{const o=await Kt(e,s);ye(e,o)}catch(o){const a=o;me.has(a.message)||(me.add(a.message),console.error(a.message))}};ke(e=>{const t=[...se.keys()];return Promise.all(t.map(Xt))});const Yt=new Map,O=new Map,G=new Map,Se=new Set;let _e=!1;const Qt={iw:"he",ji:"yi",in:"id"},be=e=>{_e||(console.warn(`[LocaleData] Supported locale "${e}" not configured, import the "Assets.js" module from the webcomponents package you are using.`),_e=!0)},en=(e,t,n)=>{e=e&&Qt[e]||e,e==="no"&&(e="nb"),e==="zh"&&!t&&(n==="Hans"?t="CN":n==="Hant"&&(t="TW")),(e==="sh"||e==="sr"&&n==="Latn")&&(e="sr",t="Latn");let s=`${e}_${t}`;return ce.includes(s)||(s=e,ce.includes(s))?O.has(s)?s:(be(s),u):u},Te=(e,t)=>{Yt.set(e,t)},tn=e=>{if(!G.get(e)){const t=O.get(e);if(!t)throw new Error(`CLDR data for locale ${e} is not loaded!`);G.set(e,t(e))}return G.get(e)},nn=async(e,t,n)=>{const s=en(e,t,n),r=w("OpenUI5Support");if(r){const o=r.getLocaleDataObject();if(o){Te(s,o);return}}try{const o=await tn(s);Te(s,o)}catch(o){const a=o;Se.has(a.message)||(Se.add(a.message),console.error(a.message))}},sn=(e,t)=>{O.set(e,t)};sn("en",async()=>(await fetch("https://sdk.openui5.org/1.103.0/resources/sap/ui/core/cldr/en.json")).json());ke(()=>{const e=ee();return nn(e.getLanguage(),e.getRegion(),e.getScript())});const Ze=new A,We="themeRegistered",rn=e=>{Ze.attachEvent(We,e)},on=e=>Ze.fireEvent(We,e),He=new Map,qe=new Map,Ge=new Set,U=new Set,ns=(e,t,n)=>{qe.set(`${e}/${t}`,n),Ge.add(e),U.add(t),on(t)},Ke=async(e,t)=>{const n=He.get(`${e}_${t}`);if(n!==void 0)return n;if(!U.has(t)){const s=[...U.values()].join(", ");return console.warn(`You have requested a non-registered theme ${t} - falling back to ${C}. Registered themes are: ${s}`),Ae(e,C)}return Ae(e,t)},Ae=async(e,t)=>{const n=qe.get(`${e}/${t}`);if(!n){console.error(`Theme [${t}] not registered for package [${e}]`);return}let s;try{s=await n(t)}catch(o){console.error(e,o.message);return}const r=s._||s;return He.set(`${e}_${t}`,r),r},Je=()=>Ge,an=e=>U.has(e);var I;(function(e){e["SAP-icons"]="SAP-icons-v4",e.horizon="SAP-icons-v5",e["SAP-icons-TNT"]="tnt",e.BusinessSuiteInAppSymbols="business-suite"})(I||(I={}));const Xe=e=>I[e]?I[e]:e,cn=(e,t)=>{const n=document.createElement("style");return n.type="text/css",t&&Object.entries(t).forEach(s=>n.setAttribute(...s)),n.textContent=e,document.head.appendChild(n),n},un=(e,t)=>{const n=document.createElement("link");return n.type="text/css",n.rel="stylesheet",t&&Object.entries(t).forEach(s=>n.setAttribute(...s)),n.href=e,document.head.appendChild(n),new Promise(s=>{n.addEventListener("load",s),n.addEventListener("error",s)})},x=(e,t)=>t?`${e}|${t}`:e,F=(e,t,n="")=>{const s=typeof e=="string"?e:e.content;if(document.adoptedStyleSheets){const r=new CSSStyleSheet;r.replaceSync(s),r._ui5StyleId=x(t,n),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]}else{const r={};r[t]=n,cn(s,r)}},ln=(e,t,n="")=>{const s=typeof e=="string"?e:e.content;if(document.adoptedStyleSheets){const r=document.adoptedStyleSheets.find(o=>o._ui5StyleId===x(t,n));r&&r.replaceSync(s||"")}else{const r=document.querySelector(`head>style[${t}="${n}"]`);r&&(r.textContent=s||"")}},j=(e,t="")=>document.adoptedStyleSheets?!!document.adoptedStyleSheets.find(n=>n._ui5StyleId===x(e,t)):!!document.querySelector(`head>style[${e}="${t}"]`),fn=(e,t="")=>{var n;if(document.adoptedStyleSheets)document.adoptedStyleSheets=document.adoptedStyleSheets.filter(s=>s._ui5StyleId!==x(e,t));else{const s=document.querySelector(`head > style[${e}="${t}"]`);(n=s==null?void 0:s.parentElement)==null||n.removeChild(s)}},Ye=(e,t,n="")=>{j(t,n)?ln(e,t,n):F(e,t,n)},m=new Set,dn=()=>{let e=document.querySelector(".sapThemeMetaData-Base-baseLib")||document.querySelector(".sapThemeMetaData-UI5-sap-ui-core");if(e)return getComputedStyle(e).backgroundImage;e=document.createElement("span"),e.style.display="none",e.classList.add("sapThemeMetaData-Base-baseLib"),document.body.appendChild(e);let t=getComputedStyle(e).backgroundImage;return t==="none"&&(e.classList.add("sapThemeMetaData-UI5-sap-ui-core"),t=getComputedStyle(e).backgroundImage),document.body.removeChild(e),t},hn=e=>{const t=/\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(e);if(t&&t.length>=2){let n=t[1];if(n=n.replace(/\\"/g,'"'),n.charAt(0)!=="{"&&n.charAt(n.length-1)!=="}")try{n=decodeURIComponent(n)}catch{m.has("decode")||(console.warn("Malformed theme metadata string, unable to decodeURIComponent"),m.add("decode"));return}try{return JSON.parse(n)}catch{m.has("parse")||(console.warn("Malformed theme metadata string, unable to parse JSON"),m.add("parse"))}}},pn=e=>{let t,n;try{t=e.Path.match(/\.([^.]+)\.css_variables$/)[1],n=e.Extends[0]}catch{m.has("object")||(console.warn("Malformed theme metadata Object",e),m.add("object"));return}return{themeName:t,baseThemeName:n}},ve=()=>{const e=dn();if(!e||e==="none")return;const t=hn(e);if(t)return pn(t)},gn=new A,mn="themeLoaded",yn=e=>gn.fireEvent(mn,e);let K;const Qe=()=>(K===void 0&&(K=ht()),K),wn=e=>`${Qe()}Base/baseLib/${e}/css_variables.css`,Sn=async e=>{const t=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);t&&document.head.removeChild(t),await un(wn(e),{"sap-ui-webcomponents-theme":e})},T="@ui5/webcomponents-theming",_n=()=>Je().has(T),bn=async e=>{if(!_n())return;const t=await Ke(T,e);t&&Ye(t,"data-ui5-theme-properties",T)},Tn=()=>{fn("data-ui5-theme-properties",T)},An=async e=>{const n=[...Je()].map(async s=>{if(s===T)return;const r=await Ke(s,e);r&&Ye(r,"data-ui5-theme-properties",s)});return Promise.all(n)},vn=async e=>{var s;const t=ve();if(t)return t;const n=w("OpenUI5Support");if(n){if(n.cssVariablesLoaded())return{themeName:(s=n.getConfigurationSettingsObject())==null?void 0:s.theme,baseThemeName:""}}else if(Qe())return await Sn(e),ve()},oe=async e=>{const t=await vn(e);!t||e!==t.themeName?await bn(e):Tn();const n=an(e)?e:t&&t.baseThemeName;await An(n||C),yn(e)};let y;const z=()=>(y===void 0&&(y=dt()),y),ss=async e=>{y!==e&&(y=e,await oe(y),await je({themeAware:!0}))},Ln=e=>z().startsWith(e),En=new Map;var d;(function(e){e.SAPIconsV4="SAP-icons-v4",e.SAPIconsV5="SAP-icons-v5",e.SAPIconsTNTV2="tnt-v2",e.SAPIconsTNTV3="tnt-v3",e.SAPBSIconsV1="business-suite-v1",e.SAPBSIconsV2="business-suite-v2"})(d||(d={}));const Pn=e=>{const t=z(),n=En.get(t);return!e&&n?Xe(n):$n(e)},$n=e=>{const t=Ln("sap_horizon");return e?e==="tnt"?t?d.SAPIconsTNTV3:d.SAPIconsTNTV2:e==="business-suite"?t?d.SAPBSIconsV2:d.SAPBSIconsV1:e:t?d.SAPIconsV5:d.SAPIconsV4},Le=new Map,M=D("SVGIcons.registry",new Map),J=D("SVGIcons.promises",new Map),Ee="ICON_NOT_FOUND",Cn=async e=>{if(!J.has(e)){if(!Le.has(e))throw new Error(`No loader registered for the ${e} icons collection. Probably you forgot to import the "AllIcons.js" module for the respective package.`);const t=Le.get(e);J.set(e,t(e))}return J.get(e)},Rn=e=>{Object.keys(e.data).forEach(t=>{const n=e.data[t];On(t,{pathData:n.path||n.paths,ltr:n.ltr,accData:n.acc,collection:e.collection,packageName:e.packageName})})},On=(e,t)=>{const n=`${t.collection}/${e}`;M.set(n,{pathData:t.pathData,ltr:t.ltr,accData:t.accData,packageName:t.packageName,customTemplate:t.customTemplate,viewBox:t.viewBox,collection:t.collection})},Un=e=>{e.startsWith("sap-icon://")&&(e=e.replace("sap-icon://",""));let t;[e,t]=e.split("/").reverse(),e=e.replace("icon-",""),t&&(t=Xe(t)),t=Pn(t);const n=`${t}/${e}`;return{name:e,collection:t,registryKey:n}},X=async e=>{const{collection:t,registryKey:n}=Un(e);let s=Ee;try{s=await Cn(t)}catch(r){console.error(r.message)}return s===Ee?s:(M.has(n)||Rn(s),M.get(n))},rs=async()=>(await X("edit"),await X("tnt/arrow"),await X("business-suite/3d"),Array.from(M.keys())),In=()=>new Promise(e=>{document.body?e():document.addEventListener("DOMContentLoaded",()=>{e()})}),Mn={packageName:"@ui5/webcomponents-base",fileName:"FontFace.css",content:`@font-face{font-family:"72";font-style:normal;font-weight:400;src:local("72"),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72full";font-style:normal;font-weight:400;src:local('72-full'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Regular-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72";font-style:normal;font-weight:700;src:local('72-Bold'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72full";font-style:normal;font-weight:700;src:local('72-Bold-full'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Bold';font-style:normal;src:local('72-Bold'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Boldfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Bold-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Light';font-style:normal;src:local('72-Light'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:'72-Lightfull';font-style:normal;src:url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_fiori_3/fonts/72-Light-full.woff2?ui5-webcomponents) format("woff2")}@font-face{font-family:"72Black";font-style:bold;font-weight:900;src:local('72Black'),url(https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/fonts/72-Black.woff2?ui5-webcomponents) format("woff2")}`},kn={packageName:"@ui5/webcomponents-base",fileName:"OverrideFontFace.css",content:"@font-face{font-family:'72override';unicode-range:U+0102-0103,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EB7,U+1EB8-1EC7,U+1EC8-1ECB,U+1ECC-1EE3,U+1EE4-1EF1,U+1EF4-1EF7;src:local('Arial'),local('Helvetica'),local('sans-serif')}"},Bn=()=>{const e=w("OpenUI5Support");(!e||!e.isLoaded())&&Dn(),xn()},Dn=()=>{j("data-ui5-font-face")||F(Mn,"data-ui5-font-face")},xn=()=>{j("data-ui5-font-face-override")||F(kn,"data-ui5-font-face-override")},Fn={packageName:"@ui5/webcomponents-base",fileName:"SystemCSSVars.css",content:":root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}[dir=rtl]{--_ui5_dir:rtl}[dir=ltr]{--_ui5_dir:ltr}"},jn=()=>{j("data-ui5-system-css-vars")||F(Fn,"data-ui5-system-css-vars")};let ae=!1,E;const et=new A,os=e=>{if(!ae){et.attachEvent("boot",e);return}e()},as=async()=>{if(E!==void 0)return E;const e=async t=>{if(typeof document>"u"){t();return}rn(zn),Pt();const n=w("OpenUI5Support"),s=n?n.isLoaded():!1,r=w("F6Navigation");n&&await n.init(),r&&!s&&r.init(),await In(),await oe(z()),n&&n.attachListeners(),Bn(),jn(),t(),ae=!0,await et.fireEventAsync("boot")};return E=new Promise(e),E},zn=e=>{const t=z();ae&&e===t&&oe(t)};export{Qn as A,z as B,es as C,os as D,A as E,rs as _,D as a,je as b,w as c,Zn as d,zt as e,Xt as f,ts as g,st as h,Ft as i,Wn as j,kt as k,Yn as l,Xn as m,At as n,as as o,Kn as p,Jn as q,Vn as r,ss as s,Gn as t,Oe as u,Mt as v,ns as w,Nn as x,Hn as y,qn as z};