@feedmepos/mf-miniprogram-v2 0.2.2-dev.16 → 0.2.2-dev.18

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.
@@ -2643,7 +2643,7 @@ function go() {
2643
2643
  let ln = null;
2644
2644
  const pn = ["application/xhtml+xml", "text/html"], Qn = "text/html";
2645
2645
  let it = null, I = null;
2646
- const M = e.createElement("form"), ae = function(k) {
2646
+ const D = e.createElement("form"), ae = function(k) {
2647
2647
  return k instanceof RegExp || k instanceof Function;
2648
2648
  }, se = function() {
2649
2649
  let k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -2755,7 +2755,7 @@ function go() {
2755
2755
  B.setAttribute(k, "");
2756
2756
  } catch {
2757
2757
  }
2758
- }, D = function(k) {
2758
+ }, M = function(k) {
2759
2759
  const B = _(k);
2760
2760
  if (B)
2761
2761
  for (let ce = B.length - 1; ce >= 0; --ce) {
@@ -2770,7 +2770,7 @@ function go() {
2770
2770
  const B = [k];
2771
2771
  for (; B.length > 0; ) {
2772
2772
  const ce = B.pop();
2773
- (E ? E(ce) : ce.nodeType) === tn.element && D(ce);
2773
+ (E ? E(ce) : ce.nodeType) === tn.element && M(ce);
2774
2774
  const je = S(ce);
2775
2775
  if (je)
2776
2776
  for (let Ge = je.length - 1; Ge >= 0; --Ge)
@@ -2946,7 +2946,7 @@ function go() {
2946
2946
  }
2947
2947
  return w(ve.afterSanitizeElements, k, null), !1;
2948
2948
  }, ze = function(k, B, ce) {
2949
- if (_e[B] || wt && B === "patchsrc" || wt && B === "for" && k !== "label" && k !== "output" || kn && (B === "id" || B === "name") && (ce in e || ce in M))
2949
+ if (_e[B] || wt && B === "patchsrc" || wt && B === "for" && k !== "label" && k !== "output" || kn && (B === "id" || B === "name") && (ce in e || ce in D))
2950
2950
  return !1;
2951
2951
  const Pe = oe[B] || ct.attributeCheck instanceof Function && ct.attributeCheck(B, k);
2952
2952
  if (!(Ue && Pt(Ne, B))) {
@@ -14318,7 +14318,7 @@ const M0 = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='v
14318
14318
  return ((st = (ze = (F = ye.payload) == null ? void 0 : F.element) == null ? void 0 : ze.ownerBlock) == null ? void 0 : st.file) === w.file && ye.feedback.startsWith("Use the block-swap skill.");
14319
14319
  }
14320
14320
  );
14321
- Y && D(Y.id);
14321
+ Y && M(Y.id);
14322
14322
  }
14323
14323
  async function Pn(w) {
14324
14324
  const x = T.value;
@@ -14531,7 +14531,7 @@ const M0 = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='v
14531
14531
  const x = w.target;
14532
14532
  x.style.height = "auto", x.style.height = `${Math.min(x.scrollHeight, 124)}px`;
14533
14533
  }
14534
- function M(w, x) {
14534
+ function D(w, x) {
14535
14535
  w.attachments = w.attachments.filter((Y) => Y.id !== x), m.value = null;
14536
14536
  }
14537
14537
  function ae(w) {
@@ -14605,7 +14605,7 @@ const M0 = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='v
14605
14605
  const w = pe.value;
14606
14606
  w && (cn(), Ue({ type: "annotation-revert", requestId: w.id }), w.draftStyles = { ...w.beforeStyles }, w.draftText = w.beforeText, w.appliedStyleKeys = [], w.textApplied = !1, w.changed = !1);
14607
14607
  }
14608
- function D(w) {
14608
+ function M(w) {
14609
14609
  var Y, ye, F;
14610
14610
  const x = v.value.find((ze) => ze.id === w);
14611
14611
  x && Ut.value && ((F = (ye = (Y = x.payload) == null ? void 0 : Y.element) == null ? void 0 : ye.ownerBlock) == null ? void 0 : F.file) === Ut.value.file && cn(), Ue({ type: "annotation-revert", requestId: w }), v.value = v.value.filter((ze) => ze.id !== w), f.value === w && (f.value = null);
@@ -14708,7 +14708,7 @@ const M0 = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='v
14708
14708
  return Jn(() => {
14709
14709
  be.setExecutor(_n), a.connect({
14710
14710
  focus: ln,
14711
- remove: D,
14711
+ remove: M,
14712
14712
  clear: Se,
14713
14713
  build: On
14714
14714
  }), window.addEventListener("message", Tn), window.addEventListener("keydown", Zt);
@@ -14840,7 +14840,7 @@ const M0 = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='v
14840
14840
  class: "preview__mini-icon-button preview__mini-icon-button--danger",
14841
14841
  title: "Remove annotation",
14842
14842
  "aria-label": "Remove annotation",
14843
- onClick: x[3] || (x[3] = (ke) => D(pe.value.id))
14843
+ onClick: x[3] || (x[3] = (ke) => M(pe.value.id))
14844
14844
  }, [
14845
14845
  X(F, {
14846
14846
  name: "delete",
@@ -14939,7 +14939,7 @@ const M0 = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='v
14939
14939
  type: "button",
14940
14940
  class: "preview__attachment-remove",
14941
14941
  "aria-label": `Remove ${ke.filename || "image"}`,
14942
- onClick: (Ir) => M(pe.value, ke.id)
14942
+ onClick: (Ir) => D(pe.value, ke.id)
14943
14943
  }, [
14944
14944
  X(F, {
14945
14945
  name: "close",
@@ -22222,16 +22222,16 @@ function H2() {
22222
22222
  Te !== null && (clearTimeout(Te), Te = null), Ne !== null && (cancelAnimationFrame(Ne), Ne = null);
22223
22223
  }
22224
22224
  function dt(I) {
22225
- let M = !1;
22225
+ let D = !1;
22226
22226
  for (const [ae, se] of ue) {
22227
22227
  if (I && (se.messageID !== I.messageID || se.partID !== I.partID)) continue;
22228
22228
  ue.delete(ae);
22229
22229
  const we = te[se.messageID];
22230
22230
  if (!we) continue;
22231
22231
  const Be = we.parts.find((qe) => qe.id === se.partID);
22232
- Be && (Be.kind === "text" || Be.kind === "reasoning") ? Be.text += se.text : Be || we.parts.push({ kind: "text", id: se.partID, text: se.text }), M = !0;
22232
+ Be && (Be.kind === "text" || Be.kind === "reasoning") ? Be.text += se.text : Be || we.parts.push({ kind: "text", id: se.partID, text: se.text }), D = !0;
22233
22233
  }
22234
- ue.size === 0 && Je(), M && T.value++;
22234
+ ue.size === 0 && Je(), D && T.value++;
22235
22235
  }
22236
22236
  function yt() {
22237
22237
  ue.clear(), Je();
@@ -22257,13 +22257,13 @@ function H2() {
22257
22257
  function oe(I = "No session selected") {
22258
22258
  ne++, H = null, J = null, t.value = "idle", e.value = I, r.value = null, a.value = !1, s.value = null, G(), o.value = null, u.value = null, c.value = null, R.value = !0, g.value = !1, S.value = null, y.value = !1, m.value = !1, z(), K();
22259
22259
  }
22260
- function be(I, M) {
22260
+ function be(I, D) {
22261
22261
  const ae = le.get(I) ?? I, se = te[ae];
22262
22262
  if (se) return se;
22263
22263
  const we = {
22264
22264
  key: I,
22265
22265
  id: I,
22266
- role: M,
22266
+ role: D,
22267
22267
  parentId: null,
22268
22268
  createdAt: Date.now(),
22269
22269
  parts: [],
@@ -22274,14 +22274,14 @@ function H2() {
22274
22274
  return te[I] = we, q.value.push(I), le.set(I, I), T.value++, we;
22275
22275
  }
22276
22276
  function ge(I) {
22277
- return q.value.map((M) => te[M]).filter((M) => (M == null ? void 0 : M.role) === "assistant" && M.parentId === I);
22277
+ return q.value.map((D) => te[D]).filter((D) => (D == null ? void 0 : D.role) === "assistant" && D.parentId === I);
22278
22278
  }
22279
22279
  function fe(I) {
22280
- const M = ge(I), ae = M[M.length - 1];
22280
+ const D = ge(I), ae = D[D.length - 1];
22281
22281
  if (!ae) return;
22282
22282
  const se = /* @__PURE__ */ new Set();
22283
22283
  let we = ae.diffs;
22284
- for (const Be of M) {
22284
+ for (const Be of D) {
22285
22285
  for (const qe of Be.changedFiles) se.add(qe);
22286
22286
  Be.diffs.length && (we = Be.diffs), Be !== ae && (Be.changedFiles = [], Be.diffs = []);
22287
22287
  }
@@ -22289,72 +22289,72 @@ function H2() {
22289
22289
  }
22290
22290
  function _e(I) {
22291
22291
  if (!I || typeof I != "object") return null;
22292
- const M = I;
22293
- return typeof M.file != "string" || !M.file ? null : {
22294
- file: M.file,
22295
- additions: typeof M.additions == "number" ? M.additions : 0,
22296
- deletions: typeof M.deletions == "number" ? M.deletions : 0,
22297
- ...typeof M.patch == "string" ? { patch: M.patch } : {},
22298
- ...M.status === "added" || M.status === "deleted" || M.status === "modified" ? { status: M.status } : {},
22299
- ...typeof M.before == "string" ? { before: M.before } : {},
22300
- ...typeof M.after == "string" ? { after: M.after } : {}
22292
+ const D = I;
22293
+ return typeof D.file != "string" || !D.file ? null : {
22294
+ file: D.file,
22295
+ additions: typeof D.additions == "number" ? D.additions : 0,
22296
+ deletions: typeof D.deletions == "number" ? D.deletions : 0,
22297
+ ...typeof D.patch == "string" ? { patch: D.patch } : {},
22298
+ ...D.status === "added" || D.status === "deleted" || D.status === "modified" ? { status: D.status } : {},
22299
+ ...typeof D.before == "string" ? { before: D.before } : {},
22300
+ ...typeof D.after == "string" ? { after: D.after } : {}
22301
22301
  };
22302
22302
  }
22303
- function ct(I, M) {
22303
+ function ct(I, D) {
22304
22304
  fe(I);
22305
22305
  const ae = ge(I), se = ae[ae.length - 1];
22306
22306
  if (!se) return;
22307
- const we = M.map(_e).filter((Be) => !!Be);
22307
+ const we = D.map(_e).filter((Be) => !!Be);
22308
22308
  se.diffs = we, se.changedFiles = we.map((Be) => Be.file), T.value++;
22309
22309
  }
22310
- function Xe(I, M) {
22311
- if (M.type === "patch") {
22312
- I.changedFiles = [.../* @__PURE__ */ new Set([...I.changedFiles, ...M.files])], I.parentId && fe(I.parentId), T.value++;
22310
+ function Xe(I, D) {
22311
+ if (D.type === "patch") {
22312
+ I.changedFiles = [.../* @__PURE__ */ new Set([...I.changedFiles, ...D.files])], I.parentId && fe(I.parentId), T.value++;
22313
22313
  return;
22314
22314
  }
22315
- const ae = z2(M);
22315
+ const ae = z2(D);
22316
22316
  if (!ae) return;
22317
22317
  const se = I.parts.findIndex((we) => we.id === ae.id);
22318
22318
  se === -1 ? I.parts.push(ae) : I.parts[se] = ae, T.value++;
22319
22319
  }
22320
22320
  function Ue(I) {
22321
22321
  if (I.sessionID !== o.value) return;
22322
- const M = be(I.id, I.role);
22323
- I.role === "assistant" ? (M.parentId = I.parentID, fe(I.parentID), M.busy = !I.time.completed, I.time.completed || (l.value = !0), I.error && (M.errorText = zn(I.error))) : (Q.delete(I.id) && (M.parts = []), M.busy = !1, I.summary && ct(I.id, I.summary.diffs));
22322
+ const D = be(I.id, I.role);
22323
+ I.role === "assistant" ? (D.parentId = I.parentID, fe(I.parentID), D.busy = !I.time.completed, I.time.completed || (l.value = !0), I.error && (D.errorText = zn(I.error))) : (Q.delete(I.id) && (D.parts = []), D.busy = !1, I.summary && ct(I.id, I.summary.diffs));
22324
22324
  }
22325
- function bt(I, M = {}) {
22325
+ function bt(I, D = {}) {
22326
22326
  K();
22327
22327
  const ae = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set();
22328
22328
  for (const { info: we, parts: Be } of [...I].sort((qe, lt) => qe.info.time.created - lt.info.time.created)) {
22329
22329
  const qe = be(we.id, we.role);
22330
- qe.createdAt = we.time.created, qe.busy = M.forceIdle ? !1 : we.role === "assistant" ? !we.time.completed : !1, we.role === "assistant" ? (qe.parentId = we.parentID, se.add(we.parentID), we.error && (qe.errorText = zn(we.error))) : we.summary && ae.set(we.id, we.summary.diffs);
22330
+ qe.createdAt = we.time.created, qe.busy = D.forceIdle ? !1 : we.role === "assistant" ? !we.time.completed : !1, we.role === "assistant" ? (qe.parentId = we.parentID, se.add(we.parentID), we.error && (qe.errorText = zn(we.error))) : we.summary && ae.set(we.id, we.summary.diffs);
22331
22331
  for (const lt of Be) Xe(qe, lt);
22332
22332
  }
22333
22333
  for (const we of se) fe(we);
22334
22334
  for (const [we, Be] of ae) ct(we, Be);
22335
22335
  }
22336
- async function Tt(I, M = ne) {
22336
+ async function Tt(I, D = ne) {
22337
22337
  const ae = H;
22338
22338
  if (!ae) return;
22339
22339
  const { data: se, error: we } = await ae.session.messages({
22340
22340
  path: { id: I },
22341
22341
  query: { limit: j2 }
22342
22342
  });
22343
- if (!(M !== ne || ae !== H)) {
22343
+ if (!(D !== ne || ae !== H)) {
22344
22344
  if (we) throw new Error(zn(we));
22345
22345
  bt(se ?? []);
22346
22346
  try {
22347
22347
  const { data: Be } = await ae.session.get({ path: { id: I } });
22348
- if (M !== ne || ae !== H) return;
22348
+ if (D !== ne || ae !== H) return;
22349
22349
  m.value = !!(Be != null && Be.revert);
22350
22350
  } catch {
22351
- if (M !== ne || ae !== H) return;
22351
+ if (D !== ne || ae !== H) return;
22352
22352
  m.value = !1;
22353
22353
  }
22354
22354
  }
22355
22355
  }
22356
- async function ht(I, M, ae, se = ne) {
22357
- const we = await nr(Hn(Ze.messages(I, M, ae)));
22356
+ async function ht(I, D, ae, se = ne) {
22357
+ const we = await nr(Hn(Ze.messages(I, D, ae)));
22358
22358
  if (!we.ok) throw new Error(await we.text());
22359
22359
  const Be = await we.json();
22360
22360
  se === ne && bt(Be.messages ?? [], { forceIdle: !0 });
@@ -22362,39 +22362,39 @@ function H2() {
22362
22362
  function wt(I) {
22363
22363
  if (I.sessionID !== o.value) return;
22364
22364
  dt({ messageID: I.messageID, partID: I.id });
22365
- const M = be(I.messageID, "assistant");
22366
- Xe(M, I);
22365
+ const D = be(I.messageID, "assistant");
22366
+ Xe(D, I);
22367
22367
  }
22368
22368
  function de(I) {
22369
22369
  return !!I && typeof I == "object" && I.type === "message.part.delta";
22370
22370
  }
22371
22371
  function xe(I) {
22372
22372
  if (!I || typeof I != "object" || I.type !== "question.asked") return !1;
22373
- const M = I.properties;
22374
- return !!M && typeof M == "object" && typeof M.id == "string" && typeof M.sessionID == "string" && Array.isArray(M.questions);
22373
+ const D = I.properties;
22374
+ return !!D && typeof D == "object" && typeof D.id == "string" && typeof D.sessionID == "string" && Array.isArray(D.questions);
22375
22375
  }
22376
22376
  function De(I) {
22377
22377
  if (!I || typeof I != "object") return !1;
22378
- const M = I.type;
22379
- if (M !== "question.replied" && M !== "question.rejected") return !1;
22378
+ const D = I.type;
22379
+ if (D !== "question.replied" && D !== "question.rejected") return !1;
22380
22380
  const ae = I.properties;
22381
22381
  return !!ae && typeof ae == "object" && typeof ae.sessionID == "string" && typeof ae.requestID == "string";
22382
22382
  }
22383
22383
  function Ve(I) {
22384
22384
  if (I.sessionID !== o.value) return;
22385
- const M = _.value.findIndex((ae) => ae.id === I.id);
22386
- M === -1 ? _.value = [..._.value, I] : _.value = _.value.map(
22387
- (ae, se) => se === M ? I : ae
22385
+ const D = _.value.findIndex((ae) => ae.id === I.id);
22386
+ D === -1 ? _.value = [..._.value, I] : _.value = _.value.map(
22387
+ (ae, se) => se === D ? I : ae
22388
22388
  ), W.value = null, T.value++;
22389
22389
  }
22390
22390
  function We(I) {
22391
- const M = _.value.filter((ae) => ae.id !== I);
22392
- M.length !== _.value.length && (_.value = M, P.value === I && (P.value = null), W.value = null, T.value++);
22391
+ const D = _.value.filter((ae) => ae.id !== I);
22392
+ D.length !== _.value.length && (_.value = D, P.value === I && (P.value = null), W.value = null, T.value++);
22393
22393
  }
22394
- function mt({ sessionID: I, messageID: M, partID: ae, field: se, delta: we }) {
22395
- if (I !== o.value || se !== "text" || !we || !te[M]) return;
22396
- const qe = `${M}\0${ae}`, lt = ue.get(qe);
22397
- lt ? lt.text += we : ue.set(qe, { messageID: M, partID: ae, text: we }), Oe();
22394
+ function mt({ sessionID: I, messageID: D, partID: ae, field: se, delta: we }) {
22395
+ if (I !== o.value || se !== "text" || !we || !te[D]) return;
22396
+ const qe = `${D}\0${ae}`, lt = ue.get(qe);
22397
+ lt ? lt.text += we : ue.set(qe, { messageID: D, partID: ae, text: we }), Oe();
22398
22398
  }
22399
22399
  async function en(I) {
22400
22400
  if (H)
@@ -22406,14 +22406,14 @@ function H2() {
22406
22406
  type: I.type,
22407
22407
  title: I.title
22408
22408
  });
22409
- } catch (M) {
22410
- e.value = `Failed to answer permission ask "${I.title}": ${rt(M)}`;
22409
+ } catch (D) {
22410
+ e.value = `Failed to answer permission ask "${I.title}": ${rt(D)}`;
22411
22411
  }
22412
22412
  }
22413
22413
  function Vt(I = !0) {
22414
- const M = ns(re.value);
22415
- re.value = M.queue;
22416
- const ae = M.item;
22414
+ const D = ns(re.value);
22415
+ re.value = D.queue;
22416
+ const ae = D.item;
22417
22417
  ae && (ae.failureText ? (ae.message.promptState = "failed", ae.message.errorText = ae.failureText) : delete ae.message.promptState, T.value++), I && Et();
22418
22418
  }
22419
22419
  function kn() {
@@ -22423,8 +22423,8 @@ function H2() {
22423
22423
  const se = te[ae];
22424
22424
  (se == null ? void 0 : se.role) === "assistant" && (se.busy = !1);
22425
22425
  }
22426
- const M = re.value.active;
22427
- M ? M.accepted ? (I = M.message.id, Vt(!1)) : M.idleObserved = !0 : Et(), I && Nt(I).finally(() => Et()), T.value++;
22426
+ const D = re.value.active;
22427
+ D ? D.accepted ? (I = D.message.id, Vt(!1)) : D.idleObserved = !0 : Et(), I && Nt(I).finally(() => Et()), T.value++;
22428
22428
  }
22429
22429
  async function Nt(I) {
22430
22430
  if (!(!c.value || !h.value || !u.value || R.value)) {
@@ -22440,54 +22440,54 @@ function H2() {
22440
22440
  }),
22441
22441
  signal: AbortSignal.timeout(18e4)
22442
22442
  }), m.value = !1;
22443
- } catch (M) {
22444
- S.value = rt(M);
22443
+ } catch (D) {
22444
+ S.value = rt(D);
22445
22445
  } finally {
22446
22446
  y.value = !1, v.value += 1;
22447
22447
  }
22448
22448
  }
22449
22449
  }
22450
- function Wt(I, M = !1) {
22450
+ function Wt(I, D = !1) {
22451
22451
  if (I.type === "idle") {
22452
- t.value === "ready" && (e.value = "Ready"), M && kn();
22452
+ t.value === "ready" && (e.value = "Ready"), D && kn();
22453
22453
  return;
22454
22454
  }
22455
22455
  l.value = !0, e.value = I.type === "retry" ? `Agent retrying${I.message ? `: ${I.message}` : "…"}` : "Agent working…";
22456
22456
  }
22457
22457
  async function Jt(I) {
22458
- const M = H, ae = o.value;
22459
- if (!(!M || !ae))
22458
+ const D = H, ae = o.value;
22459
+ if (!(!D || !ae))
22460
22460
  try {
22461
- const { data: se, error: we } = await M.session.status();
22462
- if (we || H !== M || I !== ne) return;
22461
+ const { data: se, error: we } = await D.session.status();
22462
+ if (we || H !== D || I !== ne) return;
22463
22463
  Wt((se == null ? void 0 : se[ae]) ?? { type: "idle" }, !0);
22464
22464
  } catch {
22465
22465
  }
22466
22466
  }
22467
22467
  async function It(I) {
22468
- const M = J, ae = o.value;
22469
- if (!(!M || !ae))
22468
+ const D = J, ae = o.value;
22469
+ if (!(!D || !ae))
22470
22470
  try {
22471
- const { data: se, error: we } = await M.question.list();
22471
+ const { data: se, error: we } = await D.question.list();
22472
22472
  if (we) throw we;
22473
- if (J !== M || I !== ne || o.value !== ae)
22473
+ if (J !== D || I !== ne || o.value !== ae)
22474
22474
  return;
22475
22475
  _.value = (se ?? []).filter((Be) => Be.sessionID === ae), W.value = null, T.value++;
22476
22476
  } catch (se) {
22477
- if (J !== M || I !== ne) return;
22477
+ if (J !== D || I !== ne) return;
22478
22478
  W.value = `Failed to restore agent question: ${zn(se)}`;
22479
22479
  }
22480
22480
  }
22481
22481
  async function an(I) {
22482
22482
  if (!H) return;
22483
- let M = 0;
22483
+ let D = 0;
22484
22484
  for (; H && I === ne; ) {
22485
22485
  try {
22486
22486
  const { stream: ae } = await H.event.subscribe();
22487
22487
  await Promise.all([Jt(I), It(I)]);
22488
22488
  for await (const se of ae) {
22489
22489
  if (I !== ne) return;
22490
- M = 0, g.value = !1;
22490
+ D = 0, g.value = !1;
22491
22491
  const we = se;
22492
22492
  if (xe(we))
22493
22493
  Ve(we.properties);
@@ -22516,15 +22516,15 @@ function H2() {
22516
22516
  if (I !== ne) return;
22517
22517
  e.value = `Event stream reconnecting: ${rt(ae)}`;
22518
22518
  }
22519
- M++, M >= 3 && (g.value = !0), await ai(1e3), I === ne && t.value === "ready" && !g.value && (e.value = "Ready");
22519
+ D++, D >= 3 && (g.value = !0), await ai(1e3), I === ne && t.value === "ready" && !g.value && (e.value = "Ready");
22520
22520
  }
22521
22521
  }
22522
- function At(I, M, ae, se = ne) {
22522
+ function At(I, D, ae, se = ne) {
22523
22523
  let we = !0;
22524
22524
  return (async () => {
22525
22525
  for (; we && se === ne && (await ai(2e3), !(!we || se !== ne)); )
22526
22526
  try {
22527
- const Be = await nr(Hn(Ze.startStatus(I, M, ae)));
22527
+ const Be = await nr(Hn(Ze.startStatus(I, D, ae)));
22528
22528
  if (!Be.ok) continue;
22529
22529
  const { label: qe } = await Be.json();
22530
22530
  we && se === ne && qe && qe !== "Ready" && (e.value = qe);
@@ -22536,22 +22536,22 @@ function H2() {
22536
22536
  }
22537
22537
  async function Ut(I = {}) {
22538
22538
  yt(), G(), z(), t.value = "starting", R.value = !!I.readOnly, u.value = I.sessionId ?? null, c.value = I.businessId ?? null, h.value = I.projectId ?? null, s.value = null, g.value = !1;
22539
- const M = ++ne;
22539
+ const D = ++ne;
22540
22540
  if (R.value) {
22541
22541
  e.value = "Loading archived history…", H = null, J = null, r.value = null, o.value = null;
22542
22542
  try {
22543
22543
  if (!I.businessId || !I.projectId || !I.sessionId)
22544
22544
  throw new Error("businessId, projectId and sessionId are required");
22545
- if (await ht(I.businessId, I.projectId, I.sessionId), M !== ne) return;
22545
+ if (await ht(I.businessId, I.projectId, I.sessionId), D !== ne) return;
22546
22546
  t.value = "ready", e.value = "Archived (read-only)";
22547
22547
  } catch (se) {
22548
- if (M !== ne) return;
22548
+ if (D !== ne) return;
22549
22549
  t.value = "error", e.value = `Failed to load history: ${rt(se)}`;
22550
22550
  }
22551
22551
  return;
22552
22552
  }
22553
22553
  if (e.value = "Starting sandbox…", I.businessId && I.projectId && I.sessionId && await ht(I.businessId, I.projectId, I.sessionId).catch(() => {
22554
- }), M !== ne) return;
22554
+ }), D !== ne) return;
22555
22555
  const ae = I.businessId && I.projectId && I.sessionId ? At(I.businessId, I.projectId, I.sessionId) : () => {
22556
22556
  };
22557
22557
  try {
@@ -22572,17 +22572,17 @@ function H2() {
22572
22572
  } finally {
22573
22573
  window.clearTimeout(we);
22574
22574
  }
22575
- if (M !== ne) return;
22575
+ if (D !== ne) return;
22576
22576
  if (!Be.ok) throw new Error(await Be.text());
22577
22577
  const {
22578
22578
  previewUrl: qe,
22579
22579
  sessionId: lt,
22580
22580
  rawOpencodeSessionId: Zt
22581
22581
  } = await Be.json();
22582
- if (M !== ne) return;
22582
+ if (D !== ne) return;
22583
22583
  r.value = qe, u.value = lt;
22584
22584
  const fn = Zt ?? lt, _t = await Gc();
22585
- if (M !== ne) return;
22585
+ if (D !== ne) return;
22586
22586
  const Rt = {
22587
22587
  "x-miniprogram-business-id": I.businessId ?? "",
22588
22588
  "x-miniprogram-project-id": I.projectId ?? "",
@@ -22592,15 +22592,15 @@ function H2() {
22592
22592
  const C = (Se, tt) => {
22593
22593
  const ot = new Request(Se, tt);
22594
22594
  return ot.headers.set("x-miniprogram-business-id", I.businessId ?? ""), ot.headers.set("x-miniprogram-project-id", I.projectId ?? ""), ot.headers.set("x-miniprogram-session-id", lt), ot.timeout = !1, nr(ot);
22595
- }, D = {
22595
+ }, M = {
22596
22596
  baseUrl: Hn(Ze.opencode()),
22597
22597
  headers: Rt,
22598
22598
  fetch: C
22599
22599
  };
22600
- if (H = Gx(D), J = A2(D), o.value = fn, await Tt(fn), M !== ne) return;
22601
- an(M), t.value = "ready", e.value = "Ready";
22600
+ if (H = Gx(M), J = A2(M), o.value = fn, await Tt(fn), D !== ne) return;
22601
+ an(D), t.value = "ready", e.value = "Ready";
22602
22602
  } catch (se) {
22603
- if (M !== ne) return;
22603
+ if (D !== ne) return;
22604
22604
  t.value = "error", e.value = `Failed to start: ${rt(se)}`;
22605
22605
  } finally {
22606
22606
  ae();
@@ -22617,12 +22617,12 @@ function H2() {
22617
22617
  e.value = `Failed to stop: ${rt(I)}`;
22618
22618
  }
22619
22619
  }
22620
- async function Pn(I, M) {
22620
+ async function Pn(I, D) {
22621
22621
  const ae = J;
22622
22622
  if (!ae || !_.value.some((se) => se.id === I)) return !1;
22623
22623
  P.value = I, W.value = null;
22624
22624
  try {
22625
- const { error: se } = await ae.question.reply({ requestID: I, answers: M });
22625
+ const { error: se } = await ae.question.reply({ requestID: I, answers: D });
22626
22626
  if (se) throw se;
22627
22627
  return We(I), e.value = "Agent working…", !0;
22628
22628
  } catch (se) {
@@ -22632,11 +22632,11 @@ function H2() {
22632
22632
  }
22633
22633
  }
22634
22634
  async function $n(I) {
22635
- const M = J;
22636
- if (!M || !_.value.some((ae) => ae.id === I)) return !1;
22635
+ const D = J;
22636
+ if (!D || !_.value.some((ae) => ae.id === I)) return !1;
22637
22637
  P.value = I, W.value = null;
22638
22638
  try {
22639
- const { error: ae } = await M.question.reject({ requestID: I });
22639
+ const { error: ae } = await D.question.reject({ requestID: I });
22640
22640
  if (ae) throw ae;
22641
22641
  return We(I), e.value = "Question dismissed", !0;
22642
22642
  } catch (ae) {
@@ -22650,7 +22650,7 @@ function H2() {
22650
22650
  if (!c.value || !u.value || !r.value || R.value)
22651
22651
  return s.value = "A live session is required to restart the preview server.", !1;
22652
22652
  a.value = !0, s.value = null;
22653
- const I = new AbortController(), M = window.setTimeout(() => I.abort(), F2);
22653
+ const I = new AbortController(), D = window.setTimeout(() => I.abort(), F2);
22654
22654
  try {
22655
22655
  const ae = await nr(
22656
22656
  Hn(Ze.restartPreview(c.value, h.value, u.value)),
@@ -22661,41 +22661,41 @@ function H2() {
22661
22661
  } catch (ae) {
22662
22662
  return s.value = ae instanceof DOMException && ae.name === "AbortError" ? "Preview restart timed out. Try reopening the session." : `Failed to restart preview: ${rt(ae)}`, !1;
22663
22663
  } finally {
22664
- window.clearTimeout(M), a.value = !1;
22664
+ window.clearTimeout(D), a.value = !1;
22665
22665
  }
22666
22666
  }
22667
22667
  async function _n(I) {
22668
22668
  if (!c.value || !u.value)
22669
22669
  throw new Error("session not ready for file uploads");
22670
- const M = await (await fetch(I.url)).blob(), ae = new URLSearchParams();
22670
+ const D = await (await fetch(I.url)).blob(), ae = new URLSearchParams();
22671
22671
  I.filename && ae.set("filename", I.filename);
22672
22672
  const se = await nr(
22673
22673
  Hn(
22674
22674
  Ze.uploads(c.value, h.value, u.value, ae.toString())
22675
22675
  ),
22676
- { method: "POST", body: M, headers: { "Content-Type": I.mime } }
22676
+ { method: "POST", body: D, headers: { "Content-Type": I.mime } }
22677
22677
  );
22678
22678
  if (!se.ok) throw new Error(await se.text());
22679
22679
  const { path: we } = await se.json();
22680
22680
  return we;
22681
22681
  }
22682
22682
  function qt(I) {
22683
- const { message: M } = I;
22684
- te[M.key] = M, q.value.push(M.key), T.value++;
22683
+ const { message: D } = I;
22684
+ te[D.key] = D, q.value.push(D.key), T.value++;
22685
22685
  }
22686
- function sn(I, M) {
22687
- I.failureText = rt(M), I.message.promptState = "failed", I.message.errorText = I.failureText, l.value = !1;
22686
+ function sn(I, D) {
22687
+ I.failureText = rt(D), I.message.promptState = "failed", I.message.errorText = I.failureText, l.value = !1;
22688
22688
  const ae = ns(re.value);
22689
22689
  re.value = ae.queue, e.value = `Failed to send: ${I.failureText}`, T.value++;
22690
22690
  }
22691
- function xn(I, M) {
22691
+ function xn(I, D) {
22692
22692
  const ae = ns(re.value);
22693
22693
  re.value = ae.queue, pe = { text: I.text, attachments: [...I.attachments] }, Ae.value += 1, L = !0, i.value = !1, I.message.promptState = "held";
22694
22694
  for (const se of re.value.pending) se.message.promptState = "held";
22695
- e.value = re.value.pending.length ? `${M}. ${re.value.pending.length} queued message${re.value.pending.length > 1 ? "s" : ""} on hold.` : M, T.value += 1;
22695
+ e.value = re.value.pending.length ? `${D}. ${re.value.pending.length} queued message${re.value.pending.length > 1 ? "s" : ""} on hold.` : D, T.value += 1;
22696
22696
  }
22697
- function un(I, M, ae) {
22698
- const se = N2(M, ae);
22697
+ function un(I, D, ae) {
22698
+ const se = N2(D, ae);
22699
22699
  xn(I, se.statusMessage), n.open({
22700
22700
  title: se.title,
22701
22701
  message: se.dialogMessage,
@@ -22722,14 +22722,14 @@ function H2() {
22722
22722
  const I = M2(re.value);
22723
22723
  if (!I.item) return;
22724
22724
  re.value = I.queue;
22725
- const M = I.item, ae = me, se = H, we = o.value;
22725
+ const D = I.item, ae = me, se = H, we = o.value;
22726
22726
  let Be = !1;
22727
- ve = !0, i.value = !0, M.message.promptState = "submitting";
22727
+ ve = !0, i.value = !0, D.message.promptState = "submitting";
22728
22728
  try {
22729
22729
  if (!c.value || !h.value || !u.value)
22730
22730
  throw new Error("session not ready for AI billing");
22731
22731
  const qe = B2(ie);
22732
- M.message.id = qe;
22732
+ D.message.id = qe;
22733
22733
  let lt = { action: "unavailable", cause: "unknown" };
22734
22734
  for (let Se = 1; Se <= Uc; Se++) {
22735
22735
  const tt = await at(
@@ -22742,11 +22742,11 @@ function H2() {
22742
22742
  );
22743
22743
  if (lt = O2(tt, Se), lt.action !== "retry") break;
22744
22744
  const ot = lt.delayMs;
22745
- if (await new Promise((Qe) => setTimeout(Qe, ot)), ae !== me || re.value.active !== M) return;
22745
+ if (await new Promise((Qe) => setTimeout(Qe, ot)), ae !== me || re.value.active !== D) return;
22746
22746
  }
22747
22747
  if (lt.action === "insufficient") {
22748
22748
  const Se = lt.purchaseUrl;
22749
- xn(M, "AI Token balance is insufficient"), n.open({
22749
+ xn(D, "AI Token balance is insufficient"), n.open({
22750
22750
  title: "Top up AI Tokens to continue",
22751
22751
  message: "This message was returned to the editor. Open Billing in a new tab, select the AI Token tab, and top up before sending again.",
22752
22752
  dismissAway: !0,
@@ -22758,19 +22758,19 @@ function H2() {
22758
22758
  return;
22759
22759
  }
22760
22760
  if (lt.action !== "send") {
22761
- un(M, lt.action === "unavailable" ? lt.cause : "agent_busy");
22761
+ un(D, lt.action === "unavailable" ? lt.cause : "agent_busy");
22762
22762
  return;
22763
22763
  }
22764
- Be = !0, le.set(qe, M.message.key), Q.add(qe), qt(M);
22764
+ Be = !0, le.set(qe, D.message.key), Q.add(qe), qt(D);
22765
22765
  const Zt = [];
22766
- for (const Se of M.attachments) Zt.push(await _n(Se));
22767
- if (ae !== me || H !== se || o.value !== we || re.value.active !== M)
22766
+ for (const Se of D.attachments) Zt.push(await _n(Se));
22767
+ if (ae !== me || H !== se || o.value !== we || re.value.active !== D)
22768
22768
  return;
22769
- const fn = Zt.length ? `[The attached image file${Zt.length > 1 ? "s are" : " is"} saved on this machine at: ${Zt.join(", ")} (outside the repo). If the task needs the actual file as an asset, move it into the app (e.g. src/assets/) — do not try to recreate it. If it is only a visual reference, leave it where it is.]` : "", _t = M.attachments.filter((Se) => Se.sourceUrl), Rt = _t.length ? `[${_t.length > 1 ? "Those images are" : "That image is"} in the merchant's media library, permanently hosted at: ${_t.map((Se) => `${Se.filename ?? "image"} -> ${Se.sourceUrl}`).join(", ")}. Reference the hosted URL from the code rather than copying the file into the repo.]` : "", C = [M.text.trim(), fn, Rt].filter(Boolean).join(`
22769
+ const fn = Zt.length ? `[The attached image file${Zt.length > 1 ? "s are" : " is"} saved on this machine at: ${Zt.join(", ")} (outside the repo). If the task needs the actual file as an asset, move it into the app (e.g. src/assets/) — do not try to recreate it. If it is only a visual reference, leave it where it is.]` : "", _t = D.attachments.filter((Se) => Se.sourceUrl), Rt = _t.length ? `[${_t.length > 1 ? "Those images are" : "That image is"} in the merchant's media library, permanently hosted at: ${_t.map((Se) => `${Se.filename ?? "image"} -> ${Se.sourceUrl}`).join(", ")}. Reference the hosted URL from the code rather than copying the file into the repo.]` : "", C = [D.text.trim(), fn, Rt].filter(Boolean).join(`
22770
22770
 
22771
22771
  `);
22772
22772
  l.value = !0;
22773
- const { error: D } = await se.session.promptAsync({
22773
+ const { error: M } = await se.session.promptAsync({
22774
22774
  path: { id: we },
22775
22775
  body: {
22776
22776
  messageID: qe,
@@ -22778,7 +22778,7 @@ function H2() {
22778
22778
  // OpenCode servers that started before the server config enabled it.
22779
22779
  tools: { question: !0 },
22780
22780
  parts: [
22781
- ...M.attachments.map((Se) => ({
22781
+ ...D.attachments.map((Se) => ({
22782
22782
  type: "file",
22783
22783
  mime: Se.mime,
22784
22784
  filename: Se.filename,
@@ -22788,11 +22788,11 @@ function H2() {
22788
22788
  ]
22789
22789
  }
22790
22790
  });
22791
- if (D) throw new Error(zn(D));
22792
- M.accepted = !0, M.message.promptState = M.failureText ? "failed" : "running", T.value++, M.idleObserved && (Vt(!1), Nt(qe).finally(() => Et()));
22791
+ if (M) throw new Error(zn(M));
22792
+ D.accepted = !0, D.message.promptState = D.failureText ? "failed" : "running", T.value++, D.idleObserved && (Vt(!1), Nt(qe).finally(() => Et()));
22793
22793
  } catch (qe) {
22794
- ae === me && re.value.active === M && (Be ? sn(M, qe) : un(
22795
- M,
22794
+ ae === me && re.value.active === D && (Be ? sn(D, qe) : un(
22795
+ D,
22796
22796
  qe instanceof da ? "request_rejected" : "request_failed",
22797
22797
  qe instanceof da ? `HTTP ${qe.status}${qe.body ? `: ${qe.body.slice(0, 120)}` : ""}` : rt(qe)
22798
22798
  ));
@@ -22800,7 +22800,7 @@ function H2() {
22800
22800
  ae === me && (i.value = !1, ve = !1, Et());
22801
22801
  }
22802
22802
  }
22803
- function dn(I, M, ae) {
22803
+ function dn(I, D, ae) {
22804
22804
  const se = `local-${crypto.randomUUID()}`;
22805
22805
  return { message: {
22806
22806
  key: se,
@@ -22809,7 +22809,7 @@ function H2() {
22809
22809
  parentId: null,
22810
22810
  createdAt: Date.now(),
22811
22811
  parts: [
22812
- ...M.map((Be, qe) => ({
22812
+ ...D.map((Be, qe) => ({
22813
22813
  kind: "file",
22814
22814
  id: `${se}-file-${qe}`,
22815
22815
  mime: Be.mime,
@@ -22822,16 +22822,16 @@ function H2() {
22822
22822
  diffs: [],
22823
22823
  busy: !1,
22824
22824
  promptState: ae
22825
- }, text: I, attachments: M, accepted: !1, idleObserved: !1 };
22825
+ }, text: I, attachments: D, accepted: !1, idleObserved: !1 };
22826
22826
  }
22827
- function Xn(I, M = []) {
22827
+ function Xn(I, D = []) {
22828
22828
  if (!H || !o.value || R.value) return !1;
22829
22829
  const ae = I.trim();
22830
- if (!ae && M.length === 0) return !1;
22830
+ if (!ae && D.length === 0) return !1;
22831
22831
  if (re.value.pending.length + (re.value.active ? 1 : 0) >= $l)
22832
22832
  return e.value = `Prompt queue is full (${$l} items).`, !1;
22833
22833
  f.takeControl();
22834
- const se = dn(ae, M, "queued");
22834
+ const se = dn(ae, D, "queued");
22835
22835
  return L ? (Yn(), re.value = Rl(re.value, se)) : re.value = D2(re.value, se), T.value++, Et(), !0;
22836
22836
  }
22837
22837
  async function ln() {
@@ -22843,7 +22843,7 @@ function H2() {
22843
22843
  return !1;
22844
22844
  y.value = !0, S.value = null;
22845
22845
  try {
22846
- const M = await at(
22846
+ const D = await at(
22847
22847
  Ze.revertTurn(c.value, h.value, u.value),
22848
22848
  {
22849
22849
  method: "POST",
@@ -22851,9 +22851,9 @@ function H2() {
22851
22851
  signal: AbortSignal.timeout(18e4)
22852
22852
  }
22853
22853
  );
22854
- return m.value = !0, await Tt(o.value), S.value = M.durable === !1 ? M.saveError ?? "Save pending" : null, e.value = M.durable === !1 ? "Turn undone; save pending" : "Turn undone and saved", v.value += 1, !0;
22855
- } catch (M) {
22856
- return S.value = rt(M), e.value = `Undo failed: ${S.value}`, v.value += 1, !1;
22854
+ return m.value = !0, await Tt(o.value), S.value = D.durable === !1 ? D.saveError ?? "Save pending" : null, e.value = D.durable === !1 ? "Turn undone; save pending" : "Turn undone and saved", v.value += 1, !0;
22855
+ } catch (D) {
22856
+ return S.value = rt(D), e.value = `Undo failed: ${S.value}`, v.value += 1, !1;
22857
22857
  } finally {
22858
22858
  y.value = !1;
22859
22859
  }
@@ -23575,8 +23575,8 @@ const Y2 = ["title"], X2 = { class: "project-switcher__menu" }, Q2 = {
23575
23575
  () => e.sessions.find((C) => C.id === t.workspaceSessionId) ?? E.value
23576
23576
  ), re = j(() => {
23577
23577
  var Se;
23578
- const C = is(), D = Jc(((Se = e.project) == null ? void 0 : Se.country) ?? Bl());
23579
- return !C || !D ? null : Zc(Wc("fmmf:dev"), D, C);
23578
+ const C = is(), M = Jc(((Se = e.project) == null ? void 0 : Se.country) ?? Bl());
23579
+ return !C || !M ? null : Zc(Wc("fmmf:dev"), M, C);
23580
23580
  });
23581
23581
  function Le() {
23582
23582
  const C = re.value;
@@ -23586,10 +23586,12 @@ const Y2 = ["title"], X2 = { class: "project-switcher__menu" }, Q2 = {
23586
23586
  () => Q.value ? qe(Q.value) : "Workspace"
23587
23587
  ), pe = j(() => {
23588
23588
  var tt, ot;
23589
- const C = (ot = (tt = e.project) == null ? void 0 : tt.name) == null ? void 0 : ot.trim(), D = e.projectId, Se = C === D || /^(?:prj)?[a-f0-9]{24}$/i.test(C ?? "") || /^prj[a-z0-9]{24}$/i.test(C ?? "");
23590
- return C && !Se ? C : D ? `…${D.slice(-6)}` : "App";
23589
+ const C = (ot = (tt = e.project) == null ? void 0 : tt.name) == null ? void 0 : ot.trim(), M = e.projectId, Se = C === M || /^(?:prj)?[a-f0-9]{24}$/i.test(C ?? "") || /^prj[a-z0-9]{24}$/i.test(C ?? "");
23590
+ return C && !Se ? C : M ? `…${M.slice(-6)}` : "App";
23591
23591
  }), L = j(() => `${pe.value}
23592
- ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.status === "preview") ?? null), ee = j(() => {
23592
+ ${e.projectId}`), T = j(
23593
+ () => e.releases.find((C) => C.status === "draft" || C.status === "preview") ?? null
23594
+ ), ee = j(() => {
23593
23595
  const C = T.value;
23594
23596
  return C ? C.build_status === "succeeded" ? "Release ready to go live" : C.build_status === "failed" ? "Build failed" : "Release build in progress" : "No release waiting to go live";
23595
23597
  }), H = j(() => {
@@ -23608,23 +23610,23 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23608
23610
  var C;
23609
23611
  return ((C = e.project) == null ? void 0 : C.publishingEntitlement) ?? null;
23610
23612
  }), Ne = j(() => {
23611
- var C, D;
23612
- return e.publishPermissionDenied ? "You do not have permission to publish. Contact an administrator." : ((C = Te.value) == null ? void 0 : C.status) === "not_entitled" ? "Miniprogram Premium is not enabled." : ((D = Te.value) == null ? void 0 : D.status) === "unavailable" ? "Unable to confirm subscription status. Please try again later." : null;
23613
+ var C, M;
23614
+ return e.publishPermissionDenied ? "You do not have permission to publish. Contact an administrator." : ((C = Te.value) == null ? void 0 : C.status) === "not_entitled" ? "Miniprogram Premium is not enabled." : ((M = Te.value) == null ? void 0 : M.status) === "unavailable" ? "Unable to confirm subscription status. Please try again later." : null;
23613
23615
  }), Je = j(() => e.busy || u.value), dt = j(
23614
23616
  () => !!(E.value && e.isProvisioned && !Je.value && !t.agentBusy && !t.checkpointSaving && !e.checkpointBusy)
23615
23617
  ), yt = j(
23616
23618
  () => !!(e.isProvisioned && !e.busy && !Nt.value)
23617
23619
  ), Oe = Z_(), K = j(
23618
23620
  () => {
23619
- var C, D;
23620
- return dt.value && Oe.value && !!((D = (C = e.project) == null ? void 0 : C.appTemplate) != null && D.startsWith("miniprogram-vue-v2"));
23621
+ var C;
23622
+ return dt.value && Oe.value && ((C = e.project) == null ? void 0 : C.appTemplateId) === "miniprogram-vue-v2";
23621
23623
  }
23622
23624
  ), G = j(() => {
23623
23625
  const C = e.workspaceState;
23624
23626
  return !Q.value || Q.value.status !== "active" ? "Read-only history" : C ? t.status === "starting" && C.syncState === "unavailable" ? C.lastDurableCommitSha ? `Starting workspace · saved ${C.lastDurableCommitSha.slice(0, 7)}` : "Starting workspace" : C.syncState === "unavailable" ? C.lastDurableCommitSha ? `Workspace unavailable · saved ${C.lastDurableCommitSha.slice(0, 7)}` : "Workspace unavailable" : C.syncState === "diverged" ? "Workspace diverged from main" : C.syncState === "behind" ? `${C.commitsBehindOrigin} commit${C.commitsBehindOrigin === 1 ? "" : "s"} behind main` : C.syncState === "uncommitted" ? `${C.statusCount} local change${C.statusCount === 1 ? "" : "s"} · awaiting save` : C.syncState === "unpushed" ? `${C.commitsAheadOrigin} local commit${C.commitsAheadOrigin === 1 ? "" : "s"} · not pushed` : C.syncState === "saving" || t.checkpointSaving || e.checkpointBusy ? "Saving checkpoint…" : C.syncState === "save_failed" ? "Save failed · retry scheduled" : C.lastDurableCommitSha ? `Saved to GitHub${C.lastPushedAt ? ` · ${Rt(C.lastPushedAt)}` : ""} · ${C.lastDurableCommitSha.slice(0, 7)}` : "No durable checkpoint yet" : "Checking save status…";
23625
23627
  }), z = j(() => {
23626
- var D;
23627
- const C = (D = e.workspaceState) == null ? void 0 : D.syncState;
23628
+ var M;
23629
+ const C = (M = e.workspaceState) == null ? void 0 : M.syncState;
23628
23630
  return t.status === "starting" && C === "unavailable" ? "warning" : C === "synced" ? "success" : C === "save_failed" || C === "diverged" || C === "unavailable" ? "error" : C === "uncommitted" || C === "unpushed" || C === "behind" || C === "saving" ? "warning" : "neutral";
23629
23631
  }), oe = j(() => {
23630
23632
  var C;
@@ -23634,8 +23636,8 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23634
23636
  };
23635
23637
  }), be = j(
23636
23638
  () => {
23637
- var C, D;
23638
- return ((C = Q.value) == null ? void 0 : C.status) === "active" && !t.agentBusy && !t.checkpointSaving && !e.checkpointBusy && !e.busy && t.status === "ready" && ["uncommitted", "unpushed", "save_failed"].includes(((D = e.workspaceState) == null ? void 0 : D.syncState) ?? "");
23639
+ var C, M;
23640
+ return ((C = Q.value) == null ? void 0 : C.status) === "active" && !t.agentBusy && !t.checkpointSaving && !e.checkpointBusy && !e.busy && t.status === "ready" && ["uncommitted", "unpushed", "save_failed"].includes(((M = e.workspaceState) == null ? void 0 : M.syncState) ?? "");
23639
23641
  }
23640
23642
  ), ge = j(() => ({
23641
23643
  "--workspace-chat-width": `${h.value}px`
@@ -23644,26 +23646,26 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23644
23646
  s.push(ls(e.projectId, C, a.query));
23645
23647
  }
23646
23648
  function _e() {
23647
- var D;
23648
- const C = ((D = c.value) == null ? void 0 : D.clientWidth) ?? 0;
23649
+ var M;
23650
+ const C = ((M = c.value) == null ? void 0 : M.clientWidth) ?? 0;
23649
23651
  return C ? Math.max(na, Math.min(as, C - tE)) : as;
23650
23652
  }
23651
23653
  function ct(C) {
23652
23654
  return Math.round(Math.min(_e(), Math.max(na, C)));
23653
23655
  }
23654
- function Xe(C, D = !1) {
23656
+ function Xe(C, M = !1) {
23655
23657
  const Se = ct(C);
23656
- h.value !== Se && (h.value = Se), D && si(rs, String(Se));
23658
+ h.value !== Se && (h.value = Se), M && si(rs, String(Se));
23657
23659
  }
23658
23660
  function Ue() {
23659
23661
  R == null || R.disconnect(), R = null, !(!c.value || typeof ResizeObserver > "u") && (R = new ResizeObserver(() => Xe(h.value)), R.observe(c.value), Xe(h.value));
23660
23662
  }
23661
23663
  function bt(C) {
23662
- var D, Se;
23664
+ var M, Se;
23663
23665
  C.pointerType === "mouse" && C.button !== 0 || (g = {
23664
23666
  startX: C.clientX,
23665
23667
  startWidth: h.value
23666
- }, f.value = !0, v = document.body.style.cursor, S = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", (Se = (D = C.currentTarget).setPointerCapture) == null || Se.call(D, C.pointerId), window.addEventListener("pointermove", Tt), window.addEventListener("pointerup", ht, { once: !0 }), window.addEventListener("pointercancel", ht, { once: !0 }), C.preventDefault());
23668
+ }, f.value = !0, v = document.body.style.cursor, S = document.body.style.userSelect, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", (Se = (M = C.currentTarget).setPointerCapture) == null || Se.call(M, C.pointerId), window.addEventListener("pointermove", Tt), window.addEventListener("pointerup", ht, { once: !0 }), window.addEventListener("pointercancel", ht, { once: !0 }), C.preventDefault());
23667
23669
  }
23668
23670
  function Tt(C) {
23669
23671
  g && Xe(g.startWidth + C.clientX - g.startX);
@@ -23675,22 +23677,22 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23675
23677
  C.key === "ArrowLeft" || C.key === "ArrowRight" ? (C.preventDefault(), Xe(h.value + (C.key === "ArrowRight" ? 32 : -32), !0)) : C.key === "Home" ? (C.preventDefault(), Xe(na, !0)) : C.key === "End" && (C.preventDefault(), Xe(_e(), !0));
23676
23678
  }
23677
23679
  async function de(C = !1) {
23678
- const D = Q.value;
23679
- if (!D || D.status !== "active") {
23680
+ const M = Q.value;
23681
+ if (!M || M.status !== "active") {
23680
23682
  e.workspaceState = null, e.checkpoints = [];
23681
23683
  return;
23682
23684
  }
23683
23685
  await Promise.all([
23684
- e.refreshWorkspaceState(D.id, C).catch(() => {
23686
+ e.refreshWorkspaceState(M.id, C).catch(() => {
23685
23687
  }),
23686
- W.value ? e.refreshCheckpoints(D.id).catch(() => {
23688
+ W.value ? e.refreshCheckpoints(M.id).catch(() => {
23687
23689
  }) : Promise.resolve()
23688
23690
  ]);
23689
23691
  }
23690
23692
  async function xe() {
23691
23693
  var tt;
23692
23694
  if (m) return;
23693
- const C = ++_, D = () => !m && C === _;
23695
+ const C = ++_, M = () => !m && C === _;
23694
23696
  te.value = !1, e.syncBusiness(), ie.value = null;
23695
23697
  try {
23696
23698
  await e.refreshProject();
@@ -23698,7 +23700,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23698
23700
  ie.value = rt(ot);
23699
23701
  return;
23700
23702
  }
23701
- if (!D()) return;
23703
+ if (!M()) return;
23702
23704
  if (!e.isProvisioned) {
23703
23705
  if (e.sessions = [], e.releases = [], a.query.setup === "1" && ((tt = e.project) != null && tt.appTemplate)) {
23704
23706
  const { setup: ot, ...Qe } = a.query;
@@ -23713,14 +23715,14 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23713
23715
  }
23714
23716
  if (await e.refreshSessions().catch((ot) => {
23715
23717
  e.statusText = rt(ot);
23716
- }), !D() || (await e.refreshReleases().catch(() => {
23717
- }), !D())) return;
23718
+ }), !M() || (await e.refreshReleases().catch(() => {
23719
+ }), !M())) return;
23718
23720
  if (E.value) {
23719
23721
  if (await t.init({
23720
23722
  businessId: e.businessId,
23721
23723
  projectId: e.projectId,
23722
23724
  sessionId: E.value.id
23723
- }), !D()) return;
23725
+ }), !M()) return;
23724
23726
  await de().catch(() => {
23725
23727
  });
23726
23728
  return;
@@ -23755,8 +23757,8 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23755
23757
  ), gt(
23756
23758
  () => e.project,
23757
23759
  (C) => {
23758
- var D;
23759
- C && ((D = i.context.value) == null ? void 0 : D.projectId) === e.projectId && (i.context.value.project = C);
23760
+ var M;
23761
+ C && ((M = i.context.value) == null ? void 0 : M.projectId) === e.projectId && (i.context.value.project = C);
23760
23762
  }
23761
23763
  ), gt(
23762
23764
  () => t.checkpointRevision,
@@ -23771,20 +23773,20 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23771
23773
  );
23772
23774
  async function De(C = "save") {
23773
23775
  if (!e.isProvisioned) return;
23774
- const D = await e.createSession({ archiveCodeAction: C });
23775
- fe("workspace"), q.value = !1, te.value = !1, await t.init({ businessId: e.businessId, projectId: e.projectId, sessionId: D.sessionId }), await de().catch(() => {
23776
+ const M = await e.createSession({ archiveCodeAction: C });
23777
+ fe("workspace"), q.value = !1, te.value = !1, await t.init({ businessId: e.businessId, projectId: e.projectId, sessionId: M.sessionId }), await de().catch(() => {
23776
23778
  });
23777
23779
  }
23778
23780
  const Ve = V(null), We = V(!1), mt = V(null);
23779
23781
  async function en() {
23780
- var C, D;
23782
+ var C, M;
23781
23783
  if (!(!Qa() || (C = e.project) != null && C.appTemplate)) {
23782
23784
  We.value = !0, mt.value = null;
23783
23785
  try {
23784
23786
  const Se = await e.loadAppTemplates();
23785
23787
  if (!Se.length) throw new Error("No app templates are available for this environment.");
23786
23788
  if (Ve.value) return;
23787
- Ve.value = ((D = Se.find((tt) => tt.default) ?? Se[0]) == null ? void 0 : D.id) ?? null;
23789
+ Ve.value = ((M = Se.find((tt) => tt.default) ?? Se[0]) == null ? void 0 : M.id) ?? null;
23788
23790
  } catch (Se) {
23789
23791
  mt.value = rt(Se);
23790
23792
  } finally {
@@ -23854,7 +23856,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23854
23856
  const C = E.value;
23855
23857
  if (!C || !dt.value || Nt.value) return;
23856
23858
  Nt.value = !0;
23857
- let D = !0;
23859
+ let M = !0;
23858
23860
  r.open({
23859
23861
  title: "Preparing your release",
23860
23862
  message: "We’re saving your latest changes and starting a release build. You can continue editing while it builds. View Releases to track progress, preview the result, and set it live when ready.",
@@ -23863,13 +23865,13 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23863
23865
  primaryActions: { close: !0, text: "View releases" },
23864
23866
  tertiaryActions: { close: !0, text: "Continue editing" }
23865
23867
  }).onPrimary(() => fe("releases")).onClose(() => {
23866
- D = !1;
23868
+ M = !1;
23867
23869
  });
23868
23870
  try {
23869
23871
  const { checkpoint: Se } = await e.commitSession(C.id);
23870
23872
  await e.createRelease(Se.id, C.id);
23871
23873
  } catch (Se) {
23872
- D && r.close(), r.open({
23874
+ M && r.close(), r.open({
23873
23875
  title: "Could not start release build",
23874
23876
  message: rt(Se),
23875
23877
  overlay: !0,
@@ -23896,10 +23898,10 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23896
23898
  });
23897
23899
  try {
23898
23900
  await e.createReleaseFromMain();
23899
- } catch (D) {
23901
+ } catch (M) {
23900
23902
  C && r.close(), r.open({
23901
23903
  title: "Could not start release build",
23902
- message: rt(D),
23904
+ message: rt(M),
23903
23905
  overlay: !0,
23904
23906
  primaryActions: { close: !0, text: "Close" }
23905
23907
  });
@@ -23913,7 +23915,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23913
23915
  if (!(!C || !K.value || It.value)) {
23914
23916
  It.value = !0;
23915
23917
  try {
23916
- const { checkpoint: D } = await e.commitSession(C.id);
23918
+ const { checkpoint: M } = await e.commitSession(C.id);
23917
23919
  r.open({
23918
23920
  title: "Publish as template",
23919
23921
  dialogComponent: W_,
@@ -23921,14 +23923,14 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23921
23923
  businessId: e.businessId,
23922
23924
  projectId: e.projectId,
23923
23925
  sessionId: C.id,
23924
- checkpointId: D.id,
23926
+ checkpointId: M.id,
23925
23927
  onClose: () => r.close()
23926
23928
  }
23927
23929
  });
23928
- } catch (D) {
23930
+ } catch (M) {
23929
23931
  r.open({
23930
23932
  title: "Could not prepare publish as template",
23931
- message: rt(D),
23933
+ message: rt(M),
23932
23934
  overlay: !0,
23933
23935
  primaryActions: { close: !0, text: "Close" }
23934
23936
  });
@@ -23973,15 +23975,15 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
23973
23975
  return C.context_status === "snapshotted" ? "Context saved" : C.context_status === "failed" ? "Context backup failed" : C.context_status === "unavailable" ? "Code only" : "Context pending";
23974
23976
  }
23975
23977
  function wn(C) {
23976
- const D = Q.value;
23977
- !D || D.status !== "active" || r.open({
23978
+ const M = Q.value;
23979
+ !M || M.status !== "active" || r.open({
23978
23980
  title: "Restore this checkpoint?",
23979
23981
  message: `The current workspace will be saved first, then checkpoint ${C.id} will be restored as a new commit on main. Published releases are not changed.`,
23980
23982
  dismissAway: !0,
23981
23983
  primaryActions: { close: !0, text: "Save & restore" },
23982
23984
  secondaryActions: { close: !0, text: "Cancel" }
23983
23985
  }).onPrimary(() => {
23984
- (async () => (await e.restoreCheckpoint(D.id, C.id), await t.init({ businessId: e.businessId, projectId: e.projectId, sessionId: D.id }), await de()))();
23986
+ (async () => (await e.restoreCheckpoint(M.id, C.id), await t.init({ businessId: e.businessId, projectId: e.projectId, sessionId: M.id }), await de()))();
23985
23987
  });
23986
23988
  }
23987
23989
  function _n() {
@@ -24018,7 +24020,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24018
24020
  });
24019
24021
  return;
24020
24022
  }
24021
- const D = ((ot = i.context.value) == null ? void 0 : ot.mode) === "v2" ? i.context.value.project : null, Se = D && D.projectId !== e.projectId ? `This will replace “${D.name}” with “${(Qe = e.project) == null ? void 0 : Qe.name}” at your live Mobile address. ` : "", tt = C.status === "rolled_back";
24023
+ const M = ((ot = i.context.value) == null ? void 0 : ot.mode) === "v2" ? i.context.value.project : null, Se = M && M.projectId !== e.projectId ? `This will replace “${M.name}” with “${(Qe = e.project) == null ? void 0 : Qe.name}” at your live Mobile address. ` : "", tt = C.status === "rolled_back";
24022
24024
  r.open({
24023
24025
  title: tt ? "Restore this previous release?" : "Publish this release?",
24024
24026
  message: Se + (tt ? `Release ${C.id} will immediately replace the current live release. Workspace code is not changed.` : `Release ${C.id} will go live on the merchant's public domain and immediately replace what customers currently see.`),
@@ -24052,8 +24054,8 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24052
24054
  }
24053
24055
  async function ln(C) {
24054
24056
  await Et(C), C.status === "rolled_back" ? await e.rollbackToRelease(C.id) : await e.publish(C.id);
24055
- const D = await at(Ze.portalContext(e.businessId));
24056
- i.context.value = D;
24057
+ const M = await at(Ze.portalContext(e.businessId));
24058
+ i.context.value = M;
24057
24059
  }
24058
24060
  function pn(C) {
24059
24061
  return C.status === "rolled_back" ? "Restore live" : "Set live";
@@ -24076,14 +24078,14 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24076
24078
  C && (await e.resumeSession(C), q.value = !1, te.value = !1, await t.init({ businessId: e.businessId, projectId: e.projectId, sessionId: C }), await de().catch(() => {
24077
24079
  }));
24078
24080
  }
24079
- function M(C) {
24081
+ function D(C) {
24080
24082
  P.value = !1, r.open({
24081
24083
  title: "Rename session",
24082
24084
  dialogComponent: K_,
24083
24085
  dialogComponentProps: {
24084
24086
  initialTitle: C.title,
24085
- onSubmit: (D) => {
24086
- r.close(), D !== C.title && e.renameSession(C.id, D).catch(() => {
24087
+ onSubmit: (M) => {
24088
+ r.close(), M !== C.title && e.renameSession(C.id, M).catch(() => {
24087
24089
  });
24088
24090
  },
24089
24091
  onClose: () => r.close()
@@ -24104,8 +24106,8 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24104
24106
  }
24105
24107
  await e.refreshSessions().catch(() => {
24106
24108
  });
24107
- const D = e.sessions.find((Se) => Se.id === C);
24108
- te.value = !1, D && D.status !== "active" ? (q.value = !0, await t.init({
24109
+ const M = e.sessions.find((Se) => Se.id === C);
24110
+ te.value = !1, M && M.status !== "active" ? (q.value = !0, await t.init({
24109
24111
  businessId: e.businessId,
24110
24112
  projectId: e.projectId,
24111
24113
  sessionId: C,
@@ -24129,15 +24131,15 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24129
24131
  () => t.disconnected,
24130
24132
  async (C) => {
24131
24133
  if (!C || t.readOnly) return;
24132
- const D = t.workspaceSessionId;
24133
- if (!D) return;
24134
+ const M = t.workspaceSessionId;
24135
+ if (!M) return;
24134
24136
  await e.refreshSessions().catch(() => {
24135
24137
  });
24136
- const Se = e.sessions.find((tt) => tt.id === D);
24138
+ const Se = e.sessions.find((tt) => tt.id === M);
24137
24139
  Se && Se.status !== "active" && (q.value = !0, await t.init({
24138
24140
  businessId: e.businessId,
24139
24141
  projectId: e.projectId,
24140
- sessionId: D,
24142
+ sessionId: M,
24141
24143
  readOnly: !0
24142
24144
  }));
24143
24145
  }
@@ -24150,13 +24152,13 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24150
24152
  }
24151
24153
  function qe(C) {
24152
24154
  var tt;
24153
- const D = (tt = C.title) == null ? void 0 : tt.trim(), Se = D == null ? void 0 : D.match(/^New session - (\d{4}-\d{2}-\d{2}T[\d:.]+Z)$/);
24155
+ const M = (tt = C.title) == null ? void 0 : tt.trim(), Se = M == null ? void 0 : M.match(/^New session - (\d{4}-\d{2}-\d{2}T[\d:.]+Z)$/);
24154
24156
  if (Se) {
24155
24157
  const ot = new Date(Se[1]);
24156
24158
  if (!Number.isNaN(ot.getTime()))
24157
24159
  return `Session · ${new Intl.DateTimeFormat("en", { month: "short", day: "numeric" }).format(ot)}`;
24158
24160
  }
24159
- return D || Be(C);
24161
+ return M || Be(C);
24160
24162
  }
24161
24163
  const lt = j(
24162
24164
  () => {
@@ -24173,15 +24175,15 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24173
24175
  });
24174
24176
  function Rt(C) {
24175
24177
  if (!C) return "No timestamp";
24176
- const D = new Date(C);
24177
- return Number.isNaN(D.getTime()) ? "No timestamp" : new Intl.DateTimeFormat(void 0, {
24178
+ const M = new Date(C);
24179
+ return Number.isNaN(M.getTime()) ? "No timestamp" : new Intl.DateTimeFormat(void 0, {
24178
24180
  month: "short",
24179
24181
  day: "numeric",
24180
24182
  hour: "2-digit",
24181
24183
  minute: "2-digit"
24182
- }).format(D);
24184
+ }).format(M);
24183
24185
  }
24184
- return (C, D) => {
24186
+ return (C, M) => {
24185
24187
  var Gt, Ln, On, on, En, w, x, Y, ye;
24186
24188
  const Se = Me("RouterLink"), tt = Me("FmIcon"), ot = Me("FmCircularProgress"), Qe = Me("FmButton");
24187
24189
  return p(), b("div", {
@@ -24190,7 +24192,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24190
24192
  A(e).isProvisioned ? (p(), b("div", {
24191
24193
  key: 0,
24192
24194
  class: "workspace__toolbar",
24193
- onKeydown: D[5] || (D[5] = Dl((F) => P.value = !1, ["esc"]))
24195
+ onKeydown: M[5] || (M[5] = Dl((F) => P.value = !1, ["esc"]))
24194
24196
  }, [
24195
24197
  d("div", aS, [
24196
24198
  d("nav", sS, [
@@ -24198,12 +24200,12 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24198
24200
  class: "workspace__breadcrumb-link",
24199
24201
  to: { name: "miniprogram-v2-mobile-projects", query: A(a).query }
24200
24202
  }, {
24201
- default: et(() => [...D[12] || (D[12] = [
24203
+ default: et(() => [...M[12] || (M[12] = [
24202
24204
  Ke("Mobile", -1)
24203
24205
  ])]),
24204
24206
  _: 1
24205
24207
  }, 8, ["to"]),
24206
- D[13] || (D[13] = d("span", { "aria-hidden": "true" }, "/", -1)),
24208
+ M[13] || (M[13] = d("span", { "aria-hidden": "true" }, "/", -1)),
24207
24209
  l.value === "releases" ? (p(), Ee(Se, {
24208
24210
  key: 0,
24209
24211
  class: "workspace__breadcrumb-name workspace__breadcrumb-link",
@@ -24221,7 +24223,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24221
24223
  label: pe.value,
24222
24224
  title: L.value
24223
24225
  }, null, 8, ["business-id", "project-id", "label", "title"])),
24224
- D[14] || (D[14] = d("span", { "aria-hidden": "true" }, "/", -1)),
24226
+ M[14] || (M[14] = d("span", { "aria-hidden": "true" }, "/", -1)),
24225
24227
  l.value === "releases" ? (p(), b("span", iS, "Releases")) : U("", !0)
24226
24228
  ]),
24227
24229
  l.value === "workspace" ? (p(), b("div", lS, [
@@ -24232,7 +24234,7 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24232
24234
  "aria-label": "Session menu",
24233
24235
  "aria-expanded": P.value,
24234
24236
  "aria-controls": "workspace-session-menu",
24235
- onClick: D[0] || (D[0] = (F) => P.value = !P.value)
24237
+ onClick: M[0] || (M[0] = (F) => P.value = !P.value)
24236
24238
  }, [
24237
24239
  d("span", cS, $(Ae.value), 1),
24238
24240
  Q.value && Q.value.status !== "active" ? (p(), Ee(Nn, {
@@ -24253,11 +24255,11 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24253
24255
  P.value ? (p(), b(Ce, { key: 0 }, [
24254
24256
  d("div", {
24255
24257
  class: "fixed inset-0 z-10",
24256
- onClick: D[1] || (D[1] = (F) => P.value = !1)
24258
+ onClick: M[1] || (M[1] = (F) => P.value = !1)
24257
24259
  }),
24258
24260
  d("div", uS, [
24259
24261
  d("div", dS, [
24260
- D[15] || (D[15] = Ke("Sessions ", -1)),
24262
+ M[15] || (M[15] = Ke("Sessions ", -1)),
24261
24263
  d("span", null, $(A(e).sessions.length), 1)
24262
24264
  ]),
24263
24265
  d("div", pS, [
@@ -24304,32 +24306,32 @@ ${e.projectId}`), T = j(() => e.releases.find((C) => C.status === "draft" || C.s
24304
24306
  name: "add",
24305
24307
  size: "sm"
24306
24308
  })),
24307
- D[16] || (D[16] = d("span", null, "New session", -1))
24309
+ M[16] || (M[16] = d("span", null, "New session", -1))
24308
24310
  ], 8, SS),
24309
24311
  Q.value ? (p(), b("button", {
24310
24312
  key: 0,
24311
24313
  type: "button",
24312
24314
  class: "workspace__menu-action",
24313
- onClick: D[2] || (D[2] = (F) => M(Q.value))
24315
+ onClick: M[2] || (M[2] = (F) => D(Q.value))
24314
24316
  }, [
24315
24317
  X(tt, {
24316
24318
  name: "edit",
24317
24319
  size: "sm"
24318
24320
  }),
24319
- D[17] || (D[17] = d("span", null, "Rename session", -1))
24321
+ M[17] || (M[17] = d("span", null, "Rename session", -1))
24320
24322
  ])) : U("", !0),
24321
24323
  Q.value && Q.value.status !== "active" ? (p(), b("button", {
24322
24324
  key: 1,
24323
24325
  type: "button",
24324
24326
  class: "workspace__menu-action",
24325
24327
  disabled: A(e).busy,
24326
- onClick: D[3] || (D[3] = (F) => it(Q.value))
24328
+ onClick: M[3] || (M[3] = (F) => it(Q.value))
24327
24329
  }, [
24328
24330
  X(tt, {
24329
24331
  name: "restart_alt",
24330
24332
  size: "sm"
24331
24333
  }),
24332
- D[18] || (D[18] = d("span", null, "Resume session", -1))
24334
+ M[18] || (M[18] = d("span", null, "Resume session", -1))
24333
24335
  ], 8, TS)) : U("", !0)
24334
24336
  ])
24335
24337
  ])
@@ -24390,7 +24392,7 @@ ${G.value}`,
24390
24392
  X(Qe, {
24391
24393
  label: "View releases",
24392
24394
  variant: "secondary",
24393
- onClick: D[4] || (D[4] = (F) => fe("releases"))
24395
+ onClick: M[4] || (M[4] = (F) => fe("releases"))
24394
24396
  }),
24395
24397
  K.value ? (p(), Ee(Qe, {
24396
24398
  key: 0,
@@ -24426,7 +24428,7 @@ ${G.value}`,
24426
24428
  ]))
24427
24429
  ], 32)) : U("", !0),
24428
24430
  ie.value ? (p(), b("section", NS, [
24429
- D[20] || (D[20] = d("h1", null, "Could not open project", -1)),
24431
+ M[20] || (M[20] = d("h1", null, "Could not open project", -1)),
24430
24432
  d("p", null, $(ie.value), 1),
24431
24433
  X(Qe, {
24432
24434
  label: "Retry",
@@ -24436,7 +24438,7 @@ ${G.value}`,
24436
24438
  X(Se, {
24437
24439
  to: { name: "miniprogram-v2-mobile-projects", query: A(a).query }
24438
24440
  }, {
24439
- default: et(() => [...D[19] || (D[19] = [
24441
+ default: et(() => [...M[19] || (M[19] = [
24440
24442
  Ke("Back to Mobile projects", -1)
24441
24443
  ])]),
24442
24444
  _: 1
@@ -24444,7 +24446,7 @@ ${G.value}`,
24444
24446
  ])) : A(e).isProvisioned ? l.value === "workspace" ? (p(), b("main", GS, [
24445
24447
  W.value && Q.value ? (p(), b("section", KS, [
24446
24448
  d("div", JS, [
24447
- D[22] || (D[22] = d("div", { class: "min-w-0" }, [
24449
+ M[22] || (M[22] = d("div", { class: "min-w-0" }, [
24448
24450
  d("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-primary" }, "Checkpoint history"),
24449
24451
  d("p", { class: "m-0 mt-2 fm-typo-en-body-xs-400 text-portal-text-muted" }, " Code and agent context are tracked separately. Restoring code creates a new commit on main. ")
24450
24452
  ], -1)),
@@ -24452,7 +24454,7 @@ ${G.value}`,
24452
24454
  icon: "refresh",
24453
24455
  variant: "tertiary",
24454
24456
  loading: A(e).checkpointBusy,
24455
- onClick: D[7] || (D[7] = (F) => de(!0))
24457
+ onClick: M[7] || (M[7] = (F) => de(!0))
24456
24458
  }, null, 8, ["loading"])
24457
24459
  ]),
24458
24460
  (w = A(e).workspaceState) != null && w.checkpointError || A(t).checkpointError ? (p(), b("div", ZS, $(((x = A(e).workspaceState) == null ? void 0 : x.checkpointError) || A(t).checkpointError), 1)) : U("", !0),
@@ -24515,12 +24517,12 @@ ${G.value}`,
24515
24517
  d("button", {
24516
24518
  type: "button",
24517
24519
  "aria-pressed": o.value === "chat",
24518
- onClick: D[8] || (D[8] = (F) => o.value = "chat")
24520
+ onClick: M[8] || (M[8] = (F) => o.value = "chat")
24519
24521
  }, "Remy chat", 8, dT),
24520
24522
  d("button", {
24521
24523
  type: "button",
24522
24524
  "aria-pressed": o.value === "preview",
24523
- onClick: D[9] || (D[9] = (F) => o.value = "preview")
24525
+ onClick: M[9] || (M[9] = (F) => o.value = "preview")
24524
24526
  }, "Preview", 8, pT)
24525
24527
  ]),
24526
24528
  d("div", {
@@ -24537,8 +24539,8 @@ ${G.value}`,
24537
24539
  size: "xl",
24538
24540
  color: "typo-secondary"
24539
24541
  }),
24540
- D[23] || (D[23] = d("p", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Session paused", -1)),
24541
- D[24] || (D[24] = d("p", { class: "m-0 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Paused after 30 minutes of inactivity to free up workspace resources. The control plane is finishing a checkpoint; use the save status above to confirm GitHub and agent-context durability. ", -1)),
24542
+ M[23] || (M[23] = d("p", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Session paused", -1)),
24543
+ M[24] || (M[24] = d("p", { class: "m-0 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Paused after 30 minutes of inactivity to free up workspace resources. The control plane is finishing a checkpoint; use the save status above to confirm GitHub and agent-context durability. ", -1)),
24542
24544
  X(Qe, {
24543
24545
  label: "Continue working",
24544
24546
  icon: "play_arrow",
@@ -24584,7 +24586,7 @@ ${G.value}`,
24584
24586
  title: "Resize workspace preview",
24585
24587
  onPointerdown: bt,
24586
24588
  onKeydown: wt
24587
- }, [...D[25] || (D[25] = [
24589
+ }, [...M[25] || (M[25] = [
24588
24590
  d("span", { class: "w-px bg-portal-bg-canvas transition group-hover:bg-fm-color-primary group-focus-visible:bg-fm-color-primary" }, null, -1),
24589
24591
  d("span", { class: "pointer-events-none absolute inset-y-0 left-1/2 hidden w-[3px] -translate-x-1/2 rounded-full bg-fm-color-primary opacity-20 group-hover:block group-focus-visible:block" }, null, -1)
24590
24592
  ])], 40, bT),
@@ -24596,7 +24598,7 @@ ${G.value}`,
24596
24598
  ])) : l.value === "releases" ? (p(), b("main", vT, [
24597
24599
  d("div", kT, [
24598
24600
  d("div", wT, [
24599
- D[26] || (D[26] = d("h1", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Releases", -1)),
24601
+ M[26] || (M[26] = d("h1", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Releases", -1)),
24600
24602
  d("div", _T, [
24601
24603
  X(Qe, {
24602
24604
  label: "Build release",
@@ -24610,18 +24612,18 @@ ${G.value}`,
24610
24612
  label: "Back to editor",
24611
24613
  icon: "arrow_back",
24612
24614
  variant: "tertiary",
24613
- onClick: D[10] || (D[10] = (F) => fe("workspace"))
24615
+ onClick: M[10] || (M[10] = (F) => fe("workspace"))
24614
24616
  })
24615
24617
  ])
24616
24618
  ]),
24617
- D[37] || (D[37] = d("p", { class: "m-0 fm-typo-en-body-sm-400 text-portal-text-muted" }, "Build from the latest saved main branch, preview the release, then publish it when ready. Unsaved workspace edits are not included; use Publish in the editor to save the active session first.", -1)),
24619
+ M[37] || (M[37] = d("p", { class: "m-0 fm-typo-en-body-sm-400 text-portal-text-muted" }, "Build from the latest saved main branch, preview the release, then publish it when ready. Unsaved workspace edits are not included; use Publish in the editor to save the active session first.", -1)),
24618
24620
  d("section", xT, [
24619
24621
  d("div", ST, [
24620
- D[29] || (D[29] = d("h3", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Current live version", -1)),
24622
+ M[29] || (M[29] = d("h3", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Current live version", -1)),
24621
24623
  me.value ? (p(), b(Ce, { key: 0 }, [
24622
24624
  d("div", TT, [
24623
24625
  X(Nn, { variant: "success" }, {
24624
- default: et(() => [...D[27] || (D[27] = [
24626
+ default: et(() => [...M[27] || (M[27] = [
24625
24627
  Ke("Live", -1)
24626
24628
  ])]),
24627
24629
  _: 1
@@ -24636,7 +24638,7 @@ ${G.value}`,
24636
24638
  class: "portal-link-button"
24637
24639
  }, "Open live app ↗", 8, CT),
24638
24640
  d("details", IT, [
24639
- D[28] || (D[28] = d("summary", null, "Version details", -1)),
24641
+ M[28] || (M[28] = d("summary", null, "Version details", -1)),
24640
24642
  d("p", null, "Release: " + $(me.value.id), 1),
24641
24643
  d("p", null, "Commit: " + $(me.value.source_commit_sha), 1)
24642
24644
  ])
@@ -24644,7 +24646,7 @@ ${G.value}`,
24644
24646
  ])
24645
24647
  ]),
24646
24648
  d("section", RT, [
24647
- D[31] || (D[31] = d("div", { class: "border-b border-portal-border-default px-16 py-12" }, [
24649
+ M[31] || (M[31] = d("div", { class: "border-b border-portal-border-default px-16 py-12" }, [
24648
24650
  d("h3", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Next release")
24649
24651
  ], -1)),
24650
24652
  d("div", PT, [
@@ -24682,7 +24684,7 @@ ${G.value}`,
24682
24684
  }, null, 8, ["disabled"])
24683
24685
  ])) : U("", !0),
24684
24686
  T.value ? (p(), b("details", BT, [
24685
- D[30] || (D[30] = d("summary", null, "Version details & build logs", -1)),
24687
+ M[30] || (M[30] = d("summary", null, "Version details & build logs", -1)),
24686
24688
  d("p", null, "Release: " + $(T.value.id), 1),
24687
24689
  d("p", null, "Commit: " + $(T.value.source_commit_sha), 1),
24688
24690
  ne.value ? (p(), Ee(Qe, {
@@ -24706,14 +24708,14 @@ ${G.value}`,
24706
24708
  ]),
24707
24709
  d("section", qT, [
24708
24710
  d("div", FT, [
24709
- D[32] || (D[32] = d("h3", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Recent releases", -1)),
24711
+ M[32] || (M[32] = d("h3", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Recent releases", -1)),
24710
24712
  d("div", zT, [
24711
24713
  X(Qe, {
24712
24714
  label: "Refresh",
24713
24715
  icon: "refresh",
24714
24716
  variant: "tertiary",
24715
24717
  loading: A(e).busy,
24716
- onClick: D[11] || (D[11] = (F) => A(e).refreshReleases())
24718
+ onClick: M[11] || (M[11] = (F) => A(e).refreshReleases())
24717
24719
  }, null, 8, ["loading"])
24718
24720
  ])
24719
24721
  ]),
@@ -24723,8 +24725,8 @@ ${G.value}`,
24723
24725
  size: "xl",
24724
24726
  color: "neutral-gray-300"
24725
24727
  }),
24726
- D[33] || (D[33] = d("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-muted" }, "No releases yet", -1)),
24727
- D[34] || (D[34] = d("p", { class: "m-0 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Build from the latest saved main branch to create a release you can preview and publish. Unsaved workspace edits are not included. ", -1))
24728
+ M[33] || (M[33] = d("p", { class: "m-0 fm-typo-en-body-md-600 text-portal-text-muted" }, "No releases yet", -1)),
24729
+ M[34] || (M[34] = d("p", { class: "m-0 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Build from the latest saved main branch to create a release you can preview and publish. Unsaved workspace edits are not included. ", -1))
24728
24730
  ])) : (p(), b("div", VT, [
24729
24731
  (p(!0), b(Ce, null, Fe(A(e).releases, (F) => (p(), b("div", {
24730
24732
  key: F.id,
@@ -24759,7 +24761,7 @@ ${G.value}`,
24759
24761
  ])
24760
24762
  ], 8, WT),
24761
24763
  d("details", ZT, [
24762
- D[35] || (D[35] = d("summary", null, "Details", -1)),
24764
+ M[35] || (M[35] = d("summary", null, "Details", -1)),
24763
24765
  d("p", null, "Release: " + $(F.id), 1),
24764
24766
  d("p", null, "Commit: " + $(F.source_commit_sha), 1),
24765
24767
  F.build_logs_url ? (p(), Ee(Qe, {
@@ -24789,7 +24791,7 @@ ${G.value}`,
24789
24791
  ]),
24790
24792
  d("section", XT, [
24791
24793
  d("div", QT, [
24792
- D[36] || (D[36] = d("div", { class: "min-w-0" }, [
24794
+ M[36] || (M[36] = d("div", { class: "min-w-0" }, [
24793
24795
  d("h3", { class: "m-0 fm-typo-en-body-lg-600 text-portal-text-primary" }, "Fallback"),
24794
24796
  d("p", { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Restore the merchant back to the current v1 miniprogram. ")
24795
24797
  ], -1)),
@@ -24808,7 +24810,7 @@ ${G.value}`,
24808
24810
  d("header", MS, [
24809
24811
  d("div", LS, [
24810
24812
  d("h2", BS, "Set up " + $(((Gt = A(e).project) == null ? void 0 : Gt.name) || "Mobile project"), 1),
24811
- D[21] || (D[21] = d("p", { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Prepare your app and its editing workspace. Your live app stays as it is. ", -1))
24813
+ M[21] || (M[21] = d("p", { class: "m-0 mt-4 fm-typo-en-body-sm-400 text-portal-text-muted" }, " Prepare your app and its editing workspace. Your live app stays as it is. ", -1))
24812
24814
  ]),
24813
24815
  X(Qe, {
24814
24816
  icon: "source",
@@ -24842,7 +24844,7 @@ ${G.value}`,
24842
24844
  A(Qa)() && !((En = A(e).project) != null && En.appTemplate) ? (p(), Ee(Xc, {
24843
24845
  key: 0,
24844
24846
  modelValue: Ve.value,
24845
- "onUpdate:modelValue": D[6] || (D[6] = (F) => Ve.value = F),
24847
+ "onUpdate:modelValue": M[6] || (M[6] = (F) => Ve.value = F),
24846
24848
  templates: A(e).appTemplates,
24847
24849
  disabled: A(e).busy || We.value
24848
24850
  }, null, 8, ["modelValue", "templates", "disabled"])) : U("", !0),
@@ -24852,7 +24854,7 @@ ${G.value}`,
24852
24854
  ], 2);
24853
24855
  };
24854
24856
  }
24855
- }), WE = /* @__PURE__ */ Bt(rE, [["__scopeId", "data-v-b243a7c9"]]);
24857
+ }), WE = /* @__PURE__ */ Bt(rE, [["__scopeId", "data-v-4f55ecb3"]]);
24856
24858
  export {
24857
24859
  WE as default
24858
24860
  };