@almadar/ui 5.21.9 → 5.21.11

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.
@@ -10,6 +10,7 @@ var LucideIcons2 = require('lucide-react');
10
10
  var PhosphorIcons = require('@phosphor-icons/react');
11
11
  var TablerIcons = require('@tabler/icons-react');
12
12
  var FaIcons = require('react-icons/fa');
13
+ var hooks = require('@almadar/ui/hooks');
13
14
  var evaluator = require('@almadar/evaluator');
14
15
  var reactDom = require('react-dom');
15
16
  var reactRouterDom = require('react-router-dom');
@@ -45,7 +46,6 @@ var react = require('@xyflow/react');
45
46
  var context = require('@almadar/ui/context');
46
47
  var patterns = require('@almadar/patterns');
47
48
  var fiber = require('@react-three/fiber');
48
- var reactQuery = require('@tanstack/react-query');
49
49
 
50
50
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
51
51
 
@@ -1159,11 +1159,11 @@ function ensureObserver() {
1159
1159
  });
1160
1160
  cachedFamily = getCurrentIconFamily();
1161
1161
  }
1162
- function subscribeIconFamily(notify2) {
1162
+ function subscribeIconFamily(notify) {
1163
1163
  ensureObserver();
1164
- listeners.add(notify2);
1164
+ listeners.add(notify);
1165
1165
  return () => {
1166
- listeners.delete(notify2);
1166
+ listeners.delete(notify);
1167
1167
  };
1168
1168
  }
1169
1169
  function getIconFamilySnapshot() {
@@ -2079,520 +2079,11 @@ var init_Button = __esm({
2079
2079
  exports.Button.displayName = "Button";
2080
2080
  }
2081
2081
  });
2082
-
2083
- // locales/en.json
2084
- var en_default;
2085
- var init_en = __esm({
2086
- "locales/en.json"() {
2087
- en_default = {
2088
- $meta: {
2089
- locale: "en",
2090
- direction: "ltr"
2091
- },
2092
- "common.save": "Save",
2093
- "common.cancel": "Cancel",
2094
- "common.delete": "Delete",
2095
- "common.close": "Close",
2096
- "common.confirm": "Are you sure?",
2097
- "common.create": "Create",
2098
- "common.edit": "Edit",
2099
- "common.view": "View",
2100
- "common.add": "Add",
2101
- "common.remove": "Remove",
2102
- "common.search": "Search...",
2103
- "common.filter": "Filter",
2104
- "common.actions": "Actions",
2105
- "common.yes": "Yes",
2106
- "common.no": "No",
2107
- "common.selected": "selected",
2108
- "common.ok": "OK",
2109
- "common.done": "Done",
2110
- "common.apply": "Apply",
2111
- "common.reset": "Reset",
2112
- "common.refresh": "Refresh",
2113
- "common.export": "Export",
2114
- "common.import": "Import",
2115
- "common.copy": "Copy",
2116
- "common.settings": "Settings",
2117
- "nav.previous": "Previous",
2118
- "nav.next": "Next",
2119
- "nav.back": "Back",
2120
- "nav.home": "Home",
2121
- "form.submit": "Submit",
2122
- "form.saving": "Saving...",
2123
- "form.required": "This field is required",
2124
- "form.invalidEmail": "Enter a valid email address",
2125
- "form.selectPlaceholder": "Select {{label}}...",
2126
- "form.searchPlaceholder": "Search {{entity}}...",
2127
- "table.empty.title": "No items found",
2128
- "table.empty.description": "No items to display.",
2129
- "table.search.placeholder": "Search...",
2130
- "table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
2131
- "table.pagination.page": "Page {{page}} of {{totalPages}}",
2132
- "table.bulk.selected": "{{count}} selected",
2133
- "table.loading": "Loading...",
2134
- "status.loading": "Loading...",
2135
- "status.scheduled": "Scheduled",
2136
- "status.inProgress": "In Progress",
2137
- "status.completed": "Completed",
2138
- "status.cancelled": "Cancelled",
2139
- "status.pending": "Pending",
2140
- "status.active": "Active",
2141
- "status.inactive": "Inactive",
2142
- "status.draft": "Draft",
2143
- "status.archived": "Archived",
2144
- "error.generic": "Something went wrong",
2145
- "error.retry": "Try again",
2146
- "error.notFound": "Not found",
2147
- "error.loadFailed": "Failed to load: {{message}}",
2148
- "error.configMissing": "Configuration not found for: {{id}}",
2149
- "common.loading": "Loading...",
2150
- "common.showMore": "Show More",
2151
- "common.showLess": "Show Less",
2152
- "common.noResults": "No results found",
2153
- "common.saveChanges": "Save Changes",
2154
- "common.retry": "Retry",
2155
- "common.open": "Open",
2156
- "common.back": "Back",
2157
- "empty.noItems": "No items",
2158
- "empty.noData": "No data available",
2159
- "empty.noItemsYet": "No items yet",
2160
- "empty.noItemsAdded": "No items added yet",
2161
- "empty.noOptionsFound": "No options found",
2162
- "list.addItemPlaceholder": "Add new item...",
2163
- "error.occurred": "An error occurred",
2164
- "error.failedToLoad": "Failed to load data",
2165
- "wizard.back": "Back",
2166
- "wizard.next": "Next",
2167
- "wizard.complete": "Complete",
2168
- "wizard.stepOf": "Step {{current}} of {{total}}",
2169
- "pagination.previous": "Previous",
2170
- "pagination.next": "Next",
2171
- "pagination.total": "Total:",
2172
- "pagination.show": "Show:",
2173
- "pagination.goTo": "Go to:",
2174
- "pagination.go": "Go",
2175
- "auth.signIn": "Sign in",
2176
- "auth.signOut": "Sign out",
2177
- "dialog.confirm": "Confirm",
2178
- "dialog.cancel": "Cancel",
2179
- "dialog.loading": "Loading...",
2180
- "dialog.delete.title": "Delete {{item}}?",
2181
- "dialog.delete.message": "This action cannot be undone.",
2182
- "trait.availableActions": "Available Actions",
2183
- "trait.transitions": "Transitions",
2184
- "trait.availableNow": "Available now",
2185
- "book.startReading": "Start Reading",
2186
- "book.tableOfContents": "Table of Contents",
2187
- "book.partNumber": "Part {{number}}",
2188
- "book.print": "Print",
2189
- "book.previousPage": "Previous page",
2190
- "book.nextPage": "Next page",
2191
- "quiz.showAnswer": "Show answer",
2192
- "quiz.hideAnswer": "Hide answer",
2193
- "aria.closeModal": "Close modal",
2194
- "aria.closeToast": "Dismiss toast",
2195
- "aria.closeAlert": "Dismiss alert",
2196
- "aria.removeFilter": "Remove filter",
2197
- "aria.closeDrawer": "Close drawer",
2198
- "aria.closePanel": "Close panel",
2199
- "aria.previousImage": "Previous image",
2200
- "aria.nextImage": "Next image",
2201
- "aria.dismiss": "Dismiss",
2202
- "aria.previousSlide": "Previous slide",
2203
- "aria.nextSlide": "Next slide",
2204
- "aria.previousDays": "Previous days",
2205
- "aria.nextDays": "Next days",
2206
- "aria.decrease": "Decrease",
2207
- "aria.increase": "Increase",
2208
- "aria.breadcrumb": "Breadcrumb",
2209
- "aria.tableOfContents": "Table of contents",
2210
- "aria.docsSidebar": "Documentation sidebar",
2211
- "aria.selectAllRows": "Select all rows",
2212
- "aria.selectAll": "Select all",
2213
- "aria.upvote": "Upvote",
2214
- "aria.downvote": "Downvote",
2215
- "aria.qrScanner": "QR scanner",
2216
- "aria.mockScanDev": "Mock scan (dev)",
2217
- "aria.openMenu": "Open menu",
2218
- "aria.closeMenu": "Close menu",
2219
- "aria.openSidebar": "Open sidebar",
2220
- "sidebar.expand": "Expand sidebar",
2221
- "sidebar.collapse": "Collapse sidebar",
2222
- "sidebar.close": "Close sidebar",
2223
- "loading.items": "Loading items...",
2224
- "card.imageAlt": "Image",
2225
- "canvas.emptyMessage": "No content",
2226
- "canvas.errorTitle": "Canvas error",
2227
- "book.noData": "No data",
2228
- "common.notifications": "Notifications",
2229
- "common.remaining": "{{count}} remaining",
2230
- "error.somethingWentWrong": "Something went wrong",
2231
- "error.loadingItems": "Loading items...",
2232
- "error.noItemsFound": "No items found",
2233
- "debug.noEntityData": "No entity data",
2234
- "debug.noEntities": "No entities",
2235
- "debug.noTicks": "No ticks registered",
2236
- "debug.noActiveTraits": "No active traits",
2237
- "debug.noGuardEvaluations": "No guard evaluations",
2238
- "debug.noBridgeData": "No bridge data",
2239
- "debug.status": "Status",
2240
- "debug.eventsForwarded": "Events Forwarded (Client \u2192 Server)",
2241
- "debug.eventsReceived": "Events Received (Server \u2192 Client)",
2242
- "debug.lastHeartbeat": "Last Heartbeat",
2243
- "debug.noEventsYet": "No events yet",
2244
- "debug.noTransitionsRecorded": "No transitions recorded",
2245
- "debug.noVerificationChecks": "No verification checks yet",
2246
- "display.chartError": "Chart error",
2247
- "display.codeViewerError": "Code viewer error",
2248
- "display.noCode": "No code",
2249
- "display.documentError": "Document error",
2250
- "display.noDocument": "No document",
2251
- "display.graphError": "Graph error",
2252
- "display.noGraphData": "No graph data",
2253
- "display.galleryError": "Gallery error",
2254
- "display.noMedia": "No media",
2255
- "display.meterError": "Meter error",
2256
- "display.signaturePadError": "Signature pad error",
2257
- "display.timelineError": "Timeline error",
2258
- "display.noEvents": "No events",
2259
- "template.features": "Features",
2260
- "template.howItWorks": "How It Works",
2261
- "template.showcase": "Showcase",
2262
- "template.faq": "Frequently Asked Questions",
2263
- "template.ourTeam": "Our Team",
2264
- "template.caseStudies": "Case Studies",
2265
- "richBlockEditor.toolbar.text": "Text",
2266
- "richBlockEditor.toolbar.h1": "H1",
2267
- "richBlockEditor.toolbar.h2": "H2",
2268
- "richBlockEditor.toolbar.h3": "H3",
2269
- "richBlockEditor.toolbar.bulletList": "Bullet list",
2270
- "richBlockEditor.toolbar.numbered": "Numbered",
2271
- "richBlockEditor.toolbar.quote": "Quote",
2272
- "richBlockEditor.toolbar.code": "Code",
2273
- "richBlockEditor.toolbar.divider": "Divider",
2274
- "richBlockEditor.toolbar.image": "Image",
2275
- "richBlockEditor.blockType.paragraph": "Text",
2276
- "richBlockEditor.blockType.heading1": "Heading 1",
2277
- "richBlockEditor.blockType.heading2": "Heading 2",
2278
- "richBlockEditor.blockType.heading3": "Heading 3",
2279
- "richBlockEditor.blockType.bulletList": "Bullet list",
2280
- "richBlockEditor.blockType.numberedList": "Numbered list",
2281
- "richBlockEditor.blockType.quote": "Quote",
2282
- "richBlockEditor.blockType.code": "Code",
2283
- "richBlockEditor.blockType.divider": "Divider",
2284
- "richBlockEditor.blockType.image": "Image",
2285
- "richBlockEditor.blockActions": "Block actions",
2286
- "richBlockEditor.duplicate": "Duplicate",
2287
- "richBlockEditor.turnInto": "Turn into",
2288
- "richBlockEditor.placeholder.heading1": "Heading 1",
2289
- "richBlockEditor.placeholder.heading2": "Heading 2",
2290
- "richBlockEditor.placeholder.heading3": "Heading 3",
2291
- "richBlockEditor.placeholder.quote": "Quote",
2292
- "richBlockEditor.placeholder.code": "Enter code",
2293
- "richBlockEditor.placeholder.paragraph": "Start writing...",
2294
- "richBlockEditor.placeholder.listItem": "List item",
2295
- "richBlockEditor.placeholder.caption": "Caption (optional)",
2296
- "richBlockEditor.aria.heading1Block": "Heading 1 block",
2297
- "richBlockEditor.aria.heading2Block": "Heading 2 block",
2298
- "richBlockEditor.aria.heading3Block": "Heading 3 block",
2299
- "richBlockEditor.aria.quoteBlock": "Quote block",
2300
- "richBlockEditor.aria.codeBlock": "Code block",
2301
- "richBlockEditor.aria.codeLanguage": "Code language",
2302
- "richBlockEditor.aria.imageUrl": "Image URL",
2303
- "richBlockEditor.aria.imageCaption": "Image caption",
2304
- "richBlockEditor.aria.listItem": "List item",
2305
- "richBlockEditor.aria.removeListItem": "Remove list item",
2306
- "richBlockEditor.aria.paragraphBlock": "Paragraph block",
2307
- "richBlockEditor.embeddedImage": "Embedded image",
2308
- "richBlockEditor.noImageUrl": "No image URL set",
2309
- "richBlockEditor.addItem": "Add item",
2310
- "richBlockEditor.insertParagraphBelow": "Insert paragraph below",
2311
- "richBlockEditor.editorToolbar": "Block editor toolbar",
2312
- "richBlockEditor.insertEntry": "Insert {{label}}",
2313
- "versionDiff.compare": "Compare",
2314
- "versionDiff.to": "to",
2315
- "versionDiff.beforeRevision": "Before revision",
2316
- "versionDiff.afterRevision": "After revision",
2317
- "versionDiff.switchToInline": "Switch to inline view",
2318
- "versionDiff.switchToSideBySide": "Switch to side-by-side view",
2319
- "versionDiff.revert": "Revert",
2320
- "versionDiff.byAuthor": " by {{author}}",
2321
- "violationAlert.actionType.measure": "Corrective Measure",
2322
- "violationAlert.actionType.admin": "Administrative Action",
2323
- "violationAlert.actionType.penalty": "Penalty Proceedings",
2324
- "violationAlert.fallbackMessage": "Violation",
2325
- "violationAlert.adminLabel": "Admin:",
2326
- "violationAlert.penaltyLabel": "Penalty:",
2327
- "violationAlert.goToField": "Go to field",
2328
- "branchingLogic.title": "Branching logic",
2329
- "branchingLogic.if": "If",
2330
- "branchingLogic.goTo": "go to",
2331
- "branchingLogic.rules": "Rules",
2332
- "branchingLogic.logicGraph": "Logic graph",
2333
- "branchingLogic.addRule": "Add rule",
2334
- "branchingLogic.deleteRule": "Delete rule",
2335
- "branchingLogic.endOfSurvey": "End of survey",
2336
- "branchingLogic.brokenReference": "Broken reference",
2337
- "branchingLogic.selectQuestion": "Select question",
2338
- "branchingLogic.selectTarget": "Select target",
2339
- "branchingLogic.selectValue": "Select value",
2340
- "branchingLogic.addValue": "Add value",
2341
- "branchingLogic.value": "Value",
2342
- "branchingLogic.typeValuePressEnter": "Type value, press Enter",
2343
- "branchingLogic.operatorEquals": "equals",
2344
- "branchingLogic.operatorNotEquals": "does not equal",
2345
- "branchingLogic.operatorContains": "contains",
2346
- "branchingLogic.operatorIn": "is one of",
2347
- "branchingLogic.graphAriaLabel": "Branching logic graph",
2348
- "branchingLogic.ruleCountOne": "{{count}} rule",
2349
- "branchingLogic.ruleCountOther": "{{count}} rules",
2350
- "branchingLogic.brokenCount": "{{count}} broken",
2351
- "branchingLogic.emptyNoQuestions": "Add questions before building branching rules.",
2352
- "branchingLogic.emptyNoRules": "No rules yet. Add a rule to define branching logic.",
2353
- "filterGroup.filters": "Filters",
2354
- "filterGroup.all": "All",
2355
- "filterGroup.clear": "Clear",
2356
- "filterGroup.clearAll": "Clear all",
2357
- "filterGroup.from": "From",
2358
- "filterGroup.to": "To",
2359
- "filterGroup.allOf": "All {{label}}",
2360
- "filterGroup.activeCount": "{{count}} active",
2361
- "debug.guardEvaluationsHint": "Guard evaluations will appear when transitions or ticks with guards execute",
2362
- "debug.expression": "Expression",
2363
- "debug.inputs": "Inputs",
2364
- "debug.trait": "Trait",
2365
- "debug.filterAll": "All",
2366
- "debug.filterPassed": "Passed",
2367
- "debug.filterFailed": "Failed",
2368
- "debug.traitsInitHint": "Traits will appear when the state machine initializes",
2369
- "debug.traitsMountHint": "Traits will appear when components using them are mounted",
2370
- "debug.activeStates": "Active States",
2371
- "debug.availableEvents": "Available Events",
2372
- "debug.noTransitionsFromState": "No transitions from current state",
2373
- "debug.guarded": "guarded",
2374
- "debug.otherEvents": "Other Events (not available from current state)",
2375
- "debug.recentTransitions": "Recent Transitions",
2376
- "debug.transitionsCount": "{{count}} transitions",
2377
- "debug.states": "States",
2378
- "debug.transitions": "Transitions",
2379
- "debug.guards": "Guards",
2380
- "debug.debugModeHint": "Debug mode may not be enabled",
2381
- "debug.entitiesSpawnHint": "Entities will appear when spawned",
2382
- "debug.singleton": "Singleton",
2383
- "debug.singletonsCount": "Singletons ({{count}})",
2384
- "debug.runtimeCount": "Runtime ({{count}})",
2385
- "debug.moreEntities": "+{{count}} more entities",
2386
- "debug.persistent": "Persistent",
2387
- "debug.loadedCount": "{{count}} loaded",
2388
- "debug.notLoaded": "not loaded",
2389
- "debug.eventsExecuteHint": "Events will appear as traits, ticks, and other systems execute",
2390
- "debug.allCount": "All ({{count}})",
2391
- "debug.autoScroll": "Auto-scroll",
2392
- "debug.transitionsProcessHint": "Transitions will appear as the state machine processes events",
2393
- "debug.transitionsRecorded": "{{count}} transitions recorded",
2394
- "debug.guardLabel": "guard:",
2395
- "debug.effectsCount": "{{count}} effects",
2396
- "debug.bridgeInitHint": "The ServerBridge has not been initialized. Bridge health will appear once the runtime connects to the server.",
2397
- "debug.never": "Never",
2398
- "debug.connected": "Connected",
2399
- "debug.disconnected": "Disconnected",
2400
- "debug.lastError": "Last Error",
2401
- "debug.totalEventsProcessed": "{{count}} total events processed",
2402
- "debug.server": "server",
2403
- "debug.clientEffectsCount": "{{count}} clientEffects",
2404
- "debug.emitLabel": "emit:",
2405
- "debug.rowsCount": "{{count}} rows",
2406
- "debug.serverResponse": "server response",
2407
- "debug.collapseVerificationTimeline": "Collapse verification timeline",
2408
- "debug.expandVerificationTimeline": "Expand verification timeline",
2409
- "debug.failCount": "{{count}} fail",
2410
- "debug.ok": "OK",
2411
- "debug.localCount": "{{count}} local",
2412
- "debug.serverCount": "{{count}} server",
2413
- "debug.waitingForTransitions": "Waiting for transitions...",
2414
- "debug.tabDispatch": "Dispatch",
2415
- "debug.tabVerify": "Verify",
2416
- "debug.tabVerifyAlert": "Verify (!)",
2417
- "debug.tabTimeline": "Timeline",
2418
- "debug.tabBridge": "Bridge",
2419
- "debug.tabTraits": "Traits",
2420
- "debug.tabTicks": "Ticks",
2421
- "debug.tabEntities": "Entities",
2422
- "debug.tabEvents": "Events",
2423
- "debug.tabGuards": "Guards",
2424
- "debug.debugger": "Debugger",
2425
- "debug.failedCount": "{{count}} failed",
2426
- "debug.traitsCount": "{{count}} traits",
2427
- "debug.idle": "Idle",
2428
- "debug.openDebugger": "Open Debugger (`)",
2429
- "debug.kflowVerifier": "KFlow Verifier",
2430
- "debug.allPassing": "All passing",
2431
- "debug.runtime": "Runtime",
2432
- "debug.close": "Close (`)",
2433
- "debug.toggleHint": "Press ` to toggle | window.__orbitalVerification for automation",
2434
- "replyTree.expandReplies": "Expand replies",
2435
- "replyTree.collapseReplies": "Collapse replies",
2436
- "replyTree.voteOnReplyBy": "Vote on reply by {{author}}",
2437
- "replyTree.replyTo": "Reply to {{author}}",
2438
- "replyTree.replyToPlaceholder": "Reply to {{author}}\u2026",
2439
- "replyTree.reply": "Reply",
2440
- "replyTree.flagReplyBy": "Flag reply by {{author}}",
2441
- "replyTree.flag": "Flag",
2442
- "replyTree.send": "Send",
2443
- "replyTree.continueThread": "Continue thread",
2444
- "replyTree.noRepliesYet": "No replies yet.",
2445
- "signaturePad.label": "Signature",
2446
- "signaturePad.helperText": "Draw your signature above",
2447
- "signaturePad.clear": "Clear",
2448
- "signaturePad.confirm": "Confirm",
2449
- "qrScanner.cameraUnavailable": "Camera unavailable",
2450
- "qrScanner.paused": "Paused",
2451
- "qrScanner.resumeScanning": "Resume scanning",
2452
- "qrScanner.pauseScanning": "Pause scanning",
2453
- "qrScanner.switchToFrontCamera": "Switch to front camera",
2454
- "qrScanner.switchToRearCamera": "Switch to rear camera",
2455
- "qrScanner.mockScan": "Mock Scan",
2456
- "docSearch.placeholder": "Search documentation...",
2457
- "stateMachine.loading": "Loading state machine\u2026",
2458
- "stateMachine.noStateMachine": "No state machine to visualize",
2459
- "avl.trigger": "Trigger",
2460
- "avl.guard": "Guard",
2461
- "avl.effects": "Effects",
2462
- "avl.props": "Props",
2463
- "avl.entity": "Entity",
2464
- "avl.traits": "Traits",
2465
- "avl.transition": "Transition",
2466
- "avl.onEntity": "on {{entity}}",
2467
- "avl.linkedTo": "linked to {{entity}}",
2468
- "avl.pressEscToZoomOut": "Press Esc to zoom out",
2469
- "avl.zoomIn": "Zoom in",
2470
- "avl.zoomOut": "Zoom out",
2471
- "avl.orbitalLabel": "Orbital: {{name}}",
2472
- "avl.orbitalLabelHighlighted": "Orbital: {{name}} (highlighted)",
2473
- "avl.noTraitData": "No trait data",
2474
- "avl.computingLayout": "Computing layout...",
2475
- "avl.noStateMachine": "No state machine",
2476
- "avl.listensFor": "listens for {{event}}",
2477
- "avl.emits": "emits {{event}}",
2478
- "avl.pageLayout": "Page Layout",
2479
- "avl.overlaySuffix": "(overlay)",
2480
- "orbPreview.previewBadge": "Preview",
2481
- "orbPreview.doubleClickToOpen": "Double-click to open",
2482
- "orbPreview.dropToAddAndOpen": "Drop to add and open",
2483
- "orbPreview.dispatching": "Coordinator is dispatching to this orbital",
2484
- "orbPreview.noPreview": "No preview available",
2485
- "orbPreview.screensCount": "{{count}} screens",
2486
- "detailView.noTransitionData": "No transition data",
2487
- "orbInspector.required": "req",
2488
- "orbInspector.addField": "Add Field",
2489
- "orbInspector.serviceMode": "Service Mode",
2490
- "orbInspector.standalone": "Standalone",
2491
- "orbInspector.embedded": "Embedded",
2492
- "orbInspector.rendersOwnUi": "Renders its own UI",
2493
- "orbInspector.headless": "Headless, wired to other behaviors",
2494
- "orbInspector.addEffect": "Add Effect",
2495
- "orbInspector.guardExpression": "Guard expression",
2496
- "orbInspector.selectPatternForStyles": "Select a pattern to view its style tokens.",
2497
- "orbInspector.tokens": "Tokens",
2498
- "orbInspector.noTokenContract": "No token contract declared for this pattern.",
2499
- "orbInspector.variant": "Variant",
2500
- "orbInspector.size": "Size",
2501
- "orbInspector.statesCount": "{{count}} states",
2502
- "orbInspector.onEntity": " on {{entity}}",
2503
- "orbInspector.projectThemeTokens": "Project theme tokens",
2504
- "orbInspector.tokenGroup.colors": "Colors",
2505
- "orbInspector.tokenGroup.radii": "Radii",
2506
- "orbInspector.tokenGroup.spacing": "Spacing",
2507
- "orbInspector.tokenGroup.shadows": "Shadows",
2508
- "orbInspector.tab.inspector": "Inspector",
2509
- "orbInspector.tab.styles": "Styles",
2510
- "orbInspector.tab.code": "Code",
2511
- "canvas.goBackToOverview": "Go back to overview",
2512
- "canvas.overview": "Overview",
2513
- "canvas.expanded": "Expanded",
2514
- "canvas.modulesCount": "{{count}} modules",
2515
- "canvas.screensCount": "{{count}} screens",
2516
- "canvas.switchToView": "Switch to {{label}} view",
2517
- "lawReference.viewFullText": "View full law text",
2518
- "statCard.defaultLabel": "Stat",
2519
- "statCard.vsLastPeriod": "vs last period",
2520
- "mediaGallery.upload": "Upload",
2521
- "mediaGallery.noMediaDescription": "No media items to display.",
2522
- "pagination.jumpPlaceholder": "Page",
2523
- "table.selectRow": "Select row {{id}}",
2524
- "card.selectItem": "Select {{item}}",
2525
- "card.itemFallback": "item",
2526
- "fileTree.noFiles": "No files",
2527
- "masterDetail.selectItem": "Select an item to view details",
2528
- "empty.createFirst": "Create your first item to get started.",
2529
- "upload.dropOrBrowse": "Drop files here or click to browse",
2530
- "upload.dropFilesHere": "Drop files here",
2531
- "upload.accepted": "Accepted: {{accept}}",
2532
- "upload.maxSize": "Max size: {{size}}",
2533
- "upload.maxFiles": "Up to {{count}} files",
2534
- "upload.error.maxFiles": "Maximum {{count}} files allowed",
2535
- "upload.error.invalidType": "Invalid file type: {{name}}",
2536
- "upload.error.tooLarge": "File too large: {{name}} (max {{size}})",
2537
- "optionConstraint.requiredOne": "Required, pick 1",
2538
- "optionConstraint.optionalOne": "Optional, pick up to 1",
2539
- "optionConstraint.pickExactly": "Pick exactly {{count}}",
2540
- "optionConstraint.pickRange": "Pick {{min}}-{{max}}",
2541
- "optionConstraint.pickAtLeast": "Pick at least {{count}}",
2542
- "optionConstraint.pickUpTo": "Pick up to {{count}}",
2543
- "optionConstraint.optional": "Optional",
2544
- "optionConstraint.outOfStock": "Out of stock",
2545
- "optionConstraint.error.pickOne": "Pick 1 option",
2546
- "optionConstraint.error.pickOnlyOne": "Pick only 1 option",
2547
- "optionConstraint.error.pickMore": "Pick at least {{count}} more",
2548
- "optionConstraint.error.removeOptions": "Remove {{count}} options",
2549
- "stateMachine.pinned": "Pinned",
2550
- "stateMachine.eventCount": "{{count}} events",
2551
- "stateMachine.externalEffects": "External Effects",
2552
- "stateMachine.legend.initial": "Initial",
2553
- "stateMachine.legend.final": "Final",
2554
- "stateMachine.legend.state": "State",
2555
- "stateMachine.legend.multiEvent": "Multi-event"
2556
- };
2557
- }
2558
- });
2559
- function useTranslate() {
2560
- return React79.useContext(I18nContext);
2561
- }
2562
- function createTranslate(messages) {
2563
- return (key, params) => {
2564
- let msg = messages[key] ?? coreLocale[key] ?? key;
2565
- if (params) {
2566
- for (const [k, v] of Object.entries(params)) {
2567
- msg = msg.split(`{{${k}}}`).join(String(v));
2568
- }
2569
- }
2570
- return msg;
2571
- };
2572
- }
2573
- var _meta, coreMessages, coreLocale, I18nContext; exports.I18nProvider = void 0;
2574
- var init_useTranslate = __esm({
2575
- "hooks/useTranslate.ts"() {
2576
- "use client";
2577
- init_en();
2578
- ({ $meta: _meta, ...coreMessages } = en_default);
2579
- coreLocale = coreMessages;
2580
- I18nContext = React79.createContext({
2581
- locale: "en",
2582
- direction: "ltr",
2583
- t: (key) => coreLocale[key] ?? key
2584
- // core locale fallback
2585
- });
2586
- I18nContext.displayName = "I18nContext";
2587
- exports.I18nProvider = I18nContext.Provider;
2588
- }
2589
- });
2590
2082
  exports.Input = void 0;
2591
2083
  var init_Input = __esm({
2592
2084
  "components/core/atoms/Input.tsx"() {
2593
2085
  init_cn();
2594
2086
  init_Icon();
2595
- init_useTranslate();
2596
2087
  exports.Input = React79__namespace.default.forwardRef(
2597
2088
  ({
2598
2089
  className,
@@ -2610,7 +2101,7 @@ var init_Input = __esm({
2610
2101
  onChange,
2611
2102
  ...props
2612
2103
  }, ref) => {
2613
- const { t } = useTranslate();
2104
+ const { t } = hooks.useTranslate();
2614
2105
  const type = inputType || htmlType || "text";
2615
2106
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
2616
2107
  const resolvedLeftIcon = leftIcon || IconComponent && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "h-icon-default w-icon-default" });
@@ -3067,7 +2558,6 @@ var init_FilterPill = __esm({
3067
2558
  "components/core/atoms/FilterPill.tsx"() {
3068
2559
  init_cn();
3069
2560
  init_useEventBus();
3070
- init_useTranslate();
3071
2561
  init_Icon();
3072
2562
  variantStyles4 = {
3073
2563
  default: [
@@ -3123,7 +2613,7 @@ var init_FilterPill = __esm({
3123
2613
  ...props
3124
2614
  }, ref) => {
3125
2615
  const eventBus = useEventBus();
3126
- const { t } = useTranslate();
2616
+ const { t } = hooks.useTranslate();
3127
2617
  const payloadLabel = typeof children === "string" || typeof children === "number" ? children : label;
3128
2618
  const handleClick = React79.useCallback(() => {
3129
2619
  onClick?.();
@@ -5014,7 +4504,6 @@ var init_LawReferenceTooltip = __esm({
5014
4504
  init_Typography();
5015
4505
  init_Divider();
5016
4506
  init_cn();
5017
- init_useTranslate();
5018
4507
  positionStyles2 = {
5019
4508
  top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
5020
4509
  bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
@@ -5033,7 +4522,7 @@ var init_LawReferenceTooltip = __esm({
5033
4522
  position = "top",
5034
4523
  className
5035
4524
  }) => {
5036
- const { t } = useTranslate();
4525
+ const { t } = hooks.useTranslate();
5037
4526
  const [isVisible, setIsVisible] = React79__namespace.default.useState(false);
5038
4527
  const timeoutRef = React79__namespace.default.useRef(null);
5039
4528
  const handleMouseEnter = () => {
@@ -6797,7 +6286,6 @@ var init_Modal = __esm({
6797
6286
  init_Overlay();
6798
6287
  init_cn();
6799
6288
  init_useEventBus();
6800
- init_useTranslate();
6801
6289
  sizeClasses6 = {
6802
6290
  sm: "max-w-md",
6803
6291
  md: "max-w-2xl",
@@ -6835,7 +6323,7 @@ var init_Modal = __esm({
6835
6323
  look = "centered-card"
6836
6324
  }) => {
6837
6325
  const eventBus = useEventBus();
6838
- const { t } = useTranslate();
6326
+ const { t } = hooks.useTranslate();
6839
6327
  const modalRef = React79.useRef(null);
6840
6328
  const previousActiveElement = React79.useRef(null);
6841
6329
  const [dragY, setDragY] = React79.useState(0);
@@ -7019,7 +6507,6 @@ var init_Drawer = __esm({
7019
6507
  init_Overlay();
7020
6508
  init_cn();
7021
6509
  init_useEventBus();
7022
- init_useTranslate();
7023
6510
  sizeWidths = {
7024
6511
  sm: "w-full sm:w-80",
7025
6512
  // 320px
@@ -7045,7 +6532,7 @@ var init_Drawer = __esm({
7045
6532
  closeEvent
7046
6533
  }) => {
7047
6534
  const eventBus = useEventBus();
7048
- const { t } = useTranslate();
6535
+ const { t } = hooks.useTranslate();
7049
6536
  const drawerRef = React79.useRef(null);
7050
6537
  const previousActiveElement = React79.useRef(null);
7051
6538
  React79.useEffect(() => {
@@ -7201,7 +6688,6 @@ var init_Toast = __esm({
7201
6688
  init_Badge();
7202
6689
  init_cn();
7203
6690
  init_useEventBus();
7204
- init_useTranslate();
7205
6691
  variantClasses = {
7206
6692
  success: "bg-card border-[length:var(--border-width)] border-success",
7207
6693
  error: "bg-card border-[length:var(--border-width)] border-error",
@@ -7235,7 +6721,7 @@ var init_Toast = __esm({
7235
6721
  actionEvent
7236
6722
  }) => {
7237
6723
  const eventBus = useEventBus();
7238
- const { t } = useTranslate();
6724
+ const { t } = hooks.useTranslate();
7239
6725
  const handleDismiss = () => {
7240
6726
  if (dismissEvent) eventBus.emit(`UI:${dismissEvent}`, {});
7241
6727
  onDismiss?.();
@@ -7328,7 +6814,6 @@ var init_ErrorState = __esm({
7328
6814
  init_Typography();
7329
6815
  init_Icon();
7330
6816
  init_useEventBus();
7331
- init_useTranslate();
7332
6817
  exports.ErrorState = ({
7333
6818
  title,
7334
6819
  message,
@@ -7338,7 +6823,7 @@ var init_ErrorState = __esm({
7338
6823
  retryEvent
7339
6824
  }) => {
7340
6825
  const eventBus = useEventBus();
7341
- const { t } = useTranslate();
6826
+ const { t } = hooks.useTranslate();
7342
6827
  const handleRetry = () => {
7343
6828
  if (retryEvent) eventBus.emit(`UI:${retryEvent}`, {});
7344
6829
  onRetry?.();
@@ -7371,9 +6856,8 @@ var init_ErrorBoundary = __esm({
7371
6856
  "use client";
7372
6857
  init_cn();
7373
6858
  init_ErrorState();
7374
- init_useTranslate();
7375
6859
  DefaultFallback = ({ error, onRetry }) => {
7376
- const { t } = useTranslate();
6860
+ const { t } = hooks.useTranslate();
7377
6861
  return /* @__PURE__ */ jsxRuntime.jsx(
7378
6862
  exports.ErrorState,
7379
6863
  {
@@ -7500,7 +6984,7 @@ function Skeleton({
7500
6984
  fields,
7501
6985
  className
7502
6986
  }) {
7503
- const { t: _t } = useTranslate();
6987
+ const { t: _t } = hooks.useTranslate();
7504
6988
  switch (variant) {
7505
6989
  case "header":
7506
6990
  return /* @__PURE__ */ jsxRuntime.jsx(HeaderSkeleton, { className });
@@ -7521,7 +7005,6 @@ var init_Skeleton = __esm({
7521
7005
  "components/core/molecules/Skeleton.tsx"() {
7522
7006
  "use client";
7523
7007
  init_cn();
7524
- init_useTranslate();
7525
7008
  init_Box();
7526
7009
  init_Stack();
7527
7010
  init_Stack();
@@ -8171,7 +7654,6 @@ exports.AboutPageTemplate = void 0;
8171
7654
  var init_AboutPageTemplate = __esm({
8172
7655
  "components/marketing/templates/AboutPageTemplate.tsx"() {
8173
7656
  init_cn();
8174
- init_useTranslate();
8175
7657
  init_Stack();
8176
7658
  init_Box();
8177
7659
  init_Typography();
@@ -8187,7 +7669,7 @@ var init_AboutPageTemplate = __esm({
8187
7669
  entity,
8188
7670
  className
8189
7671
  }) => {
8190
- const { t } = useTranslate();
7672
+ const { t } = hooks.useTranslate();
8191
7673
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
8192
7674
  if (!resolved) return null;
8193
7675
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: cn("w-full", className), children: [
@@ -8276,7 +7758,6 @@ var init_Alert = __esm({
8276
7758
  init_Icon();
8277
7759
  init_Typography();
8278
7760
  init_useEventBus();
8279
- init_useTranslate();
8280
7761
  variantBorderClasses = {
8281
7762
  info: "border-info",
8282
7763
  success: "border-success",
@@ -8308,7 +7789,7 @@ var init_Alert = __esm({
8308
7789
  dismissEvent
8309
7790
  }) => {
8310
7791
  const eventBus = useEventBus();
8311
- const { t } = useTranslate();
7792
+ const { t } = hooks.useTranslate();
8312
7793
  const handleDismissCallback = onDismiss || onClose;
8313
7794
  const handleDismiss = () => {
8314
7795
  if (dismissEvent) eventBus.emit(`UI:${dismissEvent}`, {});
@@ -8636,7 +8117,6 @@ var init_Menu = __esm({
8636
8117
  init_Badge();
8637
8118
  init_cn();
8638
8119
  init_useEventBus();
8639
- init_useTranslate();
8640
8120
  exports.Menu = ({
8641
8121
  trigger,
8642
8122
  items,
@@ -8644,7 +8124,7 @@ var init_Menu = __esm({
8644
8124
  className
8645
8125
  }) => {
8646
8126
  const eventBus = useEventBus();
8647
- const { t } = useTranslate();
8127
+ const { t } = hooks.useTranslate();
8648
8128
  const [isOpen, setIsOpen] = React79.useState(false);
8649
8129
  const [activeSubMenu, setActiveSubMenu] = React79.useState(null);
8650
8130
  const [triggerRect, setTriggerRect] = React79.useState(null);
@@ -8924,7 +8404,6 @@ var init_FloatingActionButton = __esm({
8924
8404
  init_Typography();
8925
8405
  init_cn();
8926
8406
  init_useEventBus();
8927
- init_useTranslate();
8928
8407
  exports.FloatingActionButton = ({
8929
8408
  action,
8930
8409
  actionPayload,
@@ -8937,7 +8416,7 @@ var init_FloatingActionButton = __esm({
8937
8416
  className
8938
8417
  }) => {
8939
8418
  const eventBus = useEventBus();
8940
- const { t } = useTranslate();
8419
+ const { t } = hooks.useTranslate();
8941
8420
  const resolvedAction = icon ? {
8942
8421
  icon,
8943
8422
  onClick: () => {
@@ -9106,13 +8585,13 @@ var init_MapView = __esm({
9106
8585
  shadowSize: [41, 41]
9107
8586
  });
9108
8587
  L.Marker.prototype.options.icon = defaultIcon;
9109
- const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback128, useState: useState112 } = React79__namespace.default;
8588
+ const { useEffect: useEffect69, useRef: useRef66, useCallback: useCallback113, useState: useState99 } = React79__namespace.default;
9110
8589
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9111
8590
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9112
8591
  function MapUpdater({ centerLat, centerLng, zoom }) {
9113
8592
  const map = useMap();
9114
- const prevRef = useRef68({ centerLat, centerLng, zoom });
9115
- useEffect74(() => {
8593
+ const prevRef = useRef66({ centerLat, centerLng, zoom });
8594
+ useEffect69(() => {
9116
8595
  const prev = prevRef.current;
9117
8596
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
9118
8597
  map.setView([centerLat, centerLng], zoom);
@@ -9123,7 +8602,7 @@ var init_MapView = __esm({
9123
8602
  }
9124
8603
  function MapClickHandler({ onMapClick }) {
9125
8604
  const map = useMap();
9126
- useEffect74(() => {
8605
+ useEffect69(() => {
9127
8606
  if (!onMapClick) return;
9128
8607
  const handler = (e) => {
9129
8608
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -9151,8 +8630,8 @@ var init_MapView = __esm({
9151
8630
  showAttribution = true
9152
8631
  }) {
9153
8632
  const eventBus = useEventBus2();
9154
- const [clickedPosition, setClickedPosition] = useState112(null);
9155
- const handleMapClick = useCallback128((lat, lng) => {
8633
+ const [clickedPosition, setClickedPosition] = useState99(null);
8634
+ const handleMapClick = useCallback113((lat, lng) => {
9156
8635
  if (showClickedPin) {
9157
8636
  setClickedPosition({ lat, lng });
9158
8637
  }
@@ -9161,7 +8640,7 @@ var init_MapView = __esm({
9161
8640
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9162
8641
  }
9163
8642
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9164
- const handleMarkerClick = useCallback128((marker) => {
8643
+ const handleMarkerClick = useCallback113((marker) => {
9165
8644
  onMarkerClick?.(marker);
9166
8645
  if (markerClickEvent) {
9167
8646
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -9988,7 +9467,7 @@ function ActionTile({
9988
9467
  categoryColors,
9989
9468
  className
9990
9469
  }) {
9991
- useTranslate();
9470
+ hooks.useTranslate();
9992
9471
  const config = SIZE_CONFIG[size];
9993
9472
  const catColor = categoryColors?.[action.category];
9994
9473
  const handleDragStart = React79.useCallback((e) => {
@@ -10027,7 +9506,6 @@ var init_ActionTile = __esm({
10027
9506
  "components/game/organisms/puzzles/sequencer/ActionTile.tsx"() {
10028
9507
  init_atoms2();
10029
9508
  init_cn();
10030
- init_useTranslate();
10031
9509
  DRAG_MIME = "application/x-almadar-slot-item";
10032
9510
  SIZE_CONFIG = {
10033
9511
  sm: { px: "px-2 py-1", icon: "text-lg", text: "text-xs" },
@@ -10046,7 +9524,7 @@ function ActionPalette({
10046
9524
  label,
10047
9525
  className
10048
9526
  }) {
10049
- const { t } = useTranslate();
9527
+ const { t } = hooks.useTranslate();
10050
9528
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
10051
9529
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: label ?? t("sequencer.actions") }),
10052
9530
  /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { className: "flex-wrap", gap: "sm", children: (actions ?? []).map((action) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -10065,7 +9543,6 @@ var init_ActionPalette = __esm({
10065
9543
  "components/game/organisms/puzzles/sequencer/ActionPalette.tsx"() {
10066
9544
  init_atoms2();
10067
9545
  init_cn();
10068
- init_useTranslate();
10069
9546
  init_ActionTile();
10070
9547
  ActionPalette.displayName = "ActionPalette";
10071
9548
  }
@@ -10075,7 +9552,6 @@ var init_AuthLayout = __esm({
10075
9552
  "components/core/templates/AuthLayout.tsx"() {
10076
9553
  "use client";
10077
9554
  init_cn();
10078
- init_useTranslate();
10079
9555
  init_Box();
10080
9556
  init_Stack();
10081
9557
  init_Typography();
@@ -10086,7 +9562,7 @@ var init_AuthLayout = __esm({
10086
9562
  showBranding = true,
10087
9563
  brandingContent
10088
9564
  }) => {
10089
- const { t } = useTranslate();
9565
+ const { t } = hooks.useTranslate();
10090
9566
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { className: "min-h-screen flex", children: [
10091
9567
  showBranding && /* @__PURE__ */ jsxRuntime.jsxs(
10092
9568
  exports.VStack,
@@ -10220,13 +9696,12 @@ var init_LoadingState = __esm({
10220
9696
  init_atoms2();
10221
9697
  init_Stack();
10222
9698
  init_Typography();
10223
- init_useTranslate();
10224
9699
  exports.LoadingState = ({
10225
9700
  title,
10226
9701
  message,
10227
9702
  className
10228
9703
  }) => {
10229
- const { t } = useTranslate();
9704
+ const { t } = hooks.useTranslate();
10230
9705
  const displayMessage = message ?? t("common.loading");
10231
9706
  return /* @__PURE__ */ jsxRuntime.jsxs(
10232
9707
  exports.VStack,
@@ -10606,7 +10081,7 @@ function IsometricCanvas({
10606
10081
  const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
10607
10082
  const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
10608
10083
  const eventBus = useEventBus();
10609
- const { t } = useTranslate();
10084
+ const { t } = hooks.useTranslate();
10610
10085
  const canvasRef = React79.useRef(null);
10611
10086
  const containerRef = React79.useRef(null);
10612
10087
  const minimapRef = React79.useRef(null);
@@ -11303,7 +10778,6 @@ var init_IsometricCanvas = __esm({
11303
10778
  "use client";
11304
10779
  init_cn();
11305
10780
  init_useEventBus();
11306
- init_useTranslate();
11307
10781
  init_Box();
11308
10782
  init_Stack();
11309
10783
  init_Icon();
@@ -11363,7 +10837,7 @@ function BattleBoard({
11363
10837
  const currentTurn = entity.turn;
11364
10838
  const gameResult = entity.gameResult;
11365
10839
  const eventBus = useEventBus();
11366
- const { t } = useTranslate();
10840
+ const { t } = hooks.useTranslate();
11367
10841
  const [hoveredTile, setHoveredTile] = React79.useState(null);
11368
10842
  const [isShaking, setIsShaking] = React79.useState(false);
11369
10843
  const selectedUnit = React79.useMemo(
@@ -11667,7 +11141,6 @@ var init_BattleBoard = __esm({
11667
11141
  "use client";
11668
11142
  init_cn();
11669
11143
  init_useEventBus();
11670
- init_useTranslate();
11671
11144
  init_Box();
11672
11145
  init_Button();
11673
11146
  init_Typography();
@@ -12427,7 +11900,6 @@ var log4, SWIM_GUTTER, CENTER_W; exports.BehaviorView = void 0;
12427
11900
  var init_BehaviorView = __esm({
12428
11901
  "components/avl/molecules/BehaviorView.tsx"() {
12429
11902
  "use client";
12430
- init_useTranslate();
12431
11903
  init_AvlState();
12432
11904
  init_AvlTransitionLane();
12433
11905
  init_AvlSwimLane();
@@ -12437,7 +11909,7 @@ var init_BehaviorView = __esm({
12437
11909
  SWIM_GUTTER = 120;
12438
11910
  CENTER_W = 360;
12439
11911
  exports.BehaviorView = ({ data }) => {
12440
- const { t } = useTranslate();
11912
+ const { t } = hooks.useTranslate();
12441
11913
  const [layout, setLayout] = React79.useState(null);
12442
11914
  const traitName = data.traits[0]?.name;
12443
11915
  const traitData = traitName ? data.traitDetails[traitName] : void 0;
@@ -12542,14 +12014,13 @@ var MIN_DIAGRAM_WIDTH; exports.ScaledDiagram = void 0;
12542
12014
  var init_ScaledDiagram = __esm({
12543
12015
  "components/core/molecules/ScaledDiagram.tsx"() {
12544
12016
  init_Box();
12545
- init_useTranslate();
12546
12017
  init_cn();
12547
12018
  MIN_DIAGRAM_WIDTH = 200;
12548
12019
  exports.ScaledDiagram = ({
12549
12020
  children,
12550
12021
  className
12551
12022
  }) => {
12552
- const { t: _t } = useTranslate();
12023
+ const { t: _t } = hooks.useTranslate();
12553
12024
  const wrapperRef = React79.useRef(null);
12554
12025
  const contentRef = React79.useRef(null);
12555
12026
  const [layout, setLayout] = React79.useState(null);
@@ -12685,7 +12156,6 @@ var init_CodeBlock = __esm({
12685
12156
  init_Textarea();
12686
12157
  init_Icon();
12687
12158
  init_useEventBus();
12688
- init_useTranslate();
12689
12159
  SyntaxHighlighter__default.default.registerLanguage("json", langJson__default.default);
12690
12160
  SyntaxHighlighter__default.default.registerLanguage("javascript", langJavascript__default.default);
12691
12161
  SyntaxHighlighter__default.default.registerLanguage("js", langJavascript__default.default);
@@ -12774,7 +12244,7 @@ var init_CodeBlock = __esm({
12774
12244
  const isLolo = language === "lolo";
12775
12245
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
12776
12246
  const eventBus = useEventBus();
12777
- const { t } = useTranslate();
12247
+ const { t } = hooks.useTranslate();
12778
12248
  const scrollRef = React79.useRef(null);
12779
12249
  const codeRef = React79.useRef(null);
12780
12250
  const savedScrollLeftRef = React79.useRef(0);
@@ -13192,11 +12662,10 @@ var init_MarkdownContent = __esm({
13192
12662
  init_katex_min();
13193
12663
  init_Box();
13194
12664
  init_CodeBlock();
13195
- init_useTranslate();
13196
12665
  init_cn();
13197
12666
  exports.MarkdownContent = React79__namespace.default.memo(
13198
12667
  ({ content, direction, className }) => {
13199
- const { t: _t } = useTranslate();
12668
+ const { t: _t } = hooks.useTranslate();
13200
12669
  const safeContent = typeof content === "string" ? content : String(content ?? "");
13201
12670
  return /* @__PURE__ */ jsxRuntime.jsx(
13202
12671
  exports.Box,
@@ -13422,7 +12891,7 @@ function Card2({
13422
12891
  longPressPayload
13423
12892
  }) {
13424
12893
  const eventBus = useEventBus();
13425
- const { t } = useTranslate();
12894
+ const { t } = hooks.useTranslate();
13426
12895
  const isClickable = !!onClick || !!action;
13427
12896
  const handleLongPress = React79.useCallback(() => {
13428
12897
  if (longPressEvent) {
@@ -13497,7 +12966,6 @@ var init_Card2 = __esm({
13497
12966
  "components/core/molecules/Card.tsx"() {
13498
12967
  "use client";
13499
12968
  init_useEventBus();
13500
- init_useTranslate();
13501
12969
  init_useLongPress();
13502
12970
  Card2.displayName = "Card";
13503
12971
  }
@@ -13511,14 +12979,13 @@ var init_QuizBlock = __esm({
13511
12979
  init_Button();
13512
12980
  init_Icon();
13513
12981
  init_Box();
13514
- init_useTranslate();
13515
12982
  init_cn();
13516
12983
  exports.QuizBlock = ({
13517
12984
  question,
13518
12985
  answer,
13519
12986
  className
13520
12987
  }) => {
13521
- const { t } = useTranslate();
12988
+ const { t } = hooks.useTranslate();
13522
12989
  const [revealed, setRevealed] = React79.useState(false);
13523
12990
  return /* @__PURE__ */ jsxRuntime.jsx(Card2, { className: cn("my-4 border-blue-200 dark:border-blue-800", className), children: /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "sm", className: "p-4", children: [
13524
12991
  /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "sm", align: "start", children: [
@@ -13554,11 +13021,10 @@ var init_StateMachineView = __esm({
13554
13021
  init_Typography();
13555
13022
  init_Button();
13556
13023
  init_Icon();
13557
- init_useTranslate();
13558
13024
  init_useEventBus();
13559
13025
  init_cn();
13560
13026
  StateNode = ({ state, config }) => {
13561
- const { t } = useTranslate();
13027
+ const { t } = hooks.useTranslate();
13562
13028
  const size = state.radius * 2;
13563
13029
  let borderColor = config.colors.nodeBorder;
13564
13030
  let borderWidth = 2;
@@ -13665,7 +13131,7 @@ var init_StateMachineView = __esm({
13665
13131
  );
13666
13132
  };
13667
13133
  TransitionBundleArrow = ({ bundle, states, bundleIndex, config, onClick, onHover }) => {
13668
- const { t } = useTranslate();
13134
+ const { t } = hooks.useTranslate();
13669
13135
  const groupRef = React79.useRef(null);
13670
13136
  const fromState = states.find((s) => s.name === bundle.from);
13671
13137
  const toState = states.find((s) => s.name === bundle.to);
@@ -13915,7 +13381,7 @@ var init_StateMachineView = __esm({
13915
13381
  );
13916
13382
  };
13917
13383
  BundleTooltip = ({ tooltip, config }) => {
13918
- const { t } = useTranslate();
13384
+ const { t } = hooks.useTranslate();
13919
13385
  if (!tooltip.visible || !tooltip.bundle) return null;
13920
13386
  const { bundle } = tooltip;
13921
13387
  const isSingle = bundle.labels.length === 1;
@@ -14067,7 +13533,7 @@ var init_StateMachineView = __esm({
14067
13533
  );
14068
13534
  };
14069
13535
  EntityBox = ({ entity, config }) => {
14070
- const { t } = useTranslate();
13536
+ const { t } = hooks.useTranslate();
14071
13537
  return /* @__PURE__ */ jsxRuntime.jsxs(
14072
13538
  exports.VStack,
14073
13539
  {
@@ -14108,7 +13574,7 @@ var init_StateMachineView = __esm({
14108
13574
  );
14109
13575
  };
14110
13576
  OutputsBox = ({ outputs, config }) => {
14111
- const { t } = useTranslate();
13577
+ const { t } = hooks.useTranslate();
14112
13578
  return /* @__PURE__ */ jsxRuntime.jsxs(
14113
13579
  exports.VStack,
14114
13580
  {
@@ -14150,7 +13616,7 @@ var init_StateMachineView = __esm({
14150
13616
  );
14151
13617
  };
14152
13618
  Legend = ({ config, y }) => {
14153
- const { t } = useTranslate();
13619
+ const { t } = hooks.useTranslate();
14154
13620
  const items = [
14155
13621
  { key: "initial", label: t("stateMachine.legend.initial"), color: config.colors.initialNode, isMultiEvent: false },
14156
13622
  { key: "final", label: t("stateMachine.legend.final"), color: config.colors.finalNode, isMultiEvent: false },
@@ -14194,7 +13660,7 @@ var init_StateMachineView = __esm({
14194
13660
  isLoading: _isLoading,
14195
13661
  error: _error
14196
13662
  }) => {
14197
- const { t } = useTranslate();
13663
+ const { t } = hooks.useTranslate();
14198
13664
  const [tooltip, setTooltip] = React79.useState({
14199
13665
  visible: false,
14200
13666
  pinned: false,
@@ -14921,7 +14387,6 @@ var init_JazariStateMachine = __esm({
14921
14387
  init_StateMachineView();
14922
14388
  init_visualizer();
14923
14389
  init_svg_paths();
14924
- init_useTranslate();
14925
14390
  init_cn();
14926
14391
  JAZARI_VISUALIZER_CONFIG = {
14927
14392
  ...DEFAULT_CONFIG,
@@ -14957,7 +14422,7 @@ var init_JazariStateMachine = __esm({
14957
14422
  isLoading = false,
14958
14423
  error = null
14959
14424
  }) => {
14960
- const { t } = useTranslate();
14425
+ const { t } = hooks.useTranslate();
14961
14426
  const resolvedTrait = React79.useMemo(
14962
14427
  () => extractTrait(schema, traitProp, traitIndex),
14963
14428
  [schema, traitProp, traitIndex]
@@ -15077,7 +14542,6 @@ var init_ContentRenderer = __esm({
15077
14542
  init_ScaledDiagram();
15078
14543
  init_JazariStateMachine();
15079
14544
  init_parseContentSegments();
15080
- init_useTranslate();
15081
14545
  init_cn();
15082
14546
  exports.ContentRenderer = ({
15083
14547
  content,
@@ -15085,7 +14549,7 @@ var init_ContentRenderer = __esm({
15085
14549
  direction,
15086
14550
  className
15087
14551
  }) => {
15088
- const { t: _t } = useTranslate();
14552
+ const { t: _t } = hooks.useTranslate();
15089
14553
  const segments = React79.useMemo(
15090
14554
  () => segmentsProp ?? parseContentSegments(content),
15091
14555
  [segmentsProp, content]
@@ -15171,14 +14635,13 @@ var init_BookChapterView = __esm({
15171
14635
  init_ScaledDiagram();
15172
14636
  init_ContentRenderer();
15173
14637
  init_JazariStateMachine();
15174
- init_useTranslate();
15175
14638
  init_cn();
15176
14639
  exports.BookChapterView = ({
15177
14640
  chapter,
15178
14641
  direction,
15179
14642
  className
15180
14643
  }) => {
15181
- const { t: _t } = useTranslate();
14644
+ const { t: _t } = hooks.useTranslate();
15182
14645
  return /* @__PURE__ */ jsxRuntime.jsxs(
15183
14646
  exports.VStack,
15184
14647
  {
@@ -15210,7 +14673,6 @@ var init_BookCoverPage = __esm({
15210
14673
  init_Typography();
15211
14674
  init_Button();
15212
14675
  init_Box();
15213
- init_useTranslate();
15214
14676
  init_cn();
15215
14677
  exports.BookCoverPage = ({
15216
14678
  title,
@@ -15220,7 +14682,7 @@ var init_BookCoverPage = __esm({
15220
14682
  direction,
15221
14683
  className
15222
14684
  }) => {
15223
- const { t } = useTranslate();
14685
+ const { t } = hooks.useTranslate();
15224
14686
  return /* @__PURE__ */ jsxRuntime.jsxs(
15225
14687
  exports.VStack,
15226
14688
  {
@@ -15290,7 +14752,6 @@ var init_BookNavBar = __esm({
15290
14752
  init_Typography();
15291
14753
  init_ProgressBar();
15292
14754
  init_Box();
15293
- init_useTranslate();
15294
14755
  init_cn();
15295
14756
  exports.BookNavBar = ({
15296
14757
  currentPage,
@@ -15299,7 +14760,7 @@ var init_BookNavBar = __esm({
15299
14760
  direction,
15300
14761
  className
15301
14762
  }) => {
15302
- const { t } = useTranslate();
14763
+ const { t } = hooks.useTranslate();
15303
14764
  const isRtl = direction === "rtl";
15304
14765
  const progress = totalPages > 1 ? currentPage / (totalPages - 1) * 100 : 0;
15305
14766
  const PrevIcon = isRtl ? LucideIcons2.ChevronRight : LucideIcons2.ChevronLeft;
@@ -15392,7 +14853,6 @@ var init_BookTableOfContents = __esm({
15392
14853
  init_Button();
15393
14854
  init_Box();
15394
14855
  init_Badge();
15395
- init_useTranslate();
15396
14856
  init_cn();
15397
14857
  exports.BookTableOfContents = ({
15398
14858
  parts,
@@ -15400,7 +14860,7 @@ var init_BookTableOfContents = __esm({
15400
14860
  direction,
15401
14861
  className
15402
14862
  }) => {
15403
- const { t } = useTranslate();
14863
+ const { t } = hooks.useTranslate();
15404
14864
  return /* @__PURE__ */ jsxRuntime.jsxs(
15405
14865
  exports.VStack,
15406
14866
  {
@@ -15452,7 +14912,6 @@ var init_EmptyState = __esm({
15452
14912
  init_Stack();
15453
14913
  init_Typography();
15454
14914
  init_useEventBus();
15455
- init_useTranslate();
15456
14915
  ICON_NAME_ALIASES = {
15457
14916
  check: "check-circle",
15458
14917
  error: "x-circle",
@@ -15478,7 +14937,7 @@ var init_EmptyState = __esm({
15478
14937
  look = "icon-only"
15479
14938
  }) => {
15480
14939
  const eventBus = useEventBus();
15481
- const { t } = useTranslate();
14940
+ const { t } = hooks.useTranslate();
15482
14941
  const handleAction = () => {
15483
14942
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
15484
14943
  onAction?.();
@@ -15623,7 +15082,6 @@ var init_BookViewer = __esm({
15623
15082
  init_Box();
15624
15083
  init_Stack();
15625
15084
  init_useEventBus();
15626
- init_useTranslate();
15627
15085
  init_cn();
15628
15086
  init_BookCoverPage();
15629
15087
  init_BookTableOfContents();
@@ -15649,7 +15107,7 @@ var init_BookViewer = __esm({
15649
15107
  className
15650
15108
  }) => {
15651
15109
  const eventBus = useEventBus();
15652
- const { t } = useTranslate();
15110
+ const { t } = hooks.useTranslate();
15653
15111
  const [currentPage, setCurrentPage] = React79.useState(initialPage);
15654
15112
  const resolvedFieldMap = React79.useMemo(() => resolveFieldMap(fieldMap), [fieldMap]);
15655
15113
  const book = React79.useMemo(() => {
@@ -16055,7 +15513,6 @@ var init_BranchingLogicBuilder = __esm({
16055
15513
  init_FilterPill();
16056
15514
  init_Box();
16057
15515
  init_useEventBus();
16058
- init_useTranslate();
16059
15516
  init_cn();
16060
15517
  END_OF_SURVEY = "end-of-survey";
16061
15518
  RuleRow = ({
@@ -16066,7 +15523,7 @@ var init_BranchingLogicBuilder = __esm({
16066
15523
  onChange,
16067
15524
  onDelete
16068
15525
  }) => {
16069
- const { t } = useTranslate();
15526
+ const { t } = hooks.useTranslate();
16070
15527
  const operatorOptions = React79.useMemo(
16071
15528
  () => [
16072
15529
  { value: "equals", label: t("branchingLogic.operatorEquals") },
@@ -16241,7 +15698,7 @@ var init_BranchingLogicBuilder = __esm({
16241
15698
  NODE_GAP_Y = 80;
16242
15699
  PADDING = 32;
16243
15700
  LogicGraph = ({ questions, rules }) => {
16244
- const { t } = useTranslate();
15701
+ const { t } = hooks.useTranslate();
16245
15702
  const endOfSurveyLabel = t("branchingLogic.endOfSurvey");
16246
15703
  const layout = React79.useMemo(() => {
16247
15704
  const items = [
@@ -16373,7 +15830,7 @@ var init_BranchingLogicBuilder = __esm({
16373
15830
  readOnly = false,
16374
15831
  className
16375
15832
  }) => {
16376
- const { t } = useTranslate();
15833
+ const { t } = hooks.useTranslate();
16377
15834
  const eventBus = useEventBus();
16378
15835
  const questions = Array.isArray(questionsProp) ? questionsProp : [];
16379
15836
  const rulesInitial = Array.isArray(rulesProp) ? rulesProp : [];
@@ -16508,7 +15965,6 @@ var init_Breadcrumb = __esm({
16508
15965
  init_Typography();
16509
15966
  init_cn();
16510
15967
  init_useEventBus();
16511
- init_useTranslate();
16512
15968
  exports.Breadcrumb = ({
16513
15969
  items,
16514
15970
  separator = "chevron-right",
@@ -16516,7 +15972,7 @@ var init_Breadcrumb = __esm({
16516
15972
  className
16517
15973
  }) => {
16518
15974
  const eventBus = useEventBus();
16519
- const { t } = useTranslate();
15975
+ const { t } = hooks.useTranslate();
16520
15976
  const displayItems = maxItems && items.length > maxItems ? [
16521
15977
  ...items.slice(0, 1),
16522
15978
  { label: "...", isCurrent: false },
@@ -16595,7 +16051,7 @@ function BuilderBoard({
16595
16051
  className
16596
16052
  }) {
16597
16053
  const { emit } = useEventBus();
16598
- const { t } = useTranslate();
16054
+ const { t } = hooks.useTranslate();
16599
16055
  const resolved = Array.isArray(entity) ? entity[0] : entity;
16600
16056
  const [placements, setPlacements] = React79.useState({});
16601
16057
  const [headerError, setHeaderError] = React79.useState(false);
@@ -16744,7 +16200,6 @@ var init_BuilderBoard = __esm({
16744
16200
  "components/game/organisms/puzzles/builder/BuilderBoard.tsx"() {
16745
16201
  init_atoms2();
16746
16202
  init_useEventBus();
16747
- init_useTranslate();
16748
16203
  BuilderBoard.displayName = "BuilderBoard";
16749
16204
  }
16750
16205
  });
@@ -17012,7 +16467,7 @@ function CalendarGrid({
17012
16467
  }) {
17013
16468
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
17014
16469
  const eventBus = useEventBus();
17015
- const { t } = useTranslate();
16470
+ const { t } = hooks.useTranslate();
17016
16471
  const longPressTimer = React79.useRef(null);
17017
16472
  const resolvedWeekStart = React79.useMemo(
17018
16473
  () => weekStart ? getStartOfWeek(weekStart) : getStartOfWeek(/* @__PURE__ */ new Date()),
@@ -17222,7 +16677,6 @@ var init_CalendarGrid = __esm({
17222
16677
  init_TimeSlotCell();
17223
16678
  init_useEventBus();
17224
16679
  init_useSwipeGesture();
17225
- init_useTranslate();
17226
16680
  SHORT_DATE = { month: "short", day: "numeric" };
17227
16681
  CalendarGrid.displayName = "CalendarGrid";
17228
16682
  }
@@ -18531,7 +17985,6 @@ var init_Pagination = __esm({
18531
17985
  init_Stack();
18532
17986
  init_cn();
18533
17987
  init_useEventBus();
18534
- init_useTranslate();
18535
17988
  exports.Pagination = ({
18536
17989
  currentPage,
18537
17990
  totalPages,
@@ -18550,7 +18003,7 @@ var init_Pagination = __esm({
18550
18003
  pageSizeChangeEvent
18551
18004
  }) => {
18552
18005
  const eventBus = useEventBus();
18553
- const { t } = useTranslate();
18006
+ const { t } = hooks.useTranslate();
18554
18007
  const [jumpToPage, setJumpToPage] = React79.useState("");
18555
18008
  const handlePageChange = (page) => {
18556
18009
  if (pageChangeEvent) eventBus.emit(`UI:${pageChangeEvent}`, { page });
@@ -18735,7 +18188,6 @@ var init_CardGrid = __esm({
18735
18188
  init_cn();
18736
18189
  init_getNestedValue();
18737
18190
  init_useEventBus();
18738
- init_useTranslate();
18739
18191
  init_atoms2();
18740
18192
  init_Badge();
18741
18193
  init_Box();
@@ -18779,7 +18231,7 @@ var init_CardGrid = __esm({
18779
18231
  imageField
18780
18232
  }) => {
18781
18233
  const eventBus = useEventBus();
18782
- const { t } = useTranslate();
18234
+ const { t } = hooks.useTranslate();
18783
18235
  const effectiveFieldNames = normalizeFields(fields).length > 0 ? normalizeFields(fields) : fieldNames ?? normalizeFields(columns);
18784
18236
  const gridTemplateColumns = `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
18785
18237
  const normalizedData = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -18964,7 +18416,6 @@ var init_Carousel = __esm({
18964
18416
  init_cn();
18965
18417
  init_useEventBus();
18966
18418
  init_useSwipeGesture();
18967
- init_useTranslate();
18968
18419
  init_Box();
18969
18420
  init_Stack();
18970
18421
  init_Button();
@@ -18985,7 +18436,7 @@ var init_Carousel = __esm({
18985
18436
  const scrollRef = React79.useRef(null);
18986
18437
  const autoPlayRef = React79.useRef(null);
18987
18438
  const eventBus = useSafeEventBus3();
18988
- const { t } = useTranslate();
18439
+ const { t } = hooks.useTranslate();
18989
18440
  const safeItems = items ?? [];
18990
18441
  const totalSlides = safeItems.length;
18991
18442
  const emitSlideChange = React79.useCallback(
@@ -19201,7 +18652,6 @@ var init_CaseStudyOrganism = __esm({
19201
18652
  "use client";
19202
18653
  init_cn();
19203
18654
  init_useEventBus();
19204
- init_useTranslate();
19205
18655
  init_Stack();
19206
18656
  init_Typography();
19207
18657
  init_SimpleGrid();
@@ -19217,7 +18667,7 @@ var init_CaseStudyOrganism = __esm({
19217
18667
  subtitle
19218
18668
  }) => {
19219
18669
  useEventBus();
19220
- const { t } = useTranslate();
18670
+ const { t } = hooks.useTranslate();
19221
18671
  const items = React79.useMemo(
19222
18672
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
19223
18673
  [entity]
@@ -19406,7 +18856,6 @@ var init_Chart = __esm({
19406
18856
  init_ErrorState();
19407
18857
  init_EmptyState();
19408
18858
  init_useEventBus();
19409
- init_useTranslate();
19410
18859
  CHART_COLORS = [
19411
18860
  "var(--color-primary)",
19412
18861
  "var(--color-success)",
@@ -19979,7 +19428,7 @@ var init_Chart = __esm({
19979
19428
  }) => {
19980
19429
  const resolvedLook = look ?? (chartType ? LOOK_FROM_CHART_TYPE[chartType] : "bar-vertical");
19981
19430
  const eventBus = useEventBus();
19982
- const { t } = useTranslate();
19431
+ const { t } = hooks.useTranslate();
19983
19432
  const handleAction = React79.useCallback(
19984
19433
  (action) => {
19985
19434
  if (action.event) {
@@ -20222,7 +19671,7 @@ function ClassifierBoard({
20222
19671
  className
20223
19672
  }) {
20224
19673
  const { emit } = useEventBus();
20225
- const { t } = useTranslate();
19674
+ const { t } = hooks.useTranslate();
20226
19675
  const resolved = Array.isArray(entity) ? entity[0] : entity;
20227
19676
  const [assignments, setAssignments] = React79.useState({});
20228
19677
  const [headerError, setHeaderError] = React79.useState(false);
@@ -20360,7 +19809,6 @@ var init_ClassifierBoard = __esm({
20360
19809
  "components/game/organisms/puzzles/classifier/ClassifierBoard.tsx"() {
20361
19810
  init_atoms2();
20362
19811
  init_useEventBus();
20363
- init_useTranslate();
20364
19812
  ClassifierBoard.displayName = "ClassifierBoard";
20365
19813
  }
20366
19814
  });
@@ -20370,7 +19818,7 @@ function CodeView({
20370
19818
  defaultExpanded = false,
20371
19819
  className
20372
19820
  }) {
20373
- const { t } = useTranslate();
19821
+ const { t } = hooks.useTranslate();
20374
19822
  const [expanded, setExpanded] = React79.useState(defaultExpanded);
20375
19823
  const jsonString = JSON.stringify(data, null, 2);
20376
19824
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
@@ -20392,7 +19840,6 @@ var init_CodeView = __esm({
20392
19840
  "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
20393
19841
  init_atoms2();
20394
19842
  init_cn();
20395
- init_useTranslate();
20396
19843
  CodeView.displayName = "CodeView";
20397
19844
  }
20398
19845
  });
@@ -20406,7 +19853,6 @@ var init_Tabs = __esm({
20406
19853
  init_Box();
20407
19854
  init_cn();
20408
19855
  init_useEventBus();
20409
- init_useTranslate();
20410
19856
  exports.Tabs = ({
20411
19857
  items,
20412
19858
  tabs,
@@ -20424,7 +19870,7 @@ var init_Tabs = __esm({
20424
19870
  id: id || value || ""
20425
19871
  }));
20426
19872
  const eventBus = useEventBus();
20427
- const { t } = useTranslate();
19873
+ const { t } = hooks.useTranslate();
20428
19874
  const initialActive = safeItems.find((item) => item.active)?.id;
20429
19875
  const [internalActiveTab, setInternalActiveTab] = React79.useState(
20430
19876
  defaultActiveTab || initialActive || safeItems[0]?.id || ""
@@ -20583,7 +20029,6 @@ var init_CodeViewer = __esm({
20583
20029
  init_EmptyState();
20584
20030
  init_Tabs();
20585
20031
  init_useEventBus();
20586
- init_useTranslate();
20587
20032
  DIFF_STYLES = {
20588
20033
  add: {
20589
20034
  bg: "bg-success/10",
@@ -20621,7 +20066,7 @@ var init_CodeViewer = __esm({
20621
20066
  className
20622
20067
  }) => {
20623
20068
  const eventBus = useEventBus();
20624
- const { t } = useTranslate();
20069
+ const { t } = hooks.useTranslate();
20625
20070
  const [copied, setCopied] = React79.useState(false);
20626
20071
  const [wrap, setWrap] = React79.useState(wordWrap);
20627
20072
  const [activeFileIndex, setActiveFileIndex] = React79.useState(0);
@@ -21012,7 +20457,6 @@ var init_ConfirmDialog = __esm({
21012
20457
  init_Box();
21013
20458
  init_Stack();
21014
20459
  init_cn();
21015
- init_useTranslate();
21016
20460
  variantConfig = {
21017
20461
  danger: {
21018
20462
  icon: LucideIcons2.Trash2,
@@ -21060,7 +20504,7 @@ var init_ConfirmDialog = __esm({
21060
20504
  className
21061
20505
  }) => {
21062
20506
  const config = variantConfig[variant];
21063
- const { t } = useTranslate();
20507
+ const { t } = hooks.useTranslate();
21064
20508
  const resolvedMessage = message ?? description ?? "";
21065
20509
  const resolvedConfirmText = confirmText ?? confirmLabel ?? t("dialog.confirm");
21066
20510
  const resolvedCancelText = cancelText ?? cancelLabel ?? t("dialog.cancel");
@@ -21618,7 +21062,6 @@ var init_DashboardGrid = __esm({
21618
21062
  "components/core/organisms/layout/DashboardGrid.tsx"() {
21619
21063
  init_cn();
21620
21064
  init_Box();
21621
- init_useTranslate();
21622
21065
  gapStyles5 = {
21623
21066
  sm: "gap-2",
21624
21067
  md: "gap-4",
@@ -21645,7 +21088,7 @@ var init_DashboardGrid = __esm({
21645
21088
  cells,
21646
21089
  className
21647
21090
  }) => {
21648
- const { t: _t } = useTranslate();
21091
+ const { t: _t } = hooks.useTranslate();
21649
21092
  return /* @__PURE__ */ jsxRuntime.jsx(
21650
21093
  exports.Box,
21651
21094
  {
@@ -21712,7 +21155,6 @@ var init_DashboardLayout = __esm({
21712
21155
  init_Icon();
21713
21156
  init_useAuthContext();
21714
21157
  init_useEventBus();
21715
- init_useTranslate();
21716
21158
  init_CurrentPagePathContext();
21717
21159
  exports.DashboardLayout = ({
21718
21160
  appName = "{{APP_TITLE}}",
@@ -21769,13 +21211,9 @@ var init_DashboardLayout = __esm({
21769
21211
  const location = reactRouterDom.useLocation();
21770
21212
  const ctxPagePath = useCurrentPagePath();
21771
21213
  const activePath = currentPath ?? ctxPagePath ?? location.pathname;
21772
- const { user: authUser, signOut: authSignOut } = useAuthContext();
21773
- const user = userProp || (authUser ? {
21774
- name: authUser.displayName || authUser.email?.split("@")[0] || "User",
21775
- email: authUser.email || "",
21776
- avatar: authUser.photoURL || void 0
21777
- } : null);
21778
- const { t } = useTranslate();
21214
+ const { signOut: authSignOut } = useAuthContext();
21215
+ const user = userProp || (null);
21216
+ const { t } = hooks.useTranslate();
21779
21217
  const handleSignOut = onSignOutProp || authSignOut;
21780
21218
  const showSidebar = layoutMode === "sidebar";
21781
21219
  const showHeader = layoutMode !== "minimal";
@@ -22441,7 +21879,7 @@ function useDataDnd(args) {
22441
21879
  ({ id, children }) => {
22442
21880
  const {
22443
21881
  attributes,
22444
- listeners: listeners8,
21882
+ listeners: listeners7,
22445
21883
  setNodeRef,
22446
21884
  transform,
22447
21885
  transition,
@@ -22464,7 +21902,7 @@ function useDataDnd(args) {
22464
21902
  ref: setNodeRef,
22465
21903
  style,
22466
21904
  ...attributes,
22467
- ...listeners8,
21905
+ ...listeners7,
22468
21906
  children
22469
21907
  }
22470
21908
  );
@@ -22746,7 +22184,7 @@ function DataGrid({
22746
22184
  look = "dense"
22747
22185
  }) {
22748
22186
  const eventBus = useEventBus();
22749
- const { t } = useTranslate();
22187
+ const { t } = hooks.useTranslate();
22750
22188
  const [selectedIds, setSelectedIds] = React79.useState(/* @__PURE__ */ new Set());
22751
22189
  const [visibleCount, setVisibleCount] = React79.useState(pageSize || Infinity);
22752
22190
  const fieldDefs = fields ?? columns ?? [];
@@ -23061,7 +22499,6 @@ var init_DataGrid = __esm({
23061
22499
  init_cn();
23062
22500
  init_getNestedValue();
23063
22501
  init_useEventBus();
23064
- init_useTranslate();
23065
22502
  init_Box();
23066
22503
  init_Stack();
23067
22504
  init_Typography();
@@ -23186,7 +22623,7 @@ function DataList({
23186
22623
  look = "dense"
23187
22624
  }) {
23188
22625
  const eventBus = useEventBus();
23189
- const { t } = useTranslate();
22626
+ const { t } = hooks.useTranslate();
23190
22627
  const [visibleCount, setVisibleCount] = React79__namespace.default.useState(pageSize || Infinity);
23191
22628
  const fieldDefs = fields ?? columns ?? [];
23192
22629
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -23500,7 +22937,6 @@ var init_DataList = __esm({
23500
22937
  init_cn();
23501
22938
  init_getNestedValue();
23502
22939
  init_useEventBus();
23503
- init_useTranslate();
23504
22940
  init_Box();
23505
22941
  init_Stack();
23506
22942
  init_Typography();
@@ -23555,7 +22991,6 @@ var init_FileTree = __esm({
23555
22991
  init_Box();
23556
22992
  init_Typography();
23557
22993
  init_Icon();
23558
- init_useTranslate();
23559
22994
  TreeNodeItem = ({
23560
22995
  node,
23561
22996
  depth,
@@ -23641,7 +23076,7 @@ var init_FileTree = __esm({
23641
23076
  className,
23642
23077
  indent = 16
23643
23078
  }) => {
23644
- const { t } = useTranslate();
23079
+ const { t } = hooks.useTranslate();
23645
23080
  if (tree.length === 0) {
23646
23081
  return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: `p-4 ${className ?? ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "caption", color: "muted", children: t("fileTree.noFiles") }) });
23647
23082
  }
@@ -23742,14 +23177,6 @@ function useQuerySingleton(query) {
23742
23177
  setSort
23743
23178
  };
23744
23179
  }
23745
- function parseQueryBinding(binding) {
23746
- const cleaned = binding.startsWith("@") ? binding.slice(1) : binding;
23747
- const parts = cleaned.split(".");
23748
- return {
23749
- query: parts[0],
23750
- field: parts.length > 1 ? parts.slice(1).join(".") : void 0
23751
- };
23752
- }
23753
23180
  var queryStores;
23754
23181
  var init_useQuerySingleton = __esm({
23755
23182
  "hooks/useQuerySingleton.ts"() {
@@ -23770,7 +23197,6 @@ var init_FilterGroup = __esm({
23770
23197
  init_Icon();
23771
23198
  init_useEventBus();
23772
23199
  init_useQuerySingleton();
23773
- init_useTranslate();
23774
23200
  resolveFilterType = (filter) => filter.filterType ?? filter.type;
23775
23201
  lookStyles6 = {
23776
23202
  toolbar: "",
@@ -23791,7 +23217,7 @@ var init_FilterGroup = __esm({
23791
23217
  isLoading,
23792
23218
  look = "toolbar"
23793
23219
  }) => {
23794
- const { t } = useTranslate();
23220
+ const { t } = hooks.useTranslate();
23795
23221
  const eventBus = useEventBus();
23796
23222
  const queryState = useQuerySingleton(query);
23797
23223
  const [selectedValues, setSelectedValues] = React79.useState(
@@ -24422,7 +23848,6 @@ var init_Coachmark = __esm({
24422
23848
  init_Button();
24423
23849
  init_Icon();
24424
23850
  init_cn();
24425
- init_useTranslate();
24426
23851
  GAP = 10;
24427
23852
  EDGE = 8;
24428
23853
  exports.Coachmark = ({
@@ -24441,7 +23866,7 @@ var init_Coachmark = __esm({
24441
23866
  className
24442
23867
  }) => {
24443
23868
  const cardRef = React79.useRef(null);
24444
- const { t } = useTranslate();
23869
+ const { t } = hooks.useTranslate();
24445
23870
  const rect = useAnchorRect(anchor, open);
24446
23871
  const [pos, setPos] = React79.useState(null);
24447
23872
  const centered = open && !rect && fallbackCentered;
@@ -24663,13 +24088,12 @@ var init_RelationSelect = __esm({
24663
24088
  init_Spinner();
24664
24089
  init_Typography();
24665
24090
  init_debug();
24666
- init_useTranslate();
24667
24091
  isRelationsDebugEnabled = () => isDebugEnabled();
24668
24092
  exports.RelationSelect = ({
24669
24093
  value,
24670
24094
  onChange,
24671
24095
  options = [],
24672
- placeholder = "Select...",
24096
+ placeholder,
24673
24097
  required = false,
24674
24098
  disabled = false,
24675
24099
  isLoading = false,
@@ -24680,7 +24104,8 @@ var init_RelationSelect = __esm({
24680
24104
  searchPlaceholder,
24681
24105
  emptyMessage
24682
24106
  }) => {
24683
- const { t } = useTranslate();
24107
+ const { t } = hooks.useTranslate();
24108
+ const resolvedPlaceholder = placeholder ?? t("relationSelect.selectPlaceholder");
24684
24109
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("common.search");
24685
24110
  const resolvedEmptyMessage = emptyMessage ?? t("empty.noOptionsFound");
24686
24111
  const [isOpen, setIsOpen] = React79.useState(false);
@@ -24790,7 +24215,7 @@ var init_RelationSelect = __esm({
24790
24215
  children: isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "xs", align: "center", children: [
24791
24216
  /* @__PURE__ */ jsxRuntime.jsx(exports.Spinner, { size: "sm" }),
24792
24217
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { as: "span", children: t("common.loading") })
24793
- ] }) : selectedOption ? selectedOption.label : placeholder
24218
+ ] }) : selectedOption ? selectedOption.label : resolvedPlaceholder
24794
24219
  }
24795
24220
  ),
24796
24221
  /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "xs", align: "center", children: [
@@ -24887,7 +24312,6 @@ var init_SearchInput = __esm({
24887
24312
  init_cn();
24888
24313
  init_useEventBus();
24889
24314
  init_useQuerySingleton();
24890
- init_useTranslate();
24891
24315
  exports.SearchInput = ({
24892
24316
  value,
24893
24317
  onSearch,
@@ -24902,7 +24326,7 @@ var init_SearchInput = __esm({
24902
24326
  ...props
24903
24327
  }) => {
24904
24328
  const eventBus = useEventBus();
24905
- const { t } = useTranslate();
24329
+ const { t } = hooks.useTranslate();
24906
24330
  const resolvedPlaceholder = placeholder ?? t("common.search");
24907
24331
  const queryState = useQuerySingleton(query);
24908
24332
  const initialValue = queryState?.search ?? value ?? "";
@@ -24990,7 +24414,6 @@ var init_SidePanel = __esm({
24990
24414
  init_Typography();
24991
24415
  init_cn();
24992
24416
  init_useEventBus();
24993
- init_useTranslate();
24994
24417
  exports.SidePanel = ({
24995
24418
  title,
24996
24419
  children,
@@ -25003,7 +24426,7 @@ var init_SidePanel = __esm({
25003
24426
  closeEvent
25004
24427
  }) => {
25005
24428
  const eventBus = useEventBus();
25006
- const { t } = useTranslate();
24429
+ const { t } = hooks.useTranslate();
25007
24430
  const handleClose = () => {
25008
24431
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
25009
24432
  onClose();
@@ -25169,7 +24592,6 @@ var init_WizardNavigation = __esm({
25169
24592
  init_Icon();
25170
24593
  init_cn();
25171
24594
  init_useEventBus();
25172
- init_useTranslate();
25173
24595
  exports.WizardNavigation = ({
25174
24596
  currentStep,
25175
24597
  totalSteps,
@@ -25190,7 +24612,7 @@ var init_WizardNavigation = __esm({
25190
24612
  className
25191
24613
  }) => {
25192
24614
  const eventBus = useSafeEventBus4();
25193
- const { t } = useTranslate();
24615
+ const { t } = hooks.useTranslate();
25194
24616
  const resolvedBackLabel = backLabel ?? t("wizard.back");
25195
24617
  const resolvedNextLabel = nextLabel ?? t("wizard.next");
25196
24618
  const resolvedCompleteLabel = completeLabel ?? t("wizard.complete");
@@ -25257,7 +24679,6 @@ var init_RepeatableFormSection = __esm({
25257
24679
  init_Card();
25258
24680
  init_Icon();
25259
24681
  init_useEventBus();
25260
- init_useTranslate();
25261
24682
  exports.RepeatableFormSection = ({
25262
24683
  sectionType,
25263
24684
  title,
@@ -25278,7 +24699,7 @@ var init_RepeatableFormSection = __esm({
25278
24699
  showAuditInfo = false
25279
24700
  }) => {
25280
24701
  const eventBus = useEventBus();
25281
- const { t } = useTranslate();
24702
+ const { t } = hooks.useTranslate();
25282
24703
  const resolvedAddLabel = addLabel ?? t("common.add");
25283
24704
  const resolvedEmptyMessage = emptyMessage ?? t("empty.noItemsAdded");
25284
24705
  const safeItems = items ?? [];
@@ -25388,7 +24809,6 @@ var actionTypeLabelKeys, actionTypeIcons; exports.ViolationAlert = void 0;
25388
24809
  var init_ViolationAlert = __esm({
25389
24810
  "components/core/molecules/ViolationAlert.tsx"() {
25390
24811
  init_cn();
25391
- init_useTranslate();
25392
24812
  init_Box();
25393
24813
  init_Stack();
25394
24814
  init_Typography();
@@ -25414,7 +24834,7 @@ var init_ViolationAlert = __esm({
25414
24834
  className,
25415
24835
  ...flatProps
25416
24836
  }) => {
25417
- const { t } = useTranslate();
24837
+ const { t } = hooks.useTranslate();
25418
24838
  const resolvedViolation = violation ?? {
25419
24839
  law: "",
25420
24840
  article: "",
@@ -25894,7 +25314,6 @@ var init_LineChart = __esm({
25894
25314
  "use client";
25895
25315
  init_cn();
25896
25316
  init_atoms2();
25897
- init_useTranslate();
25898
25317
  exports.LineChart = ({
25899
25318
  data,
25900
25319
  width = 400,
@@ -25906,7 +25325,7 @@ var init_LineChart = __esm({
25906
25325
  areaColor = "var(--color-primary)",
25907
25326
  className
25908
25327
  }) => {
25909
- const { t } = useTranslate();
25328
+ const { t } = hooks.useTranslate();
25910
25329
  const gradientId = React79.useId();
25911
25330
  const safeData = data ?? [];
25912
25331
  const sortedData = React79.useMemo(() => {
@@ -28134,7 +27553,6 @@ var init_GraphView = __esm({
28134
27553
  "use client";
28135
27554
  init_cn();
28136
27555
  init_atoms2();
28137
- init_useTranslate();
28138
27556
  GROUP_COLORS = [
28139
27557
  "#3b82f6",
28140
27558
  // blue-500
@@ -28167,7 +27585,7 @@ var init_GraphView = __esm({
28167
27585
  showLabels = true,
28168
27586
  zoomToFit = true
28169
27587
  }) => {
28170
- const { t } = useTranslate();
27588
+ const { t } = hooks.useTranslate();
28171
27589
  const containerRef = React79.useRef(null);
28172
27590
  const animRef = React79.useRef(0);
28173
27591
  const [simNodes, setSimNodes] = React79.useState([]);
@@ -28460,7 +27878,6 @@ var init_NumberStepper = __esm({
28460
27878
  init_cn();
28461
27879
  init_Icon();
28462
27880
  init_useEventBus();
28463
- init_useTranslate();
28464
27881
  sizeStyles10 = {
28465
27882
  sm: {
28466
27883
  button: "w-7 h-7",
@@ -28494,7 +27911,7 @@ var init_NumberStepper = __esm({
28494
27911
  label
28495
27912
  }) => {
28496
27913
  const eventBus = useSafeEventBus5();
28497
- const { t } = useTranslate();
27914
+ const { t } = hooks.useTranslate();
28498
27915
  const intervalRef = React79.useRef(null);
28499
27916
  const timeoutRef = React79.useRef(null);
28500
27917
  const isAtMin = min !== void 0 && value <= min;
@@ -28801,7 +28218,6 @@ var init_UploadDropZone = __esm({
28801
28218
  init_Icon();
28802
28219
  init_Typography();
28803
28220
  init_useEventBus();
28804
- init_useTranslate();
28805
28221
  exports.UploadDropZone = ({
28806
28222
  accept,
28807
28223
  maxSize,
@@ -28814,7 +28230,7 @@ var init_UploadDropZone = __esm({
28814
28230
  onFiles,
28815
28231
  className
28816
28232
  }) => {
28817
- const { t } = useTranslate();
28233
+ const { t } = hooks.useTranslate();
28818
28234
  const resolvedLabel = label ?? t("upload.dropOrBrowse");
28819
28235
  const [isDragOver, setIsDragOver] = React79.useState(false);
28820
28236
  const [error, setError] = React79.useState(null);
@@ -28968,7 +28384,6 @@ var init_Lightbox = __esm({
28968
28384
  init_Icon();
28969
28385
  init_cn();
28970
28386
  init_useEventBus();
28971
- init_useTranslate();
28972
28387
  exports.Lightbox = ({
28973
28388
  images = [],
28974
28389
  currentIndex = 0,
@@ -28983,7 +28398,7 @@ var init_Lightbox = __esm({
28983
28398
  const [index, setIndex] = React79.useState(currentIndex);
28984
28399
  const [touchStartX, setTouchStartX] = React79.useState(null);
28985
28400
  const eventBus = useSafeEventBus8();
28986
- const { t } = useTranslate();
28401
+ const { t } = hooks.useTranslate();
28987
28402
  React79.useEffect(() => {
28988
28403
  setIndex(currentIndex);
28989
28404
  }, [currentIndex]);
@@ -29221,7 +28636,7 @@ function TableView({
29221
28636
  dndRoot
29222
28637
  }) {
29223
28638
  const eventBus = useEventBus();
29224
- const { t } = useTranslate();
28639
+ const { t } = hooks.useTranslate();
29225
28640
  const [visibleCount, setVisibleCount] = React79__namespace.default.useState(pageSize > 0 ? pageSize : Infinity);
29226
28641
  const [localSelected, setLocalSelected] = React79__namespace.default.useState(/* @__PURE__ */ new Set());
29227
28642
  const colDefs = columns ?? fields ?? [];
@@ -29453,7 +28868,6 @@ var init_TableView = __esm({
29453
28868
  init_cn();
29454
28869
  init_getNestedValue();
29455
28870
  init_useEventBus();
29456
- init_useTranslate();
29457
28871
  init_Box();
29458
28872
  init_Stack();
29459
28873
  init_Typography();
@@ -29657,7 +29071,6 @@ var init_Meter = __esm({
29657
29071
  init_LoadingState();
29658
29072
  init_ErrorState();
29659
29073
  init_useEventBus();
29660
- init_useTranslate();
29661
29074
  DEFAULT_THRESHOLDS = [
29662
29075
  { value: 30, color: "var(--color-error)" },
29663
29076
  { value: 70, color: "var(--color-warning)" },
@@ -29685,7 +29098,7 @@ var init_Meter = __esm({
29685
29098
  className
29686
29099
  }) => {
29687
29100
  const eventBus = useEventBus();
29688
- const { t } = useTranslate();
29101
+ const { t } = hooks.useTranslate();
29689
29102
  const handleAction = React79.useCallback(
29690
29103
  (action) => {
29691
29104
  if (action.event) {
@@ -31604,7 +31017,6 @@ var init_VoteStack = __esm({
31604
31017
  init_cn();
31605
31018
  init_Icon();
31606
31019
  init_useEventBus();
31607
- init_useTranslate();
31608
31020
  sizeStyles12 = {
31609
31021
  sm: {
31610
31022
  button: "w-7 h-7",
@@ -31637,7 +31049,7 @@ var init_VoteStack = __esm({
31637
31049
  const isUp = userVote === "up";
31638
31050
  const isDown = userVote === "down";
31639
31051
  const eventBus = useEventBus();
31640
- const { t } = useTranslate();
31052
+ const { t } = hooks.useTranslate();
31641
31053
  const handleUp = React79.useCallback(() => {
31642
31054
  const next = isUp ? null : "up";
31643
31055
  onVote?.(next);
@@ -32059,7 +31471,6 @@ var init_QrScanner = __esm({
32059
31471
  init_atoms2();
32060
31472
  init_Icon();
32061
31473
  init_useEventBus();
32062
- init_useTranslate();
32063
31474
  exports.QrScanner = ({
32064
31475
  onScan,
32065
31476
  scanEvent,
@@ -32072,7 +31483,7 @@ var init_QrScanner = __esm({
32072
31483
  className
32073
31484
  }) => {
32074
31485
  const eventBus = useEventBus();
32075
- const { t } = useTranslate();
31486
+ const { t } = hooks.useTranslate();
32076
31487
  const videoRef = React79.useRef(null);
32077
31488
  const streamRef = React79.useRef(null);
32078
31489
  const scanIntervalRef = React79.useRef(null);
@@ -32286,7 +31697,6 @@ var init_OptionConstraintGroup = __esm({
32286
31697
  "components/core/molecules/OptionConstraintGroup.tsx"() {
32287
31698
  init_cn();
32288
31699
  init_useEventBus();
32289
- init_useTranslate();
32290
31700
  init_Typography();
32291
31701
  init_Box();
32292
31702
  init_Label();
@@ -32342,7 +31752,7 @@ var init_OptionConstraintGroup = __esm({
32342
31752
  className
32343
31753
  }) => {
32344
31754
  const eventBus = useEventBus();
32345
- const { t } = useTranslate();
31755
+ const { t } = hooks.useTranslate();
32346
31756
  const hint = constraintHint(constraint, t);
32347
31757
  const error = validateSelection(selected, constraint, t);
32348
31758
  const inputName = `option-${groupId}`;
@@ -32766,7 +32176,7 @@ function changeBlockType(block, type) {
32766
32176
  return { id: block.id, type, content: seed };
32767
32177
  }
32768
32178
  function BlockMenu({ block, readOnly, onDelete, onDuplicate, onChangeType }) {
32769
- const { t } = useTranslate();
32179
+ const { t } = hooks.useTranslate();
32770
32180
  const [open, setOpen] = React79.useState(false);
32771
32181
  const ref = React79.useRef(null);
32772
32182
  React79.useEffect(() => {
@@ -32923,7 +32333,7 @@ function BlockRow({
32923
32333
  onInsertAfter,
32924
32334
  onChangeType
32925
32335
  }) {
32926
- const { t } = useTranslate();
32336
+ const { t } = hooks.useTranslate();
32927
32337
  const setContent = React79.useCallback(
32928
32338
  (next) => onUpdate((b) => ({ ...b, content: next })),
32929
32339
  [onUpdate]
@@ -33242,7 +32652,6 @@ var init_RichBlockEditor = __esm({
33242
32652
  init_Input();
33243
32653
  init_Icon();
33244
32654
  init_useEventBus();
33245
- init_useTranslate();
33246
32655
  TOOLBAR_ENTRIES = [
33247
32656
  { type: "paragraph", labelKey: "richBlockEditor.toolbar.text", icon: LucideIcons2.Type },
33248
32657
  { type: "heading-1", labelKey: "richBlockEditor.toolbar.h1", icon: LucideIcons2.Heading1 },
@@ -33299,7 +32708,7 @@ var init_RichBlockEditor = __esm({
33299
32708
  showToolbar = true,
33300
32709
  className
33301
32710
  }) => {
33302
- const { t } = useTranslate();
32711
+ const { t } = hooks.useTranslate();
33303
32712
  const [blocks, setBlocks] = React79.useState(
33304
32713
  () => normalizeBlocks(initialBlocks)
33305
32714
  );
@@ -33433,7 +32842,6 @@ var init_ReplyTree = __esm({
33433
32842
  "use client";
33434
32843
  init_cn();
33435
32844
  init_useEventBus();
33436
- init_useTranslate();
33437
32845
  init_atoms2();
33438
32846
  init_VoteStack();
33439
32847
  ReplyTreeNode = ({
@@ -33453,7 +32861,7 @@ var init_ReplyTree = __esm({
33453
32861
  showActions
33454
32862
  }) => {
33455
32863
  const eventBus = useEventBus();
33456
- const { t } = useTranslate();
32864
+ const { t } = hooks.useTranslate();
33457
32865
  const hasReplies = !!node.replies && node.replies.length > 0;
33458
32866
  const isCollapsed = collapsedSet.has(node.id);
33459
32867
  const atMaxDepth = depth >= maxDepth;
@@ -33644,7 +33052,7 @@ var init_ReplyTree = __esm({
33644
33052
  showActions = true,
33645
33053
  className
33646
33054
  }) => {
33647
- const { t } = useTranslate();
33055
+ const { t } = hooks.useTranslate();
33648
33056
  const nodeList = Array.isArray(nodes) ? nodes : nodes ? [nodes] : [];
33649
33057
  const [collapsedSet, setCollapsedSet] = React79.useState(() => {
33650
33058
  const acc = /* @__PURE__ */ new Set();
@@ -33741,7 +33149,6 @@ var init_VersionDiff = __esm({
33741
33149
  "use client";
33742
33150
  init_cn();
33743
33151
  init_useEventBus();
33744
- init_useTranslate();
33745
33152
  init_atoms2();
33746
33153
  init_Stack();
33747
33154
  INLINE_STYLES = {
@@ -33764,7 +33171,7 @@ var init_VersionDiff = __esm({
33764
33171
  language,
33765
33172
  className
33766
33173
  }) => {
33767
- const { t } = useTranslate();
33174
+ const { t } = hooks.useTranslate();
33768
33175
  const eventBus = useEventBus();
33769
33176
  const revisions = Array.isArray(revisionsProp) ? revisionsProp : [];
33770
33177
  const fallbackBefore = revisions[0]?.id ?? "";
@@ -34057,12 +33464,11 @@ var init_DocBreadcrumb = __esm({
34057
33464
  init_Stack();
34058
33465
  init_Typography();
34059
33466
  init_Icon();
34060
- init_useTranslate();
34061
33467
  exports.DocBreadcrumb = ({
34062
33468
  items,
34063
33469
  className
34064
33470
  }) => {
34065
- const { t } = useTranslate();
33471
+ const { t } = hooks.useTranslate();
34066
33472
  return /* @__PURE__ */ jsxRuntime.jsx(
34067
33473
  exports.Box,
34068
33474
  {
@@ -34313,7 +33719,7 @@ function DocSearch({
34313
33719
  onSearch,
34314
33720
  className
34315
33721
  }) {
34316
- const { t } = useTranslate();
33722
+ const { t } = hooks.useTranslate();
34317
33723
  const resolvedPlaceholder = placeholder ?? t("docSearch.placeholder");
34318
33724
  const [query, setQuery] = React79.useState("");
34319
33725
  const [results, setResults] = React79.useState([]);
@@ -34486,7 +33892,6 @@ var init_DocSearch = __esm({
34486
33892
  init_Typography();
34487
33893
  init_Icon();
34488
33894
  init_Input();
34489
- init_useTranslate();
34490
33895
  }
34491
33896
  });
34492
33897
  var DocSidebarCategory; exports.DocSidebar = void 0;
@@ -34499,7 +33904,6 @@ var init_DocSidebar = __esm({
34499
33904
  init_Stack();
34500
33905
  init_Typography();
34501
33906
  init_Icon();
34502
- init_useTranslate();
34503
33907
  DocSidebarCategory = ({ item, depth }) => {
34504
33908
  const [expanded, setExpanded] = React79.useState(
34505
33909
  () => item.items?.some(function hasActive(child) {
@@ -34584,7 +33988,7 @@ var init_DocSidebar = __esm({
34584
33988
  items,
34585
33989
  className
34586
33990
  }) => {
34587
- const { t } = useTranslate();
33991
+ const { t } = hooks.useTranslate();
34588
33992
  return /* @__PURE__ */ jsxRuntime.jsx(
34589
33993
  exports.Box,
34590
33994
  {
@@ -34606,13 +34010,12 @@ var init_DocTOC = __esm({
34606
34010
  init_Box();
34607
34011
  init_Stack();
34608
34012
  init_Typography();
34609
- init_useTranslate();
34610
34013
  exports.DocTOC = ({
34611
34014
  items,
34612
34015
  activeId,
34613
34016
  className
34614
34017
  }) => {
34615
- const { t } = useTranslate();
34018
+ const { t } = hooks.useTranslate();
34616
34019
  return /* @__PURE__ */ jsxRuntime.jsx(
34617
34020
  exports.Box,
34618
34021
  {
@@ -35340,7 +34743,6 @@ var init_FormSection = __esm({
35340
34743
  init_Button();
35341
34744
  init_Stack();
35342
34745
  init_Icon();
35343
- init_useTranslate();
35344
34746
  init_useEventBus();
35345
34747
  exports.FormSection = ({
35346
34748
  title,
@@ -35353,7 +34755,7 @@ var init_FormSection = __esm({
35353
34755
  className
35354
34756
  }) => {
35355
34757
  const [collapsed, setCollapsed] = React79__namespace.default.useState(defaultCollapsed);
35356
- const { t } = useTranslate();
34758
+ const { t } = hooks.useTranslate();
35357
34759
  const eventBus = useEventBus();
35358
34760
  const gridClass = {
35359
34761
  1: "grid-cols-1",
@@ -35469,7 +34871,6 @@ var init_Header = __esm({
35469
34871
  init_Stack();
35470
34872
  init_Typography();
35471
34873
  init_cn();
35472
- init_useTranslate();
35473
34874
  lookStyles8 = {
35474
34875
  "compact-bar": "",
35475
34876
  hero: "py-section min-h-[200px] [&_h1]:text-display-1",
@@ -35498,7 +34899,7 @@ var init_Header = __esm({
35498
34899
  onLogoClick,
35499
34900
  className
35500
34901
  }) => {
35501
- const { t } = useTranslate();
34902
+ const { t } = hooks.useTranslate();
35502
34903
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("common.search");
35503
34904
  const userInitials = userAvatar?.initials || userName?.[0]?.toUpperCase() || "U";
35504
34905
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -35789,7 +35190,6 @@ var init_Sidebar = __esm({
35789
35190
  init_Typography();
35790
35191
  init_cn();
35791
35192
  init_useEventBus();
35792
- init_useTranslate();
35793
35193
  SidebarNavItem = ({ item, collapsed }) => {
35794
35194
  const Icon3 = item.icon;
35795
35195
  const isActive = item.active ?? item.isActive;
@@ -35853,7 +35253,7 @@ var init_Sidebar = __esm({
35853
35253
  className
35854
35254
  }) => {
35855
35255
  const { emit } = useEventBus();
35856
- const { t } = useTranslate();
35256
+ const { t } = hooks.useTranslate();
35857
35257
  const [internalCollapsed, setInternalCollapsed] = React79.useState(defaultCollapsed);
35858
35258
  const collapsed = controlledCollapsed !== void 0 ? controlledCollapsed : internalCollapsed;
35859
35259
  const handleToggle = React79.useCallback(() => {
@@ -36043,7 +35443,6 @@ var init_WizardContainer = __esm({
36043
35443
  init_Stack();
36044
35444
  init_Icon();
36045
35445
  init_cn();
36046
- init_useTranslate();
36047
35446
  exports.WizardContainer = ({
36048
35447
  steps,
36049
35448
  currentStep: controlledStep,
@@ -36056,7 +35455,7 @@ var init_WizardContainer = __esm({
36056
35455
  entity: _entity
36057
35456
  // Accept but don't use directly yet
36058
35457
  }) => {
36059
- const { t } = useTranslate();
35458
+ const { t } = hooks.useTranslate();
36060
35459
  const [internalStep, setInternalStep] = React79.useState(0);
36061
35460
  const normalizedControlledStep = (() => {
36062
35461
  if (controlledStep === void 0 || controlledStep === null)
@@ -36220,14 +35619,14 @@ var init_WizardContainer = __esm({
36220
35619
  });
36221
35620
  function calculateComplexity(schema) {
36222
35621
  if (!schema) return 1;
36223
- const entities2 = schema.dataEntities?.length || 0;
35622
+ const entities = schema.dataEntities?.length || 0;
36224
35623
  const pages = schema.ui?.pages?.length || 0;
36225
35624
  const traits2 = schema.traits?.length || 0;
36226
35625
  const sections = schema.ui?.pages?.reduce(
36227
35626
  (acc, page) => acc + (page.sections?.length || 0),
36228
35627
  0
36229
35628
  ) || 0;
36230
- return entities2 * 3 + pages * 2 + traits2 * 2 + sections * 1;
35629
+ return entities * 3 + pages * 2 + traits2 * 2 + sections * 1;
36231
35630
  }
36232
35631
  function getOrbitalType(complexity) {
36233
35632
  if (complexity <= 3) return "1s";
@@ -36617,7 +36016,6 @@ var init_SignaturePad = __esm({
36617
36016
  init_LoadingState();
36618
36017
  init_ErrorState();
36619
36018
  init_useEventBus();
36620
- init_useTranslate();
36621
36019
  exports.SignaturePad = ({
36622
36020
  label,
36623
36021
  helperText,
@@ -36635,7 +36033,7 @@ var init_SignaturePad = __esm({
36635
36033
  className
36636
36034
  }) => {
36637
36035
  const eventBus = useEventBus();
36638
- const { t } = useTranslate();
36036
+ const { t } = hooks.useTranslate();
36639
36037
  const resolvedLabel = label ?? t("signaturePad.label");
36640
36038
  const resolvedHelperText = helperText ?? t("signaturePad.helperText");
36641
36039
  const canvasRef = React79.useRef(null);
@@ -36811,7 +36209,6 @@ var init_DocumentViewer = __esm({
36811
36209
  init_EmptyState();
36812
36210
  init_Tabs();
36813
36211
  init_useEventBus();
36814
- init_useTranslate();
36815
36212
  exports.DocumentViewer = ({
36816
36213
  title,
36817
36214
  src,
@@ -36831,7 +36228,7 @@ var init_DocumentViewer = __esm({
36831
36228
  className
36832
36229
  }) => {
36833
36230
  const eventBus = useEventBus();
36834
- const { t } = useTranslate();
36231
+ const { t } = hooks.useTranslate();
36835
36232
  const [zoom, setZoom] = React79.useState(100);
36836
36233
  const [currentPage, setCurrentPage] = React79.useState(propPage ?? 1);
36837
36234
  const [activeDocIndex, setActiveDocIndex] = React79.useState(0);
@@ -37016,7 +36413,6 @@ var init_GraphCanvas = __esm({
37016
36413
  init_ErrorState();
37017
36414
  init_EmptyState();
37018
36415
  init_useEventBus();
37019
- init_useTranslate();
37020
36416
  GROUP_COLORS2 = [
37021
36417
  "var(--color-primary)",
37022
36418
  "var(--color-success)",
@@ -37043,7 +36439,7 @@ var init_GraphCanvas = __esm({
37043
36439
  className
37044
36440
  }) => {
37045
36441
  const eventBus = useEventBus();
37046
- const { t } = useTranslate();
36442
+ const { t } = hooks.useTranslate();
37047
36443
  const canvasRef = React79.useRef(null);
37048
36444
  const animRef = React79.useRef(0);
37049
36445
  const [zoom, setZoom] = React79.useState(1);
@@ -37513,7 +36909,7 @@ function DataTable({
37513
36909
  null
37514
36910
  );
37515
36911
  const eventBus = useEventBus();
37516
- const { t } = useTranslate();
36912
+ const { t } = hooks.useTranslate();
37517
36913
  const resolvedEmptyTitle = emptyTitle ?? t("table.empty.title");
37518
36914
  const resolvedEmptyDescription = emptyDescription ?? t("table.empty.description");
37519
36915
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("common.search");
@@ -37874,7 +37270,6 @@ var init_DataTable = __esm({
37874
37270
  init_molecules2();
37875
37271
  init_Icon();
37876
37272
  init_useEventBus();
37877
- init_useTranslate();
37878
37273
  init_types3();
37879
37274
  lookStyles9 = {
37880
37275
  dense: "",
@@ -37892,7 +37287,7 @@ function DebuggerBoard({
37892
37287
  className
37893
37288
  }) {
37894
37289
  const { emit } = useEventBus();
37895
- const { t } = useTranslate();
37290
+ const { t } = hooks.useTranslate();
37896
37291
  const resolved = Array.isArray(entity) ? entity[0] : entity;
37897
37292
  const [flaggedLines, setFlaggedLines] = React79.useState(/* @__PURE__ */ new Set());
37898
37293
  const [headerError, setHeaderError] = React79.useState(false);
@@ -38021,7 +37416,6 @@ var init_DebuggerBoard = __esm({
38021
37416
  "components/game/organisms/puzzles/debugger/DebuggerBoard.tsx"() {
38022
37417
  init_atoms2();
38023
37418
  init_useEventBus();
38024
- init_useTranslate();
38025
37419
  DebuggerBoard.displayName = "DebuggerBoard";
38026
37420
  }
38027
37421
  });
@@ -38192,7 +37586,6 @@ var init_DetailPanel = __esm({
38192
37586
  init_cn();
38193
37587
  init_getNestedValue();
38194
37588
  init_useEventBus();
38195
- init_useTranslate();
38196
37589
  ReactMarkdown2 = React79.lazy(() => import('react-markdown'));
38197
37590
  exports.DetailPanel = ({
38198
37591
  title: propTitle,
@@ -38212,7 +37605,7 @@ var init_DetailPanel = __esm({
38212
37605
  error
38213
37606
  }) => {
38214
37607
  const eventBus = useEventBus();
38215
- const { t } = useTranslate();
37608
+ const { t } = hooks.useTranslate();
38216
37609
  const isFieldDefArray = (arr) => {
38217
37610
  if (!arr || arr.length === 0) return false;
38218
37611
  const first = arr[0];
@@ -38705,7 +38098,7 @@ function CompactView({
38705
38098
  stateStyles,
38706
38099
  className
38707
38100
  }) {
38708
- const { t } = useTranslate();
38101
+ const { t } = hooks.useTranslate();
38709
38102
  const config = SIZE_CONFIG2[size || "md"];
38710
38103
  const currentTransitions = trait.transitions.filter((t2) => t2.from === trait.currentState);
38711
38104
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-container bg-card border border-border", className), gap: "sm", children: [
@@ -38741,7 +38134,7 @@ function FullView({
38741
38134
  stateStyles,
38742
38135
  className
38743
38136
  }) {
38744
- const { t } = useTranslate();
38137
+ const { t } = hooks.useTranslate();
38745
38138
  const config = SIZE_CONFIG2[size || "md"];
38746
38139
  const currentTransitions = trait.transitions.filter((t2) => t2.from === trait.currentState);
38747
38140
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-container bg-card border border-border", className), gap: "sm", children: [
@@ -38866,7 +38259,6 @@ var init_TraitStateViewer = __esm({
38866
38259
  "components/game/organisms/TraitStateViewer.tsx"() {
38867
38260
  "use client";
38868
38261
  init_cn();
38869
- init_useTranslate();
38870
38262
  init_Box();
38871
38263
  init_Typography();
38872
38264
  init_Stack();
@@ -38888,7 +38280,7 @@ function RuleEditor({
38888
38280
  disabled = false,
38889
38281
  className
38890
38282
  }) {
38891
- const { t } = useTranslate();
38283
+ const { t } = hooks.useTranslate();
38892
38284
  const handleWhenChange = React79.useCallback((e) => {
38893
38285
  onChange({ ...rule, whenEvent: e.target.value });
38894
38286
  }, [rule, onChange]);
@@ -38925,7 +38317,6 @@ var init_RuleEditor = __esm({
38925
38317
  "components/game/organisms/puzzles/event-handler/RuleEditor.tsx"() {
38926
38318
  init_atoms2();
38927
38319
  init_cn();
38928
- init_useTranslate();
38929
38320
  RuleEditor.displayName = "RuleEditor";
38930
38321
  }
38931
38322
  });
@@ -38935,7 +38326,7 @@ function ObjectRulePanel({
38935
38326
  disabled = false,
38936
38327
  className
38937
38328
  }) {
38938
- const { t } = useTranslate();
38329
+ const { t } = hooks.useTranslate();
38939
38330
  const maxRules = object.maxRules || 3;
38940
38331
  const canAdd = object.rules.length < maxRules;
38941
38332
  const handleRuleChange = React79.useCallback((index, updatedRule) => {
@@ -39000,7 +38391,6 @@ var init_ObjectRulePanel = __esm({
39000
38391
  "components/game/organisms/puzzles/event-handler/ObjectRulePanel.tsx"() {
39001
38392
  init_atoms2();
39002
38393
  init_cn();
39003
- init_useTranslate();
39004
38394
  init_TraitStateViewer();
39005
38395
  init_RuleEditor();
39006
38396
  nextRuleId = 1;
@@ -39013,7 +38403,7 @@ function EventLog({
39013
38403
  label,
39014
38404
  className
39015
38405
  }) {
39016
- const { t } = useTranslate();
38406
+ const { t } = hooks.useTranslate();
39017
38407
  const scrollRef = React79.useRef(null);
39018
38408
  React79.useEffect(() => {
39019
38409
  if (scrollRef.current) {
@@ -39045,7 +38435,6 @@ var init_EventLog = __esm({
39045
38435
  "components/game/organisms/puzzles/event-handler/EventLog.tsx"() {
39046
38436
  init_atoms2();
39047
38437
  init_cn();
39048
- init_useTranslate();
39049
38438
  STATUS_STYLES = {
39050
38439
  pending: "text-muted-foreground",
39051
38440
  active: "text-primary animate-pulse",
@@ -39069,7 +38458,7 @@ function EventHandlerBoard({
39069
38458
  className
39070
38459
  }) {
39071
38460
  const { emit } = useEventBus();
39072
- const { t } = useTranslate();
38461
+ const { t } = hooks.useTranslate();
39073
38462
  const resolved = Array.isArray(entity) ? entity[0] : entity;
39074
38463
  const entityObjects = resolved?.objects ?? [];
39075
38464
  const [objects, setObjects] = React79.useState(entityObjects);
@@ -39259,7 +38648,6 @@ var init_EventHandlerBoard = __esm({
39259
38648
  init_atoms2();
39260
38649
  init_cn();
39261
38650
  init_useEventBus();
39262
- init_useTranslate();
39263
38651
  init_TraitStateViewer();
39264
38652
  init_ObjectRulePanel();
39265
38653
  init_EventLog();
@@ -39329,7 +38717,6 @@ var init_FeatureGridOrganism = __esm({
39329
38717
  "use client";
39330
38718
  init_cn();
39331
38719
  init_useEventBus();
39332
- init_useTranslate();
39333
38720
  init_Stack();
39334
38721
  init_Typography();
39335
38722
  init_FeatureGrid();
@@ -39345,7 +38732,7 @@ var init_FeatureGridOrganism = __esm({
39345
38732
  subtitle
39346
38733
  }) => {
39347
38734
  const eventBus = useEventBus();
39348
- const { t } = useTranslate();
38735
+ const { t } = hooks.useTranslate();
39349
38736
  const items = React79.useMemo(
39350
38737
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
39351
38738
  [entity]
@@ -39512,7 +38899,6 @@ var init_Form = __esm({
39512
38899
  init_RelationSelect();
39513
38900
  init_Alert();
39514
38901
  init_useEventBus();
39515
- init_useTranslate();
39516
38902
  init_debug();
39517
38903
  layoutStyles = {
39518
38904
  vertical: "flex flex-col",
@@ -39563,7 +38949,7 @@ var init_Form = __esm({
39563
38949
  ...props
39564
38950
  }) => {
39565
38951
  const eventBus = useEventBus();
39566
- const { t } = useTranslate();
38952
+ const { t } = hooks.useTranslate();
39567
38953
  const resolvedSubmitLabel = submitLabel ?? t("common.save");
39568
38954
  const resolvedCancelLabel = cancelLabel ?? t("common.cancel");
39569
38955
  const isSchemaEntity = isOrbitalEntitySchema(entity);
@@ -40679,7 +40065,6 @@ var init_HeroOrganism = __esm({
40679
40065
  "use client";
40680
40066
  init_cn();
40681
40067
  init_useEventBus();
40682
- init_useTranslate();
40683
40068
  init_HeroSection();
40684
40069
  init_LoadingState();
40685
40070
  init_ErrorState();
@@ -40691,7 +40076,7 @@ var init_HeroOrganism = __esm({
40691
40076
  children
40692
40077
  }) => {
40693
40078
  const eventBus = useEventBus();
40694
- const { t } = useTranslate();
40079
+ const { t } = hooks.useTranslate();
40695
40080
  const resolved = React79.useMemo(
40696
40081
  () => Array.isArray(entity) ? entity[0] : entity && typeof entity === "object" ? entity : void 0,
40697
40082
  [entity]
@@ -40785,7 +40170,6 @@ exports.LandingPageTemplate = void 0;
40785
40170
  var init_LandingPageTemplate = __esm({
40786
40171
  "components/marketing/templates/LandingPageTemplate.tsx"() {
40787
40172
  init_cn();
40788
- init_useTranslate();
40789
40173
  init_Stack();
40790
40174
  init_Box();
40791
40175
  init_Container();
@@ -40803,7 +40187,7 @@ var init_LandingPageTemplate = __esm({
40803
40187
  featureColumns = 3,
40804
40188
  className
40805
40189
  }) => {
40806
- const { t } = useTranslate();
40190
+ const { t } = hooks.useTranslate();
40807
40191
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
40808
40192
  if (!resolved) return null;
40809
40193
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: cn("w-full", className), children: [
@@ -40985,7 +40369,6 @@ var init_List = __esm({
40985
40369
  init_cn();
40986
40370
  init_getNestedValue();
40987
40371
  init_useEventBus();
40988
- init_useTranslate();
40989
40372
  init_types3();
40990
40373
  STATUS_STYLES2 = {
40991
40374
  complete: {
@@ -41110,7 +40493,7 @@ var init_List = __esm({
41110
40493
  entityType
41111
40494
  }) => {
41112
40495
  const eventBus = useEventBus();
41113
- const { t } = useTranslate();
40496
+ const { t } = hooks.useTranslate();
41114
40497
  const resolvedEmptyMessage = emptyMessage ?? t("empty.noData");
41115
40498
  const effectiveFieldNames = normalizeFields2(fields).length > 0 ? normalizeFields2(fields) : fieldNames;
41116
40499
  const rawItems = React79.useMemo(() => {
@@ -41457,7 +40840,7 @@ function MasterDetail({
41457
40840
  className,
41458
40841
  ...rest
41459
40842
  }) {
41460
- const { t } = useTranslate();
40843
+ const { t } = hooks.useTranslate();
41461
40844
  const loading = externalLoading ?? false;
41462
40845
  const isLoading = externalIsLoading ?? false;
41463
40846
  const error = externalError ?? null;
@@ -41480,7 +40863,6 @@ var init_MasterDetail = __esm({
41480
40863
  "components/core/organisms/MasterDetail.tsx"() {
41481
40864
  "use client";
41482
40865
  init_DataTable();
41483
- init_useTranslate();
41484
40866
  MasterDetail.displayName = "MasterDetail";
41485
40867
  }
41486
40868
  });
@@ -41489,9 +40871,8 @@ var init_MasterDetailLayout = __esm({
41489
40871
  "components/core/organisms/layout/MasterDetailLayout.tsx"() {
41490
40872
  init_cn();
41491
40873
  init_Typography();
41492
- init_useTranslate();
41493
40874
  DefaultEmptyDetail = () => {
41494
- const { t } = useTranslate();
40875
+ const { t } = hooks.useTranslate();
41495
40876
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full border-2 border-dashed border-border", children: /* @__PURE__ */ jsxRuntime.jsx(
41496
40877
  exports.Typography,
41497
40878
  {
@@ -41550,7 +40931,6 @@ var init_MediaGallery = __esm({
41550
40931
  init_ErrorState();
41551
40932
  init_EmptyState();
41552
40933
  init_useEventBus();
41553
- init_useTranslate();
41554
40934
  COLUMN_CLASSES = {
41555
40935
  2: "grid-cols-2",
41556
40936
  3: "grid-cols-2 sm:grid-cols-3",
@@ -41579,7 +40959,7 @@ var init_MediaGallery = __esm({
41579
40959
  className
41580
40960
  }) => {
41581
40961
  const eventBus = useEventBus();
41582
- const { t } = useTranslate();
40962
+ const { t } = hooks.useTranslate();
41583
40963
  const [lightboxItem, setLightboxItem] = React79.useState(null);
41584
40964
  const closeLightbox = React79.useCallback(() => setLightboxItem(null), []);
41585
40965
  useEventListener("UI:LIGHTBOX_CLOSE", closeLightbox);
@@ -41914,7 +41294,7 @@ function NegotiatorBoard({
41914
41294
  className
41915
41295
  }) {
41916
41296
  const { emit } = useEventBus();
41917
- const { t } = useTranslate();
41297
+ const { t } = hooks.useTranslate();
41918
41298
  const resolved = Array.isArray(entity) ? entity[0] : entity;
41919
41299
  const [history, setHistory] = React79.useState([]);
41920
41300
  const [headerError, setHeaderError] = React79.useState(false);
@@ -42044,7 +41424,6 @@ var init_NegotiatorBoard = __esm({
42044
41424
  "components/game/organisms/puzzles/negotiator/NegotiatorBoard.tsx"() {
42045
41425
  init_atoms2();
42046
41426
  init_useEventBus();
42047
- init_useTranslate();
42048
41427
  NegotiatorBoard.displayName = "NegotiatorBoard";
42049
41428
  }
42050
41429
  });
@@ -42054,7 +41433,6 @@ var init_PricingOrganism = __esm({
42054
41433
  "use client";
42055
41434
  init_cn();
42056
41435
  init_useEventBus();
42057
- init_useTranslate();
42058
41436
  init_Stack();
42059
41437
  init_Typography();
42060
41438
  init_PricingGrid();
@@ -42069,7 +41447,7 @@ var init_PricingOrganism = __esm({
42069
41447
  subtitle
42070
41448
  }) => {
42071
41449
  useEventBus();
42072
- const { t } = useTranslate();
41450
+ const { t } = hooks.useTranslate();
42073
41451
  const items = React79.useMemo(
42074
41452
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
42075
41453
  [entity]
@@ -42104,7 +41482,6 @@ exports.PricingPageTemplate = void 0;
42104
41482
  var init_PricingPageTemplate = __esm({
42105
41483
  "components/marketing/templates/PricingPageTemplate.tsx"() {
42106
41484
  init_cn();
42107
- init_useTranslate();
42108
41485
  init_Stack();
42109
41486
  init_Box();
42110
41487
  init_Container();
@@ -42117,7 +41494,7 @@ var init_PricingPageTemplate = __esm({
42117
41494
  entity,
42118
41495
  className
42119
41496
  }) => {
42120
- const { t } = useTranslate();
41497
+ const { t } = hooks.useTranslate();
42121
41498
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
42122
41499
  if (!resolved) return null;
42123
41500
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: cn("w-full", className), children: [
@@ -42271,13 +41648,13 @@ function getEntitySnapshot() {
42271
41648
  if (!entityProvider) {
42272
41649
  return null;
42273
41650
  }
42274
- const entities2 = entityProvider();
41651
+ const entities = entityProvider();
42275
41652
  return {
42276
- entities: entities2,
41653
+ entities,
42277
41654
  timestamp: Date.now(),
42278
- totalCount: entities2.length,
41655
+ totalCount: entities.length,
42279
41656
  singletons: {},
42280
- runtime: entities2.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
41657
+ runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
42281
41658
  persistent: {}
42282
41659
  };
42283
41660
  }
@@ -42645,7 +42022,7 @@ var init_WalkMinimap = __esm({
42645
42022
  }
42646
42023
  });
42647
42024
  function TraitsTab({ traits: traits2 }) {
42648
- const { t } = useTranslate();
42025
+ const { t } = hooks.useTranslate();
42649
42026
  if (traits2.length === 0) {
42650
42027
  return /* @__PURE__ */ jsxRuntime.jsx(
42651
42028
  exports.EmptyState,
@@ -42713,12 +42090,11 @@ var init_TraitsTab = __esm({
42713
42090
  init_Typography();
42714
42091
  init_Stack();
42715
42092
  init_EmptyState();
42716
- init_useTranslate();
42717
42093
  TraitsTab.displayName = "TraitsTab";
42718
42094
  }
42719
42095
  });
42720
42096
  function TicksTab({ ticks: ticks2 }) {
42721
- const { t } = useTranslate();
42097
+ const { t } = hooks.useTranslate();
42722
42098
  const activeTicks = ticks2.filter((t2) => t2.active);
42723
42099
  const inactiveTicks = ticks2.filter((t2) => !t2.active);
42724
42100
  if (ticks2.length === 0) {
@@ -42791,12 +42167,11 @@ var init_TicksTab = __esm({
42791
42167
  init_Stack();
42792
42168
  init_Card();
42793
42169
  init_EmptyState();
42794
- init_useTranslate();
42795
42170
  TicksTab.displayName = "TicksTab";
42796
42171
  }
42797
42172
  });
42798
42173
  function EntitiesTab({ snapshot }) {
42799
- const { t } = useTranslate();
42174
+ const { t } = hooks.useTranslate();
42800
42175
  if (!snapshot) {
42801
42176
  return /* @__PURE__ */ jsxRuntime.jsx(
42802
42177
  exports.EmptyState,
@@ -42865,12 +42240,11 @@ var init_EntitiesTab = __esm({
42865
42240
  init_Typography();
42866
42241
  init_Stack();
42867
42242
  init_EmptyState();
42868
- init_useTranslate();
42869
42243
  EntitiesTab.displayName = "EntitiesTab";
42870
42244
  }
42871
42245
  });
42872
42246
  function EventFlowTab({ events: events2 }) {
42873
- const { t } = useTranslate();
42247
+ const { t } = hooks.useTranslate();
42874
42248
  const [filter, setFilter] = React79__namespace.useState("all");
42875
42249
  const containerRef = React79__namespace.useRef(null);
42876
42250
  const [autoScroll, setAutoScroll] = React79__namespace.useState(true);
@@ -42982,7 +42356,6 @@ var init_EventFlowTab = __esm({
42982
42356
  init_Button();
42983
42357
  init_Checkbox();
42984
42358
  init_EmptyState();
42985
- init_useTranslate();
42986
42359
  TYPE_BADGES = {
42987
42360
  trait: { variant: "primary", icon: "\u{1F504}" },
42988
42361
  tick: { variant: "warning", icon: "\u23F1\uFE0F" },
@@ -42995,7 +42368,7 @@ var init_EventFlowTab = __esm({
42995
42368
  }
42996
42369
  });
42997
42370
  function GuardsPanel({ guards }) {
42998
- const { t } = useTranslate();
42371
+ const { t } = hooks.useTranslate();
42999
42372
  const [filter, setFilter] = React79__namespace.useState("all");
43000
42373
  if (guards.length === 0) {
43001
42374
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -43077,12 +42450,11 @@ var init_GuardsPanel = __esm({
43077
42450
  init_ButtonGroup();
43078
42451
  init_Button();
43079
42452
  init_EmptyState();
43080
- init_useTranslate();
43081
42453
  GuardsPanel.displayName = "GuardsPanel";
43082
42454
  }
43083
42455
  });
43084
42456
  function VerificationTab({ checks, summary }) {
43085
- const { t } = useTranslate();
42457
+ const { t } = hooks.useTranslate();
43086
42458
  if (checks.length === 0) {
43087
42459
  return /* @__PURE__ */ jsxRuntime.jsx(
43088
42460
  exports.EmptyState,
@@ -43153,7 +42525,6 @@ var init_VerificationTab = __esm({
43153
42525
  init_Typography();
43154
42526
  init_Stack();
43155
42527
  init_EmptyState();
43156
- init_useTranslate();
43157
42528
  STATUS_CONFIG = {
43158
42529
  pass: { variant: "success", icon: "\u2713", label: "PASS" },
43159
42530
  fail: { variant: "danger", icon: "\u2717", label: "FAIL" },
@@ -43173,7 +42544,7 @@ function EffectBadge({ effect }) {
43173
42544
  ] });
43174
42545
  }
43175
42546
  function TransitionTimeline({ transitions }) {
43176
- const { t } = useTranslate();
42547
+ const { t } = hooks.useTranslate();
43177
42548
  const containerRef = React79__namespace.useRef(null);
43178
42549
  const [autoScroll, setAutoScroll] = React79__namespace.useState(true);
43179
42550
  const [expandedId, setExpandedId] = React79__namespace.useState(null);
@@ -43289,7 +42660,6 @@ var init_TransitionTimeline = __esm({
43289
42660
  init_Typography();
43290
42661
  init_EmptyState();
43291
42662
  init_Checkbox();
43292
- init_useTranslate();
43293
42663
  EFFECT_STATUS_VARIANT = {
43294
42664
  executed: "success",
43295
42665
  failed: "danger",
@@ -43305,7 +42675,7 @@ function StatRow({ label, value, variant }) {
43305
42675
  ] });
43306
42676
  }
43307
42677
  function ServerBridgeTab({ bridge }) {
43308
- const { t } = useTranslate();
42678
+ const { t } = hooks.useTranslate();
43309
42679
  if (!bridge) {
43310
42680
  return /* @__PURE__ */ jsxRuntime.jsx(
43311
42681
  exports.EmptyState,
@@ -43379,7 +42749,6 @@ var init_ServerBridgeTab = __esm({
43379
42749
  init_Stack();
43380
42750
  init_Card();
43381
42751
  init_EmptyState();
43382
- init_useTranslate();
43383
42752
  ServerBridgeTab.displayName = "ServerBridgeTab";
43384
42753
  }
43385
42754
  });
@@ -43458,8 +42827,8 @@ function getAllEvents(traits2) {
43458
42827
  }
43459
42828
  function EventDispatcherTab({ traits: traits2, schema }) {
43460
42829
  const eventBus = useEventBus();
43461
- const { t } = useTranslate();
43462
- const [log18, setLog] = React79__namespace.useState([]);
42830
+ const { t } = hooks.useTranslate();
42831
+ const [log8, setLog] = React79__namespace.useState([]);
43463
42832
  const prevStatesRef = React79__namespace.useRef(/* @__PURE__ */ new Map());
43464
42833
  React79__namespace.useEffect(() => {
43465
42834
  for (const trait of traits2) {
@@ -43523,9 +42892,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
43523
42892
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
43524
42893
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
43525
42894
  ] }),
43526
- log18.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
42895
+ log8.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
43527
42896
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
43528
- /* @__PURE__ */ jsxRuntime.jsx(exports.Stack, { gap: "xs", children: log18.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(exports.Typography, { variant: "small", className: "font-mono text-xs", children: [
42897
+ /* @__PURE__ */ jsxRuntime.jsx(exports.Stack, { gap: "xs", children: log8.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(exports.Typography, { variant: "small", className: "font-mono text-xs", children: [
43529
42898
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
43530
42899
  " ",
43531
42900
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
@@ -43544,7 +42913,6 @@ var init_EventDispatcherTab = __esm({
43544
42913
  init_Stack();
43545
42914
  init_EmptyState();
43546
42915
  init_useEventBus();
43547
- init_useTranslate();
43548
42916
  EventDispatcherTab.displayName = "EventDispatcherTab";
43549
42917
  }
43550
42918
  });
@@ -43555,7 +42923,7 @@ var init_RuntimeDebugger = __esm({
43555
42923
  }
43556
42924
  });
43557
42925
  function ServerResponseRow({ sr }) {
43558
- const { t } = useTranslate();
42926
+ const { t } = hooks.useTranslate();
43559
42927
  const entityEntries = Object.entries(sr.dataEntities);
43560
42928
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-xs font-mono", children: [
43561
42929
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -43581,7 +42949,7 @@ function ServerResponseRow({ sr }) {
43581
42949
  ] });
43582
42950
  }
43583
42951
  function TransitionRow({ trace }) {
43584
- const { t } = useTranslate();
42952
+ const { t } = hooks.useTranslate();
43585
42953
  const isServerEntry = !!trace.serverResponse && trace.traitName.startsWith("server:");
43586
42954
  const hasFailedEffects = trace.effects.some((e) => e.status === "failed");
43587
42955
  if (isServerEntry && trace.serverResponse) {
@@ -43630,7 +42998,7 @@ function VerifyModePanel({
43630
42998
  serverCount,
43631
42999
  localCount
43632
43000
  }) {
43633
- const { t } = useTranslate();
43001
+ const { t } = hooks.useTranslate();
43634
43002
  const [expanded, setExpanded] = React79__namespace.useState(true);
43635
43003
  const scrollRef = React79__namespace.useRef(null);
43636
43004
  const prevCountRef = React79__namespace.useRef(0);
@@ -43690,7 +43058,7 @@ function RuntimeDebugger({
43690
43058
  defaultTab,
43691
43059
  schema
43692
43060
  }) {
43693
- const { t } = useTranslate();
43061
+ const { t } = hooks.useTranslate();
43694
43062
  const [isCollapsed, setIsCollapsed] = React79__namespace.useState(mode === "verify" ? true : defaultCollapsed);
43695
43063
  const [isVisible, setIsVisible] = React79__namespace.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43696
43064
  const debugData = useDebugData();
@@ -43919,7 +43287,6 @@ var init_RuntimeDebugger2 = __esm({
43919
43287
  init_TransitionTimeline();
43920
43288
  init_ServerBridgeTab();
43921
43289
  init_EventDispatcherTab();
43922
- init_useTranslate();
43923
43290
  init_RuntimeDebugger();
43924
43291
  RuntimeDebugger.displayName = "RuntimeDebugger";
43925
43292
  }
@@ -44213,7 +43580,7 @@ function SequencerBoard({
44213
43580
  className
44214
43581
  }) {
44215
43582
  const { emit } = useEventBus();
44216
- const { t } = useTranslate();
43583
+ const { t } = hooks.useTranslate();
44217
43584
  const resolved = Array.isArray(entity) ? entity[0] : entity;
44218
43585
  const [headerError, setHeaderError] = React79.useState(false);
44219
43586
  const [slots, setSlots] = React79.useState(
@@ -44406,7 +43773,6 @@ var init_SequencerBoard = __esm({
44406
43773
  init_atoms2();
44407
43774
  init_cn();
44408
43775
  init_useEventBus();
44409
- init_useTranslate();
44410
43776
  init_TraitStateViewer();
44411
43777
  init_SequenceBar();
44412
43778
  init_ActionPalette();
@@ -44425,7 +43791,6 @@ var init_ShowcaseOrganism = __esm({
44425
43791
  "use client";
44426
43792
  init_cn();
44427
43793
  init_useEventBus();
44428
- init_useTranslate();
44429
43794
  init_Stack();
44430
43795
  init_Typography();
44431
43796
  init_SimpleGrid();
@@ -44442,7 +43807,7 @@ var init_ShowcaseOrganism = __esm({
44442
43807
  subtitle
44443
43808
  }) => {
44444
43809
  useEventBus();
44445
- const { t } = useTranslate();
43810
+ const { t } = hooks.useTranslate();
44446
43811
  const items = React79.useMemo(
44447
43812
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
44448
43813
  [entity]
@@ -44836,7 +44201,7 @@ function SimulatorBoard({
44836
44201
  className
44837
44202
  }) {
44838
44203
  const { emit } = useEventBus();
44839
- const { t } = useTranslate();
44204
+ const { t } = hooks.useTranslate();
44840
44205
  const resolved = Array.isArray(entity) ? entity[0] : entity;
44841
44206
  const parameters = resolved?.parameters ?? [];
44842
44207
  const [values, setValues] = React79.useState(() => {
@@ -44984,7 +44349,6 @@ var init_SimulatorBoard = __esm({
44984
44349
  "components/game/organisms/puzzles/simulator/SimulatorBoard.tsx"() {
44985
44350
  init_atoms2();
44986
44351
  init_useEventBus();
44987
- init_useTranslate();
44988
44352
  SimulatorBoard.displayName = "SimulatorBoard";
44989
44353
  }
44990
44354
  });
@@ -45200,7 +44564,6 @@ var init_StatCard = __esm({
45200
44564
  init_Button();
45201
44565
  init_Sparkline();
45202
44566
  init_useEventBus();
45203
- init_useTranslate();
45204
44567
  init_Icon();
45205
44568
  exports.StatCard = ({
45206
44569
  label: propLabel,
@@ -45227,7 +44590,7 @@ var init_StatCard = __esm({
45227
44590
  const Icon3 = typeof iconProp === "string" ? resolveIcon(iconProp) ?? void 0 : iconProp;
45228
44591
  const labelToUse = propLabel ?? propTitle;
45229
44592
  const eventBus = useEventBus();
45230
- const { t } = useTranslate();
44593
+ const { t } = hooks.useTranslate();
45231
44594
  const handleActionClick = React79__namespace.default.useCallback(() => {
45232
44595
  if (action?.event) {
45233
44596
  eventBus.emit(`UI:${action.event}`, {});
@@ -45518,7 +44881,7 @@ function VariablePanel({
45518
44881
  variables,
45519
44882
  className
45520
44883
  }) {
45521
- const { t } = useTranslate();
44884
+ const { t } = hooks.useTranslate();
45522
44885
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
45523
44886
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
45524
44887
  variables.map((v) => {
@@ -45556,7 +44919,6 @@ var init_VariablePanel = __esm({
45556
44919
  "components/game/organisms/puzzles/state-architect/VariablePanel.tsx"() {
45557
44920
  init_atoms2();
45558
44921
  init_cn();
45559
- init_useTranslate();
45560
44922
  VariablePanel.displayName = "VariablePanel";
45561
44923
  }
45562
44924
  });
@@ -45582,7 +44944,7 @@ function StateArchitectBoard({
45582
44944
  className
45583
44945
  }) {
45584
44946
  const { emit } = useEventBus();
45585
- const { t } = useTranslate();
44947
+ const { t } = hooks.useTranslate();
45586
44948
  const resolved = Array.isArray(entity) ? entity[0] : entity;
45587
44949
  const [transitions, setTransitions] = React79.useState(resolved?.transitions ?? []);
45588
44950
  const [headerError, setHeaderError] = React79.useState(false);
@@ -45873,7 +45235,6 @@ var init_StateArchitectBoard = __esm({
45873
45235
  init_atoms2();
45874
45236
  init_cn();
45875
45237
  init_useEventBus();
45876
- init_useTranslate();
45877
45238
  init_TraitStateViewer();
45878
45239
  init_StateNode();
45879
45240
  init_TransitionArrow();
@@ -45893,7 +45254,6 @@ var init_StatsOrganism = __esm({
45893
45254
  "components/marketing/organisms/StatsOrganism.tsx"() {
45894
45255
  "use client";
45895
45256
  init_cn();
45896
- init_useTranslate();
45897
45257
  init_StatsGrid();
45898
45258
  init_LoadingState();
45899
45259
  init_ErrorState();
@@ -45904,7 +45264,7 @@ var init_StatsOrganism = __esm({
45904
45264
  className,
45905
45265
  columns = 3
45906
45266
  }) => {
45907
- const { t } = useTranslate();
45267
+ const { t } = hooks.useTranslate();
45908
45268
  const items = React79.useMemo(
45909
45269
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
45910
45270
  [entity]
@@ -46007,7 +45367,6 @@ var init_StepFlowOrganism = __esm({
46007
45367
  "components/core/organisms/StepFlowOrganism.tsx"() {
46008
45368
  "use client";
46009
45369
  init_cn();
46010
- init_useTranslate();
46011
45370
  init_Stack();
46012
45371
  init_Typography();
46013
45372
  init_StepFlow();
@@ -46023,7 +45382,7 @@ var init_StepFlowOrganism = __esm({
46023
45382
  heading,
46024
45383
  subtitle
46025
45384
  }) => {
46026
- const { t } = useTranslate();
45385
+ const { t } = hooks.useTranslate();
46027
45386
  const items = React79.useMemo(
46028
45387
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
46029
45388
  [entity]
@@ -46177,7 +45536,6 @@ var init_TeamOrganism = __esm({
46177
45536
  "components/marketing/organisms/TeamOrganism.tsx"() {
46178
45537
  "use client";
46179
45538
  init_cn();
46180
- init_useTranslate();
46181
45539
  init_Stack();
46182
45540
  init_Typography();
46183
45541
  init_SimpleGrid();
@@ -46192,7 +45550,7 @@ var init_TeamOrganism = __esm({
46192
45550
  heading,
46193
45551
  subtitle
46194
45552
  }) => {
46195
- const { t } = useTranslate();
45553
+ const { t } = hooks.useTranslate();
46196
45554
  const items = React79.useMemo(
46197
45555
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
46198
45556
  [entity]
@@ -46235,7 +45593,6 @@ var init_Timeline = __esm({
46235
45593
  init_LoadingState();
46236
45594
  init_ErrorState();
46237
45595
  init_EmptyState();
46238
- init_useTranslate();
46239
45596
  lookStyles10 = {
46240
45597
  "vertical-compact": "gap-1 [&>*]:py-1",
46241
45598
  "vertical-spacious": "",
@@ -46275,7 +45632,7 @@ var init_Timeline = __esm({
46275
45632
  className,
46276
45633
  look = "vertical-spacious"
46277
45634
  }) => {
46278
- const { t } = useTranslate();
45635
+ const { t } = hooks.useTranslate();
46279
45636
  const entityData = Array.isArray(entity) ? entity : [];
46280
45637
  const items = React79__namespace.default.useMemo(() => {
46281
45638
  if (propItems) return propItems;
@@ -47845,7 +47202,7 @@ function UISlotComponent({
47845
47202
  }) {
47846
47203
  const { slots, clear } = context.useUISlots();
47847
47204
  const eventBus = useEventBus();
47848
- const { t } = useTranslate();
47205
+ const { t } = hooks.useTranslate();
47849
47206
  const suspenseConfig = React79.useContext(SuspenseConfigContext);
47850
47207
  const contained = React79.useContext(SlotContainedContext);
47851
47208
  const content = slots[slot];
@@ -47947,7 +47304,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
47947
47304
  const [portalRoot, setPortalRoot] = React79.useState(null);
47948
47305
  const slotsBus = context.useUISlots();
47949
47306
  const eventBus = useEventBus();
47950
- const { t } = useTranslate();
47307
+ const { t } = hooks.useTranslate();
47951
47308
  React79.useEffect(() => {
47952
47309
  setPortalRoot(getOrCreatePortalRoot());
47953
47310
  }, []);
@@ -48237,7 +47594,7 @@ function SlotContentRenderer({
48237
47594
  }
48238
47595
  }
48239
47596
  const eventBus = useEventBus();
48240
- const { t } = useTranslate();
47597
+ const { t } = hooks.useTranslate();
48241
47598
  const schemaCtx = useEntitySchemaOptional();
48242
47599
  let entityDef;
48243
47600
  if (typeof entityProp === "string" && entityProp.length > 0 && schemaCtx) {
@@ -48425,7 +47782,6 @@ var init_UISlotRenderer = __esm({
48425
47782
  init_Box();
48426
47783
  init_Typography();
48427
47784
  init_useEventBus();
48428
- init_useTranslate();
48429
47785
  init_slot_types();
48430
47786
  init_cn();
48431
47787
  init_ErrorBoundary();
@@ -49771,1625 +49127,7 @@ init_AboutPageTemplate();
49771
49127
 
49772
49128
  // components/index.ts
49773
49129
  init_cn();
49774
- var log8 = logger.createLogger("almadar:ui:orbital-history");
49775
- function useOrbitalHistory(options) {
49776
- const { appId, authToken, userId, onHistoryChange, onRevertSuccess } = options;
49777
- const getHeaders = React79.useCallback(() => {
49778
- const headers = {
49779
- "Content-Type": "application/json"
49780
- };
49781
- if (authToken) {
49782
- headers["Authorization"] = `Bearer ${authToken}`;
49783
- }
49784
- if (userId) {
49785
- headers["x-user-id"] = userId;
49786
- }
49787
- return headers;
49788
- }, [authToken, userId]);
49789
- const [timeline, setTimeline] = React79.useState([]);
49790
- const [currentVersion, setCurrentVersion] = React79.useState(1);
49791
- const [isLoading, setIsLoading] = React79.useState(false);
49792
- const [error, setError] = React79.useState(null);
49793
- const refresh = React79.useCallback(async () => {
49794
- if (!appId) return;
49795
- setIsLoading(true);
49796
- setError(null);
49797
- try {
49798
- const headers = getHeaders();
49799
- const [changesetsRes, snapshotsRes] = await Promise.all([
49800
- fetch(`/api/graphs/${appId}/history/changesets`, { headers }),
49801
- fetch(`/api/graphs/${appId}/history/snapshots`, { headers })
49802
- ]);
49803
- if (!changesetsRes.ok) {
49804
- throw new Error(`Failed to fetch changesets: ${changesetsRes.status}`);
49805
- }
49806
- if (!snapshotsRes.ok) {
49807
- throw new Error(`Failed to fetch snapshots: ${snapshotsRes.status}`);
49808
- }
49809
- const changesetsData = await changesetsRes.json();
49810
- const snapshotsData = await snapshotsRes.json();
49811
- const changesetItems = (changesetsData.changesets || []).map((cs) => ({
49812
- id: cs.id,
49813
- type: "changeset",
49814
- version: cs.version,
49815
- timestamp: cs.timestamp,
49816
- description: `Version ${cs.version}`,
49817
- source: cs.source,
49818
- summary: cs.summary
49819
- }));
49820
- const snapshotItems = (snapshotsData.snapshots || []).map((snap) => ({
49821
- id: snap.id,
49822
- type: "snapshot",
49823
- version: snap.version,
49824
- timestamp: snap.timestamp,
49825
- description: snap.reason || `Snapshot v${snap.version}`,
49826
- reason: snap.reason
49827
- }));
49828
- const mergedTimeline = [...changesetItems, ...snapshotItems].sort(
49829
- (a, b) => b.timestamp - a.timestamp
49830
- );
49831
- setTimeline(mergedTimeline);
49832
- if (mergedTimeline.length > 0) {
49833
- setCurrentVersion(mergedTimeline[0].version);
49834
- }
49835
- } catch (err) {
49836
- log8.error("Failed to load history", { error: err instanceof Error ? err : String(err) });
49837
- setError(err instanceof Error ? err.message : "Failed to load history");
49838
- } finally {
49839
- setIsLoading(false);
49840
- }
49841
- }, [appId, getHeaders]);
49842
- const revertToSnapshot = React79.useCallback(async (snapshotId) => {
49843
- if (!appId) {
49844
- return { success: false, error: "No app ID provided" };
49845
- }
49846
- try {
49847
- const response = await fetch(`/api/graphs/${appId}/history/revert/${snapshotId}`, {
49848
- method: "POST",
49849
- headers: getHeaders()
49850
- });
49851
- if (!response.ok) {
49852
- const errorData = await response.json().catch(() => ({}));
49853
- throw new Error(errorData.error || `Failed to revert: ${response.status}`);
49854
- }
49855
- const data = await response.json();
49856
- if (data.success && data.schema) {
49857
- await refresh();
49858
- onRevertSuccess?.(data.schema);
49859
- return {
49860
- success: true,
49861
- restoredSchema: data.schema
49862
- };
49863
- }
49864
- return {
49865
- success: false,
49866
- error: data.error || "Unknown error during revert"
49867
- };
49868
- } catch (err) {
49869
- log8.error("Failed to revert", { error: err instanceof Error ? err : String(err) });
49870
- return {
49871
- success: false,
49872
- error: err instanceof Error ? err.message : "Failed to revert"
49873
- };
49874
- }
49875
- }, [appId, getHeaders, refresh, onRevertSuccess]);
49876
- React79.useEffect(() => {
49877
- if (appId && authToken && userId) {
49878
- refresh();
49879
- }
49880
- }, [appId, authToken, userId]);
49881
- React79.useEffect(() => {
49882
- onHistoryChange?.(timeline);
49883
- }, [timeline]);
49884
- return {
49885
- timeline,
49886
- currentVersion,
49887
- isLoading,
49888
- error,
49889
- revertToSnapshot,
49890
- refresh
49891
- };
49892
- }
49893
- var log9 = logger.createLogger("almadar:ui:filesystem");
49894
- function useFileSystem() {
49895
- const [status, setStatus] = React79.useState("idle");
49896
- const [error, setError] = React79.useState(null);
49897
- const [isLoading, setIsLoading] = React79.useState(false);
49898
- const [files, setFiles] = React79.useState([]);
49899
- const [selectedFile, setSelectedFile] = React79.useState(null);
49900
- const [selectedPath, setSelectedPath] = React79.useState(null);
49901
- const [previewUrl, setPreviewUrl] = React79.useState(null);
49902
- const [fileContents, setFileContents] = React79.useState(/* @__PURE__ */ new Map());
49903
- const boot = React79.useCallback(async () => {
49904
- setStatus("booting");
49905
- setError(null);
49906
- setIsLoading(true);
49907
- try {
49908
- log9.debug("Booting WebContainer");
49909
- await new Promise((resolve) => setTimeout(resolve, 100));
49910
- setStatus("ready");
49911
- } catch (err) {
49912
- setError(err instanceof Error ? err.message : "Failed to boot");
49913
- setStatus("error");
49914
- } finally {
49915
- setIsLoading(false);
49916
- }
49917
- }, []);
49918
- const mountFiles = React79.useCallback(async (filesToMount) => {
49919
- setIsLoading(true);
49920
- try {
49921
- let filesArray;
49922
- if (Array.isArray(filesToMount)) {
49923
- filesArray = filesToMount;
49924
- } else {
49925
- filesArray = [];
49926
- const flattenTree = (obj, basePath = "") => {
49927
- for (const [key, value] of Object.entries(obj)) {
49928
- const path = basePath ? `${basePath}/${key}` : key;
49929
- if (value && typeof value === "object" && "file" in value) {
49930
- const fileObj = value;
49931
- filesArray.push({ path, content: fileObj.file.contents || "" });
49932
- } else if (value && typeof value === "object" && "directory" in value) {
49933
- const dirObj = value;
49934
- flattenTree(dirObj.directory, path);
49935
- }
49936
- }
49937
- };
49938
- flattenTree(filesToMount);
49939
- }
49940
- const newContents = /* @__PURE__ */ new Map();
49941
- for (const file of filesArray) {
49942
- newContents.set(file.path, file.content);
49943
- }
49944
- setFileContents(newContents);
49945
- const newTree = [];
49946
- for (const file of filesArray) {
49947
- const parts = file.path.split("/").filter(Boolean);
49948
- let current = newTree;
49949
- for (let i = 0; i < parts.length; i++) {
49950
- const part = parts[i];
49951
- const isFile = i === parts.length - 1;
49952
- const currentPath = "/" + parts.slice(0, i + 1).join("/");
49953
- let node = current.find((n) => n.name === part);
49954
- if (!node) {
49955
- node = {
49956
- path: currentPath,
49957
- name: part,
49958
- type: isFile ? "file" : "directory",
49959
- children: isFile ? void 0 : []
49960
- };
49961
- current.push(node);
49962
- }
49963
- if (!isFile && node && node.children) {
49964
- current = node.children;
49965
- }
49966
- }
49967
- }
49968
- setFiles(newTree);
49969
- setStatus("running");
49970
- } catch (err) {
49971
- log9.error("Failed to mount files", { error: err instanceof Error ? err : String(err) });
49972
- } finally {
49973
- setIsLoading(false);
49974
- }
49975
- }, []);
49976
- const readFile = React79.useCallback(async (path) => {
49977
- return fileContents.get(path) || "";
49978
- }, [fileContents]);
49979
- const writeFile = React79.useCallback(async (path, content) => {
49980
- setFileContents((prev) => {
49981
- const next = new Map(prev);
49982
- next.set(path, content);
49983
- return next;
49984
- });
49985
- }, []);
49986
- const selectFile = React79.useCallback(async (path) => {
49987
- const content = fileContents.get(path) || "";
49988
- const ext = path.split(".").pop()?.toLowerCase() || "";
49989
- const languageMap = {
49990
- ts: "typescript",
49991
- tsx: "typescript",
49992
- js: "javascript",
49993
- jsx: "javascript",
49994
- json: "json",
49995
- md: "markdown",
49996
- css: "css",
49997
- html: "html",
49998
- orb: "json"
49999
- };
50000
- setSelectedPath(path);
50001
- setSelectedFile({
50002
- path,
50003
- content,
50004
- language: languageMap[ext] || "plaintext",
50005
- isDirty: false
50006
- });
50007
- }, [fileContents]);
50008
- const updateContent = React79.useCallback((pathOrContent, contentArg) => {
50009
- const path = contentArg !== void 0 ? pathOrContent : selectedPath;
50010
- const content = contentArg !== void 0 ? contentArg : pathOrContent;
50011
- if (!path) {
50012
- log9.warn("updateContent called without path and no file selected");
50013
- return;
50014
- }
50015
- setFileContents((prev) => {
50016
- const next = new Map(prev);
50017
- next.set(path, content);
50018
- return next;
50019
- });
50020
- if (selectedPath === path) {
50021
- setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
50022
- }
50023
- }, [selectedPath]);
50024
- const updateSelectedContent = React79.useCallback((content) => {
50025
- setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
50026
- }, []);
50027
- const refreshTree = React79.useCallback(async () => {
50028
- log9.debug("Refreshing tree");
50029
- }, []);
50030
- const runCommand = React79.useCallback(async (command) => {
50031
- log9.debug("Running command", { command });
50032
- return { exitCode: 0, output: "" };
50033
- }, []);
50034
- const startDevServer = React79.useCallback(async () => {
50035
- log9.debug("Starting dev server");
50036
- setPreviewUrl("http://localhost:5173");
50037
- }, []);
50038
- return {
50039
- status,
50040
- error,
50041
- isLoading,
50042
- files,
50043
- selectedFile,
50044
- selectedPath,
50045
- previewUrl,
50046
- boot,
50047
- mountFiles,
50048
- readFile,
50049
- writeFile,
50050
- selectFile,
50051
- updateContent,
50052
- updateSelectedContent,
50053
- refreshTree,
50054
- runCommand,
50055
- startDevServer
50056
- };
50057
- }
50058
- var log10 = logger.createLogger("almadar:ui:extensions");
50059
- var defaultManifest = {
50060
- languages: {
50061
- typescript: { extensions: [".ts", ".tsx"], icon: "ts", color: "#3178c6" },
50062
- javascript: { extensions: [".js", ".jsx"], icon: "js", color: "#f7df1e" },
50063
- json: { extensions: [".json", ".orb"], icon: "json", color: "#000000" },
50064
- css: { extensions: [".css"], icon: "css", color: "#264de4" },
50065
- html: { extensions: [".html"], icon: "html", color: "#e34c26" },
50066
- markdown: { extensions: [".md", ".mdx"], icon: "md", color: "#083fa1" }
50067
- },
50068
- extensions: []
50069
- };
50070
- function useExtensions(options) {
50071
- const { appId, loadOnMount = true } = options;
50072
- const [extensions, setExtensions] = React79.useState([]);
50073
- const [manifest] = React79.useState(defaultManifest);
50074
- const [isLoading, setIsLoading] = React79.useState(false);
50075
- const [error, setError] = React79.useState(null);
50076
- const loadExtension = React79.useCallback(async (extensionId) => {
50077
- log10.debug("Loading extension", { extensionId });
50078
- }, []);
50079
- const loadExtensions = React79.useCallback(async () => {
50080
- setIsLoading(true);
50081
- setError(null);
50082
- try {
50083
- const defaultExtensions = [
50084
- { id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
50085
- { id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
50086
- { id: "json", name: "JSON", language: "json", loaded: true },
50087
- { id: "css", name: "CSS", language: "css", loaded: true },
50088
- { id: "html", name: "HTML", language: "html", loaded: true },
50089
- { id: "markdown", name: "Markdown", language: "markdown", loaded: true }
50090
- ];
50091
- setExtensions(defaultExtensions);
50092
- } catch (err) {
50093
- setError(err instanceof Error ? err.message : "Failed to load extensions");
50094
- } finally {
50095
- setIsLoading(false);
50096
- }
50097
- }, []);
50098
- const getExtensionForFile = React79.useCallback((filename) => {
50099
- const ext = filename.split(".").pop()?.toLowerCase();
50100
- if (!ext) return null;
50101
- const languageMap = {
50102
- ts: "typescript",
50103
- tsx: "typescript",
50104
- js: "javascript",
50105
- jsx: "javascript",
50106
- json: "json",
50107
- md: "markdown",
50108
- css: "css",
50109
- html: "html",
50110
- orb: "json"
50111
- };
50112
- const language = languageMap[ext];
50113
- if (!language) return null;
50114
- return extensions.find((e) => e.language === language) || null;
50115
- }, [extensions]);
50116
- React79.useEffect(() => {
50117
- if (!appId || !loadOnMount) return;
50118
- const loadExtensions2 = async () => {
50119
- setIsLoading(true);
50120
- setError(null);
50121
- try {
50122
- const defaultExtensions = [
50123
- { id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
50124
- { id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
50125
- { id: "json", name: "JSON", language: "json", loaded: true },
50126
- { id: "css", name: "CSS", language: "css", loaded: true },
50127
- { id: "html", name: "HTML", language: "html", loaded: true },
50128
- { id: "markdown", name: "Markdown", language: "markdown", loaded: true }
50129
- ];
50130
- setExtensions(defaultExtensions);
50131
- } catch (err) {
50132
- setError(err instanceof Error ? err.message : "Failed to load extensions");
50133
- } finally {
50134
- setIsLoading(false);
50135
- }
50136
- };
50137
- loadExtensions2();
50138
- }, [appId, loadOnMount]);
50139
- return {
50140
- extensions,
50141
- manifest,
50142
- isLoading,
50143
- error,
50144
- loadExtension,
50145
- loadExtensions,
50146
- getExtensionForFile
50147
- };
50148
- }
50149
- var log11 = logger.createLogger("almadar:ui:file-editor");
50150
- function useFileEditor(options) {
50151
- const { extensions, fileSystem, onSchemaUpdate } = options;
50152
- const [openFiles, setOpenFiles] = React79.useState([]);
50153
- const [activeFilePath, setActiveFilePath] = React79.useState(null);
50154
- const [isSaving, setIsSaving] = React79.useState(false);
50155
- const activeFile = openFiles.find((f3) => f3.path === activeFilePath) || null;
50156
- const openFile = React79.useCallback(async (path) => {
50157
- const existing = openFiles.find((f3) => f3.path === path);
50158
- if (existing) {
50159
- setActiveFilePath(path);
50160
- return;
50161
- }
50162
- try {
50163
- const content = await fileSystem.readFile(path);
50164
- const ext = extensions.getExtensionForFile(path);
50165
- const newFile = {
50166
- path,
50167
- content,
50168
- isDirty: false,
50169
- language: ext?.language
50170
- };
50171
- setOpenFiles((prev) => [...prev, newFile]);
50172
- setActiveFilePath(path);
50173
- } catch (err) {
50174
- log11.error("Failed to open file", { error: err instanceof Error ? err : String(err) });
50175
- }
50176
- }, [openFiles, fileSystem, extensions]);
50177
- const closeFile = React79.useCallback((path) => {
50178
- setOpenFiles((prev) => prev.filter((f3) => f3.path !== path));
50179
- if (activeFilePath === path) {
50180
- const remaining = openFiles.filter((f3) => f3.path !== path);
50181
- setActiveFilePath(remaining.length > 0 ? remaining[0].path : null);
50182
- }
50183
- }, [activeFilePath, openFiles]);
50184
- const setActiveFile = React79.useCallback((path) => {
50185
- setActiveFilePath(path);
50186
- }, []);
50187
- const updateFileContent = React79.useCallback((path, content) => {
50188
- setOpenFiles(
50189
- (prev) => prev.map(
50190
- (f3) => f3.path === path ? { ...f3, content, isDirty: true } : f3
50191
- )
50192
- );
50193
- }, []);
50194
- const handleFileEdit = React79.useCallback(async (path, content) => {
50195
- try {
50196
- await fileSystem.writeFile(path, content);
50197
- let action = "saved";
50198
- if (path.endsWith(".orb") || path.endsWith("schema.json")) {
50199
- try {
50200
- const schema = JSON.parse(content);
50201
- await onSchemaUpdate?.(schema);
50202
- action = "updated_schema";
50203
- } catch {
50204
- }
50205
- } else if (path.includes("/extensions/")) {
50206
- action = path.endsWith(".new") ? "converted_extension" : "saved_extension";
50207
- }
50208
- return { success: true, action };
50209
- } catch (err) {
50210
- return {
50211
- success: false,
50212
- error: err instanceof Error ? err.message : "Failed to save file"
50213
- };
50214
- }
50215
- }, [fileSystem, onSchemaUpdate]);
50216
- const saveFile = React79.useCallback(async (path) => {
50217
- const file = openFiles.find((f3) => f3.path === path);
50218
- if (!file) return;
50219
- setIsSaving(true);
50220
- try {
50221
- await fileSystem.writeFile(path, file.content);
50222
- setOpenFiles(
50223
- (prev) => prev.map(
50224
- (f3) => f3.path === path ? { ...f3, isDirty: false } : f3
50225
- )
50226
- );
50227
- if (path.endsWith(".orb") || path.endsWith("schema.json")) {
50228
- try {
50229
- const schema = JSON.parse(file.content);
50230
- await onSchemaUpdate?.(schema);
50231
- } catch {
50232
- }
50233
- }
50234
- } catch (err) {
50235
- log11.error("Failed to save file", { error: err instanceof Error ? err : String(err) });
50236
- } finally {
50237
- setIsSaving(false);
50238
- }
50239
- }, [openFiles, fileSystem, onSchemaUpdate]);
50240
- const saveAllFiles = React79.useCallback(async () => {
50241
- setIsSaving(true);
50242
- try {
50243
- const dirtyFiles = openFiles.filter((f3) => f3.isDirty);
50244
- for (const file of dirtyFiles) {
50245
- await saveFile(file.path);
50246
- }
50247
- } finally {
50248
- setIsSaving(false);
50249
- }
50250
- }, [openFiles, saveFile]);
50251
- return {
50252
- openFiles,
50253
- activeFile,
50254
- isSaving,
50255
- openFile,
50256
- closeFile,
50257
- setActiveFile,
50258
- updateFileContent,
50259
- handleFileEdit,
50260
- saveFile,
50261
- saveAllFiles
50262
- };
50263
- }
50264
- var log12 = logger.createLogger("almadar:ui:compile");
50265
- function useCompile() {
50266
- const [isCompiling, setIsCompiling] = React79.useState(false);
50267
- const [stage, setStage] = React79.useState("idle");
50268
- const [lastResult, setLastResult] = React79.useState(null);
50269
- const [error, setError] = React79.useState(null);
50270
- const compileSchema = React79.useCallback(async (schema) => {
50271
- setIsCompiling(true);
50272
- setStage("compiling");
50273
- setError(null);
50274
- try {
50275
- log12.debug("Compiling schema", { name: schema.name });
50276
- const result = {
50277
- success: true,
50278
- files: []
50279
- };
50280
- setLastResult(result);
50281
- setStage("done");
50282
- return result;
50283
- } catch (err) {
50284
- const errorMessage = err instanceof Error ? err.message : "Compilation failed";
50285
- setError(errorMessage);
50286
- setStage("error");
50287
- setLastResult({ success: false, errors: [errorMessage] });
50288
- return null;
50289
- } finally {
50290
- setIsCompiling(false);
50291
- }
50292
- }, []);
50293
- return {
50294
- isCompiling,
50295
- stage,
50296
- lastResult,
50297
- error,
50298
- compileSchema
50299
- };
50300
- }
50301
- var log13 = logger.createLogger("almadar:ui:preview");
50302
- function usePreview(options) {
50303
- const [previewUrl, setPreviewUrl] = React79.useState(null);
50304
- const [isLoading, setIsLoading] = React79.useState(!!options?.appId);
50305
- const [error, setError] = React79.useState(null);
50306
- const [loadError, setLoadError] = React79.useState(null);
50307
- const [app, setApp] = React79.useState(null);
50308
- const [isFullscreen, setIsFullscreen] = React79.useState(false);
50309
- const [isExecutingEvent, setIsExecutingEvent] = React79.useState(false);
50310
- const [errorToast, setErrorToast] = React79.useState(null);
50311
- const [currentStateName, setCurrentStateName] = React79.useState(null);
50312
- const [notificationsList, setNotificationsList] = React79.useState([]);
50313
- const [isPanelOpen, setIsPanelOpen] = React79.useState(false);
50314
- const notifications = React79.useMemo(() => ({
50315
- notifications: notificationsList,
50316
- isPanelOpen,
50317
- closePanel: () => setIsPanelOpen(false),
50318
- dismissNotification: (id) => {
50319
- setNotificationsList((prev) => prev.filter((n) => n.id !== id));
50320
- },
50321
- markAsRead: (id) => {
50322
- setNotificationsList(
50323
- (prev) => prev.map((n) => n.id === id ? { ...n, read: true } : n)
50324
- );
50325
- },
50326
- clearAll: () => setNotificationsList([])
50327
- }), [notificationsList, isPanelOpen]);
50328
- React79.useEffect(() => {
50329
- const appId = options?.appId;
50330
- if (!appId) {
50331
- setApp(null);
50332
- setIsLoading(false);
50333
- return;
50334
- }
50335
- log13.debug("Setting up preview for app", { appId });
50336
- setPreviewUrl(`/api/orbitals/${appId}`);
50337
- setIsLoading(false);
50338
- }, [options?.appId]);
50339
- const startPreview = React79.useCallback(async () => {
50340
- log13.debug("startPreview called");
50341
- }, []);
50342
- const stopPreview = React79.useCallback(async () => {
50343
- setIsLoading(true);
50344
- try {
50345
- log13.debug("Stopping preview server");
50346
- setPreviewUrl(null);
50347
- setApp(null);
50348
- } finally {
50349
- setIsLoading(false);
50350
- }
50351
- }, []);
50352
- const refresh = React79.useCallback(async () => {
50353
- if (!previewUrl) return;
50354
- log13.debug("Refreshing preview");
50355
- setPreviewUrl(`${previewUrl.split("?")[0]}?t=${Date.now()}`);
50356
- }, [previewUrl]);
50357
- const handleRefresh = React79.useCallback(async () => {
50358
- log13.debug("Handle refresh");
50359
- await refresh();
50360
- }, [refresh]);
50361
- const handleReset = React79.useCallback(async () => {
50362
- log13.debug("Resetting preview");
50363
- setError(null);
50364
- setLoadError(null);
50365
- setErrorToast(null);
50366
- setIsExecutingEvent(false);
50367
- setCurrentStateName(null);
50368
- }, []);
50369
- const toggleFullscreen = React79.useCallback(() => {
50370
- setIsFullscreen((prev) => !prev);
50371
- }, []);
50372
- const dismissErrorToast = React79.useCallback(() => {
50373
- setErrorToast(null);
50374
- }, []);
50375
- return {
50376
- previewUrl,
50377
- isLoading,
50378
- error,
50379
- loadError,
50380
- app,
50381
- isFullscreen,
50382
- isExecutingEvent,
50383
- errorToast,
50384
- currentStateName,
50385
- notifications,
50386
- startPreview,
50387
- stopPreview,
50388
- refresh,
50389
- handleRefresh,
50390
- handleReset,
50391
- toggleFullscreen,
50392
- setErrorToast,
50393
- dismissErrorToast
50394
- };
50395
- }
50396
- var log14 = logger.createLogger("almadar:ui:agent-chat");
50397
- function useAgentChat(options) {
50398
- const [messages, setMessages] = React79.useState([]);
50399
- const [status, setStatus] = React79.useState("idle");
50400
- const [activities, setActivities] = React79.useState([]);
50401
- const [todos, setTodos] = React79.useState([]);
50402
- const [schemaDiffs, setSchemaDiffs] = React79.useState([]);
50403
- const [isLoading, setIsLoading] = React79.useState(false);
50404
- const [error, setError] = React79.useState(null);
50405
- const [threadId] = React79.useState(null);
50406
- const [interrupt, setInterrupt] = React79.useState(null);
50407
- const sendMessage = React79.useCallback(async (content) => {
50408
- setIsLoading(true);
50409
- setStatus("running");
50410
- setError(null);
50411
- try {
50412
- const userMessage = {
50413
- id: Date.now().toString(),
50414
- role: "user",
50415
- content,
50416
- timestamp: Date.now()
50417
- };
50418
- setMessages((prev) => [...prev, userMessage]);
50419
- log14.debug("Sending message", { content });
50420
- const assistantMessage = {
50421
- id: (Date.now() + 1).toString(),
50422
- role: "assistant",
50423
- content: "Agent chat is not yet implemented.",
50424
- timestamp: Date.now()
50425
- };
50426
- setMessages((prev) => [...prev, assistantMessage]);
50427
- setStatus("idle");
50428
- options?.onComplete?.();
50429
- } catch (err) {
50430
- setError(err instanceof Error ? err.message : "Failed to send message");
50431
- setStatus("error");
50432
- } finally {
50433
- setIsLoading(false);
50434
- }
50435
- }, [options]);
50436
- const startGeneration = React79.useCallback(async (skill, prompt, genOptions) => {
50437
- setStatus("running");
50438
- setIsLoading(true);
50439
- setError(null);
50440
- const skillName = Array.isArray(skill) ? skill[0] : skill;
50441
- try {
50442
- log14.debug("Starting generation", () => ({ skillName, prompt, genOptions: JSON.stringify(genOptions) }));
50443
- await new Promise((resolve) => setTimeout(resolve, 100));
50444
- setStatus("complete");
50445
- options?.onComplete?.();
50446
- } catch (err) {
50447
- setError(err instanceof Error ? err.message : "Generation failed");
50448
- setStatus("error");
50449
- } finally {
50450
- setIsLoading(false);
50451
- }
50452
- }, [options]);
50453
- const continueConversation = React79.useCallback(async (message) => {
50454
- log14.debug("Continue conversation", { message: Array.isArray(message) ? message : [message] });
50455
- }, []);
50456
- const resumeWithDecision = React79.useCallback(async (decisions) => {
50457
- log14.debug("Resume with decision", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
50458
- setInterrupt(null);
50459
- }, []);
50460
- const cancel = React79.useCallback(() => {
50461
- setStatus("idle");
50462
- setIsLoading(false);
50463
- setInterrupt(null);
50464
- }, []);
50465
- const clearMessages = React79.useCallback(() => {
50466
- setMessages([]);
50467
- }, []);
50468
- const clearHistory = React79.useCallback(() => {
50469
- setMessages([]);
50470
- setActivities([]);
50471
- setTodos([]);
50472
- setSchemaDiffs([]);
50473
- setError(null);
50474
- }, []);
50475
- return {
50476
- messages,
50477
- status,
50478
- activities,
50479
- todos,
50480
- schemaDiffs,
50481
- isLoading,
50482
- error,
50483
- threadId,
50484
- interrupt,
50485
- sendMessage,
50486
- startGeneration,
50487
- continueConversation,
50488
- resumeWithDecision,
50489
- cancel,
50490
- clearMessages,
50491
- clearHistory
50492
- };
50493
- }
50494
- var log15 = logger.createLogger("almadar:ui:validation");
50495
- function useValidation() {
50496
- const [result, setResult] = React79.useState(null);
50497
- const [isValidating, setIsValidating] = React79.useState(false);
50498
- const [error, setError] = React79.useState(null);
50499
- const [stage, setStage] = React79.useState("idle");
50500
- const [isFixing, setIsFixing] = React79.useState(false);
50501
- const [progressMessage, setProgressMessage] = React79.useState(null);
50502
- const validate = React79.useCallback(async (appId) => {
50503
- setIsValidating(true);
50504
- setError(null);
50505
- setStage("validating");
50506
- setProgressMessage("Validating schema...");
50507
- try {
50508
- log15.debug("Validating app", { appId });
50509
- const validationResult = {
50510
- valid: true,
50511
- errors: [],
50512
- warnings: []
50513
- };
50514
- setResult(validationResult);
50515
- setStage("complete");
50516
- setProgressMessage(null);
50517
- return validationResult;
50518
- } catch (err) {
50519
- const errorMessage = err instanceof Error ? err.message : "Validation failed";
50520
- setError(errorMessage);
50521
- const failedResult = {
50522
- valid: false,
50523
- errors: [{ code: "VALIDATION_ERROR", message: errorMessage, severity: "error" }],
50524
- warnings: []
50525
- };
50526
- setResult(failedResult);
50527
- setStage("complete");
50528
- setProgressMessage(null);
50529
- return failedResult;
50530
- } finally {
50531
- setIsValidating(false);
50532
- }
50533
- }, []);
50534
- const clearResult = React79.useCallback(() => {
50535
- setResult(null);
50536
- setError(null);
50537
- }, []);
50538
- const reset = React79.useCallback(() => {
50539
- setResult(null);
50540
- setError(null);
50541
- setStage("idle");
50542
- setIsFixing(false);
50543
- setProgressMessage(null);
50544
- setIsValidating(false);
50545
- }, []);
50546
- return {
50547
- result,
50548
- isValidating,
50549
- error,
50550
- stage,
50551
- isFixing,
50552
- progressMessage,
50553
- errors: result?.errors ?? [],
50554
- warnings: result?.warnings ?? [],
50555
- isValid: result?.valid ?? false,
50556
- validate,
50557
- clearResult,
50558
- reset
50559
- };
50560
- }
50561
- var log16 = logger.createLogger("almadar:ui:deep-agent");
50562
- function useDeepAgentGeneration() {
50563
- const [requests, setRequests] = React79.useState([]);
50564
- const [currentRequest, setCurrentRequest] = React79.useState(null);
50565
- const [isGenerating, setIsGenerating] = React79.useState(false);
50566
- const [isLoading, setIsLoading] = React79.useState(false);
50567
- const [isComplete, setIsComplete] = React79.useState(false);
50568
- const [progress, setProgress] = React79.useState({ stage: "idle", percent: 0, message: "" });
50569
- const [error, setError] = React79.useState(null);
50570
- const [interrupt, setInterrupt] = React79.useState(null);
50571
- const generate = React79.useCallback(async (prompt) => {
50572
- setIsGenerating(true);
50573
- setIsLoading(true);
50574
- setIsComplete(false);
50575
- setError(null);
50576
- setProgress({ stage: "starting", percent: 0, message: "Starting generation..." });
50577
- const request = {
50578
- id: Date.now().toString(),
50579
- prompt,
50580
- status: "running"
50581
- };
50582
- setCurrentRequest(request);
50583
- setRequests((prev) => [...prev, request]);
50584
- try {
50585
- log16.debug("Generating from prompt", { prompt });
50586
- await new Promise((resolve) => setTimeout(resolve, 100));
50587
- request.status = "completed";
50588
- setCurrentRequest(request);
50589
- setIsComplete(true);
50590
- setProgress({ stage: "complete", percent: 100, message: "Generation complete" });
50591
- return null;
50592
- } catch (err) {
50593
- const errorMessage = err instanceof Error ? err.message : "Generation failed";
50594
- setError(errorMessage);
50595
- request.status = "failed";
50596
- request.error = errorMessage;
50597
- setCurrentRequest(request);
50598
- return null;
50599
- } finally {
50600
- setIsGenerating(false);
50601
- setIsLoading(false);
50602
- }
50603
- }, []);
50604
- const startGeneration = React79.useCallback(async (skill, prompt, _options) => {
50605
- log16.debug("Starting generation with skill", { skill });
50606
- await generate(prompt);
50607
- }, [generate]);
50608
- const cancelGeneration = React79.useCallback(() => {
50609
- if (currentRequest) {
50610
- currentRequest.status = "failed";
50611
- currentRequest.error = "Cancelled by user";
50612
- setCurrentRequest(null);
50613
- }
50614
- setIsGenerating(false);
50615
- setIsLoading(false);
50616
- setIsComplete(false);
50617
- setProgress({ stage: "idle", percent: 0, message: "" });
50618
- }, [currentRequest]);
50619
- const clearRequests = React79.useCallback(() => {
50620
- setRequests([]);
50621
- setCurrentRequest(null);
50622
- setError(null);
50623
- setProgress({ stage: "idle", percent: 0, message: "" });
50624
- setIsComplete(false);
50625
- }, []);
50626
- const submitInterruptDecisions = React79.useCallback((decisions) => {
50627
- log16.debug("Submitting interrupt decisions", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
50628
- setInterrupt(null);
50629
- }, []);
50630
- return {
50631
- requests,
50632
- currentRequest,
50633
- isGenerating,
50634
- isLoading,
50635
- isComplete,
50636
- progress,
50637
- error,
50638
- interrupt,
50639
- generate,
50640
- startGeneration,
50641
- cancelGeneration,
50642
- clearRequests,
50643
- submitInterruptDecisions
50644
- };
50645
- }
50646
-
50647
- // hooks/index.ts
50648
- init_useEventBus();
50649
- var log17 = logger.createLogger("almadar:ui:ui-slots");
50650
- var DEFAULT_SOURCE_KEY = "__default__";
50651
- var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
50652
- var ALL_SLOTS2 = [
50653
- "main",
50654
- "sidebar",
50655
- "modal",
50656
- "drawer",
50657
- "overlay",
50658
- "center",
50659
- "toast",
50660
- "hud-top",
50661
- "hud-bottom",
50662
- "hud-left",
50663
- "hud-right",
50664
- "floating"
50665
- ];
50666
- var DEFAULT_SLOTS = ALL_SLOTS2.reduce(
50667
- (acc, slot) => {
50668
- acc[slot] = null;
50669
- return acc;
50670
- },
50671
- {}
50672
- );
50673
- var DEFAULT_SOURCES = ALL_SLOTS2.reduce(
50674
- (acc, slot) => {
50675
- acc[slot] = {};
50676
- return acc;
50677
- },
50678
- {}
50679
- );
50680
- var idCounter = 0;
50681
- function generateId() {
50682
- return `slot-content-${++idCounter}-${Date.now()}`;
50683
- }
50684
- function aggregateSlot(sources) {
50685
- if (!sources) return null;
50686
- const entries = Object.entries(sources);
50687
- if (entries.length === 0) return null;
50688
- if (entries.length === 1) return entries[0][1];
50689
- const children = entries.map(([, entry]) => ({
50690
- type: entry.pattern,
50691
- ...entry.props
50692
- }));
50693
- const stackId = `slot-content-stack-${entries.map(([k]) => k).join("-")}`;
50694
- return {
50695
- id: stackId,
50696
- pattern: "stack",
50697
- props: {
50698
- direction: "vertical",
50699
- gap: "lg",
50700
- children
50701
- },
50702
- priority: 0,
50703
- animation: "fade",
50704
- sourceTrait: MULTI_SOURCE_STACK_TRAIT
50705
- };
50706
- }
50707
- function useUISlotManager() {
50708
- const [sources, setSources] = React79.useState(DEFAULT_SOURCES);
50709
- const subscribersRef = React79.useRef(/* @__PURE__ */ new Set());
50710
- const timersRef = React79.useRef(/* @__PURE__ */ new Map());
50711
- const traitIndexRef = React79.useRef(/* @__PURE__ */ new Map());
50712
- const traitSubscribersRef = React79.useRef(/* @__PURE__ */ new Map());
50713
- const slots = React79.useMemo(() => {
50714
- const out = { ...DEFAULT_SLOTS };
50715
- for (const slot of ALL_SLOTS2) {
50716
- out[slot] = aggregateSlot(sources[slot]);
50717
- }
50718
- return out;
50719
- }, [sources]);
50720
- React79.useEffect(() => {
50721
- return () => {
50722
- timersRef.current.forEach((timer) => clearTimeout(timer));
50723
- timersRef.current.clear();
50724
- };
50725
- }, []);
50726
- const notifySubscribers = React79.useCallback((slot, content) => {
50727
- subscribersRef.current.forEach((callback) => {
50728
- try {
50729
- callback(slot, content);
50730
- } catch (error) {
50731
- log17.error("Subscriber error", { error: error instanceof Error ? error : String(error) });
50732
- }
50733
- });
50734
- }, []);
50735
- const notifyTraitSubscribers = React79.useCallback(
50736
- (traitName, content) => {
50737
- const subs = traitSubscribersRef.current.get(traitName);
50738
- if (!subs) return;
50739
- subs.forEach((callback) => {
50740
- try {
50741
- callback(content);
50742
- } catch (error) {
50743
- log17.error("Trait subscriber error", { traitName, error: error instanceof Error ? error : String(error) });
50744
- }
50745
- });
50746
- },
50747
- []
50748
- );
50749
- const indexTraitRender = React79.useCallback(
50750
- (traitName, content) => {
50751
- traitIndexRef.current.set(traitName, content);
50752
- },
50753
- []
50754
- );
50755
- const unindexTrait = React79.useCallback((traitName) => {
50756
- traitIndexRef.current.delete(traitName);
50757
- }, []);
50758
- const render = React79.useCallback(
50759
- (config) => {
50760
- const id = generateId();
50761
- const sourceKey = config.sourceTrait ?? DEFAULT_SOURCE_KEY;
50762
- const content = {
50763
- id,
50764
- pattern: config.pattern,
50765
- props: config.props ?? {},
50766
- priority: config.priority ?? 0,
50767
- animation: config.animation ?? "fade",
50768
- onDismiss: config.onDismiss,
50769
- sourceTrait: config.sourceTrait,
50770
- slot: config.target,
50771
- transitionEvent: config.transitionEvent,
50772
- fromState: config.fromState,
50773
- entity: config.entity
50774
- };
50775
- if (config.autoDismissMs && config.autoDismissMs > 0) {
50776
- content.autoDismissAt = Date.now() + config.autoDismissMs;
50777
- const timer = setTimeout(() => {
50778
- setSources((prev) => {
50779
- const slotSources = prev[config.target];
50780
- if (slotSources && slotSources[sourceKey]?.id === id) {
50781
- content.onDismiss?.();
50782
- const next = { ...slotSources };
50783
- delete next[sourceKey];
50784
- const updated = { ...prev, [config.target]: next };
50785
- notifySubscribers(config.target, aggregateSlot(next));
50786
- return updated;
50787
- }
50788
- return prev;
50789
- });
50790
- timersRef.current.delete(id);
50791
- }, config.autoDismissMs);
50792
- timersRef.current.set(id, timer);
50793
- }
50794
- setSources((prev) => {
50795
- const slotSources = prev[config.target] ?? {};
50796
- const existing = slotSources[sourceKey];
50797
- if (existing && existing.priority > content.priority) {
50798
- log17.warn("Slot already has higher priority content", {
50799
- slot: config.target,
50800
- sourceKey,
50801
- existingPriority: existing.priority,
50802
- newPriority: content.priority
50803
- });
50804
- return prev;
50805
- }
50806
- const nextSources = {
50807
- ...slotSources,
50808
- [sourceKey]: content
50809
- };
50810
- const nextAll = { ...prev, [config.target]: nextSources };
50811
- if (content.sourceTrait) {
50812
- indexTraitRender(content.sourceTrait, content);
50813
- notifyTraitSubscribers(content.sourceTrait, content);
50814
- }
50815
- log17.info("slot:written", {
50816
- slot: config.target,
50817
- sourceKey,
50818
- sourceTrait: content.sourceTrait,
50819
- patternType: content.pattern,
50820
- priority: content.priority
50821
- });
50822
- notifySubscribers(config.target, aggregateSlot(nextSources));
50823
- return nextAll;
50824
- });
50825
- return id;
50826
- },
50827
- [notifySubscribers, notifyTraitSubscribers, indexTraitRender]
50828
- );
50829
- const clear = React79.useCallback(
50830
- (slot) => {
50831
- setSources((prev) => {
50832
- const slotSources = prev[slot];
50833
- if (!slotSources || Object.keys(slotSources).length === 0) {
50834
- return prev;
50835
- }
50836
- for (const content of Object.values(slotSources)) {
50837
- const timer = timersRef.current.get(content.id);
50838
- if (timer) {
50839
- clearTimeout(timer);
50840
- timersRef.current.delete(content.id);
50841
- }
50842
- content.onDismiss?.();
50843
- if (content.sourceTrait) {
50844
- unindexTrait(content.sourceTrait);
50845
- notifyTraitSubscribers(content.sourceTrait, null);
50846
- }
50847
- }
50848
- notifySubscribers(slot, null);
50849
- return { ...prev, [slot]: {} };
50850
- });
50851
- },
50852
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50853
- );
50854
- const clearBySource = React79.useCallback(
50855
- (slot, sourceTrait) => {
50856
- const sourceKey = sourceTrait;
50857
- setSources((prev) => {
50858
- const slotSources = prev[slot];
50859
- if (!slotSources || !(sourceKey in slotSources)) {
50860
- log17.debug("slot:clear-noop", { slot, sourceTrait, reason: !slotSources ? "no-slot" : "no-source" });
50861
- return prev;
50862
- }
50863
- const content = slotSources[sourceKey];
50864
- const timer = timersRef.current.get(content.id);
50865
- if (timer) {
50866
- clearTimeout(timer);
50867
- timersRef.current.delete(content.id);
50868
- }
50869
- content.onDismiss?.();
50870
- if (content.sourceTrait) {
50871
- unindexTrait(content.sourceTrait);
50872
- notifyTraitSubscribers(content.sourceTrait, null);
50873
- }
50874
- const nextSources = { ...slotSources };
50875
- delete nextSources[sourceKey];
50876
- log17.info("slot:cleared", { slot, sourceTrait, lastPatternType: content.pattern });
50877
- notifySubscribers(slot, aggregateSlot(nextSources));
50878
- return { ...prev, [slot]: nextSources };
50879
- });
50880
- },
50881
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50882
- );
50883
- const clearById = React79.useCallback(
50884
- (id) => {
50885
- setSources((prev) => {
50886
- for (const slot of ALL_SLOTS2) {
50887
- const slotSources = prev[slot];
50888
- if (!slotSources) continue;
50889
- const matchKey = Object.keys(slotSources).find(
50890
- (k) => slotSources[k].id === id
50891
- );
50892
- if (!matchKey) continue;
50893
- const content = slotSources[matchKey];
50894
- const timer = timersRef.current.get(id);
50895
- if (timer) {
50896
- clearTimeout(timer);
50897
- timersRef.current.delete(id);
50898
- }
50899
- content.onDismiss?.();
50900
- if (content.sourceTrait) {
50901
- unindexTrait(content.sourceTrait);
50902
- notifyTraitSubscribers(content.sourceTrait, null);
50903
- }
50904
- const nextSources = { ...slotSources };
50905
- delete nextSources[matchKey];
50906
- notifySubscribers(slot, aggregateSlot(nextSources));
50907
- return { ...prev, [slot]: nextSources };
50908
- }
50909
- return prev;
50910
- });
50911
- },
50912
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50913
- );
50914
- const clearAll = React79.useCallback(() => {
50915
- timersRef.current.forEach((timer) => clearTimeout(timer));
50916
- timersRef.current.clear();
50917
- setSources((prev) => {
50918
- for (const slot of ALL_SLOTS2) {
50919
- const slotSources = prev[slot];
50920
- if (!slotSources) continue;
50921
- for (const content of Object.values(slotSources)) {
50922
- content.onDismiss?.();
50923
- if (content.sourceTrait) {
50924
- notifyTraitSubscribers(content.sourceTrait, null);
50925
- }
50926
- }
50927
- notifySubscribers(slot, null);
50928
- }
50929
- return DEFAULT_SOURCES;
50930
- });
50931
- traitIndexRef.current.clear();
50932
- }, [notifySubscribers, notifyTraitSubscribers]);
50933
- const subscribe2 = React79.useCallback((callback) => {
50934
- subscribersRef.current.add(callback);
50935
- return () => {
50936
- subscribersRef.current.delete(callback);
50937
- };
50938
- }, []);
50939
- const hasContent = React79.useCallback(
50940
- (slot) => slots[slot] !== null,
50941
- [slots]
50942
- );
50943
- const getContent = React79.useCallback(
50944
- (slot) => slots[slot],
50945
- [slots]
50946
- );
50947
- const getTraitContent = React79.useCallback(
50948
- (traitName) => traitIndexRef.current.get(traitName) ?? null,
50949
- []
50950
- );
50951
- const subscribeTrait = React79.useCallback(
50952
- (traitName, callback) => {
50953
- let set = traitSubscribersRef.current.get(traitName);
50954
- if (!set) {
50955
- set = /* @__PURE__ */ new Set();
50956
- traitSubscribersRef.current.set(traitName, set);
50957
- }
50958
- set.add(callback);
50959
- return () => {
50960
- const s = traitSubscribersRef.current.get(traitName);
50961
- if (!s) return;
50962
- s.delete(callback);
50963
- if (s.size === 0) {
50964
- traitSubscribersRef.current.delete(traitName);
50965
- }
50966
- };
50967
- },
50968
- []
50969
- );
50970
- const updateTraitContent = React79.useCallback(
50971
- (traitName, content) => {
50972
- const id = generateId();
50973
- const fullContent = { ...content, id, sourceTrait: traitName };
50974
- indexTraitRender(traitName, fullContent);
50975
- notifyTraitSubscribers(traitName, fullContent);
50976
- return id;
50977
- },
50978
- [indexTraitRender, notifyTraitSubscribers]
50979
- );
50980
- return {
50981
- slots,
50982
- render,
50983
- clear,
50984
- clearBySource,
50985
- clearById,
50986
- clearAll,
50987
- subscribe: subscribe2,
50988
- hasContent,
50989
- getContent,
50990
- getTraitContent,
50991
- subscribeTrait,
50992
- updateTraitContent
50993
- };
50994
- }
50995
-
50996
- // hooks/useUIEvents.ts
50997
- init_useEventBus();
50998
- var UI_PREFIX = "UI:";
50999
- function useUIEvents(dispatch, traitName, validEvents, eventBusInstance) {
51000
- const defaultEventBus = useEventBus();
51001
- const eventBus = eventBusInstance ?? defaultEventBus;
51002
- const validEventsKey = validEvents.slice().sort().join(",");
51003
- const stableValidEvents = React79.useMemo(
51004
- () => validEvents,
51005
- [validEventsKey]
51006
- // intentional — validEventsKey is the stable dep
51007
- );
51008
- React79.useEffect(() => {
51009
- const unsubscribes = [];
51010
- for (const smEvent of stableValidEvents) {
51011
- const handler = (event) => {
51012
- if (event.source && event.source.dispatched) {
51013
- return;
51014
- }
51015
- dispatch(smEvent, event.payload);
51016
- };
51017
- unsubscribes.push(
51018
- eventBus.on(`${UI_PREFIX}${traitName}.${smEvent}`, handler)
51019
- );
51020
- }
51021
- return () => {
51022
- for (const unsub of unsubscribes) {
51023
- if (typeof unsub === "function") unsub();
51024
- }
51025
- };
51026
- }, [eventBus, dispatch, traitName, stableValidEvents]);
51027
- }
51028
- function useTraitListens(dispatch, listens, eventBusInstance) {
51029
- const defaultEventBus = useEventBus();
51030
- const eventBus = eventBusInstance ?? defaultEventBus;
51031
- const stableKey = listens.map((l) => `${l.sourceKey}->${l.trigger}`).sort().join("|");
51032
- const stableListens = React79.useMemo(
51033
- () => listens,
51034
- [stableKey]
51035
- // intentional
51036
- );
51037
- React79.useEffect(() => {
51038
- const unsubscribes = [];
51039
- for (const spec of stableListens) {
51040
- const handler = (event) => {
51041
- dispatch(spec.trigger, event.payload);
51042
- };
51043
- unsubscribes.push(eventBus.on(`${UI_PREFIX}${spec.sourceKey}`, handler));
51044
- }
51045
- return () => {
51046
- for (const unsub of unsubscribes) {
51047
- if (typeof unsub === "function") unsub();
51048
- }
51049
- };
51050
- }, [eventBus, dispatch, stableListens]);
51051
- }
51052
-
51053
- // hooks/index.ts
51054
- init_useQuerySingleton();
51055
49130
 
51056
- // stores/entityStore.ts
51057
- var entities = /* @__PURE__ */ new Map();
51058
- var listeners7 = /* @__PURE__ */ new Set();
51059
- var idCounter2 = 0;
51060
- function subscribe(listener) {
51061
- listeners7.add(listener);
51062
- return () => listeners7.delete(listener);
51063
- }
51064
- function notify() {
51065
- listeners7.forEach((listener) => listener());
51066
- }
51067
- function getEntity(id) {
51068
- return entities.get(id);
51069
- }
51070
- function getByType(type) {
51071
- const types = Array.isArray(type) ? type : [type];
51072
- return [...entities.values()].filter((e) => types.includes(e.type));
51073
- }
51074
- function getAllEntities() {
51075
- return [...entities.values()];
51076
- }
51077
- function getSingleton(type) {
51078
- return [...entities.values()].find((e) => e.type === type);
51079
- }
51080
- function spawnEntity(config) {
51081
- const id = config.id ?? `entity_${++idCounter2}`;
51082
- const entity = { ...config, id };
51083
- entities = new Map(entities);
51084
- entities.set(id, entity);
51085
- notify();
51086
- return id;
51087
- }
51088
- function updateEntity(id, updates) {
51089
- const entity = entities.get(id);
51090
- if (entity) {
51091
- entities = new Map(entities);
51092
- entities.set(id, { ...entity, ...updates });
51093
- notify();
51094
- }
51095
- }
51096
- function updateSingleton(type, updates) {
51097
- const entity = getSingleton(type);
51098
- if (entity) {
51099
- updateEntity(entity.id, updates);
51100
- }
51101
- }
51102
- function removeEntity(id) {
51103
- if (entities.has(id)) {
51104
- entities = new Map(entities);
51105
- entities.delete(id);
51106
- notify();
51107
- }
51108
- }
51109
- function clearEntities() {
51110
- entities = /* @__PURE__ */ new Map();
51111
- notify();
51112
- }
51113
- function getSnapshot2() {
51114
- return entities;
51115
- }
51116
-
51117
- // hooks/useEntities.ts
51118
- function useEntities() {
51119
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51120
- return {
51121
- entities: entities2,
51122
- getEntity,
51123
- getByType,
51124
- getAllEntities,
51125
- getSingleton,
51126
- spawnEntity,
51127
- updateEntity,
51128
- updateSingleton,
51129
- removeEntity,
51130
- clearEntities
51131
- };
51132
- }
51133
- function useEntity(id) {
51134
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51135
- return entities2.get(id);
51136
- }
51137
- function useEntitiesByType(type) {
51138
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51139
- return [...entities2.values()].filter((e) => e.type === type);
51140
- }
51141
- function useSingletonEntity(type) {
51142
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51143
- return [...entities2.values()].find((e) => e.type === type);
51144
- }
51145
- function usePlayer() {
51146
- const player = useSingletonEntity("Player");
51147
- const update = React79.useCallback((updates) => {
51148
- if (player) updateEntity(player.id, updates);
51149
- }, [player?.id]);
51150
- return { player, updatePlayer: update };
51151
- }
51152
- function usePhysics() {
51153
- const physics = useSingletonEntity("Physics");
51154
- const update = React79.useCallback((updates) => {
51155
- if (physics) updateEntity(physics.id, updates);
51156
- }, [physics?.id]);
51157
- return { physics, updatePhysics: update };
51158
- }
51159
- function useInput() {
51160
- const input = useSingletonEntity("Input");
51161
- const update = React79.useCallback((updates) => {
51162
- if (input) updateEntity(input.id, updates);
51163
- }, [input?.id]);
51164
- return { input, updateInput: update };
51165
- }
51166
-
51167
- // hooks/index.ts
51168
- init_useTranslate();
51169
- init_useAuthContext();
51170
- init_useSwipeGesture();
51171
- init_useLongPress();
51172
- init_useDragReorder();
51173
- init_useInfiniteScroll();
51174
- init_usePullToRefresh();
51175
- function getDistance(touches) {
51176
- const dx = touches[0].clientX - touches[1].clientX;
51177
- const dy = touches[0].clientY - touches[1].clientY;
51178
- return Math.sqrt(dx * dx + dy * dy);
51179
- }
51180
- function usePinchZoom(options = {}) {
51181
- const { minScale = 0.5, maxScale = 4 } = options;
51182
- const [scale, setScale] = React79.useState(1);
51183
- const [isPinching, setIsPinching] = React79.useState(false);
51184
- const initialDistance = React79.useRef(0);
51185
- const initialScale = React79.useRef(1);
51186
- const onTouchStart = React79.useCallback((e) => {
51187
- if (e.touches.length === 2) {
51188
- initialDistance.current = getDistance(e.touches);
51189
- initialScale.current = scale;
51190
- setIsPinching(true);
51191
- }
51192
- }, [scale]);
51193
- const onTouchMove = React79.useCallback((e) => {
51194
- if (e.touches.length !== 2 || !isPinching) return;
51195
- e.preventDefault();
51196
- const currentDistance = getDistance(e.touches);
51197
- const ratio = currentDistance / initialDistance.current;
51198
- const newScale = Math.min(maxScale, Math.max(minScale, initialScale.current * ratio));
51199
- setScale(newScale);
51200
- }, [isPinching, minScale, maxScale]);
51201
- const onTouchEnd = React79.useCallback(() => {
51202
- setIsPinching(false);
51203
- }, []);
51204
- const resetZoom = React79.useCallback(() => {
51205
- setScale(1);
51206
- }, []);
51207
- return {
51208
- scale,
51209
- isPinching,
51210
- gestureProps: {
51211
- onTouchStart,
51212
- onTouchMove,
51213
- onTouchEnd
51214
- },
51215
- resetZoom
51216
- };
51217
- }
51218
-
51219
- // hooks/useDraggable.ts
51220
- init_useEventBus();
51221
- var ALMADAR_DND_MIME = "application/x-almadar-dnd";
51222
- function useDraggable({ payload, disabled = false }) {
51223
- const [isDragging, setIsDragging] = React79.useState(false);
51224
- const eventBus = useEventBus();
51225
- const handleDragStart = React79.useCallback(
51226
- (e) => {
51227
- if (disabled) {
51228
- e.preventDefault();
51229
- return;
51230
- }
51231
- e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
51232
- e.dataTransfer.effectAllowed = "copy";
51233
- setIsDragging(true);
51234
- eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
51235
- },
51236
- [disabled, payload, eventBus]
51237
- );
51238
- const handleDragEnd = React79.useCallback(
51239
- (e) => {
51240
- setIsDragging(false);
51241
- eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
51242
- },
51243
- [payload, eventBus]
51244
- );
51245
- const dragProps = React79.useMemo(
51246
- () => ({
51247
- draggable: !disabled,
51248
- onDragStart: handleDragStart,
51249
- onDragEnd: handleDragEnd,
51250
- "aria-grabbed": isDragging
51251
- }),
51252
- [disabled, handleDragStart, handleDragEnd, isDragging]
51253
- );
51254
- return { dragProps, isDragging };
51255
- }
51256
-
51257
- // hooks/useDropZone.ts
51258
- init_useEventBus();
51259
- function parsePayload(e) {
51260
- try {
51261
- const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
51262
- if (!raw) return null;
51263
- const parsed = JSON.parse(raw);
51264
- if (typeof parsed.kind !== "string" || !parsed.data) return null;
51265
- return parsed;
51266
- } catch {
51267
- return null;
51268
- }
51269
- }
51270
- function hasAlmadarPayload(e) {
51271
- return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
51272
- }
51273
- function useDropZone({ accepts, onDrop, disabled = false }) {
51274
- const [isOver, setIsOver] = React79.useState(false);
51275
- const eventBus = useEventBus();
51276
- const handleDragOver = React79.useCallback(
51277
- (e) => {
51278
- if (disabled) return;
51279
- if (!hasAlmadarPayload(e)) return;
51280
- e.preventDefault();
51281
- e.dataTransfer.dropEffect = "copy";
51282
- setIsOver(true);
51283
- },
51284
- [disabled]
51285
- );
51286
- const handleDragLeave = React79.useCallback(
51287
- (e) => {
51288
- setIsOver(false);
51289
- },
51290
- []
51291
- );
51292
- const handleDrop = React79.useCallback(
51293
- (e) => {
51294
- e.preventDefault();
51295
- setIsOver(false);
51296
- if (disabled) return;
51297
- const payload = parsePayload(e);
51298
- if (!payload) return;
51299
- if (!accepts.includes(payload.kind)) return;
51300
- const position = { x: e.clientX, y: e.clientY };
51301
- onDrop(payload, position);
51302
- eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
51303
- },
51304
- [disabled, accepts, onDrop, eventBus]
51305
- );
51306
- const dropProps = React79.useMemo(
51307
- () => ({
51308
- onDragOver: handleDragOver,
51309
- onDragLeave: handleDragLeave,
51310
- onDrop: handleDrop
51311
- }),
51312
- [handleDragOver, handleDragLeave, handleDrop]
51313
- );
51314
- return { dropProps, isOver };
51315
- }
51316
- var API_BASE = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "http://localhost:3000";
51317
- function getUserId() {
51318
- return localStorage.getItem("userId") || "anonymous";
51319
- }
51320
- async function fetchWithAuth(endpoint, options) {
51321
- const userId = getUserId();
51322
- const response = await fetch(`${API_BASE}${endpoint}`, {
51323
- ...options,
51324
- headers: {
51325
- "Content-Type": "application/json",
51326
- "x-user-id": userId,
51327
- ...options?.headers
51328
- }
51329
- });
51330
- if (!response.ok) {
51331
- const error = await response.json().catch(() => ({ error: response.statusText }));
51332
- throw new Error(error.error || error.message || "Request failed");
51333
- }
51334
- return response.json();
51335
- }
51336
- function useGitHubStatus() {
51337
- return reactQuery.useQuery({
51338
- queryKey: ["github", "status"],
51339
- queryFn: () => fetchWithAuth("/api/github/status"),
51340
- staleTime: 6e4,
51341
- // 1 minute
51342
- retry: false
51343
- });
51344
- }
51345
- function useConnectGitHub() {
51346
- const connectGitHub = React79.useCallback(() => {
51347
- const userId = getUserId();
51348
- const state = btoa(JSON.stringify({ userId, returnUrl: window.location.href }));
51349
- window.location.href = `${API_BASE}/api/github/oauth/authorize?state=${state}`;
51350
- }, []);
51351
- return { connectGitHub };
51352
- }
51353
- function useDisconnectGitHub() {
51354
- const queryClient = reactQuery.useQueryClient();
51355
- return reactQuery.useMutation({
51356
- mutationFn: () => fetchWithAuth("/api/github/disconnect", { method: "POST" }),
51357
- onSuccess: () => {
51358
- queryClient.invalidateQueries({ queryKey: ["github", "status"] });
51359
- queryClient.removeQueries({ queryKey: ["github", "repos"] });
51360
- }
51361
- });
51362
- }
51363
- function useGitHubRepos(page = 1, perPage = 30) {
51364
- return reactQuery.useQuery({
51365
- queryKey: ["github", "repos", page, perPage],
51366
- queryFn: () => fetchWithAuth(`/api/github/repos?page=${page}&per_page=${perPage}`),
51367
- enabled: true,
51368
- // Only fetch if user is connected
51369
- staleTime: 3e5
51370
- // 5 minutes
51371
- });
51372
- }
51373
- function useGitHubRepo(owner, repo, enabled = true) {
51374
- return reactQuery.useQuery({
51375
- queryKey: ["github", "repo", owner, repo],
51376
- queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}`),
51377
- enabled: enabled && !!owner && !!repo,
51378
- staleTime: 3e5
51379
- // 5 minutes
51380
- });
51381
- }
51382
- function useGitHubBranches(owner, repo, enabled = true) {
51383
- return reactQuery.useQuery({
51384
- queryKey: ["github", "branches", owner, repo],
51385
- queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}/branches`),
51386
- enabled: enabled && !!owner && !!repo,
51387
- staleTime: 6e4
51388
- // 1 minute
51389
- });
51390
- }
51391
-
51392
- exports.ALMADAR_DND_MIME = ALMADAR_DND_MIME;
51393
49131
  exports.ActionButton = ActionButton;
51394
49132
  exports.ActionButtons = ActionButtons;
51395
49133
  exports.ActionCard = Card2;
@@ -51410,7 +49148,6 @@ exports.CombatLog = CombatLog;
51410
49148
  exports.ComboCounter = ComboCounter;
51411
49149
  exports.ControlButton = ControlButton;
51412
49150
  exports.CraftingRecipe = CraftingRecipe;
51413
- exports.DEFAULT_SLOTS = DEFAULT_SLOTS;
51414
49151
  exports.DPad = DPad;
51415
49152
  exports.DamageNumber = DamageNumber;
51416
49153
  exports.DataGrid = DataGrid;
@@ -51504,80 +49241,36 @@ exports.applyTemporaryEffect = applyTemporaryEffect;
51504
49241
  exports.calculateAttackTargets = calculateAttackTargets;
51505
49242
  exports.calculateDamage = calculateDamage;
51506
49243
  exports.calculateValidMoves = calculateValidMoves;
51507
- exports.clearEntities = clearEntities;
51508
49244
  exports.cn = cn;
51509
49245
  exports.combatAnimations = combatAnimations;
51510
49246
  exports.combatClasses = combatClasses;
51511
49247
  exports.combatEffects = combatEffects;
51512
49248
  exports.createInitialGameState = createInitialGameState;
51513
- exports.createTranslate = createTranslate;
51514
49249
  exports.createUnitAnimationState = createUnitAnimationState;
51515
49250
  exports.drawSprite = drawSprite;
51516
49251
  exports.generateCombatMessage = generateCombatMessage;
51517
- exports.getAllEntities = getAllEntities;
51518
- exports.getByType = getByType;
51519
49252
  exports.getCurrentFrame = getCurrentFrame;
51520
- exports.getEntity = getEntity;
51521
- exports.getSingleton = getSingleton;
51522
49253
  exports.getTileDimensions = getTileDimensions;
51523
49254
  exports.inferDirection = inferDirection;
51524
49255
  exports.isoToScreen = isoToScreen;
51525
49256
  exports.mapBookData = mapBookData;
51526
- exports.parseQueryBinding = parseQueryBinding;
51527
- exports.removeEntity = removeEntity;
51528
49257
  exports.resolveFieldMap = resolveFieldMap;
51529
49258
  exports.resolveFrame = resolveFrame;
51530
49259
  exports.resolveSheetDirection = resolveSheetDirection;
51531
49260
  exports.screenToIso = screenToIso;
51532
- exports.spawnEntity = spawnEntity;
51533
49261
  exports.tickAnimationState = tickAnimationState;
51534
49262
  exports.transitionAnimation = transitionAnimation;
51535
- exports.updateEntity = updateEntity;
51536
- exports.updateSingleton = updateSingleton;
51537
- exports.useAgentChat = useAgentChat;
51538
49263
  exports.useAnchorRect = useAnchorRect;
51539
- exports.useAuthContext = useAuthContext;
51540
49264
  exports.useBattleState = useBattleState;
51541
49265
  exports.useCamera = useCamera;
51542
- exports.useCompile = useCompile;
51543
- exports.useConnectGitHub = useConnectGitHub;
51544
- exports.useDeepAgentGeneration = useDeepAgentGeneration;
51545
- exports.useDisconnectGitHub = useDisconnectGitHub;
51546
- exports.useDragReorder = useDragReorder;
51547
- exports.useDraggable = useDraggable;
51548
- exports.useDropZone = useDropZone;
51549
- exports.useEmitEvent = useEmitEvent;
51550
- exports.useEntities = useEntities;
51551
- exports.useEntitiesByType = useEntitiesByType;
51552
- exports.useEntityById = useEntity;
51553
- exports.useEventBus = useEventBus;
51554
- exports.useEventListener = useEventListener;
51555
- exports.useExtensions = useExtensions;
51556
- exports.useFileEditor = useFileEditor;
51557
- exports.useFileSystem = useFileSystem;
51558
49266
  exports.useGameAudio = useGameAudio;
51559
49267
  exports.useGameAudioContext = useGameAudioContext;
51560
- exports.useGitHubBranches = useGitHubBranches;
51561
- exports.useGitHubRepo = useGitHubRepo;
51562
- exports.useGitHubRepos = useGitHubRepos;
51563
- exports.useGitHubStatus = useGitHubStatus;
51564
49268
  exports.useImageCache = useImageCache;
51565
- exports.useInfiniteScroll = useInfiniteScroll;
51566
- exports.useInput = useInput;
51567
- exports.useLongPress = useLongPress;
51568
- exports.useOrbitalHistory = useOrbitalHistory;
51569
- exports.usePhysics = usePhysics;
51570
49269
  exports.usePhysics2D = usePhysics2D;
51571
- exports.usePinchZoom = usePinchZoom;
51572
- exports.usePlayer = usePlayer;
51573
- exports.usePreview = usePreview;
51574
- exports.usePullToRefresh = usePullToRefresh;
51575
- exports.useQuerySingleton = useQuerySingleton;
51576
- exports.useSingletonEntity = useSingletonEntity;
51577
49270
  exports.useSpriteAnimations = useSpriteAnimations;
51578
- exports.useSwipeGesture = useSwipeGesture;
51579
- exports.useTraitListens = useTraitListens;
51580
- exports.useTranslate = useTranslate;
51581
- exports.useUIEvents = useUIEvents;
51582
- exports.useUISlotManager = useUISlotManager;
51583
- exports.useValidation = useValidation;
49271
+ Object.keys(hooks).forEach(function (k) {
49272
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
49273
+ enumerable: true,
49274
+ get: function () { return hooks[k]; }
49275
+ });
49276
+ });