@marimo-team/islands 0.25.3-dev308 → 0.25.3-dev310

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 (106) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DJnSxHJB.js → ConnectedDataExplorerComponent-DieU6L4x.js} +1 -1
  2. package/dist/{ErrorBoundary-flfhLFje.js → ErrorBoundary-DjoeT4kv.js} +1 -1
  3. package/dist/{abnfDiagram-VCTEODGH-CR0U5hup.js → abnfDiagram-VCTEODGH-LOVrjbdp.js} +2 -2
  4. package/dist/{any-language-editor-C5dsTpeB.js → any-language-editor-DMC2JE9_.js} +1 -1
  5. package/dist/{architectureDiagram-5GKGNRK7-Bc_fbI1Q.js → architectureDiagram-5GKGNRK7-RZsm312h.js} +1 -1
  6. package/dist/assets/__vite-browser-external-BSp9tJ_k.js +1 -0
  7. package/dist/assets/worker-BdfPA0g5.js +171 -0
  8. package/dist/{chat-ui-C4iLRzY0.js → chat-ui-DkuxGEDp.js} +418 -418
  9. package/dist/{chunk-IMKFNOWR-y9z5oeAY.js → chunk-IMKFNOWR-B6agbLjo.js} +1 -1
  10. package/dist/{chunk-SHT3W25Y-Tu-V-e_v.js → chunk-SHT3W25Y-CfULafYG.js} +1 -1
  11. package/dist/{chunk-SVP7TREG-CJFxs5R_.js → chunk-SVP7TREG-DEOpPMJp.js} +1 -1
  12. package/dist/{chunk-TICWLB2K-zkTP7ya7.js → chunk-TICWLB2K-DaH-gkX5.js} +1 -1
  13. package/dist/{classDiagram-ZZMXUADV-DxJAZI0N.js → classDiagram-ZZMXUADV-C0CyiWQ7.js} +2 -2
  14. package/dist/{classDiagram-v2-VYDZK3BY-TmHo2BpS.js → classDiagram-v2-VYDZK3BY-xfIc9e2Y.js} +2 -2
  15. package/dist/{code-visibility-BDs_r7jH.js → code-visibility-CduMVVFS.js} +32 -32
  16. package/dist/{common-CMTsL35V.js → common-CMcEcucH.js} +919 -919
  17. package/dist/{config-BG2qKzDg.js → config-BVYA1P0C.js} +103 -76
  18. package/dist/{cynefinDiagram-5FMLGOSQ-Eb40hmhD.js → cynefinDiagram-5FMLGOSQ-DwGYhKu0.js} +1 -1
  19. package/dist/{dagre-GXQ25YYZ-_paaVwit.js → dagre-GXQ25YYZ-DfMaWJOV.js} +1 -1
  20. package/dist/{data-grid-overlay-editor-es6V6qf-.js → data-grid-overlay-editor-BYrIVut3.js} +1 -1
  21. package/dist/{diagram-S7CK7UJ4-BtKJm1_4.js → diagram-S7CK7UJ4-Bw_L87GZ.js} +1 -1
  22. package/dist/{diagram-UQ7AKVKN-DQbxhEMd.js → diagram-UQ7AKVKN-nsrs3Fbz.js} +1 -1
  23. package/dist/{diagram-VX7I27RA-DITDIfGC.js → diagram-VX7I27RA-7ST9lEqP.js} +1 -1
  24. package/dist/{diagram-Z3DM3KII-Ct9_zo6F.js → diagram-Z3DM3KII-BnGte-HX.js} +1 -1
  25. package/dist/{ebnfDiagram-PWID7BFC-6cOntwfv.js → ebnfDiagram-PWID7BFC-zaKyJ1YL.js} +2 -2
  26. package/dist/{erDiagram-RLTQ6QDP-CJiOER41.js → erDiagram-RLTQ6QDP-Cx7g95FZ.js} +1 -1
  27. package/dist/{error-banner-DGOrmBk5.js → error-banner-DkQNU4bn.js} +128 -128
  28. package/dist/{error-entries-BWmleiL0.js → error-entries-istW7Xbs.js} +589 -544
  29. package/dist/{feedback-button-D4eVjeNs.js → feedback-button-Zvm26aOQ.js} +107 -106
  30. package/dist/{flowDiagram-HODETNUW-1lPBEUuW.js → flowDiagram-HODETNUW-C7nIqaHP.js} +2 -2
  31. package/dist/{formats-qhBmYb0l.js → formats-CMa7L3E8.js} +1 -1
  32. package/dist/{glide-data-editor-ahfaPdFW.js → glide-data-editor-BE-GgVp4.js} +3 -3
  33. package/dist/{globals-m8oswz--.js → globals-Dbru-WLP.js} +1 -1
  34. package/dist/{html-to-image-B8hE6HIH.js → html-to-image-pPbR2cDx.js} +4512 -4464
  35. package/dist/{infoDiagram-27XIBGKW-C6K4tri5.js → infoDiagram-27XIBGKW-BTM_NXsn.js} +1 -1
  36. package/dist/{ishikawaDiagram-5VMMS53U-DwcwgRNH.js → ishikawaDiagram-5VMMS53U-K0FZrlvv.js} +1 -1
  37. package/dist/{kanban-definition-UXKFOSKX-E489OMdc.js → kanban-definition-UXKFOSKX-ftznOyrz.js} +1 -1
  38. package/dist/main.js +6595 -6186
  39. package/dist/{mermaid-DMPMkVqY.js → mermaid-CNgH43ED.js} +33 -33
  40. package/dist/{mindmap-definition-YA3MSWOX-DWHjasOp.js → mindmap-definition-YA3MSWOX-CmzbxKfM.js} +1 -1
  41. package/dist/{number-overlay-editor-C6klKzEr.js → number-overlay-editor-qvlPZ-l-.js} +1 -1
  42. package/dist/{pegDiagram-XKGWAZYB-COjcPOZT.js → pegDiagram-XKGWAZYB-DfTAWfGE.js} +2 -2
  43. package/dist/{pieDiagram-E7YTZNPT-BHAVZ38h.js → pieDiagram-E7YTZNPT-_kGQstZj.js} +1 -1
  44. package/dist/{process-output-DZDL_j1a.js → process-output-BySO1nIs.js} +3 -3
  45. package/dist/{railroadDiagram-O6MQD6OU-94ThFyKX.js → railroadDiagram-O6MQD6OU-D41WmIff.js} +2 -2
  46. package/dist/{requirementDiagram-BXWQKSXE-CpF-Fxbb.js → requirementDiagram-BXWQKSXE-Bh53ZI3I.js} +1 -1
  47. package/dist/{reveal-component-DwnxPyVz.js → reveal-component-DQaegdcW.js} +4 -4
  48. package/dist/{sequenceDiagram-WJ2MYXX4-CvANK2x7.js → sequenceDiagram-WJ2MYXX4-DBX27dNm.js} +1 -1
  49. package/dist/{stateDiagram-D77RDMKH-WHuJ4mJL.js → stateDiagram-D77RDMKH-CSYz2IZi.js} +2 -2
  50. package/dist/{stateDiagram-v2-MP3YSRHH-DbO7lwYq.js → stateDiagram-v2-MP3YSRHH-DVLvtOqn.js} +2 -2
  51. package/dist/{swimlanes-42K2YHIH-CS2s29Vo.js → swimlanes-42K2YHIH-D59N0ktA.js} +1 -1
  52. package/dist/{swimlanesDiagram-VR7AAH4N-CXaA1vQg.js → swimlanesDiagram-VR7AAH4N-CRgpmVSW.js} +2 -2
  53. package/dist/{timeline-definition-24CTP7MA-B-SQMg5h.js → timeline-definition-24CTP7MA-C_xIIZDM.js} +1 -1
  54. package/dist/toDate-5qPtZ6HL.js +94 -0
  55. package/dist/{vega-component-DwqGfN3_.js → vega-component-Bly2lDhz.js} +10 -10
  56. package/dist/{vennDiagram-4TSXK5OY-etEFgvaG.js → vennDiagram-4TSXK5OY-DlOf0Mjs.js} +1 -1
  57. package/dist/{wardleyDiagram-VM6X3IG4-BEQN7g62.js → wardleyDiagram-VM6X3IG4-zD_2guVe.js} +1 -1
  58. package/dist/{xychartDiagram-S5SC5T6Z-D8-e5Z0R.js → xychartDiagram-S5SC5T6Z-CA0Dy1ZM.js} +1 -1
  59. package/package.json +1 -1
  60. package/src/__mocks__/executions.ts +35 -13
  61. package/src/__mocks__/requests.ts +0 -1
  62. package/src/components/editor/cell/__tests__/useRunCells.test.tsx +86 -101
  63. package/src/components/editor/cell/useRunCells.ts +38 -65
  64. package/src/components/editor/notebook-cell.tsx +32 -20
  65. package/src/components/editor/output/ansi-reduce.ts +7 -0
  66. package/src/core/ai/__tests__/staged-cells.test.ts +1 -1
  67. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +2 -0
  68. package/src/core/cells/__tests__/cells.test.ts +0 -14
  69. package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +15 -0
  70. package/src/core/cells/__tests__/utils.test.ts +1 -1
  71. package/src/core/cells/add-missing-import.ts +2 -5
  72. package/src/core/cells/cell.ts +1 -0
  73. package/src/core/cells/cells.ts +1 -2
  74. package/src/core/executions/__tests__/atoms.test.ts +227 -43
  75. package/src/core/executions/__tests__/hooks.test.tsx +1 -2
  76. package/src/core/executions/__tests__/input.test.ts +86 -0
  77. package/src/core/executions/__tests__/run.test.ts +390 -0
  78. package/src/core/executions/__tests__/select.test.ts +105 -30
  79. package/src/core/executions/atoms.ts +186 -71
  80. package/src/core/executions/index.ts +7 -6
  81. package/src/core/executions/input.ts +55 -0
  82. package/src/core/executions/run.ts +120 -0
  83. package/src/core/executions/select.ts +59 -24
  84. package/src/core/islands/__tests__/bridge.test.ts +35 -54
  85. package/src/core/islands/bootstrap.ts +5 -1
  86. package/src/core/islands/bridge.ts +16 -28
  87. package/src/core/islands/components/IslandControls.tsx +15 -7
  88. package/src/core/islands/components/__tests__/IslandControls.test.tsx +36 -53
  89. package/src/core/islands/worker/worker.tsx +45 -19
  90. package/src/core/network/__tests__/requests-lazy.test.ts +14 -24
  91. package/src/core/network/__tests__/requests-toasting.test.tsx +7 -7
  92. package/src/core/network/requests-lazy.ts +2 -3
  93. package/src/core/network/requests-network.ts +0 -9
  94. package/src/core/network/requests-static.ts +0 -1
  95. package/src/core/network/requests-toasting.tsx +0 -1
  96. package/src/core/network/types.ts +0 -2
  97. package/src/core/notebook/replica/__tests__/fixtures.ts +17 -1
  98. package/src/core/notebook/replica/backend.ts +3 -1
  99. package/src/core/runtime/__tests__/runtime.test.ts +36 -0
  100. package/src/core/runtime/config.ts +36 -1
  101. package/src/core/runtime/runtime.ts +21 -1
  102. package/src/core/transports/static.ts +4 -3
  103. package/src/core/wasm/bridge.ts +0 -17
  104. package/dist/assets/__vite-browser-external-DzTYIHH_.js +0 -1
  105. package/dist/assets/worker-BH08I2Il.js +0 -171
  106. package/dist/static-state-Dtocd9UO.js +0 -68
@@ -3,9 +3,10 @@ import { g as t } from "./button-BuSV-mLI.js";
3
3
  import { t as n } from "./compiler-runtime-DNezxW8I.js";
4
4
  import { h as r } from "./tooltip-BekOCQ3v.js";
5
5
  import { Rt as i, d as a, m as o, yt as s } from "./use-restore-focus-DyrKLdSB.js";
6
+ import { h as c } from "./error-banner-DkQNU4bn.js";
6
7
  import "./useEvent-xDnF2X04.js";
7
- import { i as c, m as l, n as u } from "./static-state-Dtocd9UO.js";
8
- var d = r("circle-question-mark", [
8
+ import { _ as l, a as u, c as d, f, s as p, v as m } from "./toDate-5qPtZ6HL.js";
9
+ var h = r("circle-question-mark", [
9
10
  ["circle", {
10
11
  cx: "12",
11
12
  cy: "12",
@@ -22,7 +23,12 @@ var d = r("circle-question-mark", [
22
23
  }]
23
24
  ]);
24
25
  n();
25
- var f = class {
26
+ function g(e) {
27
+ return e === m.NOT_STARTED;
28
+ }
29
+ //#endregion
30
+ //#region src/utils/Deferred.ts
31
+ var _ = class {
26
32
  promise;
27
33
  resolve;
28
34
  reject;
@@ -33,17 +39,17 @@ var f = class {
33
39
  this.reject = (e) => {
34
40
  this.status = "rejected", t(e);
35
41
  }, this.resolve = (t) => {
36
- this.status = "resolved", p(t) || (this.value = t), e(t);
42
+ this.status = "resolved", v(t) || (this.value = t), e(t);
37
43
  };
38
44
  });
39
45
  }
40
46
  };
41
- function p(e) {
47
+ function v(e) {
42
48
  return typeof e == "object" && !!e && "then" in e && typeof e.then == "function";
43
49
  }
44
50
  //#endregion
45
51
  //#region ../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_u64.js
46
- var m = /* @__PURE__ */ e(((e) => {
52
+ var y = /* @__PURE__ */ e(((e) => {
47
53
  Object.defineProperty(e, "__esModule", { value: !0 }), e.toBig = e.shrSL = e.shrSH = e.rotrSL = e.rotrSH = e.rotrBL = e.rotrBH = e.rotr32L = e.rotr32H = e.rotlSL = e.rotlSH = e.rotlBL = e.rotlBH = e.add5L = e.add5H = e.add4L = e.add4H = e.add3L = e.add3H = void 0, e.add = v, e.fromBig = r, e.split = i;
48
54
  var t = /* @__PURE__ */ BigInt(2 ** 32 - 1), n = /* @__PURE__ */ BigInt(32);
49
55
  function r(e, r = !1) {
@@ -131,11 +137,11 @@ var m = /* @__PURE__ */ e(((e) => {
131
137
  add5H: w,
132
138
  add5L: C
133
139
  };
134
- })), h = /* @__PURE__ */ e(((e) => {
140
+ })), b = /* @__PURE__ */ e(((e) => {
135
141
  Object.defineProperty(e, "__esModule", { value: !0 }), e.crypto = void 0, e.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
136
- })), g = /* @__PURE__ */ e(((e) => {
137
- Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = n, e.anumber = r, e.abytes = i, e.ahash = a, e.aexists = o, e.aoutput = s, e.u8 = c, e.u32 = l, e.clean = u, e.createView = d, e.rotr = f, e.rotl = p, e.byteSwap = m, e.byteSwap32 = g, e.bytesToHex = y, e.hexToBytes = S, e.asyncLoop = C, e.utf8ToBytes = w, e.bytesToUtf8 = T, e.toBytes = E, e.kdfInputToBytes = D, e.concatBytes = O, e.checkOpts = k, e.createHasher = A, e.createOptHasher = j, e.createXOFer = M, e.randomBytes = N;
138
- var t = h();
142
+ })), x = /* @__PURE__ */ e(((e) => {
143
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = n, e.anumber = r, e.abytes = i, e.ahash = a, e.aexists = o, e.aoutput = s, e.u8 = c, e.u32 = l, e.clean = u, e.createView = d, e.rotr = f, e.rotl = p, e.byteSwap = m, e.byteSwap32 = h, e.bytesToHex = v, e.hexToBytes = S, e.asyncLoop = C, e.utf8ToBytes = w, e.bytesToUtf8 = T, e.toBytes = E, e.kdfInputToBytes = D, e.concatBytes = O, e.checkOpts = k, e.createHasher = A, e.createOptHasher = j, e.createXOFer = M, e.randomBytes = N;
144
+ var t = b();
139
145
  function n(e) {
140
146
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
141
147
  }
@@ -182,19 +188,19 @@ var m = /* @__PURE__ */ e(((e) => {
182
188
  return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
183
189
  }
184
190
  e.swap8IfBE = e.isLE ? (e) => e : (e) => m(e), e.byteSwapIfBE = e.swap8IfBE;
185
- function g(e) {
191
+ function h(e) {
186
192
  for (let t = 0; t < e.length; t++) e[t] = m(e[t]);
187
193
  return e;
188
194
  }
189
- e.swap32IfBE = e.isLE ? (e) => e : g;
190
- var _ = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", v = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
191
- function y(e) {
192
- if (i(e), _) return e.toHex();
195
+ e.swap32IfBE = e.isLE ? (e) => e : h;
196
+ var g = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", _ = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
197
+ function v(e) {
198
+ if (i(e), g) return e.toHex();
193
199
  let t = "";
194
- for (let n = 0; n < e.length; n++) t += v[e[n]];
200
+ for (let n = 0; n < e.length; n++) t += _[e[n]];
195
201
  return t;
196
202
  }
197
- var b = {
203
+ var y = {
198
204
  _0: 48,
199
205
  _9: 57,
200
206
  A: 65,
@@ -203,13 +209,13 @@ var m = /* @__PURE__ */ e(((e) => {
203
209
  f: 102
204
210
  };
205
211
  function x(e) {
206
- if (e >= b._0 && e <= b._9) return e - b._0;
207
- if (e >= b.A && e <= b.F) return e - (b.A - 10);
208
- if (e >= b.a && e <= b.f) return e - (b.a - 10);
212
+ if (e >= y._0 && e <= y._9) return e - y._0;
213
+ if (e >= y.A && e <= y.F) return e - (y.A - 10);
214
+ if (e >= y.a && e <= y.f) return e - (y.a - 10);
209
215
  }
210
216
  function S(e) {
211
217
  if (typeof e != "string") throw Error("hex string expected, got " + typeof e);
212
- if (_) return Uint8Array.fromHex(e);
218
+ if (g) return Uint8Array.fromHex(e);
213
219
  let t = e.length, n = t / 2;
214
220
  if (t % 2) throw Error("hex string expected, got unpadded hex of length " + t);
215
221
  let r = new Uint8Array(n);
@@ -281,38 +287,38 @@ var m = /* @__PURE__ */ e(((e) => {
281
287
  if (t.crypto && typeof t.crypto.randomBytes == "function") return Uint8Array.from(t.crypto.randomBytes(e));
282
288
  throw Error("crypto.getRandomValues must be defined");
283
289
  }
284
- })), _ = /* @__PURE__ */ e(((e) => {
285
- Object.defineProperty(e, "__esModule", { value: !0 }), e.shake256 = e.shake128 = e.keccak_512 = e.keccak_384 = e.keccak_256 = e.keccak_224 = e.sha3_512 = e.sha3_384 = e.sha3_256 = e.sha3_224 = e.Keccak = void 0, e.keccakP = y;
286
- var t = m(), n = g(), r = BigInt(0), i = BigInt(1), a = BigInt(2), o = BigInt(7), s = BigInt(256), c = BigInt(113), l = [], u = [], d = [];
290
+ })), S = /* @__PURE__ */ e(((e) => {
291
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.shake256 = e.shake128 = e.keccak_512 = e.keccak_384 = e.keccak_256 = e.keccak_224 = e.sha3_512 = e.sha3_384 = e.sha3_256 = e.sha3_224 = e.Keccak = void 0, e.keccakP = _;
292
+ var t = y(), n = x(), r = BigInt(0), i = BigInt(1), a = BigInt(2), o = BigInt(7), s = BigInt(256), c = BigInt(113), l = [], u = [], d = [];
287
293
  for (let e = 0, t = i, n = 1, f = 0; e < 24; e++) {
288
294
  [n, f] = [f, (2 * n + 3 * f) % 5], l.push(2 * (5 * f + n)), u.push((e + 1) * (e + 2) / 2 % 64);
289
295
  let p = r;
290
296
  for (let e = 0; e < 7; e++) t = (t << i ^ (t >> o) * c) % s, t & a && (p ^= i << (i << /* @__PURE__ */ BigInt(e)) - i);
291
297
  d.push(p);
292
298
  }
293
- var f = (0, t.split)(d, !0), p = f[0], h = f[1], _ = (e, n, r) => r > 32 ? (0, t.rotlBH)(e, n, r) : (0, t.rotlSH)(e, n, r), v = (e, n, r) => r > 32 ? (0, t.rotlBL)(e, n, r) : (0, t.rotlSL)(e, n, r);
294
- function y(e, t = 24) {
299
+ var f = (0, t.split)(d, !0), p = f[0], m = f[1], h = (e, n, r) => r > 32 ? (0, t.rotlBH)(e, n, r) : (0, t.rotlSH)(e, n, r), g = (e, n, r) => r > 32 ? (0, t.rotlBL)(e, n, r) : (0, t.rotlSL)(e, n, r);
300
+ function _(e, t = 24) {
295
301
  let r = /* @__PURE__ */ new Uint32Array(10);
296
302
  for (let n = 24 - t; n < 24; n++) {
297
303
  for (let t = 0; t < 10; t++) r[t] = e[t] ^ e[t + 10] ^ e[t + 20] ^ e[t + 30] ^ e[t + 40];
298
304
  for (let t = 0; t < 10; t += 2) {
299
- let n = (t + 8) % 10, i = (t + 2) % 10, a = r[i], o = r[i + 1], s = _(a, o, 1) ^ r[n], c = v(a, o, 1) ^ r[n + 1];
305
+ let n = (t + 8) % 10, i = (t + 2) % 10, a = r[i], o = r[i + 1], s = h(a, o, 1) ^ r[n], c = g(a, o, 1) ^ r[n + 1];
300
306
  for (let n = 0; n < 50; n += 10) e[t + n] ^= s, e[t + n + 1] ^= c;
301
307
  }
302
308
  let t = e[2], i = e[3];
303
309
  for (let n = 0; n < 24; n++) {
304
- let r = u[n], a = _(t, i, r), o = v(t, i, r), s = l[n];
310
+ let r = u[n], a = h(t, i, r), o = g(t, i, r), s = l[n];
305
311
  t = e[s], i = e[s + 1], e[s] = a, e[s + 1] = o;
306
312
  }
307
313
  for (let t = 0; t < 50; t += 10) {
308
314
  for (let n = 0; n < 10; n++) r[n] = e[t + n];
309
315
  for (let n = 0; n < 10; n++) e[t + n] ^= ~r[(n + 2) % 10] & r[(n + 4) % 10];
310
316
  }
311
- e[0] ^= p[n], e[1] ^= h[n];
317
+ e[0] ^= p[n], e[1] ^= m[n];
312
318
  }
313
319
  (0, n.clean)(r);
314
320
  }
315
- var b = class e extends n.Hash {
321
+ var v = class e extends n.Hash {
316
322
  constructor(e, t, r, i = !1, a = 24) {
317
323
  if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = t, this.outputLen = r, this.enableXOF = i, this.rounds = a, (0, n.anumber)(r), !(0 < e && e < 200)) throw Error("only keccak-f1600 function is supported");
318
324
  this.state = /* @__PURE__ */ new Uint8Array(200), this.state32 = (0, n.u32)(this.state);
@@ -321,7 +327,7 @@ var m = /* @__PURE__ */ e(((e) => {
321
327
  return this._cloneInto();
322
328
  }
323
329
  keccak() {
324
- (0, n.swap32IfBE)(this.state32), y(this.state32, this.rounds), (0, n.swap32IfBE)(this.state32), this.posOut = 0, this.pos = 0;
330
+ (0, n.swap32IfBE)(this.state32), _(this.state32, this.rounds), (0, n.swap32IfBE)(this.state32), this.posOut = 0, this.pos = 0;
325
331
  }
326
332
  update(e) {
327
333
  (0, n.aexists)(this), e = (0, n.toBytes)(e), (0, n.abytes)(e);
@@ -371,13 +377,13 @@ var m = /* @__PURE__ */ e(((e) => {
371
377
  return t ||= new e(n, r, i, o, a), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = a, t.suffix = r, t.outputLen = i, t.enableXOF = o, t.destroyed = this.destroyed, t;
372
378
  }
373
379
  };
374
- e.Keccak = b;
375
- var x = (e, t, r) => (0, n.createHasher)(() => new b(t, e, r));
376
- e.sha3_224 = x(6, 144, 28), e.sha3_256 = x(6, 136, 32), e.sha3_384 = x(6, 104, 48), e.sha3_512 = x(6, 72, 64), e.keccak_224 = x(1, 144, 28), e.keccak_256 = x(1, 136, 32), e.keccak_384 = x(1, 104, 48), e.keccak_512 = x(1, 72, 64);
377
- var S = (e, t, r) => (0, n.createXOFer)((n = {}) => new b(t, e, n.dkLen === void 0 ? r : n.dkLen, !0));
380
+ e.Keccak = v;
381
+ var b = (e, t, r) => (0, n.createHasher)(() => new v(t, e, r));
382
+ e.sha3_224 = b(6, 144, 28), e.sha3_256 = b(6, 136, 32), e.sha3_384 = b(6, 104, 48), e.sha3_512 = b(6, 72, 64), e.keccak_224 = b(1, 144, 28), e.keccak_256 = b(1, 136, 32), e.keccak_384 = b(1, 104, 48), e.keccak_512 = b(1, 72, 64);
383
+ var S = (e, t, r) => (0, n.createXOFer)((n = {}) => new v(t, e, n.dkLen === void 0 ? r : n.dkLen, !0));
378
384
  e.shake128 = S(31, 168, 16), e.shake256 = S(31, 136, 32);
379
- })), v = /* @__PURE__ */ e(((e, t) => {
380
- var { sha3_512: n } = _(), r = 24, i = 32, a = (e = 4, t = Math.random) => {
385
+ })), C = /* @__PURE__ */ e(((e, t) => {
386
+ var { sha3_512: n } = S(), r = 24, i = 32, a = (e = 4, t = Math.random) => {
381
387
  let n = "";
382
388
  for (; n.length < e;) n += Math.floor(t() * 36).toString(36);
383
389
  return n;
@@ -407,19 +413,19 @@ var m = /* @__PURE__ */ e(((e) => {
407
413
  defaultLength: r,
408
414
  bigLength: i
409
415
  }), t.exports.init = p, t.exports.createId = m, t.exports.bufToBigInt = o, t.exports.createCounter = d, t.exports.createFingerprint = u, t.exports.isCuid = h;
410
- })), y = /* @__PURE__ */ e(((e, t) => {
411
- var { createId: n, init: r, getConstants: i, isCuid: a } = v();
416
+ })), w = /* @__PURE__ */ e(((e, t) => {
417
+ var { createId: n, init: r, getConstants: i, isCuid: a } = C();
412
418
  t.exports.createId = n, t.exports.init = r, t.exports.getConstants = i, t.exports.isCuid = a;
413
- })), b = y();
414
- function x(e) {
419
+ })), T = w();
420
+ function E(e) {
415
421
  let t = new URL(window.location.href);
416
422
  e(t.searchParams), window.history.replaceState({}, "", t.toString());
417
423
  }
418
- var S = /^(https?:\/\/\S+)$/;
419
- function C(e) {
420
- return typeof e == "string" && S.test(e);
424
+ var D = /^(https?:\/\/\S+)$/;
425
+ function O(e) {
426
+ return typeof e == "string" && D.test(e);
421
427
  }
422
- function w({ href: e, queryParams: t, keys: n }) {
428
+ function k({ href: e, queryParams: t, keys: n }) {
423
429
  let r = typeof t == "string" ? new URLSearchParams(t) : t;
424
430
  if (r.size === 0 || e.startsWith("http://") || e.startsWith("https://")) return e;
425
431
  let i = e.startsWith("#"), a = i && e.includes("?");
@@ -440,27 +446,28 @@ function w({ href: e, queryParams: t, keys: n }) {
440
446
  }
441
447
  //#endregion
442
448
  //#region src/core/kernel/session.ts
443
- var T = i(null), E = (0, b.init)({ length: 6 });
444
- function D() {
445
- return `s_${E()}`;
449
+ var A = i(null), j = (0, T.init)({ length: 6 });
450
+ function M() {
451
+ return `s_${j()}`;
446
452
  }
447
- function O(e) {
453
+ function N(e) {
448
454
  return e ? /^s_[\da-z]{6}$/.test(e) : !1;
449
455
  }
450
- var k = null;
451
- function A() {
452
- let e = s.get(c) === "edit", n = new URL(window.location.href).searchParams.get(o.sessionId), r = O(n) ? n : null;
453
- return x((t) => {
456
+ var P = null;
457
+ function F() {
458
+ let e = s.get(f) === "edit", n = new URL(window.location.href).searchParams.get(o.sessionId), r = N(n) ? n : null;
459
+ return E((t) => {
454
460
  e ? t.has(o.kiosk) || t.delete(o.sessionId) : (t.delete(o.sessionId), t.delete(o.kiosk));
455
- }), r === null ? (t.debug("Starting a new session", { sessionId: n }), D()) : e ? (t.debug("Connecting to existing session", { sessionId: r }), r) : (t.debug("Ignoring session_id from URL outside the editor", { sessionId: r }), D());
461
+ }), r === null ? (t.debug("Starting a new session", { sessionId: n }), M()) : e ? (t.debug("Connecting to existing session", { sessionId: r }), r) : (t.debug("Ignoring session_id from URL outside the editor", { sessionId: r }), M());
456
462
  }
457
- function j() {
458
- return k === null && (k = A()), k;
463
+ function I() {
464
+ return P === null && (P = F()), P;
459
465
  }
460
466
  //#endregion
461
467
  //#region src/core/runtime/runtime.ts
462
- var M = new Set(Object.values(o)), N = class {
463
- initialHealthyCheck = new f();
468
+ var L = new Set(Object.values(o)), R = class {
469
+ initialHealthyCheck = new _();
470
+ starting;
464
471
  config;
465
472
  lazy;
466
473
  constructor(e, t = !1) {
@@ -482,12 +489,12 @@ var M = new Set(Object.values(o)), N = class {
482
489
  return this.httpURL.origin === window.location.origin;
483
490
  }
484
491
  get isServerless() {
485
- return l() || a() || u();
492
+ return u() || a() || p();
486
493
  }
487
494
  formatHttpURL({ path: e = "", searchParams: t, restrictToKnownQueryParams: n = !0 }) {
488
495
  let r = this.httpURL, i = new URLSearchParams(window.location.search);
489
496
  if (t) for (let [e, n] of t.entries()) r.searchParams.set(e, n);
490
- for (let [e, t] of i.entries()) (!n || M.has(e)) && r.searchParams.set(e, t);
497
+ for (let [e, t] of i.entries()) (!n || L.has(e)) && r.searchParams.set(e, t);
491
498
  return r.pathname = `${r.pathname.replace(/\/$/, "")}/${e.replace(/^\//, "")}`, r.hash = "", r;
492
499
  }
493
500
  appendCrossOriginAuth(e) {
@@ -506,7 +513,7 @@ var M = new Set(Object.values(o)), N = class {
506
513
  searchParams: t,
507
514
  restrictToKnownQueryParams: !1
508
515
  });
509
- return P(this.appendCrossOriginAuth(n).toString());
516
+ return z(this.appendCrossOriginAuth(n).toString());
510
517
  }
511
518
  getSessionURL(e, t) {
512
519
  let n = this.formatHttpURL({ path: e }), r = new URLSearchParams(this.httpURL.search), i = new URLSearchParams(window.location.search);
@@ -516,7 +523,7 @@ var M = new Set(Object.values(o)), N = class {
516
523
  }
517
524
  getWsURL(e) {
518
525
  let t = this.getSessionURL("/ws", e);
519
- return P(this.appendCrossOriginAuth(t).toString());
526
+ return z(this.appendCrossOriginAuth(t).toString());
520
527
  }
521
528
  getSseURL(e) {
522
529
  let t = this.getSessionURL("/sse", e);
@@ -588,19 +595,24 @@ var M = new Set(Object.values(o)), N = class {
588
595
  async waitForHealthy() {
589
596
  return this.initialHealthyCheck.promise;
590
597
  }
598
+ start() {
599
+ return this.starting ??= this.init().then(() => this.waitForHealthy()).catch((e) => {
600
+ throw this.starting = void 0, this.initialHealthyCheck = new _(), e;
601
+ }), this.starting;
602
+ }
591
603
  headers() {
592
604
  let e = {
593
- "Marimo-Session-Id": j(),
605
+ "Marimo-Session-Id": I(),
594
606
  "Marimo-Server-Token": this.config.serverToken ?? "",
595
607
  "x-runtime-url": this.httpURL.toString()
596
608
  };
597
609
  return this.config.authToken && (e.Authorization = `Bearer ${this.config.authToken}`), e;
598
610
  }
599
611
  sessionHeaders() {
600
- return { "Marimo-Session-Id": j() };
612
+ return { "Marimo-Session-Id": I() };
601
613
  }
602
614
  };
603
- function P(e) {
615
+ function z(e) {
604
616
  if (!e.startsWith("http")) {
605
617
  t.warn(`URL must start with http: ${e}`);
606
618
  let n = new URL(e);
@@ -610,24 +622,39 @@ function P(e) {
610
622
  }
611
623
  //#endregion
612
624
  //#region src/core/runtime/config.ts
613
- function F() {
625
+ function B() {
614
626
  let e = new URL(document.baseURI);
615
627
  return e.search = "", e.hash = "", e.toString();
616
628
  }
617
- var I = {
629
+ var V = {
618
630
  lazy: !0,
619
- url: F()
620
- }, L = i(I), R = i((e) => {
621
- let t = e(L);
622
- return new N(t, t.lazy);
631
+ url: B()
632
+ }, H = i(V), U = i((e) => {
633
+ let t = e(H);
634
+ return new R(t, t.lazy);
623
635
  });
624
- function z() {
625
- return s.get(R);
636
+ function W() {
637
+ return s.get(U);
638
+ }
639
+ async function G() {
640
+ let e = W();
641
+ if (!e.isServerless && e.isLazy) {
642
+ g(s.get(d).state) && s.set(d, { state: m.CONNECTING });
643
+ try {
644
+ await e.start();
645
+ } catch (e) {
646
+ throw s.get(d).state === m.CONNECTING && s.set(d, {
647
+ state: m.CLOSED,
648
+ code: l.KERNEL_STARTUP_ERROR,
649
+ reason: c(e)
650
+ }), e;
651
+ }
652
+ }
626
653
  }
627
- function B(e) {
654
+ function K(e) {
628
655
  if (e.startsWith("http")) return new URL(e);
629
- let t = z().httpURL.toString();
656
+ let t = W().httpURL.toString();
630
657
  return t.startsWith("blob:") && (t = t.replace("blob:", "")), new URL(e, t);
631
658
  }
632
659
  //#endregion
633
- export { C as a, f as c, w as i, d as l, z as n, x as o, T as r, y as s, B as t };
660
+ export { k as a, w as c, A as i, _ as l, W as n, O as o, G as r, E as s, K as t, h as u };
@@ -2,7 +2,7 @@ import { i as e } from "./chunk-75Z2AOVW-9jQIEAxd.js";
2
2
  import { n as t } from "./src-D5uZaZib.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { D as r, H as i, K as a, U as o, a as s, b as c, c as l, f as u, v as d, w as f, y as p } from "./chunk-DU6HZSFF-B20LZ-hE.js";
5
- import { p as m } from "./mermaid-DMPMkVqY.js";
5
+ import { p as m } from "./mermaid-CNgH43ED.js";
6
6
  import { n as h } from "./mermaid-parser.core-DtOnl7m4.js";
7
7
  import { t as g } from "./chunk-JWPE2WC7-DJvv1t8U.js";
8
8
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-5FMLGOSQ.mjs
@@ -11,7 +11,7 @@ import { s as a } from "./chunk-4HAMMTFA-Bk_5S_m9.js";
11
11
  import { a as o, i as s, n as c } from "./chunk-GVQU2GXP-DGvySV5W.js";
12
12
  import { n as l } from "./chunk-L3NEJ4N5-D9-ekjZc.js";
13
13
  import { a as u, c as d, i as f } from "./chunk-OSK3NFVY-p7meGiY-.js";
14
- import { c as p, d as m, f as h, l as g, o as _, s as v, u as y } from "./mermaid-DMPMkVqY.js";
14
+ import { c as p, d as m, f as h, l as g, o as _, s as v, u as y } from "./mermaid-CNgH43ED.js";
15
15
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/dagre-GXQ25YYZ.mjs
16
16
  var b = /* @__PURE__ */ r((e, t, n) => Math.max(t, Math.min(n, e)), "clamp"), x = /* @__PURE__ */ r((e = "TB") => {
17
17
  switch (e) {
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { t } from "./react-CHbZqgBF.js";
3
3
  import { t as n } from "./react-dom-DhWGW7e0.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-CSElxhxo.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-ahfaPdFW.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-BE-GgVp4.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.0_27cffe7f1bc30287d59ac27db3240c5b/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor-style.js
7
7
  var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
8
8
  name: "DataGridOverlayEditorStyle",
@@ -3,7 +3,7 @@ import { n as t } from "./src-D5uZaZib.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { H as r, K as i, U as a, a as o, b as s, c, f as l, v as u, w as d, y as f, z as p } from "./chunk-DU6HZSFF-B20LZ-hE.js";
5
5
  import { r as m, t as h } from "./chunk-PWAF6VOD-oT_Qd2OU.js";
6
- import { p as g } from "./mermaid-DMPMkVqY.js";
6
+ import { p as g } from "./mermaid-CNgH43ED.js";
7
7
  import { n as _ } from "./mermaid-parser.core-DtOnl7m4.js";
8
8
  import { t as v } from "./chunk-JWPE2WC7-DJvv1t8U.js";
9
9
  import { t as y } from "./chunk-2Q5K7J3B-BMkUkeuy.js";
@@ -2,7 +2,7 @@ import { i as e } from "./chunk-75Z2AOVW-9jQIEAxd.js";
2
2
  import { n as t } from "./src-D5uZaZib.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { D as r, H as i, K as a, U as o, a as s, b as c, c as l, f as u, v as d, w as f, y as p } from "./chunk-DU6HZSFF-B20LZ-hE.js";
5
- import { p as m } from "./mermaid-DMPMkVqY.js";
5
+ import { p as m } from "./mermaid-CNgH43ED.js";
6
6
  import { n as h } from "./mermaid-parser.core-DtOnl7m4.js";
7
7
  import { t as g } from "./chunk-JWPE2WC7-DJvv1t8U.js";
8
8
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/diagram-UQ7AKVKN.mjs
@@ -6,7 +6,7 @@ import { p as a, t as o } from "./treemap-DmgI4zXI.js";
6
6
  import { n as s } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
7
7
  import { D as c, H as l, K as u, U as d, a as f, b as p, c as m, f as h, v as g, w as _, y as v } from "./chunk-DU6HZSFF-B20LZ-hE.js";
8
8
  import { i as y, n as b } from "./chunk-P2QGCYS3-74rxrEwb.js";
9
- import { p as x } from "./mermaid-DMPMkVqY.js";
9
+ import { p as x } from "./mermaid-CNgH43ED.js";
10
10
  import { n as S } from "./mermaid-parser.core-DtOnl7m4.js";
11
11
  import { t as C } from "./chunk-JWPE2WC7-DJvv1t8U.js";
12
12
  import { t as w } from "./chunk-POPQ4Y6H-EOTPk9Tj.js";
@@ -2,7 +2,7 @@ import { i as e } from "./chunk-75Z2AOVW-9jQIEAxd.js";
2
2
  import { n as t } from "./src-D5uZaZib.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { H as r, K as i, U as a, a as o, b as s, c, f as l, v as u, w as d, y as f } from "./chunk-DU6HZSFF-B20LZ-hE.js";
5
- import { p } from "./mermaid-DMPMkVqY.js";
5
+ import { p } from "./mermaid-CNgH43ED.js";
6
6
  import { n as m } from "./mermaid-parser.core-DtOnl7m4.js";
7
7
  import { t as h } from "./chunk-JWPE2WC7-DJvv1t8U.js";
8
8
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/diagram-Z3DM3KII.mjs
@@ -1,9 +1,9 @@
1
1
  import { n as e } from "./src-D5uZaZib.js";
2
2
  import { n as t } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
3
3
  import "./chunk-DU6HZSFF-B20LZ-hE.js";
4
- import "./mermaid-DMPMkVqY.js";
4
+ import "./mermaid-CNgH43ED.js";
5
5
  import { f as n, t as r } from "./mermaid-parser.core-DtOnl7m4.js";
6
- import { n as i, r as a, t as o } from "./chunk-SVP7TREG-CJFxs5R_.js";
6
+ import { n as i, r as a, t as o } from "./chunk-SVP7TREG-DEOpPMJp.js";
7
7
  import { t as s } from "./chunk-JWPE2WC7-DJvv1t8U.js";
8
8
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-PWID7BFC.mjs
9
9
  var c = n().RailroadEbnf.parser.LangiumParser, l = /* @__PURE__ */ t((e) => {
@@ -10,7 +10,7 @@ import "./chunk-4HAMMTFA-Bk_5S_m9.js";
10
10
  import "./chunk-GVQU2GXP-DGvySV5W.js";
11
11
  import "./chunk-L3NEJ4N5-D9-ekjZc.js";
12
12
  import "./chunk-OSK3NFVY-p7meGiY-.js";
13
- import { n as _, r as v } from "./mermaid-DMPMkVqY.js";
13
+ import { n as _, r as v } from "./mermaid-CNgH43ED.js";
14
14
  import { t as y } from "./chunk-XXDRQBXY-BM-YIt-_.js";
15
15
  import { t as b } from "./chunk-POPQ4Y6H-EOTPk9Tj.js";
16
16
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-RLTQ6QDP.mjs