@chaibuilder/sdk 4.0.0-beta.44 → 4.0.0-beta.46

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 (108) hide show
  1. package/dist/{2SSKDMRQ-BrCeJE2w.js → 2SSKDMRQ-B6pWs8Zk.js} +2 -2
  2. package/dist/{2SSKDMRQ-BKWkM_6d.cjs → 2SSKDMRQ-B7Va8HeK.cjs} +1 -1
  3. package/dist/{AP7HFJJL-CskLuLc8.js → AP7HFJJL-CNIRZpP-.js} +1 -1
  4. package/dist/{AP7HFJJL-vt0XlZqG.cjs → AP7HFJJL-Xv13XYXE.cjs} +1 -1
  5. package/dist/{IconPicker-BJ6a_dl-.js → IconPicker-CGtjTiWr.js} +1 -1
  6. package/dist/{WDYDFRGG-BN61b01J.js → WDYDFRGG-5Lwxhw_-.js} +2 -2
  7. package/dist/{WDYDFRGG-Nw-WmjVB.cjs → WDYDFRGG-zZ8jN8rF.cjs} +1 -1
  8. package/dist/{actions-registery-CMKfEXxX.js → actions-registery-B1VeX52Y.js} +1565 -1529
  9. package/dist/{actions-registery-CqhNZFV3.cjs → actions-registery-BQ31lpix.cjs} +19 -19
  10. package/dist/actions.cjs +1 -1
  11. package/dist/actions.d.ts +132 -0
  12. package/dist/actions.js +7 -6
  13. package/dist/{active-in-another-tab-DHTYNRjQ.cjs → active-in-another-tab-C8FXtXk5.cjs} +1 -1
  14. package/dist/{active-in-another-tab-CZHN4gdI.js → active-in-another-tab-HtM97aRN.js} +4 -4
  15. package/dist/{add-new-language-page-DUm56cDk.cjs → add-new-language-page-gbvPI58M.cjs} +1 -1
  16. package/dist/{add-new-language-page-J0FxQGri.js → add-new-language-page-x88_n8EW.js} +3 -3
  17. package/dist/{add-new-page-B4dH-sG6.js → add-new-page-BMSePgKl.js} +2 -2
  18. package/dist/{add-new-page-D0H-HGrE.cjs → add-new-page-CPB4yhqv.cjs} +1 -1
  19. package/dist/{ai-panel-default-lang-BHzxr8XE.cjs → ai-panel-default-lang-DKGh1pbz.cjs} +2 -2
  20. package/dist/{ai-panel-default-lang-DrKTSHgh.js → ai-panel-default-lang-Dav6FRUY.js} +10 -10
  21. package/dist/{ai-panel-other-lang-CMs97ftp.js → ai-panel-other-lang-CdFx2x23.js} +14 -14
  22. package/dist/{ai-panel-other-lang-B6cRPiU9.cjs → ai-panel-other-lang-DdDn2I8h.cjs} +1 -1
  23. package/dist/ai-prompt-input-B8SFfk6N.cjs +1 -0
  24. package/dist/ai-prompt-input-bleYNRnH.js +650 -0
  25. package/dist/{ai-translation-prompt-Ddum5Ge5.cjs → ai-translation-prompt-DGrNA2Od.cjs} +1 -1
  26. package/dist/{ai-translation-prompt-BfJry6ZR.js → ai-translation-prompt-DvHdOZ6t.js} +1 -1
  27. package/dist/{change-password-modal-C4ngPnKd.js → change-password-modal-C9afEHLW.js} +4 -4
  28. package/dist/{change-password-modal-UTKwQzI4.cjs → change-password-modal-bce5bF3K.cjs} +1 -1
  29. package/dist/{code-editor-LNL_FEZ0.js → code-editor-BfGHceIq.js} +1 -1
  30. package/dist/{continue-editing-in-this-client-rjJy4-cq.cjs → continue-editing-in-this-client-4bvChAL-.cjs} +1 -1
  31. package/dist/{continue-editing-in-this-client-CuBlXJb6.js → continue-editing-in-this-client-BFptv8tA.js} +2 -2
  32. package/dist/core.js +18 -18
  33. package/dist/{css-import-modal-ChRsUOVa.js → css-import-modal-CEQccCmc.js} +1 -1
  34. package/dist/{delete-page-BegGYX7_.js → delete-page-8h4dNP7d.js} +2 -2
  35. package/dist/{delete-page-BaJ0oesv.cjs → delete-page-BOxoMgyl.cjs} +1 -1
  36. package/dist/{design-token-usage-Bgphgz_u.js → design-token-usage-CVPBTF21.js} +8 -8
  37. package/dist/{digital-asset-manager-BPy9RYlx.js → digital-asset-manager-83B0Y6L-.js} +3 -3
  38. package/dist/{digital-asset-manager-uzOuwVMR.cjs → digital-asset-manager-JtBK07Ob.cjs} +1 -1
  39. package/dist/{duplicate-page-n6osptll.js → duplicate-page-DIa59iDe.js} +12 -12
  40. package/dist/{duplicate-page-BofwxP4t.cjs → duplicate-page-DVqC24Rd.cjs} +1 -1
  41. package/dist/{dynamic-page-selector-6EWhAHX0.js → dynamic-page-selector-C9vYslOg.js} +12 -12
  42. package/dist/{dynamic-page-selector-CVI1LwdD.cjs → dynamic-page-selector-YRCRqWlz.cjs} +1 -1
  43. package/dist/{image-editor-D1euq0rl.js → image-editor-CzxSXo-u.js} +1 -1
  44. package/dist/index-DXBHjFwY.cjs +5 -0
  45. package/dist/{index-fxuo68Am.js → index-DlTEPwjW.js} +1344 -1289
  46. package/dist/{index-fThd1uce.js → index-RwAuF_BE.js} +39 -39
  47. package/dist/{json-diff-viewer-B2Q7bs-U.cjs → json-diff-viewer-Bpsk0toO.cjs} +1 -1
  48. package/dist/{json-diff-viewer-C0kg3Rss.js → json-diff-viewer-is2P3TOV.js} +6 -6
  49. package/dist/{lang-panel-MB00AgoJ.cjs → lang-panel-BI5OFsBY.cjs} +1 -1
  50. package/dist/{lang-panel-DgDlmKaN.js → lang-panel-DwiCJRs9.js} +22 -22
  51. package/dist/{manage-design-tokens-nTmzLQyq.js → manage-design-tokens-D2Oz-jVp.js} +2 -2
  52. package/dist/{manage-design-tokens-modal-ayqKkRLc.js → manage-design-tokens-modal-ZR8PuhWC.js} +2 -2
  53. package/dist/{mark-as-template-BARMivkY.js → mark-as-template-C0Z2P_UF.js} +2 -2
  54. package/dist/{mark-as-template-CProQdMy.cjs → mark-as-template-muKJE1gk.cjs} +1 -1
  55. package/dist/{models-D95ZYr_x.js → models-BCu-p_QK.js} +4 -4
  56. package/dist/{models-5gOsRC56.cjs → models-D0RH2u4C.cjs} +1 -1
  57. package/dist/{nested-path-selector-content-DxW18z33.js → nested-path-selector-content-Ct80kFX-.js} +1 -1
  58. package/dist/{no-language-page-content-CB_UK8pU.js → no-language-page-content-BekrmPc5.js} +4 -4
  59. package/dist/{no-language-page-content-C2Q-PlyR.cjs → no-language-page-content-zn3891M8.cjs} +1 -1
  60. package/dist/{no-language-page-dialog-DsZDAaRd.js → no-language-page-dialog-dHlAqLlU.js} +2 -2
  61. package/dist/{no-language-page-dialog-B7SNu92-.cjs → no-language-page-dialog-wEXIlBuQ.cjs} +1 -1
  62. package/dist/{page-creator-CulX1J10.js → page-creator-6L7ehzhL.js} +4 -4
  63. package/dist/page-creator-CN2phGn5.cjs +1 -0
  64. package/dist/{page-lock-DbH7spVl.js → page-lock-C--D8qD7.js} +2 -2
  65. package/dist/{page-lock-BQr6vqz-.cjs → page-lock-DllloCJE.cjs} +1 -1
  66. package/dist/{page-locked-dialog-BgaqVH5J.js → page-locked-dialog-BD8LHbdC.js} +15 -15
  67. package/dist/{page-locked-dialog-B3ZmWOt_.cjs → page-locked-dialog-DzB8p0wl.cjs} +1 -1
  68. package/dist/{page-manager-new-ydVnl9s6.cjs → page-manager-new-DyjhsvPx.cjs} +1 -1
  69. package/dist/{page-manager-new-DNBm5H5A.js → page-manager-new-uFcGaZZY.js} +29 -29
  70. package/dist/{page-manager-search-and-filter-jYP_ub36.js → page-manager-search-and-filter-DK883UmG.js} +26 -26
  71. package/dist/{page-manager-search-and-filter-BhBT7qY0.cjs → page-manager-search-and-filter-zfR5i_GU.cjs} +1 -1
  72. package/dist/{page-revisions-content-ZOroDtgV.cjs → page-revisions-content-Bi2ehMnj.cjs} +1 -1
  73. package/dist/{page-revisions-content-YGYK8pv9.js → page-revisions-content-D3rIJj9X.js} +24 -24
  74. package/dist/pages.cjs +1 -1
  75. package/dist/pages.d.ts +2 -0
  76. package/dist/pages.js +24 -23
  77. package/dist/{publish-pages-content-Du3LgWM2.cjs → publish-pages-content-BQUHNRCX.cjs} +1 -1
  78. package/dist/{publish-pages-content-BgdFWGKT.js → publish-pages-content-ByPf4lvE.js} +23 -23
  79. package/dist/{rte-widget-modal-B7wA8UGi.js → rte-widget-modal-Tj_pS3ql.js} +1 -1
  80. package/dist/{save-to-lib-hHRxVrjy.js → save-to-lib-CcUqS0s1.js} +62 -62
  81. package/dist/{save-to-lib-Dxisxuo9.cjs → save-to-lib-Cyeqcelv.cjs} +1 -1
  82. package/dist/{selected-block-display-5hDghITH.cjs → selected-block-display-Benbb_OW.cjs} +1 -1
  83. package/dist/{selected-block-display-BNX9ZuNH.js → selected-block-display-C6LxDm0H.js} +11 -11
  84. package/dist/{seo-panel-CBEV-Nds.js → seo-panel-1U9Q0Ato.js} +25 -25
  85. package/dist/{seo-panel-C1DEkfcC.cjs → seo-panel-CCuvQpwV.cjs} +1 -1
  86. package/dist/{shared-json-ld-4o0YbV25.js → shared-json-ld-DbzUITto.js} +46 -46
  87. package/dist/{shared-json-ld-DuXm_88W.cjs → shared-json-ld-bj77fq_b.cjs} +1 -1
  88. package/dist/{slug-input-DE-a4dMb.js → slug-input-P-CLfUrw.js} +1 -1
  89. package/dist/supabase-actions.cjs +1 -1
  90. package/dist/supabase-actions.d.ts +4 -7
  91. package/dist/supabase-actions.js +1 -1
  92. package/dist/{take-over-request-WL-btbiZ.js → take-over-request-Bwj_2nPR.js} +5 -5
  93. package/dist/{take-over-request-DR4RC8TT.cjs → take-over-request-R3HRgShm.cjs} +1 -1
  94. package/dist/{translation-warning-modal-Cef9OsyI.js → translation-warning-modal-BdkToZwn.js} +1 -1
  95. package/dist/{unmark-as-template-Dexn_9W7.cjs → unmark-as-template-BG882c_S.cjs} +1 -1
  96. package/dist/{unmark-as-template-D-5cQ61Q.js → unmark-as-template-DHDMooLZ.js} +2 -2
  97. package/dist/{unpublish-page-C-7RnGgj.js → unpublish-page-C4e_gIX8.js} +2 -2
  98. package/dist/{unpublish-page-C14PYuLT.cjs → unpublish-page-DudJ1znF.cjs} +1 -1
  99. package/dist/{unpublished-partials-modal-O0E8HViJ.js → unpublished-partials-modal-p_0N6V23.js} +1 -1
  100. package/dist/{web-preview-DOJ6E273.js → web-preview-BA08d7DN.js} +1 -1
  101. package/dist/{web-preview-CgKfKkdH.cjs → web-preview-MG0HZxgA.cjs} +1 -1
  102. package/package.json +1 -1
  103. package/dist/ai-panel-content-BV5Hzsso.js +0 -62
  104. package/dist/ai-panel-content-D0ugQDEu.cjs +0 -1
  105. package/dist/ai-prompt-input-MPIh7805.cjs +0 -1
  106. package/dist/ai-prompt-input-__vuJNRC.js +0 -652
  107. package/dist/index-Dh-fEHei.cjs +0 -5
  108. package/dist/page-creator-CnyQu1Te.cjs +0 -1
@@ -10069,7 +10069,7 @@ const qy = () => {
10069
10069
  /* @__PURE__ */ l("p", { className: "font-semibold", children: t("Oops! Something went wrong.") }),
10070
10070
  /* @__PURE__ */ l("p", { children: t("Please try again.") })
10071
10071
  ] }) });
10072
- }, Qy = P(null), Ad = () => D(Qy), ex = ee.lazy(() => import("./code-editor-LNL_FEZ0.js")), tx = () => {
10072
+ }, Qy = P(null), Ad = () => D(Qy), ex = ee.lazy(() => import("./code-editor-BfGHceIq.js")), tx = () => {
10073
10073
  const [t] = Ad(), e = G("onError", kt);
10074
10074
  return /* @__PURE__ */ l("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ g("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40", children: [
10075
10075
  /* @__PURE__ */ l(Ve, { fallback: /* @__PURE__ */ l(zn, { className: "h-full" }), children: /* @__PURE__ */ l(an, { fallback: /* @__PURE__ */ l(pr, {}), onError: e, children: /* @__PURE__ */ l(Zy, {}) }) }),
@@ -10292,7 +10292,7 @@ const qy = () => {
10292
10292
  /* @__PURE__ */ l("option", { value: "", children: "Select" }),
10293
10293
  d.map((u) => /* @__PURE__ */ l("option", { value: u.id, children: u.name }, u.id))
10294
10294
  ] }) });
10295
- }, ox = _o(() => import("./IconPicker-BJ6a_dl-.js").then((t) => ({ default: t.IconPicker }))), sx = (t) => {
10295
+ }, ox = _o(() => import("./IconPicker-CGtjTiWr.js").then((t) => ({ default: t.IconPicker }))), sx = (t) => {
10296
10296
  try {
10297
10297
  let e = t.replace(/<svg([^>]*)\sheight="[^"]*"([^>]*)>/gi, "<svg$1$2>").replace(/<svg([^>]*)\swidth="[^"]*"([^>]*)>/gi, "<svg$1$2>");
10298
10298
  return e = e.replace(/>\s+</g, "><"), e = e.replace(/\n/g, "").replace(/\s{2,}/g, " "), e = e.replace(/\s+=/g, "=").replace(/=\s+/g, "="), e = e.replace(/<!--[\s\S]*?-->/g, ""), e.trim();
@@ -11103,7 +11103,7 @@ const Hi = () => Ue(Md), vx = () => {
11103
11103
  ]
11104
11104
  }
11105
11105
  ) });
11106
- }, kx = ee.lazy(() => import("./rte-widget-modal-B7wA8UGi.js")), Cx = ({ blockId: t, id: e, placeholder: n, value: r, onChange: o, onBlur: s }) => {
11106
+ }, kx = ee.lazy(() => import("./rte-widget-modal-Tj_pS3ql.js")), Cx = ({ blockId: t, id: e, placeholder: n, value: r, onChange: o, onBlur: s }) => {
11107
11107
  const i = re(null), [a, c] = $(!1), d = Nd({
11108
11108
  blockId: t,
11109
11109
  value: r,
@@ -14209,7 +14209,7 @@ const N0 = Xs(
14209
14209
  }
14210
14210
  ));
14211
14211
  Gt.displayName = Il.Root.displayName;
14212
- const $s = ({ className: t = "" }) => /* @__PURE__ */ l(Sp, { className: t }), S0 = _o(() => import("./manage-design-tokens-modal-ayqKkRLc.js"));
14212
+ const $s = ({ className: t = "" }) => /* @__PURE__ */ l(Sp, { className: t }), S0 = _o(() => import("./manage-design-tokens-modal-ZR8PuhWC.js"));
14213
14213
  function Jd({
14214
14214
  from: t = "default",
14215
14215
  classFromProps: e,
@@ -16565,7 +16565,7 @@ const vw = ({ value: t, onChange: e, disabled: n }) => {
16565
16565
  "popover-foreground": ["#3d3436", "#f2e9e4"]
16566
16566
  }
16567
16567
  }, Bw = _o(
16568
- () => import("./css-import-modal-ChRsUOVa.js").then((t) => ({ default: t.CssImportModal }))
16568
+ () => import("./css-import-modal-CEQccCmc.js").then((t) => ({ default: t.CssImportModal }))
16569
16569
  ), bu = "chai-builder-previous-theme", Iw = [
16570
16570
  { shadcn_default: Sw },
16571
16571
  { twitter_theme: Ew },
@@ -17782,7 +17782,7 @@ const xk = ({ partialBlockId: t }) => {
17782
17782
  /* @__PURE__ */ l(so, { className: "mx-auto text-3xl" }),
17783
17783
  /* @__PURE__ */ l("h1", { children: e("Please select a block to edit settings or styles") })
17784
17784
  ] }) });
17785
- }, vk = ee.lazy(() => import("./manage-design-tokens-nTmzLQyq.js")), jt = 280, kk = ({ isActive: t, show: e }) => /* @__PURE__ */ l(ne, { variant: t ? "default" : "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ l(Of, { className: "h-5 w-5" }) }), Ck = ({ isActive: t, show: e }) => yt() && /* @__PURE__ */ l(ne, { variant: t ? "default" : "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ l(Pf, { className: "h-5 w-5" }) }), Nk = ({ isActive: t, show: e }) => G("flags.ai", !1) ? /* @__PURE__ */ l(ne, { variant: t ? "default" : "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ l(Qs, {}) }) : null;
17785
+ }, vk = ee.lazy(() => import("./manage-design-tokens-D2Oz-jVp.js")), jt = 280, kk = ({ isActive: t, show: e }) => /* @__PURE__ */ l(ne, { variant: t ? "default" : "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ l(Of, { className: "h-5 w-5" }) }), Ck = ({ isActive: t, show: e }) => yt() && /* @__PURE__ */ l(ne, { variant: t ? "default" : "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ l(Pf, { className: "h-5 w-5" }) }), Nk = ({ isActive: t, show: e }) => G("flags.ai", !1) ? /* @__PURE__ */ l(ne, { variant: t ? "default" : "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ l(Qs, {}) }) : null;
17786
17786
  Fs("add-block", {
17787
17787
  button: Ck,
17788
17788
  label: "Add Blocks",
@@ -18802,29 +18802,29 @@ if (typeof window > "u")
18802
18802
  throw new Error("@chaibuilder/sdk is only supported in the browser. Avoid using it in the server side.");
18803
18803
  export {
18804
18804
  Nw as $,
18805
- Yo as A,
18805
+ Se as A,
18806
18806
  $i as B,
18807
18807
  Bd as C,
18808
18808
  Ho as D,
18809
- Xo as E,
18810
- _r as F,
18811
- Xd as G,
18812
- qd as H,
18813
- R0 as I,
18814
- Qd as J,
18815
- eu as K,
18809
+ we as E,
18810
+ Jo as F,
18811
+ Yo as G,
18812
+ Xo as H,
18813
+ _r as I,
18814
+ Xd as J,
18815
+ qd as K,
18816
18816
  Vn as L,
18817
- Rx as M,
18817
+ R0 as M,
18818
18818
  Od as N,
18819
- Fd as O,
18819
+ Qd as O,
18820
18820
  jo as P,
18821
- zd as Q,
18822
- Hd as R,
18821
+ eu as Q,
18822
+ Rx as R,
18823
18823
  Gi as S,
18824
18824
  Ko as T,
18825
- ae as U,
18826
- lC as V,
18827
- oh as W,
18825
+ Fd as U,
18826
+ zd as V,
18827
+ Hd as W,
18828
18828
  Fi as X,
18829
18829
  zi as Y,
18830
18830
  Er as Z,
@@ -18869,16 +18869,16 @@ export {
18869
18869
  iu as aZ,
18870
18870
  $a as a_,
18871
18871
  ft as aa,
18872
- Or as ab,
18873
- Cu as ac,
18874
- Nu as ad,
18875
- zn as ae,
18876
- Ol as af,
18877
- ue as ag,
18878
- Nn as ah,
18879
- cC as ai,
18880
- hi as aj,
18881
- Dk as ak,
18872
+ Nn as ab,
18873
+ cC as ac,
18874
+ hi as ad,
18875
+ Dk as ae,
18876
+ Or as af,
18877
+ Cu as ag,
18878
+ Nu as ah,
18879
+ zn as ai,
18880
+ Ol as aj,
18881
+ ue as ak,
18882
18882
  zm as al,
18883
18883
  Vm as am,
18884
18884
  $o as an,
@@ -18924,13 +18924,13 @@ export {
18924
18924
  dx as o,
18925
18925
  Gt as p,
18926
18926
  cx as q,
18927
- kn as r,
18928
- Cn as s,
18929
- Ft as t,
18927
+ ae as r,
18928
+ lC as s,
18929
+ oh as t,
18930
18930
  Ad as u,
18931
- _e as v,
18932
- Ne as w,
18933
- Se as x,
18934
- we as y,
18935
- Jo as z
18931
+ kn as v,
18932
+ Cn as w,
18933
+ Ft as x,
18934
+ _e as y,
18935
+ Ne as z
18936
18936
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./index-DrzR7vXl.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-Dh-fEHei.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-DrzR7vXl.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-DXBHjFwY.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}
@@ -1,12 +1,12 @@
1
1
  import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
- import { D as U, e as V, f as _, g as G, ab as $, a7 as A, B as P } from "./index-fThd1uce.js";
2
+ import { D as V, e as _, f as q, g as G, af as $, a7 as A, B as P } from "./index-RwAuF_BE.js";
3
3
  import { B as R } from "./register-chai-top-bar-D6GjnauV.js";
4
4
  import { formatDate as Q } from "date-fns";
5
5
  import { startsWith as T, replace as W, isString as X, trim as Y, isArray as Z, map as ee, isPlainObject as te, mapValues as re } from "lodash-es";
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 { ap as ie, aq as oe, A as ce, an as de } from "./index-fxuo68Am.js";
9
+ import { ao as ie, ap as oe, A as ce, am as de } from "./index-DlTEPwjW.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:");
@@ -160,7 +160,7 @@ const pe = (t) => {
160
160
  }), d;
161
161
  };
162
162
  function Oe({ open: t, compare: n, onOpenChange: o }) {
163
- const s = n[0], d = n[1], [l, r] = D(null), [f, m] = D("split"), [c, p] = D(!1), [y, O] = D(!0), [g, N] = D("blocks"), { data: h, isLoading: x } = me(s, d), { leftData: a, rightData: w, options: q } = I(() => {
163
+ const s = n[0], d = n[1], [l, r] = D(null), [f, m] = D("split"), [c, p] = D(!1), [y, O] = D(!0), [g, N] = D("blocks"), { data: h, isLoading: x } = me(s, d), { leftData: a, rightData: w, options: U } = I(() => {
164
164
  var b, B;
165
165
  const i = (b = h == null ? void 0 : h.version1) == null ? void 0 : b[g], v = (B = h == null ? void 0 : h.version2) == null ? void 0 : B[g], k = S(i), C = S(v), J = ge(h == null ? void 0 : h.version1, h == null ? void 0 : h.version2);
166
166
  return { leftData: k, rightData: C, options: J };
@@ -178,13 +178,13 @@ function Oe({ open: t, compare: n, onOpenChange: o }) {
178
178
  console.error("Failed to copy:", k);
179
179
  }
180
180
  }, L = (i) => JSON.stringify(i, null, 2);
181
- return /* @__PURE__ */ e(U, { open: t, onOpenChange: o, children: /* @__PURE__ */ u(V, { className: "flex h-[90vh] w-[95vw] max-w-[1900px] flex-col p-6", children: [
182
- /* @__PURE__ */ e(_, { className: "pb-4 pt-0", children: /* @__PURE__ */ u(G, { className: "flex items-center justify-between gap-2 leading-none", children: [
181
+ return /* @__PURE__ */ e(V, { open: t, onOpenChange: o, children: /* @__PURE__ */ u(_, { className: "flex h-[90vh] w-[95vw] max-w-[1900px] flex-col p-6", children: [
182
+ /* @__PURE__ */ e(q, { className: "pb-4 pt-0", children: /* @__PURE__ */ u(G, { className: "flex items-center justify-between gap-2 leading-none", children: [
183
183
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
184
184
  /* @__PURE__ */ e(z, { className: "h-5 w-5" }),
185
185
  "Compare",
186
186
  "",
187
- q.map((i) => /* @__PURE__ */ e(
187
+ U.map((i) => /* @__PURE__ */ e(
188
188
  "div",
189
189
  {
190
190
  className: `cursor-pointer rounded-full border px-2.5 py-1 text-xs leading-none ${g === i.key ? "border-blue-500 bg-blue-500 text-white" : "border-gray-600 text-gray-600 hover:bg-gray-200"}`,
@@ -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-DrzR7vXl.cjs"),n=require("./index-Dh-fEHei.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-BaJ0oesv.cjs"))),q=c.lazy(()=>Promise.resolve().then(()=>require("./unpublish-page-C14PYuLT.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-DrzR7vXl.cjs"),n=require("./index-DXBHjFwY.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-BOxoMgyl.cjs"))),q=c.lazy(()=>Promise.resolve().then(()=>require("./unpublish-page-DudJ1znF.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,15 +1,15 @@
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
- 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, r as Q, s as V, t as X, v as w } from "./index-fThd1uce.js";
4
- import { as as Y, k as T, L as I, at as Z, j as ee, au as se, h as ae, av as f, aw as o } from "./index-fxuo68Am.js";
5
- import { find as G, startsWith as E, isEqual as te, filter as ne, get as D, map as le, isEmpty as ie } from "lodash-es";
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 w } from "./index-RwAuF_BE.js";
4
+ import { ar as Y, k as T, L as I, as as Z, j as ee, at as se, h as ae, au as f, av as o } from "./index-DlTEPwjW.js";
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";
8
8
  import { useTranslation as U } from "react-i18next";
9
9
  import { toast as ge } from "sonner";
10
10
  import { useSetAtom as pe } from "jotai";
11
11
  const fe = ({ page: a, onClose: g }) => {
12
- const { t: l } = U(), [i, v] = S(a.slug || ""), { mutate: N, isPending: y } = Y(), { data: n } = T(), r = G(n, { key: a == null ? void 0 : a.pageType }), x = (m) => {
12
+ const { t: l } = U(), [i, v] = S(a.slug || ""), { mutate: N, isPending: y } = Y(), { data: t } = T(), r = G(t, { key: a == null ? void 0 : a.pageType }), x = (m) => {
13
13
  if (m.preventDefault(), !(a != null && a.primaryPage) && Object.keys(I).some((p) => i === `/${p}` || E(i, `/${p}/`))) {
14
14
  ge.error(l("Error"), {
15
15
  description: l("Slugs cannot start with a language code for primary page")
@@ -78,24 +78,24 @@ const fe = ({ page: a, onClose: g }) => {
78
78
  )
79
79
  ] })
80
80
  ] }),
81
- /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(A, { type: "submit", disabled: y || !E(i, `/${d}`) || te(a == null ? void 0 : a.slug, i), children: l(y ? "Changing..." : "Change Slug") }) })
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-BegGYX7_.js")), ye = z(() => import("./unpublish-page-C-7RnGgj.js")), ke = () => {
85
- const { t: a } = U(), g = pe(Z), { selectedLang: l, fallbackLang: i, setSelectedLang: v } = K(), { data: N, isFetching: y } = ee(), { data: n } = se(), { data: r } = T(), x = he(() => {
86
- const t = r == null ? void 0 : r.find((h) => h.key === (n == null ? void 0 : n.pageType));
87
- return n != null && n.dynamic ? t == null ? void 0 : t.dynamicSlug : "";
88
- }, [r, n == null ? void 0 : n.pageType, n == null ? void 0 : n.dynamic]), [d, m] = S(null), [u, b] = S(null), [p, _] = S(null), { data: P } = ae(), $ = ne(
84
+ }, Ne = z(() => import("./delete-page-8h4dNP7d.js")), ye = z(() => import("./unpublish-page-C4e_gIX8.js")), ke = () => {
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
+ const n = r == null ? void 0 : r.find((h) => h.key === (t == null ? void 0 : t.pageType));
87
+ return t != null && t.dynamic ? n == null ? void 0 : n.dynamicSlug : "";
88
+ }, [r, t == null ? void 0 : t.pageType, t == null ? void 0 : t.dynamic]), [d, m] = S(null), [u, b] = S(null), [p, _] = S(null), { data: P } = ae(), $ = te(
89
89
  D(P, "languages") || ["en"],
90
- (t) => !G(N, { lang: t }) && t !== D(P, "fallbackLang")
90
+ (n) => !G(N, { lang: n }) && n !== D(P, "fallbackLang")
91
91
  );
92
92
  return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
93
93
  /* @__PURE__ */ e("ul", { className: "space-y-2", children: y ? /* @__PURE__ */ s("div", { className: "w-full space-y-3 py-4", children: [
94
94
  /* @__PURE__ */ e("div", { className: "h-8 w-full animate-pulse rounded bg-gray-300" }),
95
95
  /* @__PURE__ */ e("div", { className: "h-8 w-full animate-pulse rounded bg-gray-300" }),
96
96
  /* @__PURE__ */ e("div", { className: "h-8 w-full animate-pulse rounded bg-gray-300" })
97
- ] }) : le(N, (t) => {
98
- const h = t.lang, C = t.slug, k = !t.primaryPage;
97
+ ] }) : le(N, (n) => {
98
+ const h = n.lang, C = n.slug, k = !n.primaryPage;
99
99
  return /* @__PURE__ */ s(M, { children: [
100
100
  /* @__PURE__ */ s(
101
101
  "li",
@@ -105,7 +105,7 @@ const fe = ({ page: a, onClose: g }) => {
105
105
  children: [
106
106
  /* @__PURE__ */ s("div", { className: "flex-1 gap-x-3", children: [
107
107
  /* @__PURE__ */ s("div", { className: "flex items-center gap-x-2 text-[13px] text-slate-800", children: [
108
- /* @__PURE__ */ e("div", { className: `h-2.5 w-2.5 rounded-full ${t.online ? "bg-green-300" : "bg-gray-300"}` }),
108
+ /* @__PURE__ */ e("div", { className: `h-2.5 w-2.5 rounded-full ${n.online ? "bg-green-300" : "bg-gray-300"}` }),
109
109
  D(I, k ? i : h, h)
110
110
  ] }),
111
111
  /* @__PURE__ */ s("div", { children: [
@@ -117,7 +117,7 @@ const fe = ({ page: a, onClose: g }) => {
117
117
  "Name:",
118
118
  /* @__PURE__ */ s("b", { className: "font-medium", children: [
119
119
  " ",
120
- t.name,
120
+ n.name,
121
121
  " "
122
122
  ] })
123
123
  ] })
@@ -144,8 +144,8 @@ const fe = ({ page: a, onClose: g }) => {
144
144
  onClick: (c) => {
145
145
  c.stopPropagation(), g({
146
146
  edit: !0,
147
- id: t.id,
148
- primaryPage: t.primaryPage
147
+ id: n.id,
148
+ primaryPage: n.primaryPage
149
149
  });
150
150
  },
151
151
  children: [
@@ -154,12 +154,12 @@ const fe = ({ page: a, onClose: g }) => {
154
154
  ]
155
155
  }
156
156
  ) }),
157
- /* @__PURE__ */ e(f, { permissions: [o.UNPUBLISH_PAGE], children: (t == null ? void 0 : t.online) && /* @__PURE__ */ s(
157
+ /* @__PURE__ */ e(f, { permissions: [o.UNPUBLISH_PAGE], children: (n == null ? void 0 : n.online) && /* @__PURE__ */ s(
158
158
  w,
159
159
  {
160
160
  className: "flex cursor-pointer items-center gap-2",
161
161
  onClick: (c) => {
162
- c.stopPropagation(), b(t);
162
+ c.stopPropagation(), b(n);
163
163
  },
164
164
  children: [
165
165
  /* @__PURE__ */ e(me, { className: "size-3" }),
@@ -172,7 +172,7 @@ const fe = ({ page: a, onClose: g }) => {
172
172
  {
173
173
  className: "flex cursor-pointer items-center gap-2",
174
174
  onClick: (c) => {
175
- c.stopPropagation(), m(t);
175
+ c.stopPropagation(), m(n);
176
176
  },
177
177
  children: [
178
178
  /* @__PURE__ */ e(ue, { className: "size-3" }),
@@ -186,7 +186,7 @@ const fe = ({ page: a, onClose: g }) => {
186
186
  ) })
187
187
  ]
188
188
  },
189
- t.id
189
+ n.id
190
190
  ),
191
191
  /* @__PURE__ */ e("div", { className: "h-1 w-full border-b" })
192
192
  ] });
@@ -199,7 +199,7 @@ const fe = ({ page: a, onClose: g }) => {
199
199
  disabled: ie($),
200
200
  onClick: () => {
201
201
  g({
202
- primaryPage: n == null ? void 0 : n.id,
202
+ primaryPage: t == null ? void 0 : t.id,
203
203
  edit: !1
204
204
  });
205
205
  },
@@ -1,5 +1,5 @@
1
1
  import { jsxs as a, Fragment as A, jsx as e } from "react/jsx-runtime";
2
- import { Z as he, _ as fe, $ as pe, a0 as K, a1 as ge, a2 as xe, a3 as ve, a4 as ke, a5 as Ne, a6 as be, a7 as Te, p as ye, a8 as Ce, a9 as we, aa as Ae } from "./index-fThd1uce.js";
2
+ import { Z as he, _ as fe, $ as pe, a0 as K, a1 as ge, a2 as xe, a3 as ve, a4 as ke, a5 as Ne, a6 as be, a7 as Te, p as ye, a8 as Ce, a9 as we, aa as Ae } from "./index-RwAuF_BE.js";
3
3
  import { z as X, B as v } from "./register-chai-top-bar-D6GjnauV.js";
4
4
  import { D as De } from "./STRINGS-BExFecZW.js";
5
5
  import { MagnifyingGlassIcon as q, PlusIcon as J, TokensIcon as je, ArrowLeftIcon as Oe, EyeOpenIcon as Y, Pencil1Icon as Se } from "@radix-ui/react-icons";
@@ -17,7 +17,7 @@ const W = (o) => {
17
17
  return h.length === 0 ? "" : h.length > 25 ? n("Token name must be 25 characters or less") : /^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(h) ? Object.entries(m).find(
18
18
  ([k, C]) => C.name === h && (!i || k !== u)
19
19
  ) ? n("Token name already exists") : "" : n("Only alphanumeric characters and hyphens allowed");
20
- }, Be = (o) => o.replace(/\s+/g, "-"), Fe = Re(() => import("./design-token-usage-Bgphgz_u.js")), te = ({
20
+ }, Be = (o) => o.replace(/\s+/g, "-"), Fe = Re(() => import("./design-token-usage-CVPBTF21.js")), te = ({
21
21
  tokenId: o,
22
22
  token: m,
23
23
  isDisabled: n,
@@ -1,5 +1,5 @@
1
1
  import { jsxs as l, jsx as e, Fragment as y } from "react/jsx-runtime";
2
- import { al as k, am as A, an as T, ao as M, ap as H, aq as _, ar as j, as as I, a7 as P, D as S, e as L, f as E, g as O, a1 as U, a2 as q, at as R, a3 as $, a4 as V, au as Y, a5 as z, a6 as B } from "./index-fThd1uce.js";
2
+ import { al as k, am as A, an as T, ao as M, ap as H, aq as _, ar as j, as as I, a7 as P, D as S, e as L, f as E, g as O, a1 as U, a2 as q, at as R, a3 as $, a4 as V, au as Y, a5 as z, a6 as B } from "./index-RwAuF_BE.js";
3
3
  import { TokensIcon as Q } from "@radix-ui/react-icons";
4
4
  import { useMemo as u, useEffect as b, useState as g, useCallback as w } from "react";
5
5
  import { useTranslation as F } from "react-i18next";
@@ -10,7 +10,7 @@ import ee from "@tailwindcss/container-queries";
10
10
  import se from "@tailwindcss/forms";
11
11
  import ne from "@tailwindcss/typography";
12
12
  import { u as ae } from "./fonts-B3UYxuJI.js";
13
- import re from "./manage-design-tokens-nTmzLQyq.js";
13
+ import re from "./manage-design-tokens-D2Oz-jVp.js";
14
14
  const te = () => {
15
15
  const [s] = T(), a = M(), [r] = H(), { document: n, window: i } = _(), t = ae();
16
16
  b(() => {
@@ -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
- 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-fThd1uce.js";
4
- import { o as j, k as O } from "./index-fxuo68Am.js";
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-RwAuF_BE.js";
4
+ import { o as j, k as O } from "./index-DlTEPwjW.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"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-DrzR7vXl.cjs"),y=require("./index-Dh-fEHei.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-DrzR7vXl.cjs"),y=require("./index-DXBHjFwY.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,4 +1,4 @@
1
- const i = [
1
+ const e = [
2
2
  {
3
3
  id: "google/gemini-2.5-flash",
4
4
  name: "Gemini 2.5 Flash",
@@ -62,9 +62,9 @@ const i = [
62
62
  description: "2x Credits",
63
63
  multiplier: 2
64
64
  }
65
- ], o = (e) => i.find((r) => r.id === e), n = () => i[0];
65
+ ], r = (i) => e.find((o) => o.id === i), n = () => e.find((i) => i.id === "google/gemini-3-flash") || e[0];
66
66
  export {
67
- i as A,
68
- o as a,
67
+ e as A,
68
+ r as a,
69
69
  n as g
70
70
  };
@@ -1 +1 @@
1
- "use strict";const i=[{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",provider:"google",description:"0.5x Credits",multiplier:.5},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",provider:"google",description:"1.25x Credits",multiplier:1.25},{id:"google/gemini-3-flash",name:"Gemini 3 Flash",provider:"google",description:"1x Credits",multiplier:1},{id:"google/gemini-3-pro",name:"Gemini 3 Pro",provider:"google",description:"2.5x Credits",multiplier:2.5},{id:"openai/gpt-5",name:"GPT-5",provider:"openai",description:"2x Credits",multiplier:2},{id:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5",provider:"anthropic",description:"1x Credits",multiplier:1},{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",provider:"anthropic",description:"3x Credits",multiplier:3},{id:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5",provider:"anthropic",description:"3x Credits",multiplier:3},{id:"openai/gpt-4.1",name:"GPT-4.1",provider:"openai",description:"2x Credits",multiplier:2}],o=e=>i.find(r=>r.id===e),t=()=>i[0];exports.AI_MODELS=i;exports.getDefaultModel=t;exports.getModelById=o;
1
+ "use strict";const i=[{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",provider:"google",description:"0.5x Credits",multiplier:.5},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",provider:"google",description:"1.25x Credits",multiplier:1.25},{id:"google/gemini-3-flash",name:"Gemini 3 Flash",provider:"google",description:"1x Credits",multiplier:1},{id:"google/gemini-3-pro",name:"Gemini 3 Pro",provider:"google",description:"2.5x Credits",multiplier:2.5},{id:"openai/gpt-5",name:"GPT-5",provider:"openai",description:"2x Credits",multiplier:2},{id:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5",provider:"anthropic",description:"1x Credits",multiplier:1},{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",provider:"anthropic",description:"3x Credits",multiplier:3},{id:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5",provider:"anthropic",description:"3x Credits",multiplier:3},{id:"openai/gpt-4.1",name:"GPT-4.1",provider:"openai",description:"2x Credits",multiplier:2}],r=e=>i.find(o=>o.id===e),d=()=>i.find(e=>e.id==="google/gemini-3-flash")||i[0];exports.AI_MODELS=i;exports.getDefaultModel=d;exports.getModelById=r;
@@ -2,7 +2,7 @@ import { jsx as c, jsxs as n } from "react/jsx-runtime";
2
2
  import { ChevronLeft as v, ChevronRight as g } from "lucide-react";
3
3
  import * as l from "react";
4
4
  import { B as k } from "./register-chai-top-bar-D6GjnauV.js";
5
- import { P as N, C as x, i as P, j as S, k as w, l as B, m as d } from "./index-fThd1uce.js";
5
+ import { P as N, C as x, i as P, j as S, k as w, l as B, m as d } from "./index-RwAuF_BE.js";
6
6
  function I({
7
7
  data: o,
8
8
  onSelect: m,
@@ -1,11 +1,11 @@
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
- import { d as u, G as w, H as p, I as f, J as P, K as C } from "./index-fThd1uce.js";
4
- import { c as S, d as L, L as x, B as N } from "./index-fxuo68Am.js";
3
+ import { d as u, J as w, K as p, M as f, O as P, Q as C } from "./index-RwAuF_BE.js";
4
+ import { c as S, d as L, L as x, B as N } from "./index-DlTEPwjW.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";
8
- const k = () => {
8
+ const G = () => {
9
9
  const { t: a } = E(), [c, l] = S(), r = c.get("lang"), i = L(r), { setSelectedLang: g } = u(), d = () => {
10
10
  const n = new URLSearchParams(window.location.search);
11
11
  n.delete("lang");
@@ -39,5 +39,5 @@ const k = () => {
39
39
  ] }) });
40
40
  };
41
41
  export {
42
- k as default
42
+ G as default
43
43
  };
@@ -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-DrzR7vXl.cjs"),n=require("./index-Dh-fEHei.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-DrzR7vXl.cjs"),n=require("./index-DXBHjFwY.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 a } from "react/jsx-runtime";
2
- import { c as g, d as n } from "./index-fxuo68Am.js";
2
+ import { c as g, d as n } from "./index-DlTEPwjW.js";
3
3
  import { Suspense as s, lazy as t } from "react";
4
- const o = t(() => import("./no-language-page-content-CB_UK8pU.js")), l = () => {
4
+ const o = t(() => import("./no-language-page-content-BekrmPc5.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
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("./index-Dh-fEHei.cjs"),n=require("react"),t=n.lazy(()=>Promise.resolve().then(()=>require("./no-language-page-content-C2Q-PlyR.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-DXBHjFwY.cjs"),n=require("react"),t=n.lazy(()=>Promise.resolve().then(()=>require("./no-language-page-content-zn3891M8.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,11 +1,11 @@
1
1
  import { jsx as s, jsxs as a, Fragment as We } from "react/jsx-runtime";
2
2
  import { z as Y, h as ye, B as W } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { j as os, p as z, X as ee, Y as se, P as le, C as ae, k as ne, l as G, m as I, ax as cs, d as us } from "./index-fThd1uce.js";
3
+ import { j as os, p as z, X as ee, Y as se, P as le, C as ae, k as ne, l as G, m as I, ax as cs, d as us } from "./index-RwAuF_BE.js";
4
4
  import { useState as y, useRef as ms, useEffect as ze, useMemo as B, startTransition as Oe } from "react";
5
- import { r as te, S as hs, c as Be } from "./slug-input-DE-a4dMb.js";
5
+ import { r as te, S as hs, c as Be } from "./slug-input-P-CLfUrw.js";
6
6
  import { isEmpty as Ie, startCase as de, filter as ps, find as ge, groupBy as ds, pick as fs, set as P } from "lodash-es";
7
7
  import { ChevronDown as re, Search as ie, Check as R } from "lucide-react";
8
- import { ap as Re, aq as Ue, A as oe, k as gs, ar as ys, e as vs, f as Ns, g as Ss, aw as bs, L as ws } from "./index-fxuo68Am.js";
8
+ import { ao as Re, ap as Ue, A as oe, k as gs, aq as ys, e as vs, f as Ns, g as Ss, av as bs, L as ws } from "./index-DlTEPwjW.js";
9
9
  import { useQuery as qe } from "@tanstack/react-query";
10
10
  import { toast as E } from "sonner";
11
11
  import { g as $e } from "./get-seo-defaults-9zHebckY.js";
@@ -201,7 +201,7 @@ function Cs({
201
201
  /* @__PURE__ */ s("option", { value: "none", children: "None" }),
202
202
  w.map((n) => {
203
203
  const d = S(n.slug), N = d > 0 ? b(d) : "", O = h(n.slug);
204
- return (g == null ? void 0 : g.id) === n.id || n.slug.startsWith(g == null ? void 0 : g.slug) ? null : /* @__PURE__ */ a("option", { value: n.id, children: [
204
+ return (g == null ? void 0 : g.id) === n.id || n.slug.startsWith(((g == null ? void 0 : g.slug) || "") + "/") ? null : /* @__PURE__ */ a("option", { value: n.id, children: [
205
205
  N,
206
206
  n.name,
207
207
  " (",