@infuro/cms-core 1.0.12 → 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
@@ -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.12" : "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";
@@ -740,9 +740,7 @@ function useAdminViewSettings() {
740
740
  }, []);
741
741
  }
742
742
  function AdminLayoutInner({ children }) {
743
- const sessionState = useSession2();
744
- const session = sessionState?.data;
745
- const status = sessionState?.status ?? "loading";
743
+ const { data: session, status } = useSession2();
746
744
  const router = useRouter();
747
745
  const pathname = usePathname3();
748
746
  const [loadingTimeout, setLoadingTimeout] = useState2(false);
@@ -6080,9 +6078,86 @@ function OrderDetailPage({ orderId }) {
6080
6078
  /* @__PURE__ */ jsxs40("div", { className: "min-w-0", children: [
6081
6079
  /* @__PURE__ */ jsx49("dt", { className: "text-gray-500", children: "Total" }),
6082
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
+ ] })
6083
6101
  ] })
6084
6102
  ] }) })
6085
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
+ ] }),
6086
6161
  /* @__PURE__ */ jsxs40("section", { children: [
6087
6162
  /* @__PURE__ */ jsx49("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Line items" }),
6088
6163
  /* @__PURE__ */ jsx49("div", { className: "min-w-0 overflow-x-auto border border-gray-200 rounded-lg", children: /* @__PURE__ */ jsxs40(Table, { children: [
@@ -7805,33 +7880,50 @@ function RightSidebar({ theme, resolver, activeTab, setActiveTab, seoProps }) {
7805
7880
  ] })
7806
7881
  ] });
7807
7882
  }
7808
- 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
+ }) {
7809
7892
  const { query } = useEditor();
7810
7893
  const [saving, setSaving] = useState28(false);
7811
7894
  const handleSave = async () => {
7812
7895
  setSaving(true);
7813
7896
  try {
7814
7897
  const content = JSON.parse(query.serialize());
7815
- let seoId = null;
7816
- 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;
7817
7900
  if (hasSeo) {
7818
7901
  const seoPayload = {
7819
- title: pageData.seoTitle,
7820
- description: pageData.seoDescription,
7821
- keywords: pageData.seoKeywords,
7822
- ogTitle: pageData.seoOgTitle,
7823
- ogDescription: pageData.seoOgDescription,
7824
- 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,
7825
7908
  slug: pageData.slug
7826
7909
  };
7827
- const seoRes = await fetch("/api/seos", {
7828
- method: "POST",
7829
- headers: { "Content-Type": "application/json" },
7830
- body: JSON.stringify(seoPayload)
7831
- });
7832
- if (seoRes.ok) {
7833
- const seoData = await seoRes.json();
7834
- 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
+ }
7835
7927
  }
7836
7928
  }
7837
7929
  const payload = {
@@ -7840,7 +7932,7 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
7840
7932
  content,
7841
7933
  published: pageData.published
7842
7934
  };
7843
- if (seoId) payload.seoId = seoId;
7935
+ if (resolvedSeoId != null) payload.seoId = resolvedSeoId;
7844
7936
  const url = pageId ? `/api/pages/${pageId}` : "/api/pages";
7845
7937
  const method = pageId ? "PUT" : "POST";
7846
7938
  const res = await fetch(url, {
@@ -7850,6 +7942,8 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
7850
7942
  });
7851
7943
  if (res.ok) {
7852
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);
7853
7947
  onSaved(saved.id?.toString() || pageId || "");
7854
7948
  }
7855
7949
  } finally {
@@ -7882,9 +7976,11 @@ function PageBuilderPage({ pageId }) {
7882
7976
  const [seoOgTitle, setSeoOgTitle] = useState28("");
7883
7977
  const [seoOgDescription, setSeoOgDescription] = useState28("");
7884
7978
  const [seoOgImage, setSeoOgImage] = useState28("");
7979
+ const [pageSeoId, setPageSeoId] = useState28(null);
7885
7980
  useEffect26(() => {
7886
7981
  if (!pageId) {
7887
7982
  setInitialContent(null);
7983
+ setPageSeoId(null);
7888
7984
  setLoading(false);
7889
7985
  return;
7890
7986
  }
@@ -7893,6 +7989,9 @@ function PageBuilderPage({ pageId }) {
7893
7989
  setTitle(data.title || "");
7894
7990
  setSlug(data.slug || "");
7895
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
+ );
7896
7995
  if (data.content) {
7897
7996
  setInitialContent(JSON.stringify(data.content));
7898
7997
  }
@@ -7946,6 +8045,8 @@ function PageBuilderPage({ pageId }) {
7946
8045
  SaveButton,
7947
8046
  {
7948
8047
  pageId,
8048
+ existingSeoId: pageSeoId,
8049
+ onSeoIdChange: setPageSeoId,
7949
8050
  pageData: { title, slug, published, seoTitle, seoDescription, seoKeywords, seoOgTitle, seoOgDescription, seoOgImage },
7950
8051
  onSaved: (id) => {
7951
8052
  if (!pageId) router.replace(`/admin/pages/${id}`);
@@ -8024,7 +8125,7 @@ function PageBuilderPage({ pageId }) {
8024
8125
 
8025
8126
  // src/admin/pages/PluginsPage.tsx
8026
8127
  import { useContext as useContext5, useState as useState29, useEffect as useEffect27 } from "react";
8027
- 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";
8028
8129
 
8029
8130
  // src/lib/email-recipients.ts
8030
8131
  function parseEmailRecipientsFromConfig(raw) {
@@ -8045,15 +8146,57 @@ function serializeEmailRecipients(emails) {
8045
8146
  return JSON.stringify(emails);
8046
8147
  }
8047
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
+
8048
8174
  // src/admin/pages/PluginsPage.tsx
8049
8175
  import { toast as toast4 } from "sonner";
8050
- 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
+ }
8051
8181
  var ICON_MAP = {
8052
8182
  storage: HardDrive,
8053
8183
  email: Mail,
8054
8184
  payment: CreditCard2,
8055
- llm: MessageCircle
8185
+ llm: MessageCircle,
8186
+ analytics: BarChart32,
8187
+ erp: Building22,
8188
+ sms: Smartphone
8056
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
+ }
8057
8200
  function splitInputToEmails(input) {
8058
8201
  return input.split(/[,;]+/).map((s) => s.trim()).filter(Boolean);
8059
8202
  }
@@ -8107,26 +8250,26 @@ function EmailRecipientTags({
8107
8250
  setDraft("");
8108
8251
  };
8109
8252
  return /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8110
- /* @__PURE__ */ jsx55(Label3, { htmlFor: id, className: "text-sm", children: label }),
8253
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: id, className: "text-sm", children: label }),
8111
8254
  /* @__PURE__ */ jsxs46(
8112
8255
  "div",
8113
8256
  {
8114
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",
8115
8258
  children: [
8116
8259
  emails.map((email) => /* @__PURE__ */ jsxs46(Badge, { variant: "secondary", className: "gap-1 pr-0.5 font-normal", children: [
8117
- /* @__PURE__ */ jsx55("span", { className: "max-w-[220px] truncate", children: email }),
8118
- /* @__PURE__ */ jsx55(
8260
+ /* @__PURE__ */ jsx56("span", { className: "max-w-[220px] truncate", children: email }),
8261
+ /* @__PURE__ */ jsx56(
8119
8262
  "button",
8120
8263
  {
8121
8264
  type: "button",
8122
8265
  className: "rounded p-0.5 hover:bg-muted",
8123
8266
  "aria-label": `Remove ${email}`,
8124
8267
  onClick: () => onChange(emails.filter((e) => e !== email)),
8125
- children: /* @__PURE__ */ jsx55(X18, { className: "h-3 w-3" })
8268
+ children: /* @__PURE__ */ jsx56(X18, { className: "h-3 w-3" })
8126
8269
  }
8127
8270
  )
8128
8271
  ] }, email)),
8129
- /* @__PURE__ */ jsx55(
8272
+ /* @__PURE__ */ jsx56(
8130
8273
  "input",
8131
8274
  {
8132
8275
  id,
@@ -8153,14 +8296,14 @@ function EmailRecipientTags({
8153
8296
  ]
8154
8297
  }
8155
8298
  ),
8156
- /* @__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 })
8157
8300
  ] });
8158
8301
  }
8159
8302
  function PluginIcon({ descriptor, size = "md" }) {
8160
8303
  const Icon2 = descriptor.icon ? ICON_MAP[descriptor.icon] ?? Puzzle2 : Puzzle2;
8161
8304
  const sizeClass = size === "sm" ? "h-8 w-8" : "h-11 w-11";
8162
8305
  const iconClass = size === "sm" ? "h-4 w-4" : "h-5 w-5";
8163
- 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 }) });
8164
8307
  }
8165
8308
  function PluginSettingsPanel({
8166
8309
  descriptor,
@@ -8169,6 +8312,8 @@ function PluginSettingsPanel({
8169
8312
  const settingsGroup = descriptor.settingsGroup;
8170
8313
  const isLlm = settingsGroup === "llm";
8171
8314
  const isEmail = settingsGroup === "email";
8315
+ const isErp = settingsGroup === "erp";
8316
+ const isSms = settingsGroup === "sms";
8172
8317
  const [enabled, setEnabled] = useState29(true);
8173
8318
  const [botName, setBotName] = useState29("");
8174
8319
  const [icon, setIcon] = useState29("");
@@ -8185,18 +8330,59 @@ function PluginSettingsPanel({
8185
8330
  const [followUsTitle, setFollowUsTitle] = useState29("Follow Us");
8186
8331
  const [socialLinkRows, setSocialLinkRows] = useState29([{ ...EMPTY_SOCIAL_ROW }]);
8187
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([]);
8188
8344
  const [loading, setLoading] = useState29(true);
8189
8345
  const [saving, setSaving] = useState29(false);
8190
8346
  useEffect27(() => {
8191
- 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) => {
8192
8349
  setEnabled(data.enabled !== "false");
8193
8350
  setBotName(data.botName ?? "");
8194
8351
  setIcon(data.icon ?? "");
8195
8352
  if (isLlm) {
8353
+ setChatMode(normalizeChatMode(data.chatMode));
8354
+ setWhatsappPhone(data.whatsappPhone ?? "");
8355
+ setExternalChatSnippet(data.externalChatSnippet ?? "");
8196
8356
  setIconImageUrl(data.iconImageUrl ?? "");
8197
8357
  setIconBackgroundColor(data.iconBackgroundColor ?? "#6366f1");
8198
8358
  setHeaderColor(data.headerColor ?? "#6366f1");
8199
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
+ }
8200
8386
  if (isEmail) {
8201
8387
  const sales = parseEmailRecipientsFromConfig(data.salesTeamEmails ?? data.salesTeamEmail);
8202
8388
  const fulfil = parseEmailRecipientsFromConfig(data.fulfilmentTeamEmails ?? data.fulfilmentTeamEmail);
@@ -8213,14 +8399,48 @@ function PluginSettingsPanel({
8213
8399
  setFooterDisclaimer(data.footerDisclaimer ?? "");
8214
8400
  }
8215
8401
  }).finally(() => setLoading(false));
8216
- }, [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]);
8217
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
+ }
8218
8435
  const payload = {
8219
8436
  enabled: { value: enabled ? "true" : "false", type: "public" },
8220
8437
  botName: { value: botName, type: "public" },
8221
8438
  icon: { value: icon, type: "public" }
8222
8439
  };
8223
8440
  if (isLlm) {
8441
+ payload.chatMode = { value: chatMode, type: "public" };
8442
+ payload.whatsappPhone = { value: whatsappPhone, type: "public" };
8443
+ payload.externalChatSnippet = { value: externalChatSnippet, type: "public" };
8224
8444
  payload.iconImageUrl = { value: iconImageUrl, type: "public" };
8225
8445
  payload.iconBackgroundColor = { value: iconBackgroundColor, type: "public" };
8226
8446
  payload.headerColor = { value: headerColor, type: "public" };
@@ -8248,6 +8468,22 @@ function PluginSettingsPanel({
8248
8468
  body: JSON.stringify(buildPayload())
8249
8469
  });
8250
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
+ }
8251
8487
  toast4.success("Settings saved");
8252
8488
  onSaved?.();
8253
8489
  } catch {
@@ -8256,10 +8492,101 @@ function PluginSettingsPanel({
8256
8492
  setSaving(false);
8257
8493
  }
8258
8494
  };
8259
- 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
+ }
8260
8587
  if (isEmail) {
8261
8588
  return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8262
- /* @__PURE__ */ jsx55(
8589
+ /* @__PURE__ */ jsx56(
8263
8590
  EmailRecipientTags,
8264
8591
  {
8265
8592
  id: `${settingsGroup}-salesTeamEmails`,
@@ -8270,7 +8597,7 @@ function PluginSettingsPanel({
8270
8597
  placeholder: "e.g. sales@example.com"
8271
8598
  }
8272
8599
  ),
8273
- /* @__PURE__ */ jsx55(
8600
+ /* @__PURE__ */ jsx56(
8274
8601
  EmailRecipientTags,
8275
8602
  {
8276
8603
  id: `${settingsGroup}-fulfilmentTeamEmails`,
@@ -8281,7 +8608,7 @@ function PluginSettingsPanel({
8281
8608
  placeholder: "e.g. fulfilment@example.com"
8282
8609
  }
8283
8610
  ),
8284
- /* @__PURE__ */ jsx55(
8611
+ /* @__PURE__ */ jsx56(
8285
8612
  EmailRecipientTags,
8286
8613
  {
8287
8614
  id: `${settingsGroup}-crmEmails`,
@@ -8292,34 +8619,34 @@ function PluginSettingsPanel({
8292
8619
  placeholder: "e.g. crm@example.com"
8293
8620
  }
8294
8621
  ),
8295
- /* @__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." }),
8296
8623
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8297
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-logoUrl`, className: "text-sm", children: "Logo URL (optional override)" }),
8298
- /* @__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" })
8299
8626
  ] }),
8300
8627
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8301
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-companyName`, className: "text-sm", children: "Company name (optional override)" }),
8302
- /* @__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" })
8303
8630
  ] }),
8304
8631
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8305
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-supportEmail`, className: "text-sm", children: "Support email (footer)" }),
8306
- /* @__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" })
8307
8634
  ] }),
8308
8635
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8309
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-supportPhone`, className: "text-sm", children: "Support phone (footer)" }),
8310
- /* @__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" })
8311
8638
  ] }),
8312
8639
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8313
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-followUsTitle`, className: "text-sm", children: "\u201CFollow us\u201D heading" }),
8314
- /* @__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" })
8315
8642
  ] }),
8316
8643
  /* @__PURE__ */ jsxs46("div", { className: "space-y-2", children: [
8317
- /* @__PURE__ */ jsx55(Label3, { className: "text-sm", children: "Social links" }),
8318
- /* @__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." }),
8319
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: [
8320
8647
  /* @__PURE__ */ jsxs46("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
8321
- /* @__PURE__ */ jsx55(Label3, { className: "text-xs text-muted-foreground", children: "Icon image URL" }),
8322
- /* @__PURE__ */ jsx55(
8648
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs text-muted-foreground", children: "Icon image URL" }),
8649
+ /* @__PURE__ */ jsx56(
8323
8650
  Input,
8324
8651
  {
8325
8652
  value: row.iconUrl,
@@ -8334,8 +8661,8 @@ function PluginSettingsPanel({
8334
8661
  )
8335
8662
  ] }),
8336
8663
  /* @__PURE__ */ jsxs46("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
8337
- /* @__PURE__ */ jsx55(Label3, { className: "text-xs text-muted-foreground", children: "Link URL" }),
8338
- /* @__PURE__ */ jsx55(
8664
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs text-muted-foreground", children: "Link URL" }),
8665
+ /* @__PURE__ */ jsx56(
8339
8666
  Input,
8340
8667
  {
8341
8668
  value: row.url,
@@ -8350,8 +8677,8 @@ function PluginSettingsPanel({
8350
8677
  )
8351
8678
  ] }),
8352
8679
  /* @__PURE__ */ jsxs46("div", { className: "w-[120px] space-y-1", children: [
8353
- /* @__PURE__ */ jsx55(Label3, { className: "text-xs text-muted-foreground", children: "Emoji / text" }),
8354
- /* @__PURE__ */ jsx55(
8680
+ /* @__PURE__ */ jsx56(Label3, { className: "text-xs text-muted-foreground", children: "Emoji / text" }),
8681
+ /* @__PURE__ */ jsx56(
8355
8682
  Input,
8356
8683
  {
8357
8684
  value: row.iconFallback,
@@ -8365,7 +8692,7 @@ function PluginSettingsPanel({
8365
8692
  }
8366
8693
  )
8367
8694
  ] }),
8368
- /* @__PURE__ */ jsx55(
8695
+ /* @__PURE__ */ jsx56(
8369
8696
  Button,
8370
8697
  {
8371
8698
  type: "button",
@@ -8378,7 +8705,7 @@ function PluginSettingsPanel({
8378
8705
  if (socialLinkRows.length <= 1) setSocialLinkRows([{ ...EMPTY_SOCIAL_ROW }]);
8379
8706
  else setSocialLinkRows(socialLinkRows.filter((_, j) => j !== i));
8380
8707
  },
8381
- children: /* @__PURE__ */ jsx55(X18, { className: "h-4 w-4" })
8708
+ children: /* @__PURE__ */ jsx56(X18, { className: "h-4 w-4" })
8382
8709
  }
8383
8710
  )
8384
8711
  ] }, i)),
@@ -8391,15 +8718,15 @@ function PluginSettingsPanel({
8391
8718
  className: "mt-1",
8392
8719
  onClick: () => setSocialLinkRows([...socialLinkRows, { ...EMPTY_SOCIAL_ROW }]),
8393
8720
  children: [
8394
- /* @__PURE__ */ jsx55(Plus8, { className: "mr-1 h-4 w-4" }),
8721
+ /* @__PURE__ */ jsx56(Plus8, { className: "mr-1 h-4 w-4" }),
8395
8722
  "Add link"
8396
8723
  ]
8397
8724
  }
8398
8725
  )
8399
8726
  ] }),
8400
8727
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8401
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-footerDisclaimer`, className: "text-sm", children: "Footer disclaimer" }),
8402
- /* @__PURE__ */ jsx55(
8728
+ /* @__PURE__ */ jsx56(Label3, { htmlFor: `${settingsGroup}-footerDisclaimer`, className: "text-sm", children: "Footer disclaimer" }),
8729
+ /* @__PURE__ */ jsx56(
8403
8730
  Textarea,
8404
8731
  {
8405
8732
  id: `${settingsGroup}-footerDisclaimer`,
@@ -8410,106 +8737,318 @@ function PluginSettingsPanel({
8410
8737
  }
8411
8738
  )
8412
8739
  ] }),
8413
- /* @__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" })
8414
8741
  ] });
8415
8742
  }
8416
- return /* @__PURE__ */ jsxs46("div", { className: "space-y-4", children: [
8417
- /* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
8418
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
8419
- /* @__PURE__ */ jsx55(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
8420
- ] }),
8421
- /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8422
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
8423
- /* @__PURE__ */ jsx55(
8424
- Input,
8425
- {
8426
- id: `${settingsGroup}-botName`,
8427
- value: botName,
8428
- onChange: (e) => setBotName(e.target.value),
8429
- placeholder: "e.g. Support Bot",
8430
- className: "h-8 text-sm"
8431
- }
8432
- )
8433
- ] }),
8434
- 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
+ ] }),
8768
+ /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
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
+ ] }),
8435
8895
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8436
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
8437
- /* @__PURE__ */ jsx55(
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(
8438
8909
  Input,
8439
8910
  {
8440
- id: `${settingsGroup}-iconImageUrl`,
8441
- value: iconImageUrl,
8442
- onChange: (e) => setIconImageUrl(e.target.value),
8443
- 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",
8444
8915
  className: "h-8 text-sm"
8445
8916
  }
8446
8917
  ),
8447
- /* @__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." })
8448
8919
  ] }),
8449
- /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8450
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon fallback (emoji)" }),
8451
- /* @__PURE__ */ jsx55(
8452
- 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,
8453
8924
  {
8454
- id: `${settingsGroup}-icon`,
8455
- value: icon,
8456
- onChange: (e) => setIcon(e.target.value),
8457
- placeholder: "e.g. \u{1F4AC}",
8458
- 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"
8459
8931
  }
8460
- )
8932
+ ),
8933
+ /* @__PURE__ */ jsx56("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Only paste code from sources you trust." })
8461
8934
  ] }),
8462
- /* @__PURE__ */ jsxs46("div", { className: "flex gap-4", children: [
8935
+ chatMode === "llm" && /* @__PURE__ */ jsxs46(Fragment12, { children: [
8463
8936
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8464
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-iconBg`, className: "text-sm", children: "Icon background" }),
8465
- /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
8466
- /* @__PURE__ */ jsx55(
8467
- "input",
8468
- {
8469
- type: "color",
8470
- id: `${settingsGroup}-iconBg`,
8471
- value: iconBackgroundColor,
8472
- onChange: (e) => setIconBackgroundColor(e.target.value),
8473
- className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
8474
- }
8475
- ),
8476
- /* @__PURE__ */ jsx55(
8477
- Input,
8478
- {
8479
- value: iconBackgroundColor,
8480
- onChange: (e) => setIconBackgroundColor(e.target.value),
8481
- className: "h-8 w-24 text-sm font-mono"
8482
- }
8483
- )
8484
- ] })
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
+ )
8485
8948
  ] }),
8486
8949
  /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8487
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-headerColor`, className: "text-sm", children: "Header color" }),
8488
- /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2", children: [
8489
- /* @__PURE__ */ jsx55(
8490
- "input",
8491
- {
8492
- type: "color",
8493
- id: `${settingsGroup}-headerColor`,
8494
- value: headerColor,
8495
- onChange: (e) => setHeaderColor(e.target.value),
8496
- className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
8497
- }
8498
- ),
8499
- /* @__PURE__ */ jsx55(
8500
- Input,
8501
- {
8502
- value: headerColor,
8503
- onChange: (e) => setHeaderColor(e.target.value),
8504
- className: "h-8 w-24 text-sm font-mono"
8505
- }
8506
- )
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
+ ] })
8507
9022
  ] })
8508
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"
8509
9028
  ] })
8510
- ] }) : /* @__PURE__ */ jsxs46("div", { className: "space-y-1", children: [
8511
- /* @__PURE__ */ jsx55(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon (emoji or name)" }),
8512
- /* @__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(
8513
9052
  Input,
8514
9053
  {
8515
9054
  id: `${settingsGroup}-icon`,
@@ -8521,7 +9060,7 @@ function PluginSettingsPanel({
8521
9060
  )
8522
9061
  ] }),
8523
9062
  /* @__PURE__ */ jsxs46(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
8524
- /* @__PURE__ */ jsx55(Save5, { className: "h-3.5 w-3.5" }),
9063
+ /* @__PURE__ */ jsx56(Save5, { className: "h-3.5 w-3.5" }),
8525
9064
  "Save"
8526
9065
  ] })
8527
9066
  ] });
@@ -8539,16 +9078,16 @@ function PluginListItem({
8539
9078
  onClick: onSelect,
8540
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"}`,
8541
9080
  children: [
8542
- /* @__PURE__ */ jsx55(PluginIcon, { descriptor, size: "sm" }),
9081
+ /* @__PURE__ */ jsx56(PluginIcon, { descriptor, size: "sm" }),
8543
9082
  /* @__PURE__ */ jsxs46("div", { className: "min-w-0 flex-1", children: [
8544
- /* @__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 }),
8545
9084
  /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-2 mt-0.5", children: [
8546
9085
  /* @__PURE__ */ jsxs46(
8547
9086
  "span",
8548
9087
  {
8549
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"}`,
8550
9089
  children: [
8551
- 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" }),
8552
9091
  enabled ? "On" : "Off"
8553
9092
  ]
8554
9093
  }
@@ -8587,14 +9126,14 @@ function PluginsPage() {
8587
9126
  };
8588
9127
  return /* @__PURE__ */ jsxs46("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
8589
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: [
8590
- /* @__PURE__ */ jsx55("h1", { className: "text-base font-semibold text-white", children: "Plugins" }),
8591
- /* @__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" })
8592
9131
  ] }),
8593
- /* @__PURE__ */ jsx55("div", { className: "min-w-0 p-6", children: pluginDescriptors.length === 0 ? /* @__PURE__ */ jsxs46("div", { className: "py-12 text-center", children: [
8594
- /* @__PURE__ */ jsx55(Puzzle2, { className: "mx-auto h-10 w-10 text-gray-400" }),
8595
- /* @__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." })
8596
9135
  ] }) : /* @__PURE__ */ jsxs46("div", { className: "flex gap-6", children: [
8597
- /* @__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(
8598
9137
  PluginListItem,
8599
9138
  {
8600
9139
  descriptor: p,
@@ -8604,15 +9143,15 @@ function PluginsPage() {
8604
9143
  },
8605
9144
  p.name
8606
9145
  )) }),
8607
- /* @__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: [
8608
- /* @__PURE__ */ jsx55(Puzzle2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
8609
- /* @__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." })
8610
- ] }) : /* @__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: [
8611
9150
  /* @__PURE__ */ jsxs46("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-4", children: [
8612
9151
  selectedDescriptor.label || selectedDescriptor.name,
8613
9152
  " \u2014 Configuration"
8614
9153
  ] }),
8615
- /* @__PURE__ */ jsx55(
9154
+ /* @__PURE__ */ jsx56(
8616
9155
  PluginSettingsPanel,
8617
9156
  {
8618
9157
  descriptor: selectedDescriptor,
@@ -8620,8 +9159,8 @@ function PluginsPage() {
8620
9159
  }
8621
9160
  )
8622
9161
  ] }) : /* @__PURE__ */ jsxs46("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
8623
- /* @__PURE__ */ jsx55(Puzzle2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
8624
- /* @__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." })
8625
9164
  ] }) }) })
8626
9165
  ] }) })
8627
9166
  ] });
@@ -8633,7 +9172,7 @@ import { useRouter as useRouter10 } from "next/navigation";
8633
9172
  import { AlertCircle as AlertCircle4 } from "lucide-react";
8634
9173
 
8635
9174
  // src/components/Admin/SeoSection.tsx
8636
- import { jsx as jsx56, jsxs as jsxs47 } from "react/jsx-runtime";
9175
+ import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
8637
9176
  function SeoSection({
8638
9177
  values,
8639
9178
  onChange
@@ -8641,37 +9180,37 @@ function SeoSection({
8641
9180
  const inputCls3 = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm h-8";
8642
9181
  const textareaCls = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm min-h-[60px]";
8643
9182
  return /* @__PURE__ */ jsxs47("div", { className: "border-t border-gray-200 pt-2", children: [
8644
- /* @__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" }),
8645
9184
  /* @__PURE__ */ jsxs47("div", { className: "space-y-3", children: [
8646
9185
  /* @__PURE__ */ jsxs47("div", { children: [
8647
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Title" }),
8648
- /* @__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 })
8649
9188
  ] }),
8650
9189
  /* @__PURE__ */ jsxs47("div", { children: [
8651
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Description" }),
8652
- /* @__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 })
8653
9192
  ] }),
8654
9193
  /* @__PURE__ */ jsxs47("div", { children: [
8655
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Keywords" }),
8656
- /* @__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 })
8657
9196
  ] }),
8658
9197
  /* @__PURE__ */ jsxs47("div", { children: [
8659
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Title" }),
8660
- /* @__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 })
8661
9200
  ] }),
8662
9201
  /* @__PURE__ */ jsxs47("div", { children: [
8663
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Description" }),
8664
- /* @__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 })
8665
9204
  ] }),
8666
9205
  /* @__PURE__ */ jsxs47("div", { children: [
8667
- /* @__PURE__ */ jsx56("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Image" }),
8668
- /* @__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 })
8669
9208
  ] })
8670
9209
  ] })
8671
9210
  ] });
8672
9211
  }
8673
9212
  async function saveSeo(seo, slug, existingSeoId) {
8674
- const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords;
9213
+ const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords || seo.seoOgTitle || seo.seoOgDescription || seo.seoOgImage;
8675
9214
  if (!hasSeo) return existingSeoId;
8676
9215
  const payload = {
8677
9216
  title: seo.seoTitle || null,
@@ -8721,7 +9260,7 @@ async function fetchSeo(seoId) {
8721
9260
  }
8722
9261
 
8723
9262
  // src/admin/pages/BrandEditPage.tsx
8724
- 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";
8725
9264
  var isCreate = (id) => id === "create";
8726
9265
  function BrandEditPage({ brandId }) {
8727
9266
  const router = useRouter10();
@@ -8807,10 +9346,10 @@ function BrandEditPage({ brandId }) {
8807
9346
  }
8808
9347
  };
8809
9348
  if (loading) {
8810
- 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..." }) });
8811
9350
  }
8812
9351
  return /* @__PURE__ */ jsxs48("div", { className: "rounded-lg bg-white shadow-md", children: [
8813
- /* @__PURE__ */ jsx57(
9352
+ /* @__PURE__ */ jsx58(
8814
9353
  DetailPageHeader,
8815
9354
  {
8816
9355
  title: create ? "Add Brand" : "Edit Brand",
@@ -8822,23 +9361,23 @@ function BrandEditPage({ brandId }) {
8822
9361
  ]
8823
9362
  }
8824
9363
  ),
8825
- 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: [
8826
- /* @__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" }),
8827
9366
  /* @__PURE__ */ jsxs48("div", { className: "ml-3", children: [
8828
- /* @__PURE__ */ jsx57("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
8829
- /* @__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)) })
8830
9369
  ] })
8831
9370
  ] }) }),
8832
- /* @__PURE__ */ jsx57(
9371
+ /* @__PURE__ */ jsx58(
8833
9372
  DetailPageLayout,
8834
9373
  {
8835
9374
  main: /* @__PURE__ */ jsxs48(Fragment13, { children: [
8836
9375
  /* @__PURE__ */ jsxs48("section", { children: [
8837
- /* @__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" }),
8838
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: [
8839
9378
  /* @__PURE__ */ jsxs48("div", { children: [
8840
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Name *" }),
8841
- /* @__PURE__ */ jsx57(
9379
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Name *" }),
9380
+ /* @__PURE__ */ jsx58(
8842
9381
  "input",
8843
9382
  {
8844
9383
  type: "text",
@@ -8850,8 +9389,8 @@ function BrandEditPage({ brandId }) {
8850
9389
  )
8851
9390
  ] }),
8852
9391
  /* @__PURE__ */ jsxs48("div", { children: [
8853
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Slug *" }),
8854
- /* @__PURE__ */ jsx57(
9392
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Slug *" }),
9393
+ /* @__PURE__ */ jsx58(
8855
9394
  "input",
8856
9395
  {
8857
9396
  type: "text",
@@ -8863,8 +9402,8 @@ function BrandEditPage({ brandId }) {
8863
9402
  )
8864
9403
  ] }),
8865
9404
  /* @__PURE__ */ jsxs48("div", { children: [
8866
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Description" }),
8867
- /* @__PURE__ */ jsx57(
9405
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Description" }),
9406
+ /* @__PURE__ */ jsx58(
8868
9407
  "textarea",
8869
9408
  {
8870
9409
  value: description,
@@ -8875,8 +9414,8 @@ function BrandEditPage({ brandId }) {
8875
9414
  )
8876
9415
  ] }),
8877
9416
  /* @__PURE__ */ jsxs48("div", { children: [
8878
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Logo URL" }),
8879
- /* @__PURE__ */ jsx57(
9417
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Logo URL" }),
9418
+ /* @__PURE__ */ jsx58(
8880
9419
  "input",
8881
9420
  {
8882
9421
  type: "url",
@@ -8887,8 +9426,8 @@ function BrandEditPage({ brandId }) {
8887
9426
  )
8888
9427
  ] }),
8889
9428
  /* @__PURE__ */ jsxs48("div", { children: [
8890
- /* @__PURE__ */ jsx57("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Sort order" }),
8891
- /* @__PURE__ */ jsx57(
9429
+ /* @__PURE__ */ jsx58("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Sort order" }),
9430
+ /* @__PURE__ */ jsx58(
8892
9431
  "input",
8893
9432
  {
8894
9433
  type: "number",
@@ -8901,14 +9440,14 @@ function BrandEditPage({ brandId }) {
8901
9440
  ] })
8902
9441
  ] }),
8903
9442
  /* @__PURE__ */ jsxs48("section", { children: [
8904
- /* @__PURE__ */ jsx57("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
8905
- /* @__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 })) }) })
8906
9445
  ] })
8907
9446
  ] }),
8908
- sidebar: /* @__PURE__ */ jsx57(Fragment13, { children: /* @__PURE__ */ jsxs48("section", { children: [
8909
- /* @__PURE__ */ jsx57("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
8910
- /* @__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: [
8911
- /* @__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(
8912
9451
  "input",
8913
9452
  {
8914
9453
  type: "checkbox",
@@ -8917,7 +9456,7 @@ function BrandEditPage({ brandId }) {
8917
9456
  className: "h-4 w-4 rounded border-gray-300"
8918
9457
  }
8919
9458
  ),
8920
- /* @__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" })
8921
9460
  ] }) })
8922
9461
  ] }) })
8923
9462
  }
@@ -8932,7 +9471,7 @@ import { AlertCircle as AlertCircle5, Plus as Plus9, Trash2 as Trash25, Star } f
8932
9471
 
8933
9472
  // src/components/Admin/AttributeFacetNameInput.tsx
8934
9473
  import { useState as useState31, useEffect as useEffect29 } from "react";
8935
- import { jsx as jsx58, jsxs as jsxs49 } from "react/jsx-runtime";
9474
+ import { jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
8936
9475
  function slugFromName(name) {
8937
9476
  const s = name.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
8938
9477
  return s || "attribute";
@@ -9001,7 +9540,7 @@ function AttributeFacetNameInput({
9001
9540
  };
9002
9541
  const exactMatch = list.some((x) => x.name.toLowerCase() === draft.trim().toLowerCase());
9003
9542
  return /* @__PURE__ */ jsxs49("div", { className: "relative min-w-0 flex-1", children: [
9004
- /* @__PURE__ */ jsx58(
9543
+ /* @__PURE__ */ jsx59(
9005
9544
  "input",
9006
9545
  {
9007
9546
  type: "text",
@@ -9033,7 +9572,7 @@ function AttributeFacetNameInput({
9033
9572
  }
9034
9573
  ),
9035
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: [
9036
- list.map((a) => /* @__PURE__ */ jsx58(
9575
+ list.map((a) => /* @__PURE__ */ jsx59(
9037
9576
  "li",
9038
9577
  {
9039
9578
  onMouseDown: (e) => {
@@ -9065,7 +9604,7 @@ function AttributeFacetNameInput({
9065
9604
  }
9066
9605
 
9067
9606
  // src/admin/pages/ProductEditPage.tsx
9068
- 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";
9069
9608
  var isCreate2 = (id) => id === "create";
9070
9609
  var sectionCls = "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50";
9071
9610
  var labelCls = "block text-xs font-medium text-gray-600 mb-1";
@@ -9108,6 +9647,7 @@ function ProductEditPage({ productId }) {
9108
9647
  const [brands, setBrands] = useState32([]);
9109
9648
  const [categories, setCategories] = useState32([]);
9110
9649
  const [name, setName] = useState32("");
9650
+ const [productSlug, setProductSlug] = useState32("");
9111
9651
  const [sku, setSku] = useState32("");
9112
9652
  const [hsn, setHsn] = useState32("");
9113
9653
  const [collectionId, setCollectionId] = useState32(null);
@@ -9160,7 +9700,10 @@ function ProductEditPage({ productId }) {
9160
9700
  if (Array.isArray(d.data)) attrList = d.data;
9161
9701
  }
9162
9702
  if (create) {
9163
- if (!cancelled) setLoading(false);
9703
+ if (!cancelled) {
9704
+ setProductSlug("");
9705
+ setLoading(false);
9706
+ }
9164
9707
  return;
9165
9708
  }
9166
9709
  const res = await fetch(`/api/products/${productId}`);
@@ -9168,6 +9711,7 @@ function ProductEditPage({ productId }) {
9168
9711
  const product = await res.json();
9169
9712
  if (cancelled) return;
9170
9713
  setName(product.name ?? "");
9714
+ setProductSlug(typeof product.slug === "string" ? product.slug : "");
9171
9715
  setSku(product.sku ?? "");
9172
9716
  setHsn(product.hsn ?? "");
9173
9717
  setCollectionId(product.collectionId ?? null);
@@ -9223,6 +9767,12 @@ function ProductEditPage({ productId }) {
9223
9767
  cancelled = true;
9224
9768
  };
9225
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]);
9226
9776
  const handleSave = async () => {
9227
9777
  setErrors([]);
9228
9778
  if (!name.trim()) {
@@ -9235,7 +9785,8 @@ function ProductEditPage({ productId }) {
9235
9785
  }
9236
9786
  setSaving(true);
9237
9787
  try {
9238
- 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);
9239
9790
  const metadata = buildProductMetadata(otherMetadata, { description, images, specifications });
9240
9791
  const productPayload = {
9241
9792
  name: name.trim(),
@@ -9263,6 +9814,9 @@ function ProductEditPage({ productId }) {
9263
9814
  return;
9264
9815
  }
9265
9816
  const savedProduct = await res.json();
9817
+ if (typeof savedProduct.slug === "string") {
9818
+ setProductSlug(savedProduct.slug);
9819
+ }
9266
9820
  const savedId = create ? savedProduct.id : productId;
9267
9821
  const slugify = (n) => n.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "attribute";
9268
9822
  async function ensureAttributeId(attrName) {
@@ -9352,10 +9906,10 @@ function ProductEditPage({ productId }) {
9352
9906
  const removeFacet = (i) => setFacetRows((prev) => prev.length <= 1 ? prev : prev.filter((_, j) => j !== i));
9353
9907
  const setFacet = (i, field, value) => setFacetRows((prev) => prev.map((row, j) => j === i ? { ...row, [field]: value } : row));
9354
9908
  if (loading) {
9355
- 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..." }) });
9356
9910
  }
9357
9911
  return /* @__PURE__ */ jsxs50("div", { className: "rounded-lg bg-white shadow-md", children: [
9358
- /* @__PURE__ */ jsx59(
9912
+ /* @__PURE__ */ jsx60(
9359
9913
  DetailPageHeader,
9360
9914
  {
9361
9915
  title: create ? "Add Product" : "Edit Product",
@@ -9367,90 +9921,90 @@ function ProductEditPage({ productId }) {
9367
9921
  ]
9368
9922
  }
9369
9923
  ),
9370
- 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: [
9371
- /* @__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" }),
9372
9926
  /* @__PURE__ */ jsxs50("div", { className: "ml-3", children: [
9373
- /* @__PURE__ */ jsx59("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
9374
- /* @__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)) })
9375
9929
  ] })
9376
9930
  ] }) }),
9377
- /* @__PURE__ */ jsx59(
9931
+ /* @__PURE__ */ jsx60(
9378
9932
  DetailPageLayout,
9379
9933
  {
9380
9934
  main: /* @__PURE__ */ jsxs50(Fragment14, { children: [
9381
9935
  /* @__PURE__ */ jsxs50("section", { children: [
9382
- /* @__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" }),
9383
9937
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-4`, children: [
9384
9938
  /* @__PURE__ */ jsxs50("div", { children: [
9385
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Name *" }),
9386
- /* @__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 })
9387
9941
  ] }),
9388
9942
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9389
9943
  /* @__PURE__ */ jsxs50("div", { children: [
9390
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "SKU" }),
9391
- /* @__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 })
9392
9946
  ] }),
9393
9947
  /* @__PURE__ */ jsxs50("div", { children: [
9394
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "HSN" }),
9395
- /* @__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 })
9396
9950
  ] })
9397
9951
  ] }),
9398
9952
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9399
9953
  /* @__PURE__ */ jsxs50("div", { children: [
9400
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Brand" }),
9954
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Brand" }),
9401
9955
  /* @__PURE__ */ jsxs50("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
9402
- /* @__PURE__ */ jsx59("option", { value: "", children: "None" }),
9403
- 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))
9404
9958
  ] })
9405
9959
  ] }),
9406
9960
  /* @__PURE__ */ jsxs50("div", { children: [
9407
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Category" }),
9961
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Category" }),
9408
9962
  /* @__PURE__ */ jsxs50("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
9409
- /* @__PURE__ */ jsx59("option", { value: "", children: "None" }),
9410
- 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))
9411
9965
  ] })
9412
9966
  ] })
9413
9967
  ] }),
9414
9968
  /* @__PURE__ */ jsxs50("div", { children: [
9415
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Collection" }),
9969
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Collection" }),
9416
9970
  /* @__PURE__ */ jsxs50("select", { value: collectionId ?? "", onChange: (e) => setCollectionId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
9417
- /* @__PURE__ */ jsx59("option", { value: "", children: "None" }),
9418
- 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))
9419
9973
  ] })
9420
9974
  ] }),
9421
9975
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9422
9976
  /* @__PURE__ */ jsxs50("div", { children: [
9423
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Price *" }),
9424
- /* @__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 })
9425
9979
  ] }),
9426
9980
  /* @__PURE__ */ jsxs50("div", { children: [
9427
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Compare at price" }),
9428
- /* @__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 })
9429
9983
  ] })
9430
9984
  ] }),
9431
9985
  /* @__PURE__ */ jsxs50("div", { className: "grid grid-cols-2 gap-4", children: [
9432
9986
  /* @__PURE__ */ jsxs50("div", { children: [
9433
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Quantity" }),
9434
- /* @__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 })
9435
9989
  ] }),
9436
9990
  /* @__PURE__ */ jsxs50("div", { children: [
9437
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Status" }),
9991
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Status" }),
9438
9992
  /* @__PURE__ */ jsxs50("select", { value: status, onChange: (e) => setStatus(e.target.value), className: inputCls, children: [
9439
- /* @__PURE__ */ jsx59("option", { value: "draft", children: "Draft" }),
9440
- /* @__PURE__ */ jsx59("option", { value: "available", children: "Available" }),
9441
- /* @__PURE__ */ jsx59("option", { value: "reserved", children: "Reserved" }),
9442
- /* @__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" })
9443
9997
  ] })
9444
9998
  ] })
9445
9999
  ] })
9446
10000
  ] })
9447
10001
  ] }),
9448
10002
  /* @__PURE__ */ jsxs50("section", { children: [
9449
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Attributes (facets)" }),
9450
- /* @__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." }),
9451
10005
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-2`, children: [
9452
10006
  facetRows.map((row, i) => /* @__PURE__ */ jsxs50("div", { className: "flex gap-2 items-start", children: [
9453
- /* @__PURE__ */ jsx59(
10007
+ /* @__PURE__ */ jsx60(
9454
10008
  AttributeFacetNameInput,
9455
10009
  {
9456
10010
  value: row.name,
@@ -9458,7 +10012,7 @@ function ProductEditPage({ productId }) {
9458
10012
  inputClassName: inputCls
9459
10013
  }
9460
10014
  ),
9461
- /* @__PURE__ */ jsx59(
10015
+ /* @__PURE__ */ jsx60(
9462
10016
  "input",
9463
10017
  {
9464
10018
  type: "text",
@@ -9468,21 +10022,21 @@ function ProductEditPage({ productId }) {
9468
10022
  className: `${inputCls} flex-1 min-w-[120px]`
9469
10023
  }
9470
10024
  ),
9471
- /* @__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" }) })
9472
10026
  ] }, i)),
9473
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: [
9474
- /* @__PURE__ */ jsx59(Plus9, { className: "h-3.5 w-3.5" }),
10028
+ /* @__PURE__ */ jsx60(Plus9, { className: "h-3.5 w-3.5" }),
9475
10029
  " Add attribute"
9476
10030
  ] })
9477
10031
  ] })
9478
10032
  ] }),
9479
10033
  /* @__PURE__ */ jsxs50("section", { children: [
9480
- /* @__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" }),
9481
10035
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-3`, children: [
9482
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: [
9483
10037
  /* @__PURE__ */ jsxs50("div", { className: "flex-1 min-w-[200px]", children: [
9484
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Image URL" }),
9485
- /* @__PURE__ */ jsx59(
10038
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Image URL" }),
10039
+ /* @__PURE__ */ jsx60(
9486
10040
  "input",
9487
10041
  {
9488
10042
  type: "url",
@@ -9494,8 +10048,8 @@ function ProductEditPage({ productId }) {
9494
10048
  )
9495
10049
  ] }),
9496
10050
  /* @__PURE__ */ jsxs50("div", { className: "flex-1 min-w-[120px]", children: [
9497
- /* @__PURE__ */ jsx59("label", { className: labelCls, children: "Alt text" }),
9498
- /* @__PURE__ */ jsx59(
10051
+ /* @__PURE__ */ jsx60("label", { className: labelCls, children: "Alt text" }),
10052
+ /* @__PURE__ */ jsx60(
9499
10053
  "input",
9500
10054
  {
9501
10055
  type: "text",
@@ -9505,27 +10059,27 @@ function ProductEditPage({ productId }) {
9505
10059
  }
9506
10060
  )
9507
10061
  ] }),
9508
- /* @__PURE__ */ jsx59(
10062
+ /* @__PURE__ */ jsx60(
9509
10063
  "button",
9510
10064
  {
9511
10065
  type: "button",
9512
10066
  onClick: () => setDefaultImage(i),
9513
10067
  title: "Set as default",
9514
10068
  className: "mt-6 p-2 rounded border border-gray-300 hover:bg-gray-100",
9515
- 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"}` })
9516
10070
  }
9517
10071
  ),
9518
- /* @__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" }) })
9519
10073
  ] }, i)),
9520
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: [
9521
- /* @__PURE__ */ jsx59(Plus9, { className: "h-3.5 w-3.5" }),
10075
+ /* @__PURE__ */ jsx60(Plus9, { className: "h-3.5 w-3.5" }),
9522
10076
  " Add image"
9523
10077
  ] })
9524
10078
  ] })
9525
10079
  ] }),
9526
10080
  /* @__PURE__ */ jsxs50("section", { children: [
9527
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Description" }),
9528
- /* @__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(
9529
10083
  "textarea",
9530
10084
  {
9531
10085
  value: description,
@@ -9537,10 +10091,10 @@ function ProductEditPage({ productId }) {
9537
10091
  ) })
9538
10092
  ] }),
9539
10093
  /* @__PURE__ */ jsxs50("section", { children: [
9540
- /* @__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" }),
9541
10095
  /* @__PURE__ */ jsxs50("div", { className: `${sectionCls} space-y-2`, children: [
9542
10096
  specifications.map((row, i) => /* @__PURE__ */ jsxs50("div", { className: "flex gap-2", children: [
9543
- /* @__PURE__ */ jsx59(
10097
+ /* @__PURE__ */ jsx60(
9544
10098
  "input",
9545
10099
  {
9546
10100
  type: "text",
@@ -9550,7 +10104,7 @@ function ProductEditPage({ productId }) {
9550
10104
  className: `${inputCls} flex-1`
9551
10105
  }
9552
10106
  ),
9553
- /* @__PURE__ */ jsx59(
10107
+ /* @__PURE__ */ jsx60(
9554
10108
  "input",
9555
10109
  {
9556
10110
  type: "text",
@@ -9560,18 +10114,18 @@ function ProductEditPage({ productId }) {
9560
10114
  className: `${inputCls} flex-1`
9561
10115
  }
9562
10116
  ),
9563
- /* @__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" }) })
9564
10118
  ] }, i)),
9565
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: [
9566
- /* @__PURE__ */ jsx59(Plus9, { className: "h-3.5 w-3.5" }),
10120
+ /* @__PURE__ */ jsx60(Plus9, { className: "h-3.5 w-3.5" }),
9567
10121
  " Add row"
9568
10122
  ] })
9569
10123
  ] })
9570
10124
  ] })
9571
10125
  ] }),
9572
10126
  sidebar: /* @__PURE__ */ jsxs50("section", { children: [
9573
- /* @__PURE__ */ jsx59("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
9574
- /* @__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 })) }) })
9575
10129
  ] })
9576
10130
  }
9577
10131
  )
@@ -9582,7 +10136,7 @@ function ProductEditPage({ productId }) {
9582
10136
  import { useState as useState33, useEffect as useEffect31 } from "react";
9583
10137
  import { useRouter as useRouter12 } from "next/navigation";
9584
10138
  import { AlertCircle as AlertCircle6, Plus as Plus10, Trash2 as Trash26, ChevronDown as ChevronDown6, ChevronUp as ChevronUp2 } from "lucide-react";
9585
- 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";
9586
10140
  var isCreate3 = (id) => id === "create";
9587
10141
  var emptySlide = () => ({ url: "", type: "image", caption: "" });
9588
10142
  var emptyVariant = () => ({ name: "", price: "", extraSpecs: [] });
@@ -9783,10 +10337,10 @@ function CollectionEditPage({ collectionId }) {
9783
10337
  (v) => v.map((x, j) => j === variantIdx ? { ...x, extraSpecs: x.extraSpecs.filter((_, s) => s !== specIdx) } : x)
9784
10338
  );
9785
10339
  if (loading) {
9786
- 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..." }) });
9787
10341
  }
9788
10342
  return /* @__PURE__ */ jsxs51("div", { className: "rounded-lg bg-white shadow-md", children: [
9789
- /* @__PURE__ */ jsx60(
10343
+ /* @__PURE__ */ jsx61(
9790
10344
  DetailPageHeader,
9791
10345
  {
9792
10346
  title: create ? "Add Collection" : "Edit Collection",
@@ -9798,59 +10352,59 @@ function CollectionEditPage({ collectionId }) {
9798
10352
  ]
9799
10353
  }
9800
10354
  ),
9801
- 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: [
9802
- /* @__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" }),
9803
10357
  /* @__PURE__ */ jsxs51("div", { className: "ml-3", children: [
9804
- /* @__PURE__ */ jsx60("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
9805
- /* @__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)) })
9806
10360
  ] })
9807
10361
  ] }) }),
9808
- /* @__PURE__ */ jsx60(
10362
+ /* @__PURE__ */ jsx61(
9809
10363
  DetailPageLayout,
9810
10364
  {
9811
10365
  main: /* @__PURE__ */ jsxs51(Fragment15, { children: [
9812
10366
  /* @__PURE__ */ jsxs51("section", { children: [
9813
- /* @__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" }),
9814
10368
  /* @__PURE__ */ jsxs51("div", { className: `${sectionCls2} space-y-4`, children: [
9815
10369
  /* @__PURE__ */ jsxs51("div", { children: [
9816
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Name *" }),
9817
- /* @__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 })
9818
10372
  ] }),
9819
10373
  /* @__PURE__ */ jsxs51("div", { children: [
9820
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Slug *" }),
9821
- /* @__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 })
9822
10376
  ] }),
9823
10377
  /* @__PURE__ */ jsxs51("div", { children: [
9824
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "HSN" }),
9825
- /* @__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 })
9826
10380
  ] }),
9827
10381
  /* @__PURE__ */ jsxs51("div", { className: "grid grid-cols-2 gap-4", children: [
9828
10382
  /* @__PURE__ */ jsxs51("div", { children: [
9829
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Category" }),
10383
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Category" }),
9830
10384
  /* @__PURE__ */ jsxs51("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
9831
- /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9832
- 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))
9833
10387
  ] })
9834
10388
  ] }),
9835
10389
  /* @__PURE__ */ jsxs51("div", { children: [
9836
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Brand" }),
10390
+ /* @__PURE__ */ jsx61("label", { className: labelCls2, children: "Brand" }),
9837
10391
  /* @__PURE__ */ jsxs51("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
9838
- /* @__PURE__ */ jsx60("option", { value: "", children: "None" }),
9839
- 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))
9840
10394
  ] })
9841
10395
  ] })
9842
10396
  ] }),
9843
10397
  /* @__PURE__ */ jsxs51("div", { children: [
9844
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Description" }),
9845
- /* @__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 })
9846
10400
  ] }),
9847
10401
  /* @__PURE__ */ jsxs51("div", { children: [
9848
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Cover image URL" }),
9849
- /* @__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://..." })
9850
10404
  ] }),
9851
10405
  /* @__PURE__ */ jsxs51("div", { children: [
9852
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Sort order" }),
9853
- /* @__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" } })
9854
10408
  ] })
9855
10409
  ] })
9856
10410
  ] }),
@@ -9862,73 +10416,73 @@ function CollectionEditPage({ collectionId }) {
9862
10416
  onClick: () => setAdvancedOpen((o) => !o),
9863
10417
  className: "flex items-center gap-2 w-full text-left text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2",
9864
10418
  children: [
9865
- 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" }),
9866
10420
  "Advanced page content"
9867
10421
  ]
9868
10422
  }
9869
10423
  ),
9870
10424
  advancedOpen && /* @__PURE__ */ jsxs51("div", { className: "space-y-4", children: [
9871
10425
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9872
- /* @__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" }),
9873
10427
  heroSlides.map((slide, i) => /* @__PURE__ */ jsxs51("div", { className: "flex flex-wrap gap-2 mb-3 p-2 bg-white rounded border", children: [
9874
- /* @__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]` }),
9875
10429
  /* @__PURE__ */ jsxs51("select", { value: slide.type, onChange: (e) => updateHeroSlide(i, "type", e.target.value), className: `${inputCls2} w-24`, children: [
9876
- /* @__PURE__ */ jsx60("option", { value: "image", children: "Image" }),
9877
- /* @__PURE__ */ jsx60("option", { value: "video", children: "Video" })
10430
+ /* @__PURE__ */ jsx61("option", { value: "image", children: "Image" }),
10431
+ /* @__PURE__ */ jsx61("option", { value: "video", children: "Video" })
9878
10432
  ] }),
9879
- /* @__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]` }),
9880
- /* @__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" }) })
9881
10435
  ] }, i)),
9882
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: [
9883
- /* @__PURE__ */ jsx60(Plus10, { className: "h-3.5 w-3.5" }),
10437
+ /* @__PURE__ */ jsx61(Plus10, { className: "h-3.5 w-3.5" }),
9884
10438
  " Add slide"
9885
10439
  ] })
9886
10440
  ] }),
9887
10441
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9888
- /* @__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" }),
9889
10443
  variants.map((v, i) => /* @__PURE__ */ jsxs51("div", { className: "mb-4 p-3 bg-white rounded border space-y-2", children: [
9890
10444
  /* @__PURE__ */ jsxs51("div", { className: "flex gap-2", children: [
9891
- /* @__PURE__ */ jsx60("input", { type: "text", value: v.name, onChange: (e) => updateVariant(i, "name", e.target.value), placeholder: "Name", className: `${inputCls2} w-40` }),
9892
- /* @__PURE__ */ jsx60("input", { type: "number", value: v.price, onChange: (e) => updateVariant(i, "price", e.target.value), placeholder: "Price", className: `${inputCls2} w-28` }),
9893
- /* @__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" }) })
9894
10448
  ] }),
9895
10449
  v.extraSpecs.map((s, si) => /* @__PURE__ */ jsxs51("div", { className: "flex gap-2", children: [
9896
- /* @__PURE__ */ jsx60("input", { type: "text", value: s.key, onChange: (e) => updateVariantExtraSpec(i, si, "key", e.target.value), placeholder: "Key", className: `${inputCls2} flex-1` }),
9897
- /* @__PURE__ */ jsx60("input", { type: "text", value: s.value, onChange: (e) => updateVariantExtraSpec(i, si, "value", e.target.value), placeholder: "Value", className: `${inputCls2} flex-1` }),
9898
- /* @__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" }) })
9899
10453
  ] }, si)),
9900
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: [
9901
- /* @__PURE__ */ jsx60(Plus10, { className: "h-3 w-3" }),
10455
+ /* @__PURE__ */ jsx61(Plus10, { className: "h-3 w-3" }),
9902
10456
  " Add spec"
9903
10457
  ] })
9904
10458
  ] }, i)),
9905
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: [
9906
- /* @__PURE__ */ jsx60(Plus10, { className: "h-3.5 w-3.5" }),
10460
+ /* @__PURE__ */ jsx61(Plus10, { className: "h-3.5 w-3.5" }),
9907
10461
  " Add variant"
9908
10462
  ] })
9909
10463
  ] }),
9910
10464
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9911
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Experience description" }),
9912
- /* @__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" })
9913
10467
  ] }),
9914
10468
  /* @__PURE__ */ jsxs51("div", { className: sectionCls2, children: [
9915
- /* @__PURE__ */ jsx60("label", { className: labelCls2, children: "Brochure URL" }),
9916
- /* @__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://..." })
9917
10471
  ] })
9918
10472
  ] })
9919
10473
  ] })
9920
10474
  ] }),
9921
10475
  sidebar: /* @__PURE__ */ jsxs51(Fragment15, { children: [
9922
10476
  /* @__PURE__ */ jsxs51("section", { children: [
9923
- /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
9924
- /* @__PURE__ */ jsx60("div", { className: sectionCls2, children: /* @__PURE__ */ jsxs51("label", { className: "flex items-center gap-2 cursor-pointer", children: [
9925
- /* @__PURE__ */ jsx60("input", { type: "checkbox", checked: active, onChange: (e) => setActive(e.target.checked), className: "h-4 w-4 rounded border-gray-300" }),
9926
- /* @__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" })
9927
10481
  ] }) })
9928
10482
  ] }),
9929
10483
  /* @__PURE__ */ jsxs51("section", { children: [
9930
- /* @__PURE__ */ jsx60("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
9931
- /* @__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 })) }) })
9932
10486
  ] })
9933
10487
  ] })
9934
10488
  }
@@ -9948,7 +10502,7 @@ function isSuperAdminGroupName(name) {
9948
10502
  }
9949
10503
 
9950
10504
  // src/admin/pages/RolesPage.tsx
9951
- import { jsx as jsx61, jsxs as jsxs52 } from "react/jsx-runtime";
10505
+ import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
9952
10506
  function RoleListItem({
9953
10507
  group,
9954
10508
  selected,
@@ -9962,8 +10516,8 @@ function RoleListItem({
9962
10516
  onClick: onSelect,
9963
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"}`,
9964
10518
  children: [
9965
- /* @__PURE__ */ jsx61(Shield2, { className: "h-5 w-5 shrink-0 text-gray-500" }),
9966
- /* @__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 }) })
9967
10521
  ]
9968
10522
  }
9969
10523
  );
@@ -10097,27 +10651,27 @@ function RolesPage() {
10097
10651
  }
10098
10652
  };
10099
10653
  if (status === "loading" || loading) {
10100
- 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" });
10101
10655
  }
10102
10656
  if (!canManage) {
10103
- 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." });
10104
10658
  }
10105
10659
  return /* @__PURE__ */ jsxs52("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
10106
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: [
10107
- /* @__PURE__ */ jsx61("h1", { className: "text-base font-semibold text-white", children: "Roles" }),
10108
- /* @__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)." })
10109
10663
  ] }),
10110
10664
  /* @__PURE__ */ jsxs52("div", { className: "min-w-0 p-6", children: [
10111
- 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: [
10112
- /* @__PURE__ */ jsx61(Shield2, { className: "mx-auto h-10 w-10 text-gray-400" }),
10113
- /* @__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." })
10114
10668
  ] }) : /* @__PURE__ */ jsxs52("div", { className: "flex gap-6", children: [
10115
10669
  /* @__PURE__ */ jsxs52("div", { className: "w-56 shrink-0 space-y-1", children: [
10116
- 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)),
10117
10671
  /* @__PURE__ */ jsxs52("div", { className: "space-y-2 border-t border-gray-200 pt-3 dark:border-gray-700", children: [
10118
- /* @__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" }),
10119
10673
  /* @__PURE__ */ jsxs52("div", { className: "flex gap-2", children: [
10120
- /* @__PURE__ */ jsx61(
10674
+ /* @__PURE__ */ jsx62(
10121
10675
  Input,
10122
10676
  {
10123
10677
  className: "h-8 text-sm",
@@ -10127,13 +10681,13 @@ function RolesPage() {
10127
10681
  onKeyDown: (e) => e.key === "Enter" && createGroup()
10128
10682
  }
10129
10683
  ),
10130
- /* @__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" })
10131
10685
  ] })
10132
10686
  ] })
10133
10687
  ] }),
10134
- /* @__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: [
10135
- /* @__PURE__ */ jsx61(Shield2, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
10136
- /* @__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." })
10137
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: [
10138
10692
  /* @__PURE__ */ jsxs52("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [
10139
10693
  /* @__PURE__ */ jsxs52("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
@@ -10141,28 +10695,28 @@ function RolesPage() {
10141
10695
  " \u2014 Permissions"
10142
10696
  ] }),
10143
10697
  /* @__PURE__ */ jsxs52(Button, { size: "sm", onClick: saveMatrix, disabled: saving, className: "gap-1", children: [
10144
- /* @__PURE__ */ jsx61(Save6, { className: "h-3.5 w-3.5" }),
10698
+ /* @__PURE__ */ jsx62(Save6, { className: "h-3.5 w-3.5" }),
10145
10699
  saving ? "Saving\u2026" : "Save"
10146
10700
  ] }),
10147
10701
  selected && !isSuperAdminGroupName(selected.name) && /* @__PURE__ */ jsxs52(Button, { size: "sm", variant: "outline", className: "gap-1 text-red-600", onClick: deleteGroup, children: [
10148
- /* @__PURE__ */ jsx61(Trash27, { className: "h-3.5 w-3.5" }),
10702
+ /* @__PURE__ */ jsx62(Trash27, { className: "h-3.5 w-3.5" }),
10149
10703
  "Delete role"
10150
10704
  ] })
10151
10705
  ] }),
10152
- 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: [
10153
- /* @__PURE__ */ jsx61("thead", { children: /* @__PURE__ */ jsxs52("tr", { className: "border-b bg-gray-50 dark:bg-gray-900/50", children: [
10154
- /* @__PURE__ */ jsx61("th", { className: "p-3 text-left font-medium", children: "Resource" }),
10155
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "C" }),
10156
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "R" }),
10157
- /* @__PURE__ */ jsx61("th", { className: "p-2", children: "U" }),
10158
- /* @__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" })
10159
10713
  ] }) }),
10160
- /* @__PURE__ */ jsx61("tbody", { children: entities.map((entity) => {
10714
+ /* @__PURE__ */ jsx62("tbody", { children: entities.map((entity) => {
10161
10715
  const row = matrix[entity];
10162
10716
  if (!row) return null;
10163
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: [
10164
- /* @__PURE__ */ jsx61("td", { className: "p-3 font-mono text-xs", children: entity }),
10165
- ["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(
10166
10720
  "input",
10167
10721
  {
10168
10722
  type: "checkbox",
@@ -10176,8 +10730,8 @@ function RolesPage() {
10176
10730
  ] }) })
10177
10731
  ] }),
10178
10732
  !error && groups.length === 0 && /* @__PURE__ */ jsxs52("div", { className: "mt-6 flex max-w-md gap-2", children: [
10179
- /* @__PURE__ */ jsx61(Input, { placeholder: "New role name", value: newName, onChange: (e) => setNewName(e.target.value), onKeyDown: (e) => e.key === "Enter" && createGroup() }),
10180
- /* @__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" })
10181
10735
  ] })
10182
10736
  ] })
10183
10737
  ] });
@@ -10339,7 +10893,7 @@ var STORE_CRUD_CONFIGS = {
10339
10893
  };
10340
10894
 
10341
10895
  // src/admin/pages/AdminPageResolver.tsx
10342
- import { jsx as jsx62, jsxs as jsxs53 } from "react/jsx-runtime";
10896
+ import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
10343
10897
  var PAGE_MAP = {
10344
10898
  dashboard: DashboardPage,
10345
10899
  signin: SignInPage_default,
@@ -10465,11 +11019,11 @@ function BlogEditorWrapper({ blogId }) {
10465
11019
  }, [blogId]);
10466
11020
  if (loading) {
10467
11021
  return /* @__PURE__ */ jsxs53("div", { className: "flex items-center justify-center py-8", children: [
10468
- /* @__PURE__ */ jsx62("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
10469
- /* @__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..." })
10470
11024
  ] });
10471
11025
  }
10472
- return /* @__PURE__ */ jsx62(BlogEditor, { existingBlog: blog });
11026
+ return /* @__PURE__ */ jsx63(BlogEditor, { existingBlog: blog });
10473
11027
  }
10474
11028
  function AdminPageResolver({ slug }) {
10475
11029
  const router = useRouter13();
@@ -10482,52 +11036,52 @@ function AdminPageResolver({ slug }) {
10482
11036
  }, [key, router]);
10483
11037
  if (key === "layout-settings") {
10484
11038
  return /* @__PURE__ */ jsxs53("div", { className: "flex justify-center py-8", children: [
10485
- /* @__PURE__ */ jsx62("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
10486
- /* @__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..." })
10487
11041
  ] });
10488
11042
  }
10489
11043
  const Page = PAGE_MAP[key];
10490
11044
  if (Page) {
10491
- return /* @__PURE__ */ jsx62(Page, {});
11045
+ return /* @__PURE__ */ jsx63(Page, {});
10492
11046
  }
10493
11047
  if (key === "form-submissions" && slug && slug.length === 3 && slug[2] === "view") {
10494
- return /* @__PURE__ */ jsx62(SubmissionDetailPage, { submissionId: slug[1] });
11048
+ return /* @__PURE__ */ jsx63(SubmissionDetailPage, { submissionId: slug[1] });
10495
11049
  }
10496
11050
  if (key === "orders" && slug && slug.length === 3 && slug[2] === "view") {
10497
- return /* @__PURE__ */ jsx62(OrderDetailPage, { orderId: slug[1] });
11051
+ return /* @__PURE__ */ jsx63(OrderDetailPage, { orderId: slug[1] });
10498
11052
  }
10499
11053
  if (key === "payments" && slug && slug.length === 3 && slug[2] === "view") {
10500
- return /* @__PURE__ */ jsx62(PaymentDetailPage, { paymentId: slug[1] });
11054
+ return /* @__PURE__ */ jsx63(PaymentDetailPage, { paymentId: slug[1] });
10501
11055
  }
10502
11056
  if (key === "contacts" && slug && slug.length === 3 && slug[2] === "view") {
10503
- return /* @__PURE__ */ jsx62(ContactDetailPage, { contactId: slug[1] });
11057
+ return /* @__PURE__ */ jsx63(ContactDetailPage, { contactId: slug[1] });
10504
11058
  }
10505
11059
  const crud = { ...CRUD_CONFIGS, ...STORE_CRUD_CONFIGS, ...customCrudConfigs }[key];
10506
11060
  if (crud && slug && slug.length >= 2) {
10507
11061
  const subPath = slug[1];
10508
11062
  const isCreate4 = subPath === "create";
10509
11063
  if (key === "blogs") {
10510
- return /* @__PURE__ */ jsx62(BlogEditorWrapper, { blogId: isCreate4 ? void 0 : subPath });
11064
+ return /* @__PURE__ */ jsx63(BlogEditorWrapper, { blogId: isCreate4 ? void 0 : subPath });
10511
11065
  }
10512
11066
  if (key === "forms") {
10513
- return /* @__PURE__ */ jsx62(FormBuilder, { formId: isCreate4 ? void 0 : subPath });
11067
+ return /* @__PURE__ */ jsx63(FormBuilder, { formId: isCreate4 ? void 0 : subPath });
10514
11068
  }
10515
11069
  if (key === "pages") {
10516
- return /* @__PURE__ */ jsx62(PageBuilderPage, { pageId: isCreate4 ? void 0 : subPath });
11070
+ return /* @__PURE__ */ jsx63(PageBuilderPage, { pageId: isCreate4 ? void 0 : subPath });
10517
11071
  }
10518
11072
  if (key === "brands") {
10519
- return /* @__PURE__ */ jsx62(BrandEditPage, { brandId: subPath });
11073
+ return /* @__PURE__ */ jsx63(BrandEditPage, { brandId: subPath });
10520
11074
  }
10521
11075
  if (key === "products") {
10522
- return /* @__PURE__ */ jsx62(ProductEditPage, { productId: subPath });
11076
+ return /* @__PURE__ */ jsx63(ProductEditPage, { productId: subPath });
10523
11077
  }
10524
11078
  if (key === "collections") {
10525
- return /* @__PURE__ */ jsx62(CollectionEditPage, { collectionId: subPath });
11079
+ return /* @__PURE__ */ jsx63(CollectionEditPage, { collectionId: subPath });
10526
11080
  }
10527
11081
  }
10528
11082
  if (crud) {
10529
11083
  if (key === "media") {
10530
- return /* @__PURE__ */ jsx62(MediaLibraryPage, {});
11084
+ return /* @__PURE__ */ jsx63(MediaLibraryPage, {});
10531
11085
  }
10532
11086
  const isContactsWithStore = key === "contacts" && storeEnabled;
10533
11087
  const columns = isContactsWithStore ? [
@@ -10539,7 +11093,7 @@ function AdminPageResolver({ slug }) {
10539
11093
  () => isContactsWithStore ? { includeSummary: "1" } : void 0,
10540
11094
  [isContactsWithStore]
10541
11095
  );
10542
- return /* @__PURE__ */ jsx62(
11096
+ return /* @__PURE__ */ jsx63(
10543
11097
  AdminCRUD,
10544
11098
  {
10545
11099
  title: crud.title,
@@ -10554,13 +11108,13 @@ function AdminPageResolver({ slug }) {
10554
11108
  }
10555
11109
  );
10556
11110
  }
10557
- 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" }) });
10558
11112
  }
10559
11113
 
10560
11114
  // src/admin/pages/LayoutSettingsPage.tsx
10561
11115
  import { useState as useState36, useEffect as useEffect34, useContext as useContext7 } from "react";
10562
11116
  import { Save as Save7 } from "lucide-react";
10563
- import { jsx as jsx63, jsxs as jsxs54 } from "react/jsx-runtime";
11117
+ import { jsx as jsx64, jsxs as jsxs54 } from "react/jsx-runtime";
10564
11118
  function LayoutSettingsPage() {
10565
11119
  const { theme } = useContext7(AdminConfigContext);
10566
11120
  const [activeTab, setActiveTab] = useState36("navbar");
@@ -10616,13 +11170,13 @@ function LayoutSettingsPage() {
10616
11170
  props: footerLayout.fields
10617
11171
  } : null;
10618
11172
  if (loading) {
10619
- 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" }) });
10620
11174
  }
10621
11175
  return /* @__PURE__ */ jsxs54("div", { className: "min-w-0 rounded-lg bg-white shadow-md", children: [
10622
11176
  /* @__PURE__ */ jsxs54("div", { className: "bg-gray-800 px-4 py-2.5 rounded-t-lg flex items-center justify-between", children: [
10623
11177
  /* @__PURE__ */ jsxs54("div", { children: [
10624
- /* @__PURE__ */ jsx63("h1", { className: "text-xl font-bold text-white", children: "Layout Settings" }),
10625
- /* @__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" })
10626
11180
  ] }),
10627
11181
  /* @__PURE__ */ jsxs54(
10628
11182
  Button,
@@ -10631,14 +11185,14 @@ function LayoutSettingsPage() {
10631
11185
  disabled: saving,
10632
11186
  className: "bg-white text-gray-800 hover:bg-gray-100 border-0 text-xs",
10633
11187
  children: [
10634
- /* @__PURE__ */ jsx63(Save7, { className: "h-4 w-4 mr-2" }),
11188
+ /* @__PURE__ */ jsx64(Save7, { className: "h-4 w-4 mr-2" }),
10635
11189
  saving ? "Saving..." : "Save"
10636
11190
  ]
10637
11191
  }
10638
11192
  )
10639
11193
  ] }),
10640
- /* @__PURE__ */ jsx63("div", { className: "border-b", children: /* @__PURE__ */ jsxs54("div", { className: "flex", children: [
10641
- /* @__PURE__ */ jsx63(
11194
+ /* @__PURE__ */ jsx64("div", { className: "border-b", children: /* @__PURE__ */ jsxs54("div", { className: "flex", children: [
11195
+ /* @__PURE__ */ jsx64(
10642
11196
  "button",
10643
11197
  {
10644
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"}`,
@@ -10646,7 +11200,7 @@ function LayoutSettingsPage() {
10646
11200
  children: "Navbar"
10647
11201
  }
10648
11202
  ),
10649
- /* @__PURE__ */ jsx63(
11203
+ /* @__PURE__ */ jsx64(
10650
11204
  "button",
10651
11205
  {
10652
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"}`,
@@ -10656,8 +11210,8 @@ function LayoutSettingsPage() {
10656
11210
  )
10657
11211
  ] }) }),
10658
11212
  /* @__PURE__ */ jsxs54("div", { className: "min-w-0 p-6", children: [
10659
- activeTab === "navbar" && /* @__PURE__ */ jsx63(NavbarEditor, { config: navbarConfig, onChange: setNavbarConfig }),
10660
- activeTab === "footer" && footerMeta && /* @__PURE__ */ jsx63(
11213
+ activeTab === "navbar" && /* @__PURE__ */ jsx64(NavbarEditor, { config: navbarConfig, onChange: setNavbarConfig }),
11214
+ activeTab === "footer" && footerMeta && /* @__PURE__ */ jsx64(
10661
11215
  ComponentSettings,
10662
11216
  {
10663
11217
  meta: footerMeta,
@@ -10665,7 +11219,7 @@ function LayoutSettingsPage() {
10665
11219
  onChange: (name, val) => setFooterValues((prev) => ({ ...prev, [name]: val }))
10666
11220
  }
10667
11221
  ),
10668
- 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." })
10669
11223
  ] })
10670
11224
  ] });
10671
11225
  }
@@ -10686,11 +11240,11 @@ var DEFAULT_ADMIN_NAV = [
10686
11240
  import { SessionProvider } from "next-auth/react";
10687
11241
  import { ThemeProvider } from "next-themes";
10688
11242
  import { Toaster as Toaster3 } from "sonner";
10689
- import { jsx as jsx64, jsxs as jsxs55 } from "react/jsx-runtime";
11243
+ import { jsx as jsx65, jsxs as jsxs55 } from "react/jsx-runtime";
10690
11244
  function CmsProviders({ children }) {
10691
- return /* @__PURE__ */ jsx64(SessionProvider, { 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: [
10692
11246
  children,
10693
- /* @__PURE__ */ jsx64(Toaster3, { position: "top-right" })
11247
+ /* @__PURE__ */ jsx65(Toaster3, { position: "top-right" })
10694
11248
  ] }) });
10695
11249
  }
10696
11250
  export {