create-fullstack-scaffold 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/cli/index.js +513 -122
  2. package/dist/cli/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/dist/cli/index.js +237 -94
  5. package/template/dist/cli/index.js.map +1 -1
  6. package/template/dist/client/admin.html +15 -10
  7. package/template/dist/client/assets/App-BpFUIC-5.js +114 -0
  8. package/template/dist/client/assets/{CartPage-DESSHkaG.js → CartPage-DgDZP-R5.js} +2 -2
  9. package/template/dist/client/assets/{CategoriesPage-DqLZ_Mom.js → CategoriesPage-fuYNiSmE.js} +2 -2
  10. package/template/dist/client/assets/ContentDetailPage-BvvFU1Mr.js +1 -0
  11. package/template/dist/client/assets/ContentListPage-ShPxo6WG.js +1 -0
  12. package/template/dist/client/assets/DashboardPage-C1rZzZo4.js +11 -0
  13. package/template/dist/client/assets/{DeveloperDashboardPage-Cum7zFwO.js → DeveloperDashboardPage-_WtmbVoA.js} +2 -2
  14. package/template/dist/client/assets/{EmptyState-BK7ttK8D.js → EmptyState-DEyOQjbY.js} +1 -1
  15. package/template/dist/client/assets/LoadingSpinner-BcHjaM1m.js +6 -0
  16. package/template/dist/client/assets/LoginPage-CjeQqDdO.js +1 -0
  17. package/template/dist/client/assets/LogoutOutlined-ColFAHdd.js +1 -0
  18. package/template/dist/client/assets/NotificationPage-DRkEv02s.js +1 -0
  19. package/template/dist/client/assets/OrdersPage-7I3vPWLP.js +11 -0
  20. package/template/dist/client/assets/{PluginDetailPage-Br24YS4P.js → PluginDetailPage-CWyxdVCg.js} +3 -13
  21. package/template/dist/client/assets/PluginsPage-DRgWLeJT.js +6 -0
  22. package/template/dist/client/assets/ProfilePage-2FFkaii8.js +16 -0
  23. package/template/dist/client/assets/PublishPage-DW7yvROx.js +1 -0
  24. package/template/dist/client/assets/{RegisterPage-rPFG4Sry.js → RegisterPage-Dvaf9b0e.js} +2 -2
  25. package/template/dist/client/assets/SaveOutlined-CLQ2tsSY.js +2 -0
  26. package/template/dist/client/assets/{SearchPage-DQl1U5Uy.js → SearchPage-DvnEyswS.js} +2 -2
  27. package/template/dist/client/assets/{SettingsPage-DaYE80wj.js → SettingsPage-IrU-L9Zr.js} +2 -2
  28. package/template/dist/client/assets/{StatusBadge-BJ3W2Zc7.js → StatusBadge-CG7wVqpu.js} +1 -1
  29. package/template/dist/client/assets/{TodoPage-zC5wWNBa.js → TodoPage-B7D-bl65.js} +3 -3
  30. package/template/dist/client/assets/TopicsPage-CYCNr-mn.js +6 -0
  31. package/template/dist/client/assets/{WebSocketPage-B4NLdz1w.js → WebSocketPage-CGEg6QJE.js} +2 -2
  32. package/template/dist/client/assets/{activity-B94BUAsD.js → activity-CgTz9Mrd.js} +1 -1
  33. package/template/dist/client/assets/admin-D2iHWNOg.js +1 -0
  34. package/template/dist/client/assets/api-request-DIJocPxr.js +356 -0
  35. package/template/dist/client/assets/{arrow-left-H5JH0iU1.js → arrow-left-DtLQ3tTk.js} +1 -1
  36. package/template/dist/client/assets/{chevron-down-DwRh_wjD.js → chevron-down-CpIAV_yr.js} +1 -1
  37. package/template/dist/client/assets/{chevron-right-CpIWaqAL.js → chevron-right-CnU7oPQs.js} +1 -1
  38. package/template/dist/client/assets/{circle-check-big-CSElLscG.js → circle-check-big-CrZdwS75.js} +1 -1
  39. package/template/dist/client/assets/{circle-x-CYxr4RAw.js → circle-x-CvN9r3fW.js} +1 -1
  40. package/template/dist/client/assets/{clock-BseUJ7ex.js → clock-CTeSZBiH.js} +1 -1
  41. package/template/dist/client/assets/{download-BsGC_Xhq.js → download-OSVfVuNV.js} +1 -1
  42. package/template/dist/client/assets/{external-link-UTDzdjq8.js → external-link-fBsuHMby.js} +1 -1
  43. package/template/dist/client/assets/{eye-nR10ui7i.js → eye-CwlZZEsj.js} +1 -1
  44. package/template/dist/client/assets/index-09IqiOaE.css +1 -0
  45. package/template/dist/client/assets/index-B3CRby6r.js +51 -0
  46. package/template/dist/client/assets/index-CC_zy73y.js +17 -0
  47. package/template/dist/client/assets/main-Cn4IDo2I.js +92 -0
  48. package/template/dist/client/assets/merchant-DDDN9bMu.js +40 -0
  49. package/template/dist/client/assets/{message-square-CwWGL-Bh.js → message-square-BRaZfgbJ.js} +1 -1
  50. package/template/dist/client/assets/pluginStore-DDsWJPe6.js +1 -0
  51. package/template/dist/client/assets/{plus-pZld_nUL.js → plus-DDZfPiDJ.js} +1 -1
  52. package/template/dist/client/assets/sse-client-DGQ072hl.js +64 -0
  53. package/template/dist/client/assets/star-C7tO6w4H.js +11 -0
  54. package/template/dist/client/assets/{tag-DsiUPF90.js → tag-DBfpQDuJ.js} +1 -1
  55. package/template/dist/client/assets/tenant-CizbLaLJ.js +1 -0
  56. package/template/dist/client/assets/{trash-2-DRblNbnA.js → trash-2-BP7fkd5b.js} +1 -1
  57. package/template/dist/client/assets/{triangle-alert-D1CLh-Vd.js → triangle-alert-CrOQEdJ2.js} +1 -1
  58. package/template/dist/client/assets/{wifi-BwXjnCqI.js → wifi-CwYSE0J4.js} +1 -1
  59. package/template/dist/client/assets/{x-BH2rJdFq.js → x-t615pnNR.js} +1 -1
  60. package/template/dist/client/content/index.html +5 -4
  61. package/template/dist/client/index.html +4 -3
  62. package/template/dist/client/merchant.html +18 -0
  63. package/template/dist/client/notifications/index.html +6 -5
  64. package/template/dist/client/tenant.html +18 -0
  65. package/template/dist/client/todos/index.html +6 -5
  66. package/template/dist/client/websocket/index.html +6 -5
  67. package/template/dist/cloudflare/chunk-HX7DVRDX.js +1 -0
  68. package/template/dist/cloudflare/{chunk-QBHAPWIA.js → chunk-IXJL2LE4.js} +1 -1
  69. package/template/dist/cloudflare/chunk-Q34AN3RF.js +14 -0
  70. package/template/dist/cloudflare/{chunk-BHPTQ4K2.js → chunk-ZAMVL4EG.js} +2 -2
  71. package/template/dist/cloudflare/cloudflare.js +35 -29
  72. package/template/dist/cloudflare/db-4AQOSFAX.js +1 -0
  73. package/template/dist/cloudflare/{migrator-2ZYYKNI5.js → migrator-TEPBVUFO.js} +1 -1
  74. package/template/dist/cloudflare/permission-service-impl-RE7NPW3Q.js +1 -0
  75. package/template/dist/cloudflare/schema-DVEMT3X2.js +1 -0
  76. package/template/dist/cloudflare/test-setup-Z2RYE5B4.js +265 -0
  77. package/template/dist/server/chunk-27SIJSPF.js +1 -0
  78. package/template/dist/server/chunk-37QNGBQU.js +1 -0
  79. package/template/dist/server/chunk-FIY4CGJJ.js +1 -0
  80. package/template/dist/server/chunk-HZUDBIT4.js +1 -0
  81. package/template/dist/server/chunk-I6OBDFDU.js +1 -0
  82. package/template/dist/server/chunk-JHNYLNG7.js +1 -0
  83. package/template/dist/server/chunk-MDOVVKKD.js +1 -0
  84. package/template/dist/server/chunk-NSOCT7E5.js +1 -0
  85. package/template/dist/server/chunk-OU5IGVVO.js +1 -0
  86. package/template/dist/server/chunk-OYCBNRMK.js +1 -0
  87. package/template/dist/server/chunk-P2RJNNGD.js +1 -0
  88. package/template/dist/server/chunk-UMAQLNPE.js +1 -0
  89. package/template/dist/server/chunk-XZZTSRSN.js +1 -0
  90. package/template/dist/server/content-service-5QVHDR5X.js +1 -0
  91. package/template/dist/server/db-FLI5L5DD.js +1 -0
  92. package/template/dist/server/dispute-service-E2FCYUEM.js +1 -0
  93. package/template/dist/server/init-72JXJV3I.js +46 -0
  94. package/template/dist/server/init-FWYXSKPX.js +46 -0
  95. package/template/dist/server/node.js +34 -28
  96. package/template/dist/server/order-service-TKGG5S5K.js +1 -0
  97. package/template/dist/server/permission-service-impl-M3AKEYNY.js +1 -0
  98. package/template/dist/server/schema-V4UG7HMU.js +1 -0
  99. package/template/dist/server/tenant-service-JG6UUWXQ.js +1 -0
  100. package/template/dist/server/tenant-service-XJWZSEDX.js +1 -0
  101. package/template/dist/{cloudflare/test-setup-NMZJZLRV.js → server/test-setup-VFOPBGYM.js} +83 -2
  102. package/template/dist/server/ticket-service-3RSW7V2Z.js +1 -0
  103. package/template/dist/server/todo-service-S6BGIO7D.js +1 -0
  104. package/template/src/merchant/pages/DisputesPage.tsx +11 -11
  105. package/template/src/merchant/pages/OrdersPage.tsx +4 -3
  106. package/template/src/merchant/pages/ProductsPage.tsx +2 -2
  107. package/template/src/merchant/stores/merchantStore.ts +11 -6
  108. package/template/src/server/db/init.ts +5 -642
  109. package/template/src/server/module-plugin/services/plugin-seed-service.ts +623 -0
  110. package/template/src/server/module-tenant/routes/tenant-routes.ts +2 -2
  111. package/template/src/server/module-tenant/services/tenant-service.ts +63 -17
  112. package/template/src/shared/modules/merchant/index.ts +9 -0
  113. package/template/src/shared/modules/merchant/schemas.ts +37 -0
  114. package/template/src/shared/modules/tenant/index.ts +2 -0
  115. package/template/src/shared/schemas/index.ts +27 -0
  116. package/template/src/tenant/layouts/Header.tsx +1 -1
  117. package/template/src/tenant/layouts/Sidebar.tsx +1 -1
  118. package/template/src/tenant/pages/SettingsPage.tsx +4 -8
  119. package/template/src/tenant/stores/tenantStore.ts +41 -302
  120. package/template/tsconfig.json +1 -0
  121. package/template/tsup.config.ts +11 -3
  122. package/template/dist/client/assets/ContentDetailPage-DdltMANL.js +0 -1
  123. package/template/dist/client/assets/ContentListPage-B63sUB6N.js +0 -1
  124. package/template/dist/client/assets/DashboardPage-tUMilc7Z.js +0 -11
  125. package/template/dist/client/assets/LoadingSpinner-DVYOLSRM.js +0 -6
  126. package/template/dist/client/assets/LoginPage-g9mSLIMC.js +0 -6
  127. package/template/dist/client/assets/NotificationPage-COTzp-HD.js +0 -1
  128. package/template/dist/client/assets/OrdersPage-BsPh4oEI.js +0 -11
  129. package/template/dist/client/assets/PluginsPage-BNtAe_yo.js +0 -6
  130. package/template/dist/client/assets/ProfilePage-dL_iSuZN.js +0 -16
  131. package/template/dist/client/assets/PublishPage-D96FnbLA.js +0 -1
  132. package/template/dist/client/assets/TopicsPage-DyLjZa4D.js +0 -6
  133. package/template/dist/client/assets/admin-Bh1vfz_L.js +0 -486
  134. package/template/dist/client/assets/index-1bA-ixFv.js +0 -114
  135. package/template/dist/client/assets/index-CWh3vXC_.css +0 -1
  136. package/template/dist/client/assets/main-DHnArIp_.js +0 -82
  137. package/template/dist/client/assets/pluginStore-XQfsm3iR.js +0 -1
  138. package/template/dist/client/content/content-1/index.html +0 -18
  139. package/template/dist/client/content/content-13/index.html +0 -18
  140. package/template/dist/client/content/content-14/index.html +0 -18
  141. package/template/dist/client/content/content-15/index.html +0 -18
  142. package/template/dist/client/content/content-19/index.html +0 -18
  143. package/template/dist/client/content/content-2/index.html +0 -18
  144. package/template/dist/client/content/content-20/index.html +0 -18
  145. package/template/dist/cloudflare/chunk-YY6FRMAQ.js +0 -14
  146. package/template/dist/cloudflare/db-7J42RQ3T.js +0 -1
  147. package/template/dist/cloudflare/permission-service-impl-TGXVSSSA.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as p,r as o,j as t}from"./index-1bA-ixFv.js";import{H as f,P as b,b as N}from"./main-DHnArIp_.js";import{L as v}from"./LoadingSpinner-DVYOLSRM.js";import{T as w}from"./trash-2-DRblNbnA.js";import{P as $}from"./plus-pZld_nUL.js";import{A as k}from"./arrow-left-H5JH0iU1.js";/**
1
+ import{r as o,j as t}from"./index-B3CRby6r.js";import{H as f,P as b,b as N}from"./main-Cn4IDo2I.js";import{L as v}from"./LoadingSpinner-BcHjaM1m.js";import{c as p}from"./sse-client-DGQ072hl.js";import{T as w}from"./trash-2-BP7fkd5b.js";import{P as $}from"./plus-DDZfPiDJ.js";import{A as k}from"./arrow-left-DtLQ3tTk.js";/**
2
2
  * @license lucide-react v0.576.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as p,r as o,j as t}from"./index-1bA-ixFv.js";import{H as f,P as b,b as
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const q=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],F=p("shopping-bag",q),x=50,P=.08,_=()=>{const[c,d]=o.useState([]),[g,u]=o.useState(!0);o.useEffect(()=>{async function e(){try{const r=await(await N.api.cart.$get()).json();r.success&&d(r.data.items)}finally{u(!1)}}e()},[]);const a=c.reduce((e,s)=>e+s.price*s.quantity,0),n=a>=x?0:5.99,m=a*P,j=a+n+m,l=c.reduce((e,s)=>e+s.quantity,0),h=(e,s)=>{d(r=>r.map(i=>i.id===e?{...i,quantity:Math.max(0,i.quantity+s)}:i).filter(i=>i.quantity>0))},y=e=>{d(s=>s.filter(r=>r.id!==e))};return g?t.jsx("div",{className:"flex items-center justify-center py-20","data-testid":"cart-loading",children:t.jsx(v,{size:"lg"})}):t.jsxs("div",{className:"max-w-6xl mx-auto p-4 sm:p-6","data-testid":"cart-page",children:[t.jsxs(f,{children:[t.jsx("title",{children:"Shopping Cart - Biomimic App"}),t.jsx("meta",{name:"description",content:"Review your shopping cart"})]}),t.jsx("div",{className:"mb-8",children:t.jsxs("h1",{className:"text-3xl font-bold text-gray-900","data-testid":"cart-title",children:["Shopping Cart",l>0&&t.jsxs("span",{className:"text-lg font-normal text-gray-500 ml-2",children:["(",l," item",l!==1?"s":"",")"]})]})}),c.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-20","data-testid":"cart-empty",children:[t.jsx("div",{className:"w-20 h-20 rounded-full bg-amber-50 flex items-center justify-center mb-6",children:t.jsx(F,{className:"w-10 h-10 text-amber-500"})}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Your cart is empty"}),t.jsx("p",{className:"text-gray-500 mb-6",children:"Looks like you haven't added anything yet."}),t.jsx("button",{className:"px-6 py-3 bg-amber-500 text-white font-medium rounded-xl hover:bg-amber-600 transition-colors","data-testid":"cart-browse-button",children:"Browse Products"})]}):t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[t.jsx("div",{className:"lg:col-span-2 space-y-4","data-testid":"cart-items",children:c.map(e=>t.jsxs("div",{className:"flex gap-4 p-4 bg-white rounded-xl border border-gray-200 shadow-sm","data-testid":`cart-item-${e.id}`,children:[t.jsx("div",{className:"w-20 h-20 sm:w-24 sm:h-24 rounded-xl flex items-center justify-center flex-shrink-0",style:{backgroundColor:e.color},"data-testid":`cart-item-image-${e.id}`,children:t.jsx(b,{className:"w-8 h-8 text-white/70"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-900 truncate","data-testid":`cart-item-name-${e.id}`,children:e.name}),t.jsx("p",{className:"text-sm text-gray-500","data-testid":`cart-item-variant-${e.id}`,children:e.variant})]}),t.jsx("button",{onClick:()=>y(e.id),className:"p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0","data-testid":`cart-item-remove-${e.id}`,children:t.jsx(w,{className:"w-4 h-4"})})]}),t.jsxs("div",{className:"flex items-center justify-between mt-3",children:[t.jsxs("div",{className:"flex items-center gap-2","data-testid":`cart-item-qty-${e.id}`,children:[t.jsx("button",{onClick:()=>h(e.id,-1),className:"w-8 h-8 rounded-lg border border-gray-300 flex items-center justify-center text-gray-600 hover:bg-gray-50 transition-colors","data-testid":`cart-item-decrease-${e.id}`,children:t.jsx(C,{className:"w-3 h-3"})}),t.jsx("span",{className:"w-8 text-center text-sm font-medium text-gray-900","data-testid":`cart-item-count-${e.id}`,children:e.quantity}),t.jsx("button",{onClick:()=>h(e.id,1),className:"w-8 h-8 rounded-lg border border-gray-300 flex items-center justify-center text-gray-600 hover:bg-gray-50 transition-colors","data-testid":`cart-item-increase-${e.id}`,children:t.jsx($,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"text-right",children:[t.jsxs("p",{className:"text-sm text-gray-500","data-testid":`cart-item-unit-price-${e.id}`,children:["$",e.price.toFixed(2)," each"]}),t.jsxs("p",{className:"font-semibold text-gray-900","data-testid":`cart-item-total-${e.id}`,children:["$",(e.price*e.quantity).toFixed(2)]})]})]})]})]},e.id))}),t.jsx("div",{className:"lg:col-span-1","data-testid":"cart-summary",children:t.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-6 sticky top-6",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Order Summary"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-gray-500",children:"Subtotal"}),t.jsxs("span",{className:"text-gray-900 font-medium","data-testid":"cart-subtotal",children:["$",a.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-gray-500",children:"Shipping"}),t.jsx("span",{className:"text-gray-900 font-medium","data-testid":"cart-shipping",children:n===0?"Free":`$${n.toFixed(2)}`})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-gray-500",children:"Tax"}),t.jsxs("span",{className:"text-gray-900 font-medium","data-testid":"cart-tax",children:["$",m.toFixed(2)]})]}),t.jsx("div",{className:"border-t border-gray-200 pt-3 mt-3",children:t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"font-semibold text-gray-900",children:"Total"}),t.jsxs("span",{className:"font-bold text-gray-900 text-lg","data-testid":"cart-total",children:["$",j.toFixed(2)]})]})})]}),t.jsx("button",{className:"w-full mt-6 px-6 py-3 bg-amber-500 text-white font-semibold rounded-xl hover:bg-amber-600 transition-colors","data-testid":"cart-checkout-button",children:"Checkout"}),t.jsx("div",{className:"mt-4 text-center",children:t.jsxs("button",{className:"inline-flex items-center gap-1.5 text-sm text-amber-600 hover:text-amber-700 font-medium transition-colors","data-testid":"cart-continue-shopping",children:[t.jsx(k,{className:"w-3.5 h-3.5"}),"Continue Shopping"]})}),a<x&&a>0&&t.jsxs("p",{className:"mt-4 text-xs text-gray-500 text-center","data-testid":"cart-shipping-note",children:["Add $",(x-a).toFixed(2)," more for free shipping"]})]})})]})]})};export{_ as CartPage};
11
+ */const q=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],F=p("shopping-bag",q),x=50,P=.08,E=()=>{const[c,d]=o.useState([]),[g,u]=o.useState(!0);o.useEffect(()=>{async function e(){try{const r=await(await N.api.cart.$get()).json();r.success&&d(r.data.items)}finally{u(!1)}}e()},[]);const a=c.reduce((e,s)=>e+s.price*s.quantity,0),n=a>=x?0:5.99,m=a*P,j=a+n+m,l=c.reduce((e,s)=>e+s.quantity,0),h=(e,s)=>{d(r=>r.map(i=>i.id===e?{...i,quantity:Math.max(0,i.quantity+s)}:i).filter(i=>i.quantity>0))},y=e=>{d(s=>s.filter(r=>r.id!==e))};return g?t.jsx("div",{className:"flex items-center justify-center py-20","data-testid":"cart-loading",children:t.jsx(v,{size:"lg"})}):t.jsxs("div",{className:"max-w-6xl mx-auto p-4 sm:p-6","data-testid":"cart-page",children:[t.jsxs(f,{children:[t.jsx("title",{children:"Shopping Cart - Biomimic App"}),t.jsx("meta",{name:"description",content:"Review your shopping cart"})]}),t.jsx("div",{className:"mb-8",children:t.jsxs("h1",{className:"text-3xl font-bold text-gray-900","data-testid":"cart-title",children:["Shopping Cart",l>0&&t.jsxs("span",{className:"text-lg font-normal text-gray-500 ml-2",children:["(",l," item",l!==1?"s":"",")"]})]})}),c.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-20","data-testid":"cart-empty",children:[t.jsx("div",{className:"w-20 h-20 rounded-full bg-amber-50 flex items-center justify-center mb-6",children:t.jsx(F,{className:"w-10 h-10 text-amber-500"})}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Your cart is empty"}),t.jsx("p",{className:"text-gray-500 mb-6",children:"Looks like you haven't added anything yet."}),t.jsx("button",{className:"px-6 py-3 bg-amber-500 text-white font-medium rounded-xl hover:bg-amber-600 transition-colors","data-testid":"cart-browse-button",children:"Browse Products"})]}):t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[t.jsx("div",{className:"lg:col-span-2 space-y-4","data-testid":"cart-items",children:c.map(e=>t.jsxs("div",{className:"flex gap-4 p-4 bg-white rounded-xl border border-gray-200 shadow-sm","data-testid":`cart-item-${e.id}`,children:[t.jsx("div",{className:"w-20 h-20 sm:w-24 sm:h-24 rounded-xl flex items-center justify-center flex-shrink-0",style:{backgroundColor:e.color},"data-testid":`cart-item-image-${e.id}`,children:t.jsx(b,{className:"w-8 h-8 text-white/70"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-900 truncate","data-testid":`cart-item-name-${e.id}`,children:e.name}),t.jsx("p",{className:"text-sm text-gray-500","data-testid":`cart-item-variant-${e.id}`,children:e.variant})]}),t.jsx("button",{onClick:()=>y(e.id),className:"p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0","data-testid":`cart-item-remove-${e.id}`,children:t.jsx(w,{className:"w-4 h-4"})})]}),t.jsxs("div",{className:"flex items-center justify-between mt-3",children:[t.jsxs("div",{className:"flex items-center gap-2","data-testid":`cart-item-qty-${e.id}`,children:[t.jsx("button",{onClick:()=>h(e.id,-1),className:"w-8 h-8 rounded-lg border border-gray-300 flex items-center justify-center text-gray-600 hover:bg-gray-50 transition-colors","data-testid":`cart-item-decrease-${e.id}`,children:t.jsx(C,{className:"w-3 h-3"})}),t.jsx("span",{className:"w-8 text-center text-sm font-medium text-gray-900","data-testid":`cart-item-count-${e.id}`,children:e.quantity}),t.jsx("button",{onClick:()=>h(e.id,1),className:"w-8 h-8 rounded-lg border border-gray-300 flex items-center justify-center text-gray-600 hover:bg-gray-50 transition-colors","data-testid":`cart-item-increase-${e.id}`,children:t.jsx($,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"text-right",children:[t.jsxs("p",{className:"text-sm text-gray-500","data-testid":`cart-item-unit-price-${e.id}`,children:["$",e.price.toFixed(2)," each"]}),t.jsxs("p",{className:"font-semibold text-gray-900","data-testid":`cart-item-total-${e.id}`,children:["$",(e.price*e.quantity).toFixed(2)]})]})]})]})]},e.id))}),t.jsx("div",{className:"lg:col-span-1","data-testid":"cart-summary",children:t.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-6 sticky top-6",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Order Summary"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-gray-500",children:"Subtotal"}),t.jsxs("span",{className:"text-gray-900 font-medium","data-testid":"cart-subtotal",children:["$",a.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-gray-500",children:"Shipping"}),t.jsx("span",{className:"text-gray-900 font-medium","data-testid":"cart-shipping",children:n===0?"Free":`$${n.toFixed(2)}`})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-gray-500",children:"Tax"}),t.jsxs("span",{className:"text-gray-900 font-medium","data-testid":"cart-tax",children:["$",m.toFixed(2)]})]}),t.jsx("div",{className:"border-t border-gray-200 pt-3 mt-3",children:t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"font-semibold text-gray-900",children:"Total"}),t.jsxs("span",{className:"font-bold text-gray-900 text-lg","data-testid":"cart-total",children:["$",j.toFixed(2)]})]})})]}),t.jsx("button",{className:"w-full mt-6 px-6 py-3 bg-amber-500 text-white font-semibold rounded-xl hover:bg-amber-600 transition-colors","data-testid":"cart-checkout-button",children:"Checkout"}),t.jsx("div",{className:"mt-4 text-center",children:t.jsxs("button",{className:"inline-flex items-center gap-1.5 text-sm text-amber-600 hover:text-amber-700 font-medium transition-colors","data-testid":"cart-continue-shopping",children:[t.jsx(k,{className:"w-3.5 h-3.5"}),"Continue Shopping"]})}),a<x&&a>0&&t.jsxs("p",{className:"mt-4 text-xs text-gray-500 text-center","data-testid":"cart-shipping-note",children:["Add $",(x-a).toFixed(2)," more for free shipping"]})]})})]})]})};export{E as CartPage};
@@ -1,6 +1,6 @@
1
- import{c as d,r as m,j as e,L as g}from"./index-1bA-ixFv.js";import{H as x,P as p}from"./main-DHnArIp_.js";import{u as s}from"./pluginStore-XQfsm3iR.js";import{L as h}from"./LoadingSpinner-DVYOLSRM.js";import{E as u}from"./EmptyState-BK7ttK8D.js";/**
1
+ import{r as d,j as e,L as m}from"./index-B3CRby6r.js";import{H as g,P as x}from"./main-Cn4IDo2I.js";import{u as s}from"./pluginStore-DDsWJPe6.js";import{L as p}from"./LoadingSpinner-BcHjaM1m.js";import{E as h}from"./EmptyState-DEyOQjbY.js";import{c as f}from"./sse-client-DGQ072hl.js";/**
2
2
  * @license lucide-react v0.576.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const f=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],l=d("folder-open",f),o=["from-violet-500 to-purple-600","from-blue-500 to-cyan-500","from-fuchsia-500 to-pink-500","from-emerald-500 to-teal-500","from-orange-500 to-amber-500","from-rose-500 to-red-500","from-indigo-500 to-blue-600","from-teal-500 to-green-500","from-cyan-500 to-sky-500"],w=()=>{const a=s(t=>t.categories),n=s(t=>t.loading),r=s(t=>t.fetchCategories),c=s(t=>t.setSelectedCategory);return m.useEffect(()=>{r()},[r]),e.jsxs("div",{className:"min-h-screen","data-testid":"categories-page",children:[e.jsxs(x,{children:[e.jsx("title",{children:"Categories - Plugin Marketplace"}),e.jsx("meta",{name:"description",content:"Browse plugins by category"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-16 px-6",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(l,{className:"w-6 h-6 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Categories"})]}),e.jsx("p",{className:"text-purple-200/70 text-lg",children:"Browse plugins by category to find exactly what you need"})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-6 -mt-8 pb-16",children:n&&a.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(h,{size:"lg"})}):a.length===0?e.jsx(u,{icon:l,title:"No categories yet"}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:a.map((t,i)=>e.jsxs(g,{to:"/plugins",onClick:()=>c(t.slug),className:"group relative overflow-hidden bg-white rounded-2xl border border-gray-100 hover:border-transparent hover:shadow-2xl hover:shadow-violet-500/10 transition-all duration-300 block",children:[e.jsx("div",{className:`absolute top-0 left-0 right-0 h-1.5 bg-gradient-to-r ${o[i%o.length]} opacity-60 group-hover:opacity-100 transition-opacity`}),e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:`w-14 h-14 rounded-2xl bg-gradient-to-br ${o[i%o.length]} flex items-center justify-center text-2xl shadow-lg mb-4`,children:t.icon||"📁"}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 group-hover:text-violet-700 transition-colors",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1.5 leading-relaxed",children:t.description}),e.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs text-violet-500 font-medium opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(p,{className:"w-3.5 h-3.5"}),"Browse plugins"]})]})]},t.id))})})]})};export{w as CategoriesPage};
6
+ */const u=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],l=f("folder-open",u),o=["from-violet-500 to-purple-600","from-blue-500 to-cyan-500","from-fuchsia-500 to-pink-500","from-emerald-500 to-teal-500","from-orange-500 to-amber-500","from-rose-500 to-red-500","from-indigo-500 to-blue-600","from-teal-500 to-green-500","from-cyan-500 to-sky-500"],k=()=>{const a=s(t=>t.categories),n=s(t=>t.loading),r=s(t=>t.fetchCategories),c=s(t=>t.setSelectedCategory);return d.useEffect(()=>{r()},[r]),e.jsxs("div",{className:"min-h-screen","data-testid":"categories-page",children:[e.jsxs(g,{children:[e.jsx("title",{children:"Categories - Plugin Marketplace"}),e.jsx("meta",{name:"description",content:"Browse plugins by category"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-16 px-6",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(l,{className:"w-6 h-6 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Categories"})]}),e.jsx("p",{className:"text-purple-200/70 text-lg",children:"Browse plugins by category to find exactly what you need"})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-6 -mt-8 pb-16",children:n&&a.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(p,{size:"lg"})}):a.length===0?e.jsx(h,{icon:l,title:"No categories yet"}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:a.map((t,i)=>e.jsxs(m,{to:"/plugins",onClick:()=>c(t.slug),className:"group relative overflow-hidden bg-white rounded-2xl border border-gray-100 hover:border-transparent hover:shadow-2xl hover:shadow-violet-500/10 transition-all duration-300 block",children:[e.jsx("div",{className:`absolute top-0 left-0 right-0 h-1.5 bg-gradient-to-r ${o[i%o.length]} opacity-60 group-hover:opacity-100 transition-opacity`}),e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:`w-14 h-14 rounded-2xl bg-gradient-to-br ${o[i%o.length]} flex items-center justify-center text-2xl shadow-lg mb-4`,children:t.icon||"📁"}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 group-hover:text-violet-700 transition-colors",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1.5 leading-relaxed",children:t.description}),e.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs text-violet-500 font-medium opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(x,{className:"w-3.5 h-3.5"}),"Browse plugins"]})]})]},t.id))})})]})};export{k as CategoriesPage};
@@ -0,0 +1 @@
1
+ import{k as g,r,j as e,L as c}from"./index-B3CRby6r.js";import{b as y,H as b}from"./main-Cn4IDo2I.js";import"./sse-client-DGQ072hl.js";const w=()=>{var d,m;const{id:n}=g(),[t,h]=r.useState(null),[u,i]=r.useState(!0),[o,a]=r.useState(null),x=r.useCallback(async s=>{i(!0),a(null);try{const l=await y.api.public.contents[":id"].$get({param:{id:s}});if(!l.ok){l.status===404?a("内容不存在"):a("加载失败");return}const p=await l.json();p.success?h(p.data??null):a("Failed to fetch content")}catch{a("Network error")}finally{i(!1)}},[]);r.useEffect(()=>{n&&x(n)},[n,x]);const j=s=>s?new Date(s).toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric"}):"";return u?e.jsx("div",{className:"max-w-4xl mx-auto p-6",children:e.jsx("div",{className:"text-center py-12 text-gray-500",children:"加载中..."})}):o||!t?e.jsx("div",{className:"max-w-4xl mx-auto p-6",children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:o||"内容不存在"}),e.jsx(c,{to:"/content",className:"text-blue-600 hover:underline",children:"← 返回内容列表"})]})}):e.jsxs(e.Fragment,{children:[e.jsxs(b,{children:[e.jsxs("title",{children:[t.title," - Biomimic App"]}),e.jsx("meta",{name:"description",content:t.content.slice(0,160)}),e.jsx("meta",{property:"og:title",content:t.title}),e.jsx("meta",{property:"og:description",content:t.content.slice(0,200)}),e.jsx("meta",{property:"og:type",content:"article"}),t.publishedAt&&e.jsx("meta",{property:"article:published_time",content:t.publishedAt}),t.author&&e.jsx("meta",{property:"article:author",content:t.author}),(d=t.tags)==null?void 0:d.map(s=>e.jsx("meta",{property:"article:tag",content:s},s))]}),e.jsxs("div",{className:"max-w-4xl mx-auto p-6","data-testid":"content-detail-page",children:[e.jsxs("nav",{className:"mb-6 text-sm text-gray-500",children:[e.jsx(c,{to:"/content",className:"hover:text-blue-600",children:"内容中心"}),e.jsx("span",{className:"mx-2",children:"/"}),e.jsx("span",{className:"text-gray-900",children:t.category})]}),e.jsxs("article",{className:"bg-white rounded-xl border border-gray-200 p-8",children:[e.jsxs("header",{className:"mb-8 pb-6 border-b border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"px-3 py-1 bg-blue-100 text-blue-700 text-sm font-medium rounded-full",children:t.category}),(m=t.tags)==null?void 0:m.map(s=>e.jsx("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded",children:s},s))]}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:t.title}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-500",children:[t.author&&e.jsxs("span",{children:["✍ ",t.author]}),t.publishedAt&&e.jsxs("span",{children:["📅 ",j(t.publishedAt)]}),e.jsxs("span",{children:["👁 ",t.viewCount," 阅读"]}),e.jsxs("span",{children:["❤ ",t.likeCount," 喜欢"]})]})]}),e.jsx("div",{className:"prose prose-gray max-w-none",children:e.jsx("div",{className:"whitespace-pre-wrap text-gray-700 leading-relaxed",children:t.content})})]}),e.jsx("div",{className:"mt-6",children:e.jsx(c,{to:"/content",className:"text-blue-600 hover:underline",children:"← 返回内容列表"})})]})]})};export{w as ContentDetailPage};
@@ -0,0 +1 @@
1
+ import{r as a,j as s,L as v}from"./index-B3CRby6r.js";import{b as N,H as w}from"./main-Cn4IDo2I.js";import"./sse-client-DGQ072hl.js";const p=[{value:"",label:"全部"},{value:"article",label:"文章"},{value:"announcement",label:"公告"},{value:"tutorial",label:"教程"},{value:"news",label:"新闻"},{value:"policy",label:"政策"}],k=()=>{const[i,g]=a.useState([]),[n,m]=a.useState(!0),[c,o]=a.useState(null),[l,h]=a.useState(""),[r,b]=a.useState(""),d=a.useCallback(async()=>{m(!0),o(null);try{const t=await(await N.api.public.contents.$get({query:{...l?{category:l}:{},...r?{search:r}:{},limit:20}})).json();t.success?g(t.data):o("Failed to fetch contents")}catch{o("Network error")}finally{m(!1)}},[l,r]);a.useEffect(()=>{d()},[d]);const y=e=>{e.preventDefault(),d()},f=e=>{var t;return((t=p.find(j=>j.value===e))==null?void 0:t.label)??e},x=e=>e?new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric"}):"",u=e=>({draft:{color:"bg-yellow-100 text-yellow-700",label:"草稿"},published:{color:"bg-green-100 text-green-700",label:"已发布"},archived:{color:"bg-gray-100 text-gray-700",label:"已归档"}})[e];return s.jsxs(s.Fragment,{children:[s.jsxs(w,{children:[s.jsx("title",{children:"内容 - Biomimic App"}),s.jsx("meta",{name:"description",content:"浏览最新的文章、公告、教程和新闻"}),s.jsx("meta",{property:"og:title",content:"内容 - Biomimic App"}),s.jsx("meta",{property:"og:description",content:"浏览最新的文章、公告、教程和新闻"})]}),s.jsxs("div",{className:"max-w-4xl mx-auto p-6","data-testid":"content-list-page",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"内容中心"}),s.jsx("p",{className:"mt-2 text-gray-600",children:"浏览最新的文章、公告、教程和新闻"})]}),s.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row gap-4",children:[s.jsx("div",{className:"flex gap-2 flex-wrap",children:p.map(e=>s.jsx("button",{onClick:()=>h(e.value),className:`px-4 py-2 rounded-full text-sm font-medium transition-colors ${l===e.value?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:e.label},e.value))}),s.jsxs("form",{onSubmit:y,className:"flex gap-2 sm:ml-auto",children:[s.jsx("input",{type:"text",value:r,onChange:e=>b(e.target.value),placeholder:"搜索内容...",className:"px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none"}),s.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"搜索"})]})]}),c&&s.jsx("div",{className:"mb-4 p-4 bg-red-50 border border-red-200 rounded-lg text-red-700",children:c}),n&&s.jsx("div",{className:"text-center py-12 text-gray-500",children:"加载中..."}),!n&&!c&&i.length===0&&s.jsx("div",{className:"text-center py-12 text-gray-500",children:"暂无内容"}),!n&&i.length>0&&s.jsx("div",{className:"space-y-4",children:i.map(e=>s.jsx(v,{to:`/content/${e.id}`,className:"block p-6 bg-white rounded-xl border border-gray-200 hover:border-blue-300 hover:shadow-md transition-all",children:s.jsx("div",{className:"flex items-start justify-between gap-4",children:s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[s.jsx("span",{className:"px-2 py-1 bg-blue-100 text-blue-700 text-xs font-medium rounded",children:f(e.category)}),s.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${u(e.status).color}`,children:u(e.status).label}),s.jsx("span",{className:"text-sm text-gray-500",children:e.author})]}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:e.title}),s.jsxs("p",{className:"text-gray-600 line-clamp-2",children:[e.content.slice(0,150),"..."]}),e.tags&&e.tags.length>0&&s.jsx("div",{className:"flex gap-1.5 flex-wrap mt-3",children:e.tags.map(t=>s.jsx("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 text-xs rounded",children:t},t))}),s.jsxs("div",{className:"flex items-center gap-4 mt-3 text-sm text-gray-400 flex-wrap",children:[e.createdAt&&s.jsxs("span",{children:["创建于 ",x(e.createdAt)]}),e.updatedAt&&e.updatedAt!==e.createdAt&&s.jsxs("span",{children:["更新于 ",x(e.updatedAt)]}),e.publishedAt&&s.jsxs("span",{children:["发布于 ",x(e.publishedAt)]}),s.jsxs("span",{children:["👁 ",e.viewCount]}),s.jsxs("span",{children:["❤ ",e.likeCount]})]})]})})},e.id))})]})]})};export{k as ContentListPage};
@@ -0,0 +1,11 @@
1
+ import{r as t,j as e}from"./index-B3CRby6r.js";import{H as S,b as k}from"./main-Cn4IDo2I.js";import{L as D}from"./LoadingSpinner-BcHjaM1m.js";import{C as $}from"./chevron-down-CpIAV_yr.js";import{c as h,T as L}from"./sse-client-DGQ072hl.js";/**
2
+ * @license lucide-react v0.576.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const R=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],A=h("arrow-up-right",R);/**
7
+ * @license lucide-react v0.576.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const C=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],U=h("trending-down",C),E={Active:"bg-green-100 text-green-700",Pending:"bg-yellow-100 text-yellow-700",Inactive:"bg-gray-100 text-gray-600"},G=["Last 7 days","Last 30 days","Last 90 days","Last year"],P=()=>{const[n,g]=t.useState("Last 30 days"),[i,c]=t.useState(!1),[p,o]=t.useState(!0),[b,u]=t.useState([]),[y,f]=t.useState([]),[j,N]=t.useState([]),[v,w]=t.useState([]);return t.useEffect(()=>{async function s(){var r,a;try{const d=k.api,x=(a=(r=d==null?void 0:d.admin)==null?void 0:r.dashboard)==null?void 0:a.stats;if(!x){o(!1);return}const m=await(await x()).json(),l=m.data??{};m.success&&(u(l.stats||[]),f(l.revenue||[]),N(l.userGrowth||[]),w(l.activity||[]))}finally{o(!1)}}s()},[]),p?e.jsx("div",{className:"flex items-center justify-center min-h-screen","data-testid":"dashboard-loading",children:e.jsx(D,{size:"lg"})}):e.jsxs("div",{className:"min-h-screen bg-gray-50 p-4 sm:p-6 lg:p-8","data-testid":"dashboard-page",children:[e.jsxs(S,{children:[e.jsx("title",{children:"Dashboard - SaaS Admin"}),e.jsx("meta",{name:"description",content:"SaaS Admin Dashboard"})]}),e.jsxs("div",{className:"max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-8 gap-4",children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-gray-900",children:"Dashboard"}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>c(!i),"data-testid":"time-range-dropdown",className:"flex items-center gap-2 px-4 py-2 bg-white border border-gray-200 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors",children:[n,e.jsx($,{className:"w-4 h-4"})]}),i&&e.jsx("div",{className:"absolute right-0 mt-1 w-44 bg-white border border-gray-200 rounded-lg shadow-lg z-10",children:G.map(s=>e.jsx("button",{onClick:()=>{g(s),c(!1)},"data-testid":`time-range-${s.toLowerCase().replace(/\s+/g,"-")}`,className:`block w-full text-left px-4 py-2 text-sm transition-colors first:rounded-t-lg last:rounded-b-lg ${s===n?"bg-gray-100 text-gray-900 font-medium":"text-gray-600 hover:bg-gray-50"}`,children:s},s))})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6 mb-8",children:b.map(s=>{const r=s.icon,a=s.trend>=0;return e.jsxs("div",{"data-testid":`stat-card-${s.label.toLowerCase().replace(/\s+/g,"-")}`,className:"bg-white rounded-lg border border-gray-200 p-5 hover:shadow-sm transition-shadow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-gray-500",children:s.label}),e.jsx("div",{className:"p-2 bg-gray-100 rounded-lg",children:e.jsx(r,{className:"w-4 h-4 text-gray-600"})})]}),e.jsx("div",{className:"text-2xl font-bold text-gray-900 mb-1",children:s.value}),e.jsxs("div",{className:"flex items-center gap-1",children:[a?e.jsx(L,{className:"w-3 h-3 text-green-500"}):e.jsx(U,{className:"w-3 h-3 text-red-500"}),e.jsxs("span",{className:`text-sm font-medium ${a?"text-green-600":"text-red-600"}`,children:[a?"+":"",s.trend,"%"]}),e.jsx("span",{className:"text-xs text-gray-400 ml-1",children:"vs last period"})]})]},s.label)})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 mb-8",children:[e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-5 sm:p-6","data-testid":"revenue-chart",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900 mb-6",children:"Revenue Overview"}),e.jsx("div",{className:"flex items-end gap-3 h-48",children:y.map(s=>e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-2",children:[e.jsxs("div",{className:"w-full flex flex-col items-center",children:[e.jsxs("span",{className:"text-xs text-gray-500 mb-1",children:["$",s.value,"k"]}),e.jsx("div",{className:"w-full rounded-t-md bg-gray-800 transition-all hover:bg-gray-700",style:{height:`${s.value/100*160}px`}})]}),e.jsx("span",{className:"text-xs text-gray-500",children:s.month})]},s.month))})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-5 sm:p-6","data-testid":"user-growth-chart",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900 mb-6",children:"User Growth"}),e.jsx("div",{className:"flex items-end gap-3 h-48",children:j.map(s=>e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-2",children:[e.jsxs("div",{className:"w-full flex flex-col items-center",children:[e.jsxs("span",{className:"text-xs text-gray-500 mb-1",children:[s.value,"%"]}),e.jsx("div",{className:"w-full rounded-t-md transition-all",style:{height:`${s.value/100*160}px`,background:`linear-gradient(to top, #1f2937 ${s.value}%, #e5e7eb ${s.value}%)`}})]}),e.jsx("span",{className:"text-xs text-gray-500",children:s.month})]},s.month))})]})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden","data-testid":"recent-activity",children:[e.jsxs("div",{className:"px-5 sm:px-6 py-4 border-b border-gray-100 flex items-center justify-between",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Recent Activity"}),e.jsxs("button",{"data-testid":"view-all-activity",className:"flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 transition-colors",children:["View all",e.jsx(A,{className:"w-3.5 h-3.5"})]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-100",children:[e.jsx("th",{className:"text-left px-5 sm:px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User"}),e.jsx("th",{className:"text-left px-5 sm:px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Action"}),e.jsx("th",{className:"text-left px-5 sm:px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider hidden sm:table-cell",children:"Date"}),e.jsx("th",{className:"text-left px-5 sm:px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"})]})}),e.jsx("tbody",{children:v.map(s=>e.jsxs("tr",{"data-testid":`activity-row-${s.id}`,className:"border-b border-gray-50 last:border-0 hover:bg-gray-50 transition-colors",children:[e.jsx("td",{className:"px-5 sm:px-6 py-4",children:e.jsx("span",{className:"text-sm font-medium text-gray-900",children:s.user})}),e.jsx("td",{className:"px-5 sm:px-6 py-4",children:e.jsx("span",{className:"text-sm text-gray-600",children:s.action})}),e.jsx("td",{className:"px-5 sm:px-6 py-4 hidden sm:table-cell",children:e.jsx("span",{className:"text-sm text-gray-500",children:s.date})}),e.jsx("td",{className:"px-5 sm:px-6 py-4",children:e.jsx("span",{"data-testid":`status-badge-${s.id}`,className:`inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium ${E[s.status]}`,children:s.status})})]},s.id))})]})})]})]})]})};export{P as DashboardPage};
@@ -1,4 +1,4 @@
1
- import{c as m,r as j,j as e,L as c}from"./index-1bA-ixFv.js";import{H as b,P as n}from"./main-DHnArIp_.js";import{u as a}from"./pluginStore-XQfsm3iR.js";import{S as f}from"./StatusBadge-BJ3W2Zc7.js";import{L as u}from"./LoadingSpinner-DVYOLSRM.js";import{E as N}from"./EmptyState-BK7ttK8D.js";import{P as w}from"./plus-pZld_nUL.js";import{C as y}from"./clock-BseUJ7ex.js";import{D as x}from"./download-BsGC_Xhq.js";import{E as k}from"./external-link-UTDzdjq8.js";import{T as P}from"./trash-2-DRblNbnA.js";/**
1
+ import{r as j,j as e,L as c}from"./index-B3CRby6r.js";import{H as b,P as n}from"./main-Cn4IDo2I.js";import{u as a}from"./pluginStore-DDsWJPe6.js";import{S as f}from"./StatusBadge-CG7wVqpu.js";import{L as u}from"./LoadingSpinner-BcHjaM1m.js";import{E as N}from"./EmptyState-DEyOQjbY.js";import{c as m}from"./sse-client-DGQ072hl.js";import{P as w}from"./plus-DDZfPiDJ.js";import{C as y}from"./clock-CTeSZBiH.js";import{D as x}from"./download-OSVfVuNV.js";import{E as k}from"./external-link-fBsuHMby.js";import{T as P}from"./trash-2-BP7fkd5b.js";/**
2
2
  * @license lucide-react v0.576.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as m,r as j,j as e,L as c}from"./index-1bA-ixFv.js";import{H as b,P as
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const M=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],S=m("circle-check",M),I=()=>{const r=a(s=>s.myPlugins),h=a(s=>s.loading),o=a(s=>s.error),d=a(s=>s.fetchMyPlugins),g=a(s=>s.deletePlugin),i=a(s=>s.fetchStats);j.useEffect(()=>{d(),i()},[d,i]);const p={approved:"green",pending:"yellow",rejected:"red"},t=(r==null?void 0:r.filter(Boolean))??[],v=t.reduce((s,l)=>s+((l==null?void 0:l.downloadCount)??0),0);return e.jsxs("div",{className:"min-h-screen","data-testid":"developer-dashboard-page",children:[e.jsxs(b,{children:[e.jsx("title",{children:"Developer Dashboard - Plugin Marketplace"}),e.jsx("meta",{name:"description",content:"Manage your published plugins"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-16 px-6",children:e.jsx("div",{className:"max-w-5xl mx-auto",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(C,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Developer Dashboard"}),e.jsx("p",{className:"text-purple-200/60 mt-0.5",children:"Manage your published plugins"})]})]}),e.jsxs(c,{to:"/publish",className:"group flex items-center gap-2 px-5 py-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 text-sm font-semibold",children:[e.jsx(w,{className:"w-4 h-4 group-hover:rotate-90 transition-transform"}),"New Plugin"]})]})})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-6 -mt-8 pb-16",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-violet-500 to-fuchsia-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-violet-50 rounded-lg",children:e.jsx(n,{className:"w-5 h-5 text-violet-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"My Plugins"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:t.length})]})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-emerald-500 to-teal-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg",children:e.jsx(S,{className:"w-5 h-5 text-emerald-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"Approved"}),e.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:t.filter(s=>s.status==="approved").length})]})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-amber-500 to-orange-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-amber-50 rounded-lg",children:e.jsx(y,{className:"w-5 h-5 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"Pending"}),e.jsx("p",{className:"text-2xl font-bold text-amber-600",children:t.filter(s=>s.status==="pending").length})]})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:e.jsx(x,{className:"w-5 h-5 text-blue-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"Downloads"}),e.jsx("p",{className:"text-2xl font-bold text-blue-600",children:v})]})]})]})]}),o&&e.jsx("div",{className:"mb-6 p-4 bg-red-500/10 border border-red-500/20 text-red-600 rounded-2xl",children:o}),h&&t.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(u,{size:"lg"})}):t.length===0?e.jsx("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-12",children:e.jsx(N,{icon:n,title:"No plugins published yet",description:"Publish your first plugin to get started"})}):e.jsx("div",{className:"space-y-3",children:t.map(s=>e.jsx("div",{className:"group bg-white rounded-2xl border border-gray-100 hover:border-violet-200 hover:shadow-lg hover:shadow-violet-500/5 transition-all duration-300 p-5",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-violet-100 to-fuchsia-100 flex items-center justify-center text-lg font-bold text-violet-600 shrink-0",children:s.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 group-hover:text-violet-700 transition-colors",children:s.name}),e.jsx(f,{label:s.status,colorScheme:p[s.status]||"gray"})]}),e.jsxs("p",{className:"text-xs text-gray-400 mt-0.5 font-mono",children:[s.slug," · v",s.version]}),s.status==="rejected"&&s.rejectReason&&e.jsxs("p",{className:"text-sm text-red-500 mt-1",children:["Rejected: ",s.rejectReason]}),e.jsx("p",{className:"text-sm text-gray-500 mt-2 line-clamp-2 leading-relaxed",children:s.description}),e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(x,{className:"w-3.5 h-3.5"}),s.downloadCount," downloads"]}),e.jsx("span",{children:new Date(s.createdAt).toLocaleDateString()})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(c,{to:`/plugins/${s.slug}`,className:"p-2.5 text-gray-400 hover:text-violet-500 hover:bg-violet-50 rounded-xl transition-all",title:"View",children:e.jsx(k,{className:"w-4.5 h-4.5"})}),e.jsx("button",{onClick:()=>{confirm("Delete this plugin?")&&g(s.slug)},className:"p-2.5 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-all",title:"Delete",children:e.jsx(P,{className:"w-4.5 h-4.5"})})]})]})},s.id))})]})]})};export{I as DeveloperDashboardPage};
11
+ */const M=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],S=m("circle-check",M),U=()=>{const r=a(s=>s.myPlugins),h=a(s=>s.loading),o=a(s=>s.error),d=a(s=>s.fetchMyPlugins),g=a(s=>s.deletePlugin),i=a(s=>s.fetchStats);j.useEffect(()=>{d(),i()},[d,i]);const p={approved:"green",pending:"yellow",rejected:"red"},t=(r==null?void 0:r.filter(Boolean))??[],v=t.reduce((s,l)=>s+((l==null?void 0:l.downloadCount)??0),0);return e.jsxs("div",{className:"min-h-screen","data-testid":"developer-dashboard-page",children:[e.jsxs(b,{children:[e.jsx("title",{children:"Developer Dashboard - Plugin Marketplace"}),e.jsx("meta",{name:"description",content:"Manage your published plugins"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-16 px-6",children:e.jsx("div",{className:"max-w-5xl mx-auto",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(C,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Developer Dashboard"}),e.jsx("p",{className:"text-purple-200/60 mt-0.5",children:"Manage your published plugins"})]})]}),e.jsxs(c,{to:"/publish",className:"group flex items-center gap-2 px-5 py-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 text-sm font-semibold",children:[e.jsx(w,{className:"w-4 h-4 group-hover:rotate-90 transition-transform"}),"New Plugin"]})]})})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-6 -mt-8 pb-16",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-violet-500 to-fuchsia-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-violet-50 rounded-lg",children:e.jsx(n,{className:"w-5 h-5 text-violet-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"My Plugins"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900",children:t.length})]})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-emerald-500 to-teal-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg",children:e.jsx(S,{className:"w-5 h-5 text-emerald-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"Approved"}),e.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:t.filter(s=>s.status==="approved").length})]})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-amber-500 to-orange-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-amber-50 rounded-lg",children:e.jsx(y,{className:"w-5 h-5 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"Pending"}),e.jsx("p",{className:"text-2xl font-bold text-amber-600",children:t.filter(s=>s.status==="pending").length})]})]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-5",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:e.jsx(x,{className:"w-5 h-5 text-blue-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:"Downloads"}),e.jsx("p",{className:"text-2xl font-bold text-blue-600",children:v})]})]})]})]}),o&&e.jsx("div",{className:"mb-6 p-4 bg-red-500/10 border border-red-500/20 text-red-600 rounded-2xl",children:o}),h&&t.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(u,{size:"lg"})}):t.length===0?e.jsx("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-12",children:e.jsx(N,{icon:n,title:"No plugins published yet",description:"Publish your first plugin to get started"})}):e.jsx("div",{className:"space-y-3",children:t.map(s=>e.jsx("div",{className:"group bg-white rounded-2xl border border-gray-100 hover:border-violet-200 hover:shadow-lg hover:shadow-violet-500/5 transition-all duration-300 p-5",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-violet-100 to-fuchsia-100 flex items-center justify-center text-lg font-bold text-violet-600 shrink-0",children:s.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 group-hover:text-violet-700 transition-colors",children:s.name}),e.jsx(f,{label:s.status,colorScheme:p[s.status]||"gray"})]}),e.jsxs("p",{className:"text-xs text-gray-400 mt-0.5 font-mono",children:[s.slug," · v",s.version]}),s.status==="rejected"&&s.rejectReason&&e.jsxs("p",{className:"text-sm text-red-500 mt-1",children:["Rejected: ",s.rejectReason]}),e.jsx("p",{className:"text-sm text-gray-500 mt-2 line-clamp-2 leading-relaxed",children:s.description}),e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(x,{className:"w-3.5 h-3.5"}),s.downloadCount," downloads"]}),e.jsx("span",{children:new Date(s.createdAt).toLocaleDateString()})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(c,{to:`/plugins/${s.slug}`,className:"p-2.5 text-gray-400 hover:text-violet-500 hover:bg-violet-50 rounded-xl transition-all",title:"View",children:e.jsx(k,{className:"w-4.5 h-4.5"})}),e.jsx("button",{onClick:()=>{confirm("Delete this plugin?")&&g(s.slug)},className:"p-2.5 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-xl transition-all",title:"Delete",children:e.jsx(P,{className:"w-4.5 h-4.5"})})]})]})},s.id))})]})]})};export{U as DeveloperDashboardPage};
@@ -1 +1 @@
1
- import{j as t}from"./index-1bA-ixFv.js";const m=({icon:s,title:a,description:e,className:r=""})=>t.jsxs("div",{className:`flex flex-col items-center justify-center h-full text-gray-500 ${r}`,"data-testid":"empty-state",children:[t.jsx(s,{className:"w-16 h-16 mb-4 text-gray-300"}),t.jsx("p",{className:"text-center",children:a}),e&&t.jsx("p",{className:"text-sm text-gray-400 mt-1",children:e})]});export{m as E};
1
+ import{j as t}from"./index-B3CRby6r.js";const m=({icon:s,title:a,description:e,className:r=""})=>t.jsxs("div",{className:`flex flex-col items-center justify-center h-full text-gray-500 ${r}`,"data-testid":"empty-state",children:[t.jsx(s,{className:"w-16 h-16 mb-4 text-gray-300"}),t.jsx("p",{className:"text-center",children:a}),e&&t.jsx("p",{className:"text-sm text-gray-400 mt-1",children:e})]});export{m as E};
@@ -0,0 +1,6 @@
1
+ import{j as o}from"./index-B3CRby6r.js";import{c as s}from"./sse-client-DGQ072hl.js";/**
2
+ * @license lucide-react v0.576.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const n=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],i=s("loader-circle",n),r={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"},m=({size:e="md",color:a="text-blue-500",className:t=""})=>o.jsx(i,{className:`animate-spin ${r[e]} ${a} ${t}`,"data-testid":"loading-spinner"});export{m as L};
@@ -0,0 +1 @@
1
+ import{f as h,r as d,j as e,L as f}from"./index-B3CRby6r.js";import{u as t,a as j,H as w,L as y}from"./main-Cn4IDo2I.js";import"./sse-client-DGQ072hl.js";const m={todo:{email:"demo@biomimic.app",password:"demo123",name:"Demo User"},plugin:{email:"developer@pluginhub.io",password:"dev123",name:"Plugin Developer"},ecommerce:{email:"shopper@shopmart.com",password:"shop123",name:"Shopper"},community:{email:"member@community.dev",password:"member123",name:"Community Member"},saas:{email:"admin@biomimic.app",password:"admin123",name:"Admin"}},L=()=>{const c=h(),u=t(s=>s.login),a=t(s=>s.loading),r=t(s=>s.error),o=t(s=>s.clearError),p=j(),n=m[p]??m.todo,[i,x]=d.useState(n.email),[l,g]=d.useState(n.password),b=async s=>{s.preventDefault(),await u(i,l),t.getState().isAuthenticated&&c("/todos")};return e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsx("title",{children:"Login - Biomimic App"})}),e.jsx("div",{className:"min-h-[calc(100vh-200px)] flex items-center justify-center",children:e.jsx("div",{className:"w-full max-w-md","data-testid":"login-page",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 p-8",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 bg-blue-100 rounded-full mb-3",children:e.jsx(y,{className:"w-6 h-6 text-blue-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Welcome Back"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Sign in to your account"})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:"Username"}),e.jsx("input",{id:"username",type:"text",value:i,onChange:s=>{x(s.target.value),r&&o()},placeholder:"Enter your username",required:!0,"data-testid":"login-username",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),e.jsx("input",{id:"password",type:"password",value:l,onChange:s=>{g(s.target.value),r&&o()},placeholder:"Enter your password",required:!0,"data-testid":"login-password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),r&&e.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-lg px-3 py-2","data-testid":"login-error",children:r}),e.jsx("button",{type:"submit",disabled:a,"data-testid":"login-submit",className:"w-full py-2 px-4 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"Signing in...":"Sign In"})]}),e.jsxs("p",{className:"mt-4 text-center text-sm text-gray-500",children:["Don't have an account?"," ",e.jsx(f,{to:"/register",className:"text-blue-600 hover:text-blue-700 font-medium","data-testid":"login-register-link",children:"Sign up"})]})]})})})]})};export{L as LoginPage};
@@ -0,0 +1 @@
1
+ import{I as y,k as x,g as L,m as F,r as V,e as _,c as B,a3 as A,bc as U,W as X,Y as C,b as Y}from"./api-request-DIJocPxr.js";import{r}from"./index-B3CRby6r.js";var W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},q=function(n,a){return r.createElement(y,x({},n,{ref:a,icon:W}))},de=r.forwardRef(q);const G=e=>{const{value:n,formatter:a,precision:t,decimalSeparator:o,groupSeparator:m="",prefixCls:i}=e;let s;if(typeof a=="function")s=a(n);else{const c=String(n),u=c.match(/^(-?)(\d*)(\.(\d+))?$/);if(!u||c==="-")s=c;else{const p=u[1];let d=u[2]||"0",f=u[4]||"";d=d.replace(/\B(?=(\d{3})+(?!\d))/g,m),typeof t=="number"&&(f=f.padEnd(t,"0").slice(0,t>0?t:0)),f&&(f=`${o}${f}`),s=[r.createElement("span",{key:"int",className:`${i}-content-value-int`},p,d),f&&r.createElement("span",{key:"decimal",className:`${i}-content-value-decimal`},f)]}}return r.createElement("span",{className:`${i}-content-value`},s)},J=e=>{const{componentCls:n,marginXXS:a,padding:t,colorTextDescription:o,titleFontSize:m,colorTextHeading:i,contentFontSize:s,fontFamily:c}=e;return{[n]:Object.assign(Object.assign({},V(e)),{[`${n}-title`]:{marginBottom:a,color:o,fontSize:m},[`${n}-skeleton`]:{paddingTop:t},[`${n}-content`]:{color:i,fontSize:s,fontFamily:c,[`${n}-content-value`]:{display:"inline-block",direction:"ltr"},[`${n}-content-prefix, ${n}-content-suffix`]:{display:"inline-block"},[`${n}-content-prefix`]:{marginInlineEnd:a},[`${n}-content-suffix`]:{marginInlineStart:a}}})}},K=e=>{const{fontSizeHeading3:n,fontSize:a}=e;return{titleFontSize:a,contentFontSize:n}},Q=L("Statistic",e=>{const n=F(e,{});return J(n)},K);var Z=function(e,n){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(a[t[o]]=e[t[o]]);return a};const O=r.forwardRef((e,n)=>{const{prefixCls:a,className:t,rootClassName:o,style:m,valueStyle:i,value:s=0,title:c,valueRender:u,prefix:p,suffix:d,loading:f=!1,formatter:l,precision:g,decimalSeparator:S=".",groupSeparator:E=",",onMouseEnter:$,onMouseLeave:z}=e,N=Z(e,["prefixCls","className","rootClassName","style","valueStyle","value","title","valueRender","prefix","suffix","loading","formatter","precision","decimalSeparator","groupSeparator","onMouseEnter","onMouseLeave"]),{getPrefixCls:j,direction:R,className:k,style:T}=_("statistic"),v=j("statistic",a),[M,I,D]=Q(v),h=r.createElement(G,{decimalSeparator:S,groupSeparator:E,prefixCls:v,formatter:l,precision:g,value:s}),H=B(v,{[`${v}-rtl`]:R==="rtl"},k,t,o,I,D),b=r.useRef(null);r.useImperativeHandle(n,()=>({nativeElement:b.current}));const P=A(N,{aria:!0,data:!0});return M(r.createElement("div",Object.assign({},P,{ref:b,className:H,style:Object.assign(Object.assign({},T),m),onMouseEnter:$,onMouseLeave:z}),c&&r.createElement("div",{className:`${v}-title`},c),r.createElement(U,{paragraph:!1,loading:f,className:`${v}-skeleton`,active:!0},r.createElement("div",{style:i,className:`${v}-content`},p&&r.createElement("span",{className:`${v}-content-prefix`},p),u?u(h):h,d&&r.createElement("span",{className:`${v}-content-suffix`},d)))))}),ee=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function te(e,n){let a=e;const t=/\[[^\]]*]/g,o=(n.match(t)||[]).map(c=>c.slice(1,-1)),m=n.replace(t,"[]"),i=ee.reduce((c,[u,p])=>{if(c.includes(u)){const d=Math.floor(a/p);return a-=d*p,c.replace(new RegExp(`${u}+`,"g"),f=>{const l=f.length;return d.toString().padStart(l,"0")})}return c},m);let s=0;return i.replace(t,()=>{const c=o[s];return s+=1,c})}function ne(e,n,a){const{format:t=""}=n,o=new Date(e).getTime(),m=Date.now(),i=Math.max(a?o-m:m-o,0);return te(i,t)}var ae=function(e,n){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(a[t[o]]=e[t[o]]);return a};function oe(e){return new Date(e).getTime()}const w=e=>{const{value:n,format:a="HH:mm:ss",onChange:t,onFinish:o,type:m}=e,i=ae(e,["value","format","onChange","onFinish","type"]),s=m==="countdown",[c,u]=r.useState(null),p=X(()=>{const l=Date.now(),g=oe(n);u({});const S=s?g-l:l-g;return t==null||t(S),s&&g<l?(o==null||o(),!1):!0});r.useEffect(()=>{let l;const g=()=>C.cancel(l),S=()=>{l=C(()=>{p()&&S()})};return S(),g},[n,s]),r.useEffect(()=>{u({})},[]);const d=(l,g)=>c?ne(l,Object.assign(Object.assign({},g),{format:a}),s):"-",f=l=>Y(l,{title:void 0});return r.createElement(O,Object.assign({},i,{value:n,valueRender:f,formatter:d}))},re=e=>r.createElement(w,Object.assign({},e,{type:"countdown"})),ce=r.memo(re);O.Timer=w;O.Countdown=ce;var se={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},le=function(n,a){return r.createElement(y,x({},n,{ref:a,icon:se}))},pe=r.forwardRef(le),ie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"},ue=function(n,a){return r.createElement(y,x({},n,{ref:a,icon:ie}))},ge=r.forwardRef(ue);export{ge as R,O as S,pe as a,de as b};
@@ -0,0 +1 @@
1
+ import{c as U,r as p,j as e}from"./index-B3CRby6r.js";import{b as c,H as T}from"./main-Cn4IDo2I.js";import{S as D}from"./StatusBadge-CG7wVqpu.js";import{L as F}from"./LoadingSpinner-BcHjaM1m.js";import{E as M}from"./EmptyState-DEyOQjbY.js";import{B as j}from"./sse-client-DGQ072hl.js";import{W as N,a as w,S as I}from"./wifi-CwYSE0J4.js";import{C,T as W,I as H}from"./triangle-alert-CrOQEdJ2.js";import{C as L}from"./circle-x-CvN9r3fW.js";import{C as z}from"./circle-check-big-CrZdwS75.js";import{T as O}from"./trash-2-BP7fkd5b.js";let m=null;const l=U(a=>({notifications:[],unreadCount:0,loading:!1,error:null,sseConnected:!1,fetchNotifications:async(r=!1)=>{a({loading:!0,error:null});try{const n=await(await c.api.notifications.$get({query:{unreadOnly:String(r)}})).json();n.success?a({notifications:n.data.items,loading:!1}):a({error:n.error,loading:!1})}catch(t){a({error:t instanceof Error?t.message:"Unknown error",loading:!1})}},createNotification:async r=>{a({loading:!0,error:null});try{const n=await(await c.api.notifications.$post({json:r})).json();n.success?a(o=>({notifications:[n.data,...o.notifications],unreadCount:o.unreadCount+1,loading:!1})):a({error:n.error,loading:!1})}catch(t){a({error:t instanceof Error?t.message:"Unknown error",loading:!1})}},markAsRead:async r=>{try{(await(await c.api.notifications[":id"].read.$patch({param:{id:r}})).json()).success&&a(o=>({notifications:o.notifications.map(i=>i.id===r?{...i,read:!0}:i),unreadCount:Math.max(0,o.unreadCount-1)}))}catch(t){console.error("Failed to mark as read:",t),a({error:t instanceof Error?t.message:"Unknown error"})}},markAllAsRead:async()=>{try{(await(await c.api.notifications["read-all"].$patch()).json()).success&&a(n=>({notifications:n.notifications.map(o=>({...o,read:!0})),unreadCount:0}))}catch(r){console.error("Failed to mark all as read:",r),a({error:r instanceof Error?r.message:"Unknown error"})}},deleteNotification:async r=>{try{(await(await c.api.notifications[":id"].$delete({param:{id:r}})).json()).success&&a(o=>{const i=o.notifications.find(d=>d.id===r);return{notifications:o.notifications.filter(d=>d.id!==r),unreadCount:i&&!i.read?o.unreadCount-1:o.unreadCount}})}catch(t){console.error("Failed to delete:",t),a({error:t instanceof Error?t.message:"Unknown error"})}},fetchUnreadCount:async()=>{try{const t=await(await c.api.notifications["unread-count"].$get()).json();t.success&&a({unreadCount:t.data.count})}catch(r){console.error("Failed to fetch unread count:",r),a({error:r instanceof Error?r.message:"Unknown error"})}},connectSSE:async()=>{if(!m)try{const r=c.api.notifications.stream.$sse();r.onStatusChange(t=>{a({sseConnected:t==="open"})}),r.on("connected",t=>{}),r.on("notification",t=>{a(n=>n.notifications.some(o=>o.id===t.id)?n:{notifications:[t,...n.notifications],unreadCount:t.read?n.unreadCount:n.unreadCount+1})}),r.onError(t=>{console.error("[SSE] Error:",t)}),m=r}catch(r){console.error("[SSE] Failed to connect:",r)}},disconnectSSE:()=>{m&&(m.abort(),m=null,a({sseConnected:!1}))}})),ee=()=>{const a=l(s=>s.notifications),r=l(s=>s.unreadCount),t=l(s=>s.sseConnected),n=l(s=>s.loading),o=l(s=>s.error),{fetchNotifications:i,createNotification:d,markAsRead:S,markAllAsRead:v,deleteNotification:k,connectSSE:E,disconnectSSE:A}=l(),[u,x]=p.useState(""),[f,h]=p.useState(""),[b,$]=p.useState("info");p.useEffect(()=>{i()},[i]);const B=async s=>{s.preventDefault(),!(!u.trim()||!f.trim())&&(await d({type:b,title:u,message:f}),x(""),h(""))},y={info:{icon:H,colorScheme:"blue",border:"border-blue-400",lightBg:"bg-blue-50"},warning:{icon:W,colorScheme:"yellow",border:"border-yellow-400",lightBg:"bg-yellow-50"},success:{icon:z,colorScheme:"green",border:"border-green-400",lightBg:"bg-green-50"},error:{icon:L,colorScheme:"red",border:"border-red-400",lightBg:"bg-red-50"}};return e.jsxs("div",{className:"max-w-3xl mx-auto p-6","data-testid":"notification-container",children:[e.jsxs(T,{children:[e.jsx("title",{children:"Notifications - Biomimic App"}),e.jsx("meta",{name:"description",content:"Real-time notifications powered by Server-Sent Events"}),e.jsx("meta",{property:"og:title",content:"Notifications - Biomimic App"}),e.jsx("meta",{property:"og:description",content:"Real-time notifications powered by Server-Sent Events"})]}),e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-3xl font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(j,{className:"w-8 h-8 text-purple-500"}),"Notifications"]}),e.jsx("p",{className:"text-gray-500 mt-2",children:"Demonstrates SSE (Server-Sent Events) with Hono RPC type inference"})]}),e.jsxs("div",{className:"mb-6 p-4 bg-white rounded-xl shadow-sm border border-gray-200 flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-gray-700",children:"SSE Status:"}),t?e.jsxs("span",{className:"flex items-center gap-1 text-green-600","data-testid":"sse-status-connected",children:[e.jsx(N,{className:"w-4 h-4"}),"Connected"]}):e.jsxs("span",{className:"flex items-center gap-1 text-red-500","data-testid":"sse-status-disconnected",children:[e.jsx(w,{className:"w-4 h-4"}),"Disconnected"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Unread:"}),e.jsx("span",{className:"px-2.5 py-0.5 bg-blue-500 text-white text-sm font-medium rounded-full","data-testid":"unread-count",children:r})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:E,disabled:t,className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-green-500 text-white hover:bg-green-600"}`,"data-testid":"connect-sse-button",children:[e.jsx(N,{className:"w-4 h-4"}),"Connect"]}),e.jsxs("button",{onClick:A,disabled:!t,className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t?"bg-red-500 text-white hover:bg-red-600":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,"data-testid":"disconnect-sse-button",children:[e.jsx(w,{className:"w-4 h-4"}),"Disconnect"]}),e.jsxs("button",{onClick:v,className:"flex items-center gap-1.5 px-4 py-2 bg-gray-500 text-white rounded-lg text-sm font-medium hover:bg-gray-600 transition-colors","data-testid":"mark-all-read-button",children:[e.jsx(C,{className:"w-4 h-4"}),"Mark All Read"]})]})]}),e.jsxs("form",{onSubmit:B,className:"mb-8 p-6 bg-white rounded-xl shadow-sm border border-gray-200",children:[e.jsxs("div",{className:"flex gap-4 mb-4",children:[e.jsxs("select",{value:b,onChange:s=>$(s.target.value),className:"px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 outline-none","data-testid":"notification-type-select",children:[e.jsx("option",{value:"info",children:"Info"}),e.jsx("option",{value:"warning",children:"Warning"}),e.jsx("option",{value:"success",children:"Success"}),e.jsx("option",{value:"error",children:"Error"})]}),e.jsx("input",{type:"text",value:u,onChange:s=>x(s.target.value),placeholder:"Title...",className:"flex-1 px-4 py-3 text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent outline-none","data-testid":"notification-title-input"})]}),e.jsx("div",{className:"mb-4",children:e.jsx("textarea",{value:f,onChange:s=>h(s.target.value),placeholder:"Message...",className:"w-full px-4 py-3 text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent outline-none resize-none min-h-[100px]","data-testid":"notification-message-input"})}),e.jsxs("button",{type:"submit",disabled:!u.trim()||!f.trim()||n,className:"flex items-center gap-2 px-6 py-3 text-base font-medium text-white bg-purple-500 rounded-lg hover:bg-purple-600 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors","data-testid":"create-notification-button",children:[n?e.jsx(F,{size:"sm",color:"text-white"}):e.jsx(I,{className:"w-5 h-5"}),"Create Notification"]})]}),o&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 text-red-700 rounded-lg",children:o}),e.jsx("div",{className:"space-y-4",children:a.map(s=>{const g=y[s.type]??y.info,R=g.icon;return e.jsx("div",{className:`p-5 rounded-xl border-l-4 transition-all ${s.read?"bg-gray-50 border-gray-200":"bg-white border-gray-200 shadow-sm"} ${g.border}`,"data-testid":s.read?"notification-item-read":"notification-item-unread",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(D,{label:s.type.toUpperCase(),icon:R,colorScheme:g.colorScheme}),e.jsx("span",{className:"font-medium text-gray-900","data-testid":"notification-title",children:s.title})]}),e.jsx("p",{className:"text-gray-600 text-sm","data-testid":"notification-message",children:s.message}),e.jsx("span",{className:"text-xs text-gray-400 mt-2 block",children:new Date(s.createdAt).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!s.read&&e.jsx("button",{onClick:()=>S(s.id),className:"p-2 text-gray-400 hover:text-blue-500 hover:bg-blue-50 rounded-lg transition-colors",title:"Mark as read","data-testid":"mark-as-read-button",children:e.jsx(C,{className:"w-5 h-5"})}),e.jsx("button",{onClick:()=>k(s.id),className:"p-2 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors","data-testid":"delete-notification-button",children:e.jsx(O,{className:"w-5 h-5"})})]})]})},s.id)})}),!n&&a.length===0&&e.jsx(M,{icon:j,title:"No notifications yet. Create one above!",className:"py-12"})]})};export{ee as NotificationPage};
@@ -0,0 +1,11 @@
1
+ import{r,j as e}from"./index-B3CRby6r.js";import{H as u,c as b,P as f,b as y}from"./main-Cn4IDo2I.js";import{L as j}from"./LoadingSpinner-BcHjaM1m.js";import{C as N}from"./circle-x-CvN9r3fW.js";import{C as v}from"./circle-check-big-CrZdwS75.js";import{c as o}from"./sse-client-DGQ072hl.js";import{C as w}from"./clock-CTeSZBiH.js";/**
2
+ * @license lucide-react v0.576.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const k=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],$=o("rotate-ccw",k);/**
7
+ * @license lucide-react v0.576.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const C=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],m=o("truck",C),S={processing:{label:"Processing",icon:w,bg:"bg-amber-100",text:"text-amber-700"},shipped:{label:"Shipped",icon:m,bg:"bg-blue-100",text:"text-blue-700"},delivered:{label:"Delivered",icon:v,bg:"bg-green-100",text:"text-green-700"},cancelled:{label:"Cancelled",icon:N,bg:"bg-red-100",text:"text-red-700"}},O=[{value:"all",label:"All"},{value:"processing",label:"Processing"},{value:"shipped",label:"Shipped"},{value:"delivered",label:"Delivered"},{value:"cancelled",label:"Cancelled"}],I=()=>{const[l,x]=r.useState("all"),[i,p]=r.useState([]),[g,h]=r.useState(!0);r.useEffect(()=>{async function t(){try{const a=await(await y.api["orders-mock"].$get()).json();a.success&&p(a.data)}finally{h(!1)}}t()},[]);const d=l==="all"?i:i.filter(t=>t.status===l);return g?e.jsx("div",{className:"flex items-center justify-center py-20","data-testid":"orders-loading",children:e.jsx(j,{size:"lg"})}):e.jsxs("div",{className:"max-w-4xl mx-auto p-4 sm:p-6","data-testid":"orders-page",children:[e.jsxs(u,{children:[e.jsx("title",{children:"Order History - Biomimic App"}),e.jsx("meta",{name:"description",content:"View your order history and track shipments"})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900","data-testid":"orders-title",children:"Order History"}),e.jsxs("p",{className:"text-gray-500 mt-2",children:[i.length," orders placed"]})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-6","data-testid":"orders-filters",children:O.map(t=>e.jsx("button",{onClick:()=>x(t.value),className:`px-4 py-2 text-sm font-medium rounded-xl transition-colors ${l===t.value?"bg-amber-500 text-white":"bg-white text-gray-600 border border-gray-200 hover:bg-gray-50"}`,"data-testid":`orders-filter-${t.value}`,children:t.label},t.value))}),d.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20","data-testid":"orders-empty",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-gray-100 flex items-center justify-center mb-6",children:e.jsx(b,{className:"w-10 h-10 text-gray-400"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"No orders found"}),e.jsx("p",{className:"text-gray-500",children:"No orders match the selected filter."})]}):e.jsx("div",{className:"space-y-4","data-testid":"orders-list",children:d.map(t=>{const s=S[t.status],a=s.icon;return e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-5","data-testid":`order-card-${t.id}`,children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"font-semibold text-gray-900","data-testid":`order-id-${t.id}`,children:t.id}),e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-xs font-medium ${s.bg} ${s.text}`,"data-testid":`order-status-${t.id}`,children:[e.jsx(a,{className:"w-3.5 h-3.5"}),s.label]})]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5","data-testid":`order-date-${t.id}`,children:new Date(t.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900","data-testid":`order-total-${t.id}`,children:["$",t.total.toFixed(2)]})]}),e.jsx("div",{className:"flex items-center gap-2 mb-4","data-testid":`order-products-${t.id}`,children:t.products.map((c,n)=>e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-gray-50 rounded-lg","data-testid":`order-product-${t.id}-${n}`,children:[e.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center flex-shrink-0",style:{backgroundColor:c.color},children:e.jsx(f,{className:"w-3 h-3 text-white/70"})}),e.jsx("span",{className:"text-sm text-gray-700 truncate max-w-[120px] sm:max-w-[200px]",children:c.name})]},n))}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-gray-100",children:[(t.status==="shipped"||t.status==="processing")&&e.jsxs("button",{className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-amber-600 bg-amber-50 rounded-xl hover:bg-amber-100 transition-colors","data-testid":`order-track-${t.id}`,children:[e.jsx(m,{className:"w-4 h-4"}),"Track Order"]}),e.jsxs("button",{className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-gray-600 bg-gray-50 rounded-xl hover:bg-gray-100 transition-colors","data-testid":`order-reorder-${t.id}`,children:[e.jsx($,{className:"w-4 h-4"}),"Reorder"]})]})]},t.id)})})]})};export{I as OrdersPage};
@@ -1,21 +1,11 @@
1
- import{c as m,o as A,r as x,j as e,L as j,U as D}from"./index-1bA-ixFv.js";import{H as U,P as M,C as z}from"./main-DHnArIp_.js";import{u as l}from"./pluginStore-XQfsm3iR.js";import{S as w}from"./StatusBadge-BJ3W2Zc7.js";import{L as N}from"./LoadingSpinner-DVYOLSRM.js";import{A as v}from"./arrow-left-H5JH0iU1.js";import{D as y}from"./download-BsGC_Xhq.js";import{E}from"./external-link-UTDzdjq8.js";import{T as I}from"./tag-DsiUPF90.js";/**
1
+ import{k as D,r as d,j as e,L as b}from"./index-B3CRby6r.js";import{H as U,P as _,C as E}from"./main-Cn4IDo2I.js";import{u as r}from"./pluginStore-DDsWJPe6.js";import{S as j}from"./StatusBadge-CG7wVqpu.js";import{L as w}from"./LoadingSpinner-BcHjaM1m.js";import{A as N}from"./arrow-left-DtLQ3tTk.js";import{c as y,U as I}from"./sse-client-DGQ072hl.js";import{a as M,S as m}from"./star-C7tO6w4H.js";import{D as v}from"./download-OSVfVuNV.js";import{E as z}from"./external-link-fBsuHMby.js";import{T as B}from"./tag-DBfpQDuJ.js";/**
2
2
  * @license lucide-react v0.576.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const $=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],B=m("globe",$);/**
6
+ */const F=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],H=y("globe",F);/**
7
7
  * @license lucide-react v0.576.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const F=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],H=m("shield",F);/**
12
- * @license lucide-react v0.576.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const T=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],d=m("star",T);/**
17
- * @license lucide-react v0.576.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const W=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],G=m("terminal",W),ee=()=>{const{slug:r}=A(),s=l(t=>t.currentPlugin),i=l(t=>t.reviews),k=l(t=>t.loading),h=l(t=>t.error),p=l(t=>t.fetchPlugin),g=l(t=>t.fetchReviews),R=l(t=>t.trackInstall),S=l(t=>t.submitReview),u=l(t=>t.clearCurrentPlugin),[n,o]=x.useState({rating:5,title:"",content:""}),[f,b]=x.useState(!1);x.useEffect(()=>(r&&(p(r),g(r)),()=>u()),[r,p,g,u]);const C=async()=>{r&&await R(r)},P=async t=>{t.preventDefault(),r&&(b(!0),await S(r,n),b(!1),o({rating:5,title:"",content:""}))};if(k&&!s)return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-slate-900 via-purple-900 to-slate-50",children:e.jsx("div",{className:"flex items-center justify-center py-32",children:e.jsx(N,{size:"lg",color:"text-white"})})});if(h&&!s)return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-slate-900 via-purple-900 to-slate-50 px-6 pt-12",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("div",{className:"p-5 bg-red-500/10 border border-red-500/20 text-red-300 rounded-2xl backdrop-blur-sm",children:h}),e.jsxs(j,{to:"/plugins",className:"mt-4 inline-flex items-center gap-2 text-purple-300 hover:text-white transition-colors",children:[e.jsx(v,{className:"w-4 h-4"}),"Back to Plugins"]})]})});if(!s)return null;const _={approved:"green",pending:"yellow",rejected:"red"},L=i.length>0?i.reduce((t,a)=>t+a.rating,0)/i.length:0;return e.jsxs("div",{className:"min-h-screen","data-testid":"plugin-detail-page",children:[e.jsxs(U,{children:[e.jsxs("title",{children:[s.name," - Plugin Marketplace"]}),e.jsx("meta",{name:"description",content:s.description})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-8 pb-20 px-6",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs(j,{to:"/plugins",className:"inline-flex items-center gap-2 text-purple-300 hover:text-white transition-colors mb-8 text-sm",children:[e.jsx(v,{className:"w-4 h-4"}),"Back to Marketplace"]}),e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-violet-500 to-fuchsia-500 flex items-center justify-center text-2xl font-bold text-white shadow-lg shadow-violet-500/30 shrink-0",children:s.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:s.name}),e.jsx(w,{label:s.status,colorScheme:_[s.status]||"gray"}),s.featured&&e.jsx(w,{label:"Featured",colorScheme:"purple"})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-3 text-sm text-purple-200/60 flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(D,{className:"w-4 h-4"}),s.authorName]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(M,{className:"w-4 h-4"}),"v",s.version]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(z,{className:"w-4 h-4"}),new Date(s.createdAt).toLocaleDateString()]}),s.license&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(H,{className:"w-4 h-4"}),s.license]})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center gap-3 flex-wrap",children:[e.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 font-semibold",children:[e.jsx(y,{className:"w-5 h-5"}),"Install Plugin"]}),s.repositoryUrl&&e.jsxs("a",{href:s.repositoryUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-5 py-3 bg-white/10 text-white rounded-xl hover:bg-white/20 transition-all text-sm backdrop-blur-sm border border-white/10",children:[e.jsx(B,{className:"w-4 h-4"}),"Repository"]}),s.homepageUrl&&e.jsxs("a",{href:s.homepageUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-5 py-3 bg-white/10 text-white rounded-xl hover:bg-white/20 transition-all text-sm backdrop-blur-sm border border-white/10",children:[e.jsx(E,{className:"w-4 h-4"}),"Homepage"]})]}),e.jsxs("div",{className:"mt-6 flex items-center gap-6 text-sm text-purple-200/50",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(y,{className:"w-4 h-4"}),e.jsx("span",{className:"text-white font-semibold",children:s.downloadCount})," ","downloads"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(d,{className:"w-4 h-4 text-yellow-400"}),e.jsx("span",{className:"text-white font-semibold",children:L.toFixed(1)}),e.jsxs("span",{children:["(",i.length," reviews)"]})]})]})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-6 -mt-8 pb-16",children:[e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-8",children:[e.jsx("p",{className:"text-gray-600 leading-relaxed text-base",children:s.description}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"mt-6 flex items-center gap-2 flex-wrap",children:s.tags.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1.5 bg-gradient-to-r from-violet-50 to-fuchsia-50 text-violet-700 rounded-lg text-sm font-medium",children:[e.jsx(I,{className:"w-3.5 h-3.5 opacity-60"}),t]},t))}),s.commands&&s.commands.length>0&&e.jsxs("div",{className:"mt-8",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2 mb-4",children:[e.jsx(G,{className:"w-5 h-5 text-violet-500"}),"Commands"]}),e.jsx("div",{className:"space-y-2",children:s.commands.map((t,a)=>e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsx("code",{className:"text-sm font-mono text-violet-600 font-semibold bg-violet-50 px-2 py-0.5 rounded",children:t.name}),t.description&&e.jsx("span",{className:"text-sm text-gray-500",children:t.description})]},a))})]})]}),e.jsxs("div",{className:"mt-6 bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-8",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2 mb-6",children:[e.jsx(d,{className:"w-5 h-5 text-yellow-400"}),"Reviews (",i.length,")"]}),i.length>0?e.jsx("div",{className:"space-y-4",children:i.map(t=>e.jsxs("div",{className:"p-5 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-violet-400 to-fuchsia-400 flex items-center justify-center text-white text-sm font-bold",children:t.userName.charAt(0).toUpperCase()}),e.jsx("span",{className:"font-semibold text-gray-900",children:t.userName}),e.jsx("div",{className:"flex items-center",children:Array.from({length:5}).map((a,c)=>e.jsx(d,{className:`w-4 h-4 ${c<t.rating?"text-yellow-400 fill-yellow-400":"text-gray-200"}`},c))})]}),e.jsx("span",{className:"text-xs text-gray-400",children:new Date(t.createdAt).toLocaleDateString()})]}),t.title&&e.jsx("h4",{className:"mt-3 font-semibold text-gray-800",children:t.title}),t.content&&e.jsx("p",{className:"mt-1.5 text-sm text-gray-600 leading-relaxed",children:t.content})]},t.id))}):e.jsx("p",{className:"text-gray-400 text-sm",children:"No reviews yet. Be the first to review!"}),e.jsxs("form",{onSubmit:P,className:"mt-8 pt-8 border-t border-gray-100",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-5",children:"Write a Review"}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Rating"}),e.jsx("div",{className:"flex items-center gap-1.5",children:Array.from({length:5}).map((t,a)=>e.jsx("button",{type:"button",onClick:()=>o(c=>({...c,rating:a+1})),children:e.jsx(d,{className:`w-7 h-7 cursor-pointer transition-all ${a<n.rating?"text-yellow-400 fill-yellow-400 scale-110":"text-gray-200 hover:text-yellow-300 hover:scale-105"}`})},a))})]}),e.jsx("div",{className:"mb-4",children:e.jsx("input",{type:"text",value:n.title??"",onChange:t=>o(a=>({...a,title:t.target.value})),placeholder:"Review title (optional)",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})}),e.jsx("div",{className:"mb-5",children:e.jsx("textarea",{value:n.content??"",onChange:t=>o(a=>({...a,content:t.target.value})),placeholder:"Write your review... (optional)",rows:3,className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm resize-none transition-all"})}),e.jsx("button",{type:"submit",disabled:f,className:"px-5 py-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 disabled:from-gray-300 disabled:to-gray-300 disabled:cursor-not-allowed transition-all text-sm font-semibold shadow-md shadow-violet-500/15",children:f?e.jsx(N,{size:"sm",color:"text-white"}):"Submit Review"})]})]})]})]})};export{ee as PluginDetailPage};
11
+ */const T=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$=y("terminal",T),ee=()=>{const{slug:l}=D(),s=r(t=>t.currentPlugin),i=r(t=>t.reviews),k=r(t=>t.loading),x=r(t=>t.error),h=r(t=>t.fetchPlugin),p=r(t=>t.fetchReviews),S=r(t=>t.trackInstall),R=r(t=>t.submitReview),g=r(t=>t.clearCurrentPlugin),[n,o]=d.useState({rating:5,title:"",content:""}),[u,f]=d.useState(!1);d.useEffect(()=>(l&&(h(l),p(l)),()=>g()),[l,h,p,g]);const P=async()=>{l&&await S(l)},C=async t=>{t.preventDefault(),l&&(f(!0),await R(l,n),f(!1),o({rating:5,title:"",content:""}))};if(k&&!s)return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-slate-900 via-purple-900 to-slate-50",children:e.jsx("div",{className:"flex items-center justify-center py-32",children:e.jsx(w,{size:"lg",color:"text-white"})})});if(x&&!s)return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-slate-900 via-purple-900 to-slate-50 px-6 pt-12",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("div",{className:"p-5 bg-red-500/10 border border-red-500/20 text-red-300 rounded-2xl backdrop-blur-sm",children:x}),e.jsxs(b,{to:"/plugins",className:"mt-4 inline-flex items-center gap-2 text-purple-300 hover:text-white transition-colors",children:[e.jsx(N,{className:"w-4 h-4"}),"Back to Plugins"]})]})});if(!s)return null;const L={approved:"green",pending:"yellow",rejected:"red"},A=i.length>0?i.reduce((t,a)=>t+a.rating,0)/i.length:0;return e.jsxs("div",{className:"min-h-screen","data-testid":"plugin-detail-page",children:[e.jsxs(U,{children:[e.jsxs("title",{children:[s.name," - Plugin Marketplace"]}),e.jsx("meta",{name:"description",content:s.description})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-8 pb-20 px-6",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs(b,{to:"/plugins",className:"inline-flex items-center gap-2 text-purple-300 hover:text-white transition-colors mb-8 text-sm",children:[e.jsx(N,{className:"w-4 h-4"}),"Back to Marketplace"]}),e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-violet-500 to-fuchsia-500 flex items-center justify-center text-2xl font-bold text-white shadow-lg shadow-violet-500/30 shrink-0",children:s.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:s.name}),e.jsx(j,{label:s.status,colorScheme:L[s.status]||"gray"}),s.featured&&e.jsx(j,{label:"Featured",colorScheme:"purple"})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-3 text-sm text-purple-200/60 flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(I,{className:"w-4 h-4"}),s.authorName]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(_,{className:"w-4 h-4"}),"v",s.version]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(E,{className:"w-4 h-4"}),new Date(s.createdAt).toLocaleDateString()]}),s.license&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(M,{className:"w-4 h-4"}),s.license]})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center gap-3 flex-wrap",children:[e.jsxs("button",{onClick:P,className:"flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 font-semibold",children:[e.jsx(v,{className:"w-5 h-5"}),"Install Plugin"]}),s.repositoryUrl&&e.jsxs("a",{href:s.repositoryUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-5 py-3 bg-white/10 text-white rounded-xl hover:bg-white/20 transition-all text-sm backdrop-blur-sm border border-white/10",children:[e.jsx(H,{className:"w-4 h-4"}),"Repository"]}),s.homepageUrl&&e.jsxs("a",{href:s.homepageUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-5 py-3 bg-white/10 text-white rounded-xl hover:bg-white/20 transition-all text-sm backdrop-blur-sm border border-white/10",children:[e.jsx(z,{className:"w-4 h-4"}),"Homepage"]})]}),e.jsxs("div",{className:"mt-6 flex items-center gap-6 text-sm text-purple-200/50",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(v,{className:"w-4 h-4"}),e.jsx("span",{className:"text-white font-semibold",children:s.downloadCount})," ","downloads"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(m,{className:"w-4 h-4 text-yellow-400"}),e.jsx("span",{className:"text-white font-semibold",children:A.toFixed(1)}),e.jsxs("span",{children:["(",i.length," reviews)"]})]})]})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-6 -mt-8 pb-16",children:[e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-8",children:[e.jsx("p",{className:"text-gray-600 leading-relaxed text-base",children:s.description}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"mt-6 flex items-center gap-2 flex-wrap",children:s.tags.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1.5 bg-gradient-to-r from-violet-50 to-fuchsia-50 text-violet-700 rounded-lg text-sm font-medium",children:[e.jsx(B,{className:"w-3.5 h-3.5 opacity-60"}),t]},t))}),s.commands&&s.commands.length>0&&e.jsxs("div",{className:"mt-8",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2 mb-4",children:[e.jsx($,{className:"w-5 h-5 text-violet-500"}),"Commands"]}),e.jsx("div",{className:"space-y-2",children:s.commands.map((t,a)=>e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsx("code",{className:"text-sm font-mono text-violet-600 font-semibold bg-violet-50 px-2 py-0.5 rounded",children:t.name}),t.description&&e.jsx("span",{className:"text-sm text-gray-500",children:t.description})]},a))})]})]}),e.jsxs("div",{className:"mt-6 bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-8",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2 mb-6",children:[e.jsx(m,{className:"w-5 h-5 text-yellow-400"}),"Reviews (",i.length,")"]}),i.length>0?e.jsx("div",{className:"space-y-4",children:i.map(t=>e.jsxs("div",{className:"p-5 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-violet-400 to-fuchsia-400 flex items-center justify-center text-white text-sm font-bold",children:t.userName.charAt(0).toUpperCase()}),e.jsx("span",{className:"font-semibold text-gray-900",children:t.userName}),e.jsx("div",{className:"flex items-center",children:Array.from({length:5}).map((a,c)=>e.jsx(m,{className:`w-4 h-4 ${c<t.rating?"text-yellow-400 fill-yellow-400":"text-gray-200"}`},c))})]}),e.jsx("span",{className:"text-xs text-gray-400",children:new Date(t.createdAt).toLocaleDateString()})]}),t.title&&e.jsx("h4",{className:"mt-3 font-semibold text-gray-800",children:t.title}),t.content&&e.jsx("p",{className:"mt-1.5 text-sm text-gray-600 leading-relaxed",children:t.content})]},t.id))}):e.jsx("p",{className:"text-gray-400 text-sm",children:"No reviews yet. Be the first to review!"}),e.jsxs("form",{onSubmit:C,className:"mt-8 pt-8 border-t border-gray-100",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-5",children:"Write a Review"}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Rating"}),e.jsx("div",{className:"flex items-center gap-1.5",children:Array.from({length:5}).map((t,a)=>e.jsx("button",{type:"button",onClick:()=>o(c=>({...c,rating:a+1})),children:e.jsx(m,{className:`w-7 h-7 cursor-pointer transition-all ${a<n.rating?"text-yellow-400 fill-yellow-400 scale-110":"text-gray-200 hover:text-yellow-300 hover:scale-105"}`})},a))})]}),e.jsx("div",{className:"mb-4",children:e.jsx("input",{type:"text",value:n.title??"",onChange:t=>o(a=>({...a,title:t.target.value})),placeholder:"Review title (optional)",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})}),e.jsx("div",{className:"mb-5",children:e.jsx("textarea",{value:n.content??"",onChange:t=>o(a=>({...a,content:t.target.value})),placeholder:"Write your review... (optional)",rows:3,className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm resize-none transition-all"})}),e.jsx("button",{type:"submit",disabled:u,className:"px-5 py-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 disabled:from-gray-300 disabled:to-gray-300 disabled:cursor-not-allowed transition-all text-sm font-semibold shadow-md shadow-violet-500/15",children:u?e.jsx(w,{size:"sm",color:"text-white"}):"Submit Review"})]})]})]})]})};export{ee as PluginDetailPage};
@@ -0,0 +1,6 @@
1
+ import{r as h,j as e,L as c}from"./index-B3CRby6r.js";import{H as j,P as g,S as u}from"./main-Cn4IDo2I.js";import{u as t}from"./pluginStore-DDsWJPe6.js";import{S as p}from"./StatusBadge-CG7wVqpu.js";import{L as N}from"./LoadingSpinner-BcHjaM1m.js";import{E as w}from"./EmptyState-DEyOQjbY.js";import{c as y,T as k}from"./sse-client-DGQ072hl.js";import{S as C,a as S}from"./star-C7tO6w4H.js";import{D as P}from"./download-OSVfVuNV.js";import{E}from"./eye-CwlZZEsj.js";import{E as b}from"./external-link-fBsuHMby.js";import{T as U}from"./tag-DBfpQDuJ.js";import{C as L,a as A}from"./chevron-right-CnU7oPQs.js";/**
2
+ * @license lucide-react v0.576.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const B=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],M=y("zap",B),T=r=>{switch(r==null?void 0:r.toLowerCase()){case"approved":return"green";case"pending":return"yellow";case"rejected":return"red";default:return"gray"}},O=()=>{const r=t(s=>s.plugins),f=t(s=>s.loading),d=t(s=>s.error),v=t(s=>s.categories),i=t(s=>s.selectedCategory),a=t(s=>s.pagination),l=t(s=>s.fetchPlugins),m=t(s=>s.fetchCategories),x=t(s=>s.setSelectedCategory);h.useEffect(()=>{l(1),m()},[l,m]),h.useEffect(()=>{l(1)},[i,l]);const n=Math.ceil(a.total/a.limit);return e.jsxs("div",{className:"min-h-screen","data-testid":"plugins-page",children:[e.jsxs(j,{children:[e.jsx("title",{children:"Plugin Marketplace - Biomimic App"}),e.jsx("meta",{name:"description",content:"Browse and discover plugins for your application"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-16 px-6",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(g,{className:"w-6 h-6 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Plugin Marketplace"})]}),e.jsx("p",{className:"text-purple-200/70 text-lg max-w-xl",children:"Extend your application with powerful plugins. Browse, install, and publish community-built extensions."}),e.jsxs("div",{className:"mt-6 flex items-center gap-4",children:[e.jsxs(c,{to:"/publish",className:"group flex items-center gap-2 px-5 py-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 text-sm font-semibold",children:[e.jsx(u,{className:"w-4 h-4 group-hover:rotate-12 transition-transform"}),"Publish Plugin"]}),e.jsx(c,{to:"/search",className:"flex items-center gap-2 px-5 py-2.5 bg-white/10 text-white rounded-xl hover:bg-white/20 transition-all text-sm font-medium backdrop-blur-sm border border-white/10",children:"Search Plugins"})]})]})}),e.jsxs("div",{className:"max-w-6xl mx-auto px-6 -mt-8",children:[d&&e.jsx("div",{className:"mb-6 p-4 bg-red-500/10 border border-red-500/20 text-red-300 rounded-2xl backdrop-blur-sm",children:d}),e.jsxs("div",{className:"flex gap-8",children:[e.jsx("aside",{className:"w-60 flex-shrink-0 hidden lg:block",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-lg shadow-black/5 border border-gray-100 p-4 sticky top-6",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3 px-2",children:"Categories"}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("button",{onClick:()=>x(null),className:`w-full text-left px-3 py-2.5 text-sm rounded-xl transition-all flex items-center gap-2 ${i?"text-gray-600 hover:bg-gray-50":"bg-gradient-to-r from-violet-50 to-fuchsia-50 text-violet-700 font-semibold shadow-sm"}`,children:[e.jsx(M,{className:"w-4 h-4"}),"All Plugins"]}),v.map(s=>e.jsxs("button",{onClick:()=>x(s.slug),className:`w-full text-left px-3 py-2.5 text-sm rounded-xl transition-all flex items-center gap-2 ${i===s.slug?"bg-gradient-to-r from-violet-50 to-fuchsia-50 text-violet-700 font-semibold shadow-sm":"text-gray-600 hover:bg-gray-50"}`,children:[e.jsx("span",{className:"text-base",children:s.icon||"📁"}),s.name]},s.id))]})]})}),e.jsx("div",{className:"flex-1 min-w-0",children:f&&r.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(N,{size:"lg"})}):r.length===0?e.jsx(w,{icon:g,title:"No plugins found"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("p",{className:"text-sm text-gray-500",children:[e.jsx("span",{className:"font-semibold text-gray-700",children:a.total})," plugins available"]}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-400",children:[e.jsx(k,{className:"w-3.5 h-3.5"}),"Sorted by popularity"]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:r.map(s=>e.jsxs(c,{to:`/plugins/${s.slug}`,className:"group relative bg-white rounded-2xl border border-gray-100 hover:border-violet-200 hover:shadow-xl hover:shadow-violet-500/5 transition-all duration-300 block overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-violet-500/0 to-fuchsia-500/0 group-hover:from-violet-500/[0.02] group-hover:to-fuchsia-500/[0.04] transition-all duration-300"}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative",children:[s.screenshotUrl?e.jsx("img",{src:s.screenshotUrl,alt:s.name,className:"w-full h-32 object-cover"}):e.jsx("div",{className:"w-full h-20 bg-gradient-to-br from-violet-100 to-fuchsia-100"}),s.featured&&e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx("div",{className:"p-1.5 bg-amber-400 rounded-full shadow-lg",children:e.jsx(C,{className:"w-3.5 h-3.5 text-white fill-white"})})})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-violet-100 to-fuchsia-100 flex items-center justify-center text-lg font-bold text-violet-600 shrink-0",children:s.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 truncate group-hover:text-violet-700 transition-colors",children:s.name}),e.jsxs("p",{className:"text-xs text-gray-400",children:["by ",s.authorName]})]})]}),e.jsx(p,{label:`v${s.version}`,colorScheme:"purple"})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(p,{label:s.status||"Unknown",icon:S,colorScheme:T(s.status||"")}),s.license&&e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 bg-gray-100 text-gray-600 rounded text-xs font-medium",children:s.license})]}),e.jsx("p",{className:"text-sm text-gray-500 line-clamp-2 mb-4 leading-relaxed",children:s.description}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-400 mb-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"w-3.5 h-3.5"}),s.downloadCount]}),s.viewCount!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3.5 h-3.5"}),s.viewCount]})]}),(s.repositoryUrl||s.homepageUrl)&&e.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[s.repositoryUrl&&e.jsx("a",{href:s.repositoryUrl,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"p-1.5 rounded-lg bg-gray-50 hover:bg-gray-100 text-gray-400 hover:text-violet-600 transition-colors",title:"Repository",children:e.jsx(b,{className:"w-3.5 h-3.5"})}),s.homepageUrl&&e.jsx("a",{href:s.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"p-1.5 rounded-lg bg-gray-50 hover:bg-gray-100 text-gray-400 hover:text-violet-600 transition-colors",title:"Homepage",children:e.jsx(b,{className:"w-3.5 h-3.5"})})]}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:s.tags.map(o=>e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-gray-50 text-gray-500 rounded-md text-xs",children:[e.jsx(U,{className:"w-2.5 h-2.5 mr-0.5 opacity-50"}),o]},o))})]})]})]},s.id))}),n>1&&e.jsxs("div",{className:"mt-10 flex items-center justify-center gap-3",children:[e.jsx("button",{onClick:()=>l(a.page-1),disabled:a.page<=1,className:"p-2.5 rounded-xl bg-white border border-gray-200 hover:border-violet-300 hover:shadow-md disabled:opacity-30 disabled:cursor-not-allowed transition-all",children:e.jsx(L,{className:"w-5 h-5 text-gray-600"})}),e.jsx("div",{className:"flex items-center gap-1.5 px-4 py-2 bg-white rounded-xl border border-gray-200",children:e.jsxs("span",{className:"text-sm text-gray-600",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:a.page}),e.jsx("span",{className:"mx-1.5 text-gray-300",children:"/"}),n]})}),e.jsx("button",{onClick:()=>l(a.page+1),disabled:a.page>=n,className:"p-2.5 rounded-xl bg-white border border-gray-200 hover:border-violet-300 hover:shadow-md disabled:opacity-30 disabled:cursor-not-allowed transition-all",children:e.jsx(A,{className:"w-5 h-5 text-gray-600"})})]})]})})]})]})]})};export{O as PluginsPage};
@@ -0,0 +1,16 @@
1
+ import{r as i,j as e}from"./index-B3CRby6r.js";import{H as j,b as v}from"./main-Cn4IDo2I.js";import{L as N}from"./LoadingSpinner-BcHjaM1m.js";import{c as n}from"./sse-client-DGQ072hl.js";import{M as b}from"./message-square-BRaZfgbJ.js";/**
2
+ * @license lucide-react v0.576.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const w=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],m=n("file-text",w);/**
7
+ * @license lucide-react v0.576.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const k=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],M=n("pencil",k);/**
12
+ * @license lucide-react v0.576.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const S=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],T=n("thumbs-up",S),A={name:"Jane Doe",initials:"JD",joinedDate:"March 2025",bio:"Full-stack developer passionate about real-time web apps, type safety, and building developer tools."},L={topics:0,replies:0,likes:0},P=[{value:"activity",label:"Activity"},{value:"topics",label:"Topics"},{value:"replies",label:"Replies"}],_=s=>{switch(s){case"topic":return e.jsx(m,{className:"w-4 h-4"});case"reply":return e.jsx(b,{className:"w-4 h-4"});case"like":return e.jsx(T,{className:"w-4 h-4"})}},E=s=>{switch(s){case"topic":return"bg-emerald-100 text-emerald-600";case"reply":return"bg-blue-100 text-blue-600";case"like":return"bg-rose-100 text-rose-500"}},$=()=>{const[s,p]=i.useState("activity"),[l,h]=i.useState(A),[r,f]=i.useState(L),[x,y]=i.useState([]),[u,g]=i.useState(!0);i.useEffect(()=>{async function t(){try{const o=await(await v.api.profile.$get()).json();if(o.success){const a=o.data;a.profile&&h(a.profile),a.stats&&f(a.stats),a.activity&&y(a.activity)}}finally{g(!1)}}t()},[]);const c=s==="activity"?x:x.filter(t=>s==="topics"?t.type==="topic":s==="replies"?t.type==="reply":!0);return u?e.jsx("div",{className:"flex items-center justify-center py-20","data-testid":"profile-loading",children:e.jsx(N,{size:"lg"})}):e.jsxs("div",{className:"min-h-screen bg-white","data-testid":"profile-page",children:[e.jsxs(j,{children:[e.jsx("title",{children:"Profile — Community"}),e.jsx("meta",{name:"description",content:"Community user profile"})]}),e.jsx("div",{className:"bg-gradient-to-b from-emerald-50 to-white pt-12 pb-16 px-4 sm:px-6",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:items-start gap-5",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-emerald-500 text-white text-2xl font-bold flex items-center justify-center shadow-lg shadow-emerald-500/25 shrink-0",children:l.initials}),e.jsxs("div",{className:"text-center sm:text-left flex-1",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:l.name}),e.jsxs("p",{className:"text-sm text-gray-500 mt-0.5",children:["Joined ",l.joinedDate]}),e.jsx("p",{className:"text-gray-600 mt-2 text-sm leading-relaxed max-w-md",children:l.bio})]}),e.jsxs("button",{className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-500 hover:bg-emerald-600 text-white text-sm font-medium rounded-xl shadow-sm shadow-emerald-500/25 transition-colors self-center sm:self-start shrink-0",children:[e.jsx(M,{className:"w-3.5 h-3.5"}),"Edit Profile"]})]}),e.jsxs("div",{className:"flex justify-center sm:justify-start gap-6 mt-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-xl font-bold text-gray-900",children:r.topics}),e.jsx("div",{className:"text-xs text-gray-500",children:"Topics"})]}),e.jsx("div",{className:"w-px bg-gray-200"}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-xl font-bold text-gray-900",children:r.replies}),e.jsx("div",{className:"text-xs text-gray-500",children:"Replies"})]}),e.jsx("div",{className:"w-px bg-gray-200"}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-xl font-bold text-gray-900",children:r.likes}),e.jsx("div",{className:"text-xs text-gray-500",children:"Likes"})]})]})]})}),e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 -mt-6 pb-16",children:[e.jsx("div",{className:"flex gap-1 bg-gray-100 p-1 rounded-xl mb-6",children:P.map(t=>e.jsx("button",{onClick:()=>p(t.value),className:`flex-1 py-2 text-sm font-medium rounded-lg transition-colors ${s===t.value?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:t.label},t.value))}),c.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 bg-gray-100 rounded-full mb-3",children:e.jsx(m,{className:"w-6 h-6 text-gray-400"})}),e.jsx("p",{className:"text-gray-500 text-sm",children:"No items yet"})]}):e.jsx("div",{className:"space-y-1",children:c.map((t,d)=>e.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl hover:bg-gray-50 transition-colors",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${E(t.type)}`,children:_(t.type)}),d<c.length-1&&e.jsx("div",{className:"absolute top-8 left-1/2 -translate-x-px w-0.5 h-[calc(100%+4px)] bg-gray-100"})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[e.jsxs("p",{className:"text-sm text-gray-700 leading-relaxed",children:[e.jsx("span",{className:"text-gray-500",children:t.text})," ",e.jsx("span",{className:"font-medium text-gray-900",children:t.target})]}),e.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:t.time})]})]},t.id))})]})]})};export{$ as ProfilePage};
@@ -0,0 +1 @@
1
+ import{f as S,r as l,j as e}from"./index-B3CRby6r.js";import{H as U,R as D}from"./main-Cn4IDo2I.js";import{u as n}from"./pluginStore-DDsWJPe6.js";import{L as R}from"./LoadingSpinner-BcHjaM1m.js";import{P as b}from"./plus-DDZfPiDJ.js";import{X as f,U as L}from"./x-t615pnNR.js";import"./sse-client-DGQ072hl.js";const H=()=>{const d=n(t=>t.loading),c=n(t=>t.error),v=n(t=>t.createPlugin),y=n(t=>t.clearError),j=S(),[a,r]=l.useState({name:"",slug:"",description:"",repositoryUrl:void 0,homepageUrl:void 0,npmPackage:void 0,license:void 0,tags:[],commands:[]}),[o,m]=l.useState(""),[i,x]=l.useState(""),[g,u]=l.useState(""),p=()=>{o.trim()&&!(a.tags||[]).includes(o.trim())&&(r(t=>({...t,tags:[...t.tags||[],o.trim()]})),m(""))},N=t=>{r(s=>({...s,tags:(s.tags||[]).filter(h=>h!==t)}))},w=()=>{i.trim()&&(r(t=>({...t,commands:[...t.commands||[],{name:i.trim(),description:g.trim()||void 0}]})),x(""),u(""))},k=t=>{r(s=>({...s,commands:(s.commands||[]).filter((h,C)=>C!==t)}))},P=async t=>{t.preventDefault(),y();const s=await v(a);s&&j(`/plugins/${s}`)};return e.jsxs("div",{className:"min-h-screen","data-testid":"publish-page",children:[e.jsxs(U,{children:[e.jsx("title",{children:"Publish Plugin - Plugin Marketplace"}),e.jsx("meta",{name:"description",content:"Publish a new plugin to the marketplace"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-20 px-6",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(D,{className:"w-6 h-6 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Publish Plugin"})]}),e.jsx("p",{className:"text-purple-200/70 text-lg",children:"Share your creation with the community"})]})}),e.jsxs("div",{className:"max-w-2xl mx-auto px-6 -mt-8 pb-16",children:[c&&e.jsx("div",{className:"mb-6 p-4 bg-red-500/10 border border-red-500/20 text-red-600 rounded-2xl",children:c}),e.jsxs("form",{onSubmit:P,className:"space-y-5",children:[e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-7 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-6 bg-gradient-to-b from-violet-500 to-fuchsia-500 rounded-full"}),"Basic Information"]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Plugin Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.name,onChange:t=>r(s=>({...s,name:t.target.value})),placeholder:"My Awesome Plugin",required:!0,className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Slug ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.slug,onChange:t=>r(s=>({...s,slug:t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")})),placeholder:"my-awesome-plugin",required:!0,pattern:"^[a-z0-9-]+$",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm font-mono transition-all"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1.5",children:"Lowercase letters, numbers, and hyphens only"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Description ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("textarea",{value:a.description,onChange:t=>r(s=>({...s,description:t.target.value})),placeholder:"Describe what your plugin does...",required:!0,rows:4,className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm resize-none transition-all"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"Repository URL"}),e.jsx("input",{type:"url",value:a.repositoryUrl||"",onChange:t=>r(s=>({...s,repositoryUrl:t.target.value||void 0})),placeholder:"https://github.com/...",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"Homepage URL"}),e.jsx("input",{type:"url",value:a.homepageUrl||"",onChange:t=>r(s=>({...s,homepageUrl:t.target.value||void 0})),placeholder:"https://...",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"NPM Package"}),e.jsx("input",{type:"text",value:a.npmPackage||"",onChange:t=>r(s=>({...s,npmPackage:t.target.value||void 0})),placeholder:"@scope/package-name",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"License"}),e.jsx("input",{type:"text",value:a.license||"",onChange:t=>r(s=>({...s,license:t.target.value||void 0})),placeholder:"MIT",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-7 space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-6 bg-gradient-to-b from-violet-500 to-fuchsia-500 rounded-full"}),"Tags"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:o,onChange:t=>m(t.target.value),onKeyDown:t=>t.key==="Enter"&&(t.preventDefault(),p()),placeholder:"Add a tag...",className:"flex-1 px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"}),e.jsx("button",{type:"button",onClick:p,className:"p-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-sm",children:e.jsx(b,{className:"w-5 h-5"})})]}),a.tags&&a.tags.length>0&&e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:a.tags.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-gradient-to-r from-violet-50 to-fuchsia-50 text-violet-700 rounded-lg text-sm font-medium",children:[t,e.jsx("button",{type:"button",onClick:()=>N(t),className:"hover:text-red-500 transition-colors",children:e.jsx(f,{className:"w-3.5 h-3.5"})})]},t))})]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-7 space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-6 bg-gradient-to-b from-violet-500 to-fuchsia-500 rounded-full"}),"Commands"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:i,onChange:t=>x(t.target.value),placeholder:"Command name",className:"flex-1 px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"}),e.jsx("input",{type:"text",value:g,onChange:t=>u(t.target.value),placeholder:"Description (optional)",className:"flex-1 px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"}),e.jsx("button",{type:"button",onClick:w,className:"p-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-sm",children:e.jsx(b,{className:"w-5 h-5"})})]}),a.commands&&a.commands.length>0&&e.jsx("div",{className:"space-y-2",children:a.commands.map((t,s)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsx("code",{className:"text-sm font-mono text-violet-600 font-semibold bg-violet-50 px-2 py-0.5 rounded",children:t.name}),t.description&&e.jsx("span",{className:"text-sm text-gray-500",children:t.description}),e.jsx("button",{type:"button",onClick:()=>k(s),className:"ml-auto p-1 text-gray-400 hover:text-red-500 transition-colors",children:e.jsx(f,{className:"w-4 h-4"})})]},s))})]}),e.jsxs("button",{type:"submit",disabled:d||!a.name||!a.slug||!a.description,className:"w-full py-4 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-2xl hover:from-violet-400 hover:to-fuchsia-400 disabled:from-gray-300 disabled:to-gray-300 disabled:cursor-not-allowed transition-all font-semibold text-base flex items-center justify-center gap-2 shadow-lg shadow-violet-500/20",children:[d?e.jsx(R,{size:"sm",color:"text-white"}):e.jsx(L,{className:"w-5 h-5"}),"Publish Plugin"]})]})]})]})};export{H as PublishPage};
@@ -1,6 +1,6 @@
1
- import{c as p,n as b,r as n,j as e,L as f}from"./index-1bA-ixFv.js";import{u as s,H as y}from"./main-DHnArIp_.js";/**
1
+ import{f as p,r as n,j as e,L as f}from"./index-B3CRby6r.js";import{u as s,H as b}from"./main-Cn4IDo2I.js";import{c as y}from"./sse-client-DGQ072hl.js";/**
2
2
  * @license lucide-react v0.576.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const j=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],v=p("user-plus",j),C=()=>{const c=b(),u=s(t=>t.register),i=s(t=>t.loading),r=s(t=>t.error),a=s(t=>t.clearError),[o,m]=n.useState(""),[l,x]=n.useState(""),[d,g]=n.useState(""),h=async t=>{t.preventDefault(),await u(o,l,d),s.getState().error||c("/login")};return e.jsxs(e.Fragment,{children:[e.jsx(y,{children:e.jsx("title",{children:"Register - Biomimic App"})}),e.jsx("div",{className:"min-h-[calc(100vh-200px)] flex items-center justify-center",children:e.jsx("div",{className:"w-full max-w-md","data-testid":"register-page",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 p-8",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 bg-green-100 rounded-full mb-3",children:e.jsx(v,{className:"w-6 h-6 text-green-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Create Account"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Join Biomimic App today"})]}),e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:"Username"}),e.jsx("input",{id:"username",type:"text",value:o,onChange:t=>{m(t.target.value),r&&a()},placeholder:"Choose a username",required:!0,"data-testid":"register-username",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),e.jsx("input",{id:"email",type:"email",value:l,onChange:t=>{x(t.target.value),r&&a()},placeholder:"Enter your email",required:!0,"data-testid":"register-email",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),e.jsx("input",{id:"password",type:"password",value:d,onChange:t=>{g(t.target.value),r&&a()},placeholder:"Choose a password (min 6 chars)",required:!0,minLength:6,"data-testid":"register-password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),r&&e.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-lg px-3 py-2","data-testid":"register-error",children:r}),e.jsx("button",{type:"submit",disabled:i,"data-testid":"register-submit",className:"w-full py-2 px-4 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:i?"Creating account...":"Create Account"})]}),e.jsxs("p",{className:"mt-4 text-center text-sm text-gray-500",children:["Already have an account?"," ",e.jsx(f,{to:"/login",className:"text-blue-600 hover:text-blue-700 font-medium","data-testid":"register-login-link",children:"Sign in"})]})]})})})]})};export{C as RegisterPage};
6
+ */const j=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],v=y("user-plus",j),S=()=>{const c=p(),u=s(t=>t.register),i=s(t=>t.loading),r=s(t=>t.error),a=s(t=>t.clearError),[o,m]=n.useState(""),[l,x]=n.useState(""),[d,g]=n.useState(""),h=async t=>{t.preventDefault(),await u(o,l,d),s.getState().error||c("/login")};return e.jsxs(e.Fragment,{children:[e.jsx(b,{children:e.jsx("title",{children:"Register - Biomimic App"})}),e.jsx("div",{className:"min-h-[calc(100vh-200px)] flex items-center justify-center",children:e.jsx("div",{className:"w-full max-w-md","data-testid":"register-page",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 p-8",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 bg-green-100 rounded-full mb-3",children:e.jsx(v,{className:"w-6 h-6 text-green-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Create Account"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Join Biomimic App today"})]}),e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:"Username"}),e.jsx("input",{id:"username",type:"text",value:o,onChange:t=>{m(t.target.value),r&&a()},placeholder:"Choose a username",required:!0,"data-testid":"register-username",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),e.jsx("input",{id:"email",type:"email",value:l,onChange:t=>{x(t.target.value),r&&a()},placeholder:"Enter your email",required:!0,"data-testid":"register-email",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),e.jsx("input",{id:"password",type:"password",value:d,onChange:t=>{g(t.target.value),r&&a()},placeholder:"Choose a password (min 6 chars)",required:!0,minLength:6,"data-testid":"register-password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),r&&e.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-lg px-3 py-2","data-testid":"register-error",children:r}),e.jsx("button",{type:"submit",disabled:i,"data-testid":"register-submit",className:"w-full py-2 px-4 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:i?"Creating account...":"Create Account"})]}),e.jsxs("p",{className:"mt-4 text-center text-sm text-gray-500",children:["Already have an account?"," ",e.jsx(f,{to:"/login",className:"text-blue-600 hover:text-blue-700 font-medium","data-testid":"register-login-link",children:"Sign in"})]})]})})})]})};export{S as RegisterPage};
@@ -0,0 +1,2 @@
1
+ import{_ as k,bY as Ze,B as A,bF as ae,aT as Qe,W as Ye,az as D,bZ as Ge,b_ as se,aR as ie,C as B,aw as ue,b$ as de,c as w,by as Ke,bz as J,bd as Je,aB as et,aC as tt,bB as nt,aL as ot,aS as F,bc as lt,bm as ct,c0 as rt,c1 as at,u as ee,b2 as st,K as fe,bp as it,bk as ut,bf as dt,aX as ft,aY as mt,bg as vt,bC as Ct,bD as gt,b9 as bt,I as L,k as H,c2 as pt,c3 as xt}from"./api-request-DIJocPxr.js";import{r as o,R as O}from"./index-B3CRby6r.js";const yt=()=>{const[e,n]=o.useState([]),c=o.useCallback(t=>(n(l=>[].concat(k(l),[t])),()=>{n(l=>l.filter(s=>s!==t))}),[]);return[e,c]},V=e=>typeof(e==null?void 0:e.then)=="function",me=e=>{const{type:n,children:c,prefixCls:t,buttonProps:l,close:s,autoFocus:v,emitEvent:i,isSilent:a,quitOnNullishReturnValue:C,actionFn:r}=e,d=o.useRef(!1),p=o.useRef(null),[m,f]=Ze(!1),x=(...u)=>{s==null||s.apply(void 0,u)};o.useEffect(()=>{let u=null;return v&&(u=setTimeout(()=>{var b;(b=p.current)===null||b===void 0||b.focus({preventScroll:!0})})),()=>{u&&clearTimeout(u)}},[v]);const y=u=>{V(u)&&(f(!0),u.then((...b)=>{f(!1,!0),x.apply(void 0,b),d.current=!1},b=>{if(f(!1,!0),d.current=!1,!(a!=null&&a()))return Promise.reject(b)}))},g=u=>{if(d.current)return;if(d.current=!0,!r){x();return}let b;if(i){if(b=r(u),C&&!V(b)){d.current=!1,x(u);return}}else if(r.length)b=r(s),d.current=!1;else if(b=r(),!V(b)){x();return}y(b)};return o.createElement(A,Object.assign({},ae(n),{onClick:g,loading:m,prefixCls:t},l,{ref:p}),c)},R=O.createContext({}),{Provider:ve}=R,te=()=>{const{autoFocusButton:e,cancelButtonProps:n,cancelTextLocale:c,isSilent:t,mergedOkCancel:l,rootPrefixCls:s,close:v,onCancel:i,onConfirm:a}=o.useContext(R);return l?O.createElement(me,{isSilent:t,actionFn:i,close:(...C)=>{v==null||v.apply(void 0,C),a==null||a(!1)},autoFocus:e==="cancel",buttonProps:n,prefixCls:`${s}-btn`},c):null},ne=()=>{const{autoFocusButton:e,close:n,isSilent:c,okButtonProps:t,rootPrefixCls:l,okTextLocale:s,okType:v,onConfirm:i,onOk:a}=o.useContext(R);return O.createElement(me,{isSilent:c,type:v||"primary",actionFn:a,close:(...C)=>{n==null||n.apply(void 0,C),i==null||i(!0)},autoFocus:e==="ok",buttonProps:t,prefixCls:`${l}-btn`},s)},Ot=()=>Qe()&&window.document.documentElement;function oe(){}const ht=o.createContext({add:oe,remove:oe});function Pt(e){const n=o.useContext(ht),c=o.useRef(null);return Ye(l=>{if(l){const s=e?l.querySelector(e):l;s&&(n.add(s),c.current=s)}else n.remove(c.current)})}const le=()=>{const{cancelButtonProps:e,cancelTextLocale:n,onCancel:c}=o.useContext(R);return O.createElement(A,Object.assign({onClick:c},e),n)},ce=()=>{const{confirmLoading:e,okButtonProps:n,okType:c,okTextLocale:t,onOk:l}=o.useContext(R);return O.createElement(A,Object.assign({},ae(c),{loading:e,onClick:l},n),t)};function Ce(e,n){return O.createElement("span",{className:`${e}-close-x`},n||O.createElement(ie,{className:`${e}-close-icon`}))}const ge=e=>{const{okText:n,okType:c="primary",cancelText:t,confirmLoading:l,onOk:s,onCancel:v,okButtonProps:i,cancelButtonProps:a,footer:C}=e,[r]=D("Modal",se()),d=n||(r==null?void 0:r.okText),p=t||(r==null?void 0:r.cancelText),m=O.useMemo(()=>({confirmLoading:l,okButtonProps:i,cancelButtonProps:a,okTextLocale:d,cancelTextLocale:p,okType:c,onOk:s,onCancel:v}),[l,i,a,d,p,c,s,v]);let f;return typeof C=="function"||typeof C>"u"?(f=O.createElement(O.Fragment,null,O.createElement(le,null),O.createElement(ce,null)),typeof C=="function"&&(f=C(f,{OkBtn:ce,CancelBtn:le})),f=O.createElement(ve,{value:m},f)):f=C,O.createElement(Ge,{disabled:!1},f)};var $t=function(e,n){var c={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(c[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(c[t[l]]=e[t[l]]);return c};let W;const Et=e=>{W={x:e.pageX,y:e.pageY},setTimeout(()=>{W=null},100)};Ot()&&document.documentElement.addEventListener("click",Et,!0);const be=e=>{const{prefixCls:n,className:c,rootClassName:t,open:l,wrapClassName:s,centered:v,getContainer:i,focusTriggerAfterClose:a=!0,style:C,visible:r,width:d=520,footer:p,classNames:m,styles:f,children:x,loading:y,confirmLoading:g,zIndex:u,mousePosition:b,onOk:$,onCancel:T,destroyOnHidden:I,destroyOnClose:we,panelRef:Ie=null,modalRender:_}=e,Se=$t(e,["prefixCls","className","rootClassName","open","wrapClassName","centered","getContainer","focusTriggerAfterClose","style","visible","width","footer","classNames","styles","children","loading","confirmLoading","zIndex","mousePosition","onOk","onCancel","destroyOnHidden","destroyOnClose","panelRef","modalRender"]),{getPopupContainer:ke,getPrefixCls:q,direction:Re,modal:h}=o.useContext(B),U=E=>{g||T==null||T(E)},Ne=E=>{$==null||$(E)},P=q("modal",n),X=q(),Z=ue(P),[Me,Q,ze]=de(P,Z),Fe=w(s,{[`${P}-centered`]:v??(h==null?void 0:h.centered),[`${P}-wrap-rtl`]:Re==="rtl"}),Be=p!==null&&!y?o.createElement(ge,Object.assign({},e,{onOk:Ne,onCancel:U})):null,[Y,G,Le,He]=Ke(J(e),J(h),{closable:!0,closeIcon:o.createElement(ie,{className:`${P}-close-icon`}),closeIconRender:E=>Ce(P,E)}),_e=_?E=>o.createElement("div",{className:`${P}-render`},_(E)):void 0,Ve=`.${P}-${_?"render":"content"}`,We=Pt(Ve),Ae=Je(Ie,We),[De,qe]=et("Modal",u),[Ue,M]=o.useMemo(()=>d&&typeof d=="object"?[void 0,d]:[d,void 0],[d]),Xe=o.useMemo(()=>{const E={};return M&&Object.keys(M).forEach(K=>{const z=M[K];z!==void 0&&(E[`--${P}-${K}-width`]=typeof z=="number"?`${z}px`:z)}),E},[P,M]);return Me(o.createElement(tt,{form:!0,space:!0},o.createElement(nt.Provider,{value:qe},o.createElement(ot,Object.assign({width:Ue},Se,{zIndex:De,getContainer:i===void 0?ke:i,prefixCls:P,rootClassName:w(Q,t,ze,Z),footer:Be,visible:l??r,mousePosition:b??W,onClose:U,closable:Y&&Object.assign({disabled:Le,closeIcon:G},He),closeIcon:G,focusTriggerAfterClose:a,transitionName:F(X,"zoom",e.transitionName),maskTransitionName:F(X,"fade",e.maskTransitionName),className:w(Q,c,h==null?void 0:h.className),style:Object.assign(Object.assign(Object.assign({},h==null?void 0:h.style),C),Xe),classNames:Object.assign(Object.assign(Object.assign({},h==null?void 0:h.classNames),m),{wrapper:w(Fe,m==null?void 0:m.wrapper)}),styles:Object.assign(Object.assign({},h==null?void 0:h.styles),f),panelRef:Ae,destroyOnClose:I??we,modalRender:_e}),y?o.createElement(lt,{active:!0,title:!1,paragraph:{rows:4},className:`${P}-body-skeleton`}):x))))},jt=e=>{const{componentCls:n,titleFontSize:c,titleLineHeight:t,modalConfirmIconSize:l,fontSize:s,lineHeight:v,modalTitleHeight:i,fontHeight:a,confirmBodyPadding:C}=e,r=`${n}-confirm`;return{[r]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${r}-body-wrapper`]:Object.assign({},st()),[`&${n} ${n}-body`]:{padding:C},[`${r}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:l,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(a).sub(l).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(i).sub(l).equal()).div(2).equal()}},[`${r}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${ee(e.marginSM)})`},[`${e.iconCls} + ${r}-paragraph`]:{maxWidth:`calc(100% - ${ee(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${r}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:c,lineHeight:t},[`${r}-content`]:{color:e.colorText,fontSize:s,lineHeight:v},[`${r}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${r}-error ${r}-body > ${e.iconCls}`]:{color:e.colorError},[`${r}-warning ${r}-body > ${e.iconCls},
2
+ ${r}-confirm ${r}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${r}-info ${r}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${r}-success ${r}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},Tt=ct(["Modal","confirm"],e=>{const n=rt(e);return jt(n)},at,{order:-1e3});var wt=function(e,n){var c={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(c[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(c[t[l]]=e[t[l]]);return c};const pe=e=>{const{prefixCls:n,icon:c,okText:t,cancelText:l,confirmPrefixCls:s,type:v,okCancel:i,footer:a,locale:C}=e,r=wt(e,["prefixCls","icon","okText","cancelText","confirmPrefixCls","type","okCancel","footer","locale"]);let d=c;if(!c&&c!==null)switch(v){case"info":d=o.createElement(vt,null);break;case"success":d=o.createElement(mt,null);break;case"error":d=o.createElement(ft,null);break;default:d=o.createElement(dt,null)}const p=i??v==="confirm",m=e.autoFocusButton===null?!1:e.autoFocusButton||"ok",[f]=D("Modal"),x=C||f,y=t||(p?x==null?void 0:x.okText:x==null?void 0:x.justOkText),g=l||(x==null?void 0:x.cancelText),u=o.useMemo(()=>Object.assign({autoFocusButton:m,cancelTextLocale:g,okTextLocale:y,mergedOkCancel:p},r),[m,g,y,p,r]),b=o.createElement(o.Fragment,null,o.createElement(te,null),o.createElement(ne,null)),$=e.title!==void 0&&e.title!==null,T=`${s}-body`;return o.createElement("div",{className:`${s}-body-wrapper`},o.createElement("div",{className:w(T,{[`${T}-has-title`]:$})},d,o.createElement("div",{className:`${s}-paragraph`},$&&o.createElement("span",{className:`${s}-title`},e.title),o.createElement("div",{className:`${s}-content`},e.content))),a===void 0||typeof a=="function"?o.createElement(ve,{value:u},o.createElement("div",{className:`${s}-btns`},typeof a=="function"?a(b,{OkBtn:ne,CancelBtn:te}):b)):a,o.createElement(Tt,{prefixCls:n}))},It=e=>{const{close:n,zIndex:c,maskStyle:t,direction:l,prefixCls:s,wrapClassName:v,rootPrefixCls:i,bodyStyle:a,closable:C=!1,onConfirm:r,styles:d,title:p}=e,m=`${s}-confirm`,f=e.width||416,x=e.style||{},y=e.mask===void 0?!0:e.mask,g=e.maskClosable===void 0?!1:e.maskClosable,u=w(m,`${m}-${e.type}`,{[`${m}-rtl`]:l==="rtl"},e.className),[,b]=it(),$=o.useMemo(()=>c!==void 0?c:b.zIndexPopupBase+ut,[c,b]);return o.createElement(be,Object.assign({},e,{className:u,wrapClassName:w({[`${m}-centered`]:!!e.centered},v),onCancel:()=>{n==null||n({triggerCancel:!0}),r==null||r(!1)},title:p,footer:null,transitionName:F(i||"","zoom",e.transitionName),maskTransitionName:F(i||"","fade",e.maskTransitionName),mask:y,maskClosable:g,style:x,styles:Object.assign({body:a,mask:t},d),width:f,zIndex:$,closable:C}),o.createElement(pe,Object.assign({},e,{confirmPrefixCls:m})))},xe=e=>{const{rootPrefixCls:n,iconPrefixCls:c,direction:t,theme:l}=e;return o.createElement(fe,{prefixCls:n,iconPrefixCls:c,direction:t,theme:l},o.createElement(It,Object.assign({},e)))},S=[];let ye="";function Oe(){return ye}const St=e=>{var n,c;const{prefixCls:t,getContainer:l,direction:s}=e,v=se(),i=o.useContext(B),a=Oe()||i.getPrefixCls(),C=t||`${a}-modal`;let r=l;return r===!1&&(r=void 0),O.createElement(xe,Object.assign({},e,{rootPrefixCls:a,prefixCls:C,iconPrefixCls:i.iconPrefixCls,theme:i.theme,direction:s??i.direction,locale:(c=(n=i.locale)===null||n===void 0?void 0:n.Modal)!==null&&c!==void 0?c:v,getContainer:r}))};function N(e){const n=gt(),c=document.createDocumentFragment();let t=Object.assign(Object.assign({},e),{close:a,open:!0}),l,s;function v(...r){var d;if(r.some(f=>f==null?void 0:f.triggerCancel)){var m;(d=e.onCancel)===null||d===void 0||(m=d).call.apply(m,[e,()=>{}].concat(k(r.slice(1))))}for(let f=0;f<S.length;f++)if(S[f]===a){S.splice(f,1);break}s()}const i=r=>{clearTimeout(l),l=setTimeout(()=>{const d=n.getPrefixCls(void 0,Oe()),p=n.getIconPrefixCls(),m=n.getTheme(),f=O.createElement(St,Object.assign({},r));s=Ct()(O.createElement(fe,{prefixCls:d,iconPrefixCls:p,theme:m},typeof n.holderRender=="function"?n.holderRender(f):f),c)})};function a(...r){t=Object.assign(Object.assign({},t),{open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),v.apply(this,r)}}),t.visible&&delete t.visible,i(t)}function C(r){typeof r=="function"?t=r(t):t=Object.assign(Object.assign({},t),r),i(t)}return i(t),S.push(a),{destroy:a,update:C}}function he(e){return Object.assign(Object.assign({},e),{type:"warning"})}function Pe(e){return Object.assign(Object.assign({},e),{type:"info"})}function $e(e){return Object.assign(Object.assign({},e),{type:"success"})}function Ee(e){return Object.assign(Object.assign({},e),{type:"error"})}function je(e){return Object.assign(Object.assign({},e),{type:"confirm"})}function kt({rootPrefixCls:e}){ye=e}var Rt=function(e,n){var c={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(c[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(c[t[l]]=e[t[l]]);return c};const Nt=(e,n)=>{var c,{afterClose:t,config:l}=e,s=Rt(e,["afterClose","config"]);const[v,i]=o.useState(!0),[a,C]=o.useState(l),{direction:r,getPrefixCls:d}=o.useContext(B),p=d("modal"),m=d(),f=()=>{var u;t(),(u=a.afterClose)===null||u===void 0||u.call(a)},x=(...u)=>{var b;if(i(!1),u.some(I=>I==null?void 0:I.triggerCancel)){var T;(b=a.onCancel)===null||b===void 0||(T=b).call.apply(T,[a,()=>{}].concat(k(u.slice(1))))}};o.useImperativeHandle(n,()=>({destroy:x,update:u=>{C(b=>{const $=typeof u=="function"?u(b):u;return Object.assign(Object.assign({},b),$)})}}));const y=(c=a.okCancel)!==null&&c!==void 0?c:a.type==="confirm",[g]=D("Modal",bt.Modal);return o.createElement(xe,Object.assign({prefixCls:p,rootPrefixCls:m},a,{close:x,open:v,afterClose:f,okText:a.okText||(y?g==null?void 0:g.okText:g==null?void 0:g.justOkText),direction:a.direction||r,cancelText:a.cancelText||(g==null?void 0:g.cancelText)},s))},Mt=o.forwardRef(Nt);let re=0;const zt=o.memo(o.forwardRef((e,n)=>{const[c,t]=yt();return o.useImperativeHandle(n,()=>({patchElement:t}),[t]),o.createElement(o.Fragment,null,c)}));function Ft(){const e=o.useRef(null),[n,c]=o.useState([]);o.useEffect(()=>{n.length&&(k(n).forEach(v=>{v()}),c([]))},[n]);const t=o.useCallback(s=>function(i){var a;re+=1;const C=o.createRef();let r;const d=new Promise(y=>{r=y});let p=!1,m;const f=o.createElement(Mt,{key:`modal-${re}`,config:s(i),ref:C,afterClose:()=>{m==null||m()},isSilent:()=>p,onConfirm:y=>{r(y)}});return m=(a=e.current)===null||a===void 0?void 0:a.patchElement(f),m&&S.push(m),{destroy:()=>{function y(){var g;(g=C.current)===null||g===void 0||g.destroy()}C.current?y():c(g=>[].concat(k(g),[y]))},update:y=>{function g(){var u;(u=C.current)===null||u===void 0||u.update(y)}C.current?g():c(u=>[].concat(k(u),[g]))},then:y=>(p=!0,d.then(y))}},[]);return[o.useMemo(()=>({info:t(Pe),success:t($e),error:t(Ee),warning:t(he),confirm:t(je)}),[t]),o.createElement(zt,{key:"modal-holder",ref:e})]}var Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},Lt=function(n,c){return o.createElement(L,H({},n,{ref:c,icon:Bt}))},Yt=o.forwardRef(Lt),Ht=function(e,n){var c={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(c[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(c[t[l]]=e[t[l]]);return c};const _t=e=>{const{prefixCls:n,className:c,closeIcon:t,closable:l,type:s,title:v,children:i,footer:a}=e,C=Ht(e,["prefixCls","className","closeIcon","closable","type","title","children","footer"]),{getPrefixCls:r}=o.useContext(B),d=r(),p=n||r("modal"),m=ue(d),[f,x,y]=de(p,m),g=`${p}-confirm`;let u={};return s?u={closable:l??!1,title:"",footer:"",children:o.createElement(pe,Object.assign({},e,{prefixCls:p,confirmPrefixCls:g,rootPrefixCls:d,content:i}))}:u={closable:l??!0,title:v,footer:a!==null&&o.createElement(ge,Object.assign({},e)),children:i},f(o.createElement(xt,Object.assign({prefixCls:p,className:w(x,`${p}-pure-panel`,s&&g,s&&`${g}-${s}`,c,y,m)},C,{closeIcon:Ce(p,t),closable:l},u)))},Vt=pt(_t);function Te(e){return N(he(e))}const j=be;j.useModal=Ft;j.info=function(n){return N(Pe(n))};j.success=function(n){return N($e(n))};j.error=function(n){return N(Ee(n))};j.warning=Te;j.warn=Te;j.confirm=function(n){return N(je(n))};j.destroyAll=function(){for(;S.length;){const n=S.pop();n&&n()}};j.config=kt;j._InternalPanelDoNotUseOrYouWillBeFired=Vt;var Wt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},At=function(n,c){return o.createElement(L,H({},n,{ref:c,icon:Wt}))},Gt=o.forwardRef(At),Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},qt=function(n,c){return o.createElement(L,H({},n,{ref:c,icon:Dt}))},Kt=o.forwardRef(qt),Ut={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},Xt=function(n,c){return o.createElement(L,H({},n,{ref:c,icon:Ut}))},Jt=o.forwardRef(Xt);export{me as A,j as M,Yt as R,Kt as a,Gt as b,Jt as c,Pt as u};