@almadar/ui 5.21.10 → 5.21.12

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.
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import * as React79 from 'react';
3
- import React79__default, { useContext, useMemo, useRef, useEffect, useCallback, createContext, Suspense, useState, lazy, useSyncExternalStore, useLayoutEffect, useId } from 'react';
3
+ import React79__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, lazy, createContext, useLayoutEffect, useId, useSyncExternalStore } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
@@ -10,6 +10,8 @@ import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCir
10
10
  import * as PhosphorIcons from '@phosphor-icons/react';
11
11
  import * as TablerIcons from '@tabler/icons-react';
12
12
  import * as FaIcons from 'react-icons/fa';
13
+ import { useTranslate } from '@almadar/ui/hooks';
14
+ export * from '@almadar/ui/hooks';
13
15
  import { evaluate, createMinimalContext } from '@almadar/evaluator';
14
16
  import { createPortal } from 'react-dom';
15
17
  import { Link, Outlet, useLocation } from 'react-router-dom';
@@ -45,7 +47,6 @@ import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
45
47
  import { useUISlots } from '@almadar/ui/context';
46
48
  import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
47
49
  import { context, Canvas } from '@react-three/fiber';
48
- import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
49
50
 
50
51
  var __defProp = Object.defineProperty;
51
52
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1110,11 +1111,11 @@ function ensureObserver() {
1110
1111
  });
1111
1112
  cachedFamily = getCurrentIconFamily();
1112
1113
  }
1113
- function subscribeIconFamily(notify2) {
1114
+ function subscribeIconFamily(notify) {
1114
1115
  ensureObserver();
1115
- listeners.add(notify2);
1116
+ listeners.add(notify);
1116
1117
  return () => {
1117
- listeners.delete(notify2);
1118
+ listeners.delete(notify);
1118
1119
  };
1119
1120
  }
1120
1121
  function getIconFamilySnapshot() {
@@ -2030,521 +2031,11 @@ var init_Button = __esm({
2030
2031
  Button.displayName = "Button";
2031
2032
  }
2032
2033
  });
2033
-
2034
- // locales/en.json
2035
- var en_default;
2036
- var init_en = __esm({
2037
- "locales/en.json"() {
2038
- en_default = {
2039
- $meta: {
2040
- locale: "en",
2041
- direction: "ltr"
2042
- },
2043
- "common.save": "Save",
2044
- "common.cancel": "Cancel",
2045
- "common.delete": "Delete",
2046
- "common.close": "Close",
2047
- "common.confirm": "Are you sure?",
2048
- "common.create": "Create",
2049
- "common.edit": "Edit",
2050
- "common.view": "View",
2051
- "common.add": "Add",
2052
- "common.remove": "Remove",
2053
- "common.search": "Search...",
2054
- "common.filter": "Filter",
2055
- "common.actions": "Actions",
2056
- "common.yes": "Yes",
2057
- "common.no": "No",
2058
- "common.selected": "selected",
2059
- "common.ok": "OK",
2060
- "common.done": "Done",
2061
- "common.apply": "Apply",
2062
- "common.reset": "Reset",
2063
- "common.refresh": "Refresh",
2064
- "common.export": "Export",
2065
- "common.import": "Import",
2066
- "common.copy": "Copy",
2067
- "common.settings": "Settings",
2068
- "nav.previous": "Previous",
2069
- "nav.next": "Next",
2070
- "nav.back": "Back",
2071
- "nav.home": "Home",
2072
- "form.submit": "Submit",
2073
- "form.saving": "Saving...",
2074
- "form.required": "This field is required",
2075
- "form.invalidEmail": "Enter a valid email address",
2076
- "form.selectPlaceholder": "Select {{label}}...",
2077
- "form.searchPlaceholder": "Search {{entity}}...",
2078
- "table.empty.title": "No items found",
2079
- "table.empty.description": "No items to display.",
2080
- "table.search.placeholder": "Search...",
2081
- "table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
2082
- "table.pagination.page": "Page {{page}} of {{totalPages}}",
2083
- "table.bulk.selected": "{{count}} selected",
2084
- "table.loading": "Loading...",
2085
- "status.loading": "Loading...",
2086
- "status.scheduled": "Scheduled",
2087
- "status.inProgress": "In Progress",
2088
- "status.completed": "Completed",
2089
- "status.cancelled": "Cancelled",
2090
- "status.pending": "Pending",
2091
- "status.active": "Active",
2092
- "status.inactive": "Inactive",
2093
- "status.draft": "Draft",
2094
- "status.archived": "Archived",
2095
- "error.generic": "Something went wrong",
2096
- "error.retry": "Try again",
2097
- "error.notFound": "Not found",
2098
- "error.loadFailed": "Failed to load: {{message}}",
2099
- "error.configMissing": "Configuration not found for: {{id}}",
2100
- "common.loading": "Loading...",
2101
- "common.showMore": "Show More",
2102
- "common.showLess": "Show Less",
2103
- "common.noResults": "No results found",
2104
- "common.saveChanges": "Save Changes",
2105
- "common.retry": "Retry",
2106
- "common.open": "Open",
2107
- "common.back": "Back",
2108
- "empty.noItems": "No items",
2109
- "empty.noData": "No data available",
2110
- "empty.noItemsYet": "No items yet",
2111
- "empty.noItemsAdded": "No items added yet",
2112
- "empty.noOptionsFound": "No options found",
2113
- "list.addItemPlaceholder": "Add new item...",
2114
- "error.occurred": "An error occurred",
2115
- "error.failedToLoad": "Failed to load data",
2116
- "wizard.back": "Back",
2117
- "wizard.next": "Next",
2118
- "wizard.complete": "Complete",
2119
- "wizard.stepOf": "Step {{current}} of {{total}}",
2120
- "pagination.previous": "Previous",
2121
- "pagination.next": "Next",
2122
- "pagination.total": "Total:",
2123
- "pagination.show": "Show:",
2124
- "pagination.goTo": "Go to:",
2125
- "pagination.go": "Go",
2126
- "auth.signIn": "Sign in",
2127
- "auth.signOut": "Sign out",
2128
- "dialog.confirm": "Confirm",
2129
- "dialog.cancel": "Cancel",
2130
- "dialog.loading": "Loading...",
2131
- "dialog.delete.title": "Delete {{item}}?",
2132
- "dialog.delete.message": "This action cannot be undone.",
2133
- "trait.availableActions": "Available Actions",
2134
- "trait.transitions": "Transitions",
2135
- "trait.availableNow": "Available now",
2136
- "book.startReading": "Start Reading",
2137
- "book.tableOfContents": "Table of Contents",
2138
- "book.partNumber": "Part {{number}}",
2139
- "book.print": "Print",
2140
- "book.previousPage": "Previous page",
2141
- "book.nextPage": "Next page",
2142
- "quiz.showAnswer": "Show answer",
2143
- "quiz.hideAnswer": "Hide answer",
2144
- "aria.closeModal": "Close modal",
2145
- "aria.closeToast": "Dismiss toast",
2146
- "aria.closeAlert": "Dismiss alert",
2147
- "aria.removeFilter": "Remove filter",
2148
- "aria.closeDrawer": "Close drawer",
2149
- "aria.closePanel": "Close panel",
2150
- "aria.previousImage": "Previous image",
2151
- "aria.nextImage": "Next image",
2152
- "aria.dismiss": "Dismiss",
2153
- "aria.previousSlide": "Previous slide",
2154
- "aria.nextSlide": "Next slide",
2155
- "aria.previousDays": "Previous days",
2156
- "aria.nextDays": "Next days",
2157
- "aria.decrease": "Decrease",
2158
- "aria.increase": "Increase",
2159
- "aria.breadcrumb": "Breadcrumb",
2160
- "aria.tableOfContents": "Table of contents",
2161
- "aria.docsSidebar": "Documentation sidebar",
2162
- "aria.selectAllRows": "Select all rows",
2163
- "aria.selectAll": "Select all",
2164
- "aria.upvote": "Upvote",
2165
- "aria.downvote": "Downvote",
2166
- "aria.qrScanner": "QR scanner",
2167
- "aria.mockScanDev": "Mock scan (dev)",
2168
- "aria.openMenu": "Open menu",
2169
- "aria.closeMenu": "Close menu",
2170
- "aria.openSidebar": "Open sidebar",
2171
- "sidebar.expand": "Expand sidebar",
2172
- "sidebar.collapse": "Collapse sidebar",
2173
- "sidebar.close": "Close sidebar",
2174
- "loading.items": "Loading items...",
2175
- "card.imageAlt": "Image",
2176
- "canvas.emptyMessage": "No content",
2177
- "canvas.errorTitle": "Canvas error",
2178
- "book.noData": "No data",
2179
- "common.notifications": "Notifications",
2180
- "common.remaining": "{{count}} remaining",
2181
- "error.somethingWentWrong": "Something went wrong",
2182
- "error.loadingItems": "Loading items...",
2183
- "error.noItemsFound": "No items found",
2184
- "debug.noEntityData": "No entity data",
2185
- "debug.noEntities": "No entities",
2186
- "debug.noTicks": "No ticks registered",
2187
- "debug.noActiveTraits": "No active traits",
2188
- "debug.noGuardEvaluations": "No guard evaluations",
2189
- "debug.noBridgeData": "No bridge data",
2190
- "debug.status": "Status",
2191
- "debug.eventsForwarded": "Events Forwarded (Client \u2192 Server)",
2192
- "debug.eventsReceived": "Events Received (Server \u2192 Client)",
2193
- "debug.lastHeartbeat": "Last Heartbeat",
2194
- "debug.noEventsYet": "No events yet",
2195
- "debug.noTransitionsRecorded": "No transitions recorded",
2196
- "debug.noVerificationChecks": "No verification checks yet",
2197
- "display.chartError": "Chart error",
2198
- "display.codeViewerError": "Code viewer error",
2199
- "display.noCode": "No code",
2200
- "display.documentError": "Document error",
2201
- "display.noDocument": "No document",
2202
- "display.graphError": "Graph error",
2203
- "display.noGraphData": "No graph data",
2204
- "display.galleryError": "Gallery error",
2205
- "display.noMedia": "No media",
2206
- "display.meterError": "Meter error",
2207
- "display.signaturePadError": "Signature pad error",
2208
- "display.timelineError": "Timeline error",
2209
- "display.noEvents": "No events",
2210
- "template.features": "Features",
2211
- "template.howItWorks": "How It Works",
2212
- "template.showcase": "Showcase",
2213
- "template.faq": "Frequently Asked Questions",
2214
- "template.ourTeam": "Our Team",
2215
- "template.caseStudies": "Case Studies",
2216
- "richBlockEditor.toolbar.text": "Text",
2217
- "richBlockEditor.toolbar.h1": "H1",
2218
- "richBlockEditor.toolbar.h2": "H2",
2219
- "richBlockEditor.toolbar.h3": "H3",
2220
- "richBlockEditor.toolbar.bulletList": "Bullet list",
2221
- "richBlockEditor.toolbar.numbered": "Numbered",
2222
- "richBlockEditor.toolbar.quote": "Quote",
2223
- "richBlockEditor.toolbar.code": "Code",
2224
- "richBlockEditor.toolbar.divider": "Divider",
2225
- "richBlockEditor.toolbar.image": "Image",
2226
- "richBlockEditor.blockType.paragraph": "Text",
2227
- "richBlockEditor.blockType.heading1": "Heading 1",
2228
- "richBlockEditor.blockType.heading2": "Heading 2",
2229
- "richBlockEditor.blockType.heading3": "Heading 3",
2230
- "richBlockEditor.blockType.bulletList": "Bullet list",
2231
- "richBlockEditor.blockType.numberedList": "Numbered list",
2232
- "richBlockEditor.blockType.quote": "Quote",
2233
- "richBlockEditor.blockType.code": "Code",
2234
- "richBlockEditor.blockType.divider": "Divider",
2235
- "richBlockEditor.blockType.image": "Image",
2236
- "richBlockEditor.blockActions": "Block actions",
2237
- "richBlockEditor.duplicate": "Duplicate",
2238
- "richBlockEditor.turnInto": "Turn into",
2239
- "richBlockEditor.placeholder.heading1": "Heading 1",
2240
- "richBlockEditor.placeholder.heading2": "Heading 2",
2241
- "richBlockEditor.placeholder.heading3": "Heading 3",
2242
- "richBlockEditor.placeholder.quote": "Quote",
2243
- "richBlockEditor.placeholder.code": "Enter code",
2244
- "richBlockEditor.placeholder.paragraph": "Start writing...",
2245
- "richBlockEditor.placeholder.listItem": "List item",
2246
- "richBlockEditor.placeholder.caption": "Caption (optional)",
2247
- "richBlockEditor.aria.heading1Block": "Heading 1 block",
2248
- "richBlockEditor.aria.heading2Block": "Heading 2 block",
2249
- "richBlockEditor.aria.heading3Block": "Heading 3 block",
2250
- "richBlockEditor.aria.quoteBlock": "Quote block",
2251
- "richBlockEditor.aria.codeBlock": "Code block",
2252
- "richBlockEditor.aria.codeLanguage": "Code language",
2253
- "richBlockEditor.aria.imageUrl": "Image URL",
2254
- "richBlockEditor.aria.imageCaption": "Image caption",
2255
- "richBlockEditor.aria.listItem": "List item",
2256
- "richBlockEditor.aria.removeListItem": "Remove list item",
2257
- "richBlockEditor.aria.paragraphBlock": "Paragraph block",
2258
- "richBlockEditor.embeddedImage": "Embedded image",
2259
- "richBlockEditor.noImageUrl": "No image URL set",
2260
- "richBlockEditor.addItem": "Add item",
2261
- "richBlockEditor.insertParagraphBelow": "Insert paragraph below",
2262
- "richBlockEditor.editorToolbar": "Block editor toolbar",
2263
- "richBlockEditor.insertEntry": "Insert {{label}}",
2264
- "versionDiff.compare": "Compare",
2265
- "versionDiff.to": "to",
2266
- "versionDiff.beforeRevision": "Before revision",
2267
- "versionDiff.afterRevision": "After revision",
2268
- "versionDiff.switchToInline": "Switch to inline view",
2269
- "versionDiff.switchToSideBySide": "Switch to side-by-side view",
2270
- "versionDiff.revert": "Revert",
2271
- "versionDiff.byAuthor": " by {{author}}",
2272
- "violationAlert.actionType.measure": "Corrective Measure",
2273
- "violationAlert.actionType.admin": "Administrative Action",
2274
- "violationAlert.actionType.penalty": "Penalty Proceedings",
2275
- "violationAlert.fallbackMessage": "Violation",
2276
- "violationAlert.adminLabel": "Admin:",
2277
- "violationAlert.penaltyLabel": "Penalty:",
2278
- "violationAlert.goToField": "Go to field",
2279
- "branchingLogic.title": "Branching logic",
2280
- "branchingLogic.if": "If",
2281
- "branchingLogic.goTo": "go to",
2282
- "branchingLogic.rules": "Rules",
2283
- "branchingLogic.logicGraph": "Logic graph",
2284
- "branchingLogic.addRule": "Add rule",
2285
- "branchingLogic.deleteRule": "Delete rule",
2286
- "branchingLogic.endOfSurvey": "End of survey",
2287
- "branchingLogic.brokenReference": "Broken reference",
2288
- "branchingLogic.selectQuestion": "Select question",
2289
- "branchingLogic.selectTarget": "Select target",
2290
- "branchingLogic.selectValue": "Select value",
2291
- "branchingLogic.addValue": "Add value",
2292
- "branchingLogic.value": "Value",
2293
- "branchingLogic.typeValuePressEnter": "Type value, press Enter",
2294
- "branchingLogic.operatorEquals": "equals",
2295
- "branchingLogic.operatorNotEquals": "does not equal",
2296
- "branchingLogic.operatorContains": "contains",
2297
- "branchingLogic.operatorIn": "is one of",
2298
- "branchingLogic.graphAriaLabel": "Branching logic graph",
2299
- "branchingLogic.ruleCountOne": "{{count}} rule",
2300
- "branchingLogic.ruleCountOther": "{{count}} rules",
2301
- "branchingLogic.brokenCount": "{{count}} broken",
2302
- "branchingLogic.emptyNoQuestions": "Add questions before building branching rules.",
2303
- "branchingLogic.emptyNoRules": "No rules yet. Add a rule to define branching logic.",
2304
- "filterGroup.filters": "Filters",
2305
- "filterGroup.all": "All",
2306
- "filterGroup.clear": "Clear",
2307
- "filterGroup.clearAll": "Clear all",
2308
- "filterGroup.from": "From",
2309
- "filterGroup.to": "To",
2310
- "filterGroup.allOf": "All {{label}}",
2311
- "filterGroup.activeCount": "{{count}} active",
2312
- "debug.guardEvaluationsHint": "Guard evaluations will appear when transitions or ticks with guards execute",
2313
- "debug.expression": "Expression",
2314
- "debug.inputs": "Inputs",
2315
- "debug.trait": "Trait",
2316
- "debug.filterAll": "All",
2317
- "debug.filterPassed": "Passed",
2318
- "debug.filterFailed": "Failed",
2319
- "debug.traitsInitHint": "Traits will appear when the state machine initializes",
2320
- "debug.traitsMountHint": "Traits will appear when components using them are mounted",
2321
- "debug.activeStates": "Active States",
2322
- "debug.availableEvents": "Available Events",
2323
- "debug.noTransitionsFromState": "No transitions from current state",
2324
- "debug.guarded": "guarded",
2325
- "debug.otherEvents": "Other Events (not available from current state)",
2326
- "debug.recentTransitions": "Recent Transitions",
2327
- "debug.transitionsCount": "{{count}} transitions",
2328
- "debug.states": "States",
2329
- "debug.transitions": "Transitions",
2330
- "debug.guards": "Guards",
2331
- "debug.debugModeHint": "Debug mode may not be enabled",
2332
- "debug.entitiesSpawnHint": "Entities will appear when spawned",
2333
- "debug.singleton": "Singleton",
2334
- "debug.singletonsCount": "Singletons ({{count}})",
2335
- "debug.runtimeCount": "Runtime ({{count}})",
2336
- "debug.moreEntities": "+{{count}} more entities",
2337
- "debug.persistent": "Persistent",
2338
- "debug.loadedCount": "{{count}} loaded",
2339
- "debug.notLoaded": "not loaded",
2340
- "debug.eventsExecuteHint": "Events will appear as traits, ticks, and other systems execute",
2341
- "debug.allCount": "All ({{count}})",
2342
- "debug.autoScroll": "Auto-scroll",
2343
- "debug.transitionsProcessHint": "Transitions will appear as the state machine processes events",
2344
- "debug.transitionsRecorded": "{{count}} transitions recorded",
2345
- "debug.guardLabel": "guard:",
2346
- "debug.effectsCount": "{{count}} effects",
2347
- "debug.bridgeInitHint": "The ServerBridge has not been initialized. Bridge health will appear once the runtime connects to the server.",
2348
- "debug.never": "Never",
2349
- "debug.connected": "Connected",
2350
- "debug.disconnected": "Disconnected",
2351
- "debug.lastError": "Last Error",
2352
- "debug.totalEventsProcessed": "{{count}} total events processed",
2353
- "debug.server": "server",
2354
- "debug.clientEffectsCount": "{{count}} clientEffects",
2355
- "debug.emitLabel": "emit:",
2356
- "debug.rowsCount": "{{count}} rows",
2357
- "debug.serverResponse": "server response",
2358
- "debug.collapseVerificationTimeline": "Collapse verification timeline",
2359
- "debug.expandVerificationTimeline": "Expand verification timeline",
2360
- "debug.failCount": "{{count}} fail",
2361
- "debug.ok": "OK",
2362
- "debug.localCount": "{{count}} local",
2363
- "debug.serverCount": "{{count}} server",
2364
- "debug.waitingForTransitions": "Waiting for transitions...",
2365
- "debug.tabDispatch": "Dispatch",
2366
- "debug.tabVerify": "Verify",
2367
- "debug.tabVerifyAlert": "Verify (!)",
2368
- "debug.tabTimeline": "Timeline",
2369
- "debug.tabBridge": "Bridge",
2370
- "debug.tabTraits": "Traits",
2371
- "debug.tabTicks": "Ticks",
2372
- "debug.tabEntities": "Entities",
2373
- "debug.tabEvents": "Events",
2374
- "debug.tabGuards": "Guards",
2375
- "debug.debugger": "Debugger",
2376
- "debug.failedCount": "{{count}} failed",
2377
- "debug.traitsCount": "{{count}} traits",
2378
- "debug.idle": "Idle",
2379
- "debug.openDebugger": "Open Debugger (`)",
2380
- "debug.kflowVerifier": "KFlow Verifier",
2381
- "debug.allPassing": "All passing",
2382
- "debug.runtime": "Runtime",
2383
- "debug.close": "Close (`)",
2384
- "debug.toggleHint": "Press ` to toggle | window.__orbitalVerification for automation",
2385
- "replyTree.expandReplies": "Expand replies",
2386
- "replyTree.collapseReplies": "Collapse replies",
2387
- "replyTree.voteOnReplyBy": "Vote on reply by {{author}}",
2388
- "replyTree.replyTo": "Reply to {{author}}",
2389
- "replyTree.replyToPlaceholder": "Reply to {{author}}\u2026",
2390
- "replyTree.reply": "Reply",
2391
- "replyTree.flagReplyBy": "Flag reply by {{author}}",
2392
- "replyTree.flag": "Flag",
2393
- "replyTree.send": "Send",
2394
- "replyTree.continueThread": "Continue thread",
2395
- "replyTree.noRepliesYet": "No replies yet.",
2396
- "signaturePad.label": "Signature",
2397
- "signaturePad.helperText": "Draw your signature above",
2398
- "signaturePad.clear": "Clear",
2399
- "signaturePad.confirm": "Confirm",
2400
- "qrScanner.cameraUnavailable": "Camera unavailable",
2401
- "qrScanner.paused": "Paused",
2402
- "qrScanner.resumeScanning": "Resume scanning",
2403
- "qrScanner.pauseScanning": "Pause scanning",
2404
- "qrScanner.switchToFrontCamera": "Switch to front camera",
2405
- "qrScanner.switchToRearCamera": "Switch to rear camera",
2406
- "qrScanner.mockScan": "Mock Scan",
2407
- "docSearch.placeholder": "Search documentation...",
2408
- "stateMachine.loading": "Loading state machine\u2026",
2409
- "stateMachine.noStateMachine": "No state machine to visualize",
2410
- "avl.trigger": "Trigger",
2411
- "avl.guard": "Guard",
2412
- "avl.effects": "Effects",
2413
- "avl.props": "Props",
2414
- "avl.entity": "Entity",
2415
- "avl.traits": "Traits",
2416
- "avl.transition": "Transition",
2417
- "avl.onEntity": "on {{entity}}",
2418
- "avl.linkedTo": "linked to {{entity}}",
2419
- "avl.pressEscToZoomOut": "Press Esc to zoom out",
2420
- "avl.zoomIn": "Zoom in",
2421
- "avl.zoomOut": "Zoom out",
2422
- "avl.orbitalLabel": "Orbital: {{name}}",
2423
- "avl.orbitalLabelHighlighted": "Orbital: {{name}} (highlighted)",
2424
- "avl.noTraitData": "No trait data",
2425
- "avl.computingLayout": "Computing layout...",
2426
- "avl.noStateMachine": "No state machine",
2427
- "avl.listensFor": "listens for {{event}}",
2428
- "avl.emits": "emits {{event}}",
2429
- "avl.pageLayout": "Page Layout",
2430
- "avl.overlaySuffix": "(overlay)",
2431
- "orbPreview.previewBadge": "Preview",
2432
- "orbPreview.doubleClickToOpen": "Double-click to open",
2433
- "orbPreview.dropToAddAndOpen": "Drop to add and open",
2434
- "orbPreview.dispatching": "Coordinator is dispatching to this orbital",
2435
- "orbPreview.noPreview": "No preview available",
2436
- "orbPreview.screensCount": "{{count}} screens",
2437
- "detailView.noTransitionData": "No transition data",
2438
- "orbInspector.required": "req",
2439
- "orbInspector.addField": "Add Field",
2440
- "orbInspector.serviceMode": "Service Mode",
2441
- "orbInspector.standalone": "Standalone",
2442
- "orbInspector.embedded": "Embedded",
2443
- "orbInspector.rendersOwnUi": "Renders its own UI",
2444
- "orbInspector.headless": "Headless, wired to other behaviors",
2445
- "orbInspector.addEffect": "Add Effect",
2446
- "orbInspector.guardExpression": "Guard expression",
2447
- "orbInspector.selectPatternForStyles": "Select a pattern to view its style tokens.",
2448
- "orbInspector.tokens": "Tokens",
2449
- "orbInspector.noTokenContract": "No token contract declared for this pattern.",
2450
- "orbInspector.variant": "Variant",
2451
- "orbInspector.size": "Size",
2452
- "orbInspector.statesCount": "{{count}} states",
2453
- "orbInspector.onEntity": " on {{entity}}",
2454
- "orbInspector.projectThemeTokens": "Project theme tokens",
2455
- "orbInspector.tokenGroup.colors": "Colors",
2456
- "orbInspector.tokenGroup.radii": "Radii",
2457
- "orbInspector.tokenGroup.spacing": "Spacing",
2458
- "orbInspector.tokenGroup.shadows": "Shadows",
2459
- "orbInspector.tab.inspector": "Inspector",
2460
- "orbInspector.tab.styles": "Styles",
2461
- "orbInspector.tab.code": "Code",
2462
- "canvas.goBackToOverview": "Go back to overview",
2463
- "canvas.overview": "Overview",
2464
- "canvas.expanded": "Expanded",
2465
- "canvas.modulesCount": "{{count}} modules",
2466
- "canvas.screensCount": "{{count}} screens",
2467
- "canvas.switchToView": "Switch to {{label}} view",
2468
- "lawReference.viewFullText": "View full law text",
2469
- "statCard.defaultLabel": "Stat",
2470
- "statCard.vsLastPeriod": "vs last period",
2471
- "mediaGallery.upload": "Upload",
2472
- "mediaGallery.noMediaDescription": "No media items to display.",
2473
- "pagination.jumpPlaceholder": "Page",
2474
- "table.selectRow": "Select row {{id}}",
2475
- "card.selectItem": "Select {{item}}",
2476
- "card.itemFallback": "item",
2477
- "fileTree.noFiles": "No files",
2478
- "masterDetail.selectItem": "Select an item to view details",
2479
- "empty.createFirst": "Create your first item to get started.",
2480
- "upload.dropOrBrowse": "Drop files here or click to browse",
2481
- "upload.dropFilesHere": "Drop files here",
2482
- "upload.accepted": "Accepted: {{accept}}",
2483
- "upload.maxSize": "Max size: {{size}}",
2484
- "upload.maxFiles": "Up to {{count}} files",
2485
- "upload.error.maxFiles": "Maximum {{count}} files allowed",
2486
- "upload.error.invalidType": "Invalid file type: {{name}}",
2487
- "upload.error.tooLarge": "File too large: {{name}} (max {{size}})",
2488
- "optionConstraint.requiredOne": "Required, pick 1",
2489
- "optionConstraint.optionalOne": "Optional, pick up to 1",
2490
- "optionConstraint.pickExactly": "Pick exactly {{count}}",
2491
- "optionConstraint.pickRange": "Pick {{min}}-{{max}}",
2492
- "optionConstraint.pickAtLeast": "Pick at least {{count}}",
2493
- "optionConstraint.pickUpTo": "Pick up to {{count}}",
2494
- "optionConstraint.optional": "Optional",
2495
- "optionConstraint.outOfStock": "Out of stock",
2496
- "optionConstraint.error.pickOne": "Pick 1 option",
2497
- "optionConstraint.error.pickOnlyOne": "Pick only 1 option",
2498
- "optionConstraint.error.pickMore": "Pick at least {{count}} more",
2499
- "optionConstraint.error.removeOptions": "Remove {{count}} options",
2500
- "stateMachine.pinned": "Pinned",
2501
- "stateMachine.eventCount": "{{count}} events",
2502
- "stateMachine.externalEffects": "External Effects",
2503
- "stateMachine.legend.initial": "Initial",
2504
- "stateMachine.legend.final": "Final",
2505
- "stateMachine.legend.state": "State",
2506
- "stateMachine.legend.multiEvent": "Multi-event",
2507
- "relationSelect.selectPlaceholder": "Select..."
2508
- };
2509
- }
2510
- });
2511
- function useTranslate() {
2512
- return useContext(I18nContext);
2513
- }
2514
- function createTranslate(messages) {
2515
- return (key, params) => {
2516
- let msg = messages[key] ?? coreLocale[key] ?? key;
2517
- if (params) {
2518
- for (const [k, v] of Object.entries(params)) {
2519
- msg = msg.split(`{{${k}}}`).join(String(v));
2520
- }
2521
- }
2522
- return msg;
2523
- };
2524
- }
2525
- var _meta, coreMessages, coreLocale, I18nContext, I18nProvider;
2526
- var init_useTranslate = __esm({
2527
- "hooks/useTranslate.ts"() {
2528
- "use client";
2529
- init_en();
2530
- ({ $meta: _meta, ...coreMessages } = en_default);
2531
- coreLocale = coreMessages;
2532
- I18nContext = createContext({
2533
- locale: "en",
2534
- direction: "ltr",
2535
- t: (key) => coreLocale[key] ?? key
2536
- // core locale fallback
2537
- });
2538
- I18nContext.displayName = "I18nContext";
2539
- I18nProvider = I18nContext.Provider;
2540
- }
2541
- });
2542
2034
  var Input;
2543
2035
  var init_Input = __esm({
2544
2036
  "components/core/atoms/Input.tsx"() {
2545
2037
  init_cn();
2546
2038
  init_Icon();
2547
- init_useTranslate();
2548
2039
  Input = React79__default.forwardRef(
2549
2040
  ({
2550
2041
  className,
@@ -3019,7 +2510,6 @@ var init_FilterPill = __esm({
3019
2510
  "components/core/atoms/FilterPill.tsx"() {
3020
2511
  init_cn();
3021
2512
  init_useEventBus();
3022
- init_useTranslate();
3023
2513
  init_Icon();
3024
2514
  variantStyles4 = {
3025
2515
  default: [
@@ -4966,7 +4456,6 @@ var init_LawReferenceTooltip = __esm({
4966
4456
  init_Typography();
4967
4457
  init_Divider();
4968
4458
  init_cn();
4969
- init_useTranslate();
4970
4459
  positionStyles2 = {
4971
4460
  top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
4972
4461
  bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
@@ -6749,7 +6238,6 @@ var init_Modal = __esm({
6749
6238
  init_Overlay();
6750
6239
  init_cn();
6751
6240
  init_useEventBus();
6752
- init_useTranslate();
6753
6241
  sizeClasses6 = {
6754
6242
  sm: "max-w-md",
6755
6243
  md: "max-w-2xl",
@@ -6971,7 +6459,6 @@ var init_Drawer = __esm({
6971
6459
  init_Overlay();
6972
6460
  init_cn();
6973
6461
  init_useEventBus();
6974
- init_useTranslate();
6975
6462
  sizeWidths = {
6976
6463
  sm: "w-full sm:w-80",
6977
6464
  // 320px
@@ -7153,7 +6640,6 @@ var init_Toast = __esm({
7153
6640
  init_Badge();
7154
6641
  init_cn();
7155
6642
  init_useEventBus();
7156
- init_useTranslate();
7157
6643
  variantClasses = {
7158
6644
  success: "bg-card border-[length:var(--border-width)] border-success",
7159
6645
  error: "bg-card border-[length:var(--border-width)] border-error",
@@ -7280,7 +6766,6 @@ var init_ErrorState = __esm({
7280
6766
  init_Typography();
7281
6767
  init_Icon();
7282
6768
  init_useEventBus();
7283
- init_useTranslate();
7284
6769
  ErrorState = ({
7285
6770
  title,
7286
6771
  message,
@@ -7323,7 +6808,6 @@ var init_ErrorBoundary = __esm({
7323
6808
  "use client";
7324
6809
  init_cn();
7325
6810
  init_ErrorState();
7326
- init_useTranslate();
7327
6811
  DefaultFallback = ({ error, onRetry }) => {
7328
6812
  const { t } = useTranslate();
7329
6813
  return /* @__PURE__ */ jsx(
@@ -7473,7 +6957,6 @@ var init_Skeleton = __esm({
7473
6957
  "components/core/molecules/Skeleton.tsx"() {
7474
6958
  "use client";
7475
6959
  init_cn();
7476
- init_useTranslate();
7477
6960
  init_Box();
7478
6961
  init_Stack();
7479
6962
  init_Stack();
@@ -8123,7 +7606,6 @@ var AboutPageTemplate;
8123
7606
  var init_AboutPageTemplate = __esm({
8124
7607
  "components/marketing/templates/AboutPageTemplate.tsx"() {
8125
7608
  init_cn();
8126
- init_useTranslate();
8127
7609
  init_Stack();
8128
7610
  init_Box();
8129
7611
  init_Typography();
@@ -8228,7 +7710,6 @@ var init_Alert = __esm({
8228
7710
  init_Icon();
8229
7711
  init_Typography();
8230
7712
  init_useEventBus();
8231
- init_useTranslate();
8232
7713
  variantBorderClasses = {
8233
7714
  info: "border-info",
8234
7715
  success: "border-success",
@@ -8588,7 +8069,6 @@ var init_Menu = __esm({
8588
8069
  init_Badge();
8589
8070
  init_cn();
8590
8071
  init_useEventBus();
8591
- init_useTranslate();
8592
8072
  Menu = ({
8593
8073
  trigger,
8594
8074
  items,
@@ -8596,7 +8076,7 @@ var init_Menu = __esm({
8596
8076
  className
8597
8077
  }) => {
8598
8078
  const eventBus = useEventBus();
8599
- const { t } = useTranslate();
8079
+ const { t, direction } = useTranslate();
8600
8080
  const [isOpen, setIsOpen] = useState(false);
8601
8081
  const [activeSubMenu, setActiveSubMenu] = useState(null);
8602
8082
  const [triggerRect, setTriggerRect] = useState(null);
@@ -8650,6 +8130,18 @@ var init_Menu = __esm({
8650
8130
  "bottom-start": "top-full left-0 mt-2",
8651
8131
  "bottom-end": "top-full right-0 mt-2"
8652
8132
  };
8133
+ const rtlMirror = {
8134
+ "top-left": "top-right",
8135
+ "top-right": "top-left",
8136
+ "bottom-left": "bottom-right",
8137
+ "bottom-right": "bottom-left",
8138
+ "top-start": "top-end",
8139
+ "top-end": "top-start",
8140
+ "bottom-start": "bottom-end",
8141
+ "bottom-end": "bottom-start"
8142
+ };
8143
+ const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
8144
+ const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
8653
8145
  const triggerChild = React79__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
8654
8146
  const triggerElement = React79__default.cloneElement(
8655
8147
  triggerChild,
@@ -8677,7 +8169,7 @@ var init_Menu = __esm({
8677
8169
  onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
8678
8170
  "data-testid": item.event ? `action-${item.event}` : void 0,
8679
8171
  className: cn(
8680
- "w-full flex items-center justify-between gap-3 px-4 py-2 text-left",
8172
+ "w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
8681
8173
  "text-sm transition-colors",
8682
8174
  "hover:bg-muted",
8683
8175
  "focus:outline-none focus:bg-muted",
@@ -8696,7 +8188,7 @@ var init_Menu = __esm({
8696
8188
  }
8697
8189
  ),
8698
8190
  item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge }),
8699
- hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
8191
+ hasSubMenu && /* @__PURE__ */ jsx(Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
8700
8192
  ] })
8701
8193
  },
8702
8194
  itemId
@@ -8716,7 +8208,8 @@ var init_Menu = __esm({
8716
8208
  Box,
8717
8209
  {
8718
8210
  className: cn(
8719
- "absolute left-full top-0 ml-2 z-50",
8211
+ "absolute top-0 z-50",
8212
+ subMenuSideClass,
8720
8213
  menuContainerStyles
8721
8214
  ),
8722
8215
  children: renderMenuItems(item.subMenu)
@@ -8734,12 +8227,12 @@ var init_Menu = __esm({
8734
8227
  className: cn(
8735
8228
  "absolute z-50",
8736
8229
  menuContainerStyles,
8737
- positionClasses3[position],
8230
+ positionClasses3[effectivePosition],
8738
8231
  className
8739
8232
  ),
8740
8233
  style: {
8741
- left: position.includes("left") ? 0 : "auto",
8742
- right: position.includes("right") ? 0 : "auto"
8234
+ left: effectivePosition.includes("left") ? 0 : "auto",
8235
+ right: effectivePosition.includes("right") ? 0 : "auto"
8743
8236
  },
8744
8237
  role: "menu",
8745
8238
  children: renderMenuItems(items)
@@ -8876,7 +8369,6 @@ var init_FloatingActionButton = __esm({
8876
8369
  init_Typography();
8877
8370
  init_cn();
8878
8371
  init_useEventBus();
8879
- init_useTranslate();
8880
8372
  FloatingActionButton = ({
8881
8373
  action,
8882
8374
  actionPayload,
@@ -9058,13 +8550,13 @@ var init_MapView = __esm({
9058
8550
  shadowSize: [41, 41]
9059
8551
  });
9060
8552
  L.Marker.prototype.options.icon = defaultIcon;
9061
- const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback128, useState: useState112 } = React79__default;
8553
+ const { useEffect: useEffect69, useRef: useRef66, useCallback: useCallback113, useState: useState99 } = React79__default;
9062
8554
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9063
8555
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9064
8556
  function MapUpdater({ centerLat, centerLng, zoom }) {
9065
8557
  const map = useMap();
9066
- const prevRef = useRef68({ centerLat, centerLng, zoom });
9067
- useEffect74(() => {
8558
+ const prevRef = useRef66({ centerLat, centerLng, zoom });
8559
+ useEffect69(() => {
9068
8560
  const prev = prevRef.current;
9069
8561
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
9070
8562
  map.setView([centerLat, centerLng], zoom);
@@ -9075,7 +8567,7 @@ var init_MapView = __esm({
9075
8567
  }
9076
8568
  function MapClickHandler({ onMapClick }) {
9077
8569
  const map = useMap();
9078
- useEffect74(() => {
8570
+ useEffect69(() => {
9079
8571
  if (!onMapClick) return;
9080
8572
  const handler = (e) => {
9081
8573
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -9103,8 +8595,8 @@ var init_MapView = __esm({
9103
8595
  showAttribution = true
9104
8596
  }) {
9105
8597
  const eventBus = useEventBus2();
9106
- const [clickedPosition, setClickedPosition] = useState112(null);
9107
- const handleMapClick = useCallback128((lat, lng) => {
8598
+ const [clickedPosition, setClickedPosition] = useState99(null);
8599
+ const handleMapClick = useCallback113((lat, lng) => {
9108
8600
  if (showClickedPin) {
9109
8601
  setClickedPosition({ lat, lng });
9110
8602
  }
@@ -9113,7 +8605,7 @@ var init_MapView = __esm({
9113
8605
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9114
8606
  }
9115
8607
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9116
- const handleMarkerClick = useCallback128((marker) => {
8608
+ const handleMarkerClick = useCallback113((marker) => {
9117
8609
  onMarkerClick?.(marker);
9118
8610
  if (markerClickEvent) {
9119
8611
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -9979,7 +9471,6 @@ var init_ActionTile = __esm({
9979
9471
  "components/game/organisms/puzzles/sequencer/ActionTile.tsx"() {
9980
9472
  init_atoms2();
9981
9473
  init_cn();
9982
- init_useTranslate();
9983
9474
  DRAG_MIME = "application/x-almadar-slot-item";
9984
9475
  SIZE_CONFIG = {
9985
9476
  sm: { px: "px-2 py-1", icon: "text-lg", text: "text-xs" },
@@ -10017,7 +9508,6 @@ var init_ActionPalette = __esm({
10017
9508
  "components/game/organisms/puzzles/sequencer/ActionPalette.tsx"() {
10018
9509
  init_atoms2();
10019
9510
  init_cn();
10020
- init_useTranslate();
10021
9511
  init_ActionTile();
10022
9512
  ActionPalette.displayName = "ActionPalette";
10023
9513
  }
@@ -10027,7 +9517,6 @@ var init_AuthLayout = __esm({
10027
9517
  "components/core/templates/AuthLayout.tsx"() {
10028
9518
  "use client";
10029
9519
  init_cn();
10030
- init_useTranslate();
10031
9520
  init_Box();
10032
9521
  init_Stack();
10033
9522
  init_Typography();
@@ -10172,7 +9661,6 @@ var init_LoadingState = __esm({
10172
9661
  init_atoms2();
10173
9662
  init_Stack();
10174
9663
  init_Typography();
10175
- init_useTranslate();
10176
9664
  LoadingState = ({
10177
9665
  title,
10178
9666
  message,
@@ -11255,7 +10743,6 @@ var init_IsometricCanvas = __esm({
11255
10743
  "use client";
11256
10744
  init_cn();
11257
10745
  init_useEventBus();
11258
- init_useTranslate();
11259
10746
  init_Box();
11260
10747
  init_Stack();
11261
10748
  init_Icon();
@@ -11619,7 +11106,6 @@ var init_BattleBoard = __esm({
11619
11106
  "use client";
11620
11107
  init_cn();
11621
11108
  init_useEventBus();
11622
- init_useTranslate();
11623
11109
  init_Box();
11624
11110
  init_Button();
11625
11111
  init_Typography();
@@ -12379,7 +11865,6 @@ var log4, SWIM_GUTTER, CENTER_W, BehaviorView;
12379
11865
  var init_BehaviorView = __esm({
12380
11866
  "components/avl/molecules/BehaviorView.tsx"() {
12381
11867
  "use client";
12382
- init_useTranslate();
12383
11868
  init_AvlState();
12384
11869
  init_AvlTransitionLane();
12385
11870
  init_AvlSwimLane();
@@ -12494,7 +11979,6 @@ var MIN_DIAGRAM_WIDTH, ScaledDiagram;
12494
11979
  var init_ScaledDiagram = __esm({
12495
11980
  "components/core/molecules/ScaledDiagram.tsx"() {
12496
11981
  init_Box();
12497
- init_useTranslate();
12498
11982
  init_cn();
12499
11983
  MIN_DIAGRAM_WIDTH = 200;
12500
11984
  ScaledDiagram = ({
@@ -12637,7 +12121,6 @@ var init_CodeBlock = __esm({
12637
12121
  init_Textarea();
12638
12122
  init_Icon();
12639
12123
  init_useEventBus();
12640
- init_useTranslate();
12641
12124
  SyntaxHighlighter.registerLanguage("json", langJson);
12642
12125
  SyntaxHighlighter.registerLanguage("javascript", langJavascript);
12643
12126
  SyntaxHighlighter.registerLanguage("js", langJavascript);
@@ -13144,7 +12627,6 @@ var init_MarkdownContent = __esm({
13144
12627
  init_katex_min();
13145
12628
  init_Box();
13146
12629
  init_CodeBlock();
13147
- init_useTranslate();
13148
12630
  init_cn();
13149
12631
  MarkdownContent = React79__default.memo(
13150
12632
  ({ content, direction, className }) => {
@@ -13449,7 +12931,6 @@ var init_Card2 = __esm({
13449
12931
  "components/core/molecules/Card.tsx"() {
13450
12932
  "use client";
13451
12933
  init_useEventBus();
13452
- init_useTranslate();
13453
12934
  init_useLongPress();
13454
12935
  Card2.displayName = "Card";
13455
12936
  }
@@ -13463,7 +12944,6 @@ var init_QuizBlock = __esm({
13463
12944
  init_Button();
13464
12945
  init_Icon();
13465
12946
  init_Box();
13466
- init_useTranslate();
13467
12947
  init_cn();
13468
12948
  QuizBlock = ({
13469
12949
  question,
@@ -13506,7 +12986,6 @@ var init_StateMachineView = __esm({
13506
12986
  init_Typography();
13507
12987
  init_Button();
13508
12988
  init_Icon();
13509
- init_useTranslate();
13510
12989
  init_useEventBus();
13511
12990
  init_cn();
13512
12991
  StateNode = ({ state, config }) => {
@@ -14873,7 +14352,6 @@ var init_JazariStateMachine = __esm({
14873
14352
  init_StateMachineView();
14874
14353
  init_visualizer();
14875
14354
  init_svg_paths();
14876
- init_useTranslate();
14877
14355
  init_cn();
14878
14356
  JAZARI_VISUALIZER_CONFIG = {
14879
14357
  ...DEFAULT_CONFIG,
@@ -15029,7 +14507,6 @@ var init_ContentRenderer = __esm({
15029
14507
  init_ScaledDiagram();
15030
14508
  init_JazariStateMachine();
15031
14509
  init_parseContentSegments();
15032
- init_useTranslate();
15033
14510
  init_cn();
15034
14511
  ContentRenderer = ({
15035
14512
  content,
@@ -15123,7 +14600,6 @@ var init_BookChapterView = __esm({
15123
14600
  init_ScaledDiagram();
15124
14601
  init_ContentRenderer();
15125
14602
  init_JazariStateMachine();
15126
- init_useTranslate();
15127
14603
  init_cn();
15128
14604
  BookChapterView = ({
15129
14605
  chapter,
@@ -15162,7 +14638,6 @@ var init_BookCoverPage = __esm({
15162
14638
  init_Typography();
15163
14639
  init_Button();
15164
14640
  init_Box();
15165
- init_useTranslate();
15166
14641
  init_cn();
15167
14642
  BookCoverPage = ({
15168
14643
  title,
@@ -15242,7 +14717,6 @@ var init_BookNavBar = __esm({
15242
14717
  init_Typography();
15243
14718
  init_ProgressBar();
15244
14719
  init_Box();
15245
- init_useTranslate();
15246
14720
  init_cn();
15247
14721
  BookNavBar = ({
15248
14722
  currentPage,
@@ -15344,7 +14818,6 @@ var init_BookTableOfContents = __esm({
15344
14818
  init_Button();
15345
14819
  init_Box();
15346
14820
  init_Badge();
15347
- init_useTranslate();
15348
14821
  init_cn();
15349
14822
  BookTableOfContents = ({
15350
14823
  parts,
@@ -15404,7 +14877,6 @@ var init_EmptyState = __esm({
15404
14877
  init_Stack();
15405
14878
  init_Typography();
15406
14879
  init_useEventBus();
15407
- init_useTranslate();
15408
14880
  ICON_NAME_ALIASES = {
15409
14881
  check: "check-circle",
15410
14882
  error: "x-circle",
@@ -15575,7 +15047,6 @@ var init_BookViewer = __esm({
15575
15047
  init_Box();
15576
15048
  init_Stack();
15577
15049
  init_useEventBus();
15578
- init_useTranslate();
15579
15050
  init_cn();
15580
15051
  init_BookCoverPage();
15581
15052
  init_BookTableOfContents();
@@ -16007,7 +15478,6 @@ var init_BranchingLogicBuilder = __esm({
16007
15478
  init_FilterPill();
16008
15479
  init_Box();
16009
15480
  init_useEventBus();
16010
- init_useTranslate();
16011
15481
  init_cn();
16012
15482
  END_OF_SURVEY = "end-of-survey";
16013
15483
  RuleRow = ({
@@ -16460,7 +15930,6 @@ var init_Breadcrumb = __esm({
16460
15930
  init_Typography();
16461
15931
  init_cn();
16462
15932
  init_useEventBus();
16463
- init_useTranslate();
16464
15933
  Breadcrumb = ({
16465
15934
  items,
16466
15935
  separator = "chevron-right",
@@ -16696,7 +16165,6 @@ var init_BuilderBoard = __esm({
16696
16165
  "components/game/organisms/puzzles/builder/BuilderBoard.tsx"() {
16697
16166
  init_atoms2();
16698
16167
  init_useEventBus();
16699
- init_useTranslate();
16700
16168
  BuilderBoard.displayName = "BuilderBoard";
16701
16169
  }
16702
16170
  });
@@ -17174,7 +16642,6 @@ var init_CalendarGrid = __esm({
17174
16642
  init_TimeSlotCell();
17175
16643
  init_useEventBus();
17176
16644
  init_useSwipeGesture();
17177
- init_useTranslate();
17178
16645
  SHORT_DATE = { month: "short", day: "numeric" };
17179
16646
  CalendarGrid.displayName = "CalendarGrid";
17180
16647
  }
@@ -18483,7 +17950,6 @@ var init_Pagination = __esm({
18483
17950
  init_Stack();
18484
17951
  init_cn();
18485
17952
  init_useEventBus();
18486
- init_useTranslate();
18487
17953
  Pagination = ({
18488
17954
  currentPage,
18489
17955
  totalPages,
@@ -18687,7 +18153,6 @@ var init_CardGrid = __esm({
18687
18153
  init_cn();
18688
18154
  init_getNestedValue();
18689
18155
  init_useEventBus();
18690
- init_useTranslate();
18691
18156
  init_atoms2();
18692
18157
  init_Badge();
18693
18158
  init_Box();
@@ -18916,7 +18381,6 @@ var init_Carousel = __esm({
18916
18381
  init_cn();
18917
18382
  init_useEventBus();
18918
18383
  init_useSwipeGesture();
18919
- init_useTranslate();
18920
18384
  init_Box();
18921
18385
  init_Stack();
18922
18386
  init_Button();
@@ -19153,7 +18617,6 @@ var init_CaseStudyOrganism = __esm({
19153
18617
  "use client";
19154
18618
  init_cn();
19155
18619
  init_useEventBus();
19156
- init_useTranslate();
19157
18620
  init_Stack();
19158
18621
  init_Typography();
19159
18622
  init_SimpleGrid();
@@ -19358,7 +18821,6 @@ var init_Chart = __esm({
19358
18821
  init_ErrorState();
19359
18822
  init_EmptyState();
19360
18823
  init_useEventBus();
19361
- init_useTranslate();
19362
18824
  CHART_COLORS = [
19363
18825
  "var(--color-primary)",
19364
18826
  "var(--color-success)",
@@ -20312,7 +19774,6 @@ var init_ClassifierBoard = __esm({
20312
19774
  "components/game/organisms/puzzles/classifier/ClassifierBoard.tsx"() {
20313
19775
  init_atoms2();
20314
19776
  init_useEventBus();
20315
- init_useTranslate();
20316
19777
  ClassifierBoard.displayName = "ClassifierBoard";
20317
19778
  }
20318
19779
  });
@@ -20344,7 +19805,6 @@ var init_CodeView = __esm({
20344
19805
  "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
20345
19806
  init_atoms2();
20346
19807
  init_cn();
20347
- init_useTranslate();
20348
19808
  CodeView.displayName = "CodeView";
20349
19809
  }
20350
19810
  });
@@ -20358,7 +19818,6 @@ var init_Tabs = __esm({
20358
19818
  init_Box();
20359
19819
  init_cn();
20360
19820
  init_useEventBus();
20361
- init_useTranslate();
20362
19821
  Tabs = ({
20363
19822
  items,
20364
19823
  tabs,
@@ -20535,7 +19994,6 @@ var init_CodeViewer = __esm({
20535
19994
  init_EmptyState();
20536
19995
  init_Tabs();
20537
19996
  init_useEventBus();
20538
- init_useTranslate();
20539
19997
  DIFF_STYLES = {
20540
19998
  add: {
20541
19999
  bg: "bg-success/10",
@@ -20964,7 +20422,6 @@ var init_ConfirmDialog = __esm({
20964
20422
  init_Box();
20965
20423
  init_Stack();
20966
20424
  init_cn();
20967
- init_useTranslate();
20968
20425
  variantConfig = {
20969
20426
  danger: {
20970
20427
  icon: Trash2,
@@ -21570,7 +21027,6 @@ var init_DashboardGrid = __esm({
21570
21027
  "components/core/organisms/layout/DashboardGrid.tsx"() {
21571
21028
  init_cn();
21572
21029
  init_Box();
21573
- init_useTranslate();
21574
21030
  gapStyles5 = {
21575
21031
  sm: "gap-2",
21576
21032
  md: "gap-4",
@@ -21664,7 +21120,6 @@ var init_DashboardLayout = __esm({
21664
21120
  init_Icon();
21665
21121
  init_useAuthContext();
21666
21122
  init_useEventBus();
21667
- init_useTranslate();
21668
21123
  init_CurrentPagePathContext();
21669
21124
  DashboardLayout = ({
21670
21125
  appName = "{{APP_TITLE}}",
@@ -21721,12 +21176,8 @@ var init_DashboardLayout = __esm({
21721
21176
  const location = useLocation();
21722
21177
  const ctxPagePath = useCurrentPagePath();
21723
21178
  const activePath = currentPath ?? ctxPagePath ?? location.pathname;
21724
- const { user: authUser, signOut: authSignOut } = useAuthContext();
21725
- const user = userProp || (authUser ? {
21726
- name: authUser.displayName || authUser.email?.split("@")[0] || "User",
21727
- email: authUser.email || "",
21728
- avatar: authUser.photoURL || void 0
21729
- } : null);
21179
+ const { signOut: authSignOut } = useAuthContext();
21180
+ const user = userProp || (null);
21730
21181
  const { t } = useTranslate();
21731
21182
  const handleSignOut = onSignOutProp || authSignOut;
21732
21183
  const showSidebar = layoutMode === "sidebar";
@@ -22393,7 +21844,7 @@ function useDataDnd(args) {
22393
21844
  ({ id, children }) => {
22394
21845
  const {
22395
21846
  attributes,
22396
- listeners: listeners8,
21847
+ listeners: listeners7,
22397
21848
  setNodeRef,
22398
21849
  transform,
22399
21850
  transition,
@@ -22416,7 +21867,7 @@ function useDataDnd(args) {
22416
21867
  ref: setNodeRef,
22417
21868
  style,
22418
21869
  ...attributes,
22419
- ...listeners8,
21870
+ ...listeners7,
22420
21871
  children
22421
21872
  }
22422
21873
  );
@@ -23013,7 +22464,6 @@ var init_DataGrid = __esm({
23013
22464
  init_cn();
23014
22465
  init_getNestedValue();
23015
22466
  init_useEventBus();
23016
- init_useTranslate();
23017
22467
  init_Box();
23018
22468
  init_Stack();
23019
22469
  init_Typography();
@@ -23452,7 +22902,6 @@ var init_DataList = __esm({
23452
22902
  init_cn();
23453
22903
  init_getNestedValue();
23454
22904
  init_useEventBus();
23455
- init_useTranslate();
23456
22905
  init_Box();
23457
22906
  init_Stack();
23458
22907
  init_Typography();
@@ -23507,7 +22956,6 @@ var init_FileTree = __esm({
23507
22956
  init_Box();
23508
22957
  init_Typography();
23509
22958
  init_Icon();
23510
- init_useTranslate();
23511
22959
  TreeNodeItem = ({
23512
22960
  node,
23513
22961
  depth,
@@ -23694,14 +23142,6 @@ function useQuerySingleton(query) {
23694
23142
  setSort
23695
23143
  };
23696
23144
  }
23697
- function parseQueryBinding(binding) {
23698
- const cleaned = binding.startsWith("@") ? binding.slice(1) : binding;
23699
- const parts = cleaned.split(".");
23700
- return {
23701
- query: parts[0],
23702
- field: parts.length > 1 ? parts.slice(1).join(".") : void 0
23703
- };
23704
- }
23705
23145
  var queryStores;
23706
23146
  var init_useQuerySingleton = __esm({
23707
23147
  "hooks/useQuerySingleton.ts"() {
@@ -23722,7 +23162,6 @@ var init_FilterGroup = __esm({
23722
23162
  init_Icon();
23723
23163
  init_useEventBus();
23724
23164
  init_useQuerySingleton();
23725
- init_useTranslate();
23726
23165
  resolveFilterType = (filter) => filter.filterType ?? filter.type;
23727
23166
  lookStyles6 = {
23728
23167
  toolbar: "",
@@ -24374,7 +23813,6 @@ var init_Coachmark = __esm({
24374
23813
  init_Button();
24375
23814
  init_Icon();
24376
23815
  init_cn();
24377
- init_useTranslate();
24378
23816
  GAP = 10;
24379
23817
  EDGE = 8;
24380
23818
  Coachmark = ({
@@ -24615,7 +24053,6 @@ var init_RelationSelect = __esm({
24615
24053
  init_Spinner();
24616
24054
  init_Typography();
24617
24055
  init_debug();
24618
- init_useTranslate();
24619
24056
  isRelationsDebugEnabled = () => isDebugEnabled();
24620
24057
  RelationSelect = ({
24621
24058
  value,
@@ -24840,7 +24277,6 @@ var init_SearchInput = __esm({
24840
24277
  init_cn();
24841
24278
  init_useEventBus();
24842
24279
  init_useQuerySingleton();
24843
- init_useTranslate();
24844
24280
  SearchInput = ({
24845
24281
  value,
24846
24282
  onSearch,
@@ -24943,7 +24379,6 @@ var init_SidePanel = __esm({
24943
24379
  init_Typography();
24944
24380
  init_cn();
24945
24381
  init_useEventBus();
24946
- init_useTranslate();
24947
24382
  SidePanel = ({
24948
24383
  title,
24949
24384
  children,
@@ -25122,7 +24557,6 @@ var init_WizardNavigation = __esm({
25122
24557
  init_Icon();
25123
24558
  init_cn();
25124
24559
  init_useEventBus();
25125
- init_useTranslate();
25126
24560
  WizardNavigation = ({
25127
24561
  currentStep,
25128
24562
  totalSteps,
@@ -25210,7 +24644,6 @@ var init_RepeatableFormSection = __esm({
25210
24644
  init_Card();
25211
24645
  init_Icon();
25212
24646
  init_useEventBus();
25213
- init_useTranslate();
25214
24647
  RepeatableFormSection = ({
25215
24648
  sectionType,
25216
24649
  title,
@@ -25341,7 +24774,6 @@ var actionTypeLabelKeys, actionTypeIcons, ViolationAlert;
25341
24774
  var init_ViolationAlert = __esm({
25342
24775
  "components/core/molecules/ViolationAlert.tsx"() {
25343
24776
  init_cn();
25344
- init_useTranslate();
25345
24777
  init_Box();
25346
24778
  init_Stack();
25347
24779
  init_Typography();
@@ -25847,7 +25279,6 @@ var init_LineChart = __esm({
25847
25279
  "use client";
25848
25280
  init_cn();
25849
25281
  init_atoms2();
25850
- init_useTranslate();
25851
25282
  LineChart2 = ({
25852
25283
  data,
25853
25284
  width = 400,
@@ -28087,7 +27518,6 @@ var init_GraphView = __esm({
28087
27518
  "use client";
28088
27519
  init_cn();
28089
27520
  init_atoms2();
28090
- init_useTranslate();
28091
27521
  GROUP_COLORS = [
28092
27522
  "#3b82f6",
28093
27523
  // blue-500
@@ -28413,7 +27843,6 @@ var init_NumberStepper = __esm({
28413
27843
  init_cn();
28414
27844
  init_Icon();
28415
27845
  init_useEventBus();
28416
- init_useTranslate();
28417
27846
  sizeStyles10 = {
28418
27847
  sm: {
28419
27848
  button: "w-7 h-7",
@@ -28754,7 +28183,6 @@ var init_UploadDropZone = __esm({
28754
28183
  init_Icon();
28755
28184
  init_Typography();
28756
28185
  init_useEventBus();
28757
- init_useTranslate();
28758
28186
  UploadDropZone = ({
28759
28187
  accept,
28760
28188
  maxSize,
@@ -28921,7 +28349,6 @@ var init_Lightbox = __esm({
28921
28349
  init_Icon();
28922
28350
  init_cn();
28923
28351
  init_useEventBus();
28924
- init_useTranslate();
28925
28352
  Lightbox = ({
28926
28353
  images = [],
28927
28354
  currentIndex = 0,
@@ -29406,7 +28833,6 @@ var init_TableView = __esm({
29406
28833
  init_cn();
29407
28834
  init_getNestedValue();
29408
28835
  init_useEventBus();
29409
- init_useTranslate();
29410
28836
  init_Box();
29411
28837
  init_Stack();
29412
28838
  init_Typography();
@@ -29610,7 +29036,6 @@ var init_Meter = __esm({
29610
29036
  init_LoadingState();
29611
29037
  init_ErrorState();
29612
29038
  init_useEventBus();
29613
- init_useTranslate();
29614
29039
  DEFAULT_THRESHOLDS = [
29615
29040
  { value: 30, color: "var(--color-error)" },
29616
29041
  { value: 70, color: "var(--color-warning)" },
@@ -31557,7 +30982,6 @@ var init_VoteStack = __esm({
31557
30982
  init_cn();
31558
30983
  init_Icon();
31559
30984
  init_useEventBus();
31560
- init_useTranslate();
31561
30985
  sizeStyles12 = {
31562
30986
  sm: {
31563
30987
  button: "w-7 h-7",
@@ -32012,7 +31436,6 @@ var init_QrScanner = __esm({
32012
31436
  init_atoms2();
32013
31437
  init_Icon();
32014
31438
  init_useEventBus();
32015
- init_useTranslate();
32016
31439
  QrScanner = ({
32017
31440
  onScan,
32018
31441
  scanEvent,
@@ -32239,7 +31662,6 @@ var init_OptionConstraintGroup = __esm({
32239
31662
  "components/core/molecules/OptionConstraintGroup.tsx"() {
32240
31663
  init_cn();
32241
31664
  init_useEventBus();
32242
- init_useTranslate();
32243
31665
  init_Typography();
32244
31666
  init_Box();
32245
31667
  init_Label();
@@ -33195,7 +32617,6 @@ var init_RichBlockEditor = __esm({
33195
32617
  init_Input();
33196
32618
  init_Icon();
33197
32619
  init_useEventBus();
33198
- init_useTranslate();
33199
32620
  TOOLBAR_ENTRIES = [
33200
32621
  { type: "paragraph", labelKey: "richBlockEditor.toolbar.text", icon: Type },
33201
32622
  { type: "heading-1", labelKey: "richBlockEditor.toolbar.h1", icon: Heading1 },
@@ -33386,7 +32807,6 @@ var init_ReplyTree = __esm({
33386
32807
  "use client";
33387
32808
  init_cn();
33388
32809
  init_useEventBus();
33389
- init_useTranslate();
33390
32810
  init_atoms2();
33391
32811
  init_VoteStack();
33392
32812
  ReplyTreeNode = ({
@@ -33694,7 +33114,6 @@ var init_VersionDiff = __esm({
33694
33114
  "use client";
33695
33115
  init_cn();
33696
33116
  init_useEventBus();
33697
- init_useTranslate();
33698
33117
  init_atoms2();
33699
33118
  init_Stack();
33700
33119
  INLINE_STYLES = {
@@ -34010,7 +33429,6 @@ var init_DocBreadcrumb = __esm({
34010
33429
  init_Stack();
34011
33430
  init_Typography();
34012
33431
  init_Icon();
34013
- init_useTranslate();
34014
33432
  DocBreadcrumb = ({
34015
33433
  items,
34016
33434
  className
@@ -34439,7 +33857,6 @@ var init_DocSearch = __esm({
34439
33857
  init_Typography();
34440
33858
  init_Icon();
34441
33859
  init_Input();
34442
- init_useTranslate();
34443
33860
  }
34444
33861
  });
34445
33862
  var DocSidebarCategory, DocSidebar;
@@ -34452,7 +33869,6 @@ var init_DocSidebar = __esm({
34452
33869
  init_Stack();
34453
33870
  init_Typography();
34454
33871
  init_Icon();
34455
- init_useTranslate();
34456
33872
  DocSidebarCategory = ({ item, depth }) => {
34457
33873
  const [expanded, setExpanded] = useState(
34458
33874
  () => item.items?.some(function hasActive(child) {
@@ -34559,7 +33975,6 @@ var init_DocTOC = __esm({
34559
33975
  init_Box();
34560
33976
  init_Stack();
34561
33977
  init_Typography();
34562
- init_useTranslate();
34563
33978
  DocTOC = ({
34564
33979
  items,
34565
33980
  activeId,
@@ -35293,7 +34708,6 @@ var init_FormSection = __esm({
35293
34708
  init_Button();
35294
34709
  init_Stack();
35295
34710
  init_Icon();
35296
- init_useTranslate();
35297
34711
  init_useEventBus();
35298
34712
  FormSection = ({
35299
34713
  title,
@@ -35422,7 +34836,6 @@ var init_Header = __esm({
35422
34836
  init_Stack();
35423
34837
  init_Typography();
35424
34838
  init_cn();
35425
- init_useTranslate();
35426
34839
  lookStyles8 = {
35427
34840
  "compact-bar": "",
35428
34841
  hero: "py-section min-h-[200px] [&_h1]:text-display-1",
@@ -35742,7 +35155,6 @@ var init_Sidebar = __esm({
35742
35155
  init_Typography();
35743
35156
  init_cn();
35744
35157
  init_useEventBus();
35745
- init_useTranslate();
35746
35158
  SidebarNavItem = ({ item, collapsed }) => {
35747
35159
  const Icon3 = item.icon;
35748
35160
  const isActive = item.active ?? item.isActive;
@@ -35996,7 +35408,6 @@ var init_WizardContainer = __esm({
35996
35408
  init_Stack();
35997
35409
  init_Icon();
35998
35410
  init_cn();
35999
- init_useTranslate();
36000
35411
  WizardContainer = ({
36001
35412
  steps,
36002
35413
  currentStep: controlledStep,
@@ -36173,14 +35584,14 @@ var init_WizardContainer = __esm({
36173
35584
  });
36174
35585
  function calculateComplexity(schema) {
36175
35586
  if (!schema) return 1;
36176
- const entities2 = schema.dataEntities?.length || 0;
35587
+ const entities = schema.dataEntities?.length || 0;
36177
35588
  const pages = schema.ui?.pages?.length || 0;
36178
35589
  const traits2 = schema.traits?.length || 0;
36179
35590
  const sections = schema.ui?.pages?.reduce(
36180
35591
  (acc, page) => acc + (page.sections?.length || 0),
36181
35592
  0
36182
35593
  ) || 0;
36183
- return entities2 * 3 + pages * 2 + traits2 * 2 + sections * 1;
35594
+ return entities * 3 + pages * 2 + traits2 * 2 + sections * 1;
36184
35595
  }
36185
35596
  function getOrbitalType(complexity) {
36186
35597
  if (complexity <= 3) return "1s";
@@ -36570,7 +35981,6 @@ var init_SignaturePad = __esm({
36570
35981
  init_LoadingState();
36571
35982
  init_ErrorState();
36572
35983
  init_useEventBus();
36573
- init_useTranslate();
36574
35984
  SignaturePad = ({
36575
35985
  label,
36576
35986
  helperText,
@@ -36764,7 +36174,6 @@ var init_DocumentViewer = __esm({
36764
36174
  init_EmptyState();
36765
36175
  init_Tabs();
36766
36176
  init_useEventBus();
36767
- init_useTranslate();
36768
36177
  DocumentViewer = ({
36769
36178
  title,
36770
36179
  src,
@@ -36969,7 +36378,6 @@ var init_GraphCanvas = __esm({
36969
36378
  init_ErrorState();
36970
36379
  init_EmptyState();
36971
36380
  init_useEventBus();
36972
- init_useTranslate();
36973
36381
  GROUP_COLORS2 = [
36974
36382
  "var(--color-primary)",
36975
36383
  "var(--color-success)",
@@ -37827,7 +37235,6 @@ var init_DataTable = __esm({
37827
37235
  init_molecules2();
37828
37236
  init_Icon();
37829
37237
  init_useEventBus();
37830
- init_useTranslate();
37831
37238
  init_types3();
37832
37239
  lookStyles9 = {
37833
37240
  dense: "",
@@ -37974,7 +37381,6 @@ var init_DebuggerBoard = __esm({
37974
37381
  "components/game/organisms/puzzles/debugger/DebuggerBoard.tsx"() {
37975
37382
  init_atoms2();
37976
37383
  init_useEventBus();
37977
- init_useTranslate();
37978
37384
  DebuggerBoard.displayName = "DebuggerBoard";
37979
37385
  }
37980
37386
  });
@@ -38145,7 +37551,6 @@ var init_DetailPanel = __esm({
38145
37551
  init_cn();
38146
37552
  init_getNestedValue();
38147
37553
  init_useEventBus();
38148
- init_useTranslate();
38149
37554
  ReactMarkdown2 = lazy(() => import('react-markdown'));
38150
37555
  DetailPanel = ({
38151
37556
  title: propTitle,
@@ -38819,7 +38224,6 @@ var init_TraitStateViewer = __esm({
38819
38224
  "components/game/organisms/TraitStateViewer.tsx"() {
38820
38225
  "use client";
38821
38226
  init_cn();
38822
- init_useTranslate();
38823
38227
  init_Box();
38824
38228
  init_Typography();
38825
38229
  init_Stack();
@@ -38878,7 +38282,6 @@ var init_RuleEditor = __esm({
38878
38282
  "components/game/organisms/puzzles/event-handler/RuleEditor.tsx"() {
38879
38283
  init_atoms2();
38880
38284
  init_cn();
38881
- init_useTranslate();
38882
38285
  RuleEditor.displayName = "RuleEditor";
38883
38286
  }
38884
38287
  });
@@ -38953,7 +38356,6 @@ var init_ObjectRulePanel = __esm({
38953
38356
  "components/game/organisms/puzzles/event-handler/ObjectRulePanel.tsx"() {
38954
38357
  init_atoms2();
38955
38358
  init_cn();
38956
- init_useTranslate();
38957
38359
  init_TraitStateViewer();
38958
38360
  init_RuleEditor();
38959
38361
  nextRuleId = 1;
@@ -38998,7 +38400,6 @@ var init_EventLog = __esm({
38998
38400
  "components/game/organisms/puzzles/event-handler/EventLog.tsx"() {
38999
38401
  init_atoms2();
39000
38402
  init_cn();
39001
- init_useTranslate();
39002
38403
  STATUS_STYLES = {
39003
38404
  pending: "text-muted-foreground",
39004
38405
  active: "text-primary animate-pulse",
@@ -39212,7 +38613,6 @@ var init_EventHandlerBoard = __esm({
39212
38613
  init_atoms2();
39213
38614
  init_cn();
39214
38615
  init_useEventBus();
39215
- init_useTranslate();
39216
38616
  init_TraitStateViewer();
39217
38617
  init_ObjectRulePanel();
39218
38618
  init_EventLog();
@@ -39282,7 +38682,6 @@ var init_FeatureGridOrganism = __esm({
39282
38682
  "use client";
39283
38683
  init_cn();
39284
38684
  init_useEventBus();
39285
- init_useTranslate();
39286
38685
  init_Stack();
39287
38686
  init_Typography();
39288
38687
  init_FeatureGrid();
@@ -39465,7 +38864,6 @@ var init_Form = __esm({
39465
38864
  init_RelationSelect();
39466
38865
  init_Alert();
39467
38866
  init_useEventBus();
39468
- init_useTranslate();
39469
38867
  init_debug();
39470
38868
  layoutStyles = {
39471
38869
  vertical: "flex flex-col",
@@ -40632,7 +40030,6 @@ var init_HeroOrganism = __esm({
40632
40030
  "use client";
40633
40031
  init_cn();
40634
40032
  init_useEventBus();
40635
- init_useTranslate();
40636
40033
  init_HeroSection();
40637
40034
  init_LoadingState();
40638
40035
  init_ErrorState();
@@ -40738,7 +40135,6 @@ var LandingPageTemplate;
40738
40135
  var init_LandingPageTemplate = __esm({
40739
40136
  "components/marketing/templates/LandingPageTemplate.tsx"() {
40740
40137
  init_cn();
40741
- init_useTranslate();
40742
40138
  init_Stack();
40743
40139
  init_Box();
40744
40140
  init_Container();
@@ -40938,7 +40334,6 @@ var init_List = __esm({
40938
40334
  init_cn();
40939
40335
  init_getNestedValue();
40940
40336
  init_useEventBus();
40941
- init_useTranslate();
40942
40337
  init_types3();
40943
40338
  STATUS_STYLES2 = {
40944
40339
  complete: {
@@ -41433,7 +40828,6 @@ var init_MasterDetail = __esm({
41433
40828
  "components/core/organisms/MasterDetail.tsx"() {
41434
40829
  "use client";
41435
40830
  init_DataTable();
41436
- init_useTranslate();
41437
40831
  MasterDetail.displayName = "MasterDetail";
41438
40832
  }
41439
40833
  });
@@ -41442,7 +40836,6 @@ var init_MasterDetailLayout = __esm({
41442
40836
  "components/core/organisms/layout/MasterDetailLayout.tsx"() {
41443
40837
  init_cn();
41444
40838
  init_Typography();
41445
- init_useTranslate();
41446
40839
  DefaultEmptyDetail = () => {
41447
40840
  const { t } = useTranslate();
41448
40841
  return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full border-2 border-dashed border-border", children: /* @__PURE__ */ jsx(
@@ -41503,7 +40896,6 @@ var init_MediaGallery = __esm({
41503
40896
  init_ErrorState();
41504
40897
  init_EmptyState();
41505
40898
  init_useEventBus();
41506
- init_useTranslate();
41507
40899
  COLUMN_CLASSES = {
41508
40900
  2: "grid-cols-2",
41509
40901
  3: "grid-cols-2 sm:grid-cols-3",
@@ -41997,7 +41389,6 @@ var init_NegotiatorBoard = __esm({
41997
41389
  "components/game/organisms/puzzles/negotiator/NegotiatorBoard.tsx"() {
41998
41390
  init_atoms2();
41999
41391
  init_useEventBus();
42000
- init_useTranslate();
42001
41392
  NegotiatorBoard.displayName = "NegotiatorBoard";
42002
41393
  }
42003
41394
  });
@@ -42007,7 +41398,6 @@ var init_PricingOrganism = __esm({
42007
41398
  "use client";
42008
41399
  init_cn();
42009
41400
  init_useEventBus();
42010
- init_useTranslate();
42011
41401
  init_Stack();
42012
41402
  init_Typography();
42013
41403
  init_PricingGrid();
@@ -42057,7 +41447,6 @@ var PricingPageTemplate;
42057
41447
  var init_PricingPageTemplate = __esm({
42058
41448
  "components/marketing/templates/PricingPageTemplate.tsx"() {
42059
41449
  init_cn();
42060
- init_useTranslate();
42061
41450
  init_Stack();
42062
41451
  init_Box();
42063
41452
  init_Container();
@@ -42224,13 +41613,13 @@ function getEntitySnapshot() {
42224
41613
  if (!entityProvider) {
42225
41614
  return null;
42226
41615
  }
42227
- const entities2 = entityProvider();
41616
+ const entities = entityProvider();
42228
41617
  return {
42229
- entities: entities2,
41618
+ entities,
42230
41619
  timestamp: Date.now(),
42231
- totalCount: entities2.length,
41620
+ totalCount: entities.length,
42232
41621
  singletons: {},
42233
- runtime: entities2.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
41622
+ runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
42234
41623
  persistent: {}
42235
41624
  };
42236
41625
  }
@@ -42666,7 +42055,6 @@ var init_TraitsTab = __esm({
42666
42055
  init_Typography();
42667
42056
  init_Stack();
42668
42057
  init_EmptyState();
42669
- init_useTranslate();
42670
42058
  TraitsTab.displayName = "TraitsTab";
42671
42059
  }
42672
42060
  });
@@ -42744,7 +42132,6 @@ var init_TicksTab = __esm({
42744
42132
  init_Stack();
42745
42133
  init_Card();
42746
42134
  init_EmptyState();
42747
- init_useTranslate();
42748
42135
  TicksTab.displayName = "TicksTab";
42749
42136
  }
42750
42137
  });
@@ -42818,7 +42205,6 @@ var init_EntitiesTab = __esm({
42818
42205
  init_Typography();
42819
42206
  init_Stack();
42820
42207
  init_EmptyState();
42821
- init_useTranslate();
42822
42208
  EntitiesTab.displayName = "EntitiesTab";
42823
42209
  }
42824
42210
  });
@@ -42935,7 +42321,6 @@ var init_EventFlowTab = __esm({
42935
42321
  init_Button();
42936
42322
  init_Checkbox();
42937
42323
  init_EmptyState();
42938
- init_useTranslate();
42939
42324
  TYPE_BADGES = {
42940
42325
  trait: { variant: "primary", icon: "\u{1F504}" },
42941
42326
  tick: { variant: "warning", icon: "\u23F1\uFE0F" },
@@ -43030,7 +42415,6 @@ var init_GuardsPanel = __esm({
43030
42415
  init_ButtonGroup();
43031
42416
  init_Button();
43032
42417
  init_EmptyState();
43033
- init_useTranslate();
43034
42418
  GuardsPanel.displayName = "GuardsPanel";
43035
42419
  }
43036
42420
  });
@@ -43106,7 +42490,6 @@ var init_VerificationTab = __esm({
43106
42490
  init_Typography();
43107
42491
  init_Stack();
43108
42492
  init_EmptyState();
43109
- init_useTranslate();
43110
42493
  STATUS_CONFIG = {
43111
42494
  pass: { variant: "success", icon: "\u2713", label: "PASS" },
43112
42495
  fail: { variant: "danger", icon: "\u2717", label: "FAIL" },
@@ -43242,7 +42625,6 @@ var init_TransitionTimeline = __esm({
43242
42625
  init_Typography();
43243
42626
  init_EmptyState();
43244
42627
  init_Checkbox();
43245
- init_useTranslate();
43246
42628
  EFFECT_STATUS_VARIANT = {
43247
42629
  executed: "success",
43248
42630
  failed: "danger",
@@ -43332,7 +42714,6 @@ var init_ServerBridgeTab = __esm({
43332
42714
  init_Stack();
43333
42715
  init_Card();
43334
42716
  init_EmptyState();
43335
- init_useTranslate();
43336
42717
  ServerBridgeTab.displayName = "ServerBridgeTab";
43337
42718
  }
43338
42719
  });
@@ -43412,7 +42793,7 @@ function getAllEvents(traits2) {
43412
42793
  function EventDispatcherTab({ traits: traits2, schema }) {
43413
42794
  const eventBus = useEventBus();
43414
42795
  const { t } = useTranslate();
43415
- const [log18, setLog] = React79.useState([]);
42796
+ const [log8, setLog] = React79.useState([]);
43416
42797
  const prevStatesRef = React79.useRef(/* @__PURE__ */ new Map());
43417
42798
  React79.useEffect(() => {
43418
42799
  for (const trait of traits2) {
@@ -43476,9 +42857,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
43476
42857
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
43477
42858
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
43478
42859
  ] }),
43479
- log18.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
42860
+ log8.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
43480
42861
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
43481
- /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log18.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
42862
+ /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log8.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
43482
42863
  /* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
43483
42864
  " ",
43484
42865
  /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
@@ -43497,7 +42878,6 @@ var init_EventDispatcherTab = __esm({
43497
42878
  init_Stack();
43498
42879
  init_EmptyState();
43499
42880
  init_useEventBus();
43500
- init_useTranslate();
43501
42881
  EventDispatcherTab.displayName = "EventDispatcherTab";
43502
42882
  }
43503
42883
  });
@@ -43872,7 +43252,6 @@ var init_RuntimeDebugger2 = __esm({
43872
43252
  init_TransitionTimeline();
43873
43253
  init_ServerBridgeTab();
43874
43254
  init_EventDispatcherTab();
43875
- init_useTranslate();
43876
43255
  init_RuntimeDebugger();
43877
43256
  RuntimeDebugger.displayName = "RuntimeDebugger";
43878
43257
  }
@@ -44359,7 +43738,6 @@ var init_SequencerBoard = __esm({
44359
43738
  init_atoms2();
44360
43739
  init_cn();
44361
43740
  init_useEventBus();
44362
- init_useTranslate();
44363
43741
  init_TraitStateViewer();
44364
43742
  init_SequenceBar();
44365
43743
  init_ActionPalette();
@@ -44378,7 +43756,6 @@ var init_ShowcaseOrganism = __esm({
44378
43756
  "use client";
44379
43757
  init_cn();
44380
43758
  init_useEventBus();
44381
- init_useTranslate();
44382
43759
  init_Stack();
44383
43760
  init_Typography();
44384
43761
  init_SimpleGrid();
@@ -44937,7 +44314,6 @@ var init_SimulatorBoard = __esm({
44937
44314
  "components/game/organisms/puzzles/simulator/SimulatorBoard.tsx"() {
44938
44315
  init_atoms2();
44939
44316
  init_useEventBus();
44940
- init_useTranslate();
44941
44317
  SimulatorBoard.displayName = "SimulatorBoard";
44942
44318
  }
44943
44319
  });
@@ -45153,7 +44529,6 @@ var init_StatCard = __esm({
45153
44529
  init_Button();
45154
44530
  init_Sparkline();
45155
44531
  init_useEventBus();
45156
- init_useTranslate();
45157
44532
  init_Icon();
45158
44533
  StatCard = ({
45159
44534
  label: propLabel,
@@ -45509,7 +44884,6 @@ var init_VariablePanel = __esm({
45509
44884
  "components/game/organisms/puzzles/state-architect/VariablePanel.tsx"() {
45510
44885
  init_atoms2();
45511
44886
  init_cn();
45512
- init_useTranslate();
45513
44887
  VariablePanel.displayName = "VariablePanel";
45514
44888
  }
45515
44889
  });
@@ -45826,7 +45200,6 @@ var init_StateArchitectBoard = __esm({
45826
45200
  init_atoms2();
45827
45201
  init_cn();
45828
45202
  init_useEventBus();
45829
- init_useTranslate();
45830
45203
  init_TraitStateViewer();
45831
45204
  init_StateNode();
45832
45205
  init_TransitionArrow();
@@ -45846,7 +45219,6 @@ var init_StatsOrganism = __esm({
45846
45219
  "components/marketing/organisms/StatsOrganism.tsx"() {
45847
45220
  "use client";
45848
45221
  init_cn();
45849
- init_useTranslate();
45850
45222
  init_StatsGrid();
45851
45223
  init_LoadingState();
45852
45224
  init_ErrorState();
@@ -45960,7 +45332,6 @@ var init_StepFlowOrganism = __esm({
45960
45332
  "components/core/organisms/StepFlowOrganism.tsx"() {
45961
45333
  "use client";
45962
45334
  init_cn();
45963
- init_useTranslate();
45964
45335
  init_Stack();
45965
45336
  init_Typography();
45966
45337
  init_StepFlow();
@@ -46130,7 +45501,6 @@ var init_TeamOrganism = __esm({
46130
45501
  "components/marketing/organisms/TeamOrganism.tsx"() {
46131
45502
  "use client";
46132
45503
  init_cn();
46133
- init_useTranslate();
46134
45504
  init_Stack();
46135
45505
  init_Typography();
46136
45506
  init_SimpleGrid();
@@ -46188,7 +45558,6 @@ var init_Timeline = __esm({
46188
45558
  init_LoadingState();
46189
45559
  init_ErrorState();
46190
45560
  init_EmptyState();
46191
- init_useTranslate();
46192
45561
  lookStyles10 = {
46193
45562
  "vertical-compact": "gap-1 [&>*]:py-1",
46194
45563
  "vertical-spacious": "",
@@ -48378,7 +47747,6 @@ var init_UISlotRenderer = __esm({
48378
47747
  init_Box();
48379
47748
  init_Typography();
48380
47749
  init_useEventBus();
48381
- init_useTranslate();
48382
47750
  init_slot_types();
48383
47751
  init_cn();
48384
47752
  init_ErrorBoundary();
@@ -49724,1622 +49092,5 @@ init_AboutPageTemplate();
49724
49092
 
49725
49093
  // components/index.ts
49726
49094
  init_cn();
49727
- var log8 = createLogger("almadar:ui:orbital-history");
49728
- function useOrbitalHistory(options) {
49729
- const { appId, authToken, userId, onHistoryChange, onRevertSuccess } = options;
49730
- const getHeaders = useCallback(() => {
49731
- const headers = {
49732
- "Content-Type": "application/json"
49733
- };
49734
- if (authToken) {
49735
- headers["Authorization"] = `Bearer ${authToken}`;
49736
- }
49737
- if (userId) {
49738
- headers["x-user-id"] = userId;
49739
- }
49740
- return headers;
49741
- }, [authToken, userId]);
49742
- const [timeline, setTimeline] = useState([]);
49743
- const [currentVersion, setCurrentVersion] = useState(1);
49744
- const [isLoading, setIsLoading] = useState(false);
49745
- const [error, setError] = useState(null);
49746
- const refresh = useCallback(async () => {
49747
- if (!appId) return;
49748
- setIsLoading(true);
49749
- setError(null);
49750
- try {
49751
- const headers = getHeaders();
49752
- const [changesetsRes, snapshotsRes] = await Promise.all([
49753
- fetch(`/api/graphs/${appId}/history/changesets`, { headers }),
49754
- fetch(`/api/graphs/${appId}/history/snapshots`, { headers })
49755
- ]);
49756
- if (!changesetsRes.ok) {
49757
- throw new Error(`Failed to fetch changesets: ${changesetsRes.status}`);
49758
- }
49759
- if (!snapshotsRes.ok) {
49760
- throw new Error(`Failed to fetch snapshots: ${snapshotsRes.status}`);
49761
- }
49762
- const changesetsData = await changesetsRes.json();
49763
- const snapshotsData = await snapshotsRes.json();
49764
- const changesetItems = (changesetsData.changesets || []).map((cs) => ({
49765
- id: cs.id,
49766
- type: "changeset",
49767
- version: cs.version,
49768
- timestamp: cs.timestamp,
49769
- description: `Version ${cs.version}`,
49770
- source: cs.source,
49771
- summary: cs.summary
49772
- }));
49773
- const snapshotItems = (snapshotsData.snapshots || []).map((snap) => ({
49774
- id: snap.id,
49775
- type: "snapshot",
49776
- version: snap.version,
49777
- timestamp: snap.timestamp,
49778
- description: snap.reason || `Snapshot v${snap.version}`,
49779
- reason: snap.reason
49780
- }));
49781
- const mergedTimeline = [...changesetItems, ...snapshotItems].sort(
49782
- (a, b) => b.timestamp - a.timestamp
49783
- );
49784
- setTimeline(mergedTimeline);
49785
- if (mergedTimeline.length > 0) {
49786
- setCurrentVersion(mergedTimeline[0].version);
49787
- }
49788
- } catch (err) {
49789
- log8.error("Failed to load history", { error: err instanceof Error ? err : String(err) });
49790
- setError(err instanceof Error ? err.message : "Failed to load history");
49791
- } finally {
49792
- setIsLoading(false);
49793
- }
49794
- }, [appId, getHeaders]);
49795
- const revertToSnapshot = useCallback(async (snapshotId) => {
49796
- if (!appId) {
49797
- return { success: false, error: "No app ID provided" };
49798
- }
49799
- try {
49800
- const response = await fetch(`/api/graphs/${appId}/history/revert/${snapshotId}`, {
49801
- method: "POST",
49802
- headers: getHeaders()
49803
- });
49804
- if (!response.ok) {
49805
- const errorData = await response.json().catch(() => ({}));
49806
- throw new Error(errorData.error || `Failed to revert: ${response.status}`);
49807
- }
49808
- const data = await response.json();
49809
- if (data.success && data.schema) {
49810
- await refresh();
49811
- onRevertSuccess?.(data.schema);
49812
- return {
49813
- success: true,
49814
- restoredSchema: data.schema
49815
- };
49816
- }
49817
- return {
49818
- success: false,
49819
- error: data.error || "Unknown error during revert"
49820
- };
49821
- } catch (err) {
49822
- log8.error("Failed to revert", { error: err instanceof Error ? err : String(err) });
49823
- return {
49824
- success: false,
49825
- error: err instanceof Error ? err.message : "Failed to revert"
49826
- };
49827
- }
49828
- }, [appId, getHeaders, refresh, onRevertSuccess]);
49829
- useEffect(() => {
49830
- if (appId && authToken && userId) {
49831
- refresh();
49832
- }
49833
- }, [appId, authToken, userId]);
49834
- useEffect(() => {
49835
- onHistoryChange?.(timeline);
49836
- }, [timeline]);
49837
- return {
49838
- timeline,
49839
- currentVersion,
49840
- isLoading,
49841
- error,
49842
- revertToSnapshot,
49843
- refresh
49844
- };
49845
- }
49846
- var log9 = createLogger("almadar:ui:filesystem");
49847
- function useFileSystem() {
49848
- const [status, setStatus] = useState("idle");
49849
- const [error, setError] = useState(null);
49850
- const [isLoading, setIsLoading] = useState(false);
49851
- const [files, setFiles] = useState([]);
49852
- const [selectedFile, setSelectedFile] = useState(null);
49853
- const [selectedPath, setSelectedPath] = useState(null);
49854
- const [previewUrl, setPreviewUrl] = useState(null);
49855
- const [fileContents, setFileContents] = useState(/* @__PURE__ */ new Map());
49856
- const boot = useCallback(async () => {
49857
- setStatus("booting");
49858
- setError(null);
49859
- setIsLoading(true);
49860
- try {
49861
- log9.debug("Booting WebContainer");
49862
- await new Promise((resolve) => setTimeout(resolve, 100));
49863
- setStatus("ready");
49864
- } catch (err) {
49865
- setError(err instanceof Error ? err.message : "Failed to boot");
49866
- setStatus("error");
49867
- } finally {
49868
- setIsLoading(false);
49869
- }
49870
- }, []);
49871
- const mountFiles = useCallback(async (filesToMount) => {
49872
- setIsLoading(true);
49873
- try {
49874
- let filesArray;
49875
- if (Array.isArray(filesToMount)) {
49876
- filesArray = filesToMount;
49877
- } else {
49878
- filesArray = [];
49879
- const flattenTree = (obj, basePath = "") => {
49880
- for (const [key, value] of Object.entries(obj)) {
49881
- const path = basePath ? `${basePath}/${key}` : key;
49882
- if (value && typeof value === "object" && "file" in value) {
49883
- const fileObj = value;
49884
- filesArray.push({ path, content: fileObj.file.contents || "" });
49885
- } else if (value && typeof value === "object" && "directory" in value) {
49886
- const dirObj = value;
49887
- flattenTree(dirObj.directory, path);
49888
- }
49889
- }
49890
- };
49891
- flattenTree(filesToMount);
49892
- }
49893
- const newContents = /* @__PURE__ */ new Map();
49894
- for (const file of filesArray) {
49895
- newContents.set(file.path, file.content);
49896
- }
49897
- setFileContents(newContents);
49898
- const newTree = [];
49899
- for (const file of filesArray) {
49900
- const parts = file.path.split("/").filter(Boolean);
49901
- let current = newTree;
49902
- for (let i = 0; i < parts.length; i++) {
49903
- const part = parts[i];
49904
- const isFile = i === parts.length - 1;
49905
- const currentPath = "/" + parts.slice(0, i + 1).join("/");
49906
- let node = current.find((n) => n.name === part);
49907
- if (!node) {
49908
- node = {
49909
- path: currentPath,
49910
- name: part,
49911
- type: isFile ? "file" : "directory",
49912
- children: isFile ? void 0 : []
49913
- };
49914
- current.push(node);
49915
- }
49916
- if (!isFile && node && node.children) {
49917
- current = node.children;
49918
- }
49919
- }
49920
- }
49921
- setFiles(newTree);
49922
- setStatus("running");
49923
- } catch (err) {
49924
- log9.error("Failed to mount files", { error: err instanceof Error ? err : String(err) });
49925
- } finally {
49926
- setIsLoading(false);
49927
- }
49928
- }, []);
49929
- const readFile = useCallback(async (path) => {
49930
- return fileContents.get(path) || "";
49931
- }, [fileContents]);
49932
- const writeFile = useCallback(async (path, content) => {
49933
- setFileContents((prev) => {
49934
- const next = new Map(prev);
49935
- next.set(path, content);
49936
- return next;
49937
- });
49938
- }, []);
49939
- const selectFile = useCallback(async (path) => {
49940
- const content = fileContents.get(path) || "";
49941
- const ext = path.split(".").pop()?.toLowerCase() || "";
49942
- const languageMap = {
49943
- ts: "typescript",
49944
- tsx: "typescript",
49945
- js: "javascript",
49946
- jsx: "javascript",
49947
- json: "json",
49948
- md: "markdown",
49949
- css: "css",
49950
- html: "html",
49951
- orb: "json"
49952
- };
49953
- setSelectedPath(path);
49954
- setSelectedFile({
49955
- path,
49956
- content,
49957
- language: languageMap[ext] || "plaintext",
49958
- isDirty: false
49959
- });
49960
- }, [fileContents]);
49961
- const updateContent = useCallback((pathOrContent, contentArg) => {
49962
- const path = contentArg !== void 0 ? pathOrContent : selectedPath;
49963
- const content = contentArg !== void 0 ? contentArg : pathOrContent;
49964
- if (!path) {
49965
- log9.warn("updateContent called without path and no file selected");
49966
- return;
49967
- }
49968
- setFileContents((prev) => {
49969
- const next = new Map(prev);
49970
- next.set(path, content);
49971
- return next;
49972
- });
49973
- if (selectedPath === path) {
49974
- setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
49975
- }
49976
- }, [selectedPath]);
49977
- const updateSelectedContent = useCallback((content) => {
49978
- setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
49979
- }, []);
49980
- const refreshTree = useCallback(async () => {
49981
- log9.debug("Refreshing tree");
49982
- }, []);
49983
- const runCommand = useCallback(async (command) => {
49984
- log9.debug("Running command", { command });
49985
- return { exitCode: 0, output: "" };
49986
- }, []);
49987
- const startDevServer = useCallback(async () => {
49988
- log9.debug("Starting dev server");
49989
- setPreviewUrl("http://localhost:5173");
49990
- }, []);
49991
- return {
49992
- status,
49993
- error,
49994
- isLoading,
49995
- files,
49996
- selectedFile,
49997
- selectedPath,
49998
- previewUrl,
49999
- boot,
50000
- mountFiles,
50001
- readFile,
50002
- writeFile,
50003
- selectFile,
50004
- updateContent,
50005
- updateSelectedContent,
50006
- refreshTree,
50007
- runCommand,
50008
- startDevServer
50009
- };
50010
- }
50011
- var log10 = createLogger("almadar:ui:extensions");
50012
- var defaultManifest = {
50013
- languages: {
50014
- typescript: { extensions: [".ts", ".tsx"], icon: "ts", color: "#3178c6" },
50015
- javascript: { extensions: [".js", ".jsx"], icon: "js", color: "#f7df1e" },
50016
- json: { extensions: [".json", ".orb"], icon: "json", color: "#000000" },
50017
- css: { extensions: [".css"], icon: "css", color: "#264de4" },
50018
- html: { extensions: [".html"], icon: "html", color: "#e34c26" },
50019
- markdown: { extensions: [".md", ".mdx"], icon: "md", color: "#083fa1" }
50020
- },
50021
- extensions: []
50022
- };
50023
- function useExtensions(options) {
50024
- const { appId, loadOnMount = true } = options;
50025
- const [extensions, setExtensions] = useState([]);
50026
- const [manifest] = useState(defaultManifest);
50027
- const [isLoading, setIsLoading] = useState(false);
50028
- const [error, setError] = useState(null);
50029
- const loadExtension = useCallback(async (extensionId) => {
50030
- log10.debug("Loading extension", { extensionId });
50031
- }, []);
50032
- const loadExtensions = useCallback(async () => {
50033
- setIsLoading(true);
50034
- setError(null);
50035
- try {
50036
- const defaultExtensions = [
50037
- { id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
50038
- { id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
50039
- { id: "json", name: "JSON", language: "json", loaded: true },
50040
- { id: "css", name: "CSS", language: "css", loaded: true },
50041
- { id: "html", name: "HTML", language: "html", loaded: true },
50042
- { id: "markdown", name: "Markdown", language: "markdown", loaded: true }
50043
- ];
50044
- setExtensions(defaultExtensions);
50045
- } catch (err) {
50046
- setError(err instanceof Error ? err.message : "Failed to load extensions");
50047
- } finally {
50048
- setIsLoading(false);
50049
- }
50050
- }, []);
50051
- const getExtensionForFile = useCallback((filename) => {
50052
- const ext = filename.split(".").pop()?.toLowerCase();
50053
- if (!ext) return null;
50054
- const languageMap = {
50055
- ts: "typescript",
50056
- tsx: "typescript",
50057
- js: "javascript",
50058
- jsx: "javascript",
50059
- json: "json",
50060
- md: "markdown",
50061
- css: "css",
50062
- html: "html",
50063
- orb: "json"
50064
- };
50065
- const language = languageMap[ext];
50066
- if (!language) return null;
50067
- return extensions.find((e) => e.language === language) || null;
50068
- }, [extensions]);
50069
- useEffect(() => {
50070
- if (!appId || !loadOnMount) return;
50071
- const loadExtensions2 = async () => {
50072
- setIsLoading(true);
50073
- setError(null);
50074
- try {
50075
- const defaultExtensions = [
50076
- { id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
50077
- { id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
50078
- { id: "json", name: "JSON", language: "json", loaded: true },
50079
- { id: "css", name: "CSS", language: "css", loaded: true },
50080
- { id: "html", name: "HTML", language: "html", loaded: true },
50081
- { id: "markdown", name: "Markdown", language: "markdown", loaded: true }
50082
- ];
50083
- setExtensions(defaultExtensions);
50084
- } catch (err) {
50085
- setError(err instanceof Error ? err.message : "Failed to load extensions");
50086
- } finally {
50087
- setIsLoading(false);
50088
- }
50089
- };
50090
- loadExtensions2();
50091
- }, [appId, loadOnMount]);
50092
- return {
50093
- extensions,
50094
- manifest,
50095
- isLoading,
50096
- error,
50097
- loadExtension,
50098
- loadExtensions,
50099
- getExtensionForFile
50100
- };
50101
- }
50102
- var log11 = createLogger("almadar:ui:file-editor");
50103
- function useFileEditor(options) {
50104
- const { extensions, fileSystem, onSchemaUpdate } = options;
50105
- const [openFiles, setOpenFiles] = useState([]);
50106
- const [activeFilePath, setActiveFilePath] = useState(null);
50107
- const [isSaving, setIsSaving] = useState(false);
50108
- const activeFile = openFiles.find((f3) => f3.path === activeFilePath) || null;
50109
- const openFile = useCallback(async (path) => {
50110
- const existing = openFiles.find((f3) => f3.path === path);
50111
- if (existing) {
50112
- setActiveFilePath(path);
50113
- return;
50114
- }
50115
- try {
50116
- const content = await fileSystem.readFile(path);
50117
- const ext = extensions.getExtensionForFile(path);
50118
- const newFile = {
50119
- path,
50120
- content,
50121
- isDirty: false,
50122
- language: ext?.language
50123
- };
50124
- setOpenFiles((prev) => [...prev, newFile]);
50125
- setActiveFilePath(path);
50126
- } catch (err) {
50127
- log11.error("Failed to open file", { error: err instanceof Error ? err : String(err) });
50128
- }
50129
- }, [openFiles, fileSystem, extensions]);
50130
- const closeFile = useCallback((path) => {
50131
- setOpenFiles((prev) => prev.filter((f3) => f3.path !== path));
50132
- if (activeFilePath === path) {
50133
- const remaining = openFiles.filter((f3) => f3.path !== path);
50134
- setActiveFilePath(remaining.length > 0 ? remaining[0].path : null);
50135
- }
50136
- }, [activeFilePath, openFiles]);
50137
- const setActiveFile = useCallback((path) => {
50138
- setActiveFilePath(path);
50139
- }, []);
50140
- const updateFileContent = useCallback((path, content) => {
50141
- setOpenFiles(
50142
- (prev) => prev.map(
50143
- (f3) => f3.path === path ? { ...f3, content, isDirty: true } : f3
50144
- )
50145
- );
50146
- }, []);
50147
- const handleFileEdit = useCallback(async (path, content) => {
50148
- try {
50149
- await fileSystem.writeFile(path, content);
50150
- let action = "saved";
50151
- if (path.endsWith(".orb") || path.endsWith("schema.json")) {
50152
- try {
50153
- const schema = JSON.parse(content);
50154
- await onSchemaUpdate?.(schema);
50155
- action = "updated_schema";
50156
- } catch {
50157
- }
50158
- } else if (path.includes("/extensions/")) {
50159
- action = path.endsWith(".new") ? "converted_extension" : "saved_extension";
50160
- }
50161
- return { success: true, action };
50162
- } catch (err) {
50163
- return {
50164
- success: false,
50165
- error: err instanceof Error ? err.message : "Failed to save file"
50166
- };
50167
- }
50168
- }, [fileSystem, onSchemaUpdate]);
50169
- const saveFile = useCallback(async (path) => {
50170
- const file = openFiles.find((f3) => f3.path === path);
50171
- if (!file) return;
50172
- setIsSaving(true);
50173
- try {
50174
- await fileSystem.writeFile(path, file.content);
50175
- setOpenFiles(
50176
- (prev) => prev.map(
50177
- (f3) => f3.path === path ? { ...f3, isDirty: false } : f3
50178
- )
50179
- );
50180
- if (path.endsWith(".orb") || path.endsWith("schema.json")) {
50181
- try {
50182
- const schema = JSON.parse(file.content);
50183
- await onSchemaUpdate?.(schema);
50184
- } catch {
50185
- }
50186
- }
50187
- } catch (err) {
50188
- log11.error("Failed to save file", { error: err instanceof Error ? err : String(err) });
50189
- } finally {
50190
- setIsSaving(false);
50191
- }
50192
- }, [openFiles, fileSystem, onSchemaUpdate]);
50193
- const saveAllFiles = useCallback(async () => {
50194
- setIsSaving(true);
50195
- try {
50196
- const dirtyFiles = openFiles.filter((f3) => f3.isDirty);
50197
- for (const file of dirtyFiles) {
50198
- await saveFile(file.path);
50199
- }
50200
- } finally {
50201
- setIsSaving(false);
50202
- }
50203
- }, [openFiles, saveFile]);
50204
- return {
50205
- openFiles,
50206
- activeFile,
50207
- isSaving,
50208
- openFile,
50209
- closeFile,
50210
- setActiveFile,
50211
- updateFileContent,
50212
- handleFileEdit,
50213
- saveFile,
50214
- saveAllFiles
50215
- };
50216
- }
50217
- var log12 = createLogger("almadar:ui:compile");
50218
- function useCompile() {
50219
- const [isCompiling, setIsCompiling] = useState(false);
50220
- const [stage, setStage] = useState("idle");
50221
- const [lastResult, setLastResult] = useState(null);
50222
- const [error, setError] = useState(null);
50223
- const compileSchema = useCallback(async (schema) => {
50224
- setIsCompiling(true);
50225
- setStage("compiling");
50226
- setError(null);
50227
- try {
50228
- log12.debug("Compiling schema", { name: schema.name });
50229
- const result = {
50230
- success: true,
50231
- files: []
50232
- };
50233
- setLastResult(result);
50234
- setStage("done");
50235
- return result;
50236
- } catch (err) {
50237
- const errorMessage = err instanceof Error ? err.message : "Compilation failed";
50238
- setError(errorMessage);
50239
- setStage("error");
50240
- setLastResult({ success: false, errors: [errorMessage] });
50241
- return null;
50242
- } finally {
50243
- setIsCompiling(false);
50244
- }
50245
- }, []);
50246
- return {
50247
- isCompiling,
50248
- stage,
50249
- lastResult,
50250
- error,
50251
- compileSchema
50252
- };
50253
- }
50254
- var log13 = createLogger("almadar:ui:preview");
50255
- function usePreview(options) {
50256
- const [previewUrl, setPreviewUrl] = useState(null);
50257
- const [isLoading, setIsLoading] = useState(!!options?.appId);
50258
- const [error, setError] = useState(null);
50259
- const [loadError, setLoadError] = useState(null);
50260
- const [app, setApp] = useState(null);
50261
- const [isFullscreen, setIsFullscreen] = useState(false);
50262
- const [isExecutingEvent, setIsExecutingEvent] = useState(false);
50263
- const [errorToast, setErrorToast] = useState(null);
50264
- const [currentStateName, setCurrentStateName] = useState(null);
50265
- const [notificationsList, setNotificationsList] = useState([]);
50266
- const [isPanelOpen, setIsPanelOpen] = useState(false);
50267
- const notifications = useMemo(() => ({
50268
- notifications: notificationsList,
50269
- isPanelOpen,
50270
- closePanel: () => setIsPanelOpen(false),
50271
- dismissNotification: (id) => {
50272
- setNotificationsList((prev) => prev.filter((n) => n.id !== id));
50273
- },
50274
- markAsRead: (id) => {
50275
- setNotificationsList(
50276
- (prev) => prev.map((n) => n.id === id ? { ...n, read: true } : n)
50277
- );
50278
- },
50279
- clearAll: () => setNotificationsList([])
50280
- }), [notificationsList, isPanelOpen]);
50281
- useEffect(() => {
50282
- const appId = options?.appId;
50283
- if (!appId) {
50284
- setApp(null);
50285
- setIsLoading(false);
50286
- return;
50287
- }
50288
- log13.debug("Setting up preview for app", { appId });
50289
- setPreviewUrl(`/api/orbitals/${appId}`);
50290
- setIsLoading(false);
50291
- }, [options?.appId]);
50292
- const startPreview = useCallback(async () => {
50293
- log13.debug("startPreview called");
50294
- }, []);
50295
- const stopPreview = useCallback(async () => {
50296
- setIsLoading(true);
50297
- try {
50298
- log13.debug("Stopping preview server");
50299
- setPreviewUrl(null);
50300
- setApp(null);
50301
- } finally {
50302
- setIsLoading(false);
50303
- }
50304
- }, []);
50305
- const refresh = useCallback(async () => {
50306
- if (!previewUrl) return;
50307
- log13.debug("Refreshing preview");
50308
- setPreviewUrl(`${previewUrl.split("?")[0]}?t=${Date.now()}`);
50309
- }, [previewUrl]);
50310
- const handleRefresh = useCallback(async () => {
50311
- log13.debug("Handle refresh");
50312
- await refresh();
50313
- }, [refresh]);
50314
- const handleReset = useCallback(async () => {
50315
- log13.debug("Resetting preview");
50316
- setError(null);
50317
- setLoadError(null);
50318
- setErrorToast(null);
50319
- setIsExecutingEvent(false);
50320
- setCurrentStateName(null);
50321
- }, []);
50322
- const toggleFullscreen = useCallback(() => {
50323
- setIsFullscreen((prev) => !prev);
50324
- }, []);
50325
- const dismissErrorToast = useCallback(() => {
50326
- setErrorToast(null);
50327
- }, []);
50328
- return {
50329
- previewUrl,
50330
- isLoading,
50331
- error,
50332
- loadError,
50333
- app,
50334
- isFullscreen,
50335
- isExecutingEvent,
50336
- errorToast,
50337
- currentStateName,
50338
- notifications,
50339
- startPreview,
50340
- stopPreview,
50341
- refresh,
50342
- handleRefresh,
50343
- handleReset,
50344
- toggleFullscreen,
50345
- setErrorToast,
50346
- dismissErrorToast
50347
- };
50348
- }
50349
- var log14 = createLogger("almadar:ui:agent-chat");
50350
- function useAgentChat(options) {
50351
- const [messages, setMessages] = useState([]);
50352
- const [status, setStatus] = useState("idle");
50353
- const [activities, setActivities] = useState([]);
50354
- const [todos, setTodos] = useState([]);
50355
- const [schemaDiffs, setSchemaDiffs] = useState([]);
50356
- const [isLoading, setIsLoading] = useState(false);
50357
- const [error, setError] = useState(null);
50358
- const [threadId] = useState(null);
50359
- const [interrupt, setInterrupt] = useState(null);
50360
- const sendMessage = useCallback(async (content) => {
50361
- setIsLoading(true);
50362
- setStatus("running");
50363
- setError(null);
50364
- try {
50365
- const userMessage = {
50366
- id: Date.now().toString(),
50367
- role: "user",
50368
- content,
50369
- timestamp: Date.now()
50370
- };
50371
- setMessages((prev) => [...prev, userMessage]);
50372
- log14.debug("Sending message", { content });
50373
- const assistantMessage = {
50374
- id: (Date.now() + 1).toString(),
50375
- role: "assistant",
50376
- content: "Agent chat is not yet implemented.",
50377
- timestamp: Date.now()
50378
- };
50379
- setMessages((prev) => [...prev, assistantMessage]);
50380
- setStatus("idle");
50381
- options?.onComplete?.();
50382
- } catch (err) {
50383
- setError(err instanceof Error ? err.message : "Failed to send message");
50384
- setStatus("error");
50385
- } finally {
50386
- setIsLoading(false);
50387
- }
50388
- }, [options]);
50389
- const startGeneration = useCallback(async (skill, prompt, genOptions) => {
50390
- setStatus("running");
50391
- setIsLoading(true);
50392
- setError(null);
50393
- const skillName = Array.isArray(skill) ? skill[0] : skill;
50394
- try {
50395
- log14.debug("Starting generation", () => ({ skillName, prompt, genOptions: JSON.stringify(genOptions) }));
50396
- await new Promise((resolve) => setTimeout(resolve, 100));
50397
- setStatus("complete");
50398
- options?.onComplete?.();
50399
- } catch (err) {
50400
- setError(err instanceof Error ? err.message : "Generation failed");
50401
- setStatus("error");
50402
- } finally {
50403
- setIsLoading(false);
50404
- }
50405
- }, [options]);
50406
- const continueConversation = useCallback(async (message) => {
50407
- log14.debug("Continue conversation", { message: Array.isArray(message) ? message : [message] });
50408
- }, []);
50409
- const resumeWithDecision = useCallback(async (decisions) => {
50410
- log14.debug("Resume with decision", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
50411
- setInterrupt(null);
50412
- }, []);
50413
- const cancel = useCallback(() => {
50414
- setStatus("idle");
50415
- setIsLoading(false);
50416
- setInterrupt(null);
50417
- }, []);
50418
- const clearMessages = useCallback(() => {
50419
- setMessages([]);
50420
- }, []);
50421
- const clearHistory = useCallback(() => {
50422
- setMessages([]);
50423
- setActivities([]);
50424
- setTodos([]);
50425
- setSchemaDiffs([]);
50426
- setError(null);
50427
- }, []);
50428
- return {
50429
- messages,
50430
- status,
50431
- activities,
50432
- todos,
50433
- schemaDiffs,
50434
- isLoading,
50435
- error,
50436
- threadId,
50437
- interrupt,
50438
- sendMessage,
50439
- startGeneration,
50440
- continueConversation,
50441
- resumeWithDecision,
50442
- cancel,
50443
- clearMessages,
50444
- clearHistory
50445
- };
50446
- }
50447
- var log15 = createLogger("almadar:ui:validation");
50448
- function useValidation() {
50449
- const [result, setResult] = useState(null);
50450
- const [isValidating, setIsValidating] = useState(false);
50451
- const [error, setError] = useState(null);
50452
- const [stage, setStage] = useState("idle");
50453
- const [isFixing, setIsFixing] = useState(false);
50454
- const [progressMessage, setProgressMessage] = useState(null);
50455
- const validate = useCallback(async (appId) => {
50456
- setIsValidating(true);
50457
- setError(null);
50458
- setStage("validating");
50459
- setProgressMessage("Validating schema...");
50460
- try {
50461
- log15.debug("Validating app", { appId });
50462
- const validationResult = {
50463
- valid: true,
50464
- errors: [],
50465
- warnings: []
50466
- };
50467
- setResult(validationResult);
50468
- setStage("complete");
50469
- setProgressMessage(null);
50470
- return validationResult;
50471
- } catch (err) {
50472
- const errorMessage = err instanceof Error ? err.message : "Validation failed";
50473
- setError(errorMessage);
50474
- const failedResult = {
50475
- valid: false,
50476
- errors: [{ code: "VALIDATION_ERROR", message: errorMessage, severity: "error" }],
50477
- warnings: []
50478
- };
50479
- setResult(failedResult);
50480
- setStage("complete");
50481
- setProgressMessage(null);
50482
- return failedResult;
50483
- } finally {
50484
- setIsValidating(false);
50485
- }
50486
- }, []);
50487
- const clearResult = useCallback(() => {
50488
- setResult(null);
50489
- setError(null);
50490
- }, []);
50491
- const reset = useCallback(() => {
50492
- setResult(null);
50493
- setError(null);
50494
- setStage("idle");
50495
- setIsFixing(false);
50496
- setProgressMessage(null);
50497
- setIsValidating(false);
50498
- }, []);
50499
- return {
50500
- result,
50501
- isValidating,
50502
- error,
50503
- stage,
50504
- isFixing,
50505
- progressMessage,
50506
- errors: result?.errors ?? [],
50507
- warnings: result?.warnings ?? [],
50508
- isValid: result?.valid ?? false,
50509
- validate,
50510
- clearResult,
50511
- reset
50512
- };
50513
- }
50514
- var log16 = createLogger("almadar:ui:deep-agent");
50515
- function useDeepAgentGeneration() {
50516
- const [requests, setRequests] = useState([]);
50517
- const [currentRequest, setCurrentRequest] = useState(null);
50518
- const [isGenerating, setIsGenerating] = useState(false);
50519
- const [isLoading, setIsLoading] = useState(false);
50520
- const [isComplete, setIsComplete] = useState(false);
50521
- const [progress, setProgress] = useState({ stage: "idle", percent: 0, message: "" });
50522
- const [error, setError] = useState(null);
50523
- const [interrupt, setInterrupt] = useState(null);
50524
- const generate = useCallback(async (prompt) => {
50525
- setIsGenerating(true);
50526
- setIsLoading(true);
50527
- setIsComplete(false);
50528
- setError(null);
50529
- setProgress({ stage: "starting", percent: 0, message: "Starting generation..." });
50530
- const request = {
50531
- id: Date.now().toString(),
50532
- prompt,
50533
- status: "running"
50534
- };
50535
- setCurrentRequest(request);
50536
- setRequests((prev) => [...prev, request]);
50537
- try {
50538
- log16.debug("Generating from prompt", { prompt });
50539
- await new Promise((resolve) => setTimeout(resolve, 100));
50540
- request.status = "completed";
50541
- setCurrentRequest(request);
50542
- setIsComplete(true);
50543
- setProgress({ stage: "complete", percent: 100, message: "Generation complete" });
50544
- return null;
50545
- } catch (err) {
50546
- const errorMessage = err instanceof Error ? err.message : "Generation failed";
50547
- setError(errorMessage);
50548
- request.status = "failed";
50549
- request.error = errorMessage;
50550
- setCurrentRequest(request);
50551
- return null;
50552
- } finally {
50553
- setIsGenerating(false);
50554
- setIsLoading(false);
50555
- }
50556
- }, []);
50557
- const startGeneration = useCallback(async (skill, prompt, _options) => {
50558
- log16.debug("Starting generation with skill", { skill });
50559
- await generate(prompt);
50560
- }, [generate]);
50561
- const cancelGeneration = useCallback(() => {
50562
- if (currentRequest) {
50563
- currentRequest.status = "failed";
50564
- currentRequest.error = "Cancelled by user";
50565
- setCurrentRequest(null);
50566
- }
50567
- setIsGenerating(false);
50568
- setIsLoading(false);
50569
- setIsComplete(false);
50570
- setProgress({ stage: "idle", percent: 0, message: "" });
50571
- }, [currentRequest]);
50572
- const clearRequests = useCallback(() => {
50573
- setRequests([]);
50574
- setCurrentRequest(null);
50575
- setError(null);
50576
- setProgress({ stage: "idle", percent: 0, message: "" });
50577
- setIsComplete(false);
50578
- }, []);
50579
- const submitInterruptDecisions = useCallback((decisions) => {
50580
- log16.debug("Submitting interrupt decisions", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
50581
- setInterrupt(null);
50582
- }, []);
50583
- return {
50584
- requests,
50585
- currentRequest,
50586
- isGenerating,
50587
- isLoading,
50588
- isComplete,
50589
- progress,
50590
- error,
50591
- interrupt,
50592
- generate,
50593
- startGeneration,
50594
- cancelGeneration,
50595
- clearRequests,
50596
- submitInterruptDecisions
50597
- };
50598
- }
50599
-
50600
- // hooks/index.ts
50601
- init_useEventBus();
50602
- var log17 = createLogger("almadar:ui:ui-slots");
50603
- var DEFAULT_SOURCE_KEY = "__default__";
50604
- var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
50605
- var ALL_SLOTS2 = [
50606
- "main",
50607
- "sidebar",
50608
- "modal",
50609
- "drawer",
50610
- "overlay",
50611
- "center",
50612
- "toast",
50613
- "hud-top",
50614
- "hud-bottom",
50615
- "hud-left",
50616
- "hud-right",
50617
- "floating"
50618
- ];
50619
- var DEFAULT_SLOTS = ALL_SLOTS2.reduce(
50620
- (acc, slot) => {
50621
- acc[slot] = null;
50622
- return acc;
50623
- },
50624
- {}
50625
- );
50626
- var DEFAULT_SOURCES = ALL_SLOTS2.reduce(
50627
- (acc, slot) => {
50628
- acc[slot] = {};
50629
- return acc;
50630
- },
50631
- {}
50632
- );
50633
- var idCounter = 0;
50634
- function generateId() {
50635
- return `slot-content-${++idCounter}-${Date.now()}`;
50636
- }
50637
- function aggregateSlot(sources) {
50638
- if (!sources) return null;
50639
- const entries = Object.entries(sources);
50640
- if (entries.length === 0) return null;
50641
- if (entries.length === 1) return entries[0][1];
50642
- const children = entries.map(([, entry]) => ({
50643
- type: entry.pattern,
50644
- ...entry.props
50645
- }));
50646
- const stackId = `slot-content-stack-${entries.map(([k]) => k).join("-")}`;
50647
- return {
50648
- id: stackId,
50649
- pattern: "stack",
50650
- props: {
50651
- direction: "vertical",
50652
- gap: "lg",
50653
- children
50654
- },
50655
- priority: 0,
50656
- animation: "fade",
50657
- sourceTrait: MULTI_SOURCE_STACK_TRAIT
50658
- };
50659
- }
50660
- function useUISlotManager() {
50661
- const [sources, setSources] = useState(DEFAULT_SOURCES);
50662
- const subscribersRef = useRef(/* @__PURE__ */ new Set());
50663
- const timersRef = useRef(/* @__PURE__ */ new Map());
50664
- const traitIndexRef = useRef(/* @__PURE__ */ new Map());
50665
- const traitSubscribersRef = useRef(/* @__PURE__ */ new Map());
50666
- const slots = useMemo(() => {
50667
- const out = { ...DEFAULT_SLOTS };
50668
- for (const slot of ALL_SLOTS2) {
50669
- out[slot] = aggregateSlot(sources[slot]);
50670
- }
50671
- return out;
50672
- }, [sources]);
50673
- useEffect(() => {
50674
- return () => {
50675
- timersRef.current.forEach((timer) => clearTimeout(timer));
50676
- timersRef.current.clear();
50677
- };
50678
- }, []);
50679
- const notifySubscribers = useCallback((slot, content) => {
50680
- subscribersRef.current.forEach((callback) => {
50681
- try {
50682
- callback(slot, content);
50683
- } catch (error) {
50684
- log17.error("Subscriber error", { error: error instanceof Error ? error : String(error) });
50685
- }
50686
- });
50687
- }, []);
50688
- const notifyTraitSubscribers = useCallback(
50689
- (traitName, content) => {
50690
- const subs = traitSubscribersRef.current.get(traitName);
50691
- if (!subs) return;
50692
- subs.forEach((callback) => {
50693
- try {
50694
- callback(content);
50695
- } catch (error) {
50696
- log17.error("Trait subscriber error", { traitName, error: error instanceof Error ? error : String(error) });
50697
- }
50698
- });
50699
- },
50700
- []
50701
- );
50702
- const indexTraitRender = useCallback(
50703
- (traitName, content) => {
50704
- traitIndexRef.current.set(traitName, content);
50705
- },
50706
- []
50707
- );
50708
- const unindexTrait = useCallback((traitName) => {
50709
- traitIndexRef.current.delete(traitName);
50710
- }, []);
50711
- const render = useCallback(
50712
- (config) => {
50713
- const id = generateId();
50714
- const sourceKey = config.sourceTrait ?? DEFAULT_SOURCE_KEY;
50715
- const content = {
50716
- id,
50717
- pattern: config.pattern,
50718
- props: config.props ?? {},
50719
- priority: config.priority ?? 0,
50720
- animation: config.animation ?? "fade",
50721
- onDismiss: config.onDismiss,
50722
- sourceTrait: config.sourceTrait,
50723
- slot: config.target,
50724
- transitionEvent: config.transitionEvent,
50725
- fromState: config.fromState,
50726
- entity: config.entity
50727
- };
50728
- if (config.autoDismissMs && config.autoDismissMs > 0) {
50729
- content.autoDismissAt = Date.now() + config.autoDismissMs;
50730
- const timer = setTimeout(() => {
50731
- setSources((prev) => {
50732
- const slotSources = prev[config.target];
50733
- if (slotSources && slotSources[sourceKey]?.id === id) {
50734
- content.onDismiss?.();
50735
- const next = { ...slotSources };
50736
- delete next[sourceKey];
50737
- const updated = { ...prev, [config.target]: next };
50738
- notifySubscribers(config.target, aggregateSlot(next));
50739
- return updated;
50740
- }
50741
- return prev;
50742
- });
50743
- timersRef.current.delete(id);
50744
- }, config.autoDismissMs);
50745
- timersRef.current.set(id, timer);
50746
- }
50747
- setSources((prev) => {
50748
- const slotSources = prev[config.target] ?? {};
50749
- const existing = slotSources[sourceKey];
50750
- if (existing && existing.priority > content.priority) {
50751
- log17.warn("Slot already has higher priority content", {
50752
- slot: config.target,
50753
- sourceKey,
50754
- existingPriority: existing.priority,
50755
- newPriority: content.priority
50756
- });
50757
- return prev;
50758
- }
50759
- const nextSources = {
50760
- ...slotSources,
50761
- [sourceKey]: content
50762
- };
50763
- const nextAll = { ...prev, [config.target]: nextSources };
50764
- if (content.sourceTrait) {
50765
- indexTraitRender(content.sourceTrait, content);
50766
- notifyTraitSubscribers(content.sourceTrait, content);
50767
- }
50768
- log17.info("slot:written", {
50769
- slot: config.target,
50770
- sourceKey,
50771
- sourceTrait: content.sourceTrait,
50772
- patternType: content.pattern,
50773
- priority: content.priority
50774
- });
50775
- notifySubscribers(config.target, aggregateSlot(nextSources));
50776
- return nextAll;
50777
- });
50778
- return id;
50779
- },
50780
- [notifySubscribers, notifyTraitSubscribers, indexTraitRender]
50781
- );
50782
- const clear = useCallback(
50783
- (slot) => {
50784
- setSources((prev) => {
50785
- const slotSources = prev[slot];
50786
- if (!slotSources || Object.keys(slotSources).length === 0) {
50787
- return prev;
50788
- }
50789
- for (const content of Object.values(slotSources)) {
50790
- const timer = timersRef.current.get(content.id);
50791
- if (timer) {
50792
- clearTimeout(timer);
50793
- timersRef.current.delete(content.id);
50794
- }
50795
- content.onDismiss?.();
50796
- if (content.sourceTrait) {
50797
- unindexTrait(content.sourceTrait);
50798
- notifyTraitSubscribers(content.sourceTrait, null);
50799
- }
50800
- }
50801
- notifySubscribers(slot, null);
50802
- return { ...prev, [slot]: {} };
50803
- });
50804
- },
50805
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50806
- );
50807
- const clearBySource = useCallback(
50808
- (slot, sourceTrait) => {
50809
- const sourceKey = sourceTrait;
50810
- setSources((prev) => {
50811
- const slotSources = prev[slot];
50812
- if (!slotSources || !(sourceKey in slotSources)) {
50813
- log17.debug("slot:clear-noop", { slot, sourceTrait, reason: !slotSources ? "no-slot" : "no-source" });
50814
- return prev;
50815
- }
50816
- const content = slotSources[sourceKey];
50817
- const timer = timersRef.current.get(content.id);
50818
- if (timer) {
50819
- clearTimeout(timer);
50820
- timersRef.current.delete(content.id);
50821
- }
50822
- content.onDismiss?.();
50823
- if (content.sourceTrait) {
50824
- unindexTrait(content.sourceTrait);
50825
- notifyTraitSubscribers(content.sourceTrait, null);
50826
- }
50827
- const nextSources = { ...slotSources };
50828
- delete nextSources[sourceKey];
50829
- log17.info("slot:cleared", { slot, sourceTrait, lastPatternType: content.pattern });
50830
- notifySubscribers(slot, aggregateSlot(nextSources));
50831
- return { ...prev, [slot]: nextSources };
50832
- });
50833
- },
50834
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50835
- );
50836
- const clearById = useCallback(
50837
- (id) => {
50838
- setSources((prev) => {
50839
- for (const slot of ALL_SLOTS2) {
50840
- const slotSources = prev[slot];
50841
- if (!slotSources) continue;
50842
- const matchKey = Object.keys(slotSources).find(
50843
- (k) => slotSources[k].id === id
50844
- );
50845
- if (!matchKey) continue;
50846
- const content = slotSources[matchKey];
50847
- const timer = timersRef.current.get(id);
50848
- if (timer) {
50849
- clearTimeout(timer);
50850
- timersRef.current.delete(id);
50851
- }
50852
- content.onDismiss?.();
50853
- if (content.sourceTrait) {
50854
- unindexTrait(content.sourceTrait);
50855
- notifyTraitSubscribers(content.sourceTrait, null);
50856
- }
50857
- const nextSources = { ...slotSources };
50858
- delete nextSources[matchKey];
50859
- notifySubscribers(slot, aggregateSlot(nextSources));
50860
- return { ...prev, [slot]: nextSources };
50861
- }
50862
- return prev;
50863
- });
50864
- },
50865
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50866
- );
50867
- const clearAll = useCallback(() => {
50868
- timersRef.current.forEach((timer) => clearTimeout(timer));
50869
- timersRef.current.clear();
50870
- setSources((prev) => {
50871
- for (const slot of ALL_SLOTS2) {
50872
- const slotSources = prev[slot];
50873
- if (!slotSources) continue;
50874
- for (const content of Object.values(slotSources)) {
50875
- content.onDismiss?.();
50876
- if (content.sourceTrait) {
50877
- notifyTraitSubscribers(content.sourceTrait, null);
50878
- }
50879
- }
50880
- notifySubscribers(slot, null);
50881
- }
50882
- return DEFAULT_SOURCES;
50883
- });
50884
- traitIndexRef.current.clear();
50885
- }, [notifySubscribers, notifyTraitSubscribers]);
50886
- const subscribe2 = useCallback((callback) => {
50887
- subscribersRef.current.add(callback);
50888
- return () => {
50889
- subscribersRef.current.delete(callback);
50890
- };
50891
- }, []);
50892
- const hasContent = useCallback(
50893
- (slot) => slots[slot] !== null,
50894
- [slots]
50895
- );
50896
- const getContent = useCallback(
50897
- (slot) => slots[slot],
50898
- [slots]
50899
- );
50900
- const getTraitContent = useCallback(
50901
- (traitName) => traitIndexRef.current.get(traitName) ?? null,
50902
- []
50903
- );
50904
- const subscribeTrait = useCallback(
50905
- (traitName, callback) => {
50906
- let set = traitSubscribersRef.current.get(traitName);
50907
- if (!set) {
50908
- set = /* @__PURE__ */ new Set();
50909
- traitSubscribersRef.current.set(traitName, set);
50910
- }
50911
- set.add(callback);
50912
- return () => {
50913
- const s = traitSubscribersRef.current.get(traitName);
50914
- if (!s) return;
50915
- s.delete(callback);
50916
- if (s.size === 0) {
50917
- traitSubscribersRef.current.delete(traitName);
50918
- }
50919
- };
50920
- },
50921
- []
50922
- );
50923
- const updateTraitContent = useCallback(
50924
- (traitName, content) => {
50925
- const id = generateId();
50926
- const fullContent = { ...content, id, sourceTrait: traitName };
50927
- indexTraitRender(traitName, fullContent);
50928
- notifyTraitSubscribers(traitName, fullContent);
50929
- return id;
50930
- },
50931
- [indexTraitRender, notifyTraitSubscribers]
50932
- );
50933
- return {
50934
- slots,
50935
- render,
50936
- clear,
50937
- clearBySource,
50938
- clearById,
50939
- clearAll,
50940
- subscribe: subscribe2,
50941
- hasContent,
50942
- getContent,
50943
- getTraitContent,
50944
- subscribeTrait,
50945
- updateTraitContent
50946
- };
50947
- }
50948
-
50949
- // hooks/useUIEvents.ts
50950
- init_useEventBus();
50951
- var UI_PREFIX = "UI:";
50952
- function useUIEvents(dispatch, traitName, validEvents, eventBusInstance) {
50953
- const defaultEventBus = useEventBus();
50954
- const eventBus = eventBusInstance ?? defaultEventBus;
50955
- const validEventsKey = validEvents.slice().sort().join(",");
50956
- const stableValidEvents = useMemo(
50957
- () => validEvents,
50958
- [validEventsKey]
50959
- // intentional — validEventsKey is the stable dep
50960
- );
50961
- useEffect(() => {
50962
- const unsubscribes = [];
50963
- for (const smEvent of stableValidEvents) {
50964
- const handler = (event) => {
50965
- if (event.source && event.source.dispatched) {
50966
- return;
50967
- }
50968
- dispatch(smEvent, event.payload);
50969
- };
50970
- unsubscribes.push(
50971
- eventBus.on(`${UI_PREFIX}${traitName}.${smEvent}`, handler)
50972
- );
50973
- }
50974
- return () => {
50975
- for (const unsub of unsubscribes) {
50976
- if (typeof unsub === "function") unsub();
50977
- }
50978
- };
50979
- }, [eventBus, dispatch, traitName, stableValidEvents]);
50980
- }
50981
- function useTraitListens(dispatch, listens, eventBusInstance) {
50982
- const defaultEventBus = useEventBus();
50983
- const eventBus = eventBusInstance ?? defaultEventBus;
50984
- const stableKey = listens.map((l) => `${l.sourceKey}->${l.trigger}`).sort().join("|");
50985
- const stableListens = useMemo(
50986
- () => listens,
50987
- [stableKey]
50988
- // intentional
50989
- );
50990
- useEffect(() => {
50991
- const unsubscribes = [];
50992
- for (const spec of stableListens) {
50993
- const handler = (event) => {
50994
- dispatch(spec.trigger, event.payload);
50995
- };
50996
- unsubscribes.push(eventBus.on(`${UI_PREFIX}${spec.sourceKey}`, handler));
50997
- }
50998
- return () => {
50999
- for (const unsub of unsubscribes) {
51000
- if (typeof unsub === "function") unsub();
51001
- }
51002
- };
51003
- }, [eventBus, dispatch, stableListens]);
51004
- }
51005
-
51006
- // hooks/index.ts
51007
- init_useQuerySingleton();
51008
-
51009
- // stores/entityStore.ts
51010
- var entities = /* @__PURE__ */ new Map();
51011
- var listeners7 = /* @__PURE__ */ new Set();
51012
- var idCounter2 = 0;
51013
- function subscribe(listener) {
51014
- listeners7.add(listener);
51015
- return () => listeners7.delete(listener);
51016
- }
51017
- function notify() {
51018
- listeners7.forEach((listener) => listener());
51019
- }
51020
- function getEntity(id) {
51021
- return entities.get(id);
51022
- }
51023
- function getByType(type) {
51024
- const types = Array.isArray(type) ? type : [type];
51025
- return [...entities.values()].filter((e) => types.includes(e.type));
51026
- }
51027
- function getAllEntities() {
51028
- return [...entities.values()];
51029
- }
51030
- function getSingleton(type) {
51031
- return [...entities.values()].find((e) => e.type === type);
51032
- }
51033
- function spawnEntity(config) {
51034
- const id = config.id ?? `entity_${++idCounter2}`;
51035
- const entity = { ...config, id };
51036
- entities = new Map(entities);
51037
- entities.set(id, entity);
51038
- notify();
51039
- return id;
51040
- }
51041
- function updateEntity(id, updates) {
51042
- const entity = entities.get(id);
51043
- if (entity) {
51044
- entities = new Map(entities);
51045
- entities.set(id, { ...entity, ...updates });
51046
- notify();
51047
- }
51048
- }
51049
- function updateSingleton(type, updates) {
51050
- const entity = getSingleton(type);
51051
- if (entity) {
51052
- updateEntity(entity.id, updates);
51053
- }
51054
- }
51055
- function removeEntity(id) {
51056
- if (entities.has(id)) {
51057
- entities = new Map(entities);
51058
- entities.delete(id);
51059
- notify();
51060
- }
51061
- }
51062
- function clearEntities() {
51063
- entities = /* @__PURE__ */ new Map();
51064
- notify();
51065
- }
51066
- function getSnapshot2() {
51067
- return entities;
51068
- }
51069
-
51070
- // hooks/useEntities.ts
51071
- function useEntities() {
51072
- const entities2 = useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51073
- return {
51074
- entities: entities2,
51075
- getEntity,
51076
- getByType,
51077
- getAllEntities,
51078
- getSingleton,
51079
- spawnEntity,
51080
- updateEntity,
51081
- updateSingleton,
51082
- removeEntity,
51083
- clearEntities
51084
- };
51085
- }
51086
- function useEntity(id) {
51087
- const entities2 = useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51088
- return entities2.get(id);
51089
- }
51090
- function useEntitiesByType(type) {
51091
- const entities2 = useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51092
- return [...entities2.values()].filter((e) => e.type === type);
51093
- }
51094
- function useSingletonEntity(type) {
51095
- const entities2 = useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51096
- return [...entities2.values()].find((e) => e.type === type);
51097
- }
51098
- function usePlayer() {
51099
- const player = useSingletonEntity("Player");
51100
- const update = useCallback((updates) => {
51101
- if (player) updateEntity(player.id, updates);
51102
- }, [player?.id]);
51103
- return { player, updatePlayer: update };
51104
- }
51105
- function usePhysics() {
51106
- const physics = useSingletonEntity("Physics");
51107
- const update = useCallback((updates) => {
51108
- if (physics) updateEntity(physics.id, updates);
51109
- }, [physics?.id]);
51110
- return { physics, updatePhysics: update };
51111
- }
51112
- function useInput() {
51113
- const input = useSingletonEntity("Input");
51114
- const update = useCallback((updates) => {
51115
- if (input) updateEntity(input.id, updates);
51116
- }, [input?.id]);
51117
- return { input, updateInput: update };
51118
- }
51119
-
51120
- // hooks/index.ts
51121
- init_useTranslate();
51122
- init_useAuthContext();
51123
- init_useSwipeGesture();
51124
- init_useLongPress();
51125
- init_useDragReorder();
51126
- init_useInfiniteScroll();
51127
- init_usePullToRefresh();
51128
- function getDistance(touches) {
51129
- const dx = touches[0].clientX - touches[1].clientX;
51130
- const dy = touches[0].clientY - touches[1].clientY;
51131
- return Math.sqrt(dx * dx + dy * dy);
51132
- }
51133
- function usePinchZoom(options = {}) {
51134
- const { minScale = 0.5, maxScale = 4 } = options;
51135
- const [scale, setScale] = useState(1);
51136
- const [isPinching, setIsPinching] = useState(false);
51137
- const initialDistance = useRef(0);
51138
- const initialScale = useRef(1);
51139
- const onTouchStart = useCallback((e) => {
51140
- if (e.touches.length === 2) {
51141
- initialDistance.current = getDistance(e.touches);
51142
- initialScale.current = scale;
51143
- setIsPinching(true);
51144
- }
51145
- }, [scale]);
51146
- const onTouchMove = useCallback((e) => {
51147
- if (e.touches.length !== 2 || !isPinching) return;
51148
- e.preventDefault();
51149
- const currentDistance = getDistance(e.touches);
51150
- const ratio = currentDistance / initialDistance.current;
51151
- const newScale = Math.min(maxScale, Math.max(minScale, initialScale.current * ratio));
51152
- setScale(newScale);
51153
- }, [isPinching, minScale, maxScale]);
51154
- const onTouchEnd = useCallback(() => {
51155
- setIsPinching(false);
51156
- }, []);
51157
- const resetZoom = useCallback(() => {
51158
- setScale(1);
51159
- }, []);
51160
- return {
51161
- scale,
51162
- isPinching,
51163
- gestureProps: {
51164
- onTouchStart,
51165
- onTouchMove,
51166
- onTouchEnd
51167
- },
51168
- resetZoom
51169
- };
51170
- }
51171
-
51172
- // hooks/useDraggable.ts
51173
- init_useEventBus();
51174
- var ALMADAR_DND_MIME = "application/x-almadar-dnd";
51175
- function useDraggable({ payload, disabled = false }) {
51176
- const [isDragging, setIsDragging] = useState(false);
51177
- const eventBus = useEventBus();
51178
- const handleDragStart = useCallback(
51179
- (e) => {
51180
- if (disabled) {
51181
- e.preventDefault();
51182
- return;
51183
- }
51184
- e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
51185
- e.dataTransfer.effectAllowed = "copy";
51186
- setIsDragging(true);
51187
- eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
51188
- },
51189
- [disabled, payload, eventBus]
51190
- );
51191
- const handleDragEnd = useCallback(
51192
- (e) => {
51193
- setIsDragging(false);
51194
- eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
51195
- },
51196
- [payload, eventBus]
51197
- );
51198
- const dragProps = useMemo(
51199
- () => ({
51200
- draggable: !disabled,
51201
- onDragStart: handleDragStart,
51202
- onDragEnd: handleDragEnd,
51203
- "aria-grabbed": isDragging
51204
- }),
51205
- [disabled, handleDragStart, handleDragEnd, isDragging]
51206
- );
51207
- return { dragProps, isDragging };
51208
- }
51209
-
51210
- // hooks/useDropZone.ts
51211
- init_useEventBus();
51212
- function parsePayload(e) {
51213
- try {
51214
- const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
51215
- if (!raw) return null;
51216
- const parsed = JSON.parse(raw);
51217
- if (typeof parsed.kind !== "string" || !parsed.data) return null;
51218
- return parsed;
51219
- } catch {
51220
- return null;
51221
- }
51222
- }
51223
- function hasAlmadarPayload(e) {
51224
- return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
51225
- }
51226
- function useDropZone({ accepts, onDrop, disabled = false }) {
51227
- const [isOver, setIsOver] = useState(false);
51228
- const eventBus = useEventBus();
51229
- const handleDragOver = useCallback(
51230
- (e) => {
51231
- if (disabled) return;
51232
- if (!hasAlmadarPayload(e)) return;
51233
- e.preventDefault();
51234
- e.dataTransfer.dropEffect = "copy";
51235
- setIsOver(true);
51236
- },
51237
- [disabled]
51238
- );
51239
- const handleDragLeave = useCallback(
51240
- (e) => {
51241
- setIsOver(false);
51242
- },
51243
- []
51244
- );
51245
- const handleDrop = useCallback(
51246
- (e) => {
51247
- e.preventDefault();
51248
- setIsOver(false);
51249
- if (disabled) return;
51250
- const payload = parsePayload(e);
51251
- if (!payload) return;
51252
- if (!accepts.includes(payload.kind)) return;
51253
- const position = { x: e.clientX, y: e.clientY };
51254
- onDrop(payload, position);
51255
- eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
51256
- },
51257
- [disabled, accepts, onDrop, eventBus]
51258
- );
51259
- const dropProps = useMemo(
51260
- () => ({
51261
- onDragOver: handleDragOver,
51262
- onDragLeave: handleDragLeave,
51263
- onDrop: handleDrop
51264
- }),
51265
- [handleDragOver, handleDragLeave, handleDrop]
51266
- );
51267
- return { dropProps, isOver };
51268
- }
51269
- var API_BASE = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "http://localhost:3000";
51270
- function getUserId() {
51271
- return localStorage.getItem("userId") || "anonymous";
51272
- }
51273
- async function fetchWithAuth(endpoint, options) {
51274
- const userId = getUserId();
51275
- const response = await fetch(`${API_BASE}${endpoint}`, {
51276
- ...options,
51277
- headers: {
51278
- "Content-Type": "application/json",
51279
- "x-user-id": userId,
51280
- ...options?.headers
51281
- }
51282
- });
51283
- if (!response.ok) {
51284
- const error = await response.json().catch(() => ({ error: response.statusText }));
51285
- throw new Error(error.error || error.message || "Request failed");
51286
- }
51287
- return response.json();
51288
- }
51289
- function useGitHubStatus() {
51290
- return useQuery({
51291
- queryKey: ["github", "status"],
51292
- queryFn: () => fetchWithAuth("/api/github/status"),
51293
- staleTime: 6e4,
51294
- // 1 minute
51295
- retry: false
51296
- });
51297
- }
51298
- function useConnectGitHub() {
51299
- const connectGitHub = useCallback(() => {
51300
- const userId = getUserId();
51301
- const state = btoa(JSON.stringify({ userId, returnUrl: window.location.href }));
51302
- window.location.href = `${API_BASE}/api/github/oauth/authorize?state=${state}`;
51303
- }, []);
51304
- return { connectGitHub };
51305
- }
51306
- function useDisconnectGitHub() {
51307
- const queryClient = useQueryClient();
51308
- return useMutation({
51309
- mutationFn: () => fetchWithAuth("/api/github/disconnect", { method: "POST" }),
51310
- onSuccess: () => {
51311
- queryClient.invalidateQueries({ queryKey: ["github", "status"] });
51312
- queryClient.removeQueries({ queryKey: ["github", "repos"] });
51313
- }
51314
- });
51315
- }
51316
- function useGitHubRepos(page = 1, perPage = 30) {
51317
- return useQuery({
51318
- queryKey: ["github", "repos", page, perPage],
51319
- queryFn: () => fetchWithAuth(`/api/github/repos?page=${page}&per_page=${perPage}`),
51320
- enabled: true,
51321
- // Only fetch if user is connected
51322
- staleTime: 3e5
51323
- // 5 minutes
51324
- });
51325
- }
51326
- function useGitHubRepo(owner, repo, enabled = true) {
51327
- return useQuery({
51328
- queryKey: ["github", "repo", owner, repo],
51329
- queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}`),
51330
- enabled: enabled && !!owner && !!repo,
51331
- staleTime: 3e5
51332
- // 5 minutes
51333
- });
51334
- }
51335
- function useGitHubBranches(owner, repo, enabled = true) {
51336
- return useQuery({
51337
- queryKey: ["github", "branches", owner, repo],
51338
- queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}/branches`),
51339
- enabled: enabled && !!owner && !!repo,
51340
- staleTime: 6e4
51341
- // 1 minute
51342
- });
51343
- }
51344
49095
 
51345
- export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, Coachmark, CodeBlock, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocCodeBlock, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FeatureRenderer2 as FeatureRenderer, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, clearEntities, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createTranslate, createUnitAnimationState, drawSprite, generateCombatMessage, getAllEntities, getByType, getCurrentFrame, getEntity, getSingleton, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseQueryBinding, pendulum, projectileMotion, removeEntity, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, spawnEntity, springOscillator, tickAnimationState, transitionAnimation, updateEntity, updateSingleton, useAgentChat, useAnchorRect, useAuthContext, useBattleState, useCamera, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEntities, useEntitiesByType, useEntity as useEntityById, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, usePhysics, usePhysics2D, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useSingletonEntity, useSpriteAnimations, useSwipeGesture, useTraitListens, useTranslate, useUIEvents, useUISlotManager, useValidation };
49096
+ export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, Coachmark, CodeBlock, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocCodeBlock, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FeatureRenderer2 as FeatureRenderer, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };