@shopify/ui-extensions-server-kit 5.4.0 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +3 -5
  4. package/dist/ExtensionServerClient/server-types.d.ts +31 -7
  5. package/dist/_virtual/jsx-runtime.cjs.js +1 -0
  6. package/dist/_virtual/jsx-runtime.cjs2.js +1 -0
  7. package/dist/_virtual/jsx-runtime.es.js +5 -0
  8. package/dist/_virtual/jsx-runtime.es2.js +4 -0
  9. package/dist/_virtual/react-jsx-runtime.development.cjs.js +1 -0
  10. package/dist/_virtual/react-jsx-runtime.development.es.js +4 -0
  11. package/dist/_virtual/react-jsx-runtime.production.min.cjs.js +1 -0
  12. package/dist/_virtual/react-jsx-runtime.production.min.es.js +4 -0
  13. package/dist/i18n.d.ts +2 -8
  14. package/dist/index.cjs.js +1 -1
  15. package/dist/index.cjs2.js +1 -1
  16. package/dist/index.es.js +18 -18
  17. package/dist/index.es2.js +3 -3
  18. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +22 -0
  19. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.es.js +604 -0
  20. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.cjs.js +9 -0
  21. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.es.js +28 -0
  22. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.cjs.js +1 -0
  23. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.es.js +10 -0
  24. package/dist/packages/ui-extensions-server-kit/src/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -0
  25. package/dist/{ExtensionServerClient → packages/ui-extensions-server-kit/src/ExtensionServerClient}/ExtensionServerClient.es.js +21 -18
  26. package/dist/packages/ui-extensions-server-kit/src/context/ExtensionServerProvider.cjs.js +1 -0
  27. package/dist/packages/ui-extensions-server-kit/src/context/ExtensionServerProvider.es.js +30 -0
  28. package/dist/{context → packages/ui-extensions-server-kit/src/context}/constants.cjs.js +1 -1
  29. package/dist/packages/ui-extensions-server-kit/src/hooks/useExtensionServerContext.cjs.js +1 -0
  30. package/dist/{hooks → packages/ui-extensions-server-kit/src/hooks}/useExtensionServerContext.es.js +3 -2
  31. package/dist/packages/ui-extensions-server-kit/src/testing/MockExtensionServerProvider.cjs.js +1 -0
  32. package/dist/packages/ui-extensions-server-kit/src/testing/MockExtensionServerProvider.es.js +25 -0
  33. package/dist/packages/ui-extensions-server-kit/src/utilities/isUIExtension.cjs.js +1 -0
  34. package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/isUIExtension.es.js +3 -2
  35. package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/isValidSurface.cjs.js +1 -1
  36. package/dist/packages/ui-extensions-server-kit/src/utilities/isValidSurface.es.js +7 -0
  37. package/dist/types.d.ts +11 -8
  38. package/dist/utilities/isUIExtension.d.ts +1 -1
  39. package/dist/utilities/isValidSurface.d.ts +1 -1
  40. package/dist/utilities/set.d.ts +1 -1
  41. package/node_modules/{@shopify/react-testing/LICENSE.md → @testing-library/react/LICENSE} +2 -3
  42. package/node_modules/@testing-library/react/README.md +692 -0
  43. package/node_modules/@testing-library/react/dist/@testing-library/react.cjs.js +537 -0
  44. package/node_modules/@testing-library/react/dist/@testing-library/react.esm.js +497 -0
  45. package/node_modules/@testing-library/react/dist/@testing-library/react.pure.cjs.js +501 -0
  46. package/node_modules/@testing-library/react/dist/@testing-library/react.pure.esm.js +461 -0
  47. package/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.js +502 -0
  48. package/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.js.map +1 -0
  49. package/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.min.js +2 -0
  50. package/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.min.js.map +1 -0
  51. package/node_modules/@testing-library/react/dist/@testing-library/react.umd.js +538 -0
  52. package/node_modules/@testing-library/react/dist/@testing-library/react.umd.js.map +1 -0
  53. package/node_modules/@testing-library/react/dist/@testing-library/react.umd.min.js +2 -0
  54. package/node_modules/@testing-library/react/dist/@testing-library/react.umd.min.js.map +1 -0
  55. package/node_modules/@testing-library/react/dist/act-compat.js +80 -0
  56. package/node_modules/@testing-library/react/dist/config.js +33 -0
  57. package/node_modules/@testing-library/react/dist/fire-event.js +70 -0
  58. package/node_modules/@testing-library/react/dist/index.js +52 -0
  59. package/node_modules/@testing-library/react/dist/pure.js +356 -0
  60. package/node_modules/@testing-library/react/dont-cleanup-after-each.js +1 -0
  61. package/node_modules/@testing-library/react/package.json +116 -0
  62. package/node_modules/@testing-library/react/pure.d.ts +1 -0
  63. package/node_modules/@testing-library/react/pure.js +2 -0
  64. package/node_modules/@testing-library/react/types/index.d.ts +287 -0
  65. package/node_modules/@testing-library/react/types/pure.d.ts +1 -0
  66. package/node_modules/@vitejs/plugin-react/README.md +159 -0
  67. package/node_modules/@vitejs/plugin-react/dist/index.d.ts +75 -0
  68. package/node_modules/@vitejs/plugin-react/dist/index.js +401 -0
  69. package/node_modules/@vitejs/plugin-react/dist/refresh-runtime.js +663 -0
  70. package/node_modules/@vitejs/plugin-react/package.json +77 -0
  71. package/node_modules/@vitejs/plugin-react/types/preamble.d.ts +1 -0
  72. package/package.json +8 -9
  73. package/project.json +1 -1
  74. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +6 -5
  75. package/src/ExtensionServerClient/ExtensionServerClient.ts +27 -19
  76. package/src/ExtensionServerClient/server-types.ts +17 -7
  77. package/src/ExtensionServerClient/types.ts +0 -2
  78. package/src/context/ExtensionServerProvider.test.tsx +55 -73
  79. package/src/context/ExtensionServerProvider.tsx +1 -0
  80. package/src/i18n.ts +2 -5
  81. package/src/state/reducers/extensionServerReducer.test.ts +2 -2
  82. package/src/types.ts +11 -6
  83. package/src/utilities/assetToString.ts +0 -1
  84. package/src/utilities/isUIExtension.ts +5 -4
  85. package/src/utilities/isValidSurface.ts +2 -3
  86. package/src/utilities/replaceUpdated.ts +0 -2
  87. package/src/utilities/set.ts +10 -5
  88. package/tests/setup.ts +1 -4
  89. package/vite.config.mts +57 -0
  90. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +0 -1
  91. package/dist/context/ExtensionServerProvider.cjs.js +0 -1
  92. package/dist/context/ExtensionServerProvider.es.js +0 -29
  93. package/dist/hooks/useExtensionServerContext.cjs.js +0 -1
  94. package/dist/testing/MockExtensionServerProvider.cjs.js +0 -1
  95. package/dist/testing/MockExtensionServerProvider.es.js +0 -24
  96. package/dist/utilities/isUIExtension.cjs.js +0 -1
  97. package/dist/utilities/isValidSurface.es.js +0 -7
  98. package/node_modules/@shopify/react-testing/README.md +0 -711
  99. package/node_modules/@shopify/react-testing/build/cjs/TestWrapper.js +0 -52
  100. package/node_modules/@shopify/react-testing/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -47
  101. package/node_modules/@shopify/react-testing/build/cjs/compat.js +0 -14
  102. package/node_modules/@shopify/react-testing/build/cjs/destroy.js +0 -13
  103. package/node_modules/@shopify/react-testing/build/cjs/element.js +0 -225
  104. package/node_modules/@shopify/react-testing/build/cjs/index.js +0 -21
  105. package/node_modules/@shopify/react-testing/build/cjs/matchers/components.js +0 -46
  106. package/node_modules/@shopify/react-testing/build/cjs/matchers/context.js +0 -25
  107. package/node_modules/@shopify/react-testing/build/cjs/matchers/index.js +0 -16
  108. package/node_modules/@shopify/react-testing/build/cjs/matchers/props.js +0 -38
  109. package/node_modules/@shopify/react-testing/build/cjs/matchers/strings.js +0 -42
  110. package/node_modules/@shopify/react-testing/build/cjs/matchers/utilities.js +0 -110
  111. package/node_modules/@shopify/react-testing/build/cjs/mount.js +0 -76
  112. package/node_modules/@shopify/react-testing/build/cjs/root.js +0 -284
  113. package/node_modules/@shopify/react-testing/build/cjs/toReactString.js +0 -86
  114. package/node_modules/@shopify/react-testing/build/cjs/types.js +0 -28
  115. package/node_modules/@shopify/react-testing/build/esm/TestWrapper.mjs +0 -44
  116. package/node_modules/@shopify/react-testing/build/esm/_virtual/_rollupPluginBabelHelpers.mjs +0 -42
  117. package/node_modules/@shopify/react-testing/build/esm/compat.mjs +0 -10
  118. package/node_modules/@shopify/react-testing/build/esm/destroy.mjs +0 -9
  119. package/node_modules/@shopify/react-testing/build/esm/element.mjs +0 -221
  120. package/node_modules/@shopify/react-testing/build/esm/index.mjs +0 -5
  121. package/node_modules/@shopify/react-testing/build/esm/matchers/components.mjs +0 -41
  122. package/node_modules/@shopify/react-testing/build/esm/matchers/context.mjs +0 -21
  123. package/node_modules/@shopify/react-testing/build/esm/matchers/index.mjs +0 -14
  124. package/node_modules/@shopify/react-testing/build/esm/matchers/props.mjs +0 -33
  125. package/node_modules/@shopify/react-testing/build/esm/matchers/strings.mjs +0 -37
  126. package/node_modules/@shopify/react-testing/build/esm/matchers/utilities.mjs +0 -101
  127. package/node_modules/@shopify/react-testing/build/esm/mount.mjs +0 -70
  128. package/node_modules/@shopify/react-testing/build/esm/root.mjs +0 -275
  129. package/node_modules/@shopify/react-testing/build/esm/toReactString.mjs +0 -80
  130. package/node_modules/@shopify/react-testing/build/esm/types.mjs +0 -26
  131. package/node_modules/@shopify/react-testing/build/esnext/TestWrapper.esnext +0 -44
  132. package/node_modules/@shopify/react-testing/build/esnext/compat.esnext +0 -10
  133. package/node_modules/@shopify/react-testing/build/esnext/destroy.esnext +0 -9
  134. package/node_modules/@shopify/react-testing/build/esnext/element.esnext +0 -221
  135. package/node_modules/@shopify/react-testing/build/esnext/index.esnext +0 -5
  136. package/node_modules/@shopify/react-testing/build/esnext/matchers/components.esnext +0 -41
  137. package/node_modules/@shopify/react-testing/build/esnext/matchers/context.esnext +0 -21
  138. package/node_modules/@shopify/react-testing/build/esnext/matchers/index.esnext +0 -14
  139. package/node_modules/@shopify/react-testing/build/esnext/matchers/props.esnext +0 -33
  140. package/node_modules/@shopify/react-testing/build/esnext/matchers/strings.esnext +0 -37
  141. package/node_modules/@shopify/react-testing/build/esnext/matchers/utilities.esnext +0 -99
  142. package/node_modules/@shopify/react-testing/build/esnext/mount.esnext +0 -71
  143. package/node_modules/@shopify/react-testing/build/esnext/root.esnext +0 -275
  144. package/node_modules/@shopify/react-testing/build/esnext/toReactString.esnext +0 -80
  145. package/node_modules/@shopify/react-testing/build/esnext/types.esnext +0 -26
  146. package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts +0 -17
  147. package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts.map +0 -1
  148. package/node_modules/@shopify/react-testing/build/ts/compat.d.ts +0 -3
  149. package/node_modules/@shopify/react-testing/build/ts/compat.d.ts.map +0 -1
  150. package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts +0 -2
  151. package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts.map +0 -1
  152. package/node_modules/@shopify/react-testing/build/ts/element.d.ts +0 -42
  153. package/node_modules/@shopify/react-testing/build/ts/element.d.ts.map +0 -1
  154. package/node_modules/@shopify/react-testing/build/ts/index.d.ts +0 -7
  155. package/node_modules/@shopify/react-testing/build/ts/index.d.ts.map +0 -1
  156. package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts +0 -12
  157. package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts.map +0 -1
  158. package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts +0 -8
  159. package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts.map +0 -1
  160. package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts +0 -20
  161. package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts.map +0 -1
  162. package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts +0 -10
  163. package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts.map +0 -1
  164. package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts +0 -11
  165. package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts.map +0 -1
  166. package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts +0 -17
  167. package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts.map +0 -1
  168. package/node_modules/@shopify/react-testing/build/ts/mount.d.ts +0 -39
  169. package/node_modules/@shopify/react-testing/build/ts/mount.d.ts.map +0 -1
  170. package/node_modules/@shopify/react-testing/build/ts/root.d.ts +0 -55
  171. package/node_modules/@shopify/react-testing/build/ts/root.d.ts.map +0 -1
  172. package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts +0 -5
  173. package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts.map +0 -1
  174. package/node_modules/@shopify/react-testing/build/ts/types.d.ts +0 -89
  175. package/node_modules/@shopify/react-testing/build/ts/types.d.ts.map +0 -1
  176. package/node_modules/@shopify/react-testing/index.esnext +0 -1
  177. package/node_modules/@shopify/react-testing/index.js +0 -1
  178. package/node_modules/@shopify/react-testing/index.mjs +0 -1
  179. package/node_modules/@shopify/react-testing/matchers.esnext +0 -1
  180. package/node_modules/@shopify/react-testing/matchers.js +0 -1
  181. package/node_modules/@shopify/react-testing/matchers.mjs +0 -1
  182. package/node_modules/@shopify/react-testing/package.json +0 -69
  183. package/node_modules/@shopify/ui-extensions-test-utils/CHANGELOG.md +0 -66
  184. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.d.ts +0 -3
  185. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.js +0 -3
  186. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.d.ts +0 -2
  187. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.js +0 -5
  188. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.d.ts +0 -17
  189. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.js +0 -20
  190. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.d.ts +0 -9
  191. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +0 -7
  192. package/node_modules/@shopify/ui-extensions-test-utils/package.json +0 -40
  193. package/node_modules/@shopify/ui-extensions-test-utils/project.json +0 -39
  194. package/node_modules/@vitejs/plugin-react-refresh/README.md +0 -73
  195. package/node_modules/@vitejs/plugin-react-refresh/index.d.ts +0 -14
  196. package/node_modules/@vitejs/plugin-react-refresh/index.js +0 -239
  197. package/node_modules/@vitejs/plugin-react-refresh/package.json +0 -35
  198. /package/dist/{ExtensionServerClient → packages/ui-extensions-server-kit/src/ExtensionServerClient}/types.cjs.js +0 -0
  199. /package/dist/{ExtensionServerClient → packages/ui-extensions-server-kit/src/ExtensionServerClient}/types.es.js +0 -0
  200. /package/dist/{context → packages/ui-extensions-server-kit/src/context}/constants.es.js +0 -0
  201. /package/dist/{hooks → packages/ui-extensions-server-kit/src/hooks}/useExtensionServerState.cjs.js +0 -0
  202. /package/dist/{hooks → packages/ui-extensions-server-kit/src/hooks}/useExtensionServerState.es.js +0 -0
  203. /package/dist/{hooks → packages/ui-extensions-server-kit/src/hooks}/useIsomorphicLayoutEffect.cjs.js +0 -0
  204. /package/dist/{hooks → packages/ui-extensions-server-kit/src/hooks}/useIsomorphicLayoutEffect.es.js +0 -0
  205. /package/dist/{i18n.cjs.js → packages/ui-extensions-server-kit/src/i18n.cjs.js} +0 -0
  206. /package/dist/{i18n.es.js → packages/ui-extensions-server-kit/src/i18n.es.js} +0 -0
  207. /package/dist/{state → packages/ui-extensions-server-kit/src/state}/actions/actions.cjs.js +0 -0
  208. /package/dist/{state → packages/ui-extensions-server-kit/src/state}/actions/actions.es.js +0 -0
  209. /package/dist/{state → packages/ui-extensions-server-kit/src/state}/reducers/constants.cjs.js +0 -0
  210. /package/dist/{state → packages/ui-extensions-server-kit/src/state}/reducers/constants.es.js +0 -0
  211. /package/dist/{state → packages/ui-extensions-server-kit/src/state}/reducers/extensionServerReducer.cjs.js +0 -0
  212. /package/dist/{state → packages/ui-extensions-server-kit/src/state}/reducers/extensionServerReducer.es.js +0 -0
  213. /package/dist/{testing → packages/ui-extensions-server-kit/src/testing}/app.cjs.js +0 -0
  214. /package/dist/{testing → packages/ui-extensions-server-kit/src/testing}/app.es.js +0 -0
  215. /package/dist/{testing → packages/ui-extensions-server-kit/src/testing}/extensions.cjs.js +0 -0
  216. /package/dist/{testing → packages/ui-extensions-server-kit/src/testing}/extensions.es.js +0 -0
  217. /package/dist/{types.cjs.js → packages/ui-extensions-server-kit/src/types.cjs.js} +0 -0
  218. /package/dist/{types.es.js → packages/ui-extensions-server-kit/src/types.es.js} +0 -0
  219. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/assetToString.cjs.js +0 -0
  220. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/assetToString.es.js +0 -0
  221. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/noop.cjs.js +0 -0
  222. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/noop.es.js +0 -0
  223. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/replaceUpdated.cjs.js +0 -0
  224. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/replaceUpdated.es.js +0 -0
  225. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/set.cjs.js +0 -0
  226. /package/dist/{utilities → packages/ui-extensions-server-kit/src/utilities}/set.es.js +0 -0
  227. /package/node_modules/@vitejs/{plugin-react-refresh → plugin-react}/LICENSE +0 -0
@@ -0,0 +1,604 @@
1
+ import { __exports as m } from "../../../../../../_virtual/react-jsx-runtime.development.es.js";
2
+ import ir from "react";
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.development.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var Ee;
13
+ function sr() {
14
+ return Ee ? m : (Ee = 1, process.env.NODE_ENV !== "production" && (function() {
15
+ var ye = ir, k = Symbol.for("react.element"), Re = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), K = Symbol.for("react.provider"), N = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), _e = Symbol.for("react.offscreen"), q = Symbol.iterator, me = "@@iterator";
16
+ function Te(e) {
17
+ if (e === null || typeof e != "object")
18
+ return null;
19
+ var r = q && e[q] || e[me];
20
+ return typeof r == "function" ? r : null;
21
+ }
22
+ var h = ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
23
+ function f(e) {
24
+ {
25
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
26
+ t[n - 1] = arguments[n];
27
+ Ce("error", e, t);
28
+ }
29
+ }
30
+ function Ce(e, r, t) {
31
+ {
32
+ var n = h.ReactDebugCurrentFrame, o = n.getStackAddendum();
33
+ o !== "" && (r += "%s", t = t.concat([o]));
34
+ var u = t.map(function(i) {
35
+ return String(i);
36
+ });
37
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
38
+ }
39
+ }
40
+ var Oe = !1, Pe = !1, Se = !1, we = !1, je = !1, G;
41
+ G = Symbol.for("react.module.reference");
42
+ function ke(e) {
43
+ return !!(typeof e == "string" || typeof e == "function" || e === T || e === B || je || e === U || e === x || e === D || we || e === _e || Oe || Pe || Se || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === O || e.$$typeof === K || e.$$typeof === N || e.$$typeof === C || // This needs to include all possible module reference object
44
+ // types supported by any Flight configuration anywhere since
45
+ // we don't know which Flight build this will end up being used
46
+ // with.
47
+ e.$$typeof === G || e.getModuleId !== void 0));
48
+ }
49
+ function xe(e, r, t) {
50
+ var n = e.displayName;
51
+ if (n)
52
+ return n;
53
+ var o = r.displayName || r.name || "";
54
+ return o !== "" ? t + "(" + o + ")" : t;
55
+ }
56
+ function J(e) {
57
+ return e.displayName || "Context";
58
+ }
59
+ function p(e) {
60
+ if (e == null)
61
+ return null;
62
+ if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
63
+ return e.displayName || e.name || null;
64
+ if (typeof e == "string")
65
+ return e;
66
+ switch (e) {
67
+ case T:
68
+ return "Fragment";
69
+ case Re:
70
+ return "Portal";
71
+ case B:
72
+ return "Profiler";
73
+ case U:
74
+ return "StrictMode";
75
+ case x:
76
+ return "Suspense";
77
+ case D:
78
+ return "SuspenseList";
79
+ }
80
+ if (typeof e == "object")
81
+ switch (e.$$typeof) {
82
+ case N:
83
+ var r = e;
84
+ return J(r) + ".Consumer";
85
+ case K:
86
+ var t = e;
87
+ return J(t._context) + ".Provider";
88
+ case C:
89
+ return xe(e, e.render, "ForwardRef");
90
+ case O:
91
+ var n = e.displayName || null;
92
+ return n !== null ? n : p(e.type) || "Memo";
93
+ case F: {
94
+ var o = e, u = o._payload, i = o._init;
95
+ try {
96
+ return p(i(u));
97
+ } catch {
98
+ return null;
99
+ }
100
+ }
101
+ }
102
+ return null;
103
+ }
104
+ var g = Object.assign, R = 0, z, X, H, Z, Q, ee, re;
105
+ function te() {
106
+ }
107
+ te.__reactDisabledLog = !0;
108
+ function De() {
109
+ {
110
+ if (R === 0) {
111
+ z = console.log, X = console.info, H = console.warn, Z = console.error, Q = console.group, ee = console.groupCollapsed, re = console.groupEnd;
112
+ var e = {
113
+ configurable: !0,
114
+ enumerable: !0,
115
+ value: te,
116
+ writable: !0
117
+ };
118
+ Object.defineProperties(console, {
119
+ info: e,
120
+ log: e,
121
+ warn: e,
122
+ error: e,
123
+ group: e,
124
+ groupCollapsed: e,
125
+ groupEnd: e
126
+ });
127
+ }
128
+ R++;
129
+ }
130
+ }
131
+ function Fe() {
132
+ {
133
+ if (R--, R === 0) {
134
+ var e = {
135
+ configurable: !0,
136
+ enumerable: !0,
137
+ writable: !0
138
+ };
139
+ Object.defineProperties(console, {
140
+ log: g({}, e, {
141
+ value: z
142
+ }),
143
+ info: g({}, e, {
144
+ value: X
145
+ }),
146
+ warn: g({}, e, {
147
+ value: H
148
+ }),
149
+ error: g({}, e, {
150
+ value: Z
151
+ }),
152
+ group: g({}, e, {
153
+ value: Q
154
+ }),
155
+ groupCollapsed: g({}, e, {
156
+ value: ee
157
+ }),
158
+ groupEnd: g({}, e, {
159
+ value: re
160
+ })
161
+ });
162
+ }
163
+ R < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
164
+ }
165
+ }
166
+ var A = h.ReactCurrentDispatcher, I;
167
+ function P(e, r, t) {
168
+ {
169
+ if (I === void 0)
170
+ try {
171
+ throw Error();
172
+ } catch (o) {
173
+ var n = o.stack.trim().match(/\n( *(at )?)/);
174
+ I = n && n[1] || "";
175
+ }
176
+ return `
177
+ ` + I + e;
178
+ }
179
+ }
180
+ var $ = !1, S;
181
+ {
182
+ var Ae = typeof WeakMap == "function" ? WeakMap : Map;
183
+ S = new Ae();
184
+ }
185
+ function ne(e, r) {
186
+ if (!e || $)
187
+ return "";
188
+ {
189
+ var t = S.get(e);
190
+ if (t !== void 0)
191
+ return t;
192
+ }
193
+ var n;
194
+ $ = !0;
195
+ var o = Error.prepareStackTrace;
196
+ Error.prepareStackTrace = void 0;
197
+ var u;
198
+ u = A.current, A.current = null, De();
199
+ try {
200
+ if (r) {
201
+ var i = function() {
202
+ throw Error();
203
+ };
204
+ if (Object.defineProperty(i.prototype, "props", {
205
+ set: function() {
206
+ throw Error();
207
+ }
208
+ }), typeof Reflect == "object" && Reflect.construct) {
209
+ try {
210
+ Reflect.construct(i, []);
211
+ } catch (v) {
212
+ n = v;
213
+ }
214
+ Reflect.construct(e, [], i);
215
+ } else {
216
+ try {
217
+ i.call();
218
+ } catch (v) {
219
+ n = v;
220
+ }
221
+ e.call(i.prototype);
222
+ }
223
+ } else {
224
+ try {
225
+ throw Error();
226
+ } catch (v) {
227
+ n = v;
228
+ }
229
+ e();
230
+ }
231
+ } catch (v) {
232
+ if (v && n && typeof v.stack == "string") {
233
+ for (var a = v.stack.split(`
234
+ `), c = n.stack.split(`
235
+ `), s = a.length - 1, l = c.length - 1; s >= 1 && l >= 0 && a[s] !== c[l]; )
236
+ l--;
237
+ for (; s >= 1 && l >= 0; s--, l--)
238
+ if (a[s] !== c[l]) {
239
+ if (s !== 1 || l !== 1)
240
+ do
241
+ if (s--, l--, l < 0 || a[s] !== c[l]) {
242
+ var d = `
243
+ ` + a[s].replace(" at new ", " at ");
244
+ return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && S.set(e, d), d;
245
+ }
246
+ while (s >= 1 && l >= 0);
247
+ break;
248
+ }
249
+ }
250
+ } finally {
251
+ $ = !1, A.current = u, Fe(), Error.prepareStackTrace = o;
252
+ }
253
+ var y = e ? e.displayName || e.name : "", b = y ? P(y) : "";
254
+ return typeof e == "function" && S.set(e, b), b;
255
+ }
256
+ function Ie(e, r, t) {
257
+ return ne(e, !1);
258
+ }
259
+ function $e(e) {
260
+ var r = e.prototype;
261
+ return !!(r && r.isReactComponent);
262
+ }
263
+ function w(e, r, t) {
264
+ if (e == null)
265
+ return "";
266
+ if (typeof e == "function")
267
+ return ne(e, $e(e));
268
+ if (typeof e == "string")
269
+ return P(e);
270
+ switch (e) {
271
+ case x:
272
+ return P("Suspense");
273
+ case D:
274
+ return P("SuspenseList");
275
+ }
276
+ if (typeof e == "object")
277
+ switch (e.$$typeof) {
278
+ case C:
279
+ return Ie(e.render);
280
+ case O:
281
+ return w(e.type, r, t);
282
+ case F: {
283
+ var n = e, o = n._payload, u = n._init;
284
+ try {
285
+ return w(u(o), r, t);
286
+ } catch {
287
+ }
288
+ }
289
+ }
290
+ return "";
291
+ }
292
+ var _ = Object.prototype.hasOwnProperty, ae = {}, ie = h.ReactDebugCurrentFrame;
293
+ function j(e) {
294
+ if (e) {
295
+ var r = e._owner, t = w(e.type, e._source, r ? r.type : null);
296
+ ie.setExtraStackFrame(t);
297
+ } else
298
+ ie.setExtraStackFrame(null);
299
+ }
300
+ function We(e, r, t, n, o) {
301
+ {
302
+ var u = Function.call.bind(_);
303
+ for (var i in e)
304
+ if (u(e, i)) {
305
+ var a = void 0;
306
+ try {
307
+ if (typeof e[i] != "function") {
308
+ var c = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
309
+ throw c.name = "Invariant Violation", c;
310
+ }
311
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
312
+ } catch (s) {
313
+ a = s;
314
+ }
315
+ a && !(a instanceof Error) && (j(o), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), j(null)), a instanceof Error && !(a.message in ae) && (ae[a.message] = !0, j(o), f("Failed %s type: %s", t, a.message), j(null));
316
+ }
317
+ }
318
+ }
319
+ var Ye = Array.isArray;
320
+ function W(e) {
321
+ return Ye(e);
322
+ }
323
+ function Me(e) {
324
+ {
325
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
326
+ return t;
327
+ }
328
+ }
329
+ function Ve(e) {
330
+ try {
331
+ return oe(e), !1;
332
+ } catch {
333
+ return !0;
334
+ }
335
+ }
336
+ function oe(e) {
337
+ return "" + e;
338
+ }
339
+ function ue(e) {
340
+ if (Ve(e))
341
+ return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Me(e)), oe(e);
342
+ }
343
+ var se = h.ReactCurrentOwner, Le = {
344
+ key: !0,
345
+ ref: !0,
346
+ __self: !0,
347
+ __source: !0
348
+ }, le, fe;
349
+ function Ue(e) {
350
+ if (_.call(e, "ref")) {
351
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
352
+ if (r && r.isReactWarning)
353
+ return !1;
354
+ }
355
+ return e.ref !== void 0;
356
+ }
357
+ function Be(e) {
358
+ if (_.call(e, "key")) {
359
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
360
+ if (r && r.isReactWarning)
361
+ return !1;
362
+ }
363
+ return e.key !== void 0;
364
+ }
365
+ function Ke(e, r) {
366
+ typeof e.ref == "string" && se.current;
367
+ }
368
+ function Ne(e, r) {
369
+ {
370
+ var t = function() {
371
+ le || (le = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
372
+ };
373
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
374
+ get: t,
375
+ configurable: !0
376
+ });
377
+ }
378
+ }
379
+ function qe(e, r) {
380
+ {
381
+ var t = function() {
382
+ fe || (fe = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
383
+ };
384
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
385
+ get: t,
386
+ configurable: !0
387
+ });
388
+ }
389
+ }
390
+ var Ge = function(e, r, t, n, o, u, i) {
391
+ var a = {
392
+ // This tag allows us to uniquely identify this as a React Element
393
+ $$typeof: k,
394
+ // Built-in properties that belong on the element
395
+ type: e,
396
+ key: r,
397
+ ref: t,
398
+ props: i,
399
+ // Record the component responsible for creating this element.
400
+ _owner: u
401
+ };
402
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
403
+ configurable: !1,
404
+ enumerable: !1,
405
+ writable: !0,
406
+ value: !1
407
+ }), Object.defineProperty(a, "_self", {
408
+ configurable: !1,
409
+ enumerable: !1,
410
+ writable: !1,
411
+ value: n
412
+ }), Object.defineProperty(a, "_source", {
413
+ configurable: !1,
414
+ enumerable: !1,
415
+ writable: !1,
416
+ value: o
417
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
418
+ };
419
+ function Je(e, r, t, n, o) {
420
+ {
421
+ var u, i = {}, a = null, c = null;
422
+ t !== void 0 && (ue(t), a = "" + t), Be(r) && (ue(r.key), a = "" + r.key), Ue(r) && (c = r.ref, Ke(r, o));
423
+ for (u in r)
424
+ _.call(r, u) && !Le.hasOwnProperty(u) && (i[u] = r[u]);
425
+ if (e && e.defaultProps) {
426
+ var s = e.defaultProps;
427
+ for (u in s)
428
+ i[u] === void 0 && (i[u] = s[u]);
429
+ }
430
+ if (a || c) {
431
+ var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
432
+ a && Ne(i, l), c && qe(i, l);
433
+ }
434
+ return Ge(e, a, c, o, n, se.current, i);
435
+ }
436
+ }
437
+ var Y = h.ReactCurrentOwner, ce = h.ReactDebugCurrentFrame;
438
+ function E(e) {
439
+ if (e) {
440
+ var r = e._owner, t = w(e.type, e._source, r ? r.type : null);
441
+ ce.setExtraStackFrame(t);
442
+ } else
443
+ ce.setExtraStackFrame(null);
444
+ }
445
+ var M;
446
+ M = !1;
447
+ function V(e) {
448
+ return typeof e == "object" && e !== null && e.$$typeof === k;
449
+ }
450
+ function ve() {
451
+ {
452
+ if (Y.current) {
453
+ var e = p(Y.current.type);
454
+ if (e)
455
+ return `
456
+
457
+ Check the render method of \`` + e + "`.";
458
+ }
459
+ return "";
460
+ }
461
+ }
462
+ function ze(e) {
463
+ return "";
464
+ }
465
+ var de = {};
466
+ function Xe(e) {
467
+ {
468
+ var r = ve();
469
+ if (!r) {
470
+ var t = typeof e == "string" ? e : e.displayName || e.name;
471
+ t && (r = `
472
+
473
+ Check the top-level render call using <` + t + ">.");
474
+ }
475
+ return r;
476
+ }
477
+ }
478
+ function pe(e, r) {
479
+ {
480
+ if (!e._store || e._store.validated || e.key != null)
481
+ return;
482
+ e._store.validated = !0;
483
+ var t = Xe(r);
484
+ if (de[t])
485
+ return;
486
+ de[t] = !0;
487
+ var n = "";
488
+ e && e._owner && e._owner !== Y.current && (n = " It was passed a child from " + p(e._owner.type) + "."), E(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), E(null);
489
+ }
490
+ }
491
+ function ge(e, r) {
492
+ {
493
+ if (typeof e != "object")
494
+ return;
495
+ if (W(e))
496
+ for (var t = 0; t < e.length; t++) {
497
+ var n = e[t];
498
+ V(n) && pe(n, r);
499
+ }
500
+ else if (V(e))
501
+ e._store && (e._store.validated = !0);
502
+ else if (e) {
503
+ var o = Te(e);
504
+ if (typeof o == "function" && o !== e.entries)
505
+ for (var u = o.call(e), i; !(i = u.next()).done; )
506
+ V(i.value) && pe(i.value, r);
507
+ }
508
+ }
509
+ }
510
+ function He(e) {
511
+ {
512
+ var r = e.type;
513
+ if (r == null || typeof r == "string")
514
+ return;
515
+ var t;
516
+ if (typeof r == "function")
517
+ t = r.propTypes;
518
+ else if (typeof r == "object" && (r.$$typeof === C || // Note: Memo only checks outer props here.
519
+ // Inner props are checked in the reconciler.
520
+ r.$$typeof === O))
521
+ t = r.propTypes;
522
+ else
523
+ return;
524
+ if (t) {
525
+ var n = p(r);
526
+ We(t, e.props, "prop", n, e);
527
+ } else if (r.PropTypes !== void 0 && !M) {
528
+ M = !0;
529
+ var o = p(r);
530
+ f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
531
+ }
532
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
533
+ }
534
+ }
535
+ function Ze(e) {
536
+ {
537
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
538
+ var n = r[t];
539
+ if (n !== "children" && n !== "key") {
540
+ E(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), E(null);
541
+ break;
542
+ }
543
+ }
544
+ e.ref !== null && (E(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), E(null));
545
+ }
546
+ }
547
+ var be = {};
548
+ function he(e, r, t, n, o, u) {
549
+ {
550
+ var i = ke(e);
551
+ if (!i) {
552
+ var a = "";
553
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
554
+ var c = ze();
555
+ c ? a += c : a += ve();
556
+ var s;
557
+ e === null ? s = "null" : W(e) ? s = "array" : e !== void 0 && e.$$typeof === k ? (s = "<" + (p(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
558
+ }
559
+ var l = Je(e, r, t, o, u);
560
+ if (l == null)
561
+ return l;
562
+ if (i) {
563
+ var d = r.children;
564
+ if (d !== void 0)
565
+ if (n)
566
+ if (W(d)) {
567
+ for (var y = 0; y < d.length; y++)
568
+ ge(d[y], e);
569
+ Object.freeze && Object.freeze(d);
570
+ } else
571
+ f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
572
+ else
573
+ ge(d, e);
574
+ }
575
+ if (_.call(r, "key")) {
576
+ var b = p(e), v = Object.keys(r).filter(function(ar) {
577
+ return ar !== "key";
578
+ }), L = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
579
+ if (!be[b + L]) {
580
+ var nr = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
581
+ f(`A props object containing a "key" prop is being spread into JSX:
582
+ let props = %s;
583
+ <%s {...props} />
584
+ React keys must be passed directly to JSX without using spread:
585
+ let props = %s;
586
+ <%s key={someKey} {...props} />`, L, b, nr, b), be[b + L] = !0;
587
+ }
588
+ }
589
+ return e === T ? Ze(l) : He(l), l;
590
+ }
591
+ }
592
+ function Qe(e, r, t) {
593
+ return he(e, r, t, !0);
594
+ }
595
+ function er(e, r, t) {
596
+ return he(e, r, t, !1);
597
+ }
598
+ var rr = er, tr = Qe;
599
+ m.Fragment = T, m.jsx = rr, m.jsxs = tr;
600
+ })(), m);
601
+ }
602
+ export {
603
+ sr as __require
604
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../../../_virtual/react-jsx-runtime.production.min.cjs.js"),R=require("react");/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var p;function a(){if(p)return t.__exports;p=1;var f=R,c=Symbol.for("react.element"),l=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function u(o,e,i){var r,n={},_=null,s=null;i!==void 0&&(_=""+i),e.key!==void 0&&(_=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)d.call(e,r)&&!y.hasOwnProperty(r)&&(n[r]=e[r]);if(o&&o.defaultProps)for(r in e=o.defaultProps,e)n[r]===void 0&&(n[r]=e[r]);return{$$typeof:c,type:o,key:_,ref:s,props:n,_owner:m.current}}return t.__exports.Fragment=l,t.__exports.jsx=u,t.__exports.jsxs=u,t.__exports}exports.__require=a;
@@ -0,0 +1,28 @@
1
+ import { __exports as t } from "../../../../../../_virtual/react-jsx-runtime.production.min.es.js";
2
+ import R from "react";
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var p;
13
+ function v() {
14
+ if (p) return t;
15
+ p = 1;
16
+ var s = R, m = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function _(o, r, i) {
18
+ var e, n = {}, u = null, f = null;
19
+ i !== void 0 && (u = "" + i), r.key !== void 0 && (u = "" + r.key), r.ref !== void 0 && (f = r.ref);
20
+ for (e in r) c.call(r, e) && !y.hasOwnProperty(e) && (n[e] = r[e]);
21
+ if (o && o.defaultProps) for (e in r = o.defaultProps, r) n[e] === void 0 && (n[e] = r[e]);
22
+ return { $$typeof: m, type: o, key: u, ref: f, props: n, _owner: d.current };
23
+ }
24
+ return t.Fragment = l, t.jsx = _, t.jsxs = _, t;
25
+ }
26
+ export {
27
+ v as __require
28
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../../_virtual/jsx-runtime.cjs2.js"),t=require("./cjs/react-jsx-runtime.production.min.cjs.js"),u=require("./cjs/react-jsx-runtime.development.cjs.js");var r;function i(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=u.__require()),e.__module.exports}exports.__require=i;
@@ -0,0 +1,10 @@
1
+ import { __module as e } from "../../../../../_virtual/jsx-runtime.es2.js";
2
+ import { __require as i } from "./cjs/react-jsx-runtime.production.min.es.js";
3
+ import { __require as t } from "./cjs/react-jsx-runtime.development.es.js";
4
+ var r;
5
+ function m() {
6
+ return r ? e.exports : (r = 1, process.env.NODE_ENV === "production" ? e.exports = i() : e.exports = t(), e.exports);
7
+ }
8
+ export {
9
+ m as __require
10
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../i18n.cjs.js"),E=require("../utilities/isValidSurface.cjs.js"),f=require("../utilities/isUIExtension.cjs.js");class g{constructor(n={}){this.EVENT_THAT_WILL_MUTATE_THE_SERVER=["update"],this.listeners={},this.connectionListeners={close:new Set,open:new Set},this.connected=!1,this.uiExtensionsByUuid={},this.id=(Math.random()+1).toString(36).substring(7),this.options=p({...n,connection:{automaticConnect:!0,protocols:[],...n.connection??{}}}),this.setupConnection(this.options.connection.automaticConnect)}connect(n={connection:{}}){const t=S(this.options,n);return JSON.stringify(t)!==JSON.stringify(this.options)&&(this.options=t,this.setupConnection(!0)),()=>{this.closeConnection()}}on(n,t){return this.listeners[n]||(this.listeners[n]=new Set),this.listeners[n].add(t),()=>this.listeners[n].delete(t)}persist(n,t){var s,e,i;if(this.EVENT_THAT_WILL_MUTATE_THE_SERVER.includes(n))return this.options.locales?((e=t.extensions)==null||e.forEach(c=>{d.TRANSLATED_KEYS.forEach(o=>{var l;f.isUIExtension(c)&&((l=c.extensionPoints)==null||l.forEach(a=>{delete a[o]})),delete c[o]})}),(i=this.connection)==null?void 0:i.send(JSON.stringify({event:n,data:t}))):(s=this.connection)==null?void 0:s.send(JSON.stringify({event:n,data:t}));console.warn('You tried to use "persist" with a dispatch event. Please use the "emit" method instead.')}emit(...n){var e;const t=n[0],s=n.length>1?n[1]:void 0;if(this.EVENT_THAT_WILL_MUTATE_THE_SERVER.includes(t))return console.warn(`You tried to use "emit" with a the "${t}" event. Please use the "persist" method instead to persist changes to the server.`);(e=this.connection)==null||e.send(JSON.stringify({event:"dispatch",data:{type:t,payload:s}}))}onConnection(n,t){return this.connectionListeners[n].add(t),()=>this.connectionListeners[n].delete(t)}initializeConnection(){var n;this.connection&&(this.connection.addEventListener("open",t=>{this.connected=!0,this.connectionListeners.open.forEach(s=>s(t))}),this.connection.addEventListener("close",t=>{this.connected=!1,this.connectionListeners.close.forEach(s=>s(t))}),(n=this.connection)==null||n.addEventListener("message",t=>{var s,e;try{const{event:i,data:c}=JSON.parse(t.data),o=c;if(i==="dispatch"){const{type:a,payload:h}=o;(s=this.listeners[a])==null||s.forEach(u=>u(h));return}const l=o.extensions?T(o.extensions,this.options.surface):o.extensions;(e=this.listeners[i])==null||e.forEach(a=>{a({...o,extensions:this._getLocalizedExtensions(l)})})}catch(i){console.error("[ExtensionServer] Something went wrong while parsing a server message:",i instanceof Error?i.message:i)}}))}setupConnection(n=!0){this.options.connection.url&&n&&(this.closeConnection(),this.connection=new WebSocket(this.options.connection.url,this.options.connection.protocols),this.initializeConnection())}closeConnection(){var n;this.connected&&((n=this.connection)==null||n.close())}_getLocalizedExtensions(n){return n==null?void 0:n.map(t=>{var o,l,a,h,u;if(!this.options.locales||!f.isUIExtension(t))return t;const e=((l=(o=this.uiExtensionsByUuid[t.uuid])==null?void 0:o.localization)==null?void 0:l.lastUpdated)!==((a=t.localization)==null?void 0:a.lastUpdated)?d.getFlattenedLocalization(t.localization,this.options.locales):((h=this.uiExtensionsByUuid[t.uuid])==null?void 0:h.localization)??t.localization,i=e&&d.isFlattenedTranslations(e)?JSON.parse(e.translations):e,c={...t,localization:e,name:i&&t.name.startsWith("t:")?this._getLocalizedValue(i,t.name):t.name,...t.description&&{description:i&&((u=t.description)!=null&&u.startsWith("t:"))?this._getLocalizedValue(i,t.description):t.description}};return this.uiExtensionsByUuid[t.uuid]={...c,extensionPoints:this._getLocalizedExtensionPoints(e,c)},this.uiExtensionsByUuid[t.uuid]})}_getLocalizedExtensionPoints(n,{extensionPoints:t,name:s,description:e}){return!n||!d.isFlattenedTranslations(n)?t:t==null?void 0:t.map(i=>({...i,localization:n,name:s,...e&&{description:e}}))}_getLocalizedValue(n,t){const s=t.replace("t:","");return n[s]||t}}function S(r,n){return p({...r,...n,connection:{...r.connection,...n.connection}})}function p(r){return E.isValidSurface(r.surface)||delete r.surface,r}function T(r,n){return n?r.filter(t=>t.surface===n?!0:Array.isArray(t.extensionPoints)?t.extensionPoints.filter(i=>typeof i=="string"?!1:i.surface===n).length>0:!1):r}exports.ExtensionServerClient=g;