@chaibuilder/sdk 4.0.0-beta.49 → 4.0.0-beta.50

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 (79) hide show
  1. package/README.md +0 -5
  2. package/dist/{2SSKDMRQ-CjvuNdPo.cjs → 2SSKDMRQ-DRvGNTLs.cjs} +1 -1
  3. package/dist/{2SSKDMRQ-Dvf9zadl.js → 2SSKDMRQ-DqIyZppU.js} +2 -2
  4. package/dist/{AP7HFJJL-DYFttFoI.cjs → AP7HFJJL-BWwvxG86.cjs} +1 -1
  5. package/dist/{AP7HFJJL-q4dJdyFs.js → AP7HFJJL-DlUIW-7z.js} +1 -1
  6. package/dist/{WDYDFRGG-BEksfGMC.cjs → WDYDFRGG-N7kNyI7H.cjs} +1 -1
  7. package/dist/{WDYDFRGG-O9GIrtX0.js → WDYDFRGG-SsaVMSIa.js} +2 -2
  8. package/dist/{active-in-another-tab-B4Ur0JP7.js → active-in-another-tab-3S4Tzg0v.js} +1 -1
  9. package/dist/{active-in-another-tab-BPdx4lWh.cjs → active-in-another-tab-C83x4jHw.cjs} +1 -1
  10. package/dist/{add-new-language-page-CRR93tLq.js → add-new-language-page-BnPnQ-3A.js} +1 -1
  11. package/dist/{add-new-language-page-BfUp5Ua2.cjs → add-new-language-page-QIaeQ_fJ.cjs} +1 -1
  12. package/dist/{add-new-page-B8NGK6WS.cjs → add-new-page-Ddoy3kTu.cjs} +1 -1
  13. package/dist/{add-new-page-Ppy5-y5j.js → add-new-page-aLHfIIHC.js} +1 -1
  14. package/dist/{ai-panel-default-lang-BXYQye3N.js → ai-panel-default-lang-BOCTOIH_.js} +3 -3
  15. package/dist/{ai-panel-default-lang-VhgmHFoQ.cjs → ai-panel-default-lang-FNeOfRkj.cjs} +2 -2
  16. package/dist/{ai-panel-other-lang-DaCf-cq4.js → ai-panel-other-lang-C2j7qGZx.js} +3 -3
  17. package/dist/{ai-panel-other-lang-Ds0EXeUC.cjs → ai-panel-other-lang-DgRzCQGx.cjs} +1 -1
  18. package/dist/{ai-prompt-input-nZ5_Dm7X.cjs → ai-prompt-input-SJnya_UU.cjs} +1 -1
  19. package/dist/{ai-prompt-input-7iWk72w5.js → ai-prompt-input-p5KHwgCW.js} +1 -1
  20. package/dist/{ai-translation-prompt-1OUs1P7n.js → ai-translation-prompt-BTEXWPQq.js} +1 -1
  21. package/dist/{ai-translation-prompt-B16cK-1Q.cjs → ai-translation-prompt-Dhh-bNJr.cjs} +1 -1
  22. package/dist/{change-password-modal-CdvJR1Ln.js → change-password-modal-BkBFwrxi.js} +1 -1
  23. package/dist/{change-password-modal-D5eXjiYq.cjs → change-password-modal-BwBRdCeD.cjs} +1 -1
  24. package/dist/{continue-editing-in-this-client-BrSvK-Ay.js → continue-editing-in-this-client-DTmWmAee.js} +1 -1
  25. package/dist/{continue-editing-in-this-client-Cmi-GkYZ.cjs → continue-editing-in-this-client-DgtsPYZ4.cjs} +1 -1
  26. package/dist/{delete-page-DLohaU-U.cjs → delete-page-BNZclrjF.cjs} +1 -1
  27. package/dist/{delete-page-C99K2qzS.js → delete-page-BYh290jY.js} +1 -1
  28. package/dist/{digital-asset-manager-BZMb6sC7.js → digital-asset-manager-BINMP8H4.js} +1 -1
  29. package/dist/{digital-asset-manager-Z5aJxkq0.cjs → digital-asset-manager-DnNRvKt8.cjs} +1 -1
  30. package/dist/{duplicate-page-CDc2X0eW.js → duplicate-page-B_j9rgxU.js} +1 -1
  31. package/dist/{duplicate-page-D5Gtvqdv.cjs → duplicate-page-DgxKd840.cjs} +1 -1
  32. package/dist/{dynamic-page-selector-DvNBXo6o.js → dynamic-page-selector-B2HE4wRM.js} +1 -1
  33. package/dist/{dynamic-page-selector-DZHhX008.cjs → dynamic-page-selector-CDuWB_Yw.cjs} +1 -1
  34. package/dist/{index-BVwFJWDq.cjs → index-CzBSRTj0.cjs} +3 -3
  35. package/dist/{index-LBTm1Jmk.js → index-nzqILA37.js} +17 -17
  36. package/dist/{json-diff-viewer-Cb1CmRqP.cjs → json-diff-viewer-3C7leKFH.cjs} +1 -1
  37. package/dist/{json-diff-viewer-DG6qMOBS.js → json-diff-viewer-CMw5W_Li.js} +1 -1
  38. package/dist/{lang-panel-DxoJ0v4y.cjs → lang-panel-DIdkbjDj.cjs} +1 -1
  39. package/dist/{lang-panel-B3USOxGq.js → lang-panel-S3dD5t_t.js} +2 -2
  40. package/dist/{mark-as-template-B9yLcasI.cjs → mark-as-template-6kAFYYpY.cjs} +1 -1
  41. package/dist/{mark-as-template-CP_F9ZQ4.js → mark-as-template-BP6ltrws.js} +1 -1
  42. package/dist/{no-language-page-content-C-MCdPXt.cjs → no-language-page-content-HjxRSjI0.cjs} +1 -1
  43. package/dist/{no-language-page-content-D8t5dfgh.js → no-language-page-content-MPJjIXir.js} +1 -1
  44. package/dist/{no-language-page-dialog-D4QIAHnE.cjs → no-language-page-dialog-CoRH5H9v.cjs} +1 -1
  45. package/dist/{no-language-page-dialog-C_fHI2zI.js → no-language-page-dialog-D06JM3cU.js} +2 -2
  46. package/dist/{page-creator-DKEkuGCO.js → page-creator-Cu6i7LZ1.js} +134 -134
  47. package/dist/page-creator-QCmVlpyE.cjs +1 -0
  48. package/dist/{page-lock-DdCvtA-I.cjs → page-lock-D5BkmYCP.cjs} +1 -1
  49. package/dist/{page-lock-CwZKJ4IE.js → page-lock-csXU_vk5.js} +2 -2
  50. package/dist/{page-locked-dialog-CrTDBoC4.cjs → page-locked-dialog-BfmE52P5.cjs} +1 -1
  51. package/dist/{page-locked-dialog-DqLlooUz.js → page-locked-dialog-o9eCXo2g.js} +1 -1
  52. package/dist/{page-manager-new-ttsrxdW9.js → page-manager-new-CwYu8Am_.js} +2 -2
  53. package/dist/{page-manager-new-ah6QYar2.cjs → page-manager-new-KUeOWmce.cjs} +1 -1
  54. package/dist/{page-manager-search-and-filter-D7AupT6_.cjs → page-manager-search-and-filter-BE7w_2hv.cjs} +1 -1
  55. package/dist/{page-manager-search-and-filter-bsqZ6wnI.js → page-manager-search-and-filter-BwxrJZgv.js} +1 -1
  56. package/dist/{page-revisions-content-C5O8_Fms.js → page-revisions-content-DmXFnqRE.js} +2 -2
  57. package/dist/{page-revisions-content-B6hsIla7.cjs → page-revisions-content-qIljNtcN.cjs} +1 -1
  58. package/dist/pages.cjs +1 -1
  59. package/dist/pages.js +1 -1
  60. package/dist/{publish-pages-content-KZVMHT6V.js → publish-pages-content-BmaVd0qz.js} +2 -2
  61. package/dist/{publish-pages-content-BrajJUcP.cjs → publish-pages-content-gMEMzV-_.cjs} +1 -1
  62. package/dist/{save-to-lib-DMnv7ENo.js → save-to-lib-CPqQG37K.js} +1 -1
  63. package/dist/{save-to-lib-Dc700Aop.cjs → save-to-lib-DMPQDhKe.cjs} +1 -1
  64. package/dist/{selected-block-display-CidmQ-wz.js → selected-block-display-C7iOI7Wd.js} +1 -1
  65. package/dist/{selected-block-display-CAFEOrLV.cjs → selected-block-display-CSYAaqzP.cjs} +1 -1
  66. package/dist/{seo-panel-CMY-adM-.cjs → seo-panel-CgDo_uDs.cjs} +1 -1
  67. package/dist/{seo-panel-Br8gxDxu.js → seo-panel-DUVBUbG3.js} +1 -1
  68. package/dist/{shared-json-ld-CMH-eRUq.cjs → shared-json-ld-Clk0cKIp.cjs} +1 -1
  69. package/dist/{shared-json-ld-uvMmwCYp.js → shared-json-ld-nS_mdAYR.js} +1 -1
  70. package/dist/{take-over-request-KdR1_h_K.js → take-over-request-Bjyi22us.js} +1 -1
  71. package/dist/{take-over-request-IRLgF1dG.cjs → take-over-request-GdscXVYh.cjs} +1 -1
  72. package/dist/{unmark-as-template-C5ovsEBP.js → unmark-as-template-BStQtwjr.js} +1 -1
  73. package/dist/{unmark-as-template-F7TdgWjI.cjs → unmark-as-template-D_-Bbbl_.cjs} +1 -1
  74. package/dist/{unpublish-page-CUr8Xub6.cjs → unpublish-page-CGZWa57H.cjs} +1 -1
  75. package/dist/{unpublish-page-0fR1o0b7.js → unpublish-page-Dsqk_IA1.js} +1 -1
  76. package/dist/{web-preview-D9pXonAv.js → web-preview-_TrLPhaZ.js} +1 -1
  77. package/dist/{web-preview-CuMYekVJ.cjs → web-preview-e2NMKzzH.cjs} +1 -1
  78. package/package.json +1 -1
  79. package/dist/page-creator-Cz_ah-qE.cjs +0 -1
@@ -757,7 +757,7 @@ const mt = 10, Ao = 1e3, To = 2, So = 16e3, nr = () => {
757
757
  }), () => {
758
758
  r && n && r.untrack();
759
759
  }), [r, n, t]);
760
- }, bo = M(() => import("./add-new-page-Ppy5-y5j.js")), Io = M(() => import("./delete-page-C99K2qzS.js")), No = M(() => import("./duplicate-page-CDc2X0eW.js")), vo = M(() => import("./mark-as-template-CP_F9ZQ4.js")), Co = M(() => import("./unmark-as-template-C5ovsEBP.js")), Lo = M(() => import("./unpublish-page-0fR1o0b7.js")), Go = () => {
760
+ }, bo = M(() => import("./add-new-page-aLHfIIHC.js")), Io = M(() => import("./delete-page-BYh290jY.js")), No = M(() => import("./duplicate-page-B_j9rgxU.js")), vo = M(() => import("./mark-as-template-BP6ltrws.js")), Co = M(() => import("./unmark-as-template-BStQtwjr.js")), Lo = M(() => import("./unpublish-page-Dsqk_IA1.js")), Go = () => {
761
761
  const [e, t] = N(null), [n, s] = N(null), [r, a] = N(null), [i, l] = N(null), [c, d] = N(null), [f, u] = N(null), { data: g, isFetching: h } = Ge(), { selectedLang: p, fallbackLang: _ } = Se(), { data: I } = yn(), y = I == null ? void 0 : I.find((D) => D.lang === p), { isLocked: A } = Ce(), w = !(g != null && g.slug), F = Xn(nn);
762
762
  if (!g) return null;
763
763
  const V = (D) => {
@@ -1022,7 +1022,7 @@ function Do(e, t, n = !1) {
1022
1022
  const s = e.toString() ? `?${e.toString()}` : "/";
1023
1023
  n ? window.history.replaceState(null, "", s) : window.history.pushState({}, "", s), t(e), window.dispatchEvent(new PopStateEvent("popstate"));
1024
1024
  }
1025
- const xo = M(() => import("./add-new-language-page-CRR93tLq.js")), Oo = () => {
1025
+ const xo = M(() => import("./add-new-language-page-BnPnQ-3A.js")), Oo = () => {
1026
1026
  const e = ye("topLeftCorner", null);
1027
1027
  return e ? /* @__PURE__ */ o("div", { className: "max-h-9 w-full overflow-hidden pr-2", children: wi.createElement(e, {}) }) : null;
1028
1028
  }, Ro = ({
@@ -1154,7 +1154,7 @@ function Bo() {
1154
1154
  /* @__PURE__ */ o(qt, { className: "h-8 w-8 rounded-full" })
1155
1155
  ] }, t)) });
1156
1156
  }
1157
- const Mo = z.lazy(() => import("./page-revisions-content-C5O8_Fms.js"));
1157
+ const Mo = z.lazy(() => import("./page-revisions-content-DmXFnqRE.js"));
1158
1158
  function Fo() {
1159
1159
  const [e, t] = z.useState(!1);
1160
1160
  return /* @__PURE__ */ o(Hs, { children: /* @__PURE__ */ m(hn, { delayDuration: 0, children: [
@@ -1370,7 +1370,7 @@ const Gn = ({
1370
1370
  O.error("Failed to change slug");
1371
1371
  }
1372
1372
  });
1373
- }, Ko = M(() => import("./publish-pages-content-KZVMHT6V.js"));
1373
+ }, Ko = M(() => import("./publish-pages-content-BmaVd0qz.js"));
1374
1374
  function Vo({
1375
1375
  showModal: e = !1,
1376
1376
  onClose: t = () => console.log("Cancelled")
@@ -1457,11 +1457,11 @@ function Ht({
1457
1457
  /* @__PURE__ */ o(mn, { side: n, sideOffset: 10, children: /* @__PURE__ */ o("p", { children: t }) })
1458
1458
  ] }) }) : e;
1459
1459
  }
1460
- const Yo = M(() => import("./unpublish-page-0fR1o0b7.js")), Jo = M(
1460
+ const Yo = M(() => import("./unpublish-page-Dsqk_IA1.js")), Jo = M(
1461
1461
  () => import("./translation-warning-modal-CzNt6LDO.js")
1462
1462
  ), Zo = M(
1463
1463
  () => import("./unpublished-partials-modal-BhNAub_z.js")
1464
- ), Ps = M(() => import("./json-diff-viewer-DG6qMOBS.js")), Xo = () => {
1464
+ ), Ps = M(() => import("./json-diff-viewer-CMw5W_Li.js")), Xo = () => {
1465
1465
  const { t: e } = ue(), { selectedLang: t, fallbackLang: n } = Se(), s = ye("getPreviewUrl", async (g) => g), [r, a] = N(""), { data: i } = fe(), { data: l } = yn(), { data: c } = Ve(), d = j(
1466
1466
  () => {
1467
1467
  var g;
@@ -1738,7 +1738,7 @@ function rl() {
1738
1738
  /* @__PURE__ */ o(sl, {})
1739
1739
  ] });
1740
1740
  }
1741
- const al = M(() => import("./page-manager-new-ttsrxdW9.js")), il = ({ children: e }) => {
1741
+ const al = M(() => import("./page-manager-new-CwYu8Am_.js")), il = ({ children: e }) => {
1742
1742
  const { t } = ue(), [n] = ve(), s = n.get("page"), { data: r, isFetching: a } = fe(), { data: i, isFetching: l } = Ke(), [c, d] = N(!1), [f, u] = N(!0), { savePage: g } = Me(), h = !!s && !Ee(r), { isLocked: p } = Ce();
1743
1743
  J(() => {
1744
1744
  !l && i && u(!1);
@@ -1791,7 +1791,7 @@ const al = M(() => import("./page-manager-new-ttsrxdW9.js")), il = ({ children:
1791
1791
  }
1792
1792
  ) })
1793
1793
  ] });
1794
- }, ol = M(() => import("./dynamic-page-selector-DvNBXo6o.js")), ll = () => {
1794
+ }, ol = M(() => import("./dynamic-page-selector-B2HE4wRM.js")), ll = () => {
1795
1795
  const { dynamicPage: e, allLangPages: t, isFetching: n } = Vi(), s = t.length > 0;
1796
1796
  return n ? null : /* @__PURE__ */ m("div", { className: "relative", children: [
1797
1797
  !e && /* @__PURE__ */ o(ko, { hasDynamicPage: s }),
@@ -2070,7 +2070,7 @@ const al = M(() => import("./page-manager-new-ttsrxdW9.js")), il = ({ children:
2070
2070
  button: Tl,
2071
2071
  panel: () => /* @__PURE__ */ o(yl, { onSuccess: console.log, onError: console.log, onComplete: console.log }),
2072
2072
  position: "top"
2073
- }, _l = M(() => import("./lang-panel-B3USOxGq.js")), Pl = ({ isActive: e, show: t }) => {
2073
+ }, _l = M(() => import("./lang-panel-S3dD5t_t.js")), Pl = ({ isActive: e, show: t }) => {
2074
2074
  const { data: n } = He();
2075
2075
  return !Zn(n, "languages") || !Q(n, "languages", []).length ? null : /* @__PURE__ */ o(x, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ o(pi, { className: "h-4 w-4" }) });
2076
2076
  }, cr = "lang", wl = {
@@ -2081,7 +2081,7 @@ const al = M(() => import("./page-manager-new-ttsrxdW9.js")), il = ({ children:
2081
2081
  button: Pl,
2082
2082
  view: "modal",
2083
2083
  width: 400
2084
- }, bl = M(() => import("./seo-panel-Br8gxDxu.js")), ur = "seo", Il = ({ isActive: e, show: t }) => {
2084
+ }, bl = M(() => import("./seo-panel-DUVBUbG3.js")), ur = "seo", Il = ({ isActive: e, show: t }) => {
2085
2085
  const { data: n } = fe(), s = ji(n == null ? void 0 : n.pageType);
2086
2086
  return !Zn(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ o(x, { size: "icon", className: "my-1 p-0", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ m(
2087
2087
  "svg",
@@ -2110,7 +2110,7 @@ const al = M(() => import("./page-manager-new-ttsrxdW9.js")), il = ({ children:
2110
2110
  width: 600,
2111
2111
  view: "modal"
2112
2112
  }, vl = M(
2113
- () => import("./change-password-modal-CdvJR1Ln.js").then((e) => ({ default: e.ChangePasswordModal }))
2113
+ () => import("./change-password-modal-BkBFwrxi.js").then((e) => ({ default: e.ChangePasswordModal }))
2114
2114
  ), dr = "user-info", Cl = () => {
2115
2115
  const { t: e } = ue(), { user: t, logout: n } = ss(), s = ye("onLogout", En), [r, a] = N(!1);
2116
2116
  return t ? /* @__PURE__ */ m(_a, { children: [
@@ -3997,7 +3997,7 @@ var Bd = (e, t = !1) => {
3997
3997
  const t = vr(() => {
3998
3998
  const n = this, [s] = S(this, Je), [r] = S(this, Ze), [a] = S(this, Xe), [i] = S(this, et), [l] = S(this, Gt), [c] = S(this, ze), [d] = S(this, nt);
3999
3999
  let f;
4000
- return S(this, tt) ? f = S(this, tt) : (f = Ir(() => import("./WDYDFRGG-O9GIrtX0.js")), v(this, tt, f)), Wr(S(this, Lt), S(this, Ye)), wr(f, br({
4000
+ return S(this, tt) ? f = S(this, tt) : (f = Ir(() => import("./WDYDFRGG-SsaVMSIa.js")), v(this, tt, f)), Wr(S(this, Lt), S(this, Ye)), wr(f, br({
4001
4001
  get queryFlavor() {
4002
4002
  return S(n, vt);
4003
4003
  },
@@ -4104,7 +4104,7 @@ var Bd = (e, t = !1) => {
4104
4104
  const t = vr(() => {
4105
4105
  const n = this, [s] = S(this, at), [r] = S(this, it), [a] = S(this, ot), [i] = S(this, lt), [l] = S(this, Ut), [c] = S(this, st), [d] = S(this, ct), [f] = S(this, dt);
4106
4106
  let u;
4107
- return S(this, ut) ? u = S(this, ut) : (u = Ir(() => import("./2SSKDMRQ-Dvf9zadl.js")), v(this, ut, u)), Wr(S(this, Rt), S(this, rt)), wr(u, br({
4107
+ return S(this, ut) ? u = S(this, ut) : (u = Ir(() => import("./2SSKDMRQ-DqIyZppU.js")), v(this, ut, u)), Wr(S(this, Rt), S(this, rt)), wr(u, br({
4108
4108
  get queryFlavor() {
4109
4109
  return S(n, xt);
4110
4110
  },
@@ -4358,7 +4358,7 @@ const uu = () => {
4358
4358
  }), r;
4359
4359
  }
4360
4360
  });
4361
- }, fu = M(() => import("./page-lock-CwZKJ4IE.js")), hu = M(() => import("./no-language-page-dialog-C_fHI2zI.js")), gu = M(() => import("./digital-asset-manager-BZMb6sC7.js")), mu = M(() => import("./save-to-lib-DMnv7ENo.js")), Eu = M(() => import("./web-preview-D9pXonAv.js"));
4361
+ }, fu = M(() => import("./page-lock-csXU_vk5.js")), hu = M(() => import("./no-language-page-dialog-D06JM3cU.js")), gu = M(() => import("./digital-asset-manager-BINMP8H4.js")), mu = M(() => import("./save-to-lib-CPqQG37K.js")), Eu = M(() => import("./web-preview-_TrLPhaZ.js"));
4362
4362
  au();
4363
4363
  xi();
4364
4364
  ta(ul);
@@ -4593,7 +4593,7 @@ const $d = () => {
4593
4593
  console.error("Failed to update metadata");
4594
4594
  }
4595
4595
  });
4596
- }, Pu = M(() => import("./digital-asset-manager-BZMb6sC7.js")), jd = ({
4596
+ }, Pu = M(() => import("./digital-asset-manager-BINMP8H4.js")), jd = ({
4597
4597
  assetId: e,
4598
4598
  assetUrl: t,
4599
4599
  onChange: n,
@@ -4736,7 +4736,7 @@ const $d = () => {
4736
4736
  n = n.replace(r[0], i);
4737
4737
  }
4738
4738
  return n;
4739
- }, Nu = M(() => import("./shared-json-ld-uvMmwCYp.js")), zd = ({
4739
+ }, Nu = M(() => import("./shared-json-ld-nS_mdAYR.js")), zd = ({
4740
4740
  value: e,
4741
4741
  onChange: t,
4742
4742
  disabled: n = !1,
@@ -4924,7 +4924,7 @@ const $d = () => {
4924
4924
  if (e === void 0)
4925
4925
  throw new Error("useAIConfig must be used within AIConfigProvider");
4926
4926
  return e;
4927
- }, Yd = () => ({ models: Cu().models }), Lu = M(() => import("./ai-panel-default-lang-BXYQye3N.js")), Gu = M(() => import("./ai-panel-other-lang-DaCf-cq4.js")), ku = () => {
4927
+ }, Yd = () => ({ models: Cu().models }), Lu = M(() => import("./ai-panel-default-lang-BOCTOIH_.js")), Gu = M(() => import("./ai-panel-other-lang-C2j7qGZx.js")), ku = () => {
4928
4928
  const { t: e } = ue(), [t, n] = N(""), [s, r] = N([]), [a, i] = N(!1), [l, c] = N(null), [d, f] = N(null), [u, g] = N(ki().id), { selectedLang: h, fallbackLang: p } = Se(), _ = Mi(), [I] = ve(), y = I.get("page"), A = (s == null ? void 0 : s.filter((Z) => Z.role === "user").length) >= 4, w = (s == null ? void 0 : s.filter((Z) => Z.role === "user").length) >= 10;
4929
4929
  J(() => {
4930
4930
  r([]);
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./index-DCJDQs1a.cjs"),L=require("./register-chai-top-bar-DyW9GPzV.cjs"),z=require("date-fns"),p=require("lodash-es"),N=require("lucide-react"),b=require("react"),M=require("react-diff-view"),O=require("./index-BVwFJWDq.cjs"),H=require("@tanstack/react-query");function K(t,r){const o=O.useApiUrl(),n=O.useFetch(),d=p.startsWith(t.uid,"draft:")||p.startsWith(r.uid,"live:");return H.useQuery({queryKey:["revision-comparison",t.uid,r.uid],queryFn:async()=>{if(!t.uid||!r.uid)throw new Error("Both revision IDs are required for comparison");const l=h=>h==="draft"||h==="live"?h:"revision",s=h=>p.replace(h.uid,`${h.label}:`,"");return await n(o,{action:O.ACTIONS.GET_COMPARE_DATA,data:{versions:{version1:{type:l(t.label),id:s(t)},version2:{type:l(r.label),id:s(r)}}}})},enabled:!!t.uid&&!!r.uid,staleTime:d?0:1/0,refetchOnMount:d?"always":!1,gcTime:d?0:void 0})}const V=({version:t})=>{const r=t==null?void 0:t.item,{data:o}=O.useChaiUserInfo(r==null?void 0:r.currentEditor),n=t.label==="live",d=t.label==="draft";return e.jsxs("span",{className:`flex min-h-8 items-center gap-x-2 rounded border bg-white px-2 text-xs shadow-lg ${n?"border-green-500/30":d?"border-amber-500/30":"border-purple-500/30"}`,children:[e.jsx("div",{className:"h-full items-center rounded px-1.5 py-0.5 font-medium capitalize"+(n?" bg-green-500 text-green-50":d?" bg-amber-500 text-amber-50":" bg-purple-500 text-purple-50"),children:t.label}),e.jsxs("div",{className:"py-1 text-xs font-light leading-none text-gray-800",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-light opacity-90",children:d?"Currently editing":"Published by"}),!d&&e.jsx("span",{className:"pl-1 font-medium",children:(o==null?void 0:o.name)||"Unknown"})]}),(r==null?void 0:r.createdAt)&&e.jsx("div",{className:"pt-0.5 text-[10px] leading-tight",children:z.formatDate(r.createdAt,"dd MMM yyyy, h:mm a")})]})]})},F=({version:t})=>e.jsx(V,{version:t});function U(t,r,o="data.json"){const n=JSON.stringify(t,null,2),d=JSON.stringify(r,null,2),l=n.split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./index-DCJDQs1a.cjs"),L=require("./register-chai-top-bar-DyW9GPzV.cjs"),z=require("date-fns"),p=require("lodash-es"),N=require("lucide-react"),b=require("react"),M=require("react-diff-view"),O=require("./index-CzBSRTj0.cjs"),H=require("@tanstack/react-query");function K(t,r){const o=O.useApiUrl(),n=O.useFetch(),d=p.startsWith(t.uid,"draft:")||p.startsWith(r.uid,"live:");return H.useQuery({queryKey:["revision-comparison",t.uid,r.uid],queryFn:async()=>{if(!t.uid||!r.uid)throw new Error("Both revision IDs are required for comparison");const l=h=>h==="draft"||h==="live"?h:"revision",s=h=>p.replace(h.uid,`${h.label}:`,"");return await n(o,{action:O.ACTIONS.GET_COMPARE_DATA,data:{versions:{version1:{type:l(t.label),id:s(t)},version2:{type:l(r.label),id:s(r)}}}})},enabled:!!t.uid&&!!r.uid,staleTime:d?0:1/0,refetchOnMount:d?"always":!1,gcTime:d?0:void 0})}const V=({version:t})=>{const r=t==null?void 0:t.item,{data:o}=O.useChaiUserInfo(r==null?void 0:r.currentEditor),n=t.label==="live",d=t.label==="draft";return e.jsxs("span",{className:`flex min-h-8 items-center gap-x-2 rounded border bg-white px-2 text-xs shadow-lg ${n?"border-green-500/30":d?"border-amber-500/30":"border-purple-500/30"}`,children:[e.jsx("div",{className:"h-full items-center rounded px-1.5 py-0.5 font-medium capitalize"+(n?" bg-green-500 text-green-50":d?" bg-amber-500 text-amber-50":" bg-purple-500 text-purple-50"),children:t.label}),e.jsxs("div",{className:"py-1 text-xs font-light leading-none text-gray-800",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-light opacity-90",children:d?"Currently editing":"Published by"}),!d&&e.jsx("span",{className:"pl-1 font-medium",children:(o==null?void 0:o.name)||"Unknown"})]}),(r==null?void 0:r.createdAt)&&e.jsx("div",{className:"pt-0.5 text-[10px] leading-tight",children:z.formatDate(r.createdAt,"dd MMM yyyy, h:mm a")})]})]})},F=({version:t})=>e.jsx(V,{version:t});function U(t,r,o="data.json"){const n=JSON.stringify(t,null,2),d=JSON.stringify(r,null,2),l=n.split(`
2
2
  `),s=d.split(`
3
3
  `);let u=`--- a/${o}
4
4
  `;u+=`+++ b/${o}
@@ -6,7 +6,7 @@ import { startsWith as T, replace as W, isString as X, trim as Y, isArray as Z,
6
6
  import { FileJson as z, Loader as ne, Check as F, Copy as H } from "lucide-react";
7
7
  import { useState as D, useMemo as I } from "react";
8
8
  import { parseDiff as se, Diff as le, Hunk as ae } from "react-diff-view";
9
- import { aq as ie, ar as oe, A as ce, ao as de } from "./index-LBTm1Jmk.js";
9
+ import { aq as ie, ar as oe, A as ce, ao as de } from "./index-nzqILA37.js";
10
10
  import { useQuery as fe } from "@tanstack/react-query";
11
11
  function me(t, n) {
12
12
  const o = ie(), s = oe(), d = T(t.uid, "draft:") || T(n.uid, "live:");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("./register-chai-top-bar-DyW9GPzV.cjs"),a=require("./index-DCJDQs1a.cjs"),n=require("./index-BVwFJWDq.cjs"),r=require("lodash-es"),j=require("lucide-react"),c=require("react"),I=require("react-i18next"),L=require("sonner"),k=require("jotai"),M=({page:s,onClose:p})=>{const{t:l}=I.useTranslation(),[o,P]=c.useState(s.slug||""),{mutate:y,isPending:f}=n.useChangeSlug(),{data:i}=n.usePageTypes(),d=r.find(i,{key:s==null?void 0:s.pageType}),E=h=>{if(h.preventDefault(),!(s!=null&&s.primaryPage)&&Object.keys(n.LANGUAGES).some(S=>o===`/${S}`||r.startsWith(o,`/${S}/`))){L.toast.error(l("Error"),{description:l("Slugs cannot start with a language code for primary page")});return}y({...s,slug:o},{onSuccess:p})},m=(s==null?void 0:s.lang)||"";return e.jsx(a.Dialog,{open:!!s,onOpenChange:p,children:e.jsxs(a.DialogContent,{children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:l("Change Slug")}),e.jsx(a.DialogDescription,{className:"text-xs",children:e.jsxs(N.Alert,{variant:"destructive",className:"mt-2",children:[e.jsx(j.AlertCircle,{className:"h-4 w-4"}),l("Changing the slug may have impact on your SEO. Please proceed with caution.")]})})]}),e.jsxs("form",{onSubmit:E,children:[e.jsxs("div",{className:"space-y-4 py-4 text-sm",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{children:[e.jsxs("span",{children:[l("Type"),":"]}),e.jsxs("span",{className:"font-medium text-gray-600",children:[" ",(d==null?void 0:d.name)||(s==null?void 0:s.pageType)]})]}),e.jsxs("div",{children:[e.jsxs("span",{children:[l("Name"),":"]}),e.jsxs("span",{className:"font-medium text-gray-600",children:[" ",s.name]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs(a.Label,{htmlFor:"slug",className:"text-right",children:[l("Slug")," ",e.jsxs("small",{className:"font-light text-gray-500",children:[l("Slug should start with")," /",m]})]}),e.jsx(N.Input,{id:"slug",value:o,onChange:h=>{const x=h.target.value;r.startsWith(x,`/${m}`)&&P(x)},className:"col-span-3",required:!0,pattern:"^/.*",title:l("Slug must start with /"),placeholder:l("Enter page slug")})]})]}),e.jsx(a.DialogFooter,{children:e.jsx(N.Button,{type:"submit",disabled:f||!r.startsWith(o,`/${m}`)||r.isEqual(s==null?void 0:s.slug,o),children:l(f?"Changing...":"Change Slug")})})]})]})})},T=c.lazy(()=>Promise.resolve().then(()=>require("./delete-page-DLohaU-U.cjs"))),q=c.lazy(()=>Promise.resolve().then(()=>require("./unpublish-page-CUr8Xub6.cjs"))),_=()=>{const{t:s}=I.useTranslation(),p=k.useSetAtom(n.addNewLangAtom),{selectedLang:l,fallbackLang:o,setSelectedLang:P}=a.useLanguages(),{data:y,isFetching:f}=n.useLanguagePages(),{data:i}=n.usePrimaryPage(),{data:d}=n.usePageTypes(),E=c.useMemo(()=>{const t=d==null?void 0:d.find(g=>g.key===(i==null?void 0:i.pageType));return i!=null&&i.dynamic?t==null?void 0:t.dynamicSlug:""},[d,i==null?void 0:i.pageType,i==null?void 0:i.dynamic]),[m,h]=c.useState(null),[x,v]=c.useState(null),[S,A]=c.useState(null),{data:b}=n.useWebsiteSetting(),D=r.filter(r.get(b,"languages")||["en"],t=>!r.find(y,{lang:t})&&t!==r.get(b,"fallbackLang"));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("ul",{className:"space-y-2",children:f?e.jsxs("div",{className:"w-full space-y-3 py-4",children:[e.jsx("div",{className:"h-8 w-full animate-pulse rounded bg-gray-300"}),e.jsx("div",{className:"h-8 w-full animate-pulse rounded bg-gray-300"}),e.jsx("div",{className:"h-8 w-full animate-pulse rounded bg-gray-300"})]}):r.map(y,t=>{const g=t.lang,C=t.slug,w=!t.primaryPage,G=g===l;return e.jsxs(e.Fragment,{children:[e.jsxs("li",{className:`flex w-full cursor-pointer items-center justify-between rounded p-2 text-slate-500 ${G?"bg-gray-200":"hover:bg-gray-100"}`,onClick:()=>P(g),children:[e.jsxs("div",{className:"flex-1 gap-x-3",children:[e.jsxs("div",{className:"flex items-center gap-x-2 text-[13px] text-slate-800",children:[e.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${t.online?"bg-green-300":"bg-gray-300"}`}),r.get(n.LANGUAGES,w?o:g,g)]}),e.jsxs("div",{children:[C&&e.jsxs("div",{className:"text-[11px] font-light text-slate-600",children:["Slug: ",e.jsx("b",{className:"font-mono font-medium",children:E?`${C}/${E}`:C})]}),e.jsxs("div",{className:"text-[11px] font-light text-slate-600",children:["Name:",e.jsxs("b",{className:"font-medium",children:[" ",t.name," "]})]})]})]}),w?e.jsxs("div",{className:"flex items-center gap-x-1 text-[11px] text-orange-500",children:[e.jsx(j.StarIcon,{fill:"orange",className:"h-3 w-3"}),e.jsx("b",{children:" Primary"})]}):e.jsx("div",{className:"flex items-center gap-x-3",children:e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.EDIT_PAGE,n.PAGES_PERMISSIONS.DELETE_PAGE,n.PAGES_PERMISSIONS.UNPUBLISH_PAGE],children:e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,onClick:u=>u.stopPropagation(),children:e.jsx(N.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:e.jsx(j.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(a.DropdownMenuContent,{align:"end",className:"z-[9999] text-sm",children:[e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.EDIT_PAGE],children:e.jsxs(a.DropdownMenuItem,{className:"flex cursor-pointer items-center gap-2",onClick:u=>{u.stopPropagation(),p({edit:!0,id:t.id,primaryPage:t.primaryPage})},children:[e.jsx(j.PencilIcon,{className:"size-3"}),s("Edit")]})}),e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.UNPUBLISH_PAGE],children:(t==null?void 0:t.online)&&e.jsxs(a.DropdownMenuItem,{className:"flex cursor-pointer items-center gap-2",onClick:u=>{u.stopPropagation(),v(t)},children:[e.jsx(j.Power,{className:"size-3"}),s("Unpublish")]})}),e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.DELETE_PAGE],children:e.jsxs(a.DropdownMenuItem,{className:"flex cursor-pointer items-center gap-2",onClick:u=>{u.stopPropagation(),h(t)},children:[e.jsx(j.TrashIcon,{className:"size-3"}),s("Delete")]})})]})]})})})]},t.id),e.jsx("div",{className:"h-1 w-full border-b"})]})})}),e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.ADD_PAGE],children:e.jsx("div",{className:"flex w-full justify-center",children:e.jsx(N.Button,{variant:"default",size:"sm",disabled:r.isEmpty(D),onClick:()=>{p({primaryPage:i==null?void 0:i.id,edit:!1})},children:s("Add new language page")})})}),m&&e.jsx(c.Suspense,{children:e.jsx(T,{page:m,onClose:()=>h(null)})}),x&&e.jsx(c.Suspense,{children:e.jsx(q,{page:x,onClose:()=>v(null)})}),S&&e.jsx(c.Suspense,{children:e.jsx(M,{page:S,onClose:()=>A(null)})})]})};exports.default=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("./register-chai-top-bar-DyW9GPzV.cjs"),a=require("./index-DCJDQs1a.cjs"),n=require("./index-CzBSRTj0.cjs"),r=require("lodash-es"),j=require("lucide-react"),c=require("react"),I=require("react-i18next"),L=require("sonner"),k=require("jotai"),M=({page:s,onClose:p})=>{const{t:l}=I.useTranslation(),[o,P]=c.useState(s.slug||""),{mutate:y,isPending:f}=n.useChangeSlug(),{data:i}=n.usePageTypes(),d=r.find(i,{key:s==null?void 0:s.pageType}),E=h=>{if(h.preventDefault(),!(s!=null&&s.primaryPage)&&Object.keys(n.LANGUAGES).some(S=>o===`/${S}`||r.startsWith(o,`/${S}/`))){L.toast.error(l("Error"),{description:l("Slugs cannot start with a language code for primary page")});return}y({...s,slug:o},{onSuccess:p})},m=(s==null?void 0:s.lang)||"";return e.jsx(a.Dialog,{open:!!s,onOpenChange:p,children:e.jsxs(a.DialogContent,{children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:l("Change Slug")}),e.jsx(a.DialogDescription,{className:"text-xs",children:e.jsxs(N.Alert,{variant:"destructive",className:"mt-2",children:[e.jsx(j.AlertCircle,{className:"h-4 w-4"}),l("Changing the slug may have impact on your SEO. Please proceed with caution.")]})})]}),e.jsxs("form",{onSubmit:E,children:[e.jsxs("div",{className:"space-y-4 py-4 text-sm",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{children:[e.jsxs("span",{children:[l("Type"),":"]}),e.jsxs("span",{className:"font-medium text-gray-600",children:[" ",(d==null?void 0:d.name)||(s==null?void 0:s.pageType)]})]}),e.jsxs("div",{children:[e.jsxs("span",{children:[l("Name"),":"]}),e.jsxs("span",{className:"font-medium text-gray-600",children:[" ",s.name]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs(a.Label,{htmlFor:"slug",className:"text-right",children:[l("Slug")," ",e.jsxs("small",{className:"font-light text-gray-500",children:[l("Slug should start with")," /",m]})]}),e.jsx(N.Input,{id:"slug",value:o,onChange:h=>{const x=h.target.value;r.startsWith(x,`/${m}`)&&P(x)},className:"col-span-3",required:!0,pattern:"^/.*",title:l("Slug must start with /"),placeholder:l("Enter page slug")})]})]}),e.jsx(a.DialogFooter,{children:e.jsx(N.Button,{type:"submit",disabled:f||!r.startsWith(o,`/${m}`)||r.isEqual(s==null?void 0:s.slug,o),children:l(f?"Changing...":"Change Slug")})})]})]})})},T=c.lazy(()=>Promise.resolve().then(()=>require("./delete-page-BNZclrjF.cjs"))),q=c.lazy(()=>Promise.resolve().then(()=>require("./unpublish-page-CGZWa57H.cjs"))),_=()=>{const{t:s}=I.useTranslation(),p=k.useSetAtom(n.addNewLangAtom),{selectedLang:l,fallbackLang:o,setSelectedLang:P}=a.useLanguages(),{data:y,isFetching:f}=n.useLanguagePages(),{data:i}=n.usePrimaryPage(),{data:d}=n.usePageTypes(),E=c.useMemo(()=>{const t=d==null?void 0:d.find(g=>g.key===(i==null?void 0:i.pageType));return i!=null&&i.dynamic?t==null?void 0:t.dynamicSlug:""},[d,i==null?void 0:i.pageType,i==null?void 0:i.dynamic]),[m,h]=c.useState(null),[x,v]=c.useState(null),[S,A]=c.useState(null),{data:b}=n.useWebsiteSetting(),D=r.filter(r.get(b,"languages")||["en"],t=>!r.find(y,{lang:t})&&t!==r.get(b,"fallbackLang"));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("ul",{className:"space-y-2",children:f?e.jsxs("div",{className:"w-full space-y-3 py-4",children:[e.jsx("div",{className:"h-8 w-full animate-pulse rounded bg-gray-300"}),e.jsx("div",{className:"h-8 w-full animate-pulse rounded bg-gray-300"}),e.jsx("div",{className:"h-8 w-full animate-pulse rounded bg-gray-300"})]}):r.map(y,t=>{const g=t.lang,C=t.slug,w=!t.primaryPage,G=g===l;return e.jsxs(e.Fragment,{children:[e.jsxs("li",{className:`flex w-full cursor-pointer items-center justify-between rounded p-2 text-slate-500 ${G?"bg-gray-200":"hover:bg-gray-100"}`,onClick:()=>P(g),children:[e.jsxs("div",{className:"flex-1 gap-x-3",children:[e.jsxs("div",{className:"flex items-center gap-x-2 text-[13px] text-slate-800",children:[e.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${t.online?"bg-green-300":"bg-gray-300"}`}),r.get(n.LANGUAGES,w?o:g,g)]}),e.jsxs("div",{children:[C&&e.jsxs("div",{className:"text-[11px] font-light text-slate-600",children:["Slug: ",e.jsx("b",{className:"font-mono font-medium",children:E?`${C}/${E}`:C})]}),e.jsxs("div",{className:"text-[11px] font-light text-slate-600",children:["Name:",e.jsxs("b",{className:"font-medium",children:[" ",t.name," "]})]})]})]}),w?e.jsxs("div",{className:"flex items-center gap-x-1 text-[11px] text-orange-500",children:[e.jsx(j.StarIcon,{fill:"orange",className:"h-3 w-3"}),e.jsx("b",{children:" Primary"})]}):e.jsx("div",{className:"flex items-center gap-x-3",children:e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.EDIT_PAGE,n.PAGES_PERMISSIONS.DELETE_PAGE,n.PAGES_PERMISSIONS.UNPUBLISH_PAGE],children:e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,onClick:u=>u.stopPropagation(),children:e.jsx(N.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:e.jsx(j.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(a.DropdownMenuContent,{align:"end",className:"z-[9999] text-sm",children:[e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.EDIT_PAGE],children:e.jsxs(a.DropdownMenuItem,{className:"flex cursor-pointer items-center gap-2",onClick:u=>{u.stopPropagation(),p({edit:!0,id:t.id,primaryPage:t.primaryPage})},children:[e.jsx(j.PencilIcon,{className:"size-3"}),s("Edit")]})}),e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.UNPUBLISH_PAGE],children:(t==null?void 0:t.online)&&e.jsxs(a.DropdownMenuItem,{className:"flex cursor-pointer items-center gap-2",onClick:u=>{u.stopPropagation(),v(t)},children:[e.jsx(j.Power,{className:"size-3"}),s("Unpublish")]})}),e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.DELETE_PAGE],children:e.jsxs(a.DropdownMenuItem,{className:"flex cursor-pointer items-center gap-2",onClick:u=>{u.stopPropagation(),h(t)},children:[e.jsx(j.TrashIcon,{className:"size-3"}),s("Delete")]})})]})]})})})]},t.id),e.jsx("div",{className:"h-1 w-full border-b"})]})})}),e.jsx(n.PermissionChecker,{permissions:[n.PAGES_PERMISSIONS.ADD_PAGE],children:e.jsx("div",{className:"flex w-full justify-center",children:e.jsx(N.Button,{variant:"default",size:"sm",disabled:r.isEmpty(D),onClick:()=>{p({primaryPage:i==null?void 0:i.id,edit:!1})},children:s("Add new language page")})})}),m&&e.jsx(c.Suspense,{children:e.jsx(T,{page:m,onClose:()=>h(null)})}),x&&e.jsx(c.Suspense,{children:e.jsx(q,{page:x,onClose:()=>v(null)})}),S&&e.jsx(c.Suspense,{children:e.jsx(M,{page:S,onClose:()=>A(null)})})]})};exports.default=_;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as s, Fragment as M } from "react/jsx-runtime";
2
2
  import { D as j, z as F, B as A } from "./register-chai-top-bar-D6GjnauV.js";
3
3
  import { D as B, e as H, f as O, g as W, o as q, p as R, q as J, d as K, v as Q, w as V, x as X, y as C } from "./index-OuHV9Ann.js";
4
- import { at as Y, k as T, L as I, au as Z, j as ee, av as se, h as ae, aw as f, ax as o } from "./index-LBTm1Jmk.js";
4
+ import { at as Y, k as T, L as I, au as Z, j as ee, av as se, h as ae, aw as f, ax as o } from "./index-nzqILA37.js";
5
5
  import { find as G, startsWith as E, isEqual as ne, filter as te, get as D, map as le, isEmpty as ie } from "lodash-es";
6
6
  import { AlertCircle as re, StarIcon as ce, MoreHorizontal as oe, PencilIcon as de, Power as me, TrashIcon as ue } from "lucide-react";
7
7
  import { useState as S, useMemo as he, Suspense as L, lazy as z } from "react";
@@ -81,7 +81,7 @@ const fe = ({ page: a, onClose: g }) => {
81
81
  /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(A, { type: "submit", disabled: y || !E(i, `/${d}`) || ne(a == null ? void 0 : a.slug, i), children: l(y ? "Changing..." : "Change Slug") }) })
82
82
  ] })
83
83
  ] }) });
84
- }, Ne = z(() => import("./delete-page-C99K2qzS.js")), ye = z(() => import("./unpublish-page-0fR1o0b7.js")), ke = () => {
84
+ }, Ne = z(() => import("./delete-page-BYh290jY.js")), ye = z(() => import("./unpublish-page-Dsqk_IA1.js")), ke = () => {
85
85
  const { t: a } = U(), g = pe(Z), { selectedLang: l, fallbackLang: i, setSelectedLang: v } = K(), { data: N, isFetching: y } = ee(), { data: t } = se(), { data: r } = T(), x = he(() => {
86
86
  const n = r == null ? void 0 : r.find((h) => h.key === (t == null ? void 0 : t.pageType));
87
87
  return t != null && t.dynamic ? n == null ? void 0 : n.dynamicSlug : "";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-DCJDQs1a.cjs"),y=require("./index-BVwFJWDq.cjs"),w=require("lodash-es"),m=require("lucide-react"),l=require("react"),M=require("react-i18next"),k=require("sonner"),B=1*1024*1024,A=({page:r,onClose:u})=>{const{t:s}=M.useTranslation(),[f,p]=l.useState(!1),[j,T]=l.useState(""),[c,N]=l.useState(""),[v,x]=l.useState(!1),i=l.useRef(null),C=y.useMarkAsTemplate(),{data:h}=y.usePageTypes(),g=h==null?void 0:h.find(a=>a.key===r.pageType),I=(g==null?void 0:g.name)||w.startCase(r.pageType),D=l.useCallback(a=>{var b;const d=(b=a.target.files)==null?void 0:b[0];if(d){if(d.size>B){k.toast.error(s("File too large"),{description:`${s("Maximum file size is 1MB. Selected file is")} ${(d.size/1024).toFixed(2)}KB.`}),i.current&&(i.current.value="");return}try{x(!0);const n=new FileReader;n.onloadend=()=>{N(n.result),x(!1)},n.readAsDataURL(d)}catch(n){console.error("Error reading file:",n),x(!1),k.toast.error(s("Failed to process image"),{description:n instanceof Error?n.message:s("Unknown error")})}}},[s]),F=()=>{N(""),i.current&&(i.current.value="")},S=()=>{var a;(a=i.current)==null||a.click()},q=()=>{p(!0),C.mutate({page:r,name:r.name,description:j.trim()||void 0,pageType:r.pageType,...c?{previewImage:c}:{}},{onSuccess:()=>{p(!1),u()},onError:()=>{p(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:u,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:s("Mark as template")}),e.jsxs(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:[s("Are you sure you want to mark this page as a template?"),e.jsx("br",{}),s("Templates can be used to create new pages with the same content.")]})]}),e.jsxs("div",{className:"mb-4 space-y-4 text-xs",children:[e.jsxs("div",{className:"space-y-3 rounded border bg-slate-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m.Tag,{className:"h-4 w-4 text-slate-500"}),e.jsxs("span",{className:"font-medium text-slate-500",children:[s("Page Name"),":"]}),e.jsx("span",{className:"font-semibold",children:w.startCase(r.name)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m.File,{className:"h-4 w-4 text-slate-500"}),e.jsxs("span",{className:"font-medium text-slate-500",children:[s("Type"),":"]}),e.jsx("span",{className:"font-semibold",children:I})]})]}),e.jsxs("div",{children:[e.jsx(t.Label,{htmlFor:"description",className:"text-xs font-medium",children:s("Description (Optional)")}),e.jsx(t.Textarea,{id:"description",placeholder:s("Describe this template's purpose"),className:"mt-1 h-24 resize-none text-xs",value:j,onChange:a=>T(a.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"previewImage",className:"text-xs font-medium",children:s("Preview Image (Optional)")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o.Input,{type:"file",id:"previewImage",ref:i,onChange:D,accept:"image/*",className:"hidden"}),e.jsx(o.Button,{type:"button",variant:"outline",onClick:S,disabled:v,className:"w-full",children:v?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),s("Uploading...")]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(m.ImageIcon,{className:"h-4 w-4"}),s("Select image")]})}),c&&e.jsx(o.Button,{type:"button",variant:"outline",size:"icon",onClick:F,children:e.jsx(m.X,{className:"h-4 w-4"})})]}),c&&e.jsx("div",{className:"aspect-video overflow-hidden rounded-md border",children:e.jsx("img",{src:c,alt:s("Preview"),className:"h-full max-h-[200px] w-full object-contain"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("max 1mb")})]})]})]}),e.jsxs(t.DialogFooter,{className:f?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:a=>{a.stopPropagation(),u()},children:s("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:f,onClick:q,children:s("Mark as template")})]})]})})};exports.default=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-DCJDQs1a.cjs"),y=require("./index-CzBSRTj0.cjs"),w=require("lodash-es"),m=require("lucide-react"),l=require("react"),M=require("react-i18next"),k=require("sonner"),B=1*1024*1024,A=({page:r,onClose:u})=>{const{t:s}=M.useTranslation(),[f,p]=l.useState(!1),[j,T]=l.useState(""),[c,N]=l.useState(""),[v,x]=l.useState(!1),i=l.useRef(null),C=y.useMarkAsTemplate(),{data:h}=y.usePageTypes(),g=h==null?void 0:h.find(a=>a.key===r.pageType),I=(g==null?void 0:g.name)||w.startCase(r.pageType),D=l.useCallback(a=>{var b;const d=(b=a.target.files)==null?void 0:b[0];if(d){if(d.size>B){k.toast.error(s("File too large"),{description:`${s("Maximum file size is 1MB. Selected file is")} ${(d.size/1024).toFixed(2)}KB.`}),i.current&&(i.current.value="");return}try{x(!0);const n=new FileReader;n.onloadend=()=>{N(n.result),x(!1)},n.readAsDataURL(d)}catch(n){console.error("Error reading file:",n),x(!1),k.toast.error(s("Failed to process image"),{description:n instanceof Error?n.message:s("Unknown error")})}}},[s]),F=()=>{N(""),i.current&&(i.current.value="")},S=()=>{var a;(a=i.current)==null||a.click()},q=()=>{p(!0),C.mutate({page:r,name:r.name,description:j.trim()||void 0,pageType:r.pageType,...c?{previewImage:c}:{}},{onSuccess:()=>{p(!1),u()},onError:()=>{p(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:u,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:s("Mark as template")}),e.jsxs(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:[s("Are you sure you want to mark this page as a template?"),e.jsx("br",{}),s("Templates can be used to create new pages with the same content.")]})]}),e.jsxs("div",{className:"mb-4 space-y-4 text-xs",children:[e.jsxs("div",{className:"space-y-3 rounded border bg-slate-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m.Tag,{className:"h-4 w-4 text-slate-500"}),e.jsxs("span",{className:"font-medium text-slate-500",children:[s("Page Name"),":"]}),e.jsx("span",{className:"font-semibold",children:w.startCase(r.name)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m.File,{className:"h-4 w-4 text-slate-500"}),e.jsxs("span",{className:"font-medium text-slate-500",children:[s("Type"),":"]}),e.jsx("span",{className:"font-semibold",children:I})]})]}),e.jsxs("div",{children:[e.jsx(t.Label,{htmlFor:"description",className:"text-xs font-medium",children:s("Description (Optional)")}),e.jsx(t.Textarea,{id:"description",placeholder:s("Describe this template's purpose"),className:"mt-1 h-24 resize-none text-xs",value:j,onChange:a=>T(a.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(t.Label,{htmlFor:"previewImage",className:"text-xs font-medium",children:s("Preview Image (Optional)")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o.Input,{type:"file",id:"previewImage",ref:i,onChange:D,accept:"image/*",className:"hidden"}),e.jsx(o.Button,{type:"button",variant:"outline",onClick:S,disabled:v,className:"w-full",children:v?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),s("Uploading...")]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(m.ImageIcon,{className:"h-4 w-4"}),s("Select image")]})}),c&&e.jsx(o.Button,{type:"button",variant:"outline",size:"icon",onClick:F,children:e.jsx(m.X,{className:"h-4 w-4"})})]}),c&&e.jsx("div",{className:"aspect-video overflow-hidden rounded-md border",children:e.jsx("img",{src:c,alt:s("Preview"),className:"h-full max-h-[200px] w-full object-contain"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("max 1mb")})]})]})]}),e.jsxs(t.DialogFooter,{className:f?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:a=>{a.stopPropagation(),u()},children:s("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:f,onClick:q,children:s("Mark as template")})]})]})})};exports.default=A;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import { z, B as c } from "./register-chai-top-bar-D6GjnauV.js";
3
3
  import { D as P, e as B, f as E, g as L, o as S, p as w, T as U, q as R } from "./index-OuHV9Ann.js";
4
- import { r as j, k as O } from "./index-LBTm1Jmk.js";
4
+ import { r as j, k as O } from "./index-nzqILA37.js";
5
5
  import { startCase as y } from "lodash-es";
6
6
  import { Tag as X, File as _, ImageIcon as $, X as q } from "lucide-react";
7
7
  import { useState as m, useRef as H, useCallback as K } from "react";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-DCJDQs1a.cjs"),n=require("./index-BVwFJWDq.cjs"),w=require("lodash-es"),x=require("lucide-react"),p=require("react-i18next"),P=()=>{const{t:a}=p.useTranslation(),[i,l]=n.useSearchParams(),c=i.get("lang"),g=n.useIsLanguagePageCreated(c),{setSelectedLang:u}=t.useLanguages(),d=()=>{const r=new URLSearchParams(window.location.search);r.delete("lang");const o=r.toString(),h=`${window.location.pathname}${o?`?${o}`:""}`;window.history.pushState({},"",h),l(r),u(""),window.dispatchEvent(new PopStateEvent("popstate"))};if(g)return null;const s=w.get(n.LANGUAGES,c);return e.jsx(n.BlurContainer,{children:e.jsxs(t.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(t.CardHeader,{className:"space-y-1",children:e.jsxs(t.CardTitle,{className:"flex items-center gap-2 text-2xl",children:[e.jsx(x.LockIcon,{className:"h-6 w-6 text-yellow-500"}),a("Page missing for"),' "',s,'" ',a("language"),"."]})}),e.jsx(t.CardContent,{className:"grid gap-4",children:e.jsxs("div",{children:[a("Page is not available in the"),' "',s,'" ',a("language. Either create the page in the"),' "',s,'"',a("language or switch to the base language.")]})}),e.jsx(t.CardFooter,{children:e.jsx(m.Button,{onClick:d,className:"w-full",variant:"destructive",children:a("Switch to default language")})})]})})};exports.default=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-DCJDQs1a.cjs"),n=require("./index-CzBSRTj0.cjs"),w=require("lodash-es"),x=require("lucide-react"),p=require("react-i18next"),P=()=>{const{t:a}=p.useTranslation(),[i,l]=n.useSearchParams(),c=i.get("lang"),g=n.useIsLanguagePageCreated(c),{setSelectedLang:u}=t.useLanguages(),d=()=>{const r=new URLSearchParams(window.location.search);r.delete("lang");const o=r.toString(),h=`${window.location.pathname}${o?`?${o}`:""}`;window.history.pushState({},"",h),l(r),u(""),window.dispatchEvent(new PopStateEvent("popstate"))};if(g)return null;const s=w.get(n.LANGUAGES,c);return e.jsx(n.BlurContainer,{children:e.jsxs(t.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(t.CardHeader,{className:"space-y-1",children:e.jsxs(t.CardTitle,{className:"flex items-center gap-2 text-2xl",children:[e.jsx(x.LockIcon,{className:"h-6 w-6 text-yellow-500"}),a("Page missing for"),' "',s,'" ',a("language"),"."]})}),e.jsx(t.CardContent,{className:"grid gap-4",children:e.jsxs("div",{children:[a("Page is not available in the"),' "',s,'" ',a("language. Either create the page in the"),' "',s,'"',a("language or switch to the base language.")]})}),e.jsx(t.CardFooter,{children:e.jsx(m.Button,{onClick:d,className:"w-full",variant:"destructive",children:a("Switch to default language")})})]})})};exports.default=P;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { B as h } from "./register-chai-top-bar-D6GjnauV.js";
3
3
  import { d as u, J as w, K as p, M as f, O as P, Q as C } from "./index-OuHV9Ann.js";
4
- import { c as S, d as L, L as x, B as N } from "./index-LBTm1Jmk.js";
4
+ import { c as S, d as L, L as x, B as N } from "./index-nzqILA37.js";
5
5
  import { get as v } from "lodash-es";
6
6
  import { LockIcon as B } from "lucide-react";
7
7
  import { useTranslation as E } from "react-i18next";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("./index-BVwFJWDq.cjs"),n=require("react"),t=n.lazy(()=>Promise.resolve().then(()=>require("./no-language-page-content-C-MCdPXt.cjs"))),g=()=>{const[r]=a.useSearchParams(),s=r.get("lang");return a.useIsLanguagePageCreated(s)?null:e.jsx(n.Suspense,{children:e.jsx(t,{})})};exports.default=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("./index-CzBSRTj0.cjs"),n=require("react"),t=n.lazy(()=>Promise.resolve().then(()=>require("./no-language-page-content-HjxRSjI0.cjs"))),g=()=>{const[r]=a.useSearchParams(),s=r.get("lang");return a.useIsLanguagePageCreated(s)?null:e.jsx(n.Suspense,{children:e.jsx(t,{})})};exports.default=g;
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { c as g, d as n } from "./index-LBTm1Jmk.js";
2
+ import { c as g, d as n } from "./index-nzqILA37.js";
3
3
  import { Suspense as s, lazy as t } from "react";
4
- const o = t(() => import("./no-language-page-content-D8t5dfgh.js")), l = () => {
4
+ const o = t(() => import("./no-language-page-content-MPJjIXir.js")), l = () => {
5
5
  const [e] = g(), r = e.get("lang");
6
6
  return n(r) ? null : /* @__PURE__ */ a(s, { children: /* @__PURE__ */ a(o, {}) });
7
7
  };