@wix/cli-app 1.1.115 → 1.1.117

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 (63) hide show
  1. package/build/{AddPermissionCommand-NFOSCZBB.js → AddPermissionCommand-FRULGWNY.js} +2 -2
  2. package/build/{DevCommand-2WTVQWPB.js → DevCommand-YI2B7G5J.js} +10 -10
  3. package/build/{GenerateCommand-EKL4CDEW.js → GenerateCommand-H75GGH5J.js} +7 -7
  4. package/build/{LogsCommand-W52WDTBH.js → LogsCommand-RQPS236I.js} +3 -3
  5. package/build/PreviewCommand-V6BO4PKA.js +19 -0
  6. package/build/ReleaseCommand-36SQJV6H.js +23 -0
  7. package/build/{ServeCommand-NJ6IJ4SB.js → ServeCommand-A4JHPMA7.js} +3 -3
  8. package/build/{build-G2IJISVN.js → build-C33J7Y3I.js} +6 -6
  9. package/build/{chunk-JRPKJWOU.js → chunk-3RNGX7ML.js} +21 -3
  10. package/build/chunk-3RNGX7ML.js.map +1 -0
  11. package/build/{chunk-C7R22JYH.js → chunk-474QW7HY.js} +2 -2
  12. package/build/{chunk-RJQXIF35.js → chunk-4Q3VR44F.js} +4 -4
  13. package/build/{chunk-NRM3ZXW7.js → chunk-5M3CNYCV.js} +4 -4
  14. package/build/{chunk-45FEUWCU.js → chunk-5RLZ6L2J.js} +6 -6
  15. package/build/{chunk-5GOQH6SN.js → chunk-A27H6ZXE.js} +14350 -13045
  16. package/build/{chunk-5GOQH6SN.js.map → chunk-A27H6ZXE.js.map} +1 -1
  17. package/build/{chunk-7BNC5HUR.js → chunk-BBNWMF7I.js} +3 -3
  18. package/build/{chunk-JSP5PP3E.js → chunk-CIJQD4JQ.js} +543 -246
  19. package/build/{chunk-JSP5PP3E.js.map → chunk-CIJQD4JQ.js.map} +1 -1
  20. package/build/{chunk-VEKEHQPT.js → chunk-EZ5VASE7.js} +2 -2
  21. package/build/{chunk-PG3XBIRJ.js → chunk-H5NUQH27.js} +7 -7
  22. package/build/{chunk-PAUSYJEB.js → chunk-I7IV53RG.js} +2 -2
  23. package/build/{chunk-67SQHC34.js → chunk-KHDDMFXB.js} +2 -2
  24. package/build/{chunk-7MDEKB7H.js → chunk-L626S3LH.js} +6 -6
  25. package/build/{chunk-WRBSQEXO.js → chunk-OFUMAVSR.js} +2 -2
  26. package/build/{chunk-RFUMAZYB.js → chunk-Q3KFWPJE.js} +2 -2
  27. package/build/{chunk-CKWBUKC5.js → chunk-SVQO4SWK.js} +2 -2
  28. package/build/{chunk-62IIA6VV.js → chunk-UYYAUVCF.js} +2 -2
  29. package/build/index.js +23 -23
  30. package/build/platform-sdk/editor.js +4 -4
  31. package/build/platform-sdk/editor.js.map +1 -1
  32. package/build/{preview-Q53FBYSD.js → preview-CHUIOS3O.js} +12 -12
  33. package/build/{release-OL4HSPAN.js → release-QQKNMFX6.js} +14 -14
  34. package/build/{render-command-YNU4BMZE.js → render-command-UUA6QUPM.js} +5 -5
  35. package/package.json +5 -5
  36. package/build/PreviewCommand-42IMENU3.js +0 -19
  37. package/build/ReleaseCommand-2F5DH3KE.js +0 -23
  38. package/build/chunk-JRPKJWOU.js.map +0 -1
  39. /package/build/{AddPermissionCommand-NFOSCZBB.js.map → AddPermissionCommand-FRULGWNY.js.map} +0 -0
  40. /package/build/{DevCommand-2WTVQWPB.js.map → DevCommand-YI2B7G5J.js.map} +0 -0
  41. /package/build/{GenerateCommand-EKL4CDEW.js.map → GenerateCommand-H75GGH5J.js.map} +0 -0
  42. /package/build/{LogsCommand-W52WDTBH.js.map → LogsCommand-RQPS236I.js.map} +0 -0
  43. /package/build/{PreviewCommand-42IMENU3.js.map → PreviewCommand-V6BO4PKA.js.map} +0 -0
  44. /package/build/{ReleaseCommand-2F5DH3KE.js.map → ReleaseCommand-36SQJV6H.js.map} +0 -0
  45. /package/build/{ServeCommand-NJ6IJ4SB.js.map → ServeCommand-A4JHPMA7.js.map} +0 -0
  46. /package/build/{build-G2IJISVN.js.map → build-C33J7Y3I.js.map} +0 -0
  47. /package/build/{chunk-C7R22JYH.js.map → chunk-474QW7HY.js.map} +0 -0
  48. /package/build/{chunk-RJQXIF35.js.map → chunk-4Q3VR44F.js.map} +0 -0
  49. /package/build/{chunk-NRM3ZXW7.js.map → chunk-5M3CNYCV.js.map} +0 -0
  50. /package/build/{chunk-45FEUWCU.js.map → chunk-5RLZ6L2J.js.map} +0 -0
  51. /package/build/{chunk-7BNC5HUR.js.map → chunk-BBNWMF7I.js.map} +0 -0
  52. /package/build/{chunk-VEKEHQPT.js.map → chunk-EZ5VASE7.js.map} +0 -0
  53. /package/build/{chunk-PG3XBIRJ.js.map → chunk-H5NUQH27.js.map} +0 -0
  54. /package/build/{chunk-PAUSYJEB.js.map → chunk-I7IV53RG.js.map} +0 -0
  55. /package/build/{chunk-67SQHC34.js.map → chunk-KHDDMFXB.js.map} +0 -0
  56. /package/build/{chunk-7MDEKB7H.js.map → chunk-L626S3LH.js.map} +0 -0
  57. /package/build/{chunk-WRBSQEXO.js.map → chunk-OFUMAVSR.js.map} +0 -0
  58. /package/build/{chunk-RFUMAZYB.js.map → chunk-Q3KFWPJE.js.map} +0 -0
  59. /package/build/{chunk-CKWBUKC5.js.map → chunk-SVQO4SWK.js.map} +0 -0
  60. /package/build/{chunk-62IIA6VV.js.map → chunk-UYYAUVCF.js.map} +0 -0
  61. /package/build/{preview-Q53FBYSD.js.map → preview-CHUIOS3O.js.map} +0 -0
  62. /package/build/{release-OL4HSPAN.js.map → release-QQKNMFX6.js.map} +0 -0
  63. /package/build/{render-command-YNU4BMZE.js.map → render-command-UUA6QUPM.js.map} +0 -0
@@ -10,7 +10,7 @@ import {
10
10
  require_react,
11
11
  useTranslation,
12
12
  z
13
- } from "./chunk-5GOQH6SN.js";
13
+ } from "./chunk-A27H6ZXE.js";
14
14
  import {
15
15
  __toESM,
16
16
  init_esm_shims
@@ -179,4 +179,4 @@ export {
179
179
  docsExtensionTypeSchema,
180
180
  getGenerateFlowByDocsExtensionType
181
181
  };
182
- //# sourceMappingURL=chunk-VEKEHQPT.js.map
182
+ //# sourceMappingURL=chunk-EZ5VASE7.js.map
@@ -4,13 +4,13 @@ import {
4
4
  componentGenerator,
5
5
  require_lodash,
6
6
  useBackendComponents
7
- } from "./chunk-67SQHC34.js";
7
+ } from "./chunk-KHDDMFXB.js";
8
8
  import {
9
9
  useTunnel
10
- } from "./chunk-RFUMAZYB.js";
10
+ } from "./chunk-Q3KFWPJE.js";
11
11
  import {
12
12
  useDebugLog
13
- } from "./chunk-WRBSQEXO.js";
13
+ } from "./chunk-OFUMAVSR.js";
14
14
  import {
15
15
  createAppManifest,
16
16
  getComponentDevSourceBuilder,
@@ -18,10 +18,10 @@ import {
18
18
  getViteConfig2,
19
19
  getViteServerUrl,
20
20
  updateAppManifestComponents
21
- } from "./chunk-JSP5PP3E.js";
21
+ } from "./chunk-CIJQD4JQ.js";
22
22
  import {
23
23
  useExtensionDataClient
24
- } from "./chunk-JRPKJWOU.js";
24
+ } from "./chunk-3RNGX7ML.js";
25
25
  import {
26
26
  APP_CONFIG_PATH,
27
27
  Alert,
@@ -83,7 +83,7 @@ import {
83
83
  wixCliAction,
84
84
  wixCliAppFlowStepsAnswers,
85
85
  z
86
- } from "./chunk-5GOQH6SN.js";
86
+ } from "./chunk-A27H6ZXE.js";
87
87
  import {
88
88
  __commonJS,
89
89
  __dirname,
@@ -29023,4 +29023,4 @@ xmlhttprequest-ssl/lib/XMLHttpRequest.js:
29023
29023
  * @license MIT
29024
29024
  *)
29025
29025
  */
29026
- //# sourceMappingURL=chunk-PG3XBIRJ.js.map
29026
+ //# sourceMappingURL=chunk-H5NUQH27.js.map
@@ -11,7 +11,7 @@ import {
11
11
  require_lib,
12
12
  writeJson,
13
13
  z
14
- } from "./chunk-5GOQH6SN.js";
14
+ } from "./chunk-A27H6ZXE.js";
15
15
  import {
16
16
  __toESM,
17
17
  init_esm_shims
@@ -351,4 +351,4 @@ export {
351
351
  getRepoType,
352
352
  createPackageManager
353
353
  };
354
- //# sourceMappingURL=chunk-PAUSYJEB.js.map
354
+ //# sourceMappingURL=chunk-I7IV53RG.js.map
@@ -15,7 +15,7 @@ import {
15
15
  useProjectModel,
16
16
  writePackageJson,
17
17
  z
18
- } from "./chunk-5GOQH6SN.js";
18
+ } from "./chunk-A27H6ZXE.js";
19
19
  import {
20
20
  __commonJS,
21
21
  __require,
@@ -9385,4 +9385,4 @@ ejs/lib/ejs.js:
9385
9385
  * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
9386
9386
  *)
9387
9387
  */
9388
- //# sourceMappingURL=chunk-67SQHC34.js.map
9388
+ //# sourceMappingURL=chunk-KHDDMFXB.js.map
@@ -2,7 +2,7 @@ import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  readAppManifestFile
5
- } from "./chunk-7BNC5HUR.js";
5
+ } from "./chunk-BBNWMF7I.js";
6
6
  import {
7
7
  ArmTagProvider,
8
8
  ExtensionDataProvider,
@@ -16,16 +16,16 @@ import {
16
16
  useResolvePlatformUrl,
17
17
  useSite,
18
18
  useSiteOverrideClient
19
- } from "./chunk-PG3XBIRJ.js";
19
+ } from "./chunk-H5NUQH27.js";
20
20
  import {
21
21
  useBackendComponents
22
- } from "./chunk-67SQHC34.js";
22
+ } from "./chunk-KHDDMFXB.js";
23
23
  import {
24
24
  getMonitoringProvider,
25
25
  updateAppManifestComponents,
26
26
  updateMonitoring,
27
27
  updateTopology
28
- } from "./chunk-JSP5PP3E.js";
28
+ } from "./chunk-CIJQD4JQ.js";
29
29
  import {
30
30
  Alert,
31
31
  BROWSER_STATICS_FOLDER,
@@ -57,7 +57,7 @@ import {
57
57
  useHttpClient,
58
58
  useProjectModel,
59
59
  useTranslation
60
- } from "./chunk-5GOQH6SN.js";
60
+ } from "./chunk-A27H6ZXE.js";
61
61
  import {
62
62
  __toESM,
63
63
  init_esm_shims
@@ -290,4 +290,4 @@ export {
290
290
  assertBuildOutputExists,
291
291
  PreviewCommand
292
292
  };
293
- //# sourceMappingURL=chunk-7MDEKB7H.js.map
293
+ //# sourceMappingURL=chunk-L626S3LH.js.map
@@ -4,7 +4,7 @@ import {
4
4
  require_index_node,
5
5
  require_react,
6
6
  require_verror
7
- } from "./chunk-5GOQH6SN.js";
7
+ } from "./chunk-A27H6ZXE.js";
8
8
  import {
9
9
  __toESM,
10
10
  init_esm_shims
@@ -99,4 +99,4 @@ export {
99
99
  DebugLogProvider,
100
100
  useDebugLog
101
101
  };
102
- //# sourceMappingURL=chunk-WRBSQEXO.js.map
102
+ //# sourceMappingURL=chunk-OFUMAVSR.js.map
@@ -18,7 +18,7 @@ import {
18
18
  usePanoramaMethodLogger,
19
19
  wixCliAppsFlowTunnelCreationStatusSrc11Evid5233,
20
20
  z
21
- } from "./chunk-5GOQH6SN.js";
21
+ } from "./chunk-A27H6ZXE.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __dirname,
@@ -900,4 +900,4 @@ init_esm_shims();
900
900
  export {
901
901
  useTunnel
902
902
  };
903
- //# sourceMappingURL=chunk-RFUMAZYB.js.map
903
+ //# sourceMappingURL=chunk-Q3KFWPJE.js.map
@@ -5,7 +5,7 @@ import {
5
5
  isCliSystemError,
6
6
  wixCliCliCommand,
7
7
  wixCliCliCommandStatus
8
- } from "./chunk-5GOQH6SN.js";
8
+ } from "./chunk-A27H6ZXE.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __toESM,
@@ -594,4 +594,4 @@ export {
594
594
  addUserFields,
595
595
  reportCommandStartEvent
596
596
  };
597
- //# sourceMappingURL=chunk-CKWBUKC5.js.map
597
+ //# sourceMappingURL=chunk-SVQO4SWK.js.map
@@ -5,7 +5,7 @@ import {
5
5
  createRendererToString,
6
6
  isCliError,
7
7
  require_react
8
- } from "./chunk-5GOQH6SN.js";
8
+ } from "./chunk-A27H6ZXE.js";
9
9
  import {
10
10
  __toESM,
11
11
  init_esm_shims
@@ -61,4 +61,4 @@ function createLogger({
61
61
  export {
62
62
  createLogger
63
63
  };
64
- //# sourceMappingURL=chunk-62IIA6VV.js.map
64
+ //# sourceMappingURL=chunk-UYYAUVCF.js.map
package/build/index.js CHANGED
@@ -3,18 +3,18 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  createI18nT,
5
5
  docsExtensionTypeSchema
6
- } from "./chunk-VEKEHQPT.js";
6
+ } from "./chunk-EZ5VASE7.js";
7
7
  import {
8
8
  runCommand
9
- } from "./chunk-NRM3ZXW7.js";
10
- import "./chunk-CKWBUKC5.js";
9
+ } from "./chunk-5M3CNYCV.js";
10
+ import "./chunk-SVQO4SWK.js";
11
11
  import "./chunk-ZHQREOZP.js";
12
- import "./chunk-WRBSQEXO.js";
12
+ import "./chunk-OFUMAVSR.js";
13
13
  import {
14
14
  package_default,
15
15
  require_react,
16
16
  z
17
- } from "./chunk-5GOQH6SN.js";
17
+ } from "./chunk-A27H6ZXE.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __require,
@@ -3377,8 +3377,8 @@ var {
3377
3377
  // src/commands/build.ts
3378
3378
  init_esm_shims();
3379
3379
  var buildCommand = (services) => createCommand("build").action(async (_, command) => {
3380
- const { runCommand: runCommand2 } = await import("./render-command-YNU4BMZE.js");
3381
- const { build } = await import("./build-G2IJISVN.js");
3380
+ const { runCommand: runCommand2 } = await import("./render-command-UUA6QUPM.js");
3381
+ const { build } = await import("./build-C33J7Y3I.js");
3382
3382
  await runCommand2(command, services, build);
3383
3383
  });
3384
3384
 
@@ -3443,8 +3443,8 @@ var devCommand = (services) => {
3443
3443
  return createCommand("dev").option("-s, --https", t("dev_command_def.option.https")).option("--port <port>", t("dev_command_def.option.port"), validatePort).addOption(
3444
3444
  new Option("--origin <url>", t("dev_command_def.option.origin")).argParser(validateBase).hideHelp()
3445
3445
  ).action(async (options, command) => {
3446
- const { DevCommand } = await import("./DevCommand-2WTVQWPB.js");
3447
- const { renderCommand } = await import("./render-command-YNU4BMZE.js");
3446
+ const { DevCommand } = await import("./DevCommand-YI2B7G5J.js");
3447
+ const { renderCommand } = await import("./render-command-UUA6QUPM.js");
3448
3448
  const { https = false, origin, port } = options;
3449
3449
  await renderCommand(
3450
3450
  command,
@@ -3483,17 +3483,17 @@ var previewCommand = (services) => {
3483
3483
  ).hideHelp()
3484
3484
  ).action(async (options, command) => {
3485
3485
  const { site, baseUrl, json } = options;
3486
- const { renderCommand, runCommand: runCommand2 } = await import("./render-command-YNU4BMZE.js");
3486
+ const { renderCommand, runCommand: runCommand2 } = await import("./render-command-UUA6QUPM.js");
3487
3487
  if (json) {
3488
3488
  return runCommand2(command, services, async (model) => {
3489
- const { nonInteractivePreview } = await import("./preview-Q53FBYSD.js");
3489
+ const { nonInteractivePreview } = await import("./preview-CHUIOS3O.js");
3490
3490
  return nonInteractivePreview(services, model, {
3491
3491
  baseUrl,
3492
3492
  siteId: site
3493
3493
  });
3494
3494
  });
3495
3495
  }
3496
- const { PreviewCommand } = await import("./PreviewCommand-42IMENU3.js");
3496
+ const { PreviewCommand } = await import("./PreviewCommand-V6BO4PKA.js");
3497
3497
  await renderCommand(
3498
3498
  command,
3499
3499
  services,
@@ -3510,8 +3510,8 @@ var addPermissionCommand = (services) => {
3510
3510
  return createCommand("add-permission").description("adding a permission to the app").addOption(
3511
3511
  new Option("-p, --permission-id <id>", t("the permission id to add"))
3512
3512
  ).action(async (options, command) => {
3513
- const { renderCommand } = await import("./render-command-YNU4BMZE.js");
3514
- const { AddPermissionCommand } = await import("./AddPermissionCommand-NFOSCZBB.js");
3513
+ const { renderCommand } = await import("./render-command-UUA6QUPM.js");
3514
+ const { AddPermissionCommand } = await import("./AddPermissionCommand-FRULGWNY.js");
3515
3515
  const { permissionId = "" } = options;
3516
3516
  await renderCommand(
3517
3517
  command,
@@ -3527,8 +3527,8 @@ var import_react4 = __toESM(require_react(), 1);
3527
3527
  var serveCommand = (services) => {
3528
3528
  const t = createI18nT();
3529
3529
  return createCommand("serve").description(t("serve_command_def.description")).action(async (_, command) => {
3530
- const { renderCommand } = await import("./render-command-YNU4BMZE.js");
3531
- const { ServeCommandDeprecated } = await import("./ServeCommand-NJ6IJ4SB.js");
3530
+ const { renderCommand } = await import("./render-command-UUA6QUPM.js");
3531
+ const { ServeCommandDeprecated } = await import("./ServeCommand-A4JHPMA7.js");
3532
3532
  await renderCommand(command, services, /* @__PURE__ */ import_react4.default.createElement(ServeCommandDeprecated, null));
3533
3533
  });
3534
3534
  };
@@ -3543,8 +3543,8 @@ var generateCommand = (services) => {
3543
3543
  t("generate_command.type_flag"),
3544
3544
  validateDocsExtensionType
3545
3545
  ).description(t("generate_command.description")).action(async (options, command) => {
3546
- const { GenerateCommand } = await import("./GenerateCommand-EKL4CDEW.js");
3547
- const { renderCommand } = await import("./render-command-YNU4BMZE.js");
3546
+ const { GenerateCommand } = await import("./GenerateCommand-H75GGH5J.js");
3547
+ const { renderCommand } = await import("./render-command-UUA6QUPM.js");
3548
3548
  const { type } = options;
3549
3549
  await renderCommand(
3550
3550
  command,
@@ -3568,8 +3568,8 @@ var logsCommand = (services) => {
3568
3568
  validateVersion
3569
3569
  ).action(async (options, command) => {
3570
3570
  const { version } = options;
3571
- const { renderCommand } = await import("./render-command-YNU4BMZE.js");
3572
- const { LogsCommand } = await import("./LogsCommand-W52WDTBH.js");
3571
+ const { renderCommand } = await import("./render-command-UUA6QUPM.js");
3572
+ const { LogsCommand } = await import("./LogsCommand-RQPS236I.js");
3573
3573
  await renderCommand(command, services, /* @__PURE__ */ import_react6.default.createElement(LogsCommand, { version }));
3574
3574
  });
3575
3575
  };
@@ -3602,8 +3602,8 @@ var releaseCommand = (services) => {
3602
3602
  t("app_preview_command_def.option.json")
3603
3603
  ).hideHelp()
3604
3604
  ).action(async (options, command) => {
3605
- const { renderCommand } = await import("./render-command-YNU4BMZE.js");
3606
- const { ReleaseCommand, ReleaseVersionType } = await import("./ReleaseCommand-2F5DH3KE.js");
3605
+ const { renderCommand } = await import("./render-command-UUA6QUPM.js");
3606
+ const { ReleaseCommand, ReleaseVersionType } = await import("./ReleaseCommand-36SQJV6H.js");
3607
3607
  const { baseUrl, site, comment, json } = options;
3608
3608
  const versionType = options.versionType ? {
3609
3609
  major: ReleaseVersionType.MAJOR,
@@ -3617,7 +3617,7 @@ var releaseCommand = (services) => {
3617
3617
  };
3618
3618
  if (json) {
3619
3619
  return runCommand(command, services, async (model) => {
3620
- const { nonInteractiveRelease } = await import("./release-OL4HSPAN.js");
3620
+ const { nonInteractiveRelease } = await import("./release-QQKNMFX6.js");
3621
3621
  return nonInteractiveRelease(services, model, props);
3622
3622
  });
3623
3623
  }
@@ -1,8 +1,8 @@
1
- import{a as _e,b as De}from"./chunk-BBFFXVJD.js";import{a as Te}from"./chunk-LX3ELJ3H.js";import"./chunk-NHYZDMR5.js";import{c as oi,d as ci}from"./chunk-7EYXEF6M.js";import{b as Me,d as Re,e as ai,f as l,g as o,h as p,i as v,j as d}from"./chunk-SBZEOPXX.js";var Ne=Me(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.EventType=void 0;var Se;(function(i){i.removeAppCompleted="removeAppCompleted",i.componentSelectionChanged="componentSelectionChanged",i.appInstalled="appInstalled",i.appUpdateCompleted="appUpdateCompleted"})(Se||(lt.EventType=Se={}))});var Lt=Me(A=>{"use strict";var li=A&&A.__createBinding||(Object.create?function(i,t,e,n){n===void 0&&(n=e);var s=Object.getOwnPropertyDescriptor(t,e);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(i,n,s)}:function(i,t,e,n){n===void 0&&(n=e),i[n]=t[e]}),pi=A&&A.__setModuleDefault||(Object.create?function(i,t){Object.defineProperty(i,"default",{enumerable:!0,value:t})}:function(i,t){i.default=t}),hi=A&&A.__importStar||function(){var i=function(t){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[n.length]=s);return n},i(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=i(t),s=0;s<n.length;s++)n[s]!=="default"&&li(e,t,n[s]);return pi(e,t),e}}();Object.defineProperty(A,"__esModule",{value:!0});A.EventType=A.WixSDKTypes=void 0;var di=hi((ci(),ai(oi)));A.WixSDKTypes=di;var ui=Ne();Object.defineProperty(A,"EventType",{enumerable:!0,get:function(){return ui.EventType}})});var V=Re(Lt(),1);var S=class S{constructor(){l(this,"uid",0);l(this,"callbacks",new Map);l(this,"inTransaction",!1);l(this,"isSilent",!1);l(this,"queue",[])}silent(t=!0){this.isSilent=t}startTransaction(){this.inTransaction=!0}commit(){this.inTransaction=!1;let t=this.queue;this.queue=[],this.isSilent||t.forEach(e=>{this.notify(e)})}notify(t){this.isSilent||(this.inTransaction?this.queue.push(t):this.callbacks.forEach(e=>{e(t)}))}subscribe(t){let e=this.uid++;return this.callbacks.set(e,t),()=>{this.callbacks.delete(e)}}notifyWithStep(t,e){this.notify({...t,meta:{...t.meta,step:e}})}async withEvent(t,e){let n=e();if(n&&n.hasOwnProperty("then"))try{return this.notifyWithStep(t,S.EventSteps.Start),n=await n,this.notifyWithStep(t,S.EventSteps.End),n}catch(s){throw this.notifyWithStep({...t,meta:{...t.meta,error:s}},S.EventSteps.Error),s}else return this.notify(t),n}};l(S,"biEvents",{PLATFORM_WORKER_SPAWN:123,PLATFORM_APP_RUNNER_INIT_APP_API:124,PLATFORM_APP_RUNNER_RUN_APP:125,PLATFORM_APP_RUNNER_REMOVE_APP:126,PLATFORM_WORKER_APP_BUNDLE_LOAD:127,PLATFORM_WORKER_APP_BUNDLE_EXECUTE:128,PLATFORM_IFRAME_INIT:129,PLATFORM_APP_API_INIT:130,PLATFORM_APP_API_GET:131}),l(S,"EventSteps",{Start:"start",End:"end",Error:"error"});var Ft=S,ht=(i=>(i.WorkerSpawn="WorkerSpawn",i.HostEvent="HostEvent",i.ApplicationsSpecsReceived="ApplicationsSpecsReceived",i.InitApplicationApi="InitApplicationApi",i.RunApplication="RunApplication",i.getApplicationApi="getApplicationApi",i.IframeInit="IframeInit",i))(ht||{}),jt=(i=>(i.EditorReady="EditorReady",i))(jt||{});var b=(i=>(i.ApplicationInit="ApplicationInit",i.ApplicationExecute="ApplicationExecute",i.ApplicationRemoved="ApplicationRemoved",i.ApplicationLoad="ApplicationLoad",i.ApplicationApiInit="ApplicationApiInit",i.CustomEvent="CustomEvent",i.HostEvent="HostEvent",i.EditorReady="EditorReady",i))(b||{}),Ut=class{createApplicationRemovedEvent(t){return{type:"ApplicationRemoved",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_SPAWN,appDefId:t}}}}createApplicationLoadEvent(t,e){return{type:"ApplicationLoad",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_LOAD,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationExecuteEvent(t,e){return{type:"ApplicationExecute",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_EXECUTE,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationApiInitEvent(t,e){return{type:"ApplicationApiInit",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_APP_API_INIT,appDefId:t,scope:e}}}}},E=class extends Ft{constructor(){super(...arguments);l(this,"factories",new Ut)}},pt=class pt{constructor(t){this.events=t}mapToPlatformHostEvent(t){if(typeof t=="string")try{t=JSON.parse(t)}catch{}return{type:ht.HostEvent,payload:{type:t.args.eventType,...t.args.eventPayload},meta:{appDefinitionId:t.appDefinitionId??null,intent:t.intent}}}notify(t){let e=this.mapToPlatformHostEvent(t);pt.allowedEvents.includes(e.payload.type)&&this.events.notify(e)}};l(pt,"allowedEvents",[V.EventType.componentSelectionChanged,V.EventType.appInstalled,V.EventType.appUpdateCompleted,V.EventType.removeAppCompleted]);var Oe=pt;var I=class i extends Error{constructor(e,n,s){let r=e?` ${e}`:"",a=`[${s}]#${n}`;super(`${a}.${r}`);l(this,"state",{});l(this,"displayName");l(this,"prefix");l(this,"errorMessage");l(this,"parent");l(this,"messages",[]);l(this,"code");this.displayName=a,this.errorMessage=e,this.prefix=s,this.code=n,this.name=a,Object.defineProperty(this,"message",{get:()=>this.getDisplayMessage()}),Error.captureStackTrace&&Error.captureStackTrace(this,i)}get parentError(){let e=this.parent;if(!e)return null;if(this.parent instanceof i)return this.parent;let n=e.name??"[Unknown Error]";return{getBreadcrumbs(){return[n]},getMessage(){return[n,e.message??"unknown error message"].join(`
1
+ import{a as Ne,b as Oe}from"./chunk-BBFFXVJD.js";import{a as Se}from"./chunk-LX3ELJ3H.js";import"./chunk-NHYZDMR5.js";import{c as pi,d as hi}from"./chunk-7EYXEF6M.js";import{b as _e,d as De,e as li,f as l,g as o,h,i as A,j as u}from"./chunk-SBZEOPXX.js";var Le=_e(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.EventType=void 0;var ke;(function(i){i.removeAppCompleted="removeAppCompleted",i.componentSelectionChanged="componentSelectionChanged",i.appInstalled="appInstalled",i.appUpdateCompleted="appUpdateCompleted"})(ke||(pt.EventType=ke={}))});var Ut=_e(w=>{"use strict";var di=w&&w.__createBinding||(Object.create?function(i,t,e,n){n===void 0&&(n=e);var s=Object.getOwnPropertyDescriptor(t,e);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(i,n,s)}:function(i,t,e,n){n===void 0&&(n=e),i[n]=t[e]}),ui=w&&w.__setModuleDefault||(Object.create?function(i,t){Object.defineProperty(i,"default",{enumerable:!0,value:t})}:function(i,t){i.default=t}),Pi=w&&w.__importStar||function(){var i=function(t){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[n.length]=s);return n},i(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=i(t),s=0;s<n.length;s++)n[s]!=="default"&&di(e,t,n[s]);return ui(e,t),e}}();Object.defineProperty(w,"__esModule",{value:!0});w.EventType=w.WixSDKTypes=void 0;var fi=Pi((hi(),li(pi)));w.WixSDKTypes=fi;var gi=Le();Object.defineProperty(w,"EventType",{enumerable:!0,get:function(){return gi.EventType}})});var V=De(Ut(),1);var S=class S{constructor(){l(this,"uid",0);l(this,"callbacks",new Map);l(this,"inTransaction",!1);l(this,"isSilent",!1);l(this,"queue",[])}silent(t=!0){this.isSilent=t}startTransaction(){this.inTransaction=!0}commit(){this.inTransaction=!1;let t=this.queue;this.queue=[],this.isSilent||t.forEach(e=>{this.notify(e)})}notify(t){this.isSilent||(this.inTransaction?this.queue.push(t):this.callbacks.forEach(e=>{e(t)}))}subscribe(t){let e=this.uid++;return this.callbacks.set(e,t),()=>{this.callbacks.delete(e)}}notifyWithStep(t,e){this.notify({...t,meta:{...t.meta,step:e}})}async withEvent(t,e){let n=e();if(n&&n.hasOwnProperty("then"))try{return this.notifyWithStep(t,S.EventSteps.Start),n=await n,this.notifyWithStep(t,S.EventSteps.End),n}catch(s){throw this.notifyWithStep({...t,meta:{...t.meta,error:s}},S.EventSteps.Error),s}else return this.notify(t),n}};l(S,"biEvents",{PLATFORM_WORKER_SPAWN:123,PLATFORM_APP_RUNNER_INIT_APP_API:124,PLATFORM_APP_RUNNER_RUN_APP:125,PLATFORM_APP_RUNNER_REMOVE_APP:126,PLATFORM_WORKER_APP_BUNDLE_LOAD:127,PLATFORM_WORKER_APP_BUNDLE_EXECUTE:128,PLATFORM_IFRAME_INIT:129,PLATFORM_APP_API_INIT:130,PLATFORM_APP_API_GET:131}),l(S,"EventSteps",{Start:"start",End:"end",Error:"error"});var jt=S,dt=(i=>(i.WorkerSpawn="WorkerSpawn",i.HostEvent="HostEvent",i.ApplicationsSpecsReceived="ApplicationsSpecsReceived",i.InitApplicationApi="InitApplicationApi",i.RunApplication="RunApplication",i.getApplicationApi="getApplicationApi",i.IframeInit="IframeInit",i))(dt||{}),Wt=(i=>(i.EditorReady="EditorReady",i))(Wt||{});var b=(i=>(i.ApplicationInit="ApplicationInit",i.ApplicationExecute="ApplicationExecute",i.ApplicationRemoved="ApplicationRemoved",i.ApplicationLoad="ApplicationLoad",i.ApplicationApiInit="ApplicationApiInit",i.CustomEvent="CustomEvent",i.HostEvent="HostEvent",i.EditorReady="EditorReady",i))(b||{}),$t=class{createApplicationRemovedEvent(t){return{type:"ApplicationRemoved",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_SPAWN,appDefId:t}}}}createApplicationLoadEvent(t,e){return{type:"ApplicationLoad",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_LOAD,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationExecuteEvent(t,e){return{type:"ApplicationExecute",payload:{appDefinitionId:t.appDefinitionId,url:e},meta:{bi:{evid:E.biEvents.PLATFORM_WORKER_APP_BUNDLE_EXECUTE,appDefId:t.appDefinitionId,appType:t.appType,bundleUrl:e}}}}createApplicationApiInitEvent(t,e){return{type:"ApplicationApiInit",payload:{appDefinitionId:t},meta:{bi:{evid:E.biEvents.PLATFORM_APP_API_INIT,appDefId:t,scope:e}}}}},E=class extends jt{constructor(){super(...arguments);l(this,"factories",new $t)}},ht=class ht{constructor(t){this.events=t}mapToPlatformHostEvent(t){if(typeof t=="string")try{t=JSON.parse(t)}catch{}return{type:dt.HostEvent,payload:{type:t.args.eventType,...t.args.eventPayload},meta:{appDefinitionId:t.appDefinitionId??null,intent:t.intent}}}notify(t){let e=this.mapToPlatformHostEvent(t);ht.allowedEvents.includes(e.payload.type)&&this.events.notify(e)}};l(ht,"allowedEvents",[V.EventType.componentSelectionChanged,V.EventType.appInstalled,V.EventType.appUpdateCompleted,V.EventType.removeAppCompleted]);var Fe=ht;var I=class i extends Error{constructor(e,n,s){let r=e?` ${e}`:"",a=`[${s}]#${n}`;super(`${a}.${r}`);l(this,"state",{});l(this,"displayName");l(this,"prefix");l(this,"errorMessage");l(this,"parent");l(this,"messages",[]);l(this,"code");this.displayName=a,this.errorMessage=e,this.prefix=s,this.code=n,this.name=a,Object.defineProperty(this,"message",{get:()=>this.getDisplayMessage()}),Error.captureStackTrace&&Error.captureStackTrace(this,i)}get parentError(){let e=this.parent;if(!e)return null;if(this.parent instanceof i)return this.parent;let n=e.name??"[Unknown Error]";return{getBreadcrumbs(){return[n]},getMessage(){return[n,e.message??"unknown error message"].join(`
2
2
  `)}}}getDisplayMessage(){return[(this.parentError?this.getBreadcrumbs():[]).join(" -> "),this.getMessage()].filter(n=>n.trim().length).join(`
3
- `)}getMessage(){let e=Object.entries(this.state).reduce((c,[h,u])=>(u&&c.push(` \u2013 ${h}: ${u}`),c),[]).join(`
4
- `),n=this.messages.reduce((c,h)=>(c.push(` - ${h.join(" ")}`),c),[]).join(`
3
+ `)}getMessage(){let e=Object.entries(this.state).reduce((c,[p,d])=>(d&&c.push(` \u2013 ${p}: ${d}`),c),[]).join(`
4
+ `),n=this.messages.reduce((c,p)=>(c.push(` - ${p.join(" ")}`),c),[]).join(`
5
5
  `),s=this.parentError,r=s?["",s.getMessage(),""].join(`
6
6
  `):"",a=this.errorMessage?`${this.displayName}: ${this.errorMessage}`:this.displayName;return[r,a,e,n].filter(c=>c.trim().length).join(`
7
- `)}getBreadcrumbs(){let e=this.parentError;return e?[...e.getBreadcrumbs(),this.displayName]:[this.displayName]}withParentError(e){return this.parent=e,this}withMessage(...e){return this.messages.push(e),this}};function w(i){return function t(e,n=""){let s=new i(n,e);return Error.captureStackTrace&&Error.captureStackTrace(s,t),s}}var $t=class extends I{constructor(e,n){super(e,n,"Editor Platform Internal Error");l(this,"state",{})}withHost(e){return this.state={...this.state,host:e},this}},Pi=w($t);var $=(i=>(i.IncorrectEnvironment="IncorrectEnvironment",i))($||{}),qt=class extends I{constructor(e,n){super(e,n,"EP Context Error");l(this,"state",{})}withUrl(e){return this.state={...this.state,url:e},this}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}},Y=w(qt);async function fi(i,t){if(!i?.type)return i;switch(i.type){case"componentSelectionChanged":let e=i.componentRefs||[],n=await Promise.all(e.map(s=>t.components.getComponent(s)));return{type:i.type,components:n};default:return i}}var Bt=class{constructor(t,e,n){l(this,"events");l(this,"subscribe");l(this,"commit");l(this,"startTransaction");l(this,"silent");this.appDefinitionId=t,this.privateAPI=n,this.events=e,this.subscribe=e.subscribe.bind(e),this.commit=e.commit.bind(e),this.startTransaction=e.startTransaction.bind(e),this.silent=e.silent.bind(e)}notify(t){this.events.notify({type:t.type,payload:t.payload,meta:{appDefinitionId:this.appDefinitionId}})}notifyCustomEvent(t,e){this.notify({type:b.CustomEvent,payload:{...e,type:t}})}addEventListener(t,e){return this.events.subscribe(async n=>{let s=n.meta?.appDefinitionId===this.appDefinitionId||n.meta?.appDefinitionId===null,r=()=>fi(n.payload,this.privateAPI);t==="*"?e(await r()):n.type===b.CustomEvent?t===n.payload?.type&&!s&&e(await r()):n.type===b.HostEvent&&t===n.payload?.type&&s&&e(await r())})}},gi=200,mi=50,O,Kt,ke,dt=class{constructor(t){p(this,O);l(this,"injectionUUID");l(this,"injectionUUID_Deprecated");this.injectionUUID_Deprecated=`__${t}_CONTEXT_INJECTION_STATUS_KEY`,this.injectionUUID=`__${t}_CONTEXT_INJECTION_STATUS_KEY#0.1`,d(this,O,Kt).call(this)||d(this,O,ke).call(this)}resolveInjected(){globalThis[this.injectionUUID]?.resolve()}waitInjected(){return new Promise((t,e)=>{let n=!1,s,r=0,a=()=>{n||(s=setTimeout(()=>{if(r++,r<mi){r%10===0&&console.log(Y($.IncorrectEnvironment,"contexts are not resolved, still re-trying").withMessage(`try number ${r}`).message),a();return}if(!n){let c=Y($.IncorrectEnvironment,"contexts are not resolved, threw by timeout");e(c)}},gi))};a(),d(this,O,Kt).call(this)?.then(()=>{n=!0,clearTimeout(s),t()})})}};O=new WeakSet,Kt=function(){return globalThis[this.injectionUUID]?.promise},ke=function(){let t,e=new Promise(n=>{t=n});globalThis[this.injectionUUID]={promise:e,resolve:t},globalThis[this.injectionUUID_Deprecated]=new Promise(n=>{e.then(n)})};var Wt="__ENVIRONMENT_CONTEXT_KEY",ft=(i=>(i.Worker="Worker",i.Frame="Frame",i.ComponentPanel="ComponentPanel",i))(ft||{}),ut=class ut{constructor(t){this.environmentContext=t}static async inject(t){if(globalThis[Wt])throw Y($.IncorrectEnvironment,"Environment context already exists and should not be overridden");globalThis[Wt]=new ut(t),this.status.resolveInjected()}static async getInstance(){return await this.status.waitInjected(),globalThis[Wt]}getPrivateAPI(){return this.environmentContext.privateApi}getEvents(){return this.environmentContext.events}getApplicationAPIs(){return this.environmentContext.applicationAPIs??{}}getEnvironment(){return this.environmentContext.environment}};l(ut,"status",new dt("environment"));var N=ut,J="__APPLICATION_CONTEXT_KEY",Pt=class Pt{constructor(t,e){l(this,"events");this.context=t,this.environment=e,this.events=new Bt(t.appDefinitionId?t.appDefinitionId:null,this.environment.getEvents(),this.environment.getPrivateAPI())}static async inject(t){if(globalThis[J])throw Y($.IncorrectEnvironment,"Application context already exists and should not be overridden");globalThis[J]=new Pt(t,await N.getInstance()),this.status.resolveInjected()}static async getInstance(){return typeof __APPLICATION_CONTEXT_KEY<"u"?__APPLICATION_CONTEXT_KEY:(await this.status.waitInjected(),globalThis[J])}getContext(){return this.context}getAppDefinitionId(){return this.context.appDefinitionId}getManifestContextId(){return this.context.manifestContextId}getEvents(){return this.events}getEnvironmentContext(){return this.environment}getPrivateAPI(){return this.environment.getPrivateAPI()}getPrivateApplicationAPI(){let t=this.getAppDefinitionId();if(!t)throw Y($.IncorrectEnvironment,"appDefinitionId is not available");return this.environment.getApplicationAPIs()[t]}};l(Pt,"status",new dt("application"));var y=Pt;var He=Re(Lt());var tt=i=>`"editor-platform-transport": ${i}`,Ue=i=>tt(`[Internal Error] ${i}`),je="\u0192",$e="\u2202",We="_get_",qe="_set_",gt="+",Le="-",Qt="\xB7",Zt="\xD7",te="\xB0",Be=i=>i[0]===Zt?"":i,Fe=i=>i===null||typeof i>"u"||typeof i=="symbol"||typeof i=="number"||typeof i=="boolean"||typeof i=="function"||typeof i=="string",Ii=i=>!!i&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof Set)&&!(i instanceof Map),Ai=i=>W(i.split(Qt)),W=i=>i.map(Be).filter(Boolean).join(".");function xt(i,t){return{marker:i,...t}}var wi=xt("A",{shouldUse:i=>Array.isArray(i),serialize:(i,t)=>{i.length?i.forEach((e,n)=>{t(`${n}`,e)}):t("",te)},deserialize:{create:()=>[],has:(i,t)=>!(typeof i[t]>"u"),append:(i,t,e)=>{i.push(e)}}}),yi=xt("M",{shouldUse:i=>i instanceof Map,serialize:(i,t)=>{i.forEach((e,n)=>{t(n,e)})},deserialize:{create:()=>new Map,has:(i,t)=>i.has(t),append:(i,t,e)=>{i.set(t,e)}}}),vi=xt("S",{shouldUse:i=>i instanceof Set,serialize:(i,t)=>{let e=0;i.forEach(n=>{t(`${e++}`,n)})},deserialize:{create:()=>new Set,has:(i,t)=>i.has(t),append:(i,t,e)=>{i.add(e)}}}),Gt=xt("O",{shouldUse:i=>typeof i=="object",serialize:(i,t)=>{let e=n=>{let r=Reflect.ownKeys(n).filter(c=>c!=="constructor").filter(c=>typeof c!="symbol");r.length?r.filter(c=>c!=="constructor").filter(c=>typeof c!="symbol").forEach(c=>{let h=Reflect.get(i,c);t(c,h)}):t("",te);let a=Reflect.getPrototypeOf(n);!a||a?.hasOwnProperty("__proto__")||e(a)};e(i)},deserialize:{create:()=>({}),has:(i,t)=>!!i[t],append:(i,t,e)=>{i[t]=e}}}),Ke=[wi,vi,yi];function bi(i,t){let e=i;for(;e;){let n=Object.getOwnPropertyDescriptor(e,t);if(n)return n;e=Reflect.getPrototypeOf(e)}return null}function Ei(i,t){let e=new WeakMap,n=r=>{let a=r.slice(1).map(Be).filter(Boolean);return a.slice(1).reduce((c,h)=>({context:c.context[c.pointer],pointer:h}),{context:i,pointer:a[0]})},s=(r,a=[])=>{if(e.has(r)&&e.get(r)?.some(u=>a.join(".").startsWith(u))){t(a,{...n(a),value:"[Circular]"});return}if(r&&!Fe(r)&&(e.has(r)&&e.set(r,[]),e.set(r,[...e.get(r)??[],a.join(".")])),Fe(r)){t(a,{...n(a),value:r});return}let c=Ke.find(h=>h.shouldUse(r))??Gt;if(c){c.serialize(r,(h,u)=>{s(u,[...a,`${Zt}${c.marker}`,h])});return}};return s(i)}var Ci=(i,t)=>{if(!Ii(i))throw new Error(tt("only objects are serializable at the root level"));let e={data:[]},n=(r,a)=>{e.data.push([r,a])},s=(r,a)=>{t(Ai(r),(...c)=>a.context[a.pointer](...c)),n(r,je)};return Ei(i,(r,{value:a,context:c,pointer:h})=>{let u=r.slice(1).join(Qt),P=bi(c,h);if(P?.get||P?.set){P?.get&&t(W([...r,We]),()=>c[h]),P?.set&&t(W([...r,qe]),G=>{c[h]=G});let D=[P?.get?gt:Le,P?.set?gt:Le];n(u,`${$e}${D.join("")}`)}else typeof a=="function"?s(u,{context:c,pointer:h}):n(u,a)}),e},xi=(i,t)=>typeof i!="object"||i===null?i:i.data.reduce((e,[n,s])=>{let r=e,a=n.split(Qt),c=Gt,h=null;for(let u=0;u<a.length;u++){let P=a[u];if(P[0]===Zt){let D=c.deserialize.has(r,h);if(c=[Gt,...Ke].find(G=>G.marker===P[1]),!c)throw new Error(tt(`unknown marker "${P[1]}"`));D||(r[h]=c.deserialize.create()),r=r[h]}else h=P}if(s?.toString()===te)return e;if(s?.toString()===je)c.deserialize.append(r,h,t(W(a)));else if(s?.toString()[0]===$e){let u=s?.toString()[1]===gt,P=s?.toString()[2]===gt,D={};if(u){let G=t(W([...a,We]));D.get=()=>G()}P&&(D.set=t(W([...a,qe]))),Object.defineProperty(r,h,D)}else c.deserialize.append(r,h,s);return e},{[Symbol("transferred object")]:`${(JSON.stringify(i.data).length/1024).toFixed(2)}Kb`});function ze(){let i=globalThis.performance;if(i&&i.now)return i.now();let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length,s=0,r=10;for(;s<r;)t+=e.charAt(Math.floor(Math.random()*n)),s+=1;return t}var X=(i=>(i.ExposeAPI="ExposeAPI",i.Call="Call",i.Response="Response",i.Cleanup="Cleanup",i))(X||{}),R=class i{constructor(t,e){l(this,"correlationId",`M-${ze()}`);l(this,"parentCorrelationId");this.type=t,this.payload=e}withParentCorrelationId(t){return this.parentCorrelationId=t,this}serialize(t){return JSON.stringify({parentCorrelationId:this.parentCorrelationId,correlationId:this.correlationId,type:this.type,payload:Ci(this.payload,(e,n)=>{t(this.correlationId,e,n)})})}static fromEvent(t,e){let n=JSON.parse(t);return new i(n.type,xi(n.payload,s=>e(n.correlationId,s))).withParentCorrelationId(n.correlationId)}},Vt=class extends R{constructor(t){super("Cleanup",t)}},Jt=class extends R{constructor(t){super("Response",t)}},mt=class extends R{constructor(t){super("Response",t)}},Yt=class extends R{constructor(t){super("Call",t)}},zt=(i,t)=>`${i}_${t}`,bt,Et,q,C,Ht=class{constructor(t){p(this,bt,new FinalizationRegistry(t=>{this.postMessage(new Vt(t))}));p(this,Et,{[X.Cleanup]:t=>{let e=t.payload.functionMarkerKey,n=t.payload.callId;delete o(this,q)[e],n&&delete o(this,C)[n]},[X.Response]:async t=>{let e=t.payload.callId,n=t.payload.errorMessage;if(n)if(t.payload.errorStack){let r=new Error(n);r.stack=t.payload.errorStack,o(this,C)[e]?.reject(r)}else o(this,C)[e]?.reject(n);else{let s=t.payload.response;o(this,C)[e]?.resolve(s)}delete o(this,C)[e]},[X.Call]:async t=>{let e=t.payload.functionMarkerKey,n=o(this,q)[e];if(!n){this.postMessage(new mt({callId:t.payload.callId,errorMessage:tt("function is not available")}));return}try{let s=await n.value(...t.payload.props??[]);this.postMessage(new Jt({callId:t.payload.callId,response:s}))}catch(s){this.postMessage(new mt({callId:t.payload.callId,errorMessage:s.message,errorStack:s.stack}))}}});p(this,q,{});p(this,C,{});l(this,"queue",[]);this.port=t,this.port.onmessage=e=>{this.onMessage(e)}}onMessage(t){let e=R.fromEvent(t.data,(n,s)=>{let r=this.replaceTransferredFunction(n,s);return o(this,bt).register(r,{functionMarkerKey:zt(n,s)}),r});o(this,Et)[e.type]?.(e),this.messageEvents[e.type]?.(e)}postMessage(t){this.port.postMessage(t.serialize(this.registerTransferredFunction.bind(this)))}registerTransferredFunction(t,e,n){let s=zt(t,e);o(this,q)[s]={path:e,value:n}}replaceTransferredFunction(t,e){return(...n)=>{let s=`CALL-${crypto.randomUUID()}`;return this.postMessage(new Yt({callId:s,functionMarkerKey:zt(t,e),props:n})),new Promise((r,a)=>{o(this,C)[s]={resolve:r,reject:a}})}}flush(){this.queue.forEach(t=>{this.postMessage(t)}),this.queue=[]}};bt=new WeakMap,Et=new WeakMap,q=new WeakMap,C=new WeakMap;var It=class extends Ht{constructor(){super(...arguments);l(this,"messageEvents",{})}expose(e){if(!e.type)throw new Error(tt('wrong exposed API instance, "type" property is required'));this.queue.push(new R(X.ExposeAPI,e)),this.flush()}};var H=(i=>(i.Ping="EDITOR_PLATFORM_TRANSPORT_EVENT:__Ping",i.RequestPort="EDITOR_PLATFORM_TRANSPORT_EVENT:__RequestPort",i.Pong="EDITOR_PLATFORM_TRANSPORT_EVENT:__Pong",i.Port="EDITOR_PLATFORM_TRANSPORT_EVENT:__Port",i))(H||{});var B,M,Ct,Ge,Xt=class{constructor(t,e){p(this,Ct);p(this,B,new Set);p(this,M);this.postMessage=t,this.onMessage=e}setActivePort(t){this.dispose(),v(this,M,t),d(this,Ct,Ge).call(this)}dispose(){o(this,M)&&(o(this,M).close(),o(this,M).onmessage=null)}onHandshake(t){return o(this,B).add(t),()=>{o(this,B).delete(t)}}};B=new WeakMap,M=new WeakMap,Ct=new WeakSet,Ge=function(){let t=o(this,M);if(!t){console.warn(Ue("port is required no notify onHandshake listeners"));return}o(this,B).forEach(e=>e(t))};var Q,Z,T,Ve,Je,Ye,At=class extends Xt{constructor(e,n){super(e,n);p(this,T);p(this,Q,!1);p(this,Z,`consumer-${ze()}`);d(this,T,Ve).call(this);let s={type:H.Ping};e(JSON.stringify(s))}};Q=new WeakMap,Z=new WeakMap,T=new WeakSet,Ve=function(){this.onMessage(e=>{try{let n=JSON.parse(e.data);switch(n.type){case H.Pong:{d(this,T,Je).call(this);break}case H.Port:{d(this,T,Ye).call(this,n.targetMemberId,e.ports?.[0]);break}}}catch{}})},Je=function(){if(o(this,Q))return;v(this,Q,!0);let e={type:H.RequestPort,memberId:o(this,Z)};this.postMessage(JSON.stringify(e))},Ye=function(e,n){if(e===o(this,Z)){if(!n)throw new Error(Ue("no port at consumer handshake"));this.setActivePort(n)}};var wt=class{get onConnect(){return this.handshake.onHandshake.bind(this.handshake)}},yt=class i extends wt{constructor(){super(...arguments);l(this,"handshake",new At(e=>{globalThis.parent.postMessage(e,"*")},e=>{globalThis.addEventListener("message",e)}))}static exposeAPI(e){new i().onConnect(s=>{new It(s).expose(e)})}};var vt=class i extends wt{constructor(){super(...arguments);l(this,"handshake",new At(e=>{globalThis.postMessage(e)},e=>{globalThis.addEventListener("message",e)}))}static exposeAPI(e){new i().onConnect(s=>{new It(s).expose(e)})}};var Mt=class{constructor(t){this.platformAppEvents=t}notify(t){switch(t.type){case jt.EditorReady:this.platformAppEvents.notify({...t,type:b.EditorReady});break;case ht.HostEvent:this.platformAppEvents.notify({...t,type:b.HostEvent});break}}subscribe(t){this.platformAppEvents.subscribe(e=>{t(e)})}},oe=(i=>(i.Frame="PLATFORM_FRAME_API",i.Worker="PLATFORM_WORKER_API",i))(oe||{}),Rt=class{constructor(t,e){this.type=t,this.envType=e}async injectEnvironmentContext({events:t,privateApi:e}){await N.inject({environment:this.envType,events:t,privateApi:e,applicationAPIs:{}})}async injectApplicationContext(t){await y.inject(t)}},Mi={classic:"https://www.unpkg.com/@wix/design-system/dist/statics/tokens-default.global.css",studio:"https://www.unpkg.com/@wix/design-system/dist/statics/tokens-studio.global.css"},et,it,_t,nt,Dt,Xe,ie=class extends Rt{constructor(){super(oe.Frame,ft.Frame);p(this,Dt);p(this,et,new E);p(this,it,new Mt(o(this,et)));p(this,_t);p(this,nt);d(this,Dt,Xe).call(this)}async initEnvironment(e){let{applicationPrivateAPI:n,privateAPI:s,context:r}=e,a=e.context?.appDefinitionId??e.appDefinitionId,c=e.context?e.context:{appDefinitionId:a};v(this,nt,n),v(this,_t,s),await this.injectEnvironmentContext({privateApi:s,events:o(this,et),applicationAPIs:a?{[a]:o(this,nt)}:{}}),await this.injectApplicationContext(c)}notify(e){o(this,it).notify(e)}subscribe(e){o(this,it).subscribe(e)}};et=new WeakMap,it=new WeakMap,_t=new WeakMap,nt=new WeakMap,Dt=new WeakSet,Xe=function(){if(typeof globalThis?.document?.head?.prepend=="function"){let n=new URL(globalThis.location.href).searchParams.get("editorType")==="CLASSIC"?"classic":"studio",s=Mi[n],r=s&&!!document.querySelectorAll(`link[type="text/css"][href="${s}"]`)?.length;if(s&&!r){let a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",s),globalThis.document.head.prepend(a)}}};var _=(i=>(i.ApplicationLoadError="ApplicationLoadError",i.ApplicationFetchError="ApplicationFetchError",i.ApplicationExecuteError="ApplicationExecuteError",i))(_||{}),ne=class extends I{constructor(e,n){super(e,n,"EP Application Container Error");l(this,"state",{})}withUrl(e){return this.state={...this.state,url:e},this}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}withApiMethod(e){return this.state={...this.state,apiMethod:e},this}withApiType(e){return this.state={...this.state,apiType:e},this}},k=w(ne),Ri="__APPLICATION_REGISTRY_KEY";async function Ti(i,t,e){let n=new Function(J,Ri,e),s,r=a=>{if(s)throw k(_.ApplicationExecuteError,"Application registry called more than once").withAppDefinitionId(t.appDefinitionId);if(a.type!==t.type)throw k(_.ApplicationExecuteError,"Application has different type").withMessage("expected type",t.type).withMessage("received type",a.type);s=a};try{let a={...t};n.call(null,new y(a,await N.getInstance()),r)}catch(a){throw k(_.ApplicationExecuteError,a.message).withAppDefinitionId(t.appDefinitionId).withParentError(a)}return new Promise((a,c)=>{let h=i.subscribe(u=>{let P=setTimeout(()=>{clearTimeout(P),h(),s||c(k(_.ApplicationExecuteError,"Application registry was not called, threw by timeout").withAppDefinitionId(t.appDefinitionId))},5e3);u.type===b.ApplicationInit&&u.meta.appDefinitionId===t.appDefinitionId&&(clearTimeout(P),h(),s||c(k(_.ApplicationExecuteError,"Application registry was not called").withAppDefinitionId(t.appDefinitionId)),a({instance:s}))})})}var L,st,m,se=class{constructor(t,e){p(this,L,{});p(this,st);p(this,m);v(this,st,t),v(this,m,e),o(this,m).subscribe(n=>{switch(n.type){case b.HostEvent:{n.payload.type===He.EventType.removeAppCompleted&&o(this,m).withEvent(o(this,m).factories.createApplicationRemovedEvent(n.payload.appDefinitionId),()=>this.removeApplication(n.payload.appDefinitionId));break}}})}async runApplication(t){let e=await this.loadApplication(t),n=await this.executeApplication(t,e);return this.setApplication(t.appDefinitionId,n),n}setApplication(t,e){o(this,L)[t]=e,o(this,m).withEvent(o(this,m).factories.createApplicationApiInitEvent(t,e?.api?.private?"private":"public"),()=>{o(this,st).applicationManager.setApplication(e)})}getApplication(t){return o(this,L)[t]}getAppDefinitionIds(){return Object.keys(o(this,L))}removeApplication(t){delete o(this,L)[t]}async loadApplication(t){let e=t.url;return o(this,m).withEvent(o(this,m).factories.createApplicationLoadEvent(t,e),async()=>{try{return await this.loadApplicationBundle(e)}catch(n){throw k(_.ApplicationLoadError).withUrl(e).withAppDefinitionId(t.appDefinitionId).withParentError(n)}})}async loadApplicationBundle(t){let e=await fetch(t,{method:"GET"});if(!(e.status>=200&&e.status<=299))throw k(_.ApplicationFetchError).withUrl(t);return e.text()}async executeApplication(t,e){return o(this,m).withEvent(o(this,m).factories.createApplicationExecuteEvent(t,t.url),async()=>{let{instance:n}=await Ti(o(this,m),t,e);return n})}};L=new WeakMap,st=new WeakMap,m=new WeakMap;var K,rt,at,F,ot,re=class extends Rt{constructor(){super(oe.Worker,ft.Worker);p(this,K,new E);p(this,rt,new Mt(o(this,K)));p(this,at,null);p(this,F);p(this,ot,[])}create(){}async initEnvironment(e){let{buildPrivateAPI:n}=e;v(this,F,await n({type:"EDITOR_ADDON"})),await this.injectEnvironmentContext({events:o(this,K),privateApi:o(this,F),applicationAPIs:{}}),v(this,at,new se(o(this,F),o(this,K))),o(this,ot).forEach(s=>s(this))}async notify(e){await this.waitReady(),o(this,rt).notify(e)}subscribe(e){o(this,rt).subscribe(e)}async runApplication(e){await this.waitReady(),await o(this,at).runApplication(e)}waitReady(){return new Promise(e=>{if(o(this,F))return e(this);o(this,ot).push(e)})}};K=new WeakMap,rt=new WeakMap,at=new WeakMap,F=new WeakMap,ot=new WeakMap;var ee="$_EP_TRANSPORT_ENV_CONTEXT_GUARD",z,Qe,Ze,Tt=class{constructor(){p(this,z)}isEnvironmentApiExposed(){return!!globalThis[ee]}async getContexts(){let[t,e]=await Promise.all([N.getInstance(),y.getInstance()]);return{environmentContext:t,applicationContext:e}}expose(){if(this.isEnvironmentApiExposed())return;let t=typeof importScripts=="function",e=globalThis.self&&globalThis.top&&globalThis.self!==globalThis.top;t?(d(this,z,Qe).call(this),globalThis[ee]=!0):e&&(d(this,z,Ze).call(this),globalThis[ee]=!0)}};z=new WeakSet,Qe=function(){vt.exposeAPI(new re)},Ze=function(){yt.exposeAPI(new ie)};var ae=class extends I{constructor(e,n){super(e,n,"EP EnvironmentAPI Error");l(this,"state",{})}withUrl(e){return this.state={...this.state,url:e},this}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}},hn=w(ae);new Tt().expose();var ce=class extends I{constructor(e,n){super(e,n,"Auth Strategy Error");l(this,"state",{})}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}},ti=w(ce);function _i(i,t){let e=Date.now(),n=i?new Date(i).getTime():null;return n&&n-e>t}var Di=30*60*1e3,Si=()=>{let i;return{getAuthHeaders:async()=>{let t=await y.getInstance(),e=t.getAppDefinitionId(),n=t.getPrivateAPI();if(!e)throw ti("EmptyAppDefinitionId");return(!i||_i(i.expires,Di))&&(i=await n.auth.getAccessToken(e,await n.info.getMetaSiteId())),i?.token?{headers:{Authorization:i.token}}:(console.error(ti("EmptyAppAuthInstance").withAppDefinitionId(e)),{headers:{Authorization:""}})}}},f=class i{constructor(t,e=[]){this.ShapeConstructor=t,this.selectedMethods=e}withPublicMethod(t){return new i(this.ShapeConstructor,[...this.selectedMethods,t])}build(){if(!this.selectedMethods.length)throw new Error("methods are not defined for the SDK shape");let t=this.selectedMethods.reduce((e,n)=>({...e,[n]:s=>{let r=new this.ShapeConstructor(s?.applicationContext);return r[n]?r[n].bind(r):()=>{console.error(`"${n}" is not defined in the SDK shape`)}}}),{});return _e(t)}},le=class extends I{constructor(t,e){super(t,e,"Base SDK Error")}},Ni=w(le),g=class{constructor(t=null){this.overriddenApplicationContext=t}getApplicationContext(){return this.overriddenApplicationContext?this.overriddenApplicationContext:y.getInstance()}async getAppDefinitionId(){return(await this.getApplicationContext()).getAppDefinitionId()}async getManifestContextId(){return(await this.getApplicationContext()).getManifestContextId()}async getRequiredManifestContextId(){let t=await this.getManifestContextId();if(!t)throw Ni("ManifestContextIdRequired");return t}async getEnvironmentContext(){return(await this.getApplicationContext()).getEnvironmentContext()}async getPlatformPrivateAPI(){return(await this.getApplicationContext()).getPrivateAPI()}},pe=class extends g{async getPrivateAPI(){return(await this.getApplicationContext()).getPrivateApplicationAPI()}async getPublicAPI(t){return(await this.getPlatformPrivateAPI()).applicationManager.getPublicApplicationAPI(t)}async getAppInstance(){return(await this.getPlatformPrivateAPI()).info.getAppInstance(await this.getAppDefinitionId())}},An=new f(pe).withPublicMethod("getPrivateAPI").withPublicMethod("getPublicAPI").withPublicMethod("getAppInstance").build(),Nt=class extends g{async addEventListener(t,e){return(await this.getApplicationContext()).getEvents().addEventListener(t,e)}},wn=new f(Nt).withPublicMethod("addEventListener").build(),he=class extends g{async getSelection(){let t=await this.getPlatformPrivateAPI(),e=await t.components.getSelectedComponents();return Promise.all(e.map(n=>t.components.getComponent(n)))}async onSelectionChange(t){new Nt(this.getApplicationContext()).addEventListener("componentSelectionChanged",n=>{t(n.components)})}},yn=new f(he).withPublicMethod("onSelectionChange").withPublicMethod("getSelection").build(),de=class extends g{async getViewMode(){return(await this.getPlatformPrivateAPI()).info.getViewMode()}async getLanguageCode(){return(await this.getPlatformPrivateAPI()).info.getLanguageCode()}async getSiteDirection(){return(await this.getPlatformPrivateAPI()).info.getSiteDirection()}async siteHasCustomClasses(){return(await this.getPlatformPrivateAPI()).info.siteHasCustomClasses()}async getThemeCustomProperties(t){return(await this.getPlatformPrivateAPI()).info.getThemeCustomProperties(t)}},vn=new f(de).withPublicMethod("getViewMode").withPublicMethod("getLanguageCode").withPublicMethod("getSiteDirection").withPublicMethod("siteHasCustomClasses").withPublicMethod("getThemeCustomProperties").build(),ct=(i=>(i.UndefinedCompRef="UndefinedCompRef",i.NotAvailableMethod="NotAvailableMethod",i))(ct||{}),ue=class extends I{constructor(t,e){super(t,e,"Widget Error")}},St=w(ue),ii="underline";function Oi(i){return i.map(t=>ni({font:t}).family).filter(Boolean)}function ni(i){let t={family:void 0,size:void 0};if(i?.font){let{variableName:e,fallbackValue:n}=ki(i.font);t.cssVariableName=e;let s=n.match(/(?:(["']).*?\1|\S)+/g)||[];for(let r=0;r<s.length;r++){let a=s[r];switch(a){case"bold":t.bold=!0;break;case"italic":t.italic=!0;break;default:a?.endsWith("px")?t.size=parseInt(a,10):r===s.length-1?t.family=a:t.family=(t.family||"")+" "+a}}}return i?.textDecoration&&(t.underline=i.textDecoration===ii),t.family=t.family?.trim().replace(/['"]+/g,""),t}function ki(i){let t=i.trim(),e=t.match(/var\((--[\w-]+),\s*(.+)\)/);return e?{variableName:e[1],fallbackValue:e[2]?.trim()??""}:{variableName:void 0,fallbackValue:t}}var j=class i{constructor(t,e){this.compRef=t,this.privateAPI=e}async getProp(t){return(await this.privateAPI.refComponents.getProps(this.compRef))?.[t]}async setProp(t,e){await this.privateAPI.refComponents.setProps(this.compRef,{[t]:e})}async getDesignPreset(){return this.privateAPI.designPresets.getDesignPresetName(this.compRef)}async setDesignPreset(t){await this.privateAPI.designPresets.setDesignPresetByName(this.compRef,t)}async getNestedWidget(t){let e=await this.privateAPI.refComponents.findComponentBySelector(this.compRef,t);return e?new i(e,this.privateAPI):null}},x,U,Pe=class extends g{constructor(){super(...arguments);p(this,x)}async setPreloadFonts(e){let n=await this.getPlatformPrivateAPI(),s=await d(this,x,U).call(this);if(await n.refComponents.isRefComponent(s))throw St(ct.NotAvailableMethod,"not available for the current component type");let r=Oi(e);await n.customElement.setPreloadFonts(s,r)}async getProp(e){let n=await this.getPlatformPrivateAPI(),s=await d(this,x,U).call(this);return await n.refComponents.isRefComponent(s)?new j(s,n).getProp(e):n.customElement.getAttribute(s,e)}async setProp(e,n){let s=await this.getPlatformPrivateAPI(),r=await d(this,x,U).call(this);if(await s.refComponents.isRefComponent(r))return new j(r,s).setProp(e,n);await s.customElement.setAttribute(r,e,n)}async getDesignPreset(){let e=await this.getPlatformPrivateAPI(),n=await d(this,x,U).call(this);if(!await e.refComponents.isRefComponent(n))throw St(ct.NotAvailableMethod,"not available for the current component type");return new j(n,e).getDesignPreset()}async setDesignPreset(e){let n=await this.getPlatformPrivateAPI(),s=await d(this,x,U).call(this);if(!await n.refComponents.isRefComponent(s))throw St(ct.NotAvailableMethod,"not available for the current component type");return new j(s,n).setDesignPreset(e)}async getNestedWidget(e){let n=await this.getPlatformPrivateAPI(),s=await d(this,x,U).call(this);return new j(s,n).getNestedWidget(e)}};x=new WeakSet,U=async function(){let s=(await(await this.getPlatformPrivateAPI()).components.getSelectedComponents())[0];if(!s)throw St(ct.UndefinedCompRef);return s};var Li=new f(Pe).withPublicMethod("getNestedWidget").withPublicMethod("setDesignPreset").withPublicMethod("getDesignPreset").withPublicMethod("setProp").withPublicMethod("getProp").withPublicMethod("setPreloadFonts"),bn=Li.build();function Fi(i){return`${i.cssVariableName?`var(${i.cssVariableName}, `:""}${i.italic?"italic ":""}${i.bold?"bold ":""}${i.size||16}px ${i.family?.split(",").map(t=>`"${t.replace(/['"]+/g,"")}"`).join(",")||"serif"}${i.cssVariableName?")":""}`}function Ui(i){if(!i)return null;let t=i,e=t.match(/var\((--[\w-]+),\s*(.+)\)/);return e?{cssVariableName:e[1],color:e[2]}:{color:t}}function ei(i){return i?i.cssVariableName?`var(${i.cssVariableName}, ${i.color})`:i.color:""}var ji={transformFontInternalValue:i=>{if(i){let{theme:t,cssVariableName:e,bold:n,italic:s,underline:r,...a}=i;return{...a,style:{bold:n,italic:s,underline:r},editorKey:e||t||""}}else return{editorKey:"font_7",family:"helvetica-w01-roman",size:16,style:{}}}},fe=class extends g{async selectColor(t,e){let n=await this.getPlatformPrivateAPI(),s=Ui(t),r=ei(s);return await n.inputs.openColorPicker({color:s?.cssVariableName||s?.theme||s?.color},({color:a,theme:c,cssVariableTheme:h})=>{s={color:a,theme:c,cssVariableName:h},r=ei(s),e?.onChange?.(r)}),r}async selectFont(t,e){let n=await this.getPlatformPrivateAPI(),s=ni(t),r=t;return await n.inputs.openFontPickerV2({...e,panelSectionsDefinition:{htmlTag:"hidden"},componentStyle:ji.transformFontInternalValue(s)},(a,c)=>{r={font:Fi(a),textDecoration:a.underline?ii:void 0},e?.onChange?.(r)}),r}},En=new f(fe).withPublicMethod("selectColor").withPublicMethod("selectFont").build(),ge=class extends g{async openLanguageSupportPanel(){return(await this.getPlatformPrivateAPI()).panels.openLanguageSupportPanel()}async openFontsUploadPanel(){return(await this.getPlatformPrivateAPI()).panels.openFontsUploadPanel()}},Cn=new f(ge).withPublicMethod("openLanguageSupportPanel").withPublicMethod("openFontsUploadPanel").build(),me=class extends g{async openDashboardModal(t){return(await this.getPlatformPrivateAPI()).panels.openDashboardPanel(await this.getAppDefinitionId(),t)}},xn=new f(me).withPublicMethod("openDashboardModal").build(),Ie=class extends g{constructor(t=null,e=[]){super(t),this.overriddenApplicationContext=t,this.childPath=e}async getStyleDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getStyleDefinitions(e,this.childPath)}async getStyles(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getStyles(e,this.childPath)}async setStyles({cssProperties:t,cssCustomProperties:e}={}){let n=await this.getPlatformPrivateAPI(),s=await this.getRequiredManifestContextId();return n.builderComponent.setStyles(s,this.childPath,{cssProperties:t,cssCustomProperties:e})}async removeStyles(t={}){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.removeStyles(n,this.childPath,t)}async getDataDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getDataDefinitions(e,this.childPath)}async getData(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getData(e,this.childPath)}async getResolvedData({dataItemKey:t}){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.getResolvedData(n,this.childPath,{dataItemKey:t})}async setData(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.setData(n,this.childPath,t)}async getPresetDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getPresetDefinitions(e,this.childPath)}async getAppliedPreset(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getAppliedPreset(e,this.childPath)}async applyPreset(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.applyPreset(n,this.childPath,t)}async getDisplayGroupDefinitions(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.getDisplayGroupDefinitions(n,this.childPath,t)}async getState(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getState(e,this.childPath)}async setState(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.setState(n,this.childPath,t)}async getStateDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getStateDefinitions(e,this.childPath)}async onChange(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.onContextualManifestChange(n,t)}async selectFont(t){try{let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return await e.builderComponent.selectFont(n,this.childPath,{...t,showWeights:!0})}catch{}}async selectFontFamily(t){try{let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return await e.builderComponent.selectFont(n,this.childPath,{...t,showWeights:!1})}catch{}}async selectMedia(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectMedia(n,this.childPath,t)}async selectLink(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectLink(n,this.childPath,t)}async selectColor(t){let e=await this.getPlatformPrivateAPI();try{let n=await this.getRequiredManifestContextId();return await e.builderComponent.selectColor(n,this.childPath,t)}catch{}}async selectFontWeight(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectFontWeight(n,this.childPath,t)}async selectTextTheme(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectTextTheme(n,t)}},Mn=new f(Ie).withPublicMethod("getDataDefinitions").withPublicMethod("getData").withPublicMethod("getResolvedData").withPublicMethod("setData").withPublicMethod("getStyleDefinitions").withPublicMethod("getStyles").withPublicMethod("setStyles").withPublicMethod("removeStyles").withPublicMethod("getPresetDefinitions").withPublicMethod("getAppliedPreset").withPublicMethod("applyPreset").withPublicMethod("getDisplayGroupDefinitions").withPublicMethod("getState").withPublicMethod("setState").withPublicMethod("onChange").withPublicMethod("getStateDefinitions").withPublicMethod("selectFont").withPublicMethod("selectFontFamily").withPublicMethod("selectMedia").withPublicMethod("selectLink").withPublicMethod("selectColor").withPublicMethod("selectFontWeight").withPublicMethod("selectTextTheme").build(),Ae=class extends g{async get(t){return(await this.getPlatformPrivateAPI()).userPreferences.get(await this.getAppDefinitionId(),t)}async set(t){return(await this.getPlatformPrivateAPI()).userPreferences.set(await this.getAppDefinitionId(),t)}},Rn=new f(Ae).withPublicMethod("set").withPublicMethod("get").build(),we=class extends g{async getData(){return(await this.getPlatformPrivateAPI()).externalPanels.getData()}async setData(t){return(await this.getPlatformPrivateAPI()).externalPanels.setData(t)}async getStyle(){return(await this.getPlatformPrivateAPI()).externalPanels.getStyle()}async setStyle(t){return(await this.getPlatformPrivateAPI()).externalPanels.setStyle(t)}async getTheme(){return(await this.getPlatformPrivateAPI()).externalPanels.getTheme()}async selectMedia(){return(await this.getPlatformPrivateAPI()).externalPanels.selectMedia()}async selectLink(...t){return(await this.getPlatformPrivateAPI()).externalPanels.selectLink(...t)}async selectColor(...t){return async()=>(await this.getPlatformPrivateAPI()).externalPanels.selectColor(...t)}async translate(t,e){return(await this.getPlatformPrivateAPI()).externalPanels.translate(t,e)}},Tn=new f(we).withPublicMethod("getTheme").withPublicMethod("getData").withPublicMethod("getStyle").withPublicMethod("selectColor").withPublicMethod("selectLink").withPublicMethod("selectMedia").withPublicMethod("setData").withPublicMethod("setStyle").withPublicMethod("translate").build(),si=(i=>(i.UndefinedCompRef="UndefinedCompRef",i))(si||{}),ye=class extends I{constructor(t,e){super(t,e,"Controllers Error")}},$i=w(ye),kt,ri,ve=class extends g{constructor(){super(...arguments);p(this,kt)}async get(){return(await this.getPlatformPrivateAPI()).controllers.get(await this.getAppDefinitionId(),await d(this,kt,ri).call(this))}};kt=new WeakSet,ri=async function(){let s=(await(await this.getPlatformPrivateAPI()).components.getSelectedComponents())[0];if(!s)throw $i(si.UndefinedCompRef);return s};var _n=new f(ve).withPublicMethod("get").build(),Ot=class{constructor(t,e,n,s){this.privateAPI=t,this.compRef=e,this.bindingTargetId=n,this.config=s}update(t){return this.privateAPI.bindings.update(this.compRef,this.bindingTargetId,{config:t.config,role:t.role})}delete(){return this.privateAPI.bindings.delete(this.compRef,this.bindingTargetId)}},be=class extends g{async get(t){let e=await this.getPlatformPrivateAPI(),n=await e.components.getSelectedComponents();if(n.length!==1)return null;let[s]=n,r=e.bindings.get(t.id,s);return r?new Ot(e,s,t.id,r):null}},Dn=new f(be).withPublicMethod("get").build(),Wi="Data Binding",{dataBindingPanelId:qi,bindingItemName:Bi}={dataBindingPanelId:"",bindingItemName:"dataBinding"},Ee=class{constructor(t,e,n,s,r){this.privateAPI=t,this.compRef=e,this.dataItemTarget=n,this.name=s,this.dataBindingPanelId=r}select(){return this.privateAPI.bindings.openDataBindingPanel(this.dataItemTarget.id,this.dataBindingPanelId)}createBinding(t){return this.privateAPI.bindings.create(this.compRef,{dataItemId:this.dataItemTarget.id,bindingItemType:Bi,...t})?new Ot(this.privateAPI,this.compRef,this.dataItemTarget.id,JSON.stringify(t)):null}},Ce=class extends g{async list(t){let e=await this.getPlatformPrivateAPI(),n=await e.components.getSelectedComponents();if(n.length!==1)return[];let[s]=n;return await e.bindings.canCreateBindingsProvider(s)?[new Ee(e,s,t,Wi,qi)]:[]}},Sn=new f(Ce).withPublicMethod("list").build(),Ki=()=>{let i=new URLSearchParams(window.location.search),t=i.has("essentials")?JSON.parse(i.get("essentials")):void 0,{monitoring:e,...n}=t||{},s=i.get("appDefinitionId"),{context:r,config:a}=e||{},c=De({hostContext:{appId:s,...r},monitoringConfig:a,sentrySDK:typeof window<"u"?window.Sentry:void 0});return{environment:{},applicationContext:y.getInstance(),channel:{observeState:async()=>({disconnect(){}})},getMonitoringClient:c,essentials:n}},zi=()=>({environment:{},applicationContext:y.getInstance(),channel:{observeState:async()=>({disconnect(){}})}}),xe={host:()=>typeof importScripts=="function"?zi():Ki(),auth:Si};var Fn=()=>{let i=xe.host(),t=xe.auth();Te({auth:t,host:i}).enableContext("module")};export{Fn as enableClient};
7
+ `)}getBreadcrumbs(){let e=this.parentError;return e?[...e.getBreadcrumbs(),this.displayName]:[this.displayName]}withParentError(e){return this.parent=e,this}withMessage(...e){return this.messages.push(e),this}};function y(i){return function t(e,n=""){let s=new i(n,e);return Error.captureStackTrace&&Error.captureStackTrace(s,t),s}}var qt=class extends I{constructor(e,n){super(e,n,"Editor Platform Internal Error");l(this,"state",{})}withHost(e){return this.state={...this.state,host:e},this}},mi=y(qt);var $=(i=>(i.IncorrectEnvironment="IncorrectEnvironment",i))($||{}),Kt=class extends I{constructor(e,n){super(e,n,"EP Context Error");l(this,"state",{})}withUrl(e){return this.state={...this.state,url:e},this}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}},Y=y(Kt);async function Ii(i,t){if(!i?.type)return i;switch(i.type){case"componentSelectionChanged":let e=i.componentRefs||[],n=await Promise.all(e.map(s=>t.components.getComponent(s)));return{type:i.type,components:n};default:return i}}var zt=class{constructor(t,e,n){l(this,"events");l(this,"subscribe");l(this,"commit");l(this,"startTransaction");l(this,"silent");this.appDefinitionId=t,this.privateAPI=n,this.events=e,this.subscribe=e.subscribe.bind(e),this.commit=e.commit.bind(e),this.startTransaction=e.startTransaction.bind(e),this.silent=e.silent.bind(e)}notify(t){this.events.notify({type:t.type,payload:t.payload,meta:{appDefinitionId:this.appDefinitionId}})}notifyCustomEvent(t,e){this.notify({type:b.CustomEvent,payload:{...e,type:t}})}addEventListener(t,e){return this.events.subscribe(async n=>{let s=n.meta?.appDefinitionId===this.appDefinitionId||n.meta?.appDefinitionId===null,r=()=>Ii(n.payload,this.privateAPI);t==="*"?e(await r()):n.type===b.CustomEvent?t===n.payload?.type&&!s&&e(await r()):n.type===b.HostEvent&&t===n.payload?.type&&s&&e(await r())})}},Ai=200,wi=50,O,Gt,Ue,ut=class{constructor(t){h(this,O);l(this,"injectionUUID");l(this,"injectionUUID_Deprecated");this.injectionUUID_Deprecated=`__${t}_CONTEXT_INJECTION_STATUS_KEY`,this.injectionUUID=`__${t}_CONTEXT_INJECTION_STATUS_KEY#0.1`,u(this,O,Gt).call(this)||u(this,O,Ue).call(this)}resolveInjected(){globalThis[this.injectionUUID]?.resolve()}waitInjected(){return new Promise((t,e)=>{let n=!1,s,r=0,a=()=>{n||(s=setTimeout(()=>{if(r++,r<wi){r%10===0&&console.log(Y($.IncorrectEnvironment,"contexts are not resolved, still re-trying").withMessage(`try number ${r}`).message),a();return}if(!n){let c=Y($.IncorrectEnvironment,"contexts are not resolved, threw by timeout");e(c)}},Ai))};a(),u(this,O,Gt).call(this)?.then(()=>{n=!0,clearTimeout(s),t()})})}};O=new WeakSet,Gt=function(){return globalThis[this.injectionUUID]?.promise},Ue=function(){let t,e=new Promise(n=>{t=n});globalThis[this.injectionUUID]={promise:e,resolve:t},globalThis[this.injectionUUID_Deprecated]=new Promise(n=>{e.then(n)})};var Bt="__ENVIRONMENT_CONTEXT_KEY",gt=(i=>(i.Worker="Worker",i.Frame="Frame",i.ComponentPanel="ComponentPanel",i))(gt||{}),Pt=class Pt{constructor(t){this.environmentContext=t}static async inject(t){if(globalThis[Bt])throw Y($.IncorrectEnvironment,"Environment context already exists and should not be overridden");globalThis[Bt]=new Pt(t),this.status.resolveInjected()}static async getInstance(){return await this.status.waitInjected(),globalThis[Bt]}getPrivateAPI(){return this.environmentContext.privateApi}getEvents(){return this.environmentContext.events}getApplicationAPIs(){return this.environmentContext.applicationAPIs??{}}getEnvironment(){return this.environmentContext.environment}};l(Pt,"status",new ut("environment"));var N=Pt,J="__APPLICATION_CONTEXT_KEY",ft=class ft{constructor(t,e){l(this,"events");this.context=t,this.environment=e,this.events=new zt(t.appDefinitionId?t.appDefinitionId:null,this.environment.getEvents(),this.environment.getPrivateAPI())}static async inject(t){if(globalThis[J])throw Y($.IncorrectEnvironment,"Application context already exists and should not be overridden");globalThis[J]=new ft(t,await N.getInstance()),this.status.resolveInjected()}static async getInstance(){return typeof __APPLICATION_CONTEXT_KEY<"u"?__APPLICATION_CONTEXT_KEY:(await this.status.waitInjected(),globalThis[J])}getContext(){return this.context}getAppDefinitionId(){return this.context.appDefinitionId}getManifestContextId(){return this.context.manifestContextId}getEvents(){return this.events}getEnvironmentContext(){return this.environment}getPrivateAPI(){return this.environment.getPrivateAPI()}getPrivateApplicationAPI(){let t=this.getAppDefinitionId();if(!t)throw Y($.IncorrectEnvironment,"appDefinitionId is not available");return this.environment.getApplicationAPIs()[t]}};l(ft,"status",new ut("application"));var v=ft;var Ze=De(Ut());var tt=i=>`"editor-platform-transport": ${i}`,We=i=>tt(`[Internal Error] ${i}`),qe="\u0192",Be="\u2202",Ke="_get_",ze="_set_",mt="+",je="-",te="\xB7",ee="\xD7",ie="\xB0",Ge=i=>i[0]===ee?"":i,$e=i=>i===null||typeof i>"u"||typeof i=="symbol"||typeof i=="number"||typeof i=="boolean"||typeof i=="function"||typeof i=="string",yi=i=>!!i&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof Set)&&!(i instanceof Map),vi=i=>W(i.split(te)),W=i=>i.map(Ge).filter(Boolean).join(".");function Mt(i,t){return{marker:i,...t}}var bi=Mt("A",{shouldUse:i=>Array.isArray(i),serialize:(i,t)=>{i.length?i.forEach((e,n)=>{t(`${n}`,e)}):t("",ie)},deserialize:{create:()=>[],has:(i,t)=>!(typeof i[t]>"u"),append:(i,t,e)=>{i.push(e)}}}),Ei=Mt("M",{shouldUse:i=>i instanceof Map,serialize:(i,t)=>{i.forEach((e,n)=>{t(n,e)})},deserialize:{create:()=>new Map,has:(i,t)=>i.has(t),append:(i,t,e)=>{i.set(t,e)}}}),Ci=Mt("S",{shouldUse:i=>i instanceof Set,serialize:(i,t)=>{let e=0;i.forEach(n=>{t(`${e++}`,n)})},deserialize:{create:()=>new Set,has:(i,t)=>i.has(t),append:(i,t,e)=>{i.add(e)}}}),Jt=Mt("O",{shouldUse:i=>typeof i=="object",serialize:(i,t)=>{let e=n=>{let r=Reflect.ownKeys(n).filter(c=>c!=="constructor").filter(c=>typeof c!="symbol");r.length?r.filter(c=>c!=="constructor").filter(c=>typeof c!="symbol").forEach(c=>{let p=Reflect.get(i,c);t(c,p)}):t("",ie);let a=Reflect.getPrototypeOf(n);!a||a?.hasOwnProperty("__proto__")||e(a)};e(i)},deserialize:{create:()=>({}),has:(i,t)=>!!i[t],append:(i,t,e)=>{i[t]=e}}}),Ve=[bi,Ci,Ei];function xi(i,t){let e=i;for(;e;){let n=Object.getOwnPropertyDescriptor(e,t);if(n)return n;e=Reflect.getPrototypeOf(e)}return null}function Mi(i,t){let e=new WeakMap,n=r=>{let a=r.slice(1).map(Ge).filter(Boolean);return a.slice(1).reduce((c,p)=>({context:c.context[c.pointer],pointer:p}),{context:i,pointer:a[0]})},s=(r,a=[])=>{if(e.has(r)&&e.get(r)?.some(d=>a.join(".").startsWith(d))){t(a,{...n(a),value:"[Circular]"});return}if(r&&!$e(r)&&(e.has(r)&&e.set(r,[]),e.set(r,[...e.get(r)??[],a.join(".")])),$e(r)){t(a,{...n(a),value:r});return}let c=Ve.find(p=>p.shouldUse(r))??Jt;if(c){c.serialize(r,(p,d)=>{s(d,[...a,`${ee}${c.marker}`,p])});return}};return s(i)}var Ri=(i,t)=>{if(!yi(i))throw new Error(tt("only objects are serializable at the root level"));let e={data:[]},n=(r,a)=>{e.data.push([r,a])},s=(r,a)=>{t(vi(r),(...c)=>a.context[a.pointer](...c)),n(r,qe)};return Mi(i,(r,{value:a,context:c,pointer:p})=>{let d=r.slice(1).join(te),P=xi(c,p);if(P?.get||P?.set){P?.get&&t(W([...r,Ke]),()=>c[p]),P?.set&&t(W([...r,ze]),G=>{c[p]=G});let D=[P?.get?mt:je,P?.set?mt:je];n(d,`${Be}${D.join("")}`)}else typeof a=="function"?s(d,{context:c,pointer:p}):n(d,a)}),e},Ti=(i,t)=>typeof i!="object"||i===null?i:i.data.reduce((e,[n,s])=>{let r=e,a=n.split(te),c=Jt,p=null;for(let d=0;d<a.length;d++){let P=a[d];if(P[0]===ee){let D=c.deserialize.has(r,p);if(c=[Jt,...Ve].find(G=>G.marker===P[1]),!c)throw new Error(tt(`unknown marker "${P[1]}"`));D||(r[p]=c.deserialize.create()),r=r[p]}else p=P}if(s?.toString()===ie)return e;if(s?.toString()===qe)c.deserialize.append(r,p,t(W(a)));else if(s?.toString()[0]===Be){let d=s?.toString()[1]===mt,P=s?.toString()[2]===mt,D={};if(d){let G=t(W([...a,Ke]));D.get=()=>G()}P&&(D.set=t(W([...a,ze]))),Object.defineProperty(r,p,D)}else c.deserialize.append(r,p,s);return e},{[Symbol("transferred object")]:`${(JSON.stringify(i.data).length/1024).toFixed(2)}Kb`});function Je(){let i=globalThis.performance;if(i&&i.now)return i.now();let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length,s=0,r=10;for(;s<r;)t+=e.charAt(Math.floor(Math.random()*n)),s+=1;return t}var X=(i=>(i.ExposeAPI="ExposeAPI",i.Call="Call",i.Response="Response",i.Cleanup="Cleanup",i))(X||{}),R=class i{constructor(t,e){l(this,"correlationId",`M-${Je()}`);l(this,"parentCorrelationId");this.type=t,this.payload=e}withParentCorrelationId(t){return this.parentCorrelationId=t,this}serialize(t){return JSON.stringify({parentCorrelationId:this.parentCorrelationId,correlationId:this.correlationId,type:this.type,payload:Ri(this.payload,(e,n)=>{t(this.correlationId,e,n)})})}static fromEvent(t,e){let n=JSON.parse(t);return new i(n.type,Ti(n.payload,s=>e(n.correlationId,s))).withParentCorrelationId(n.correlationId)}},Yt=class extends R{constructor(t){super("Cleanup",t)}},Ht=class extends R{constructor(t){super("Response",t)}},It=class extends R{constructor(t){super("Response",t)}},Xt=class extends R{constructor(t){super("Call",t)}},Vt=(i,t)=>`${i}_${t}`,Et,Ct,q,C,Qt=class{constructor(t){h(this,Et,new FinalizationRegistry(t=>{this.postMessage(new Yt(t))}));h(this,Ct,{[X.Cleanup]:t=>{let e=t.payload.functionMarkerKey,n=t.payload.callId;delete o(this,q)[e],n&&delete o(this,C)[n]},[X.Response]:async t=>{let e=t.payload.callId,n=t.payload.errorMessage;if(n)if(t.payload.errorStack){let r=new Error(n);r.stack=t.payload.errorStack,o(this,C)[e]?.reject(r)}else o(this,C)[e]?.reject(n);else{let s=t.payload.response;o(this,C)[e]?.resolve(s)}delete o(this,C)[e]},[X.Call]:async t=>{let e=t.payload.functionMarkerKey,n=o(this,q)[e];if(!n){this.postMessage(new It({callId:t.payload.callId,errorMessage:tt("function is not available")}));return}try{let s=await n.value(...t.payload.props??[]);this.postMessage(new Ht({callId:t.payload.callId,response:s}))}catch(s){this.postMessage(new It({callId:t.payload.callId,errorMessage:s.message,errorStack:s.stack}))}}});h(this,q,{});h(this,C,{});l(this,"queue",[]);this.port=t,this.port.onmessage=e=>{this.onMessage(e)}}onMessage(t){let e=R.fromEvent(t.data,(n,s)=>{let r=this.replaceTransferredFunction(n,s);return o(this,Et).register(r,{functionMarkerKey:Vt(n,s)}),r});o(this,Ct)[e.type]?.(e),this.messageEvents[e.type]?.(e)}postMessage(t){this.port.postMessage(t.serialize(this.registerTransferredFunction.bind(this)))}registerTransferredFunction(t,e,n){let s=Vt(t,e);o(this,q)[s]={path:e,value:n}}replaceTransferredFunction(t,e){return(...n)=>{let s=`CALL-${crypto.randomUUID()}`;return this.postMessage(new Xt({callId:s,functionMarkerKey:Vt(t,e),props:n})),new Promise((r,a)=>{o(this,C)[s]={resolve:r,reject:a}})}}flush(){this.queue.forEach(t=>{this.postMessage(t)}),this.queue=[]}};Et=new WeakMap,Ct=new WeakMap,q=new WeakMap,C=new WeakMap;var At=class extends Qt{constructor(){super(...arguments);l(this,"messageEvents",{})}expose(e){if(!e.type)throw new Error(tt('wrong exposed API instance, "type" property is required'));this.queue.push(new R(X.ExposeAPI,e)),this.flush()}};var H=(i=>(i.Ping="EDITOR_PLATFORM_TRANSPORT_EVENT:__Ping",i.RequestPort="EDITOR_PLATFORM_TRANSPORT_EVENT:__RequestPort",i.Pong="EDITOR_PLATFORM_TRANSPORT_EVENT:__Pong",i.Port="EDITOR_PLATFORM_TRANSPORT_EVENT:__Port",i))(H||{});var B,M,xt,Ye,Zt=class{constructor(t,e){h(this,xt);h(this,B,new Set);h(this,M);this.postMessage=t,this.onMessage=e}setActivePort(t){this.dispose(),A(this,M,t),u(this,xt,Ye).call(this)}dispose(){o(this,M)&&(o(this,M).close(),o(this,M).onmessage=null)}onHandshake(t){return o(this,B).add(t),()=>{o(this,B).delete(t)}}};B=new WeakMap,M=new WeakMap,xt=new WeakSet,Ye=function(){let t=o(this,M);if(!t){console.warn(We("port is required no notify onHandshake listeners"));return}o(this,B).forEach(e=>e(t))};var Q,Z,T,He,Xe,Qe,wt=class extends Zt{constructor(e,n){super(e,n);h(this,T);h(this,Q,!1);h(this,Z,`consumer-${Je()}`);u(this,T,He).call(this);let s={type:H.Ping};e(JSON.stringify(s))}};Q=new WeakMap,Z=new WeakMap,T=new WeakSet,He=function(){this.onMessage(e=>{try{let n=JSON.parse(e.data);switch(n.type){case H.Pong:{u(this,T,Xe).call(this);break}case H.Port:{u(this,T,Qe).call(this,n.targetMemberId,e.ports?.[0]);break}}}catch{}})},Xe=function(){if(o(this,Q))return;A(this,Q,!0);let e={type:H.RequestPort,memberId:o(this,Z)};this.postMessage(JSON.stringify(e))},Qe=function(e,n){if(e===o(this,Z)){if(!n)throw new Error(We("no port at consumer handshake"));this.setActivePort(n)}};var yt=class{get onConnect(){return this.handshake.onHandshake.bind(this.handshake)}},vt=class i extends yt{constructor(){super(...arguments);l(this,"handshake",new wt(e=>{globalThis.parent.postMessage(e,"*")},e=>{globalThis.addEventListener("message",e)}))}static exposeAPI(e){new i().onConnect(s=>{new At(s).expose(e)})}};var bt=class i extends yt{constructor(){super(...arguments);l(this,"handshake",new wt(e=>{globalThis.postMessage(e)},e=>{globalThis.addEventListener("message",e)}))}static exposeAPI(e){new i().onConnect(s=>{new At(s).expose(e)})}};var Rt=class{constructor(t){this.platformAppEvents=t}notify(t){switch(t.type){case Wt.EditorReady:this.platformAppEvents.notify({...t,type:b.EditorReady});break;case dt.HostEvent:this.platformAppEvents.notify({...t,type:b.HostEvent});break}}subscribe(t){this.platformAppEvents.subscribe(e=>{t(e)})}},le=(i=>(i.Frame="PLATFORM_FRAME_API",i.Worker="PLATFORM_WORKER_API",i))(le||{}),Tt=class{constructor(t,e){this.type=t,this.envType=e}async injectEnvironmentContext({events:t,privateApi:e}){await N.inject({environment:this.envType,events:t,privateApi:e,applicationAPIs:{}})}async injectApplicationContext(t){await v.inject(t)}},_i={classic:"https://www.unpkg.com/@wix/design-system/dist/statics/tokens-default.global.css",studio:"https://www.unpkg.com/@wix/design-system/dist/statics/tokens-studio.global.css"},et,it,Dt,nt,St,ti,se=class extends Tt{constructor(){super(le.Frame,gt.Frame);h(this,St);h(this,et,new E);h(this,it,new Rt(o(this,et)));h(this,Dt);h(this,nt);u(this,St,ti).call(this)}async initEnvironment(e){let{applicationPrivateAPI:n,privateAPI:s,context:r}=e,a=e.context?.appDefinitionId??e.appDefinitionId,c=e.context?e.context:{appDefinitionId:a};A(this,nt,n),A(this,Dt,s),await this.injectEnvironmentContext({privateApi:s,events:o(this,et),applicationAPIs:a?{[a]:o(this,nt)}:{}}),await this.injectApplicationContext(c)}notify(e){o(this,it).notify(e)}subscribe(e){o(this,it).subscribe(e)}};et=new WeakMap,it=new WeakMap,Dt=new WeakMap,nt=new WeakMap,St=new WeakSet,ti=function(){if(typeof globalThis?.document?.head?.prepend=="function"){let n=new URL(globalThis.location.href).searchParams.get("editorType")==="CLASSIC"?"classic":"studio",s=_i[n],r=s&&!!document.querySelectorAll(`link[type="text/css"][href="${s}"]`)?.length;if(s&&!r){let a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",s),globalThis.document.head.prepend(a)}}};var _=(i=>(i.ApplicationLoadError="ApplicationLoadError",i.ApplicationFetchError="ApplicationFetchError",i.ApplicationExecuteError="ApplicationExecuteError",i))(_||{}),re=class extends I{constructor(e,n){super(e,n,"EP Application Container Error");l(this,"state",{})}withUrl(e){return this.state={...this.state,url:e},this}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}withApiMethod(e){return this.state={...this.state,apiMethod:e},this}withApiType(e){return this.state={...this.state,apiType:e},this}},k=y(re),Di="__APPLICATION_REGISTRY_KEY";async function Si(i,t,e){let n=new Function(J,Di,e),s,r=a=>{if(s)throw k(_.ApplicationExecuteError,"Application registry called more than once").withAppDefinitionId(t.appDefinitionId);if(a.type!==t.type)throw k(_.ApplicationExecuteError,"Application has different type").withMessage("expected type",t.type).withMessage("received type",a.type);s=a};try{let a={...t};n.call(null,new v(a,await N.getInstance()),r)}catch(a){throw k(_.ApplicationExecuteError,a.message).withAppDefinitionId(t.appDefinitionId).withParentError(a)}return new Promise((a,c)=>{let p=i.subscribe(d=>{let P=setTimeout(()=>{clearTimeout(P),p(),s||c(k(_.ApplicationExecuteError,"Application registry was not called, threw by timeout").withAppDefinitionId(t.appDefinitionId))},5e3);d.type===b.ApplicationInit&&d.meta.appDefinitionId===t.appDefinitionId&&(clearTimeout(P),p(),s||c(k(_.ApplicationExecuteError,"Application registry was not called").withAppDefinitionId(t.appDefinitionId)),a({instance:s}))})})}var L,st,m,ae=class{constructor(t,e){h(this,L,{});h(this,st);h(this,m);A(this,st,t),A(this,m,e),o(this,m).subscribe(n=>{switch(n.type){case b.HostEvent:{n.payload.type===Ze.EventType.removeAppCompleted&&o(this,m).withEvent(o(this,m).factories.createApplicationRemovedEvent(n.payload.appDefinitionId),()=>this.removeApplication(n.payload.appDefinitionId));break}}})}async runApplication(t){let e=await this.loadApplication(t),n=await this.executeApplication(t,e);return this.setApplication(t.appDefinitionId,n),n}setApplication(t,e){o(this,L)[t]=e,o(this,m).withEvent(o(this,m).factories.createApplicationApiInitEvent(t,e?.api?.private?"private":"public"),()=>{o(this,st).applicationManager.setApplication(e)})}getApplication(t){return o(this,L)[t]}getAppDefinitionIds(){return Object.keys(o(this,L))}removeApplication(t){delete o(this,L)[t]}async loadApplication(t){let e=t.url;return o(this,m).withEvent(o(this,m).factories.createApplicationLoadEvent(t,e),async()=>{try{return await this.loadApplicationBundle(e)}catch(n){throw k(_.ApplicationLoadError).withUrl(e).withAppDefinitionId(t.appDefinitionId).withParentError(n)}})}async loadApplicationBundle(t){let e=await fetch(t,{method:"GET"});if(!(e.status>=200&&e.status<=299))throw k(_.ApplicationFetchError).withUrl(t);return e.text()}async executeApplication(t,e){return o(this,m).withEvent(o(this,m).factories.createApplicationExecuteEvent(t,t.url),async()=>{let{instance:n}=await Si(o(this,m),t,e);return n})}};L=new WeakMap,st=new WeakMap,m=new WeakMap;var K,rt,at,F,ot,oe=class extends Tt{constructor(){super(le.Worker,gt.Worker);h(this,K,new E);h(this,rt,new Rt(o(this,K)));h(this,at,null);h(this,F);h(this,ot,[])}create(){}async initEnvironment(e){let{buildPrivateAPI:n}=e;A(this,F,await n({type:"EDITOR_ADDON"})),await this.injectEnvironmentContext({events:o(this,K),privateApi:o(this,F),applicationAPIs:{}}),A(this,at,new ae(o(this,F),o(this,K))),o(this,ot).forEach(s=>s(this))}async notify(e){await this.waitReady(),o(this,rt).notify(e)}subscribe(e){o(this,rt).subscribe(e)}async runApplication(e){await this.waitReady(),await o(this,at).runApplication(e)}waitReady(){return new Promise(e=>{if(o(this,F))return e(this);o(this,ot).push(e)})}};K=new WeakMap,rt=new WeakMap,at=new WeakMap,F=new WeakMap,ot=new WeakMap;var ne="$_EP_TRANSPORT_ENV_CONTEXT_GUARD",z,ei,ii,_t=class{constructor(){h(this,z)}isEnvironmentApiExposed(){return!!globalThis[ne]}async getContexts(){let[t,e]=await Promise.all([N.getInstance(),v.getInstance()]);return{environmentContext:t,applicationContext:e}}expose(){if(this.isEnvironmentApiExposed())return;let t=typeof importScripts=="function",e=globalThis.self&&globalThis.top&&globalThis.self!==globalThis.top;t?(u(this,z,ei).call(this),globalThis[ne]=!0):e&&(u(this,z,ii).call(this),globalThis[ne]=!0)}};z=new WeakSet,ei=function(){bt.exposeAPI(new oe)},ii=function(){vt.exposeAPI(new se)};var ce=class extends I{constructor(e,n){super(e,n,"EP EnvironmentAPI Error");l(this,"state",{})}withUrl(e){return this.state={...this.state,url:e},this}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}},Pn=y(ce);new _t().expose();var pe=class extends I{constructor(e,n){super(e,n,"Auth Strategy Error");l(this,"state",{})}withAppDefinitionId(e){return this.state={...this.state,appDefinitionId:e},this}},ni=y(pe);function Ni(i,t){let e=Date.now(),n=i?new Date(i).getTime():null;return n&&n-e>t}var Oi=30*60*1e3,ki=()=>{let i;return{getAuthHeaders:async()=>{let t=await v.getInstance(),e=t.getAppDefinitionId(),n=t.getPrivateAPI();if(!e)throw ni("EmptyAppDefinitionId");return(!i||Ni(i.expires,Oi))&&(i=await n.auth.getAccessToken(e,await n.info.getMetaSiteId())),i?.token?{headers:{Authorization:i.token}}:(console.error(ni("EmptyAppAuthInstance").withAppDefinitionId(e)),{headers:{Authorization:""}})}}},f=class i{constructor(t,e=[]){this.ShapeConstructor=t,this.selectedMethods=e}withPublicMethod(t){return new i(this.ShapeConstructor,[...this.selectedMethods,t])}build(){if(!this.selectedMethods.length)throw new Error("methods are not defined for the SDK shape");let t=this.selectedMethods.reduce((e,n)=>({...e,[n]:s=>{let r=new this.ShapeConstructor(s?.applicationContext);return r[n]?r[n].bind(r):()=>{console.error(`"${n}" is not defined in the SDK shape`)}}}),{});return Ne(t)}},he=class extends I{constructor(t,e){super(t,e,"Base SDK Error")}},Li=y(he),g=class{constructor(t=null){this.overriddenApplicationContext=t}getApplicationContext(){return this.overriddenApplicationContext?this.overriddenApplicationContext:v.getInstance()}async getAppDefinitionId(){return(await this.getApplicationContext()).getAppDefinitionId()}async getManifestContextId(){return(await this.getApplicationContext()).getManifestContextId()}async getRequiredManifestContextId(){let t=await this.getManifestContextId();if(!t)throw Li("ManifestContextIdRequired");return t}async getEnvironmentContext(){return(await this.getApplicationContext()).getEnvironmentContext()}async getPlatformPrivateAPI(){return(await this.getApplicationContext()).getPrivateAPI()}},de=class extends g{async getPrivateAPI(){return(await this.getApplicationContext()).getPrivateApplicationAPI()}async getPublicAPI(t){return(await this.getPlatformPrivateAPI()).applicationManager.getPublicApplicationAPI(t)}async getAppInstance(){return(await this.getPlatformPrivateAPI()).info.getAppInstance(await this.getAppDefinitionId())}},vn=new f(de).withPublicMethod("getPrivateAPI").withPublicMethod("getPublicAPI").withPublicMethod("getAppInstance").build(),Ot=class extends g{async addEventListener(t,e){return(await this.getApplicationContext()).getEvents().addEventListener(t,e)}},bn=new f(Ot).withPublicMethod("addEventListener").build(),ue=class extends g{async getSelection(){let t=await this.getPlatformPrivateAPI(),e=await t.components.getSelectedComponents();return Promise.all(e.map(n=>t.components.getComponent(n)))}async onSelectionChange(t){new Ot(this.getApplicationContext()).addEventListener("componentSelectionChanged",n=>{t(n.components)})}},En=new f(ue).withPublicMethod("onSelectionChange").withPublicMethod("getSelection").build(),Pe=class extends g{async getViewMode(){return(await this.getPlatformPrivateAPI()).info.getViewMode()}async getLanguageCode(){return(await this.getPlatformPrivateAPI()).info.getLanguageCode()}async getSiteDirection(){return(await this.getPlatformPrivateAPI()).info.getSiteDirection()}async siteHasCustomClasses(){return(await this.getPlatformPrivateAPI()).info.siteHasCustomClasses()}async getThemeCustomProperties(t){return(await this.getPlatformPrivateAPI()).info.getThemeCustomProperties(t)}},Cn=new f(Pe).withPublicMethod("getViewMode").withPublicMethod("getLanguageCode").withPublicMethod("getSiteDirection").withPublicMethod("siteHasCustomClasses").withPublicMethod("getThemeCustomProperties").build(),ct=(i=>(i.UndefinedCompRef="UndefinedCompRef",i.NotAvailableMethod="NotAvailableMethod",i))(ct||{}),fe=class extends I{constructor(t,e){super(t,e,"Widget Error")}},Nt=y(fe),ri="underline";function Fi(i){return i.map(t=>ai({font:t}).family).filter(Boolean)}function ai(i){let t={family:void 0,size:void 0};if(i?.font){let{variableName:e,fallbackValue:n}=Ui(i.font);t.cssVariableName=e;let s=n.match(/(?:(["']).*?\1|\S)+/g)||[];for(let r=0;r<s.length;r++){let a=s[r];switch(a){case"bold":t.bold=!0;break;case"italic":t.italic=!0;break;default:a?.endsWith("px")?t.size=parseInt(a,10):r===s.length-1?t.family=a:t.family=(t.family||"")+" "+a}}}return i?.textDecoration&&(t.underline=i.textDecoration===ri),t.family=t.family?.trim().replace(/['"]+/g,""),t}function Ui(i){let t=i.trim(),e=t.match(/var\((--[\w-]+),\s*(.+)\)/);return e?{variableName:e[1],fallbackValue:e[2]?.trim()??""}:{variableName:void 0,fallbackValue:t}}var j=class i{constructor(t,e){this.compRef=t,this.privateAPI=e}async getProp(t){return(await this.privateAPI.refComponents.getProps(this.compRef))?.[t]}async setProp(t,e){await this.privateAPI.refComponents.setProps(this.compRef,{[t]:e})}async getDesignPreset(){return this.privateAPI.designPresets.getDesignPresetName(this.compRef)}async setDesignPreset(t){await this.privateAPI.designPresets.setDesignPresetByName(this.compRef,t)}async getNestedWidget(t){let e=await this.privateAPI.refComponents.findComponentBySelector(this.compRef,t);return e?new i(e,this.privateAPI):null}},x,U,ge=class extends g{constructor(){super(...arguments);h(this,x)}async setPreloadFonts(e){let n=await this.getPlatformPrivateAPI(),s=await u(this,x,U).call(this);if(await n.refComponents.isRefComponent(s))throw Nt(ct.NotAvailableMethod,"not available for the current component type");let r=Fi(e);await n.customElement.setPreloadFonts(s,r)}async getProp(e){let n=await this.getPlatformPrivateAPI(),s=await u(this,x,U).call(this);return await n.refComponents.isRefComponent(s)?new j(s,n).getProp(e):n.customElement.getAttribute(s,e)}async setProp(e,n){let s=await this.getPlatformPrivateAPI(),r=await u(this,x,U).call(this);if(await s.refComponents.isRefComponent(r))return new j(r,s).setProp(e,n);await s.customElement.setAttribute(r,e,n)}async getDesignPreset(){let e=await this.getPlatformPrivateAPI(),n=await u(this,x,U).call(this);if(!await e.refComponents.isRefComponent(n))throw Nt(ct.NotAvailableMethod,"not available for the current component type");return new j(n,e).getDesignPreset()}async setDesignPreset(e){let n=await this.getPlatformPrivateAPI(),s=await u(this,x,U).call(this);if(!await n.refComponents.isRefComponent(s))throw Nt(ct.NotAvailableMethod,"not available for the current component type");return new j(s,n).setDesignPreset(e)}async getNestedWidget(e){let n=await this.getPlatformPrivateAPI(),s=await u(this,x,U).call(this);return new j(s,n).getNestedWidget(e)}};x=new WeakSet,U=async function(){let s=(await(await this.getPlatformPrivateAPI()).components.getSelectedComponents())[0];if(!s)throw Nt(ct.UndefinedCompRef);return s};var ji=new f(ge).withPublicMethod("getNestedWidget").withPublicMethod("setDesignPreset").withPublicMethod("getDesignPreset").withPublicMethod("setProp").withPublicMethod("getProp").withPublicMethod("setPreloadFonts"),xn=ji.build();function $i(i){return`${i.cssVariableName?`var(${i.cssVariableName}, `:""}${i.italic?"italic ":""}${i.bold?"bold ":""}${i.size||16}px ${i.family?.split(",").map(t=>`"${t.replace(/['"]+/g,"")}"`).join(",")||"serif"}${i.cssVariableName?")":""}`}function Wi(i){if(!i)return null;let t=i,e=t.match(/var\((--[\w-]+),\s*(.+)\)/);return e?{cssVariableName:e[1],color:e[2]}:{color:t}}function si(i){return i?i.cssVariableName?`var(${i.cssVariableName}, ${i.color})`:i.color:""}var qi={transformFontInternalValue:i=>{if(i){let{theme:t,cssVariableName:e,bold:n,italic:s,underline:r,...a}=i;return{...a,style:{bold:n,italic:s,underline:r},editorKey:e||t||""}}else return{editorKey:"font_7",family:"helvetica-w01-roman",size:16,style:{}}}},me=class extends g{async selectColor(t,e){let n=await this.getPlatformPrivateAPI(),s=Wi(t),r=si(s);return await n.inputs.openColorPicker({color:s?.cssVariableName||s?.theme||s?.color},({color:a,theme:c,cssVariableTheme:p})=>{s={color:a,theme:c,cssVariableName:p},r=si(s),e?.onChange?.(r)}),r}async selectFont(t,e){let n=await this.getPlatformPrivateAPI(),s=ai(t),r=t;return await n.inputs.openFontPickerV2({...e,panelSectionsDefinition:{htmlTag:"hidden"},componentStyle:qi.transformFontInternalValue(s)},(a,c)=>{r={font:$i(a),textDecoration:a.underline?ri:void 0},e?.onChange?.(r)}),r}},Mn=new f(me).withPublicMethod("selectColor").withPublicMethod("selectFont").build(),Ie=class extends g{async openLanguageSupportPanel(){return(await this.getPlatformPrivateAPI()).panels.openLanguageSupportPanel()}async openFontsUploadPanel(){return(await this.getPlatformPrivateAPI()).panels.openFontsUploadPanel()}},Rn=new f(Ie).withPublicMethod("openLanguageSupportPanel").withPublicMethod("openFontsUploadPanel").build(),Ae=class extends g{async openDashboardModal(t){return(await this.getPlatformPrivateAPI()).panels.openDashboardPanel(await this.getAppDefinitionId(),t)}},Tn=new f(Ae).withPublicMethod("openDashboardModal").build(),we=class extends g{constructor(t=null,e=[]){super(t),this.overriddenApplicationContext=t,this.childPath=e}async getStyleDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getStyleDefinitions(e,this.childPath)}async getStyles(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getStyles(e,this.childPath)}async setStyles({cssProperties:t,cssCustomProperties:e}={}){let n=await this.getPlatformPrivateAPI(),s=await this.getRequiredManifestContextId();return n.builderComponent.setStyles(s,this.childPath,{cssProperties:t,cssCustomProperties:e})}async removeStyles(t={}){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.removeStyles(n,this.childPath,t)}async getDataDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getDataDefinitions(e,this.childPath)}async getData(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getData(e,this.childPath)}async getResolvedData({dataItemKey:t}){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.getResolvedData(n,this.childPath,{dataItemKey:t})}async setData(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.setData(n,this.childPath,t)}async getPresetDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getPresetDefinitions(e,this.childPath)}async getAppliedPreset(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getAppliedPreset(e,this.childPath)}async applyPreset(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.applyPreset(n,this.childPath,t)}async getDisplayGroupDefinitions(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.getDisplayGroupDefinitions(n,this.childPath,t)}async getState(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getState(e,this.childPath)}async setState(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.setState(n,this.childPath,t)}async getStateDefinitions(){let t=await this.getPlatformPrivateAPI(),e=await this.getRequiredManifestContextId();return t.builderComponent.getStateDefinitions(e,this.childPath)}async onChange(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.onContextualManifestChange(n,t)}async selectFont(t){try{let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return await e.builderComponent.selectFont(n,this.childPath,{...t,showWeights:!0})}catch{}}async selectFontFamily(t){try{let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return await e.builderComponent.selectFont(n,this.childPath,{...t,showWeights:!1})}catch{}}async selectMedia(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectMedia(n,this.childPath,t)}async selectLink(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectLink(n,this.childPath,t)}async selectColor(t){let e=await this.getPlatformPrivateAPI();try{let n=await this.getRequiredManifestContextId();return await e.builderComponent.selectColor(n,this.childPath,t)}catch{}}async selectFontWeight(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectFontWeight(n,this.childPath,t)}async selectTextTheme(t){let e=await this.getPlatformPrivateAPI(),n=await this.getRequiredManifestContextId();return e.builderComponent.selectTextTheme(n,t)}},_n=new f(we).withPublicMethod("getDataDefinitions").withPublicMethod("getData").withPublicMethod("getResolvedData").withPublicMethod("setData").withPublicMethod("getStyleDefinitions").withPublicMethod("getStyles").withPublicMethod("setStyles").withPublicMethod("removeStyles").withPublicMethod("getPresetDefinitions").withPublicMethod("getAppliedPreset").withPublicMethod("applyPreset").withPublicMethod("getDisplayGroupDefinitions").withPublicMethod("getState").withPublicMethod("setState").withPublicMethod("onChange").withPublicMethod("getStateDefinitions").withPublicMethod("selectFont").withPublicMethod("selectFontFamily").withPublicMethod("selectMedia").withPublicMethod("selectLink").withPublicMethod("selectColor").withPublicMethod("selectFontWeight").withPublicMethod("selectTextTheme").build(),ye=class extends g{async get(t){return(await this.getPlatformPrivateAPI()).userPreferences.get(await this.getAppDefinitionId(),t)}async set(t){return(await this.getPlatformPrivateAPI()).userPreferences.set(await this.getAppDefinitionId(),t)}},Dn=new f(ye).withPublicMethod("set").withPublicMethod("get").build(),ve=class extends g{async getData(){return(await this.getPlatformPrivateAPI()).externalPanels.getData()}async setData(t){return(await this.getPlatformPrivateAPI()).externalPanels.setData(t)}async getStyle(){return(await this.getPlatformPrivateAPI()).externalPanels.getStyle()}async setStyle(t){return(await this.getPlatformPrivateAPI()).externalPanels.setStyle(t)}async getTheme(){return(await this.getPlatformPrivateAPI()).externalPanels.getTheme()}async selectMedia(){return(await this.getPlatformPrivateAPI()).externalPanels.selectMedia()}async selectLink(...t){return(await this.getPlatformPrivateAPI()).externalPanels.selectLink(...t)}async selectColor(...t){return async()=>(await this.getPlatformPrivateAPI()).externalPanels.selectColor(...t)}async translate(t,e){return(await this.getPlatformPrivateAPI()).externalPanels.translate(t,e)}},Sn=new f(ve).withPublicMethod("getTheme").withPublicMethod("getData").withPublicMethod("getStyle").withPublicMethod("selectColor").withPublicMethod("selectLink").withPublicMethod("selectMedia").withPublicMethod("setData").withPublicMethod("setStyle").withPublicMethod("translate").build(),oi=(i=>(i.UndefinedCompRef="UndefinedCompRef",i))(oi||{}),be=class extends I{constructor(t,e){super(t,e,"Controllers Error")}},Bi=y(be),Ft,ci,Ee=class extends g{constructor(){super(...arguments);h(this,Ft)}async get(){return(await this.getPlatformPrivateAPI()).controllers.get(await this.getAppDefinitionId(),await u(this,Ft,ci).call(this))}};Ft=new WeakSet,ci=async function(){let s=(await(await this.getPlatformPrivateAPI()).components.getSelectedComponents())[0];if(!s)throw Bi(oi.UndefinedCompRef);return s};var Nn=new f(Ee).withPublicMethod("get").build(),kt=class{constructor(t,e,n,s){this.privateAPI=t,this.compRef=e,this.bindingTargetId=n,this.config=s}update(t){return this.privateAPI.bindings.update(this.compRef,this.bindingTargetId,{config:t.config,role:t.role})}delete(){return this.privateAPI.bindings.delete(this.compRef,this.bindingTargetId)}},Ce=class extends g{async get(t){let e=await this.getPlatformPrivateAPI(),n=await e.components.getSelectedComponents();if(n.length!==1)return null;let[s]=n,r=e.bindings.get(t.id,s);return r?new kt(e,s,t.id,r):null}},On=new f(Ce).withPublicMethod("get").build(),Ki="Data Binding",{dataBindingPanelId:zi,bindingItemName:Gi}={dataBindingPanelId:"",bindingItemName:"dataBinding"},xe=class{constructor(t,e,n,s,r){this.privateAPI=t,this.compRef=e,this.dataItemTarget=n,this.name=s,this.dataBindingPanelId=r}select(){return this.privateAPI.bindings.openDataBindingPanel(this.dataItemTarget.id,this.dataBindingPanelId)}createBinding(t){return this.privateAPI.bindings.create(this.compRef,{dataItemId:this.dataItemTarget.id,bindingItemType:Gi,...t})?new kt(this.privateAPI,this.compRef,this.dataItemTarget.id,JSON.stringify(t)):null}},Me=class extends g{async list(t){let e=await this.getPlatformPrivateAPI(),n=await e.components.getSelectedComponents();if(n.length!==1)return[];let[s]=n;return await e.bindings.canCreateBindingsProvider(s)?[new xe(e,s,t,Ki,zi)]:[]}},kn=new f(Me).withPublicMethod("list").build(),Re=class{constructor(t){l(this,"getContextIds",()=>{throw new Error("Not implemented yet")});l(this,"openItemSelector",t=>{throw new Error("Not implemented yet")});this.applicationContext=t}async adminAPI(){return await(await this.applicationContext).getPrivateAPI().admin}},lt,Lt=class{constructor(t){h(this,lt);A(this,lt,new Re(t))}getAPI(){return o(this,lt)}};lt=new WeakMap;var Vi=()=>{let i=new URLSearchParams(window.location.search),t=i.has("essentials")?JSON.parse(i.get("essentials")):void 0,{monitoring:e,...n}=t||{},s=i.get("appDefinitionId"),{context:r,config:a}=e||{},c=Oe({hostContext:{appId:s,...r},monitoringConfig:a,sentrySDK:typeof window<"u"?window.Sentry:void 0}),p=v.getInstance(),d=new Lt(p);return{environment:{},applicationContext:p,channel:{observeState:async()=>({disconnect(){}})},getMonitoringClient:c,admin:d.getAPI(),essentials:n}},Ji=()=>{let i=v.getInstance(),t=new Lt(i);return{environment:{},applicationContext:i,channel:{observeState:async()=>({disconnect(){}})},admin:t.getAPI()}},Te={host:()=>typeof importScripts=="function"?Ji():Vi(),auth:ki};var $n=()=>{let i=Te.host(),t=Te.auth();Se({auth:t,host:i}).enableContext("module")};export{$n as enableClient};
8
8
  //# sourceMappingURL=editor.js.map