@ui5/webcomponents-base 1.12.0-rc.3 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.eslintignore +4 -4
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +35 -0
  4. package/bundle.esm.js +2 -0
  5. package/config/wdio.conf.cjs +400 -0
  6. package/dist/asset-registries/Icons.js +3 -0
  7. package/dist/asset-registries/Icons.js.map +1 -1
  8. package/dist/assets/Boot.0baffc5a.js +9 -0
  9. package/dist/assets/bundle.esm.40f06613.js +52 -0
  10. package/dist/assets/test/pages/{Boot.html.6c88e6c0.js → Boot.html.348aea59.js} +1 -1
  11. package/dist/assets/test/pages/{i18n.html.8ebad660.js → i18n.html.91288b11.js} +1 -1
  12. package/dist/assets/test/pages/{i18n_texts.html.474d5e34.js → i18n_texts.html.d01e2614.js} +1 -1
  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/decorators/slot.js +2 -2
  21. package/dist/decorators/slot.js.map +1 -1
  22. package/dist/generated/AssetParameters.js +2 -0
  23. package/dist/generated/VersionInfo.js +4 -4
  24. package/dist/global.d.ts +2 -0
  25. package/dist/test/pages/AllTestElements.html +2 -2
  26. package/dist/test/pages/Boot.html +2 -2
  27. package/dist/test/pages/Configuration.html +3 -2
  28. package/dist/test/pages/ConfigurationScript.html +2 -2
  29. package/dist/test/pages/WithComplexTemplate.html +2 -2
  30. package/dist/test/pages/i18n.html +3 -3
  31. package/dist/test/pages/i18n_texts.html +3 -3
  32. package/dist/validateThemeRoot.js +14 -13
  33. package/dist/validateThemeRoot.js.map +1 -1
  34. package/index.js +227 -1
  35. package/lib/generate-asset-parameters/index.js +4 -2
  36. package/lib/generate-styles/index.js +3 -3
  37. package/lib/generate-version-info/index.js +1 -1
  38. package/{package-scripts.js → package-scripts.cjs} +2 -1
  39. package/package.json +4 -3
  40. package/config/wdio.conf.js +0 -1
  41. package/dist/assets/Boot.f55a9419.js +0 -9
  42. package/dist/assets/bundle.esm.8409a5cf.js +0 -52
  43. /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/.eslintignore CHANGED
@@ -8,9 +8,9 @@ src/thirdparty
8
8
  bundle.esm.js
9
9
  bundle.es5.js
10
10
  rollup.config*.js
11
- wdio.conf.js
12
- postcss.config.js
13
- package-scripts.js
14
- .eslintrc.js
11
+ wdio.conf.cjs
12
+ postcss.config.cjs
13
+ package-scripts.cjs
14
+ .eslintrc.cjs
15
15
  src/renderer/directives/style-map.js
16
16
  src/util/metaUrl.js
package/.npsrc.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "config": "./package-scripts.cjs"
3
+ }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.12.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.1) (2023-04-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **framework:** relative paths for external themes ([#6799](https://github.com/SAP/ui5-webcomponents/issues/6799)) ([df1ddfc](https://github.com/SAP/ui5-webcomponents/commit/df1ddfc955ef3bb46d3b1e4694e7b931655a3079))
12
+ * getIconAccessibleName now handles empty strings ([240b35b](https://github.com/SAP/ui5-webcomponents/commit/240b35bf830b753e2b662ef705d6e4c624a911f0))
13
+ * **theming:** fix icons version display for custom themes (built via the ThemeDesigner) ([#6815](https://github.com/SAP/ui5-webcomponents/issues/6815)) ([63ff800](https://github.com/SAP/ui5-webcomponents/commit/63ff8007889a66efae074fc6b4dbcb1b7ea36713)), closes [#6758](https://github.com/SAP/ui5-webcomponents/issues/6758)
14
+
15
+
16
+ ### Features
17
+
18
+ * **framework:** re-export all public imports from index.js ([#6823](https://github.com/SAP/ui5-webcomponents/issues/6823)) ([a08d464](https://github.com/SAP/ui5-webcomponents/commit/a08d4645aeaae6e6f5eb8c55d8cb8bfaf4aa58b6))
19
+
20
+
21
+
22
+
23
+
24
+ # [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **framework:** relative paths for external themes ([#6799](https://github.com/SAP/ui5-webcomponents/issues/6799)) ([df1ddfc](https://github.com/SAP/ui5-webcomponents/commit/df1ddfc955ef3bb46d3b1e4694e7b931655a3079))
30
+ * **theming:** fix icons version display for custom themes (built via the ThemeDesigner) ([#6815](https://github.com/SAP/ui5-webcomponents/issues/6815)) ([63ff800](https://github.com/SAP/ui5-webcomponents/commit/63ff8007889a66efae074fc6b4dbcb1b7ea36713)), closes [#6758](https://github.com/SAP/ui5-webcomponents/issues/6758)
31
+
32
+
33
+ ### Features
34
+
35
+ * **framework:** re-export all public imports from index.js ([#6823](https://github.com/SAP/ui5-webcomponents/issues/6823)) ([a08d464](https://github.com/SAP/ui5-webcomponents/commit/a08d4645aeaae6e6f5eb8c55d8cb8bfaf4aa58b6))
36
+
37
+
38
+
39
+
40
+
6
41
  # [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
7
42
 
8
43
  **Note:** Version bump only for package @ui5/webcomponents-base
package/bundle.esm.js CHANGED
@@ -31,6 +31,7 @@ import { getAnimationMode } from "./dist/config/AnimationMode.js";
31
31
  import { getLanguage, setLanguage } from "./dist/config/Language.js";
32
32
  import { getCalendarType } from "./dist/config/CalendarType.js";
33
33
  import { getTheme, setTheme } from "./dist/config/Theme.js";
34
+ import { getThemeRoot } from "./dist/config/ThemeRoots";
34
35
  import { getNoConflict, setNoConflict } from "./dist/config/NoConflict.js";
35
36
  import { getRTL } from "./dist/config/RTL.js";
36
37
  import { getFirstDayOfWeek, getLegacyDateCalendarCustomizing } from "./dist/config/FormatSettings.js";
@@ -44,6 +45,7 @@ window["sap-ui-webcomponents-bundle"] = {
44
45
  getLanguage,
45
46
  setLanguage,
46
47
  getTheme,
48
+ getThemeRoot,
47
49
  setTheme,
48
50
  getNoConflict,
49
51
  setNoConflict,
@@ -0,0 +1,400 @@
1
+ exports.config = {
2
+ //
3
+ // ====================
4
+ // Runner Configuration
5
+ // ====================
6
+ //
7
+ // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
8
+ // on a remote machine).
9
+ runner: 'local',
10
+
11
+ //
12
+ // ==================
13
+ // Specify Test Files
14
+ // ==================
15
+ // Define which test specs should run. The pattern is relative to the directory
16
+ // from which `wdio` was called. Notice that, if you are calling `wdio` from an
17
+ // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
18
+ // directory is where your package.json resides, so `wdio` will be called from there.
19
+ //
20
+ specs: [
21
+ './test/specs/**/*.js'
22
+ ],
23
+ // Patterns to exclude.
24
+ exclude: [
25
+ // 'path/to/excluded/files'
26
+ ],
27
+ //
28
+ // ============
29
+ // Capabilities
30
+ // ============
31
+ // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
32
+ // time. Depending on the number of capabilities, WebdriverIO launches several test
33
+ // sessions. Within your capabilities you can overwrite the spec and exclude options in
34
+ // order to group specific specs to a specific capability.
35
+ //
36
+ // First, you can define how many instances should be started at the same time. Let's
37
+ // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
38
+ // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
39
+ // files and you set maxInstances to 10, all spec files will get tested at the same time
40
+ // and 30 processes will get spawned. The property handles how many capabilities
41
+ // from the same test should run tests.
42
+ //
43
+ maxInstances: 10,
44
+ //
45
+ // If you have trouble getting all important capabilities together, check out the
46
+ // Sauce Labs platform configurator - a great tool to configure your capabilities:
47
+ // https://docs.saucelabs.com/reference/platforms-configurator
48
+ //
49
+ capabilities: [{
50
+ // maxInstances can get overwritten per capability. So if you have an in-house Selenium
51
+ // grid with only 5 firefox instances available you can make sure that not more than
52
+ // 5 instances get started at a time.
53
+ maxInstances: 5,
54
+ //
55
+ browserName: 'chrome',
56
+ 'goog:chromeOptions': {
57
+ // to run chrome headless the following flags are required
58
+ // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
59
+ args: [
60
+ 'headless', // start in headless mode
61
+ 'start-maximized', // maximize the window
62
+ 'no-sandbox', // disable sandbox isolation
63
+ 'disable-infobars', // disable the infos
64
+ 'disable-gpu', // on windows disable gpu hw acceleration
65
+ 'disable-extensions', // disable extensions
66
+ 'disable-dev-shm-usage' // disable /dev/shm in CI
67
+ ],
68
+ }
69
+ }],
70
+ //
71
+ // port to find chromedriver
72
+ port: 9515, // default
73
+ // ===================
74
+ // Test Configurations
75
+ // ===================
76
+ // Define all options that are relevant for the WebdriverIO instance here
77
+ //
78
+ // Level of logging verbosity: trace | debug | info | warn | error
79
+ logLevel: 'error',
80
+ //
81
+ // Warns when a deprecated command is used
82
+ deprecationWarnings: true,
83
+ //
84
+ // If you only want to run your tests until a specific amount of tests have failed use
85
+ // bail (default is 0 - don't bail, run all tests).
86
+ bail: 0,
87
+ //
88
+ // Set a base URL in order to shorten url command calls. If your `url` parameter starts
89
+ // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
90
+ // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
91
+ // gets prepended directly.
92
+ baseUrl: 'http://localhost:4567', // This is important since WDIO 7+ does not accept an empty string for baseUrl
93
+ path: '',
94
+ //
95
+ // Default timeout for all waitFor* commands.
96
+ waitforTimeout: 10000,
97
+ //
98
+ // Default timeout in milliseconds for request
99
+ // if Selenium Grid doesn't send response
100
+ connectionRetryTimeout: 90000,
101
+ //
102
+ // Default request retries count
103
+ connectionRetryCount: 3,
104
+ //
105
+ // Test runner services
106
+ // Services take over a specific job you don't want to take care of. They enhance
107
+ // your test setup with almost no effort. Unlike plugins, they don't add new
108
+ // commands. Instead, they hook themselves up into the test process.
109
+ services: ['chromedriver', 'devtools',
110
+ ['static-server', {
111
+ folders: [
112
+ { mount: '/', path: './dist' },
113
+ ],
114
+ port: '4567',
115
+ }],
116
+ ],
117
+ // options
118
+ chromeDriverArgs: ['--port=9515'], // default
119
+ // Framework you want to run your specs with.
120
+ // The following are supported: Mocha, Jasmine, and Cucumber
121
+ // see also: https://webdriver.io/docs/frameworks.html
122
+ //
123
+ // Make sure you have the wdio adapter package for the specific framework installed
124
+ // before running any tests.
125
+ framework: 'mocha',
126
+ //
127
+ // Test reporter for stdout.
128
+ // The only one supported by default is 'dot'
129
+ // see also: https://webdriver.io/docs/dot-reporter.html
130
+ reporters: ['dot', 'spec'],
131
+
132
+ //
133
+ // Options to be passed to Mocha.
134
+ // See the full list at http://mochajs.org/
135
+ mochaOpts: {
136
+ ui: 'bdd',
137
+ timeout: 60000
138
+ },
139
+ //
140
+ // =====
141
+ // Hooks
142
+ // =====
143
+ // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
144
+ // it and to build services around it. You can either apply a single function or an array of
145
+ // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
146
+ // resolved to continue.
147
+ /**
148
+ * Gets executed once before all workers get launched.
149
+ * @param {Object} config wdio configuration object
150
+ * @param {Array.<Object>} capabilities list of capabilities details
151
+ */
152
+ // onPrepare: function (config, capabilities) {
153
+ // },
154
+ /**
155
+ * Gets executed just before initialising the webdriver session and test framework. It allows you
156
+ * to manipulate configurations depending on the capability or spec.
157
+ * @param {Object} config wdio configuration object
158
+ * @param {Array.<Object>} capabilities list of capabilities details
159
+ * @param {Array.<String>} specs List of spec file paths that are to be run
160
+ */
161
+ // beforeSession: function (config, capabilities, specs) {
162
+ // },
163
+ /**
164
+ * Gets executed before test execution begins. At this point you can access to all global
165
+ * variables like `browser`. It is the perfect place to define custom commands.
166
+ * @param {Array.<Object>} capabilities list of capabilities details
167
+ * @param {Array.<String>} specs List of spec file paths that are to be run
168
+ */
169
+ before: async function (capabilities, specs) {
170
+ await browser.addCommand("isFocusedDeep", async function () {
171
+ return browser.executeAsync(function (elem, done) {
172
+ let activeElement = document.activeElement;
173
+
174
+ while (activeElement.shadowRoot) {
175
+ if (activeElement.shadowRoot.activeElement) {
176
+ activeElement = activeElement.shadowRoot.activeElement;
177
+ } else {
178
+ break;
179
+ }
180
+ }
181
+ done(elem === activeElement);
182
+ }, this);
183
+ }, true);
184
+
185
+ await browser.addCommand("isFocusedDeepElement", async function (element) {
186
+ return browser.executeAsync(function (elem, element, done) {
187
+ let activeElement = document.activeElement;
188
+
189
+ while (activeElement.shadowRoot) {
190
+ if (activeElement.shadowRoot.activeElement) {
191
+ activeElement = activeElement.shadowRoot.activeElement;
192
+ } else {
193
+ break;
194
+ }
195
+ }
196
+ done(element === activeElement);
197
+ }, this, element);
198
+ }, true);
199
+
200
+ await browser.addCommand("setProperty", async function(property, value) {
201
+ return browser.executeAsync((elem, property, value, done) => {
202
+ elem[property] = value;
203
+ done();
204
+ }, this, property, value);
205
+ }, true);
206
+
207
+ await browser.addCommand("setAttribute", async function(attribute, value) {
208
+ return browser.executeAsync((elem, attribute, value, done) => {
209
+ elem.setAttribute(attribute, value);
210
+ done();
211
+ }, this, attribute, value);
212
+ }, true);
213
+
214
+ await browser.addCommand("removeAttribute", async function(attribute) {
215
+ return browser.executeAsync((elem, attribute, done) => {
216
+ elem.removeAttribute(attribute);
217
+ done();
218
+ }, this, attribute);
219
+ }, true);
220
+
221
+ await browser.addCommand("hasClass", async function(className) {
222
+ return browser.executeAsync((elem, className, done) => {
223
+ done(elem.classList.contains(className));
224
+ }, this, className);
225
+ }, true);
226
+
227
+ await browser.addCommand("hasAttribute", async function(attrName) {
228
+ return browser.executeAsync((elem, attrName, done) => {
229
+ done(elem.hasAttribute(attrName));
230
+ }, this, attrName);
231
+ }, true);
232
+
233
+ await browser.addCommand("getStaticAreaItemClassName", async function(selector) {
234
+ return browser.executeAsync(async (selector, done) => {
235
+ const staticAreaItem = await document.querySelector(selector).getStaticAreaItemDomRef();
236
+ done(staticAreaItem.host.classList[0]);
237
+ }, selector);
238
+ }, false);
239
+
240
+ await browser.addLocatorStrategy('activeElement', (selector) => {
241
+ return document.querySelector(selector).shadowRoot.activeElement;
242
+ });
243
+ },
244
+ /**
245
+ * Runs before a WebdriverIO command gets executed.
246
+ * @param {String} commandName hook command name
247
+ * @param {Array} args arguments that command would receive
248
+ */
249
+ beforeCommand: async function (commandName, args) {
250
+ const waitFor = [
251
+ "$",
252
+ "$$",
253
+ "getAttribute",
254
+ "hasAttribute", // custom
255
+ "getCSSProperty",
256
+ "getHTML",
257
+ "getProperty",
258
+ "getSize",
259
+ "getStaticAreaItemClassName", // custom
260
+ "getText",
261
+ "getValue",
262
+ "hasClass", // custom
263
+ "isDisplayed",
264
+ "isDisplayedInViewport",
265
+ "isEnabled",
266
+ "isExisting",
267
+ "isFocused",
268
+ "isFocusedDeep", // custom
269
+ "isFocusedDeepElement", // custom
270
+ "shadow$",
271
+ "shadow$$",
272
+ ];
273
+ if (waitFor.includes(commandName)) {
274
+ await browser.executeAsync(function (done) {
275
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
276
+ });
277
+ }
278
+ },
279
+
280
+ /**
281
+ * Hook that gets executed before the suite starts
282
+ * @param {Object} suite suite details
283
+ */
284
+ // beforeSuite: function (suite) {
285
+ // },
286
+ /**
287
+ * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
288
+ * @param {Object} test test details
289
+ */
290
+ // beforeTest: function (test) {
291
+ // },
292
+ /**
293
+ * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
294
+ * beforeEach in Mocha)
295
+ */
296
+ // beforeHook: function () {
297
+ // },
298
+ /**
299
+ * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
300
+ * afterEach in Mocha)
301
+ */
302
+ // afterHook: function () {
303
+ // },
304
+ /**
305
+ * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
306
+ * @param {Object} test test details
307
+ */
308
+ // afterTest: function (test) {
309
+ // },
310
+ /**
311
+ * Hook that gets executed after the suite has ended
312
+ * @param {Object} suite suite details
313
+ */
314
+ // afterSuite: function (suite) {
315
+ // },
316
+
317
+ /**
318
+ * Runs after a WebdriverIO command gets executed
319
+ * @param {String} commandName hook command name
320
+ * @param {Array} args arguments that command would receive
321
+ * @param {Number} result 0 - command success, 1 - command error
322
+ * @param {Object} error error object if any
323
+ */
324
+ afterCommand: async function (commandName, args, result, error) {
325
+
326
+ // url -> set configuration first
327
+ if (commandName === "url" && !args[0].includes("do-not-change-configuration")) {
328
+ await browser.executeAsync(function(done) {
329
+ window["sap-ui-webcomponents-bundle"].configuration.setNoConflict(true);
330
+ done();
331
+ });
332
+ }
333
+
334
+ const waitFor = [
335
+ "addValue",
336
+ "clearValue",
337
+ "click",
338
+ "doubleClick",
339
+ "dragAndDrop",
340
+ "pause",
341
+ "removeAttribute", // custom
342
+ "scrollIntoView",
343
+ "setAttribute", // custom
344
+ "setProperty", // custom
345
+ "setValue",
346
+ "setWindowSize",
347
+ "touchAction",
348
+ "url",
349
+ ];
350
+
351
+ const waitForWithDelay = [
352
+ "keys",
353
+ ];
354
+
355
+ if (waitFor.includes(commandName)) {
356
+ await browser.executeAsync(function (done) {
357
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
358
+ });
359
+ } else if (waitForWithDelay.includes(commandName)) {
360
+ await browser.executeAsync(function (done) {
361
+ setTimeout(() => {
362
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
363
+ }, 10);
364
+ });
365
+ }
366
+ },
367
+ /**
368
+ * Gets executed after all tests are done. You still have access to all global variables from
369
+ * the test.
370
+ * @param {Number} result 0 - test pass, 1 - test fail
371
+ * @param {Array.<Object>} capabilities list of capabilities details
372
+ * @param {Array.<String>} specs List of spec file paths that ran
373
+ */
374
+ // after: function (result, capabilities, specs) {
375
+ // },
376
+ /**
377
+ * Gets executed right after terminating the webdriver session.
378
+ * @param {Object} config wdio configuration object
379
+ * @param {Array.<Object>} capabilities list of capabilities details
380
+ * @param {Array.<String>} specs List of spec file paths that ran
381
+ */
382
+ // afterSession: function (config, capabilities, specs) {
383
+ // },
384
+ /**
385
+ * Gets executed after all workers got shut down and the process is about to exit.
386
+ * @param {Object} exitCode 0 - success, 1 - fail
387
+ * @param {Object} config wdio configuration object
388
+ * @param {Array.<Object>} capabilities list of capabilities details
389
+ * @param {<Object>} results object containing test results
390
+ */
391
+ // onComplete: function(exitCode, config, capabilities, results) {
392
+ // },
393
+ /**
394
+ * Gets executed when a refresh happens.
395
+ * @param {String} oldSessionId session ID of the old session
396
+ * @param {String} newSessionId session ID of the new session
397
+ */
398
+ //onReload: function(oldSessionId, newSessionId) {
399
+ //}
400
+ }
@@ -101,6 +101,9 @@ const getIconData = async (name) => {
101
101
  * @return { Promise }
102
102
  */
103
103
  const getIconAccessibleName = async (name) => {
104
+ if (!name) {
105
+ return;
106
+ }
104
107
  let iconData = getIconDataSync(name);
105
108
  if (!iconData) {
106
109
  iconData = await getIconData(name);
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA4BjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;AAC9C,MAAM,QAAQ,GAAG,iBAAiB,CAAwB,mBAAmB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1F,MAAM,sBAAsB,GAAG,iBAAiB,CAAuC,mBAAmB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAEvH,MAAM,cAAc,GAAG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AG,KAAK,IAAI,EAAE;IACtC,+DAA+D;IAC/D,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/B,MAAM,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"../assets-meta/IconCollectionsAlias.js\";\nimport { getEffectiveIconCollection } from \"../config/Icons.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\"\n * to form the proper registry key (\"collection/name\") under which the icon is registered:\n *\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n * - determines theme dependant icon collection (f.e \"home\" => \"SAP-icons-v4/home\" in Quartz | \"SAP-icons-v5/home\" in Horizon)\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\tcollection = getEffectiveIconCollection(collection);\n\n\tconst registryKey = `${collection}/${name}`;\n\treturn { name, collection, registryKey };\n};\n\nconst getIconDataSync = (name: string) => {\n\tconst { registryKey } = processName(name);\n\treturn registry.get(registryKey);\n};\n\nconst getIconData = async (name: string) => {\n\tconst { collection, registryKey } = processName(name);\n\n\tlet iconData: string | CollectionData = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(collection))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tif (!registry.has(registryKey)) {\n\t\t// not filled by another await. many getters will await on the same loader, but fill only once\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
1
+ {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Ic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qB,GAAG,KAAK,EAAE,IAAY,EAA+B,EAAE;IACjF,IAAI,CAAC,IAAI,EAAE;QACV,OAAO;KACP;IAED,IAAI,QAAQ,GAAiD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEnF,IAAI,CAAC,QAAQ,EAAE;QACd,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;KACnC;IAED,IAAI,QAAQ,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,CAAC,OAAO,EAAE;QAChE,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC7D,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;KAC5C;AACF,CAAC,CAAC;AAEF,uBAAuB;AACvB,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;IACtC,+DAA+D;IAC/D,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/B,MAAM,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"../assets-meta/IconCollectionsAlias.js\";\nimport { getEffectiveIconCollection } from \"../config/Icons.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\"\n * to form the proper registry key (\"collection/name\") under which the icon is registered:\n *\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n * - determines theme dependant icon collection (f.e \"home\" => \"SAP-icons-v4/home\" in Quartz | \"SAP-icons-v5/home\" in Horizon)\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\tcollection = getEffectiveIconCollection(collection);\n\n\tconst registryKey = `${collection}/${name}`;\n\treturn { name, collection, registryKey };\n};\n\nconst getIconDataSync = (name: string) => {\n\tconst { registryKey } = processName(name);\n\treturn registry.get(registryKey);\n};\n\nconst getIconData = async (name: string) => {\n\tconst { collection, registryKey } = processName(name);\n\n\tlet iconData: string | CollectionData = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(collection))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tif (!registry.has(registryKey)) {\n\t\t// not filled by another await. many getters will await on the same loader, but fill only once\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
@@ -0,0 +1,9 @@
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 A={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"]}},R=A.themes.default,st=A.themes.all,D=A.languages.default,u=A.locales.default,ue=A.locales.all,rt=()=>{const e=navigator.languages,t=()=>navigator.language;return e&&e[0]||t()||D};var Pe={},$e=Pe.hasOwnProperty,ot=Pe.toString,Ce=$e.toString,at=Ce.call(Object),le=function(e){var t,n;return!e||ot.call(e)!=="[object Object]"?!1:(t=Object.getPrototypeOf(e),t?(n=$e.call(t,"constructor")&&t.constructor,typeof n=="function"&&Ce.call(n)===at):!0)},it=Object.create(null),Re=function(e,t,n,s){var r,o,a,c,L,p,f=arguments[2]||{},V=3,tt=arguments.length,ce=arguments[0]||!1,nt=arguments[1]?void 0:it;for(typeof f!="object"&&typeof f!="function"&&(f={});V<tt;V++)if((L=arguments[V])!=null)for(c in L)r=f[c],a=L[c],!(c==="__proto__"||f===a)&&(ce&&a&&(le(a)||(o=Array.isArray(a)))?(o?(o=!1,p=r&&Array.isArray(r)?r:[]):p=r&&le(r)?r:{},f[c]=Re(ce,arguments[1],p,a)):a!==nt&&(f[c]=a));return f};const Oe=function(e,t){return Re(!0,!1,...arguments)},Ue=new Map,Wn=(e,t)=>{Ue.set(e,t)},w=e=>Ue.get(e),ct=e=>{const t=document.querySelector(`META[name="${e}"]`);return t&&t.getAttribute("content")},ut=e=>{const t=ct("sap-allowedThemeOrigins");return t&&t.split(",").some(n=>n==="*"||e===n.trim())},lt=(e,t)=>{const n=new URL(e).pathname;return new URL(n,t).toString()},ft=e=>{let t;try{if(e.startsWith(".")||e.startsWith("/"))t=new URL(e,window.location.href).toString();else{const n=new URL(e),s=n.origin;s&&ut(s)?t=n.toString():t=lt(n.toString(),window.location.href)}return t.endsWith("/")||(t=`${t}/`),`${t}UI5/`}catch{}};var Y;(function(e){e.Full="full",e.Basic="basic",e.Minimal="minimal",e.None="none"})(Y||(Y={}));const dt=Y;let fe=!1,i={animationMode:dt.Full,theme:R,themeRoot:void 0,rtl:void 0,language:void 0,calendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1};const Zn=()=>(l(),i.animationMode),ht=()=>(l(),i.theme),pt=()=>(l(),i.themeRoot),Hn=()=>(l(),i.rtl),gt=()=>(l(),i.language),mt=()=>(l(),i.fetchDefaultLanguage),qn=()=>(l(),i.noConflict),Gn=()=>(l(),i.calendarType),Kn=()=>(l(),i.formatSettings),O=new Map;O.set("true",!0);O.set("false",!1);const yt=()=>{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))}},wt=()=>{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||de(n,t,"sap")}),e.forEach((t,n)=>{!n.startsWith("sap-ui")||de(n,t,"sap-ui")})},St=e=>{const t=e.split("@")[1];return ft(t)},_t=(e,t)=>e==="theme"&&t.includes("@")?t.split("@")[0]:t,de=(e,t,n)=>{const s=t.toLowerCase(),r=e.split(`${n}-`)[1];O.has(t)&&(t=O.get(s)),r==="theme"?(i.theme=_t(r,t),t&&t.includes("@")&&(i.themeRoot=St(t))):i[r]=t},bt=()=>{const e=w("OpenUI5Support");if(!e||!e.isLoaded())return;const t=e.getConfigurationSettingsObject();i=Oe(i,t)},l=()=>{typeof document>"u"||fe||(yt(),wt(),bt(),fe=!0)};class v{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 v,Me="languageChange",ke=e=>{Ie.attachEvent(Me,e)},Tt=e=>Ie.fireEventAsync(Me,e),he=10;class At{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>he)throw new Error(`Web component processed too many times this task, max allowed is: ${he}`);t(n),s.set(n,r+1),n=this.shift()}}}const vt=(e,t=document.body)=>{let n=document.querySelector(e);return n||(n=document.createElement(e),t.insertBefore(n,t.firstChild))},Lt=()=>typeof document>"u"?null:vt("ui5-shared-resources",document.head),B=(e,t)=>{const n=e.split(".");let s=Lt();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},Et={version:"1.12.1",major:1,minor:12,patch:1,suffix:"",isNext:!1,buildTime:1681222432};let $,Pt="";const N=new Map,b=B("Runtimes",[]),$t=()=>{if($===void 0){$=b.length;const e=Et;b.push({...e,alias:Pt,description:`Runtime ${$} - ver ${e.version}`})}},De=()=>$,Ct=(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},Rt=()=>b,Be=B("Tags",new Map),ne=new Set;let h=new Map,W;const xe=-1,Jn=e=>{ne.add(e),Be.set(e,De())},Xn=e=>ne.has(e),Ot=()=>[...ne.values()],Yn=e=>{let t=Be.get(e);t===void 0&&(t=xe),h.has(t)||h.set(t,new Set),h.get(t).add(e),W||(W=setTimeout(()=>{Ut(),h=new Map,W=void 0},1e3))},Ut=()=>{const e=Rt(),t=De(),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=Ct(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,Qn=e=>{Fe.add(e)},It=e=>Fe.has(e),se=new Set,Mt=new v,S=new At;let g,C,Z,E;const kt=async e=>{S.add(e),await Bt()},Dt=e=>{Mt.fireEvent("beforeComponentRender",e),se.add(e),e._render()},es=e=>{S.remove(e),se.delete(e)},Bt=async()=>{E||(E=new Promise(e=>{window.requestAnimationFrame(()=>{S.process(Dt),E=null,e(),Z||(Z=setTimeout(()=>{Z=void 0,S.isEmpty()&&zt()},200))})})),await E},xt=()=>g||(g=new Promise(e=>{C=e,window.requestAnimationFrame(()=>{S.isEmpty()&&(g=void 0,e())})}),g),Ft=()=>{const e=Ot().map(t=>customElements.whenDefined(t));return Promise.all(e)},jt=async()=>{await Ft(),await xt()},zt=()=>{!S.isEmpty()||C&&(C(),C=void 0,g=void 0)},je=async e=>{se.forEach(t=>{const n=t.constructor,s=n.getMetadata().getTag(),r=It(n),o=n.getMetadata().isLanguageAware(),a=n.getMetadata().isThemeAware();(!e||e.tag===s||e.rtlAware&&r||e.languageAware&&o||e.themeAware&&a)&&kt(t)}),await jt()};let _,Q;const Vt=()=>(_===void 0&&(_=gt()),_),ts=async e=>{_!==e&&(_=e,await Tt(e),await je({languageAware:!0}))},Nt=e=>{Q=e},Wt=()=>(Q===void 0&&Nt(mt()),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]||D,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)),pe=e=>{try{if(e&&typeof e=="string")return Ve(e)}catch{}return new ze(u)},ee=e=>{if(e)return pe(e);const t=Vt();return t?Ve(t):pe(rt())},Ht=/^((?:[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,ge=/(?:^|-)(saptrc|sappsd)(?:-|$)/i,qt={he:"iw",yi:"ji",nb:"no",sr:"sh"},Gt=e=>{let t;if(!e)return u;if(typeof e=="string"&&(t=Ht.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=qt[n]||n,a&&(t=ge.exec(a))||o&&(t=ge.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},Kt=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:""},me=new Set,ye=new Set,re=new Map,q=new Map,oe=new Map,ns=(e,t,n)=>{const s=`${e}/${t}`;oe.set(s,n)},we=(e,t)=>{re.set(e,t)},ss=e=>re.get(e),Ne=(e,t)=>{const n=`${e}/${t}`;return oe.has(n)},Jt=(e,t)=>{const n=`${e}/${t}`,s=oe.get(n);return s&&!q.get(n)&&q.set(n,s(t)),q.get(n)},Xt=e=>{me.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.`),me.add(e))},Se=(e,t)=>t!==D&&!Ne(e,t),Yt=async e=>{const t=ee().getLanguage(),n=ee().getRegion();let s=t+(n?`-${n}`:"");if(Se(e,s))for(s=Gt(s);Se(e,s);)s=Kt(s);const r=Wt();if(s===D&&!r){we(e,null);return}if(!Ne(e,s)){Xt(e);return}try{const o=await Jt(e,s);we(e,o)}catch(o){const a=o;ye.has(a.message)||(ye.add(a.message),console.error(a.message))}};ke(e=>{const t=[...re.keys()];return Promise.all(t.map(Yt))});const Qt=new Map,U=new Map,G=new Map,_e=new Set;let be=!1;const en={iw:"he",ji:"yi",in:"id"},Te=e=>{be||(console.warn(`[LocaleData] Supported locale "${e}" not configured, import the "Assets.js" module from the webcomponents package you are using.`),be=!0)},tn=(e,t,n)=>{e=e&&en[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 ue.includes(s)||(s=e,ue.includes(s))?U.has(s)?s:(Te(s),u):u},Ae=(e,t)=>{Qt.set(e,t)},nn=e=>{if(!G.get(e)){const t=U.get(e);if(!t)throw new Error(`CLDR data for locale ${e} is not loaded!`);G.set(e,t(e))}return G.get(e)},sn=async(e,t,n)=>{const s=tn(e,t,n),r=w("OpenUI5Support");if(r){const o=r.getLocaleDataObject();if(o){Ae(s,o);return}}try{const o=await nn(s);Ae(s,o)}catch(o){const a=o;_e.has(a.message)||(_e.add(a.message),console.error(a.message))}},rn=(e,t)=>{U.set(e,t)};rn("en",async()=>(await fetch("https://sdk.openui5.org/1.103.0/resources/sap/ui/core/cldr/en.json")).json());ke(()=>{const e=ee();return sn(e.getLanguage(),e.getRegion(),e.getScript())});const We=new v,Ze="themeRegistered",on=e=>{We.attachEvent(Ze,e)},an=e=>We.fireEvent(Ze,e),He=new Map,qe=new Map,Ge=new Set,I=new Set,rs=(e,t,n)=>{qe.set(`${e}/${t}`,n),Ge.add(e),I.add(t),an(t)},Ke=async(e,t)=>{const n=He.get(`${e}_${t}`);if(n!==void 0)return n;if(!I.has(t)){const s=[...I.values()].join(", ");return console.warn(`You have requested a non-registered theme ${t} - falling back to ${R}. Registered themes are: ${s}`),ve(e,R)}return ve(e,t)},ve=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,cn=e=>I.has(e);var M;(function(e){e["SAP-icons"]="SAP-icons-v4",e.horizon="SAP-icons-v5",e["SAP-icons-TNT"]="tnt",e.BusinessSuiteInAppSymbols="business-suite"})(M||(M={}));const Xe=e=>M[e]?M[e]:e,un=(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},ln=(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,un(s,r)}},fn=(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}"]`),dn=(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)?fn(e,t,n):F(e,t,n)},m=new Set,hn=()=>{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},pn=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"))}}},gn=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}},te=()=>{const e=hn();if(!e||e==="none")return;const t=pn(e);if(t)return gn(t)},mn=new v,yn="themeLoaded",wn=e=>mn.fireEvent(yn,e);let K;const Qe=()=>(K===void 0&&(K=pt()),K),Sn=e=>`${Qe()}Base/baseLib/${e}/css_variables.css`,_n=async e=>{const t=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);t&&document.head.removeChild(t),await ln(Sn(e),{"sap-ui-webcomponents-theme":e})},T="@ui5/webcomponents-theming",bn=()=>Je().has(T),Tn=async e=>{if(!bn())return;const t=await Ke(T,e);t&&Ye(t,"data-ui5-theme-properties",T)},An=()=>{dn("data-ui5-theme-properties",T)},vn=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)},Ln=async e=>{var s;const t=te();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 _n(e),te()},ae=async e=>{const t=await Ln(e);!t||e!==t.themeName?await Tn(e):An();const n=cn(e)?e:t&&t.baseThemeName;await vn(n||R),wn(e)};let y;const z=()=>(y===void 0&&(y=ht()),y),os=async e=>{y!==e&&(y=e,await ae(y),await je({themeAware:!0}))},En=()=>{var t,n;const e=z();return Pn(e)?!e.startsWith("sap_horizon"):!((n=(t=te())==null?void 0:t.baseThemeName)!=null&&n.startsWith("sap_horizon"))},Pn=e=>st.includes(e),$n=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 Cn=e=>{const t=z(),n=$n.get(t);return!e&&n?Xe(n):Rn(e)},Rn=e=>{const t=En();return e?e==="tnt"?t?d.SAPIconsTNTV2:d.SAPIconsTNTV3:e==="business-suite"?t?d.SAPBSIconsV1:d.SAPBSIconsV2:e:t?d.SAPIconsV4:d.SAPIconsV5},Le=new Map,k=B("SVGIcons.registry",new Map),J=B("SVGIcons.promises",new Map),Ee="ICON_NOT_FOUND",On=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)},Un=e=>{Object.keys(e.data).forEach(t=>{const n=e.data[t];In(t,{pathData:n.path||n.paths,ltr:n.ltr,accData:n.acc,collection:e.collection,packageName:e.packageName})})},In=(e,t)=>{const n=`${t.collection}/${e}`;k.set(n,{pathData:t.pathData,ltr:t.ltr,accData:t.accData,packageName:t.packageName,customTemplate:t.customTemplate,viewBox:t.viewBox,collection:t.collection})},Mn=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=Cn(t);const n=`${t}/${e}`;return{name:e,collection:t,registryKey:n}},X=async e=>{const{collection:t,registryKey:n}=Mn(e);let s=Ee;try{s=await On(t)}catch(r){console.error(r.message)}return s===Ee?s:(k.has(n)||Un(s),k.get(n))},as=async()=>(await X("edit"),await X("tnt/arrow"),await X("business-suite/3d"),Array.from(k.keys())),kn=()=>new Promise(e=>{document.body?e():document.addEventListener("DOMContentLoaded",()=>{e()})}),Dn={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")}`},Bn={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')}"},xn=()=>{const e=w("OpenUI5Support");(!e||!e.isLoaded())&&Fn(),jn()},Fn=()=>{j("data-ui5-font-face")||F(Dn,"data-ui5-font-face")},jn=()=>{j("data-ui5-font-face-override")||F(Bn,"data-ui5-font-face-override")},zn={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}"},Vn=()=>{j("data-ui5-system-css-vars")||F(zn,"data-ui5-system-css-vars")};let ie=!1,P;const et=new v,is=e=>{if(!ie){et.attachEvent("boot",e);return}e()},cs=async()=>{if(P!==void 0)return P;const e=async t=>{if(typeof document>"u"){t();return}on(Nn),$t();const n=w("OpenUI5Support"),s=n?n.isLoaded():!1,r=w("F6Navigation");n&&await n.init(),r&&!s&&r.init(),await kn(),await ae(z()),n&&n.attachListeners(),xn(),Vn(),t(),ie=!0,await et.fireEventAsync("boot")};return P=new Promise(e),P},Nn=e=>{const t=z();ie&&e===t&&ae(t)};export{ts as A,z as B,Qe as C,ns as D,v as E,is as F,as as _,B as a,je as b,w as c,Hn as d,Vt as e,Yt as f,ss as g,rt as h,jt as i,qn as j,Dt as k,es as l,Qn as m,vt as n,cs as o,Xn as p,Yn as q,Wn as r,os as s,Jn as t,Oe as u,kt as v,rs as w,Zn as x,Gn as y,Kn as z};