@rizom/brain 0.2.0-alpha.383 → 0.2.0-alpha.384

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/brain.js +36 -36
  2. package/dist/chunks/{app-7z5e3c7s.js → app-zn0wshdg.js} +2 -2
  3. package/dist/chunks/{index-ymrghn05.js → index-fe19h0ey.js} +3 -3
  4. package/dist/chunks/{index-ymrghn05.js.map → index-fe19h0ey.js.map} +1 -1
  5. package/dist/chunks/{index-ccy24bdp.js → index-q8rrvgdf.js} +2 -2
  6. package/dist/chunks/{index-3dz3sh65.js → index-y41e244y.js} +2 -2
  7. package/dist/index.js +1 -1
  8. package/dist/model.js +37 -37
  9. package/dist/model.js.map +2 -2
  10. package/dist/ui/studio-app.css +32 -18
  11. package/dist/ui/studio-app.js +3 -3
  12. package/dist/ui/studio-app.js.map +1 -1
  13. package/dist/ui/studio-asset-manifest.json +16 -16
  14. package/dist/ui/studio-chunks/account-view-811dnmr7.js +3 -0
  15. package/dist/ui/studio-chunks/{account-view-4544h367.js.map → account-view-811dnmr7.js.map} +2 -2
  16. package/dist/ui/studio-chunks/{highlighted-body-OFNGDK62-1w01z27m.js → highlighted-body-OFNGDK62-kw57xp1t.js} +2 -2
  17. package/dist/ui/studio-chunks/{highlighted-body-OFNGDK62-1w01z27m.js.map → highlighted-body-OFNGDK62-kw57xp1t.js.map} +1 -1
  18. package/dist/ui/studio-chunks/{main-1gqf08r8.js → main-53ha0ekw.js} +18 -18
  19. package/dist/ui/studio-chunks/{main-1gqf08r8.js.map → main-53ha0ekw.js.map} +4 -7
  20. package/dist/ui/studio-chunks/{main-b34wmcw1.js → main-g0bad58x.js} +4 -4
  21. package/dist/ui/studio-chunks/{main-b34wmcw1.js.map → main-g0bad58x.js.map} +1 -1
  22. package/dist/ui/studio-chunks/main-g6b89p15.js +7 -0
  23. package/dist/ui/studio-chunks/{main-ptks77cs.js.map → main-g6b89p15.js.map} +3 -3
  24. package/dist/ui/studio-chunks/main-me847330.js +50 -0
  25. package/dist/ui/studio-chunks/{main-vzjqx8f9.js.map → main-me847330.js.map} +6 -3
  26. package/dist/ui/studio-chunks/mermaid-GHXKKRXX-hqacyqmt.js +3 -0
  27. package/dist/ui/studio-chunks/{mermaid-GHXKKRXX-ftrk50mv.js.map → mermaid-GHXKKRXX-hqacyqmt.js.map} +1 -1
  28. package/dist/ui/studio-chunks/studio-chat-workspace-hmkhk808.js +5 -0
  29. package/dist/ui/studio-chunks/studio-chat-workspace-hmkhk808.js.map +20 -0
  30. package/package.json +1 -1
  31. package/dist/ui/studio-chunks/account-view-4544h367.js +0 -3
  32. package/dist/ui/studio-chunks/main-ptks77cs.js +0 -7
  33. package/dist/ui/studio-chunks/main-vzjqx8f9.js +0 -50
  34. package/dist/ui/studio-chunks/mermaid-GHXKKRXX-ftrk50mv.js +0 -3
  35. package/dist/ui/studio-chunks/studio-chat-workspace-kpfmp85b.js +0 -5
  36. package/dist/ui/studio-chunks/studio-chat-workspace-kpfmp85b.js.map +0 -21
  37. /package/dist/chunks/{app-7z5e3c7s.js.map → app-zn0wshdg.js.map} +0 -0
  38. /package/dist/chunks/{index-ccy24bdp.js.map → index-q8rrvgdf.js.map} +0 -0
  39. /package/dist/chunks/{index-3dz3sh65.js.map → index-y41e244y.js.map} +0 -0
@@ -86,6 +86,7 @@
86
86
  .x1s8w4yu:not(#\#){padding:10px 0 24px}
87
87
  .x1b4vry6:not(#\#){padding:10px 0}
88
88
  .xsuht3:not(#\#){padding:10px 18px 6px}
89
+ .x17udgi5:not(#\#){padding:10px 24px 16px}
89
90
  .x13j9azq:not(#\#){padding:10px 26px}
90
91
  .x1gqud3g:not(#\#){padding:12px 14px}
91
92
  .xnohdxd:not(#\#){padding:12px 26px}
@@ -106,9 +107,9 @@
106
107
  .x1n79iv5:not(#\#){padding:22px 16px}
107
108
  .xaukpwp:not(#\#){padding:22px 18px 16px}
108
109
  .x1easoi4:not(#\#){padding:22px 4px}
109
- .x10czhz2:not(#\#){padding:24px 8px 24px 0}
110
110
  .x1f7pr5y:not(#\#){padding:24px 8px}
111
111
  .xggk2y7:not(#\#){padding:24px}
112
+ .x12mnf9l:not(#\#){padding:26px 24px}
112
113
  .xga4tv:not(#\#){padding:26px 26px 60px}
113
114
  .xhlzbb6:not(#\#){padding:26px 36px 0}
114
115
  .x11wck8f:not(#\#){padding:26px 36px}
@@ -121,12 +122,14 @@
121
122
  .x1asu97y:not(#\#){padding:3px 8px}
122
123
  .x1x7i2cb:not(#\#){padding:3px 9px}
123
124
  .x1o8uwn5:not(#\#){padding:48px}
125
+ .xsoouyo:not(#\#){padding:4px 24px}
124
126
  .x19ajujh:not(#\#){padding:4px 5px 4px 13px}
125
127
  .x14odnwx:not(#\#){padding:5px}
126
128
  .xk61eof:not(#\#){padding:6px 10px}
127
129
  .x560879:not(#\#){padding:6px 16px 20px}
128
130
  .x1jmcyos:not(#\#){padding:6px 9px}
129
131
  .x6uox72:not(#\#){padding:7px 0 18px 9px}
132
+ .x1160tuk:not(#\#){padding:8px 10px}
130
133
  .x153ncpu:not(#\#){padding:8px 12px}
131
134
  .xbnpv00:not(#\#){padding:8px 14px}
132
135
  .x1ff1495:not(#\#){padding:8px 16px}
@@ -143,12 +146,15 @@
143
146
  @media (max-width: 900px){.xb1114b.xb1114b:not(#\#){padding:0}}
144
147
  @media (max-width: 640px){.xlko52b.xlko52b:not(#\#){padding:10px 12px}}
145
148
  @media (max-width: 640px){.xj4fmvg.xj4fmvg:not(#\#){padding:14px 2px}}
149
+ @media (max-width: 640px){.xvc418b.xvc418b:not(#\#){padding:18px 16px}}
146
150
  @media (max-width: 640px){.x10fa4w8.x10fa4w8:not(#\#){padding:18px 18px 88px}}
147
151
  @media (max-width: 640px){.x1p5ebxg.x1p5ebxg:not(#\#){padding:22px 20px 0}}
148
152
  @media (max-width: 640px){.x1h32jcg.x1h32jcg:not(#\#){padding:22px 20px 26px}}
153
+ @media (max-width: 640px){.xbqoc8e.xbqoc8e:not(#\#){padding:4px 10px}}
149
154
  @media (max-width: 640px){.x11btecl.x11btecl:not(#\#){padding:6px 12px calc(6px + env(safe-area-inset-bottom))}}
150
155
  @media (min-width: 641px) and (max-width: 900px){.xj3o16p.xj3o16p:not(#\#){padding:7px 12px}}
151
156
  @media (max-width: 640px){.xiuf7f6.xiuf7f6:not(#\#){padding:7px 14px}}
157
+ @media (max-width: 640px){.x1lbfznl.x1lbfznl:not(#\#){padding:8px 10px calc(10px + env(safe-area-inset-bottom))}}
152
158
  @media (max-width: 640px){.x1xccwpl.x1xccwpl:not(#\#){padding:9px 12px}}
153
159
  @media (max-width: 900px){.xs0sw79.xs0sw79:not(#\#){padding:env(safe-area-inset-top) 16px 0}}
154
160
  @media (max-width: 640px){.x13bo2ae.x13bo2ae:has([data-operator-action-result]):not(#\#){padding:12px}}
@@ -163,6 +169,8 @@
163
169
  .xy1lt07:not(#\#):not(#\#){border-color:var(--console-rule)}
164
170
  .x1vw2y1n:not(#\#):not(#\#){border-color:var(--console-text-muted)}
165
171
  .x11qqpng:not(#\#):not(#\#){border-color:var(--console-warn)}
172
+ .x1cxwkf3:not(#\#):not(#\#){border-radius:12px 12px 2px 12px}
173
+ .x4pepcl:not(#\#):not(#\#){border-radius:12px}
166
174
  .xixl9f9:not(#\#):not(#\#){border-radius:14px}
167
175
  .x12oqio5:not(#\#):not(#\#){border-radius:4px}
168
176
  .x16rqkct:not(#\#):not(#\#){border-radius:50%}
@@ -182,6 +190,7 @@
182
190
  .x1mg3qzt:not(#\#):not(#\#){flex:1 0 480px}
183
191
  .x12lumcd:not(#\#):not(#\#){flex:1 1 auto}
184
192
  .x98rzlu:not(#\#):not(#\#){flex:1}
193
+ .xxhr3t:not(#\#):not(#\#){gap:0}
185
194
  .x883omv:not(#\#):not(#\#){gap:10px}
186
195
  .x1v2ro7d:not(#\#):not(#\#){gap:12px}
187
196
  .x1aut5rd:not(#\#):not(#\#){gap:13px}
@@ -191,8 +200,8 @@
191
200
  .x1c1vhfx:not(#\#):not(#\#){gap:20px}
192
201
  .x1wszfx9:not(#\#):not(#\#){gap:22px 28px}
193
202
  .x33pbmt:not(#\#):not(#\#){gap:28px}
203
+ .x195vfkc:not(#\#):not(#\#){gap:2px}
194
204
  .xseyljb:not(#\#):not(#\#){gap:30px}
195
- .x1rzw5jd:not(#\#):not(#\#){gap:32px}
196
205
  .xv5gsod:not(#\#):not(#\#){gap:36px}
197
206
  .x1jnr06f:not(#\#):not(#\#){gap:4px}
198
207
  .x1nejdyq:not(#\#):not(#\#){gap:5px}
@@ -212,6 +221,7 @@
212
221
  .x1jp4ehj:not(#\#):not(#\#){margin-block:8px}
213
222
  .xrxpjvj:not(#\#):not(#\#){margin-inline:0}
214
223
  .x1i847zn:not(#\#):not(#\#){margin-inline:36px}
224
+ .xvueqy4:not(#\#):not(#\#){margin-inline:auto}
215
225
  .x1a2a7pz:not(#\#):not(#\#){outline:none}
216
226
  .xysyzu8:not(#\#):not(#\#){overflow:auto}
217
227
  .xb3r6kr:not(#\#):not(#\#){overflow:hidden}
@@ -295,6 +305,7 @@
295
305
  .x1pha0wt:not(#\#):not(#\#):not(#\#){align-items:baseline}
296
306
  .x6s0dn4:not(#\#):not(#\#):not(#\#){align-items:center}
297
307
  .x1qjc9v5:not(#\#):not(#\#):not(#\#){align-items:stretch}
308
+ .xamitd3:not(#\#):not(#\#):not(#\#){align-self:center}
298
309
  .xegkacw:not(#\#):not(#\#):not(#\#){animation-duration:.9s}
299
310
  .x1m9vv7p:not(#\#):not(#\#):not(#\#){animation-duration:1.2s}
300
311
  .xa4qsjk:not(#\#):not(#\#):not(#\#){animation-iteration-count:infinite}
@@ -369,6 +380,7 @@
369
380
  .xt0e3qv:not(#\#):not(#\#):not(#\#){cursor:default}
370
381
  .x1h6gzvc:not(#\#):not(#\#):not(#\#){cursor:not-allowed}
371
382
  .x1ypdohk:not(#\#):not(#\#):not(#\#){cursor:pointer}
383
+ .x1huxd7x:not(#\#):not(#\#):not(#\#){cursor:zoom-in}
372
384
  .x104kibb:not(#\#):not(#\#):not(#\#){display:-webkit-box}
373
385
  .x1lliihq:not(#\#):not(#\#):not(#\#){display:block}
374
386
  .x78zum5:not(#\#):not(#\#):not(#\#){display:flex}
@@ -424,14 +436,12 @@
424
436
  .x1pd3egz:not(#\#):not(#\#):not(#\#){font-weight:inherit}
425
437
  .xz5popk:not(#\#):not(#\#):not(#\#){grid-template-columns:124px minmax(0,220px)}
426
438
  .x1emn39o:not(#\#):not(#\#):not(#\#){grid-template-columns:124px}
427
- .x8z353p:not(#\#):not(#\#):not(#\#){grid-template-columns:180px minmax(0,1fr)}
428
439
  .x1o61qjw:not(#\#):not(#\#):not(#\#){grid-template-columns:1fr 1fr}
429
440
  .x1y6fwsi:not(#\#):not(#\#):not(#\#){grid-template-columns:1fr}
430
441
  .xd67fm3:not(#\#):not(#\#):not(#\#){grid-template-columns:2.5ch max-content}
431
442
  .x1otrvri:not(#\#):not(#\#):not(#\#){grid-template-columns:22px minmax(0,1fr)}
432
443
  .x18588mg:not(#\#):not(#\#):not(#\#){grid-template-columns:344px minmax(0,1fr)}
433
444
  .x770nye:not(#\#):not(#\#):not(#\#){grid-template-columns:36px minmax(0,1fr) auto}
434
- .xpczwk3:not(#\#):not(#\#):not(#\#){grid-template-columns:40px minmax(0,1fr)}
435
445
  .x1hxcnyl:not(#\#):not(#\#):not(#\#){grid-template-columns:68px minmax(0,1fr)}
436
446
  .xwfq92r:not(#\#):not(#\#):not(#\#){grid-template-columns:68px}
437
447
  .xubx16b:not(#\#):not(#\#):not(#\#){grid-template-columns:auto minmax(140px,1fr) auto}
@@ -487,6 +497,7 @@
487
497
  .xcev3uh:not(#\#):not(#\#):not(#\#){margin-inline-start:14px}
488
498
  .xvc5jky:not(#\#):not(#\#):not(#\#){margin-inline-start:auto}
489
499
  .x19kjcj4:not(#\#):not(#\#):not(#\#){object-fit:contain}
500
+ .xl1xv1r:not(#\#):not(#\#):not(#\#){object-fit:cover}
490
501
  .x1667htg:not(#\#):not(#\#):not(#\#){opacity:.78}
491
502
  .x2ssjo2:not(#\#):not(#\#):not(#\#){outline-offset:-2px}
492
503
  .x1hl8ikr:not(#\#):not(#\#):not(#\#){outline-offset:2px}
@@ -503,6 +514,7 @@
503
514
  .x10l6tqk:not(#\#):not(#\#):not(#\#){position:absolute}
504
515
  .xixxii4:not(#\#):not(#\#):not(#\#){position:fixed}
505
516
  .x1n2onr6:not(#\#):not(#\#):not(#\#){position:relative}
517
+ .xtt52l0:not(#\#):not(#\#):not(#\#){resize:none}
506
518
  .x288g5:not(#\#):not(#\#):not(#\#){resize:vertical}
507
519
  .xgwpcrc:not(#\#):not(#\#):not(#\#){scrollbar-color:var(--console-rule-strong) transparent}
508
520
  .x1597r2g:not(#\#):not(#\#):not(#\#){scrollbar-width:thin}
@@ -622,16 +634,15 @@
622
634
  @media (max-width: 640px){.x1ux6vrq.x1ux6vrq:not(#\#):not(#\#):not(#\#){display:flex}}
623
635
  @media (max-width: 640px){.x10acg2q.x10acg2q:not(#\#):not(#\#):not(#\#){display:grid}}
624
636
  @media (max-width: 640px){.x13v5x0x.x13v5x0x:not(#\#):not(#\#):not(#\#){display:inline-flex}}
625
- @media (max-width: 860px){.x19y3i14.x19y3i14:not(#\#):not(#\#):not(#\#){display:inline-flex}}
626
637
  @media (max-width: 900px){.x168i3sl.x168i3sl:not(#\#):not(#\#):not(#\#){display:inline-flex}}
627
638
  @media (max-width: 640px){.xkaaz9w.xkaaz9w:not(#\#):not(#\#):not(#\#){display:none}}
628
- @media (max-width: 860px){.xubcuz8.xubcuz8:not(#\#):not(#\#):not(#\#){display:none}}
629
639
  @media (max-width: 900px){.xzd29fr.xzd29fr:not(#\#):not(#\#):not(#\#){display:none}}
630
640
  @media (max-width: 640px){.x19d57q8.x19d57q8:not(#\#):not(#\#):not(#\#){flex-basis:400px}}
631
641
  @media (max-width: 640px){.xzbubq.xzbubq:not(#\#):not(#\#):not(#\#){flex-wrap:wrap}}
632
642
  @media (max-width: 640px){.x162edmi.x162edmi:not(#\#):not(#\#):not(#\#){font-family:var(--console-mono)}}
633
643
  @media (max-width: 640px){.xxgfmko.xxgfmko:not(#\#):not(#\#):not(#\#){font-size:10.5px}}
634
644
  @media (max-width: 640px){.x1sj03fv.x1sj03fv:not(#\#):not(#\#):not(#\#){font-size:11px}}
645
+ @media (max-width: 640px){.x1sgj8az.x1sgj8az:not(#\#):not(#\#):not(#\#){font-size:15px}}
635
646
  @media (max-width: 640px){.xf2x79s.xf2x79s:not(#\#):not(#\#):not(#\#){font-size:16px}}
636
647
  @media (max-width: 640px){.xn50ssu.xn50ssu:not(#\#):not(#\#):not(#\#){font-size:17px}}
637
648
  @media (max-width: 640px){.xidcplc.xidcplc:not(#\#):not(#\#):not(#\#){font-size:21px}}
@@ -642,12 +653,10 @@
642
653
  @media (max-width: 640px){.xreyasp.xreyasp:not(#\#):not(#\#):not(#\#){grid-template-columns:1fr}}
643
654
  @media (max-width: 640px){.xa4j55y.xa4j55y:not(#\#):not(#\#):not(#\#){grid-template-columns:24px minmax(0,1fr) auto}}
644
655
  @media (min-width: 641px) and (max-width: 900px){.xig6l2g.xig6l2g:not(#\#):not(#\#):not(#\#){grid-template-columns:260px minmax(0,1fr)}}
645
- @media (max-width: 640px){.xfs71jk.xfs71jk:not(#\#):not(#\#):not(#\#){grid-template-columns:28px minmax(0,1fr)}}
646
656
  @media (max-width: 900px){.x7aqbxz.x7aqbxz:not(#\#):not(#\#):not(#\#){grid-template-columns:auto minmax(0,1fr) auto}}
647
657
  @media (max-width: 640px){.xlpkf44.xlpkf44:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr) auto}}
648
658
  @media (max-width: 1000px){.x1xvdkq4.x1xvdkq4:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}}
649
659
  @media (max-width: 640px){.x4jmfmw.x4jmfmw:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}}
650
- @media (max-width: 860px){.xf4kbi9.xf4kbi9:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}}
651
660
  @media (max-width: 900px){.xirox3h.xirox3h:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}}
652
661
  @media (max-width:900px){.x5oc4b.x5oc4b:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}}
653
662
  @media (min-width: 641px) and (max-width: 900px){.x8ef1wo.x8ef1wo:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}}
@@ -715,6 +724,7 @@
715
724
  .x1fgtraw:not(#\#):not(#\#):not(#\#):not(#\#){height:28px}
716
725
  .x10w6t97:not(#\#):not(#\#):not(#\#):not(#\#){height:32px}
717
726
  .xc9qbxq:not(#\#):not(#\#):not(#\#):not(#\#){height:36px}
727
+ .x1vqgdyp:not(#\#):not(#\#):not(#\#):not(#\#){height:40px}
718
728
  .x5kalc8:not(#\#):not(#\#):not(#\#):not(#\#){height:42px}
719
729
  .xn3w4p2:not(#\#):not(#\#):not(#\#):not(#\#){height:44px}
720
730
  .xegnrdp:not(#\#):not(#\#):not(#\#):not(#\#){height:9px}
@@ -732,7 +742,7 @@
732
742
  .x1yztbdb:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:16px}
733
743
  .x1c436fg:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:18px}
734
744
  .xieb3on:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:20px}
735
- .x91k8ka:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:22px}
745
+ .x1xka2u1:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:26px}
736
746
  .x12nagc:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:4px}
737
747
  .xzueoph:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:6px}
738
748
  .xwoyzhm:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:7px}
@@ -751,24 +761,30 @@
751
761
  .x1xmf6yo:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:8px}
752
762
  .xr1yuqi:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:auto}
753
763
  .x1wj9ous:not(#\#):not(#\#):not(#\#):not(#\#){max-height:100dvh}
764
+ .x569fbc:not(#\#):not(#\#):not(#\#):not(#\#){max-height:100px}
765
+ .x1hyak1l:not(#\#):not(#\#):not(#\#):not(#\#){max-height:140px}
754
766
  .x1aoj0v:not(#\#):not(#\#):not(#\#):not(#\#){max-height:150px}
755
- .x19aweqf:not(#\#):not(#\#):not(#\#):not(#\#){max-height:180px}
756
- .x14eurpq:not(#\#):not(#\#):not(#\#):not(#\#){max-height:480px}
767
+ .x1iuus0c:not(#\#):not(#\#):not(#\#):not(#\#){max-height:260px}
768
+ .x6kd6ug:not(#\#):not(#\#):not(#\#):not(#\#){max-height:60dvh}
757
769
  .x1j65ot3:not(#\#):not(#\#):not(#\#):not(#\#){max-height:65dvh}
758
- .x1551h31:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(240px,28dvh)}
759
770
  .x1js9hbl:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(35dvh,16rem)}
771
+ .x8ln6o7:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(40dvh,320px)}
772
+ .xtgemb3:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(480px,60dvh)}
760
773
  .xojfs98:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(84dvh,720px)}
761
774
  .xlz9g7p:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--radix-dropdown-menu-content-available-height,320px)}
762
775
  .x1yy5vjr:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--radix-select-content-available-height,320px)}
763
776
  .x193iq5w:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}
764
777
  .x1racy4e:not(#\#):not(#\#):not(#\#):not(#\#){max-width:220px}
778
+ .x1jkqq1h:not(#\#):not(#\#):not(#\#):not(#\#){max-width:280px}
765
779
  .xxc7z9f:not(#\#):not(#\#):not(#\#):not(#\#){max-width:360px}
766
780
  .x197vjsw:not(#\#):not(#\#):not(#\#):not(#\#){max-width:430px}
767
781
  .x6amaq2:not(#\#):not(#\#):not(#\#):not(#\#){max-width:48ch}
768
782
  .x73t7g:not(#\#):not(#\#):not(#\#):not(#\#){max-width:55%}
769
783
  .xiky8lt:not(#\#):not(#\#):not(#\#):not(#\#){max-width:62ch}
784
+ .x1ac2792:not(#\#):not(#\#):not(#\#):not(#\#){max-width:740px}
770
785
  .x15g8yj6:not(#\#):not(#\#):not(#\#):not(#\#){max-width:75ch}
771
786
  .xw7nakj:not(#\#):not(#\#):not(#\#):not(#\#){max-width:calc(100vw - 32px)}
787
+ .x1v8xovm:not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(580px,100%)}
772
788
  .x2lwn1j:not(#\#):not(#\#):not(#\#):not(#\#){min-height:0}
773
789
  .x1y6680h:not(#\#):not(#\#):not(#\#):not(#\#){min-height:1.65em}
774
790
  .xisnujt:not(#\#):not(#\#):not(#\#):not(#\#){min-height:20px}
@@ -784,9 +800,9 @@
784
800
  .xgujvf1:not(#\#):not(#\#):not(#\#):not(#\#){min-height:42px}
785
801
  .x1gg8mnh:not(#\#):not(#\#):not(#\#):not(#\#){min-height:44px}
786
802
  .x5mc7k8:not(#\#):not(#\#):not(#\#):not(#\#){min-height:480px}
803
+ .xt55aet:not(#\#):not(#\#):not(#\#):not(#\#){min-height:54px}
787
804
  .xbktkl8:not(#\#):not(#\#):not(#\#):not(#\#){min-height:56px}
788
805
  .xvkrg5o:not(#\#):not(#\#):not(#\#):not(#\#){min-height:58px}
789
- .xseoqlg:not(#\#):not(#\#):not(#\#):not(#\#){min-height:80px}
790
806
  .xefclja:not(#\#):not(#\#):not(#\#):not(#\#){min-height:88px}
791
807
  .x65nank:not(#\#):not(#\#):not(#\#):not(#\#){min-height:auto}
792
808
  .x1eguyfn:not(#\#):not(#\#):not(#\#):not(#\#){min-height:var(--console-touch)}
@@ -795,6 +811,7 @@
795
811
  .x5w4yej:not(#\#):not(#\#):not(#\#):not(#\#){min-width:160px}
796
812
  .xfb3i0g:not(#\#):not(#\#):not(#\#):not(#\#){min-width:180px}
797
813
  .x1vktgvc:not(#\#):not(#\#):not(#\#):not(#\#){min-width:230px}
814
+ .x1nb6za0:not(#\#):not(#\#):not(#\#):not(#\#){min-width:44px}
798
815
  .xk8lq53:not(#\#):not(#\#):not(#\#):not(#\#){min-width:max-content}
799
816
  .x113rx6s:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--radix-select-trigger-width,180px)}
800
817
  .xw2csxc:not(#\#):not(#\#):not(#\#):not(#\#){overflow-x:auto}
@@ -807,16 +824,14 @@
807
824
  .x1l90r2v:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:16px}
808
825
  .x1hhzuzn:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:18px}
809
826
  .xbe17z6:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:34px}
810
- .x198on2p:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:38px}
811
827
  .x1sgudl8:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:48px}
812
828
  .xnljgj5:not(#\#):not(#\#):not(#\#):not(#\#){padding-left:22px}
813
829
  .xxpkpgd:not(#\#):not(#\#):not(#\#):not(#\#){padding-left:28px}
814
830
  .xyndbda:not(#\#):not(#\#):not(#\#):not(#\#){padding-left:9px}
815
- .xz9dl7a:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:12px}
831
+ .xexx8yu:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:0}
816
832
  .xyamay9:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:16px}
817
833
  .x1p5oq8j:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:24px}
818
834
  .xijc0j3:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:36px}
819
- .x1yrsyyn:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:6px}
820
835
  .x3m8u43:not(#\#):not(#\#):not(#\#):not(#\#){right:0}
821
836
  .x44moml:not(#\#):not(#\#):not(#\#):not(#\#){right:14px}
822
837
  .xn5hqff:not(#\#):not(#\#):not(#\#):not(#\#){right:16px}
@@ -836,6 +851,7 @@
836
851
  .x1td3qas:not(#\#):not(#\#):not(#\#):not(#\#){width:32px}
837
852
  .x1691je0:not(#\#):not(#\#):not(#\#):not(#\#){width:34px}
838
853
  .x14qfxbe:not(#\#):not(#\#):not(#\#):not(#\#){width:36px}
854
+ .x100vrsf:not(#\#):not(#\#):not(#\#):not(#\#){width:40px}
839
855
  .x3p9ev8:not(#\#):not(#\#):not(#\#):not(#\#){width:420px}
840
856
  .x10h3iyq:not(#\#):not(#\#):not(#\#):not(#\#){width:42px}
841
857
  .x187nhsf:not(#\#):not(#\#):not(#\#):not(#\#){width:44px}
@@ -870,7 +886,6 @@
870
886
  @media (max-width: 640px){.x7xdyrl.x7xdyrl:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:10px}}
871
887
  @media (max-width: 640px){.xg0897w.xg0897w:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:24px}}
872
888
  @media (max-width: 640px){.x1h9t1nj.x1h9t1nj:not(#\#):not(#\#):not(#\#):not(#\#){max-height:110px}}
873
- @media (max-width: 860px){.x9h7e8.x9h7e8:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(480px,60dvh)}}
874
889
  @media (max-width: 640px){.xxnk3sr.xxnk3sr:not(#\#):not(#\#):not(#\#):not(#\#){max-height:min(88dvh,760px)}}
875
890
  @media (max-width: 640px){.xeyi6kz.xeyi6kz:not(#\#):not(#\#):not(#\#):not(#\#){max-width:none}}
876
891
  @media (max-width: 640px){.x1qm741w.x1qm741w:not(#\#):not(#\#):not(#\#):not(#\#){min-height:0}}
@@ -893,7 +908,6 @@
893
908
  @media (max-width: 640px){.xzuy7g3.xzuy7g3:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:16px}}
894
909
  @media (max-width: 640px){.x1pll5v8.x1pll5v8:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:88px}}
895
910
  @media (max-width: 640px){.x1lak8av.x1lak8av:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(20px + env(safe-area-inset-bottom))}}
896
- @media (max-width: 640px){.xw27878.xw27878:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(24px + env(safe-area-inset-bottom))}}
897
911
  @media (max-width: 640px){.x1m3yuwo.x1m3yuwo:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(28px + env(safe-area-inset-bottom))}}
898
912
  @media (max-width: 640px){.x1c54s19.x1c54s19:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(38px + env(safe-area-inset-bottom))}}
899
913
  @media (max-width: 640px){.x1lt50j.x1lt50j:not(#\#):not(#\#):not(#\#):not(#\#){padding-left:10px}}
@@ -1,4 +1,4 @@
1
- import{a as Ob,d as CO,e as AO,f as TO,g as EO}from"./studio-chunks/main-vzjqx8f9.js";import{$ as Ri,A as V1,Aa as kD,B as GO,Ba as _m,C as Uo,Ca as oR,D as QO,Da as lR,E as I1,Ea as sR,F as WO,Fa as pR,G as L1,Ga as Pm,H as FO,I as JO,J as ZO,K as xl,L as KO,M as eR,N as $1,O as tR,P as nR,Q as P1,R as Y1,S as Mh,T as vO,U as br,V as Th,W as jm,X as Eh,Y as E1,Z as M1,_ as Vm,aa as xO,ba as D1,ca as If,da as iR,ea as kO,fa as z1,ga as O1,h as rR,ha as $p,i as IO,ia as En,j as cR,ja as Jn,k as ya,ka as cs,l as Ym,la as km,m as $O,ma as mr,n as fR,na as Fn,o as PO,oa as zm,p as Xm,pa as hh,q as Ft,qa as Cm,r as Mt,ra as zM,s as _1,sa as BM,t as U1,ta as dh,u as q1,ua as oM,v as j1,va as lM,w as YO,wa as W,xa as HD,y as XO,ya as d1,z as ba,za as yD}from"./studio-chunks/main-ptks77cs.js";import"./studio-chunks/main-b34wmcw1.js";import{Ab as ci,Bb as R1,Cb as Im,Db as MO,Na as P,Oa as ds,Pa as qe,Qa as sn,Ta as wO,Ua as et,Va as Xp,Wa as ia,Za as pO,bb as mO,cb as gO,db as Ki,eb as H2,fb as nO,gb as iO,hb as oO,ib as N2,jb as k1,kb as C1,lb as A1,mb as T1,pb as sr,qb as Zi,rb as qO,sb as yr,tb as jO,ub as vr,vb as hR,wb as dR,xb as Zu,yb as yO,zb as Pp}from"./studio-chunks/main-1gqf08r8.js";import{Eb as We,Fb as Tb,Hb as VO,Ib as gl,Kb as FB}from"./studio-chunks/main-rjhqdb2v.js";var b2=Tb(function(WB){(function(){function t(){if(ne=!1,Ne){var Q=WB.unstable_now();at=Q;var de=!0;try{e:{V=!1,I&&(I=!1,st(At),At=-1),_=!0;var pe=L;try{t:{c(Q);for(R=l(w);R!==null&&!(R.expirationTime>Q&&d());){var rt=R.callback;if(typeof rt==="function"){R.callback=null,L=R.priorityLevel;var Ge=rt(R.expirationTime<=Q);if(Q=WB.unstable_now(),typeof Ge==="function"){R.callback=Ge,c(Q),de=!0;break t}R===l(w)&&s(w),c(Q)}else s(w);R=l(w)}if(R!==null)de=!0;else{var zi=l(k);zi!==null&&m(h,zi.startTime-Q),de=!1}}break e}finally{R=null,L=pe,_=!1}de=void 0}}finally{de?te():Ne=!1}}}function i(Q,de){var pe=Q.length;Q.push(de);e:for(;0<pe;){var rt=pe-1>>>1,Ge=Q[rt];if(0<r(Ge,de))Q[rt]=de,Q[pe]=Ge,pe=rt;else break e}}function l(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var de=Q[0],pe=Q.pop();if(pe!==de){Q[0]=pe;e:for(var rt=0,Ge=Q.length,zi=Ge>>>1;rt<zi;){var qo=2*(rt+1)-1,so=Q[qo],Nn=qo+1,Rt=Q[Nn];if(0>r(so,pe))Nn<Ge&&0>r(Rt,so)?(Q[rt]=Rt,Q[Nn]=pe,rt=Nn):(Q[rt]=so,Q[qo]=pe,rt=qo);else if(Nn<Ge&&0>r(Rt,pe))Q[rt]=Rt,Q[Nn]=pe,rt=Nn;else break e}}return de}function r(Q,de){var pe=Q.sortIndex-de.sortIndex;return pe!==0?pe:Q.id-de.id}function c(Q){for(var de=l(k);de!==null;){if(de.callback===null)s(k);else if(de.startTime<=Q)s(k),de.sortIndex=de.expirationTime,i(w,de);else break;de=l(k)}}function h(Q){if(I=!1,c(Q),!V)if(l(w)!==null)V=!0,Ne||(Ne=!0,te());else{var de=l(k);de!==null&&m(h,de.startTime-Q)}}function d(){return ne?!0:WB.unstable_now()-at<se?!1:!0}function m(Q,de){At=be(function(){Q(WB.unstable_now())},de)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),WB.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var y=performance;WB.unstable_now=function(){return y.now()}}else{var b=Date,S=b.now();WB.unstable_now=function(){return b.now()-S}}var w=[],k=[],E=1,R=null,L=3,_=!1,V=!1,I=!1,ne=!1,be=typeof setTimeout==="function"?setTimeout:null,st=typeof clearTimeout==="function"?clearTimeout:null,Nt=typeof setImmediate<"u"?setImmediate:null,Ne=!1,At=-1,se=5,at=-1;if(typeof Nt==="function")var te=function(){Nt(t)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Jt=je.port2;je.port1.onmessage=t,te=function(){Jt.postMessage(null)}}else te=function(){be(t,0)};WB.unstable_IdlePriority=5,WB.unstable_ImmediatePriority=1,WB.unstable_LowPriority=4,WB.unstable_NormalPriority=3,WB.unstable_Profiling=null,WB.unstable_UserBlockingPriority=2,WB.unstable_cancelCallback=function(Q){Q.callback=null},WB.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<Q?Math.floor(1000/Q):5},WB.unstable_getCurrentPriorityLevel=function(){return L},WB.unstable_next=function(Q){switch(L){case 1:case 2:case 3:var de=3;break;default:de=L}var pe=L;L=de;try{return Q()}finally{L=pe}},WB.unstable_requestPaint=function(){ne=!0},WB.unstable_runWithPriority=function(Q,de){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var pe=L;L=Q;try{return de()}finally{L=pe}},WB.unstable_scheduleCallback=function(Q,de,pe){var rt=WB.unstable_now();switch(typeof pe==="object"&&pe!==null?(pe=pe.delay,pe=typeof pe==="number"&&0<pe?rt+pe:rt):pe=rt,Q){case 1:var Ge=-1;break;case 2:Ge=250;break;case 5:Ge=1073741823;break;case 4:Ge=1e4;break;default:Ge=5000}return Ge=pe+Ge,Q={id:E++,callback:de,priorityLevel:Q,startTime:pe,expirationTime:Ge,sortIndex:-1},pe>rt?(Q.sortIndex=pe,i(k,Q),l(w)===null&&Q===l(k)&&(I?(st(At),At=-1):I=!0,m(h,pe-rt))):(Q.sortIndex=Ge,i(w,Q),V||_||(V=!0,Ne||(Ne=!0,te()))),Q},WB.unstable_shouldYield=d,WB.unstable_wrapCallback=function(Q){var de=L;return function(){var pe=L;L=de;try{return Q.apply(this,arguments)}finally{L=pe}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var v2=Tb(function(JB){var Qe=We(b2()),Tu=We(gl()),Eb=We(FB());(function(){function t(e,n){for(e=e.memoizedState;e!==null&&0<n;)e=e.next,n--;return e}function i(e,n,o,a){if(o>=n.length)return a;var u=n[o],f=fn(e)?e.slice():Oe({},e);return f[u]=i(e[u],n,o+1,a),f}function l(e,n,o){if(n.length!==o.length)console.warn("copyWithRename() expects paths of the same length");else{for(var a=0;a<o.length-1;a++)if(n[a]!==o[a]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return s(e,n,o,0)}}function s(e,n,o,a){var u=n[a],f=fn(e)?e.slice():Oe({},e);return a+1===n.length?(f[o[a]]=f[u],fn(f)?f.splice(u,1):delete f[u]):f[u]=s(e[u],n,o,a+1),f}function r(e,n,o){var a=n[o],u=fn(e)?e.slice():Oe({},e);if(o+1===n.length)return fn(u)?u.splice(a,1):delete u[a],u;return u[a]=r(e[a],n,o+1),u}function c(){return!1}function h(){return null}function d(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function m(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function y(){}function b(){}function S(e){var n=[];return e.forEach(function(o){n.push(o)}),n.sort().join(", ")}function w(e,n,o,a){return new UR(e,n,o,a)}function k(e,n){e.context===Hs&&(Xy(e.current,2,n,e,null,null),_r())}function E(e,n){if(Vi!==null){var o=n.staleFamilies;n=n.updatedFamilies,Bc(),CS(e.current,n,o),_r()}}function R(e){Vi=e}function L(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function V(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function I(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function ne(e){if(_(e)!==e)throw Error("Unable to find node on an unmounted component.")}function be(e){var n=e.alternate;if(!n){if(n=_(e),n===null)throw Error("Unable to find node on an unmounted component.");return n!==e?null:e}for(var o=e,a=n;;){var u=o.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){o=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===o)return ne(u),e;if(f===a)return ne(u),n;f=f.sibling}throw Error("Unable to find node on an unmounted component.")}if(o.return!==a.return)o=u,a=f;else{for(var p=!1,g=u.child;g;){if(g===o){p=!0,o=u,a=f;break}if(g===a){p=!0,a=u,o=f;break}g=g.sibling}if(!p){for(g=f.child;g;){if(g===o){p=!0,o=f,a=u;break}if(g===a){p=!0,a=f,o=u;break}g=g.sibling}if(!p)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(o.alternate!==a)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(o.tag!==3)throw Error("Unable to find node on an unmounted component.");return o.stateNode.current===o?e:n}function st(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=st(e),n!==null)return n;e=e.sibling}return null}function Nt(e){if(e===null||typeof e!=="object")return null;return e=Rk&&e[Rk]||e["@@iterator"],typeof e==="function"?e:null}function Ne(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===lz?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case Pr:return"Fragment";case Zy:return"Profiler";case _d:return"StrictMode";case e0:return"Suspense";case t0:return"SuspenseList";case n0:return"Activity"}if(typeof e==="object")switch(typeof e.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case $r:return"Portal";case ll:return e.displayName||"Context";case Ky:return(e._context.displayName||"Context")+".Consumer";case Pc:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ud:return n=e.displayName||null,n!==null?n:Ne(e.type)||"Memo";case wi:n=e._payload,e=e._init;try{return Ne(e(n))}catch(o){}}return null}function At(e){return typeof e.tag==="number"?se(e):typeof e.name==="string"?e.name:null}function se(e){var n=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(n._context.displayName||"Context")+".Consumer";case 10:return n.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(n);case 8:return n===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof n==="function")return n.displayName||n.name||null;if(typeof n==="string")return n;break;case 29:if(n=e._debugInfo,n!=null){for(var o=n.length-1;0<=o;o--)if(typeof n[o].name==="string")return n[o].name}if(e.return!==null)return se(e.return)}return null}function at(e){return{current:e}}function te(e,n){0>ql?console.error("Unexpected pop."):(n!==o0[ql]&&console.error("Unexpected Fiber popped."),e.current=i0[ql],i0[ql]=null,o0[ql]=null,ql--)}function je(e,n,o){ql++,i0[ql]=e.current,o0[ql]=o,e.current=n}function Jt(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function Q(e,n){je(Ds,n,e),je(Yc,e,e),je(Ms,null,e);var o=n.nodeType;switch(o){case 9:case 11:o=o===9?"#document":"#fragment",n=(n=n.documentElement)?(n=n.namespaceURI)?tk(n):Kl:Kl;break;default:if(o=n.tagName,n=n.namespaceURI)n=tk(n),n=nk(n,o);else switch(o){case"svg":n=Cu;break;case"math":n=Np;break;default:n=Kl}}o=o.toLowerCase(),o=W1(null,o),o={context:n,ancestorInfo:o},te(Ms,e),je(Ms,o,e)}function de(e){te(Ms,e),te(Yc,e),te(Ds,e)}function pe(){return Jt(Ms.current)}function rt(e){e.memoizedState!==null&&je(qd,e,e);var n=Jt(Ms.current),o=e.type,a=nk(n.context,o);o=W1(n.ancestorInfo,o),a={context:a,ancestorInfo:o},n!==a&&(je(Yc,e,e),je(Ms,a,e))}function Ge(e){Yc.current===e&&(te(Ms,e),te(Yc,e)),qd.current===e&&(te(qd,e),_f._currentValue=or)}function zi(){}function qo(){if(Xc===0){Lk=console.log,zk=console.info,Bk=console.warn,Hk=console.error,Nk=console.group,_k=console.groupCollapsed,Uk=console.groupEnd;var e={configurable:!0,enumerable:!0,value:zi,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Xc++}function so(){if(Xc--,Xc===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Oe({},e,{value:Lk}),info:Oe({},e,{value:zk}),warn:Oe({},e,{value:Bk}),error:Oe({},e,{value:Hk}),group:Oe({},e,{value:Nk}),groupCollapsed:Oe({},e,{value:_k}),groupEnd:Oe({},e,{value:Uk})})}0>Xc&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Nn(e){var n=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=n,e.startsWith(`Error: react-stack-top-frame
1
+ import{a as Ob,d as CO,e as AO,f as Pp,g as ci,h as TO,i as EO,j as R1,k as Im,l as MO}from"./studio-chunks/main-me847330.js";import{$ as jm,A as j1,Aa as lM,B as YO,Ba as W,Ca as HD,D as XO,Da as d1,E as ba,Ea as yD,F as V1,Fa as kD,G as GO,Ga as _m,H as Uo,Ha as oR,I as QO,Ia as lR,J as I1,Ja as sR,K as WO,Ka as pR,L as L1,La as Pm,M as FO,N as JO,O as ZO,P as xl,Q as KO,R as eR,S as $1,T as tR,U as nR,V as P1,W as Y1,X as Mh,Y as vO,Z as br,_ as Th,aa as Eh,ba as E1,ca as M1,da as Vm,ea as Ri,fa as xO,ga as D1,ha as If,ia as iR,ja as kO,ka as z1,la as O1,m as rR,ma as $p,n as IO,na as En,o as cR,oa as Jn,p as ya,pa as cs,q as Ym,qa as km,r as $O,ra as mr,s as fR,sa as Fn,t as PO,ta as zm,u as Xm,ua as hh,v as Ft,va as Cm,w as Mt,wa as zM,x as _1,xa as BM,y as U1,ya as dh,z as q1,za as oM}from"./studio-chunks/main-g6b89p15.js";import"./studio-chunks/main-g0bad58x.js";import{$a as ia,Ab as hR,Bb as dR,Cb as Zu,Db as yO,Sa as P,Ta as ds,Ua as qe,Va as sn,Ya as wO,Za as et,_a as Xp,cb as pO,gb as mO,hb as gO,ib as Ki,jb as H2,kb as nO,lb as iO,mb as oO,nb as N2,ob as k1,pb as C1,qb as A1,rb as T1,ub as sr,vb as Zi,wb as qO,xb as yr,yb as jO,zb as vr}from"./studio-chunks/main-53ha0ekw.js";import{Eb as We,Fb as Tb,Hb as VO,Ib as gl,Kb as FB}from"./studio-chunks/main-rjhqdb2v.js";var b2=Tb(function(WB){(function(){function t(){if(ne=!1,Ne){var Q=WB.unstable_now();at=Q;var de=!0;try{e:{V=!1,I&&(I=!1,st(At),At=-1),_=!0;var pe=L;try{t:{c(Q);for(R=l(w);R!==null&&!(R.expirationTime>Q&&d());){var rt=R.callback;if(typeof rt==="function"){R.callback=null,L=R.priorityLevel;var Ge=rt(R.expirationTime<=Q);if(Q=WB.unstable_now(),typeof Ge==="function"){R.callback=Ge,c(Q),de=!0;break t}R===l(w)&&s(w),c(Q)}else s(w);R=l(w)}if(R!==null)de=!0;else{var zi=l(k);zi!==null&&m(h,zi.startTime-Q),de=!1}}break e}finally{R=null,L=pe,_=!1}de=void 0}}finally{de?te():Ne=!1}}}function i(Q,de){var pe=Q.length;Q.push(de);e:for(;0<pe;){var rt=pe-1>>>1,Ge=Q[rt];if(0<r(Ge,de))Q[rt]=de,Q[pe]=Ge,pe=rt;else break e}}function l(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var de=Q[0],pe=Q.pop();if(pe!==de){Q[0]=pe;e:for(var rt=0,Ge=Q.length,zi=Ge>>>1;rt<zi;){var qo=2*(rt+1)-1,so=Q[qo],Nn=qo+1,Rt=Q[Nn];if(0>r(so,pe))Nn<Ge&&0>r(Rt,so)?(Q[rt]=Rt,Q[Nn]=pe,rt=Nn):(Q[rt]=so,Q[qo]=pe,rt=qo);else if(Nn<Ge&&0>r(Rt,pe))Q[rt]=Rt,Q[Nn]=pe,rt=Nn;else break e}}return de}function r(Q,de){var pe=Q.sortIndex-de.sortIndex;return pe!==0?pe:Q.id-de.id}function c(Q){for(var de=l(k);de!==null;){if(de.callback===null)s(k);else if(de.startTime<=Q)s(k),de.sortIndex=de.expirationTime,i(w,de);else break;de=l(k)}}function h(Q){if(I=!1,c(Q),!V)if(l(w)!==null)V=!0,Ne||(Ne=!0,te());else{var de=l(k);de!==null&&m(h,de.startTime-Q)}}function d(){return ne?!0:WB.unstable_now()-at<se?!1:!0}function m(Q,de){At=be(function(){Q(WB.unstable_now())},de)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),WB.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var y=performance;WB.unstable_now=function(){return y.now()}}else{var b=Date,S=b.now();WB.unstable_now=function(){return b.now()-S}}var w=[],k=[],E=1,R=null,L=3,_=!1,V=!1,I=!1,ne=!1,be=typeof setTimeout==="function"?setTimeout:null,st=typeof clearTimeout==="function"?clearTimeout:null,Nt=typeof setImmediate<"u"?setImmediate:null,Ne=!1,At=-1,se=5,at=-1;if(typeof Nt==="function")var te=function(){Nt(t)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Jt=je.port2;je.port1.onmessage=t,te=function(){Jt.postMessage(null)}}else te=function(){be(t,0)};WB.unstable_IdlePriority=5,WB.unstable_ImmediatePriority=1,WB.unstable_LowPriority=4,WB.unstable_NormalPriority=3,WB.unstable_Profiling=null,WB.unstable_UserBlockingPriority=2,WB.unstable_cancelCallback=function(Q){Q.callback=null},WB.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<Q?Math.floor(1000/Q):5},WB.unstable_getCurrentPriorityLevel=function(){return L},WB.unstable_next=function(Q){switch(L){case 1:case 2:case 3:var de=3;break;default:de=L}var pe=L;L=de;try{return Q()}finally{L=pe}},WB.unstable_requestPaint=function(){ne=!0},WB.unstable_runWithPriority=function(Q,de){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var pe=L;L=Q;try{return de()}finally{L=pe}},WB.unstable_scheduleCallback=function(Q,de,pe){var rt=WB.unstable_now();switch(typeof pe==="object"&&pe!==null?(pe=pe.delay,pe=typeof pe==="number"&&0<pe?rt+pe:rt):pe=rt,Q){case 1:var Ge=-1;break;case 2:Ge=250;break;case 5:Ge=1073741823;break;case 4:Ge=1e4;break;default:Ge=5000}return Ge=pe+Ge,Q={id:E++,callback:de,priorityLevel:Q,startTime:pe,expirationTime:Ge,sortIndex:-1},pe>rt?(Q.sortIndex=pe,i(k,Q),l(w)===null&&Q===l(k)&&(I?(st(At),At=-1):I=!0,m(h,pe-rt))):(Q.sortIndex=Ge,i(w,Q),V||_||(V=!0,Ne||(Ne=!0,te()))),Q},WB.unstable_shouldYield=d,WB.unstable_wrapCallback=function(Q){var de=L;return function(){var pe=L;L=de;try{return Q.apply(this,arguments)}finally{L=pe}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var v2=Tb(function(JB){var Qe=We(b2()),Tu=We(gl()),Eb=We(FB());(function(){function t(e,n){for(e=e.memoizedState;e!==null&&0<n;)e=e.next,n--;return e}function i(e,n,o,a){if(o>=n.length)return a;var u=n[o],f=fn(e)?e.slice():Oe({},e);return f[u]=i(e[u],n,o+1,a),f}function l(e,n,o){if(n.length!==o.length)console.warn("copyWithRename() expects paths of the same length");else{for(var a=0;a<o.length-1;a++)if(n[a]!==o[a]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return s(e,n,o,0)}}function s(e,n,o,a){var u=n[a],f=fn(e)?e.slice():Oe({},e);return a+1===n.length?(f[o[a]]=f[u],fn(f)?f.splice(u,1):delete f[u]):f[u]=s(e[u],n,o,a+1),f}function r(e,n,o){var a=n[o],u=fn(e)?e.slice():Oe({},e);if(o+1===n.length)return fn(u)?u.splice(a,1):delete u[a],u;return u[a]=r(e[a],n,o+1),u}function c(){return!1}function h(){return null}function d(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function m(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function y(){}function b(){}function S(e){var n=[];return e.forEach(function(o){n.push(o)}),n.sort().join(", ")}function w(e,n,o,a){return new UR(e,n,o,a)}function k(e,n){e.context===Hs&&(Xy(e.current,2,n,e,null,null),_r())}function E(e,n){if(Vi!==null){var o=n.staleFamilies;n=n.updatedFamilies,Bc(),CS(e.current,n,o),_r()}}function R(e){Vi=e}function L(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function V(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function I(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function ne(e){if(_(e)!==e)throw Error("Unable to find node on an unmounted component.")}function be(e){var n=e.alternate;if(!n){if(n=_(e),n===null)throw Error("Unable to find node on an unmounted component.");return n!==e?null:e}for(var o=e,a=n;;){var u=o.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){o=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===o)return ne(u),e;if(f===a)return ne(u),n;f=f.sibling}throw Error("Unable to find node on an unmounted component.")}if(o.return!==a.return)o=u,a=f;else{for(var p=!1,g=u.child;g;){if(g===o){p=!0,o=u,a=f;break}if(g===a){p=!0,a=u,o=f;break}g=g.sibling}if(!p){for(g=f.child;g;){if(g===o){p=!0,o=f,a=u;break}if(g===a){p=!0,a=f,o=u;break}g=g.sibling}if(!p)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(o.alternate!==a)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(o.tag!==3)throw Error("Unable to find node on an unmounted component.");return o.stateNode.current===o?e:n}function st(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=st(e),n!==null)return n;e=e.sibling}return null}function Nt(e){if(e===null||typeof e!=="object")return null;return e=Rk&&e[Rk]||e["@@iterator"],typeof e==="function"?e:null}function Ne(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===lz?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case Pr:return"Fragment";case Zy:return"Profiler";case _d:return"StrictMode";case e0:return"Suspense";case t0:return"SuspenseList";case n0:return"Activity"}if(typeof e==="object")switch(typeof e.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case $r:return"Portal";case ll:return e.displayName||"Context";case Ky:return(e._context.displayName||"Context")+".Consumer";case Pc:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ud:return n=e.displayName||null,n!==null?n:Ne(e.type)||"Memo";case wi:n=e._payload,e=e._init;try{return Ne(e(n))}catch(o){}}return null}function At(e){return typeof e.tag==="number"?se(e):typeof e.name==="string"?e.name:null}function se(e){var n=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(n._context.displayName||"Context")+".Consumer";case 10:return n.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(n);case 8:return n===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof n==="function")return n.displayName||n.name||null;if(typeof n==="string")return n;break;case 29:if(n=e._debugInfo,n!=null){for(var o=n.length-1;0<=o;o--)if(typeof n[o].name==="string")return n[o].name}if(e.return!==null)return se(e.return)}return null}function at(e){return{current:e}}function te(e,n){0>ql?console.error("Unexpected pop."):(n!==o0[ql]&&console.error("Unexpected Fiber popped."),e.current=i0[ql],i0[ql]=null,o0[ql]=null,ql--)}function je(e,n,o){ql++,i0[ql]=e.current,o0[ql]=o,e.current=n}function Jt(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function Q(e,n){je(Ds,n,e),je(Yc,e,e),je(Ms,null,e);var o=n.nodeType;switch(o){case 9:case 11:o=o===9?"#document":"#fragment",n=(n=n.documentElement)?(n=n.namespaceURI)?tk(n):Kl:Kl;break;default:if(o=n.tagName,n=n.namespaceURI)n=tk(n),n=nk(n,o);else switch(o){case"svg":n=Cu;break;case"math":n=Np;break;default:n=Kl}}o=o.toLowerCase(),o=W1(null,o),o={context:n,ancestorInfo:o},te(Ms,e),je(Ms,o,e)}function de(e){te(Ms,e),te(Yc,e),te(Ds,e)}function pe(){return Jt(Ms.current)}function rt(e){e.memoizedState!==null&&je(qd,e,e);var n=Jt(Ms.current),o=e.type,a=nk(n.context,o);o=W1(n.ancestorInfo,o),a={context:a,ancestorInfo:o},n!==a&&(je(Yc,e,e),je(Ms,a,e))}function Ge(e){Yc.current===e&&(te(Ms,e),te(Yc,e)),qd.current===e&&(te(qd,e),_f._currentValue=or)}function zi(){}function qo(){if(Xc===0){Lk=console.log,zk=console.info,Bk=console.warn,Hk=console.error,Nk=console.group,_k=console.groupCollapsed,Uk=console.groupEnd;var e={configurable:!0,enumerable:!0,value:zi,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Xc++}function so(){if(Xc--,Xc===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Oe({},e,{value:Lk}),info:Oe({},e,{value:zk}),warn:Oe({},e,{value:Bk}),error:Oe({},e,{value:Hk}),group:Oe({},e,{value:Nk}),groupCollapsed:Oe({},e,{value:_k}),groupEnd:Oe({},e,{value:Uk})})}0>Xc&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Nn(e){var n=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=n,e.startsWith(`Error: react-stack-top-frame
2
2
  `)&&(e=e.slice(29)),n=e.indexOf(`
3
3
  `),n!==-1&&(e=e.slice(n+1)),n=e.indexOf("react_stack_bottom_frame"),n!==-1&&(n=e.lastIndexOf(`
4
4
  `,n)),n!==-1)e=e.slice(0,n);else return"";return e}function Rt(e){if(l0===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);l0=n&&n[1]||"",qk=-1<o.stack.indexOf(`
@@ -242,6 +242,6 @@ You might need to use a local HTTP server (instead of file://): https://react.de
242
242
 
243
243
  [Open the Inbox item](${i.backlink})`;return{draft:l,body:i.body?`${i.body}
244
244
 
245
- ${s}`:s}}function HO(t,i,l){return{studioChatHandoff:{version:1,sourceId:t,itemId:i,label:l,prompt:"Help me understand this Inbox item and decide what to do next."}}}function NO(t){if(typeof t!=="object"||t===null)return null;let i=Reflect.get(t,"studioChatHandoff");if(typeof i!=="object"||i===null)return null;let l=Reflect.get(i,"version"),s=Reflect.get(i,"sourceId"),r=Reflect.get(i,"itemId"),c=Reflect.get(i,"label"),h=Reflect.get(i,"prompt");if(l!==1||typeof s!=="string"||!/^[a-z][a-z0-9-]*$/.test(s)||s.length>64||typeof r!=="string"||r.trim().length===0||r.length>300||typeof c!=="string"||c.trim().length===0||c.length>160||typeof h!=="string"||h.trim().length===0||h.length>1e4)return null;return{sourceId:s,itemId:r,label:c,prompt:h}}function ic(t){if(t instanceof vr)switch(t.status){case 401:return"Your session is no longer authenticated. Sign in again in another tab, then retry here. Keep this tab open to preserve your draft.";case 403:return"You do not currently have permission to read this content. Ask an administrator to check access, then retry.";case 404:return"This content is unavailable. It may have moved, been removed, or be outside your access. Choose another destination or retry.";case 429:return"Studio is receiving too many requests. Wait briefly before retrying."}return`Studio could not load this data. Check your connection or retry later. ${Ri(t)}`}var _O=new Set(["offset","limit"]);function UO(t,i){if(t?.urlQuery!==!0)return{};let l={};for(let[s,r]of new URLSearchParams(i))if(!_O.has(s))l[s]=r;return l}function B1(t){let i=new URLSearchParams,l=Object.entries(t).filter(([r,c])=>!_O.has(r)&&c!==void 0&&(typeof c!=="number"||Number.isFinite(c))).sort(([r],[c])=>r.localeCompare(c));for(let[r,c]of l)i.set(r,String(c));let s=i.toString();return s?`?${s}`:""}function oc(t,i){return`${t}${B1(i)}`}function H1(t,i,l,s){if(s!==i)return;t.replace(oc(i,l))}function N1(t){let i=yr.safeParse(jO(new URLSearchParams(t))),l=i.success?i.data:yr.parse({});return{...l,offset:Math.floor(l.offset/l.limit)*l.limit}}function Sr(t){let i=new URLSearchParams;if(t.offset>0)i.set("offset",String(t.offset));if(t.limit!==qO)i.set("limit",String(t.limit));if(t.q)i.set("q",t.q);if(t.visibility!=="all")i.set("visibility",t.visibility);if(t.status)i.set("status",t.status);if(t.sort!=="updated-desc")i.set("sort",t.sort);let l=i.toString();return l?`?${l}`:""}var wn=We(sn(),1),DH=le.lazy(async()=>({default:(await import("./studio-chunks/account-view-4544h367.js")).AccountApp})),OH=le.lazy(async()=>({default:(await import("./studio-chunks/studio-chat-workspace-kpfmp85b.js")).StudioChatWorkspace}));function RH(t){let i=new URLSearchParams(t).get("session")?.trim();return i&&i.length<=256?i:null}function LH(){let t=window.history.state;return x2(t)?t:{}}var zH=[],BH=[],HH={},NH=["public","trusted","admin"];function _H(t,i){let l=document.querySelector("[data-studio-root]"),s=l?.getAttribute("data-studio-principal-name")??"Your account",r=l?.getAttribute("data-studio-principal-role"),c=NH.find((h)=>h===r)??"public";return{displayName:s,role:c,routePath:t,studioPath:i}}function aR(){let t=$O(),i=Xm({select:(U)=>U.location.pathname}),l=Xm({select:(U)=>U.location.searchStr}),s=Xm({select:(U)=>U.location.state}),r=oR(),c=le.useMemo(()=>i===_1?{kind:"workspace",workspaceId:U1}:QO(i,r),[i,r]),h=le.useMemo(()=>c.kind==="collection"&&new URLSearchParams(l).get("mode")==="create",[l,c]),d=i,[m,y]=le.useState(null),[b,S]=le.useState(null),[w,k]=le.useState({}),[E,R]=le.useReducer(T2,jf),{mode:L,draft:_,body:V,save:I}=E,ne=A2(E),[be]=le.useState(()=>new XO),st=le.useSyncExternalStore(be.subscribe,be.hasDrafts,be.hasDrafts),[Nt,Ne]=le.useState({hasDraft:!1,busy:!1}),At=PO({shouldBlockFn:({next:U})=>ne||i===_1&&YO({...Nt,hasDraft:st},U.pathname),enableBeforeUnload:ne||st||Nt.busy,withResolver:!0}),[se,at]=le.useState({kind:"idle"}),[te,je]=le.useState("preview"),[Jt,Q]=le.useState("details"),de=le.useRef(null),pe=le.useCallback((U)=>{de.current=U,Q(U)},[]),[rt,Ge]=le.useState(null),[zi,qo]=le.useState(0),[so,Nn]=le.useState(null),Rt=le.useRef(0),ao=le.useRef(null),an=le.useRef(0),va=le.useRef(b);va.current=b;let ut=IO(),_t=Zu(),Be=ya(KO(_t)),X=Be.data?.types??null,Kn=X?.find((U)=>U.entityType===b),Ke=Kn?.capabilities,It=le.useMemo(()=>Kn?.isSingleton?N1(""):N1(l),[Kn?.isSingleton,l]),Lt=It.offset,Se=Be.data?.workspaces??BH,Ye=Se.find((U)=>U.id===m),rn=Ye?.rendererName===WO,jo=Ye?.rendererName===q1,we=Ye?.rendererName==="DeclarativeOperatorWorkspace",kl=m?w[m]:void 0,ei=Ye?.urlQuery!==!0||kl?.urlSearch===l,un=le.useMemo(()=>UO(Ye,l),[Ye,l]),ro=m?kl&&ei?kl.query:un:HH,Cl=ya({...eR(_t,m??"",ro),enabled:we}),uo=Cl.data??null,Sa=uo?.data??null,Bi=Cl.error?ic(Cl.error):null,co=L.kind==="edit"?L.entity.id:null,wr=ya({...tR(_t,b??"",co??""),enabled:b!==null&&co!==null&&Ke?.canAssist===!0&&Ke.canUpdate}).data??zH,Hi=ya({...nR(_t),enabled:b!==null}).data??null,Ni=ya({...Y1(_t,b??"",It),enabled:b!==null}),xr=b?Ni.data?.entities??null:null,Vo=Ni.data?.total,Al=ya({...P1(_t,b??""),enabled:b!==null}),_n=b?Al.data??null:null;ya({...Mh(_t,b??"",co??""),enabled:b!==null&&co!==null});let fo=Ym({mutationFn:(U)=>ZO(_t,U)}),K=Ym({mutationFn:(U)=>JO(_t,U)}),bt=Ym({mutationFn:(U)=>FO(_t,U)}),Tl=K.isPending,ho=we&&uo?uo.data:null;le.useEffect(()=>{if(!b||!Kn||m||c.kind!=="collection"&&c.kind!=="entity"||c.entityType!==b)return;if(Vo===void 0)return;let U=Math.floor(Math.max(0,Vo-1)/It.limit)*It.limit;if(Lt>U)t.history.replace(`${i}${Sr({...It,offset:U})}`,t.history.location.state)},[Kn,m,Lt,Vo,It,b,i,c,t.history]),le.useEffect(()=>{if(!m||!ho?.refreshAfterMs)return;let U=window.setTimeout(()=>{ut.invalidateQueries({queryKey:xl.workspace(m)})},ho.refreshAfterMs);return()=>window.clearTimeout(U)},[m,ho,ut]),le.useEffect(()=>{if(Ye?.urlQuery!==!0||c.kind!=="workspace"||c.workspaceId!==Ye.id)return;let U=Uo(r,Ye.id);if(oc(U,un)!==`${U}${l}`)H1(t.history,U,un,window.location.pathname)},[Ye,r,un,l,c,t.history]),le.useEffect(()=>{if(!X)return;if(Ge(null),c.kind==="not-found"){an.current+=1,Ge(`Studio route not found: ${c.pathname}`);return}if(c.kind==="workspace"){let xe=Se.find((Me)=>Me.id===c.workspaceId);if(!xe){let Me=lR(r,c.workspaceId,l,Se);if(Me){t.history.replace(Me);return}an.current+=1,Ge(`Workspace unavailable for this account: ${c.workspaceId}`);return}y(xe.id),S(null);return}let U=c.kind==="collection"||c.kind==="entity"?c.entityType:void 0,re=X.find((xe)=>!xe.isSingleton)??X[0];if(c.kind==="home"){let xe=sR(r,X,Se);if(xe!==r){t.history.replace(xe);return}}let Le=U??re?.entityType??null;if(U!==void 0&&!X.some((xe)=>xe.entityType===U)){an.current+=1,Ge(`Collection unavailable for this account: ${U}`);return}y(null),S(Le)},[l,c,t.history,r,X,Se]),le.useEffect(()=>{if(I.kind!=="saved"||!Hi?.git)return;if(qm({save:I,git:Hi.git,baselineCommit:so}).committed==="done")return;if(Date.now()-Rt.current>20000)return;let re=window.setTimeout(()=>{ut.invalidateQueries({queryKey:xl.syncStatus()})},900);return()=>window.clearTimeout(re)},[I,Hi,so,ut]),le.useEffect(()=>{if(!b||c.kind==="workspace"||c.kind==="not-found")return;let U=c.kind==="entity"&&c.entityType===b?c.id:null,re=++an.current;R({type:"collectionChanged"}),Q("details"),at({kind:"idle"});let Le=!0,xe=()=>Le&&re===an.current;return ut.fetchQuery({...P1(_t,b),staleTime:0}).then(async(Me)=>{if(!Le||re!==an.current)return;let Ve=DO(Me,de.current);if(Q(Ve),window.matchMedia("(max-width: 640px)").matches&&Ve!=="details")je(Ve==="write"?"source":"preview");if(h&&U===null){if(X?.find((cn)=>cn.entityType===b)?.capabilities.canCreate!==!0){Ge(`Creating ${b} is not allowed.`);return}let Ol=zO(window.history.state,b,()=>window.history.replaceState(LO(LH()),"",window.location.href)),go=BO(Me.fields,Ol);R({type:"creationStarted",draft:go.draft,body:go.body});return}if(U!==null)return ut.fetchQuery({...Mh(_t,b,U),staleTime:0}).then((Dl)=>{if(!Le||re!==an.current)return;let Ol=tc(Dl),go=ao.current,cn=go?.pathname===d?go.save:{kind:"idle"};if(go?.pathname===d)ao.current=null;R({type:"documentOpened",document:Ol,save:cn})});if(Me.isSingleton){let Dl=await ut.ensureQueryData(Y1(_t,b));if(!xe())return;let Ol=Dl.entities[0];if(Ol)return ut.fetchQuery({...Mh(_t,b,Ol.id),staleTime:0}).then((go)=>{if(!Le||re!==an.current)return;let cn=tc(go);R({type:"documentOpened",document:cn})});R({type:"creationStarted",draft:Eh(Me.fields)})}return}).catch((Me)=>{if(Le&&re===an.current)Ge(ic(Me))}),()=>{Le=!1}},[h,d,b,zi,ut,i,c,X]);let zt=le.useCallback((U,re={kind:"idle"})=>{if(!b)return;let Le=V1(r,b,U);if(Le!==d){ao.current={pathname:Le,save:re},t.history.push(`${Le}${Sr(It)}`,{studioCollectionPath:`${ba(r,b)}${Sr(It)}`},re.kind==="saved"?{ignoreBlocker:!0}:void 0);return}let xe=++an.current,Me=b;ut.fetchQuery({...Mh(_t,b,U),staleTime:0}).then((Ve)=>{if(xe!==an.current||va.current!==Me)return;let Dl=tc(Ve);R({type:"documentOpened",document:Dl,save:re}),at({kind:"idle"})}).catch((Ve)=>{if(xe===an.current)Ge(ic(Ve))})},[r,d,b,It,ut,t.history]),po=le.useCallback((U,re)=>{let Le=V1(r,U,re);ao.current={pathname:Le,save:{kind:"idle"}},t.history.push(Le,{studioCollectionPath:ba(r,U)})},[r,t.history]),El=le.useCallback((U,re,Le,xe)=>{t.history.push(GO(r,"note"),C2(U,`entity://${encodeURIComponent(Le)}/${encodeURIComponent(xe)}`,re))},[r,t.history]),Ml=le.useCallback((U,re,Le)=>{if(Se.some((xe)=>xe.rendererName===q1)){t.history.push(j1(r),HO(U,re,Le));return}},[t.history,r,Se]),sc=le.useCallback((U)=>{switch(U.target){case"account-settings":{t.history.push(Uo(r,I1));return}case"invitations":t.history.push(oc(Uo(r,"admin:administration"),{tab:"invitations"}));return;case"admin-peer-invite":{t.history.push(oc(Uo(r,"admin:administration"),{tab:"invitations",peerId:U.peerId,displayName:U.displayName}));return}case"inbox":{let re={};if("source"in U){if(re.sourceId="mail-items",U.filter==="high-priority")re["facet.mail-priority"]="high";else if(U.filter==="needs-reply")re["facet.needs-reply"]="true";else if(U.filter==="unclassified")re["facet.category"]="unclassified"}t.history.push(oc(Uo(r,"unified-inbox:inbox"),re));return}case"publishing":t.history.push(Uo(r,"content-pipeline:publishing"));return;case"site":t.history.push(Uo(r,"site-builder:site"));return;case"inbox-open-entity":po(U.entityType,U.entityId);return;case"inbox-capture-note":El(U.title,U.summary,U.entityType,U.entityId);return;case"inbox-discuss-in-chat":Ml(U.sourceId,U.itemId,U.label)}},[El,r,Ml,po,l,t.history]),kr=le.useCallback((U)=>{t.history.push(ba(r,U)),window.scrollTo({top:0,left:0})},[r,t.history]),Cr=le.useCallback((U)=>{if(!b)return;t.history.push(`${ba(r,b)}${Sr({...It,offset:U})}`),window.scrollTo({top:0,left:0})},[b,It,r,t.history]),ms=le.useCallback((U)=>{t.history.push(U===U1?j1(r):Uo(r,U)),window.scrollTo({top:0,left:0})},[r,t.history]),mo=le.useCallback(()=>{if(!_n||Ke?.canCreate!==!0)return;R({type:"creationStarted",draft:Eh(_n.fields)}),at({kind:"idle"})},[Ke,_n]),ti=le.useCallback(()=>{if(!b)return;let U=`${ba(r,b)}${Sr(It)}`,re=t.history.location.state;if(typeof re==="object"&&re!==null&&"studioCollectionPath"in re&&re.studioCollectionPath===U&&t.history.canGoBack()){t.history.back();return}t.history.replace(U)},[r,b,It,t.history]),Dh=le.useCallback((U,re)=>{if(!b||L.kind!=="edit"||Ke?.canUpdate!==!0||Ke.canAssist!==!0||V.trim().length===0)return;at({kind:"loading",field:re,variant:U}),_t.requestFieldAssist({variant:U,entityType:b,id:L.entity.id,targetField:re}).then((Le)=>{let xe=Le.variant==="summarise"?Le.suggestion:Le.suggestions;at({kind:"suggested",field:Le.targetField,variant:Le.variant,suggestion:xe})}).catch((Le)=>{at({kind:"error",field:re,message:Ri(Le)})})},[Ke,V,b,L]),Wm=le.useCallback((U,re)=>{R({type:"fieldAssistApplied",field:U,suggestion:re}),at({kind:"idle"})},[]),ac=le.useCallback(()=>{if(!b||L.kind==="browse"||!_n)return;if(L.kind==="create"?Ke?.canCreate!==!0:Ke?.canUpdate!==!0)return;Rt.current=Date.now(),Nn(Hi?.git?.lastCommit??null),R({type:"saveStarted"});let U=_n.hasBody?{body:V}:{},re=iR(_n.fields,_),Le=L.kind==="create"?{kind:"create",entityType:b,frontmatter:re,...U}:{kind:"update",entityType:b,id:L.entity.id,frontmatter:re,baseContentHash:L.entity.contentHash,...U},xe=an.current;fo.mutate(Le,{onSuccess:async(Me)=>{if(await Promise.all([ut.invalidateQueries({queryKey:xl.entities(b)}),ut.invalidateQueries({queryKey:xl.syncStatus()}),...L.kind==="create"?[ut.invalidateQueries({queryKey:xl.navigation()})]:[]]),xe!==an.current)return;let Ve="skipped"in Me&&Me.skipped===!0;zt(Me.entityId,{kind:"saved",noop:Ve})},onError:(Me)=>{if(xe!==an.current)return;if(Me instanceof vr&&Me.issues.length>0)Q("details");R({type:"saveFailed",save:Me instanceof vr&&Me.status===409?{kind:"conflict",message:Ri(Me)}:{kind:"error",message:Me instanceof vr&&Me.issues.length>0?Me.message||"Validation failed":Ri(Me),...Me instanceof vr?{issues:Me.issues}:{}}})}})},[Ke,b,L,_,V,_n,zt,Hi,ut,fo]),Oh=le.useCallback(()=>{if(!b||L.kind!=="edit"||Tl||Ke?.canDelete!==!0)return;let{id:U}=L.entity;K.mutate({entityType:b,id:U},{onSuccess:async()=>{R({type:"deleteSucceeded"}),ut.removeQueries({queryKey:xl.entity(b,U)}),await Promise.all([ut.invalidateQueries({queryKey:xl.entities(b)}),ut.invalidateQueries({queryKey:xl.syncStatus()}),ut.invalidateQueries({queryKey:xl.navigation()})]),t.history.replace(ba(r,b),void 0,{ignoreBlocker:!0})},onError:(re)=>{R({type:"deleteFailed",message:Ri(re)})}})},[Ke,r,b,L,Tl,ut,K,t.history]),Ar=le.useCallback(async(U)=>{let re=Se.find((Ve)=>Ve.pluginId==="content-pipeline"&&Ve.entityTypes.includes(U.entityType));if(!re)throw Error("Publishing is unavailable");let Le={entityType:U.entityType,entityId:U.entityId,...U.type==="reorder"?{position:U.position}:{}};if(U.type==="publish"&&!U.confirmation){let Ve=await bt.mutateAsync({workspaceId:re.id,action:{actionId:"publish",label:"Publish now",input:Le,invocation:{mode:"prepare"}}});if(typeof Ve!=="object"||Ve===null||!("kind"in Ve)||Ve.kind!=="prepared-confirmation"||!("token"in Ve)||typeof Ve.token!=="string"||!("summary"in Ve)||typeof Ve.summary!=="string"||!("expiresAt"in Ve)||typeof Ve.expiresAt!=="string")throw Error("Publishing confirmation is unavailable");return{needsConfirmation:!0,summary:Ve.summary,args:{confirmed:!0,confirmationToken:Ve.token,contentHash:Ve.token,expiresAt:Ve.expiresAt}}}let xe=await bt.mutateAsync({workspaceId:re.id,action:{actionId:U.type,label:U.type,input:Le,...U.type==="publish"&&U.confirmation?{invocation:{mode:"execute",token:U.confirmation.confirmationToken}}:{}}});if(typeof xe!=="object"||xe===null)throw Error("Publishing returned an invalid result");let Me="success"in xe&&xe.success===!1?{success:!1,error:"error"in xe&&typeof xe.error==="string"?xe.error:"Publishing failed",..."code"in xe&&typeof xe.code==="string"?{code:xe.code}:{}}:{success:!0};if(!w1(Me)&&!x1(Me)){if(await $1(ut,re.id),L.kind==="edit"&&b===U.entityType&&L.entity.id===U.entityId)zt(U.entityId)}return Me},[b,L,zt,ut,bt,Se]),ni=le.useCallback(async(U)=>{if(!m)throw Error("Declarative workspace is unavailable");try{let re=await bt.mutateAsync({workspaceId:m,action:U});return await $1(ut,m),re}finally{bt.reset()}},[m,bt,ut]),Rh=le.useCallback((U,re,Le)=>{let xe=Se.find((Ve)=>Ve.id===U),Me=xe?.urlQuery===!0?l:void 0;if(xe?.urlQuery===!0&&Le!==void 0){let Ve=Uo(r,U);Me=B1(Le),H1(t.history,Ve,Le,window.location.pathname)}k((Ve)=>({...Ve,[U]:{query:re,...Me!==void 0?{urlSearch:Me}:{}}}))},[r,l,t.history,Se]),_i=rt??(Be.error?ic(Be.error):Ni.error?ic(Ni.error):null),rc=()=>{if(Ge(null),Be.error)Be.refetch();if(Ni.error)Ni.refetch();if(Cl.error)Cl.refetch();if(L.kind==="browse")qo((U)=>U+1)};if(_i&&!X)return wn.jsxDEV(nc,{message:_i,error:!0,onRetry:rc},void 0,!1,void 0,this);if(!X)return wn.jsxDEV(nc,{message:"Loading…"},void 0,!1,void 0,this);if(rn){let U=Uo(r,I1);return wn.jsxDEV(OO,{types:X,workspaces:Se,workspaceId:Ye.id,selectEntityType:kr,selectWorkspace:ms,children:wn.jsxDEV(le.Suspense,{fallback:wn.jsxDEV(Mt,{children:"Opening Account…"},void 0,!1,void 0,this),children:wn.jsxDEV(DH,{bootstrap:_H(U,r)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}if(jo)return wn.jsxDEV(wn.Fragment,{children:[wn.jsxDEV(le.Suspense,{fallback:wn.jsxDEV(nc,{message:"Opening Chat…"},void 0,!1,void 0,this),children:wn.jsxDEV(OH,{apiPath:Ye.chatApiPath,draftStore:be,onNavigationStateChange:Ne,studioBasePath:r,sessionId:RH(l),types:X,workspaces:Se,handoff:NO(s),navigate:(U,re)=>{t.history.push(U,void 0,{ignoreBlocker:re?.preserveWork===!0})},selectEntityType:kr,selectWorkspace:ms},void 0,!1,void 0,this)},void 0,!1,void 0,this),At.status==="blocked"&&wn.jsxDEV(Ki,{mark:"↩",title:"Leave this conversation?",titleId:"chat-navigation-title",cancelLabel:"Stay",confirmLabel:"Leave",onCancel:()=>At.reset(),onConfirm:()=>At.proceed(),children:wn.jsxDEV("p",{children:"Your draft stays in this tab. Leaving stops receiving the response, but does not undo completed actions or background jobs."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(m?!Sa&&!Bi:b&&!_n&&!_i)return wn.jsxDEV(nc,{message:"Loading…"},void 0,!1,void 0,this);if(!m&&(!b||!_n&&!_i))return wn.jsxDEV(nc,{message:_i??"No readable collections are available for this account.",error:Boolean(_i),..._i?{onHome:()=>t.history.push(r)}:{}},void 0,!1,void 0,this);return wn.jsxDEV(RO,{activeWorkspaceId:m,types:X,workspaces:Se,workspaceError:Bi,readError:_i,onRetryRead:rc,declarativeWorkspaceData:ho,workspaceQuery:ro,entityType:b,entities:xr,entityOffset:Lt,entityLimit:It.limit,entityTotal:Vo??0,collectionQuery:It,onCollectionQueryChange:(U)=>{if(!b)return;t.history.push(`${ba(r,b)}${Sr({...U,offset:0})}`),window.scrollTo({top:0,left:0})},entityListLoading:Ni.isPending,schema:_n,editor:E,fieldAssistState:se,bodyMode:te,mobilePane:Jt,syncStatus:Hi,baselineCommit:so,agentTargets:wr,deleting:Tl,hasUnsavedChanges:ne,navigationBlocked:At.status==="blocked",dispatchEditor:R,setFieldAssistState:at,setBodyMode:je,setMobilePane:pe,backToList:ti,selectEntityType:kr,selectWorkspace:ms,changeEntityPage:Cr,openWorkspaceEntity:po,openWorkspaceLaunch:sc,performPublishingAction:Ar,performDeclarativeAction:ni,onWorkspaceQueryChange:Rh,startCreate:mo,openEntity:zt,runFieldAssist:Dh,applyFieldAssist:Wm,save:ac,remove:Oh,onNavigationReset:()=>At.reset?.(),onNavigationProceed:()=>At.proceed?.()},void 0,!1,void 0,this)}function uR(){return new rR({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1},mutations:{retry:!1}}})}var Qm=We(sn(),1),Gm=document.querySelector("[data-studio-root]");if(Gm){let t=Gm.getAttribute("data-studio-base-path")??"/studio",i=new hR({basePath:t});Gm.textContent="";let l=uR(),s=pR(t,aR);mR.createRoot(Gm).render(Qm.jsxDEV(cR,{client:l,children:Qm.jsxDEV(dR,{api:i,children:Qm.jsxDEV(fR,{router:s},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}
245
+ ${s}`:s}}function HO(t,i,l){return{studioChatHandoff:{version:1,sourceId:t,itemId:i,label:l,prompt:"Help me understand this Inbox item and decide what to do next."}}}function NO(t){if(typeof t!=="object"||t===null)return null;let i=Reflect.get(t,"studioChatHandoff");if(typeof i!=="object"||i===null)return null;let l=Reflect.get(i,"version"),s=Reflect.get(i,"sourceId"),r=Reflect.get(i,"itemId"),c=Reflect.get(i,"label"),h=Reflect.get(i,"prompt");if(l!==1||typeof s!=="string"||!/^[a-z][a-z0-9-]*$/.test(s)||s.length>64||typeof r!=="string"||r.trim().length===0||r.length>300||typeof c!=="string"||c.trim().length===0||c.length>160||typeof h!=="string"||h.trim().length===0||h.length>1e4)return null;return{sourceId:s,itemId:r,label:c,prompt:h}}function ic(t){if(t instanceof vr)switch(t.status){case 401:return"Your session is no longer authenticated. Sign in again in another tab, then retry here. Keep this tab open to preserve your draft.";case 403:return"You do not currently have permission to read this content. Ask an administrator to check access, then retry.";case 404:return"This content is unavailable. It may have moved, been removed, or be outside your access. Choose another destination or retry.";case 429:return"Studio is receiving too many requests. Wait briefly before retrying."}return`Studio could not load this data. Check your connection or retry later. ${Ri(t)}`}var _O=new Set(["offset","limit"]);function UO(t,i){if(t?.urlQuery!==!0)return{};let l={};for(let[s,r]of new URLSearchParams(i))if(!_O.has(s))l[s]=r;return l}function B1(t){let i=new URLSearchParams,l=Object.entries(t).filter(([r,c])=>!_O.has(r)&&c!==void 0&&(typeof c!=="number"||Number.isFinite(c))).sort(([r],[c])=>r.localeCompare(c));for(let[r,c]of l)i.set(r,String(c));let s=i.toString();return s?`?${s}`:""}function oc(t,i){return`${t}${B1(i)}`}function H1(t,i,l,s){if(s!==i)return;t.replace(oc(i,l))}function N1(t){let i=yr.safeParse(jO(new URLSearchParams(t))),l=i.success?i.data:yr.parse({});return{...l,offset:Math.floor(l.offset/l.limit)*l.limit}}function Sr(t){let i=new URLSearchParams;if(t.offset>0)i.set("offset",String(t.offset));if(t.limit!==qO)i.set("limit",String(t.limit));if(t.q)i.set("q",t.q);if(t.visibility!=="all")i.set("visibility",t.visibility);if(t.status)i.set("status",t.status);if(t.sort!=="updated-desc")i.set("sort",t.sort);let l=i.toString();return l?`?${l}`:""}var wn=We(sn(),1),DH=le.lazy(async()=>({default:(await import("./studio-chunks/account-view-811dnmr7.js")).AccountApp})),OH=le.lazy(async()=>({default:(await import("./studio-chunks/studio-chat-workspace-hmkhk808.js")).StudioChatWorkspace}));function RH(t){let i=new URLSearchParams(t).get("session")?.trim();return i&&i.length<=256?i:null}function LH(){let t=window.history.state;return x2(t)?t:{}}var zH=[],BH=[],HH={},NH=["public","trusted","admin"];function _H(t,i){let l=document.querySelector("[data-studio-root]"),s=l?.getAttribute("data-studio-principal-name")??"Your account",r=l?.getAttribute("data-studio-principal-role"),c=NH.find((h)=>h===r)??"public";return{displayName:s,role:c,routePath:t,studioPath:i}}function aR(){let t=$O(),i=Xm({select:(U)=>U.location.pathname}),l=Xm({select:(U)=>U.location.searchStr}),s=Xm({select:(U)=>U.location.state}),r=oR(),c=le.useMemo(()=>i===_1?{kind:"workspace",workspaceId:U1}:QO(i,r),[i,r]),h=le.useMemo(()=>c.kind==="collection"&&new URLSearchParams(l).get("mode")==="create",[l,c]),d=i,[m,y]=le.useState(null),[b,S]=le.useState(null),[w,k]=le.useState({}),[E,R]=le.useReducer(T2,jf),{mode:L,draft:_,body:V,save:I}=E,ne=A2(E),[be]=le.useState(()=>new XO),st=le.useSyncExternalStore(be.subscribe,be.hasDrafts,be.hasDrafts),[Nt,Ne]=le.useState({hasDraft:!1,busy:!1}),At=PO({shouldBlockFn:({next:U})=>ne||i===_1&&YO({...Nt,hasDraft:st},U.pathname),enableBeforeUnload:ne||st||Nt.busy,withResolver:!0}),[se,at]=le.useState({kind:"idle"}),[te,je]=le.useState("preview"),[Jt,Q]=le.useState("details"),de=le.useRef(null),pe=le.useCallback((U)=>{de.current=U,Q(U)},[]),[rt,Ge]=le.useState(null),[zi,qo]=le.useState(0),[so,Nn]=le.useState(null),Rt=le.useRef(0),ao=le.useRef(null),an=le.useRef(0),va=le.useRef(b);va.current=b;let ut=IO(),_t=Zu(),Be=ya(KO(_t)),X=Be.data?.types??null,Kn=X?.find((U)=>U.entityType===b),Ke=Kn?.capabilities,It=le.useMemo(()=>Kn?.isSingleton?N1(""):N1(l),[Kn?.isSingleton,l]),Lt=It.offset,Se=Be.data?.workspaces??BH,Ye=Se.find((U)=>U.id===m),rn=Ye?.rendererName===WO,jo=Ye?.rendererName===q1,we=Ye?.rendererName==="DeclarativeOperatorWorkspace",kl=m?w[m]:void 0,ei=Ye?.urlQuery!==!0||kl?.urlSearch===l,un=le.useMemo(()=>UO(Ye,l),[Ye,l]),ro=m?kl&&ei?kl.query:un:HH,Cl=ya({...eR(_t,m??"",ro),enabled:we}),uo=Cl.data??null,Sa=uo?.data??null,Bi=Cl.error?ic(Cl.error):null,co=L.kind==="edit"?L.entity.id:null,wr=ya({...tR(_t,b??"",co??""),enabled:b!==null&&co!==null&&Ke?.canAssist===!0&&Ke.canUpdate}).data??zH,Hi=ya({...nR(_t),enabled:b!==null}).data??null,Ni=ya({...Y1(_t,b??"",It),enabled:b!==null}),xr=b?Ni.data?.entities??null:null,Vo=Ni.data?.total,Al=ya({...P1(_t,b??""),enabled:b!==null}),_n=b?Al.data??null:null;ya({...Mh(_t,b??"",co??""),enabled:b!==null&&co!==null});let fo=Ym({mutationFn:(U)=>ZO(_t,U)}),K=Ym({mutationFn:(U)=>JO(_t,U)}),bt=Ym({mutationFn:(U)=>FO(_t,U)}),Tl=K.isPending,ho=we&&uo?uo.data:null;le.useEffect(()=>{if(!b||!Kn||m||c.kind!=="collection"&&c.kind!=="entity"||c.entityType!==b)return;if(Vo===void 0)return;let U=Math.floor(Math.max(0,Vo-1)/It.limit)*It.limit;if(Lt>U)t.history.replace(`${i}${Sr({...It,offset:U})}`,t.history.location.state)},[Kn,m,Lt,Vo,It,b,i,c,t.history]),le.useEffect(()=>{if(!m||!ho?.refreshAfterMs)return;let U=window.setTimeout(()=>{ut.invalidateQueries({queryKey:xl.workspace(m)})},ho.refreshAfterMs);return()=>window.clearTimeout(U)},[m,ho,ut]),le.useEffect(()=>{if(Ye?.urlQuery!==!0||c.kind!=="workspace"||c.workspaceId!==Ye.id)return;let U=Uo(r,Ye.id);if(oc(U,un)!==`${U}${l}`)H1(t.history,U,un,window.location.pathname)},[Ye,r,un,l,c,t.history]),le.useEffect(()=>{if(!X)return;if(Ge(null),c.kind==="not-found"){an.current+=1,Ge(`Studio route not found: ${c.pathname}`);return}if(c.kind==="workspace"){let xe=Se.find((Me)=>Me.id===c.workspaceId);if(!xe){let Me=lR(r,c.workspaceId,l,Se);if(Me){t.history.replace(Me);return}an.current+=1,Ge(`Workspace unavailable for this account: ${c.workspaceId}`);return}y(xe.id),S(null);return}let U=c.kind==="collection"||c.kind==="entity"?c.entityType:void 0,re=X.find((xe)=>!xe.isSingleton)??X[0];if(c.kind==="home"){let xe=sR(r,X,Se);if(xe!==r){t.history.replace(xe);return}}let Le=U??re?.entityType??null;if(U!==void 0&&!X.some((xe)=>xe.entityType===U)){an.current+=1,Ge(`Collection unavailable for this account: ${U}`);return}y(null),S(Le)},[l,c,t.history,r,X,Se]),le.useEffect(()=>{if(I.kind!=="saved"||!Hi?.git)return;if(qm({save:I,git:Hi.git,baselineCommit:so}).committed==="done")return;if(Date.now()-Rt.current>20000)return;let re=window.setTimeout(()=>{ut.invalidateQueries({queryKey:xl.syncStatus()})},900);return()=>window.clearTimeout(re)},[I,Hi,so,ut]),le.useEffect(()=>{if(!b||c.kind==="workspace"||c.kind==="not-found")return;let U=c.kind==="entity"&&c.entityType===b?c.id:null,re=++an.current;R({type:"collectionChanged"}),Q("details"),at({kind:"idle"});let Le=!0,xe=()=>Le&&re===an.current;return ut.fetchQuery({...P1(_t,b),staleTime:0}).then(async(Me)=>{if(!Le||re!==an.current)return;let Ve=DO(Me,de.current);if(Q(Ve),window.matchMedia("(max-width: 640px)").matches&&Ve!=="details")je(Ve==="write"?"source":"preview");if(h&&U===null){if(X?.find((cn)=>cn.entityType===b)?.capabilities.canCreate!==!0){Ge(`Creating ${b} is not allowed.`);return}let Ol=zO(window.history.state,b,()=>window.history.replaceState(LO(LH()),"",window.location.href)),go=BO(Me.fields,Ol);R({type:"creationStarted",draft:go.draft,body:go.body});return}if(U!==null)return ut.fetchQuery({...Mh(_t,b,U),staleTime:0}).then((Dl)=>{if(!Le||re!==an.current)return;let Ol=tc(Dl),go=ao.current,cn=go?.pathname===d?go.save:{kind:"idle"};if(go?.pathname===d)ao.current=null;R({type:"documentOpened",document:Ol,save:cn})});if(Me.isSingleton){let Dl=await ut.ensureQueryData(Y1(_t,b));if(!xe())return;let Ol=Dl.entities[0];if(Ol)return ut.fetchQuery({...Mh(_t,b,Ol.id),staleTime:0}).then((go)=>{if(!Le||re!==an.current)return;let cn=tc(go);R({type:"documentOpened",document:cn})});R({type:"creationStarted",draft:Eh(Me.fields)})}return}).catch((Me)=>{if(Le&&re===an.current)Ge(ic(Me))}),()=>{Le=!1}},[h,d,b,zi,ut,i,c,X]);let zt=le.useCallback((U,re={kind:"idle"})=>{if(!b)return;let Le=V1(r,b,U);if(Le!==d){ao.current={pathname:Le,save:re},t.history.push(`${Le}${Sr(It)}`,{studioCollectionPath:`${ba(r,b)}${Sr(It)}`},re.kind==="saved"?{ignoreBlocker:!0}:void 0);return}let xe=++an.current,Me=b;ut.fetchQuery({...Mh(_t,b,U),staleTime:0}).then((Ve)=>{if(xe!==an.current||va.current!==Me)return;let Dl=tc(Ve);R({type:"documentOpened",document:Dl,save:re}),at({kind:"idle"})}).catch((Ve)=>{if(xe===an.current)Ge(ic(Ve))})},[r,d,b,It,ut,t.history]),po=le.useCallback((U,re)=>{let Le=V1(r,U,re);ao.current={pathname:Le,save:{kind:"idle"}},t.history.push(Le,{studioCollectionPath:ba(r,U)})},[r,t.history]),El=le.useCallback((U,re,Le,xe)=>{t.history.push(GO(r,"note"),C2(U,`entity://${encodeURIComponent(Le)}/${encodeURIComponent(xe)}`,re))},[r,t.history]),Ml=le.useCallback((U,re,Le)=>{if(Se.some((xe)=>xe.rendererName===q1)){t.history.push(j1(r),HO(U,re,Le));return}},[t.history,r,Se]),sc=le.useCallback((U)=>{switch(U.target){case"account-settings":{t.history.push(Uo(r,I1));return}case"invitations":t.history.push(oc(Uo(r,"admin:administration"),{tab:"invitations"}));return;case"admin-peer-invite":{t.history.push(oc(Uo(r,"admin:administration"),{tab:"invitations",peerId:U.peerId,displayName:U.displayName}));return}case"inbox":{let re={};if("source"in U){if(re.sourceId="mail-items",U.filter==="high-priority")re["facet.mail-priority"]="high";else if(U.filter==="needs-reply")re["facet.needs-reply"]="true";else if(U.filter==="unclassified")re["facet.category"]="unclassified"}t.history.push(oc(Uo(r,"unified-inbox:inbox"),re));return}case"publishing":t.history.push(Uo(r,"content-pipeline:publishing"));return;case"site":t.history.push(Uo(r,"site-builder:site"));return;case"inbox-open-entity":po(U.entityType,U.entityId);return;case"inbox-capture-note":El(U.title,U.summary,U.entityType,U.entityId);return;case"inbox-discuss-in-chat":Ml(U.sourceId,U.itemId,U.label)}},[El,r,Ml,po,l,t.history]),kr=le.useCallback((U)=>{t.history.push(ba(r,U)),window.scrollTo({top:0,left:0})},[r,t.history]),Cr=le.useCallback((U)=>{if(!b)return;t.history.push(`${ba(r,b)}${Sr({...It,offset:U})}`),window.scrollTo({top:0,left:0})},[b,It,r,t.history]),ms=le.useCallback((U)=>{t.history.push(U===U1?j1(r):Uo(r,U)),window.scrollTo({top:0,left:0})},[r,t.history]),mo=le.useCallback(()=>{if(!_n||Ke?.canCreate!==!0)return;R({type:"creationStarted",draft:Eh(_n.fields)}),at({kind:"idle"})},[Ke,_n]),ti=le.useCallback(()=>{if(!b)return;let U=`${ba(r,b)}${Sr(It)}`,re=t.history.location.state;if(typeof re==="object"&&re!==null&&"studioCollectionPath"in re&&re.studioCollectionPath===U&&t.history.canGoBack()){t.history.back();return}t.history.replace(U)},[r,b,It,t.history]),Dh=le.useCallback((U,re)=>{if(!b||L.kind!=="edit"||Ke?.canUpdate!==!0||Ke.canAssist!==!0||V.trim().length===0)return;at({kind:"loading",field:re,variant:U}),_t.requestFieldAssist({variant:U,entityType:b,id:L.entity.id,targetField:re}).then((Le)=>{let xe=Le.variant==="summarise"?Le.suggestion:Le.suggestions;at({kind:"suggested",field:Le.targetField,variant:Le.variant,suggestion:xe})}).catch((Le)=>{at({kind:"error",field:re,message:Ri(Le)})})},[Ke,V,b,L]),Wm=le.useCallback((U,re)=>{R({type:"fieldAssistApplied",field:U,suggestion:re}),at({kind:"idle"})},[]),ac=le.useCallback(()=>{if(!b||L.kind==="browse"||!_n)return;if(L.kind==="create"?Ke?.canCreate!==!0:Ke?.canUpdate!==!0)return;Rt.current=Date.now(),Nn(Hi?.git?.lastCommit??null),R({type:"saveStarted"});let U=_n.hasBody?{body:V}:{},re=iR(_n.fields,_),Le=L.kind==="create"?{kind:"create",entityType:b,frontmatter:re,...U}:{kind:"update",entityType:b,id:L.entity.id,frontmatter:re,baseContentHash:L.entity.contentHash,...U},xe=an.current;fo.mutate(Le,{onSuccess:async(Me)=>{if(await Promise.all([ut.invalidateQueries({queryKey:xl.entities(b)}),ut.invalidateQueries({queryKey:xl.syncStatus()}),...L.kind==="create"?[ut.invalidateQueries({queryKey:xl.navigation()})]:[]]),xe!==an.current)return;let Ve="skipped"in Me&&Me.skipped===!0;zt(Me.entityId,{kind:"saved",noop:Ve})},onError:(Me)=>{if(xe!==an.current)return;if(Me instanceof vr&&Me.issues.length>0)Q("details");R({type:"saveFailed",save:Me instanceof vr&&Me.status===409?{kind:"conflict",message:Ri(Me)}:{kind:"error",message:Me instanceof vr&&Me.issues.length>0?Me.message||"Validation failed":Ri(Me),...Me instanceof vr?{issues:Me.issues}:{}}})}})},[Ke,b,L,_,V,_n,zt,Hi,ut,fo]),Oh=le.useCallback(()=>{if(!b||L.kind!=="edit"||Tl||Ke?.canDelete!==!0)return;let{id:U}=L.entity;K.mutate({entityType:b,id:U},{onSuccess:async()=>{R({type:"deleteSucceeded"}),ut.removeQueries({queryKey:xl.entity(b,U)}),await Promise.all([ut.invalidateQueries({queryKey:xl.entities(b)}),ut.invalidateQueries({queryKey:xl.syncStatus()}),ut.invalidateQueries({queryKey:xl.navigation()})]),t.history.replace(ba(r,b),void 0,{ignoreBlocker:!0})},onError:(re)=>{R({type:"deleteFailed",message:Ri(re)})}})},[Ke,r,b,L,Tl,ut,K,t.history]),Ar=le.useCallback(async(U)=>{let re=Se.find((Ve)=>Ve.pluginId==="content-pipeline"&&Ve.entityTypes.includes(U.entityType));if(!re)throw Error("Publishing is unavailable");let Le={entityType:U.entityType,entityId:U.entityId,...U.type==="reorder"?{position:U.position}:{}};if(U.type==="publish"&&!U.confirmation){let Ve=await bt.mutateAsync({workspaceId:re.id,action:{actionId:"publish",label:"Publish now",input:Le,invocation:{mode:"prepare"}}});if(typeof Ve!=="object"||Ve===null||!("kind"in Ve)||Ve.kind!=="prepared-confirmation"||!("token"in Ve)||typeof Ve.token!=="string"||!("summary"in Ve)||typeof Ve.summary!=="string"||!("expiresAt"in Ve)||typeof Ve.expiresAt!=="string")throw Error("Publishing confirmation is unavailable");return{needsConfirmation:!0,summary:Ve.summary,args:{confirmed:!0,confirmationToken:Ve.token,contentHash:Ve.token,expiresAt:Ve.expiresAt}}}let xe=await bt.mutateAsync({workspaceId:re.id,action:{actionId:U.type,label:U.type,input:Le,...U.type==="publish"&&U.confirmation?{invocation:{mode:"execute",token:U.confirmation.confirmationToken}}:{}}});if(typeof xe!=="object"||xe===null)throw Error("Publishing returned an invalid result");let Me="success"in xe&&xe.success===!1?{success:!1,error:"error"in xe&&typeof xe.error==="string"?xe.error:"Publishing failed",..."code"in xe&&typeof xe.code==="string"?{code:xe.code}:{}}:{success:!0};if(!w1(Me)&&!x1(Me)){if(await $1(ut,re.id),L.kind==="edit"&&b===U.entityType&&L.entity.id===U.entityId)zt(U.entityId)}return Me},[b,L,zt,ut,bt,Se]),ni=le.useCallback(async(U)=>{if(!m)throw Error("Declarative workspace is unavailable");try{let re=await bt.mutateAsync({workspaceId:m,action:U});return await $1(ut,m),re}finally{bt.reset()}},[m,bt,ut]),Rh=le.useCallback((U,re,Le)=>{let xe=Se.find((Ve)=>Ve.id===U),Me=xe?.urlQuery===!0?l:void 0;if(xe?.urlQuery===!0&&Le!==void 0){let Ve=Uo(r,U);Me=B1(Le),H1(t.history,Ve,Le,window.location.pathname)}k((Ve)=>({...Ve,[U]:{query:re,...Me!==void 0?{urlSearch:Me}:{}}}))},[r,l,t.history,Se]),_i=rt??(Be.error?ic(Be.error):Ni.error?ic(Ni.error):null),rc=()=>{if(Ge(null),Be.error)Be.refetch();if(Ni.error)Ni.refetch();if(Cl.error)Cl.refetch();if(L.kind==="browse")qo((U)=>U+1)};if(_i&&!X)return wn.jsxDEV(nc,{message:_i,error:!0,onRetry:rc},void 0,!1,void 0,this);if(!X)return wn.jsxDEV(nc,{message:"Loading…"},void 0,!1,void 0,this);if(rn){let U=Uo(r,I1);return wn.jsxDEV(OO,{types:X,workspaces:Se,workspaceId:Ye.id,selectEntityType:kr,selectWorkspace:ms,children:wn.jsxDEV(le.Suspense,{fallback:wn.jsxDEV(Mt,{children:"Opening Account…"},void 0,!1,void 0,this),children:wn.jsxDEV(DH,{bootstrap:_H(U,r)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}if(jo)return wn.jsxDEV(wn.Fragment,{children:[wn.jsxDEV(le.Suspense,{fallback:wn.jsxDEV(nc,{message:"Opening Chat…"},void 0,!1,void 0,this),children:wn.jsxDEV(OH,{apiPath:Ye.chatApiPath,draftStore:be,onNavigationStateChange:Ne,studioBasePath:r,sessionId:RH(l),types:X,workspaces:Se,handoff:NO(s),navigate:(U,re)=>{t.history.push(U,void 0,{ignoreBlocker:re?.preserveWork===!0})},selectEntityType:kr,selectWorkspace:ms},void 0,!1,void 0,this)},void 0,!1,void 0,this),At.status==="blocked"&&wn.jsxDEV(Ki,{mark:"↩",title:"Leave this conversation?",titleId:"chat-navigation-title",cancelLabel:"Stay",confirmLabel:"Leave",onCancel:()=>At.reset(),onConfirm:()=>At.proceed(),children:wn.jsxDEV("p",{children:"Your draft stays in this tab. Leaving stops receiving the response, but does not undo completed actions or background jobs."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(m?!Sa&&!Bi:b&&!_n&&!_i)return wn.jsxDEV(nc,{message:"Loading…"},void 0,!1,void 0,this);if(!m&&(!b||!_n&&!_i))return wn.jsxDEV(nc,{message:_i??"No readable collections are available for this account.",error:Boolean(_i),..._i?{onHome:()=>t.history.push(r)}:{}},void 0,!1,void 0,this);return wn.jsxDEV(RO,{activeWorkspaceId:m,types:X,workspaces:Se,workspaceError:Bi,readError:_i,onRetryRead:rc,declarativeWorkspaceData:ho,workspaceQuery:ro,entityType:b,entities:xr,entityOffset:Lt,entityLimit:It.limit,entityTotal:Vo??0,collectionQuery:It,onCollectionQueryChange:(U)=>{if(!b)return;t.history.push(`${ba(r,b)}${Sr({...U,offset:0})}`),window.scrollTo({top:0,left:0})},entityListLoading:Ni.isPending,schema:_n,editor:E,fieldAssistState:se,bodyMode:te,mobilePane:Jt,syncStatus:Hi,baselineCommit:so,agentTargets:wr,deleting:Tl,hasUnsavedChanges:ne,navigationBlocked:At.status==="blocked",dispatchEditor:R,setFieldAssistState:at,setBodyMode:je,setMobilePane:pe,backToList:ti,selectEntityType:kr,selectWorkspace:ms,changeEntityPage:Cr,openWorkspaceEntity:po,openWorkspaceLaunch:sc,performPublishingAction:Ar,performDeclarativeAction:ni,onWorkspaceQueryChange:Rh,startCreate:mo,openEntity:zt,runFieldAssist:Dh,applyFieldAssist:Wm,save:ac,remove:Oh,onNavigationReset:()=>At.reset?.(),onNavigationProceed:()=>At.proceed?.()},void 0,!1,void 0,this)}function uR(){return new rR({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1},mutations:{retry:!1}}})}var Qm=We(sn(),1),Gm=document.querySelector("[data-studio-root]");if(Gm){let t=Gm.getAttribute("data-studio-base-path")??"/studio",i=new hR({basePath:t});Gm.textContent="";let l=uR(),s=pR(t,aR);mR.createRoot(Gm).render(Qm.jsxDEV(cR,{client:l,children:Qm.jsxDEV(dR,{api:i,children:Qm.jsxDEV(fR,{router:s},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}
246
246
 
247
- //# debugId=37C0D182364C1B9064756E2164756E21
247
+ //# debugId=E21406C69006106164756E2164756E21