@infuro/cms-core 1.0.11 → 1.0.14

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.
package/dist/admin.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/admin/pages/AdminLayout.tsx
4
4
  import React5, { useEffect as useEffect2, useState as useState2 } from "react";
5
- import { SessionProvider, useSession as useSession2 } from "next-auth/react";
5
+ import { useSession as useSession2 } from "next-auth/react";
6
6
  import { useRouter, usePathname as usePathname3 } from "next/navigation";
7
7
  import { Toaster } from "sonner";
8
8
 
@@ -334,7 +334,7 @@ var AdminConfigContext = createContext(defaultValue);
334
334
  var INFURO_FAVICON_BASE64 = "data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8V////bv///7D////R////0f///7D///9u////FQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wL///9s0qun7q9qYv/DkYv/6tfV///+/v///////////////+7///9r////AgAAAAAAAAAAAAAAAP///wL///+Q/////sqcl/+WOzH/ljsx/5c9M//AiYP/+/j4/////////////////v///5D///8CAAAAAAAAAAD///9s/////v/////Oo5//lz00/5Y7Mf+WOzH/ljsx/7Z3cP/9+/v////////////////+////bAAAAAD///8V////7v///////////v39//Tq6f/QqKP/m0U8/5Y7Mf+WOzH/z6ah/////////////////////+7///8V////bv///////////////////////////////+XOy/+ZQTf/ljsx/59MQ//69fX/////////////////////bv///7D/////////////////////////////////////wYyG/5Y7Mf+WOzH/4MTC/////////////////////7D////R//////////////////7+//79/f/+/f3//v39/+DGw/+WOzH/ljsx/82inf/////////////////////R////0f///////////////9Svq/+mWVH/pllR/6ZZUf+iUUj/ljsx/5Y7Mf/KnJf/////////////////////0f///7D////////////////KnJf/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/062p/////////////////////7D///9u////////////////0amk/6FQSP+hUEj/oVBI/6JRSP+mWVH/plpS/+7g3v////////////////////9u////Ff///+7///////////7+/v/9/Pz/9u7t/8SSjP/Dj4r/9ezr//79/f/////////////////////u////FQAAAAD///9s/////v///////////////8OPif+WOzH/ljsx/7+Jgv/////////////////////+////bAAAAAAAAAAA////Av///5D////+//////////+9hH7/ljsx/5Y7Mf+8g3z////////////////+////kP///wIAAAAAAAAAAAAAAAD///8C////bP///+7/////8OTi/7R0bP+zcmr/8OLh///////////u////bP///wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8V////bv///7D////R////0f///7D///9u////FQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAACAAAABAAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8C////Hf///0n///95////mf///67///+u////mf///3n///9J////Hf///wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8I////Tf///7D////p/////v////////////////////////////////////7////p////sP///03///8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8C////Pfjz8r7HlpH7wY2H/86lof/iysf/9e3s///+/v//////////////////////////////////////////+////77///89////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////Cf///37////z9Ovq/6BORf+WOzH/ljsx/5Y8Mv+hUEf/v4iC/+rY1v/+/f3///////////////////////////////////////////H///99////CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wr///+d/////P/////06+r/oE5F/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/m0Q7/8WTjf/38PD///////////////////////////////////////////z///+d////CgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8J////nf////3///////////Tr6v+gTkX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/61mX//w4+L///////////////////////////////////////////3///+d////CQAAAAAAAAAAAAAAAAAAAAAAAAAA////Av///37////8////////////////9Ovq/6BORf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6daUv/v4uD///////////////////////////////////////////z///9+////AgAAAAAAAAAAAAAAAAAAAAD///89////8//////////////////////48fD/rGRc/5pCOf+YPjT/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6xkXf/37+////////////////////////////////////////////P///89AAAAAAAAAAAAAAAA////CP///77////////////////////////////////7+Pf/8eXj/+DGw/++hn//m0U8/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/8GLhf/9/Pz//////////////////////////////////////////77///8IAAAAAAAAAAD///9N////+/////////////////////////////////////////////////7+/v/p1tP/rGRd/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/mkI4/+XPzf//////////////////////////////////////////+////00AAAAA////Av///7D////////////////////////////////////////////////////////////////06+r/r2pi/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/tndw//38+///////////////////////////////////////////sP///wL///8d////6f/////////////////////////////////////////////////////////////////////x5eP/olJJ/5Y7Mf+WOzH/ljsx/5Y7Mf+aQjn/7dza///////////////////////////////////////////p////Hf///0n////+///////////////////////////////////////////////////////////////////////////Ur6v/ljwy/5Y7Mf+WOzH/ljsx/5Y7Mf/Oo5////////////////////////////////////////////7///9J////ef////////////////////////////////////////////////////////////////////////////////fw7/+jVEv/ljsx/5Y7Mf+WOzH/ljsx/7Nxav///////////////////////////////////////////////3n///+Z/////////////////////////////////////////////////////////////////////////////////////7yCfP+WOzH/ljsx/5Y7Mf+WOzH/pllQ//r29f//////////////////////////////////////////mf///67///////////////////////////////////////////79/f/9/Pz//fz8//38/P/9/Pz//fz8//38/P/9/Pz/yZuW/5Y7Mf+WOzH/ljsx/5Y7Mf+gT0b/9evr//////////////////////////////////////////+u////rv/////////////////////////////////////69vb/wo2I/7Z3cf+2d3H/tndx/7Z3cf+2d3H/tndx/7Z3cf+lV0//ljsx/5Y7Mf+WOzH/ljsx/6BORf/06+r//////////////////////////////////////////67///+Z//////////////////////////////////////Tr6v+gTkX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/oE5F//Tr6v//////////////////////////////////////////mf///3n/////////////////////////////////////9Ovq/6BORf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+lVk7/+fPz//////////////////////////////////////////95////Sf////7////////////////////////////////06+r/oE5F/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/7FuZ////v7//////////////////////////////////////v///0n///8d////6f////////////////////////////////Tr6v+gTkX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/zKCb///////////////////////////////////////////p////Hf///wL///+w////////////////////////////////+PLx/7d4cf+tZl//rWZf/61mX/+tZl//rWZf/61mX/+tZl//rmdg/7Z3cP+2d3H/tndx/7h7df/w4uH//////////////////////////////////////////7D///8CAAAAAP///03////7/////////////////////////////////Pv6//z6+f/8+vn//Pr5//z6+f/z6un/48zJ/+LKx//y5+b//fz8//38/P/9/Pz//fz8///////////////////////////////////////////7////TQAAAAAAAAAA////CP///77/////////////////////////////////////////////////////4MXC/6VXTv+WPDL/ljwy/6JRSP/aubb///7+/////////////////////////////////////////////////////77///8IAAAAAAAAAAAAAAAA////Pf////P///////////////////////////////////////////Xs6/+jU0r/ljsx/5Y7Mf+WOzH/ljsx/59MQv/w5OL////////////////////////////////////////////////z////PQAAAAAAAAAAAAAAAAAAAAD///8C////fv////z/////////////////////////////////////3sK//5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/9m5tf///////////////////////////////////////////P///37///8CAAAAAAAAAAAAAAAAAAAAAAAAAAD///8J////nf////3////////////////////////////////ZuLX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/17Sw//////////////////////////////////////3///+d////CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8K////nf////z//////////////////////////+zc2v+aQzn/ljsx/5Y7Mf+WOzH/ljsx/5pDOf/r2tj////////////////////////////////8////nf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8J////fv////P//////////////////////v39/8eYkv+YPjT/ljsx/5Y7Mf+YPjT/xpSP//79/f//////////////////////////8////37///8JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8C////Pf///77////7/////////////////fv6/+DEwf/Ekoz/wY2H/97Bvv/8+vr/////////////////////+////77///89////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////CP///03///+w////6f////7////////////////////////////////////+////6f///7D///9N////CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wL///8d////Sf///3n///+Z////rv///67///+Z////ef///0n///8d////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAADAAAABgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8E////DP///xr///80////Rv///1n///9q////gP///4D///9q////Wf///0b///80////Gv///wz///8EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////CP///y7///9g////lP///7v////V////6P////r////8/////P////z////8////+v///+j////V////u////5T///9g////Lv///wgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wf///81////k////8/////v////+v////////////////////////////////////////////////////////////////////r////v////z////5P///81////BwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8G////Kv37+3zt3Nrd27y5/Nm6t//fxMH/59LQ//Dk4v/48vH//fv6//////////////////////////////////////////////////////////////////////z////d////fP///yr///8GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///xH///9g////wvz5+ffNop3+m0U8/5c+NP+cRz7/pFVN/65oYP+8gnv/0qun/+jU0v/59fT//v7+///////////////////////////////////////////////////////////+////9////8L///9f////EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///4n////m/////fv4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+XPTT/m0Q6/6ZaUf/BjIX/6NXT//z5+f////////////////////////////////////////////////////////////////3////k////if///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wH///8i////pP////f///////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+XPjT/oVFI/8yhnP/x5OP//vz8////////////////////////////////////////////////////////////////9////6T///8i////AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///yL///+d////8/////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5tEOv+3eHL/48rH//37+/////////////////////////////////////////////////////////////////P///+d////IgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///6T////z//////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+YPjT/qFxT/9y+uv/9+vr////////////////////////////////////////////////////////////////z////pP///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8R////if////f///////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsy/6NUS//Yt7P//Pn4////////////////////////////////////////////////////////////////9////4n///8RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wb///9g////5v////////////////////////////////v4+P/KnZj/mUI4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5c8Mv+pXlb/38PA//38/P///////////////////////////////////////////////////////////////+b///9g////BgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///yr////C/////f////////////////////////////////38+//dwLz/qF1V/51JP/+bRDv/mD40/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+XPTP/qWBY/+vZ2P///v7///////////////////////////////////////////////////////////3////C////KgAAAAAAAAAAAAAAAAAAAAAAAAAA////B////3z////3///////////////////////////////////////////9+/r/9/Dv/+zc2f/dwLz/x5iT/7BrY/+eS0H/lz0z/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/lzwy/7d6c//06un////////////////////////////////////////////////////////////////3////fP///wcAAAAAAAAAAAAAAAAAAAAA////Nf///93////+//////////////////////////////////////////////////////7+/v/+/v7//fz8//Hm5f/XtLH/s3Fq/5lCOP+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/51JP//Sq6b//Pn5///////////////////////////////////////////////////////////+////3f///zUAAAAAAAAAAAAAAAD///8I////k/////z////////////////////////////////////////////////////////////////////////////////9+/v/8eTj/8aVkP+dRz7/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5c8Mv+vamL/7uDf/////////////////////////////////////////////////////////////////P///5P///8IAAAAAAAAAAD///8u////z/////////////////////////////////////////////////////////////////////////////////////////////////fx8P/ImZP/nUg//5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+ZQTj/0qyo//38/P///////////////////////////////////////////////////////////////8////8uAAAAAP///wT///9g////7//////////////////////////////////////////////////////////////////////////////////////////////////////07Or/xJGL/5hAN/+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/rGRd//Tq6P///////////////////////////////////////////////////////////////+////9g////BP///wz///+U////+v////////////////////////////////////////////////////////////////////////////////////////////////////////7/8+jm/7Nya/+WPDP/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/mkQ7/9m3s////v7///////////////////////////////////////////////////////////r///+U////DP///xr///+7/////////////////////////////////////////////////////////////////////////////////////////////////////////////////v7+/+HHxP+hUEf/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljwy/7yBe//69/f///////////////////////////////////////////////////////////////+7////Gv///zT////V//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////bu7f+7gHr/mD40/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6xkXP/u4N/////////////////////////////////////////////////////////////////V////NP///0b////o//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////38/P/XtK//nEY9/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6BNRP/iycb////////////////////////////////////////////////////////////////o////Rv///1n////6///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////o1NL/pVhQ/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5xGPP/Yt7L//v39///////////////////////////////////////////////////////////6////Wf///2r////8///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////06un/sW1m/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5pDOf/PpKD//Pr5///////////////////////////////////////////////////////////8////av///4D////8/////////////////////////////////////////////////////////////v7//fv7//37+v/9+/r//fv6//37+v/9+/r//fv6//37+v/9+/r//fv6//37+v/06un/snBp/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lBOP/KnJj/+/j4///////////////////////////////////////////////////////////8////gP///4D////8//////////////////////////////////////////////////////79/f/s3Nr/z6ej/8uemv/Lnpr/y56a/8uemv/Lnpr/y56a/8uemv/Lnpr/y56a/8uemv/GlI//o1VM/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lBOP/KnJf/+/j4///////////////////////////////////////////////////////////8////gP///2r////8//////////////////////////////////////////////////////z5+f/Nop3/m0Q7/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lBOP/KnJf/+/j4///////////////////////////////////////////////////////////8////av///1n////6//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lCOP/KnZj/+/j4///////////////////////////////////////////////////////////6////Wf///0b////o//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5pDOv/Qp6P//Pr6///////////////////////////////////////////////////////////o////Rv///zT////V//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/51IP//bvbr//v7+///////////////////////////////////////////////////////////V////NP///xr///+7//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6RVTf/n0c////////////////////////////////////////////////////////////////+7////Gv///wz///+U////+v////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/7FuZ//z6ej///////////////////////////////////////////////////////////r///+U////DP///wT///9g////7/////////////////////////////////////////////////z4+P/LnZj/mkI5/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/mUE3/8mblf/9+/r//////////////////////////////////////////////////////////+////9g////BAAAAAD///8u////z/////////////////////////////////////////////////38/P/iycb/v4iC/7yCfP+8gnz/vIJ8/7yCfP+8gnz/vIJ8/7yCfP+8gnz/vIJ8/7yCfP+8gnz/voR+/8qcl//Lnpr/y56a/8uemv/Lnpr/zqOf//Hl5P///v7//////////////////////////////////////////////////////////8////8uAAAAAAAAAAD///8I////k/////z////////////////////////////////////////////////9/Pz/+vf2//r39v/69/b/+vf2//r39v/69/b/+vf2//j08//07Ov/7+Df/+7f3v/z6+n/+PPy//z6+v/9+/r//fv6//37+v/9+/r//fv7///+/v///////////////////////////////////////////////////////////P///5P///8IAAAAAAAAAAAAAAAA////Nf///93////+/////////////////////////////////////////////////////////////////////////////v7/9u7t/9i3s/++hn//sW1m/7BsZf+7gnv/066q//Ln5v/+/v7////////////////////////////////////////////////////////////////////////////////+////3f///zUAAAAAAAAAAAAAAAAAAAAA////B////3z////3///////////////////////////////////////////////////////////////////////////17Ov/wo6I/55KQf+XPjT/ljsx/5Y7Mf+XPTP/nEY9/7uBe//x5eP////////////////////////////////////////////////////////////////////////////////3////fP///wcAAAAAAAAAAAAAAAAAAAAAAAAAAP///yr////C/////f////////////////////////////////////////////////////////////////37+//UsKz/nUg//5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5tEO//No57/+/j4//////////////////////////////////////////////////////////////////////3////C////KgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wb///9g////5v////////////////////////////////////////////////////////////////bv7/+5fHb/lz0z/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y8Mv+ycGj/8ujm/////////////////////////////////////////////////////////////////////+b///9g////BgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8R////if////f//////////////////////////////////////////////////////////+3e3P+qYlr/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+oXVT/6tnX////////////////////////////////////////////////////////////////9////4n///8RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///6T////z/////////////////////////////////////////////////////+vZ1/+oXVT/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+nWlL/6dbU///////////////////////////////////////////////////////////z////pP///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///yL///+d////8/////////////////////////////////////////////////Hm5f+wa2T/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+uaGD/8OPh//////////////////////////////////////////////////////P///+d////IgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wH///8i////pP////f///////////////////////////////////////////r19P/CjYf/mD81/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5g/Nf/BjIb/+fTz////////////////////////////////////////////////9////6T///8i////AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///4n////m/////f////////////////////////////////7+/v/m0M7/qmFZ/5c9M/+WOzH/ljsx/5Y7Mf+WOzH/lz0z/6leV//lz8z//v7+//////////////////////////////////////3////m////if///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///xH///9g////wv////f////+///////////////////////////8+vr/4snG/7d4cf+iUUj/mUA3/5c+NP+gTkT/tXVu/+DFw//8+fn////////////////////////////////+////9////8L///9g////EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8G////Kv///3z////d/////P///////////////////////////v38//Tr6v/kzcv/2726/9m6t//jysf/8uno//78/P////////////////////////////////z////d////fP///yr///8GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wf///81////k////8/////v////+v////////////////////////////////////////////////////////////////////r////v////z////5P///81////BwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////CP///y7///9g////lP///7v////V////6P////r////8/////P////z////8////+v///+j////V////u////5T///9g////Lv///wgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8E////DP///xr///80////Rv///1n///9q////gP///4D///9q////Wf///0b///80////Gv///wz///8EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
335
335
 
336
336
  // src/lib/cms-version.ts
337
- var CMS_VERSION = true ? "1.0.11" : "0.0.0";
337
+ var CMS_VERSION = true ? "1.0.14" : "0.0.0";
338
338
 
339
339
  // src/components/Admin/Sidebar.tsx
340
340
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
@@ -720,7 +720,13 @@ body{font-family:"Inter",ui-sans-serif,system-ui,sans-serif;font-size:14px}
720
720
 
721
721
  // src/admin/pages/AdminLayout.tsx
722
722
  import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
723
- var PUBLIC_ADMIN_PATHS = ["/admin/signin", "/admin/forgot-password", "/admin/reset-password", "/admin/invite"];
723
+ var PUBLIC_ADMIN_PATHS = [
724
+ "/admin/signin",
725
+ "/admin/forgot-password",
726
+ "/admin/reset-password",
727
+ "/admin/invite",
728
+ "/admin/access-denied"
729
+ ];
724
730
  var AdminStyle = () => /* @__PURE__ */ jsx7("style", { dangerouslySetInnerHTML: { __html: ADMIN_THEME_CSS } });
725
731
  function useAdminViewSettings() {
726
732
  useEffect2(() => {
@@ -839,7 +845,7 @@ function AdminLayout({ children, customNavItems = [], customNavSections = [], cu
839
845
  }),
840
846
  [customNavItems, customNavSections, customCrudConfigs, resolvedTheme, themeRegistry, pluginDescriptors, storeEnabled]
841
847
  );
842
- return /* @__PURE__ */ jsx7(SessionProvider, { children: /* @__PURE__ */ jsx7(AdminConfigContext.Provider, { value: configValue, children: /* @__PURE__ */ jsx7(AdminLayoutInner, { children }) }) });
848
+ return /* @__PURE__ */ jsx7(AdminConfigContext.Provider, { value: configValue, children: /* @__PURE__ */ jsx7(AdminLayoutInner, { children }) });
843
849
  }
844
850
 
845
851
  // src/admin/AdminShell.tsx
@@ -5236,7 +5242,7 @@ var SigninPage = () => {
5236
5242
  const [error, setError] = useState17("");
5237
5243
  const [loading, setLoading] = useState17(false);
5238
5244
  const router = useRouter4();
5239
- const { status, update } = useSession3();
5245
+ const { status } = useSession3();
5240
5246
  useEffect16(() => {
5241
5247
  if (status === "authenticated") {
5242
5248
  router.replace("/admin/dashboard");
@@ -5255,8 +5261,7 @@ var SigninPage = () => {
5255
5261
  if (result?.error) {
5256
5262
  setError("Invalid email or password");
5257
5263
  } else {
5258
- await update();
5259
- router.push("/admin/dashboard");
5264
+ window.location.assign("/admin/dashboard");
5260
5265
  }
5261
5266
  } catch (error2) {
5262
5267
  setError("An error occurred. Please try again.");
@@ -6073,9 +6078,86 @@ function OrderDetailPage({ orderId }) {
6073
6078
  /* @__PURE__ */ jsxs40("div", { className: "min-w-0", children: [
6074
6079
  /* @__PURE__ */ jsx49("dt", { className: "text-gray-500", children: "Total" }),
6075
6080
  /* @__PURE__ */ jsx49("dd", { className: "font-medium text-gray-900", children: formatMoney(Number(order.total), currency) })
6081
+ ] }),
6082
+ (order.orderKind || order.parentOrderId != null) && /* @__PURE__ */ jsxs40(Fragment7, { children: [
6083
+ /* @__PURE__ */ jsxs40("div", { className: "min-w-0", children: [
6084
+ /* @__PURE__ */ jsx49("dt", { className: "text-gray-500", children: "Kind" }),
6085
+ /* @__PURE__ */ jsx49("dd", { className: "font-medium text-gray-900 capitalize", children: order.orderKind ?? "sale" })
6086
+ ] }),
6087
+ order.parentOrderId != null && /* @__PURE__ */ jsxs40("div", { className: "min-w-0", children: [
6088
+ /* @__PURE__ */ jsx49("dt", { className: "text-gray-500", children: "Parent order" }),
6089
+ /* @__PURE__ */ jsx49("dd", { className: "font-medium text-gray-900", children: /* @__PURE__ */ jsxs40(
6090
+ Link10,
6091
+ {
6092
+ href: `/admin/orders/${order.parentOrderId}/view`,
6093
+ className: "text-blue-600 hover:underline",
6094
+ children: [
6095
+ "#",
6096
+ order.parentOrderId
6097
+ ]
6098
+ }
6099
+ ) })
6100
+ ] })
6076
6101
  ] })
6077
6102
  ] }) })
6078
6103
  ] }),
6104
+ (() => {
6105
+ const fulfillment = order.metadata?.fulfillment;
6106
+ if (!fulfillment?.status && !fulfillment?.trackingId && !(fulfillment?.events && fulfillment.events.length))
6107
+ return null;
6108
+ return /* @__PURE__ */ jsxs40("section", { children: [
6109
+ /* @__PURE__ */ jsx49("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Fulfillment" }),
6110
+ /* @__PURE__ */ jsxs40("div", { className: "min-w-0 border border-gray-200 rounded-lg p-4 bg-gray-50/50 text-sm space-y-2", children: [
6111
+ fulfillment.status && /* @__PURE__ */ jsxs40("p", { children: [
6112
+ /* @__PURE__ */ jsx49("span", { className: "text-gray-500", children: "Status: " }),
6113
+ /* @__PURE__ */ jsx49("span", { className: "font-medium text-gray-900", children: fulfillment.status })
6114
+ ] }),
6115
+ fulfillment.trackingId && /* @__PURE__ */ jsxs40("p", { children: [
6116
+ /* @__PURE__ */ jsx49("span", { className: "text-gray-500", children: "Tracking: " }),
6117
+ /* @__PURE__ */ jsx49("span", { className: "font-mono text-gray-900", children: fulfillment.trackingId })
6118
+ ] }),
6119
+ fulfillment.events && fulfillment.events.length > 0 && /* @__PURE__ */ jsx49("ul", { className: "mt-3 space-y-2 border-t border-gray-200 pt-3", children: fulfillment.events.map((ev, i) => /* @__PURE__ */ jsxs40("li", { className: "text-gray-800", children: [
6120
+ ev.at && /* @__PURE__ */ jsx49("span", { className: "text-gray-500 text-xs block", children: ev.at }),
6121
+ ev.label && /* @__PURE__ */ jsx49("span", { className: "font-medium", children: ev.label }),
6122
+ ev.detail && /* @__PURE__ */ jsx49("span", { className: "text-gray-600 ml-1", children: ev.detail })
6123
+ ] }, i)) })
6124
+ ] })
6125
+ ] });
6126
+ })(),
6127
+ (order.orderKind ?? "sale") === "sale" && /* @__PURE__ */ jsxs40("section", { children: [
6128
+ /* @__PURE__ */ jsx49("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Invoice" }),
6129
+ /* @__PURE__ */ jsxs40("div", { className: "min-w-0 border border-gray-200 rounded-lg p-4 bg-gray-50/50 text-sm", children: [
6130
+ order.metadata?.invoice?.invoiceNumber && /* @__PURE__ */ jsxs40("p", { className: "text-gray-700 mb-2", children: [
6131
+ "#",
6132
+ String((order.metadata?.invoice).invoiceNumber)
6133
+ ] }),
6134
+ /* @__PURE__ */ jsx49(
6135
+ "a",
6136
+ {
6137
+ href: `/api/orders/${order.id}/invoice`,
6138
+ target: "_blank",
6139
+ rel: "noopener noreferrer",
6140
+ className: "text-blue-600 font-medium hover:underline",
6141
+ children: "Download invoice PDF"
6142
+ }
6143
+ )
6144
+ ] })
6145
+ ] }),
6146
+ (order.relatedOrders ?? []).length > 0 && /* @__PURE__ */ jsxs40("section", { children: [
6147
+ /* @__PURE__ */ jsx49("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Returns & replacements" }),
6148
+ /* @__PURE__ */ jsx49("div", { className: "min-w-0 border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs40(Table, { children: [
6149
+ /* @__PURE__ */ jsx49(TableHeader, { children: /* @__PURE__ */ jsxs40(TableRow, { className: "bg-gray-50", children: [
6150
+ /* @__PURE__ */ jsx49(TableHead, { className: "font-medium", children: "Number" }),
6151
+ /* @__PURE__ */ jsx49(TableHead, { className: "font-medium", children: "Kind" }),
6152
+ /* @__PURE__ */ jsx49(TableHead, { className: "font-medium", children: "Status" })
6153
+ ] }) }),
6154
+ /* @__PURE__ */ jsx49(TableBody, { children: (order.relatedOrders ?? []).map((r) => /* @__PURE__ */ jsxs40(TableRow, { children: [
6155
+ /* @__PURE__ */ jsx49(TableCell, { children: /* @__PURE__ */ jsx49(Link10, { href: `/admin/orders/${r.id}/view`, className: "text-blue-600 hover:underline font-medium", children: r.orderNumber }) }),
6156
+ /* @__PURE__ */ jsx49(TableCell, { className: "capitalize", children: r.orderKind ?? "\u2014" }),
6157
+ /* @__PURE__ */ jsx49(TableCell, { className: "capitalize", children: r.status ?? "\u2014" })
6158
+ ] }, r.id)) })
6159
+ ] }) })
6160
+ ] }),
6079
6161
  /* @__PURE__ */ jsxs40("section", { children: [
6080
6162
  /* @__PURE__ */ jsx49("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Line items" }),
6081
6163
  /* @__PURE__ */ jsx49("div", { className: "min-w-0 overflow-x-auto border border-gray-200 rounded-lg", children: /* @__PURE__ */ jsxs40(Table, { children: [
@@ -7798,33 +7880,50 @@ function RightSidebar({ theme, resolver, activeTab, setActiveTab, seoProps }) {
7798
7880
  ] })
7799
7881
  ] });
7800
7882
  }
7801
- function SaveButton({ pageId, pageData, onSaved, children, className }) {
7883
+ function SaveButton({
7884
+ pageId,
7885
+ pageData,
7886
+ existingSeoId,
7887
+ onSeoIdChange,
7888
+ onSaved,
7889
+ children,
7890
+ className
7891
+ }) {
7802
7892
  const { query } = useEditor();
7803
7893
  const [saving, setSaving] = useState28(false);
7804
7894
  const handleSave = async () => {
7805
7895
  setSaving(true);
7806
7896
  try {
7807
7897
  const content = JSON.parse(query.serialize());
7808
- let seoId = null;
7809
- const hasSeo = pageData.seoTitle || pageData.seoDescription || pageData.seoKeywords;
7898
+ let resolvedSeoId = existingSeoId;
7899
+ const hasSeo = pageData.seoTitle || pageData.seoDescription || pageData.seoKeywords || pageData.seoOgTitle || pageData.seoOgDescription || pageData.seoOgImage;
7810
7900
  if (hasSeo) {
7811
7901
  const seoPayload = {
7812
- title: pageData.seoTitle,
7813
- description: pageData.seoDescription,
7814
- keywords: pageData.seoKeywords,
7815
- ogTitle: pageData.seoOgTitle,
7816
- ogDescription: pageData.seoOgDescription,
7817
- ogImage: pageData.seoOgImage,
7902
+ title: pageData.seoTitle || null,
7903
+ description: pageData.seoDescription || null,
7904
+ keywords: pageData.seoKeywords || null,
7905
+ ogTitle: pageData.seoOgTitle || null,
7906
+ ogDescription: pageData.seoOgDescription || null,
7907
+ ogImage: pageData.seoOgImage || null,
7818
7908
  slug: pageData.slug
7819
7909
  };
7820
- const seoRes = await fetch("/api/seos", {
7821
- method: "POST",
7822
- headers: { "Content-Type": "application/json" },
7823
- body: JSON.stringify(seoPayload)
7824
- });
7825
- if (seoRes.ok) {
7826
- const seoData = await seoRes.json();
7827
- seoId = seoData.id;
7910
+ if (existingSeoId) {
7911
+ const seoRes = await fetch(`/api/seos/${existingSeoId}`, {
7912
+ method: "PUT",
7913
+ headers: { "Content-Type": "application/json" },
7914
+ body: JSON.stringify(seoPayload)
7915
+ });
7916
+ if (seoRes.ok) resolvedSeoId = existingSeoId;
7917
+ } else {
7918
+ const seoRes = await fetch("/api/seos", {
7919
+ method: "POST",
7920
+ headers: { "Content-Type": "application/json" },
7921
+ body: JSON.stringify(seoPayload)
7922
+ });
7923
+ if (seoRes.ok) {
7924
+ const seoData = await seoRes.json();
7925
+ resolvedSeoId = seoData.id ?? null;
7926
+ }
7828
7927
  }
7829
7928
  }
7830
7929
  const payload = {
@@ -7833,7 +7932,7 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
7833
7932
  content,
7834
7933
  published: pageData.published
7835
7934
  };
7836
- if (seoId) payload.seoId = seoId;
7935
+ if (resolvedSeoId != null) payload.seoId = resolvedSeoId;
7837
7936
  const url = pageId ? `/api/pages/${pageId}` : "/api/pages";
7838
7937
  const method = pageId ? "PUT" : "POST";
7839
7938
  const res = await fetch(url, {
@@ -7843,6 +7942,8 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
7843
7942
  });
7844
7943
  if (res.ok) {
7845
7944
  const saved = await res.json();
7945
+ const nextSeo = saved.seoId != null && saved.seoId !== "" ? Number(saved.seoId) : resolvedSeoId;
7946
+ if (Number.isFinite(nextSeo)) onSeoIdChange(nextSeo);
7846
7947
  onSaved(saved.id?.toString() || pageId || "");
7847
7948
  }
7848
7949
  } finally {
@@ -7875,9 +7976,11 @@ function PageBuilderPage({ pageId }) {
7875
7976
  const [seoOgTitle, setSeoOgTitle] = useState28("");
7876
7977
  const [seoOgDescription, setSeoOgDescription] = useState28("");
7877
7978
  const [seoOgImage, setSeoOgImage] = useState28("");
7979
+ const [pageSeoId, setPageSeoId] = useState28(null);
7878
7980
  useEffect26(() => {
7879
7981
  if (!pageId) {
7880
7982
  setInitialContent(null);
7983
+ setPageSeoId(null);
7881
7984
  setLoading(false);
7882
7985
  return;
7883
7986
  }
@@ -7886,6 +7989,9 @@ function PageBuilderPage({ pageId }) {
7886
7989
  setTitle(data.title || "");
7887
7990
  setSlug(data.slug || "");
7888
7991
  setPublished(data.published || false);
7992
+ setPageSeoId(
7993
+ data.seoId != null && data.seoId !== "" ? Number(data.seoId) : data.seo?.id != null ? Number(data.seo.id) : null
7994
+ );
7889
7995
  if (data.content) {
7890
7996
  setInitialContent(JSON.stringify(data.content));
7891
7997
  }
@@ -7939,6 +8045,8 @@ function PageBuilderPage({ pageId }) {
7939
8045
  SaveButton,
7940
8046
  {
7941
8047
  pageId,
8048
+ existingSeoId: pageSeoId,
8049
+ onSeoIdChange: setPageSeoId,
7942
8050
  pageData: { title, slug, published, seoTitle, seoDescription, seoKeywords, seoOgTitle, seoOgDescription, seoOgImage },
7943
8051
  onSaved: (id) => {
7944
8052
  if (!pageId) router.replace(`/admin/pages/${id}`);
@@ -8017,7 +8125,7 @@ function PageBuilderPage({ pageId }) {
8017
8125
 
8018
8126
  // src/admin/pages/PluginsPage.tsx
8019
8127
  import { useContext as useContext5, useState as useState29, useEffect as useEffect27 } from "react";
8020
- import { HardDrive, Mail, CreditCard as CreditCard2, MessageCircle, Puzzle as Puzzle2, CheckCircle2 as CheckCircle22, XCircle, Save as Save5, X as X18, Plus as Plus8 } from "lucide-react";
8128
+ import { HardDrive, Mail, CreditCard as CreditCard2, MessageCircle, BarChart3 as BarChart32, Building2 as Building22, Puzzle as Puzzle2, CheckCircle2 as CheckCircle22, XCircle, Save as Save5, X as X18, Plus as Plus8, Smartphone } from "lucide-react";
8021
8129
 
8022
8130
  // src/lib/email-recipients.ts
8023
8131
  function parseEmailRecipientsFromConfig(raw) {
@@ -8038,15 +8146,57 @@ function serializeEmailRecipients(emails) {
8038
8146
  return JSON.stringify(emails);
8039
8147
  }
8040
8148
 
8149
+ // src/components/ui/checkbox.tsx
8150
+ import * as React19 from "react";
8151
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
8152
+ import { Check as Check6 } from "lucide-react";
8153
+ import { jsx as jsx55 } from "react/jsx-runtime";
8154
+ var Checkbox = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx55(
8155
+ CheckboxPrimitive.Root,
8156
+ {
8157
+ ref,
8158
+ className: cn(
8159
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
8160
+ className
8161
+ ),
8162
+ ...props,
8163
+ children: /* @__PURE__ */ jsx55(
8164
+ CheckboxPrimitive.Indicator,
8165
+ {
8166
+ className: cn("flex items-center justify-center text-current"),
8167
+ children: /* @__PURE__ */ jsx55(Check6, { className: "h-4 w-4" })
8168
+ }
8169
+ )
8170
+ }
8171
+ ));
8172
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
8173
+
8041
8174
  // src/admin/pages/PluginsPage.tsx
8042
8175
  import { toast as toast4 } from "sonner";
8043
- import { Fragment as Fragment12, jsx as jsx55, jsxs as jsxs46 } from "react/jsx-runtime";
8176
+ import { Fragment as Fragment12, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
8177
+ function normalizeChatMode(raw) {
8178
+ if (raw === "external" || raw === "llm") return raw;
8179
+ return "whatsapp";
8180
+ }
8044
8181
  var ICON_MAP = {
8045
8182
  storage: HardDrive,
8046
8183
  email: Mail,
8047
8184
  payment: CreditCard2,
8048
- llm: MessageCircle
8185
+ llm: MessageCircle,
8186
+ analytics: BarChart32,
8187
+ erp: Building22,
8188
+ sms: Smartphone
8049
8189
  };
8190
+ function normalizeSmsProviderChoice(raw) {
8191
+ const x = (raw || "auto").toLowerCase().trim();
8192
+ if (x === "msg91" || x === "twilio" || x === "webhook" || x === "auto") return x;
8193
+ return "auto";
8194
+ }
8195
+ function normalizeMsg91ApiMode(raw) {
8196
+ const x = (raw || "auto").toLowerCase().trim();
8197
+ if (x === "flow" || x === "sendhttp" || x === "auto") return x;
8198
+ return "auto";
8199
+ }
8050
8200
  function splitInputToEmails(input) {
8051
8201
  return input.split(/[,;]+/).map((s) => s.trim()).filter(Boolean);
8052
8202
  }
@@ -8100,26 +8250,26 @@ function EmailRecipientTags({
8100
8250
  setDraft("");
8101
8251
  };
8102
8252
  return /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8103
- /* @__PURE__ */ jsx55(Label3, { htmlFor: id, className: "text-sm", children: label }),
8253
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: id, className: "text-sm", children: label }),
8104
8254
  /* @__PURE__ */ jsxs46(
8105
8255
  "div",
8106
8256
  {
8107
8257
  className: "flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 dark:border-gray-600",
8108
8258
  children: [
8109
8259
  emails.map((email) => /* @__PURE__ */ jsxs46(Badge, { variant: "secondary", className: "gap-1 pr-0.5 font-normal", children: [
8110
- /* @__PURE__ */ jsx55("span", { className: "max-w-[220px] truncate", children: email }),
8111
- /* @__PURE__ */ jsx55(
8260
+ /* @__PURE__ */ jsx56("span", { className: "max-w-[220px] truncate", children: email }),
8261
+ /* @__PURE__ */ jsx56(
8112
8262
  "button",
8113
8263
  {
8114
8264
  type: "button",
8115
8265
  className: "rounded p-0.5 hover:bg-muted",
8116
8266
  "aria-label": `Remove ${email}`,
8117
8267
  onClick: () => onChange(emails.filter((e) => e !== email)),
8118
- children: /* @__PURE__ */ jsx55(X18, { className: "h-3 w-3" })
8268
+ children: /* @__PURE__ */ jsx56(X18, { className: "h-3 w-3" })
8119
8269
  }
8120
8270
  )
8121
8271
  ] }, email)),
8122
- /* @__PURE__ */ jsx55(
8272
+ /* @__PURE__ */ jsx56(
8123
8273
  "input",
8124
8274
  {
8125
8275
  id,
@@ -8146,14 +8296,14 @@ function EmailRecipientTags({
8146
8296
  ]
8147
8297
  }
8148
8298
  ),
8149
- /* @__PURE__ */ jsx55("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: hint })
8299
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: hint })
8150
8300
  ] });
8151
8301
  }
8152
8302
  function PluginIcon({ descriptor, size = "md" }) {
8153
8303
  const Icon2 = descriptor.icon ? ICON_MAP[descriptor.icon] ?? Puzzle2 : Puzzle2;
8154
8304
  const sizeClass = size === "sm" ? "h-8 w-8" : "h-11 w-11";
8155
8305
  const iconClass = size === "sm" ? "h-4 w-4" : "h-5 w-5";
8156
- return /* @__PURE__ */ jsx55("div", { className: `flex shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ${sizeClass}`, children: /* @__PURE__ */ jsx55(Icon2, { className: iconClass }) });
8306
+ return /* @__PURE__ */ jsx56("div", { className: `flex shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ${sizeClass}`, children: /* @__PURE__ */ jsx56(Icon2, { className: iconClass }) });
8157
8307
  }
8158
8308
  function PluginSettingsPanel({
8159
8309
  descriptor,
@@ -8162,6 +8312,8 @@ function PluginSettingsPanel({
8162
8312
  const settingsGroup = descriptor.settingsGroup;
8163
8313
  const isLlm = settingsGroup === "llm";
8164
8314
  const isEmail = settingsGroup === "email";
8315
+ const isErp = settingsGroup === "erp";
8316
+ const isSms = settingsGroup === "sms";
8165
8317
  const [enabled, setEnabled] = useState29(true);
8166
8318
  const [botName, setBotName] = useState29("");
8167
8319
  const [icon, setIcon] = useState29("");
@@ -8178,18 +8330,59 @@ function PluginSettingsPanel({
8178
8330
  const [followUsTitle, setFollowUsTitle] = useState29("Follow Us");
8179
8331
  const [socialLinkRows, setSocialLinkRows] = useState29([{ ...EMPTY_SOCIAL_ROW }]);
8180
8332
  const [footerDisclaimer, setFooterDisclaimer] = useState29("");
8333
+ const [chatMode, setChatMode] = useState29("whatsapp");
8334
+ const [whatsappPhone, setWhatsappPhone] = useState29("");
8335
+ const [externalChatSnippet, setExternalChatSnippet] = useState29("");
8336
+ const [erpPipelineName, setErpPipelineName] = useState29("");
8337
+ const [erpPipelineStageName, setErpPipelineStageName] = useState29("");
8338
+ const [erpFormsCatalog, setErpFormsCatalog] = useState29([]);
8339
+ const [erpOpportunityFormIds, setErpOpportunityFormIds] = useState29([]);
8340
+ const [erpOpportunityIdsKeyPresent, setErpOpportunityIdsKeyPresent] = useState29(false);
8341
+ const [smsProviderChoice, setSmsProviderChoice] = useState29("auto");
8342
+ const [msg91ApiMode, setMsg91ApiMode] = useState29("auto");
8343
+ const [smsTplItems, setSmsTplItems] = useState29([]);
8181
8344
  const [loading, setLoading] = useState29(true);
8182
8345
  const [saving, setSaving] = useState29(false);
8183
8346
  useEffect27(() => {
8184
- fetch(`/api/settings/${settingsGroup}`).then((r) => r.ok ? r.json() : {}).then((data) => {
8347
+ setLoading(true);
8348
+ fetch(`/api/settings/${settingsGroup}`).then((r) => r.ok ? r.json() : {}).then(async (data) => {
8185
8349
  setEnabled(data.enabled !== "false");
8186
8350
  setBotName(data.botName ?? "");
8187
8351
  setIcon(data.icon ?? "");
8188
8352
  if (isLlm) {
8353
+ setChatMode(normalizeChatMode(data.chatMode));
8354
+ setWhatsappPhone(data.whatsappPhone ?? "");
8355
+ setExternalChatSnippet(data.externalChatSnippet ?? "");
8189
8356
  setIconImageUrl(data.iconImageUrl ?? "");
8190
8357
  setIconBackgroundColor(data.iconBackgroundColor ?? "#6366f1");
8191
8358
  setHeaderColor(data.headerColor ?? "#6366f1");
8192
8359
  }
8360
+ if (isErp) {
8361
+ setErpPipelineName(data.pipelineName ?? data.pipelineId ?? "");
8362
+ setErpPipelineStageName(data.pipelineStageName ?? data.pipelineStageId ?? "");
8363
+ const rawOpp = data.opportunityFormIds;
8364
+ const keyPresent = rawOpp !== void 0 && rawOpp !== null && String(rawOpp).trim() !== "";
8365
+ setErpOpportunityIdsKeyPresent(keyPresent);
8366
+ if (keyPresent) {
8367
+ try {
8368
+ const p = JSON.parse(String(rawOpp));
8369
+ const ids = Array.isArray(p) ? p.map((x) => typeof x === "number" ? x : Number(x)).filter((n) => Number.isInteger(n) && n > 0) : [];
8370
+ setErpOpportunityFormIds([...new Set(ids)]);
8371
+ } catch {
8372
+ setErpOpportunityFormIds([]);
8373
+ }
8374
+ } else {
8375
+ setErpOpportunityFormIds([]);
8376
+ }
8377
+ }
8378
+ if (isSms) {
8379
+ setSmsProviderChoice(normalizeSmsProviderChoice(data.smsProvider ?? data.SMS_PROVIDER));
8380
+ setMsg91ApiMode(normalizeMsg91ApiMode(data.msg91ApiMode));
8381
+ const tr = await fetch("/api/message-templates/sms").then(
8382
+ (r) => r.ok ? r.json() : { items: [] }
8383
+ );
8384
+ setSmsTplItems(tr.items ?? []);
8385
+ }
8193
8386
  if (isEmail) {
8194
8387
  const sales = parseEmailRecipientsFromConfig(data.salesTeamEmails ?? data.salesTeamEmail);
8195
8388
  const fulfil = parseEmailRecipientsFromConfig(data.fulfilmentTeamEmails ?? data.fulfilmentTeamEmail);
@@ -8206,14 +8399,48 @@ function PluginSettingsPanel({
8206
8399
  setFooterDisclaimer(data.footerDisclaimer ?? "");
8207
8400
  }
8208
8401
  }).finally(() => setLoading(false));
8209
- }, [settingsGroup, isLlm, isEmail]);
8402
+ }, [settingsGroup, isLlm, isEmail, isErp, isSms]);
8403
+ useEffect27(() => {
8404
+ if (!isErp || loading) return;
8405
+ fetch("/api/forms?limit=500&sortField=name&sortOrder=asc").then((r) => r.ok ? r.json() : { data: [] }).then((res) => {
8406
+ const rows = (res.data ?? []).map((f) => ({
8407
+ id: typeof f.id === "number" ? f.id : Number(f.id),
8408
+ name: String(f.name ?? "")
8409
+ })).filter((f) => Number.isInteger(f.id) && f.id > 0);
8410
+ setErpFormsCatalog(rows);
8411
+ }).catch(() => setErpFormsCatalog([]));
8412
+ }, [isErp, loading]);
8210
8413
  const buildPayload = () => {
8414
+ if (isErp) {
8415
+ const sortedIds = [...new Set(erpOpportunityFormIds.filter((n) => Number.isInteger(n) && n > 0))].sort(
8416
+ (a, b) => a - b
8417
+ );
8418
+ const payload2 = {
8419
+ enabled: { value: enabled ? "true" : "false", type: "public" },
8420
+ pipelineName: { value: erpPipelineName, type: "public" },
8421
+ pipelineStageName: { value: erpPipelineStageName, type: "public" }
8422
+ };
8423
+ if (erpFormsCatalog.length > 0 || erpOpportunityIdsKeyPresent) {
8424
+ payload2.opportunityFormIds = { value: JSON.stringify(sortedIds), type: "public" };
8425
+ }
8426
+ return payload2;
8427
+ }
8428
+ if (isSms) {
8429
+ return {
8430
+ enabled: { value: enabled ? "true" : "false", type: "public" },
8431
+ smsProvider: { value: smsProviderChoice, type: "public" },
8432
+ msg91ApiMode: { value: msg91ApiMode, type: "public" }
8433
+ };
8434
+ }
8211
8435
  const payload = {
8212
8436
  enabled: { value: enabled ? "true" : "false", type: "public" },
8213
8437
  botName: { value: botName, type: "public" },
8214
8438
  icon: { value: icon, type: "public" }
8215
8439
  };
8216
8440
  if (isLlm) {
8441
+ payload.chatMode = { value: chatMode, type: "public" };
8442
+ payload.whatsappPhone = { value: whatsappPhone, type: "public" };
8443
+ payload.externalChatSnippet = { value: externalChatSnippet, type: "public" };
8217
8444
  payload.iconImageUrl = { value: iconImageUrl, type: "public" };
8218
8445
  payload.iconBackgroundColor = { value: iconBackgroundColor, type: "public" };
8219
8446
  payload.headerColor = { value: headerColor, type: "public" };
@@ -8241,6 +8468,22 @@ function PluginSettingsPanel({
8241
8468
  body: JSON.stringify(buildPayload())
8242
8469
  });
8243
8470
  if (!res.ok) throw new Error();
8471
+ if (isSms && smsTplItems.length > 0) {
8472
+ const res2 = await fetch("/api/message-templates/sms", {
8473
+ method: "PUT",
8474
+ headers: { "Content-Type": "application/json" },
8475
+ body: JSON.stringify({
8476
+ items: smsTplItems.map((t) => ({
8477
+ templateKey: t.templateKey,
8478
+ body: t.body,
8479
+ externalTemplateRef: t.externalTemplateRef,
8480
+ otpVarKey: t.otpVarKey,
8481
+ enabled: t.enabled
8482
+ }))
8483
+ })
8484
+ });
8485
+ if (!res2.ok) throw new Error();
8486
+ }
8244
8487
  toast4.success("Settings saved");
8245
8488
  onSaved?.();
8246
8489
  } catch {
@@ -8249,10 +8492,101 @@ function PluginSettingsPanel({
8249
8492
  setSaving(false);
8250
8493
  }
8251
8494
  };
8252
- if (loading) return /* @__PURE__ */ jsx55("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading..." });
8495
+ if (loading) return /* @__PURE__ */ jsx56("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading..." });
8496
+ if (isErp) {
8497
+ return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8498
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
8499
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
8500
+ /* @__PURE__ */ jsx56(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
8501
+ ] }),
8502
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Webhook URL and JWT are set in server environment (see ERP integration guide). Pipeline fields apply to form submissions that are sent as opportunities." }),
8503
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8504
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-pipelineName`, className: "text-sm", children: "Pipeline name" }),
8505
+ /* @__PURE__ */ jsx56(
8506
+ Input,
8507
+ {
8508
+ id: `${settingsGroup}-pipelineName`,
8509
+ value: erpPipelineName,
8510
+ onChange: (e) => setErpPipelineName(e.target.value),
8511
+ placeholder: "e.g. Sales",
8512
+ className: "h-8 text-sm"
8513
+ }
8514
+ )
8515
+ ] }),
8516
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8517
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-pipelineStageName`, className: "text-sm", children: "Pipeline stage name" }),
8518
+ /* @__PURE__ */ jsx56(
8519
+ Input,
8520
+ {
8521
+ id: `${settingsGroup}-pipelineStageName`,
8522
+ value: erpPipelineStageName,
8523
+ onChange: (e) => setErpPipelineStageName(e.target.value),
8524
+ placeholder: "e.g. New",
8525
+ className: "h-8 text-sm"
8526
+ }
8527
+ )
8528
+ ] }),
8529
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-2", children: [
8530
+ /* @__PURE__ */ jsxs46("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
8531
+ /* @__PURE__ */ jsx56(Label3, { className: "text-sm", children: "Forms as CRM opportunity" }),
8532
+ /* @__PURE__ */ jsxs46("div", { className: "flex gap-2 text-xs", children: [
8533
+ /* @__PURE__ */ jsx56(
8534
+ "button",
8535
+ {
8536
+ type: "button",
8537
+ className: "text-primary underline-offset-2 hover:underline",
8538
+ onClick: () => setErpOpportunityFormIds(erpFormsCatalog.map((f) => f.id)),
8539
+ children: "Select all"
8540
+ }
8541
+ ),
8542
+ /* @__PURE__ */ jsx56(
8543
+ "button",
8544
+ {
8545
+ type: "button",
8546
+ className: "text-primary underline-offset-2 hover:underline",
8547
+ onClick: () => setErpOpportunityFormIds([]),
8548
+ children: "Clear"
8549
+ }
8550
+ )
8551
+ ] })
8552
+ ] }),
8553
+ /* @__PURE__ */ jsxs46("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
8554
+ "Every form submission with an email is sent to ERP: unchecked forms use ",
8555
+ /* @__PURE__ */ jsx56("span", { className: "font-medium", children: "lead" }),
8556
+ " (",
8557
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "lead.created" }),
8558
+ "); checked forms use ",
8559
+ /* @__PURE__ */ jsx56("span", { className: "font-medium", children: "opportunity" }),
8560
+ " (",
8561
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "form.submitted" }),
8562
+ ") with the pipeline and stage above."
8563
+ ] }),
8564
+ /* @__PURE__ */ jsx56("div", { className: "max-h-48 space-y-2 overflow-y-auto rounded-md border border-input p-2 dark:border-gray-600", children: erpFormsCatalog.length === 0 ? /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "No forms found." }) : erpFormsCatalog.map((f) => /* @__PURE__ */ jsxs46("label", { className: "flex cursor-pointer items-center gap-2 text-sm", children: [
8565
+ /* @__PURE__ */ jsx56(
8566
+ Checkbox,
8567
+ {
8568
+ checked: erpOpportunityFormIds.includes(f.id),
8569
+ onCheckedChange: (c) => {
8570
+ const on = c === true;
8571
+ setErpOpportunityFormIds((prev) => {
8572
+ if (on) return prev.includes(f.id) ? prev : [...prev, f.id].sort((a, b) => a - b);
8573
+ return prev.filter((x) => x !== f.id);
8574
+ });
8575
+ }
8576
+ }
8577
+ ),
8578
+ /* @__PURE__ */ jsx56("span", { className: "min-w-0 truncate", children: f.name || `Form #${f.id}` })
8579
+ ] }, f.id)) })
8580
+ ] }),
8581
+ /* @__PURE__ */ jsxs46(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
8582
+ /* @__PURE__ */ jsx56(Save5, { className: "h-3.5 w-3.5" }),
8583
+ "Save"
8584
+ ] })
8585
+ ] });
8586
+ }
8253
8587
  if (isEmail) {
8254
8588
  return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8255
- /* @__PURE__ */ jsx55(
8589
+ /* @__PURE__ */ jsx56(
8256
8590
  EmailRecipientTags,
8257
8591
  {
8258
8592
  id: `${settingsGroup}-salesTeamEmails`,
@@ -8263,7 +8597,7 @@ function PluginSettingsPanel({
8263
8597
  placeholder: "e.g. sales@example.com"
8264
8598
  }
8265
8599
  ),
8266
- /* @__PURE__ */ jsx55(
8600
+ /* @__PURE__ */ jsx56(
8267
8601
  EmailRecipientTags,
8268
8602
  {
8269
8603
  id: `${settingsGroup}-fulfilmentTeamEmails`,
@@ -8274,7 +8608,7 @@ function PluginSettingsPanel({
8274
8608
  placeholder: "e.g. fulfilment@example.com"
8275
8609
  }
8276
8610
  ),
8277
- /* @__PURE__ */ jsx55(
8611
+ /* @__PURE__ */ jsx56(
8278
8612
  EmailRecipientTags,
8279
8613
  {
8280
8614
  id: `${settingsGroup}-crmEmails`,
@@ -8285,34 +8619,34 @@ function PluginSettingsPanel({
8285
8619
  placeholder: "e.g. crm@example.com"
8286
8620
  }
8287
8621
  ),
8288
- /* @__PURE__ */ jsx55("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Layout below merges with Branding settings; values here override branding when set. Use absolute URLs for logos in email." }),
8622
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Layout below merges with Branding settings; values here override branding when set. Use absolute URLs for logos in email." }),
8289
8623
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8290
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-logoUrl`, className: "text-sm", children: "Logo URL (optional override)" }),
8291
- /* @__PURE__ */ jsx55(Input, { id: `${settingsGroup}-logoUrl`, value: logoUrl, onChange: (e) => setLogoUrl(e.target.value), placeholder: "https://\u2026", className: "h-8 text-sm" })
8624
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-logoUrl`, className: "text-sm", children: "Logo URL (optional override)" }),
8625
+ /* @__PURE__ */ jsx56(Input, { id: `${settingsGroup}-logoUrl`, value: logoUrl, onChange: (e) => setLogoUrl(e.target.value), placeholder: "https://\u2026", className: "h-8 text-sm" })
8292
8626
  ] }),
8293
8627
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8294
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-companyName`, className: "text-sm", children: "Company name (optional override)" }),
8295
- /* @__PURE__ */ jsx55(Input, { id: `${settingsGroup}-companyName`, value: companyName, onChange: (e) => setCompanyName(e.target.value), className: "h-8 text-sm" })
8628
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-companyName`, className: "text-sm", children: "Company name (optional override)" }),
8629
+ /* @__PURE__ */ jsx56(Input, { id: `${settingsGroup}-companyName`, value: companyName, onChange: (e) => setCompanyName(e.target.value), className: "h-8 text-sm" })
8296
8630
  ] }),
8297
8631
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8298
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-supportEmail`, className: "text-sm", children: "Support email (footer)" }),
8299
- /* @__PURE__ */ jsx55(Input, { id: `${settingsGroup}-supportEmail`, value: supportEmail, onChange: (e) => setSupportEmail(e.target.value), type: "email", className: "h-8 text-sm" })
8632
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-supportEmail`, className: "text-sm", children: "Support email (footer)" }),
8633
+ /* @__PURE__ */ jsx56(Input, { id: `${settingsGroup}-supportEmail`, value: supportEmail, onChange: (e) => setSupportEmail(e.target.value), type: "email", className: "h-8 text-sm" })
8300
8634
  ] }),
8301
8635
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8302
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-supportPhone`, className: "text-sm", children: "Support phone (footer)" }),
8303
- /* @__PURE__ */ jsx55(Input, { id: `${settingsGroup}-supportPhone`, value: supportPhone, onChange: (e) => setSupportPhone(e.target.value), className: "h-8 text-sm" })
8636
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-supportPhone`, className: "text-sm", children: "Support phone (footer)" }),
8637
+ /* @__PURE__ */ jsx56(Input, { id: `${settingsGroup}-supportPhone`, value: supportPhone, onChange: (e) => setSupportPhone(e.target.value), className: "h-8 text-sm" })
8304
8638
  ] }),
8305
8639
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8306
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-followUsTitle`, className: "text-sm", children: "\u201CFollow us\u201D heading" }),
8307
- /* @__PURE__ */ jsx55(Input, { id: `${settingsGroup}-followUsTitle`, value: followUsTitle, onChange: (e) => setFollowUsTitle(e.target.value), className: "h-8 text-sm" })
8640
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-followUsTitle`, className: "text-sm", children: "\u201CFollow us\u201D heading" }),
8641
+ /* @__PURE__ */ jsx56(Input, { id: `${settingsGroup}-followUsTitle`, value: followUsTitle, onChange: (e) => setFollowUsTitle(e.target.value), className: "h-8 text-sm" })
8308
8642
  ] }),
8309
8643
  /* @__PURE__ */ jsxs46("div", { className: "space-y-2", children: [
8310
- /* @__PURE__ */ jsx55(Label3, { className: "text-sm", children: "Social links" }),
8311
- /* @__PURE__ */ jsx55("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Add rows: icon image URL (optional), link URL, and emoji/text only if you are not using an image." }),
8644
+ /* @__PURE__ */ jsx56(Label3, { className: "text-sm", children: "Social links" }),
8645
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Add rows: icon image URL (optional), link URL, and emoji/text only if you are not using an image." }),
8312
8646
  socialLinkRows.map((row, i) => /* @__PURE__ */ jsxs46("div", { className: "flex flex-wrap items-end gap-2 border-b border-border/60 pb-3 dark:border-gray-600", children: [
8313
8647
  /* @__PURE__ */ jsxs46("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
8314
- /* @__PURE__ */ jsx55(Label3, { className: "text-xs text-muted-foreground", children: "Icon image URL" }),
8315
- /* @__PURE__ */ jsx55(
8648
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs text-muted-foreground", children: "Icon image URL" }),
8649
+ /* @__PURE__ */ jsx56(
8316
8650
  Input,
8317
8651
  {
8318
8652
  value: row.iconUrl,
@@ -8327,8 +8661,8 @@ function PluginSettingsPanel({
8327
8661
  )
8328
8662
  ] }),
8329
8663
  /* @__PURE__ */ jsxs46("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
8330
- /* @__PURE__ */ jsx55(Label3, { className: "text-xs text-muted-foreground", children: "Link URL" }),
8331
- /* @__PURE__ */ jsx55(
8664
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs text-muted-foreground", children: "Link URL" }),
8665
+ /* @__PURE__ */ jsx56(
8332
8666
  Input,
8333
8667
  {
8334
8668
  value: row.url,
@@ -8343,8 +8677,8 @@ function PluginSettingsPanel({
8343
8677
  )
8344
8678
  ] }),
8345
8679
  /* @__PURE__ */ jsxs46("div", { className: "w-[120px] space-y-1", children: [
8346
- /* @__PURE__ */ jsx55(Label3, { className: "text-xs text-muted-foreground", children: "Emoji / text" }),
8347
- /* @__PURE__ */ jsx55(
8680
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs text-muted-foreground", children: "Emoji / text" }),
8681
+ /* @__PURE__ */ jsx56(
8348
8682
  Input,
8349
8683
  {
8350
8684
  value: row.iconFallback,
@@ -8358,7 +8692,7 @@ function PluginSettingsPanel({
8358
8692
  }
8359
8693
  )
8360
8694
  ] }),
8361
- /* @__PURE__ */ jsx55(
8695
+ /* @__PURE__ */ jsx56(
8362
8696
  Button,
8363
8697
  {
8364
8698
  type: "button",
@@ -8371,7 +8705,7 @@ function PluginSettingsPanel({
8371
8705
  if (socialLinkRows.length <= 1) setSocialLinkRows([{ ...EMPTY_SOCIAL_ROW }]);
8372
8706
  else setSocialLinkRows(socialLinkRows.filter((_, j) => j !== i));
8373
8707
  },
8374
- children: /* @__PURE__ */ jsx55(X18, { className: "h-4 w-4" })
8708
+ children: /* @__PURE__ */ jsx56(X18, { className: "h-4 w-4" })
8375
8709
  }
8376
8710
  )
8377
8711
  ] }, i)),
@@ -8384,15 +8718,15 @@ function PluginSettingsPanel({
8384
8718
  className: "mt-1",
8385
8719
  onClick: () => setSocialLinkRows([...socialLinkRows, { ...EMPTY_SOCIAL_ROW }]),
8386
8720
  children: [
8387
- /* @__PURE__ */ jsx55(Plus8, { className: "mr-1 h-4 w-4" }),
8721
+ /* @__PURE__ */ jsx56(Plus8, { className: "mr-1 h-4 w-4" }),
8388
8722
  "Add link"
8389
8723
  ]
8390
8724
  }
8391
8725
  )
8392
8726
  ] }),
8393
8727
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8394
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-footerDisclaimer`, className: "text-sm", children: "Footer disclaimer" }),
8395
- /* @__PURE__ */ jsx55(
8728
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-footerDisclaimer`, className: "text-sm", children: "Footer disclaimer" }),
8729
+ /* @__PURE__ */ jsx56(
8396
8730
  Textarea,
8397
8731
  {
8398
8732
  id: `${settingsGroup}-footerDisclaimer`,
@@ -8403,106 +8737,318 @@ function PluginSettingsPanel({
8403
8737
  }
8404
8738
  )
8405
8739
  ] }),
8406
- /* @__PURE__ */ jsx55(Button, { size: "sm", onClick: handleSave, disabled: saving, children: saving ? "Saving\u2026" : "Save" })
8740
+ /* @__PURE__ */ jsx56(Button, { size: "sm", onClick: handleSave, disabled: saving, children: saving ? "Saving\u2026" : "Save" })
8407
8741
  ] });
8408
8742
  }
8409
- return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8410
- /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
8411
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
8412
- /* @__PURE__ */ jsx55(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
8413
- ] }),
8414
- /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8415
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
8416
- /* @__PURE__ */ jsx55(
8417
- Input,
8418
- {
8419
- id: `${settingsGroup}-botName`,
8420
- value: botName,
8421
- onChange: (e) => setBotName(e.target.value),
8422
- placeholder: "e.g. Support Bot",
8423
- className: "h-8 text-sm"
8424
- }
8425
- )
8426
- ] }),
8427
- isLlm ? /* @__PURE__ */ jsxs46(Fragment12, { children: [
8743
+ if (isSms) {
8744
+ return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8745
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
8746
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
8747
+ /* @__PURE__ */ jsx56(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
8748
+ ] }),
8749
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8750
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-smsProvider`, className: "text-sm", children: "Active provider" }),
8751
+ /* @__PURE__ */ jsxs46(
8752
+ Select,
8753
+ {
8754
+ value: smsProviderChoice,
8755
+ onValueChange: (v) => setSmsProviderChoice(v),
8756
+ children: [
8757
+ /* @__PURE__ */ jsx56(SelectTrigger, { id: `${settingsGroup}-smsProvider`, className: "h-9 text-sm", children: /* @__PURE__ */ jsx56(SelectValue, { placeholder: "Select provider" }) }),
8758
+ /* @__PURE__ */ jsxs46(SelectContent, { children: [
8759
+ /* @__PURE__ */ jsx56(SelectItem, { value: "auto", children: "Auto (MSG91 \u2192 Twilio \u2192 webhook, first with credentials)" }),
8760
+ /* @__PURE__ */ jsx56(SelectItem, { value: "msg91", children: "MSG91 (India)" }),
8761
+ /* @__PURE__ */ jsx56(SelectItem, { value: "twilio", children: "Twilio" }),
8762
+ /* @__PURE__ */ jsx56(SelectItem, { value: "webhook", children: "HTTP webhook" })
8763
+ ] })
8764
+ ]
8765
+ }
8766
+ )
8767
+ ] }),
8428
8768
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8429
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
8430
- /* @__PURE__ */ jsx55(
8769
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-msg91ApiMode`, className: "text-sm", children: "MSG91 API mode" }),
8770
+ /* @__PURE__ */ jsxs46(Select, { value: msg91ApiMode, onValueChange: (v) => setMsg91ApiMode(v), children: [
8771
+ /* @__PURE__ */ jsx56(SelectTrigger, { id: `${settingsGroup}-msg91ApiMode`, className: "h-9 text-sm", children: /* @__PURE__ */ jsx56(SelectValue, {}) }),
8772
+ /* @__PURE__ */ jsxs46(SelectContent, { children: [
8773
+ /* @__PURE__ */ jsx56(SelectItem, { value: "auto", children: "Auto (Flow if template ID + auth key; else sendhttp)" }),
8774
+ /* @__PURE__ */ jsx56(SelectItem, { value: "flow", children: "Flow API (DLT template_id; recommended for India)" }),
8775
+ /* @__PURE__ */ jsx56(SelectItem, { value: "sendhttp", children: "Legacy sendhttp (needs sender ID; not for arbitrary India text)" })
8776
+ ] })
8777
+ ] })
8778
+ ] }),
8779
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-3 rounded-md border border-gray-200 dark:border-gray-600 p-3", children: [
8780
+ /* @__PURE__ */ jsx56("p", { className: "text-sm font-medium text-gray-900 dark:text-white", children: "SMS templates" }),
8781
+ /* @__PURE__ */ jsxs46("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
8782
+ "Defaults come from code; overrides and DLT / Flow IDs are stored here. Use ",
8783
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "{{code}}" }),
8784
+ " in the message body for the OTP."
8785
+ ] }),
8786
+ smsTplItems.map((t) => /* @__PURE__ */ jsxs46("div", { className: "space-y-2 border-t border-gray-100 pt-3 first:border-t-0 first:pt-0 dark:border-gray-700", children: [
8787
+ /* @__PURE__ */ jsxs46("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
8788
+ /* @__PURE__ */ jsxs46("div", { children: [
8789
+ /* @__PURE__ */ jsx56("div", { className: "text-sm font-medium", children: t.name }),
8790
+ /* @__PURE__ */ jsx56("div", { className: "text-[11px] font-mono text-gray-500", children: t.templateKey })
8791
+ ] }),
8792
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
8793
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-tpl-${t.templateKey}-enabled`, className: "text-xs text-gray-600 dark:text-gray-400", children: "Apply custom body / Flow id" }),
8794
+ /* @__PURE__ */ jsx56(
8795
+ Switch,
8796
+ {
8797
+ id: `${settingsGroup}-tpl-${t.templateKey}-enabled`,
8798
+ checked: t.enabled,
8799
+ onCheckedChange: (v) => setSmsTplItems(
8800
+ (items) => items.map((x) => x.templateKey === t.templateKey ? { ...x, enabled: v } : x)
8801
+ )
8802
+ }
8803
+ )
8804
+ ] })
8805
+ ] }),
8806
+ /* @__PURE__ */ jsxs46("p", { className: "text-[11px] text-gray-500", children: [
8807
+ "Default: ",
8808
+ t.defaultBody
8809
+ ] }),
8810
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8811
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs", children: "Message body" }),
8812
+ /* @__PURE__ */ jsx56(
8813
+ Textarea,
8814
+ {
8815
+ value: t.body,
8816
+ onChange: (e) => setSmsTplItems(
8817
+ (items) => items.map((x) => x.templateKey === t.templateKey ? { ...x, body: e.target.value } : x)
8818
+ ),
8819
+ rows: 2,
8820
+ className: "text-sm"
8821
+ }
8822
+ )
8823
+ ] }),
8824
+ /* @__PURE__ */ jsxs46("div", { className: "grid gap-2 sm:grid-cols-2", children: [
8825
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8826
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs", children: "External template ref (e.g. MSG91 Flow / DLT id)" }),
8827
+ /* @__PURE__ */ jsx56(
8828
+ Input,
8829
+ {
8830
+ value: t.externalTemplateRef,
8831
+ onChange: (e) => setSmsTplItems(
8832
+ (items) => items.map(
8833
+ (x) => x.templateKey === t.templateKey ? { ...x, externalTemplateRef: e.target.value } : x
8834
+ )
8835
+ ),
8836
+ placeholder: "From MSG91 after DLT mapping",
8837
+ className: "h-8 text-sm"
8838
+ }
8839
+ )
8840
+ ] }),
8841
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8842
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs", children: "OTP variable key (Flow recipient field)" }),
8843
+ /* @__PURE__ */ jsx56(
8844
+ Input,
8845
+ {
8846
+ value: t.otpVarKey,
8847
+ onChange: (e) => setSmsTplItems(
8848
+ (items) => items.map(
8849
+ (x) => x.templateKey === t.templateKey ? { ...x, otpVarKey: e.target.value } : x
8850
+ )
8851
+ ),
8852
+ className: "h-8 text-sm font-mono",
8853
+ placeholder: "var1"
8854
+ }
8855
+ )
8856
+ ] })
8857
+ ] })
8858
+ ] }, t.templateKey))
8859
+ ] }),
8860
+ /* @__PURE__ */ jsxs46("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
8861
+ "Server env: ",
8862
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "MSG91_AUTH_KEY" }),
8863
+ "; optional global fallback ",
8864
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "MSG91_TEMPLATE_ID" }),
8865
+ ",",
8866
+ " ",
8867
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "MSG91_OTP_VAR_KEY" }),
8868
+ "; sendhttp: ",
8869
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "MSG91_SENDER_ID" }),
8870
+ ",",
8871
+ " ",
8872
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "MSG91_ROUTE" }),
8873
+ ". Or ",
8874
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "TWILIO_*" }),
8875
+ ", ",
8876
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "SMS_WEBHOOK_URL" }),
8877
+ ".",
8878
+ " ",
8879
+ /* @__PURE__ */ jsx56("code", { className: "text-[11px]", children: "SMS_PROVIDER" }),
8880
+ " matches the provider dropdown."
8881
+ ] }),
8882
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "India (TRAI DLT): register content on operators; map the approved template in MSG91 and set the Flow id per template above." }),
8883
+ /* @__PURE__ */ jsxs46(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
8884
+ /* @__PURE__ */ jsx56(Save5, { className: "h-3.5 w-3.5" }),
8885
+ "Save"
8886
+ ] })
8887
+ ] });
8888
+ }
8889
+ if (isLlm) {
8890
+ return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8891
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
8892
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
8893
+ /* @__PURE__ */ jsx56(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
8894
+ ] }),
8895
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8896
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-chatMode`, className: "text-sm", children: "Support channel" }),
8897
+ /* @__PURE__ */ jsxs46(Select, { value: chatMode, onValueChange: (v) => setChatMode(v), children: [
8898
+ /* @__PURE__ */ jsx56(SelectTrigger, { id: `${settingsGroup}-chatMode`, className: "h-9 text-sm", children: /* @__PURE__ */ jsx56(SelectValue, { placeholder: "Select channel" }) }),
8899
+ /* @__PURE__ */ jsxs46(SelectContent, { children: [
8900
+ /* @__PURE__ */ jsx56(SelectItem, { value: "whatsapp", children: "WhatsApp" }),
8901
+ /* @__PURE__ */ jsx56(SelectItem, { value: "external", children: "External (script)" }),
8902
+ /* @__PURE__ */ jsx56(SelectItem, { value: "llm", children: "Infuro Chat Assistant" })
8903
+ ] })
8904
+ ] })
8905
+ ] }),
8906
+ chatMode === "whatsapp" && /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8907
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-whatsappPhone`, className: "text-sm", children: "Phone number" }),
8908
+ /* @__PURE__ */ jsx56(
8431
8909
  Input,
8432
8910
  {
8433
- id: `${settingsGroup}-iconImageUrl`,
8434
- value: iconImageUrl,
8435
- onChange: (e) => setIconImageUrl(e.target.value),
8436
- placeholder: "https://\u2026 or /images/chat-icon.png",
8911
+ id: `${settingsGroup}-whatsappPhone`,
8912
+ value: whatsappPhone,
8913
+ onChange: (e) => setWhatsappPhone(e.target.value),
8914
+ placeholder: "e.g. +1 555 123 4567",
8437
8915
  className: "h-8 text-sm"
8438
8916
  }
8439
8917
  ),
8440
- /* @__PURE__ */ jsx55("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "PNG or image URL. Leave empty to use emoji below." })
8918
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Include country code. Opens WhatsApp (wa.me) when visitors tap the site button." })
8441
8919
  ] }),
8442
- /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8443
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon fallback (emoji)" }),
8444
- /* @__PURE__ */ jsx55(
8445
- Input,
8920
+ chatMode === "external" && /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8921
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-externalSnippet`, className: "text-sm", children: "Embed script" }),
8922
+ /* @__PURE__ */ jsx56(
8923
+ Textarea,
8446
8924
  {
8447
- id: `${settingsGroup}-icon`,
8448
- value: icon,
8449
- onChange: (e) => setIcon(e.target.value),
8450
- placeholder: "e.g. \u{1F4AC}",
8451
- className: "h-8 text-sm w-20"
8925
+ id: `${settingsGroup}-externalSnippet`,
8926
+ value: externalChatSnippet,
8927
+ onChange: (e) => setExternalChatSnippet(e.target.value),
8928
+ rows: 8,
8929
+ placeholder: "Paste third-party widget HTML / script tags\u2026",
8930
+ className: "text-sm font-mono"
8452
8931
  }
8453
- )
8932
+ ),
8933
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Only paste code from sources you trust." })
8454
8934
  ] }),
8455
- /* @__PURE__ */ jsxs46("div", { className: "flex gap-4", children: [
8935
+ chatMode === "llm" && /* @__PURE__ */ jsxs46(Fragment12, { children: [
8456
8936
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8457
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-iconBg`, className: "text-sm", children: "Icon background" }),
8458
- /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
8459
- /* @__PURE__ */ jsx55(
8460
- "input",
8461
- {
8462
- type: "color",
8463
- id: `${settingsGroup}-iconBg`,
8464
- value: iconBackgroundColor,
8465
- onChange: (e) => setIconBackgroundColor(e.target.value),
8466
- className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
8467
- }
8468
- ),
8469
- /* @__PURE__ */ jsx55(
8470
- Input,
8471
- {
8472
- value: iconBackgroundColor,
8473
- onChange: (e) => setIconBackgroundColor(e.target.value),
8474
- className: "h-8 w-24 text-sm font-mono"
8475
- }
8476
- )
8477
- ] })
8937
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
8938
+ /* @__PURE__ */ jsx56(
8939
+ Input,
8940
+ {
8941
+ id: `${settingsGroup}-botName`,
8942
+ value: botName,
8943
+ onChange: (e) => setBotName(e.target.value),
8944
+ placeholder: "e.g. Support Bot",
8945
+ className: "h-8 text-sm"
8946
+ }
8947
+ )
8478
8948
  ] }),
8479
8949
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8480
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-headerColor`, className: "text-sm", children: "Header color" }),
8481
- /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
8482
- /* @__PURE__ */ jsx55(
8483
- "input",
8484
- {
8485
- type: "color",
8486
- id: `${settingsGroup}-headerColor`,
8487
- value: headerColor,
8488
- onChange: (e) => setHeaderColor(e.target.value),
8489
- className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
8490
- }
8491
- ),
8492
- /* @__PURE__ */ jsx55(
8493
- Input,
8494
- {
8495
- value: headerColor,
8496
- onChange: (e) => setHeaderColor(e.target.value),
8497
- className: "h-8 w-24 text-sm font-mono"
8498
- }
8499
- )
8950
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
8951
+ /* @__PURE__ */ jsx56(
8952
+ Input,
8953
+ {
8954
+ id: `${settingsGroup}-iconImageUrl`,
8955
+ value: iconImageUrl,
8956
+ onChange: (e) => setIconImageUrl(e.target.value),
8957
+ placeholder: "https://\u2026 or /images/chat-icon.png",
8958
+ className: "h-8 text-sm"
8959
+ }
8960
+ ),
8961
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "PNG or image URL. Leave empty to use emoji below." })
8962
+ ] }),
8963
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8964
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon fallback (emoji)" }),
8965
+ /* @__PURE__ */ jsx56(
8966
+ Input,
8967
+ {
8968
+ id: `${settingsGroup}-icon`,
8969
+ value: icon,
8970
+ onChange: (e) => setIcon(e.target.value),
8971
+ placeholder: "e.g. \u{1F4AC}",
8972
+ className: "h-8 text-sm w-20"
8973
+ }
8974
+ )
8975
+ ] }),
8976
+ /* @__PURE__ */ jsxs46("div", { className: "flex gap-4", children: [
8977
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8978
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-iconBg`, className: "text-sm", children: "Icon background" }),
8979
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
8980
+ /* @__PURE__ */ jsx56(
8981
+ "input",
8982
+ {
8983
+ type: "color",
8984
+ id: `${settingsGroup}-iconBg`,
8985
+ value: iconBackgroundColor,
8986
+ onChange: (e) => setIconBackgroundColor(e.target.value),
8987
+ className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
8988
+ }
8989
+ ),
8990
+ /* @__PURE__ */ jsx56(
8991
+ Input,
8992
+ {
8993
+ value: iconBackgroundColor,
8994
+ onChange: (e) => setIconBackgroundColor(e.target.value),
8995
+ className: "h-8 w-24 text-sm font-mono"
8996
+ }
8997
+ )
8998
+ ] })
8999
+ ] }),
9000
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
9001
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-headerColor`, className: "text-sm", children: "Header color" }),
9002
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
9003
+ /* @__PURE__ */ jsx56(
9004
+ "input",
9005
+ {
9006
+ type: "color",
9007
+ id: `${settingsGroup}-headerColor`,
9008
+ value: headerColor,
9009
+ onChange: (e) => setHeaderColor(e.target.value),
9010
+ className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
9011
+ }
9012
+ ),
9013
+ /* @__PURE__ */ jsx56(
9014
+ Input,
9015
+ {
9016
+ value: headerColor,
9017
+ onChange: (e) => setHeaderColor(e.target.value),
9018
+ className: "h-8 w-24 text-sm font-mono"
9019
+ }
9020
+ )
9021
+ ] })
8500
9022
  ] })
8501
9023
  ] })
9024
+ ] }),
9025
+ /* @__PURE__ */ jsxs46(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
9026
+ /* @__PURE__ */ jsx56(Save5, { className: "h-3.5 w-3.5" }),
9027
+ "Save"
8502
9028
  ] })
8503
- ] }) : /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8504
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon (emoji or name)" }),
8505
- /* @__PURE__ */ jsx55(
9029
+ ] });
9030
+ }
9031
+ return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
9032
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
9033
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
9034
+ /* @__PURE__ */ jsx56(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
9035
+ ] }),
9036
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
9037
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
9038
+ /* @__PURE__ */ jsx56(
9039
+ Input,
9040
+ {
9041
+ id: `${settingsGroup}-botName`,
9042
+ value: botName,
9043
+ onChange: (e) => setBotName(e.target.value),
9044
+ placeholder: "e.g. Support Bot",
9045
+ className: "h-8 text-sm"
9046
+ }
9047
+ )
9048
+ ] }),
9049
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
9050
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon (emoji or name)" }),
9051
+ /* @__PURE__ */ jsx56(
8506
9052
  Input,
8507
9053
  {
8508
9054
  id: `${settingsGroup}-icon`,
@@ -8514,7 +9060,7 @@ function PluginSettingsPanel({
8514
9060
  )
8515
9061
  ] }),
8516
9062
  /* @__PURE__ */ jsxs46(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
8517
- /* @__PURE__ */ jsx55(Save5, { className: "h-3.5 w-3.5" }),
9063
+ /* @__PURE__ */ jsx56(Save5, { className: "h-3.5 w-3.5" }),
8518
9064
  "Save"
8519
9065
  ] })
8520
9066
  ] });
@@ -8532,16 +9078,16 @@ function PluginListItem({
8532
9078
  onClick: onSelect,
8533
9079
  className: `flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors ${selected ? "border-gray-300 bg-gray-50 dark:border-gray-600 dark:bg-gray-700/50" : "border-transparent hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,
8534
9080
  children: [
8535
- /* @__PURE__ */ jsx55(PluginIcon, { descriptor, size: "sm" }),
9081
+ /* @__PURE__ */ jsx56(PluginIcon, { descriptor, size: "sm" }),
8536
9082
  /* @__PURE__ */ jsxs46("div", { className: "min-w-0 flex-1", children: [
8537
- /* @__PURE__ */ jsx55("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: descriptor.label || descriptor.name }),
9083
+ /* @__PURE__ */ jsx56("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: descriptor.label || descriptor.name }),
8538
9084
  /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2 mt-0.5", children: [
8539
9085
  /* @__PURE__ */ jsxs46(
8540
9086
  "span",
8541
9087
  {
8542
9088
  className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-xs font-medium ${enabled ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}`,
8543
9089
  children: [
8544
- enabled ? /* @__PURE__ */ jsx55(CheckCircle22, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx55(XCircle, { className: "h-3 w-3" }),
9090
+ enabled ? /* @__PURE__ */ jsx56(CheckCircle22, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx56(XCircle, { className: "h-3 w-3" }),
8545
9091
  enabled ? "On" : "Off"
8546
9092
  ]
8547
9093
  }
@@ -8580,14 +9126,14 @@ function PluginsPage() {
8580
9126
  };
8581
9127
  return /* @__PURE__ */ jsxs46("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
8582
9128
  /* @__PURE__ */ jsxs46("div", { className: "bg-gray-800 border-b border-gray-700 px-4 py-2.5 rounded-t-lg dark:bg-gray-900 dark:border-gray-700", children: [
8583
- /* @__PURE__ */ jsx55("h1", { className: "text-base font-semibold text-white", children: "Plugins" }),
8584
- /* @__PURE__ */ jsx55("p", { className: "text-xs text-gray-300 mt-0.5", children: "Registered plugins and their status" })
9129
+ /* @__PURE__ */ jsx56("h1", { className: "text-base font-semibold text-white", children: "Plugins" }),
9130
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-300 mt-0.5", children: "Registered plugins and their status" })
8585
9131
  ] }),
8586
- /* @__PURE__ */ jsx55("div", { className: "min-w-0 p-6", children: pluginDescriptors.length === 0 ? /* @__PURE__ */ jsxs46("div", { className: "py-12 text-center", children: [
8587
- /* @__PURE__ */ jsx55(Puzzle2, { className: "mx-auto h-10 w-10 text-gray-400" }),
8588
- /* @__PURE__ */ jsx55("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No plugins registered. Add plugin descriptors to your app admin layout." })
9132
+ /* @__PURE__ */ jsx56("div", { className: "min-w-0 p-6", children: pluginDescriptors.length === 0 ? /* @__PURE__ */ jsxs46("div", { className: "py-12 text-center", children: [
9133
+ /* @__PURE__ */ jsx56(Puzzle2, { className: "mx-auto h-10 w-10 text-gray-400" }),
9134
+ /* @__PURE__ */ jsx56("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No plugins registered. Add plugin descriptors to your app admin layout." })
8589
9135
  ] }) : /* @__PURE__ */ jsxs46("div", { className: "flex gap-6", children: [
8590
- /* @__PURE__ */ jsx55("div", { className: "w-56 shrink-0 space-y-1", children: pluginDescriptors.map((p) => /* @__PURE__ */ jsx55(
9136
+ /* @__PURE__ */ jsx56("div", { className: "w-56 shrink-0 space-y-1", children: pluginDescriptors.map((p) => /* @__PURE__ */ jsx56(
8591
9137
  PluginListItem,
8592
9138
  {
8593
9139
  descriptor: p,
@@ -8597,15 +9143,15 @@ function PluginsPage() {
8597
9143
  },
8598
9144
  p.name
8599
9145
  )) }),
8600
- /* @__PURE__ */ jsx55("div", { className: "min-w-0 flex-1", children: !selectedName ? /* @__PURE__ */ jsxs46("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
8601
- /* @__PURE__ */ jsx55(Puzzle2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
8602
- /* @__PURE__ */ jsx55("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a plugin to view or edit its configuration." })
8603
- ] }) : /* @__PURE__ */ jsx55("div", { className: "rounded-lg border border-gray-200 bg-gray-50/50 p-5 dark:border-gray-700 dark:bg-gray-800/50", children: selectedDescriptor?.settingsGroup ? /* @__PURE__ */ jsxs46(Fragment12, { children: [
9146
+ /* @__PURE__ */ jsx56("div", { className: "min-w-0 flex-1", children: !selectedName ? /* @__PURE__ */ jsxs46("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
9147
+ /* @__PURE__ */ jsx56(Puzzle2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
9148
+ /* @__PURE__ */ jsx56("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a plugin to view or edit its configuration." })
9149
+ ] }) : /* @__PURE__ */ jsx56("div", { className: "rounded-lg border border-gray-200 bg-gray-50/50 p-5 dark:border-gray-700 dark:bg-gray-800/50", children: selectedDescriptor?.settingsGroup ? /* @__PURE__ */ jsxs46(Fragment12, { children: [
8604
9150
  /* @__PURE__ */ jsxs46("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-4", children: [
8605
9151
  selectedDescriptor.label || selectedDescriptor.name,
8606
9152
  " \u2014 Configuration"
8607
9153
  ] }),
8608
- /* @__PURE__ */ jsx55(
9154
+ /* @__PURE__ */ jsx56(
8609
9155
  PluginSettingsPanel,
8610
9156
  {
8611
9157
  descriptor: selectedDescriptor,
@@ -8613,8 +9159,8 @@ function PluginsPage() {
8613
9159
  }
8614
9160
  )
8615
9161
  ] }) : /* @__PURE__ */ jsxs46("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
8616
- /* @__PURE__ */ jsx55(Puzzle2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
8617
- /* @__PURE__ */ jsx55("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No configuration available for this plugin." })
9162
+ /* @__PURE__ */ jsx56(Puzzle2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
9163
+ /* @__PURE__ */ jsx56("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No configuration available for this plugin." })
8618
9164
  ] }) }) })
8619
9165
  ] }) })
8620
9166
  ] });
@@ -8626,7 +9172,7 @@ import { useRouter as useRouter10 } from "next/navigation";
8626
9172
  import { AlertCircle as AlertCircle4 } from "lucide-react";
8627
9173
 
8628
9174
  // src/components/Admin/SeoSection.tsx
8629
- import { jsx as jsx56, jsxs as jsxs47 } from "react/jsx-runtime";
9175
+ import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
8630
9176
  function SeoSection({
8631
9177
  values,
8632
9178
  onChange
@@ -8634,37 +9180,37 @@ function SeoSection({
8634
9180
  const inputCls3 = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm h-8";
8635
9181
  const textareaCls = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm min-h-[60px]";
8636
9182
  return /* @__PURE__ */ jsxs47("div", { className: "border-t border-gray-200 pt-2", children: [
8637
- /* @__PURE__ */ jsx56("div", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: "SEO" }),
9183
+ /* @__PURE__ */ jsx57("div", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: "SEO" }),
8638
9184
  /* @__PURE__ */ jsxs47("div", { className: "space-y-3", children: [
8639
9185
  /* @__PURE__ */ jsxs47("div", { children: [
8640
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Title" }),
8641
- /* @__PURE__ */ jsx56("input", { type: "text", value: values.seoTitle, onChange: (e) => onChange("seoTitle", e.target.value), className: inputCls3 })
9186
+ /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Title" }),
9187
+ /* @__PURE__ */ jsx57("input", { type: "text", value: values.seoTitle, onChange: (e) => onChange("seoTitle", e.target.value), className: inputCls3 })
8642
9188
  ] }),
8643
9189
  /* @__PURE__ */ jsxs47("div", { children: [
8644
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Description" }),
8645
- /* @__PURE__ */ jsx56("textarea", { value: values.seoDescription, onChange: (e) => onChange("seoDescription", e.target.value), className: textareaCls, rows: 2 })
9190
+ /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Description" }),
9191
+ /* @__PURE__ */ jsx57("textarea", { value: values.seoDescription, onChange: (e) => onChange("seoDescription", e.target.value), className: textareaCls, rows: 2 })
8646
9192
  ] }),
8647
9193
  /* @__PURE__ */ jsxs47("div", { children: [
8648
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Keywords" }),
8649
- /* @__PURE__ */ jsx56("input", { type: "text", value: values.seoKeywords, onChange: (e) => onChange("seoKeywords", e.target.value), placeholder: "keyword1, keyword2", className: inputCls3 })
9194
+ /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Keywords" }),
9195
+ /* @__PURE__ */ jsx57("input", { type: "text", value: values.seoKeywords, onChange: (e) => onChange("seoKeywords", e.target.value), placeholder: "keyword1, keyword2", className: inputCls3 })
8650
9196
  ] }),
8651
9197
  /* @__PURE__ */ jsxs47("div", { children: [
8652
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Title" }),
8653
- /* @__PURE__ */ jsx56("input", { type: "text", value: values.seoOgTitle, onChange: (e) => onChange("seoOgTitle", e.target.value), className: inputCls3 })
9198
+ /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Title" }),
9199
+ /* @__PURE__ */ jsx57("input", { type: "text", value: values.seoOgTitle, onChange: (e) => onChange("seoOgTitle", e.target.value), className: inputCls3 })
8654
9200
  ] }),
8655
9201
  /* @__PURE__ */ jsxs47("div", { children: [
8656
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Description" }),
8657
- /* @__PURE__ */ jsx56("textarea", { value: values.seoOgDescription, onChange: (e) => onChange("seoOgDescription", e.target.value), className: textareaCls, rows: 2 })
9202
+ /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Description" }),
9203
+ /* @__PURE__ */ jsx57("textarea", { value: values.seoOgDescription, onChange: (e) => onChange("seoOgDescription", e.target.value), className: textareaCls, rows: 2 })
8658
9204
  ] }),
8659
9205
  /* @__PURE__ */ jsxs47("div", { children: [
8660
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Image" }),
8661
- /* @__PURE__ */ jsx56("input", { type: "url", value: values.seoOgImage, onChange: (e) => onChange("seoOgImage", e.target.value), placeholder: "https://...", className: inputCls3 })
9206
+ /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Image" }),
9207
+ /* @__PURE__ */ jsx57("input", { type: "url", value: values.seoOgImage, onChange: (e) => onChange("seoOgImage", e.target.value), placeholder: "https://...", className: inputCls3 })
8662
9208
  ] })
8663
9209
  ] })
8664
9210
  ] });
8665
9211
  }
8666
9212
  async function saveSeo(seo, slug, existingSeoId) {
8667
- const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords;
9213
+ const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords || seo.seoOgTitle || seo.seoOgDescription || seo.seoOgImage;
8668
9214
  if (!hasSeo) return existingSeoId;
8669
9215
  const payload = {
8670
9216
  title: seo.seoTitle || null,
@@ -8714,7 +9260,7 @@ async function fetchSeo(seoId) {
8714
9260
  }
8715
9261
 
8716
9262
  // src/admin/pages/BrandEditPage.tsx
8717
- import { Fragment as Fragment13, jsx as jsx57, jsxs as jsxs48 } from "react/jsx-runtime";
9263
+ import { Fragment as Fragment13, jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
8718
9264
  var isCreate = (id) => id === "create";
8719
9265
  function BrandEditPage({ brandId }) {
8720
9266
  const router = useRouter10();
@@ -8800,10 +9346,10 @@ function BrandEditPage({ brandId }) {
8800
9346
  }
8801
9347
  };
8802
9348
  if (loading) {
8803
- return /* @__PURE__ */ jsx57("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx57("span", { className: "text-gray-500", children: "Loading..." }) });
9349
+ return /* @__PURE__ */ jsx58("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx58("span", { className: "text-gray-500", children: "Loading..." }) });
8804
9350
  }
8805
9351
  return /* @__PURE__ */ jsxs48("div", { className: "rounded-lg bg-white shadow-md", children: [
8806
- /* @__PURE__ */ jsx57(
9352
+ /* @__PURE__ */ jsx58(
8807
9353
  DetailPageHeader,
8808
9354
  {
8809
9355
  title: create ? "Add Brand" : "Edit Brand",
@@ -8815,23 +9361,23 @@ function BrandEditPage({ brandId }) {
8815
9361
  ]
8816
9362
  }
8817
9363
  ),
8818
- errors.length > 0 && /* @__PURE__ */ jsx57("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ jsxs48("div", { className: "flex", children: [
8819
- /* @__PURE__ */ jsx57(AlertCircle4, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
9364
+ errors.length > 0 && /* @__PURE__ */ jsx58("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ jsxs48("div", { className: "flex", children: [
9365
+ /* @__PURE__ */ jsx58(AlertCircle4, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
8820
9366
  /* @__PURE__ */ jsxs48("div", { className: "ml-3", children: [
8821
- /* @__PURE__ */ jsx57("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
8822
- /* @__PURE__ */ jsx57("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ jsx57("li", { children: e }, i)) })
9367
+ /* @__PURE__ */ jsx58("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
9368
+ /* @__PURE__ */ jsx58("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ jsx58("li", { children: e }, i)) })
8823
9369
  ] })
8824
9370
  ] }) }),
8825
- /* @__PURE__ */ jsx57(
9371
+ /* @__PURE__ */ jsx58(
8826
9372
  DetailPageLayout,
8827
9373
  {
8828
9374
  main: /* @__PURE__ */ jsxs48(Fragment13, { children: [
8829
9375
  /* @__PURE__ */ jsxs48("section", { children: [
8830
- /* @__PURE__ */ jsx57("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
9376
+ /* @__PURE__ */ jsx58("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
8831
9377
  /* @__PURE__ */ jsxs48("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50 space-y-4", children: [
8832
9378
  /* @__PURE__ */ jsxs48("div", { children: [
8833
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Name *" }),
8834
- /* @__PURE__ */ jsx57(
9379
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Name *" }),
9380
+ /* @__PURE__ */ jsx58(
8835
9381
  "input",
8836
9382
  {
8837
9383
  type: "text",
@@ -8843,8 +9389,8 @@ function BrandEditPage({ brandId }) {
8843
9389
  )
8844
9390
  ] }),
8845
9391
  /* @__PURE__ */ jsxs48("div", { children: [
8846
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Slug *" }),
8847
- /* @__PURE__ */ jsx57(
9392
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Slug *" }),
9393
+ /* @__PURE__ */ jsx58(
8848
9394
  "input",
8849
9395
  {
8850
9396
  type: "text",
@@ -8856,8 +9402,8 @@ function BrandEditPage({ brandId }) {
8856
9402
  )
8857
9403
  ] }),
8858
9404
  /* @__PURE__ */ jsxs48("div", { children: [
8859
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Description" }),
8860
- /* @__PURE__ */ jsx57(
9405
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Description" }),
9406
+ /* @__PURE__ */ jsx58(
8861
9407
  "textarea",
8862
9408
  {
8863
9409
  value: description,
@@ -8868,8 +9414,8 @@ function BrandEditPage({ brandId }) {
8868
9414
  )
8869
9415
  ] }),
8870
9416
  /* @__PURE__ */ jsxs48("div", { children: [
8871
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Logo URL" }),
8872
- /* @__PURE__ */ jsx57(
9417
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Logo URL" }),
9418
+ /* @__PURE__ */ jsx58(
8873
9419
  "input",
8874
9420
  {
8875
9421
  type: "url",
@@ -8880,8 +9426,8 @@ function BrandEditPage({ brandId }) {
8880
9426
  )
8881
9427
  ] }),
8882
9428
  /* @__PURE__ */ jsxs48("div", { children: [
8883
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Sort order" }),
8884
- /* @__PURE__ */ jsx57(
9429
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Sort order" }),
9430
+ /* @__PURE__ */ jsx58(
8885
9431
  "input",
8886
9432
  {
8887
9433
  type: "number",
@@ -8894,14 +9440,14 @@ function BrandEditPage({ brandId }) {
8894
9440
  ] })
8895
9441
  ] }),
8896
9442
  /* @__PURE__ */ jsxs48("section", { children: [
8897
- /* @__PURE__ */ jsx57("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
8898
- /* @__PURE__ */ jsx57("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ jsx57(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
9443
+ /* @__PURE__ */ jsx58("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
9444
+ /* @__PURE__ */ jsx58("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ jsx58(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
8899
9445
  ] })
8900
9446
  ] }),
8901
- sidebar: /* @__PURE__ */ jsx57(Fragment13, { children: /* @__PURE__ */ jsxs48("section", { children: [
8902
- /* @__PURE__ */ jsx57("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
8903
- /* @__PURE__ */ jsx57("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ jsxs48("label", { className: "flex items-center gap-2 cursor-pointer", children: [
8904
- /* @__PURE__ */ jsx57(
9447
+ sidebar: /* @__PURE__ */ jsx58(Fragment13, { children: /* @__PURE__ */ jsxs48("section", { children: [
9448
+ /* @__PURE__ */ jsx58("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
9449
+ /* @__PURE__ */ jsx58("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ jsxs48("label", { className: "flex items-center gap-2 cursor-pointer", children: [
9450
+ /* @__PURE__ */ jsx58(
8905
9451
  "input",
8906
9452
  {
8907
9453
  type: "checkbox",
@@ -8910,7 +9456,7 @@ function BrandEditPage({ brandId }) {
8910
9456
  className: "h-4 w-4 rounded border-gray-300"
8911
9457
  }
8912
9458
  ),
8913
- /* @__PURE__ */ jsx57("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
9459
+ /* @__PURE__ */ jsx58("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
8914
9460
  ] }) })
8915
9461
  ] }) })
8916
9462
  }
@@ -8925,7 +9471,7 @@ import { AlertCircle as AlertCircle5, Plus as Plus9, Trash2 as Trash25, Star } f
8925
9471
 
8926
9472
  // src/components/Admin/AttributeFacetNameInput.tsx
8927
9473
  import { useState as useState31, useEffect as useEffect29 } from "react";
8928
- import { jsx as jsx58, jsxs as jsxs49 } from "react/jsx-runtime";
9474
+ import { jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
8929
9475
  function slugFromName(name) {
8930
9476
  const s = name.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
8931
9477
  return s || "attribute";
@@ -8994,7 +9540,7 @@ function AttributeFacetNameInput({
8994
9540
  };
8995
9541
  const exactMatch = list.some((x) => x.name.toLowerCase() === draft.trim().toLowerCase());
8996
9542
  return /* @__PURE__ */ jsxs49("div", { className: "relative min-w-0 flex-1", children: [
8997
- /* @__PURE__ */ jsx58(
9543
+ /* @__PURE__ */ jsx59(
8998
9544
  "input",
8999
9545
  {
9000
9546
  type: "text",
@@ -9026,7 +9572,7 @@ function AttributeFacetNameInput({
9026
9572
  }
9027
9573
  ),
9028
9574
  open && (list.length > 0 || draft.trim() && !exactMatch) && /* @__PURE__ */ jsxs49("ul", { className: "absolute z-20 mt-1 w-full rounded-md border border-gray-200 bg-white py-1 shadow-lg max-h-48 overflow-auto", children: [
9029
- list.map((a) => /* @__PURE__ */ jsx58(
9575
+ list.map((a) => /* @__PURE__ */ jsx59(
9030
9576
  "li",
9031
9577
  {
9032
9578
  onMouseDown: (e) => {
@@ -9058,7 +9604,7 @@ function AttributeFacetNameInput({
9058
9604
  }
9059
9605
 
9060
9606
  // src/admin/pages/ProductEditPage.tsx
9061
- import { Fragment as Fragment14, jsx as jsx59, jsxs as jsxs50 } from "react/jsx-runtime";
9607
+ import { Fragment as Fragment14, jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
9062
9608
  var isCreate2 = (id) => id === "create";
9063
9609
  var sectionCls = "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50";
9064
9610
  var labelCls = "block text-xs font-medium text-gray-600 mb-1";
@@ -9101,6 +9647,7 @@ function ProductEditPage({ productId }) {
9101
9647
  const [brands, setBrands] = useState32([]);
9102
9648
  const [categories, setCategories] = useState32([]);
9103
9649
  const [name, setName] = useState32("");
9650
+ const [productSlug, setProductSlug] = useState32("");
9104
9651
  const [sku, setSku] = useState32("");
9105
9652
  const [hsn, setHsn] = useState32("");
9106
9653
  const [collectionId, setCollectionId] = useState32(null);
@@ -9153,7 +9700,10 @@ function ProductEditPage({ productId }) {
9153
9700
  if (Array.isArray(d.data)) attrList = d.data;
9154
9701
  }
9155
9702
  if (create) {
9156
- if (!cancelled) setLoading(false);
9703
+ if (!cancelled) {
9704
+ setProductSlug("");
9705
+ setLoading(false);
9706
+ }
9157
9707
  return;
9158
9708
  }
9159
9709
  const res = await fetch(`/api/products/${productId}`);
@@ -9161,6 +9711,7 @@ function ProductEditPage({ productId }) {
9161
9711
  const product = await res.json();
9162
9712
  if (cancelled) return;
9163
9713
  setName(product.name ?? "");
9714
+ setProductSlug(typeof product.slug === "string" ? product.slug : "");
9164
9715
  setSku(product.sku ?? "");
9165
9716
  setHsn(product.hsn ?? "");
9166
9717
  setCollectionId(product.collectionId ?? null);
@@ -9216,6 +9767,12 @@ function ProductEditPage({ productId }) {
9216
9767
  cancelled = true;
9217
9768
  };
9218
9769
  }, [productId, create]);
9770
+ useEffect30(() => {
9771
+ if (!create || !name.trim() || productSlug.trim()) return;
9772
+ setProductSlug(
9773
+ name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "")
9774
+ );
9775
+ }, [create, name, productSlug]);
9219
9776
  const handleSave = async () => {
9220
9777
  setErrors([]);
9221
9778
  if (!name.trim()) {
@@ -9228,7 +9785,8 @@ function ProductEditPage({ productId }) {
9228
9785
  }
9229
9786
  setSaving(true);
9230
9787
  try {
9231
- const savedSeoId = await saveSeo(seo, name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-"), seoId);
9788
+ const seoSlug = productSlug.trim() || name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
9789
+ const savedSeoId = await saveSeo(seo, seoSlug, seoId);
9232
9790
  const metadata = buildProductMetadata(otherMetadata, { description, images, specifications });
9233
9791
  const productPayload = {
9234
9792
  name: name.trim(),
@@ -9256,6 +9814,9 @@ function ProductEditPage({ productId }) {
9256
9814
  return;
9257
9815
  }
9258
9816
  const savedProduct = await res.json();
9817
+ if (typeof savedProduct.slug === "string") {
9818
+ setProductSlug(savedProduct.slug);
9819
+ }
9259
9820
  const savedId = create ? savedProduct.id : productId;
9260
9821
  const slugify = (n) => n.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "attribute";
9261
9822
  async function ensureAttributeId(attrName) {
@@ -9345,10 +9906,10 @@ function ProductEditPage({ productId }) {
9345
9906
  const removeFacet = (i) => setFacetRows((prev) => prev.length <= 1 ? prev : prev.filter((_, j) => j !== i));
9346
9907
  const setFacet = (i, field, value) => setFacetRows((prev) => prev.map((row, j) => j === i ? { ...row, [field]: value } : row));
9347
9908
  if (loading) {
9348
- return /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx59("span", { className: "text-gray-500", children: "Loading..." }) });
9909
+ return /* @__PURE__ */ jsx60("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx60("span", { className: "text-gray-500", children: "Loading..." }) });
9349
9910
  }
9350
9911
  return /* @__PURE__ */ jsxs50("div", { className: "rounded-lg bg-white shadow-md", children: [
9351
- /* @__PURE__ */ jsx59(
9912
+ /* @__PURE__ */ jsx60(
9352
9913
  DetailPageHeader,
9353
9914
  {
9354
9915
  title: create ? "Add Product" : "Edit Product",
@@ -9360,90 +9921,90 @@ function ProductEditPage({ productId }) {
9360
9921
  ]
9361
9922
  }
9362
9923
  ),
9363
- errors.length > 0 && /* @__PURE__ */ jsx59("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ jsxs50("div", { className: "flex", children: [
9364
- /* @__PURE__ */ jsx59(AlertCircle5, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
9924
+ errors.length > 0 && /* @__PURE__ */ jsx60("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ jsxs50("div", { className: "flex", children: [
9925
+ /* @__PURE__ */ jsx60(AlertCircle5, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
9365
9926
  /* @__PURE__ */ jsxs50("div", { className: "ml-3", children: [
9366
- /* @__PURE__ */ jsx59("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
9367
- /* @__PURE__ */ jsx59("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ jsx59("li", { children: e }, i)) })
9927
+ /* @__PURE__ */ jsx60("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
9928
+ /* @__PURE__ */ jsx60("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ jsx60("li", { children: e }, i)) })
9368
9929
  ] })
9369
9930
  ] }) }),
9370
- /* @__PURE__ */ jsx59(
9931
+ /* @__PURE__ */ jsx60(
9371
9932
  DetailPageLayout,
9372
9933
  {
9373
9934
  main: /* @__PURE__ */ jsxs50(Fragment14, { children: [
9374
9935
  /* @__PURE__ */ jsxs50("section", { children: [
9375
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Product details" }),
9936
+ /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Product details" }),
9376
9937
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-4`, children: [
9377
9938
  /* @__PURE__ */ jsxs50("div", { children: [
9378
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Name *" }),
9379
- /* @__PURE__ */ jsx59("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls, required: true })
9939
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Name *" }),
9940
+ /* @__PURE__ */ jsx60("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls, required: true })
9380
9941
  ] }),
9381
9942
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9382
9943
  /* @__PURE__ */ jsxs50("div", { children: [
9383
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "SKU" }),
9384
- /* @__PURE__ */ jsx59("input", { type: "text", value: sku, onChange: (e) => setSku(e.target.value), className: inputCls })
9944
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "SKU" }),
9945
+ /* @__PURE__ */ jsx60("input", { type: "text", value: sku, onChange: (e) => setSku(e.target.value), className: inputCls })
9385
9946
  ] }),
9386
9947
  /* @__PURE__ */ jsxs50("div", { children: [
9387
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "HSN" }),
9388
- /* @__PURE__ */ jsx59("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls })
9948
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "HSN" }),
9949
+ /* @__PURE__ */ jsx60("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls })
9389
9950
  ] })
9390
9951
  ] }),
9391
9952
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9392
9953
  /* @__PURE__ */ jsxs50("div", { children: [
9393
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Brand" }),
9954
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Brand" }),
9394
9955
  /* @__PURE__ */ jsxs50("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
9395
- /* @__PURE__ */ jsx59("option", { value: "", children: "None" }),
9396
- brands.map((b) => /* @__PURE__ */ jsx59("option", { value: b.id, children: b.name }, b.id))
9956
+ /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9957
+ brands.map((b) => /* @__PURE__ */ jsx60("option", { value: b.id, children: b.name }, b.id))
9397
9958
  ] })
9398
9959
  ] }),
9399
9960
  /* @__PURE__ */ jsxs50("div", { children: [
9400
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Category" }),
9961
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Category" }),
9401
9962
  /* @__PURE__ */ jsxs50("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
9402
- /* @__PURE__ */ jsx59("option", { value: "", children: "None" }),
9403
- categories.map((c) => /* @__PURE__ */ jsx59("option", { value: c.id, children: c.name }, c.id))
9963
+ /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9964
+ categories.map((c) => /* @__PURE__ */ jsx60("option", { value: c.id, children: c.name }, c.id))
9404
9965
  ] })
9405
9966
  ] })
9406
9967
  ] }),
9407
9968
  /* @__PURE__ */ jsxs50("div", { children: [
9408
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Collection" }),
9969
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Collection" }),
9409
9970
  /* @__PURE__ */ jsxs50("select", { value: collectionId ?? "", onChange: (e) => setCollectionId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
9410
- /* @__PURE__ */ jsx59("option", { value: "", children: "None" }),
9411
- collections.map((c) => /* @__PURE__ */ jsx59("option", { value: c.id, children: c.name }, c.id))
9971
+ /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9972
+ collections.map((c) => /* @__PURE__ */ jsx60("option", { value: c.id, children: c.name }, c.id))
9412
9973
  ] })
9413
9974
  ] }),
9414
9975
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9415
9976
  /* @__PURE__ */ jsxs50("div", { children: [
9416
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Price *" }),
9417
- /* @__PURE__ */ jsx59("input", { type: "number", value: price, onChange: (e) => setPrice(e.target.value), className: inputCls, required: true })
9977
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Price *" }),
9978
+ /* @__PURE__ */ jsx60("input", { type: "number", value: price, onChange: (e) => setPrice(e.target.value), className: inputCls, required: true })
9418
9979
  ] }),
9419
9980
  /* @__PURE__ */ jsxs50("div", { children: [
9420
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Compare at price" }),
9421
- /* @__PURE__ */ jsx59("input", { type: "number", value: compareAtPrice, onChange: (e) => setCompareAtPrice(e.target.value), className: inputCls })
9981
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Compare at price" }),
9982
+ /* @__PURE__ */ jsx60("input", { type: "number", value: compareAtPrice, onChange: (e) => setCompareAtPrice(e.target.value), className: inputCls })
9422
9983
  ] })
9423
9984
  ] }),
9424
9985
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9425
9986
  /* @__PURE__ */ jsxs50("div", { children: [
9426
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Quantity" }),
9427
- /* @__PURE__ */ jsx59("input", { type: "number", value: quantity, onChange: (e) => setQuantity(Number(e.target.value) || 0), className: inputCls })
9987
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Quantity" }),
9988
+ /* @__PURE__ */ jsx60("input", { type: "number", value: quantity, onChange: (e) => setQuantity(Number(e.target.value) || 0), className: inputCls })
9428
9989
  ] }),
9429
9990
  /* @__PURE__ */ jsxs50("div", { children: [
9430
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Status" }),
9991
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Status" }),
9431
9992
  /* @__PURE__ */ jsxs50("select", { value: status, onChange: (e) => setStatus(e.target.value), className: inputCls, children: [
9432
- /* @__PURE__ */ jsx59("option", { value: "draft", children: "Draft" }),
9433
- /* @__PURE__ */ jsx59("option", { value: "available", children: "Available" }),
9434
- /* @__PURE__ */ jsx59("option", { value: "reserved", children: "Reserved" }),
9435
- /* @__PURE__ */ jsx59("option", { value: "sold", children: "Sold" })
9993
+ /* @__PURE__ */ jsx60("option", { value: "draft", children: "Draft" }),
9994
+ /* @__PURE__ */ jsx60("option", { value: "available", children: "Available" }),
9995
+ /* @__PURE__ */ jsx60("option", { value: "reserved", children: "Reserved" }),
9996
+ /* @__PURE__ */ jsx60("option", { value: "sold", children: "Sold" })
9436
9997
  ] })
9437
9998
  ] })
9438
9999
  ] })
9439
10000
  ] })
9440
10001
  ] }),
9441
10002
  /* @__PURE__ */ jsxs50("section", { children: [
9442
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Attributes (facets)" }),
9443
- /* @__PURE__ */ jsx59("p", { className: "text-xs text-gray-500 mb-2", children: "Search existing attributes or create new ones (like blog categories). Value on the right." }),
10003
+ /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Attributes (facets)" }),
10004
+ /* @__PURE__ */ jsx60("p", { className: "text-xs text-gray-500 mb-2", children: "Search existing attributes or create new ones (like blog categories). Value on the right." }),
9444
10005
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-2`, children: [
9445
10006
  facetRows.map((row, i) => /* @__PURE__ */ jsxs50("div", { className: "flex gap-2 items-start", children: [
9446
- /* @__PURE__ */ jsx59(
10007
+ /* @__PURE__ */ jsx60(
9447
10008
  AttributeFacetNameInput,
9448
10009
  {
9449
10010
  value: row.name,
@@ -9451,7 +10012,7 @@ function ProductEditPage({ productId }) {
9451
10012
  inputClassName: inputCls
9452
10013
  }
9453
10014
  ),
9454
- /* @__PURE__ */ jsx59(
10015
+ /* @__PURE__ */ jsx60(
9455
10016
  "input",
9456
10017
  {
9457
10018
  type: "text",
@@ -9461,21 +10022,21 @@ function ProductEditPage({ productId }) {
9461
10022
  className: `${inputCls} flex-1 min-w-[120px]`
9462
10023
  }
9463
10024
  ),
9464
- /* @__PURE__ */ jsx59("button", { type: "button", onClick: () => removeFacet(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0 mt-0.5", children: /* @__PURE__ */ jsx59(Trash25, { className: "h-4 w-4" }) })
10025
+ /* @__PURE__ */ jsx60("button", { type: "button", onClick: () => removeFacet(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0 mt-0.5", children: /* @__PURE__ */ jsx60(Trash25, { className: "h-4 w-4" }) })
9465
10026
  ] }, i)),
9466
10027
  /* @__PURE__ */ jsxs50("button", { type: "button", onClick: addFacet, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
9467
- /* @__PURE__ */ jsx59(Plus9, { className: "h-3.5 w-3.5" }),
10028
+ /* @__PURE__ */ jsx60(Plus9, { className: "h-3.5 w-3.5" }),
9468
10029
  " Add attribute"
9469
10030
  ] })
9470
10031
  ] })
9471
10032
  ] }),
9472
10033
  /* @__PURE__ */ jsxs50("section", { children: [
9473
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Media" }),
10034
+ /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Media" }),
9474
10035
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-3`, children: [
9475
10036
  images.map((row, i) => /* @__PURE__ */ jsxs50("div", { className: "flex flex-wrap items-start gap-2 p-2 bg-white rounded border border-gray-200", children: [
9476
10037
  /* @__PURE__ */ jsxs50("div", { className: "flex-1 min-w-[200px]", children: [
9477
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Image URL" }),
9478
- /* @__PURE__ */ jsx59(
10038
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Image URL" }),
10039
+ /* @__PURE__ */ jsx60(
9479
10040
  "input",
9480
10041
  {
9481
10042
  type: "url",
@@ -9487,8 +10048,8 @@ function ProductEditPage({ productId }) {
9487
10048
  )
9488
10049
  ] }),
9489
10050
  /* @__PURE__ */ jsxs50("div", { className: "flex-1 min-w-[120px]", children: [
9490
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Alt text" }),
9491
- /* @__PURE__ */ jsx59(
10051
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Alt text" }),
10052
+ /* @__PURE__ */ jsx60(
9492
10053
  "input",
9493
10054
  {
9494
10055
  type: "text",
@@ -9498,27 +10059,27 @@ function ProductEditPage({ productId }) {
9498
10059
  }
9499
10060
  )
9500
10061
  ] }),
9501
- /* @__PURE__ */ jsx59(
10062
+ /* @__PURE__ */ jsx60(
9502
10063
  "button",
9503
10064
  {
9504
10065
  type: "button",
9505
10066
  onClick: () => setDefaultImage(i),
9506
10067
  title: "Set as default",
9507
10068
  className: "mt-6 p-2 rounded border border-gray-300 hover:bg-gray-100",
9508
- children: /* @__PURE__ */ jsx59(Star, { className: `h-4 w-4 ${row.isDefault ? "fill-amber-400 text-amber-500" : "text-gray-400"}` })
10069
+ children: /* @__PURE__ */ jsx60(Star, { className: `h-4 w-4 ${row.isDefault ? "fill-amber-400 text-amber-500" : "text-gray-400"}` })
9509
10070
  }
9510
10071
  ),
9511
- /* @__PURE__ */ jsx59("button", { type: "button", onClick: () => removeImage(i), className: "mt-6 p-2 text-gray-400 hover:text-red-600 rounded", children: /* @__PURE__ */ jsx59(Trash25, { className: "h-4 w-4" }) })
10072
+ /* @__PURE__ */ jsx60("button", { type: "button", onClick: () => removeImage(i), className: "mt-6 p-2 text-gray-400 hover:text-red-600 rounded", children: /* @__PURE__ */ jsx60(Trash25, { className: "h-4 w-4" }) })
9512
10073
  ] }, i)),
9513
10074
  /* @__PURE__ */ jsxs50("button", { type: "button", onClick: addImage, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
9514
- /* @__PURE__ */ jsx59(Plus9, { className: "h-3.5 w-3.5" }),
10075
+ /* @__PURE__ */ jsx60(Plus9, { className: "h-3.5 w-3.5" }),
9515
10076
  " Add image"
9516
10077
  ] })
9517
10078
  ] })
9518
10079
  ] }),
9519
10080
  /* @__PURE__ */ jsxs50("section", { children: [
9520
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Description" }),
9521
- /* @__PURE__ */ jsx59("div", { className: sectionCls, children: /* @__PURE__ */ jsx59(
10081
+ /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Description" }),
10082
+ /* @__PURE__ */ jsx60("div", { className: sectionCls, children: /* @__PURE__ */ jsx60(
9522
10083
  "textarea",
9523
10084
  {
9524
10085
  value: description,
@@ -9530,10 +10091,10 @@ function ProductEditPage({ productId }) {
9530
10091
  ) })
9531
10092
  ] }),
9532
10093
  /* @__PURE__ */ jsxs50("section", { children: [
9533
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Specifications" }),
10094
+ /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Specifications" }),
9534
10095
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-2`, children: [
9535
10096
  specifications.map((row, i) => /* @__PURE__ */ jsxs50("div", { className: "flex gap-2", children: [
9536
- /* @__PURE__ */ jsx59(
10097
+ /* @__PURE__ */ jsx60(
9537
10098
  "input",
9538
10099
  {
9539
10100
  type: "text",
@@ -9543,7 +10104,7 @@ function ProductEditPage({ productId }) {
9543
10104
  className: `${inputCls} flex-1`
9544
10105
  }
9545
10106
  ),
9546
- /* @__PURE__ */ jsx59(
10107
+ /* @__PURE__ */ jsx60(
9547
10108
  "input",
9548
10109
  {
9549
10110
  type: "text",
@@ -9553,18 +10114,18 @@ function ProductEditPage({ productId }) {
9553
10114
  className: `${inputCls} flex-1`
9554
10115
  }
9555
10116
  ),
9556
- /* @__PURE__ */ jsx59("button", { type: "button", onClick: () => removeSpec(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx59(Trash25, { className: "h-4 w-4" }) })
10117
+ /* @__PURE__ */ jsx60("button", { type: "button", onClick: () => removeSpec(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx60(Trash25, { className: "h-4 w-4" }) })
9557
10118
  ] }, i)),
9558
10119
  /* @__PURE__ */ jsxs50("button", { type: "button", onClick: addSpec, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
9559
- /* @__PURE__ */ jsx59(Plus9, { className: "h-3.5 w-3.5" }),
10120
+ /* @__PURE__ */ jsx60(Plus9, { className: "h-3.5 w-3.5" }),
9560
10121
  " Add row"
9561
10122
  ] })
9562
10123
  ] })
9563
10124
  ] })
9564
10125
  ] }),
9565
10126
  sidebar: /* @__PURE__ */ jsxs50("section", { children: [
9566
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
9567
- /* @__PURE__ */ jsx59("div", { className: sectionCls, children: /* @__PURE__ */ jsx59(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
10127
+ /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
10128
+ /* @__PURE__ */ jsx60("div", { className: sectionCls, children: /* @__PURE__ */ jsx60(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
9568
10129
  ] })
9569
10130
  }
9570
10131
  )
@@ -9575,7 +10136,7 @@ function ProductEditPage({ productId }) {
9575
10136
  import { useState as useState33, useEffect as useEffect31 } from "react";
9576
10137
  import { useRouter as useRouter12 } from "next/navigation";
9577
10138
  import { AlertCircle as AlertCircle6, Plus as Plus10, Trash2 as Trash26, ChevronDown as ChevronDown6, ChevronUp as ChevronUp2 } from "lucide-react";
9578
- import { Fragment as Fragment15, jsx as jsx60, jsxs as jsxs51 } from "react/jsx-runtime";
10139
+ import { Fragment as Fragment15, jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
9579
10140
  var isCreate3 = (id) => id === "create";
9580
10141
  var emptySlide = () => ({ url: "", type: "image", caption: "" });
9581
10142
  var emptyVariant = () => ({ name: "", price: "", extraSpecs: [] });
@@ -9776,10 +10337,10 @@ function CollectionEditPage({ collectionId }) {
9776
10337
  (v) => v.map((x, j) => j === variantIdx ? { ...x, extraSpecs: x.extraSpecs.filter((_, s) => s !== specIdx) } : x)
9777
10338
  );
9778
10339
  if (loading) {
9779
- return /* @__PURE__ */ jsx60("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx60("span", { className: "text-gray-500", children: "Loading..." }) });
10340
+ return /* @__PURE__ */ jsx61("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx61("span", { className: "text-gray-500", children: "Loading..." }) });
9780
10341
  }
9781
10342
  return /* @__PURE__ */ jsxs51("div", { className: "rounded-lg bg-white shadow-md", children: [
9782
- /* @__PURE__ */ jsx60(
10343
+ /* @__PURE__ */ jsx61(
9783
10344
  DetailPageHeader,
9784
10345
  {
9785
10346
  title: create ? "Add Collection" : "Edit Collection",
@@ -9791,59 +10352,59 @@ function CollectionEditPage({ collectionId }) {
9791
10352
  ]
9792
10353
  }
9793
10354
  ),
9794
- errors.length > 0 && /* @__PURE__ */ jsx60("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ jsxs51("div", { className: "flex", children: [
9795
- /* @__PURE__ */ jsx60(AlertCircle6, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
10355
+ errors.length > 0 && /* @__PURE__ */ jsx61("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ jsxs51("div", { className: "flex", children: [
10356
+ /* @__PURE__ */ jsx61(AlertCircle6, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
9796
10357
  /* @__PURE__ */ jsxs51("div", { className: "ml-3", children: [
9797
- /* @__PURE__ */ jsx60("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
9798
- /* @__PURE__ */ jsx60("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ jsx60("li", { children: e }, i)) })
10358
+ /* @__PURE__ */ jsx61("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
10359
+ /* @__PURE__ */ jsx61("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ jsx61("li", { children: e }, i)) })
9799
10360
  ] })
9800
10361
  ] }) }),
9801
- /* @__PURE__ */ jsx60(
10362
+ /* @__PURE__ */ jsx61(
9802
10363
  DetailPageLayout,
9803
10364
  {
9804
10365
  main: /* @__PURE__ */ jsxs51(Fragment15, { children: [
9805
10366
  /* @__PURE__ */ jsxs51("section", { children: [
9806
- /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
10367
+ /* @__PURE__ */ jsx61("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
9807
10368
  /* @__PURE__ */ jsxs51("div", { className: `${sectionCls2} space-y-4`, children: [
9808
10369
  /* @__PURE__ */ jsxs51("div", { children: [
9809
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Name *" }),
9810
- /* @__PURE__ */ jsx60("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls2, required: true })
10370
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Name *" }),
10371
+ /* @__PURE__ */ jsx61("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls2, required: true })
9811
10372
  ] }),
9812
10373
  /* @__PURE__ */ jsxs51("div", { children: [
9813
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Slug *" }),
9814
- /* @__PURE__ */ jsx60("input", { type: "text", value: slug, onChange: (e) => setSlug(e.target.value), className: inputCls2, required: true })
10374
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Slug *" }),
10375
+ /* @__PURE__ */ jsx61("input", { type: "text", value: slug, onChange: (e) => setSlug(e.target.value), className: inputCls2, required: true })
9815
10376
  ] }),
9816
10377
  /* @__PURE__ */ jsxs51("div", { children: [
9817
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "HSN" }),
9818
- /* @__PURE__ */ jsx60("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls2 })
10378
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "HSN" }),
10379
+ /* @__PURE__ */ jsx61("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls2 })
9819
10380
  ] }),
9820
10381
  /* @__PURE__ */ jsxs51("div", { className: "grid grid-cols-2 gap-4", children: [
9821
10382
  /* @__PURE__ */ jsxs51("div", { children: [
9822
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Category" }),
10383
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Category" }),
9823
10384
  /* @__PURE__ */ jsxs51("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
9824
- /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9825
- categories.map((c) => /* @__PURE__ */ jsx60("option", { value: c.id, children: c.name }, c.id))
10385
+ /* @__PURE__ */ jsx61("option", { value: "", children: "None" }),
10386
+ categories.map((c) => /* @__PURE__ */ jsx61("option", { value: c.id, children: c.name }, c.id))
9826
10387
  ] })
9827
10388
  ] }),
9828
10389
  /* @__PURE__ */ jsxs51("div", { children: [
9829
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Brand" }),
10390
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Brand" }),
9830
10391
  /* @__PURE__ */ jsxs51("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
9831
- /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9832
- brands.map((b) => /* @__PURE__ */ jsx60("option", { value: b.id, children: b.name }, b.id))
10392
+ /* @__PURE__ */ jsx61("option", { value: "", children: "None" }),
10393
+ brands.map((b) => /* @__PURE__ */ jsx61("option", { value: b.id, children: b.name }, b.id))
9833
10394
  ] })
9834
10395
  ] })
9835
10396
  ] }),
9836
10397
  /* @__PURE__ */ jsxs51("div", { children: [
9837
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Description" }),
9838
- /* @__PURE__ */ jsx60("textarea", { value: description, onChange: (e) => setDescription(e.target.value), className: `${inputCls2} min-h-[80px]`, rows: 3 })
10398
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Description" }),
10399
+ /* @__PURE__ */ jsx61("textarea", { value: description, onChange: (e) => setDescription(e.target.value), className: `${inputCls2} min-h-[80px]`, rows: 3 })
9839
10400
  ] }),
9840
10401
  /* @__PURE__ */ jsxs51("div", { children: [
9841
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Cover image URL" }),
9842
- /* @__PURE__ */ jsx60("input", { type: "url", value: image, onChange: (e) => setImage(e.target.value), className: inputCls2, placeholder: "https://..." })
10402
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Cover image URL" }),
10403
+ /* @__PURE__ */ jsx61("input", { type: "url", value: image, onChange: (e) => setImage(e.target.value), className: inputCls2, placeholder: "https://..." })
9843
10404
  ] }),
9844
10405
  /* @__PURE__ */ jsxs51("div", { children: [
9845
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Sort order" }),
9846
- /* @__PURE__ */ jsx60("input", { type: "number", value: sortOrder, onChange: (e) => setSortOrder(Number(e.target.value) || 0), className: inputCls2, style: { width: "6rem" } })
10406
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Sort order" }),
10407
+ /* @__PURE__ */ jsx61("input", { type: "number", value: sortOrder, onChange: (e) => setSortOrder(Number(e.target.value) || 0), className: inputCls2, style: { width: "6rem" } })
9847
10408
  ] })
9848
10409
  ] })
9849
10410
  ] }),
@@ -9855,73 +10416,73 @@ function CollectionEditPage({ collectionId }) {
9855
10416
  onClick: () => setAdvancedOpen((o) => !o),
9856
10417
  className: "flex items-center gap-2 w-full text-left text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2",
9857
10418
  children: [
9858
- advancedOpen ? /* @__PURE__ */ jsx60(ChevronUp2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx60(ChevronDown6, { className: "h-4 w-4" }),
10419
+ advancedOpen ? /* @__PURE__ */ jsx61(ChevronUp2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx61(ChevronDown6, { className: "h-4 w-4" }),
9859
10420
  "Advanced page content"
9860
10421
  ]
9861
10422
  }
9862
10423
  ),
9863
10424
  advancedOpen && /* @__PURE__ */ jsxs51("div", { className: "space-y-4", children: [
9864
10425
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9865
- /* @__PURE__ */ jsx60("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Hero carousel" }),
10426
+ /* @__PURE__ */ jsx61("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Hero carousel" }),
9866
10427
  heroSlides.map((slide, i) => /* @__PURE__ */ jsxs51("div", { className: "flex flex-wrap gap-2 mb-3 p-2 bg-white rounded border", children: [
9867
- /* @__PURE__ */ jsx60("input", { type: "url", value: slide.url, onChange: (e) => updateHeroSlide(i, "url", e.target.value), placeholder: "Media URL", className: `${inputCls2} flex-1 min-w-[200px]` }),
10428
+ /* @__PURE__ */ jsx61("input", { type: "url", value: slide.url, onChange: (e) => updateHeroSlide(i, "url", e.target.value), placeholder: "Media URL", className: `${inputCls2} flex-1 min-w-[200px]` }),
9868
10429
  /* @__PURE__ */ jsxs51("select", { value: slide.type, onChange: (e) => updateHeroSlide(i, "type", e.target.value), className: `${inputCls2} w-24`, children: [
9869
- /* @__PURE__ */ jsx60("option", { value: "image", children: "Image" }),
9870
- /* @__PURE__ */ jsx60("option", { value: "video", children: "Video" })
10430
+ /* @__PURE__ */ jsx61("option", { value: "image", children: "Image" }),
10431
+ /* @__PURE__ */ jsx61("option", { value: "video", children: "Video" })
9871
10432
  ] }),
9872
- /* @__PURE__ */ jsx60("input", { type: "text", value: slide.caption, onChange: (e) => updateHeroSlide(i, "caption", e.target.value), placeholder: "Caption", className: `${inputCls2} flex-1 min-w-[120px]` }),
9873
- /* @__PURE__ */ jsx60("button", { type: "button", onClick: () => removeHeroSlide(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx60(Trash26, { className: "h-4 w-4" }) })
10433
+ /* @__PURE__ */ jsx61("input", { type: "text", value: slide.caption, onChange: (e) => updateHeroSlide(i, "caption", e.target.value), placeholder: "Caption", className: `${inputCls2} flex-1 min-w-[120px]` }),
10434
+ /* @__PURE__ */ jsx61("button", { type: "button", onClick: () => removeHeroSlide(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx61(Trash26, { className: "h-4 w-4" }) })
9874
10435
  ] }, i)),
9875
10436
  /* @__PURE__ */ jsxs51("button", { type: "button", onClick: addHeroSlide, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
9876
- /* @__PURE__ */ jsx60(Plus10, { className: "h-3.5 w-3.5" }),
10437
+ /* @__PURE__ */ jsx61(Plus10, { className: "h-3.5 w-3.5" }),
9877
10438
  " Add slide"
9878
10439
  ] })
9879
10440
  ] }),
9880
10441
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9881
- /* @__PURE__ */ jsx60("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Variants" }),
10442
+ /* @__PURE__ */ jsx61("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Variants" }),
9882
10443
  variants.map((v, i) => /* @__PURE__ */ jsxs51("div", { className: "mb-4 p-3 bg-white rounded border space-y-2", children: [
9883
10444
  /* @__PURE__ */ jsxs51("div", { className: "flex gap-2", children: [
9884
- /* @__PURE__ */ jsx60("input", { type: "text", value: v.name, onChange: (e) => updateVariant(i, "name", e.target.value), placeholder: "Name", className: `${inputCls2} w-40` }),
9885
- /* @__PURE__ */ jsx60("input", { type: "number", value: v.price, onChange: (e) => updateVariant(i, "price", e.target.value), placeholder: "Price", className: `${inputCls2} w-28` }),
9886
- /* @__PURE__ */ jsx60("button", { type: "button", onClick: () => removeVariant(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx60(Trash26, { className: "h-4 w-4" }) })
10445
+ /* @__PURE__ */ jsx61("input", { type: "text", value: v.name, onChange: (e) => updateVariant(i, "name", e.target.value), placeholder: "Name", className: `${inputCls2} w-40` }),
10446
+ /* @__PURE__ */ jsx61("input", { type: "number", value: v.price, onChange: (e) => updateVariant(i, "price", e.target.value), placeholder: "Price", className: `${inputCls2} w-28` }),
10447
+ /* @__PURE__ */ jsx61("button", { type: "button", onClick: () => removeVariant(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx61(Trash26, { className: "h-4 w-4" }) })
9887
10448
  ] }),
9888
10449
  v.extraSpecs.map((s, si) => /* @__PURE__ */ jsxs51("div", { className: "flex gap-2", children: [
9889
- /* @__PURE__ */ jsx60("input", { type: "text", value: s.key, onChange: (e) => updateVariantExtraSpec(i, si, "key", e.target.value), placeholder: "Key", className: `${inputCls2} flex-1` }),
9890
- /* @__PURE__ */ jsx60("input", { type: "text", value: s.value, onChange: (e) => updateVariantExtraSpec(i, si, "value", e.target.value), placeholder: "Value", className: `${inputCls2} flex-1` }),
9891
- /* @__PURE__ */ jsx60("button", { type: "button", onClick: () => removeVariantExtraSpec(i, si), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx60(Trash26, { className: "h-4 w-4" }) })
10450
+ /* @__PURE__ */ jsx61("input", { type: "text", value: s.key, onChange: (e) => updateVariantExtraSpec(i, si, "key", e.target.value), placeholder: "Key", className: `${inputCls2} flex-1` }),
10451
+ /* @__PURE__ */ jsx61("input", { type: "text", value: s.value, onChange: (e) => updateVariantExtraSpec(i, si, "value", e.target.value), placeholder: "Value", className: `${inputCls2} flex-1` }),
10452
+ /* @__PURE__ */ jsx61("button", { type: "button", onClick: () => removeVariantExtraSpec(i, si), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ jsx61(Trash26, { className: "h-4 w-4" }) })
9892
10453
  ] }, si)),
9893
10454
  /* @__PURE__ */ jsxs51("button", { type: "button", onClick: () => addVariantExtraSpec(i), className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-50", children: [
9894
- /* @__PURE__ */ jsx60(Plus10, { className: "h-3 w-3" }),
10455
+ /* @__PURE__ */ jsx61(Plus10, { className: "h-3 w-3" }),
9895
10456
  " Add spec"
9896
10457
  ] })
9897
10458
  ] }, i)),
9898
10459
  /* @__PURE__ */ jsxs51("button", { type: "button", onClick: addVariant, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
9899
- /* @__PURE__ */ jsx60(Plus10, { className: "h-3.5 w-3.5" }),
10460
+ /* @__PURE__ */ jsx61(Plus10, { className: "h-3.5 w-3.5" }),
9900
10461
  " Add variant"
9901
10462
  ] })
9902
10463
  ] }),
9903
10464
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9904
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Experience description" }),
9905
- /* @__PURE__ */ jsx60("textarea", { value: experienceDescription, onChange: (e) => setExperienceDescription(e.target.value), className: `${inputCls2} min-h-[60px]`, rows: 2, placeholder: "Optional" })
10465
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Experience description" }),
10466
+ /* @__PURE__ */ jsx61("textarea", { value: experienceDescription, onChange: (e) => setExperienceDescription(e.target.value), className: `${inputCls2} min-h-[60px]`, rows: 2, placeholder: "Optional" })
9906
10467
  ] }),
9907
10468
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9908
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Brochure URL" }),
9909
- /* @__PURE__ */ jsx60("input", { type: "url", value: brochureUrl, onChange: (e) => setBrochureUrl(e.target.value), className: inputCls2, placeholder: "https://..." })
10469
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Brochure URL" }),
10470
+ /* @__PURE__ */ jsx61("input", { type: "url", value: brochureUrl, onChange: (e) => setBrochureUrl(e.target.value), className: inputCls2, placeholder: "https://..." })
9910
10471
  ] })
9911
10472
  ] })
9912
10473
  ] })
9913
10474
  ] }),
9914
10475
  sidebar: /* @__PURE__ */ jsxs51(Fragment15, { children: [
9915
10476
  /* @__PURE__ */ jsxs51("section", { children: [
9916
- /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
9917
- /* @__PURE__ */ jsx60("div", { className: sectionCls2, children: /* @__PURE__ */ jsxs51("label", { className: "flex items-center gap-2 cursor-pointer", children: [
9918
- /* @__PURE__ */ jsx60("input", { type: "checkbox", checked: active, onChange: (e) => setActive(e.target.checked), className: "h-4 w-4 rounded border-gray-300" }),
9919
- /* @__PURE__ */ jsx60("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
10477
+ /* @__PURE__ */ jsx61("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
10478
+ /* @__PURE__ */ jsx61("div", { className: sectionCls2, children: /* @__PURE__ */ jsxs51("label", { className: "flex items-center gap-2 cursor-pointer", children: [
10479
+ /* @__PURE__ */ jsx61("input", { type: "checkbox", checked: active, onChange: (e) => setActive(e.target.checked), className: "h-4 w-4 rounded border-gray-300" }),
10480
+ /* @__PURE__ */ jsx61("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
9920
10481
  ] }) })
9921
10482
  ] }),
9922
10483
  /* @__PURE__ */ jsxs51("section", { children: [
9923
- /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
9924
- /* @__PURE__ */ jsx60("div", { className: sectionCls2, children: /* @__PURE__ */ jsx60(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
10484
+ /* @__PURE__ */ jsx61("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
10485
+ /* @__PURE__ */ jsx61("div", { className: sectionCls2, children: /* @__PURE__ */ jsx61(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
9925
10486
  ] })
9926
10487
  ] })
9927
10488
  }
@@ -9941,7 +10502,7 @@ function isSuperAdminGroupName(name) {
9941
10502
  }
9942
10503
 
9943
10504
  // src/admin/pages/RolesPage.tsx
9944
- import { jsx as jsx61, jsxs as jsxs52 } from "react/jsx-runtime";
10505
+ import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
9945
10506
  function RoleListItem({
9946
10507
  group,
9947
10508
  selected,
@@ -9955,8 +10516,8 @@ function RoleListItem({
9955
10516
  onClick: onSelect,
9956
10517
  className: `flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors ${selected ? "border-gray-300 bg-gray-50 dark:border-gray-600 dark:bg-gray-700/50" : "border-transparent hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,
9957
10518
  children: [
9958
- /* @__PURE__ */ jsx61(Shield2, { className: "h-5 w-5 shrink-0 text-gray-500" }),
9959
- /* @__PURE__ */ jsx61("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx61("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: group.name }) })
10519
+ /* @__PURE__ */ jsx62(Shield2, { className: "h-5 w-5 shrink-0 text-gray-500" }),
10520
+ /* @__PURE__ */ jsx62("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx62("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: group.name }) })
9960
10521
  ]
9961
10522
  }
9962
10523
  );
@@ -10090,27 +10651,27 @@ function RolesPage() {
10090
10651
  }
10091
10652
  };
10092
10653
  if (status === "loading" || loading) {
10093
- return /* @__PURE__ */ jsx61("div", { className: "flex items-center justify-center py-12 text-gray-600", children: "Loading\u2026" });
10654
+ return /* @__PURE__ */ jsx62("div", { className: "flex items-center justify-center py-12 text-gray-600", children: "Loading\u2026" });
10094
10655
  }
10095
10656
  if (!canManage) {
10096
- return /* @__PURE__ */ jsx61("p", { className: "text-gray-600 p-6", children: "You do not have permission to manage roles." });
10657
+ return /* @__PURE__ */ jsx62("p", { className: "text-gray-600 p-6", children: "You do not have permission to manage roles." });
10097
10658
  }
10098
10659
  return /* @__PURE__ */ jsxs52("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
10099
10660
  /* @__PURE__ */ jsxs52("div", { className: "rounded-t-lg border-b border-gray-700 bg-gray-800 px-4 py-2.5 dark:border-gray-700 dark:bg-gray-900", children: [
10100
- /* @__PURE__ */ jsx61("h1", { className: "text-base font-semibold text-white", children: "Roles" }),
10101
- /* @__PURE__ */ jsx61("p", { className: "mt-0.5 text-xs text-gray-300", children: "Only the Administrator group can open this page. All roles use the matrix for entity access (Administrator also has users / roles plumbing without matrix rows)." })
10661
+ /* @__PURE__ */ jsx62("h1", { className: "text-base font-semibold text-white", children: "Roles" }),
10662
+ /* @__PURE__ */ jsx62("p", { className: "mt-0.5 text-xs text-gray-300", children: "Only the Administrator group can open this page. All roles use the matrix for entity access (Administrator also has users / roles plumbing without matrix rows)." })
10102
10663
  ] }),
10103
10664
  /* @__PURE__ */ jsxs52("div", { className: "min-w-0 p-6", children: [
10104
- error ? /* @__PURE__ */ jsx61("div", { className: "py-8 text-center", children: /* @__PURE__ */ jsx61("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) }) : groups.length === 0 ? /* @__PURE__ */ jsxs52("div", { className: "py-12 text-center", children: [
10105
- /* @__PURE__ */ jsx61(Shield2, { className: "mx-auto h-10 w-10 text-gray-400" }),
10106
- /* @__PURE__ */ jsx61("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No roles yet. Add one below." })
10665
+ error ? /* @__PURE__ */ jsx62("div", { className: "py-8 text-center", children: /* @__PURE__ */ jsx62("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) }) : groups.length === 0 ? /* @__PURE__ */ jsxs52("div", { className: "py-12 text-center", children: [
10666
+ /* @__PURE__ */ jsx62(Shield2, { className: "mx-auto h-10 w-10 text-gray-400" }),
10667
+ /* @__PURE__ */ jsx62("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No roles yet. Add one below." })
10107
10668
  ] }) : /* @__PURE__ */ jsxs52("div", { className: "flex gap-6", children: [
10108
10669
  /* @__PURE__ */ jsxs52("div", { className: "w-56 shrink-0 space-y-1", children: [
10109
- groups.map((g) => /* @__PURE__ */ jsx61(RoleListItem, { group: g, selected: selectedId === g.id, onSelect: () => setSelectedId(g.id) }, g.id)),
10670
+ groups.map((g) => /* @__PURE__ */ jsx62(RoleListItem, { group: g, selected: selectedId === g.id, onSelect: () => setSelectedId(g.id) }, g.id)),
10110
10671
  /* @__PURE__ */ jsxs52("div", { className: "space-y-2 border-t border-gray-200 pt-3 dark:border-gray-700", children: [
10111
- /* @__PURE__ */ jsx61(Label3, { className: "text-xs text-gray-500", children: "New role" }),
10672
+ /* @__PURE__ */ jsx62(Label3, { className: "text-xs text-gray-500", children: "New role" }),
10112
10673
  /* @__PURE__ */ jsxs52("div", { className: "flex gap-2", children: [
10113
- /* @__PURE__ */ jsx61(
10674
+ /* @__PURE__ */ jsx62(
10114
10675
  Input,
10115
10676
  {
10116
10677
  className: "h-8 text-sm",
@@ -10120,13 +10681,13 @@ function RolesPage() {
10120
10681
  onKeyDown: (e) => e.key === "Enter" && createGroup()
10121
10682
  }
10122
10683
  ),
10123
- /* @__PURE__ */ jsx61(Button, { type: "button", size: "sm", variant: "outline", className: "shrink-0", onClick: createGroup, children: "Add" })
10684
+ /* @__PURE__ */ jsx62(Button, { type: "button", size: "sm", variant: "outline", className: "shrink-0", onClick: createGroup, children: "Add" })
10124
10685
  ] })
10125
10686
  ] })
10126
10687
  ] }),
10127
- /* @__PURE__ */ jsx61("div", { className: "min-w-0 flex-1", children: !selectedId ? /* @__PURE__ */ jsxs52("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
10128
- /* @__PURE__ */ jsx61(Shield2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
10129
- /* @__PURE__ */ jsx61("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a role to view or edit permissions." })
10688
+ /* @__PURE__ */ jsx62("div", { className: "min-w-0 flex-1", children: !selectedId ? /* @__PURE__ */ jsxs52("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
10689
+ /* @__PURE__ */ jsx62(Shield2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
10690
+ /* @__PURE__ */ jsx62("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a role to view or edit permissions." })
10130
10691
  ] }) : /* @__PURE__ */ jsxs52("div", { className: "rounded-lg border border-gray-200 bg-gray-50/50 p-5 dark:border-gray-700 dark:bg-gray-800/50", children: [
10131
10692
  /* @__PURE__ */ jsxs52("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [
10132
10693
  /* @__PURE__ */ jsxs52("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
@@ -10134,28 +10695,28 @@ function RolesPage() {
10134
10695
  " \u2014 Permissions"
10135
10696
  ] }),
10136
10697
  /* @__PURE__ */ jsxs52(Button, { size: "sm", onClick: saveMatrix, disabled: saving, className: "gap-1", children: [
10137
- /* @__PURE__ */ jsx61(Save6, { className: "h-3.5 w-3.5" }),
10698
+ /* @__PURE__ */ jsx62(Save6, { className: "h-3.5 w-3.5" }),
10138
10699
  saving ? "Saving\u2026" : "Save"
10139
10700
  ] }),
10140
10701
  selected && !isSuperAdminGroupName(selected.name) && /* @__PURE__ */ jsxs52(Button, { size: "sm", variant: "outline", className: "gap-1 text-red-600", onClick: deleteGroup, children: [
10141
- /* @__PURE__ */ jsx61(Trash27, { className: "h-3.5 w-3.5" }),
10702
+ /* @__PURE__ */ jsx62(Trash27, { className: "h-3.5 w-3.5" }),
10142
10703
  "Delete role"
10143
10704
  ] })
10144
10705
  ] }),
10145
- entities.length > 0 && /* @__PURE__ */ jsx61("div", { className: "overflow-x-auto rounded-md border border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ jsxs52("table", { className: "w-full text-sm", children: [
10146
- /* @__PURE__ */ jsx61("thead", { children: /* @__PURE__ */ jsxs52("tr", { className: "border-b bg-gray-50 dark:bg-gray-900/50", children: [
10147
- /* @__PURE__ */ jsx61("th", { className: "p-3 text-left font-medium", children: "Resource" }),
10148
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "C" }),
10149
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "R" }),
10150
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "U" }),
10151
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "D" })
10706
+ entities.length > 0 && /* @__PURE__ */ jsx62("div", { className: "overflow-x-auto rounded-md border border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ jsxs52("table", { className: "w-full text-sm", children: [
10707
+ /* @__PURE__ */ jsx62("thead", { children: /* @__PURE__ */ jsxs52("tr", { className: "border-b bg-gray-50 dark:bg-gray-900/50", children: [
10708
+ /* @__PURE__ */ jsx62("th", { className: "p-3 text-left font-medium", children: "Resource" }),
10709
+ /* @__PURE__ */ jsx62("th", { className: "p-2", children: "C" }),
10710
+ /* @__PURE__ */ jsx62("th", { className: "p-2", children: "R" }),
10711
+ /* @__PURE__ */ jsx62("th", { className: "p-2", children: "U" }),
10712
+ /* @__PURE__ */ jsx62("th", { className: "p-2", children: "D" })
10152
10713
  ] }) }),
10153
- /* @__PURE__ */ jsx61("tbody", { children: entities.map((entity) => {
10714
+ /* @__PURE__ */ jsx62("tbody", { children: entities.map((entity) => {
10154
10715
  const row = matrix[entity];
10155
10716
  if (!row) return null;
10156
10717
  return /* @__PURE__ */ jsxs52("tr", { className: "border-b border-gray-100 hover:bg-gray-50/50 dark:border-gray-700 dark:hover:bg-gray-800/30", children: [
10157
- /* @__PURE__ */ jsx61("td", { className: "p-3 font-mono text-xs", children: entity }),
10158
- ["canCreate", "canRead", "canUpdate", "canDelete"].map((k) => /* @__PURE__ */ jsx61("td", { className: "p-2 text-center", children: /* @__PURE__ */ jsx61(
10718
+ /* @__PURE__ */ jsx62("td", { className: "p-3 font-mono text-xs", children: entity }),
10719
+ ["canCreate", "canRead", "canUpdate", "canDelete"].map((k) => /* @__PURE__ */ jsx62("td", { className: "p-2 text-center", children: /* @__PURE__ */ jsx62(
10159
10720
  "input",
10160
10721
  {
10161
10722
  type: "checkbox",
@@ -10169,8 +10730,8 @@ function RolesPage() {
10169
10730
  ] }) })
10170
10731
  ] }),
10171
10732
  !error && groups.length === 0 && /* @__PURE__ */ jsxs52("div", { className: "mt-6 flex max-w-md gap-2", children: [
10172
- /* @__PURE__ */ jsx61(Input, { placeholder: "New role name", value: newName, onChange: (e) => setNewName(e.target.value), onKeyDown: (e) => e.key === "Enter" && createGroup() }),
10173
- /* @__PURE__ */ jsx61(Button, { type: "button", onClick: createGroup, children: "Add role" })
10733
+ /* @__PURE__ */ jsx62(Input, { placeholder: "New role name", value: newName, onChange: (e) => setNewName(e.target.value), onKeyDown: (e) => e.key === "Enter" && createGroup() }),
10734
+ /* @__PURE__ */ jsx62(Button, { type: "button", onClick: createGroup, children: "Add role" })
10174
10735
  ] })
10175
10736
  ] })
10176
10737
  ] });
@@ -10332,7 +10893,7 @@ var STORE_CRUD_CONFIGS = {
10332
10893
  };
10333
10894
 
10334
10895
  // src/admin/pages/AdminPageResolver.tsx
10335
- import { jsx as jsx62, jsxs as jsxs53 } from "react/jsx-runtime";
10896
+ import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
10336
10897
  var PAGE_MAP = {
10337
10898
  dashboard: DashboardPage,
10338
10899
  signin: SignInPage_default,
@@ -10458,11 +11019,11 @@ function BlogEditorWrapper({ blogId }) {
10458
11019
  }, [blogId]);
10459
11020
  if (loading) {
10460
11021
  return /* @__PURE__ */ jsxs53("div", { className: "flex items-center justify-center py-8", children: [
10461
- /* @__PURE__ */ jsx62("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
10462
- /* @__PURE__ */ jsx62("span", { className: "ml-2", children: "Loading..." })
11022
+ /* @__PURE__ */ jsx63("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
11023
+ /* @__PURE__ */ jsx63("span", { className: "ml-2", children: "Loading..." })
10463
11024
  ] });
10464
11025
  }
10465
- return /* @__PURE__ */ jsx62(BlogEditor, { existingBlog: blog });
11026
+ return /* @__PURE__ */ jsx63(BlogEditor, { existingBlog: blog });
10466
11027
  }
10467
11028
  function AdminPageResolver({ slug }) {
10468
11029
  const router = useRouter13();
@@ -10475,52 +11036,52 @@ function AdminPageResolver({ slug }) {
10475
11036
  }, [key, router]);
10476
11037
  if (key === "layout-settings") {
10477
11038
  return /* @__PURE__ */ jsxs53("div", { className: "flex justify-center py-8", children: [
10478
- /* @__PURE__ */ jsx62("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
10479
- /* @__PURE__ */ jsx62("span", { className: "ml-2", children: "Redirecting..." })
11039
+ /* @__PURE__ */ jsx63("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
11040
+ /* @__PURE__ */ jsx63("span", { className: "ml-2", children: "Redirecting..." })
10480
11041
  ] });
10481
11042
  }
10482
11043
  const Page = PAGE_MAP[key];
10483
11044
  if (Page) {
10484
- return /* @__PURE__ */ jsx62(Page, {});
11045
+ return /* @__PURE__ */ jsx63(Page, {});
10485
11046
  }
10486
11047
  if (key === "form-submissions" && slug && slug.length === 3 && slug[2] === "view") {
10487
- return /* @__PURE__ */ jsx62(SubmissionDetailPage, { submissionId: slug[1] });
11048
+ return /* @__PURE__ */ jsx63(SubmissionDetailPage, { submissionId: slug[1] });
10488
11049
  }
10489
11050
  if (key === "orders" && slug && slug.length === 3 && slug[2] === "view") {
10490
- return /* @__PURE__ */ jsx62(OrderDetailPage, { orderId: slug[1] });
11051
+ return /* @__PURE__ */ jsx63(OrderDetailPage, { orderId: slug[1] });
10491
11052
  }
10492
11053
  if (key === "payments" && slug && slug.length === 3 && slug[2] === "view") {
10493
- return /* @__PURE__ */ jsx62(PaymentDetailPage, { paymentId: slug[1] });
11054
+ return /* @__PURE__ */ jsx63(PaymentDetailPage, { paymentId: slug[1] });
10494
11055
  }
10495
11056
  if (key === "contacts" && slug && slug.length === 3 && slug[2] === "view") {
10496
- return /* @__PURE__ */ jsx62(ContactDetailPage, { contactId: slug[1] });
11057
+ return /* @__PURE__ */ jsx63(ContactDetailPage, { contactId: slug[1] });
10497
11058
  }
10498
11059
  const crud = { ...CRUD_CONFIGS, ...STORE_CRUD_CONFIGS, ...customCrudConfigs }[key];
10499
11060
  if (crud && slug && slug.length >= 2) {
10500
11061
  const subPath = slug[1];
10501
11062
  const isCreate4 = subPath === "create";
10502
11063
  if (key === "blogs") {
10503
- return /* @__PURE__ */ jsx62(BlogEditorWrapper, { blogId: isCreate4 ? void 0 : subPath });
11064
+ return /* @__PURE__ */ jsx63(BlogEditorWrapper, { blogId: isCreate4 ? void 0 : subPath });
10504
11065
  }
10505
11066
  if (key === "forms") {
10506
- return /* @__PURE__ */ jsx62(FormBuilder, { formId: isCreate4 ? void 0 : subPath });
11067
+ return /* @__PURE__ */ jsx63(FormBuilder, { formId: isCreate4 ? void 0 : subPath });
10507
11068
  }
10508
11069
  if (key === "pages") {
10509
- return /* @__PURE__ */ jsx62(PageBuilderPage, { pageId: isCreate4 ? void 0 : subPath });
11070
+ return /* @__PURE__ */ jsx63(PageBuilderPage, { pageId: isCreate4 ? void 0 : subPath });
10510
11071
  }
10511
11072
  if (key === "brands") {
10512
- return /* @__PURE__ */ jsx62(BrandEditPage, { brandId: subPath });
11073
+ return /* @__PURE__ */ jsx63(BrandEditPage, { brandId: subPath });
10513
11074
  }
10514
11075
  if (key === "products") {
10515
- return /* @__PURE__ */ jsx62(ProductEditPage, { productId: subPath });
11076
+ return /* @__PURE__ */ jsx63(ProductEditPage, { productId: subPath });
10516
11077
  }
10517
11078
  if (key === "collections") {
10518
- return /* @__PURE__ */ jsx62(CollectionEditPage, { collectionId: subPath });
11079
+ return /* @__PURE__ */ jsx63(CollectionEditPage, { collectionId: subPath });
10519
11080
  }
10520
11081
  }
10521
11082
  if (crud) {
10522
11083
  if (key === "media") {
10523
- return /* @__PURE__ */ jsx62(MediaLibraryPage, {});
11084
+ return /* @__PURE__ */ jsx63(MediaLibraryPage, {});
10524
11085
  }
10525
11086
  const isContactsWithStore = key === "contacts" && storeEnabled;
10526
11087
  const columns = isContactsWithStore ? [
@@ -10532,7 +11093,7 @@ function AdminPageResolver({ slug }) {
10532
11093
  () => isContactsWithStore ? { includeSummary: "1" } : void 0,
10533
11094
  [isContactsWithStore]
10534
11095
  );
10535
- return /* @__PURE__ */ jsx62(
11096
+ return /* @__PURE__ */ jsx63(
10536
11097
  AdminCRUD,
10537
11098
  {
10538
11099
  title: crud.title,
@@ -10547,13 +11108,13 @@ function AdminPageResolver({ slug }) {
10547
11108
  }
10548
11109
  );
10549
11110
  }
10550
- return /* @__PURE__ */ jsx62("div", { className: "flex items-center justify-center min-h-[50vh]", children: /* @__PURE__ */ jsx62("p", { className: "text-gray-500", children: "Page not found" }) });
11111
+ return /* @__PURE__ */ jsx63("div", { className: "flex items-center justify-center min-h-[50vh]", children: /* @__PURE__ */ jsx63("p", { className: "text-gray-500", children: "Page not found" }) });
10551
11112
  }
10552
11113
 
10553
11114
  // src/admin/pages/LayoutSettingsPage.tsx
10554
11115
  import { useState as useState36, useEffect as useEffect34, useContext as useContext7 } from "react";
10555
11116
  import { Save as Save7 } from "lucide-react";
10556
- import { jsx as jsx63, jsxs as jsxs54 } from "react/jsx-runtime";
11117
+ import { jsx as jsx64, jsxs as jsxs54 } from "react/jsx-runtime";
10557
11118
  function LayoutSettingsPage() {
10558
11119
  const { theme } = useContext7(AdminConfigContext);
10559
11120
  const [activeTab, setActiveTab] = useState36("navbar");
@@ -10609,13 +11170,13 @@ function LayoutSettingsPage() {
10609
11170
  props: footerLayout.fields
10610
11171
  } : null;
10611
11172
  if (loading) {
10612
- return /* @__PURE__ */ jsx63("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx63("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }) });
11173
+ return /* @__PURE__ */ jsx64("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx64("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }) });
10613
11174
  }
10614
11175
  return /* @__PURE__ */ jsxs54("div", { className: "min-w-0 rounded-lg bg-white shadow-md", children: [
10615
11176
  /* @__PURE__ */ jsxs54("div", { className: "bg-gray-800 px-4 py-2.5 rounded-t-lg flex items-center justify-between", children: [
10616
11177
  /* @__PURE__ */ jsxs54("div", { children: [
10617
- /* @__PURE__ */ jsx63("h1", { className: "text-xl font-bold text-white", children: "Layout Settings" }),
10618
- /* @__PURE__ */ jsx63("p", { className: "text-xs text-gray-300 mt-0.5", children: "Configure your site navbar and footer" })
11178
+ /* @__PURE__ */ jsx64("h1", { className: "text-xl font-bold text-white", children: "Layout Settings" }),
11179
+ /* @__PURE__ */ jsx64("p", { className: "text-xs text-gray-300 mt-0.5", children: "Configure your site navbar and footer" })
10619
11180
  ] }),
10620
11181
  /* @__PURE__ */ jsxs54(
10621
11182
  Button,
@@ -10624,14 +11185,14 @@ function LayoutSettingsPage() {
10624
11185
  disabled: saving,
10625
11186
  className: "bg-white text-gray-800 hover:bg-gray-100 border-0 text-xs",
10626
11187
  children: [
10627
- /* @__PURE__ */ jsx63(Save7, { className: "h-4 w-4 mr-2" }),
11188
+ /* @__PURE__ */ jsx64(Save7, { className: "h-4 w-4 mr-2" }),
10628
11189
  saving ? "Saving..." : "Save"
10629
11190
  ]
10630
11191
  }
10631
11192
  )
10632
11193
  ] }),
10633
- /* @__PURE__ */ jsx63("div", { className: "border-b", children: /* @__PURE__ */ jsxs54("div", { className: "flex", children: [
10634
- /* @__PURE__ */ jsx63(
11194
+ /* @__PURE__ */ jsx64("div", { className: "border-b", children: /* @__PURE__ */ jsxs54("div", { className: "flex", children: [
11195
+ /* @__PURE__ */ jsx64(
10635
11196
  "button",
10636
11197
  {
10637
11198
  className: `px-4 py-2.5 text-sm font-medium border-b-2 ${activeTab === "navbar" ? "border-gray-800 text-gray-800" : "border-transparent text-gray-500 hover:text-gray-700"}`,
@@ -10639,7 +11200,7 @@ function LayoutSettingsPage() {
10639
11200
  children: "Navbar"
10640
11201
  }
10641
11202
  ),
10642
- /* @__PURE__ */ jsx63(
11203
+ /* @__PURE__ */ jsx64(
10643
11204
  "button",
10644
11205
  {
10645
11206
  className: `px-4 py-2.5 text-sm font-medium border-b-2 ${activeTab === "footer" ? "border-gray-800 text-gray-800" : "border-transparent text-gray-500 hover:text-gray-700"}`,
@@ -10649,8 +11210,8 @@ function LayoutSettingsPage() {
10649
11210
  )
10650
11211
  ] }) }),
10651
11212
  /* @__PURE__ */ jsxs54("div", { className: "min-w-0 p-6", children: [
10652
- activeTab === "navbar" && /* @__PURE__ */ jsx63(NavbarEditor, { config: navbarConfig, onChange: setNavbarConfig }),
10653
- activeTab === "footer" && footerMeta && /* @__PURE__ */ jsx63(
11213
+ activeTab === "navbar" && /* @__PURE__ */ jsx64(NavbarEditor, { config: navbarConfig, onChange: setNavbarConfig }),
11214
+ activeTab === "footer" && footerMeta && /* @__PURE__ */ jsx64(
10654
11215
  ComponentSettings,
10655
11216
  {
10656
11217
  meta: footerMeta,
@@ -10658,7 +11219,7 @@ function LayoutSettingsPage() {
10658
11219
  onChange: (name, val) => setFooterValues((prev) => ({ ...prev, [name]: val }))
10659
11220
  }
10660
11221
  ),
10661
- activeTab === "footer" && !footerMeta && /* @__PURE__ */ jsx63("p", { className: "text-sm text-gray-500", children: "No footer configuration defined in the current theme." })
11222
+ activeTab === "footer" && !footerMeta && /* @__PURE__ */ jsx64("p", { className: "text-sm text-gray-500", children: "No footer configuration defined in the current theme." })
10662
11223
  ] })
10663
11224
  ] });
10664
11225
  }
@@ -10676,14 +11237,14 @@ var DEFAULT_ADMIN_NAV = [
10676
11237
  ];
10677
11238
 
10678
11239
  // src/admin/CmsProviders.tsx
10679
- import { SessionProvider as SessionProvider2 } from "next-auth/react";
11240
+ import { SessionProvider } from "next-auth/react";
10680
11241
  import { ThemeProvider } from "next-themes";
10681
11242
  import { Toaster as Toaster3 } from "sonner";
10682
- import { jsx as jsx64, jsxs as jsxs55 } from "react/jsx-runtime";
11243
+ import { jsx as jsx65, jsxs as jsxs55 } from "react/jsx-runtime";
10683
11244
  function CmsProviders({ children }) {
10684
- return /* @__PURE__ */ jsx64(SessionProvider2, { children: /* @__PURE__ */ jsxs55(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: [
11245
+ return /* @__PURE__ */ jsx65(SessionProvider, { children: /* @__PURE__ */ jsxs55(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: [
10685
11246
  children,
10686
- /* @__PURE__ */ jsx64(Toaster3, { position: "top-right" })
11247
+ /* @__PURE__ */ jsx65(Toaster3, { position: "top-right" })
10687
11248
  ] }) });
10688
11249
  }
10689
11250
  export {