@arcblock/payment-service 1.29.12 → 1.29.13

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 (163) hide show
  1. package/dist/cf.js +13 -13
  2. package/dist/index.js +10 -2
  3. package/package.json +3 -3
  4. package/web/assets/{account-DrsnH5wP.js → account-BN9x94rB.js} +1 -1
  5. package/web/assets/{action-C2c0yWuW.js → action-B9qBcxnd.js} +1 -1
  6. package/web/assets/{actions-BEUwbsq1.js → actions-BYX1WnBr.js} +1 -1
  7. package/web/assets/{actions-C9AfME83.js → actions-Bal42Hlw.js} +1 -1
  8. package/web/assets/{actions-D2-s31n3.js → actions-BmYfP6Ex.js} +1 -1
  9. package/web/assets/{actions-DeCPtfTK.js → actions-BvdAKBBR.js} +1 -1
  10. package/web/assets/{actions-DXMceTgd.js → actions-C0iB0sUH.js} +1 -1
  11. package/web/assets/{actions-JHsqbHpB.js → actions-C8z5APgU.js} +1 -1
  12. package/web/assets/{actions-DtNZGZWf.js → actions-CHC4oZpy.js} +1 -1
  13. package/web/assets/{actions-izdZ2Mn4.js → actions-CYXoOOED.js} +1 -1
  14. package/web/assets/{actions--FNKSNIs.js → actions-DTY0f0j8.js} +1 -1
  15. package/web/assets/{add-price-TdXAR3NW.js → add-price-BxoCZ-Tz.js} +1 -1
  16. package/web/assets/{admin-BpFv3eF5.js → admin--WTDrdAF.js} +1 -1
  17. package/web/assets/{assign-DKRfmN7W.js → assign-BOWJRdk_.js} +1 -1
  18. package/web/assets/{attempts-BfbYfiJa.js → attempts-D5nVVL_6.js} +1 -1
  19. package/web/assets/browser-QPNAlSRH.js +1 -0
  20. package/web/assets/{change-payment-j5UC8_h0.js → change-payment-DXontAeB.js} +1 -1
  21. package/web/assets/{change-plan-CtXvsIDw.js → change-plan-BsSmbAiG.js} +1 -1
  22. package/web/assets/{click-boundary-Bi28Y0Fq.js → click-boundary-Cozpjijr.js} +1 -1
  23. package/web/assets/{connect-CXek4LAE.js → connect-Wm36BWSB.js} +1 -1
  24. package/web/assets/{copyable-CprMHdhV.js → copyable-Dn7WoFib.js} +1 -1
  25. package/web/assets/{create-B-Ubepl_.js → create-4PWfxWLb.js} +1 -1
  26. package/web/assets/{create-IaalYGmm.js → create-7bXG85gU.js} +1 -1
  27. package/web/assets/{create-BWviSWbC.js → create-B5JxFhZm.js} +1 -1
  28. package/web/assets/{create-BVt_sQ_7.js → create-B9rgbz0l.js} +1 -1
  29. package/web/assets/{create-C6jihslA.js → create-DRn34vtT.js} +1 -1
  30. package/web/assets/{create-jzl1m8ZK.js → create-DSvEFvVu.js} +1 -1
  31. package/web/assets/{credit-grant-item-list-DQcvdSRs.js → credit-grant-item-list-B_vTdJGs.js} +1 -1
  32. package/web/assets/{credit-overview-CPId2vzk.js → credit-overview-hFT3I5RJ.js} +1 -1
  33. package/web/assets/{currency-restrictions-Dsupz2ce.js → currency-restrictions-DummyP0l.js} +1 -1
  34. package/web/assets/{currency-select-C8j7QQMP.js → currency-select-3BZ7dBe5.js} +1 -1
  35. package/web/assets/{dayjs-DUNWtvju.js → dayjs-t9Apc5Bb.js} +1 -1
  36. package/web/assets/{description-BHxdy5I3.js → description-Ci4-GOSF.js} +1 -1
  37. package/web/assets/{detail-BkRkrKyw.js → detail-8cEd6DEn.js} +1 -1
  38. package/web/assets/{detail-BdC9VIc6.js → detail-BH-Vvu0W.js} +1 -1
  39. package/web/assets/{detail-DUAJzKsu.js → detail-BO6Agb-b.js} +1 -1
  40. package/web/assets/{detail-H0dkKVyS.js → detail-BWPA3PH8.js} +1 -1
  41. package/web/assets/{detail-DTXDMIR9.js → detail-BgYHeC3e.js} +1 -1
  42. package/web/assets/{detail-CHJqYZ0W.js → detail-Bt5iQMX3.js} +1 -1
  43. package/web/assets/{detail-De8PyTyx.js → detail-BzlOf80w.js} +1 -1
  44. package/web/assets/{detail-MgdgGj5J.js → detail-C3T6qeB-.js} +1 -1
  45. package/web/assets/{detail-D729Bgs6.js → detail-C3_ACSpn.js} +1 -1
  46. package/web/assets/{detail-C--ATvwm.js → detail-CIUyjUAi.js} +1 -1
  47. package/web/assets/{detail-BvcI9cB_.js → detail-CPyUedtO.js} +1 -1
  48. package/web/assets/{detail-CmIweOLE.js → detail-CQWsMU9x.js} +1 -1
  49. package/web/assets/{detail-B17BN6kU.js → detail-CwTgF8q3.js} +1 -1
  50. package/web/assets/{detail-Dzt5tfyZ.js → detail-D1VjwguC.js} +1 -1
  51. package/web/assets/{detail-DQj1mbhA.js → detail-D4H6jbI1.js} +1 -1
  52. package/web/assets/{detail-WAmPM6yq.js → detail-D6NtqUGL.js} +1 -1
  53. package/web/assets/{detail-CfvKZ7IV.js → detail-D8kasVEc.js} +1 -1
  54. package/web/assets/{detail-DOcm4Kqg.js → detail-DMTZKNwK.js} +1 -1
  55. package/web/assets/{detail-DqfxOHky.js → detail-DO-7MCEH.js} +1 -1
  56. package/web/assets/{detail-g6el9Fxj.js → detail-DQfl09aa.js} +1 -1
  57. package/web/assets/{detail-DD1YBtex.js → detail-DtDNi9LO.js} +1 -1
  58. package/web/assets/{detail-BJEqTXDS.js → detail-VwGSacR5.js} +1 -1
  59. package/web/assets/{detail-BJ-hl5PK.js → detail-XRs3LPkf.js} +1 -1
  60. package/web/assets/{drawer-form-CQjNFFWk.js → drawer-form-CSWrmdZI.js} +1 -1
  61. package/web/assets/{edit-DAU8AWzT.js → edit-Cr-QHEQs.js} +1 -1
  62. package/web/assets/{editor-vZvxDUTl.js → editor-BzrYE3Ds.js} +1 -1
  63. package/web/assets/{embed-ClYNqZbf.js → embed-Dj1y7Zwp.js} +1 -1
  64. package/web/assets/{filter-toolbar-VvmMATj0.js → filter-toolbar-DpJmPWVP.js} +1 -1
  65. package/web/assets/{form-Bro99BjK.js → form-BBQXYqsx.js} +1 -1
  66. package/web/assets/{form-4_MzglPj.js → form-BJdpcmEf.js} +1 -1
  67. package/web/assets/{form-Cuvruf4H.js → form-BiiiQfiO.js} +1 -1
  68. package/web/assets/{form-AFzUvoFE.js → form-DPTZI-Fw.js} +1 -1
  69. package/web/assets/{form-CnrBCyTJ.js → form-nz7nSyN7.js} +1 -1
  70. package/web/assets/{gas-kw2KMH1u.js → gas-BGJEvZ8T.js} +1 -1
  71. package/web/assets/{generateCategoricalChart-BCpuUeC_.js → generateCategoricalChart-DJ3AfbsA.js} +1 -1
  72. package/web/assets/{home-ZNJREzbw.js → home-DfyGtwPb.js} +1 -1
  73. package/web/assets/index-B3Jk6ppU.js +1 -0
  74. package/web/assets/{index-BHwID_s4.js → index-B8bk0Ojf.js} +1 -1
  75. package/web/assets/{index-BtWfmATr.js → index-BFVHrFpT.js} +1 -1
  76. package/web/assets/{index-CPFlZhA2.js → index-BHIDYW0u.js} +1 -1
  77. package/web/assets/{index-DZkpxY-C.js → index-BNcCDKM5.js} +1 -1
  78. package/web/assets/{index-eDERHpkr.js → index-BPTu0yg7.js} +1 -1
  79. package/web/assets/index-BS70xmCD.js +1 -0
  80. package/web/assets/{index-BRmN8ViQ.js → index-BXCq4SkL.js} +1 -1
  81. package/web/assets/{index-C3AP4jq0.js → index-BXtNZIry.js} +1 -1
  82. package/web/assets/{index-B4yaPb7B.js → index-Bfp56O3W.js} +4 -4
  83. package/web/assets/{index-CKPfOW6M.js → index-BgQwjOVK.js} +1 -1
  84. package/web/assets/{index-DY-g0BPU.js → index-BhMKRIqj.js} +1 -1
  85. package/web/assets/{index-Dju8k6mq.js → index-Bo_vcdD9.js} +1 -1
  86. package/web/assets/{index-Dh9agU9O.js → index-BoqL8izO.js} +1 -1
  87. package/web/assets/{index-DAen2-cr.js → index-BuuQy4UK.js} +1 -1
  88. package/web/assets/{index-Dze0CpfQ.js → index-CQ7Ml281.js} +1 -1
  89. package/web/assets/{index-C3Rh1SaB.js → index-CcREcO7K.js} +1 -1
  90. package/web/assets/index-Cd-8zjpb.js +1 -0
  91. package/web/assets/{index-mgPU1lyd.js → index-CjPQC4mk.js} +1 -1
  92. package/web/assets/{index-C-5n472s.js → index-Cve8Vvzh.js} +1 -1
  93. package/web/assets/{index-olGOY5KB.js → index-Cvgxrbh_.js} +1 -1
  94. package/web/assets/{index-D7pWd60Z.js → index-D6Qc93ry.js} +1 -1
  95. package/web/assets/{index-ASk8vU2H.js → index-DA2h2xQ0.js} +1 -1
  96. package/web/assets/{index-CiWvs3j9.js → index-DAJUVYVW.js} +1 -1
  97. package/web/assets/{index-DwDNPqjF.js → index-DGlYR3g5.js} +1 -1
  98. package/web/assets/{index-BjKRyxNQ.js → index-DNwHUtwI.js} +1 -1
  99. package/web/assets/index-DVKKpTqA.js +1 -0
  100. package/web/assets/{index-DNobX-Tr.js → index-DdZRyqZe.js} +1 -1
  101. package/web/assets/{index-CH_k9MVv.js → index-DkHezF0C.js} +1 -1
  102. package/web/assets/index-DsYh3Cg8.js +1 -0
  103. package/web/assets/{index-x7sBb6oM.js → index-DxJqoRNV.js} +1 -1
  104. package/web/assets/{index-oy7LrXGT.js → index-HSIuOZNi.js} +1 -1
  105. package/web/assets/{index-CPyGjEd3.js → index-Z5VIg59-.js} +2 -2
  106. package/web/assets/index-_Owi04Rb.js +1 -0
  107. package/web/assets/index-bj4dA1Ad.js +1 -0
  108. package/web/assets/{index-B4n6PvPu.js → index-vdswLk79.js} +1 -1
  109. package/web/assets/{index-D6gv9jHh.js → index-vs4D4-i_.js} +1 -1
  110. package/web/assets/{index.es-C2Q6Owow.js → index.es-oPgScGhn.js} +1 -1
  111. package/web/assets/{info-card-C9dRgztS.js → info-card-Xtng8th6.js} +1 -1
  112. package/web/assets/{info-metric-ukWq8INi.js → info-metric-DwDA6oTc.js} +1 -1
  113. package/web/assets/{info-row-CaPaNF4L.js → info-row-Cr8bdDz0.js} +1 -1
  114. package/web/assets/{info-row-group-Cxo-4Gk5.js → info-row-group-qhfbrxfY.js} +1 -1
  115. package/web/assets/{libphonenumber-CTvobi0D.js → libphonenumber-DjN-XRyW.js} +1 -1
  116. package/web/assets/{link-DsltSF2Q.js → link-Dhj5mzaG.js} +1 -1
  117. package/web/assets/{list-BzgF4i3i.js → list-0fajnTAx.js} +1 -1
  118. package/web/assets/{list-B2b-s8wM.js → list-B6NGNObl.js} +1 -1
  119. package/web/assets/{list-DtEjqlED.js → list-BaGkIr9x.js} +1 -1
  120. package/web/assets/{list-ZaBapEXW.js → list-CMRLDBem.js} +1 -1
  121. package/web/assets/{list-CvM46TsP.js → list-CQ5uQIra.js} +1 -1
  122. package/web/assets/{list-O_uCSLFq.js → list-CZbuS490.js} +1 -1
  123. package/web/assets/{list-YNWVqjwW.js → list-DiFKB2Fh.js} +1 -1
  124. package/web/assets/{list-Cd1O-aDi.js → list-qrTTpMns.js} +1 -1
  125. package/web/assets/{metadata-_hV0ZaVh.js → metadata-C5loY77S.js} +1 -1
  126. package/web/assets/{meter-event-CPVBpekF.js → meter-event-BUamJsml.js} +1 -1
  127. package/web/assets/{metrics-DVPdwpyf.js → metrics-qFgjQM5V.js} +1 -1
  128. package/web/assets/{overview-CGdVIJrJ.js → overview-Bbyl7SwX.js} +1 -1
  129. package/web/assets/{overview-CN59I5Sc.js → overview-DPA4NQjh.js} +1 -1
  130. package/web/assets/{past-due-C3PtU8uo.js → past-due-D4jJMcjq.js} +1 -1
  131. package/web/assets/{pay-XVdSNq__.js → pay-s4cR1nfz.js} +1 -1
  132. package/web/assets/{payment-method-info-D_qR04xC.js → payment-method-info-Cto4lYu0.js} +1 -1
  133. package/web/assets/preview-DV7989ox.js +1 -0
  134. package/web/assets/{preview-F3lma170.js → preview-DrU96XLI.js} +1 -1
  135. package/web/assets/{pricing-table-Bt2WljzE.js → pricing-table-BstRGwem.js} +1 -1
  136. package/web/assets/{pricing-table-D9FGYBVa.js → pricing-table-CwzRykLm.js} +1 -1
  137. package/web/assets/{product-select-_72p-5lF.js → product-select-VFuyl5ev.js} +1 -1
  138. package/web/assets/{recharge-CSlKshbU.js → recharge-Dlg-3474.js} +1 -1
  139. package/web/assets/{related-credit-grants-DnKdAit6.js → related-credit-grants-BxHOJRRa.js} +3 -3
  140. package/web/assets/{safe-did-address-CRTPYo34.js → safe-did-address-Bj0hfqCH.js} +1 -1
  141. package/web/assets/{source-data-viewer-D1GShrs5.js → source-data-viewer-DQnM31KB.js} +1 -1
  142. package/web/assets/{status-3Swm2gK5.js → status-DlEqz2pS.js} +1 -1
  143. package/web/assets/{subscription-BX00k6FU.js → subscription-BJxso5rX.js} +1 -1
  144. package/web/assets/{subscription-Bzeblscr.js → subscription-DzHzZLOA.js} +1 -1
  145. package/web/assets/table-CyJj8e85.js +1 -0
  146. package/web/assets/{tax-code-select-j2arPbaE.js → tax-code-select-CoXANTPX.js} +1 -1
  147. package/web/assets/{tax-utils-B8J0Kfnz.js → tax-utils-BF4tobIJ.js} +1 -1
  148. package/web/assets/{uploader-BLdAbLR6.js → uploader-CV9IVKh1.js} +1 -1
  149. package/web/assets/{usage-records-BAwNs1y8.js → usage-records-nONbPDaL.js} +1 -1
  150. package/web/assets/{util-B8B3fsMa.js → util-Dp629jKU.js} +1 -1
  151. package/web/assets/{vendor-arcblock-D1drrE7q.js → vendor-arcblock-D34ufhta.js} +1 -1
  152. package/web/assets/{vendor-blocklet-B67R14so.js → vendor-blocklet-B8V2HFST.js} +2 -2
  153. package/web/index.html +1 -1
  154. package/web/assets/browser-DF2vfpBa.js +0 -1
  155. package/web/assets/index-BMcnd_jZ.js +0 -1
  156. package/web/assets/index-BdbLl6St.js +0 -1
  157. package/web/assets/index-BjLJQRKY.js +0 -1
  158. package/web/assets/index-BkNCPnTn.js +0 -1
  159. package/web/assets/index-BlAwTTmu.js +0 -1
  160. package/web/assets/index-CDyxbCzc.js +0 -1
  161. package/web/assets/index-ChC-jsE2.js +0 -1
  162. package/web/assets/preview-Bdtbh-xk.js +0 -1
  163. package/web/assets/table-BN3WBnr3.js +0 -1
@@ -1 +1 @@
1
- import{j as e,A as y,w as v,B as r,a3 as a,bv as w,q as i,a7 as j,Y as m,O as C,be as _,bf as I}from"./vendor-mui-BXZut9Pz.js";import{V as N,P as k}from"./vendor-blocklet-B67R14so.js";import{d as D,i as d,j as c,A as E,e as S}from"./index-B4yaPb7B.js";import{L as h}from"./vendor-react-BPknnnEA.js";import{C as T}from"./copyable-CprMHdhV.js";import{C as $}from"./link-DsltSF2Q.js";import{E as A}from"./list-CvM46TsP.js";import{I as n}from"./info-row-CaPaNF4L.js";import{I as l}from"./info-metric-ukWq8INi.js";import{S as x}from"./header-ivXuPt06.js";import{g as M}from"./util-B8B3fsMa.js";import{I as z}from"./info-row-group-Cxo-4Gk5.js";import{M as L}from"./list-B2b-s8wM.js";import"./table-BN3WBnr3.js";import"./lodash-B4Ozcv0x.js";const O=o=>S.get(`/api/meter-events/${o}`).then(s=>s.data);function ee(o){const{t:s}=N(),{isMobile:u}=D(),{loading:g,error:p,data:t}=k(()=>O(o.id));if(p)return e.jsx(y,{severity:"error",children:p.message});if(g||!t)return e.jsx(v,{});const f=b=>{switch(b){case"pending":return"info";case"requires_action":return"warning";case"requires_capture":return"warning";case"completed":return"success";case"processing":return"info";default:return"default"}};return e.jsxs(W,{direction:"column",spacing:2.5,sx:{mb:4},children:[e.jsxs(r,{children:[e.jsx(a,{className:"page-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:e.jsxs(a,{direction:"row",onClick:()=>M("/admin/billing/meters"),sx:{alignItems:"center",fontWeight:"normal",cursor:"pointer"},children:[e.jsx(w,{fontSize:"small",sx:{mr:.5,color:"text.secondary"}}),e.jsx(i,{variant:"h6",sx:{color:"text.secondary",fontWeight:"normal"},children:s("admin.meterEvents.title")})]})}),e.jsxs(r,{sx:{mt:4,mb:3,display:"flex",gap:{xs:2,sm:2,md:5},flexWrap:"wrap",flexDirection:{xs:"column",sm:"column",md:"row"},alignItems:{xs:"flex-start",sm:"flex-start",md:"center"}},children:[e.jsx(a,{direction:"column",sx:{gap:1},children:e.jsx(T,{text:o.id})}),e.jsxs(a,{className:"section-body",sx:{justifyContent:"flex-start",flexWrap:"wrap","hr.MuiDivider-root:last-child":{display:"none"},flexDirection:{xs:"column",sm:"column",md:"row"},alignItems:"flex-start",gap:{xs:1,sm:1,md:3}},children:[e.jsx(l,{label:s("common.status"),value:e.jsx(j,{label:t.status,color:f(t.status),size:"small"}),divider:!0}),e.jsx(l,{label:s("common.meterEvent"),value:e.jsx(h,{to:`/admin/billing/meters/${t.meter.id}`,style:{color:"inherit"},children:e.jsx(i,{sx:{color:"text.link"},children:t.meter.event_name})}),divider:!0}),t.subscription&&e.jsx(l,{label:s("common.subscription"),value:e.jsx(h,{to:`/admin/billing/${t.subscription.id}`,style:{color:"inherit"},children:e.jsx(i,{sx:{color:"text.link"},children:t.subscription.description||t.subscription.id})}),divider:!0}),e.jsx(l,{label:s("admin.meterEvent.creditConsumed"),value:`${d(t.credit_consumed,t.paymentCurrency?.decimal)} ${t.paymentCurrency?.symbol}`,divider:!0}),t.credit_pending!=="0"&&e.jsx(l,{label:s("admin.customer.creditGrants.pendingAmount"),value:e.jsx(i,{sx:{color:"error.main"},children:`${d(t.credit_pending,t.paymentCurrency?.decimal)} ${t.paymentCurrency?.symbol}`}),divider:!0})]})]}),e.jsx(m,{})]}),e.jsxs(a,{sx:{flexDirection:{xs:"column",lg:"row"},gap:{xs:2.5,md:4},".meter-event-column-1":{minWidth:{xs:"100%",lg:"600px"}},".meter-event-column-2":{width:{xs:"100%",md:"100%",lg:"320px"},maxWidth:{xs:"100%",md:"33%"}}},children:[e.jsxs(r,{className:"meter-event-column-1",sx:{flex:1,gap:2.5,display:"flex",flexDirection:"column"},children:[e.jsxs(r,{className:"section",sx:{containerType:"inline-size"},children:[e.jsx(x,{title:s("admin.details")}),e.jsxs(z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",xl:"repeat(2, 1fr)"},"@container (min-width: 1000px)":{gridTemplateColumns:"repeat(2, 1fr)"},".info-row-wrapper":{gap:1,flexDirection:{xs:"column",xl:"row"},alignItems:{xs:"flex-start",xl:"center"},"@container (min-width: 1000px)":{flexDirection:"row",alignItems:"center"}},".currency-name":{color:"text.secondary"}},children:[e.jsx(n,{label:s("admin.meterEvent.usageValue"),value:`${d(t.payload.value,t.paymentCurrency?.decimal)} ${t.paymentCurrency?.symbol}`}),e.jsx(n,{label:s("admin.meterEvent.reportedAt"),value:c(t.timestamp*1e3)}),e.jsx(n,{label:s("common.customer"),value:e.jsx($,{customer:t.customer,size:u?"default":"small"})}),e.jsx(n,{label:s("common.createdAt"),value:c(t.created_at)}),e.jsx(n,{label:s("common.status"),value:e.jsxs(a,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(j,{label:t.status,color:f(t.status),size:"small",sx:{textTransform:"capitalize"}}),t.metadata?.last_error&&e.jsx(C,{title:e.jsx("pre",{style:{whiteSpace:"break-spaces"},children:JSON.stringify({error:t.metadata.last_error,failed_at:t.metadata.failed_at?c(t.metadata.failed_at*1e3):void 0,attempt_count:t.attempt_count,next_attempt:t.next_attempt?c(t.next_attempt*1e3):void 0},null,2)}),children:e.jsx(_,{fontSize:"small",color:"error"})})]})})]})]}),e.jsx(m,{}),e.jsxs(r,{className:"section",children:[e.jsx(i,{variant:"h3",className:"section-header",children:s("admin.creditTransactions.title")}),e.jsx(r,{className:"section-body",children:e.jsx(E,{customer_id:t.payload.customer_id,source:t.id,showAdminColumns:!0,mode:"dashboard"})})]}),e.jsx(m,{}),e.jsxs(r,{className:"section",children:[e.jsx(x,{title:s("admin.events.title")}),e.jsx(r,{className:"section-body",children:e.jsx(A,{features:{toolbar:!1},object_id:t.id})})]})]}),u&&e.jsx(m,{}),e.jsx(r,{className:"meter-event-column-2",sx:{gap:2.5,display:"flex",flexDirection:"column"},children:t.metadata&&Object.keys(t.metadata).length>0&&e.jsxs(r,{className:"section",children:[e.jsx(x,{title:s("common.metadata.label")}),e.jsx(r,{className:"section-body",children:e.jsx(L,{data:t.metadata,handleEditMetadata:()=>{}})})]})})]})]})}const W=I(a)``;export{ee as default};
1
+ import{j as e,A as y,w as v,B as r,a3 as a,bv as w,q as i,a7 as j,Y as m,O as C,be as _,bf as I}from"./vendor-mui-BXZut9Pz.js";import{V as N,P as k}from"./vendor-blocklet-B8V2HFST.js";import{d as D,i as d,j as c,A as E,e as S}from"./index-Bfp56O3W.js";import{L as h}from"./vendor-react-BPknnnEA.js";import{C as T}from"./copyable-Dn7WoFib.js";import{C as $}from"./link-Dhj5mzaG.js";import{E as A}from"./list-CQ5uQIra.js";import{I as n}from"./info-row-Cr8bdDz0.js";import{I as l}from"./info-metric-DwDA6oTc.js";import{S as x}from"./header-ivXuPt06.js";import{g as M}from"./util-Dp629jKU.js";import{I as z}from"./info-row-group-qhfbrxfY.js";import{M as L}from"./list-B6NGNObl.js";import"./table-CyJj8e85.js";import"./lodash-B4Ozcv0x.js";const O=o=>S.get(`/api/meter-events/${o}`).then(s=>s.data);function ee(o){const{t:s}=N(),{isMobile:u}=D(),{loading:g,error:p,data:t}=k(()=>O(o.id));if(p)return e.jsx(y,{severity:"error",children:p.message});if(g||!t)return e.jsx(v,{});const f=b=>{switch(b){case"pending":return"info";case"requires_action":return"warning";case"requires_capture":return"warning";case"completed":return"success";case"processing":return"info";default:return"default"}};return e.jsxs(W,{direction:"column",spacing:2.5,sx:{mb:4},children:[e.jsxs(r,{children:[e.jsx(a,{className:"page-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:e.jsxs(a,{direction:"row",onClick:()=>M("/admin/billing/meters"),sx:{alignItems:"center",fontWeight:"normal",cursor:"pointer"},children:[e.jsx(w,{fontSize:"small",sx:{mr:.5,color:"text.secondary"}}),e.jsx(i,{variant:"h6",sx:{color:"text.secondary",fontWeight:"normal"},children:s("admin.meterEvents.title")})]})}),e.jsxs(r,{sx:{mt:4,mb:3,display:"flex",gap:{xs:2,sm:2,md:5},flexWrap:"wrap",flexDirection:{xs:"column",sm:"column",md:"row"},alignItems:{xs:"flex-start",sm:"flex-start",md:"center"}},children:[e.jsx(a,{direction:"column",sx:{gap:1},children:e.jsx(T,{text:o.id})}),e.jsxs(a,{className:"section-body",sx:{justifyContent:"flex-start",flexWrap:"wrap","hr.MuiDivider-root:last-child":{display:"none"},flexDirection:{xs:"column",sm:"column",md:"row"},alignItems:"flex-start",gap:{xs:1,sm:1,md:3}},children:[e.jsx(l,{label:s("common.status"),value:e.jsx(j,{label:t.status,color:f(t.status),size:"small"}),divider:!0}),e.jsx(l,{label:s("common.meterEvent"),value:e.jsx(h,{to:`/admin/billing/meters/${t.meter.id}`,style:{color:"inherit"},children:e.jsx(i,{sx:{color:"text.link"},children:t.meter.event_name})}),divider:!0}),t.subscription&&e.jsx(l,{label:s("common.subscription"),value:e.jsx(h,{to:`/admin/billing/${t.subscription.id}`,style:{color:"inherit"},children:e.jsx(i,{sx:{color:"text.link"},children:t.subscription.description||t.subscription.id})}),divider:!0}),e.jsx(l,{label:s("admin.meterEvent.creditConsumed"),value:`${d(t.credit_consumed,t.paymentCurrency?.decimal)} ${t.paymentCurrency?.symbol}`,divider:!0}),t.credit_pending!=="0"&&e.jsx(l,{label:s("admin.customer.creditGrants.pendingAmount"),value:e.jsx(i,{sx:{color:"error.main"},children:`${d(t.credit_pending,t.paymentCurrency?.decimal)} ${t.paymentCurrency?.symbol}`}),divider:!0})]})]}),e.jsx(m,{})]}),e.jsxs(a,{sx:{flexDirection:{xs:"column",lg:"row"},gap:{xs:2.5,md:4},".meter-event-column-1":{minWidth:{xs:"100%",lg:"600px"}},".meter-event-column-2":{width:{xs:"100%",md:"100%",lg:"320px"},maxWidth:{xs:"100%",md:"33%"}}},children:[e.jsxs(r,{className:"meter-event-column-1",sx:{flex:1,gap:2.5,display:"flex",flexDirection:"column"},children:[e.jsxs(r,{className:"section",sx:{containerType:"inline-size"},children:[e.jsx(x,{title:s("admin.details")}),e.jsxs(z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",xl:"repeat(2, 1fr)"},"@container (min-width: 1000px)":{gridTemplateColumns:"repeat(2, 1fr)"},".info-row-wrapper":{gap:1,flexDirection:{xs:"column",xl:"row"},alignItems:{xs:"flex-start",xl:"center"},"@container (min-width: 1000px)":{flexDirection:"row",alignItems:"center"}},".currency-name":{color:"text.secondary"}},children:[e.jsx(n,{label:s("admin.meterEvent.usageValue"),value:`${d(t.payload.value,t.paymentCurrency?.decimal)} ${t.paymentCurrency?.symbol}`}),e.jsx(n,{label:s("admin.meterEvent.reportedAt"),value:c(t.timestamp*1e3)}),e.jsx(n,{label:s("common.customer"),value:e.jsx($,{customer:t.customer,size:u?"default":"small"})}),e.jsx(n,{label:s("common.createdAt"),value:c(t.created_at)}),e.jsx(n,{label:s("common.status"),value:e.jsxs(a,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(j,{label:t.status,color:f(t.status),size:"small",sx:{textTransform:"capitalize"}}),t.metadata?.last_error&&e.jsx(C,{title:e.jsx("pre",{style:{whiteSpace:"break-spaces"},children:JSON.stringify({error:t.metadata.last_error,failed_at:t.metadata.failed_at?c(t.metadata.failed_at*1e3):void 0,attempt_count:t.attempt_count,next_attempt:t.next_attempt?c(t.next_attempt*1e3):void 0},null,2)}),children:e.jsx(_,{fontSize:"small",color:"error"})})]})})]})]}),e.jsx(m,{}),e.jsxs(r,{className:"section",children:[e.jsx(i,{variant:"h3",className:"section-header",children:s("admin.creditTransactions.title")}),e.jsx(r,{className:"section-body",children:e.jsx(E,{customer_id:t.payload.customer_id,source:t.id,showAdminColumns:!0,mode:"dashboard"})})]}),e.jsx(m,{}),e.jsxs(r,{className:"section",children:[e.jsx(x,{title:s("admin.events.title")}),e.jsx(r,{className:"section-body",children:e.jsx(A,{features:{toolbar:!1},object_id:t.id})})]})]}),u&&e.jsx(m,{}),e.jsx(r,{className:"meter-event-column-2",sx:{gap:2.5,display:"flex",flexDirection:"column"},children:t.metadata&&Object.keys(t.metadata).length>0&&e.jsxs(r,{className:"section",children:[e.jsx(x,{title:s("common.metadata.label")}),e.jsx(r,{className:"section-body",children:e.jsx(L,{data:t.metadata,handleEditMetadata:()=>{}})})]})})]})]})}const W=I(a)``;export{ee as default};
@@ -1 +1 @@
1
- import{j as t,q as c,O as x,be as b,a3 as g,bL as k,a1 as A,w as $,x as _,M,N as W,B as R}from"./vendor-mui-BXZut9Pz.js";import{V as N,P as d,G as h}from"./vendor-blocklet-B67R14so.js";import{d as T,j as y,i as f,e as m}from"./index-B4yaPb7B.js";import{I as r}from"./info-metric-ukWq8INi.js";import{S as F}from"./status-3Swm2gK5.js";import{a as L}from"./vendor-react-BPknnnEA.js";const O=e=>m.get(`/api/subscriptions/${e}/upcoming`).then(n=>n.data),P=e=>m.get(`/api/subscriptions/${e}/payer-token`).then(n=>n.data),V=({customerId:e,subscriptionId:n})=>m.get(`/api/credit-grants/summary?customer_id=${e}&subscription_id=${n}`).then(i=>i.data);function K({subscription:e,showBalance:n=!0,mode:i="portal"}){const{t:a}=N(),o=e.paymentCurrency?.type==="credit",{data:s,loading:j}=d(()=>O(e.id)),u=L(),{isMobile:v}=T(),{data:l,loading:p}=d(()=>P(e.id),{ready:n}),{data:S}=d(()=>V({customerId:e.customer_id,subscriptionId:e.id}),{ready:o}),C=n&&["arcblock","ethereum","base"].includes(e.paymentMethod.type),I=new h(l?.token||"0").lt(new h(s?.amount||"0")),B=()=>{o||i!=="portal"||u(`/customer/subscription/${e.id}/recharge`)},w=()=>{const z=o?S?.[e.paymentCurrency.id]?.remainingAmount:l?.token;return j||p?t.jsx($,{size:16}):I&&!o&&i==="portal"?t.jsxs(_,{component:"a",color:"error",sx:{height:24,pt:0,pb:0,...v?{textAlign:"right",maxWidth:160}:{}},onClick:()=>u(`/customer/subscription/${e.id}/recharge`),children:[a("admin.subscription.insufficientBalance"),t.jsx(M,{sx:{fontSize:14}})]}):t.jsxs(g,{sx:{flexDirection:"row",alignItems:"center",gap:.5,fontSize:"16px",fontWeight:500,cursor:"pointer","&:hover":{color:"primary.main"}},onClick:B,children:[t.jsx(W,{src:e.paymentCurrency?.logo,sx:{width:16,height:16},alt:e.paymentCurrency?.name}),t.jsxs(R,{sx:{display:"flex",alignItems:"baseline"},children:[f(z,e.paymentCurrency.decimal),t.jsx(c,{sx:{fontSize:14,ml:.5},children:e.paymentCurrency.symbol})]})]})};return t.jsxs(t.Fragment,{children:[t.jsx(r,{label:a("common.status"),value:t.jsx(F,{subscription:e}),divider:!0}),e.status==="active"&&!e.cancel_at&&t.jsx(r,{label:a("admin.subscription.nextInvoice"),value:y(e.current_period_end*1e3),divider:!0}),["active","trialing"].includes(e.status)&&s?.amount&&s.amount!=="0"&&t.jsx(r,{label:t.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:14,fontWeight:500},children:[a("admin.subscription.nextInvoiceAmount"),t.jsx(x,{title:a("admin.subscription.nextInvoiceAmountTip"),placement:"top",arrow:!0,children:t.jsx(b,{fontSize:"small",sx:{color:"text.secondary",cursor:"pointer",fontSize:"16px"}})})]}),value:`${f(s.amount,e.paymentCurrency.decimal)} ${e.paymentCurrency.symbol} (${a("common.estimated")})`,divider:!0}),C&&["active","trialing"].includes(e.status)&&t.jsx(r,{label:t.jsxs(g,{direction:"row",spacing:1,sx:{alignItems:"center",fontWeight:500},children:[t.jsx(c,{sx:{fontWeight:500,fontSize:14},children:a("admin.subscription.currentBalance")}),t.jsx(x,{title:t.jsxs(c,{sx:{fontFamily:"monospace",fontSize:"13px"},children:[a("admin.subscription.paymentAddress"),":",p?t.jsx(A,{width:120}):l?.paymentAddress]}),placement:"top",arrow:!0,children:t.jsx(k,{sx:{fontSize:"16px",color:"text.secondary",cursor:"pointer","&:hover":{color:"primary.main"},display:{xs:"none",md:"block"}}})})]}),value:w(),divider:!0}),e.status==="canceled"&&e.canceled_at&&t.jsx(r,{label:a("admin.subscription.cancel.done"),value:y(e.canceled_at*1e3),divider:!0})]})}export{K as S};
1
+ import{j as t,q as c,O as x,be as b,a3 as g,bL as k,a1 as A,w as $,x as _,M,N as W,B as R}from"./vendor-mui-BXZut9Pz.js";import{V as N,P as d,G as h}from"./vendor-blocklet-B8V2HFST.js";import{d as T,j as y,i as f,e as m}from"./index-Bfp56O3W.js";import{I as r}from"./info-metric-DwDA6oTc.js";import{S as F}from"./status-DlEqz2pS.js";import{a as L}from"./vendor-react-BPknnnEA.js";const O=e=>m.get(`/api/subscriptions/${e}/upcoming`).then(n=>n.data),P=e=>m.get(`/api/subscriptions/${e}/payer-token`).then(n=>n.data),V=({customerId:e,subscriptionId:n})=>m.get(`/api/credit-grants/summary?customer_id=${e}&subscription_id=${n}`).then(i=>i.data);function K({subscription:e,showBalance:n=!0,mode:i="portal"}){const{t:a}=N(),o=e.paymentCurrency?.type==="credit",{data:s,loading:j}=d(()=>O(e.id)),u=L(),{isMobile:v}=T(),{data:l,loading:p}=d(()=>P(e.id),{ready:n}),{data:S}=d(()=>V({customerId:e.customer_id,subscriptionId:e.id}),{ready:o}),C=n&&["arcblock","ethereum","base"].includes(e.paymentMethod.type),I=new h(l?.token||"0").lt(new h(s?.amount||"0")),B=()=>{o||i!=="portal"||u(`/customer/subscription/${e.id}/recharge`)},w=()=>{const z=o?S?.[e.paymentCurrency.id]?.remainingAmount:l?.token;return j||p?t.jsx($,{size:16}):I&&!o&&i==="portal"?t.jsxs(_,{component:"a",color:"error",sx:{height:24,pt:0,pb:0,...v?{textAlign:"right",maxWidth:160}:{}},onClick:()=>u(`/customer/subscription/${e.id}/recharge`),children:[a("admin.subscription.insufficientBalance"),t.jsx(M,{sx:{fontSize:14}})]}):t.jsxs(g,{sx:{flexDirection:"row",alignItems:"center",gap:.5,fontSize:"16px",fontWeight:500,cursor:"pointer","&:hover":{color:"primary.main"}},onClick:B,children:[t.jsx(W,{src:e.paymentCurrency?.logo,sx:{width:16,height:16},alt:e.paymentCurrency?.name}),t.jsxs(R,{sx:{display:"flex",alignItems:"baseline"},children:[f(z,e.paymentCurrency.decimal),t.jsx(c,{sx:{fontSize:14,ml:.5},children:e.paymentCurrency.symbol})]})]})};return t.jsxs(t.Fragment,{children:[t.jsx(r,{label:a("common.status"),value:t.jsx(F,{subscription:e}),divider:!0}),e.status==="active"&&!e.cancel_at&&t.jsx(r,{label:a("admin.subscription.nextInvoice"),value:y(e.current_period_end*1e3),divider:!0}),["active","trialing"].includes(e.status)&&s?.amount&&s.amount!=="0"&&t.jsx(r,{label:t.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:14,fontWeight:500},children:[a("admin.subscription.nextInvoiceAmount"),t.jsx(x,{title:a("admin.subscription.nextInvoiceAmountTip"),placement:"top",arrow:!0,children:t.jsx(b,{fontSize:"small",sx:{color:"text.secondary",cursor:"pointer",fontSize:"16px"}})})]}),value:`${f(s.amount,e.paymentCurrency.decimal)} ${e.paymentCurrency.symbol} (${a("common.estimated")})`,divider:!0}),C&&["active","trialing"].includes(e.status)&&t.jsx(r,{label:t.jsxs(g,{direction:"row",spacing:1,sx:{alignItems:"center",fontWeight:500},children:[t.jsx(c,{sx:{fontWeight:500,fontSize:14},children:a("admin.subscription.currentBalance")}),t.jsx(x,{title:t.jsxs(c,{sx:{fontFamily:"monospace",fontSize:"13px"},children:[a("admin.subscription.paymentAddress"),":",p?t.jsx(A,{width:120}):l?.paymentAddress]}),placement:"top",arrow:!0,children:t.jsx(k,{sx:{fontSize:"16px",color:"text.secondary",cursor:"pointer","&:hover":{color:"primary.main"},display:{xs:"none",md:"block"}}})})]}),value:w(),divider:!0}),e.status==="canceled"&&e.canceled_at&&t.jsx(r,{label:a("admin.subscription.cancel.done"),value:y(e.canceled_at*1e3),divider:!0})]})}export{K as S};
@@ -1,4 +1,4 @@
1
- import{r as M,e as f,K as pt,u as Jt,j as l,a1 as ee,B as Y,a0 as Zt,$ as V,Y as Be,q as T,c8 as qn,a8 as Gn,a9 as Xn,aH as Kn,I as _e,c9 as Qn,aQ as St,aT as Pt,ad as jt,ca as Un,cb as Jn,cc as Zn,cd as er,ce as tr,cf as nr,ah as Z,aF as rr,a3 as _,x as Mt,cg as ar,bq as ir,bg as oe,N as Ze,M as Ct,bj as or,aV as sr,aW as cr,aN as lr,aM as et}from"./vendor-mui-BXZut9Pz.js";import{cs as ur,c8 as De,bp as Et,V as dr,B as H,Y as hr,J as fr,P as tt,a7 as mr,G as gr}from"./vendor-blocklet-B67R14so.js";import{a as yr,e as nt,q as ct,i as rt,a3 as pr}from"./index-B4yaPb7B.js";import{L as Fe}from"./vendor-react-BPknnnEA.js";import{w as Re,i as Le,a as vr,u as br,b as xr,c as wr,d as U,e as Dr,h as Or,j as en,k as tn,l as nn,C as rn,m as fe,L as Me,n as ze,o as at,A as kr,p as be,q as Sr,r as Pr,s as jr,t as Mr,G as Cr,v as At,x as Tt,D as Er,g as Ar,X as an,Y as on,f as Tr,T as Nr,y as Wr}from"./generateCategoricalChart-BCpuUeC_.js";import{h as Nt,s as Rr}from"./util-B8B3fsMa.js";import{C as _r}from"./currency-select-C8j7QQMP.js";function Ie(e){"@babel/helpers - typeof";return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(e)}function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wt(Object(n),!0).forEach(function(r){Ir(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ir(e,t,n){return t=Yr(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yr(e){var t=Fr(e,"string");return Ie(t)=="symbol"?t:t+""}function Fr(e,t){if(Ie(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e,t){return Br(e)||Hr(e,t)||$r(e,t)||zr()}function zr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as M,e as f,K as pt,u as Jt,j as l,a1 as ee,B as Y,a0 as Zt,$ as V,Y as Be,q as T,c8 as qn,a8 as Gn,a9 as Xn,aH as Kn,I as _e,c9 as Qn,aQ as St,aT as Pt,ad as jt,ca as Un,cb as Jn,cc as Zn,cd as er,ce as tr,cf as nr,ah as Z,aF as rr,a3 as _,x as Mt,cg as ar,bq as ir,bg as oe,N as Ze,M as Ct,bj as or,aV as sr,aW as cr,aN as lr,aM as et}from"./vendor-mui-BXZut9Pz.js";import{cs as ur,c8 as De,bp as Et,V as dr,B as H,Y as hr,J as fr,P as tt,a7 as mr,G as gr}from"./vendor-blocklet-B8V2HFST.js";import{a as yr,e as nt,q as ct,i as rt,a3 as pr}from"./index-Bfp56O3W.js";import{L as Fe}from"./vendor-react-BPknnnEA.js";import{w as Re,i as Le,a as vr,u as br,b as xr,c as wr,d as U,e as Dr,h as Or,j as en,k as tn,l as nn,C as rn,m as fe,L as Me,n as ze,o as at,A as kr,p as be,q as Sr,r as Pr,s as jr,t as Mr,G as Cr,v as At,x as Tt,D as Er,g as Ar,X as an,Y as on,f as Tr,T as Nr,y as Wr}from"./generateCategoricalChart-DJ3AfbsA.js";import{h as Nt,s as Rr}from"./util-Dp629jKU.js";import{C as _r}from"./currency-select-3BZ7dBe5.js";function Ie(e){"@babel/helpers - typeof";return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(e)}function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wt(Object(n),!0).forEach(function(r){Ir(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ir(e,t,n){return t=Yr(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yr(e){var t=Fr(e,"string");return Ie(t)=="symbol"?t:t+""}function Fr(e,t){if(Ie(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lr(e,t){return Br(e)||Hr(e,t)||$r(e,t)||zr()}function zr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $r(e,t){if(e){if(typeof e=="string")return Rt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rt(e,t)}}function Rt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hr(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,d=[],u=!0,h=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(u=(r=i.call(n)).done)&&(d.push(r.value),d.length!==t);u=!0);}catch(c){h=!0,a=c}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(h)throw a}}return d}}function Br(e){if(Array.isArray(e))return e}var Vr=M.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,d=e.height,u=d===void 0?"100%":d,h=e.minWidth,c=h===void 0?0:h,m=e.minHeight,g=e.maxHeight,p=e.children,O=e.debounce,b=O===void 0?0:O,y=e.id,w=e.className,P=e.onResize,j=e.style,k=j===void 0?{}:j,x=M.useRef(null),C=M.useRef();C.current=P,M.useImperativeHandle(t,function(){return Object.defineProperty(x.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),x.current},configurable:!0})});var z=M.useState({containerWidth:a.width,containerHeight:a.height}),N=Lr(z,2),$=N[0],q=N[1],W=M.useCallback(function(X,Q){q(function(F){var v=Math.round(X),L=Math.round(Q);return F.containerWidth===v&&F.containerHeight===L?F:{containerWidth:v,containerHeight:L}})},[]);M.useEffect(function(){var X=function(ve){var ke,Se=ve[0].contentRect,Pe=Se.width,je=Se.height;W(Pe,je),(ke=C.current)===null||ke===void 0||ke.call(C,Pe,je)};b>0&&(X=ur(X,b,{trailing:!0,leading:!1}));var Q=new ResizeObserver(X),F=x.current.getBoundingClientRect(),v=F.width,L=F.height;return W(v,L),Q.observe(x.current),function(){Q.disconnect()}},[W,b]);var te=M.useMemo(function(){var X=$.containerWidth,Q=$.containerHeight;if(X<0||Q<0)return null;Re(Le(o)||Le(u),`The width(%s) and height(%s) are both fixed numbers,
3
3
  maybe you don't need to use a ResponsiveContainer.`,o,u),Re(!n||n>0,"The aspect(%s) must be greater than zero.",n);var F=Le(o)?X:o,v=Le(u)?Q:u;n&&n>0&&(F?v=F/n:v&&(F=v*n),g&&v>g&&(v=g)),Re(F>0||v>0,`The width(%s) and height(%s) of chart should be greater than 0,
4
4
  please check the style of container, or the props width(%s) and height(%s),
@@ -1 +1 @@
1
- import{r as g,j as t,B as n,q as o,$ as s,Y as h,O as m,ai as l,b4 as u,x as d,bS as f,cs as b,ct as j,cu as y,bW as v,cv as k,cw as w,cx as S}from"./vendor-mui-BXZut9Pz.js";import{V as C,$ as z}from"./vendor-blocklet-B67R14so.js";import{a as O}from"./vendor-react-BPknnnEA.js";const W=[{title:"integrations.features.products.title",description:"integrations.features.products.intro",icon:t.jsx(f,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products"},{title:"integrations.features.paymentLinks.title",description:"integrations.features.paymentLinks.intro",icon:t.jsx(b,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products/links"},{title:"integrations.features.pricingTables.title",description:"integrations.features.pricingTables.intro",icon:t.jsx(j,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products/pricing-tables"}],I=[{title:"integrations.features.metering.title",description:"integrations.features.metering.intro",icon:t.jsx(y,{sx:{fontSize:32,color:"text.lighter"}}),dialog:"metering",doc:{url:"https://www.arcblock.io/blog/en/payment-kit-enhanced-credit-management"}},{title:"integrations.features.promotions.title",description:"integrations.features.promotions.intro",icon:t.jsx(v,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products/coupons",doc:{url:"https://www.arcblock.io/content/blog/en/payment-kit-promotion-code-discounts-support"}},{title:"integrations.features.donate.title",description:"integrations.features.donate.intro",icon:t.jsx(k,{sx:{fontSize:32,color:"text.lighter"}}),path:"/integrations/donations"},{title:"integrations.features.paymentMethods.title",description:"integrations.features.paymentMethods.intro",icon:t.jsx(w,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/settings/payment-methods"},{title:"integrations.features.api.title",description:"integrations.features.api.intro",icon:t.jsx(S,{sx:{fontSize:32,color:"text.lighter"}}),path:"https://www.staging.arcblock.io/content/docs/payment-kit-sdk",external:!0}];function F(){const{t:i}=C(),a=O(),[x,r]=g.useState(!1),c=e=>{if(e.dialog==="metering"){r(!0);return}e.external?window.open(e.path,"_blank"):a(e.path)};return t.jsxs(n,{children:[t.jsx(n,{sx:{mb:4},children:t.jsx(o,{variant:"body2",sx:{color:"text.secondary",mb:2},children:i("common.welcomeDesc")})}),t.jsxs(o,{variant:"h3",gutterBottom:!0,sx:{mb:2},children:[i("integrations.basicFeatures")," 🚀"]}),t.jsx(s,{container:!0,spacing:2,sx:{mb:4,maxWidth:1200},children:W.map(e=>t.jsx(s,{size:{xs:12,sm:6,md:4},children:t.jsxs(n,{className:"base-card",onClick:()=>c(e),sx:{height:"100%",cursor:"pointer","&:hover":{boxShadow:2}},children:[t.jsxs(n,{sx:{mb:1},children:[e.icon,t.jsx(o,{variant:"h4",sx:{mt:1.5},children:i(e.title)})]}),t.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:i(e.description)})]})},e.path))}),t.jsx(h,{sx:{my:4}}),t.jsxs(o,{variant:"h3",gutterBottom:!0,sx:{mb:2},children:[i("integrations.advancedFeatures")," 🔥"]}),t.jsx(s,{container:!0,spacing:2,sx:{maxWidth:1200},children:I.map(e=>t.jsx(s,{size:{xs:12,sm:6,md:4},children:t.jsxs(n,{className:"base-card",onClick:()=>c(e),sx:{height:"100%",cursor:"pointer","&:hover":{boxShadow:2}},children:[t.jsxs(n,{sx:{mb:1},children:[e.icon,t.jsxs(n,{sx:{display:"flex",alignItems:"center",mt:1.5},children:[t.jsx(o,{variant:"h4",children:i(e.title)}),e.doc?.url&&t.jsx(m,{title:i("integrations.viewDocs"),placement:"top",children:t.jsx(l,{href:e.doc.url,target:"_blank",rel:"noopener",onClick:p=>p.stopPropagation(),sx:{display:"flex",alignItems:"center",ml:1,color:"text.secondary","&:hover":{color:"primary.main"}},children:t.jsx(u,{fontSize:"small",sx:{cursor:"pointer"}})})})]})]}),t.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:i(e.description)})]})},e.path))}),t.jsxs(z,{open:x,onClose:()=>r(!1),maxWidth:"sm",fullWidth:!0,className:"base-dialog",title:i("integrations.features.metering.dialog.title"),actions:t.jsxs(n,{sx:{display:"flex",gap:2},children:[t.jsx(d,{onClick:()=>r(!1),children:i("common.cancel")}),t.jsx(d,{onClick:()=>a("/admin/billing/meters"),variant:"contained",children:i("common.goToConfigure")})]}),children:[t.jsx(o,{variant:"body2",sx:{color:"text.secondary",mb:3},children:i("integrations.features.metering.dialog.description")}),t.jsx(n,{component:"ol",sx:{pl:0,mb:3,listStyle:"none",counterReset:"step-counter"},children:["step1","step2","step3","step4"].map(e=>t.jsx(n,{component:"li",sx:{mb:3,pl:3,position:"relative",counterIncrement:"step-counter","&::before":{content:"counter(step-counter)",position:"absolute",left:0,top:0,width:24,height:24,borderRadius:"50%",backgroundColor:"primary.main",color:"white",fontSize:"12px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center"}},children:t.jsxs(n,{sx:{ml:.5},children:[t.jsx(o,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:i(`integrations.features.metering.dialog.steps.${e}.title`)}),t.jsx(o,{variant:"body2",sx:{color:"text.secondary",lineHeight:1.5},children:i(`integrations.features.metering.dialog.steps.${e}.description`)})]})},e))}),t.jsx(n,{sx:{p:2,backgroundColor:"action.hover",borderRadius:1,border:"1px solid",borderColor:"divider"},children:t.jsx(l,{href:"https://www.staging.arcblock.io/content/docs/payment-kit-sdk/en/payment-kit-sdk-core-concepts-credit-billing",target:"_blank",rel:"noopener",underline:"hover",sx:{color:"primary.main",fontWeight:500,display:"flex",alignItems:"center",gap:.5},children:i("integrations.features.metering.dialog.docText")})})]})]})}export{F as default};
1
+ import{r as g,j as t,B as n,q as o,$ as s,Y as h,O as m,ai as l,b4 as u,x as d,bS as f,cs as b,ct as j,cu as y,bW as v,cv as k,cw as w,cx as S}from"./vendor-mui-BXZut9Pz.js";import{V as C,$ as z}from"./vendor-blocklet-B8V2HFST.js";import{a as O}from"./vendor-react-BPknnnEA.js";const W=[{title:"integrations.features.products.title",description:"integrations.features.products.intro",icon:t.jsx(f,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products"},{title:"integrations.features.paymentLinks.title",description:"integrations.features.paymentLinks.intro",icon:t.jsx(b,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products/links"},{title:"integrations.features.pricingTables.title",description:"integrations.features.pricingTables.intro",icon:t.jsx(j,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products/pricing-tables"}],I=[{title:"integrations.features.metering.title",description:"integrations.features.metering.intro",icon:t.jsx(y,{sx:{fontSize:32,color:"text.lighter"}}),dialog:"metering",doc:{url:"https://www.arcblock.io/blog/en/payment-kit-enhanced-credit-management"}},{title:"integrations.features.promotions.title",description:"integrations.features.promotions.intro",icon:t.jsx(v,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/products/coupons",doc:{url:"https://www.arcblock.io/content/blog/en/payment-kit-promotion-code-discounts-support"}},{title:"integrations.features.donate.title",description:"integrations.features.donate.intro",icon:t.jsx(k,{sx:{fontSize:32,color:"text.lighter"}}),path:"/integrations/donations"},{title:"integrations.features.paymentMethods.title",description:"integrations.features.paymentMethods.intro",icon:t.jsx(w,{sx:{fontSize:32,color:"text.lighter"}}),path:"/admin/settings/payment-methods"},{title:"integrations.features.api.title",description:"integrations.features.api.intro",icon:t.jsx(S,{sx:{fontSize:32,color:"text.lighter"}}),path:"https://www.staging.arcblock.io/content/docs/payment-kit-sdk",external:!0}];function F(){const{t:i}=C(),a=O(),[x,r]=g.useState(!1),c=e=>{if(e.dialog==="metering"){r(!0);return}e.external?window.open(e.path,"_blank"):a(e.path)};return t.jsxs(n,{children:[t.jsx(n,{sx:{mb:4},children:t.jsx(o,{variant:"body2",sx:{color:"text.secondary",mb:2},children:i("common.welcomeDesc")})}),t.jsxs(o,{variant:"h3",gutterBottom:!0,sx:{mb:2},children:[i("integrations.basicFeatures")," 🚀"]}),t.jsx(s,{container:!0,spacing:2,sx:{mb:4,maxWidth:1200},children:W.map(e=>t.jsx(s,{size:{xs:12,sm:6,md:4},children:t.jsxs(n,{className:"base-card",onClick:()=>c(e),sx:{height:"100%",cursor:"pointer","&:hover":{boxShadow:2}},children:[t.jsxs(n,{sx:{mb:1},children:[e.icon,t.jsx(o,{variant:"h4",sx:{mt:1.5},children:i(e.title)})]}),t.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:i(e.description)})]})},e.path))}),t.jsx(h,{sx:{my:4}}),t.jsxs(o,{variant:"h3",gutterBottom:!0,sx:{mb:2},children:[i("integrations.advancedFeatures")," 🔥"]}),t.jsx(s,{container:!0,spacing:2,sx:{maxWidth:1200},children:I.map(e=>t.jsx(s,{size:{xs:12,sm:6,md:4},children:t.jsxs(n,{className:"base-card",onClick:()=>c(e),sx:{height:"100%",cursor:"pointer","&:hover":{boxShadow:2}},children:[t.jsxs(n,{sx:{mb:1},children:[e.icon,t.jsxs(n,{sx:{display:"flex",alignItems:"center",mt:1.5},children:[t.jsx(o,{variant:"h4",children:i(e.title)}),e.doc?.url&&t.jsx(m,{title:i("integrations.viewDocs"),placement:"top",children:t.jsx(l,{href:e.doc.url,target:"_blank",rel:"noopener",onClick:p=>p.stopPropagation(),sx:{display:"flex",alignItems:"center",ml:1,color:"text.secondary","&:hover":{color:"primary.main"}},children:t.jsx(u,{fontSize:"small",sx:{cursor:"pointer"}})})})]})]}),t.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:i(e.description)})]})},e.path))}),t.jsxs(z,{open:x,onClose:()=>r(!1),maxWidth:"sm",fullWidth:!0,className:"base-dialog",title:i("integrations.features.metering.dialog.title"),actions:t.jsxs(n,{sx:{display:"flex",gap:2},children:[t.jsx(d,{onClick:()=>r(!1),children:i("common.cancel")}),t.jsx(d,{onClick:()=>a("/admin/billing/meters"),variant:"contained",children:i("common.goToConfigure")})]}),children:[t.jsx(o,{variant:"body2",sx:{color:"text.secondary",mb:3},children:i("integrations.features.metering.dialog.description")}),t.jsx(n,{component:"ol",sx:{pl:0,mb:3,listStyle:"none",counterReset:"step-counter"},children:["step1","step2","step3","step4"].map(e=>t.jsx(n,{component:"li",sx:{mb:3,pl:3,position:"relative",counterIncrement:"step-counter","&::before":{content:"counter(step-counter)",position:"absolute",left:0,top:0,width:24,height:24,borderRadius:"50%",backgroundColor:"primary.main",color:"white",fontSize:"12px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center"}},children:t.jsxs(n,{sx:{ml:.5},children:[t.jsx(o,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:i(`integrations.features.metering.dialog.steps.${e}.title`)}),t.jsx(o,{variant:"body2",sx:{color:"text.secondary",lineHeight:1.5},children:i(`integrations.features.metering.dialog.steps.${e}.description`)})]})},e))}),t.jsx(n,{sx:{p:2,backgroundColor:"action.hover",borderRadius:1,border:"1px solid",borderColor:"divider"},children:t.jsx(l,{href:"https://www.staging.arcblock.io/content/docs/payment-kit-sdk/en/payment-kit-sdk-core-concepts-credit-billing",target:"_blank",rel:"noopener",underline:"hover",sx:{color:"primary.main",fontWeight:500,display:"flex",alignItems:"center",gap:.5},children:i("integrations.features.metering.dialog.docText")})})]})]})}export{F as default};
@@ -1,4 +1,4 @@
1
- import{r as i,j as e,A as l,w as B,a3 as r,bv as O,q as A,B as m,x as D,bf as R}from"./vendor-mui-BXZut9Pz.js";import{V as _,P as z,Z as H,F as L}from"./vendor-blocklet-B67R14so.js";import{u as T,a as U,k as g,O as q,m as F,l as N,x as W,e as Q}from"./index-B4yaPb7B.js";import{b as V}from"./vendor-react-BPknnnEA.js";import{l as Z}from"./lodash-B4Ozcv0x.js";import{S as G}from"./header-ivXuPt06.js";import{g as j}from"./util-B8B3fsMa.js";import{u as J}from"./browser-DF2vfpBa.js";const K=()=>Q.get("/api/customers/me").then(s=>s.data);function ne(){const{t:s,locale:v}=_(),{events:b}=T(),{connect:n,session:P}=U(),[u]=V(),w=J(),[d,p]=i.useState(!1),[f,a]=i.useState(!1),{loading:S,error:x,data:h,runAsync:C}=z(K);if(i.useEffect(()=>{b.on("switch-did",()=>{C().catch(console.error)})},[]),x)return e.jsx(l,{severity:"error",children:g(x)});if(S)return e.jsx(B,{});if(!h)return e.jsx(l,{sx:{mt:3},severity:"info",children:s("payment.customer.empty")});const t=u.get("subscription")||"",c=u.get("currency")||"",I=()=>{t&&c?n.open({containerEl:void 0,saveConnect:!1,action:"collect-batch",locale:v,prefix:L(N(),"/api/did"),extraParams:{subscriptionId:t,currencyId:c},messages:{scan:s("common.connect.defaultScan"),title:s("payment.customer.invoice.payBatch"),confirm:s("common.connect.confirm")},onSuccess:()=>{n.close()},onClose:()=>{n.close()},onError:o=>{H.error(g(o))}}):a(!0)},k=(o,E)=>{if(Z.isEmpty(o)||o?.count===0){if(p(!1),E?.count>0){const y=W(window.location.href)?.referer;y?window.location.replace(y):j("/customer")}return}p(!0)};return e.jsxs(r,{direction:"column",spacing:3,sx:{my:2},children:[e.jsx(r,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between"},children:w?e.jsx(m,{}):e.jsxs(r,{direction:"row",onClick:()=>j("/customer"),sx:{alignItems:"center",fontWeight:"normal",cursor:"pointer"},children:[e.jsx(O,{fontSize:"small",sx:{mr:.5,color:"text.secondary"}}),e.jsx(A,{variant:"h6",sx:{color:"text.secondary",fontWeight:"normal"},children:s("common.previous")})]})}),e.jsxs(M,{direction:"column",spacing:3,children:[d&&e.jsx(l,{severity:"error",children:s("payment.customer.pastDue.warning")}),f&&e.jsx(q,{customerId:P.user.did,subscriptionId:t,onPaid:()=>{a(!1)},successToast:!1,dialogProps:{open:f,onClose:()=>a(!1)},detailLinkOptions:{enabled:!1}}),e.jsxs(m,{className:"section",children:[e.jsx(G,{title:s("payment.customer.pastDue.invoices"),mb:0,children:d&&e.jsx(D,{size:"small",variant:"contained",color:"primary",onClick:I,children:s("admin.subscription.batchPay.button")})}),e.jsx(m,{className:"section-body",children:e.jsx(F,{customer_id:h.id,subscription_id:t,currency_id:c,pageSize:10,status:"uncollectible",target:"_blank",action:"pay",type:"table",onTableDataChange:k,relatedSubscription:!0})})]})]})]})}const M=R(r)`
1
+ import{r as i,j as e,A as l,w as B,a3 as r,bv as O,q as A,B as m,x as D,bf as R}from"./vendor-mui-BXZut9Pz.js";import{V as _,P as z,Z as H,F as L}from"./vendor-blocklet-B8V2HFST.js";import{u as T,a as U,k as g,O as q,m as F,l as N,x as W,e as Q}from"./index-Bfp56O3W.js";import{b as V}from"./vendor-react-BPknnnEA.js";import{l as Z}from"./lodash-B4Ozcv0x.js";import{S as G}from"./header-ivXuPt06.js";import{g as j}from"./util-Dp629jKU.js";import{u as J}from"./browser-QPNAlSRH.js";const K=()=>Q.get("/api/customers/me").then(s=>s.data);function ne(){const{t:s,locale:v}=_(),{events:b}=T(),{connect:n,session:P}=U(),[u]=V(),w=J(),[d,p]=i.useState(!1),[f,a]=i.useState(!1),{loading:S,error:x,data:h,runAsync:C}=z(K);if(i.useEffect(()=>{b.on("switch-did",()=>{C().catch(console.error)})},[]),x)return e.jsx(l,{severity:"error",children:g(x)});if(S)return e.jsx(B,{});if(!h)return e.jsx(l,{sx:{mt:3},severity:"info",children:s("payment.customer.empty")});const t=u.get("subscription")||"",c=u.get("currency")||"",I=()=>{t&&c?n.open({containerEl:void 0,saveConnect:!1,action:"collect-batch",locale:v,prefix:L(N(),"/api/did"),extraParams:{subscriptionId:t,currencyId:c},messages:{scan:s("common.connect.defaultScan"),title:s("payment.customer.invoice.payBatch"),confirm:s("common.connect.confirm")},onSuccess:()=>{n.close()},onClose:()=>{n.close()},onError:o=>{H.error(g(o))}}):a(!0)},k=(o,E)=>{if(Z.isEmpty(o)||o?.count===0){if(p(!1),E?.count>0){const y=W(window.location.href)?.referer;y?window.location.replace(y):j("/customer")}return}p(!0)};return e.jsxs(r,{direction:"column",spacing:3,sx:{my:2},children:[e.jsx(r,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between"},children:w?e.jsx(m,{}):e.jsxs(r,{direction:"row",onClick:()=>j("/customer"),sx:{alignItems:"center",fontWeight:"normal",cursor:"pointer"},children:[e.jsx(O,{fontSize:"small",sx:{mr:.5,color:"text.secondary"}}),e.jsx(A,{variant:"h6",sx:{color:"text.secondary",fontWeight:"normal"},children:s("common.previous")})]})}),e.jsxs(M,{direction:"column",spacing:3,children:[d&&e.jsx(l,{severity:"error",children:s("payment.customer.pastDue.warning")}),f&&e.jsx(q,{customerId:P.user.did,subscriptionId:t,onPaid:()=>{a(!1)},successToast:!1,dialogProps:{open:f,onClose:()=>a(!1)},detailLinkOptions:{enabled:!1}}),e.jsxs(m,{className:"section",children:[e.jsx(G,{title:s("payment.customer.pastDue.invoices"),mb:0,children:d&&e.jsx(D,{size:"small",variant:"contained",color:"primary",onClick:I,children:s("admin.subscription.batchPay.button")})}),e.jsx(m,{className:"section-body",children:e.jsx(F,{customer_id:h.id,subscription_id:t,currency_id:c,pageSize:10,status:"uncollectible",target:"_blank",action:"pay",type:"table",onTableDataChange:k,relatedSubscription:!0})})]})]})]})}const M=R(r)`
2
2
  a {
3
3
  text-decoration: underline;
4
4
  }