@salsita-ai/sdk 0.50.0-develop.c33986dc44 → 0.50.0-develop.ca5894b56c

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 (245) hide show
  1. package/README.md +1 -1
  2. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  3. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  4. package/dist/application-spec/core/index.d.ts +1 -3
  5. package/dist/application-spec/core/index.js +1 -1
  6. package/dist/application-spec/core/json-schema.d.ts +2 -52
  7. package/dist/application-spec/core/markers/index.d.ts +1 -1
  8. package/dist/application-spec/core/markers/index.js +1 -1
  9. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  10. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  11. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  12. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  13. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  14. package/dist/application-spec/errors/diagnostic-codes.d.ts +1 -0
  15. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  16. package/dist/application-spec/errors/diagnostic-messages.d.ts +1 -0
  17. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  18. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  19. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  20. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  21. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  22. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  23. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  24. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +1 -1
  25. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
  26. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +2 -2
  27. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  28. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  29. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  30. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  31. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  32. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  33. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  34. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -1
  35. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  36. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -1
  37. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  38. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  39. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +2 -1
  40. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  41. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  42. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  43. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  44. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  45. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  46. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  47. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  48. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  49. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  50. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  51. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  52. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  53. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  54. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  55. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  56. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  57. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  58. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  59. package/dist/client/authorized-client.d.ts +3 -1
  60. package/dist/client/authorized-client.js +1 -1
  61. package/dist/client/contract.d.ts +17 -0
  62. package/dist/client/index.d.ts +1 -1
  63. package/dist/client/local-authorized-client.d.ts +3 -1
  64. package/dist/client/local-authorized-client.js +1 -1
  65. package/dist/client/memory-authorized-client.d.ts +4 -1
  66. package/dist/client/memory-authorized-client.js +1 -1
  67. package/dist/client/phoenix-api.d.ts +228 -0
  68. package/dist/configurator/ConfiguratorApp.js +1 -1
  69. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  70. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +13 -0
  71. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  72. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +2 -1
  73. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  74. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -9
  75. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  76. package/dist/configurator/common/configurator-interface.d.ts +2 -2
  77. package/dist/configurator/common/configurator-interface.js +1 -1
  78. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +1 -1
  79. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  80. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  81. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  82. package/dist/configurator/configurator-context/index.d.ts +0 -4
  83. package/dist/configurator/configurator-context/index.js +1 -1
  84. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  85. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  86. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  87. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  88. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  89. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  90. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  91. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  92. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  93. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  94. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  95. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  96. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  97. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  98. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  99. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  100. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  101. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  102. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  103. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  104. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  105. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  106. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  107. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  108. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  109. package/dist/docs/index.json +1 -1
  110. package/dist/docs/phoenix/domain-model.mdx +4 -1
  111. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  112. package/dist/docs/phoenix/project-structure.mdx +21 -17
  113. package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
  114. package/dist/docs/phoenix/webhooks.mdx +5 -1
  115. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  116. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  117. package/dist/domain/index.d.ts +1 -0
  118. package/dist/domain/index.js +1 -1
  119. package/dist/domain/spec/application/index.d.ts +1 -0
  120. package/dist/domain/spec/application/index.js +1 -0
  121. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  122. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  123. package/dist/domain/spec/enhanced-json-value.js +1 -0
  124. package/dist/domain/spec/index.d.ts +7 -0
  125. package/dist/domain/spec/index.js +1 -0
  126. package/dist/domain/spec/json-schema.d.ts +52 -0
  127. package/dist/domain/spec/json-schema.js +1 -0
  128. package/dist/domain/spec/markers/index.d.ts +2 -0
  129. package/dist/domain/spec/markers/index.js +1 -0
  130. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  131. package/dist/domain/spec/markers/msg-marker.js +1 -0
  132. package/dist/domain/spec/model/aliases.d.ts +9 -0
  133. package/dist/domain/spec/model/aliases.js +1 -0
  134. package/dist/domain/spec/model/common-types.d.ts +15 -0
  135. package/dist/domain/spec/model/common-types.js +1 -0
  136. package/dist/domain/spec/model/defaults.d.ts +33 -0
  137. package/dist/domain/spec/model/defaults.js +1 -0
  138. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  139. package/dist/domain/spec/model/entity-types.js +1 -0
  140. package/dist/domain/spec/model/index.d.ts +7 -0
  141. package/dist/domain/spec/model/index.js +1 -0
  142. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  143. package/dist/domain/spec/model/model-version-key.js +1 -0
  144. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  145. package/dist/domain/spec/model/names/action-name.js +1 -0
  146. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  147. package/dist/domain/spec/model/names/alias-name.js +1 -0
  148. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  149. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  150. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  151. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  152. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  153. package/dist/domain/spec/model/names/expression-name.js +1 -0
  154. package/dist/domain/spec/model/names/index.d.ts +9 -0
  155. package/dist/domain/spec/model/names/index.js +1 -0
  156. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  157. package/dist/domain/spec/model/names/instance-name.js +1 -0
  158. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  159. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  160. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  161. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  162. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  163. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  164. package/dist/domain/spec/model/presets.d.ts +30 -0
  165. package/dist/domain/spec/model/presets.js +1 -0
  166. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  167. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  168. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  169. package/dist/phoenix/application-spec/index.d.ts +1 -0
  170. package/dist/phoenix/application-spec/index.js +1 -1
  171. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  172. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  173. package/dist/phoenix/bin.js +1 -1
  174. package/dist/phoenix/cli.js +1 -1
  175. package/dist/phoenix/commands/build.js +1 -1
  176. package/dist/phoenix/commands/clean.js +1 -1
  177. package/dist/phoenix/commands/deploy.js +1 -1
  178. package/dist/phoenix/commands/dev.js +5 -5
  179. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  180. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  181. package/dist/phoenix/commands/index.d.ts +1 -1
  182. package/dist/phoenix/commands/index.js +1 -1
  183. package/dist/phoenix/commands/sync.js +1 -1
  184. package/dist/phoenix/lingui/index.d.ts +1 -0
  185. package/dist/phoenix/lingui/index.js +1 -0
  186. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  187. package/dist/phoenix/lingui/lingui.js +1 -0
  188. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  189. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  190. package/dist/phoenix/services/index.d.ts +1 -0
  191. package/dist/phoenix/services/index.js +1 -1
  192. package/dist/phoenix/services/lingui-watcher.js +1 -1
  193. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  194. package/dist/phoenix/services/vite-config.js +1 -1
  195. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  196. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  197. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  198. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  199. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  200. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  201. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  202. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  203. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  204. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  205. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  206. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  207. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  208. package/dist/react-sdk/domain-application-context/index.js +1 -1
  209. package/dist/react-sdk/index.d.ts +3 -0
  210. package/dist/react-sdk/index.js +1 -1
  211. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  212. package/dist/react-sdk/integration/index.d.ts +1 -0
  213. package/dist/react-sdk/integration/index.js +1 -0
  214. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  215. package/dist/react-sdk/lifecycle-providers/index.d.ts +1 -0
  216. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  217. package/package.json +3 -3
  218. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  219. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  220. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  221. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  222. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  223. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  224. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  225. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  226. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  227. package/dist/phoenix/services/lingui.js +0 -1
  228. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  229. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  230. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  231. /package/dist/{application-spec/core → domain/spec}/components/index.d.ts +0 -0
  232. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  233. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  234. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  235. /package/dist/{application-spec/core → domain/spec}/expressions/index.d.ts +0 -0
  236. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  237. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  238. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.js +0 -0
  239. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  240. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  241. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  242. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  243. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  244. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  245. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
@@ -11,19 +11,25 @@ export interface GraphQLOperation {
11
11
  export interface GraphQLScreenshot {
12
12
  readonly entityId: string;
13
13
  readonly view: string;
14
- /** The picture as base64 data. */
15
- readonly data: string;
16
- readonly mimeType: 'image/jpeg' | 'image/png';
14
+ /** The id the server stored the picture under, which the tool result references it by. */
15
+ readonly imageId: string;
17
16
  }
18
17
  export interface GraphQLSystemContext {
19
18
  /** The assistant the initialized session runs: the operations are validated and executed against its schema. */
20
19
  readonly getAssistantSetup: () => SessionAssistantSetup;
21
20
  /**
22
21
  * Renders the picture an `agentScreenshot` component of a state declares, behind every export
23
- * already queued; `null` from an executor that renders no pictures. The only async step of an
24
- * execution, and the only one that needs a canvas.
22
+ * already queued, as a JPEG or PNG blob; `null` from an executor that renders no pictures. One of
23
+ * the two async steps of an execution, and the only one that needs a canvas.
25
24
  */
26
25
  readonly renderScreenshot: (component: ComponentSnapshot<AgentScreenshotComponent>, state: AnyDomainState) => Promise<Blob | null>;
26
+ /**
27
+ * Stores a rendered screenshot in the assistant thread on the server and resolves with the id the
28
+ * tool result references it by. The other async step of an execution, run right after each render.
29
+ */
30
+ readonly uploadScreenshot: (image: Blob) => Promise<{
31
+ readonly imageId: string;
32
+ }>;
27
33
  readonly specSelectors: SpecSelectors;
28
34
  readonly domainContextSelectors: DomainContextSelectors;
29
35
  readonly domainServicesSelectors: DomainServicesSelectors;
@@ -97,7 +103,7 @@ export declare class GraphQLSystem {
97
103
  private readonly _resolveType;
98
104
  private _generation;
99
105
  /**
100
- * The picture of an entity of a state from one `agentScreenshot` view, as base64 of the view's
106
+ * The picture of an entity of a state from one `agentScreenshot` view, as a blob of the view's
101
107
  * file format; `null` when the view is not attached to the entity there or nothing renders it.
102
108
  */
103
109
  private readonly _renderScreenshot;
@@ -118,9 +124,9 @@ export declare class GraphQLSystem {
118
124
  private readonly _runMutation;
119
125
  /**
120
126
  * Takes a screenshot once every one asked for before it in the execution has been taken, so they
121
- * render and spend the budget in document order. A failure nulls only its own field and fails
122
- * nothing else: the user kept changing the configuration, the image did not fit the budget, or
123
- * rendering failed. Once the budget is spent, no later screenshot renders.
127
+ * render in document order, and uploads it as soon as it has rendered. A failure nulls only its
128
+ * own field and fails nothing else: the user kept changing the configuration, rendering failed,
129
+ * or the server did not store the picture.
124
130
  */
125
131
  private readonly _takeScreenshot;
126
132
  private readonly _setup;
@@ -1 +1 @@
1
- import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as r,parse as o,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as f,agentScreenshotComponent as m,createAssistantExecutionSchema as p,findAssistantMutation as g}from"#package/domain";import{ExportBusyError as y}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as v}from"./close-unclosed-braces.js";import{createEntityMeta as S}from"./entity-meta.js";import{injectAssistantLenses as w}from"./inject-assistant-lenses.js";import{readSideEffects as _}from"./side-effects.js";let x={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},$={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},b="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",E="Not taken: the screenshots of this tool call have used up its image size budget. Ask for this screenshot in another call, and for fewer in one call.",T=async e=>{let t=new Uint8Array(await e.arrayBuffer()),i="";for(let e=0;e<t.length;e+=32768)i+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(i)},C=new RegExp(f.pattern),M=[...s,t],k=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,j=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,R=e=>e instanceof Error?e.message:String(e),A=e=>/[.!?]$/.test(e)?e:`${e}.`,N=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,z=(e,t)=>{let i=N(e)?e._raw:void 0;if(k(i))return i;if(!Array.isArray(e)&&!N(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>z(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,z(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||u(e)?t(e):e;let q=t=>new e(`The configurator cannot handle this request: ${A(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),L="SCREENSHOT_NOT_TAKEN",F=(t,i)=>new e(t,{originalError:i,extensions:{code:L}}),O=e=>(e.errors??[]).some(e=>e.extensions.code!==L),V=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=p(e),i=l(t);return i.length>0?q(i.map(e=>e.message).join(" ")):t}catch(e){return q(R(e))}});_selectLenses=h([h.leaf(e=>e)],e=>o(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,o,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,o,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),o,s);if(!k(n))return i(n,o,s,a);if("meta"===a.fieldName){let e;return S({entity:n,state:("object"==typeof(e=j(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i),find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return j(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${k(t)?t.id:"an entity"}: ${A(R(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===r(a.returnType).name?((t,i,n)=>{try{return z(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${k(t)?t.id:"an entity"}: ${A(R(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let r=t.filter(e=>!C.test(e));if(r.length>0)throw new e(`${r.map(e=>`"${e}"`).join(", ")} ${1===r.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>C.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>k(e)?e.type:void 0;_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:m,instanceName:t},i);if(!n)return null;let r=await this._context.renderScreenshot(n,i);return null===r?null:{data:await T(r),mimeType:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"}};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,r)=>{if(void 0!==r.failedMutationField)throw new e(`Not run: the earlier field "${r.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,r)}catch(e){throw r.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let r=g(t,n.manifest);if(!r)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let o=n.state,s=r.implementation(i,o,{manifest:n.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(o),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(s.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(s.updates,o,"committed");if(!i.validity.valid)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: ${(e=>{if("uncaught"===e.severity)return`validating it threw: ${A(R(e.error))}`;let t=[...new Set(e.entityViolations.filter(({violation:t})=>t.severity===e.severity).map(({entityId:e})=>e))];return`it has ${e.severity} violations on ${t.join(", ")}.`})(i.validity)} Change the request so the configuration stays valid.`);n.emissions.push(i),n.state=i.state}return s.readResult({previousState:o,state:n.state})};_takeScreenshot=({entity:t,state:i},n,r)=>{let o=r.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!o)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=r.lastScreenshot.then(async()=>{if(!r.generation.active)throw F(b);if(r.screenshotBudget<=0)throw F(E);let e=await this._renderScreenshot(t.id,o.instanceName,i).catch(e=>{throw F(e instanceof y?"User made concurrent actions that prevented the screenshot from being taken, try again":`The screenshot of ${t.id} from "${n}" could not be taken: ${A(R(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!r.generation.active)throw F(b);if(null===e)return null;if(e.data.length>r.screenshotBudget)throw r.screenshotBudget=0,F(E);r.screenshotBudget-=e.data.length;let s=`${t.id}/${n}`,a=[...r.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,l=0===a?s:`${s}#${a+1}`;return r.screenshots.set(l,{entityId:t.id,view:n,...e}),{image:l}});return r.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:x};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=(t,i,r,s)=>{let l;try{l=o(t)}catch(t){return{errors:[t instanceof e?t:new e(R(t))]}}let c=a(r.schema,l,M);return c.length>0?{errors:c}:n({schema:r.schema,document:l,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:r.fieldResolver,typeResolver:this._resolveType})};prepare=async(t,i,n=this._generation)=>{let r,o=this._setup();if(!o.ready)return i.map(()=>({result:o.result,emissions:[],screenshots:new Map}));let s={manifest:o.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,screenshotBudget:14e5,lastScreenshot:Promise.resolve(),generation:n},a=[];for(let[t,n]of i.entries())if(void 0===r){let i=s.emissions.length,l=s.screenshots.size;s.failedMutationField=void 0;let c=v(n.document),h=o.lenses?w(c,o.lenses):c,d=h instanceof e?{errors:[h]}:await this._run(h,n,o,s);await s.lastScreenshot,a.push({result:d,emissions:s.emissions.slice(i),screenshots:new Map([...s.screenshots].slice(l))}),O(d)&&(r=t)}else a.push({result:V(r),emissions:[],screenshots:new Map});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>_(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));_prepareAndCommit=async(e,t)=>{let i,n,r,o=this._context.domainContextSelectors.getStoreSystem(),s=await this.prepare(o.stateSlices.committed.value.state,e,t),a=s.map(({result:e})=>e),l=this.readSideEffects(s),h=this.readScreenshots(s),d=s.flatMap(e=>e.emissions);if(!t.active)return{results:a,sideEffects:l,screenshots:h,outcome:"conflict"};if(a.some(O)||0===d.length)return{results:a,sideEffects:l,screenshots:h,outcome:"none"};let u=(i=c(d[0]),n=c(d[d.length-1]),r=d.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:i.previousState,state:n.state,updates:d.flatMap(e=>e.updates),validity:n.validity,transformationLog:r?d.flatMap(e=>e.transformationLog??[]):void 0});return{results:a,sideEffects:l,screenshots:h,outcome:o.commitPrepared(u),preparedState:u.state}};execute=async e=>{let t=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>$),committed:!1,sideEffects:[],screenshots:new Map};let i=await this._prepareAndCommit(e,t),{results:n,sideEffects:r,screenshots:o,outcome:s,preparedState:a}="conflict"===i.outcome&&t.active?await this._prepareAndCommit(e,t):i;return"committed"===s?{results:n,committed:!0,sideEffects:r,screenshots:o,preparedState:a}:"held"===s?{results:n,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:r,screenshots:o,preparedState:a}:"conflict"===s?{results:n,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:r,screenshots:o}:{results:n,committed:!1,sideEffects:r,screenshots:o}}}
1
+ import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as o,parse as r,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as f,agentScreenshotComponent as m,createAssistantExecutionSchema as p,findAssistantMutation as g}from"#package/domain";import{ExportBusyError as y}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as v}from"./close-unclosed-braces.js";import{createEntityMeta as S}from"./entity-meta.js";import{injectAssistantLenses as _}from"./inject-assistant-lenses.js";import{readSideEffects as w}from"./side-effects.js";let x={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},$={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},b="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",E=new RegExp(f.pattern),T=[...s,t],C=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,M=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,j=e=>e instanceof Error?e.message:String(e),k=e=>/[.!?]$/.test(e)?e:`${e}.`,R=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,N=(e,t)=>{let i=R(e)?e._raw:void 0;if(C(i))return i;if(!Array.isArray(e)&&!R(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>N(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,N(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||u(e)?t(e):e;let A=t=>new e(`The configurator cannot handle this request: ${k(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),q="SCREENSHOT_NOT_TAKEN",z=(t,i)=>new e(t,{originalError:i,extensions:{code:q}}),L=e=>(e.errors??[]).some(e=>e.extensions.code!==q),F=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=p(e),i=l(t);return i.length>0?A(i.map(e=>e.message).join(" ")):t}catch(e){return A(j(e))}});_selectLenses=h([h.leaf(e=>e)],e=>r(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,r,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,r,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),r,s);if(!C(n))return i(n,r,s,a);if("meta"===a.fieldName){let e;return S({entity:n,state:("object"==typeof(e=M(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i),find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return M(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${C(t)?t.id:"an entity"}: ${k(j(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===o(a.returnType).name?((t,i,n)=>{try{return N(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${C(t)?t.id:"an entity"}: ${k(j(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let o=t.filter(e=>!E.test(e));if(o.length>0)throw new e(`${o.map(e=>`"${e}"`).join(", ")} ${1===o.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>E.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>C(e)?e.type:void 0;_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:m,instanceName:t},i);if(!n)return null;let o=await this._context.renderScreenshot(n,i);return null===o?null:new Blob([o],{type:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"})};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,o)=>{if(void 0!==o.failedMutationField)throw new e(`Not run: the earlier field "${o.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,o)}catch(e){throw o.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let o=g(t,n.manifest);if(!o)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=n.state,s=o.implementation(i,r,{manifest:n.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(s.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(s.updates,r,"committed");if(!i.validity.valid)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: ${(e=>{if("uncaught"===e.severity)return`validating it threw: ${k(j(e.error))}`;let t=[...new Set(e.entityViolations.filter(({violation:t})=>t.severity===e.severity).map(({entityId:e})=>e))];return`it has ${e.severity} violations on ${t.join(", ")}.`})(i.validity)} Change the request so the configuration stays valid.`);n.emissions.push(i),n.state=i.state}return s.readResult({previousState:r,state:n.state})};_takeScreenshot=({entity:t,state:i},n,o)=>{let r=o.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!r)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=o.lastScreenshot.then(async()=>{if(!o.generation.active)throw z(b);let e=await this._renderScreenshot(t.id,r.instanceName,i).catch(e=>{throw z(e instanceof y?"User made concurrent actions that prevented the screenshot from being taken, try again":`The screenshot of ${t.id} from "${n}" could not be taken: ${k(j(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!o.generation.active)throw z(b);if(null===e)return null;let{imageId:s}=await this._context.uploadScreenshot(e).catch(e=>{throw z(`The screenshot of ${t.id} from "${n}" was taken but could not be stored: ${k(j(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)}),a=`${t.id}/${n}`,l=[...o.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,c=0===l?a:`${a}#${l+1}`;return o.screenshots.set(c,{entityId:t.id,view:n,imageId:s}),{image:c}});return o.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:x};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=(t,i,o,s)=>{let l;try{l=r(t)}catch(t){return{errors:[t instanceof e?t:new e(j(t))]}}let c=a(o.schema,l,T);return c.length>0?{errors:c}:n({schema:o.schema,document:l,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:o.fieldResolver,typeResolver:this._resolveType})};prepare=async(t,i,n=this._generation)=>{let o,r=this._setup();if(!r.ready)return i.map(()=>({result:r.result,emissions:[],screenshots:new Map}));let s={manifest:r.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,lastScreenshot:Promise.resolve(),generation:n},a=[];for(let[t,n]of i.entries())if(void 0===o){let i=s.emissions.length,l=s.screenshots.size;s.failedMutationField=void 0;let c=v(n.document),h=r.lenses?_(c,r.lenses):c,d=h instanceof e?{errors:[h]}:await this._run(h,n,r,s);await s.lastScreenshot,a.push({result:d,emissions:s.emissions.slice(i),screenshots:new Map([...s.screenshots].slice(l))}),L(d)&&(o=t)}else a.push({result:F(o),emissions:[],screenshots:new Map});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>w(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));_prepareAndCommit=async(e,t)=>{let i,n,o,r=this._context.domainContextSelectors.getStoreSystem(),s=await this.prepare(r.stateSlices.committed.value.state,e,t),a=s.map(({result:e})=>e),l=this.readSideEffects(s),h=this.readScreenshots(s),d=s.flatMap(e=>e.emissions);if(!t.active)return{results:a,sideEffects:l,screenshots:h,outcome:"conflict"};if(a.some(L)||0===d.length)return{results:a,sideEffects:l,screenshots:h,outcome:"none"};let u=(i=c(d[0]),n=c(d[d.length-1]),o=d.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:i.previousState,state:n.state,updates:d.flatMap(e=>e.updates),validity:n.validity,transformationLog:o?d.flatMap(e=>e.transformationLog??[]):void 0});return{results:a,sideEffects:l,screenshots:h,outcome:r.commitPrepared(u),preparedState:u.state}};execute=async e=>{let t=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>$),committed:!1,sideEffects:[],screenshots:new Map};let i=await this._prepareAndCommit(e,t),{results:n,sideEffects:o,screenshots:r,outcome:s,preparedState:a}="conflict"===i.outcome&&t.active?await this._prepareAndCommit(e,t):i;return"committed"===s?{results:n,committed:!0,sideEffects:o,screenshots:r,preparedState:a}:"held"===s?{results:n,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,screenshots:r,preparedState:a}:"conflict"===s?{results:n,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o,screenshots:r}:{results:n,committed:!1,sideEffects:o,screenshots:r}}}
@@ -1,8 +1,8 @@
1
1
  import { type $DomainEntity, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
2
- import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
2
+ import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseConfiguratorRouting, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
3
3
  import { type CreatePhoenixIconSet } from '#package/ui-sdk';
4
4
  import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
5
- import { type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type UseConfiguratorRouting, type UsePresetSelection, usePreview, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
5
+ import { type UsePresetSelection, usePreview, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
6
6
  import { useCloseAction } from '../integration/index.js';
7
7
  import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
8
8
  import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-and-drop/use-updated-selection.js';
@@ -1 +1 @@
1
- import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createPresetUi as I,createSelectionHotspot as A,createToolMenuFab as C,isAngleDimensionUpdate as S,isAttributeSelectionUpdate as w,isAttributeSwitchUpdate as E,isDeleteEntityUpdate as b,isDistanceDimensionUpdate as q,isGenericDimensionUpdate as B,isSwatchSelectionUpdate as P,isTextValueUpdate as R,useAccessService as U,useActiveNavigationState as h,useActiveToolState as v,useActiveViewState as z,useActiveViewports as D,useAnalyticsService as F,useAngleDimension as G,useAttributeSelection as H,useAttributeSwitch as J,useAuthenticatedClient as K,useAuthorizedClient as L,useBackendData as M,useChildEntitySelection as N,useCommittedSlice as O,useCommittedState as Q,useComponent as T,useComponents as V,useComposition as W,useConfigurationId as X,useConfigurationSaveState as Y,useConfiguratorMessages as Z,useControlViolations as $,useCookRecipes as _,useCookReplaceRecipes as ee,useCookedRecipes as et,useCookedReplaceRecipes as er,useCreateAuthorizedClient as eo,useDeleteEntity as ei,useDeletedEntity as en,useDeselect as es,useDistanceDimension as ea,useDistanceDimensionSelection as em,useDomain as ep,useDomainApplication as ed,useDomainApplicationProps as ec,useDomainEntityRenderedState as eu,useDomainEntityState as ef,useEntityPrice as el,useEntitySelector as eg,useFinalizeAction as ej,useFinalizeActions as ex,useFinalizeViolations as ek,useFirstComponent as ey,useFirstRenderedComponent as eI,useFirstRootComponent as eA,useFirstRootRenderedComponent as eC,useFrontendData as eS,useGenerateShareLink as ew,useGenericDimension as eE,useGroupedRecipeOptions as eb,useHoveredDomainEntityId as eq,useHoveredEntity as eB,useHoveredEntityId as eP,useIntegrationService as eR,useIntegrationState as eU,useIsFullscreenActive as eh,useLoadedData as ev,useLoadingState as ez,useLoadingStateValue as eD,useLocaleSwitch as eF,useLocalizable as eG,useMapViolationHints as eH,useNavigate as eJ,usePopNavigate as eK,usePresetEmbeddedState as eL,usePublishedData as eM,usePushNavigate as eN,useRecipeEmbeddedState as eO,useRenderedComponent as eQ,useRenderedComponents as eT,useRenderedEntitySelector as eV,useRenderedRootEntitySelector as eW,useRenderedSelector as eX,useRenderedSelector$ as eY,useRenderedSlice as eZ,useRenderedState as e$,useReplaceEntityRecipeOptions as e_,useResolveLocalizable as e0,useRootComponents as e1,useRootEntityId as e2,useRootEntityPrice as e3,useRootEntityRenderedId as e4,useRootEntityRenderedState as e5,useRootEntitySelector as e6,useRootEntityState as e7,useRootRenderedComponents as e8,useSelectEntity as e9,useSelectParent as te,useSelectedDomainEntityId as tt,useSelectedEntity as tr,useSelectedEntityId as to,useSession as ti,useSessionRole as tn,useSessionService as ts,useSetFullscreen as ta,useSetViewState as tm,useShareLinks as tp,useStateValidity as td,useStepNavigation as tc,useStoreSelector as tu,useStoreSelector$ as tf,useSwatchSelection as tl,useTabNavigation as tg,useTextValue as tj,useUndoRedo as tx,useUpdateControl as tk,useUpdatedControl as ty}from"#package/react-sdk";import{createPhoenixIconSet as tI}from"#package/ui-sdk";import{useConfigurator as tA}from"../application-runtime/index.js";import{createOnApplicationStartProvider as tC,createOnBackendDataReadyProvider as tS,createOnConfiguratorReadyProvider as tw,createOnFrontendDataReadyProvider as tE,createOnGoToIndexHandler as tb,createOnPresetLoadedHandler as tq,createOnPublishedDataReadyProvider as tB,createOnRoutingReadyProvider as tP,createOnSessionReadyProvider as tR,useConfiguratorRouting as tU,usePresetSelection as th,usePreview as tv,usePropertyPageStack as tz,usePropertyPageState as tD}from"../configurator-context/index.js";import{useCloseAction as tF}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tG}from"../scene/index.js";import{useUpdateEntityObjectSelection as tH}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tJ,useMeasurements as tK,useToolbarActions as tL}from"../toolbar-actions/index.js";import{LayoutSlots as tM,createCanvasLoader as tN,createLayoutAdminUi as tO,createLayoutCustomOwnerUi as tQ,createLayoutCustomReadUi as tT,createLayoutDialog as tV,createLayoutFooter as tW,createLayoutToolbarDesktop as tX,createLayoutToolbarDesktopFullScreen as tY,createLayoutToolbarReadDesktop as tZ,createLayoutToolbarReadDesktopFullScreen as t$,createLayoutUserUi as t_,createToolbarHelp as t0,useSceneSafeArea as t1}from"../ui/index.js";import{createPresetDeviceNotSupported as t2,createPresetPageAction as t3}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t4}from"./use-reset-camera.js";export const createConfiguratorInterface=t5=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:tI,createGetTextureProcessingMapHandler:tG,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:tb,createOnApplicationStartProvider:tC,createOnSessionReadyProvider:tR,createOnPublishedDataReadyProvider:tB,createOnFrontendDataReadyProvider:tE,createOnBackendDataReadyProvider:tS,createOnRoutingReadyProvider:tP,createOnConfiguratorReadyProvider:tw,createOnPresetLoadedHandler:tq,createPresetUi:I,createPresetPageAction:t3,createPresetDeviceNotSupported:t2,createLayoutFooter:tW,createAppLoader:u,createCanvasLoader:tN,createLayoutDialog:tV,createLayoutToolbarDesktop:tX,createLayoutToolbarDesktopFullScreen:tY,createLayoutToolbarReadDesktop:tZ,createLayoutToolbarReadDesktopFullScreen:t$,createLayoutCustomOwnerUi:tQ,createLayoutCustomReadUi:tT,createLayoutAdminUi:tO,createLayoutUserUi:t_,createToolbarHelp:t0,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:A,createNavigationHotspot:k,createToolMenuFab:C,createTransformer:n,transformerBuilder:s(),useAnalytics:F,useAuthenticatedClient:K,useAuthorizedClient:L,useCreateAuthorizedClient:eo,useAccessService:U,useConfigurationId:X,useSession:ti,useSessionRole:tn,useSessionService:ts,useDomain:ep,useDomainApplication:ed,useConfigurator:tA,useConfiguratorRouting:tU,usePresetSelection:th,usePublishedData:eM,useFrontendData:eS,useBackendData:M,useDomainApplicationProps:ec,useLoadedData:ev,useIntegrationService:eR,useIntegrationState:eU,usePresetEmbeddedState:eL,useRecipeEmbeddedState:eO,useCommittedSlice:O,useRenderedSlice:eZ,useCommittedState:Q,useRenderedState:e$,useStoreSelector:tu,useRenderedSelector:eX,useStoreSelector$:tf,useRenderedSelector$:eY,useEntitySelector:eg,useRenderedEntitySelector:eV,useRootEntitySelector:e6,useRenderedRootEntitySelector:eW,useStateValidity:td,useMapViolationHints:eH,useNavigate:eJ,usePopNavigate:eK,usePushNavigate:eN,useControlViolations:$,useFinalizeViolations:ek,useConfiguratorMessages:Z,useConfigurationSaveState:Y,useFinalizeAction:ej,useFinalizeActions:ex,useComponent:T,useRenderedComponent:eQ,useComponents:V,useRenderedComponents:eT,useFirstComponent:ey,useFirstRenderedComponent:eI,useRootComponents:e1,useRootRenderedComponents:e8,useFirstRootComponent:eA,useFirstRootRenderedComponent:eC,useEntityState:ef,useEntityRenderedState:eu,useRootEntityState:e7,useRootEntityRenderedState:e5,useRootEntityId:e2,useRootEntityRenderedId:e4,useEntityPrice:el,useRootEntityPrice:e3,useSelectedEntity:tr,useSelectedEntityId:to,useSelectedDomainEntityId:tt,useSelectEntity:e9,useDeselect:es,useSelectParent:te,useHoveredEntity:eB,useHoveredEntityId:eP,useHoveredDomainEntityId:eq,useActiveNavigationState:h,useActiveViewState:z,useSetViewState:tm,useActiveToolState:v,useIsFullscreenActive:eh,useSetFullscreen:ta,useResetCamera:t4,useUndoRedo:tx,useTabNavigation:tg,useStepNavigation:tc,useSceneSafeArea:t1,useActiveViewports:D,usePreview:tv,useCloseAction:tF,useIsCloningAllowed:tM.useIsCloningAllowed,useResolveLocalizable:e0,useLocalizable:eG,useToolbarActions:tL,useMeasurements:tK,useLocaleSwitch:eF,useShareLinks:tp,useAssistantPanel:tJ,useComposition:W,useUpdateControl:tk,useUpdatedControl:ty,useCookRecipes:_,useCookedRecipes:et,useCookReplaceRecipes:ee,useCookedReplaceRecipes:er,useDeleteEntity:ei,useDeletedEntity:en,useSwatchSelection:tl,useTextValue:tj,useAttributeSelection:H,useAttributeSwitch:J,useDistanceDimension:ea,useDistanceDimensionSelection:em,useGenericDimension:eE,useAngleDimension:G,useChildEntitySelection:N,useGroupedRecipeOptions:eb,useReplaceEntityRecipeOptions:e_,useUpdateEntityObjectSelection:tH,useGenerateShareLink:ew,useLoadingState:ez,useLoadingStateValue:eD,usePropertyPageStack:tz,usePropertyPageState:tD,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:b,isAngleDimensionUpdate:S,isDistanceDimensionUpdate:q,isGenericDimensionUpdate:B,isAttributeSelectionUpdate:w,isAttributeSwitchUpdate:E,isTextValueUpdate:R,isSwatchSelectionUpdate:P});
1
+ import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createOnApplicationStartProvider as I,createOnBackendDataReadyProvider as A,createOnConfiguratorReadyProvider as C,createOnFrontendDataReadyProvider as S,createOnGoToIndexHandler as w,createOnPresetLoadedHandler as E,createOnPublishedDataReadyProvider as b,createOnRoutingReadyProvider as q,createOnSessionReadyProvider as B,createPresetUi as P,createSelectionHotspot as R,createToolMenuFab as U,isAngleDimensionUpdate as h,isAttributeSelectionUpdate as v,isAttributeSwitchUpdate as z,isDeleteEntityUpdate as D,isDistanceDimensionUpdate as F,isGenericDimensionUpdate as G,isSwatchSelectionUpdate as H,isTextValueUpdate as J,useAccessService as K,useActiveNavigationState as L,useActiveToolState as M,useActiveViewState as N,useActiveViewports as O,useAnalyticsService as Q,useAngleDimension as T,useAttributeSelection as V,useAttributeSwitch as W,useAuthenticatedClient as X,useAuthorizedClient as Y,useBackendData as Z,useChildEntitySelection as $,useCommittedSlice as _,useCommittedState as ee,useComponent as et,useComponents as er,useComposition as eo,useConfigurationId as ei,useConfigurationSaveState as en,useConfiguratorMessages as es,useConfiguratorRouting as ea,useControlViolations as em,useCookRecipes as ep,useCookReplaceRecipes as ed,useCookedRecipes as ec,useCookedReplaceRecipes as eu,useCreateAuthorizedClient as ef,useDeleteEntity as el,useDeletedEntity as eg,useDeselect as ej,useDistanceDimension as ex,useDistanceDimensionSelection as ek,useDomain as ey,useDomainApplication as eI,useDomainApplicationProps as eA,useDomainEntityRenderedState as eC,useDomainEntityState as eS,useEntityPrice as ew,useEntitySelector as eE,useFinalizeAction as eb,useFinalizeActions as eq,useFinalizeViolations as eB,useFirstComponent as eP,useFirstRenderedComponent as eR,useFirstRootComponent as eU,useFirstRootRenderedComponent as eh,useFrontendData as ev,useGenerateShareLink as ez,useGenericDimension as eD,useGroupedRecipeOptions as eF,useHoveredDomainEntityId as eG,useHoveredEntity as eH,useHoveredEntityId as eJ,useIntegrationService as eK,useIntegrationState as eL,useIsFullscreenActive as eM,useLoadedData as eN,useLoadingState as eO,useLoadingStateValue as eQ,useLocaleSwitch as eT,useLocalizable as eV,useMapViolationHints as eW,useNavigate as eX,usePopNavigate as eY,usePresetEmbeddedState as eZ,usePublishedData as e$,usePushNavigate as e_,useRecipeEmbeddedState as e0,useRenderedComponent as e1,useRenderedComponents as e2,useRenderedEntitySelector as e3,useRenderedRootEntitySelector as e4,useRenderedSelector as e5,useRenderedSelector$ as e6,useRenderedSlice as e7,useRenderedState as e8,useReplaceEntityRecipeOptions as e9,useResolveLocalizable as te,useRootComponents as tt,useRootEntityId as tr,useRootEntityPrice as to,useRootEntityRenderedId as ti,useRootEntityRenderedState as tn,useRootEntitySelector as ts,useRootEntityState as ta,useRootRenderedComponents as tm,useSelectEntity as tp,useSelectParent as td,useSelectedDomainEntityId as tc,useSelectedEntity as tu,useSelectedEntityId as tf,useSession as tl,useSessionRole as tg,useSessionService as tj,useSetFullscreen as tx,useSetViewState as tk,useShareLinks as ty,useStateValidity as tI,useStepNavigation as tA,useStoreSelector as tC,useStoreSelector$ as tS,useSwatchSelection as tw,useTabNavigation as tE,useTextValue as tb,useUndoRedo as tq,useUpdateControl as tB,useUpdatedControl as tP}from"#package/react-sdk";import{createPhoenixIconSet as tR}from"#package/ui-sdk";import{useConfigurator as tU}from"../application-runtime/index.js";import{usePresetSelection as th,usePreview as tv,usePropertyPageStack as tz,usePropertyPageState as tD}from"../configurator-context/index.js";import{useCloseAction as tF}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tG}from"../scene/index.js";import{useUpdateEntityObjectSelection as tH}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tJ,useMeasurements as tK,useToolbarActions as tL}from"../toolbar-actions/index.js";import{LayoutSlots as tM,createCanvasLoader as tN,createLayoutAdminUi as tO,createLayoutCustomOwnerUi as tQ,createLayoutCustomReadUi as tT,createLayoutDialog as tV,createLayoutFooter as tW,createLayoutToolbarDesktop as tX,createLayoutToolbarDesktopFullScreen as tY,createLayoutToolbarReadDesktop as tZ,createLayoutToolbarReadDesktopFullScreen as t$,createLayoutUserUi as t_,createToolbarHelp as t0,useSceneSafeArea as t1}from"../ui/index.js";import{createPresetDeviceNotSupported as t2,createPresetPageAction as t3}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t4}from"./use-reset-camera.js";export const createConfiguratorInterface=t5=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:tR,createGetTextureProcessingMapHandler:tG,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:w,createOnApplicationStartProvider:I,createOnSessionReadyProvider:B,createOnPublishedDataReadyProvider:b,createOnFrontendDataReadyProvider:S,createOnBackendDataReadyProvider:A,createOnRoutingReadyProvider:q,createOnConfiguratorReadyProvider:C,createOnPresetLoadedHandler:E,createPresetUi:P,createPresetPageAction:t3,createPresetDeviceNotSupported:t2,createLayoutFooter:tW,createAppLoader:u,createCanvasLoader:tN,createLayoutDialog:tV,createLayoutToolbarDesktop:tX,createLayoutToolbarDesktopFullScreen:tY,createLayoutToolbarReadDesktop:tZ,createLayoutToolbarReadDesktopFullScreen:t$,createLayoutCustomOwnerUi:tQ,createLayoutCustomReadUi:tT,createLayoutAdminUi:tO,createLayoutUserUi:t_,createToolbarHelp:t0,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:R,createNavigationHotspot:k,createToolMenuFab:U,createTransformer:n,transformerBuilder:s(),useAnalytics:Q,useAuthenticatedClient:X,useAuthorizedClient:Y,useCreateAuthorizedClient:ef,useAccessService:K,useConfigurationId:ei,useSession:tl,useSessionRole:tg,useSessionService:tj,useDomain:ey,useDomainApplication:eI,useConfigurator:tU,useConfiguratorRouting:ea,usePresetSelection:th,usePublishedData:e$,useFrontendData:ev,useBackendData:Z,useDomainApplicationProps:eA,useLoadedData:eN,useIntegrationService:eK,useIntegrationState:eL,usePresetEmbeddedState:eZ,useRecipeEmbeddedState:e0,useCommittedSlice:_,useRenderedSlice:e7,useCommittedState:ee,useRenderedState:e8,useStoreSelector:tC,useRenderedSelector:e5,useStoreSelector$:tS,useRenderedSelector$:e6,useEntitySelector:eE,useRenderedEntitySelector:e3,useRootEntitySelector:ts,useRenderedRootEntitySelector:e4,useStateValidity:tI,useMapViolationHints:eW,useNavigate:eX,usePopNavigate:eY,usePushNavigate:e_,useControlViolations:em,useFinalizeViolations:eB,useConfiguratorMessages:es,useConfigurationSaveState:en,useFinalizeAction:eb,useFinalizeActions:eq,useComponent:et,useRenderedComponent:e1,useComponents:er,useRenderedComponents:e2,useFirstComponent:eP,useFirstRenderedComponent:eR,useRootComponents:tt,useRootRenderedComponents:tm,useFirstRootComponent:eU,useFirstRootRenderedComponent:eh,useEntityState:eS,useEntityRenderedState:eC,useRootEntityState:ta,useRootEntityRenderedState:tn,useRootEntityId:tr,useRootEntityRenderedId:ti,useEntityPrice:ew,useRootEntityPrice:to,useSelectedEntity:tu,useSelectedEntityId:tf,useSelectedDomainEntityId:tc,useSelectEntity:tp,useDeselect:ej,useSelectParent:td,useHoveredEntity:eH,useHoveredEntityId:eJ,useHoveredDomainEntityId:eG,useActiveNavigationState:L,useActiveViewState:N,useSetViewState:tk,useActiveToolState:M,useIsFullscreenActive:eM,useSetFullscreen:tx,useResetCamera:t4,useUndoRedo:tq,useTabNavigation:tE,useStepNavigation:tA,useSceneSafeArea:t1,useActiveViewports:O,usePreview:tv,useCloseAction:tF,useIsCloningAllowed:tM.useIsCloningAllowed,useResolveLocalizable:te,useLocalizable:eV,useToolbarActions:tL,useMeasurements:tK,useLocaleSwitch:eT,useShareLinks:ty,useAssistantPanel:tJ,useComposition:eo,useUpdateControl:tB,useUpdatedControl:tP,useCookRecipes:ep,useCookedRecipes:ec,useCookReplaceRecipes:ed,useCookedReplaceRecipes:eu,useDeleteEntity:el,useDeletedEntity:eg,useSwatchSelection:tw,useTextValue:tb,useAttributeSelection:V,useAttributeSwitch:W,useDistanceDimension:ex,useDistanceDimensionSelection:ek,useGenericDimension:eD,useAngleDimension:T,useChildEntitySelection:$,useGroupedRecipeOptions:eF,useReplaceEntityRecipeOptions:e9,useUpdateEntityObjectSelection:tH,useGenerateShareLink:ez,useLoadingState:eO,useLoadingStateValue:eQ,usePropertyPageStack:tz,usePropertyPageState:tD,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:D,isAngleDimensionUpdate:h,isDistanceDimensionUpdate:F,isGenericDimensionUpdate:G,isAttributeSelectionUpdate:v,isAttributeSwitchUpdate:z,isTextValueUpdate:J,isSwatchSelectionUpdate:H});
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{BackendDataProvider as e,FrontendDataProvider as i,PublishedDataProvider as c}from"#package/react-sdk";import{OnBackendDataReadyProvider as o,OnFrontendDataReadyProvider as t,OnPublishedDataReadyProvider as d}from"./LifecycleProviders.js";export const ConfiguratorDataProvider=({children:n})=>r(c,{children:r(d,{children:r(i,{children:r(t,{children:r(e,{children:r(o,{children:n})})})})})});
1
+ import{jsx as r}from"react/jsx-runtime";import{BackendDataProvider as e,FrontendDataProvider as i,OnBackendDataReadyProvider as c,OnFrontendDataReadyProvider as n,OnPublishedDataReadyProvider as o,PublishedDataProvider as t}from"#package/react-sdk";export const ConfiguratorDataProvider=({children:a})=>r(t,{children:r(o,{children:r(i,{children:r(n,{children:r(e,{children:r(c,{children:a})})})})})});
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Button as t}from"@mui/material";import{useMutation as r}from"@tanstack/react-query";import{useSnackbar as i}from"notistack";import{useSubscription as o}from"observable-hooks";import{createContext as s,useCallback as n,useContext as a,useEffect as l,useMemo as m,useState as d}from"react";import{skip as p}from"rxjs";import{match as c}from"ts-pattern";import{AuthorizedClient as g,LocalStorageAuthorizedPhoenixApiClient as u,MemoryAuthorizedPhoenixApiClient as f}from"#package/client";import{SYSTEM_CHUNK_KEY as h,standardWebComponentProperties as y}from"#package/domain";import{ApplicationRoutes as P,FrontendAnalyticsFactory as v,useAnalyticsService as w,useAuthenticatedClient as x,useConfiguratorDomainFactory as C,useEagerObservableValue as T,useIsDev as k,useLogger as D,usePersistenceConfig as S,usePublishedData as E,useResolveLocalizable as b,useRoutingSelectors as A,useSessionService as I,useSpecPresetSeed as V,useWebComponentProperty$ as j}from"#package/react-sdk";import{useOnPresetLoadedHandler as $}from"./OnPresetLoadedHandler.js";import{useConfiguratorRouting as F}from"./configurator-routing/index.js";let M={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},R={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},q="phx-preset-creation-error";export const PresetSelectionContext=s(null);export const usePresetSelection=()=>{let e=a(PresetSelectionContext);if(null===e)throw Error("usePresetSelection must be used within a PresetSelectionProvider!");return e};let z=e=>t=>null===e||void 0!==t.tags&&t.tags.some(t=>e.includes(t));export const PresetSelectionProvider=s=>{let{children:a}=s,[H,L]=d(null),[O,U]=d(null),B=V(),G=x(),J=w(),K=S(),N=C(),Q=k(),W=b(),{requestSessionToken:X}=I(),Y=D(),Z=F(),_=A(),ee=E(),{enqueueSnackbar:et,closeSnackbar:er}=i(),ei=j(y.presetTags),eo=T(ei),es=$();o(m(()=>ei.pipe(p(1)),[ei]),()=>{_.getRoutingState().route!==P.Index&&Z.goToIndex()}),l(()=>{U(null),er(q)},[Q,er]);let{mutate:en}=r({mutationFn:n(async e=>{let{getData:t,name:r}=e,{rootEntityType:i,entities:o,modelVersion:s}=await t(),n=N.validateAndMigrateState(o,s);J.push(v.ProductSelected(i,W(r)));let a=es?await es(n):n;return G.createConfiguration({rootEntityType:i,data:a})},[N,J,W,G,es]),onSuccess:e=>{Z.goToConfigurationDetail(e.configurationId,e.accessToken)},onError:(e,t)=>{Y.error("Failed to create a new configuration from a preset!",{name:t.name},e),U(e)},onSettled:()=>{L(null)}}),ea=m(()=>{let e,t=(e=h in ee?ee[h].presetCategories:ee.presetCategories,{publishedPresetCategories:(e??[]).map(e=>({...e,presets:e.presets.filter(z(eo))})).filter(e=>e.presets.length>0),seedPresets:B.filter(z(eo))});return t.publishedPresetCategories.length>0?t.publishedPresetCategories.map(e=>({id:e.id,name:e.name,description:e.description,img:e.img,imgAlt:e.imgAlt,presets:e.presets.map(e=>({id:e.configurationId,name:e.name,description:e.description,img:e?.img,imgAlt:e?.imgAlt,detailTitle:e?.detailTitle,detailDescription:e?.detailDescription,getData:async()=>{let t=c(K).with({type:"server"},t=>new g(t.serverUrl,()=>e.readToken,X)).with({type:"local-storage"},()=>new u(N.modelVersion)).with({type:"memory"},()=>new f(N.modelVersion)).exhaustive(),r=await t.getConfigurationRevision(e.configurationId,e.revisionId);return{entities:r.data,rootEntityType:r.rootEntityType,modelVersion:r.modelVersion}}}))})):t.seedPresets.length>0?[{id:"Default",name:"Default Category",presets:t.seedPresets.map((e,t)=>({id:`${t}`,name:e.name??`${e.rootEntityType} preset - ${t}`,description:e.description??"",img:e.img,imgAlt:e.imgAlt,detailTitle:e.detailTitle,detailDescription:e.detailDescription,getData:async()=>({entities:e.initialDomainEntities,rootEntityType:e.rootEntityType,modelVersion:N.modelVersion})}))}]:[]},[ee,X,K,N,eo,B]),el=m(()=>ea.flatMap(e=>e.presets),[ea]),em=n(r=>{let i=el.find(e=>e.id===r);if(void 0===i)throw Error(`Preset with id ${r} not found!`);let{getData:o,name:s}=i,n=!Q&&el.length>1;U(null),L(r),en({getData:o,name:s},{onError:()=>{n&&(er(q),et(W(M),{variant:"error",key:q,persist:!0,preventDuplicate:!0,action:r=>e(t,{color:"inherit",size:"small",onClick:()=>{U(null),er(r)},children:W(R)})}))}})},[el,Q,en,et,er,W]),ed=el.length>1,ep=m(()=>({hasMultiplePresets:ed,presetCategories:ea,selectPreset:em,selectionError:O,creatingPresetId:H}),[em,ed,ea,O,H]);return e(PresetSelectionContext.Provider,{value:ep,children:a})};
1
+ import{jsx as e}from"react/jsx-runtime";import{Button as t}from"@mui/material";import{useMutation as r}from"@tanstack/react-query";import{useSnackbar as i}from"notistack";import{useSubscription as o}from"observable-hooks";import{createContext as s,useCallback as n,useContext as a,useEffect as l,useMemo as m,useState as d}from"react";import{skip as p}from"rxjs";import{match as c}from"ts-pattern";import{AuthorizedClient as g,LocalStorageAuthorizedPhoenixApiClient as u,MemoryAuthorizedPhoenixApiClient as f}from"#package/client";import{SYSTEM_CHUNK_KEY as h,standardWebComponentProperties as y}from"#package/domain";import{ApplicationRoutes as P,FrontendAnalyticsFactory as v,useAnalyticsService as w,useAuthenticatedClient as C,useConfiguratorDomainFactory as T,useConfiguratorRouting as k,useEagerObservableValue as x,useIsDev as D,useLogger as S,useOnPresetLoadedHandler as E,usePersistenceConfig as b,usePublishedData as A,useResolveLocalizable as I,useRoutingSelectors as V,useSessionService as $,useSpecPresetSeed as j,useWebComponentProperty$ as F}from"#package/react-sdk";let M={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},R={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},q="phx-preset-creation-error";export const PresetSelectionContext=s(null);export const usePresetSelection=()=>{let e=a(PresetSelectionContext);if(null===e)throw Error("usePresetSelection must be used within a PresetSelectionProvider!");return e};let z=e=>t=>null===e||void 0!==t.tags&&t.tags.some(t=>e.includes(t));export const PresetSelectionProvider=s=>{let{children:a}=s,[U,B]=d(null),[G,H]=d(null),J=j(),K=C(),L=w(),N=b(),O=T(),Q=D(),W=I(),{requestSessionToken:X}=$(),Y=S(),Z=k(),_=V(),ee=A(),{enqueueSnackbar:et,closeSnackbar:er}=i(),ei=F(y.presetTags),eo=x(ei),es=E();o(m(()=>ei.pipe(p(1)),[ei]),()=>{_.getRoutingState().route!==P.Index&&Z.goToIndex()}),l(()=>{H(null),er(q)},[Q,er]);let{mutate:en}=r({mutationFn:n(async e=>{let{getData:t,name:r}=e,{rootEntityType:i,entities:o,modelVersion:s}=await t(),n=O.validateAndMigrateState(o,s);L.push(v.ProductSelected(i,W(r)));let a=es?await es(n):n;return K.createConfiguration({rootEntityType:i,data:a})},[O,L,W,K,es]),onSuccess:e=>{Z.goToConfigurationDetail(e.configurationId,e.accessToken)},onError:(e,t)=>{Y.error("Failed to create a new configuration from a preset!",{name:t.name},e),H(e)},onSettled:()=>{B(null)}}),ea=m(()=>{let e,t=(e=h in ee?ee[h].presetCategories:ee.presetCategories,{publishedPresetCategories:(e??[]).map(e=>({...e,presets:e.presets.filter(z(eo))})).filter(e=>e.presets.length>0),seedPresets:J.filter(z(eo))});return t.publishedPresetCategories.length>0?t.publishedPresetCategories.map(e=>({id:e.id,name:e.name,description:e.description,img:e.img,imgAlt:e.imgAlt,presets:e.presets.map(e=>({id:e.configurationId,name:e.name,description:e.description,img:e?.img,imgAlt:e?.imgAlt,detailTitle:e?.detailTitle,detailDescription:e?.detailDescription,getData:async()=>{let t=c(N).with({type:"server"},t=>new g(t.serverUrl,()=>e.readToken,X)).with({type:"local-storage"},()=>new u(O.modelVersion)).with({type:"memory"},()=>new f(O.modelVersion)).exhaustive(),r=await t.getConfigurationRevision(e.configurationId,e.revisionId);return{entities:r.data,rootEntityType:r.rootEntityType,modelVersion:r.modelVersion}}}))})):t.seedPresets.length>0?[{id:"Default",name:"Default Category",presets:t.seedPresets.map((e,t)=>({id:`${t}`,name:e.name??`${e.rootEntityType} preset - ${t}`,description:e.description??"",img:e.img,imgAlt:e.imgAlt,detailTitle:e.detailTitle,detailDescription:e.detailDescription,getData:async()=>({entities:e.initialDomainEntities,rootEntityType:e.rootEntityType,modelVersion:O.modelVersion})}))}]:[]},[ee,X,N,O,eo,J]),el=m(()=>ea.flatMap(e=>e.presets),[ea]),em=n(r=>{let i=el.find(e=>e.id===r);if(void 0===i)throw Error(`Preset with id ${r} not found!`);let{getData:o,name:s}=i,n=!Q&&el.length>1;H(null),B(r),en({getData:o,name:s},{onError:()=>{n&&(er(q),et(W(M),{variant:"error",key:q,persist:!0,preventDuplicate:!0,action:r=>e(t,{color:"inherit",size:"small",onClick:()=>{H(null),er(r)},children:W(R)})}))}})},[el,Q,en,et,er,W]),ed=el.length>1,ep=m(()=>({hasMultiplePresets:ed,presetCategories:ea,selectPreset:em,selectionError:G,creatingPresetId:U}),[em,ed,ea,G,U]);return e(PresetSelectionContext.Provider,{value:ep,children:a})};
@@ -1,4 +1,3 @@
1
1
  export { useLayoutSystemConfig, useEnterSidebarSummary, useLeaveSidebarSummary, useIsSidebarSummaryActive, useSidebarSummary, useSidebarContents, useSidebarGoBack, useHasSidebarSummary, useToolbarState, useSteps, useBackToPresetEnabled, useEmbeddedModeActive, usePresetEmbeddedModeActive, useHasSteps, useHeaderStyle, } from './layout-hooks.js';
2
2
  export { usePropertyPageState, usePropertyPageStack } from './property-page/property-page-hooks.js';
3
3
  export { PropertyStateProvider } from './property-page/PropertyStateProvider.js';
4
- export { useChatEnabled } from './chat-hooks.js';
@@ -1 +1 @@
1
- export{useLayoutSystemConfig,useEnterSidebarSummary,useLeaveSidebarSummary,useIsSidebarSummaryActive,useSidebarSummary,useSidebarContents,useSidebarGoBack,useHasSidebarSummary,useToolbarState,useSteps,useBackToPresetEnabled,useEmbeddedModeActive,usePresetEmbeddedModeActive,useHasSteps,useHeaderStyle}from"./layout-hooks.js";export{usePropertyPageState,usePropertyPageStack}from"./property-page/property-page-hooks.js";export{PropertyStateProvider}from"./property-page/PropertyStateProvider.js";export{useChatEnabled}from"./chat-hooks.js";
1
+ export{useLayoutSystemConfig,useEnterSidebarSummary,useLeaveSidebarSummary,useIsSidebarSummaryActive,useSidebarSummary,useSidebarContents,useSidebarGoBack,useHasSidebarSummary,useToolbarState,useSteps,useBackToPresetEnabled,useEmbeddedModeActive,usePresetEmbeddedModeActive,useHasSteps,useHeaderStyle}from"./layout-hooks.js";export{usePropertyPageState,usePropertyPageStack}from"./property-page/property-page-hooks.js";export{PropertyStateProvider}from"./property-page/PropertyStateProvider.js";
@@ -1,9 +1,5 @@
1
1
  export { usePresetSelection, type UsePresetSelection, PresetSelectionProvider, type PresetSelectionProviderProps, } from './PresetSelectionProvider.js';
2
- export { useOnPresetLoadedHandler, createOnPresetLoadedHandler, type CreateOnPresetLoadedHandler, } from './OnPresetLoadedHandler.js';
3
- export { IntegrationSubscription, type IntegrationSubscriptionProps } from './IntegrationSubscription.js';
4
2
  export { ViewportStateSync } from './ViewportStateSync.js';
5
3
  export { PreviewApplicationProvider } from './PreviewApplicationProvider.js';
6
4
  export { PreviewContextProvider, usePreview } from './PreviewContextProvider.js';
7
- export * from './LifecycleProviders.js';
8
5
  export * from './configurator-hooks/index.js';
9
- export * from './configurator-routing/index.js';
@@ -1 +1 @@
1
- export{usePresetSelection,PresetSelectionProvider}from"./PresetSelectionProvider.js";export{useOnPresetLoadedHandler,createOnPresetLoadedHandler}from"./OnPresetLoadedHandler.js";export{IntegrationSubscription}from"./IntegrationSubscription.js";export{ViewportStateSync}from"./ViewportStateSync.js";export{PreviewApplicationProvider}from"./PreviewApplicationProvider.js";export{PreviewContextProvider,usePreview}from"./PreviewContextProvider.js";export*from"./LifecycleProviders.js";export*from"./configurator-hooks/index.js";export*from"./configurator-routing/index.js";
1
+ export{usePresetSelection,PresetSelectionProvider}from"./PresetSelectionProvider.js";export{ViewportStateSync}from"./ViewportStateSync.js";export{PreviewApplicationProvider}from"./PreviewApplicationProvider.js";export{PreviewContextProvider,usePreview}from"./PreviewContextProvider.js";export*from"./configurator-hooks/index.js";
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ConfigurationNotFoundPageElement as n}from"../configuration-not-found-page/index.js";import{useConfiguratorRouting as r}from"../configurator-context/index.js";export const ConfiguratorNotFoundPage=()=>o(n,{onBack:r().goToIndex});
1
+ import{jsx as o}from"react/jsx-runtime";import{useConfiguratorRouting as r}from"#package/react-sdk";import{ConfigurationNotFoundPageElement as t}from"../configuration-not-found-page/index.js";export const ConfiguratorNotFoundPage=()=>o(t,{onBack:r().goToIndex});
@@ -1 +1 @@
1
- import{jsx as o,jsxs as r}from"react/jsx-runtime";import i from"mui-modal-provider";import{memo as e,useCallback as n,useEffect as t,useState as a}from"react";import{InvalidAccessKeyError as d}from"#package/client";import{BuiltInLoadingPhase as l,CommonAnalyticsFactory as s,DomainLifecycleBoundary as c,FinalizeActionsHost as u,FinalizeActionsProvider as f,LoadedDataProvider as m,PhoenixLayoutElement as g,useAccessService as p,useAnalyticsService as v,useAuthorizedClient as I,useConfiguratorDomainFactory as h,useConfiguratorLoadStatus as j,useConfiguratorRawLoadedData as C,useLoadedDataActions as k,useLoadingError as w,useLoadingPhase as y,useLogger as b,useRoutingService as x,useSpecAssistant as M}from"#package/react-sdk";import{useConfigurator as E}from"../application-runtime/index.js";import{IntegrationSubscription as L,OnConfiguratorReadyProvider as D,ViewportStateSync as F}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as T}from"./ConfiguratorNotFoundPage.js";import{ConfiguratorLayoutName as P}from"./configurator-layout-name.js";import{DevContextFallback as R}from"./error-boundaries/DevContextFallback.js";import{DevLoadingFallback as V}from"./error-boundaries/DevLoadingFallback.js";import{LoadingErrorBoundary as A}from"./error-boundaries/LoadingErrorBoundary.js";import{useLoad as S}from"./use-load.js";let q=({onMount:o})=>(t(()=>{o()},[o]),null),B=e(({onLayoutMount:e})=>((()=>{let{assistantSystem:o}=E(),r=null!=M();t(()=>{if(r)return o.activate()},[o,r])})(),o(f,{children:o(i,{children:r(D,{children:[o(u,{}),o(g,{name:P}),o(q,{onMount:e})]})})})));export const LoadedConfiguratorDetailPage=()=>{let[i,e]=a(!1),t=n(()=>{e(!0)},[]),{configurationId:u,accessInfo:f}=p(),g=I(),M=x(),E=b(),D=v(),{startConfiguratorLoad:P,completeConfiguratorLoad:q,failConfiguratorLoad:G,resetConfiguratorLoad:N}=k(),{isLoading:z,isError:H}=j(),J=C(),K=h(),O=n(()=>f.viewMode&&void 0!==f.revisionId?g.getConfigurationRevision(u,f.revisionId):g.getConfiguration(u),[f.revisionId,f.viewMode,g,u]),Q=n(()=>{P()},[P]),U=n(o=>{q({initialRevisionId:o.revisionId,initialEntities:o.data,modelVersion:o.modelVersion,rootEntityType:o.rootEntityType,schemaIdentity:K}),D.push(s.ConfigurationLoaded(o.configurationId,o.revisionId,f.viewMode?"read":"owner")),E.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:f.viewMode}),E.info("Configuration loaded.")},[f.viewMode,D,q,K,E]),W=n(o=>{if(G(o),o instanceof d)return void M.rejectAccessToken(u,f.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});E.error("Configuration loading failed because the API request did not succeed. Verify the configuration ID and access token.",{configurationId:u},r)},[f.raw,u,G,E,M]),X=n(()=>{N()},[N]);return(S({key:[g,u,f.revisionId,f.viewMode],load:O,onStart:Q,onSuccess:U,onError:W,onCleanup:X}),y({id:l.DataFetch,label:"Loading configuration…"},z||!H&&!i),w(H),H)?o(T,{}):null===J?null:o(m,{value:J,children:o(A,{fallbackRender:r=>o(V,{...r}),children:o(c,{type:"configurator",children:o(A,{FallbackComponent:R,children:r(L,{children:[o(F,{}),o(B,{onLayoutMount:t})]})})})})})};
1
+ import{jsx as o,jsxs as r}from"react/jsx-runtime";import i from"mui-modal-provider";import{memo as e,useCallback as n,useEffect as t,useState as a}from"react";import{InvalidAccessKeyError as d}from"#package/client";import{BuiltInLoadingPhase as l,CommonAnalyticsFactory as s,DomainLifecycleBoundary as c,FinalizeActionsHost as u,FinalizeActionsProvider as f,IntegrationSubscription as m,LoadedDataProvider as g,OnConfiguratorReadyProvider as p,PhoenixLayoutElement as v,useAccessService as I,useAnalyticsService as h,useAuthorizedClient as j,useConfiguratorDomainFactory as C,useConfiguratorLoadStatus as k,useConfiguratorRawLoadedData as w,useLoadedDataActions as y,useLoadingError as b,useLoadingPhase as x,useLogger as M,useRoutingService as E,useSpecAssistant as L}from"#package/react-sdk";import{useConfigurator as D}from"../application-runtime/index.js";import{ViewportStateSync as F}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as T}from"./ConfiguratorNotFoundPage.js";import{ConfiguratorLayoutName as P}from"./configurator-layout-name.js";import{DevContextFallback as R}from"./error-boundaries/DevContextFallback.js";import{DevLoadingFallback as V}from"./error-boundaries/DevLoadingFallback.js";import{LoadingErrorBoundary as A}from"./error-boundaries/LoadingErrorBoundary.js";import{useLoad as S}from"./use-load.js";let q=({onMount:o})=>(t(()=>{o()},[o]),null),B=e(({onLayoutMount:e})=>((()=>{let{assistantSystem:o}=D(),r=null!=L();t(()=>{if(r)return o.activate()},[o,r])})(),o(f,{children:o(i,{children:r(p,{children:[o(u,{}),o(v,{name:P}),o(q,{onMount:e})]})})})));export const LoadedConfiguratorDetailPage=()=>{let[i,e]=a(!1),t=n(()=>{e(!0)},[]),{configurationId:u,accessInfo:f}=I(),p=j(),v=E(),L=M(),D=h(),{startConfiguratorLoad:P,completeConfiguratorLoad:q,failConfiguratorLoad:G,resetConfiguratorLoad:N}=y(),{isLoading:z,isError:H}=k(),J=w(),K=C(),O=n(()=>f.viewMode&&void 0!==f.revisionId?p.getConfigurationRevision(u,f.revisionId):p.getConfiguration(u),[f.revisionId,f.viewMode,p,u]),Q=n(()=>{P()},[P]),U=n(o=>{q({initialRevisionId:o.revisionId,initialEntities:o.data,modelVersion:o.modelVersion,rootEntityType:o.rootEntityType,schemaIdentity:K}),D.push(s.ConfigurationLoaded(o.configurationId,o.revisionId,f.viewMode?"read":"owner")),L.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:f.viewMode}),L.info("Configuration loaded.")},[f.viewMode,D,q,K,L]),W=n(o=>{if(G(o),o instanceof d)return void v.rejectAccessToken(u,f.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});L.error("Configuration loading failed because the API request did not succeed. Verify the configuration ID and access token.",{configurationId:u},r)},[f.raw,u,G,L,v]),X=n(()=>{N()},[N]);return(S({key:[p,u,f.revisionId,f.viewMode],load:O,onStart:Q,onSuccess:U,onError:W,onCleanup:X}),x({id:l.DataFetch,label:"Loading configuration…"},z||!H&&!i),b(H),H)?o(T,{}):null===J?null:o(g,{value:J,children:o(A,{fallbackRender:r=>o(V,{...r}),children:o(c,{type:"configurator",children:o(A,{FallbackComponent:R,children:r(m,{children:[o(F,{}),o(B,{onLayoutMount:t})]})})})})})};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e,Fragment as i}from"react/jsx-runtime";import{Box as n,Button as r,Divider as o,Typography as a}from"@mui/material";import{Stack as d}from"@mui/system";import{useMemo as s}from"react";import{domainEntityTypeFromId as c}from"#package/domain";import{ControlAttachmentError as l,useAccessService as h,useBackendData as m,useCommittedState as p,useDomain as f,useFrontendData as b,useIsDev as u,useLoadedData as v,usePublishedData as y,useRenderedState as x,useSessionService as g}from"#package/react-sdk";import{JsonViewer as S,StackTraceViewer as k}from"#package/ui-sdk";import{useConfiguratorRouting as w}from"../../configurator-context/index.js";import{useResetOnEditorHotReload as C}from"./use-reset-on-editor-hot-reload.js";let W=()=>{let i=w();return e(d,{direction:"row",spacing:2,sx:{mb:2},children:[t(r,{variant:"outlined",size:"small",onClick:()=>{i.goToIndex()},children:"Reset state"}),t(r,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},T=()=>{let{compositionProjections:r,componentReader:c,storeSystem:l}=f(),u=p(),k=x(),w=v(),C=h(),W=g(),T=y(),I=b(),z=m(),L=s(()=>{try{return r.getTree(u)}catch(t){return null}},[u,r]),D=s(()=>c.readManyComponents({},u),[u,c]),R=s(()=>{try{return r.getTree(k)}catch(t){return null}},[k,r]),A=s(()=>c.readManyComponents({},k),[k,c]),U=l.stateSlices.committed.value,E=l.stateSlices.potentiallyInvalid.value,j=E.validity.valid||"uncaught"===E.validity.severity?[]:E.validity.entityViolations,M=j.length>0,N="reset"!==U.kind;return e(n,{component:"div",children:[t(a,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(n,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(a,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[e("li",{children:[t("strong",{children:"Start with Last Emission:"})," Check if there are invariant violations - these often indicate the root cause"]}),e("li",{children:[t("strong",{children:"Review Last Updates:"})," See which state changes were applied right before the error occurred"]}),e("li",{children:[t("strong",{children:"Check Committed vs Rendered State:"})," Compare these to identify inconsistencies or timing issues"]}),e("li",{children:[t("strong",{children:"Inspect Composition Tree:"})," Verify that all entities are composed correctly"]}),e("li",{children:[t("strong",{children:"Review Data Sources:"})," Ensure all required data is loaded and in the expected format"]}),t("li",{children:'Use the "Reset state" button to navigate back to the index page without reloading'}),t("li",{children:'Use the "Reload Page" button to perform a full page refresh if state is corrupted'})]})})]}),(M||N)&&e(i,{children:[e(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:M?"error.main":"primary.main"},children:["Last Emission ",M&&"(Has Violations!)"]}),e(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:["The most recent state update that was applied."," ",M?"Contains invariant violations that prevented the state from being committed.":"Shows what changed in the application state."]}),M&&t(i,{children:e(n,{component:"div",sx:{p:2,backgroundColor:"#ffebee",borderRadius:1,borderLeft:"4px solid #f44336",mb:2},children:[t(a,{variant:"subtitle2",sx:{color:"error.main",mb:1},children:"⚠️ Invariant Violations:"}),t(d,{component:"div",spacing:1,children:j.map((i,r)=>e(n,{component:"div",sx:{pl:2},children:[e(a,{variant:"body2",sx:{fontWeight:600},children:["Entity: ",String(i.entityId)]}),t(a,{variant:"caption",sx:{color:"text.secondary",display:"block",fontFamily:"monospace",fontSize:"0.75rem"},children:JSON.stringify(i.violation)})]},r))})]})}),N&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Last Updates"}),t(S,{data:U.updates})]}),U.transformationLog&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Transformation Log"}),t(S,{data:U.transformationLog})]}),t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Validity"}),t(S,{data:E.validity}),t(o,{sx:{my:4}})]}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Committed Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:'The last valid state that was successfully committed. This is the "source of truth" for the application state and passes all invariant checks.'}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(S,{data:u})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(S,{data:D})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),L&&t(S,{data:L})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Rendered Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The state that's currently being used to render the UI. This may differ from committed state during animations or transitions."}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(S,{data:k})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(S,{data:A})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),R&&t(S,{data:R})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(S,{data:T}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(S,{data:I}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(S,{data:z}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(S,{data:W}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(S,{data:w}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(S,{data:C}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevContextFallback=r=>{let{error:s,resetErrorBoundary:h}=r,m=u();if(C(h),!m)throw s;if(s instanceof l)return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"Can not render a control input!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", during the rendering of UI controls. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A control input component is referenced but not defined in the domain"}),t("li",{children:"The instanceName has a typo or doesn't match the actual component name"}),t("li",{children:"The entity type doesn't support the requested control input"})]})]}),t(W,{}),t(o,{}),t(a,{variant:"body1",children:s.message}),t(o,{}),e(d,{spacing:2,direction:"row",children:[e(d,{children:[t(a,{variant:"subtitle2",children:"Instance Name: "}),t(a,{variant:"subtitle2",children:"Entity Id: "})]}),e(d,{children:[t(a,{variant:"body1",children:s.instanceName}),t(a,{variant:"body1",children:s.entityId})]})]}),t(o,{}),s.stack&&e(i,{children:[t(k,{stack:s.stack,error:s}),t(o,{})]}),e(d,{children:[t(a,{variant:"subtitle2",children:"To debug: "}),e("ul",{children:[t("li",{children:t(a,{variant:"body1",children:"Check that input component exists"})}),t("li",{children:e(a,{variant:"body1",children:["Check it exists on an entity of type ",t("strong",{children:c(s.entityId)})]})}),t("li",{children:e(a,{variant:"body1",children:["Check that the ",t("strong",{children:"instanceName"})," is correct and there is no typo"]})})]})]}),t(o,{}),t(T,{})]})});let p=s instanceof Error?s.stack:null;return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"There was an unknown error in the configurator context!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", after data was successfully loaded. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A state update caused an invariant violation"}),t("li",{children:"Component rendering failed due to invalid state"}),t("li",{children:"Business rules or transformations threw an unexpected error"}),t("li",{children:"Invalid data was introduced through user interactions or computed values"})]})]}),t(a,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(W,{}),t(a,{variant:"subtitle2",children:"Error: "}),t(a,{variant:"body2",children:`${s}`}),p&&e(i,{children:[t(o,{}),t(k,{stack:p,error:s})]}),t(o,{}),t(T,{})]})})};
1
+ import{jsx as t,jsxs as e,Fragment as i}from"react/jsx-runtime";import{Box as n,Button as r,Divider as o,Typography as a}from"@mui/material";import{Stack as d}from"@mui/system";import{useMemo as s}from"react";import{domainEntityTypeFromId as c}from"#package/domain";import{ControlAttachmentError as l,useAccessService as h,useBackendData as m,useCommittedState as p,useConfiguratorRouting as f,useDomain as b,useFrontendData as u,useIsDev as v,useLoadedData as y,usePublishedData as x,useRenderedState as g,useSessionService as S}from"#package/react-sdk";import{JsonViewer as k,StackTraceViewer as w}from"#package/ui-sdk";import{useResetOnEditorHotReload as C}from"./use-reset-on-editor-hot-reload.js";let W=()=>{let i=f();return e(d,{direction:"row",spacing:2,sx:{mb:2},children:[t(r,{variant:"outlined",size:"small",onClick:()=>{i.goToIndex()},children:"Reset state"}),t(r,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},T=()=>{let{compositionProjections:r,componentReader:c,storeSystem:l}=b(),f=p(),v=g(),w=y(),C=h(),W=S(),T=x(),I=u(),z=m(),L=s(()=>{try{return r.getTree(f)}catch(t){return null}},[f,r]),D=s(()=>c.readManyComponents({},f),[f,c]),R=s(()=>{try{return r.getTree(v)}catch(t){return null}},[v,r]),A=s(()=>c.readManyComponents({},v),[v,c]),U=l.stateSlices.committed.value,E=l.stateSlices.potentiallyInvalid.value,M=E.validity.valid||"uncaught"===E.validity.severity?[]:E.validity.entityViolations,N=M.length>0,P="reset"!==U.kind;return e(n,{component:"div",children:[t(a,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(n,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(a,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[e("li",{children:[t("strong",{children:"Start with Last Emission:"})," Check if there are invariant violations - these often indicate the root cause"]}),e("li",{children:[t("strong",{children:"Review Last Updates:"})," See which state changes were applied right before the error occurred"]}),e("li",{children:[t("strong",{children:"Check Committed vs Rendered State:"})," Compare these to identify inconsistencies or timing issues"]}),e("li",{children:[t("strong",{children:"Inspect Composition Tree:"})," Verify that all entities are composed correctly"]}),e("li",{children:[t("strong",{children:"Review Data Sources:"})," Ensure all required data is loaded and in the expected format"]}),t("li",{children:'Use the "Reset state" button to navigate back to the index page without reloading'}),t("li",{children:'Use the "Reload Page" button to perform a full page refresh if state is corrupted'})]})})]}),(N||P)&&e(i,{children:[e(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:N?"error.main":"primary.main"},children:["Last Emission ",N&&"(Has Violations!)"]}),e(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:["The most recent state update that was applied."," ",N?"Contains invariant violations that prevented the state from being committed.":"Shows what changed in the application state."]}),N&&t(i,{children:e(n,{component:"div",sx:{p:2,backgroundColor:"#ffebee",borderRadius:1,borderLeft:"4px solid #f44336",mb:2},children:[t(a,{variant:"subtitle2",sx:{color:"error.main",mb:1},children:"⚠️ Invariant Violations:"}),t(d,{component:"div",spacing:1,children:M.map((i,r)=>e(n,{component:"div",sx:{pl:2},children:[e(a,{variant:"body2",sx:{fontWeight:600},children:["Entity: ",String(i.entityId)]}),t(a,{variant:"caption",sx:{color:"text.secondary",display:"block",fontFamily:"monospace",fontSize:"0.75rem"},children:JSON.stringify(i.violation)})]},r))})]})}),P&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Last Updates"}),t(k,{data:U.updates})]}),U.transformationLog&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Transformation Log"}),t(k,{data:U.transformationLog})]}),t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Validity"}),t(k,{data:E.validity}),t(o,{sx:{my:4}})]}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Committed Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:'The last valid state that was successfully committed. This is the "source of truth" for the application state and passes all invariant checks.'}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(k,{data:f})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(k,{data:D})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),L&&t(k,{data:L})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Rendered Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The state that's currently being used to render the UI. This may differ from committed state during animations or transitions."}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(k,{data:v})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(k,{data:A})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),R&&t(k,{data:R})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(k,{data:T}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(k,{data:I}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(k,{data:z}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(k,{data:W}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(k,{data:w}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(k,{data:C}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevContextFallback=r=>{let{error:s,resetErrorBoundary:h}=r,m=v();if(C(h),!m)throw s;if(s instanceof l)return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"Can not render a control input!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", during the rendering of UI controls. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A control input component is referenced but not defined in the domain"}),t("li",{children:"The instanceName has a typo or doesn't match the actual component name"}),t("li",{children:"The entity type doesn't support the requested control input"})]})]}),t(W,{}),t(o,{}),t(a,{variant:"body1",children:s.message}),t(o,{}),e(d,{spacing:2,direction:"row",children:[e(d,{children:[t(a,{variant:"subtitle2",children:"Instance Name: "}),t(a,{variant:"subtitle2",children:"Entity Id: "})]}),e(d,{children:[t(a,{variant:"body1",children:s.instanceName}),t(a,{variant:"body1",children:s.entityId})]})]}),t(o,{}),s.stack&&e(i,{children:[t(w,{stack:s.stack,error:s}),t(o,{})]}),e(d,{children:[t(a,{variant:"subtitle2",children:"To debug: "}),e("ul",{children:[t("li",{children:t(a,{variant:"body1",children:"Check that input component exists"})}),t("li",{children:e(a,{variant:"body1",children:["Check it exists on an entity of type ",t("strong",{children:c(s.entityId)})]})}),t("li",{children:e(a,{variant:"body1",children:["Check that the ",t("strong",{children:"instanceName"})," is correct and there is no typo"]})})]})]}),t(o,{}),t(T,{})]})});let p=s instanceof Error?s.stack:null;return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"There was an unknown error in the configurator context!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", after data was successfully loaded. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A state update caused an invariant violation"}),t("li",{children:"Component rendering failed due to invalid state"}),t("li",{children:"Business rules or transformations threw an unexpected error"}),t("li",{children:"Invalid data was introduced through user interactions or computed values"})]})]}),t(a,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(W,{}),t(a,{variant:"subtitle2",children:"Error: "}),t(a,{variant:"body2",children:`${s}`}),p&&e(i,{children:[t(o,{}),t(w,{stack:p,error:s})]}),t(o,{}),t(T,{})]})})};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{Box as i,Button as n,Divider as o,Stack as a,Typography as s}from"@mui/material";import{useEffect as c,useRef as d}from"react";import{useAccessService as l,useBackendData as h,useFrontendData as m,useIsDev as f,useLoadedData as u,useOverridesHash as p,usePublishedData as b,useSessionService as x}from"#package/react-sdk";import{JsonViewer as g,StackTraceViewer as v}from"#package/ui-sdk";import{useConfiguratorRouting as y}from"../../configurator-context/index.js";import{useResetOnEditorHotReload as k}from"./use-reset-on-editor-hot-reload.js";let w=()=>{let r=y();return e(a,{direction:"row",spacing:2,sx:{mb:2},children:[t(n,{variant:"outlined",size:"small",onClick:()=>{r.goToIndex()},children:"Reset state"}),t(n,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},S=()=>{let n=u(),a=l(),c=x(),d=b(),f=m(),p=h();return e(r,{children:[t(s,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(i,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(s,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(s,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[t("li",{children:"Check the error message and stack trace above for the exact location of the issue"}),t("li",{children:"Review the data sections below to understand the current application state"}),t("li",{children:"Look for missing or unexpected values in Published, Frontend, or Backend Data"}),t("li",{children:"Verify that all required data sources are loaded correctly"}),t("li",{children:"Check Session Service for authentication issues"}),t("li",{children:'Use the "Reset state" button to return to the index page'}),t("li",{children:'Use the "Reload Page" button to start fresh if the issue persists'})]})})]}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(g,{data:d}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(g,{data:f}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(g,{data:p}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(g,{data:c}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(g,{data:n}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(g,{data:a}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevLoadingFallback=n=>{let{error:l,resetErrorBoundary:h}=n,m=f(),u=p();k(h);let b=d(null);if(c(()=>{if(h){if(null===b.current){b.current=u;return}u!==b.current&&h()}},[u,h]),!m)throw l;if(l instanceof Error)return t(i,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(a,{component:"div",spacing:3,sx:{p:5,boxSizing:"border-box"},alignItems:"flex-start",children:[t(s,{variant:"h6",sx:{mb:2,mt:2},color:"error",children:"Loading of the context failed for an unknown reason!"}),e(i,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(s,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(s,{variant:"body2",children:["This error happened ",t("strong",{children:"during the initial loading of data"})," before the configurator could start. Most likely causes:"]}),e(s,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"Migration scripts failed to transform the data correctly"}),t("li",{children:"State initialization encountered invalid or corrupted data"})]})]}),t(s,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(w,{}),t(s,{variant:"subtitle2",children:"Error: "}),t(s,{variant:"body2",children:l.message}),l.stack&&e(r,{children:[t(o,{}),t(v,{stack:l.stack,error:l})]}),t(o,{}),t(S,{})]})});let x=l instanceof Error?l.stack:null;return t(i,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(a,{component:"div",spacing:3,sx:{p:5,boxSizing:"border-box"},children:[t(s,{variant:"h6",sx:{mb:2,mt:2},color:"error",children:"Loading of the context failed for an unknown reason!"}),t(s,{variant:"body2",children:"This should not happen, please report it so we can improve the platform!"}),t(w,{}),t(s,{variant:"subtitle2",children:"Error: "}),t(s,{variant:"body2",children:`${l}`}),x&&e(r,{children:[t(o,{}),t(v,{stack:x,error:l})]}),t(o,{}),t(S,{})]})})};
1
+ import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{Box as i,Button as n,Divider as o,Stack as a,Typography as s}from"@mui/material";import{useEffect as c,useRef as d}from"react";import{useAccessService as l,useBackendData as h,useConfiguratorRouting as m,useFrontendData as f,useIsDev as u,useLoadedData as p,useOverridesHash as b,usePublishedData as x,useSessionService as v}from"#package/react-sdk";import{JsonViewer as g,StackTraceViewer as y}from"#package/ui-sdk";import{useResetOnEditorHotReload as k}from"./use-reset-on-editor-hot-reload.js";let w=()=>{let r=m();return e(a,{direction:"row",spacing:2,sx:{mb:2},children:[t(n,{variant:"outlined",size:"small",onClick:()=>{r.goToIndex()},children:"Reset state"}),t(n,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},S=()=>{let n=p(),a=l(),c=v(),d=x(),m=f(),u=h();return e(r,{children:[t(s,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(i,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(s,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(s,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[t("li",{children:"Check the error message and stack trace above for the exact location of the issue"}),t("li",{children:"Review the data sections below to understand the current application state"}),t("li",{children:"Look for missing or unexpected values in Published, Frontend, or Backend Data"}),t("li",{children:"Verify that all required data sources are loaded correctly"}),t("li",{children:"Check Session Service for authentication issues"}),t("li",{children:'Use the "Reset state" button to return to the index page'}),t("li",{children:'Use the "Reload Page" button to start fresh if the issue persists'})]})})]}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(g,{data:d}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(g,{data:m}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(g,{data:u}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(g,{data:c}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(g,{data:n}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(g,{data:a}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevLoadingFallback=n=>{let{error:l,resetErrorBoundary:h}=n,m=u(),f=b();k(h);let p=d(null);if(c(()=>{if(h){if(null===p.current){p.current=f;return}f!==p.current&&h()}},[f,h]),!m)throw l;if(l instanceof Error)return t(i,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(a,{component:"div",spacing:3,sx:{p:5,boxSizing:"border-box"},alignItems:"flex-start",children:[t(s,{variant:"h6",sx:{mb:2,mt:2},color:"error",children:"Loading of the context failed for an unknown reason!"}),e(i,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(s,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(s,{variant:"body2",children:["This error happened ",t("strong",{children:"during the initial loading of data"})," before the configurator could start. Most likely causes:"]}),e(s,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"Migration scripts failed to transform the data correctly"}),t("li",{children:"State initialization encountered invalid or corrupted data"})]})]}),t(s,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(w,{}),t(s,{variant:"subtitle2",children:"Error: "}),t(s,{variant:"body2",children:l.message}),l.stack&&e(r,{children:[t(o,{}),t(y,{stack:l.stack,error:l})]}),t(o,{}),t(S,{})]})});let x=l instanceof Error?l.stack:null;return t(i,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(a,{component:"div",spacing:3,sx:{p:5,boxSizing:"border-box"},children:[t(s,{variant:"h6",sx:{mb:2,mt:2},color:"error",children:"Loading of the context failed for an unknown reason!"}),t(s,{variant:"body2",children:"This should not happen, please report it so we can improve the platform!"}),t(w,{}),t(s,{variant:"subtitle2",children:"Error: "}),t(s,{variant:"body2",children:`${l}`}),x&&e(r,{children:[t(o,{}),t(y,{stack:x,error:l})]}),t(o,{}),t(S,{})]})})};
@@ -4,6 +4,6 @@ interface ScreenshotThumbnailsProps {
4
4
  /** Called once a picture has loaded, which changes the size of the popover. */
5
5
  readonly onImageLoad: () => void;
6
6
  }
7
- /** The pictures of a tool call's screenshots, each captioned by its view and entity id. */
7
+ /** The pictures of a tool call's screenshots. */
8
8
  export declare const ScreenshotThumbnails: ({ screenshots, onImageLoad }: ScreenshotThumbnailsProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{styled as r}from"@mui/material";import{AssistantPanelName as o}from"../theme.js";let a=r("span",{name:o,slot:"screenshots"})(({theme:{palette:e,shape:i,shadows:r,spacing:o,typography:a}})=>({...a.caption,background:e.background.paper,borderRadius:i.borderRadius,boxShadow:r[4],color:e.text.secondary,display:"grid",gap:o(1.5),gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",inlineSize:"min(80vw, 480px)",padding:o(1.5)})),n=r("span")(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(.5),minInlineSize:0})),t=r("img")(({theme:{palette:e,shape:i}})=>({blockSize:"auto",borderRadius:i.borderRadius/2,boxShadow:`inset 0 0 0 1px ${e.divider}`,inlineSize:"100%"})),s=r("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});export const ScreenshotThumbnails=({screenshots:r,onImageLoad:o})=>e(a,{children:r.map(({label:r,entityId:a,view:d,src:l})=>i(n,{children:[e(t,{src:l,alt:"",onLoad:o}),i(s,{title:r,children:[d," \xb7 ",a]})]},r))});
1
+ import{jsx as e}from"react/jsx-runtime";import{styled as o}from"@mui/material";import{AssistantPanelName as r}from"../theme.js";import{useScreenshotSrc as a}from"./use-screenshot-src.js";let i=o("span",{name:r,slot:"screenshots",shouldForwardProp:e=>"columns"!==e})(({columns:e,theme:{palette:o,shape:r,shadows:a,spacing:i}})=>({background:o.background.paper,borderRadius:r.borderRadius,boxShadow:a[4],display:"grid",gap:i(1.5),gridTemplateColumns:`repeat(${e}, minmax(0, 200px))`,maxInlineSize:"80vw",padding:i(1.5)})),s=o("img")(({theme:{palette:e,shape:o}})=>({blockSize:"auto",borderRadius:o.borderRadius/2,boxShadow:`inset 0 0 0 1px ${e.divider}`,display:"block",inlineSize:"100%"})),d=o("span")(({theme:{palette:e,shape:o}})=>({aspectRatio:"4 / 3",background:e.action.hover,borderRadius:o.borderRadius/2,display:"block"})),t=({picture:o,onImageLoad:r})=>{let i=a(o);return void 0===i?e(d,{}):e(s,{src:i,alt:"",onLoad:r})};export const ScreenshotThumbnails=({screenshots:o,onImageLoad:r})=>e(i,{columns:Math.min(o.length,2),children:o.map(({label:o,picture:a})=>e(t,{picture:a,onImageLoad:r},o))});
@@ -1,11 +1,19 @@
1
+ /**
2
+ * Where the panel gets a screenshot's picture from: the server, by the id the browser uploaded it
3
+ * under, or the data URL of a picture a thread from before the upload carries inline.
4
+ */
5
+ export type AssistantScreenshotPicture = {
6
+ readonly kind: 'stored';
7
+ readonly imageId: string;
8
+ } | {
9
+ readonly kind: 'inline';
10
+ readonly src: string;
11
+ };
1
12
  /** A screenshot a `query` or `apply` call took, as the panel shows it. */
2
13
  export interface AssistantToolScreenshot {
3
14
  /** The label the call's `image` field returned, such as `Cabinet-2/doorLayout#2`. */
4
15
  readonly label: string;
5
- readonly entityId: string;
6
- readonly view: string;
7
- /** The picture as a data URL. */
8
- readonly src: string;
16
+ readonly picture: AssistantScreenshotPicture;
9
17
  }
10
18
  /**
11
19
  * The screenshots of a tool result: the image parts that follow the result's JSON, each after the
@@ -1 +1 @@
1
- import{z as e}from"zod";let t=e.object({type:e.literal("text"),content:e.string()}),a=e.object({type:e.literal("image"),source:e.object({type:e.literal("data"),value:e.string(),mimeType:e.string()})}),s=/^([^/]+)\/([^#]+)(?:#\d+)?$/;export const readToolScreenshots=e=>Array.isArray(e)?e.slice(1).flatMap((e,r,c)=>{let l=a.safeParse(e),o=t.safeParse(c[r-1]),n=o.success?s.exec(o.data.content):null;if(!l.success||!o.success||!n?.[1]||!n[2])return[];let{value:i,mimeType:d}=l.data.source;return[{label:o.data.content,entityId:n[1],view:n[2],src:`data:${d};base64,${i}`}]}):[];
1
+ import{z as t}from"zod";import{readAssistantImageReference as e}from"@salsita-ai/contracts/assistant";let a=t.object({type:t.literal("text"),content:t.string()}),r=t.object({type:t.literal("image"),source:t.discriminatedUnion("type",[t.object({type:t.literal("url"),value:t.string()}),t.object({type:t.literal("data"),value:t.string(),mimeType:t.string()})])}),s=/^[^/]+\/[^#]+(?:#\d+)?$/;export const readToolScreenshots=t=>Array.isArray(t)?t.slice(1).flatMap((t,l,i)=>{let n=r.safeParse(t),o=a.safeParse(i[l-1]),c=n.success?(({source:t})=>{if("data"===t.type)return{kind:"inline",src:`data:${t.mimeType};base64,${t.value}`};let a=e(t.value);return null===a?null:{kind:"stored",imageId:a}})(n.data):null;return c&&o.success&&s.test(o.data.content)?[{label:o.data.content,picture:c}]:[]}):[];
@@ -0,0 +1,8 @@
1
+ import type { AssistantScreenshotPicture } from './tool-screenshots.js';
2
+ /**
3
+ * The `src` of a screenshot's picture: the data URL of an inline one at once, and for an uploaded
4
+ * one the object URL the assistant system reads it into, once it has been read; `undefined` until
5
+ * then and when the read fails. Only the open popover of a call's screenshots calls it, so nothing
6
+ * is read while the popover is closed.
7
+ */
8
+ export declare const useScreenshotSrc: (picture: AssistantScreenshotPicture) => string | undefined;
@@ -0,0 +1 @@
1
+ import{useEffect as r,useState as e}from"react";import{useConfigurator as n}from"../../../application-runtime/index.js";export const useScreenshotSrc=t=>{let{assistantSystem:i}=n(),o="stored"===t.kind?t.imageId:null,[l,d]=e();return(r(()=>{if(null===o)return;let r=!0;return i.loadScreenshotUrl(o).then(e=>{r&&d({imageId:o,src:e})},()=>void 0),()=>{r=!1}},[i,o]),"inline"===t.kind)?t.src:l?.imageId===o?l.src:void 0};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as t,Typography as o,styled as s}from"@mui/material";import{PhxIcon as a}from"#package/ui-sdk";import{useConfiguratorRouting as n}from"../../../../configurator-context/index.js";let c=s("div")(({theme:{spacing:e}})=>({display:"grid",minBlockSize:"100cqb",padding:e(2),placeItems:"center",position:"relative"})),m=s("div")({maxInlineSize:"80ch",textAlign:"center",textWrap:"pretty"});export const GPUAccelerationDisabled=()=>{let{goToIndex:s}=n();return e(c,{children:r(m,{children:[e(a,{name:"CubeDuotone",sx:{fontSize:48}}),e(o,{component:"h1",variant:"h4",sx:{my:4},children:e(i,{id:"sdk.messages.error.gpuDisabled.title",message:"GPU acceleration disabled"})}),e(o,{color:"text.secondary",children:e(i,{id:"sdk.messages.error.gpuDisabled.message",message:"Your browser has GPU acceleration disabled, which prevents the configurator from working correctly. 3D performance is severely impacted. Enabled this option in your browser settings to use the configurator."})}),e(t,{variant:"text",color:"primary",size:"large",sx:{mt:6.5},onClick:s,children:e(i,{id:"sdk.messages.navigation.goToHomepage.label",message:"Go To Homepage"})})]})})};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as a,Typography as t,styled as s}from"@mui/material";import{useConfiguratorRouting as o}from"#package/react-sdk";import{PhxIcon as n}from"#package/ui-sdk";let c=s("div")(({theme:{spacing:e}})=>({display:"grid",minBlockSize:"100cqb",padding:e(2),placeItems:"center",position:"relative"})),m=s("div")({maxInlineSize:"80ch",textAlign:"center",textWrap:"pretty"});export const GPUAccelerationDisabled=()=>{let{goToIndex:s}=o();return e(c,{children:r(m,{children:[e(n,{name:"CubeDuotone",sx:{fontSize:48}}),e(t,{component:"h1",variant:"h4",sx:{my:4},children:e(i,{id:"sdk.messages.error.gpuDisabled.title",message:"GPU acceleration disabled"})}),e(t,{color:"text.secondary",children:e(i,{id:"sdk.messages.error.gpuDisabled.message",message:"Your browser has GPU acceleration disabled, which prevents the configurator from working correctly. 3D performance is severely impacted. Enabled this option in your browser settings to use the configurator."})}),e(a,{variant:"text",color:"primary",size:"large",sx:{mt:6.5},onClick:s,children:e(i,{id:"sdk.messages.navigation.goToHomepage.label",message:"Go To Homepage"})})]})})};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as o}from"@lingui/react";import{Button as t,Typography as i,styled as s}from"@mui/material";import{PhxIcon as a}from"#package/ui-sdk";import{useConfiguratorRouting as n}from"../../../../configurator-context/index.js";let m=s("div")(({theme:{spacing:e}})=>({display:"grid",minBlockSize:"100cqb",padding:e(2),placeItems:"center",position:"relative"})),d=s("div")({maxInlineSize:"80ch",textAlign:"center",textWrap:"pretty"});export const WebGLNotSupported=()=>{let{goToIndex:s}=n();return e(m,{children:r(d,{children:[e(a,{name:"CubeDuotone",sx:{fontSize:48}}),e(i,{component:"h1",variant:"h4",sx:{my:4},children:e(o,{id:"sdk.messages.error.webglNotSupported.title",message:"WebGL is not supported or cannot be initialized"})}),e(i,{color:"text.secondary",children:e(o,{id:"sdk.messages.error.webglNotSupported.message",message:"Your device or browser does not support WebGL, which is required for the configurator to function. Try a different browser or device that supports WebGL"})}),e(t,{variant:"text",color:"primary",size:"large",sx:{mt:6.5},onClick:s,children:e(o,{id:"sdk.messages.navigation.goToHomepage.label",message:"Go To Homepage"})})]})})};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as t}from"@lingui/react";import{Button as o,Typography as i,styled as s}from"@mui/material";import{useConfiguratorRouting as a}from"#package/react-sdk";import{PhxIcon as n}from"#package/ui-sdk";let m=s("div")(({theme:{spacing:e}})=>({display:"grid",minBlockSize:"100cqb",padding:e(2),placeItems:"center",position:"relative"})),d=s("div")({maxInlineSize:"80ch",textAlign:"center",textWrap:"pretty"});export const WebGLNotSupported=()=>{let{goToIndex:s}=a();return e(m,{children:r(d,{children:[e(n,{name:"CubeDuotone",sx:{fontSize:48}}),e(i,{component:"h1",variant:"h4",sx:{my:4},children:e(t,{id:"sdk.messages.error.webglNotSupported.title",message:"WebGL is not supported or cannot be initialized"})}),e(i,{color:"text.secondary",children:e(t,{id:"sdk.messages.error.webglNotSupported.message",message:"Your device or browser does not support WebGL, which is required for the configurator to function. Try a different browser or device that supports WebGL"})}),e(o,{variant:"text",color:"primary",size:"large",sx:{mt:6.5},onClick:s,children:e(t,{id:"sdk.messages.navigation.goToHomepage.label",message:"Go To Homepage"})})]})})};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as o}from"@lingui/react";import{Button as n,DialogActions as r,DialogContent as i,DialogContentText as t,DialogTitle as l,Dialog as c,dialogClasses as s,styled as d}from"@mui/material";import{useMutation as m}from"@tanstack/react-query";import{useCallback as u}from"react";import{useAuthorizedClient as p,useConfigurationId as g,useDomainApplication as f}from"#package/react-sdk";import{LoadingButton as k}from"#package/ui-sdk";import{useConfiguratorRouting as y}from"../../../../configurator-context/index.js";let h=d(c)(()=>({[`.${s.paper}`]:{inlineSize:"min(480px, 100%)",maxWidth:"unset"}}));export const CloneToEditDialog=c=>{let{onClose:s,open:d}=c,{goToConfigurationDetail:b}=y(),x=p(),C=g(),{configurationPersistSystem:j}=f(),{mutate:v,isPending:T}=m({mutationFn:()=>x.cloneConfiguration(C,j.revisionId$.value),onSuccess:e=>{s(),b(e.configurationId,e.accessToken)}}),D=u(()=>{v()},[v]);return a(h,{open:d,onClose:s,children:[e(l,{children:e(o,{id:"sdk.layout.banner.readonly.clone.title",message:"Edit configuration"})}),e(i,{children:e(t,{children:e(o,{id:"sdk.layout.banner.readonly.clone.message",message:"You're about to create an editable copy of this setup. Changes you make won't affect the original shared link."})})}),a(r,{children:[e(n,{variant:"text",color:"inherit",onClick:s,children:e(o,{id:"sdk.layout.banner.readonly.cancel.label",message:"Cancel"})}),e(k,{variant:"contained",color:"primary",busy:T,onClick:D,children:e(o,{id:"sdk.layout.banner.readonly.clone.label",message:"Create editable copy"})})]})]})};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as n}from"@lingui/react";import{Button as o,DialogActions as r,DialogContent as i,DialogContentText as t,DialogTitle as l,Dialog as s,dialogClasses as c,styled as d}from"@mui/material";import{useMutation as m}from"@tanstack/react-query";import{useCallback as u}from"react";import{useAuthorizedClient as p,useConfigurationId as g,useConfiguratorRouting as k,useDomainApplication as y}from"#package/react-sdk";import{LoadingButton as f}from"#package/ui-sdk";let h=d(s)(()=>({[`.${c.paper}`]:{inlineSize:"min(480px, 100%)",maxWidth:"unset"}}));export const CloneToEditDialog=s=>{let{onClose:c,open:d}=s,{goToConfigurationDetail:b}=k(),C=p(),x=g(),{configurationPersistSystem:v}=y(),{mutate:j,isPending:T}=m({mutationFn:()=>C.cloneConfiguration(x,v.revisionId$.value),onSuccess:e=>{c(),b(e.configurationId,e.accessToken)}}),D=u(()=>{j()},[j]);return a(h,{open:d,onClose:c,children:[e(l,{children:e(n,{id:"sdk.layout.banner.readonly.clone.title",message:"Edit configuration"})}),e(i,{children:e(t,{children:e(n,{id:"sdk.layout.banner.readonly.clone.message",message:"You're about to create an editable copy of this setup. Changes you make won't affect the original shared link."})})}),a(r,{children:[e(o,{variant:"text",color:"inherit",onClick:c,children:e(n,{id:"sdk.layout.banner.readonly.cancel.label",message:"Cancel"})}),e(f,{variant:"contained",color:"primary",busy:T,onClick:D,children:e(n,{id:"sdk.layout.banner.readonly.clone.label",message:"Create editable copy"})})]})]})};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useCallback as t,useState as e}from"react";import{useLocalizable as i}from"#package/react-sdk";import{ExperimentalChatUi as n,MobileChat as m}from"#package/ui-sdk";import{useChatEnabled as l}from"../../../configurator-context/index.js";import{Chat as s}from"./Chat.js";export const MobileChat=c=>{let{icon:p,label:h,heading:d}=c,[f,g]=e(!1),u=l(),x=i(h),b=t(()=>{g(!0)},[]),j=t(()=>{g(!1)},[]);return u?r(o,{children:[a(m.Button,{icon:p,ariaLabel:x,handleOpen:b}),a(m.Dialog,{isOpen:f,handleClose:j,heading:d,children:a(n.ChatRoot,{variant:"mobile",children:a(s,{variant:"mobile"})})})]}):null};
1
+ import{jsx as a,jsxs as e,Fragment as r}from"react/jsx-runtime";import{useCallback as t,useState as o}from"react";import{useChatEnabled as i,useLocalizable as n}from"#package/react-sdk";import{ExperimentalChatUi as l,MobileChat as m}from"#package/ui-sdk";import{Chat as s}from"./Chat.js";export const MobileChat=c=>{let{icon:h,label:p,heading:d}=c,[b,f]=o(!1),g=i(),u=n(p),C=t(()=>{f(!0)},[]),j=t(()=>{f(!1)},[]);return g?e(r,{children:[a(m.Button,{icon:h,ariaLabel:u,handleOpen:C}),a(m.Dialog,{isOpen:b,handleClose:j,heading:d,children:a(l.ChatRoot,{variant:"mobile",children:a(s,{variant:"mobile"})})})]}):null};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as t}from"@mui/material";import{memo as e,useCallback as i}from"react";import{FrontendAnalyticsFactory as a,useAnalyticsService as m,useIntegrationState as n}from"#package/react-sdk";import{PhxIcon as s}from"#package/ui-sdk";import{useConfiguratorRouting as c,usePresetSelection as l,usePreview as p}from"../../../../configurator-context/index.js";import{CloseConfiguratorButton as d}from"./CloseConfiguratorButton.js";export const CommonTopNavigation=e(()=>{let e=m(),f=c(),{presetCategories:u}=l(),{isPreview:g,isPreviewEnabled:k}=p(),x=u.flatMap(o=>o.presets).length>1,C=n(),j=i(()=>{e.push(a.GoToProductsClicked()),f.goToIndex()},[e,f]);if(!C.embeddedView)return x||!k||g?x?o(t,{size:"small",startIcon:o(s,{name:"ArrowLeft"}),onClick:j,children:o(r,{id:"sdk.layout.navigation.common.product.label",message:"Website"})}):null:o(d,{})});
1
+ import{jsx as o}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as t}from"@mui/material";import{memo as e,useCallback as i}from"react";import{FrontendAnalyticsFactory as a,useAnalyticsService as m,useConfiguratorRouting as n,useIntegrationState as s}from"#package/react-sdk";import{PhxIcon as c}from"#package/ui-sdk";import{usePresetSelection as l,usePreview as p}from"../../../../configurator-context/index.js";import{CloseConfiguratorButton as d}from"./CloseConfiguratorButton.js";export const CommonTopNavigation=e(()=>{let e=m(),f=n(),{presetCategories:u}=l(),{isPreview:g,isPreviewEnabled:k}=p(),x=u.flatMap(o=>o.presets).length>1,C=s(),j=i(()=>{e.push(a.GoToProductsClicked()),f.goToIndex()},[e,f]);if(!C.embeddedView)return x||!k||g?x?o(t,{size:"small",startIcon:o(c,{name:"ArrowLeft"}),onClick:j,children:o(r,{id:"sdk.layout.navigation.common.product.label",message:"Website"})}):null:o(d,{})});
@@ -1 +1 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{AnimatePresence as e,motion as r}from"motion/react";import{AnimationTarget as m,Sidebar as i}from"#package/ui-sdk";import{useChatEnabled as a}from"../../../../configurator-context/index.js";import{ChatInteractionContainer as n}from"../../chat/ChatInteractionContainer.js";import{CommonFinalizeButton as c}from"../common/CommonFinalizeButton.js";import{CommonSidebarFooter as s}from"../common/CommonSidebarFooter.js";import{DesktopSummaryButton as u}from"../common/DesktopSummaryButton.js";import{SimpleSidebarContent as p}from"./SimpleSidebarContent.js";let d={transition:{type:"spring",duration:.3},variants:{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:16}}};export const SimpleSidebar=l=>{let{summaryPage:y,customPriceNode:f,onEnterSummary:S,onLeaveSummary:h,price:B,isSummaryActive:j,hasSummary:v}=l,x=a();return t(i.Layout,{content:t(p,{isSummaryActive:j,summaryPage:y,onLeaveSummary:h}),chat:x&&t(n,{}),footer:o(e,{initial:!1,mode:"wait",children:[!v&&t(s,{customPriceNode:f,formattedPrice:B,actionButton:t(c,{}),showTemplateButton:!0,showSaveTemplateButton:!0}),v&&!j&&t(r.div,{...d,...m,children:t(s,{customPriceNode:f,actionButton:t(u,{onEnterSummary:S}),formattedPrice:B,showSaveTemplateButton:!1})},"sidebarFooterSummary"),v&&j&&t(r.div,{...d,...m,children:t(s,{customPriceNode:f,actionButton:t(c,{}),formattedPrice:B,showTemplateButton:!0,showSaveTemplateButton:!0})},"sidebarFooterSummary")]})})};
1
+ import{jsx as t,jsxs as o}from"react/jsx-runtime";import{AnimatePresence as e,motion as r}from"motion/react";import{useChatEnabled as m}from"#package/react-sdk";import{AnimationTarget as a,Sidebar as i}from"#package/ui-sdk";import{ChatInteractionContainer as n}from"../../chat/ChatInteractionContainer.js";import{CommonFinalizeButton as c}from"../common/CommonFinalizeButton.js";import{CommonSidebarFooter as s}from"../common/CommonSidebarFooter.js";import{DesktopSummaryButton as p}from"../common/DesktopSummaryButton.js";import{SimpleSidebarContent as u}from"./SimpleSidebarContent.js";let d={transition:{type:"spring",duration:.3},variants:{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:16}}};export const SimpleSidebar=l=>{let{summaryPage:y,customPriceNode:S,onEnterSummary:f,onLeaveSummary:h,price:B,isSummaryActive:j,hasSummary:v}=l,P=m();return t(i.Layout,{content:t(u,{isSummaryActive:j,summaryPage:y,onLeaveSummary:h}),chat:P&&t(n,{}),footer:o(e,{initial:!1,mode:"wait",children:[!v&&t(s,{customPriceNode:S,formattedPrice:B,actionButton:t(c,{}),showTemplateButton:!0,showSaveTemplateButton:!0}),v&&!j&&t(r.div,{...d,...a,children:t(s,{customPriceNode:S,actionButton:t(p,{onEnterSummary:f}),formattedPrice:B,showSaveTemplateButton:!1})},"sidebarFooterSummary"),v&&j&&t(r.div,{...d,...a,children:t(s,{customPriceNode:S,actionButton:t(c,{}),formattedPrice:B,showTemplateButton:!0,showSaveTemplateButton:!0})},"sidebarFooterSummary")]})})};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as t}from"@mui/material";import{memo as e,useCallback as i}from"react";import{FrontendAnalyticsFactory as a,useAnalyticsService as m,usePresetEmbeddedState as s}from"#package/react-sdk";import{PhxIcon as n}from"#package/ui-sdk";import{useConfiguratorRouting as l,usePresetSelection as p,usePreview as c}from"../../../../configurator-context/index.js";import{CloseConfiguratorButton as f}from"../common/CloseConfiguratorButton.js";export const SimpleMobileTopNavigation=e(()=>{let e=m(),u=l(),{presetCategories:d}=p(),{isPreview:g,isPreviewEnabled:k}=c(),x=d.flatMap(o=>o.presets).length>1,b=i(()=>{e.push(a.GoToProductsClicked()),u.goToIndex()},[e,u]);if(!s())return x||g||!k?x?o(t,{size:"small",startIcon:o(n,{name:"ArrowLeft"}),onClick:b,children:o(r,{id:"sdk.layout.navigation.mobile.product.label",message:"Website"})}):null:o(f,{})});
1
+ import{jsx as o}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as t}from"@mui/material";import{memo as e,useCallback as i}from"react";import{FrontendAnalyticsFactory as a,useAnalyticsService as m,useConfiguratorRouting as s,usePresetEmbeddedState as n}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{usePresetSelection as p,usePreview as c}from"../../../../configurator-context/index.js";import{CloseConfiguratorButton as f}from"../common/CloseConfiguratorButton.js";export const SimpleMobileTopNavigation=e(()=>{let e=m(),u=s(),{presetCategories:d}=p(),{isPreview:g,isPreviewEnabled:k}=c(),x=d.flatMap(o=>o.presets).length>1,b=i(()=>{e.push(a.GoToProductsClicked()),u.goToIndex()},[e,u]);if(!n())return x||g||!k?x?o(t,{size:"small",startIcon:o(l,{name:"ArrowLeft"}),onClick:b,children:o(r,{id:"sdk.layout.navigation.mobile.product.label",message:"Website"})}):null:o(f,{})});
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{Trans as a}from"@lingui/react";import{memo as i,useCallback as o}from"react";import{FrontendAnalyticsFactory as s,useActiveNavigationState as n,useAnalyticsService as r,useDomain as p,usePresetEmbeddedState as c,useResolveLocalizable as l}from"#package/react-sdk";import{TopNavigation as d,useResponsive as m}from"#package/ui-sdk";import{useConfiguratorRouting as g,usePresetSelection as u}from"../../../../configurator-context/index.js";export const StepsNavigation=i(i=>{let{steps:f}=i,k=r(),{navigationSystem:v,storeSystem:x}=p(),h=n(),C=g(),S=l(),{presetCategories:T}=u(),j=c(),N=T.flatMap(t=>t.presets).length>1,b=!j&&N,I=f.findIndex(t=>t.navigationStates.includes(h))+ +!!b,{isTablet:P}=m(),y=o(()=>{k.push(s.GoToProductsClicked()),C.goToIndex()},[k,C]);return e(d.Root,{activeStep:I,nonLinear:!0,compact:P,fullWidth:!0,children:[b&&t(d.Step,{isCompleted:!0,onClick:y,compact:P,children:t(a,{id:"sdk.layout.navigation.steps.first.label",message:"Products"})}),f.map((e,a)=>{let i=b?a<I-1:a<I,o=S(e.label);return t(d.Step,{isCompleted:i,isDisabled:!i,compact:P,onClick:()=>{let t=e.navigationStates[0];t&&(k.push(s.TopNavigationStepClicked(t)),x.stageAndCommit([v.getNavigationUpdate(t)]))},children:o},o)})]})});
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{Trans as a}from"@lingui/react";import{memo as i,useCallback as o}from"react";import{FrontendAnalyticsFactory as s,useActiveNavigationState as n,useAnalyticsService as r,useConfiguratorRouting as p,useDomain as c,usePresetEmbeddedState as l,useResolveLocalizable as d}from"#package/react-sdk";import{TopNavigation as m,useResponsive as g}from"#package/ui-sdk";import{usePresetSelection as u}from"../../../../configurator-context/index.js";export const StepsNavigation=i(i=>{let{steps:f}=i,k=r(),{navigationSystem:v,storeSystem:x}=c(),h=n(),C=p(),S=d(),{presetCategories:T}=u(),j=l(),N=T.flatMap(t=>t.presets).length>1,b=!j&&N,I=f.findIndex(t=>t.navigationStates.includes(h))+ +!!b,{isTablet:P}=g(),y=o(()=>{k.push(s.GoToProductsClicked()),C.goToIndex()},[k,C]);return e(m.Root,{activeStep:I,nonLinear:!0,compact:P,fullWidth:!0,children:[b&&t(m.Step,{isCompleted:!0,onClick:y,compact:P,children:t(a,{id:"sdk.layout.navigation.steps.first.label",message:"Products"})}),f.map((e,a)=>{let i=b?a<I-1:a<I,o=S(e.label);return t(m.Step,{isCompleted:i,isDisabled:!i,compact:P,onClick:()=>{let t=e.navigationStates[0];t&&(k.push(s.TopNavigationStepClicked(t)),x.stageAndCommit([v.getNavigationUpdate(t)]))},children:o},o)})]})});