@delopay/sdk 0.448.0 → 0.450.0

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 (315) hide show
  1. package/dist/airwallexCard.cjs.map +1 -1
  2. package/dist/branding.cjs.map +1 -1
  3. package/dist/cardFormStyles.cjs.map +1 -1
  4. package/dist/checkoutSession.cjs +2 -2
  5. package/dist/checkoutSession.cjs.map +1 -1
  6. package/dist/checkoutSession.js +1 -1
  7. package/dist/chunk-244VZFFO.cjs.map +1 -1
  8. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  9. package/dist/chunk-34PC72O7.cjs.map +1 -1
  10. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  11. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  12. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  13. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  14. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  15. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  16. package/dist/chunk-5CITBN33.cjs.map +1 -1
  17. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  18. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  19. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  20. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  21. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  22. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  23. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  24. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  25. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  26. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  27. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  28. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  29. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  30. package/dist/chunk-AVR2GPXU.cjs.map +1 -1
  31. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  32. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  33. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  34. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  35. package/dist/{chunk-ZPFPDNBE.js → chunk-BY3BENXH.js} +87 -1
  36. package/dist/chunk-BY3BENXH.js.map +1 -0
  37. package/dist/chunk-CAMALM35.cjs.map +1 -1
  38. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  39. package/dist/chunk-CKKNFFKP.cjs.map +1 -1
  40. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  41. package/dist/{chunk-4CRVNVVO.cjs → chunk-CXJ7O4E7.cjs} +3 -3
  42. package/dist/chunk-CXJ7O4E7.cjs.map +1 -0
  43. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  44. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  45. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  46. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  47. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  48. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  49. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  50. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  51. package/dist/{chunk-ZFUGT6YL.cjs → chunk-FA2PM4VM.cjs} +3 -3
  52. package/dist/chunk-FA2PM4VM.cjs.map +1 -0
  53. package/dist/chunk-FG7YBXJQ.cjs.map +1 -1
  54. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  55. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  56. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  57. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  58. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  59. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  60. package/dist/chunk-GWJ33GOK.cjs.map +1 -1
  61. package/dist/chunk-HHUUSNIL.cjs.map +1 -1
  62. package/dist/chunk-HLHML5ES.cjs.map +1 -1
  63. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  64. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  65. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  66. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  67. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  68. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  69. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  70. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  71. package/dist/chunk-JJPKURUG.cjs.map +1 -1
  72. package/dist/chunk-JPRSNCYP.cjs.map +1 -1
  73. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  74. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  75. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  76. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  77. package/dist/chunk-KOB6MOAV.cjs.map +1 -1
  78. package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
  79. package/dist/{chunk-5QNQRLWX.cjs → chunk-KT2WXUWG.cjs} +87 -1
  80. package/dist/chunk-KT2WXUWG.cjs.map +1 -0
  81. package/dist/{chunk-I5XG56UR.cjs → chunk-KZHLKMVX.cjs} +17 -3
  82. package/dist/chunk-KZHLKMVX.cjs.map +1 -0
  83. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  84. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  85. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  86. package/dist/{chunk-MKMWXXMC.js → chunk-M327HN6D.js} +2 -2
  87. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  88. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  89. package/dist/chunk-MCNDMK7F.cjs.map +1 -1
  90. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  91. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  92. package/dist/chunk-NKDUQ2BI.cjs.map +1 -1
  93. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  94. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  95. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  96. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  97. package/dist/chunk-OWP7XBY2.cjs.map +1 -1
  98. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  99. package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
  100. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  101. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  102. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  103. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  104. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  105. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  106. package/dist/chunk-R4FE6K43.cjs.map +1 -1
  107. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  108. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  109. package/dist/{chunk-GY26OJZF.js → chunk-RDO66IQR.js} +2 -2
  110. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  111. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  112. package/dist/chunk-RSVLVW4L.cjs.map +1 -1
  113. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  114. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  115. package/dist/chunk-SQELICSX.cjs.map +1 -1
  116. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  117. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  118. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  119. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  120. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  121. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  122. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  123. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  124. package/dist/chunk-W457XUA6.cjs.map +1 -1
  125. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  126. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  127. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  128. package/dist/{chunk-XR4SKXMH.js → chunk-WYR27JGG.js} +16 -2
  129. package/dist/chunk-WYR27JGG.js.map +1 -0
  130. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  131. package/dist/chunk-YJQPKT6W.cjs.map +1 -1
  132. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  133. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  134. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  135. package/dist/client.cjs +2 -2
  136. package/dist/client.cjs.map +1 -1
  137. package/dist/client.js +1 -1
  138. package/dist/core.cjs.map +1 -1
  139. package/dist/currencies.cjs.map +1 -1
  140. package/dist/enigmaCardForm.cjs.map +1 -1
  141. package/dist/error.cjs.map +1 -1
  142. package/dist/eventStream.cjs.map +1 -1
  143. package/dist/exportDownload.cjs.map +1 -1
  144. package/dist/feeProgram.cjs.map +1 -1
  145. package/dist/index.cjs +4 -4
  146. package/dist/index.cjs.map +1 -1
  147. package/dist/index.d.cts +1 -1
  148. package/dist/index.d.ts +1 -1
  149. package/dist/index.js +3 -3
  150. package/dist/internal/resources/admin.cjs.map +1 -1
  151. package/dist/internal/resources/admin.d.cts +1 -1
  152. package/dist/internal/resources/admin.d.ts +1 -1
  153. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  154. package/dist/internal/resources/adminBranding.d.cts +1 -1
  155. package/dist/internal/resources/adminBranding.d.ts +1 -1
  156. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  157. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
  158. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
  159. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  160. package/dist/internal/resources/adminFeePlans.d.cts +1 -1
  161. package/dist/internal/resources/adminFeePlans.d.ts +1 -1
  162. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  163. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  164. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  165. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  166. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  167. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  168. package/dist/internal/resources/adminLive.cjs.map +1 -1
  169. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  170. package/dist/internal/resources/adminNotices.d.cts +1 -1
  171. package/dist/internal/resources/adminNotices.d.ts +1 -1
  172. package/dist/internal/resources/adminPortal.cjs +2 -2
  173. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  174. package/dist/internal/resources/adminPortal.d.cts +10 -2
  175. package/dist/internal/resources/adminPortal.d.ts +10 -2
  176. package/dist/internal/resources/adminPortal.js +1 -1
  177. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  178. package/dist/internal/resources/adminSupport.d.cts +1 -1
  179. package/dist/internal/resources/adminSupport.d.ts +1 -1
  180. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  181. package/dist/internal/resources/auditLogs.d.cts +1 -1
  182. package/dist/internal/resources/auditLogs.d.ts +1 -1
  183. package/dist/internal/resources/cache.cjs.map +1 -1
  184. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  185. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  186. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  187. package/dist/internal/resources/configs.cjs.map +1 -1
  188. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  189. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  190. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  191. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  192. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  193. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  194. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  195. package/dist/internal/resources/diagnostic.d.cts +1 -1
  196. package/dist/internal/resources/diagnostic.d.ts +1 -1
  197. package/dist/internal/resources/gsm.cjs.map +1 -1
  198. package/dist/internal/resources/gsm.d.cts +1 -1
  199. package/dist/internal/resources/gsm.d.ts +1 -1
  200. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  201. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  202. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  203. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  204. package/dist/internal/resources/platformBilling.d.cts +1 -1
  205. package/dist/internal/resources/platformBilling.d.ts +1 -1
  206. package/dist/internal/resources/platformFees.cjs.map +1 -1
  207. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  208. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  209. package/dist/internal/resources/platformSettings.d.cts +1 -1
  210. package/dist/internal/resources/platformSettings.d.ts +1 -1
  211. package/dist/internal.cjs +7 -7
  212. package/dist/internal.cjs.map +1 -1
  213. package/dist/internal.d.cts +2 -2
  214. package/dist/internal.d.ts +2 -2
  215. package/dist/internal.js +4 -4
  216. package/dist/listQuery.cjs.map +1 -1
  217. package/dist/panes.cjs.map +1 -1
  218. package/dist/paymentPresentation.cjs.map +1 -1
  219. package/dist/recordCounter.cjs.map +1 -1
  220. package/dist/resources/aiTools.cjs.map +1 -1
  221. package/dist/resources/analytics.cjs.map +1 -1
  222. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  223. package/dist/resources/apiKeys.cjs.map +1 -1
  224. package/dist/resources/audit.cjs.map +1 -1
  225. package/dist/resources/authentication.cjs.map +1 -1
  226. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  227. package/dist/resources/billing.cjs.map +1 -1
  228. package/dist/resources/buyerAccount.cjs.map +1 -1
  229. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  230. package/dist/resources/buyerConversations.cjs.map +1 -1
  231. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  232. package/dist/resources/buyerPortal.cjs.map +1 -1
  233. package/dist/resources/cards.cjs.map +1 -1
  234. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  235. package/dist/resources/checkoutDomains.cjs.map +1 -1
  236. package/dist/resources/checkoutMethods.cjs.map +1 -1
  237. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  238. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  239. package/dist/resources/connectors.cjs.map +1 -1
  240. package/dist/resources/contentEncryption.cjs.map +1 -1
  241. package/dist/resources/costRules.cjs.map +1 -1
  242. package/dist/resources/customers.cjs.map +1 -1
  243. package/dist/resources/deploymentBranding.cjs.map +1 -1
  244. package/dist/resources/disputes.cjs.map +1 -1
  245. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  246. package/dist/resources/events.cjs.map +1 -1
  247. package/dist/resources/export.cjs.map +1 -1
  248. package/dist/resources/externalRecords.cjs.map +1 -1
  249. package/dist/resources/featureMatrix.cjs.map +1 -1
  250. package/dist/resources/fees.cjs.map +1 -1
  251. package/dist/resources/files.cjs.map +1 -1
  252. package/dist/resources/forex.cjs.map +1 -1
  253. package/dist/resources/identityVerifications.cjs.map +1 -1
  254. package/dist/resources/industries.cjs.map +1 -1
  255. package/dist/resources/invoiceSettings.cjs.map +1 -1
  256. package/dist/resources/invoices.cjs.map +1 -1
  257. package/dist/resources/live.cjs.map +1 -1
  258. package/dist/resources/mandates.cjs.map +1 -1
  259. package/dist/resources/merchantAccounts.cjs.map +1 -1
  260. package/dist/resources/messageTemplates.cjs.map +1 -1
  261. package/dist/resources/notices.cjs.map +1 -1
  262. package/dist/resources/operationLimits.cjs.map +1 -1
  263. package/dist/resources/paymentLinks.cjs.map +1 -1
  264. package/dist/resources/paymentMethods.cjs.map +1 -1
  265. package/dist/resources/payments.cjs.map +1 -1
  266. package/dist/resources/payoutDestinations.cjs.map +1 -1
  267. package/dist/resources/payouts.cjs.map +1 -1
  268. package/dist/resources/paypalDisputes.cjs.map +1 -1
  269. package/dist/resources/persons.cjs.map +1 -1
  270. package/dist/resources/poll.cjs.map +1 -1
  271. package/dist/resources/processorCosts.cjs.map +1 -1
  272. package/dist/resources/processorImports.cjs.map +1 -1
  273. package/dist/resources/products.cjs.map +1 -1
  274. package/dist/resources/profileAcquirers.cjs.map +1 -1
  275. package/dist/resources/profiles.cjs.map +1 -1
  276. package/dist/resources/projects.cjs.map +1 -1
  277. package/dist/resources/refunds.cjs.map +1 -1
  278. package/dist/resources/regions.cjs.map +1 -1
  279. package/dist/resources/relay.cjs.map +1 -1
  280. package/dist/resources/risk.cjs.map +1 -1
  281. package/dist/resources/routing.cjs.map +1 -1
  282. package/dist/resources/search.cjs.map +1 -1
  283. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  284. package/dist/resources/settings.cjs.map +1 -1
  285. package/dist/resources/settlement.cjs +2 -2
  286. package/dist/resources/settlement.cjs.map +1 -1
  287. package/dist/resources/settlement.d.cts +53 -1
  288. package/dist/resources/settlement.d.ts +53 -1
  289. package/dist/resources/settlement.js +1 -1
  290. package/dist/resources/shopLabels.cjs.map +1 -1
  291. package/dist/resources/shops.cjs.map +1 -1
  292. package/dist/resources/stripeConnect.cjs.map +1 -1
  293. package/dist/resources/subscriptions.cjs.map +1 -1
  294. package/dist/resources/support.cjs.map +1 -1
  295. package/dist/resources/threeDsRules.cjs.map +1 -1
  296. package/dist/resources/users.cjs.map +1 -1
  297. package/dist/resources/vatRates.cjs.map +1 -1
  298. package/dist/resources/verification.cjs.map +1 -1
  299. package/dist/resources/webhooks.cjs.map +1 -1
  300. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  301. package/dist/trustedOrigins.cjs.map +1 -1
  302. package/dist/{types-CRqkiXMY.d.ts → types-5LpAi5X9.d.ts} +12 -1
  303. package/dist/{types-9JmhQ4Gf.d.cts → types-BHQB_jPU.d.cts} +12 -1
  304. package/dist/types.cjs.map +1 -1
  305. package/dist/types.d.cts +181 -5
  306. package/dist/types.d.ts +181 -5
  307. package/package.json +19 -17
  308. package/dist/chunk-4CRVNVVO.cjs.map +0 -1
  309. package/dist/chunk-5QNQRLWX.cjs.map +0 -1
  310. package/dist/chunk-I5XG56UR.cjs.map +0 -1
  311. package/dist/chunk-XR4SKXMH.js.map +0 -1
  312. package/dist/chunk-ZFUGT6YL.cjs.map +0 -1
  313. package/dist/chunk-ZPFPDNBE.js.map +0 -1
  314. /package/dist/{chunk-MKMWXXMC.js.map → chunk-M327HN6D.js.map} +0 -0
  315. /package/dist/{chunk-GY26OJZF.js.map → chunk-RDO66IQR.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w6pub/delopay-typescript-sdk/dist/chunk-YJQPKT6W.cjs","../src/panes.ts"],"names":[],"mappings":"AAAA;ACqEA,IAAM,kBAAA,EAA+C,CAAC,QAAA,EAAU,eAAA,EAAiB,eAAe,CAAA;AAMhG,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,OAAO,IAAA,IAAQ,QAAA,GAAW,IAAA,IAAQ,YAAA,EAAc,IAAA,EAAM,KAAA;AACxD;AAEA,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,wBAAO,iBAAA,CAAkB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,GAAG,CAAA,UAAK,UAAA;AAC7D;AAEA,IAAM,qBAAA,EAAqD;AAAA,EACzD,YAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA;AAYA,SAAS,kBAAA,CAAmB,GAAA,EAAiC;AAC3D,EAAA,wBAAO,oBAAA,CAAqB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,GAAG,CAAA,UAAK,cAAA;AAChE;AA4EO,SAAS,kBAAA,CACd,IAAA,EACgB;AAChB,EAAA,MAAM,SAAA,EAAW,iBAAA,CAAkB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,IAAA,C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ACpC,EAAA;AACtC,EAAA;AAIP,EAAA;AAIX;AAaoC;AAClC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACF;AAiD0C;AAEL;AAEI;AAET;AAWiD;AACT,EAAA;AACxE;AAYwD;AACd,EAAA;AACjC,EAAA;AACgB,IAAA;AACX,IAAA;AACiB,IAAA;AAC7B,EAAA;AACF;AAG+B;AAEE;AAEA;AD7sB2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/w6pub/delopay-typescript-sdk/dist/chunk-YJQPKT6W.cjs","sourcesContent":[null,"// **Payment panes** — merchant-configured payment methods that render as\n// DeloPay-drawn tiles in the embedded checkout instead of inside a connector's\n// own embedded form.\n//\n// Why they exist: Stripe only offers Apple Pay / Google Pay / Link when the\n// *top-level* document's domain is registered as a payment method domain on the\n// merchant's Stripe account. In an embedded iframe that domain is the\n// merchant's shop, not the DeloPay checkout — so the wallet silently\n// disappears. A pane replaces it with our own tile that opens the DeloPay\n// hosted checkout at the top level, in a focused single-method view.\n//\n// Nothing here is Apple-Pay-specific, and since the router published a\n// per-connector capability catalogue nothing here is Stripe-specific either:\n// the feature is \"which of a connector's payment methods render as a pane, and\n// how they look\".\n//\n// This module serves SDK consumers: merchants configuring\n// `metadata.native_panes` on a merchant connector account programmatically\n// (codec), reading the resolved `native_panes` off a checkout payload\n// ({@link PaneView}), or building the focused single-method link that goes\n// behind their own button ({@link focusedCheckoutUrl}).\n//\n// The wire shapes are owned by the API — `native_panes` in\n// the metadata key, the field names and the enum values are contracts with it\n// and with links already in buyers' hands, so the identifiers here were renamed\n// off \"native pane\" and the wire was not.\n//\n// Capability (which connector may publish which method, on which rail) comes\n// from the router at runtime through `connectors.getPanesCatalog()`, not from a\n// table here.\n\n// Type-only, so this module still emits no imports and can be executed\n// standalone. `types.ts` owns the catalogue's wire shapes because they are\n// generated-spec-paired (`scripts/validate-types.ts`); it imports nothing from\n// here, so the dependency runs one way.\nimport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n PaneNativeElement,\n} from './types';\n\nexport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n};\n\n// --- Wire types ---------------------------------------------------------\n\n/**\n * The values {@link decodePanes} recognises. Anything else — a value written by\n * a dashboard newer than this SDK — degrades to `always` rather than throwing\n * or dropping the row: an older SDK reading a newer blob is a normal state\n * during a rollout, and a hard failure there takes out a merchant's whole\n * connector config rather than one tile.\n */\nconst PANE_VISIBILITIES: readonly PaneVisibility[] = ['always', 'embedded_only', 'external_only'];\n\n/**\n * `same_page` and `popup` are kept as written; anything else — including the\n * absent key — is the default `tab`, as it always was.\n */\nfunction parseOpenTarget(raw: unknown): PaneOpenTarget {\n return raw === 'popup' || raw === 'same_page' ? raw : 'tab';\n}\n\nfunction parseVisibility(raw: unknown): PaneVisibility {\n return PANE_VISIBILITIES.find((value) => value === raw) ?? 'always';\n}\n\nconst PANE_NATIVE_ELEMENTS: readonly PaneNativeElement[] = [\n 'everywhere',\n 'embedded_only',\n 'external_only',\n];\n\n/**\n * Read a stored row's native-element choice, tolerantly.\n *\n * Absent decodes to `everywhere`, because that is what the router decodes a\n * missing key to (`admin::NativePaneNativeElement` defaults to it): a row\n * written before the field existed means \"the wallet's own button wherever\n * this pane is offered\", which is what the tile was always a stand-in for. An\n * unknown word degrades the same way rather than dropping the row — the\n * router's own decode is lenient for the same rolling-deploy reason.\n */\nfunction parseNativeElement(raw: unknown): PaneNativeElement {\n return PANE_NATIVE_ELEMENTS.find((value) => value === raw) ?? 'everywhere';\n}\n\n/**\n * One pane exactly as the merchant configures it. Persisted (JSON) under\n * `metadata.native_panes` on the merchant connector account.\n *\n * Field names are the wire contract — renaming one is a migration. The router\n * decodes strictly row by row: a row that fails strict decoding (e.g. a\n * wrong-typed field like `display_order: \"3\"`) is dropped whole with a server\n * log, and the remaining rows still render. This SDK's {@link decodePanes} is\n * additionally per-property tolerant — including clamping `display_order` into\n * the router's `i32` range — so a decode→encode round-trip through the SDK\n * repairs a blob the router would partially drop.\n */\nexport interface Pane {\n /** Catalogue key of the promoted method — see {@link paneMethodInfo}. */\n method: string;\n /** Disabled rows keep their tuning but never reach a buyer. */\n enabled: boolean;\n /** Default-language tile label. Empty falls back to the catalogue name. */\n label: string;\n /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */\n labelTranslations: Record<string, string>;\n /**\n * Secondary line under the label. `null` means \"use the catalogue default\";\n * an empty string means the merchant deliberately hid the line. That\n * distinction is the whole reason this is nullable and `label` is not.\n */\n sublabel: string | null;\n /** Per-locale overrides of `sublabel`. */\n sublabelTranslations: Record<string, string>;\n /** Section the tile groups under. Empty falls back to the catalogue category. */\n category: string;\n /** Built-in icon key — see {@link PANE_ICON_KEYS}. */\n icon: string;\n /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a\n * rejected payload falls back to the built-in `icon`. */\n iconSvg: string;\n /** Lower renders first; ties break on catalogue order. */\n displayOrder: number;\n /** Where the tile is offered — see {@link PaneVisibility}. */\n visibility: PaneVisibility;\n /** How the embedded checkout opens the focused view — see {@link PaneOpenTarget}. */\n openIn: PaneOpenTarget;\n /**\n * Where the wallet's own button replaces this tile — see\n * {@link PaneNativeElement}. Only meaningful on a method whose catalogue\n * entry says {@link PaneCapability.supports_native_element}; the router\n * ignores it elsewhere. `everywhere` is the default and what a row stored\n * before the field existed decodes to.\n */\n nativeElement: PaneNativeElement;\n /** A shipped look instead of the icon (`paypal`, `card`); `''` or absent = none.\n * Optional because a `Pane` built before the field existed must still encode. */\n preset?: string;\n /** The preset's style; `''` or absent = the preset's default. */\n style?: string;\n}\n\n/**\n * Read a resolved tile's placement rule, across every payload version.\n *\n * Prefer this to touching either field. They are independent on the wire — a\n * payload may carry either, both or neither — and each alone loses a placement\n * rule: `embedded_only` cannot express `external_only`, so an `external_only`\n * tile read through it renders inside the merchant iframe the merchant asked\n * to keep it out of; `visibility` is absent on a router that predates it, so\n * an `embedded_only` tile read through it alone renders at top level too,\n * duplicating a method Stripe's own form already offers there.\n *\n * A recognised `visibility` wins. Otherwise the legacy boolean answers: absent\n * (old router) it carries the only placement that router could express, and\n * unrecognised (newer router) the router still sets it under its own fixed\n * rule. Neither path throws, and both degrade toward showing a tile — losing a\n * placement rule, never stranding a method.\n */\nexport function paneViewVisibility(\n view: Pick<PaneView, 'visibility' | 'embedded_only'>,\n): PaneVisibility {\n const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);\n if (declared) return declared;\n return view.embedded_only === true ? 'embedded_only' : 'always';\n}\n\n// --- Catalogue ----------------------------------------------------------\n\n/**\n * A method the frozen Stripe fallback table knows, with the compiled copy the\n * router shipped for it at the time.\n *\n * Only {@link STRIPE_FALLBACK_PANE_METHODS} is typed with this. The live\n * catalogue (`connectors.getPanesCatalog()`) carries capability facts and no\n * copy at all, by design — see {@link PaneCapability}.\n */\nexport interface PaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethod: string;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethodType: string;\n /** The focused checkout has to collect a billing country to confirm this. */\n requiresBillingCountry: boolean;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * What this SDK assumes when the router cannot answer.\n *\n * The capability endpoint does not exist on an older router, which answers\n * `connectors.getPanesCatalog()` with a 404.\n * Rather than leaving a caller with nothing, the pane helpers default to\n * exactly the behaviour they had before that endpoint existed: panes on the\n * Stripe connector only, with the method set the router's Stripe catalogue had\n * at the time.\n *\n * **This is a degradation path, not a mirror. Do not keep it in sync by hand,\n * and do not add a connector or a method to it** — that is what this table was\n * before the capability endpoint, and adding to it would quietly rebuild the mirror. A\n * connector the router serves panes for arrives through the endpoint and needs\n * no entry here; a connector that needs an entry here to appear is a connector\n * the router will not deliver panes for anyway.\n *\n * The only reason to touch this list is to correct what Stripe's catalogue\n * looked like *before* the endpoint existed, and that is history, so there is\n * no such reason. Once the endpoint is reachable it is never consulted for a\n * connector the router answered for.\n *\n * The redirect-rail set is deliberately narrow — every entry is a variant the\n * Stripe connector accepts and that needs no extra buyer input beyond a\n * billing country. `eps` / `p24` / `bancontact` are absent because Stripe\n * hard-requires billing fields the focused checkout never collects (a full\n * name for EPS and Bancontact, an email for Przelewy24), so their tiles could\n * never succeed.\n *\n * `defaultLabel` / `defaultSublabel` are the copy the router compiled at that\n * time and are frozen with the rest of the table. Copy for a method the live\n * catalogue reports belongs to the consumer's own locale files, keyed by\n * `key` — the router ships none.\n */\nexport const STRIPE_FALLBACK_PANE_METHODS: readonly PaneMethodInfo[] = [\n {\n key: 'apple_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'apple_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Apple Pay',\n defaultSublabel: 'Pay with Apple Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'apple',\n },\n {\n key: 'google_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'google_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Google Pay',\n defaultSublabel: 'Pay with Google Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'google',\n },\n {\n key: 'link',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'link',\n requiresBillingCountry: false,\n defaultLabel: 'Link',\n defaultSublabel: 'Pay with saved details',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'klarna',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'klarna',\n // Stripe's Klarna needs the buyer's country echoed into the confirm body.\n requiresBillingCountry: true,\n defaultLabel: 'Klarna',\n // NOT the router's current \"Pay later or in 3 instalments\". This table is\n // what a router predating the capability endpoint renders, and that copy\n // only gained the \"3\" in the same release that added the endpoint.\n // Restating the new string here\n // would put copy no reachable router emits in front of a merchant, and\n // would change what the deprecated `nativePaneMethodInfo` has returned\n // since 0.106.0.\n defaultSublabel: 'Pay later or in instalments',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'affirm',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'affirm',\n requiresBillingCountry: false,\n defaultLabel: 'Affirm',\n defaultSublabel: 'Pay over time',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'ideal',\n rail: 'redirect',\n paymentMethod: 'bank_redirect',\n paymentMethodType: 'ideal',\n requiresBillingCountry: false,\n defaultLabel: 'iDEAL',\n defaultSublabel: 'Pay from your bank',\n defaultCategory: 'bank_redirect',\n defaultIcon: 'bank',\n },\n {\n key: 'alipay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'ali_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Alipay',\n defaultSublabel: 'Pay with Alipay',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'revolut_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'revolut_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Revolut Pay',\n defaultSublabel: 'Pay with Revolut',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'amazon_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'amazon_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Amazon Pay',\n defaultSublabel: 'Pay with Amazon',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n];\n\n/**\n * {@link STRIPE_FALLBACK_PANE_METHODS} in the shape the live endpoint returns,\n * so every helper below takes one type of catalogue and the degradation path\n * is not a second code path. Derived, not written out: two spellings of one\n * table is exactly the drift this design removes.\n */\nexport const STRIPE_FALLBACK_PANE_CATALOG: PanesConnectorCatalog = {\n connector: 'stripe',\n allowed_rails: ['wallet', 'redirect'],\n methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({\n key: info.key,\n rail: info.rail,\n payment_method: info.paymentMethod,\n payment_method_type: info.paymentMethodType,\n requires_billing_country: info.requiresBillingCountry,\n })),\n};\n\n/**\n * An empty catalogue — a connector the router does not offer panes for.\n * Exported so callers can express \"asked, and the answer was no\" without\n * reaching for `null` in the middle of a computation.\n */\nexport function emptyPaneCatalog(connector: string): PanesConnectorCatalog {\n return { connector, allowed_rails: [], methods: [] };\n}\n\n/**\n * Pull one connector's entry out of a `connectors.getPanesCatalog()` response.\n *\n * Returns {@link emptyPaneCatalog} for a connector the response does not name:\n * \"the router knows this connector and publishes no panes for it\" and \"the\n * router has never heard of it\" are the same answer to a caller building an\n * editor, and both mean \"offer nothing\".\n */\nexport function paneCatalogFor(\n response: PanesCatalogResponse,\n connector: string,\n): PanesConnectorCatalog {\n return (\n response.connectors.find((entry) => entry.connector === connector) ??\n emptyPaneCatalog(connector)\n );\n}\n\n/**\n * Built-in tile icon keys the buyer-facing checkout ships a glyph for.\n *\n * Reconciled against both ends: every key here has a branch in the checkout's\n * `NativePaneIcon.svelte`, and every `default_icon` the router's catalogue\n * publishes is in this list. An icon key the checkout does not ship falls\n * through to `wallet` there, so a key that drifts in renders as the wrong\n * glyph rather than as nothing.\n */\nexport const PANE_ICON_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n // Brand marks, not category glyphs: the checkout draws PayPal's monogram,\n // Klarna's squircle-K and the Bitcoin mark for these, the same logos the\n // bespoke panes they replace already drew. Listed here so a merchant's own\n // dashboard can offer them; the router decides which one a tile *defaults*\n // to, and a router predating them simply keeps sending the old default.\n 'paypal',\n 'klarna',\n 'crypto',\n];\n\n/**\n * Section keys a pane's tile may group under.\n *\n * Reconciled against the router's actual `default_category` values rather than\n * against what the Stripe table happened to need. `crypto` and `game_items`\n * are router defaults (the Cryptomus/NowPayments and Skinsback catalogues) and\n * were missing here, so a merchant configuring one of those panes was shown a\n * category their editor did not recognise.\n *\n * A custom value is allowed and renders as its own section under that literal\n * text. The buyer-facing checkout translates a subset of these into a section\n * header and falls through to the raw key for the rest — `crypto` and\n * `game_items` are the two it has yet to add.\n */\nexport const PANE_CATEGORY_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bnpl',\n 'bank_redirect',\n 'bank_transfer',\n 'crypto',\n 'game_items',\n 'cash',\n];\n\n/**\n * Mirror of the router's per-connector cap. Counted differently on each side:\n * {@link decodePanes} stops after 12 *decoded* rows (entries with a usable,\n * non-duplicate `method` — junk and duplicate entries don't consume a slot),\n * while the router caps *accepted* panes (enabled, known, deduplicated) at 12\n * — so an oversized hand-written blob may render a pane this decoder drops.\n * Blobs the SDK itself encodes never exceed the cap.\n */\nexport const PANES_MAX = 12;\n\n/**\n * Look a method up in one connector's catalogue.\n *\n * Pass the entry for the connector being configured, from\n * `connectors.getPanesCatalog()` via {@link paneCatalogFor}. The default is\n * the degradation path and only correct for Stripe on a router that predates\n * the endpoint — see {@link STRIPE_FALLBACK_PANE_CATALOG}.\n */\nexport function paneMethodInfo(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneCapability | undefined {\n return catalog.methods.find((info) => info.key === method);\n}\n\n/** Whether this connector may declare a pane on `rail` at all. A wallet pane\n * on a connector outside its `allowed_rails` is refused at save time — the\n * wallet rail rides on Stripe's Express Checkout Element charging the *same*\n * payment intent the embedded checkout holds, which does not generalise. */\nexport function paneRailAllowed(rail: PaneRail, catalog: PanesConnectorCatalog): boolean {\n return catalog.allowed_rails.includes(rail);\n}\n\n/**\n * The methods a caller may actually offer for this connector: the catalogue's\n * own list, minus anything on a rail the connector does not allow.\n *\n * The router should not report such a pair in the first place, but the two\n * fields are independent in the response and a save that crosses them is\n * refused at the API with an error naming the connector and the method. Filter\n * rather than trust, so a merchant never configures a tile the save will\n * bounce.\n */\nexport function offerablePaneMethods(catalog: PanesConnectorCatalog): PaneCapability[] {\n return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));\n}\n\n/** Non-copy display defaults for a tile: which built-in glyph and which\n * section heading a new pane starts on. */\nexport interface PaneDisplayDefaults {\n icon: string;\n category: string;\n}\n\n/**\n * Per-method overrides, for the handful whose brand glyph is not what their\n * payment method would suggest. Everything else is derived from the catalogue\n * entry's `payment_method` below, so a connector the SDK has never heard of\n * still gets a sensible tile rather than a blank one.\n *\n * These have to be keyed by method and not by `payment_method`: `wallet` also\n * routes Link, Alipay, Revolut Pay and Amazon Pay, and `pay_later` also routes\n * Affirm — none of which the SDK has a mark for. Getting this wrong is not a\n * cosmetic slip that the next release fixes, because {@link defaultPane}\n * materialises the value and {@link encodePanes} writes it to\n * `metadata.native_panes`, where a stored `icon` outranks the router's\n * `default_icon` for the life of the pane.\n */\nconst DISPLAY_DEFAULTS_BY_KEY: Readonly<Record<string, PaneDisplayDefaults>> = {\n apple_pay: { icon: 'apple', category: 'wallet' },\n google_pay: { icon: 'google', category: 'wallet' },\n paypal: { icon: 'paypal', category: 'wallet' },\n // Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on\n // the generic `bnpl` glyph — same rail, no mark of its own.\n klarna: { icon: 'klarna', category: 'bnpl' },\n};\n\n/**\n * Derived from the `payment_method` half of the catalogue's routing pair.\n * Every value here reproduces the router's own `default_icon` /\n * `default_category` for the methods it publishes today, so a tile the SDK\n * lays out and a tile the router lays out agree.\n */\nconst DISPLAY_DEFAULTS_BY_PAYMENT_METHOD: Readonly<Record<string, PaneDisplayDefaults>> = {\n wallet: { icon: 'wallet', category: 'wallet' },\n card: { icon: 'card', category: 'card' },\n card_redirect: { icon: 'card', category: 'card' },\n pay_later: { icon: 'bnpl', category: 'bnpl' },\n bank_redirect: { icon: 'bank', category: 'bank_redirect' },\n bank_transfer: { icon: 'bank', category: 'bank_transfer' },\n bank_debit: { icon: 'bank', category: 'bank_transfer' },\n // Cryptomus and NowPayments publish the same `crypto` key on this rail, and\n // the router defaults both to the Bitcoin mark.\n crypto: { icon: 'crypto', category: 'crypto' },\n // Skinsback, which has no mark: the router defaults it to `wallet` too.\n game_items: { icon: 'wallet', category: 'game_items' },\n cash: { icon: 'cash', category: 'cash' },\n voucher: { icon: 'cash', category: 'cash' },\n};\n\nconst DISPLAY_DEFAULTS_FALLBACK: PaneDisplayDefaults = { icon: 'wallet', category: 'wallet' };\n\n/**\n * What a new tile looks like before the merchant designs it.\n *\n * The router serves capability, not presentation, so the glyph and the section\n * come from here and the accompanying text comes from the caller's own locale\n * files. A method with no entry at all still resolves — that is the point of\n * deriving from `payment_method`: a connector added to the router's catalogue\n * tomorrow needs no SDK release to be designable today.\n */\nexport function paneDisplayDefaults(info: PaneCapability | undefined): PaneDisplayDefaults {\n if (!info) return DISPLAY_DEFAULTS_FALLBACK;\n return (\n DISPLAY_DEFAULTS_BY_KEY[info.key] ??\n DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ??\n DISPLAY_DEFAULTS_FALLBACK\n );\n}\n\n// --- Validation ---------------------------------------------------------\n\n/**\n * Why a configured pane would not survive a save or a render.\n *\n * - `method_unknown` — the connector's catalogue does not publish this key, so\n * the router drops the row at render.\n * - `rail_not_allowed` — the method's rail is not in the connector's\n * `allowed_rails`; the API refuses this at save time.\n * - `over_cap` — past the router's per-connector cap of {@link PANES_MAX}; the\n * row is stored but never rendered.\n * - `duplicate_method` — an earlier enabled row already claims this method.\n * The router skips disabled rows and then dedupes, so the first *enabled*\n * row renders and every later one is dropped in silence. Reported on the\n * losing rows, never on the one that survives.\n */\nexport type PaneIssueCode = 'method_unknown' | 'rail_not_allowed' | 'over_cap' | 'duplicate_method';\n\nexport interface PaneIssue {\n /** Index into the list handed to {@link validatePanes}. */\n index: number;\n method: string;\n code: PaneIssueCode;\n}\n\n/**\n * Check a configured list against one connector's catalogue, before writing it\n * to `metadata.native_panes`.\n *\n * The API applies the same rules at save time, so this changes where the\n * merchant finds out, not whether they do — and an SDK caller building an\n * editor would otherwise learn it from a bounced request with no row to point\n * at. An empty result means nothing here will be refused or silently dropped.\n */\nexport function validatePanes(\n panes: readonly Pane[],\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneIssue[] {\n const issues: PaneIssue[] = [];\n // Keyed on the catalogue's own key rather than the raw string, because that\n // is what the router dedupes on. Only enabled rows are recorded: a disabled\n // row never reaches the router's `seen` set, so it neither claims a method\n // nor loses to one.\n const claimedBy = new Set<string>();\n panes.forEach((pane, index) => {\n const info = paneMethodInfo(pane.method, catalog);\n if (!info) {\n issues.push({ index, method: pane.method, code: 'method_unknown' });\n } else if (!paneRailAllowed(info.rail, catalog)) {\n issues.push({ index, method: pane.method, code: 'rail_not_allowed' });\n } else if (pane.enabled) {\n // Unknown and rail-refused rows are dropped before the router dedupes,\n // so they cannot claim a key — and reporting two codes for one row would\n // point the merchant at the wrong repair.\n if (claimedBy.has(info.key)) {\n issues.push({ index, method: pane.method, code: 'duplicate_method' });\n } else {\n claimedBy.add(info.key);\n }\n }\n if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: 'over_cap' });\n });\n return issues;\n}\n\n// --- Codec --------------------------------------------------------------\n\n/**\n * A new pane for `method`, with its glyph and section resolved from the\n * connector's catalogue entry rather than from a Stripe-keyed table — so\n * `defaultPane('creem_checkout', catalog)` is a designed tile and not a blank\n * one.\n *\n * Pass the catalogue entry for the connector being configured; the default is\n * the degradation path (see {@link STRIPE_FALLBACK_PANE_CATALOG}). Labels are\n * deliberately left empty: empty means \"use the catalogue default\", which the\n * router resolves at render, and the router ships no copy for a caller to\n * mirror.\n */\nexport function defaultPane(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): Pane {\n const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));\n return {\n method,\n enabled: true,\n label: '',\n labelTranslations: {},\n sublabel: null,\n sublabelTranslations: {},\n category: defaults.category,\n icon: defaults.icon,\n iconSvg: '',\n displayOrder: 0,\n visibility: 'always',\n openIn: 'tab',\n nativeElement: 'everywhere',\n preset: '',\n style: '',\n };\n}\n\nexport function clonePane(pane: Pane): Pane {\n return {\n ...pane,\n labelTranslations: { ...pane.labelTranslations },\n sublabelTranslations: { ...pane.sublabelTranslations },\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseTranslations(raw: unknown): Record<string, string> {\n if (!isObject(raw)) return {};\n const out: Record<string, string> = {};\n for (const [locale, value] of Object.entries(raw)) {\n if (typeof value === 'string' && value.length > 0) out[locale] = value;\n }\n return out;\n}\n\nfunction str(raw: unknown): string {\n return typeof raw === 'string' ? raw : '';\n}\n\n// `display_order` is a 32-bit signed integer on the wire, and a\n// fractional or out-of-range value fails its strict row decode — dropping the\n// whole row server-side while an SDK round-trip would keep the blob looking\n// healthy. Clamped on BOTH decode and encode so this codec never emits a\n// value the router rejects, regardless of where the number came from.\nconst DISPLAY_ORDER_MIN = -2147483648;\nconst DISPLAY_ORDER_MAX = 2147483647;\n\nfunction clampDisplayOrder(raw: number): number {\n if (!Number.isFinite(raw)) return 0;\n return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));\n}\n\n/**\n * Decode the stored `metadata.native_panes` blob into editor rows.\n *\n * Tolerant like the branding codecs: anything malformed falls back per\n * property, rows without a usable `method` are dropped, duplicates keep the\n * first occurrence — except that an enabled row wins over an earlier disabled\n * one for the same method, because that is the row the router renders — and\n * decoding stops after {@link PANES_MAX} decoded rows (dropped junk/duplicate\n * entries don't consume a slot). That is more forgiving than the router, which\n * drops a strict-decode-failing row whole (keeping the rest) and caps accepted\n * panes rather than decoded rows — see {@link Pane} and {@link PANES_MAX}.\n * Returns `null` when the input is not an array so the caller can distinguish\n * \"never configured\" from \"cleared\".\n */\nexport function decodePanes(raw: unknown): Pane[] | null {\n if (!Array.isArray(raw)) return null;\n const decodeRow = (entry: Record<string, unknown>, method: string): Pane => ({\n method,\n enabled: entry['enabled'] !== false,\n label: str(entry['label']),\n labelTranslations: parseTranslations(entry['label_translations']),\n sublabel: typeof entry['sublabel'] === 'string' ? entry['sublabel'] : null,\n sublabelTranslations: parseTranslations(entry['sublabel_translations']),\n category: str(entry['category']),\n icon: str(entry['icon']),\n iconSvg: str(entry['icon_svg']),\n displayOrder: clampDisplayOrder(Number(entry['display_order'])),\n // Anything unrecognised degrades to `always` rather than dropping the row.\n visibility: parseVisibility(entry['visibility']),\n // Same tolerance: an unknown value degrades to the default `tab`.\n openIn: parseOpenTarget(entry['open_in']),\n nativeElement: parseNativeElement(entry['native_element']),\n preset: str(entry['preset']),\n style: str(entry['style']),\n });\n\n const indexByMethod = new Map<string, number>();\n const out: Pane[] = [];\n for (const entry of raw) {\n if (out.length >= PANES_MAX) break;\n if (!isObject(entry)) continue;\n const method = str(entry['method']).trim();\n if (!method) continue;\n const kept = indexByMethod.get(method);\n if (kept !== undefined) {\n // Duplicate method. Keep the row the ROUTER would render: it skips\n // disabled rows BEFORE deduping, so where a blob\n // holds both a disabled and an enabled row for one method, buyers see\n // the enabled one. Keeping the disabled row here would show the merchant\n // a pane that is off while it is live, and persist that on the next save.\n const enabled = entry['enabled'] !== false;\n const existing = out[kept];\n if (enabled && existing && !existing.enabled) out[kept] = decodeRow(entry, method);\n continue;\n }\n indexByMethod.set(method, out.length);\n out.push(decodeRow(entry, method));\n }\n return out;\n}\n\n/**\n * Encode editor rows back into the snake_case blob the connector account\n * stores. Empty optional strings are omitted so the metadata stays small and a\n * merchant who typed nothing round-trips as \"use the catalogue default\" rather\n * than as an explicit empty override.\n *\n * `sublabel` is the exception: an explicitly-empty value is preserved (as `\"\"`)\n * because that is how a merchant hides the second line.\n */\nexport function encodePanes(panes: Pane[]): Record<string, unknown>[] {\n const nonEmpty = (map: Record<string, string>): Record<string, string> | undefined => {\n const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n };\n return panes.slice(0, PANES_MAX).map((pane) => {\n const labelTranslations = nonEmpty(pane.labelTranslations);\n const sublabelTranslations = nonEmpty(pane.sublabelTranslations);\n return {\n method: pane.method,\n enabled: pane.enabled,\n ...(pane.label.trim() ? { label: pane.label.trim() } : {}),\n ...(labelTranslations ? { label_translations: labelTranslations } : {}),\n // `null` omits the key entirely (catalogue default wins); `''` is sent\n // as-is because that is how the merchant hides the second line.\n ...(pane.sublabel !== null ? { sublabel: pane.sublabel } : {}),\n ...(sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {}),\n ...(pane.category.trim() ? { category: pane.category.trim() } : {}),\n ...(pane.icon.trim() ? { icon: pane.icon.trim() } : {}),\n ...(pane.iconSvg.trim() ? { icon_svg: pane.iconSvg.trim() } : {}),\n // Clamped on encode too, not only decode: the router's strict i32 row\n // decode drops a row whole for a fractional or out-of-range value, so\n // writing e.g. 3.5 or Date.now() verbatim would silently delete the\n // pane at render while every read surface shows it healthy.\n display_order: clampDisplayOrder(pane.displayOrder),\n // Normalised on encode for the same reason `display_order` is clamped:\n // the router's strict row decode drops a row whole on a value outside\n // its enum, and a caller who built a `Pane` by hand (or in plain JS)\n // never went through `decodePanes`. A decoded pane always holds a valid\n // value, so this is a no-op on the round-trip path.\n visibility: parseVisibility(pane.visibility),\n open_in: parseOpenTarget(pane.openIn),\n // Omitted at the default: `everywhere` is what the router decodes an\n // absent key to, so leaving it out changes nothing — and keeps a blob\n // stored before the field existed byte-identical on re-encode, which\n // is what the wire-compatibility test pins.\n ...(parseNativeElement(pane.nativeElement) === 'everywhere'\n ? {}\n : { native_element: parseNativeElement(pane.nativeElement) }),\n // Absent and blank both mean \"no look\": a pane shaped before the fields\n // existed encodes exactly as it always did.\n ...((pane.preset ?? '').trim() ? { preset: (pane.preset ?? '').trim() } : {}),\n ...((pane.style ?? '').trim() ? { style: (pane.style ?? '').trim() } : {}),\n };\n });\n}\n\n// --- Focused checkout URL ----------------------------------------------\n\n/**\n * A payment link id the hosted checkout serves on its own, as\n * `/pay/{payment_link_id}`: the lowercase, hyphenated UUID the API issues.\n */\nconst OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport interface FocusedCheckoutUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /**\n * The payment's `payment_link.payment_link_id`. When it is the opaque id the\n * API issues (a lowercase, hyphenated UUID), the link is\n * `/pay/{payment_link_id}`, which names neither the merchant nor the\n * payment. Omitted, or an older `plink_` id, keeps\n * `/pay/{merchantId}/{paymentId}`, which the checkout still serves.\n */\n paymentLinkId?: string | null;\n /** Pane method key to focus on (`apple_pay`, `klarna`, …). */\n method: string;\n /**\n * Connector that owns the tile, forwarded as `connector=`.\n *\n * A bare `pane=` resolves to the **first payable match in server-sorted\n * order**, which is unambiguous only while one connector publishes a given\n * key. Stripe publishes `klarna` and so does the Klarna connector, so a deep\n * link that names neither charges through whichever tile happens to sort\n * first. Name the connector whenever you know it.\n *\n * Optional because links minted before this parameter existed are already in\n * merchants' pages and still have to resolve.\n */\n connector?: string;\n /**\n * Merchant connector ACCOUNT that owns the tile, forwarded as `mca=`.\n *\n * Needed for the same reason `connector` is, one level down: a profile may\n * hold two enabled accounts of one connector, each publishing its own tile,\n * and the two links would otherwise be identical. Only meaningful alongside\n * `connector`.\n */\n merchantConnectorId?: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n /**\n * Set when the merchant's checkout-custom-field answers are already\n * persisted on the payment — forwarded as `cf=1` so the focused view skips\n * asking a second time. Purely a UI hint: the values live on the intent\n * either way, and the backend only accepts the merchant's configured field\n * keys from a client, so a wrongly-set flag can at worst skip an\n * informational prompt. This is the same hint the embedded pane sets when\n * it opens the focused view.\n */\n customFieldsCollected?: boolean;\n}\n\n/**\n * Build the link to the **focused single-method checkout**: the DeloPay hosted\n * checkout rendered with one payment method, one button, no picker.\n *\n * Two callers:\n * - the embedded checkout, which opens this in a new tab when a buyer clicks\n * a pane tile, and\n * - a merchant running their own checkout, who puts it behind their own\n * button — the same mechanism without an iframe.\n *\n * `method` is not limited to configured panes. A configured pane gets the\n * focused one-button view; `card`, `paypal`, `crypto_currency` and the\n * local-methods catalogs (by method key or vendor code) open the checkout\n * pinned to that method. Methods that exist only as a tab inside a connector's\n * own embedded form — iDEAL, Bancontact, P24 and the like, unless promoted to\n * a pane — cannot be isolated, because the connector owns that surface. An\n * unknown or unavailable method is never a dead end: the checkout shows a\n * notice with a visible \"show all payment methods\" action.\n *\n * Pass {@link FocusedCheckoutUrlParams.connector} (and\n * {@link FocusedCheckoutUrlParams.merchantConnectorId}) whenever you know\n * them. Without them the method key alone picks the first payable match, and\n * more than one connector can publish the same key. Omitting them produces\n * exactly the URL this function has always produced, so links already minted\n * are unaffected.\n *\n * Open it **at the top level** (a new tab or a full-page navigation). The whole\n * point is that the top-level domain is the registered payment method domain;\n * rendering it in an iframe puts you back where you started.\n *\n * If you open it with `window.open`, call that **synchronously inside the click\n * handler** or the popup blocker will eat it, and make sure any iframe you\n * render DeloPay in permits popups (`allow-popups`, plus\n * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).\n */\nexport function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ pane: params.method });\n // Parameter order matches the embedded checkout's own `focusedUrl`\n // (`NativePanesPane.svelte`), so a merchant's deep link and a tile click\n // produce the same string for the same tile. A blank value is treated as\n // absent rather than emitted empty: `connector=` would otherwise read as a\n // connector named \"\" instead of as \"not specified\".\n const connector = params.connector?.trim();\n if (connector) query.set('connector', connector);\n const merchantConnectorId = params.merchantConnectorId?.trim();\n if (merchantConnectorId) query.set('mca', merchantConnectorId);\n if (params.locale) query.set('locale', params.locale);\n if (params.customFieldsCollected) query.set('cf', '1');\n return `${path}?${query.toString()}`;\n}\n\n// --- Checkout entries --------------------------------------------------\n\nexport interface CheckoutEntryUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /** The payment's `payment_link.payment_link_id`; see {@link FocusedCheckoutUrlParams.paymentLinkId}. */\n paymentLinkId?: string | null;\n /** The entry's `key`, as configured on the shop (`CheckoutEntry.key`). */\n entry: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n}\n\n/**\n * The link to one of the shop's **checkout entries** for a payment: the hosted\n * checkout with `?entry=<key>`, showing only that entry's methods in its\n * named look. Every entry of one payment charges the same payment, so the\n * buyer can move between them and still pays once.\n *\n * A `card` entry is meant for an iframe in your own page\n * (`<iframe src={checkoutEntryUrl(...)} allow=\"payment\">`, with your page's\n * origin in the shop's iframe origins). Its \"Other payment methods\" action\n * opens the entry the shop configured in a new tab, and also posts\n * {@link CheckoutOpenEntryMessage} to your page, so you can navigate yourself\n * instead. Give a sandboxed iframe `allow-popups` and\n * `allow-popups-to-escape-sandbox`, or the tab is refused and the buyer gets\n * a plain link. Open a `methods` entry at the top level.\n *\n * An entry key the shop does not have, and an entry with nothing for this\n * payment, show an explanation and no methods: an entry never falls back to\n * the full checkout.\n */\nexport function checkoutEntryUrl(params: CheckoutEntryUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ entry: params.entry.trim() });\n if (params.locale) query.set('locale', params.locale);\n return `${path}?${query.toString()}`;\n}\n\n/**\n * What an embedded card entry posts to your page when the buyer presses\n * \"Other payment methods\": the payment, the entry the shop configured and its\n * link. Sent only to the shop's iframe origins. `source` names the sending\n * checkout and follows the deployment's branding, so match on `type`.\n */\nexport interface CheckoutOpenEntryMessage {\n source: string;\n type: 'open_entry';\n payment_id: string;\n entry: string;\n url: string;\n}\n\n/** Whether a `message` event's `data` is a {@link CheckoutOpenEntryMessage}. */\nexport function isCheckoutOpenEntryMessage(data: unknown): data is CheckoutOpenEntryMessage {\n if (typeof data !== 'object' || data === null) return false;\n const message = data as Record<string, unknown>;\n return (\n message.type === 'open_entry' &&\n typeof message.source === 'string' &&\n typeof message.payment_id === 'string' &&\n typeof message.entry === 'string' &&\n typeof message.url === 'string'\n );\n}\n\n// --- Buyer-side checkout events ----------------------------------------\n\n/**\n * The closed vocabulary of buyer-side checkout events recorded on the payment's\n * status timeline. Written through\n * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized\n * with the payment's `client_secret` as a bearer token.\n *\n * The `native_pane_` prefix is the router's enum on the wire and does not move\n * with the rename — see the module header.\n */\nexport const CHECKOUT_EVENT_KINDS = [\n 'native_pane_selected',\n 'native_pane_tab_opened',\n 'native_pane_tab_blocked',\n 'native_pane_abandoned',\n 'native_pane_returned',\n 'checkout_cancelled',\n] as const;\n\nexport type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];\n\n// --- Deprecated aliases -------------------------------------------------\n//\n// The pre-0.109.0 names, kept so an external `@delopay/sdk` consumer upgrades\n// on their own schedule rather than on ours. **Scheduled for removal in\n// 0.112.0** — see CHANGELOG.md. Nothing in this repo uses them.\n\n/** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */\nexport type StripeNativePane = Pane;\n/** @deprecated Renamed to {@link PaneView}. Removed in 0.112.0. */\nexport type NativePaneView = PaneView;\n/** @deprecated Renamed to {@link PaneVisibility}. Removed in 0.112.0. */\nexport type NativePaneVisibility = PaneVisibility;\n/** @deprecated Renamed to {@link PaneOpenTarget}. Removed in 0.112.0. */\nexport type NativePaneOpenTarget = PaneOpenTarget;\n/** @deprecated Spelt {@link PaneNativeElement} on the SDK side. Removed in 0.112.0. */\nexport type NativePaneNativeElement = PaneNativeElement;\n/**\n * @deprecated Superseded by {@link PaneMethodInfo}. Removed in 0.112.0.\n *\n * Deliberately **not** an alias of `PaneMethodInfo`: that type gained three\n * required routing fields (`paymentMethod`, `paymentMethodType`,\n * `requiresBillingCountry`), and a consumer who wrote an object literal or a\n * function return against the 0.108 shape would stop compiling on a deprecated\n * name that promises the opposite. This stays the six fields that shape had.\n *\n * `PaneMethodInfo` is structurally assignable to it, so everything this SDK\n * hands back — including {@link nativePaneMethodInfo} — still satisfies it.\n */\nexport interface NativePaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * @deprecated Renamed to {@link STRIPE_FALLBACK_PANE_METHODS}, which is a\n * degradation path and not a catalogue mirror. Removed in 0.112.0.\n */\nexport const STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;\n/** @deprecated Renamed to {@link PANE_ICON_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;\n/** @deprecated Renamed to {@link PANE_CATEGORY_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;\n/** @deprecated Renamed to {@link PANES_MAX}. Removed in 0.112.0. */\nexport const NATIVE_PANES_MAX = PANES_MAX;\n\n/**\n * @deprecated Superseded by {@link paneMethodInfo}, which takes the connector's\n * catalogue and answers for every connector rather than only for Stripe.\n * Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old return type: it answers out of the frozen Stripe table and carries that\n * table's compiled copy, which the live catalogue deliberately does not have.\n */\nexport function nativePaneMethodInfo(method: string): PaneMethodInfo | undefined {\n return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);\n}\n\n/**\n * @deprecated Superseded by {@link defaultPane}. Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old behaviour: it leaves `category` empty and resolves `icon` out of the\n * frozen Stripe table only. `defaultPane` fills both from the connector's\n * catalogue, which is the fix — but a caller on the old name encodes whatever\n * it is handed, and quietly turning a blank field into a stored override is\n * not something a deprecated alias should do to a merchant's saved config.\n */\nexport function defaultNativePane(method: string): Pane {\n const info = nativePaneMethodInfo(method);\n return {\n ...defaultPane(method),\n category: '',\n icon: info?.defaultIcon ?? '',\n };\n}\n\n/** @deprecated Renamed to {@link clonePane}. Removed in 0.112.0. */\nexport const cloneNativePane = clonePane;\n/** @deprecated Renamed to {@link decodePanes}. Removed in 0.112.0. */\nexport const decodeNativePanes = decodePanes;\n/** @deprecated Renamed to {@link encodePanes}. Removed in 0.112.0. */\nexport const encodeNativePanes = encodePanes;\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-0450/dist/chunk-YJQPKT6W.cjs","../src/panes.ts"],"names":[],"mappings":"AAAA;ACqEA,IAAM,kBAAA,EAA+C,CAAC,QAAA,EAAU,eAAA,EAAiB,eAAe,CAAA;AAMhG,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,OAAO,IAAA,IAAQ,QAAA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,EAAI,CAAC;AAAA,IAC1E,CAAA;AAAA,EACF,CAAC,CAAA;AACH;AAQA,IAAM,uBAAA,EAAyB,gEAAA;AAwFxB,SAAS,kBAAA,CAAmB,MAAA,EAA0C;AAC3E,EAAA,MAAM,KAAA,EAAO,MAAA,CAAO,eAAA,CAAgB,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AACtD,EAAA,MAAM,KAAA,EACJ,MAAA,CAAO,cAAA,GAAiB,sBAAA,CAAuB,IAAA,CAAK,MAAA,CAAO,aAAa,EAAA,EACpE,CAAA,EAAA;AAES,IAAA;AACR,EAAA;AACkD,EAAA;AAMhB,EAAA;AACM,EAAA;AACc,EAAA;AACA,EAAA;AACT,EAAA;AACC,EAAA;AACnB,EAAA;AACpC;AAoCyE;AACjB,EAAA;AAGhD,EAAA;AAES,IAAA;AACR,EAAA;AACyD,EAAA;AACZ,EAAA;AAClB,EAAA;AACpC;AAiB4F;AACpC,EAAA;AACtC,EAAA;AAIP,EAAA;AAIX;AAaoC;AAClC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACF;AAiD0C;AAEL;AAEI;AAET;AAWiD;AACT,EAAA;AACxE;AAYwD;AACd,EAAA;AACjC,EAAA;AACgB,IAAA;AACX,IAAA;AACiB,IAAA;AAC7B,EAAA;AACF;AAG+B;AAEE;AAEA;AD7sB2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-0450/dist/chunk-YJQPKT6W.cjs","sourcesContent":[null,"// **Payment panes** — merchant-configured payment methods that render as\n// DeloPay-drawn tiles in the embedded checkout instead of inside a connector's\n// own embedded form.\n//\n// Why they exist: Stripe only offers Apple Pay / Google Pay / Link when the\n// *top-level* document's domain is registered as a payment method domain on the\n// merchant's Stripe account. In an embedded iframe that domain is the\n// merchant's shop, not the DeloPay checkout — so the wallet silently\n// disappears. A pane replaces it with our own tile that opens the DeloPay\n// hosted checkout at the top level, in a focused single-method view.\n//\n// Nothing here is Apple-Pay-specific, and since the router published a\n// per-connector capability catalogue nothing here is Stripe-specific either:\n// the feature is \"which of a connector's payment methods render as a pane, and\n// how they look\".\n//\n// This module serves SDK consumers: merchants configuring\n// `metadata.native_panes` on a merchant connector account programmatically\n// (codec), reading the resolved `native_panes` off a checkout payload\n// ({@link PaneView}), or building the focused single-method link that goes\n// behind their own button ({@link focusedCheckoutUrl}).\n//\n// The wire shapes are owned by the API — `native_panes` in\n// the metadata key, the field names and the enum values are contracts with it\n// and with links already in buyers' hands, so the identifiers here were renamed\n// off \"native pane\" and the wire was not.\n//\n// Capability (which connector may publish which method, on which rail) comes\n// from the router at runtime through `connectors.getPanesCatalog()`, not from a\n// table here.\n\n// Type-only, so this module still emits no imports and can be executed\n// standalone. `types.ts` owns the catalogue's wire shapes because they are\n// generated-spec-paired (`scripts/validate-types.ts`); it imports nothing from\n// here, so the dependency runs one way.\nimport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n PaneNativeElement,\n} from './types';\n\nexport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n};\n\n// --- Wire types ---------------------------------------------------------\n\n/**\n * The values {@link decodePanes} recognises. Anything else — a value written by\n * a dashboard newer than this SDK — degrades to `always` rather than throwing\n * or dropping the row: an older SDK reading a newer blob is a normal state\n * during a rollout, and a hard failure there takes out a merchant's whole\n * connector config rather than one tile.\n */\nconst PANE_VISIBILITIES: readonly PaneVisibility[] = ['always', 'embedded_only', 'external_only'];\n\n/**\n * `same_page` and `popup` are kept as written; anything else — including the\n * absent key — is the default `tab`, as it always was.\n */\nfunction parseOpenTarget(raw: unknown): PaneOpenTarget {\n return raw === 'popup' || raw === 'same_page' ? raw : 'tab';\n}\n\nfunction parseVisibility(raw: unknown): PaneVisibility {\n return PANE_VISIBILITIES.find((value) => value === raw) ?? 'always';\n}\n\nconst PANE_NATIVE_ELEMENTS: readonly PaneNativeElement[] = [\n 'everywhere',\n 'embedded_only',\n 'external_only',\n];\n\n/**\n * Read a stored row's native-element choice, tolerantly.\n *\n * Absent decodes to `everywhere`, because that is what the router decodes a\n * missing key to (`admin::NativePaneNativeElement` defaults to it): a row\n * written before the field existed means \"the wallet's own button wherever\n * this pane is offered\", which is what the tile was always a stand-in for. An\n * unknown word degrades the same way rather than dropping the row — the\n * router's own decode is lenient for the same rolling-deploy reason.\n */\nfunction parseNativeElement(raw: unknown): PaneNativeElement {\n return PANE_NATIVE_ELEMENTS.find((value) => value === raw) ?? 'everywhere';\n}\n\n/**\n * One pane exactly as the merchant configures it. Persisted (JSON) under\n * `metadata.native_panes` on the merchant connector account.\n *\n * Field names are the wire contract — renaming one is a migration. The router\n * decodes strictly row by row: a row that fails strict decoding (e.g. a\n * wrong-typed field like `display_order: \"3\"`) is dropped whole with a server\n * log, and the remaining rows still render. This SDK's {@link decodePanes} is\n * additionally per-property tolerant — including clamping `display_order` into\n * the router's `i32` range — so a decode→encode round-trip through the SDK\n * repairs a blob the router would partially drop.\n */\nexport interface Pane {\n /** Catalogue key of the promoted method — see {@link paneMethodInfo}. */\n method: string;\n /** Disabled rows keep their tuning but never reach a buyer. */\n enabled: boolean;\n /** Default-language tile label. Empty falls back to the catalogue name. */\n label: string;\n /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */\n labelTranslations: Record<string, string>;\n /**\n * Secondary line under the label. `null` means \"use the catalogue default\";\n * an empty string means the merchant deliberately hid the line. That\n * distinction is the whole reason this is nullable and `label` is not.\n */\n sublabel: string | null;\n /** Per-locale overrides of `sublabel`. */\n sublabelTranslations: Record<string, string>;\n /** Section the tile groups under. Empty falls back to the catalogue category. */\n category: string;\n /** Built-in icon key — see {@link PANE_ICON_KEYS}. */\n icon: string;\n /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a\n * rejected payload falls back to the built-in `icon`. */\n iconSvg: string;\n /** Lower renders first; ties break on catalogue order. */\n displayOrder: number;\n /** Where the tile is offered — see {@link PaneVisibility}. */\n visibility: PaneVisibility;\n /** How the embedded checkout opens the focused view — see {@link PaneOpenTarget}. */\n openIn: PaneOpenTarget;\n /**\n * Where the wallet's own button replaces this tile — see\n * {@link PaneNativeElement}. Only meaningful on a method whose catalogue\n * entry says {@link PaneCapability.supports_native_element}; the router\n * ignores it elsewhere. `everywhere` is the default and what a row stored\n * before the field existed decodes to.\n */\n nativeElement: PaneNativeElement;\n /** A shipped look instead of the icon (`paypal`, `card`); `''` or absent = none.\n * Optional because a `Pane` built before the field existed must still encode. */\n preset?: string;\n /** The preset's style; `''` or absent = the preset's default. */\n style?: string;\n}\n\n/**\n * Read a resolved tile's placement rule, across every payload version.\n *\n * Prefer this to touching either field. They are independent on the wire — a\n * payload may carry either, both or neither — and each alone loses a placement\n * rule: `embedded_only` cannot express `external_only`, so an `external_only`\n * tile read through it renders inside the merchant iframe the merchant asked\n * to keep it out of; `visibility` is absent on a router that predates it, so\n * an `embedded_only` tile read through it alone renders at top level too,\n * duplicating a method Stripe's own form already offers there.\n *\n * A recognised `visibility` wins. Otherwise the legacy boolean answers: absent\n * (old router) it carries the only placement that router could express, and\n * unrecognised (newer router) the router still sets it under its own fixed\n * rule. Neither path throws, and both degrade toward showing a tile — losing a\n * placement rule, never stranding a method.\n */\nexport function paneViewVisibility(\n view: Pick<PaneView, 'visibility' | 'embedded_only'>,\n): PaneVisibility {\n const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);\n if (declared) return declared;\n return view.embedded_only === true ? 'embedded_only' : 'always';\n}\n\n// --- Catalogue ----------------------------------------------------------\n\n/**\n * A method the frozen Stripe fallback table knows, with the compiled copy the\n * router shipped for it at the time.\n *\n * Only {@link STRIPE_FALLBACK_PANE_METHODS} is typed with this. The live\n * catalogue (`connectors.getPanesCatalog()`) carries capability facts and no\n * copy at all, by design — see {@link PaneCapability}.\n */\nexport interface PaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethod: string;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethodType: string;\n /** The focused checkout has to collect a billing country to confirm this. */\n requiresBillingCountry: boolean;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * What this SDK assumes when the router cannot answer.\n *\n * The capability endpoint does not exist on an older router, which answers\n * `connectors.getPanesCatalog()` with a 404.\n * Rather than leaving a caller with nothing, the pane helpers default to\n * exactly the behaviour they had before that endpoint existed: panes on the\n * Stripe connector only, with the method set the router's Stripe catalogue had\n * at the time.\n *\n * **This is a degradation path, not a mirror. Do not keep it in sync by hand,\n * and do not add a connector or a method to it** — that is what this table was\n * before the capability endpoint, and adding to it would quietly rebuild the mirror. A\n * connector the router serves panes for arrives through the endpoint and needs\n * no entry here; a connector that needs an entry here to appear is a connector\n * the router will not deliver panes for anyway.\n *\n * The only reason to touch this list is to correct what Stripe's catalogue\n * looked like *before* the endpoint existed, and that is history, so there is\n * no such reason. Once the endpoint is reachable it is never consulted for a\n * connector the router answered for.\n *\n * The redirect-rail set is deliberately narrow — every entry is a variant the\n * Stripe connector accepts and that needs no extra buyer input beyond a\n * billing country. `eps` / `p24` / `bancontact` are absent because Stripe\n * hard-requires billing fields the focused checkout never collects (a full\n * name for EPS and Bancontact, an email for Przelewy24), so their tiles could\n * never succeed.\n *\n * `defaultLabel` / `defaultSublabel` are the copy the router compiled at that\n * time and are frozen with the rest of the table. Copy for a method the live\n * catalogue reports belongs to the consumer's own locale files, keyed by\n * `key` — the router ships none.\n */\nexport const STRIPE_FALLBACK_PANE_METHODS: readonly PaneMethodInfo[] = [\n {\n key: 'apple_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'apple_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Apple Pay',\n defaultSublabel: 'Pay with Apple Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'apple',\n },\n {\n key: 'google_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'google_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Google Pay',\n defaultSublabel: 'Pay with Google Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'google',\n },\n {\n key: 'link',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'link',\n requiresBillingCountry: false,\n defaultLabel: 'Link',\n defaultSublabel: 'Pay with saved details',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'klarna',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'klarna',\n // Stripe's Klarna needs the buyer's country echoed into the confirm body.\n requiresBillingCountry: true,\n defaultLabel: 'Klarna',\n // NOT the router's current \"Pay later or in 3 instalments\". This table is\n // what a router predating the capability endpoint renders, and that copy\n // only gained the \"3\" in the same release that added the endpoint.\n // Restating the new string here\n // would put copy no reachable router emits in front of a merchant, and\n // would change what the deprecated `nativePaneMethodInfo` has returned\n // since 0.106.0.\n defaultSublabel: 'Pay later or in instalments',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'affirm',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'affirm',\n requiresBillingCountry: false,\n defaultLabel: 'Affirm',\n defaultSublabel: 'Pay over time',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'ideal',\n rail: 'redirect',\n paymentMethod: 'bank_redirect',\n paymentMethodType: 'ideal',\n requiresBillingCountry: false,\n defaultLabel: 'iDEAL',\n defaultSublabel: 'Pay from your bank',\n defaultCategory: 'bank_redirect',\n defaultIcon: 'bank',\n },\n {\n key: 'alipay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'ali_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Alipay',\n defaultSublabel: 'Pay with Alipay',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'revolut_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'revolut_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Revolut Pay',\n defaultSublabel: 'Pay with Revolut',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'amazon_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'amazon_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Amazon Pay',\n defaultSublabel: 'Pay with Amazon',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n];\n\n/**\n * {@link STRIPE_FALLBACK_PANE_METHODS} in the shape the live endpoint returns,\n * so every helper below takes one type of catalogue and the degradation path\n * is not a second code path. Derived, not written out: two spellings of one\n * table is exactly the drift this design removes.\n */\nexport const STRIPE_FALLBACK_PANE_CATALOG: PanesConnectorCatalog = {\n connector: 'stripe',\n allowed_rails: ['wallet', 'redirect'],\n methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({\n key: info.key,\n rail: info.rail,\n payment_method: info.paymentMethod,\n payment_method_type: info.paymentMethodType,\n requires_billing_country: info.requiresBillingCountry,\n })),\n};\n\n/**\n * An empty catalogue — a connector the router does not offer panes for.\n * Exported so callers can express \"asked, and the answer was no\" without\n * reaching for `null` in the middle of a computation.\n */\nexport function emptyPaneCatalog(connector: string): PanesConnectorCatalog {\n return { connector, allowed_rails: [], methods: [] };\n}\n\n/**\n * Pull one connector's entry out of a `connectors.getPanesCatalog()` response.\n *\n * Returns {@link emptyPaneCatalog} for a connector the response does not name:\n * \"the router knows this connector and publishes no panes for it\" and \"the\n * router has never heard of it\" are the same answer to a caller building an\n * editor, and both mean \"offer nothing\".\n */\nexport function paneCatalogFor(\n response: PanesCatalogResponse,\n connector: string,\n): PanesConnectorCatalog {\n return (\n response.connectors.find((entry) => entry.connector === connector) ??\n emptyPaneCatalog(connector)\n );\n}\n\n/**\n * Built-in tile icon keys the buyer-facing checkout ships a glyph for.\n *\n * Reconciled against both ends: every key here has a branch in the checkout's\n * `NativePaneIcon.svelte`, and every `default_icon` the router's catalogue\n * publishes is in this list. An icon key the checkout does not ship falls\n * through to `wallet` there, so a key that drifts in renders as the wrong\n * glyph rather than as nothing.\n */\nexport const PANE_ICON_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n // Brand marks, not category glyphs: the checkout draws PayPal's monogram,\n // Klarna's squircle-K and the Bitcoin mark for these, the same logos the\n // bespoke panes they replace already drew. Listed here so a merchant's own\n // dashboard can offer them; the router decides which one a tile *defaults*\n // to, and a router predating them simply keeps sending the old default.\n 'paypal',\n 'klarna',\n 'crypto',\n];\n\n/**\n * Section keys a pane's tile may group under.\n *\n * Reconciled against the router's actual `default_category` values rather than\n * against what the Stripe table happened to need. `crypto` and `game_items`\n * are router defaults (the Cryptomus/NowPayments and Skinsback catalogues) and\n * were missing here, so a merchant configuring one of those panes was shown a\n * category their editor did not recognise.\n *\n * A custom value is allowed and renders as its own section under that literal\n * text. The buyer-facing checkout translates a subset of these into a section\n * header and falls through to the raw key for the rest — `crypto` and\n * `game_items` are the two it has yet to add.\n */\nexport const PANE_CATEGORY_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bnpl',\n 'bank_redirect',\n 'bank_transfer',\n 'crypto',\n 'game_items',\n 'cash',\n];\n\n/**\n * Mirror of the router's per-connector cap. Counted differently on each side:\n * {@link decodePanes} stops after 12 *decoded* rows (entries with a usable,\n * non-duplicate `method` — junk and duplicate entries don't consume a slot),\n * while the router caps *accepted* panes (enabled, known, deduplicated) at 12\n * — so an oversized hand-written blob may render a pane this decoder drops.\n * Blobs the SDK itself encodes never exceed the cap.\n */\nexport const PANES_MAX = 12;\n\n/**\n * Look a method up in one connector's catalogue.\n *\n * Pass the entry for the connector being configured, from\n * `connectors.getPanesCatalog()` via {@link paneCatalogFor}. The default is\n * the degradation path and only correct for Stripe on a router that predates\n * the endpoint — see {@link STRIPE_FALLBACK_PANE_CATALOG}.\n */\nexport function paneMethodInfo(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneCapability | undefined {\n return catalog.methods.find((info) => info.key === method);\n}\n\n/** Whether this connector may declare a pane on `rail` at all. A wallet pane\n * on a connector outside its `allowed_rails` is refused at save time — the\n * wallet rail rides on Stripe's Express Checkout Element charging the *same*\n * payment intent the embedded checkout holds, which does not generalise. */\nexport function paneRailAllowed(rail: PaneRail, catalog: PanesConnectorCatalog): boolean {\n return catalog.allowed_rails.includes(rail);\n}\n\n/**\n * The methods a caller may actually offer for this connector: the catalogue's\n * own list, minus anything on a rail the connector does not allow.\n *\n * The router should not report such a pair in the first place, but the two\n * fields are independent in the response and a save that crosses them is\n * refused at the API with an error naming the connector and the method. Filter\n * rather than trust, so a merchant never configures a tile the save will\n * bounce.\n */\nexport function offerablePaneMethods(catalog: PanesConnectorCatalog): PaneCapability[] {\n return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));\n}\n\n/** Non-copy display defaults for a tile: which built-in glyph and which\n * section heading a new pane starts on. */\nexport interface PaneDisplayDefaults {\n icon: string;\n category: string;\n}\n\n/**\n * Per-method overrides, for the handful whose brand glyph is not what their\n * payment method would suggest. Everything else is derived from the catalogue\n * entry's `payment_method` below, so a connector the SDK has never heard of\n * still gets a sensible tile rather than a blank one.\n *\n * These have to be keyed by method and not by `payment_method`: `wallet` also\n * routes Link, Alipay, Revolut Pay and Amazon Pay, and `pay_later` also routes\n * Affirm — none of which the SDK has a mark for. Getting this wrong is not a\n * cosmetic slip that the next release fixes, because {@link defaultPane}\n * materialises the value and {@link encodePanes} writes it to\n * `metadata.native_panes`, where a stored `icon` outranks the router's\n * `default_icon` for the life of the pane.\n */\nconst DISPLAY_DEFAULTS_BY_KEY: Readonly<Record<string, PaneDisplayDefaults>> = {\n apple_pay: { icon: 'apple', category: 'wallet' },\n google_pay: { icon: 'google', category: 'wallet' },\n paypal: { icon: 'paypal', category: 'wallet' },\n // Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on\n // the generic `bnpl` glyph — same rail, no mark of its own.\n klarna: { icon: 'klarna', category: 'bnpl' },\n};\n\n/**\n * Derived from the `payment_method` half of the catalogue's routing pair.\n * Every value here reproduces the router's own `default_icon` /\n * `default_category` for the methods it publishes today, so a tile the SDK\n * lays out and a tile the router lays out agree.\n */\nconst DISPLAY_DEFAULTS_BY_PAYMENT_METHOD: Readonly<Record<string, PaneDisplayDefaults>> = {\n wallet: { icon: 'wallet', category: 'wallet' },\n card: { icon: 'card', category: 'card' },\n card_redirect: { icon: 'card', category: 'card' },\n pay_later: { icon: 'bnpl', category: 'bnpl' },\n bank_redirect: { icon: 'bank', category: 'bank_redirect' },\n bank_transfer: { icon: 'bank', category: 'bank_transfer' },\n bank_debit: { icon: 'bank', category: 'bank_transfer' },\n // Cryptomus and NowPayments publish the same `crypto` key on this rail, and\n // the router defaults both to the Bitcoin mark.\n crypto: { icon: 'crypto', category: 'crypto' },\n // Skinsback, which has no mark: the router defaults it to `wallet` too.\n game_items: { icon: 'wallet', category: 'game_items' },\n cash: { icon: 'cash', category: 'cash' },\n voucher: { icon: 'cash', category: 'cash' },\n};\n\nconst DISPLAY_DEFAULTS_FALLBACK: PaneDisplayDefaults = { icon: 'wallet', category: 'wallet' };\n\n/**\n * What a new tile looks like before the merchant designs it.\n *\n * The router serves capability, not presentation, so the glyph and the section\n * come from here and the accompanying text comes from the caller's own locale\n * files. A method with no entry at all still resolves — that is the point of\n * deriving from `payment_method`: a connector added to the router's catalogue\n * tomorrow needs no SDK release to be designable today.\n */\nexport function paneDisplayDefaults(info: PaneCapability | undefined): PaneDisplayDefaults {\n if (!info) return DISPLAY_DEFAULTS_FALLBACK;\n return (\n DISPLAY_DEFAULTS_BY_KEY[info.key] ??\n DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ??\n DISPLAY_DEFAULTS_FALLBACK\n );\n}\n\n// --- Validation ---------------------------------------------------------\n\n/**\n * Why a configured pane would not survive a save or a render.\n *\n * - `method_unknown` — the connector's catalogue does not publish this key, so\n * the router drops the row at render.\n * - `rail_not_allowed` — the method's rail is not in the connector's\n * `allowed_rails`; the API refuses this at save time.\n * - `over_cap` — past the router's per-connector cap of {@link PANES_MAX}; the\n * row is stored but never rendered.\n * - `duplicate_method` — an earlier enabled row already claims this method.\n * The router skips disabled rows and then dedupes, so the first *enabled*\n * row renders and every later one is dropped in silence. Reported on the\n * losing rows, never on the one that survives.\n */\nexport type PaneIssueCode = 'method_unknown' | 'rail_not_allowed' | 'over_cap' | 'duplicate_method';\n\nexport interface PaneIssue {\n /** Index into the list handed to {@link validatePanes}. */\n index: number;\n method: string;\n code: PaneIssueCode;\n}\n\n/**\n * Check a configured list against one connector's catalogue, before writing it\n * to `metadata.native_panes`.\n *\n * The API applies the same rules at save time, so this changes where the\n * merchant finds out, not whether they do — and an SDK caller building an\n * editor would otherwise learn it from a bounced request with no row to point\n * at. An empty result means nothing here will be refused or silently dropped.\n */\nexport function validatePanes(\n panes: readonly Pane[],\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneIssue[] {\n const issues: PaneIssue[] = [];\n // Keyed on the catalogue's own key rather than the raw string, because that\n // is what the router dedupes on. Only enabled rows are recorded: a disabled\n // row never reaches the router's `seen` set, so it neither claims a method\n // nor loses to one.\n const claimedBy = new Set<string>();\n panes.forEach((pane, index) => {\n const info = paneMethodInfo(pane.method, catalog);\n if (!info) {\n issues.push({ index, method: pane.method, code: 'method_unknown' });\n } else if (!paneRailAllowed(info.rail, catalog)) {\n issues.push({ index, method: pane.method, code: 'rail_not_allowed' });\n } else if (pane.enabled) {\n // Unknown and rail-refused rows are dropped before the router dedupes,\n // so they cannot claim a key — and reporting two codes for one row would\n // point the merchant at the wrong repair.\n if (claimedBy.has(info.key)) {\n issues.push({ index, method: pane.method, code: 'duplicate_method' });\n } else {\n claimedBy.add(info.key);\n }\n }\n if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: 'over_cap' });\n });\n return issues;\n}\n\n// --- Codec --------------------------------------------------------------\n\n/**\n * A new pane for `method`, with its glyph and section resolved from the\n * connector's catalogue entry rather than from a Stripe-keyed table — so\n * `defaultPane('creem_checkout', catalog)` is a designed tile and not a blank\n * one.\n *\n * Pass the catalogue entry for the connector being configured; the default is\n * the degradation path (see {@link STRIPE_FALLBACK_PANE_CATALOG}). Labels are\n * deliberately left empty: empty means \"use the catalogue default\", which the\n * router resolves at render, and the router ships no copy for a caller to\n * mirror.\n */\nexport function defaultPane(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): Pane {\n const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));\n return {\n method,\n enabled: true,\n label: '',\n labelTranslations: {},\n sublabel: null,\n sublabelTranslations: {},\n category: defaults.category,\n icon: defaults.icon,\n iconSvg: '',\n displayOrder: 0,\n visibility: 'always',\n openIn: 'tab',\n nativeElement: 'everywhere',\n preset: '',\n style: '',\n };\n}\n\nexport function clonePane(pane: Pane): Pane {\n return {\n ...pane,\n labelTranslations: { ...pane.labelTranslations },\n sublabelTranslations: { ...pane.sublabelTranslations },\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseTranslations(raw: unknown): Record<string, string> {\n if (!isObject(raw)) return {};\n const out: Record<string, string> = {};\n for (const [locale, value] of Object.entries(raw)) {\n if (typeof value === 'string' && value.length > 0) out[locale] = value;\n }\n return out;\n}\n\nfunction str(raw: unknown): string {\n return typeof raw === 'string' ? raw : '';\n}\n\n// `display_order` is a 32-bit signed integer on the wire, and a\n// fractional or out-of-range value fails its strict row decode — dropping the\n// whole row server-side while an SDK round-trip would keep the blob looking\n// healthy. Clamped on BOTH decode and encode so this codec never emits a\n// value the router rejects, regardless of where the number came from.\nconst DISPLAY_ORDER_MIN = -2147483648;\nconst DISPLAY_ORDER_MAX = 2147483647;\n\nfunction clampDisplayOrder(raw: number): number {\n if (!Number.isFinite(raw)) return 0;\n return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));\n}\n\n/**\n * Decode the stored `metadata.native_panes` blob into editor rows.\n *\n * Tolerant like the branding codecs: anything malformed falls back per\n * property, rows without a usable `method` are dropped, duplicates keep the\n * first occurrence — except that an enabled row wins over an earlier disabled\n * one for the same method, because that is the row the router renders — and\n * decoding stops after {@link PANES_MAX} decoded rows (dropped junk/duplicate\n * entries don't consume a slot). That is more forgiving than the router, which\n * drops a strict-decode-failing row whole (keeping the rest) and caps accepted\n * panes rather than decoded rows — see {@link Pane} and {@link PANES_MAX}.\n * Returns `null` when the input is not an array so the caller can distinguish\n * \"never configured\" from \"cleared\".\n */\nexport function decodePanes(raw: unknown): Pane[] | null {\n if (!Array.isArray(raw)) return null;\n const decodeRow = (entry: Record<string, unknown>, method: string): Pane => ({\n method,\n enabled: entry['enabled'] !== false,\n label: str(entry['label']),\n labelTranslations: parseTranslations(entry['label_translations']),\n sublabel: typeof entry['sublabel'] === 'string' ? entry['sublabel'] : null,\n sublabelTranslations: parseTranslations(entry['sublabel_translations']),\n category: str(entry['category']),\n icon: str(entry['icon']),\n iconSvg: str(entry['icon_svg']),\n displayOrder: clampDisplayOrder(Number(entry['display_order'])),\n // Anything unrecognised degrades to `always` rather than dropping the row.\n visibility: parseVisibility(entry['visibility']),\n // Same tolerance: an unknown value degrades to the default `tab`.\n openIn: parseOpenTarget(entry['open_in']),\n nativeElement: parseNativeElement(entry['native_element']),\n preset: str(entry['preset']),\n style: str(entry['style']),\n });\n\n const indexByMethod = new Map<string, number>();\n const out: Pane[] = [];\n for (const entry of raw) {\n if (out.length >= PANES_MAX) break;\n if (!isObject(entry)) continue;\n const method = str(entry['method']).trim();\n if (!method) continue;\n const kept = indexByMethod.get(method);\n if (kept !== undefined) {\n // Duplicate method. Keep the row the ROUTER would render: it skips\n // disabled rows BEFORE deduping, so where a blob\n // holds both a disabled and an enabled row for one method, buyers see\n // the enabled one. Keeping the disabled row here would show the merchant\n // a pane that is off while it is live, and persist that on the next save.\n const enabled = entry['enabled'] !== false;\n const existing = out[kept];\n if (enabled && existing && !existing.enabled) out[kept] = decodeRow(entry, method);\n continue;\n }\n indexByMethod.set(method, out.length);\n out.push(decodeRow(entry, method));\n }\n return out;\n}\n\n/**\n * Encode editor rows back into the snake_case blob the connector account\n * stores. Empty optional strings are omitted so the metadata stays small and a\n * merchant who typed nothing round-trips as \"use the catalogue default\" rather\n * than as an explicit empty override.\n *\n * `sublabel` is the exception: an explicitly-empty value is preserved (as `\"\"`)\n * because that is how a merchant hides the second line.\n */\nexport function encodePanes(panes: Pane[]): Record<string, unknown>[] {\n const nonEmpty = (map: Record<string, string>): Record<string, string> | undefined => {\n const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n };\n return panes.slice(0, PANES_MAX).map((pane) => {\n const labelTranslations = nonEmpty(pane.labelTranslations);\n const sublabelTranslations = nonEmpty(pane.sublabelTranslations);\n return {\n method: pane.method,\n enabled: pane.enabled,\n ...(pane.label.trim() ? { label: pane.label.trim() } : {}),\n ...(labelTranslations ? { label_translations: labelTranslations } : {}),\n // `null` omits the key entirely (catalogue default wins); `''` is sent\n // as-is because that is how the merchant hides the second line.\n ...(pane.sublabel !== null ? { sublabel: pane.sublabel } : {}),\n ...(sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {}),\n ...(pane.category.trim() ? { category: pane.category.trim() } : {}),\n ...(pane.icon.trim() ? { icon: pane.icon.trim() } : {}),\n ...(pane.iconSvg.trim() ? { icon_svg: pane.iconSvg.trim() } : {}),\n // Clamped on encode too, not only decode: the router's strict i32 row\n // decode drops a row whole for a fractional or out-of-range value, so\n // writing e.g. 3.5 or Date.now() verbatim would silently delete the\n // pane at render while every read surface shows it healthy.\n display_order: clampDisplayOrder(pane.displayOrder),\n // Normalised on encode for the same reason `display_order` is clamped:\n // the router's strict row decode drops a row whole on a value outside\n // its enum, and a caller who built a `Pane` by hand (or in plain JS)\n // never went through `decodePanes`. A decoded pane always holds a valid\n // value, so this is a no-op on the round-trip path.\n visibility: parseVisibility(pane.visibility),\n open_in: parseOpenTarget(pane.openIn),\n // Omitted at the default: `everywhere` is what the router decodes an\n // absent key to, so leaving it out changes nothing — and keeps a blob\n // stored before the field existed byte-identical on re-encode, which\n // is what the wire-compatibility test pins.\n ...(parseNativeElement(pane.nativeElement) === 'everywhere'\n ? {}\n : { native_element: parseNativeElement(pane.nativeElement) }),\n // Absent and blank both mean \"no look\": a pane shaped before the fields\n // existed encodes exactly as it always did.\n ...((pane.preset ?? '').trim() ? { preset: (pane.preset ?? '').trim() } : {}),\n ...((pane.style ?? '').trim() ? { style: (pane.style ?? '').trim() } : {}),\n };\n });\n}\n\n// --- Focused checkout URL ----------------------------------------------\n\n/**\n * A payment link id the hosted checkout serves on its own, as\n * `/pay/{payment_link_id}`: the lowercase, hyphenated UUID the API issues.\n */\nconst OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport interface FocusedCheckoutUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /**\n * The payment's `payment_link.payment_link_id`. When it is the opaque id the\n * API issues (a lowercase, hyphenated UUID), the link is\n * `/pay/{payment_link_id}`, which names neither the merchant nor the\n * payment. Omitted, or an older `plink_` id, keeps\n * `/pay/{merchantId}/{paymentId}`, which the checkout still serves.\n */\n paymentLinkId?: string | null;\n /** Pane method key to focus on (`apple_pay`, `klarna`, …). */\n method: string;\n /**\n * Connector that owns the tile, forwarded as `connector=`.\n *\n * A bare `pane=` resolves to the **first payable match in server-sorted\n * order**, which is unambiguous only while one connector publishes a given\n * key. Stripe publishes `klarna` and so does the Klarna connector, so a deep\n * link that names neither charges through whichever tile happens to sort\n * first. Name the connector whenever you know it.\n *\n * Optional because links minted before this parameter existed are already in\n * merchants' pages and still have to resolve.\n */\n connector?: string;\n /**\n * Merchant connector ACCOUNT that owns the tile, forwarded as `mca=`.\n *\n * Needed for the same reason `connector` is, one level down: a profile may\n * hold two enabled accounts of one connector, each publishing its own tile,\n * and the two links would otherwise be identical. Only meaningful alongside\n * `connector`.\n */\n merchantConnectorId?: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n /**\n * Set when the merchant's checkout-custom-field answers are already\n * persisted on the payment — forwarded as `cf=1` so the focused view skips\n * asking a second time. Purely a UI hint: the values live on the intent\n * either way, and the backend only accepts the merchant's configured field\n * keys from a client, so a wrongly-set flag can at worst skip an\n * informational prompt. This is the same hint the embedded pane sets when\n * it opens the focused view.\n */\n customFieldsCollected?: boolean;\n}\n\n/**\n * Build the link to the **focused single-method checkout**: the DeloPay hosted\n * checkout rendered with one payment method, one button, no picker.\n *\n * Two callers:\n * - the embedded checkout, which opens this in a new tab when a buyer clicks\n * a pane tile, and\n * - a merchant running their own checkout, who puts it behind their own\n * button — the same mechanism without an iframe.\n *\n * `method` is not limited to configured panes. A configured pane gets the\n * focused one-button view; `card`, `paypal`, `crypto_currency` and the\n * local-methods catalogs (by method key or vendor code) open the checkout\n * pinned to that method. Methods that exist only as a tab inside a connector's\n * own embedded form — iDEAL, Bancontact, P24 and the like, unless promoted to\n * a pane — cannot be isolated, because the connector owns that surface. An\n * unknown or unavailable method is never a dead end: the checkout shows a\n * notice with a visible \"show all payment methods\" action.\n *\n * Pass {@link FocusedCheckoutUrlParams.connector} (and\n * {@link FocusedCheckoutUrlParams.merchantConnectorId}) whenever you know\n * them. Without them the method key alone picks the first payable match, and\n * more than one connector can publish the same key. Omitting them produces\n * exactly the URL this function has always produced, so links already minted\n * are unaffected.\n *\n * Open it **at the top level** (a new tab or a full-page navigation). The whole\n * point is that the top-level domain is the registered payment method domain;\n * rendering it in an iframe puts you back where you started.\n *\n * If you open it with `window.open`, call that **synchronously inside the click\n * handler** or the popup blocker will eat it, and make sure any iframe you\n * render DeloPay in permits popups (`allow-popups`, plus\n * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).\n */\nexport function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ pane: params.method });\n // Parameter order matches the embedded checkout's own `focusedUrl`\n // (`NativePanesPane.svelte`), so a merchant's deep link and a tile click\n // produce the same string for the same tile. A blank value is treated as\n // absent rather than emitted empty: `connector=` would otherwise read as a\n // connector named \"\" instead of as \"not specified\".\n const connector = params.connector?.trim();\n if (connector) query.set('connector', connector);\n const merchantConnectorId = params.merchantConnectorId?.trim();\n if (merchantConnectorId) query.set('mca', merchantConnectorId);\n if (params.locale) query.set('locale', params.locale);\n if (params.customFieldsCollected) query.set('cf', '1');\n return `${path}?${query.toString()}`;\n}\n\n// --- Checkout entries --------------------------------------------------\n\nexport interface CheckoutEntryUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /** The payment's `payment_link.payment_link_id`; see {@link FocusedCheckoutUrlParams.paymentLinkId}. */\n paymentLinkId?: string | null;\n /** The entry's `key`, as configured on the shop (`CheckoutEntry.key`). */\n entry: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n}\n\n/**\n * The link to one of the shop's **checkout entries** for a payment: the hosted\n * checkout with `?entry=<key>`, showing only that entry's methods in its\n * named look. Every entry of one payment charges the same payment, so the\n * buyer can move between them and still pays once.\n *\n * A `card` entry is meant for an iframe in your own page\n * (`<iframe src={checkoutEntryUrl(...)} allow=\"payment\">`, with your page's\n * origin in the shop's iframe origins). Its \"Other payment methods\" action\n * opens the entry the shop configured in a new tab, and also posts\n * {@link CheckoutOpenEntryMessage} to your page, so you can navigate yourself\n * instead. Give a sandboxed iframe `allow-popups` and\n * `allow-popups-to-escape-sandbox`, or the tab is refused and the buyer gets\n * a plain link. Open a `methods` entry at the top level.\n *\n * An entry key the shop does not have, and an entry with nothing for this\n * payment, show an explanation and no methods: an entry never falls back to\n * the full checkout.\n */\nexport function checkoutEntryUrl(params: CheckoutEntryUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ entry: params.entry.trim() });\n if (params.locale) query.set('locale', params.locale);\n return `${path}?${query.toString()}`;\n}\n\n/**\n * What an embedded card entry posts to your page when the buyer presses\n * \"Other payment methods\": the payment, the entry the shop configured and its\n * link. Sent only to the shop's iframe origins. `source` names the sending\n * checkout and follows the deployment's branding, so match on `type`.\n */\nexport interface CheckoutOpenEntryMessage {\n source: string;\n type: 'open_entry';\n payment_id: string;\n entry: string;\n url: string;\n}\n\n/** Whether a `message` event's `data` is a {@link CheckoutOpenEntryMessage}. */\nexport function isCheckoutOpenEntryMessage(data: unknown): data is CheckoutOpenEntryMessage {\n if (typeof data !== 'object' || data === null) return false;\n const message = data as Record<string, unknown>;\n return (\n message.type === 'open_entry' &&\n typeof message.source === 'string' &&\n typeof message.payment_id === 'string' &&\n typeof message.entry === 'string' &&\n typeof message.url === 'string'\n );\n}\n\n// --- Buyer-side checkout events ----------------------------------------\n\n/**\n * The closed vocabulary of buyer-side checkout events recorded on the payment's\n * status timeline. Written through\n * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized\n * with the payment's `client_secret` as a bearer token.\n *\n * The `native_pane_` prefix is the router's enum on the wire and does not move\n * with the rename — see the module header.\n */\nexport const CHECKOUT_EVENT_KINDS = [\n 'native_pane_selected',\n 'native_pane_tab_opened',\n 'native_pane_tab_blocked',\n 'native_pane_abandoned',\n 'native_pane_returned',\n 'checkout_cancelled',\n] as const;\n\nexport type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];\n\n// --- Deprecated aliases -------------------------------------------------\n//\n// The pre-0.109.0 names, kept so an external `@delopay/sdk` consumer upgrades\n// on their own schedule rather than on ours. **Scheduled for removal in\n// 0.112.0** — see CHANGELOG.md. Nothing in this repo uses them.\n\n/** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */\nexport type StripeNativePane = Pane;\n/** @deprecated Renamed to {@link PaneView}. Removed in 0.112.0. */\nexport type NativePaneView = PaneView;\n/** @deprecated Renamed to {@link PaneVisibility}. Removed in 0.112.0. */\nexport type NativePaneVisibility = PaneVisibility;\n/** @deprecated Renamed to {@link PaneOpenTarget}. Removed in 0.112.0. */\nexport type NativePaneOpenTarget = PaneOpenTarget;\n/** @deprecated Spelt {@link PaneNativeElement} on the SDK side. Removed in 0.112.0. */\nexport type NativePaneNativeElement = PaneNativeElement;\n/**\n * @deprecated Superseded by {@link PaneMethodInfo}. Removed in 0.112.0.\n *\n * Deliberately **not** an alias of `PaneMethodInfo`: that type gained three\n * required routing fields (`paymentMethod`, `paymentMethodType`,\n * `requiresBillingCountry`), and a consumer who wrote an object literal or a\n * function return against the 0.108 shape would stop compiling on a deprecated\n * name that promises the opposite. This stays the six fields that shape had.\n *\n * `PaneMethodInfo` is structurally assignable to it, so everything this SDK\n * hands back — including {@link nativePaneMethodInfo} — still satisfies it.\n */\nexport interface NativePaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * @deprecated Renamed to {@link STRIPE_FALLBACK_PANE_METHODS}, which is a\n * degradation path and not a catalogue mirror. Removed in 0.112.0.\n */\nexport const STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;\n/** @deprecated Renamed to {@link PANE_ICON_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;\n/** @deprecated Renamed to {@link PANE_CATEGORY_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;\n/** @deprecated Renamed to {@link PANES_MAX}. Removed in 0.112.0. */\nexport const NATIVE_PANES_MAX = PANES_MAX;\n\n/**\n * @deprecated Superseded by {@link paneMethodInfo}, which takes the connector's\n * catalogue and answers for every connector rather than only for Stripe.\n * Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old return type: it answers out of the frozen Stripe table and carries that\n * table's compiled copy, which the live catalogue deliberately does not have.\n */\nexport function nativePaneMethodInfo(method: string): PaneMethodInfo | undefined {\n return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);\n}\n\n/**\n * @deprecated Superseded by {@link defaultPane}. Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old behaviour: it leaves `category` empty and resolves `icon` out of the\n * frozen Stripe table only. `defaultPane` fills both from the connector's\n * catalogue, which is the fix — but a caller on the old name encodes whatever\n * it is handed, and quietly turning a blank field into a stored override is\n * not something a deprecated alias should do to a merchant's saved config.\n */\nexport function defaultNativePane(method: string): Pane {\n const info = nativePaneMethodInfo(method);\n return {\n ...defaultPane(method),\n category: '',\n icon: info?.defaultIcon ?? '',\n };\n}\n\n/** @deprecated Renamed to {@link clonePane}. Removed in 0.112.0. */\nexport const cloneNativePane = clonePane;\n/** @deprecated Renamed to {@link decodePanes}. Removed in 0.112.0. */\nexport const decodeNativePanes = decodePanes;\n/** @deprecated Renamed to {@link encodePanes}. Removed in 0.112.0. */\nexport const encodeNativePanes = encodePanes;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w6pub/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA,EAIA,MAAM,WAAA,CACJ,IAAA,EACA,SAAA,EACA,OAAA,EACqC;AACrC,IAAA,MAAM,KAAA,EAAO,IAAI,QAAA,CAAS,CAAA;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,IAAI,CAAA;AACxB,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB;AAAA,MAC9C,IAAA,EAAM,IAAA;AAAA,MACN,GAAG,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,OAAO;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,M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A;AAAA;AAAA;AAAA;AAW6C,EAAA;AACY,IAAA;AAC/C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBwC,EAAA;AACgC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/w6pub/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-0450/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA,EAIA,MAAM,WAAA,CACJ,IAAA,EACA,SAAA,EACA,OAAA,EACqC;AACrC,IAAA,MAAM,KAAA,EAAO,IAAI,QAAA,CAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBqC,EAAA;AACmB,IAAA;AAC9C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAUyC,EAAA;AACa,IAAA;AACE,MAAA;AACnB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcwC,EAAA;AAC+B,IAAA;AAClC,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW6C,EAAA;AACY,IAAA;AAC/C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBwC,EAAA;AACgC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-0450/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}