autumn-js 0.0.103 → 0.0.104

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 (259) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +28 -4
  2. package/dist/libraries/backend/better-auth.d.ts +28 -4
  3. package/dist/libraries/backend/better-auth.js +76 -83
  4. package/dist/libraries/backend/better-auth.mjs +7 -7
  5. package/dist/libraries/backend/{chunk-YFWJ6E4U.mjs → chunk-2RZ2FZX2.mjs} +10 -10
  6. package/dist/libraries/backend/{chunk-33NT3WE5.mjs → chunk-3OLXYDCU.mjs} +1 -1
  7. package/dist/libraries/backend/{chunk-AKV5N4WO.mjs → chunk-5EKNB4IJ.mjs} +1 -1
  8. package/dist/libraries/backend/{chunk-CEZHD5H6.mjs → chunk-5H6HVCOP.mjs} +1 -1
  9. package/dist/libraries/backend/{chunk-J3L3OBSS.mjs → chunk-HHMIVOXX.mjs} +18 -1
  10. package/dist/libraries/backend/{chunk-6VS7TU7O.mjs → chunk-IOSEAUDJ.mjs} +57 -81
  11. package/dist/libraries/backend/{chunk-RA4AC56B.mjs → chunk-K7JGEYUX.mjs} +1 -1
  12. package/dist/libraries/backend/convex.js +73 -80
  13. package/dist/libraries/backend/convex.mjs +7 -7
  14. package/dist/libraries/backend/elysia.js +73 -80
  15. package/dist/libraries/backend/elysia.mjs +7 -7
  16. package/dist/libraries/backend/express.d.mts +1 -1
  17. package/dist/libraries/backend/express.d.ts +1 -1
  18. package/dist/libraries/backend/express.js +73 -80
  19. package/dist/libraries/backend/express.mjs +7 -7
  20. package/dist/libraries/backend/fastify.js +73 -80
  21. package/dist/libraries/backend/fastify.mjs +7 -7
  22. package/dist/libraries/backend/hono.js +73 -80
  23. package/dist/libraries/backend/hono.mjs +7 -7
  24. package/dist/libraries/backend/next.js +169 -176
  25. package/dist/libraries/backend/next.mjs +101 -101
  26. package/dist/libraries/backend/react-router.js +73 -80
  27. package/dist/libraries/backend/react-router.mjs +7 -7
  28. package/dist/libraries/backend/{referralTypes-DV8s1h8w.d.ts → referralTypes-CnYanpMd.d.ts} +199 -102
  29. package/dist/libraries/backend/{referralTypes-DcDxMGTp.d.mts → referralTypes-jA7MQ1y5.d.mts} +199 -102
  30. package/dist/libraries/backend/remix_dep.js +73 -80
  31. package/dist/libraries/backend/remix_dep.mjs +7 -7
  32. package/dist/libraries/backend/routes/backendRouter.js +73 -80
  33. package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
  34. package/dist/libraries/backend/routes/entityRoutes.js +56 -80
  35. package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
  36. package/dist/libraries/backend/routes/genRoutes.js +73 -80
  37. package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
  38. package/dist/libraries/backend/routes/productRoutes.js +56 -80
  39. package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
  40. package/dist/libraries/backend/routes/referralRoutes.js +56 -80
  41. package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
  42. package/dist/libraries/backend/supabase.js +73 -80
  43. package/dist/libraries/backend/supabase.mjs +7 -7
  44. package/dist/libraries/backend/tanstack.js +73 -80
  45. package/dist/libraries/backend/tanstack.mjs +7 -7
  46. package/dist/libraries/backend/utils/backendRes.js +56 -80
  47. package/dist/libraries/backend/utils/backendRes.mjs +1 -1
  48. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  49. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  50. package/dist/libraries/backend/utils/withAuth.js +56 -80
  51. package/dist/libraries/backend/utils/withAuth.mjs +2 -2
  52. package/dist/libraries/react/AutumnContext.d.mts +5 -4
  53. package/dist/libraries/react/AutumnContext.d.ts +5 -4
  54. package/dist/libraries/react/AutumnContext.js +63 -82
  55. package/dist/libraries/react/AutumnContext.mjs +6 -6
  56. package/dist/libraries/react/BaseAutumnProvider.d.mts +5 -4
  57. package/dist/libraries/react/BaseAutumnProvider.d.ts +5 -4
  58. package/dist/libraries/react/BaseAutumnProvider.js +96 -111
  59. package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
  60. package/dist/libraries/react/{ReactAutumnClient-C8Nt-pqu.d.mts → ReactAutumnClient-BGI56QI_.d.mts} +21 -10
  61. package/dist/libraries/react/{ReactAutumnClient-BlxQQOXE.d.ts → ReactAutumnClient-CEv9YGLM.d.ts} +21 -10
  62. package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
  63. package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
  64. package/dist/libraries/react/ReactAutumnProvider.js +96 -111
  65. package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
  66. package/dist/libraries/react/attachTypes-Cexub7bN.d.ts +58 -0
  67. package/dist/libraries/react/attachTypes-DqI7qtXD.d.mts +58 -0
  68. package/dist/libraries/react/{chunk-VUBJ6JM3.mjs → chunk-253MTZP3.mjs} +7 -2
  69. package/dist/libraries/react/{chunk-RQN4VDAE.mjs → chunk-3N6WLQH3.mjs} +3 -3
  70. package/dist/libraries/react/{chunk-DHJ36QEV.mjs → chunk-473LVTGN.mjs} +2 -2
  71. package/dist/libraries/react/{chunk-LXSKONN2.mjs → chunk-4A53GN44.mjs} +5 -5
  72. package/dist/libraries/react/{chunk-EHOBTSZ7.mjs → chunk-4BQDSIWM.mjs} +5 -8
  73. package/dist/libraries/react/{chunk-S6JUZ43Q.mjs → chunk-4VXBAIPC.mjs} +2 -2
  74. package/dist/libraries/react/{chunk-OAWFFAKA.mjs → chunk-6EZVNJHQ.mjs} +6 -6
  75. package/dist/libraries/react/{chunk-DBGTWERW.mjs → chunk-ASL5VH2W.mjs} +4 -3
  76. package/dist/libraries/react/{chunk-QBBE72EF.mjs → chunk-CBPZVSMZ.mjs} +12 -7
  77. package/dist/libraries/react/chunk-CUWUAQML.mjs +179 -0
  78. package/dist/libraries/react/chunk-DJIRJJNG.mjs +34 -0
  79. package/dist/libraries/react/{chunk-CYW4LNFZ.mjs → chunk-E5EYSQYJ.mjs} +68 -90
  80. package/dist/libraries/react/{chunk-GQIE3MFB.mjs → chunk-EBQBPZCM.mjs} +3 -3
  81. package/dist/libraries/react/{chunk-AL3VJLFU.mjs → chunk-EV5RNY5U.mjs} +1 -1
  82. package/dist/libraries/react/chunk-G6NOGGDA.mjs +695 -0
  83. package/dist/libraries/react/{chunk-OAPUYXBO.mjs → chunk-KWNH6C27.mjs} +6 -6
  84. package/dist/libraries/react/{chunk-X4R3V6O6.mjs → chunk-MNOH7Q3B.mjs} +2 -2
  85. package/dist/libraries/react/{chunk-3SGSKYJ7.mjs → chunk-P5MIFIIO.mjs} +2 -2
  86. package/dist/libraries/react/{chunk-PZJQBCVG.mjs → chunk-PIENO233.mjs} +1 -1
  87. package/dist/libraries/react/chunk-QUO2CYKM.mjs +30 -0
  88. package/dist/libraries/react/{chunk-BCMBFJ7E.mjs → chunk-RCTILKK3.mjs} +70 -37
  89. package/dist/libraries/react/{chunk-ZVQKDPUP.mjs → chunk-RPEGNKJH.mjs} +3 -3
  90. package/dist/libraries/react/{chunk-SDMBKRAI.mjs → chunk-WAFSQH6N.mjs} +37 -37
  91. package/dist/libraries/react/{chunk-CGWNDUYV.mjs → chunk-ZFIJI37N.mjs} +1 -1
  92. package/dist/libraries/react/{chunk-KYSWTOMQ.mjs → chunk-ZITEHPEQ.mjs} +30 -24
  93. package/dist/libraries/react/client/ReactAutumnClient.d.mts +5 -5
  94. package/dist/libraries/react/client/ReactAutumnClient.d.ts +5 -5
  95. package/dist/libraries/react/client/ReactAutumnClient.js +63 -82
  96. package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
  97. package/dist/libraries/react/client/clientCompMethods.d.mts +5 -5
  98. package/dist/libraries/react/client/clientCompMethods.d.ts +5 -5
  99. package/dist/libraries/react/client/clientCusMethods.d.mts +5 -5
  100. package/dist/libraries/react/client/clientCusMethods.d.ts +5 -5
  101. package/dist/libraries/react/client/clientEntityMethods.d.mts +5 -5
  102. package/dist/libraries/react/client/clientEntityMethods.d.ts +5 -5
  103. package/dist/libraries/react/client/clientGenMethods.d.mts +9 -7
  104. package/dist/libraries/react/client/clientGenMethods.d.ts +9 -7
  105. package/dist/libraries/react/client/clientGenMethods.js +8 -2
  106. package/dist/libraries/react/client/clientGenMethods.mjs +3 -1
  107. package/dist/libraries/react/client/clientProdMethods.d.mts +5 -5
  108. package/dist/libraries/react/client/clientProdMethods.d.ts +5 -5
  109. package/dist/libraries/react/client/clientReferralMethods.d.mts +5 -5
  110. package/dist/libraries/react/client/clientReferralMethods.d.ts +5 -5
  111. package/dist/libraries/react/client/types/clientAttachTypes.d.mts +115 -0
  112. package/dist/libraries/react/client/types/clientAttachTypes.d.ts +115 -0
  113. package/dist/libraries/react/client/types/clientAttachTypes.js +68 -0
  114. package/dist/libraries/react/client/types/clientAttachTypes.mjs +42 -0
  115. package/dist/libraries/react/client/types/clientGenTypes.d.mts +10 -81
  116. package/dist/libraries/react/client/types/clientGenTypes.d.ts +10 -81
  117. package/dist/libraries/react/client/types/clientGenTypes.js +1 -24
  118. package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -22
  119. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +213 -4
  120. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +5 -32
  121. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +5 -32
  122. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +720 -371
  123. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +30 -33
  124. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +3 -2
  125. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +3 -2
  126. package/dist/libraries/react/components/attach-dialog/lib/attach-content.js +70 -37
  127. package/dist/libraries/react/components/attach-dialog/lib/attach-content.mjs +1 -1
  128. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
  129. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
  130. package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +43 -43
  131. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +5 -5
  132. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
  133. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
  134. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +3 -1
  135. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +3 -1
  136. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.js +12 -7
  137. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.mjs +1 -1
  138. package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +213 -4
  139. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  140. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  141. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +794 -456
  142. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +29 -26
  143. package/dist/libraries/react/components/ui/accordion.d.mts +9 -0
  144. package/dist/libraries/react/components/ui/accordion.d.ts +9 -0
  145. package/dist/libraries/react/components/ui/accordion.js +2721 -0
  146. package/dist/libraries/react/components/ui/accordion.mjs +15 -0
  147. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  148. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  149. package/dist/libraries/react/components/ui/button.js +3 -3
  150. package/dist/libraries/react/components/ui/button.mjs +2 -2
  151. package/dist/libraries/react/components/ui/dialog.js +43 -43
  152. package/dist/libraries/react/components/ui/dialog.mjs +3 -3
  153. package/dist/libraries/react/components/ui/input.d.mts +5 -0
  154. package/dist/libraries/react/components/ui/input.d.ts +5 -0
  155. package/dist/libraries/react/components/ui/input.js +2587 -0
  156. package/dist/libraries/react/components/ui/input.mjs +9 -0
  157. package/dist/libraries/react/components/ui/popover.d.mts +9 -0
  158. package/dist/libraries/react/components/ui/popover.d.ts +9 -0
  159. package/dist/libraries/react/components/ui/popover.js +2594 -0
  160. package/dist/libraries/react/components/ui/popover.mjs +15 -0
  161. package/dist/libraries/react/components/ui/switch.js +12 -12
  162. package/dist/libraries/react/components/ui/switch.mjs +3 -3
  163. package/dist/libraries/react/{cusTypes-CHcG59KG.d.mts → cusTypes-DCeNEQLu.d.mts} +28 -10
  164. package/dist/libraries/react/{cusTypes-CHcG59KG.d.ts → cusTypes-DCeNEQLu.d.ts} +28 -10
  165. package/dist/libraries/react/{entTypes-8-4TWxee.d.ts → entTypes-BJD_Hxbp.d.ts} +1 -1
  166. package/dist/libraries/react/{entTypes-3t7AbNhm.d.mts → entTypes-CJhJFCKD.d.mts} +1 -1
  167. package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
  168. package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
  169. package/dist/libraries/react/hooks/useAutumn.d.mts +21 -6
  170. package/dist/libraries/react/hooks/useAutumn.d.ts +21 -6
  171. package/dist/libraries/react/hooks/useAutumn.js +94 -110
  172. package/dist/libraries/react/hooks/useAutumn.mjs +9 -9
  173. package/dist/libraries/react/hooks/useAutumnBase.d.mts +24 -9
  174. package/dist/libraries/react/hooks/useAutumnBase.d.ts +24 -9
  175. package/dist/libraries/react/hooks/useAutumnBase.js +94 -110
  176. package/dist/libraries/react/hooks/useAutumnBase.mjs +8 -8
  177. package/dist/libraries/react/hooks/useCustomer.d.mts +7 -5
  178. package/dist/libraries/react/hooks/useCustomer.d.ts +7 -5
  179. package/dist/libraries/react/hooks/useCustomer.js +96 -111
  180. package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
  181. package/dist/libraries/react/hooks/useCustomerBase.d.mts +8 -5
  182. package/dist/libraries/react/hooks/useCustomerBase.d.ts +8 -5
  183. package/dist/libraries/react/hooks/useCustomerBase.js +96 -111
  184. package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
  185. package/dist/libraries/react/hooks/useEntity.d.mts +14 -7
  186. package/dist/libraries/react/hooks/useEntity.d.ts +14 -7
  187. package/dist/libraries/react/hooks/useEntity.js +94 -110
  188. package/dist/libraries/react/hooks/useEntity.mjs +10 -10
  189. package/dist/libraries/react/hooks/useEntityBase.d.mts +16 -7
  190. package/dist/libraries/react/hooks/useEntityBase.d.ts +16 -7
  191. package/dist/libraries/react/hooks/useEntityBase.js +94 -110
  192. package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
  193. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  194. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  195. package/dist/libraries/react/hooks/usePricingTable.js +66 -88
  196. package/dist/libraries/react/hooks/usePricingTable.mjs +8 -8
  197. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
  198. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
  199. package/dist/libraries/react/hooks/usePricingTableBase.js +66 -88
  200. package/dist/libraries/react/hooks/usePricingTableBase.mjs +7 -7
  201. package/dist/libraries/react/hooks/useProductsBase.js +63 -82
  202. package/dist/libraries/react/hooks/useProductsBase.mjs +6 -6
  203. package/dist/libraries/react/index.d.mts +217 -106
  204. package/dist/libraries/react/index.d.ts +217 -106
  205. package/dist/libraries/react/index.js +801 -463
  206. package/dist/libraries/react/index.mjs +792 -454
  207. package/dist/libraries/react/{response-DnJCkvfc.d.ts → response-Dek2TEnE.d.ts} +2 -25
  208. package/dist/libraries/react/{response-B8MYd86O.d.mts → response-HZAWTgGp.d.mts} +2 -25
  209. package/dist/next/{AutumnProvider-Xl1mqxls.d.mts → AutumnProvider-CHFySjFm.d.mts} +30 -12
  210. package/dist/next/{AutumnProvider-Xl1mqxls.d.ts → AutumnProvider-CHFySjFm.d.ts} +30 -12
  211. package/dist/next/AutumnProvider.d.mts +1 -1
  212. package/dist/next/AutumnProvider.d.ts +1 -1
  213. package/dist/next/client/NextAutumnClient.d.mts +18 -7
  214. package/dist/next/client/NextAutumnClient.d.ts +18 -7
  215. package/dist/next/client/NextAutumnClient.js +13 -2
  216. package/dist/next/client/NextAutumnClient.mjs +13 -2
  217. package/dist/next/client/NextAutumnProvider.d.mts +1 -1
  218. package/dist/next/client/NextAutumnProvider.d.ts +1 -1
  219. package/dist/next/client/attachTypes-BL6x9Zbx.d.ts +58 -0
  220. package/dist/next/client/attachTypes-BPYeJ6E4.d.mts +58 -0
  221. package/dist/next/client/{clientGenTypes-Dx1TULjb.d.ts → clientAttachTypes-Dj6U8D7o.d.ts} +108 -90
  222. package/dist/next/client/{clientGenTypes-tE8HbEdV.d.mts → clientAttachTypes-fN66J754.d.mts} +108 -90
  223. package/dist/next/client/clientUtils.d.mts +2 -2
  224. package/dist/next/client/clientUtils.d.ts +2 -2
  225. package/dist/next/client/{cusTypes-nWQygxXu.d.mts → cusTypes-BoVZ2omf.d.mts} +32 -14
  226. package/dist/next/client/{cusTypes-nWQygxXu.d.ts → cusTypes-BoVZ2omf.d.ts} +32 -14
  227. package/dist/next/client/{entTypes-DDZyYuom.d.ts → entTypes-BrHkjvC9.d.ts} +1 -1
  228. package/dist/next/client/{entTypes-DusU3WqD.d.mts → entTypes-Li6ZrG0C.d.mts} +1 -1
  229. package/dist/next/client/hooks/useAutumn.d.mts +19 -5
  230. package/dist/next/client/hooks/useAutumn.d.ts +19 -5
  231. package/dist/next/client/hooks/useCustomer.d.mts +5 -4
  232. package/dist/next/client/hooks/useCustomer.d.ts +5 -4
  233. package/dist/next/client/hooks/useEntity.d.mts +14 -8
  234. package/dist/next/client/hooks/useEntity.d.ts +14 -8
  235. package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
  236. package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
  237. package/dist/next/client/types.d.mts +2 -2
  238. package/dist/next/client/types.d.ts +2 -2
  239. package/dist/next/index.d.mts +213 -107
  240. package/dist/next/index.d.ts +213 -107
  241. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  242. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  243. package/dist/next/server/componentActions.d.mts +1 -1
  244. package/dist/next/server/componentActions.d.ts +1 -1
  245. package/dist/next/server/cusActions.d.mts +173 -94
  246. package/dist/next/server/cusActions.d.ts +173 -94
  247. package/dist/next/server/{cusTypes-Tc189V9T.d.mts → cusTypes-Bh_pVAJp.d.mts} +32 -14
  248. package/dist/next/server/{cusTypes-Tc189V9T.d.ts → cusTypes-Bh_pVAJp.d.ts} +32 -14
  249. package/dist/next/server/genActions.d.mts +3 -4
  250. package/dist/next/server/genActions.d.ts +3 -4
  251. package/dist/sdk/index.d.mts +221 -135
  252. package/dist/sdk/index.d.ts +221 -135
  253. package/dist/sdk/index.js +55 -80
  254. package/dist/sdk/index.mjs +54 -81
  255. package/dist/styles/global.css +213 -4
  256. package/dist/utils/encryptUtils.js +56 -80
  257. package/dist/utils/encryptUtils.mjs +56 -80
  258. package/package.json +7 -4
  259. package/dist/libraries/react/chunk-ZEVKOP7Z.mjs +0 -548
@@ -42,7 +42,7 @@ __export(pricing_table_synced_exports, {
42
42
  usePricingTableContext: () => usePricingTableContext
43
43
  });
44
44
  module.exports = __toCommonJS(pricing_table_synced_exports);
45
- var import_react8 = __toESM(require("react"));
45
+ var import_react10 = __toESM(require("react"));
46
46
 
47
47
  // src/libraries/react/BaseAutumnProvider.tsx
48
48
  var import_react3 = require("react");
@@ -96,6 +96,12 @@ var AutumnError = class _AutumnError extends Error {
96
96
  };
97
97
 
98
98
  // src/sdk/general/genMethods.ts
99
+ var handleCheckout = async ({
100
+ instance,
101
+ params
102
+ }) => {
103
+ return instance.post("/checkout", params);
104
+ };
99
105
  var handleAttach = async ({
100
106
  instance,
101
107
  params
@@ -114,18 +120,6 @@ var handleCancel = async ({
114
120
  }) => {
115
121
  return instance.post("/cancel", params);
116
122
  };
117
- var handleEntitled = async ({
118
- instance,
119
- params
120
- }) => {
121
- return instance.post("/entitled", params);
122
- };
123
- var handleEvent = async ({
124
- instance,
125
- params
126
- }) => {
127
- return instance.post("/events", params);
128
- };
129
123
  var handleTrack = async ({
130
124
  instance,
131
125
  params
@@ -472,6 +466,13 @@ var Autumn = class {
472
466
  products = productMethods(this);
473
467
  entities = entityMethods(this);
474
468
  referrals = referralMethods(this);
469
+ static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
470
+ async checkout(params) {
471
+ return handleCheckout({
472
+ instance: this,
473
+ params
474
+ });
475
+ }
475
476
  static attach = (params) => staticWrapper(handleAttach, void 0, { params });
476
477
  static usage = (params) => staticWrapper(handleUsage, void 0, { params });
477
478
  async attach(params) {
@@ -494,21 +495,6 @@ var Autumn = class {
494
495
  params
495
496
  });
496
497
  }
497
- /**
498
- * @deprecated This method is deprecated and will be removed in a future version.
499
- * Please use the new check() method instead.
500
- */
501
- static entitled = (params) => staticWrapper(handleEntitled, void 0, { params });
502
- /**
503
- * @deprecated This method is deprecated and will be removed in a future version.
504
- * Please use the new check() method instead.
505
- */
506
- async entitled(params) {
507
- return handleEntitled({
508
- instance: this,
509
- params
510
- });
511
- }
512
498
  static check = (params) => staticWrapper(handleCheck, void 0, { params });
513
499
  async check(params) {
514
500
  return handleCheck({
@@ -516,21 +502,6 @@ var Autumn = class {
516
502
  params
517
503
  });
518
504
  }
519
- /**
520
- * @deprecated This method is deprecated and will be removed in a future version.
521
- * Please use the new track() method instead.
522
- */
523
- static event = (params) => staticWrapper(handleEvent, void 0, { params });
524
- /**
525
- * @deprecated This method is deprecated and will be removed in a future version.
526
- * Please use the new track() method instead.
527
- */
528
- async event(params) {
529
- return handleEvent({
530
- instance: this,
531
- params
532
- });
533
- }
534
505
  static track = (params) => staticWrapper(handleTrack, void 0, { params });
535
506
  async track(params) {
536
507
  return handleTrack({
@@ -555,44 +526,6 @@ var EntityDataSchema = import_zod.z.object({
555
526
 
556
527
  // src/sdk/general/genTypes.ts
557
528
  var import_zod2 = require("zod");
558
- var AttachFeatureOptionsSchema = import_zod2.z.object({
559
- feature_id: import_zod2.z.string(),
560
- quantity: import_zod2.z.number()
561
- });
562
- var AttachParamsSchema = import_zod2.z.object({
563
- customer_id: import_zod2.z.string(),
564
- product_id: import_zod2.z.string().optional(),
565
- entity_id: import_zod2.z.string().optional(),
566
- options: import_zod2.z.array(
567
- import_zod2.z.object({
568
- feature_id: import_zod2.z.string(),
569
- quantity: import_zod2.z.number()
570
- })
571
- ).optional(),
572
- product_ids: import_zod2.z.array(import_zod2.z.string()).optional(),
573
- // If set, will attach multiple products to the customer (cannot be used with product_id)
574
- free_trial: import_zod2.z.boolean().optional(),
575
- // Default is true -- if set to false, will bypass product free trial
576
- success_url: import_zod2.z.string().optional(),
577
- // Passed to Stripe
578
- metadata: import_zod2.z.record(import_zod2.z.string()).optional(),
579
- // Passed to Stripe
580
- force_checkout: import_zod2.z.boolean().optional(),
581
- // Default is false -- if set to true, will force the customer to checkout (not allowed for upgrades / downgrades)
582
- customer_data: import_zod2.z.any().optional(),
583
- entity_data: import_zod2.z.any().optional(),
584
- checkout_session_params: import_zod2.z.record(import_zod2.z.any()).optional(),
585
- // Passed to Stripe
586
- reward: import_zod2.z.string().optional()
587
- });
588
- var AttachResultSchema = import_zod2.z.object({
589
- checkout_url: import_zod2.z.string().optional(),
590
- customer_id: import_zod2.z.string(),
591
- product_ids: import_zod2.z.array(import_zod2.z.string()),
592
- code: import_zod2.z.string(),
593
- message: import_zod2.z.string(),
594
- customer_data: import_zod2.z.any().optional()
595
- });
596
529
  var CancelParamsSchema = import_zod2.z.object({
597
530
  customer_id: import_zod2.z.string(),
598
531
  product_id: import_zod2.z.string(),
@@ -646,6 +579,11 @@ var CustomerExpandEnum = import_zod3.z.enum([
646
579
 
647
580
  // src/sdk/customers/cusTypes.ts
648
581
  var import_zod4 = require("zod");
582
+ var CustomerDataSchema = import_zod4.z.object({
583
+ name: import_zod4.z.string().nullish(),
584
+ email: import_zod4.z.string().nullish(),
585
+ fingerprint: import_zod4.z.string().nullish()
586
+ });
649
587
  var CreateCustomerParamsSchema = import_zod4.z.object({
650
588
  id: import_zod4.z.string().nullish(),
651
589
  email: import_zod4.z.string().nullish(),
@@ -669,6 +607,44 @@ var RedeemReferralCodeParamsSchema = import_zod5.z.object({
669
607
  customer_id: import_zod5.z.string()
670
608
  });
671
609
 
610
+ // src/sdk/general/attachTypes.ts
611
+ var import_zod6 = require("zod");
612
+ var AttachFeatureOptionsSchema = import_zod6.z.object({
613
+ feature_id: import_zod6.z.string(),
614
+ quantity: import_zod6.z.number()
615
+ });
616
+ var AttachParamsSchema = import_zod6.z.object({
617
+ customer_id: import_zod6.z.string(),
618
+ product_id: import_zod6.z.string().optional(),
619
+ entity_id: import_zod6.z.string().optional(),
620
+ options: import_zod6.z.array(AttachFeatureOptionsSchema).optional(),
621
+ product_ids: import_zod6.z.array(import_zod6.z.string()).optional(),
622
+ free_trial: import_zod6.z.boolean().optional(),
623
+ success_url: import_zod6.z.string().optional(),
624
+ metadata: import_zod6.z.record(import_zod6.z.string()).optional(),
625
+ force_checkout: import_zod6.z.boolean().optional(),
626
+ customer_data: CustomerDataSchema.optional(),
627
+ entity_data: import_zod6.z.any().optional(),
628
+ checkout_session_params: import_zod6.z.record(import_zod6.z.any()).optional(),
629
+ reward: import_zod6.z.string().optional()
630
+ });
631
+ var AttachResultSchema = import_zod6.z.object({
632
+ checkout_url: import_zod6.z.string().optional(),
633
+ customer_id: import_zod6.z.string(),
634
+ product_ids: import_zod6.z.array(import_zod6.z.string()),
635
+ code: import_zod6.z.string(),
636
+ message: import_zod6.z.string(),
637
+ customer_data: import_zod6.z.any().optional()
638
+ });
639
+ var CheckoutParamsSchema = import_zod6.z.object({
640
+ customer_id: import_zod6.z.string(),
641
+ product_id: import_zod6.z.string(),
642
+ entity_id: import_zod6.z.string().optional(),
643
+ success_url: import_zod6.z.string().optional(),
644
+ customer_data: CustomerDataSchema.optional(),
645
+ options: import_zod6.z.array(AttachFeatureOptionsSchema).optional()
646
+ });
647
+
672
648
  // src/libraries/react/errorUtils/logFetchError.ts
673
649
  var logFetchError = ({
674
650
  method,
@@ -744,9 +720,13 @@ async function deleteEntityMethod(entityId) {
744
720
  }
745
721
 
746
722
  // src/libraries/react/client/clientGenMethods.ts
723
+ async function checkoutMethod(params) {
724
+ let snakeParams = toSnakeCase(params);
725
+ const res = await this.post(`${this.prefix}/checkout`, snakeParams);
726
+ return res;
727
+ }
747
728
  async function attachMethod(params) {
748
- let { dialog, ...rest } = params;
749
- let snakeParams = toSnakeCase(rest, ["checkoutSessionparams"]);
729
+ let snakeParams = toSnakeCase(params, ["checkoutSessionparams"]);
750
730
  const res = await this.post(`${this.prefix}/attach`, snakeParams);
751
731
  return res;
752
732
  }
@@ -953,6 +933,7 @@ var AutumnClient = class {
953
933
  return await getPricingTableMethod.bind(this)();
954
934
  }
955
935
  attach = attachMethod.bind(this);
936
+ checkout = checkoutMethod.bind(this);
956
937
  cancel = cancelMethod.bind(this);
957
938
  check = checkMethod.bind(this);
958
939
  track = trackMethod.bind(this);
@@ -1173,15 +1154,13 @@ var defaultSWRConfig = {
1173
1154
  };
1174
1155
  var usePricingTableBase = ({
1175
1156
  AutumnContext: AutumnContext2,
1176
- params,
1177
- authClient
1157
+ params
1178
1158
  }) => {
1179
1159
  const context = useAutumnContext({
1180
1160
  AutumnContext: AutumnContext2,
1181
- name: "usePricingTable",
1182
- errorIfNotInitialized: !authClient
1161
+ name: "usePricingTable"
1183
1162
  });
1184
- const client = authClient ? authClient.autumn : context.client;
1163
+ const client = context.client;
1185
1164
  const fetcher = async () => {
1186
1165
  try {
1187
1166
  const { data: data2, error: error2 } = await client.products.list();
@@ -1201,7 +1180,6 @@ var usePricingTableBase = ({
1201
1180
  );
1202
1181
  return {
1203
1182
  products: mergeProductDetails(data || [], params?.productDetails),
1204
- // products: data || [],
1205
1183
  isLoading: !error && !data,
1206
1184
  error,
1207
1185
  refetch: mutate
@@ -1211,20 +1189,16 @@ var usePricingTableBase = ({
1211
1189
  // src/libraries/react/hooks/useAutumnBase.tsx
1212
1190
  var useAutumnBase = ({
1213
1191
  AutumnContext: AutumnContext2,
1214
- authClient,
1215
1192
  refetchCustomer
1216
1193
  }) => {
1217
1194
  const context = useAutumnContext({
1218
1195
  AutumnContext: AutumnContext2,
1219
- name: "useAutumn",
1220
- errorIfNotInitialized: !authClient
1196
+ name: "useAutumn"
1221
1197
  });
1222
1198
  const { attachDialog, paywallDialog } = context;
1223
- const client = authClient ? authClient.autumn : context.client;
1224
- const authClientExists = !!authClient;
1199
+ const client = context.client;
1225
1200
  const { refetch: refetchPricingTable } = usePricingTableBase({
1226
- AutumnContext: AutumnContext2,
1227
- authClient
1201
+ AutumnContext: AutumnContext2
1228
1202
  });
1229
1203
  let {
1230
1204
  open: attachOpen,
@@ -1259,8 +1233,29 @@ var useAutumnBase = ({
1259
1233
  }
1260
1234
  return result;
1261
1235
  };
1236
+ const checkout = async (params) => {
1237
+ const { data, error } = await client.checkout(params);
1238
+ const { dialog, ...rest } = params;
1239
+ if (error) {
1240
+ return { data, error };
1241
+ }
1242
+ if (data.url) {
1243
+ if (params.openInNewTab) {
1244
+ window.open(data.url, "_blank");
1245
+ } else {
1246
+ window.location.href = data.url;
1247
+ }
1248
+ return { data, error };
1249
+ }
1250
+ if (params.dialog) {
1251
+ setAttachProps({ checkoutResult: data, attachParams: rest });
1252
+ setAttachComponent(params.dialog);
1253
+ setAttachOpen(true);
1254
+ }
1255
+ return { data, error };
1256
+ };
1262
1257
  const attachWithDialog = async (params) => {
1263
- let { dialog, ...rest } = params;
1258
+ let { ...rest } = params;
1264
1259
  const { productId, entityId, entityData } = params;
1265
1260
  const checkRes = await client.check({
1266
1261
  productId,
@@ -1281,14 +1276,8 @@ var useAutumnBase = ({
1281
1276
  return checkRes;
1282
1277
  };
1283
1278
  const attach = async (params) => {
1284
- const { dialog, openInNewTab } = params;
1279
+ const { dialog } = params;
1285
1280
  let finalDialog = dialog;
1286
- if (dialog && authClientExists) {
1287
- console.error(
1288
- "[Autumn] Attach dialog cannot be used with better auth plugin. To use this, please switch to <AutumnProvider /> and autumnHandler. Learn more here: https://docs.useautumn.com/quickstart/quickstart"
1289
- );
1290
- return void 0;
1291
- }
1292
1281
  if (finalDialog && !attachOpen) {
1293
1282
  setAttachComponent(finalDialog);
1294
1283
  return await attachWithDialog(params);
@@ -1304,12 +1293,6 @@ var useAutumnBase = ({
1304
1293
  };
1305
1294
  const check = async (params) => {
1306
1295
  let { dialog, withPreview } = params;
1307
- if (dialog && authClientExists) {
1308
- console.error(
1309
- "[Autumn] Check dialog cannot be used with better auth plugin. To use this, please switch to <AutumnProvider /> and autumnHandler. Learn more here: https://docs.useautumn.com/quickstart/quickstart"
1310
- );
1311
- return void 0;
1312
- }
1313
1296
  if (dialog) {
1314
1297
  setPaywallComponent(dialog);
1315
1298
  }
@@ -1385,7 +1368,8 @@ var useAutumnBase = ({
1385
1368
  track,
1386
1369
  cancel,
1387
1370
  openBillingPortal,
1388
- setupPayment
1371
+ setupPayment,
1372
+ checkout
1389
1373
  };
1390
1374
  };
1391
1375
 
@@ -1457,7 +1441,8 @@ var emptyDefaultFunctions = {
1457
1441
  track: "",
1458
1442
  cancel: "",
1459
1443
  openBillingPortal: "",
1460
- setupPayment: ""
1444
+ setupPayment: "",
1445
+ checkout: ""
1461
1446
  };
1462
1447
  var useCustomerBase = ({
1463
1448
  params,
@@ -1546,7 +1531,8 @@ var import_swr3 = __toESM(require("swr"));
1546
1531
  var import_react4 = require("react");
1547
1532
 
1548
1533
  // src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
1549
- var import_react6 = require("react");
1534
+ var AccordionPrimitive2 = __toESM(require("@radix-ui/react-accordion"));
1535
+ var import_react8 = require("react");
1550
1536
 
1551
1537
  // ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
1552
1538
  function r(e) {
@@ -4076,10 +4062,10 @@ function cn(...inputs) {
4076
4062
  // src/libraries/react/components/ui/button.tsx
4077
4063
  var React3 = __toESM(require("react"));
4078
4064
 
4079
- // ../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
4065
+ // ../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
4080
4066
  var React2 = __toESM(require("react"), 1);
4081
4067
 
4082
- // ../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
4068
+ // ../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
4083
4069
  var React = __toESM(require("react"), 1);
4084
4070
  function setRef(ref, value) {
4085
4071
  if (typeof ref === "function") {
@@ -4116,7 +4102,7 @@ function useComposedRefs(...refs) {
4116
4102
  return React.useCallback(composeRefs(...refs), refs);
4117
4103
  }
4118
4104
 
4119
- // ../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
4105
+ // ../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
4120
4106
  var import_jsx_runtime3 = require("react/jsx-runtime");
4121
4107
  // @__NO_SIDE_EFFECTS__
4122
4108
  function createSlot(ownerName) {
@@ -4289,7 +4275,7 @@ Button.displayName = "Button";
4289
4275
  // src/libraries/react/components/ui/dialog.tsx
4290
4276
  var React26 = __toESM(require("react"));
4291
4277
 
4292
- // ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18.3_6jqxb3tj3w4wyxj7ukcjjle5fm/node_modules/@radix-ui/react-dialog/dist/index.mjs
4278
+ // ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1._xkx6efnpqhhb4lkirxfs4qofci/node_modules/@radix-ui/react-dialog/dist/index.mjs
4293
4279
  var React25 = __toESM(require("react"), 1);
4294
4280
 
4295
4281
  // ../node_modules/.pnpm/@radix-ui+primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.mjs
@@ -4302,7 +4288,7 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
4302
4288
  };
4303
4289
  }
4304
4290
 
4305
- // ../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.mjs
4291
+ // ../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.mjs
4306
4292
  var React4 = __toESM(require("react"), 1);
4307
4293
  var import_jsx_runtime5 = require("react/jsx-runtime");
4308
4294
  function createContext22(rootComponentName, defaultContext) {
@@ -4379,15 +4365,15 @@ function composeContextScopes(...scopes) {
4379
4365
  return createScope;
4380
4366
  }
4381
4367
 
4382
- // ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
4368
+ // ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
4383
4369
  var React6 = __toESM(require("react"), 1);
4384
4370
 
4385
- // ../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
4371
+ // ../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
4386
4372
  var React5 = __toESM(require("react"), 1);
4387
4373
  var useLayoutEffect2 = globalThis?.document ? React5.useLayoutEffect : () => {
4388
4374
  };
4389
4375
 
4390
- // ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
4376
+ // ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
4391
4377
  var useReactId = React6[" useId ".trim().toString()] || (() => void 0);
4392
4378
  var count = 0;
4393
4379
  function useId(deterministicId) {
@@ -4398,7 +4384,7 @@ function useId(deterministicId) {
4398
4384
  return deterministicId || (id ? `radix-${id}` : "");
4399
4385
  }
4400
4386
 
4401
- // ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
4387
+ // ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
4402
4388
  var React7 = __toESM(require("react"), 1);
4403
4389
  var React22 = __toESM(require("react"), 1);
4404
4390
  var useInsertionEffect = React7[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
@@ -4467,10 +4453,10 @@ function isFunction(value) {
4467
4453
  }
4468
4454
  var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
4469
4455
 
4470
- // ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.6_@types+react@18.3.23__@types_drwlkfjdq4wgdhzmir3o6m26pm/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
4456
+ // ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.6_@types+react@19.1.8__@types+_ya5augm4xgo65hmrlxfyu743vi/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
4471
4457
  var React11 = __toESM(require("react"), 1);
4472
4458
 
4473
- // ../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18_nioct6cchui7iasnxutwakzwo4/node_modules/@radix-ui/react-primitive/dist/index.mjs
4459
+ // ../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19._sqnj4wa3mllckai5din6afvope/node_modules/@radix-ui/react-primitive/dist/index.mjs
4474
4460
  var React8 = __toESM(require("react"), 1);
4475
4461
  var ReactDOM = __toESM(require("react-dom"), 1);
4476
4462
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -4510,7 +4496,7 @@ function dispatchDiscreteCustomEvent(target, event) {
4510
4496
  if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
4511
4497
  }
4512
4498
 
4513
- // ../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
4499
+ // ../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
4514
4500
  var React9 = __toESM(require("react"), 1);
4515
4501
  function useCallbackRef(callback) {
4516
4502
  const callbackRef = React9.useRef(callback);
@@ -4520,7 +4506,7 @@ function useCallbackRef(callback) {
4520
4506
  return React9.useMemo(() => (...args) => callbackRef.current?.(...args), []);
4521
4507
  }
4522
4508
 
4523
- // ../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
4509
+ // ../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
4524
4510
  var React10 = __toESM(require("react"), 1);
4525
4511
  function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
4526
4512
  const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
@@ -4535,7 +4521,7 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
4535
4521
  }, [onEscapeKeyDown, ownerDocument]);
4536
4522
  }
4537
4523
 
4538
- // ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.6_@types+react@18.3.23__@types_drwlkfjdq4wgdhzmir3o6m26pm/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
4524
+ // ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.6_@types+react@19.1.8__@types+_ya5augm4xgo65hmrlxfyu743vi/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
4539
4525
  var import_jsx_runtime7 = require("react/jsx-runtime");
4540
4526
  var DISMISSABLE_LAYER_NAME = "DismissableLayer";
4541
4527
  var CONTEXT_UPDATE = "dismissableLayer.update";
@@ -4740,7 +4726,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
4740
4726
  }
4741
4727
  }
4742
4728
 
4743
- // ../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@_tzcmconc5ragkl5g7l4v5nw77e/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
4729
+ // ../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@1_7liqdxmess7vaws2bkjw22mwva/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
4744
4730
  var React12 = __toESM(require("react"), 1);
4745
4731
  var import_jsx_runtime8 = require("react/jsx-runtime");
4746
4732
  var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
@@ -4944,7 +4930,7 @@ function removeLinks(items) {
4944
4930
  return items.filter((item) => item.tagName !== "A");
4945
4931
  }
4946
4932
 
4947
- // ../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18.3._i6nxrodwqs37ebgrrch2pubydm/node_modules/@radix-ui/react-portal/dist/index.mjs
4933
+ // ../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1.8_5jmzxxd65wsdfod4yurl7mkae4/node_modules/@radix-ui/react-portal/dist/index.mjs
4948
4934
  var React13 = __toESM(require("react"), 1);
4949
4935
  var import_react_dom = __toESM(require("react-dom"), 1);
4950
4936
  var import_jsx_runtime9 = require("react/jsx-runtime");
@@ -4958,7 +4944,7 @@ var Portal = React13.forwardRef((props, forwardedRef) => {
4958
4944
  });
4959
4945
  Portal.displayName = PORTAL_NAME;
4960
4946
 
4961
- // ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18._bzol5sev26xbtplj3ab5nkoo5a/node_modules/@radix-ui/react-presence/dist/index.mjs
4947
+ // ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1_2lguv7jzxii6s3eigxktbpwkji/node_modules/@radix-ui/react-presence/dist/index.mjs
4962
4948
  var React23 = __toESM(require("react"), 1);
4963
4949
  var React14 = __toESM(require("react"), 1);
4964
4950
  function useStateMachine(initialState, machine) {
@@ -5084,7 +5070,7 @@ function getElementRef2(element) {
5084
5070
  return element.props.ref || element.ref;
5085
5071
  }
5086
5072
 
5087
- // ../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
5073
+ // ../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
5088
5074
  var React15 = __toESM(require("react"), 1);
5089
5075
  var count2 = 0;
5090
5076
  function useFocusGuards() {
@@ -5144,19 +5130,19 @@ function __spreadArray(to, from, pack) {
5144
5130
  return to.concat(ar || Array.prototype.slice.call(from));
5145
5131
  }
5146
5132
 
5147
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
5133
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
5148
5134
  var React24 = __toESM(require("react"));
5149
5135
 
5150
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
5136
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
5151
5137
  var React18 = __toESM(require("react"));
5152
5138
 
5153
- // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
5139
+ // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
5154
5140
  var zeroRightClassName = "right-scroll-bar-position";
5155
5141
  var fullWidthClassName = "width-before-scroll-bar";
5156
5142
  var noScrollbarsClassName = "with-scroll-bars-hidden";
5157
5143
  var removedBarSizeVariable = "--removed-body-scroll-bar-size";
5158
5144
 
5159
- // ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.23_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
5145
+ // ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.8_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
5160
5146
  function assignRef(ref, value) {
5161
5147
  if (typeof ref === "function") {
5162
5148
  ref(value);
@@ -5166,7 +5152,7 @@ function assignRef(ref, value) {
5166
5152
  return ref;
5167
5153
  }
5168
5154
 
5169
- // ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.23_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js
5155
+ // ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.8_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js
5170
5156
  var import_react5 = require("react");
5171
5157
  function useCallbackRef2(initialValue, callback) {
5172
5158
  var ref = (0, import_react5.useState)(function() {
@@ -5194,7 +5180,7 @@ function useCallbackRef2(initialValue, callback) {
5194
5180
  return ref.facade;
5195
5181
  }
5196
5182
 
5197
- // ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@18.3.23_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
5183
+ // ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.8_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
5198
5184
  var React16 = __toESM(require("react"));
5199
5185
  var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React16.useLayoutEffect : React16.useEffect;
5200
5186
  var currentValues = /* @__PURE__ */ new WeakMap();
@@ -5226,7 +5212,7 @@ function useMergeRefs(refs, defaultValue) {
5226
5212
  return callbackRef;
5227
5213
  }
5228
5214
 
5229
- // ../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@18.3.23_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js
5215
+ // ../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.8_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js
5230
5216
  function ItoI(a) {
5231
5217
  return a;
5232
5218
  }
@@ -5312,7 +5298,7 @@ function createSidecarMedium(options) {
5312
5298
  return medium;
5313
5299
  }
5314
5300
 
5315
- // ../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@18.3.23_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js
5301
+ // ../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.8_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js
5316
5302
  var React17 = __toESM(require("react"));
5317
5303
  var SideCar = function(_a) {
5318
5304
  var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
@@ -5331,10 +5317,10 @@ function exportSidecar(medium, exported) {
5331
5317
  return SideCar;
5332
5318
  }
5333
5319
 
5334
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js
5320
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js
5335
5321
  var effectCar = createSidecarMedium();
5336
5322
 
5337
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
5323
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
5338
5324
  var nothing = function() {
5339
5325
  return;
5340
5326
  };
@@ -5366,13 +5352,13 @@ RemoveScroll.classNames = {
5366
5352
  zeroRight: zeroRightClassName
5367
5353
  };
5368
5354
 
5369
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
5355
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
5370
5356
  var React21 = __toESM(require("react"));
5371
5357
 
5372
- // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
5358
+ // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
5373
5359
  var React20 = __toESM(require("react"));
5374
5360
 
5375
- // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@18.3.23_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
5361
+ // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.8_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
5376
5362
  var React19 = __toESM(require("react"));
5377
5363
 
5378
5364
  // ../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
@@ -5387,7 +5373,7 @@ var getNonce = function() {
5387
5373
  return void 0;
5388
5374
  };
5389
5375
 
5390
- // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@18.3.23_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js
5376
+ // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.8_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js
5391
5377
  function makeStyleTag() {
5392
5378
  if (!document)
5393
5379
  return null;
@@ -5433,7 +5419,7 @@ var stylesheetSingleton = function() {
5433
5419
  };
5434
5420
  };
5435
5421
 
5436
- // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@18.3.23_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
5422
+ // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.8_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
5437
5423
  var styleHookSingleton = function() {
5438
5424
  var sheet = stylesheetSingleton();
5439
5425
  return function(styles, isDynamic) {
@@ -5446,7 +5432,7 @@ var styleHookSingleton = function() {
5446
5432
  };
5447
5433
  };
5448
5434
 
5449
- // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@18.3.23_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js
5435
+ // ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.8_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js
5450
5436
  var styleSingleton = function() {
5451
5437
  var useStyle = styleHookSingleton();
5452
5438
  var Sheet = function(_a) {
@@ -5457,7 +5443,7 @@ var styleSingleton = function() {
5457
5443
  return Sheet;
5458
5444
  };
5459
5445
 
5460
- // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
5446
+ // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
5461
5447
  var zeroGap = {
5462
5448
  left: 0,
5463
5449
  top: 0,
@@ -5492,7 +5478,7 @@ var getGapWidth = function(gapMode) {
5492
5478
  };
5493
5479
  };
5494
5480
 
5495
- // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
5481
+ // ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
5496
5482
  var Style = styleSingleton();
5497
5483
  var lockAttribute = "data-scroll-locked";
5498
5484
  var getStyles = function(_a, allowRelative, gapMode, important) {
@@ -5532,7 +5518,7 @@ var RemoveScrollBar = function(_a) {
5532
5518
  return React20.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
5533
5519
  };
5534
5520
 
5535
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
5521
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
5536
5522
  var passiveSupported = false;
5537
5523
  if (typeof window !== "undefined") {
5538
5524
  try {
@@ -5551,7 +5537,7 @@ if (typeof window !== "undefined") {
5551
5537
  var options;
5552
5538
  var nonPassive = passiveSupported ? { passive: false } : false;
5553
5539
 
5554
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
5540
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
5555
5541
  var alwaysContainsScroll = function(node) {
5556
5542
  return node.tagName === "TEXTAREA";
5557
5543
  };
@@ -5651,7 +5637,7 @@ var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
5651
5637
  return shouldCancelScroll;
5652
5638
  };
5653
5639
 
5654
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
5640
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
5655
5641
  var getTouchXY = function(event) {
5656
5642
  return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
5657
5643
  };
@@ -5816,10 +5802,10 @@ function getOutermostShadowParent(node) {
5816
5802
  return shadowParent;
5817
5803
  }
5818
5804
 
5819
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
5805
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
5820
5806
  var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
5821
5807
 
5822
- // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@18.3.23_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
5808
+ // ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.8_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
5823
5809
  var ReactRemoveScroll = React24.forwardRef(function(props, ref) {
5824
5810
  return React24.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
5825
5811
  });
@@ -5947,7 +5933,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
5947
5933
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
5948
5934
  };
5949
5935
 
5950
- // ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18.3_6jqxb3tj3w4wyxj7ukcjjle5fm/node_modules/@radix-ui/react-dialog/dist/index.mjs
5936
+ // ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1._xkx6efnpqhhb4lkirxfs4qofci/node_modules/@radix-ui/react-dialog/dist/index.mjs
5951
5937
  var import_jsx_runtime10 = require("react/jsx-runtime");
5952
5938
  var DIALOG_NAME = "Dialog";
5953
5939
  var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
@@ -6265,7 +6251,7 @@ var DialogOverlay2 = React26.forwardRef(({ className, ...props }, ref) => /* @__
6265
6251
  {
6266
6252
  ref,
6267
6253
  className: cn(
6268
- "au-fixed au-inset-0 au-z-50 au-bg-black/80 data-[state=open]:au-animate-in data-[state=closed]:au-animate-out data-[state=closed]:au-fade-out-0 data-[state=open]:au-fade-in-0",
6254
+ "au-fixed au-inset-0 au-z-50 data-[state=open]:au-animate-in data-[state=closed]:au-animate-out data-[state=closed]:au-fade-out-0 data-[state=open]:au-fade-in-0 au-backdrop-blur-sm au-bg-black/40",
6269
6255
  className
6270
6256
  ),
6271
6257
  ...props
@@ -6343,27 +6329,61 @@ DialogDescription2.displayName = Description.displayName;
6343
6329
 
6344
6330
  // src/libraries/react/components/attach-dialog/lib/attach-content.tsx
6345
6331
  var import_jsx_runtime12 = require("react/jsx-runtime");
6346
- var getAttachContent = (preview) => {
6347
- const {
6348
- scenario,
6349
- product_name,
6350
- recurring,
6351
- current_product_name,
6352
- next_cycle_at
6353
- } = preview;
6354
- const nextCycleAtStr = next_cycle_at ? new Date(next_cycle_at).toLocaleDateString() : void 0;
6332
+ var getAttachContent = (checkoutResult) => {
6333
+ const { product, current_product, next_cycle } = checkoutResult;
6334
+ const { is_one_off, is_free, has_trial, has_prepaid } = product.properties;
6335
+ const scenario = product.scenario;
6336
+ const nextCycleAtStr = next_cycle ? new Date(next_cycle.starts_at).toLocaleDateString() : void 0;
6337
+ const productName = product.name;
6338
+ if (is_one_off) {
6339
+ return {
6340
+ title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6341
+ "Purchase ",
6342
+ productName
6343
+ ] }),
6344
+ message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6345
+ "By clicking confirm, you will purchase ",
6346
+ productName,
6347
+ " and your card will be charged immediately."
6348
+ ] })
6349
+ };
6350
+ }
6351
+ if (scenario == "active" && has_prepaid) {
6352
+ if (has_prepaid) {
6353
+ return {
6354
+ title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "Update Plan" }),
6355
+ message: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "Update your prepaid quantity. You'll be charged or credited the prorated difference based on your current billing cycle." })
6356
+ };
6357
+ }
6358
+ }
6359
+ if (has_trial) {
6360
+ return {
6361
+ title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6362
+ "Start trial for ",
6363
+ productName
6364
+ ] }),
6365
+ message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6366
+ "By clicking confirm, you will start a free trial of ",
6367
+ productName,
6368
+ " ",
6369
+ "which ends on ",
6370
+ nextCycleAtStr,
6371
+ "."
6372
+ ] })
6373
+ };
6374
+ }
6355
6375
  switch (scenario) {
6356
6376
  case "scheduled":
6357
6377
  return {
6358
6378
  title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6359
- product_name,
6379
+ productName,
6360
6380
  " product already scheduled"
6361
6381
  ] }),
6362
6382
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6363
6383
  "You are currently on product ",
6364
- current_product_name,
6384
+ current_product.name,
6365
6385
  " and are scheduled to start ",
6366
- product_name,
6386
+ productName,
6367
6387
  " on ",
6368
6388
  nextCycleAtStr,
6369
6389
  "."
@@ -6375,38 +6395,37 @@ var getAttachContent = (preview) => {
6375
6395
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "You are already subscribed to this product." })
6376
6396
  };
6377
6397
  case "new":
6378
- if (recurring) {
6379
- return {
6380
- title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6381
- "Subscribe to ",
6382
- product_name
6383
- ] }),
6384
- message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6385
- "By clicking confirm, you will be subscribed to ",
6386
- product_name,
6387
- " and your card will be charged immediately."
6388
- ] })
6389
- };
6390
- } else {
6398
+ if (is_free) {
6391
6399
  return {
6392
6400
  title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6393
- "Purchase ",
6394
- product_name
6401
+ "Enable ",
6402
+ productName
6395
6403
  ] }),
6396
6404
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6397
- "By clicking confirm, you will purchase ",
6398
- product_name,
6399
- " and your card will be charged immediately."
6405
+ "By clicking confirm, ",
6406
+ productName,
6407
+ " will be enabled immediately."
6400
6408
  ] })
6401
6409
  };
6402
6410
  }
6411
+ return {
6412
+ title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6413
+ "Subscribe to ",
6414
+ productName
6415
+ ] }),
6416
+ message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6417
+ "By clicking confirm, you will be subscribed to ",
6418
+ productName,
6419
+ " and your card will be charged immediately."
6420
+ ] })
6421
+ };
6403
6422
  case "renew":
6404
6423
  return {
6405
6424
  title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "Renew" }),
6406
6425
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6407
6426
  "By clicking confirm, you will renew your subscription to",
6408
6427
  " ",
6409
- product_name,
6428
+ productName,
6410
6429
  "."
6411
6430
  ] })
6412
6431
  };
@@ -6414,11 +6433,11 @@ var getAttachContent = (preview) => {
6414
6433
  return {
6415
6434
  title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6416
6435
  "Upgrade to ",
6417
- product_name
6436
+ productName
6418
6437
  ] }),
6419
6438
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6420
6439
  "By clicking confirm, you will upgrade to ",
6421
- product_name,
6440
+ productName,
6422
6441
  " and your payment method will be charged immediately."
6423
6442
  ] })
6424
6443
  };
@@ -6426,15 +6445,15 @@ var getAttachContent = (preview) => {
6426
6445
  return {
6427
6446
  title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6428
6447
  "Downgrade to ",
6429
- product_name
6448
+ productName
6430
6449
  ] }),
6431
6450
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6432
6451
  "By clicking confirm, your current subscription to",
6433
6452
  " ",
6434
- current_product_name,
6453
+ current_product.name,
6435
6454
  " will be cancelled and a new subscription to",
6436
6455
  " ",
6437
- product_name,
6456
+ productName,
6438
6457
  " will begin on ",
6439
6458
  nextCycleAtStr,
6440
6459
  "."
@@ -6445,7 +6464,7 @@ var getAttachContent = (preview) => {
6445
6464
  title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "Cancel" }),
6446
6465
  message: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
6447
6466
  "By clicking confirm, your subscription to ",
6448
- current_product_name,
6467
+ current_product.name,
6449
6468
  " ",
6450
6469
  "will end on ",
6451
6470
  nextCycleAtStr,
@@ -6460,213 +6479,495 @@ var getAttachContent = (preview) => {
6460
6479
  }
6461
6480
  };
6462
6481
 
6463
- // src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
6482
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/createLucideIcon.js
6483
+ var import_react7 = require("react");
6484
+
6485
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/shared/src/utils.js
6486
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
6487
+ var toCamelCase = (string) => string.replace(
6488
+ /^([A-Z])|[\s-_]+(\w)/g,
6489
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
6490
+ );
6491
+ var toPascalCase = (string) => {
6492
+ const camelCase = toCamelCase(string);
6493
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
6494
+ };
6495
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
6496
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
6497
+ }).join(" ").trim();
6498
+ var hasA11yProp = (props) => {
6499
+ for (const prop in props) {
6500
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
6501
+ return true;
6502
+ }
6503
+ }
6504
+ };
6505
+
6506
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/Icon.js
6507
+ var import_react6 = require("react");
6508
+
6509
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/defaultAttributes.js
6510
+ var defaultAttributes = {
6511
+ xmlns: "http://www.w3.org/2000/svg",
6512
+ width: 24,
6513
+ height: 24,
6514
+ viewBox: "0 0 24 24",
6515
+ fill: "none",
6516
+ stroke: "currentColor",
6517
+ strokeWidth: 2,
6518
+ strokeLinecap: "round",
6519
+ strokeLinejoin: "round"
6520
+ };
6521
+
6522
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/Icon.js
6523
+ var Icon = (0, import_react6.forwardRef)(
6524
+ ({
6525
+ color = "currentColor",
6526
+ size = 24,
6527
+ strokeWidth = 2,
6528
+ absoluteStrokeWidth,
6529
+ className = "",
6530
+ children,
6531
+ iconNode,
6532
+ ...rest
6533
+ }, ref) => (0, import_react6.createElement)(
6534
+ "svg",
6535
+ {
6536
+ ref,
6537
+ ...defaultAttributes,
6538
+ width: size,
6539
+ height: size,
6540
+ stroke: color,
6541
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
6542
+ className: mergeClasses("lucide", className),
6543
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
6544
+ ...rest
6545
+ },
6546
+ [
6547
+ ...iconNode.map(([tag, attrs]) => (0, import_react6.createElement)(tag, attrs)),
6548
+ ...Array.isArray(children) ? children : [children]
6549
+ ]
6550
+ )
6551
+ );
6552
+
6553
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/createLucideIcon.js
6554
+ var createLucideIcon = (iconName, iconNode) => {
6555
+ const Component = (0, import_react7.forwardRef)(
6556
+ ({ className, ...props }, ref) => (0, import_react7.createElement)(Icon, {
6557
+ ref,
6558
+ iconNode,
6559
+ className: mergeClasses(
6560
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
6561
+ `lucide-${iconName}`,
6562
+ className
6563
+ ),
6564
+ ...props
6565
+ })
6566
+ );
6567
+ Component.displayName = toPascalCase(iconName);
6568
+ return Component;
6569
+ };
6570
+
6571
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js
6572
+ var __iconNode = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
6573
+ var ChevronDown = createLucideIcon("chevron-down", __iconNode);
6574
+
6575
+ // ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js
6576
+ var __iconNode2 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
6577
+ var LoaderCircle = createLucideIcon("loader-circle", __iconNode2);
6578
+
6579
+ // src/libraries/react/components/ui/accordion.tsx
6580
+ var React27 = __toESM(require("react"));
6581
+ var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
6464
6582
  var import_jsx_runtime13 = require("react/jsx-runtime");
6583
+ var Accordion = AccordionPrimitive.Root;
6584
+ var AccordionItem = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6585
+ AccordionPrimitive.Item,
6586
+ {
6587
+ ref,
6588
+ className: cn("au-border-b", className),
6589
+ ...props
6590
+ }
6591
+ ));
6592
+ AccordionItem.displayName = "AccordionItem";
6593
+ var AccordionTrigger = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AccordionPrimitive.Header, { className: "au-flex", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6594
+ AccordionPrimitive.Trigger,
6595
+ {
6596
+ ref,
6597
+ className: cn(
6598
+ "au-flex au-flex-1 au-items-center au-justify-between au-py-4 au-text-sm au-font-medium au-transition-all hover:au-underline au-text-left [&[data-state=open]>svg]:au-rotate-180",
6599
+ className
6600
+ ),
6601
+ ...props,
6602
+ children: [
6603
+ children,
6604
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronDown, { className: "au-h-4 au-w-4 au-shrink-0 au-text-muted-foreground au-transition-transform au-duration-200" })
6605
+ ]
6606
+ }
6607
+ ) }));
6608
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
6609
+ var AccordionContent = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6610
+ AccordionPrimitive.Content,
6611
+ {
6612
+ ref,
6613
+ className: "au-overflow-hidden au-text-sm data-[state=closed]:au-animate-accordion-up data-[state=open]:au-animate-accordion-down",
6614
+ ...props,
6615
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("au-pb-4 au-pt-0", className), children })
6616
+ }
6617
+ ));
6618
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
6619
+
6620
+ // src/libraries/react/components/ui/popover.tsx
6621
+ var React28 = __toESM(require("react"));
6622
+ var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
6623
+ var import_jsx_runtime14 = require("react/jsx-runtime");
6624
+ var Popover = PopoverPrimitive.Root;
6625
+ var PopoverTrigger = PopoverPrimitive.Trigger;
6626
+ var PopoverContent = React28.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6627
+ PopoverPrimitive.Content,
6628
+ {
6629
+ ref,
6630
+ align,
6631
+ sideOffset,
6632
+ className: cn(
6633
+ "au-z-50 au-w-72 au-rounded-md au-border au-bg-popover au-p-4 au-text-popover-foreground au-shadow-md au-outline-none data-[state=open]:au-animate-in data-[state=closed]:au-animate-out data-[state=closed]:au-fade-out-0 data-[state=open]:au-fade-in-0 data-[state=closed]:au-zoom-out-95 data-[state=open]:au-zoom-in-95 data-[side=bottom]:au-slide-in-from-top-2 data-[side=left]:au-slide-in-from-right-2 data-[side=right]:au-slide-in-from-left-2 data-[side=top]:au-slide-in-from-bottom-2 au-origin-[--radix-popover-content-transform-origin]",
6634
+ className
6635
+ ),
6636
+ ...props
6637
+ }
6638
+ ) }));
6639
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
6640
+
6641
+ // src/libraries/react/components/ui/input.tsx
6642
+ var React29 = __toESM(require("react"));
6643
+ var import_jsx_runtime15 = require("react/jsx-runtime");
6644
+ var Input = React29.forwardRef(
6645
+ ({ className, type, ...props }, ref) => {
6646
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6647
+ "input",
6648
+ {
6649
+ type,
6650
+ className: cn(
6651
+ "au-flex au-h-9 au-w-full au-rounded-md au-border au-border-input au-bg-transparent au-px-3 au-py-1 au-text-base au-shadow-sm au-transition-colors file:au-border-0 file:au-bg-transparent file:au-text-sm file:au-font-medium file:au-text-foreground placeholder:au-text-muted-foreground focus-visible:au-outline-none focus-visible:au-ring-1 focus-visible:au-ring-ring disabled:au-cursor-not-allowed disabled:au-opacity-50 md:au-text-sm",
6652
+ className
6653
+ ),
6654
+ ref,
6655
+ ...props
6656
+ }
6657
+ );
6658
+ }
6659
+ );
6660
+ Input.displayName = "Input";
6661
+
6662
+ // src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
6663
+ var import_jsx_runtime16 = require("react/jsx-runtime");
6664
+ var formatCurrency = ({
6665
+ amount,
6666
+ currency
6667
+ }) => {
6668
+ return new Intl.NumberFormat("en-US", {
6669
+ style: "currency",
6670
+ currency
6671
+ }).format(amount);
6672
+ };
6465
6673
  function AttachDialog(params) {
6466
6674
  const { attach } = useCustomer();
6467
- const [loading, setLoading] = (0, import_react6.useState)(false);
6468
- const [optionsInput, setOptionsInput] = (0, import_react6.useState)(
6469
- params?.preview?.options || []
6675
+ const [checkoutResult, setCheckoutResult] = (0, import_react8.useState)(params?.checkoutResult);
6676
+ (0, import_react8.useEffect)(() => {
6677
+ if (params.checkoutResult) {
6678
+ setCheckoutResult(params.checkoutResult);
6679
+ }
6680
+ }, [params.checkoutResult]);
6681
+ const [loading, setLoading] = (0, import_react8.useState)(false);
6682
+ if (!checkoutResult) {
6683
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, {});
6684
+ }
6685
+ const { open, setOpen } = params;
6686
+ const { title, message } = getAttachContent(checkoutResult);
6687
+ const isFree = checkoutResult?.product.properties?.is_free;
6688
+ const isPaid = isFree === false;
6689
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Dialog2, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogContent2, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-overflow-hidden au-text-sm", children: [
6690
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogTitle2, { className: "au-px-6 au-mb-1", children: title }),
6691
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "au-px-6 au-mt-1 au-mb-4 au-text-muted-foreground", children: message }),
6692
+ isPaid && checkoutResult && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6693
+ PriceInformation,
6694
+ {
6695
+ checkoutResult,
6696
+ setCheckoutResult
6697
+ }
6698
+ ),
6699
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-pl-6 au-pr-3 au-bg-secondary au-border-t au-shadow-inner", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6700
+ Button,
6701
+ {
6702
+ size: "sm",
6703
+ onClick: async () => {
6704
+ setLoading(true);
6705
+ const options = checkoutResult.options.map((option) => {
6706
+ return {
6707
+ featureId: option.feature_id,
6708
+ quantity: option.quantity
6709
+ };
6710
+ });
6711
+ await attach({
6712
+ productId: checkoutResult.product.id,
6713
+ options
6714
+ });
6715
+ setOpen(false);
6716
+ setLoading(false);
6717
+ },
6718
+ disabled: loading,
6719
+ className: "au-min-w-16 au-flex au-items-center au-gap-2",
6720
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoaderCircle, { className: "au-w-4 au-h-4 au-animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "au-whitespace-nowrap au-flex au-gap-1", children: "Confirm" }) })
6721
+ }
6722
+ ) })
6723
+ ] }) });
6724
+ }
6725
+ function PriceInformation({
6726
+ checkoutResult,
6727
+ setCheckoutResult
6728
+ }) {
6729
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-px-6 au-mb-4 au-flex au-flex-col au-gap-4", children: [
6730
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6731
+ ProductItems,
6732
+ {
6733
+ checkoutResult,
6734
+ setCheckoutResult
6735
+ }
6736
+ ),
6737
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-flex-col au-gap-2", children: [
6738
+ checkoutResult?.has_prorations && checkoutResult.lines.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckoutLines, { checkoutResult }),
6739
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DueAmounts, { checkoutResult })
6740
+ ] })
6741
+ ] });
6742
+ }
6743
+ function DueAmounts({ checkoutResult }) {
6744
+ const { next_cycle, product } = checkoutResult;
6745
+ const nextCycleAtStr = next_cycle ? new Date(next_cycle.starts_at).toLocaleDateString() : void 0;
6746
+ const hasUsagePrice = product.items.some(
6747
+ (item) => item.usage_model === "pay_per_use"
6470
6748
  );
6471
- const getTotalPrice = () => {
6472
- let sum = due_today?.price || 0;
6473
- optionsInput.forEach((option) => {
6474
- if (option.price && option.quantity) {
6475
- sum += option.price * (option.quantity / option.billing_units);
6749
+ const showNextCycle = next_cycle && next_cycle.total !== checkoutResult.total;
6750
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-flex-col au-gap-1", children: [
6751
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-justify-between", children: [
6752
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-font-medium au-text-md", children: "Total due today" }) }),
6753
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-font-medium au-text-md", children: formatCurrency({
6754
+ amount: checkoutResult?.total,
6755
+ currency: checkoutResult?.currency
6756
+ }) })
6757
+ ] }),
6758
+ showNextCycle && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-justify-between au-text-muted-foreground", children: [
6759
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "au-text-md", children: [
6760
+ "Due next cycle (",
6761
+ nextCycleAtStr,
6762
+ ")"
6763
+ ] }) }),
6764
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "au-text-md", children: [
6765
+ formatCurrency({
6766
+ amount: next_cycle.total,
6767
+ currency: checkoutResult?.currency
6768
+ }),
6769
+ hasUsagePrice && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: " + usage prices" })
6770
+ ] })
6771
+ ] })
6772
+ ] });
6773
+ }
6774
+ function ProductItems({
6775
+ checkoutResult,
6776
+ setCheckoutResult
6777
+ }) {
6778
+ const isUpdateQuantity = checkoutResult?.product.scenario === "active" && checkoutResult.product.properties.has_prepaid;
6779
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-flex-col au-gap-2", children: [
6780
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-text-sm au-font-medium", children: "Price" }),
6781
+ checkoutResult?.product.items.filter((item) => item.type !== "feature").map((item, index) => {
6782
+ if (item.usage_model == "prepaid") {
6783
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6784
+ PrepaidItem,
6785
+ {
6786
+ item,
6787
+ checkoutResult,
6788
+ setCheckoutResult
6789
+ },
6790
+ index
6791
+ );
6476
6792
  }
6477
- });
6478
- return sum;
6479
- };
6480
- (0, import_react6.useEffect)(() => {
6481
- setOptionsInput(params?.preview?.options || []);
6482
- }, [params?.preview?.options]);
6483
- if (!params || !params.preview) {
6484
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {});
6485
- }
6486
- const { open, setOpen, preview } = params;
6487
- const { items, due_today } = preview;
6488
- const { title, message } = getAttachContent(preview);
6489
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Dialog2, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6490
- DialogContent2,
6491
- {
6492
- className: cn(
6493
- "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-overflow-hidden au-text-sm"
6494
- ),
6495
- children: [
6496
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogTitle2, { className: cn("au-px-6 au-mb-1 "), children: title }),
6497
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("au-px-6 au-mt-1 au-mb-4 au-text-muted-foreground"), children: message }),
6498
- (items || optionsInput.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "au-mb-6 au-px-6", children: [
6499
- items?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(PriceItem, { children: [
6500
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "au-truncate au-flex-1", children: item.description }),
6501
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: item.price })
6502
- ] }, item.description)),
6503
- optionsInput?.map((option, index) => {
6504
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6505
- OptionsInput,
6506
- {
6507
- option,
6508
- optionsInput,
6509
- setOptionsInput,
6510
- index
6511
- },
6512
- option.feature_name
6513
- );
6514
- })
6515
- ] }),
6516
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-pl-6 au-pr-3 au-bg-secondary au-border-t au-shadow-inner", children: [
6517
- due_today && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(TotalPrice, { children: [
6518
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Due Today" }),
6519
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: new Intl.NumberFormat("en-US", {
6520
- style: "currency",
6521
- currency: due_today.currency
6522
- }).format(getTotalPrice()) })
6523
- ] }),
6524
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6525
- Button,
6526
- {
6527
- size: "sm",
6528
- onClick: async () => {
6529
- setLoading(true);
6530
- await attach({
6531
- productId: preview.product_id,
6532
- options: optionsInput.map((option) => ({
6533
- featureId: option.feature_id,
6534
- quantity: option.quantity || 0
6535
- }))
6536
- });
6537
- setOpen(false);
6538
- setLoading(false);
6539
- },
6540
- disabled: loading,
6541
- className: "au-min-w-16 au-flex au-items-center au-gap-2"
6542
- }
6543
- )
6793
+ if (isUpdateQuantity) {
6794
+ return null;
6795
+ }
6796
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-justify-between", children: [
6797
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-text-muted-foreground", children: item.feature ? item.feature.name : "Subscription" }),
6798
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
6799
+ item.display?.primary_text,
6800
+ " ",
6801
+ item.display?.secondary_text
6544
6802
  ] })
6545
- ]
6546
- }
6547
- ) });
6803
+ ] }, index);
6804
+ })
6805
+ ] });
6548
6806
  }
6549
- var PriceItem = ({
6550
- children,
6807
+ function CheckoutLines({ checkoutResult }) {
6808
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Accordion, { type: "single", collapsible: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(AccordionItem, { value: "total", className: "au-border-b-0", children: [
6809
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CustomAccordionTrigger, { className: "au-justify-between au-w-full au-my-0 au-py-0 au-border-none", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-cursor-pointer au-flex au-items-center au-gap-1 au-w-full au-justify-end", children: [
6810
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-font-light au-text-muted-foreground", children: "View details" }),
6811
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6812
+ ChevronDown,
6813
+ {
6814
+ className: "au-text-muted-foreground au-mt-0.5 au-rotate-90 au-transition-transform au-duration-200 au-ease-in-out",
6815
+ size: 14
6816
+ }
6817
+ )
6818
+ ] }) }),
6819
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AccordionContent, { className: "au-mt-2 au-mb-0 au-pb-2 au-flex au-flex-col au-gap-2", children: checkoutResult?.lines.filter((line) => line.amount != 0).map((line, index) => {
6820
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-justify-between", children: [
6821
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-text-muted-foreground", children: line.description }),
6822
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-text-muted-foreground", children: new Intl.NumberFormat("en-US", {
6823
+ style: "currency",
6824
+ currency: checkoutResult?.currency
6825
+ }).format(line.amount) })
6826
+ ] }, index);
6827
+ }) })
6828
+ ] }) });
6829
+ }
6830
+ function CustomAccordionTrigger({
6551
6831
  className,
6832
+ children,
6552
6833
  ...props
6553
- }) => {
6554
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6555
- "div",
6834
+ }) {
6835
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AccordionPrimitive2.Header, { className: "au-flex", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6836
+ AccordionPrimitive2.Trigger,
6556
6837
  {
6838
+ "data-slot": "accordion-trigger",
6557
6839
  className: cn(
6558
- "au-flex au-flex-col au-pb-4 sm:au-pb-0 au-gap-1 sm:au-flex-row au-justify-between sm:au-h-7 sm:au-gap-2 sm:au-items-center",
6840
+ "focus-visible:au-border-ring focus-visible:au-ring-ring/50 au-flex au-flex-1 au-items-start au-justify-between au-gap-4 au-rounded-md au-py-4 au-text-left au-text-sm au-font-medium au-transition-all au-outline-none focus-visible:au-ring-[3px] disabled:au-pointer-events-none disabled:au-opacity-50 [&[data-state=open]_svg]:au-rotate-0",
6559
6841
  className
6560
6842
  ),
6561
6843
  ...props,
6562
6844
  children
6563
6845
  }
6564
- );
6565
- };
6566
- var OptionsInput = ({
6567
- className,
6568
- option,
6569
- optionsInput,
6570
- setOptionsInput,
6571
- index,
6572
- ...props
6573
- }) => {
6574
- const { feature_name, billing_units, quantity, price } = option;
6575
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(PriceItem, { children: [
6576
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: feature_name }),
6577
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6578
- QuantityInput,
6579
- {
6580
- value: quantity ? quantity / billing_units : "",
6581
- onChange: (e) => {
6582
- const newOptions = [...optionsInput];
6583
- newOptions[index].quantity = parseInt(e.target.value) * billing_units;
6584
- setOptionsInput(newOptions);
6585
- },
6586
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "", children: [
6587
- "\xD7 $",
6588
- price,
6589
- " per ",
6590
- billing_units === 1 ? " " : billing_units,
6591
- " ",
6592
- feature_name
6593
- ] })
6594
- },
6595
- feature_name
6596
- )
6597
- ] }, feature_name);
6598
- };
6599
- var QuantityInput = ({
6600
- children,
6601
- onChange,
6602
- value,
6603
- className,
6604
- ...props
6846
+ ) });
6847
+ }
6848
+ var PrepaidItem = ({
6849
+ item,
6850
+ checkoutResult,
6851
+ setCheckoutResult
6605
6852
  }) => {
6606
- const currentValue = Number(value) || 0;
6607
- const handleValueChange = (newValue) => {
6608
- const syntheticEvent = {
6609
- target: { value: String(newValue) }
6610
- };
6611
- onChange(syntheticEvent);
6612
- };
6613
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6614
- "div",
6615
- {
6616
- className: cn(className, "au-flex au-flex-row au-items-center au-gap-4"),
6617
- ...props,
6618
- children: [
6619
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "au-flex au-items-center au-gap-1", children: [
6620
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6621
- Button,
6622
- {
6623
- variant: "outline",
6624
- size: "icon",
6625
- onClick: () => currentValue > 0 && handleValueChange(currentValue - 1),
6626
- disabled: currentValue <= 0,
6627
- className: "au-h-6 au-w-6 au-pb-0.5",
6628
- children: "-"
6629
- }
6630
- ),
6631
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "au-w-8 au-text-center au-text-foreground", children: currentValue }),
6632
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6633
- Button,
6634
- {
6635
- variant: "outline",
6636
- size: "icon",
6637
- onClick: () => handleValueChange(currentValue + 1),
6638
- className: "au-h-6 au-w-6 au-pb-0.5",
6639
- children: "+"
6640
- }
6641
- )
6642
- ] }),
6643
- children
6644
- ]
6645
- }
6853
+ const { quantity = 0, billing_units: billingUnits = 1 } = item;
6854
+ const [quantityInput, setQuantityInput] = (0, import_react8.useState)(
6855
+ (quantity / billingUnits).toString()
6646
6856
  );
6647
- };
6648
- var TotalPrice = ({ children }) => {
6649
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "au-w-full au-font-semibold au-flex au-justify-between au-items-center", children });
6857
+ const { checkout } = useCustomer();
6858
+ const [loading, setLoading] = (0, import_react8.useState)(false);
6859
+ const [open, setOpen] = (0, import_react8.useState)(false);
6860
+ const scenario = checkoutResult.product.scenario;
6861
+ const handleSave = async () => {
6862
+ setLoading(true);
6863
+ try {
6864
+ const newOptions = checkoutResult.options.filter((option) => option.feature_id !== item.feature_id).map((option) => {
6865
+ return {
6866
+ featureId: option.feature_id,
6867
+ quantity: option.quantity
6868
+ };
6869
+ });
6870
+ newOptions.push({
6871
+ featureId: item.feature_id,
6872
+ quantity: Number(quantityInput) * billingUnits
6873
+ });
6874
+ const { data, error } = await checkout({
6875
+ productId: checkoutResult.product.id,
6876
+ options: newOptions
6877
+ });
6878
+ if (error) {
6879
+ console.error(error);
6880
+ return;
6881
+ }
6882
+ setCheckoutResult(data);
6883
+ } catch (error) {
6884
+ console.error(error);
6885
+ } finally {
6886
+ setLoading(false);
6887
+ setOpen(false);
6888
+ }
6889
+ };
6890
+ const disableSelection = scenario === "renew";
6891
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-justify-between", children: [
6892
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-gap-2", children: [
6893
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-text-muted-foreground", children: item.feature?.name }),
6894
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
6895
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6896
+ PopoverTrigger,
6897
+ {
6898
+ className: cn(
6899
+ "au-text-muted-foreground au-text-xs au-px-1 au-py-0.5 au-rounded-md au-flex au-items-center au-gap-1 au-bg-accent/80 hover:au-bg-accent hover:au-text-foreground"
6900
+ ),
6901
+ disabled: disableSelection,
6902
+ children: [
6903
+ "Qty: ",
6904
+ quantity,
6905
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronDown, { size: 12 })
6906
+ ]
6907
+ }
6908
+ ),
6909
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6910
+ PopoverContent,
6911
+ {
6912
+ align: "start",
6913
+ className: "au-w-80 au-text-sm au-p-4 au-pt-3 au-flex au-flex-col au-gap-4",
6914
+ children: [
6915
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-flex-col au-gap-1", children: [
6916
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "au-text-sm au-font-medium", children: item.feature?.name }),
6917
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "au-text-muted-foreground", children: [
6918
+ item.display?.primary_text,
6919
+ " ",
6920
+ item.display?.secondary_text
6921
+ ] })
6922
+ ] }),
6923
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-justify-between au-items-end", children: [
6924
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "au-flex au-gap-2 au-items-center", children: [
6925
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6926
+ Input,
6927
+ {
6928
+ className: "au-h-7 au-w-16 focus:!au-ring-2",
6929
+ value: quantityInput,
6930
+ onChange: (e) => setQuantityInput(e.target.value)
6931
+ }
6932
+ ),
6933
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "au-text-muted-foreground", children: [
6934
+ billingUnits > 1 && `x ${billingUnits} `,
6935
+ item.feature?.name
6936
+ ] })
6937
+ ] }),
6938
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { onClick: handleSave, className: "au-w-14", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoaderCircle, { className: "au-text-muted-foreground au-animate-spin !au-w-4 !au-h-4" }) : "Save" })
6939
+ ] })
6940
+ ]
6941
+ }
6942
+ )
6943
+ ] })
6944
+ ] }),
6945
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
6946
+ item.display?.primary_text,
6947
+ " ",
6948
+ item.display?.secondary_text
6949
+ ] })
6950
+ ] });
6650
6951
  };
6651
6952
 
6652
6953
  // src/libraries/react/components/check-dialog/check-dialog-synced.tsx
6653
- var import_react7 = require("react");
6654
- var import_jsx_runtime14 = require("react/jsx-runtime");
6954
+ var import_react9 = require("react");
6955
+ var import_jsx_runtime17 = require("react/jsx-runtime");
6655
6956
 
6656
6957
  // src/libraries/react/components/pricing-table/pricing-table-synced.tsx
6657
- var import_react9 = require("react");
6958
+ var import_react11 = require("react");
6658
6959
 
6659
6960
  // src/libraries/react/components/ui/switch.tsx
6660
- var React31 = __toESM(require("react"));
6961
+ var React34 = __toESM(require("react"));
6661
6962
 
6662
- // ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18.3._6zzey5cj563f4jvdnd6324q4ry/node_modules/@radix-ui/react-switch/dist/index.mjs
6663
- var React30 = __toESM(require("react"), 1);
6963
+ // ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1.8_uhx276sbw7dr3tfricp4xfbxsq/node_modules/@radix-ui/react-switch/dist/index.mjs
6964
+ var React33 = __toESM(require("react"), 1);
6664
6965
 
6665
- // ../node_modules/.pnpm/@radix-ui+react-use-previous@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs
6666
- var React28 = __toESM(require("react"), 1);
6966
+ // ../node_modules/.pnpm/@radix-ui+react-use-previous@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs
6967
+ var React31 = __toESM(require("react"), 1);
6667
6968
  function usePrevious(value) {
6668
- const ref = React28.useRef({ value, previous: value });
6669
- return React28.useMemo(() => {
6969
+ const ref = React31.useRef({ value, previous: value });
6970
+ return React31.useMemo(() => {
6670
6971
  if (ref.current.value !== value) {
6671
6972
  ref.current.previous = ref.current.value;
6672
6973
  ref.current.value = value;
@@ -6675,10 +6976,10 @@ function usePrevious(value) {
6675
6976
  }, [value]);
6676
6977
  }
6677
6978
 
6678
- // ../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@18.3.23_react@19.1.0/node_modules/@radix-ui/react-use-size/dist/index.mjs
6679
- var React29 = __toESM(require("react"), 1);
6979
+ // ../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-size/dist/index.mjs
6980
+ var React32 = __toESM(require("react"), 1);
6680
6981
  function useSize(element) {
6681
- const [size, setSize] = React29.useState(void 0);
6982
+ const [size, setSize] = React32.useState(void 0);
6682
6983
  useLayoutEffect2(() => {
6683
6984
  if (element) {
6684
6985
  setSize({ width: element.offsetWidth, height: element.offsetHeight });
@@ -6712,12 +7013,12 @@ function useSize(element) {
6712
7013
  return size;
6713
7014
  }
6714
7015
 
6715
- // ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.6_@types+react@18.3.23__@types+react@18.3._6zzey5cj563f4jvdnd6324q4ry/node_modules/@radix-ui/react-switch/dist/index.mjs
6716
- var import_jsx_runtime15 = require("react/jsx-runtime");
7016
+ // ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.6_@types+react@19.1.8__@types+react@19.1.8_uhx276sbw7dr3tfricp4xfbxsq/node_modules/@radix-ui/react-switch/dist/index.mjs
7017
+ var import_jsx_runtime18 = require("react/jsx-runtime");
6717
7018
  var SWITCH_NAME = "Switch";
6718
7019
  var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
6719
7020
  var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
6720
- var Switch = React30.forwardRef(
7021
+ var Switch = React33.forwardRef(
6721
7022
  (props, forwardedRef) => {
6722
7023
  const {
6723
7024
  __scopeSwitch,
@@ -6731,9 +7032,9 @@ var Switch = React30.forwardRef(
6731
7032
  form,
6732
7033
  ...switchProps
6733
7034
  } = props;
6734
- const [button, setButton] = React30.useState(null);
7035
+ const [button, setButton] = React33.useState(null);
6735
7036
  const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
6736
- const hasConsumerStoppedPropagationRef = React30.useRef(false);
7037
+ const hasConsumerStoppedPropagationRef = React33.useRef(false);
6737
7038
  const isFormControl = button ? form || !!button.closest("form") : true;
6738
7039
  const [checked, setChecked] = useControllableState({
6739
7040
  prop: checkedProp,
@@ -6741,8 +7042,8 @@ var Switch = React30.forwardRef(
6741
7042
  onChange: onCheckedChange,
6742
7043
  caller: SWITCH_NAME
6743
7044
  });
6744
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
6745
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7045
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
7046
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6746
7047
  Primitive.button,
6747
7048
  {
6748
7049
  type: "button",
@@ -6764,7 +7065,7 @@ var Switch = React30.forwardRef(
6764
7065
  })
6765
7066
  }
6766
7067
  ),
6767
- isFormControl && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7068
+ isFormControl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6768
7069
  SwitchBubbleInput,
6769
7070
  {
6770
7071
  control: button,
@@ -6783,11 +7084,11 @@ var Switch = React30.forwardRef(
6783
7084
  );
6784
7085
  Switch.displayName = SWITCH_NAME;
6785
7086
  var THUMB_NAME = "SwitchThumb";
6786
- var SwitchThumb = React30.forwardRef(
7087
+ var SwitchThumb = React33.forwardRef(
6787
7088
  (props, forwardedRef) => {
6788
7089
  const { __scopeSwitch, ...thumbProps } = props;
6789
7090
  const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
6790
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7091
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6791
7092
  Primitive.span,
6792
7093
  {
6793
7094
  "data-state": getState2(context.checked),
@@ -6800,7 +7101,7 @@ var SwitchThumb = React30.forwardRef(
6800
7101
  );
6801
7102
  SwitchThumb.displayName = THUMB_NAME;
6802
7103
  var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
6803
- var SwitchBubbleInput = React30.forwardRef(
7104
+ var SwitchBubbleInput = React33.forwardRef(
6804
7105
  ({
6805
7106
  __scopeSwitch,
6806
7107
  control,
@@ -6808,11 +7109,11 @@ var SwitchBubbleInput = React30.forwardRef(
6808
7109
  bubbles = true,
6809
7110
  ...props
6810
7111
  }, forwardedRef) => {
6811
- const ref = React30.useRef(null);
7112
+ const ref = React33.useRef(null);
6812
7113
  const composedRefs = useComposedRefs(ref, forwardedRef);
6813
7114
  const prevChecked = usePrevious(checked);
6814
7115
  const controlSize = useSize(control);
6815
- React30.useEffect(() => {
7116
+ React33.useEffect(() => {
6816
7117
  const input = ref.current;
6817
7118
  if (!input) return;
6818
7119
  const inputProto = window.HTMLInputElement.prototype;
@@ -6827,7 +7128,7 @@ var SwitchBubbleInput = React30.forwardRef(
6827
7128
  input.dispatchEvent(event);
6828
7129
  }
6829
7130
  }, [prevChecked, checked, bubbles]);
6830
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7131
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6831
7132
  "input",
6832
7133
  {
6833
7134
  type: "checkbox",
@@ -6852,13 +7153,13 @@ SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
6852
7153
  function getState2(checked) {
6853
7154
  return checked ? "checked" : "unchecked";
6854
7155
  }
6855
- var Root2 = Switch;
7156
+ var Root4 = Switch;
6856
7157
  var Thumb = SwitchThumb;
6857
7158
 
6858
7159
  // src/libraries/react/components/ui/switch.tsx
6859
- var import_jsx_runtime16 = require("react/jsx-runtime");
6860
- var Switch2 = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6861
- Root2,
7160
+ var import_jsx_runtime19 = require("react/jsx-runtime");
7161
+ var Switch2 = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7162
+ Root4,
6862
7163
  {
6863
7164
  className: cn(
6864
7165
  "au-peer au-inline-flex au-h-5 au-w-9 au-shrink-0 au-cursor-pointer au-items-center au-rounded-full au-border-2 au-border-transparent au-shadow-sm au-transition-colors focus-visible:au-outline-none focus-visible:au-ring-2 focus-visible:au-ring-ring focus-visible:au-ring-offset-2 focus-visible:au-ring-offset-background au-disabled:cursor-not-allowed au-disabled:opacity-50 data-[state=checked]:au-bg-primary data-[state=unchecked]:au-bg-input",
@@ -6866,7 +7167,7 @@ var Switch2 = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__
6866
7167
  ),
6867
7168
  ...props,
6868
7169
  ref,
6869
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7170
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6870
7171
  Thumb,
6871
7172
  {
6872
7173
  className: cn(
@@ -6876,55 +7177,60 @@ var Switch2 = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__
6876
7177
  )
6877
7178
  }
6878
7179
  ));
6879
- Switch2.displayName = Root2.displayName;
7180
+ Switch2.displayName = Root4.displayName;
6880
7181
 
6881
7182
  // src/libraries/react/components/pricing-table/lib/pricing-table-content.tsx
6882
- var import_jsx_runtime17 = require("react/jsx-runtime");
7183
+ var import_jsx_runtime20 = require("react/jsx-runtime");
6883
7184
  var getPricingTableContent = (product) => {
6884
- const { scenario, free_trial } = product;
6885
- if (free_trial && free_trial.trial_available) {
7185
+ const { scenario, free_trial, properties } = product;
7186
+ const { is_one_off, has_prepaid, has_trial } = properties;
7187
+ if (has_trial) {
6886
7188
  return {
6887
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Start Free Trial" })
7189
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Start Free Trial" })
6888
7190
  };
6889
7191
  }
6890
7192
  switch (scenario) {
6891
7193
  case "scheduled":
6892
7194
  return {
6893
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Plan Scheduled" })
7195
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Plan Scheduled" })
6894
7196
  };
6895
7197
  case "active":
7198
+ if (has_prepaid) {
7199
+ return {
7200
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Update Plan" })
7201
+ };
7202
+ }
6896
7203
  return {
6897
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Current Plan" })
7204
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Current Plan" })
6898
7205
  };
6899
7206
  case "new":
6900
- if (product.properties?.is_one_off) {
6901
- return {
6902
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Purchase" })
6903
- };
6904
- } else {
7207
+ if (is_one_off) {
6905
7208
  return {
6906
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Get started" })
7209
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Purchase" })
6907
7210
  };
6908
7211
  }
7212
+ return {
7213
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Get started" })
7214
+ };
6909
7215
  case "renew":
6910
7216
  return {
6911
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Renew" })
7217
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Renew" })
6912
7218
  };
6913
7219
  case "upgrade":
6914
7220
  return {
6915
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Upgrade" })
7221
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Upgrade" })
6916
7222
  };
6917
7223
  case "downgrade":
6918
7224
  return {
6919
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Downgrade" })
7225
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Downgrade" })
6920
7226
  };
6921
7227
  case "cancel":
6922
7228
  return {
6923
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Cancel Plan" })
7229
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Cancel Plan" })
6924
7230
  };
6925
7231
  default:
6926
7232
  return {
6927
- buttonText: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "Get Started" })
7233
+ buttonText: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "Get Started" })
6928
7234
  };
6929
7235
  }
6930
7236
  };
@@ -6938,6 +7244,12 @@ var loadingStyles = {
6938
7244
  alignItems: "center",
6939
7245
  minHeight: "300px"
6940
7246
  };
7247
+ var spinnerStyles = {
7248
+ width: "1.5rem",
7249
+ height: "1.5rem",
7250
+ color: "rgb(161 161 170)",
7251
+ animation: "spin 1s linear infinite"
7252
+ };
6941
7253
  if (typeof document !== "undefined") {
6942
7254
  const styleId = "au-spinner-keyframes";
6943
7255
  if (!document.getElementById(styleId)) {
@@ -6954,18 +7266,18 @@ if (typeof document !== "undefined") {
6954
7266
  }
6955
7267
 
6956
7268
  // src/libraries/react/components/pricing-table/pricing-table-synced.tsx
6957
- var import_jsx_runtime18 = require("react/jsx-runtime");
7269
+ var import_jsx_runtime21 = require("react/jsx-runtime");
6958
7270
  function PricingTable({
6959
7271
  productDetails
6960
7272
  }) {
6961
- const { attach } = useCustomer();
6962
- const [isAnnual, setIsAnnual] = (0, import_react9.useState)(false);
7273
+ const { checkout } = useCustomer();
7274
+ const [isAnnual, setIsAnnual] = (0, import_react11.useState)(false);
6963
7275
  const { products, isLoading, error } = usePricingTable({ productDetails });
6964
7276
  if (isLoading) {
6965
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: loadingStyles });
7277
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: loadingStyles, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LoaderCircle, { style: spinnerStyles }) });
6966
7278
  }
6967
7279
  if (error) {
6968
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: " Something went wrong..." });
7280
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: " Something went wrong..." });
6969
7281
  }
6970
7282
  const intervals = Array.from(
6971
7283
  new Set(
@@ -6986,14 +7298,14 @@ function PricingTable({
6986
7298
  }
6987
7299
  return true;
6988
7300
  };
6989
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("au-root"), children: products && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7301
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("au-root"), children: products && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6990
7302
  PricingTableContainer,
6991
7303
  {
6992
7304
  products,
6993
7305
  isAnnualToggle: isAnnual,
6994
7306
  setIsAnnualToggle: setIsAnnual,
6995
7307
  multiInterval,
6996
- children: products.filter(intervalFilter).map((product, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7308
+ children: products.filter(intervalFilter).map((product, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6997
7309
  PricingCard,
6998
7310
  {
6999
7311
  productId: product.id,
@@ -7001,7 +7313,7 @@ function PricingTable({
7001
7313
  disabled: product.scenario === "active" || product.scenario === "scheduled",
7002
7314
  onClick: async () => {
7003
7315
  if (product.id) {
7004
- await attach({
7316
+ await checkout({
7005
7317
  productId: product.id,
7006
7318
  dialog: AttachDialog
7007
7319
  });
@@ -7016,7 +7328,7 @@ function PricingTable({
7016
7328
  }
7017
7329
  ) });
7018
7330
  }
7019
- var PricingTableContext = (0, import_react9.createContext)({
7331
+ var PricingTableContext = (0, import_react11.createContext)({
7020
7332
  isAnnualToggle: false,
7021
7333
  setIsAnnualToggle: () => {
7022
7334
  },
@@ -7024,7 +7336,7 @@ var PricingTableContext = (0, import_react9.createContext)({
7024
7336
  showFeatures: true
7025
7337
  });
7026
7338
  var usePricingTableContext = (componentName) => {
7027
- const context = (0, import_react9.useContext)(PricingTableContext);
7339
+ const context = (0, import_react11.useContext)(PricingTableContext);
7028
7340
  if (context === void 0) {
7029
7341
  throw new Error(`${componentName} must be used within <PricingTable />`);
7030
7342
  }
@@ -7043,14 +7355,14 @@ var PricingTableContainer = ({
7043
7355
  throw new Error("products is required in <PricingTable />");
7044
7356
  }
7045
7357
  if (products.length === 0) {
7046
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, {});
7358
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {});
7047
7359
  }
7048
7360
  const hasRecommended = products?.some((p) => p.display?.recommend_text);
7049
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7361
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7050
7362
  PricingTableContext.Provider,
7051
7363
  {
7052
7364
  value: { isAnnualToggle, setIsAnnualToggle, products, showFeatures },
7053
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7365
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7054
7366
  "div",
7055
7367
  {
7056
7368
  className: cn(
@@ -7058,13 +7370,13 @@ var PricingTableContainer = ({
7058
7370
  hasRecommended && "!au-py-10"
7059
7371
  ),
7060
7372
  children: [
7061
- multiInterval && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7373
+ multiInterval && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7062
7374
  "div",
7063
7375
  {
7064
7376
  className: cn(
7065
7377
  products.some((p) => p.display?.recommend_text) && "au-mb-8"
7066
7378
  ),
7067
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7379
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7068
7380
  AnnualSwitch,
7069
7381
  {
7070
7382
  isAnnualToggle,
@@ -7073,7 +7385,7 @@ var PricingTableContainer = ({
7073
7385
  )
7074
7386
  }
7075
7387
  ),
7076
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7388
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7077
7389
  "div",
7078
7390
  {
7079
7391
  className: cn(
@@ -7106,7 +7418,7 @@ var PricingCard = ({
7106
7418
  primary_text: "Free"
7107
7419
  } : product.items[0].display;
7108
7420
  const featureItems = product.properties?.is_free ? product.items : product.items.slice(1);
7109
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7421
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7110
7422
  "div",
7111
7423
  {
7112
7424
  className: cn(
@@ -7115,8 +7427,8 @@ var PricingCard = ({
7115
7427
  className
7116
7428
  ),
7117
7429
  children: [
7118
- productDisplay?.recommend_text && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(RecommendedBadge, { recommended: productDisplay?.recommend_text }),
7119
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7430
+ productDisplay?.recommend_text && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RecommendedBadge, { recommended: productDisplay?.recommend_text }),
7431
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7120
7432
  "div",
7121
7433
  {
7122
7434
  className: cn(
@@ -7124,19 +7436,19 @@ var PricingCard = ({
7124
7436
  isRecommended && "lg:au-translate-y-6"
7125
7437
  ),
7126
7438
  children: [
7127
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "au-h-full", children: [
7128
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "au-flex au-flex-col", children: [
7129
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "au-pb-4", children: [
7130
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "au-text-2xl au-font-semibold au-px-6 au-truncate", children: productDisplay?.name || name }),
7131
- productDisplay?.description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "au-text-sm au-text-muted-foreground au-px-6 au-h-8", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "au-line-clamp-2", children: productDisplay?.description }) })
7439
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-h-full", children: [
7440
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-flex au-flex-col", children: [
7441
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-pb-4", children: [
7442
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "au-text-2xl au-font-semibold au-px-6 au-truncate", children: productDisplay?.name || name }),
7443
+ productDisplay?.description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "au-text-sm au-text-muted-foreground au-px-6 au-h-8", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "au-line-clamp-2", children: productDisplay?.description }) })
7132
7444
  ] }),
7133
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "au-mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "au-font-semibold au-h-16 au-flex au-px-6 au-items-center au-border-y au-mb-4 au-bg-secondary/40", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "au-line-clamp-2", children: [
7445
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "au-mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { className: "au-font-semibold au-h-16 au-flex au-px-6 au-items-center au-border-y au-mb-4 au-bg-secondary/40", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-line-clamp-2", children: [
7134
7446
  mainPriceDisplay?.primary_text,
7135
7447
  " ",
7136
- mainPriceDisplay?.secondary_text && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "au-font-normal au-text-muted-foreground au-mt-1", children: mainPriceDisplay?.secondary_text })
7448
+ mainPriceDisplay?.secondary_text && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "au-font-normal au-text-muted-foreground au-mt-1", children: mainPriceDisplay?.secondary_text })
7137
7449
  ] }) }) })
7138
7450
  ] }),
7139
- showFeatures && featureItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "au-flex-grow au-px-6 au-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7451
+ showFeatures && featureItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "au-flex-grow au-px-6 au-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7140
7452
  PricingFeatureList,
7141
7453
  {
7142
7454
  items: featureItems,
@@ -7145,11 +7457,11 @@ var PricingCard = ({
7145
7457
  }
7146
7458
  ) })
7147
7459
  ] }),
7148
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7460
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7149
7461
  "div",
7150
7462
  {
7151
7463
  className: cn(" au-px-6 ", isRecommended && "lg:au--translate-y-12"),
7152
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7464
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7153
7465
  PricingCardButton,
7154
7466
  {
7155
7467
  recommended: productDisplay?.recommend_text ? true : false,
@@ -7172,27 +7484,27 @@ var PricingFeatureList = ({
7172
7484
  everythingFrom,
7173
7485
  className
7174
7486
  }) => {
7175
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("au-flex-grow", className), children: [
7176
- everythingFrom && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "au-text-sm au-mb-4", children: [
7487
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("au-flex-grow", className), children: [
7488
+ everythingFrom && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { className: "au-text-sm au-mb-4", children: [
7177
7489
  "Everything from ",
7178
7490
  everythingFrom,
7179
7491
  ", plus:"
7180
7492
  ] }),
7181
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "au-space-y-3", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7493
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "au-space-y-3", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7182
7494
  "div",
7183
7495
  {
7184
7496
  className: "au-flex au-items-start au-gap-2 au-text-sm",
7185
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "au-flex au-flex-col", children: [
7186
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: item.display?.primary_text }),
7187
- item.display?.secondary_text && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "au-text-sm au-text-muted-foreground", children: item.display?.secondary_text })
7497
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-flex au-flex-col", children: [
7498
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: item.display?.primary_text }),
7499
+ item.display?.secondary_text && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "au-text-sm au-text-muted-foreground", children: item.display?.secondary_text })
7188
7500
  ] })
7189
7501
  },
7190
7502
  index
7191
7503
  )) })
7192
7504
  ] });
7193
7505
  };
7194
- var PricingCardButton = import_react8.default.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
7195
- const [loading, setLoading] = (0, import_react9.useState)(false);
7506
+ var PricingCardButton = import_react10.default.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
7507
+ const [loading, setLoading] = (0, import_react11.useState)(false);
7196
7508
  const handleClick = async (e) => {
7197
7509
  setLoading(true);
7198
7510
  try {
@@ -7203,7 +7515,7 @@ var PricingCardButton = import_react8.default.forwardRef(({ recommended, childre
7203
7515
  setLoading(false);
7204
7516
  }
7205
7517
  };
7206
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7518
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7207
7519
  Button,
7208
7520
  {
7209
7521
  className: cn(
@@ -7214,7 +7526,17 @@ var PricingCardButton = import_react8.default.forwardRef(({ recommended, childre
7214
7526
  variant: recommended ? "default" : "secondary",
7215
7527
  ref,
7216
7528
  disabled: loading || props.disabled,
7217
- onClick: handleClick
7529
+ onClick: handleClick,
7530
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LoaderCircle, { className: "au-h-4 au-w-4 au-animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
7531
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-flex au-items-center au-justify-between au-w-full au-transition-transform au-duration-300 group-hover:au-translate-y-[-130%]", children: [
7532
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children }),
7533
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "au-text-sm", children: "\u2192" })
7534
+ ] }),
7535
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-flex au-items-center au-justify-between au-w-full au-absolute au-px-4 au-translate-y-[130%] au-transition-transform au-duration-300 group-hover:au-translate-y-0 au-mt-2 group-hover:au-mt-0", children: [
7536
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children }),
7537
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "au-text-sm", children: "\u2192" })
7538
+ ] })
7539
+ ] })
7218
7540
  }
7219
7541
  );
7220
7542
  });
@@ -7223,9 +7545,9 @@ var AnnualSwitch = ({
7223
7545
  isAnnualToggle,
7224
7546
  setIsAnnualToggle
7225
7547
  }) => {
7226
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "au-flex au-items-center au-space-x-2 au-mb-4", children: [
7227
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "au-text-sm au-text-muted-foreground", children: "Monthly" }),
7228
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7548
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "au-flex au-items-center au-space-x-2 au-mb-4", children: [
7549
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "au-text-sm au-text-muted-foreground", children: "Monthly" }),
7550
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7229
7551
  Switch2,
7230
7552
  {
7231
7553
  id: "annual-billing",
@@ -7233,11 +7555,11 @@ var AnnualSwitch = ({
7233
7555
  onCheckedChange: setIsAnnualToggle
7234
7556
  }
7235
7557
  ),
7236
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "au-text-sm au-text-muted-foreground", children: "Annual" })
7558
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "au-text-sm au-text-muted-foreground", children: "Annual" })
7237
7559
  ] });
7238
7560
  };
7239
7561
  var RecommendedBadge = ({ recommended }) => {
7240
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "au-bg-secondary au-absolute au-border au-text-muted-foreground au-text-sm au-font-medium lg:au-rounded-full au-px-3 lg:au-py-0.5 lg:au-top-4 lg:au-right-4 au-top-[-1px] au-right-[-1px] au-rounded-bl-lg", children: recommended });
7562
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "au-bg-secondary au-absolute au-border au-text-muted-foreground au-text-sm au-font-medium lg:au-rounded-full au-px-3 lg:au-py-0.5 lg:au-top-4 lg:au-right-4 au-top-[-1px] au-right-[-1px] au-rounded-bl-lg", children: recommended });
7241
7563
  };
7242
7564
  // Annotate the CommonJS export names for ESM import in node:
7243
7565
  0 && (module.exports = {
@@ -7249,3 +7571,19 @@ var RecommendedBadge = ({ recommended }) => {
7249
7571
  RecommendedBadge,
7250
7572
  usePricingTableContext
7251
7573
  });
7574
+ /*! Bundled license information:
7575
+
7576
+ lucide-react/dist/esm/shared/src/utils.js:
7577
+ lucide-react/dist/esm/defaultAttributes.js:
7578
+ lucide-react/dist/esm/Icon.js:
7579
+ lucide-react/dist/esm/createLucideIcon.js:
7580
+ lucide-react/dist/esm/icons/chevron-down.js:
7581
+ lucide-react/dist/esm/icons/loader-circle.js:
7582
+ lucide-react/dist/esm/lucide-react.js:
7583
+ (**
7584
+ * @license lucide-react v0.523.0 - ISC
7585
+ *
7586
+ * This source code is licensed under the ISC license.
7587
+ * See the LICENSE file in the root directory of this source tree.
7588
+ *)
7589
+ */