@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.cjs +1095 -541
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +939 -385
- package/dist/admin.js.map +1 -1
- package/dist/api.cjs +1111 -55
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +1110 -54
- package/dist/api.js.map +1 -1
- package/dist/auth.cjs +62 -19
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +12 -1
- package/dist/auth.d.ts +12 -1
- package/dist/auth.js +62 -19
- package/dist/auth.js.map +1 -1
- package/dist/{index-JrST6EIC.d.cts → index-Be8NLxu-.d.cts} +28 -4
- package/dist/{index-C4Yl7js9.d.ts → index-CjBf9dAb.d.ts} +28 -4
- package/dist/index.cjs +2983 -914
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -54
- package/dist/index.d.ts +345 -54
- package/dist/index.js +2783 -737
- package/dist/index.js.map +1 -1
- package/dist/migrations/1774600000000-OrderKindParentOrderNumber.ts +36 -0
- package/dist/migrations/1774800000000-OtpChallengesUserPhone.ts +41 -0
- package/dist/migrations/1774900000000-MessageTemplates.ts +39 -0
- package/package.json +1 -1
package/dist/admin.cjs
CHANGED
|
@@ -384,7 +384,7 @@ var AdminConfigContext = (0, import_react3.createContext)(defaultValue);
|
|
|
384
384
|
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==";
|
|
385
385
|
|
|
386
386
|
// src/lib/cms-version.ts
|
|
387
|
-
var CMS_VERSION = true ? "1.0.
|
|
387
|
+
var CMS_VERSION = true ? "1.0.14" : "0.0.0";
|
|
388
388
|
|
|
389
389
|
// src/components/Admin/Sidebar.tsx
|
|
390
390
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -781,9 +781,7 @@ function useAdminViewSettings() {
|
|
|
781
781
|
}, []);
|
|
782
782
|
}
|
|
783
783
|
function AdminLayoutInner({ children }) {
|
|
784
|
-
const
|
|
785
|
-
const session = sessionState?.data;
|
|
786
|
-
const status = sessionState?.status ?? "loading";
|
|
784
|
+
const { data: session, status } = (0, import_react7.useSession)();
|
|
787
785
|
const router = (0, import_navigation3.useRouter)();
|
|
788
786
|
const pathname = (0, import_navigation3.usePathname)();
|
|
789
787
|
const [loadingTimeout, setLoadingTimeout] = (0, import_react6.useState)(false);
|
|
@@ -6111,9 +6109,86 @@ function OrderDetailPage({ orderId }) {
|
|
|
6111
6109
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
6112
6110
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dt", { className: "text-gray-500", children: "Total" }),
|
|
6113
6111
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dd", { className: "font-medium text-gray-900", children: formatMoney(Number(order.total), currency) })
|
|
6112
|
+
] }),
|
|
6113
|
+
(order.orderKind || order.parentOrderId != null) && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
6114
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dt", { className: "text-gray-500", children: "Kind" }),
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dd", { className: "font-medium text-gray-900 capitalize", children: order.orderKind ?? "sale" })
|
|
6117
|
+
] }),
|
|
6118
|
+
order.parentOrderId != null && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
6119
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dt", { className: "text-gray-500", children: "Parent order" }),
|
|
6120
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dd", { className: "font-medium text-gray-900", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6121
|
+
import_link10.default,
|
|
6122
|
+
{
|
|
6123
|
+
href: `/admin/orders/${order.parentOrderId}/view`,
|
|
6124
|
+
className: "text-blue-600 hover:underline",
|
|
6125
|
+
children: [
|
|
6126
|
+
"#",
|
|
6127
|
+
order.parentOrderId
|
|
6128
|
+
]
|
|
6129
|
+
}
|
|
6130
|
+
) })
|
|
6131
|
+
] })
|
|
6114
6132
|
] })
|
|
6115
6133
|
] }) })
|
|
6116
6134
|
] }),
|
|
6135
|
+
(() => {
|
|
6136
|
+
const fulfillment = order.metadata?.fulfillment;
|
|
6137
|
+
if (!fulfillment?.status && !fulfillment?.trackingId && !(fulfillment?.events && fulfillment.events.length))
|
|
6138
|
+
return null;
|
|
6139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6140
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Fulfillment" }),
|
|
6141
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0 border border-gray-200 rounded-lg p-4 bg-gray-50/50 text-sm space-y-2", children: [
|
|
6142
|
+
fulfillment.status && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { children: [
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-500", children: "Status: " }),
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium text-gray-900", children: fulfillment.status })
|
|
6145
|
+
] }),
|
|
6146
|
+
fulfillment.trackingId && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { children: [
|
|
6147
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-500", children: "Tracking: " }),
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-mono text-gray-900", children: fulfillment.trackingId })
|
|
6149
|
+
] }),
|
|
6150
|
+
fulfillment.events && fulfillment.events.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ul", { className: "mt-3 space-y-2 border-t border-gray-200 pt-3", children: fulfillment.events.map((ev, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { className: "text-gray-800", children: [
|
|
6151
|
+
ev.at && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-500 text-xs block", children: ev.at }),
|
|
6152
|
+
ev.label && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium", children: ev.label }),
|
|
6153
|
+
ev.detail && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-600 ml-1", children: ev.detail })
|
|
6154
|
+
] }, i)) })
|
|
6155
|
+
] })
|
|
6156
|
+
] });
|
|
6157
|
+
})(),
|
|
6158
|
+
(order.orderKind ?? "sale") === "sale" && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Invoice" }),
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0 border border-gray-200 rounded-lg p-4 bg-gray-50/50 text-sm", children: [
|
|
6161
|
+
order.metadata?.invoice?.invoiceNumber && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-gray-700 mb-2", children: [
|
|
6162
|
+
"#",
|
|
6163
|
+
String((order.metadata?.invoice).invoiceNumber)
|
|
6164
|
+
] }),
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6166
|
+
"a",
|
|
6167
|
+
{
|
|
6168
|
+
href: `/api/orders/${order.id}/invoice`,
|
|
6169
|
+
target: "_blank",
|
|
6170
|
+
rel: "noopener noreferrer",
|
|
6171
|
+
className: "text-blue-600 font-medium hover:underline",
|
|
6172
|
+
children: "Download invoice PDF"
|
|
6173
|
+
}
|
|
6174
|
+
)
|
|
6175
|
+
] })
|
|
6176
|
+
] }),
|
|
6177
|
+
(order.relatedOrders ?? []).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6178
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Returns & replacements" }),
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "min-w-0 border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Table, { children: [
|
|
6180
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(TableRow, { className: "bg-gray-50", children: [
|
|
6181
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { className: "font-medium", children: "Number" }),
|
|
6182
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { className: "font-medium", children: "Kind" }),
|
|
6183
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { className: "font-medium", children: "Status" })
|
|
6184
|
+
] }) }),
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableBody, { children: (order.relatedOrders ?? []).map((r) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(TableRow, { children: [
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_link10.default, { href: `/admin/orders/${r.id}/view`, className: "text-blue-600 hover:underline font-medium", children: r.orderNumber }) }),
|
|
6187
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { className: "capitalize", children: r.orderKind ?? "\u2014" }),
|
|
6188
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { className: "capitalize", children: r.status ?? "\u2014" })
|
|
6189
|
+
] }, r.id)) })
|
|
6190
|
+
] }) })
|
|
6191
|
+
] }),
|
|
6117
6192
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6118
6193
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Line items" }),
|
|
6119
6194
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "min-w-0 overflow-x-auto border border-gray-200 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Table, { children: [
|
|
@@ -7836,33 +7911,50 @@ function RightSidebar({ theme, resolver, activeTab, setActiveTab, seoProps }) {
|
|
|
7836
7911
|
] })
|
|
7837
7912
|
] });
|
|
7838
7913
|
}
|
|
7839
|
-
function SaveButton({
|
|
7914
|
+
function SaveButton({
|
|
7915
|
+
pageId,
|
|
7916
|
+
pageData,
|
|
7917
|
+
existingSeoId,
|
|
7918
|
+
onSeoIdChange,
|
|
7919
|
+
onSaved,
|
|
7920
|
+
children,
|
|
7921
|
+
className
|
|
7922
|
+
}) {
|
|
7840
7923
|
const { query } = (0, import_core.useEditor)();
|
|
7841
7924
|
const [saving, setSaving] = (0, import_react38.useState)(false);
|
|
7842
7925
|
const handleSave = async () => {
|
|
7843
7926
|
setSaving(true);
|
|
7844
7927
|
try {
|
|
7845
7928
|
const content = JSON.parse(query.serialize());
|
|
7846
|
-
let
|
|
7847
|
-
const hasSeo = pageData.seoTitle || pageData.seoDescription || pageData.seoKeywords;
|
|
7929
|
+
let resolvedSeoId = existingSeoId;
|
|
7930
|
+
const hasSeo = pageData.seoTitle || pageData.seoDescription || pageData.seoKeywords || pageData.seoOgTitle || pageData.seoOgDescription || pageData.seoOgImage;
|
|
7848
7931
|
if (hasSeo) {
|
|
7849
7932
|
const seoPayload = {
|
|
7850
|
-
title: pageData.seoTitle,
|
|
7851
|
-
description: pageData.seoDescription,
|
|
7852
|
-
keywords: pageData.seoKeywords,
|
|
7853
|
-
ogTitle: pageData.seoOgTitle,
|
|
7854
|
-
ogDescription: pageData.seoOgDescription,
|
|
7855
|
-
ogImage: pageData.seoOgImage,
|
|
7933
|
+
title: pageData.seoTitle || null,
|
|
7934
|
+
description: pageData.seoDescription || null,
|
|
7935
|
+
keywords: pageData.seoKeywords || null,
|
|
7936
|
+
ogTitle: pageData.seoOgTitle || null,
|
|
7937
|
+
ogDescription: pageData.seoOgDescription || null,
|
|
7938
|
+
ogImage: pageData.seoOgImage || null,
|
|
7856
7939
|
slug: pageData.slug
|
|
7857
7940
|
};
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7941
|
+
if (existingSeoId) {
|
|
7942
|
+
const seoRes = await fetch(`/api/seos/${existingSeoId}`, {
|
|
7943
|
+
method: "PUT",
|
|
7944
|
+
headers: { "Content-Type": "application/json" },
|
|
7945
|
+
body: JSON.stringify(seoPayload)
|
|
7946
|
+
});
|
|
7947
|
+
if (seoRes.ok) resolvedSeoId = existingSeoId;
|
|
7948
|
+
} else {
|
|
7949
|
+
const seoRes = await fetch("/api/seos", {
|
|
7950
|
+
method: "POST",
|
|
7951
|
+
headers: { "Content-Type": "application/json" },
|
|
7952
|
+
body: JSON.stringify(seoPayload)
|
|
7953
|
+
});
|
|
7954
|
+
if (seoRes.ok) {
|
|
7955
|
+
const seoData = await seoRes.json();
|
|
7956
|
+
resolvedSeoId = seoData.id ?? null;
|
|
7957
|
+
}
|
|
7866
7958
|
}
|
|
7867
7959
|
}
|
|
7868
7960
|
const payload = {
|
|
@@ -7871,7 +7963,7 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
|
|
|
7871
7963
|
content,
|
|
7872
7964
|
published: pageData.published
|
|
7873
7965
|
};
|
|
7874
|
-
if (
|
|
7966
|
+
if (resolvedSeoId != null) payload.seoId = resolvedSeoId;
|
|
7875
7967
|
const url = pageId ? `/api/pages/${pageId}` : "/api/pages";
|
|
7876
7968
|
const method = pageId ? "PUT" : "POST";
|
|
7877
7969
|
const res = await fetch(url, {
|
|
@@ -7881,6 +7973,8 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
|
|
|
7881
7973
|
});
|
|
7882
7974
|
if (res.ok) {
|
|
7883
7975
|
const saved = await res.json();
|
|
7976
|
+
const nextSeo = saved.seoId != null && saved.seoId !== "" ? Number(saved.seoId) : resolvedSeoId;
|
|
7977
|
+
if (Number.isFinite(nextSeo)) onSeoIdChange(nextSeo);
|
|
7884
7978
|
onSaved(saved.id?.toString() || pageId || "");
|
|
7885
7979
|
}
|
|
7886
7980
|
} finally {
|
|
@@ -7913,9 +8007,11 @@ function PageBuilderPage({ pageId }) {
|
|
|
7913
8007
|
const [seoOgTitle, setSeoOgTitle] = (0, import_react38.useState)("");
|
|
7914
8008
|
const [seoOgDescription, setSeoOgDescription] = (0, import_react38.useState)("");
|
|
7915
8009
|
const [seoOgImage, setSeoOgImage] = (0, import_react38.useState)("");
|
|
8010
|
+
const [pageSeoId, setPageSeoId] = (0, import_react38.useState)(null);
|
|
7916
8011
|
(0, import_react38.useEffect)(() => {
|
|
7917
8012
|
if (!pageId) {
|
|
7918
8013
|
setInitialContent(null);
|
|
8014
|
+
setPageSeoId(null);
|
|
7919
8015
|
setLoading(false);
|
|
7920
8016
|
return;
|
|
7921
8017
|
}
|
|
@@ -7924,6 +8020,9 @@ function PageBuilderPage({ pageId }) {
|
|
|
7924
8020
|
setTitle(data.title || "");
|
|
7925
8021
|
setSlug(data.slug || "");
|
|
7926
8022
|
setPublished(data.published || false);
|
|
8023
|
+
setPageSeoId(
|
|
8024
|
+
data.seoId != null && data.seoId !== "" ? Number(data.seoId) : data.seo?.id != null ? Number(data.seo.id) : null
|
|
8025
|
+
);
|
|
7927
8026
|
if (data.content) {
|
|
7928
8027
|
setInitialContent(JSON.stringify(data.content));
|
|
7929
8028
|
}
|
|
@@ -7977,6 +8076,8 @@ function PageBuilderPage({ pageId }) {
|
|
|
7977
8076
|
SaveButton,
|
|
7978
8077
|
{
|
|
7979
8078
|
pageId,
|
|
8079
|
+
existingSeoId: pageSeoId,
|
|
8080
|
+
onSeoIdChange: setPageSeoId,
|
|
7980
8081
|
pageData: { title, slug, published, seoTitle, seoDescription, seoKeywords, seoOgTitle, seoOgDescription, seoOgImage },
|
|
7981
8082
|
onSaved: (id) => {
|
|
7982
8083
|
if (!pageId) router.replace(`/admin/pages/${id}`);
|
|
@@ -8055,7 +8156,7 @@ function PageBuilderPage({ pageId }) {
|
|
|
8055
8156
|
|
|
8056
8157
|
// src/admin/pages/PluginsPage.tsx
|
|
8057
8158
|
var import_react40 = require("react");
|
|
8058
|
-
var
|
|
8159
|
+
var import_lucide_react32 = require("lucide-react");
|
|
8059
8160
|
|
|
8060
8161
|
// src/lib/email-recipients.ts
|
|
8061
8162
|
function parseEmailRecipientsFromConfig(raw) {
|
|
@@ -8076,15 +8177,57 @@ function serializeEmailRecipients(emails) {
|
|
|
8076
8177
|
return JSON.stringify(emails);
|
|
8077
8178
|
}
|
|
8078
8179
|
|
|
8180
|
+
// src/components/ui/checkbox.tsx
|
|
8181
|
+
var React19 = __toESM(require("react"), 1);
|
|
8182
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
8183
|
+
var import_lucide_react31 = require("lucide-react");
|
|
8184
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
8185
|
+
var Checkbox = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8186
|
+
CheckboxPrimitive.Root,
|
|
8187
|
+
{
|
|
8188
|
+
ref,
|
|
8189
|
+
className: cn(
|
|
8190
|
+
"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",
|
|
8191
|
+
className
|
|
8192
|
+
),
|
|
8193
|
+
...props,
|
|
8194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8195
|
+
CheckboxPrimitive.Indicator,
|
|
8196
|
+
{
|
|
8197
|
+
className: cn("flex items-center justify-center text-current"),
|
|
8198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react31.Check, { className: "h-4 w-4" })
|
|
8199
|
+
}
|
|
8200
|
+
)
|
|
8201
|
+
}
|
|
8202
|
+
));
|
|
8203
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
8204
|
+
|
|
8079
8205
|
// src/admin/pages/PluginsPage.tsx
|
|
8080
8206
|
var import_sonner6 = require("sonner");
|
|
8081
|
-
var
|
|
8207
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8208
|
+
function normalizeChatMode(raw) {
|
|
8209
|
+
if (raw === "external" || raw === "llm") return raw;
|
|
8210
|
+
return "whatsapp";
|
|
8211
|
+
}
|
|
8082
8212
|
var ICON_MAP = {
|
|
8083
|
-
storage:
|
|
8084
|
-
email:
|
|
8085
|
-
payment:
|
|
8086
|
-
llm:
|
|
8213
|
+
storage: import_lucide_react32.HardDrive,
|
|
8214
|
+
email: import_lucide_react32.Mail,
|
|
8215
|
+
payment: import_lucide_react32.CreditCard,
|
|
8216
|
+
llm: import_lucide_react32.MessageCircle,
|
|
8217
|
+
analytics: import_lucide_react32.BarChart3,
|
|
8218
|
+
erp: import_lucide_react32.Building2,
|
|
8219
|
+
sms: import_lucide_react32.Smartphone
|
|
8087
8220
|
};
|
|
8221
|
+
function normalizeSmsProviderChoice(raw) {
|
|
8222
|
+
const x = (raw || "auto").toLowerCase().trim();
|
|
8223
|
+
if (x === "msg91" || x === "twilio" || x === "webhook" || x === "auto") return x;
|
|
8224
|
+
return "auto";
|
|
8225
|
+
}
|
|
8226
|
+
function normalizeMsg91ApiMode(raw) {
|
|
8227
|
+
const x = (raw || "auto").toLowerCase().trim();
|
|
8228
|
+
if (x === "flow" || x === "sendhttp" || x === "auto") return x;
|
|
8229
|
+
return "auto";
|
|
8230
|
+
}
|
|
8088
8231
|
function splitInputToEmails(input) {
|
|
8089
8232
|
return input.split(/[,;]+/).map((s) => s.trim()).filter(Boolean);
|
|
8090
8233
|
}
|
|
@@ -8137,27 +8280,27 @@ function EmailRecipientTags({
|
|
|
8137
8280
|
onChange(next);
|
|
8138
8281
|
setDraft("");
|
|
8139
8282
|
};
|
|
8140
|
-
return /* @__PURE__ */ (0,
|
|
8141
|
-
/* @__PURE__ */ (0,
|
|
8142
|
-
/* @__PURE__ */ (0,
|
|
8283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8284
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: id, className: "text-sm", children: label }),
|
|
8285
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8143
8286
|
"div",
|
|
8144
8287
|
{
|
|
8145
8288
|
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",
|
|
8146
8289
|
children: [
|
|
8147
|
-
emails.map((email) => /* @__PURE__ */ (0,
|
|
8148
|
-
/* @__PURE__ */ (0,
|
|
8149
|
-
/* @__PURE__ */ (0,
|
|
8290
|
+
emails.map((email) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Badge, { variant: "secondary", className: "gap-1 pr-0.5 font-normal", children: [
|
|
8291
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "max-w-[220px] truncate", children: email }),
|
|
8292
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8150
8293
|
"button",
|
|
8151
8294
|
{
|
|
8152
8295
|
type: "button",
|
|
8153
8296
|
className: "rounded p-0.5 hover:bg-muted",
|
|
8154
8297
|
"aria-label": `Remove ${email}`,
|
|
8155
8298
|
onClick: () => onChange(emails.filter((e) => e !== email)),
|
|
8156
|
-
children: /* @__PURE__ */ (0,
|
|
8299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.X, { className: "h-3 w-3" })
|
|
8157
8300
|
}
|
|
8158
8301
|
)
|
|
8159
8302
|
] }, email)),
|
|
8160
|
-
/* @__PURE__ */ (0,
|
|
8303
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8161
8304
|
"input",
|
|
8162
8305
|
{
|
|
8163
8306
|
id,
|
|
@@ -8184,14 +8327,14 @@ function EmailRecipientTags({
|
|
|
8184
8327
|
]
|
|
8185
8328
|
}
|
|
8186
8329
|
),
|
|
8187
|
-
/* @__PURE__ */ (0,
|
|
8330
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: hint })
|
|
8188
8331
|
] });
|
|
8189
8332
|
}
|
|
8190
8333
|
function PluginIcon({ descriptor, size = "md" }) {
|
|
8191
|
-
const Icon2 = descriptor.icon ? ICON_MAP[descriptor.icon] ??
|
|
8334
|
+
const Icon2 = descriptor.icon ? ICON_MAP[descriptor.icon] ?? import_lucide_react32.Puzzle : import_lucide_react32.Puzzle;
|
|
8192
8335
|
const sizeClass = size === "sm" ? "h-8 w-8" : "h-11 w-11";
|
|
8193
8336
|
const iconClass = size === "sm" ? "h-4 w-4" : "h-5 w-5";
|
|
8194
|
-
return /* @__PURE__ */ (0,
|
|
8337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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__ */ (0, import_jsx_runtime56.jsx)(Icon2, { className: iconClass }) });
|
|
8195
8338
|
}
|
|
8196
8339
|
function PluginSettingsPanel({
|
|
8197
8340
|
descriptor,
|
|
@@ -8200,6 +8343,8 @@ function PluginSettingsPanel({
|
|
|
8200
8343
|
const settingsGroup = descriptor.settingsGroup;
|
|
8201
8344
|
const isLlm = settingsGroup === "llm";
|
|
8202
8345
|
const isEmail = settingsGroup === "email";
|
|
8346
|
+
const isErp = settingsGroup === "erp";
|
|
8347
|
+
const isSms = settingsGroup === "sms";
|
|
8203
8348
|
const [enabled, setEnabled] = (0, import_react40.useState)(true);
|
|
8204
8349
|
const [botName, setBotName] = (0, import_react40.useState)("");
|
|
8205
8350
|
const [icon, setIcon] = (0, import_react40.useState)("");
|
|
@@ -8216,18 +8361,59 @@ function PluginSettingsPanel({
|
|
|
8216
8361
|
const [followUsTitle, setFollowUsTitle] = (0, import_react40.useState)("Follow Us");
|
|
8217
8362
|
const [socialLinkRows, setSocialLinkRows] = (0, import_react40.useState)([{ ...EMPTY_SOCIAL_ROW }]);
|
|
8218
8363
|
const [footerDisclaimer, setFooterDisclaimer] = (0, import_react40.useState)("");
|
|
8364
|
+
const [chatMode, setChatMode] = (0, import_react40.useState)("whatsapp");
|
|
8365
|
+
const [whatsappPhone, setWhatsappPhone] = (0, import_react40.useState)("");
|
|
8366
|
+
const [externalChatSnippet, setExternalChatSnippet] = (0, import_react40.useState)("");
|
|
8367
|
+
const [erpPipelineName, setErpPipelineName] = (0, import_react40.useState)("");
|
|
8368
|
+
const [erpPipelineStageName, setErpPipelineStageName] = (0, import_react40.useState)("");
|
|
8369
|
+
const [erpFormsCatalog, setErpFormsCatalog] = (0, import_react40.useState)([]);
|
|
8370
|
+
const [erpOpportunityFormIds, setErpOpportunityFormIds] = (0, import_react40.useState)([]);
|
|
8371
|
+
const [erpOpportunityIdsKeyPresent, setErpOpportunityIdsKeyPresent] = (0, import_react40.useState)(false);
|
|
8372
|
+
const [smsProviderChoice, setSmsProviderChoice] = (0, import_react40.useState)("auto");
|
|
8373
|
+
const [msg91ApiMode, setMsg91ApiMode] = (0, import_react40.useState)("auto");
|
|
8374
|
+
const [smsTplItems, setSmsTplItems] = (0, import_react40.useState)([]);
|
|
8219
8375
|
const [loading, setLoading] = (0, import_react40.useState)(true);
|
|
8220
8376
|
const [saving, setSaving] = (0, import_react40.useState)(false);
|
|
8221
8377
|
(0, import_react40.useEffect)(() => {
|
|
8222
|
-
|
|
8378
|
+
setLoading(true);
|
|
8379
|
+
fetch(`/api/settings/${settingsGroup}`).then((r) => r.ok ? r.json() : {}).then(async (data) => {
|
|
8223
8380
|
setEnabled(data.enabled !== "false");
|
|
8224
8381
|
setBotName(data.botName ?? "");
|
|
8225
8382
|
setIcon(data.icon ?? "");
|
|
8226
8383
|
if (isLlm) {
|
|
8384
|
+
setChatMode(normalizeChatMode(data.chatMode));
|
|
8385
|
+
setWhatsappPhone(data.whatsappPhone ?? "");
|
|
8386
|
+
setExternalChatSnippet(data.externalChatSnippet ?? "");
|
|
8227
8387
|
setIconImageUrl(data.iconImageUrl ?? "");
|
|
8228
8388
|
setIconBackgroundColor(data.iconBackgroundColor ?? "#6366f1");
|
|
8229
8389
|
setHeaderColor(data.headerColor ?? "#6366f1");
|
|
8230
8390
|
}
|
|
8391
|
+
if (isErp) {
|
|
8392
|
+
setErpPipelineName(data.pipelineName ?? data.pipelineId ?? "");
|
|
8393
|
+
setErpPipelineStageName(data.pipelineStageName ?? data.pipelineStageId ?? "");
|
|
8394
|
+
const rawOpp = data.opportunityFormIds;
|
|
8395
|
+
const keyPresent = rawOpp !== void 0 && rawOpp !== null && String(rawOpp).trim() !== "";
|
|
8396
|
+
setErpOpportunityIdsKeyPresent(keyPresent);
|
|
8397
|
+
if (keyPresent) {
|
|
8398
|
+
try {
|
|
8399
|
+
const p = JSON.parse(String(rawOpp));
|
|
8400
|
+
const ids = Array.isArray(p) ? p.map((x) => typeof x === "number" ? x : Number(x)).filter((n) => Number.isInteger(n) && n > 0) : [];
|
|
8401
|
+
setErpOpportunityFormIds([...new Set(ids)]);
|
|
8402
|
+
} catch {
|
|
8403
|
+
setErpOpportunityFormIds([]);
|
|
8404
|
+
}
|
|
8405
|
+
} else {
|
|
8406
|
+
setErpOpportunityFormIds([]);
|
|
8407
|
+
}
|
|
8408
|
+
}
|
|
8409
|
+
if (isSms) {
|
|
8410
|
+
setSmsProviderChoice(normalizeSmsProviderChoice(data.smsProvider ?? data.SMS_PROVIDER));
|
|
8411
|
+
setMsg91ApiMode(normalizeMsg91ApiMode(data.msg91ApiMode));
|
|
8412
|
+
const tr = await fetch("/api/message-templates/sms").then(
|
|
8413
|
+
(r) => r.ok ? r.json() : { items: [] }
|
|
8414
|
+
);
|
|
8415
|
+
setSmsTplItems(tr.items ?? []);
|
|
8416
|
+
}
|
|
8231
8417
|
if (isEmail) {
|
|
8232
8418
|
const sales = parseEmailRecipientsFromConfig(data.salesTeamEmails ?? data.salesTeamEmail);
|
|
8233
8419
|
const fulfil = parseEmailRecipientsFromConfig(data.fulfilmentTeamEmails ?? data.fulfilmentTeamEmail);
|
|
@@ -8244,14 +8430,48 @@ function PluginSettingsPanel({
|
|
|
8244
8430
|
setFooterDisclaimer(data.footerDisclaimer ?? "");
|
|
8245
8431
|
}
|
|
8246
8432
|
}).finally(() => setLoading(false));
|
|
8247
|
-
}, [settingsGroup, isLlm, isEmail]);
|
|
8433
|
+
}, [settingsGroup, isLlm, isEmail, isErp, isSms]);
|
|
8434
|
+
(0, import_react40.useEffect)(() => {
|
|
8435
|
+
if (!isErp || loading) return;
|
|
8436
|
+
fetch("/api/forms?limit=500&sortField=name&sortOrder=asc").then((r) => r.ok ? r.json() : { data: [] }).then((res) => {
|
|
8437
|
+
const rows = (res.data ?? []).map((f) => ({
|
|
8438
|
+
id: typeof f.id === "number" ? f.id : Number(f.id),
|
|
8439
|
+
name: String(f.name ?? "")
|
|
8440
|
+
})).filter((f) => Number.isInteger(f.id) && f.id > 0);
|
|
8441
|
+
setErpFormsCatalog(rows);
|
|
8442
|
+
}).catch(() => setErpFormsCatalog([]));
|
|
8443
|
+
}, [isErp, loading]);
|
|
8248
8444
|
const buildPayload = () => {
|
|
8445
|
+
if (isErp) {
|
|
8446
|
+
const sortedIds = [...new Set(erpOpportunityFormIds.filter((n) => Number.isInteger(n) && n > 0))].sort(
|
|
8447
|
+
(a, b) => a - b
|
|
8448
|
+
);
|
|
8449
|
+
const payload2 = {
|
|
8450
|
+
enabled: { value: enabled ? "true" : "false", type: "public" },
|
|
8451
|
+
pipelineName: { value: erpPipelineName, type: "public" },
|
|
8452
|
+
pipelineStageName: { value: erpPipelineStageName, type: "public" }
|
|
8453
|
+
};
|
|
8454
|
+
if (erpFormsCatalog.length > 0 || erpOpportunityIdsKeyPresent) {
|
|
8455
|
+
payload2.opportunityFormIds = { value: JSON.stringify(sortedIds), type: "public" };
|
|
8456
|
+
}
|
|
8457
|
+
return payload2;
|
|
8458
|
+
}
|
|
8459
|
+
if (isSms) {
|
|
8460
|
+
return {
|
|
8461
|
+
enabled: { value: enabled ? "true" : "false", type: "public" },
|
|
8462
|
+
smsProvider: { value: smsProviderChoice, type: "public" },
|
|
8463
|
+
msg91ApiMode: { value: msg91ApiMode, type: "public" }
|
|
8464
|
+
};
|
|
8465
|
+
}
|
|
8249
8466
|
const payload = {
|
|
8250
8467
|
enabled: { value: enabled ? "true" : "false", type: "public" },
|
|
8251
8468
|
botName: { value: botName, type: "public" },
|
|
8252
8469
|
icon: { value: icon, type: "public" }
|
|
8253
8470
|
};
|
|
8254
8471
|
if (isLlm) {
|
|
8472
|
+
payload.chatMode = { value: chatMode, type: "public" };
|
|
8473
|
+
payload.whatsappPhone = { value: whatsappPhone, type: "public" };
|
|
8474
|
+
payload.externalChatSnippet = { value: externalChatSnippet, type: "public" };
|
|
8255
8475
|
payload.iconImageUrl = { value: iconImageUrl, type: "public" };
|
|
8256
8476
|
payload.iconBackgroundColor = { value: iconBackgroundColor, type: "public" };
|
|
8257
8477
|
payload.headerColor = { value: headerColor, type: "public" };
|
|
@@ -8279,6 +8499,22 @@ function PluginSettingsPanel({
|
|
|
8279
8499
|
body: JSON.stringify(buildPayload())
|
|
8280
8500
|
});
|
|
8281
8501
|
if (!res.ok) throw new Error();
|
|
8502
|
+
if (isSms && smsTplItems.length > 0) {
|
|
8503
|
+
const res2 = await fetch("/api/message-templates/sms", {
|
|
8504
|
+
method: "PUT",
|
|
8505
|
+
headers: { "Content-Type": "application/json" },
|
|
8506
|
+
body: JSON.stringify({
|
|
8507
|
+
items: smsTplItems.map((t) => ({
|
|
8508
|
+
templateKey: t.templateKey,
|
|
8509
|
+
body: t.body,
|
|
8510
|
+
externalTemplateRef: t.externalTemplateRef,
|
|
8511
|
+
otpVarKey: t.otpVarKey,
|
|
8512
|
+
enabled: t.enabled
|
|
8513
|
+
}))
|
|
8514
|
+
})
|
|
8515
|
+
});
|
|
8516
|
+
if (!res2.ok) throw new Error();
|
|
8517
|
+
}
|
|
8282
8518
|
import_sonner6.toast.success("Settings saved");
|
|
8283
8519
|
onSaved?.();
|
|
8284
8520
|
} catch {
|
|
@@ -8287,10 +8523,101 @@ function PluginSettingsPanel({
|
|
|
8287
8523
|
setSaving(false);
|
|
8288
8524
|
}
|
|
8289
8525
|
};
|
|
8290
|
-
if (loading) return /* @__PURE__ */ (0,
|
|
8526
|
+
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading..." });
|
|
8527
|
+
if (isErp) {
|
|
8528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8529
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8530
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
8531
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
8532
|
+
] }),
|
|
8533
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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." }),
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8535
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-pipelineName`, className: "text-sm", children: "Pipeline name" }),
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8537
|
+
Input,
|
|
8538
|
+
{
|
|
8539
|
+
id: `${settingsGroup}-pipelineName`,
|
|
8540
|
+
value: erpPipelineName,
|
|
8541
|
+
onChange: (e) => setErpPipelineName(e.target.value),
|
|
8542
|
+
placeholder: "e.g. Sales",
|
|
8543
|
+
className: "h-8 text-sm"
|
|
8544
|
+
}
|
|
8545
|
+
)
|
|
8546
|
+
] }),
|
|
8547
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-pipelineStageName`, className: "text-sm", children: "Pipeline stage name" }),
|
|
8549
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8550
|
+
Input,
|
|
8551
|
+
{
|
|
8552
|
+
id: `${settingsGroup}-pipelineStageName`,
|
|
8553
|
+
value: erpPipelineStageName,
|
|
8554
|
+
onChange: (e) => setErpPipelineStageName(e.target.value),
|
|
8555
|
+
placeholder: "e.g. New",
|
|
8556
|
+
className: "h-8 text-sm"
|
|
8557
|
+
}
|
|
8558
|
+
)
|
|
8559
|
+
] }),
|
|
8560
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2", children: [
|
|
8561
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
8562
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-sm", children: "Forms as CRM opportunity" }),
|
|
8563
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex gap-2 text-xs", children: [
|
|
8564
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8565
|
+
"button",
|
|
8566
|
+
{
|
|
8567
|
+
type: "button",
|
|
8568
|
+
className: "text-primary underline-offset-2 hover:underline",
|
|
8569
|
+
onClick: () => setErpOpportunityFormIds(erpFormsCatalog.map((f) => f.id)),
|
|
8570
|
+
children: "Select all"
|
|
8571
|
+
}
|
|
8572
|
+
),
|
|
8573
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8574
|
+
"button",
|
|
8575
|
+
{
|
|
8576
|
+
type: "button",
|
|
8577
|
+
className: "text-primary underline-offset-2 hover:underline",
|
|
8578
|
+
onClick: () => setErpOpportunityFormIds([]),
|
|
8579
|
+
children: "Clear"
|
|
8580
|
+
}
|
|
8581
|
+
)
|
|
8582
|
+
] })
|
|
8583
|
+
] }),
|
|
8584
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
8585
|
+
"Every form submission with an email is sent to ERP: unchecked forms use ",
|
|
8586
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "font-medium", children: "lead" }),
|
|
8587
|
+
" (",
|
|
8588
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "lead.created" }),
|
|
8589
|
+
"); checked forms use ",
|
|
8590
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "font-medium", children: "opportunity" }),
|
|
8591
|
+
" (",
|
|
8592
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "form.submitted" }),
|
|
8593
|
+
") with the pipeline and stage above."
|
|
8594
|
+
] }),
|
|
8595
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "No forms found." }) : erpFormsCatalog.map((f) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "flex cursor-pointer items-center gap-2 text-sm", children: [
|
|
8596
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8597
|
+
Checkbox,
|
|
8598
|
+
{
|
|
8599
|
+
checked: erpOpportunityFormIds.includes(f.id),
|
|
8600
|
+
onCheckedChange: (c) => {
|
|
8601
|
+
const on = c === true;
|
|
8602
|
+
setErpOpportunityFormIds((prev) => {
|
|
8603
|
+
if (on) return prev.includes(f.id) ? prev : [...prev, f.id].sort((a, b) => a - b);
|
|
8604
|
+
return prev.filter((x) => x !== f.id);
|
|
8605
|
+
});
|
|
8606
|
+
}
|
|
8607
|
+
}
|
|
8608
|
+
),
|
|
8609
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "min-w-0 truncate", children: f.name || `Form #${f.id}` })
|
|
8610
|
+
] }, f.id)) })
|
|
8611
|
+
] }),
|
|
8612
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
8613
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
8614
|
+
"Save"
|
|
8615
|
+
] })
|
|
8616
|
+
] });
|
|
8617
|
+
}
|
|
8291
8618
|
if (isEmail) {
|
|
8292
|
-
return /* @__PURE__ */ (0,
|
|
8293
|
-
/* @__PURE__ */ (0,
|
|
8619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8620
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8294
8621
|
EmailRecipientTags,
|
|
8295
8622
|
{
|
|
8296
8623
|
id: `${settingsGroup}-salesTeamEmails`,
|
|
@@ -8301,7 +8628,7 @@ function PluginSettingsPanel({
|
|
|
8301
8628
|
placeholder: "e.g. sales@example.com"
|
|
8302
8629
|
}
|
|
8303
8630
|
),
|
|
8304
|
-
/* @__PURE__ */ (0,
|
|
8631
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8305
8632
|
EmailRecipientTags,
|
|
8306
8633
|
{
|
|
8307
8634
|
id: `${settingsGroup}-fulfilmentTeamEmails`,
|
|
@@ -8312,7 +8639,7 @@ function PluginSettingsPanel({
|
|
|
8312
8639
|
placeholder: "e.g. fulfilment@example.com"
|
|
8313
8640
|
}
|
|
8314
8641
|
),
|
|
8315
|
-
/* @__PURE__ */ (0,
|
|
8642
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8316
8643
|
EmailRecipientTags,
|
|
8317
8644
|
{
|
|
8318
8645
|
id: `${settingsGroup}-crmEmails`,
|
|
@@ -8323,34 +8650,34 @@ function PluginSettingsPanel({
|
|
|
8323
8650
|
placeholder: "e.g. crm@example.com"
|
|
8324
8651
|
}
|
|
8325
8652
|
),
|
|
8326
|
-
/* @__PURE__ */ (0,
|
|
8327
|
-
/* @__PURE__ */ (0,
|
|
8328
|
-
/* @__PURE__ */ (0,
|
|
8329
|
-
/* @__PURE__ */ (0,
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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." }),
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8655
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-logoUrl`, className: "text-sm", children: "Logo URL (optional override)" }),
|
|
8656
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-logoUrl`, value: logoUrl, onChange: (e) => setLogoUrl(e.target.value), placeholder: "https://\u2026", className: "h-8 text-sm" })
|
|
8330
8657
|
] }),
|
|
8331
|
-
/* @__PURE__ */ (0,
|
|
8332
|
-
/* @__PURE__ */ (0,
|
|
8333
|
-
/* @__PURE__ */ (0,
|
|
8658
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8659
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-companyName`, className: "text-sm", children: "Company name (optional override)" }),
|
|
8660
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-companyName`, value: companyName, onChange: (e) => setCompanyName(e.target.value), className: "h-8 text-sm" })
|
|
8334
8661
|
] }),
|
|
8335
|
-
/* @__PURE__ */ (0,
|
|
8336
|
-
/* @__PURE__ */ (0,
|
|
8337
|
-
/* @__PURE__ */ (0,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-supportEmail`, className: "text-sm", children: "Support email (footer)" }),
|
|
8664
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-supportEmail`, value: supportEmail, onChange: (e) => setSupportEmail(e.target.value), type: "email", className: "h-8 text-sm" })
|
|
8338
8665
|
] }),
|
|
8339
|
-
/* @__PURE__ */ (0,
|
|
8340
|
-
/* @__PURE__ */ (0,
|
|
8341
|
-
/* @__PURE__ */ (0,
|
|
8666
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8667
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-supportPhone`, className: "text-sm", children: "Support phone (footer)" }),
|
|
8668
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-supportPhone`, value: supportPhone, onChange: (e) => setSupportPhone(e.target.value), className: "h-8 text-sm" })
|
|
8342
8669
|
] }),
|
|
8343
|
-
/* @__PURE__ */ (0,
|
|
8344
|
-
/* @__PURE__ */ (0,
|
|
8345
|
-
/* @__PURE__ */ (0,
|
|
8670
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8671
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-followUsTitle`, className: "text-sm", children: "\u201CFollow us\u201D heading" }),
|
|
8672
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-followUsTitle`, value: followUsTitle, onChange: (e) => setFollowUsTitle(e.target.value), className: "h-8 text-sm" })
|
|
8346
8673
|
] }),
|
|
8347
|
-
/* @__PURE__ */ (0,
|
|
8348
|
-
/* @__PURE__ */ (0,
|
|
8349
|
-
/* @__PURE__ */ (0,
|
|
8350
|
-
socialLinkRows.map((row, i) => /* @__PURE__ */ (0,
|
|
8351
|
-
/* @__PURE__ */ (0,
|
|
8352
|
-
/* @__PURE__ */ (0,
|
|
8353
|
-
/* @__PURE__ */ (0,
|
|
8674
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2", children: [
|
|
8675
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-sm", children: "Social links" }),
|
|
8676
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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." }),
|
|
8677
|
+
socialLinkRows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-wrap items-end gap-2 border-b border-border/60 pb-3 dark:border-gray-600", children: [
|
|
8678
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
|
|
8679
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs text-muted-foreground", children: "Icon image URL" }),
|
|
8680
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8354
8681
|
Input,
|
|
8355
8682
|
{
|
|
8356
8683
|
value: row.iconUrl,
|
|
@@ -8364,9 +8691,9 @@ function PluginSettingsPanel({
|
|
|
8364
8691
|
}
|
|
8365
8692
|
)
|
|
8366
8693
|
] }),
|
|
8367
|
-
/* @__PURE__ */ (0,
|
|
8368
|
-
/* @__PURE__ */ (0,
|
|
8369
|
-
/* @__PURE__ */ (0,
|
|
8694
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
|
|
8695
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs text-muted-foreground", children: "Link URL" }),
|
|
8696
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8370
8697
|
Input,
|
|
8371
8698
|
{
|
|
8372
8699
|
value: row.url,
|
|
@@ -8380,9 +8707,9 @@ function PluginSettingsPanel({
|
|
|
8380
8707
|
}
|
|
8381
8708
|
)
|
|
8382
8709
|
] }),
|
|
8383
|
-
/* @__PURE__ */ (0,
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8385
|
-
/* @__PURE__ */ (0,
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "w-[120px] space-y-1", children: [
|
|
8711
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs text-muted-foreground", children: "Emoji / text" }),
|
|
8712
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8386
8713
|
Input,
|
|
8387
8714
|
{
|
|
8388
8715
|
value: row.iconFallback,
|
|
@@ -8396,7 +8723,7 @@ function PluginSettingsPanel({
|
|
|
8396
8723
|
}
|
|
8397
8724
|
)
|
|
8398
8725
|
] }),
|
|
8399
|
-
/* @__PURE__ */ (0,
|
|
8726
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8400
8727
|
Button,
|
|
8401
8728
|
{
|
|
8402
8729
|
type: "button",
|
|
@@ -8409,11 +8736,11 @@ function PluginSettingsPanel({
|
|
|
8409
8736
|
if (socialLinkRows.length <= 1) setSocialLinkRows([{ ...EMPTY_SOCIAL_ROW }]);
|
|
8410
8737
|
else setSocialLinkRows(socialLinkRows.filter((_, j) => j !== i));
|
|
8411
8738
|
},
|
|
8412
|
-
children: /* @__PURE__ */ (0,
|
|
8739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.X, { className: "h-4 w-4" })
|
|
8413
8740
|
}
|
|
8414
8741
|
)
|
|
8415
8742
|
] }, i)),
|
|
8416
|
-
/* @__PURE__ */ (0,
|
|
8743
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8417
8744
|
Button,
|
|
8418
8745
|
{
|
|
8419
8746
|
type: "button",
|
|
@@ -8422,15 +8749,15 @@ function PluginSettingsPanel({
|
|
|
8422
8749
|
className: "mt-1",
|
|
8423
8750
|
onClick: () => setSocialLinkRows([...socialLinkRows, { ...EMPTY_SOCIAL_ROW }]),
|
|
8424
8751
|
children: [
|
|
8425
|
-
/* @__PURE__ */ (0,
|
|
8752
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Plus, { className: "mr-1 h-4 w-4" }),
|
|
8426
8753
|
"Add link"
|
|
8427
8754
|
]
|
|
8428
8755
|
}
|
|
8429
8756
|
)
|
|
8430
8757
|
] }),
|
|
8431
|
-
/* @__PURE__ */ (0,
|
|
8432
|
-
/* @__PURE__ */ (0,
|
|
8433
|
-
/* @__PURE__ */ (0,
|
|
8758
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8759
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-footerDisclaimer`, className: "text-sm", children: "Footer disclaimer" }),
|
|
8760
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8434
8761
|
Textarea,
|
|
8435
8762
|
{
|
|
8436
8763
|
id: `${settingsGroup}-footerDisclaimer`,
|
|
@@ -8441,106 +8768,318 @@ function PluginSettingsPanel({
|
|
|
8441
8768
|
}
|
|
8442
8769
|
)
|
|
8443
8770
|
] }),
|
|
8444
|
-
/* @__PURE__ */ (0,
|
|
8771
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { size: "sm", onClick: handleSave, disabled: saving, children: saving ? "Saving\u2026" : "Save" })
|
|
8445
8772
|
] });
|
|
8446
8773
|
}
|
|
8447
|
-
|
|
8448
|
-
/* @__PURE__ */ (0,
|
|
8449
|
-
/* @__PURE__ */ (0,
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "space-y-1", children: [
|
|
8453
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
|
|
8454
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8455
|
-
Input,
|
|
8456
|
-
{
|
|
8457
|
-
id: `${settingsGroup}-botName`,
|
|
8458
|
-
value: botName,
|
|
8459
|
-
onChange: (e) => setBotName(e.target.value),
|
|
8460
|
-
placeholder: "e.g. Support Bot",
|
|
8461
|
-
className: "h-8 text-sm"
|
|
8462
|
-
}
|
|
8463
|
-
)
|
|
8464
|
-
] }),
|
|
8465
|
-
isLlm ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
8466
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "space-y-1", children: [
|
|
8467
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
|
|
8468
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8469
|
-
Input,
|
|
8470
|
-
{
|
|
8471
|
-
id: `${settingsGroup}-iconImageUrl`,
|
|
8472
|
-
value: iconImageUrl,
|
|
8473
|
-
onChange: (e) => setIconImageUrl(e.target.value),
|
|
8474
|
-
placeholder: "https://\u2026 or /images/chat-icon.png",
|
|
8475
|
-
className: "h-8 text-sm"
|
|
8476
|
-
}
|
|
8477
|
-
),
|
|
8478
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "PNG or image URL. Leave empty to use emoji below." })
|
|
8774
|
+
if (isSms) {
|
|
8775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8776
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
8778
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
8479
8779
|
] }),
|
|
8480
|
-
/* @__PURE__ */ (0,
|
|
8481
|
-
/* @__PURE__ */ (0,
|
|
8482
|
-
/* @__PURE__ */ (0,
|
|
8483
|
-
|
|
8780
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8781
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-smsProvider`, className: "text-sm", children: "Active provider" }),
|
|
8782
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8783
|
+
Select,
|
|
8484
8784
|
{
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8785
|
+
value: smsProviderChoice,
|
|
8786
|
+
onValueChange: (v) => setSmsProviderChoice(v),
|
|
8787
|
+
children: [
|
|
8788
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { id: `${settingsGroup}-smsProvider`, className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Select provider" }) }),
|
|
8789
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
8790
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "auto", children: "Auto (MSG91 \u2192 Twilio \u2192 webhook, first with credentials)" }),
|
|
8791
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "msg91", children: "MSG91 (India)" }),
|
|
8792
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "twilio", children: "Twilio" }),
|
|
8793
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "webhook", children: "HTTP webhook" })
|
|
8794
|
+
] })
|
|
8795
|
+
]
|
|
8490
8796
|
}
|
|
8491
8797
|
)
|
|
8492
8798
|
] }),
|
|
8493
|
-
/* @__PURE__ */ (0,
|
|
8494
|
-
/* @__PURE__ */ (0,
|
|
8495
|
-
|
|
8496
|
-
/* @__PURE__ */ (0,
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
id: `${settingsGroup}-iconBg`,
|
|
8502
|
-
value: iconBackgroundColor,
|
|
8503
|
-
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
8504
|
-
className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
|
|
8505
|
-
}
|
|
8506
|
-
),
|
|
8507
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8508
|
-
Input,
|
|
8509
|
-
{
|
|
8510
|
-
value: iconBackgroundColor,
|
|
8511
|
-
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
8512
|
-
className: "h-8 w-24 text-sm font-mono"
|
|
8513
|
-
}
|
|
8514
|
-
)
|
|
8799
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-msg91ApiMode`, className: "text-sm", children: "MSG91 API mode" }),
|
|
8801
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Select, { value: msg91ApiMode, onValueChange: (v) => setMsg91ApiMode(v), children: [
|
|
8802
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { id: `${settingsGroup}-msg91ApiMode`, className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, {}) }),
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "auto", children: "Auto (Flow if template ID + auth key; else sendhttp)" }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "flow", children: "Flow API (DLT template_id; recommended for India)" }),
|
|
8806
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "sendhttp", children: "Legacy sendhttp (needs sender ID; not for arbitrary India text)" })
|
|
8515
8807
|
] })
|
|
8808
|
+
] })
|
|
8809
|
+
] }),
|
|
8810
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-3 rounded-md border border-gray-200 dark:border-gray-600 p-3", children: [
|
|
8811
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-white", children: "SMS templates" }),
|
|
8812
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
8813
|
+
"Defaults come from code; overrides and DLT / Flow IDs are stored here. Use ",
|
|
8814
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "{{code}}" }),
|
|
8815
|
+
" in the message body for the OTP."
|
|
8516
8816
|
] }),
|
|
8517
|
-
/* @__PURE__ */ (0,
|
|
8518
|
-
/* @__PURE__ */ (0,
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
"
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8817
|
+
smsTplItems.map((t) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2 border-t border-gray-100 pt-3 first:border-t-0 first:pt-0 dark:border-gray-700", children: [
|
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
8819
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
8820
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-sm font-medium", children: t.name }),
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-[11px] font-mono text-gray-500", children: t.templateKey })
|
|
8822
|
+
] }),
|
|
8823
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8824
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-tpl-${t.templateKey}-enabled`, className: "text-xs text-gray-600 dark:text-gray-400", children: "Apply custom body / Flow id" }),
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8826
|
+
Switch,
|
|
8827
|
+
{
|
|
8828
|
+
id: `${settingsGroup}-tpl-${t.templateKey}-enabled`,
|
|
8829
|
+
checked: t.enabled,
|
|
8830
|
+
onCheckedChange: (v) => setSmsTplItems(
|
|
8831
|
+
(items) => items.map((x) => x.templateKey === t.templateKey ? { ...x, enabled: v } : x)
|
|
8832
|
+
)
|
|
8833
|
+
}
|
|
8834
|
+
)
|
|
8835
|
+
] })
|
|
8836
|
+
] }),
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-[11px] text-gray-500", children: [
|
|
8838
|
+
"Default: ",
|
|
8839
|
+
t.defaultBody
|
|
8840
|
+
] }),
|
|
8841
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs", children: "Message body" }),
|
|
8843
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8844
|
+
Textarea,
|
|
8532
8845
|
{
|
|
8533
|
-
value:
|
|
8534
|
-
onChange: (e) =>
|
|
8535
|
-
|
|
8846
|
+
value: t.body,
|
|
8847
|
+
onChange: (e) => setSmsTplItems(
|
|
8848
|
+
(items) => items.map((x) => x.templateKey === t.templateKey ? { ...x, body: e.target.value } : x)
|
|
8849
|
+
),
|
|
8850
|
+
rows: 2,
|
|
8851
|
+
className: "text-sm"
|
|
8536
8852
|
}
|
|
8537
8853
|
)
|
|
8854
|
+
] }),
|
|
8855
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
8856
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8857
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs", children: "External template ref (e.g. MSG91 Flow / DLT id)" }),
|
|
8858
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8859
|
+
Input,
|
|
8860
|
+
{
|
|
8861
|
+
value: t.externalTemplateRef,
|
|
8862
|
+
onChange: (e) => setSmsTplItems(
|
|
8863
|
+
(items) => items.map(
|
|
8864
|
+
(x) => x.templateKey === t.templateKey ? { ...x, externalTemplateRef: e.target.value } : x
|
|
8865
|
+
)
|
|
8866
|
+
),
|
|
8867
|
+
placeholder: "From MSG91 after DLT mapping",
|
|
8868
|
+
className: "h-8 text-sm"
|
|
8869
|
+
}
|
|
8870
|
+
)
|
|
8871
|
+
] }),
|
|
8872
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8873
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs", children: "OTP variable key (Flow recipient field)" }),
|
|
8874
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8875
|
+
Input,
|
|
8876
|
+
{
|
|
8877
|
+
value: t.otpVarKey,
|
|
8878
|
+
onChange: (e) => setSmsTplItems(
|
|
8879
|
+
(items) => items.map(
|
|
8880
|
+
(x) => x.templateKey === t.templateKey ? { ...x, otpVarKey: e.target.value } : x
|
|
8881
|
+
)
|
|
8882
|
+
),
|
|
8883
|
+
className: "h-8 text-sm font-mono",
|
|
8884
|
+
placeholder: "var1"
|
|
8885
|
+
}
|
|
8886
|
+
)
|
|
8887
|
+
] })
|
|
8888
|
+
] })
|
|
8889
|
+
] }, t.templateKey))
|
|
8890
|
+
] }),
|
|
8891
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
8892
|
+
"Server env: ",
|
|
8893
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_AUTH_KEY" }),
|
|
8894
|
+
"; optional global fallback ",
|
|
8895
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_TEMPLATE_ID" }),
|
|
8896
|
+
",",
|
|
8897
|
+
" ",
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_OTP_VAR_KEY" }),
|
|
8899
|
+
"; sendhttp: ",
|
|
8900
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_SENDER_ID" }),
|
|
8901
|
+
",",
|
|
8902
|
+
" ",
|
|
8903
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_ROUTE" }),
|
|
8904
|
+
". Or ",
|
|
8905
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "TWILIO_*" }),
|
|
8906
|
+
", ",
|
|
8907
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "SMS_WEBHOOK_URL" }),
|
|
8908
|
+
".",
|
|
8909
|
+
" ",
|
|
8910
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "SMS_PROVIDER" }),
|
|
8911
|
+
" matches the provider dropdown."
|
|
8912
|
+
] }),
|
|
8913
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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." }),
|
|
8914
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
8915
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
8916
|
+
"Save"
|
|
8917
|
+
] })
|
|
8918
|
+
] });
|
|
8919
|
+
}
|
|
8920
|
+
if (isLlm) {
|
|
8921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8922
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8923
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
8924
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
8925
|
+
] }),
|
|
8926
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8927
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-chatMode`, className: "text-sm", children: "Support channel" }),
|
|
8928
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Select, { value: chatMode, onValueChange: (v) => setChatMode(v), children: [
|
|
8929
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { id: `${settingsGroup}-chatMode`, className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Select channel" }) }),
|
|
8930
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
8931
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "whatsapp", children: "WhatsApp" }),
|
|
8932
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "external", children: "External (script)" }),
|
|
8933
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "llm", children: "Infuro Chat Assistant" })
|
|
8538
8934
|
] })
|
|
8539
8935
|
] })
|
|
8936
|
+
] }),
|
|
8937
|
+
chatMode === "whatsapp" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8938
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-whatsappPhone`, className: "text-sm", children: "Phone number" }),
|
|
8939
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8940
|
+
Input,
|
|
8941
|
+
{
|
|
8942
|
+
id: `${settingsGroup}-whatsappPhone`,
|
|
8943
|
+
value: whatsappPhone,
|
|
8944
|
+
onChange: (e) => setWhatsappPhone(e.target.value),
|
|
8945
|
+
placeholder: "e.g. +1 555 123 4567",
|
|
8946
|
+
className: "h-8 text-sm"
|
|
8947
|
+
}
|
|
8948
|
+
),
|
|
8949
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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." })
|
|
8950
|
+
] }),
|
|
8951
|
+
chatMode === "external" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8952
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-externalSnippet`, className: "text-sm", children: "Embed script" }),
|
|
8953
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8954
|
+
Textarea,
|
|
8955
|
+
{
|
|
8956
|
+
id: `${settingsGroup}-externalSnippet`,
|
|
8957
|
+
value: externalChatSnippet,
|
|
8958
|
+
onChange: (e) => setExternalChatSnippet(e.target.value),
|
|
8959
|
+
rows: 8,
|
|
8960
|
+
placeholder: "Paste third-party widget HTML / script tags\u2026",
|
|
8961
|
+
className: "text-sm font-mono"
|
|
8962
|
+
}
|
|
8963
|
+
),
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Only paste code from sources you trust." })
|
|
8965
|
+
] }),
|
|
8966
|
+
chatMode === "llm" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
8967
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8968
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
|
|
8969
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8970
|
+
Input,
|
|
8971
|
+
{
|
|
8972
|
+
id: `${settingsGroup}-botName`,
|
|
8973
|
+
value: botName,
|
|
8974
|
+
onChange: (e) => setBotName(e.target.value),
|
|
8975
|
+
placeholder: "e.g. Support Bot",
|
|
8976
|
+
className: "h-8 text-sm"
|
|
8977
|
+
}
|
|
8978
|
+
)
|
|
8979
|
+
] }),
|
|
8980
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8981
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
|
|
8982
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8983
|
+
Input,
|
|
8984
|
+
{
|
|
8985
|
+
id: `${settingsGroup}-iconImageUrl`,
|
|
8986
|
+
value: iconImageUrl,
|
|
8987
|
+
onChange: (e) => setIconImageUrl(e.target.value),
|
|
8988
|
+
placeholder: "https://\u2026 or /images/chat-icon.png",
|
|
8989
|
+
className: "h-8 text-sm"
|
|
8990
|
+
}
|
|
8991
|
+
),
|
|
8992
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "PNG or image URL. Leave empty to use emoji below." })
|
|
8993
|
+
] }),
|
|
8994
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8995
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon fallback (emoji)" }),
|
|
8996
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8997
|
+
Input,
|
|
8998
|
+
{
|
|
8999
|
+
id: `${settingsGroup}-icon`,
|
|
9000
|
+
value: icon,
|
|
9001
|
+
onChange: (e) => setIcon(e.target.value),
|
|
9002
|
+
placeholder: "e.g. \u{1F4AC}",
|
|
9003
|
+
className: "h-8 text-sm w-20"
|
|
9004
|
+
}
|
|
9005
|
+
)
|
|
9006
|
+
] }),
|
|
9007
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex gap-4", children: [
|
|
9008
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9009
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-iconBg`, className: "text-sm", children: "Icon background" }),
|
|
9010
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9011
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9012
|
+
"input",
|
|
9013
|
+
{
|
|
9014
|
+
type: "color",
|
|
9015
|
+
id: `${settingsGroup}-iconBg`,
|
|
9016
|
+
value: iconBackgroundColor,
|
|
9017
|
+
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
9018
|
+
className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
|
|
9019
|
+
}
|
|
9020
|
+
),
|
|
9021
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9022
|
+
Input,
|
|
9023
|
+
{
|
|
9024
|
+
value: iconBackgroundColor,
|
|
9025
|
+
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
9026
|
+
className: "h-8 w-24 text-sm font-mono"
|
|
9027
|
+
}
|
|
9028
|
+
)
|
|
9029
|
+
] })
|
|
9030
|
+
] }),
|
|
9031
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9032
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-headerColor`, className: "text-sm", children: "Header color" }),
|
|
9033
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9034
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9035
|
+
"input",
|
|
9036
|
+
{
|
|
9037
|
+
type: "color",
|
|
9038
|
+
id: `${settingsGroup}-headerColor`,
|
|
9039
|
+
value: headerColor,
|
|
9040
|
+
onChange: (e) => setHeaderColor(e.target.value),
|
|
9041
|
+
className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
|
|
9042
|
+
}
|
|
9043
|
+
),
|
|
9044
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9045
|
+
Input,
|
|
9046
|
+
{
|
|
9047
|
+
value: headerColor,
|
|
9048
|
+
onChange: (e) => setHeaderColor(e.target.value),
|
|
9049
|
+
className: "h-8 w-24 text-sm font-mono"
|
|
9050
|
+
}
|
|
9051
|
+
)
|
|
9052
|
+
] })
|
|
9053
|
+
] })
|
|
9054
|
+
] })
|
|
9055
|
+
] }),
|
|
9056
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
9057
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
9058
|
+
"Save"
|
|
8540
9059
|
] })
|
|
8541
|
-
] })
|
|
8542
|
-
|
|
8543
|
-
|
|
9060
|
+
] });
|
|
9061
|
+
}
|
|
9062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
9063
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
9064
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
9065
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
9066
|
+
] }),
|
|
9067
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9068
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
|
|
9069
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9070
|
+
Input,
|
|
9071
|
+
{
|
|
9072
|
+
id: `${settingsGroup}-botName`,
|
|
9073
|
+
value: botName,
|
|
9074
|
+
onChange: (e) => setBotName(e.target.value),
|
|
9075
|
+
placeholder: "e.g. Support Bot",
|
|
9076
|
+
className: "h-8 text-sm"
|
|
9077
|
+
}
|
|
9078
|
+
)
|
|
9079
|
+
] }),
|
|
9080
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9081
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon (emoji or name)" }),
|
|
9082
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8544
9083
|
Input,
|
|
8545
9084
|
{
|
|
8546
9085
|
id: `${settingsGroup}-icon`,
|
|
@@ -8551,8 +9090,8 @@ function PluginSettingsPanel({
|
|
|
8551
9090
|
}
|
|
8552
9091
|
)
|
|
8553
9092
|
] }),
|
|
8554
|
-
/* @__PURE__ */ (0,
|
|
8555
|
-
/* @__PURE__ */ (0,
|
|
9093
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
9094
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
8556
9095
|
"Save"
|
|
8557
9096
|
] })
|
|
8558
9097
|
] });
|
|
@@ -8563,28 +9102,28 @@ function PluginListItem({
|
|
|
8563
9102
|
selected,
|
|
8564
9103
|
onSelect
|
|
8565
9104
|
}) {
|
|
8566
|
-
return /* @__PURE__ */ (0,
|
|
9105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8567
9106
|
"button",
|
|
8568
9107
|
{
|
|
8569
9108
|
type: "button",
|
|
8570
9109
|
onClick: onSelect,
|
|
8571
9110
|
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"}`,
|
|
8572
9111
|
children: [
|
|
8573
|
-
/* @__PURE__ */ (0,
|
|
8574
|
-
/* @__PURE__ */ (0,
|
|
8575
|
-
/* @__PURE__ */ (0,
|
|
8576
|
-
/* @__PURE__ */ (0,
|
|
8577
|
-
/* @__PURE__ */ (0,
|
|
9112
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PluginIcon, { descriptor, size: "sm" }),
|
|
9113
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: descriptor.label || descriptor.name }),
|
|
9115
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
9116
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8578
9117
|
"span",
|
|
8579
9118
|
{
|
|
8580
9119
|
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"}`,
|
|
8581
9120
|
children: [
|
|
8582
|
-
enabled ? /* @__PURE__ */ (0,
|
|
9121
|
+
enabled ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.CheckCircle2, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.XCircle, { className: "h-3 w-3" }),
|
|
8583
9122
|
enabled ? "On" : "Off"
|
|
8584
9123
|
]
|
|
8585
9124
|
}
|
|
8586
9125
|
),
|
|
8587
|
-
/* @__PURE__ */ (0,
|
|
9126
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: [
|
|
8588
9127
|
"v",
|
|
8589
9128
|
descriptor.version
|
|
8590
9129
|
] })
|
|
@@ -8616,16 +9155,16 @@ function PluginsPage() {
|
|
|
8616
9155
|
).catch(() => {
|
|
8617
9156
|
});
|
|
8618
9157
|
};
|
|
8619
|
-
return /* @__PURE__ */ (0,
|
|
8620
|
-
/* @__PURE__ */ (0,
|
|
8621
|
-
/* @__PURE__ */ (0,
|
|
8622
|
-
/* @__PURE__ */ (0,
|
|
9158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
|
|
9159
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("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: [
|
|
9160
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h1", { className: "text-base font-semibold text-white", children: "Plugins" }),
|
|
9161
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-300 mt-0.5", children: "Registered plugins and their status" })
|
|
8623
9162
|
] }),
|
|
8624
|
-
/* @__PURE__ */ (0,
|
|
8625
|
-
/* @__PURE__ */ (0,
|
|
8626
|
-
/* @__PURE__ */ (0,
|
|
8627
|
-
] }) : /* @__PURE__ */ (0,
|
|
8628
|
-
/* @__PURE__ */ (0,
|
|
9163
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "min-w-0 p-6", children: pluginDescriptors.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "py-12 text-center", children: [
|
|
9164
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Puzzle, { className: "mx-auto h-10 w-10 text-gray-400" }),
|
|
9165
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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." })
|
|
9166
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex gap-6", children: [
|
|
9167
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-56 shrink-0 space-y-1", children: pluginDescriptors.map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8629
9168
|
PluginListItem,
|
|
8630
9169
|
{
|
|
8631
9170
|
descriptor: p,
|
|
@@ -8635,24 +9174,24 @@ function PluginsPage() {
|
|
|
8635
9174
|
},
|
|
8636
9175
|
p.name
|
|
8637
9176
|
)) }),
|
|
8638
|
-
/* @__PURE__ */ (0,
|
|
8639
|
-
/* @__PURE__ */ (0,
|
|
8640
|
-
/* @__PURE__ */ (0,
|
|
8641
|
-
] }) : /* @__PURE__ */ (0,
|
|
8642
|
-
/* @__PURE__ */ (0,
|
|
9177
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "min-w-0 flex-1", children: !selectedName ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
9178
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Puzzle, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
|
|
9179
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a plugin to view or edit its configuration." })
|
|
9180
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("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__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
9181
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-4", children: [
|
|
8643
9182
|
selectedDescriptor.label || selectedDescriptor.name,
|
|
8644
9183
|
" \u2014 Configuration"
|
|
8645
9184
|
] }),
|
|
8646
|
-
/* @__PURE__ */ (0,
|
|
9185
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8647
9186
|
PluginSettingsPanel,
|
|
8648
9187
|
{
|
|
8649
9188
|
descriptor: selectedDescriptor,
|
|
8650
9189
|
onSaved: () => refreshEnabled(selectedDescriptor.name)
|
|
8651
9190
|
}
|
|
8652
9191
|
)
|
|
8653
|
-
] }) : /* @__PURE__ */ (0,
|
|
8654
|
-
/* @__PURE__ */ (0,
|
|
8655
|
-
/* @__PURE__ */ (0,
|
|
9192
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
9193
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Puzzle, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
|
|
9194
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No configuration available for this plugin." })
|
|
8656
9195
|
] }) }) })
|
|
8657
9196
|
] }) })
|
|
8658
9197
|
] });
|
|
@@ -8661,48 +9200,48 @@ function PluginsPage() {
|
|
|
8661
9200
|
// src/admin/pages/BrandEditPage.tsx
|
|
8662
9201
|
var import_react41 = require("react");
|
|
8663
9202
|
var import_navigation16 = require("next/navigation");
|
|
8664
|
-
var
|
|
9203
|
+
var import_lucide_react33 = require("lucide-react");
|
|
8665
9204
|
|
|
8666
9205
|
// src/components/Admin/SeoSection.tsx
|
|
8667
|
-
var
|
|
9206
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8668
9207
|
function SeoSection({
|
|
8669
9208
|
values,
|
|
8670
9209
|
onChange
|
|
8671
9210
|
}) {
|
|
8672
9211
|
const inputCls3 = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm h-8";
|
|
8673
9212
|
const textareaCls = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm min-h-[60px]";
|
|
8674
|
-
return /* @__PURE__ */ (0,
|
|
8675
|
-
/* @__PURE__ */ (0,
|
|
8676
|
-
/* @__PURE__ */ (0,
|
|
8677
|
-
/* @__PURE__ */ (0,
|
|
8678
|
-
/* @__PURE__ */ (0,
|
|
8679
|
-
/* @__PURE__ */ (0,
|
|
9213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "border-t border-gray-200 pt-2", children: [
|
|
9214
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: "SEO" }),
|
|
9215
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "space-y-3", children: [
|
|
9216
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9217
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Title" }),
|
|
9218
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "text", value: values.seoTitle, onChange: (e) => onChange("seoTitle", e.target.value), className: inputCls3 })
|
|
8680
9219
|
] }),
|
|
8681
|
-
/* @__PURE__ */ (0,
|
|
8682
|
-
/* @__PURE__ */ (0,
|
|
8683
|
-
/* @__PURE__ */ (0,
|
|
9220
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9221
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Description" }),
|
|
9222
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("textarea", { value: values.seoDescription, onChange: (e) => onChange("seoDescription", e.target.value), className: textareaCls, rows: 2 })
|
|
8684
9223
|
] }),
|
|
8685
|
-
/* @__PURE__ */ (0,
|
|
8686
|
-
/* @__PURE__ */ (0,
|
|
8687
|
-
/* @__PURE__ */ (0,
|
|
9224
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Keywords" }),
|
|
9226
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "text", value: values.seoKeywords, onChange: (e) => onChange("seoKeywords", e.target.value), placeholder: "keyword1, keyword2", className: inputCls3 })
|
|
8688
9227
|
] }),
|
|
8689
|
-
/* @__PURE__ */ (0,
|
|
8690
|
-
/* @__PURE__ */ (0,
|
|
8691
|
-
/* @__PURE__ */ (0,
|
|
9228
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Title" }),
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "text", value: values.seoOgTitle, onChange: (e) => onChange("seoOgTitle", e.target.value), className: inputCls3 })
|
|
8692
9231
|
] }),
|
|
8693
|
-
/* @__PURE__ */ (0,
|
|
8694
|
-
/* @__PURE__ */ (0,
|
|
8695
|
-
/* @__PURE__ */ (0,
|
|
9232
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9233
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Description" }),
|
|
9234
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("textarea", { value: values.seoOgDescription, onChange: (e) => onChange("seoOgDescription", e.target.value), className: textareaCls, rows: 2 })
|
|
8696
9235
|
] }),
|
|
8697
|
-
/* @__PURE__ */ (0,
|
|
8698
|
-
/* @__PURE__ */ (0,
|
|
8699
|
-
/* @__PURE__ */ (0,
|
|
9236
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9237
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Image" }),
|
|
9238
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "url", value: values.seoOgImage, onChange: (e) => onChange("seoOgImage", e.target.value), placeholder: "https://...", className: inputCls3 })
|
|
8700
9239
|
] })
|
|
8701
9240
|
] })
|
|
8702
9241
|
] });
|
|
8703
9242
|
}
|
|
8704
9243
|
async function saveSeo(seo, slug, existingSeoId) {
|
|
8705
|
-
const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords;
|
|
9244
|
+
const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords || seo.seoOgTitle || seo.seoOgDescription || seo.seoOgImage;
|
|
8706
9245
|
if (!hasSeo) return existingSeoId;
|
|
8707
9246
|
const payload = {
|
|
8708
9247
|
title: seo.seoTitle || null,
|
|
@@ -8752,7 +9291,7 @@ async function fetchSeo(seoId) {
|
|
|
8752
9291
|
}
|
|
8753
9292
|
|
|
8754
9293
|
// src/admin/pages/BrandEditPage.tsx
|
|
8755
|
-
var
|
|
9294
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8756
9295
|
var isCreate = (id) => id === "create";
|
|
8757
9296
|
function BrandEditPage({ brandId }) {
|
|
8758
9297
|
const router = (0, import_navigation16.useRouter)();
|
|
@@ -8838,10 +9377,10 @@ function BrandEditPage({ brandId }) {
|
|
|
8838
9377
|
}
|
|
8839
9378
|
};
|
|
8840
9379
|
if (loading) {
|
|
8841
|
-
return /* @__PURE__ */ (0,
|
|
9380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-gray-500", children: "Loading..." }) });
|
|
8842
9381
|
}
|
|
8843
|
-
return /* @__PURE__ */ (0,
|
|
8844
|
-
/* @__PURE__ */ (0,
|
|
9382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "rounded-lg bg-white shadow-md", children: [
|
|
9383
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8845
9384
|
DetailPageHeader,
|
|
8846
9385
|
{
|
|
8847
9386
|
title: create ? "Add Brand" : "Edit Brand",
|
|
@@ -8853,23 +9392,23 @@ function BrandEditPage({ brandId }) {
|
|
|
8853
9392
|
]
|
|
8854
9393
|
}
|
|
8855
9394
|
),
|
|
8856
|
-
errors.length > 0 && /* @__PURE__ */ (0,
|
|
8857
|
-
/* @__PURE__ */ (0,
|
|
8858
|
-
/* @__PURE__ */ (0,
|
|
8859
|
-
/* @__PURE__ */ (0,
|
|
8860
|
-
/* @__PURE__ */ (0,
|
|
9395
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex", children: [
|
|
9396
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react33.AlertCircle, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
|
|
9397
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ml-3", children: [
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
|
|
9399
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: e }, i)) })
|
|
8861
9400
|
] })
|
|
8862
9401
|
] }) }),
|
|
8863
|
-
/* @__PURE__ */ (0,
|
|
9402
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8864
9403
|
DetailPageLayout,
|
|
8865
9404
|
{
|
|
8866
|
-
main: /* @__PURE__ */ (0,
|
|
8867
|
-
/* @__PURE__ */ (0,
|
|
8868
|
-
/* @__PURE__ */ (0,
|
|
8869
|
-
/* @__PURE__ */ (0,
|
|
8870
|
-
/* @__PURE__ */ (0,
|
|
8871
|
-
/* @__PURE__ */ (0,
|
|
8872
|
-
/* @__PURE__ */ (0,
|
|
9405
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
9406
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { children: [
|
|
9407
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
|
|
9408
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50 space-y-4", children: [
|
|
9409
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Name *" }),
|
|
9411
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8873
9412
|
"input",
|
|
8874
9413
|
{
|
|
8875
9414
|
type: "text",
|
|
@@ -8880,9 +9419,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8880
9419
|
}
|
|
8881
9420
|
)
|
|
8882
9421
|
] }),
|
|
8883
|
-
/* @__PURE__ */ (0,
|
|
8884
|
-
/* @__PURE__ */ (0,
|
|
8885
|
-
/* @__PURE__ */ (0,
|
|
9422
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9423
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Slug *" }),
|
|
9424
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8886
9425
|
"input",
|
|
8887
9426
|
{
|
|
8888
9427
|
type: "text",
|
|
@@ -8893,9 +9432,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8893
9432
|
}
|
|
8894
9433
|
)
|
|
8895
9434
|
] }),
|
|
8896
|
-
/* @__PURE__ */ (0,
|
|
8897
|
-
/* @__PURE__ */ (0,
|
|
8898
|
-
/* @__PURE__ */ (0,
|
|
9435
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9436
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Description" }),
|
|
9437
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8899
9438
|
"textarea",
|
|
8900
9439
|
{
|
|
8901
9440
|
value: description,
|
|
@@ -8905,9 +9444,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8905
9444
|
}
|
|
8906
9445
|
)
|
|
8907
9446
|
] }),
|
|
8908
|
-
/* @__PURE__ */ (0,
|
|
8909
|
-
/* @__PURE__ */ (0,
|
|
8910
|
-
/* @__PURE__ */ (0,
|
|
9447
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9448
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Logo URL" }),
|
|
9449
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8911
9450
|
"input",
|
|
8912
9451
|
{
|
|
8913
9452
|
type: "url",
|
|
@@ -8917,9 +9456,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8917
9456
|
}
|
|
8918
9457
|
)
|
|
8919
9458
|
] }),
|
|
8920
|
-
/* @__PURE__ */ (0,
|
|
8921
|
-
/* @__PURE__ */ (0,
|
|
8922
|
-
/* @__PURE__ */ (0,
|
|
9459
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9460
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Sort order" }),
|
|
9461
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8923
9462
|
"input",
|
|
8924
9463
|
{
|
|
8925
9464
|
type: "number",
|
|
@@ -8931,15 +9470,15 @@ function BrandEditPage({ brandId }) {
|
|
|
8931
9470
|
] })
|
|
8932
9471
|
] })
|
|
8933
9472
|
] }),
|
|
8934
|
-
/* @__PURE__ */ (0,
|
|
8935
|
-
/* @__PURE__ */ (0,
|
|
8936
|
-
/* @__PURE__ */ (0,
|
|
9473
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { children: [
|
|
9474
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
|
|
8937
9476
|
] })
|
|
8938
9477
|
] }),
|
|
8939
|
-
sidebar: /* @__PURE__ */ (0,
|
|
8940
|
-
/* @__PURE__ */ (0,
|
|
8941
|
-
/* @__PURE__ */ (0,
|
|
8942
|
-
/* @__PURE__ */ (0,
|
|
9478
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { children: [
|
|
9479
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
|
|
9480
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
9481
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8943
9482
|
"input",
|
|
8944
9483
|
{
|
|
8945
9484
|
type: "checkbox",
|
|
@@ -8948,7 +9487,7 @@ function BrandEditPage({ brandId }) {
|
|
|
8948
9487
|
className: "h-4 w-4 rounded border-gray-300"
|
|
8949
9488
|
}
|
|
8950
9489
|
),
|
|
8951
|
-
/* @__PURE__ */ (0,
|
|
9490
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
|
|
8952
9491
|
] }) })
|
|
8953
9492
|
] }) })
|
|
8954
9493
|
}
|
|
@@ -8959,11 +9498,11 @@ function BrandEditPage({ brandId }) {
|
|
|
8959
9498
|
// src/admin/pages/ProductEditPage.tsx
|
|
8960
9499
|
var import_react43 = require("react");
|
|
8961
9500
|
var import_navigation17 = require("next/navigation");
|
|
8962
|
-
var
|
|
9501
|
+
var import_lucide_react34 = require("lucide-react");
|
|
8963
9502
|
|
|
8964
9503
|
// src/components/Admin/AttributeFacetNameInput.tsx
|
|
8965
9504
|
var import_react42 = require("react");
|
|
8966
|
-
var
|
|
9505
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8967
9506
|
function slugFromName(name) {
|
|
8968
9507
|
const s = name.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
8969
9508
|
return s || "attribute";
|
|
@@ -9031,8 +9570,8 @@ function AttributeFacetNameInput({
|
|
|
9031
9570
|
}
|
|
9032
9571
|
};
|
|
9033
9572
|
const exactMatch = list.some((x) => x.name.toLowerCase() === draft.trim().toLowerCase());
|
|
9034
|
-
return /* @__PURE__ */ (0,
|
|
9035
|
-
/* @__PURE__ */ (0,
|
|
9573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
9574
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9036
9575
|
"input",
|
|
9037
9576
|
{
|
|
9038
9577
|
type: "text",
|
|
@@ -9063,8 +9602,8 @@ function AttributeFacetNameInput({
|
|
|
9063
9602
|
className: inputClassName
|
|
9064
9603
|
}
|
|
9065
9604
|
),
|
|
9066
|
-
open && (list.length > 0 || draft.trim() && !exactMatch) && /* @__PURE__ */ (0,
|
|
9067
|
-
list.map((a) => /* @__PURE__ */ (0,
|
|
9605
|
+
open && (list.length > 0 || draft.trim() && !exactMatch) && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("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: [
|
|
9606
|
+
list.map((a) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9068
9607
|
"li",
|
|
9069
9608
|
{
|
|
9070
9609
|
onMouseDown: (e) => {
|
|
@@ -9076,7 +9615,7 @@ function AttributeFacetNameInput({
|
|
|
9076
9615
|
},
|
|
9077
9616
|
a.id
|
|
9078
9617
|
)),
|
|
9079
|
-
draft.trim() && !exactMatch && /* @__PURE__ */ (0,
|
|
9618
|
+
draft.trim() && !exactMatch && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
9080
9619
|
"li",
|
|
9081
9620
|
{
|
|
9082
9621
|
onMouseDown: (e) => {
|
|
@@ -9096,7 +9635,7 @@ function AttributeFacetNameInput({
|
|
|
9096
9635
|
}
|
|
9097
9636
|
|
|
9098
9637
|
// src/admin/pages/ProductEditPage.tsx
|
|
9099
|
-
var
|
|
9638
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
9100
9639
|
var isCreate2 = (id) => id === "create";
|
|
9101
9640
|
var sectionCls = "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50";
|
|
9102
9641
|
var labelCls = "block text-xs font-medium text-gray-600 mb-1";
|
|
@@ -9139,6 +9678,7 @@ function ProductEditPage({ productId }) {
|
|
|
9139
9678
|
const [brands, setBrands] = (0, import_react43.useState)([]);
|
|
9140
9679
|
const [categories, setCategories] = (0, import_react43.useState)([]);
|
|
9141
9680
|
const [name, setName] = (0, import_react43.useState)("");
|
|
9681
|
+
const [productSlug, setProductSlug] = (0, import_react43.useState)("");
|
|
9142
9682
|
const [sku, setSku] = (0, import_react43.useState)("");
|
|
9143
9683
|
const [hsn, setHsn] = (0, import_react43.useState)("");
|
|
9144
9684
|
const [collectionId, setCollectionId] = (0, import_react43.useState)(null);
|
|
@@ -9191,7 +9731,10 @@ function ProductEditPage({ productId }) {
|
|
|
9191
9731
|
if (Array.isArray(d.data)) attrList = d.data;
|
|
9192
9732
|
}
|
|
9193
9733
|
if (create) {
|
|
9194
|
-
if (!cancelled)
|
|
9734
|
+
if (!cancelled) {
|
|
9735
|
+
setProductSlug("");
|
|
9736
|
+
setLoading(false);
|
|
9737
|
+
}
|
|
9195
9738
|
return;
|
|
9196
9739
|
}
|
|
9197
9740
|
const res = await fetch(`/api/products/${productId}`);
|
|
@@ -9199,6 +9742,7 @@ function ProductEditPage({ productId }) {
|
|
|
9199
9742
|
const product = await res.json();
|
|
9200
9743
|
if (cancelled) return;
|
|
9201
9744
|
setName(product.name ?? "");
|
|
9745
|
+
setProductSlug(typeof product.slug === "string" ? product.slug : "");
|
|
9202
9746
|
setSku(product.sku ?? "");
|
|
9203
9747
|
setHsn(product.hsn ?? "");
|
|
9204
9748
|
setCollectionId(product.collectionId ?? null);
|
|
@@ -9254,6 +9798,12 @@ function ProductEditPage({ productId }) {
|
|
|
9254
9798
|
cancelled = true;
|
|
9255
9799
|
};
|
|
9256
9800
|
}, [productId, create]);
|
|
9801
|
+
(0, import_react43.useEffect)(() => {
|
|
9802
|
+
if (!create || !name.trim() || productSlug.trim()) return;
|
|
9803
|
+
setProductSlug(
|
|
9804
|
+
name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "")
|
|
9805
|
+
);
|
|
9806
|
+
}, [create, name, productSlug]);
|
|
9257
9807
|
const handleSave = async () => {
|
|
9258
9808
|
setErrors([]);
|
|
9259
9809
|
if (!name.trim()) {
|
|
@@ -9266,7 +9816,8 @@ function ProductEditPage({ productId }) {
|
|
|
9266
9816
|
}
|
|
9267
9817
|
setSaving(true);
|
|
9268
9818
|
try {
|
|
9269
|
-
const
|
|
9819
|
+
const seoSlug = productSlug.trim() || name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
9820
|
+
const savedSeoId = await saveSeo(seo, seoSlug, seoId);
|
|
9270
9821
|
const metadata = buildProductMetadata(otherMetadata, { description, images, specifications });
|
|
9271
9822
|
const productPayload = {
|
|
9272
9823
|
name: name.trim(),
|
|
@@ -9294,6 +9845,9 @@ function ProductEditPage({ productId }) {
|
|
|
9294
9845
|
return;
|
|
9295
9846
|
}
|
|
9296
9847
|
const savedProduct = await res.json();
|
|
9848
|
+
if (typeof savedProduct.slug === "string") {
|
|
9849
|
+
setProductSlug(savedProduct.slug);
|
|
9850
|
+
}
|
|
9297
9851
|
const savedId = create ? savedProduct.id : productId;
|
|
9298
9852
|
const slugify = (n) => n.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "attribute";
|
|
9299
9853
|
async function ensureAttributeId(attrName) {
|
|
@@ -9383,10 +9937,10 @@ function ProductEditPage({ productId }) {
|
|
|
9383
9937
|
const removeFacet = (i) => setFacetRows((prev) => prev.length <= 1 ? prev : prev.filter((_, j) => j !== i));
|
|
9384
9938
|
const setFacet = (i, field, value) => setFacetRows((prev) => prev.map((row, j) => j === i ? { ...row, [field]: value } : row));
|
|
9385
9939
|
if (loading) {
|
|
9386
|
-
return /* @__PURE__ */ (0,
|
|
9940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-gray-500", children: "Loading..." }) });
|
|
9387
9941
|
}
|
|
9388
|
-
return /* @__PURE__ */ (0,
|
|
9389
|
-
/* @__PURE__ */ (0,
|
|
9942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "rounded-lg bg-white shadow-md", children: [
|
|
9943
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9390
9944
|
DetailPageHeader,
|
|
9391
9945
|
{
|
|
9392
9946
|
title: create ? "Add Product" : "Edit Product",
|
|
@@ -9398,90 +9952,90 @@ function ProductEditPage({ productId }) {
|
|
|
9398
9952
|
]
|
|
9399
9953
|
}
|
|
9400
9954
|
),
|
|
9401
|
-
errors.length > 0 && /* @__PURE__ */ (0,
|
|
9402
|
-
/* @__PURE__ */ (0,
|
|
9403
|
-
/* @__PURE__ */ (0,
|
|
9404
|
-
/* @__PURE__ */ (0,
|
|
9405
|
-
/* @__PURE__ */ (0,
|
|
9955
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex", children: [
|
|
9956
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.AlertCircle, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
|
|
9957
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ml-3", children: [
|
|
9958
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
|
|
9959
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("li", { children: e }, i)) })
|
|
9406
9960
|
] })
|
|
9407
9961
|
] }) }),
|
|
9408
|
-
/* @__PURE__ */ (0,
|
|
9962
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9409
9963
|
DetailPageLayout,
|
|
9410
9964
|
{
|
|
9411
|
-
main: /* @__PURE__ */ (0,
|
|
9412
|
-
/* @__PURE__ */ (0,
|
|
9413
|
-
/* @__PURE__ */ (0,
|
|
9414
|
-
/* @__PURE__ */ (0,
|
|
9415
|
-
/* @__PURE__ */ (0,
|
|
9416
|
-
/* @__PURE__ */ (0,
|
|
9417
|
-
/* @__PURE__ */ (0,
|
|
9965
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
9966
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
9967
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Product details" }),
|
|
9968
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-4`, children: [
|
|
9969
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9970
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Name *" }),
|
|
9971
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls, required: true })
|
|
9418
9972
|
] }),
|
|
9419
|
-
/* @__PURE__ */ (0,
|
|
9420
|
-
/* @__PURE__ */ (0,
|
|
9421
|
-
/* @__PURE__ */ (0,
|
|
9422
|
-
/* @__PURE__ */ (0,
|
|
9973
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
9974
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9975
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "SKU" }),
|
|
9976
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "text", value: sku, onChange: (e) => setSku(e.target.value), className: inputCls })
|
|
9423
9977
|
] }),
|
|
9424
|
-
/* @__PURE__ */ (0,
|
|
9425
|
-
/* @__PURE__ */ (0,
|
|
9426
|
-
/* @__PURE__ */ (0,
|
|
9978
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9979
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "HSN" }),
|
|
9980
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls })
|
|
9427
9981
|
] })
|
|
9428
9982
|
] }),
|
|
9429
|
-
/* @__PURE__ */ (0,
|
|
9430
|
-
/* @__PURE__ */ (0,
|
|
9431
|
-
/* @__PURE__ */ (0,
|
|
9432
|
-
/* @__PURE__ */ (0,
|
|
9433
|
-
/* @__PURE__ */ (0,
|
|
9434
|
-
brands.map((b) => /* @__PURE__ */ (0,
|
|
9983
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
9984
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9985
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Brand" }),
|
|
9986
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
|
|
9987
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "", children: "None" }),
|
|
9988
|
+
brands.map((b) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: b.id, children: b.name }, b.id))
|
|
9435
9989
|
] })
|
|
9436
9990
|
] }),
|
|
9437
|
-
/* @__PURE__ */ (0,
|
|
9438
|
-
/* @__PURE__ */ (0,
|
|
9439
|
-
/* @__PURE__ */ (0,
|
|
9440
|
-
/* @__PURE__ */ (0,
|
|
9441
|
-
categories.map((c) => /* @__PURE__ */ (0,
|
|
9991
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9992
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Category" }),
|
|
9993
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
|
|
9994
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "", children: "None" }),
|
|
9995
|
+
categories.map((c) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: c.id, children: c.name }, c.id))
|
|
9442
9996
|
] })
|
|
9443
9997
|
] })
|
|
9444
9998
|
] }),
|
|
9445
|
-
/* @__PURE__ */ (0,
|
|
9446
|
-
/* @__PURE__ */ (0,
|
|
9447
|
-
/* @__PURE__ */ (0,
|
|
9448
|
-
/* @__PURE__ */ (0,
|
|
9449
|
-
collections.map((c) => /* @__PURE__ */ (0,
|
|
9999
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10000
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Collection" }),
|
|
10001
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: collectionId ?? "", onChange: (e) => setCollectionId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
|
|
10002
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "", children: "None" }),
|
|
10003
|
+
collections.map((c) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: c.id, children: c.name }, c.id))
|
|
9450
10004
|
] })
|
|
9451
10005
|
] }),
|
|
9452
|
-
/* @__PURE__ */ (0,
|
|
9453
|
-
/* @__PURE__ */ (0,
|
|
9454
|
-
/* @__PURE__ */ (0,
|
|
9455
|
-
/* @__PURE__ */ (0,
|
|
10006
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10007
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10008
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Price *" }),
|
|
10009
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "number", value: price, onChange: (e) => setPrice(e.target.value), className: inputCls, required: true })
|
|
9456
10010
|
] }),
|
|
9457
|
-
/* @__PURE__ */ (0,
|
|
9458
|
-
/* @__PURE__ */ (0,
|
|
9459
|
-
/* @__PURE__ */ (0,
|
|
10011
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10012
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Compare at price" }),
|
|
10013
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "number", value: compareAtPrice, onChange: (e) => setCompareAtPrice(e.target.value), className: inputCls })
|
|
9460
10014
|
] })
|
|
9461
10015
|
] }),
|
|
9462
|
-
/* @__PURE__ */ (0,
|
|
9463
|
-
/* @__PURE__ */ (0,
|
|
9464
|
-
/* @__PURE__ */ (0,
|
|
9465
|
-
/* @__PURE__ */ (0,
|
|
10016
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10017
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10018
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Quantity" }),
|
|
10019
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "number", value: quantity, onChange: (e) => setQuantity(Number(e.target.value) || 0), className: inputCls })
|
|
9466
10020
|
] }),
|
|
9467
|
-
/* @__PURE__ */ (0,
|
|
9468
|
-
/* @__PURE__ */ (0,
|
|
9469
|
-
/* @__PURE__ */ (0,
|
|
9470
|
-
/* @__PURE__ */ (0,
|
|
9471
|
-
/* @__PURE__ */ (0,
|
|
9472
|
-
/* @__PURE__ */ (0,
|
|
9473
|
-
/* @__PURE__ */ (0,
|
|
10021
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10022
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Status" }),
|
|
10023
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: status, onChange: (e) => setStatus(e.target.value), className: inputCls, children: [
|
|
10024
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "draft", children: "Draft" }),
|
|
10025
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "available", children: "Available" }),
|
|
10026
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "reserved", children: "Reserved" }),
|
|
10027
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "sold", children: "Sold" })
|
|
9474
10028
|
] })
|
|
9475
10029
|
] })
|
|
9476
10030
|
] })
|
|
9477
10031
|
] })
|
|
9478
10032
|
] }),
|
|
9479
|
-
/* @__PURE__ */ (0,
|
|
9480
|
-
/* @__PURE__ */ (0,
|
|
9481
|
-
/* @__PURE__ */ (0,
|
|
9482
|
-
/* @__PURE__ */ (0,
|
|
9483
|
-
facetRows.map((row, i) => /* @__PURE__ */ (0,
|
|
9484
|
-
/* @__PURE__ */ (0,
|
|
10033
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10034
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Attributes (facets)" }),
|
|
10035
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs text-gray-500 mb-2", children: "Search existing attributes or create new ones (like blog categories). Value on the right." }),
|
|
10036
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-2`, children: [
|
|
10037
|
+
facetRows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2 items-start", children: [
|
|
10038
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9485
10039
|
AttributeFacetNameInput,
|
|
9486
10040
|
{
|
|
9487
10041
|
value: row.name,
|
|
@@ -9489,7 +10043,7 @@ function ProductEditPage({ productId }) {
|
|
|
9489
10043
|
inputClassName: inputCls
|
|
9490
10044
|
}
|
|
9491
10045
|
),
|
|
9492
|
-
/* @__PURE__ */ (0,
|
|
10046
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9493
10047
|
"input",
|
|
9494
10048
|
{
|
|
9495
10049
|
type: "text",
|
|
@@ -9499,21 +10053,21 @@ function ProductEditPage({ productId }) {
|
|
|
9499
10053
|
className: `${inputCls} flex-1 min-w-[120px]`
|
|
9500
10054
|
}
|
|
9501
10055
|
),
|
|
9502
|
-
/* @__PURE__ */ (0,
|
|
10056
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { type: "button", onClick: () => removeFacet(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0 mt-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Trash2, { className: "h-4 w-4" }) })
|
|
9503
10057
|
] }, i)),
|
|
9504
|
-
/* @__PURE__ */ (0,
|
|
9505
|
-
/* @__PURE__ */ (0,
|
|
10058
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("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: [
|
|
10059
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Plus, { className: "h-3.5 w-3.5" }),
|
|
9506
10060
|
" Add attribute"
|
|
9507
10061
|
] })
|
|
9508
10062
|
] })
|
|
9509
10063
|
] }),
|
|
9510
|
-
/* @__PURE__ */ (0,
|
|
9511
|
-
/* @__PURE__ */ (0,
|
|
9512
|
-
/* @__PURE__ */ (0,
|
|
9513
|
-
images.map((row, i) => /* @__PURE__ */ (0,
|
|
9514
|
-
/* @__PURE__ */ (0,
|
|
9515
|
-
/* @__PURE__ */ (0,
|
|
9516
|
-
/* @__PURE__ */ (0,
|
|
10064
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10065
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Media" }),
|
|
10066
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-3`, children: [
|
|
10067
|
+
images.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-wrap items-start gap-2 p-2 bg-white rounded border border-gray-200", children: [
|
|
10068
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 min-w-[200px]", children: [
|
|
10069
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Image URL" }),
|
|
10070
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9517
10071
|
"input",
|
|
9518
10072
|
{
|
|
9519
10073
|
type: "url",
|
|
@@ -9524,9 +10078,9 @@ function ProductEditPage({ productId }) {
|
|
|
9524
10078
|
}
|
|
9525
10079
|
)
|
|
9526
10080
|
] }),
|
|
9527
|
-
/* @__PURE__ */ (0,
|
|
9528
|
-
/* @__PURE__ */ (0,
|
|
9529
|
-
/* @__PURE__ */ (0,
|
|
10081
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 min-w-[120px]", children: [
|
|
10082
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Alt text" }),
|
|
10083
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9530
10084
|
"input",
|
|
9531
10085
|
{
|
|
9532
10086
|
type: "text",
|
|
@@ -9536,27 +10090,27 @@ function ProductEditPage({ productId }) {
|
|
|
9536
10090
|
}
|
|
9537
10091
|
)
|
|
9538
10092
|
] }),
|
|
9539
|
-
/* @__PURE__ */ (0,
|
|
10093
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9540
10094
|
"button",
|
|
9541
10095
|
{
|
|
9542
10096
|
type: "button",
|
|
9543
10097
|
onClick: () => setDefaultImage(i),
|
|
9544
10098
|
title: "Set as default",
|
|
9545
10099
|
className: "mt-6 p-2 rounded border border-gray-300 hover:bg-gray-100",
|
|
9546
|
-
children: /* @__PURE__ */ (0,
|
|
10100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Star, { className: `h-4 w-4 ${row.isDefault ? "fill-amber-400 text-amber-500" : "text-gray-400"}` })
|
|
9547
10101
|
}
|
|
9548
10102
|
),
|
|
9549
|
-
/* @__PURE__ */ (0,
|
|
10103
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { type: "button", onClick: () => removeImage(i), className: "mt-6 p-2 text-gray-400 hover:text-red-600 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Trash2, { className: "h-4 w-4" }) })
|
|
9550
10104
|
] }, i)),
|
|
9551
|
-
/* @__PURE__ */ (0,
|
|
9552
|
-
/* @__PURE__ */ (0,
|
|
10105
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("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: [
|
|
10106
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Plus, { className: "h-3.5 w-3.5" }),
|
|
9553
10107
|
" Add image"
|
|
9554
10108
|
] })
|
|
9555
10109
|
] })
|
|
9556
10110
|
] }),
|
|
9557
|
-
/* @__PURE__ */ (0,
|
|
9558
|
-
/* @__PURE__ */ (0,
|
|
9559
|
-
/* @__PURE__ */ (0,
|
|
10111
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10112
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Description" }),
|
|
10113
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: sectionCls, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9560
10114
|
"textarea",
|
|
9561
10115
|
{
|
|
9562
10116
|
value: description,
|
|
@@ -9567,11 +10121,11 @@ function ProductEditPage({ productId }) {
|
|
|
9567
10121
|
}
|
|
9568
10122
|
) })
|
|
9569
10123
|
] }),
|
|
9570
|
-
/* @__PURE__ */ (0,
|
|
9571
|
-
/* @__PURE__ */ (0,
|
|
9572
|
-
/* @__PURE__ */ (0,
|
|
9573
|
-
specifications.map((row, i) => /* @__PURE__ */ (0,
|
|
9574
|
-
/* @__PURE__ */ (0,
|
|
10124
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10125
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Specifications" }),
|
|
10126
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-2`, children: [
|
|
10127
|
+
specifications.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2", children: [
|
|
10128
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9575
10129
|
"input",
|
|
9576
10130
|
{
|
|
9577
10131
|
type: "text",
|
|
@@ -9581,7 +10135,7 @@ function ProductEditPage({ productId }) {
|
|
|
9581
10135
|
className: `${inputCls} flex-1`
|
|
9582
10136
|
}
|
|
9583
10137
|
),
|
|
9584
|
-
/* @__PURE__ */ (0,
|
|
10138
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9585
10139
|
"input",
|
|
9586
10140
|
{
|
|
9587
10141
|
type: "text",
|
|
@@ -9591,18 +10145,18 @@ function ProductEditPage({ productId }) {
|
|
|
9591
10145
|
className: `${inputCls} flex-1`
|
|
9592
10146
|
}
|
|
9593
10147
|
),
|
|
9594
|
-
/* @__PURE__ */ (0,
|
|
10148
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { type: "button", onClick: () => removeSpec(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Trash2, { className: "h-4 w-4" }) })
|
|
9595
10149
|
] }, i)),
|
|
9596
|
-
/* @__PURE__ */ (0,
|
|
9597
|
-
/* @__PURE__ */ (0,
|
|
10150
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("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: [
|
|
10151
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Plus, { className: "h-3.5 w-3.5" }),
|
|
9598
10152
|
" Add row"
|
|
9599
10153
|
] })
|
|
9600
10154
|
] })
|
|
9601
10155
|
] })
|
|
9602
10156
|
] }),
|
|
9603
|
-
sidebar: /* @__PURE__ */ (0,
|
|
9604
|
-
/* @__PURE__ */ (0,
|
|
9605
|
-
/* @__PURE__ */ (0,
|
|
10157
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10158
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
|
|
10159
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: sectionCls, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
|
|
9606
10160
|
] })
|
|
9607
10161
|
}
|
|
9608
10162
|
)
|
|
@@ -9612,8 +10166,8 @@ function ProductEditPage({ productId }) {
|
|
|
9612
10166
|
// src/admin/pages/CollectionEditPage.tsx
|
|
9613
10167
|
var import_react44 = require("react");
|
|
9614
10168
|
var import_navigation18 = require("next/navigation");
|
|
9615
|
-
var
|
|
9616
|
-
var
|
|
10169
|
+
var import_lucide_react35 = require("lucide-react");
|
|
10170
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
9617
10171
|
var isCreate3 = (id) => id === "create";
|
|
9618
10172
|
var emptySlide = () => ({ url: "", type: "image", caption: "" });
|
|
9619
10173
|
var emptyVariant = () => ({ name: "", price: "", extraSpecs: [] });
|
|
@@ -9814,10 +10368,10 @@ function CollectionEditPage({ collectionId }) {
|
|
|
9814
10368
|
(v) => v.map((x, j) => j === variantIdx ? { ...x, extraSpecs: x.extraSpecs.filter((_, s) => s !== specIdx) } : x)
|
|
9815
10369
|
);
|
|
9816
10370
|
if (loading) {
|
|
9817
|
-
return /* @__PURE__ */ (0,
|
|
10371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-gray-500", children: "Loading..." }) });
|
|
9818
10372
|
}
|
|
9819
|
-
return /* @__PURE__ */ (0,
|
|
9820
|
-
/* @__PURE__ */ (0,
|
|
10373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "rounded-lg bg-white shadow-md", children: [
|
|
10374
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9821
10375
|
DetailPageHeader,
|
|
9822
10376
|
{
|
|
9823
10377
|
title: create ? "Add Collection" : "Edit Collection",
|
|
@@ -9829,137 +10383,137 @@ function CollectionEditPage({ collectionId }) {
|
|
|
9829
10383
|
]
|
|
9830
10384
|
}
|
|
9831
10385
|
),
|
|
9832
|
-
errors.length > 0 && /* @__PURE__ */ (0,
|
|
9833
|
-
/* @__PURE__ */ (0,
|
|
9834
|
-
/* @__PURE__ */ (0,
|
|
9835
|
-
/* @__PURE__ */ (0,
|
|
9836
|
-
/* @__PURE__ */ (0,
|
|
10386
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex", children: [
|
|
10387
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.AlertCircle, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
|
|
10388
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ml-3", children: [
|
|
10389
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
|
|
10390
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("li", { children: e }, i)) })
|
|
9837
10391
|
] })
|
|
9838
10392
|
] }) }),
|
|
9839
|
-
/* @__PURE__ */ (0,
|
|
10393
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9840
10394
|
DetailPageLayout,
|
|
9841
10395
|
{
|
|
9842
|
-
main: /* @__PURE__ */ (0,
|
|
9843
|
-
/* @__PURE__ */ (0,
|
|
9844
|
-
/* @__PURE__ */ (0,
|
|
9845
|
-
/* @__PURE__ */ (0,
|
|
9846
|
-
/* @__PURE__ */ (0,
|
|
9847
|
-
/* @__PURE__ */ (0,
|
|
9848
|
-
/* @__PURE__ */ (0,
|
|
10396
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
10397
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10398
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
|
|
10399
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: `${sectionCls2} space-y-4`, children: [
|
|
10400
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10401
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Name *" }),
|
|
10402
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls2, required: true })
|
|
9849
10403
|
] }),
|
|
9850
|
-
/* @__PURE__ */ (0,
|
|
9851
|
-
/* @__PURE__ */ (0,
|
|
9852
|
-
/* @__PURE__ */ (0,
|
|
10404
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10405
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Slug *" }),
|
|
10406
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: slug, onChange: (e) => setSlug(e.target.value), className: inputCls2, required: true })
|
|
9853
10407
|
] }),
|
|
9854
|
-
/* @__PURE__ */ (0,
|
|
9855
|
-
/* @__PURE__ */ (0,
|
|
9856
|
-
/* @__PURE__ */ (0,
|
|
10408
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10409
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "HSN" }),
|
|
10410
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls2 })
|
|
9857
10411
|
] }),
|
|
9858
|
-
/* @__PURE__ */ (0,
|
|
9859
|
-
/* @__PURE__ */ (0,
|
|
9860
|
-
/* @__PURE__ */ (0,
|
|
9861
|
-
/* @__PURE__ */ (0,
|
|
9862
|
-
/* @__PURE__ */ (0,
|
|
9863
|
-
categories.map((c) => /* @__PURE__ */ (0,
|
|
10412
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10413
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10414
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Category" }),
|
|
10415
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
|
|
10416
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "", children: "None" }),
|
|
10417
|
+
categories.map((c) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: c.id, children: c.name }, c.id))
|
|
9864
10418
|
] })
|
|
9865
10419
|
] }),
|
|
9866
|
-
/* @__PURE__ */ (0,
|
|
9867
|
-
/* @__PURE__ */ (0,
|
|
9868
|
-
/* @__PURE__ */ (0,
|
|
9869
|
-
/* @__PURE__ */ (0,
|
|
9870
|
-
brands.map((b) => /* @__PURE__ */ (0,
|
|
10420
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10421
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Brand" }),
|
|
10422
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
|
|
10423
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "", children: "None" }),
|
|
10424
|
+
brands.map((b) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: b.id, children: b.name }, b.id))
|
|
9871
10425
|
] })
|
|
9872
10426
|
] })
|
|
9873
10427
|
] }),
|
|
9874
|
-
/* @__PURE__ */ (0,
|
|
9875
|
-
/* @__PURE__ */ (0,
|
|
9876
|
-
/* @__PURE__ */ (0,
|
|
10428
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10429
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Description" }),
|
|
10430
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("textarea", { value: description, onChange: (e) => setDescription(e.target.value), className: `${inputCls2} min-h-[80px]`, rows: 3 })
|
|
9877
10431
|
] }),
|
|
9878
|
-
/* @__PURE__ */ (0,
|
|
9879
|
-
/* @__PURE__ */ (0,
|
|
9880
|
-
/* @__PURE__ */ (0,
|
|
10432
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10433
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Cover image URL" }),
|
|
10434
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "url", value: image, onChange: (e) => setImage(e.target.value), className: inputCls2, placeholder: "https://..." })
|
|
9881
10435
|
] }),
|
|
9882
|
-
/* @__PURE__ */ (0,
|
|
9883
|
-
/* @__PURE__ */ (0,
|
|
9884
|
-
/* @__PURE__ */ (0,
|
|
10436
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10437
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Sort order" }),
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "number", value: sortOrder, onChange: (e) => setSortOrder(Number(e.target.value) || 0), className: inputCls2, style: { width: "6rem" } })
|
|
9885
10439
|
] })
|
|
9886
10440
|
] })
|
|
9887
10441
|
] }),
|
|
9888
|
-
/* @__PURE__ */ (0,
|
|
9889
|
-
/* @__PURE__ */ (0,
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10443
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
9890
10444
|
"button",
|
|
9891
10445
|
{
|
|
9892
10446
|
type: "button",
|
|
9893
10447
|
onClick: () => setAdvancedOpen((o) => !o),
|
|
9894
10448
|
className: "flex items-center gap-2 w-full text-left text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2",
|
|
9895
10449
|
children: [
|
|
9896
|
-
advancedOpen ? /* @__PURE__ */ (0,
|
|
10450
|
+
advancedOpen ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.ChevronDown, { className: "h-4 w-4" }),
|
|
9897
10451
|
"Advanced page content"
|
|
9898
10452
|
]
|
|
9899
10453
|
}
|
|
9900
10454
|
),
|
|
9901
|
-
advancedOpen && /* @__PURE__ */ (0,
|
|
9902
|
-
/* @__PURE__ */ (0,
|
|
9903
|
-
/* @__PURE__ */ (0,
|
|
9904
|
-
heroSlides.map((slide, i) => /* @__PURE__ */ (0,
|
|
9905
|
-
/* @__PURE__ */ (0,
|
|
9906
|
-
/* @__PURE__ */ (0,
|
|
9907
|
-
/* @__PURE__ */ (0,
|
|
9908
|
-
/* @__PURE__ */ (0,
|
|
10455
|
+
advancedOpen && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "space-y-4", children: [
|
|
10456
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10457
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Hero carousel" }),
|
|
10458
|
+
heroSlides.map((slide, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-wrap gap-2 mb-3 p-2 bg-white rounded border", children: [
|
|
10459
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "url", value: slide.url, onChange: (e) => updateHeroSlide(i, "url", e.target.value), placeholder: "Media URL", className: `${inputCls2} flex-1 min-w-[200px]` }),
|
|
10460
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("select", { value: slide.type, onChange: (e) => updateHeroSlide(i, "type", e.target.value), className: `${inputCls2} w-24`, children: [
|
|
10461
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "image", children: "Image" }),
|
|
10462
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "video", children: "Video" })
|
|
9909
10463
|
] }),
|
|
9910
|
-
/* @__PURE__ */ (0,
|
|
9911
|
-
/* @__PURE__ */ (0,
|
|
10464
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: slide.caption, onChange: (e) => updateHeroSlide(i, "caption", e.target.value), placeholder: "Caption", className: `${inputCls2} flex-1 min-w-[120px]` }),
|
|
10465
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", onClick: () => removeHeroSlide(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Trash2, { className: "h-4 w-4" }) })
|
|
9912
10466
|
] }, i)),
|
|
9913
|
-
/* @__PURE__ */ (0,
|
|
9914
|
-
/* @__PURE__ */ (0,
|
|
10467
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("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: [
|
|
10468
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Plus, { className: "h-3.5 w-3.5" }),
|
|
9915
10469
|
" Add slide"
|
|
9916
10470
|
] })
|
|
9917
10471
|
] }),
|
|
9918
|
-
/* @__PURE__ */ (0,
|
|
9919
|
-
/* @__PURE__ */ (0,
|
|
9920
|
-
variants.map((v, i) => /* @__PURE__ */ (0,
|
|
9921
|
-
/* @__PURE__ */ (0,
|
|
9922
|
-
/* @__PURE__ */ (0,
|
|
9923
|
-
/* @__PURE__ */ (0,
|
|
9924
|
-
/* @__PURE__ */ (0,
|
|
10472
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10473
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Variants" }),
|
|
10474
|
+
variants.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "mb-4 p-3 bg-white rounded border space-y-2", children: [
|
|
10475
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex gap-2", children: [
|
|
10476
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: v.name, onChange: (e) => updateVariant(i, "name", e.target.value), placeholder: "Name", className: `${inputCls2} w-40` }),
|
|
10477
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "number", value: v.price, onChange: (e) => updateVariant(i, "price", e.target.value), placeholder: "Price", className: `${inputCls2} w-28` }),
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", onClick: () => removeVariant(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Trash2, { className: "h-4 w-4" }) })
|
|
9925
10479
|
] }),
|
|
9926
|
-
v.extraSpecs.map((s, si) => /* @__PURE__ */ (0,
|
|
9927
|
-
/* @__PURE__ */ (0,
|
|
9928
|
-
/* @__PURE__ */ (0,
|
|
9929
|
-
/* @__PURE__ */ (0,
|
|
10480
|
+
v.extraSpecs.map((s, si) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex gap-2", children: [
|
|
10481
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: s.key, onChange: (e) => updateVariantExtraSpec(i, si, "key", e.target.value), placeholder: "Key", className: `${inputCls2} flex-1` }),
|
|
10482
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: s.value, onChange: (e) => updateVariantExtraSpec(i, si, "value", e.target.value), placeholder: "Value", className: `${inputCls2} flex-1` }),
|
|
10483
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", onClick: () => removeVariantExtraSpec(i, si), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Trash2, { className: "h-4 w-4" }) })
|
|
9930
10484
|
] }, si)),
|
|
9931
|
-
/* @__PURE__ */ (0,
|
|
9932
|
-
/* @__PURE__ */ (0,
|
|
10485
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("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: [
|
|
10486
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Plus, { className: "h-3 w-3" }),
|
|
9933
10487
|
" Add spec"
|
|
9934
10488
|
] })
|
|
9935
10489
|
] }, i)),
|
|
9936
|
-
/* @__PURE__ */ (0,
|
|
9937
|
-
/* @__PURE__ */ (0,
|
|
10490
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("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: [
|
|
10491
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Plus, { className: "h-3.5 w-3.5" }),
|
|
9938
10492
|
" Add variant"
|
|
9939
10493
|
] })
|
|
9940
10494
|
] }),
|
|
9941
|
-
/* @__PURE__ */ (0,
|
|
9942
|
-
/* @__PURE__ */ (0,
|
|
9943
|
-
/* @__PURE__ */ (0,
|
|
10495
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10496
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Experience description" }),
|
|
10497
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("textarea", { value: experienceDescription, onChange: (e) => setExperienceDescription(e.target.value), className: `${inputCls2} min-h-[60px]`, rows: 2, placeholder: "Optional" })
|
|
9944
10498
|
] }),
|
|
9945
|
-
/* @__PURE__ */ (0,
|
|
9946
|
-
/* @__PURE__ */ (0,
|
|
9947
|
-
/* @__PURE__ */ (0,
|
|
10499
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10500
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Brochure URL" }),
|
|
10501
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "url", value: brochureUrl, onChange: (e) => setBrochureUrl(e.target.value), className: inputCls2, placeholder: "https://..." })
|
|
9948
10502
|
] })
|
|
9949
10503
|
] })
|
|
9950
10504
|
] })
|
|
9951
10505
|
] }),
|
|
9952
|
-
sidebar: /* @__PURE__ */ (0,
|
|
9953
|
-
/* @__PURE__ */ (0,
|
|
9954
|
-
/* @__PURE__ */ (0,
|
|
9955
|
-
/* @__PURE__ */ (0,
|
|
9956
|
-
/* @__PURE__ */ (0,
|
|
9957
|
-
/* @__PURE__ */ (0,
|
|
10506
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
10507
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10508
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
|
|
10509
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: sectionCls2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
10510
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "checkbox", checked: active, onChange: (e) => setActive(e.target.checked), className: "h-4 w-4 rounded border-gray-300" }),
|
|
10511
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
|
|
9958
10512
|
] }) })
|
|
9959
10513
|
] }),
|
|
9960
|
-
/* @__PURE__ */ (0,
|
|
9961
|
-
/* @__PURE__ */ (0,
|
|
9962
|
-
/* @__PURE__ */ (0,
|
|
10514
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10515
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
|
|
10516
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: sectionCls2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
|
|
9963
10517
|
] })
|
|
9964
10518
|
] })
|
|
9965
10519
|
}
|
|
@@ -9970,7 +10524,7 @@ function CollectionEditPage({ collectionId }) {
|
|
|
9970
10524
|
// src/admin/pages/RolesPage.tsx
|
|
9971
10525
|
var import_react45 = require("react");
|
|
9972
10526
|
var import_react46 = require("next-auth/react");
|
|
9973
|
-
var
|
|
10527
|
+
var import_lucide_react36 = require("lucide-react");
|
|
9974
10528
|
|
|
9975
10529
|
// src/auth/permission-entities.ts
|
|
9976
10530
|
var ADMIN_GROUP_NAME = "Administrator";
|
|
@@ -9979,22 +10533,22 @@ function isSuperAdminGroupName(name) {
|
|
|
9979
10533
|
}
|
|
9980
10534
|
|
|
9981
10535
|
// src/admin/pages/RolesPage.tsx
|
|
9982
|
-
var
|
|
10536
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
9983
10537
|
function RoleListItem({
|
|
9984
10538
|
group,
|
|
9985
10539
|
selected,
|
|
9986
10540
|
onSelect
|
|
9987
10541
|
}) {
|
|
9988
10542
|
const superG = isSuperAdminGroupName(group.name);
|
|
9989
|
-
return /* @__PURE__ */ (0,
|
|
10543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
9990
10544
|
"button",
|
|
9991
10545
|
{
|
|
9992
10546
|
type: "button",
|
|
9993
10547
|
onClick: onSelect,
|
|
9994
10548
|
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"}`,
|
|
9995
10549
|
children: [
|
|
9996
|
-
/* @__PURE__ */ (0,
|
|
9997
|
-
/* @__PURE__ */ (0,
|
|
10550
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Shield, { className: "h-5 w-5 shrink-0 text-gray-500" }),
|
|
10551
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: group.name }) })
|
|
9998
10552
|
]
|
|
9999
10553
|
}
|
|
10000
10554
|
);
|
|
@@ -10128,27 +10682,27 @@ function RolesPage() {
|
|
|
10128
10682
|
}
|
|
10129
10683
|
};
|
|
10130
10684
|
if (status === "loading" || loading) {
|
|
10131
|
-
return /* @__PURE__ */ (0,
|
|
10685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center justify-center py-12 text-gray-600", children: "Loading\u2026" });
|
|
10132
10686
|
}
|
|
10133
10687
|
if (!canManage) {
|
|
10134
|
-
return /* @__PURE__ */ (0,
|
|
10688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-gray-600 p-6", children: "You do not have permission to manage roles." });
|
|
10135
10689
|
}
|
|
10136
|
-
return /* @__PURE__ */ (0,
|
|
10137
|
-
/* @__PURE__ */ (0,
|
|
10138
|
-
/* @__PURE__ */ (0,
|
|
10139
|
-
/* @__PURE__ */ (0,
|
|
10690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
|
|
10691
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("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: [
|
|
10692
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("h1", { className: "text-base font-semibold text-white", children: "Roles" }),
|
|
10693
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("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)." })
|
|
10140
10694
|
] }),
|
|
10141
|
-
/* @__PURE__ */ (0,
|
|
10142
|
-
error ? /* @__PURE__ */ (0,
|
|
10143
|
-
/* @__PURE__ */ (0,
|
|
10144
|
-
/* @__PURE__ */ (0,
|
|
10145
|
-
] }) : /* @__PURE__ */ (0,
|
|
10146
|
-
/* @__PURE__ */ (0,
|
|
10147
|
-
groups.map((g) => /* @__PURE__ */ (0,
|
|
10148
|
-
/* @__PURE__ */ (0,
|
|
10149
|
-
/* @__PURE__ */ (0,
|
|
10150
|
-
/* @__PURE__ */ (0,
|
|
10151
|
-
/* @__PURE__ */ (0,
|
|
10695
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "min-w-0 p-6", children: [
|
|
10696
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "py-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) }) : groups.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "py-12 text-center", children: [
|
|
10697
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Shield, { className: "mx-auto h-10 w-10 text-gray-400" }),
|
|
10698
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No roles yet. Add one below." })
|
|
10699
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex gap-6", children: [
|
|
10700
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "w-56 shrink-0 space-y-1", children: [
|
|
10701
|
+
groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(RoleListItem, { group: g, selected: selectedId === g.id, onSelect: () => setSelectedId(g.id) }, g.id)),
|
|
10702
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "space-y-2 border-t border-gray-200 pt-3 dark:border-gray-700", children: [
|
|
10703
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Label3, { className: "text-xs text-gray-500", children: "New role" }),
|
|
10704
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex gap-2", children: [
|
|
10705
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10152
10706
|
Input,
|
|
10153
10707
|
{
|
|
10154
10708
|
className: "h-8 text-sm",
|
|
@@ -10158,42 +10712,42 @@ function RolesPage() {
|
|
|
10158
10712
|
onKeyDown: (e) => e.key === "Enter" && createGroup()
|
|
10159
10713
|
}
|
|
10160
10714
|
),
|
|
10161
|
-
/* @__PURE__ */ (0,
|
|
10715
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "shrink-0", onClick: createGroup, children: "Add" })
|
|
10162
10716
|
] })
|
|
10163
10717
|
] })
|
|
10164
10718
|
] }),
|
|
10165
|
-
/* @__PURE__ */ (0,
|
|
10166
|
-
/* @__PURE__ */ (0,
|
|
10167
|
-
/* @__PURE__ */ (0,
|
|
10168
|
-
] }) : /* @__PURE__ */ (0,
|
|
10169
|
-
/* @__PURE__ */ (0,
|
|
10170
|
-
/* @__PURE__ */ (0,
|
|
10719
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "min-w-0 flex-1", children: !selectedId ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
10720
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Shield, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
|
|
10721
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a role to view or edit permissions." })
|
|
10722
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "rounded-lg border border-gray-200 bg-gray-50/50 p-5 dark:border-gray-700 dark:bg-gray-800/50", children: [
|
|
10723
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [
|
|
10724
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
10171
10725
|
selected?.name,
|
|
10172
10726
|
" \u2014 Permissions"
|
|
10173
10727
|
] }),
|
|
10174
|
-
/* @__PURE__ */ (0,
|
|
10175
|
-
/* @__PURE__ */ (0,
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Button, { size: "sm", onClick: saveMatrix, disabled: saving, className: "gap-1", children: [
|
|
10729
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Save, { className: "h-3.5 w-3.5" }),
|
|
10176
10730
|
saving ? "Saving\u2026" : "Save"
|
|
10177
10731
|
] }),
|
|
10178
|
-
selected && !isSuperAdminGroupName(selected.name) && /* @__PURE__ */ (0,
|
|
10179
|
-
/* @__PURE__ */ (0,
|
|
10732
|
+
selected && !isSuperAdminGroupName(selected.name) && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Button, { size: "sm", variant: "outline", className: "gap-1 text-red-600", onClick: deleteGroup, children: [
|
|
10733
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Trash2, { className: "h-3.5 w-3.5" }),
|
|
10180
10734
|
"Delete role"
|
|
10181
10735
|
] })
|
|
10182
10736
|
] }),
|
|
10183
|
-
entities.length > 0 && /* @__PURE__ */ (0,
|
|
10184
|
-
/* @__PURE__ */ (0,
|
|
10185
|
-
/* @__PURE__ */ (0,
|
|
10186
|
-
/* @__PURE__ */ (0,
|
|
10187
|
-
/* @__PURE__ */ (0,
|
|
10188
|
-
/* @__PURE__ */ (0,
|
|
10189
|
-
/* @__PURE__ */ (0,
|
|
10737
|
+
entities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "overflow-x-auto rounded-md border border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("table", { className: "w-full text-sm", children: [
|
|
10738
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("tr", { className: "border-b bg-gray-50 dark:bg-gray-900/50", children: [
|
|
10739
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-3 text-left font-medium", children: "Resource" }),
|
|
10740
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "C" }),
|
|
10741
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "R" }),
|
|
10742
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "U" }),
|
|
10743
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "D" })
|
|
10190
10744
|
] }) }),
|
|
10191
|
-
/* @__PURE__ */ (0,
|
|
10745
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tbody", { children: entities.map((entity) => {
|
|
10192
10746
|
const row = matrix[entity];
|
|
10193
10747
|
if (!row) return null;
|
|
10194
|
-
return /* @__PURE__ */ (0,
|
|
10195
|
-
/* @__PURE__ */ (0,
|
|
10196
|
-
["canCreate", "canRead", "canUpdate", "canDelete"].map((k) => /* @__PURE__ */ (0,
|
|
10748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("tr", { className: "border-b border-gray-100 hover:bg-gray-50/50 dark:border-gray-700 dark:hover:bg-gray-800/30", children: [
|
|
10749
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { className: "p-3 font-mono text-xs", children: entity }),
|
|
10750
|
+
["canCreate", "canRead", "canUpdate", "canDelete"].map((k) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { className: "p-2 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10197
10751
|
"input",
|
|
10198
10752
|
{
|
|
10199
10753
|
type: "checkbox",
|
|
@@ -10206,9 +10760,9 @@ function RolesPage() {
|
|
|
10206
10760
|
] }) })
|
|
10207
10761
|
] }) })
|
|
10208
10762
|
] }),
|
|
10209
|
-
!error && groups.length === 0 && /* @__PURE__ */ (0,
|
|
10210
|
-
/* @__PURE__ */ (0,
|
|
10211
|
-
/* @__PURE__ */ (0,
|
|
10763
|
+
!error && groups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mt-6 flex max-w-md gap-2", children: [
|
|
10764
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Input, { placeholder: "New role name", value: newName, onChange: (e) => setNewName(e.target.value), onKeyDown: (e) => e.key === "Enter" && createGroup() }),
|
|
10765
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { type: "button", onClick: createGroup, children: "Add role" })
|
|
10212
10766
|
] })
|
|
10213
10767
|
] })
|
|
10214
10768
|
] });
|
|
@@ -10370,7 +10924,7 @@ var STORE_CRUD_CONFIGS = {
|
|
|
10370
10924
|
};
|
|
10371
10925
|
|
|
10372
10926
|
// src/admin/pages/AdminPageResolver.tsx
|
|
10373
|
-
var
|
|
10927
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10374
10928
|
var PAGE_MAP = {
|
|
10375
10929
|
dashboard: DashboardPage,
|
|
10376
10930
|
signin: SignInPage_default,
|
|
@@ -10495,12 +11049,12 @@ function BlogEditorWrapper({ blogId }) {
|
|
|
10495
11049
|
fetch(`/api/blogs/${blogId}`).then((res) => res.ok ? res.json() : null).then((data) => setBlog(data)).finally(() => setLoading(false));
|
|
10496
11050
|
}, [blogId]);
|
|
10497
11051
|
if (loading) {
|
|
10498
|
-
return /* @__PURE__ */ (0,
|
|
10499
|
-
/* @__PURE__ */ (0,
|
|
10500
|
-
/* @__PURE__ */ (0,
|
|
11052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center justify-center py-8", children: [
|
|
11053
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
|
|
11054
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ml-2", children: "Loading..." })
|
|
10501
11055
|
] });
|
|
10502
11056
|
}
|
|
10503
|
-
return /* @__PURE__ */ (0,
|
|
11057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BlogEditor, { existingBlog: blog });
|
|
10504
11058
|
}
|
|
10505
11059
|
function AdminPageResolver({ slug }) {
|
|
10506
11060
|
const router = (0, import_navigation19.useRouter)();
|
|
@@ -10512,53 +11066,53 @@ function AdminPageResolver({ slug }) {
|
|
|
10512
11066
|
}
|
|
10513
11067
|
}, [key, router]);
|
|
10514
11068
|
if (key === "layout-settings") {
|
|
10515
|
-
return /* @__PURE__ */ (0,
|
|
10516
|
-
/* @__PURE__ */ (0,
|
|
10517
|
-
/* @__PURE__ */ (0,
|
|
11069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex justify-center py-8", children: [
|
|
11070
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
|
|
11071
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ml-2", children: "Redirecting..." })
|
|
10518
11072
|
] });
|
|
10519
11073
|
}
|
|
10520
11074
|
const Page = PAGE_MAP[key];
|
|
10521
11075
|
if (Page) {
|
|
10522
|
-
return /* @__PURE__ */ (0,
|
|
11076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Page, {});
|
|
10523
11077
|
}
|
|
10524
11078
|
if (key === "form-submissions" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10525
|
-
return /* @__PURE__ */ (0,
|
|
11079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SubmissionDetailPage, { submissionId: slug[1] });
|
|
10526
11080
|
}
|
|
10527
11081
|
if (key === "orders" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10528
|
-
return /* @__PURE__ */ (0,
|
|
11082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrderDetailPage, { orderId: slug[1] });
|
|
10529
11083
|
}
|
|
10530
11084
|
if (key === "payments" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10531
|
-
return /* @__PURE__ */ (0,
|
|
11085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PaymentDetailPage, { paymentId: slug[1] });
|
|
10532
11086
|
}
|
|
10533
11087
|
if (key === "contacts" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10534
|
-
return /* @__PURE__ */ (0,
|
|
11088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ContactDetailPage, { contactId: slug[1] });
|
|
10535
11089
|
}
|
|
10536
11090
|
const crud = { ...CRUD_CONFIGS, ...STORE_CRUD_CONFIGS, ...customCrudConfigs }[key];
|
|
10537
11091
|
if (crud && slug && slug.length >= 2) {
|
|
10538
11092
|
const subPath = slug[1];
|
|
10539
11093
|
const isCreate4 = subPath === "create";
|
|
10540
11094
|
if (key === "blogs") {
|
|
10541
|
-
return /* @__PURE__ */ (0,
|
|
11095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BlogEditorWrapper, { blogId: isCreate4 ? void 0 : subPath });
|
|
10542
11096
|
}
|
|
10543
11097
|
if (key === "forms") {
|
|
10544
|
-
return /* @__PURE__ */ (0,
|
|
11098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormBuilder, { formId: isCreate4 ? void 0 : subPath });
|
|
10545
11099
|
}
|
|
10546
11100
|
if (key === "pages") {
|
|
10547
|
-
return /* @__PURE__ */ (0,
|
|
11101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PageBuilderPage, { pageId: isCreate4 ? void 0 : subPath });
|
|
10548
11102
|
}
|
|
10549
11103
|
if (key === "brands") {
|
|
10550
|
-
return /* @__PURE__ */ (0,
|
|
11104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BrandEditPage, { brandId: subPath });
|
|
10551
11105
|
}
|
|
10552
11106
|
if (key === "products") {
|
|
10553
|
-
return /* @__PURE__ */ (0,
|
|
11107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ProductEditPage, { productId: subPath });
|
|
10554
11108
|
}
|
|
10555
11109
|
if (key === "collections") {
|
|
10556
|
-
return /* @__PURE__ */ (0,
|
|
11110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CollectionEditPage, { collectionId: subPath });
|
|
10557
11111
|
}
|
|
10558
11112
|
}
|
|
10559
11113
|
if (crud) {
|
|
10560
11114
|
if (key === "media") {
|
|
10561
|
-
return /* @__PURE__ */ (0,
|
|
11115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MediaLibraryPage, {});
|
|
10562
11116
|
}
|
|
10563
11117
|
const isContactsWithStore = key === "contacts" && storeEnabled;
|
|
10564
11118
|
const columns = isContactsWithStore ? [
|
|
@@ -10570,7 +11124,7 @@ function AdminPageResolver({ slug }) {
|
|
|
10570
11124
|
() => isContactsWithStore ? { includeSummary: "1" } : void 0,
|
|
10571
11125
|
[isContactsWithStore]
|
|
10572
11126
|
);
|
|
10573
|
-
return /* @__PURE__ */ (0,
|
|
11127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10574
11128
|
AdminCRUD,
|
|
10575
11129
|
{
|
|
10576
11130
|
title: crud.title,
|
|
@@ -10585,13 +11139,13 @@ function AdminPageResolver({ slug }) {
|
|
|
10585
11139
|
}
|
|
10586
11140
|
);
|
|
10587
11141
|
}
|
|
10588
|
-
return /* @__PURE__ */ (0,
|
|
11142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center justify-center min-h-[50vh]", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-gray-500", children: "Page not found" }) });
|
|
10589
11143
|
}
|
|
10590
11144
|
|
|
10591
11145
|
// src/admin/pages/LayoutSettingsPage.tsx
|
|
10592
11146
|
var import_react48 = require("react");
|
|
10593
|
-
var
|
|
10594
|
-
var
|
|
11147
|
+
var import_lucide_react37 = require("lucide-react");
|
|
11148
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
10595
11149
|
function LayoutSettingsPage() {
|
|
10596
11150
|
const { theme } = (0, import_react48.useContext)(AdminConfigContext);
|
|
10597
11151
|
const [activeTab, setActiveTab] = (0, import_react48.useState)("navbar");
|
|
@@ -10647,29 +11201,29 @@ function LayoutSettingsPage() {
|
|
|
10647
11201
|
props: footerLayout.fields
|
|
10648
11202
|
} : null;
|
|
10649
11203
|
if (loading) {
|
|
10650
|
-
return /* @__PURE__ */ (0,
|
|
11204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }) });
|
|
10651
11205
|
}
|
|
10652
|
-
return /* @__PURE__ */ (0,
|
|
10653
|
-
/* @__PURE__ */ (0,
|
|
10654
|
-
/* @__PURE__ */ (0,
|
|
10655
|
-
/* @__PURE__ */ (0,
|
|
10656
|
-
/* @__PURE__ */ (0,
|
|
11206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "min-w-0 rounded-lg bg-white shadow-md", children: [
|
|
11207
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "bg-gray-800 px-4 py-2.5 rounded-t-lg flex items-center justify-between", children: [
|
|
11208
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { children: [
|
|
11209
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h1", { className: "text-xl font-bold text-white", children: "Layout Settings" }),
|
|
11210
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-xs text-gray-300 mt-0.5", children: "Configure your site navbar and footer" })
|
|
10657
11211
|
] }),
|
|
10658
|
-
/* @__PURE__ */ (0,
|
|
11212
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
10659
11213
|
Button,
|
|
10660
11214
|
{
|
|
10661
11215
|
onClick: handleSave,
|
|
10662
11216
|
disabled: saving,
|
|
10663
11217
|
className: "bg-white text-gray-800 hover:bg-gray-100 border-0 text-xs",
|
|
10664
11218
|
children: [
|
|
10665
|
-
/* @__PURE__ */ (0,
|
|
11219
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react37.Save, { className: "h-4 w-4 mr-2" }),
|
|
10666
11220
|
saving ? "Saving..." : "Save"
|
|
10667
11221
|
]
|
|
10668
11222
|
}
|
|
10669
11223
|
)
|
|
10670
11224
|
] }),
|
|
10671
|
-
/* @__PURE__ */ (0,
|
|
10672
|
-
/* @__PURE__ */ (0,
|
|
11225
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "border-b", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex", children: [
|
|
11226
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10673
11227
|
"button",
|
|
10674
11228
|
{
|
|
10675
11229
|
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"}`,
|
|
@@ -10677,7 +11231,7 @@ function LayoutSettingsPage() {
|
|
|
10677
11231
|
children: "Navbar"
|
|
10678
11232
|
}
|
|
10679
11233
|
),
|
|
10680
|
-
/* @__PURE__ */ (0,
|
|
11234
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10681
11235
|
"button",
|
|
10682
11236
|
{
|
|
10683
11237
|
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"}`,
|
|
@@ -10686,9 +11240,9 @@ function LayoutSettingsPage() {
|
|
|
10686
11240
|
}
|
|
10687
11241
|
)
|
|
10688
11242
|
] }) }),
|
|
10689
|
-
/* @__PURE__ */ (0,
|
|
10690
|
-
activeTab === "navbar" && /* @__PURE__ */ (0,
|
|
10691
|
-
activeTab === "footer" && footerMeta && /* @__PURE__ */ (0,
|
|
11243
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "min-w-0 p-6", children: [
|
|
11244
|
+
activeTab === "navbar" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(NavbarEditor, { config: navbarConfig, onChange: setNavbarConfig }),
|
|
11245
|
+
activeTab === "footer" && footerMeta && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10692
11246
|
ComponentSettings,
|
|
10693
11247
|
{
|
|
10694
11248
|
meta: footerMeta,
|
|
@@ -10696,7 +11250,7 @@ function LayoutSettingsPage() {
|
|
|
10696
11250
|
onChange: (name, val) => setFooterValues((prev) => ({ ...prev, [name]: val }))
|
|
10697
11251
|
}
|
|
10698
11252
|
),
|
|
10699
|
-
activeTab === "footer" && !footerMeta && /* @__PURE__ */ (0,
|
|
11253
|
+
activeTab === "footer" && !footerMeta && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-sm text-gray-500", children: "No footer configuration defined in the current theme." })
|
|
10700
11254
|
] })
|
|
10701
11255
|
] });
|
|
10702
11256
|
}
|
|
@@ -10717,11 +11271,11 @@ var DEFAULT_ADMIN_NAV = [
|
|
|
10717
11271
|
var import_react49 = require("next-auth/react");
|
|
10718
11272
|
var import_next_themes = require("next-themes");
|
|
10719
11273
|
var import_sonner7 = require("sonner");
|
|
10720
|
-
var
|
|
11274
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
10721
11275
|
function CmsProviders({ children }) {
|
|
10722
|
-
return /* @__PURE__ */ (0,
|
|
11276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react49.SessionProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_next_themes.ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: [
|
|
10723
11277
|
children,
|
|
10724
|
-
/* @__PURE__ */ (0,
|
|
11278
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_sonner7.Toaster, { position: "top-right" })
|
|
10725
11279
|
] }) });
|
|
10726
11280
|
}
|
|
10727
11281
|
// Annotate the CommonJS export names for ESM import in node:
|